Files
OldThink/Content.Server/UtkaIntegration/Commands/UtkaRestartRoundCommand.cs
2024-01-17 12:00:25 +03:00

26 lines
709 B
C#

using Content.Server.GameTicking;
using Content.Server.UtkaIntegration.TCP;
namespace Content.Server.UtkaIntegration;
public sealed class UtkaRestartRoundCommand : IUtkaCommand
{
[Dependency] private UtkaTCPWrapper _utkaSocket = default!;
public string Name => "restart_round";
public Type RequestMessageType => typeof(UtkaRestartRoundRequest);
public void Execute(UtkaTCPSession session, UtkaBaseMessage baseMessage)
{
IoCManager.InjectDependencies(this);
EntitySystem.Get<GameTicker>().RestartRound();
var response = new UtkaRestartRoundResponse()
{
Restarted = true
};
_utkaSocket.SendMessageToAll(response);
}
}