Fix gamerule display issues (#28178)

* A comprehensive rule list for joining admins and mid round command to get rule list added

* Fix up for when a rule is added vs started and some logging

* fix command help localization, fix admin flags and spam anouncement.

* Send admin message only to the joining player not all admins.

* Bit better formatting in chat box
This commit is contained in:
Repo
2024-05-26 08:18:05 +12:00
committed by GitHub
parent 739c81c230
commit 90d3699c1d
7 changed files with 98 additions and 5 deletions

View File

@@ -1,4 +1,6 @@
using System.Linq;
using Content.Server.Database;
using Content.Shared.Administration;
using Content.Shared.CCVar;
using Content.Shared.GameTicking;
using Content.Shared.GameWindow;
@@ -196,6 +198,15 @@ namespace Content.Server.GameTicking
_playerGameStatuses[session.UserId] = PlayerGameStatus.JoinedGame;
_db.AddRoundPlayers(RoundId, session.UserId);
if (_adminManager.HasAdminFlag(session, AdminFlags.Admin))
{
if (_allPreviousGameRules.Count > 0)
{
var rulesMessage = GetGameRulesListMessage(true);
_chatManager.SendAdminAnnouncementMessage(session, Loc.GetString("starting-rule-selected-preset", ("preset", rulesMessage)));
}
}
RaiseNetworkEvent(new TickerJoinGameEvent(), session.Channel);
}