Un-revert IPlayerManager refactor (#21244)

This commit is contained in:
Leon Friedrich
2023-10-28 09:59:53 +11:00
committed by GitHub
parent c55e1dcafd
commit e685cb626b
245 changed files with 781 additions and 943 deletions

View File

@@ -4,7 +4,6 @@ using Content.Shared.Administration;
using Content.Shared.Database;
using Content.Shared.CCVar;
using Content.Server.Chat.Managers;
using Robust.Server.Player;
using Robust.Shared.Configuration;
using Robust.Shared.Console;
@@ -21,18 +20,18 @@ public sealed class SetMotdCommand : LocalizedCommands
[Dependency] private readonly IConfigurationManager _configurationManager = default!;
public override string Command => "set-motd";
public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
string motd = "";
var player = (IPlayerSession?)shell.Player;
var player = shell.Player;
if (args.Length > 0)
{
motd = string.Join(" ", args).Trim();
if (player != null && _chatManager.MessageCharacterLimit(player, motd))
return; // check function prints its own error response
}
_configurationManager.SetCVar(CCVars.MOTD, motd); // A hook in MOTDSystem broadcasts changes to the MOTD to everyone so we don't need to do it here.
if (string.IsNullOrEmpty(motd))
{