Skip to content

cvar looc.enabled does not work as intended. #43244

@Minemoder5000

Description

@Minemoder5000

What version did the issue occur in?

No response

Description

Setting the cvar looc.enabled does not work midround, while setlooc does.
Additionally, setting the cvar to be disabled by default in the server's .toml causes an error on build and will crash if not on release.

Reproduction

  1. Start server
  2. cvar looc.enabled false
  3. deadmin
  4. Say something in LOOC
  5. You can still LOOC

Or

  1. Open server's .toml
  2. Add [looc] enabled = false
  3. Start server on debug or tools
  4. Server fails to start

Additionally

  1. Join server normally
  2. setlooc false
  3. cvar looc.enabled = true
  4. deadmin
  5. Use LOOC
  6. You cannot use LOOC

Additional Context

> [FATL] unhandled: System.NullReferenceException: Object reference not set to an instance of an object.
   at Content.Server.Chat.Managers.ChatManager.DispatchServerAnnouncement(String message, Nullable`1 colorOverride) in H:\Git Projects\space-station-14\Content.Server\Chat\Managers\ChatManager.cs:line 119
   at Content.Server.Chat.Systems.ChatSystem.OnLoocEnabledChanged(Boolean val) in H:\Git Projects\space-station-14\Content.Server\Chat\Systems\ChatSystem.cs:line 83
   at Robust.Shared.Configuration.ConfigurationManager.OnValueChanged[T](String name, Action`1 onValueChanged, Boolean invokeImmediately) in H:\Git Projects\space-station-14\RobustToolbox\Robust.Shared\Configuration\ConfigurationManager.cs:line 477
   at Robust.Shared.Configuration.ConfigurationManager.OnValueChanged[T](CVarDef`1 cVar, Action`1 onValueChanged, Boolean invokeImmediately) in H:\Git Projects\space-station-14\RobustToolbox\Robust.Shared\Configuration\ConfigurationManager.cs:line 460
   at Robust.Shared.GameObjects.EntitySystemSubscriptionExt.CVar[T](Subscriptions subs, IConfigurationManager cfg, CVarDef`1 cVar, Action`1 onValueChanged, Boolean invokeImmediately) in H:\Git Projects\space-station-14\RobustToolbox\Robust.Shared\GameObjects\EntitySystemSubscriptionExt.cs:line 66
   at Content.Server.Chat.Systems.ChatSystem.Initialize() in H:\Git Projects\space-station-14\Content.Server\Chat\Systems\ChatSystem.cs:line 71
   at Robust.Shared.GameObjects.EntitySystemManager.Initialize(Boolean discover) in H:\Git Projects\space-station-14\RobustToolbox\Robust.Shared\GameObjects\EntitySystemManager.cs:line 209
   at Robust.Shared.GameObjects.EntityManager.Startup() in H:\Git Projects\space-station-14\RobustToolbox\Robust.Shared\GameObjects\EntityManager.cs:line 235
   at Robust.Server.GameObjects.ServerEntityManager.Startup() in H:\Git Projects\space-station-14\RobustToolbox\Robust.Server\GameObjects\ServerEntityManager.cs:line 60
   at Robust.Server.BaseServer.Start(ServerOptions options, Func`1 logHandlerFactory) in H:\Git Projects\space-station-14\RobustToolbox\Robust.Server\BaseServer.cs:line 399
   at Robust.Server.Program.ParsedMain(CommandLineArgs args, Boolean contentStart, ServerOptions options) in H:\Git Projects\space-station-14\RobustToolbox\Robust.Server\Program.cs:line 64
   at Robust.Server.Program.Start(String[] args, ServerOptions options, Boolean contentStart) in H:\Git Projects\space-station-14\RobustToolbox\Robust.Server\Program.cs:line 42
   at Robust.Server.ContentStart.Start(String[] args) in H:\Git Projects\space-station-14\RobustToolbox\Robust.Server\ContentStart.cs:line 10
   at Content.Server.Program.Main(String[] args) in H:\Git Projects\space-station-14\Content.Server\Program.cs:line 9
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
   at Content.Server.Chat.Managers.ChatManager.DispatchServerAnnouncement(String message, Nullable`1 colorOverride) in H:\Git Projects\space-station-14\Content.Server\Chat\Managers\ChatManager.cs:line 119
   at Content.Server.Chat.Systems.ChatSystem.OnLoocEnabledChanged(Boolean val) in H:\Git Projects\space-station-14\Content.Server\Chat\Systems\ChatSystem.cs:line 83
   at Robust.Shared.Configuration.ConfigurationManager.OnValueChanged[T](String name, Action`1 onValueChanged, Boolean invokeImmediately) in H:\Git Projects\space-station-14\RobustToolbox\Robust.Shared\Configuration\ConfigurationManager.cs:line 477
   at Robust.Shared.Configuration.ConfigurationManager.OnValueChanged[T](CVarDef`1 cVar, Action`1 onValueChanged, Boolean invokeImmediately) in H:\Git Projects\space-station-14\RobustToolbox\Robust.Shared\Configuration\ConfigurationManager.cs:line 460
   at Robust.Shared.GameObjects.EntitySystemSubscriptionExt.CVar[T](Subscriptions subs, IConfigurationManager cfg, CVarDef`1 cVar, Action`1 onValueChanged, Boolean invokeImmediately) in H:\Git Projects\space-station-14\RobustToolbox\Robust.Shared\GameObjects\EntitySystemSubscriptionExt.cs:line 66
   at Content.Server.Chat.Systems.ChatSystem.Initialize() in H:\Git Projects\space-station-14\Content.Server\Chat\Systems\ChatSystem.cs:line 71
   at Robust.Shared.GameObjects.EntitySystemManager.Initialize(Boolean discover) in H:\Git Projects\space-station-14\RobustToolbox\Robust.Shared\GameObjects\EntitySystemManager.cs:line 209
   at Robust.Shared.GameObjects.EntityManager.Startup() in H:\Git Projects\space-station-14\RobustToolbox\Robust.Shared\GameObjects\EntityManager.cs:line 235
   at Robust.Server.GameObjects.ServerEntityManager.Startup() in H:\Git Projects\space-station-14\RobustToolbox\Robust.Server\GameObjects\ServerEntityManager.cs:line 60
   at Robust.Server.BaseServer.Start(ServerOptions options, Func`1 logHandlerFactory) in H:\Git Projects\space-station-14\RobustToolbox\Robust.Server\BaseServer.cs:line 399
   at Robust.Server.Program.ParsedMain(CommandLineArgs args, Boolean contentStart, ServerOptions options) in H:\Git Projects\space-station-14\RobustToolbox\Robust.Server\Program.cs:line 64
   at Robust.Server.Program.Start(String[] args, ServerOptions options, Boolean contentStart) in H:\Git Projects\space-station-14\RobustToolbox\Robust.Server\Program.cs:line 42
   at Robust.Server.ContentStart.Start(String[] args) in H:\Git Projects\space-station-14\RobustToolbox\Robust.Server\ContentStart.cs:line 10
   at Content.Server.Program.Main(String[] args) in H:\Git Projects\space-station-14\Content.Server\Program.cs:line 9

Metadata

Metadata

Assignees

No one assigned

    Labels

    D2: MediumDifficulty: A good amount of codebase knowledge required.Issue: ReplicatedThis issue has been replicated by another user.P2: RaisedPriority: Item has a raised priority, indicating it might get increased maintainer attention.T: BugfixType: Bugs and/or bugfixesT: Of Admin InterestType: Affects administration work a lot, and might require admins to weigh in on

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions