[feat] Sockets, i guess mm hmm

# 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
This commit is contained in:
rhailrake
2023-04-27 06:01:05 +06:00
committed by Remuchi
parent eeec02119d
commit aca6843c0a
26 changed files with 1175 additions and 81 deletions

View File

@@ -20,6 +20,8 @@ using Robust.Shared.Network;
using Robust.Shared.Player;
using Robust.Shared.Random;
using Robust.Shared.Utility;
using Content.Server.UtkaIntegration;
using System.Threading.Tasks;
namespace Content.Server.GameTicking
{
@@ -28,6 +30,10 @@ namespace Content.Server.GameTicking
[Dependency] private readonly DiscordWebhook _discord = default!;
[Dependency] private readonly ITaskManager _taskManager = default!;
//WD-EDIT
[Dependency] private readonly UtkaTCPWrapper _utkaSocketWrapper = default!;
//WD-EDIT
private static readonly Counter RoundNumberMetric = Metrics.CreateCounter(
"ss14_round_number",
"Round number.");
@@ -255,6 +261,7 @@ namespace Content.Server.GameTicking
AnnounceRound();
UpdateInfoText();
RaiseLocalEvent(new RoundStartedEvent(RoundId)); // WD-EDIT
SendRoundStatus("game_started"); //WD-EDIT
#if EXCEPTION_TOLERANCE
}
@@ -435,6 +442,7 @@ namespace Content.Server.GameTicking
UpdateInfoText();
ReqWindowAttentionAll();
SendRoundStatus("lobby_loaded"); //WD-EDIT
}
}
@@ -517,6 +525,22 @@ namespace Content.Server.GameTicking
return true;
}
//WD-EDIT
private void SendRoundStatus(string status)
{
if (!_postInitialized)
return;
var utkaRoundStatusEvent = new UtkaRoundStatusEvent()
{
Message = status
};
_utkaSocketWrapper.SendMessageToAll(utkaRoundStatusEvent);
}
//WD-EDIT
private void UpdateRoundFlow(float frameTime)
{
if (RunLevel == GameRunLevel.InRound)