Save round information into replay_final.yml (#23013)

* Save round information into the replay

* Add round end text too

* This is way better

* Get actual job

* oop

* OK THERE

* Fake line endings to make life easier

* I was told this yaml is legal

* I just realised this will make my life easier

* REVIEWS BABY IM A PROGRAMMER MOMMY

* Live pjb reaction

* Live pjb reaction 2

* Reviews 2

* Dont need this

* Please no more have mercy on my soul

* Oh frick
This commit is contained in:
Vasilis
2024-02-17 21:30:54 +01:00
committed by GitHub
parent 5b485fedbd
commit cb999d23f4
5 changed files with 63 additions and 7 deletions

View File

@@ -46,6 +46,10 @@ namespace Content.Server.GameTicking
[ViewVariables]
private GameRunLevel _runLevel;
private RoundEndMessageEvent.RoundEndPlayerInfo[]? _replayRoundPlayerInfo;
private string? _replayRoundText;
[ViewVariables]
public GameRunLevel RunLevel
{
@@ -372,11 +376,14 @@ namespace Content.Server.GameTicking
PlayerOOCName = contentPlayerData?.Name ?? "(IMPOSSIBLE: REGISTERED MIND WITH NO OWNER)",
// Character name takes precedence over current entity name
PlayerICName = playerIcName,
PlayerGuid = userId,
PlayerNetEntity = GetNetEntity(entity),
Role = antag
? roles.First(role => role.Antagonist).Name
: roles.FirstOrDefault().Name ?? Loc.GetString("game-ticker-unknown-role"),
Antag = antag,
JobPrototypes = roles.Where(role => !role.Antagonist).Select(role => role.Prototype).ToArray(),
AntagPrototypes = roles.Where(role => role.Antagonist).Select(role => role.Prototype).ToArray(),
Observer = observer,
Connected = connected
};
@@ -389,6 +396,9 @@ namespace Content.Server.GameTicking
RaiseNetworkEvent(new RoundEndMessageEvent(gamemodeTitle, roundEndText, roundDuration, RoundId,
listOfPlayerInfoFinal.Length, listOfPlayerInfoFinal, LobbySong, sound));
_replayRoundPlayerInfo = listOfPlayerInfoFinal;
_replayRoundText = roundEndText;
}
private async void SendRoundEndDiscordMessage()