[feat] Stalin manager

# Conflicts:
#	Content.Client/Entry/EntryPoint.cs
#	Content.Server/Entry/EntryPoint.cs
#	Content.Server/GameTicking/Commands/JoinGameCommand.cs
#	Content.Server/GameTicking/GameTicker.Lobby.cs
#	Content.Server/GameTicking/GameTicker.RoundFlow.cs
#	Content.Server/GameTicking/GameTicker.Spawning.cs
This commit is contained in:
rhailrake
2023-04-27 21:56:22 +06:00
committed by Remuchi
parent 976b6788a8
commit c41e58fa3e
22 changed files with 539 additions and 10 deletions

View File

@@ -12,6 +12,7 @@ using Content.Shared.Players;
using Content.Shared.Preferences;
using Content.Shared.Roles;
using Content.Shared.Roles.Jobs;
using Content.Shared.White;
using JetBrains.Annotations;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
@@ -307,12 +308,22 @@ namespace Content.Server.GameTicking
/// <summary>
/// Causes the given player to join the current game as observer ghost. See also <see cref="SpawnObserver"/>
/// </summary>
public void JoinAsObserver(ICommonSession player)
public async void JoinAsObserver(ICommonSession player)
{
// Can't spawn players with a dummy ticker!
if (DummyTicker)
return;
if (_configurationManager.GetCVar(WhiteCVars.StalinEnabled))
{
var allowEnterData = await _stalinManager.AllowEnter(player);
if (!allowEnterData.allow)
{
_chatManager.DispatchServerMessage(player, $"Вход в игру запрещен: {allowEnterData.errorMessage}");
return;
}
}
PlayerJoinGame(player);
SpawnObserver(player);
}