# Conflicts: # Content.Server/Administration/Systems/BwoinkSystem.cs # Content.Server/Chat/Managers/ChatManager.cs # Content.Server/Entry/EntryPoint.cs # Content.Server/GameTicking/GameTicker.RoundFlow.cs # Content.Server/IoC/ServerContentIoC.cs # Content.Server/RoundEnd/RoundEndSystem.cs # Content.Server/Shuttles/Systems/EmergencyShuttleSystem.Console.cs # Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs # Content.Shared/CCVar/CCVars.cs
44 lines
1.2 KiB
C#
44 lines
1.2 KiB
C#
using System.Linq;
|
|
using System.Net;
|
|
using System.Text;
|
|
using System.Text.Json;
|
|
using Content.Server.Administration.Managers;
|
|
using Content.Server.UtkaIntegration.TCP;
|
|
using Content.Shared.CCVar;
|
|
using Robust.Shared;
|
|
using Robust.Shared.Configuration;
|
|
|
|
namespace Content.Server.UtkaIntegration;
|
|
|
|
public sealed class UtkaAdminWhoCommand : IUtkaCommand
|
|
{
|
|
public string Name => "adminwho";
|
|
public Type RequestMessageType => typeof(UtkaAdminWhoRequest);
|
|
|
|
[Dependency] private readonly UtkaTCPWrapper _utkaSocketWrapper = default!;
|
|
|
|
public void Execute(UtkaTCPSession session, UtkaBaseMessage baseMessage)
|
|
{
|
|
if(baseMessage is not UtkaAdminWhoRequest message) return;
|
|
IoCManager.InjectDependencies(this);
|
|
|
|
var adminManager = IoCManager.Resolve<IAdminManager>();
|
|
|
|
var admins = adminManager.ActiveAdmins.ToList();
|
|
|
|
var adminsList = new List<string>();
|
|
|
|
foreach (var admin in admins)
|
|
{
|
|
adminsList.Add(admin.Name);
|
|
}
|
|
|
|
var toUtkaMessage = new UtkaAdminWhoResponse()
|
|
{
|
|
Admins = adminsList
|
|
};
|
|
|
|
_utkaSocketWrapper.SendMessageToAll(toUtkaMessage);
|
|
}
|
|
}
|