Revert "Game server api" (#26871)
Revert "Game server api (#24015)"
This reverts commit 297853929b.
This commit is contained in:
committed by
GitHub
parent
297853929b
commit
3aee197923
File diff suppressed because it is too large
Load Diff
@@ -61,7 +61,7 @@ namespace Content.Server.Administration.Systems
|
||||
public IReadOnlySet<NetUserId> RoundActivePlayers => _roundActivePlayers;
|
||||
|
||||
private readonly HashSet<NetUserId> _roundActivePlayers = new();
|
||||
public readonly PanicBunkerStatus PanicBunker = new();
|
||||
private readonly PanicBunkerStatus _panicBunker = new();
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -240,7 +240,7 @@ namespace Content.Server.Administration.Systems
|
||||
|
||||
private void OnPanicBunkerChanged(bool enabled)
|
||||
{
|
||||
PanicBunker.Enabled = enabled;
|
||||
_panicBunker.Enabled = enabled;
|
||||
_chat.SendAdminAlert(Loc.GetString(enabled
|
||||
? "admin-ui-panic-bunker-enabled-admin-alert"
|
||||
: "admin-ui-panic-bunker-disabled-admin-alert"
|
||||
@@ -251,52 +251,52 @@ namespace Content.Server.Administration.Systems
|
||||
|
||||
private void OnPanicBunkerDisableWithAdminsChanged(bool enabled)
|
||||
{
|
||||
PanicBunker.DisableWithAdmins = enabled;
|
||||
_panicBunker.DisableWithAdmins = enabled;
|
||||
UpdatePanicBunker();
|
||||
}
|
||||
|
||||
private void OnPanicBunkerEnableWithoutAdminsChanged(bool enabled)
|
||||
{
|
||||
PanicBunker.EnableWithoutAdmins = enabled;
|
||||
_panicBunker.EnableWithoutAdmins = enabled;
|
||||
UpdatePanicBunker();
|
||||
}
|
||||
|
||||
private void OnPanicBunkerCountDeadminnedAdminsChanged(bool enabled)
|
||||
{
|
||||
PanicBunker.CountDeadminnedAdmins = enabled;
|
||||
_panicBunker.CountDeadminnedAdmins = enabled;
|
||||
UpdatePanicBunker();
|
||||
}
|
||||
|
||||
private void OnShowReasonChanged(bool enabled)
|
||||
{
|
||||
PanicBunker.ShowReason = enabled;
|
||||
_panicBunker.ShowReason = enabled;
|
||||
SendPanicBunkerStatusAll();
|
||||
}
|
||||
|
||||
private void OnPanicBunkerMinAccountAgeChanged(int minutes)
|
||||
{
|
||||
PanicBunker.MinAccountAgeHours = minutes / 60;
|
||||
_panicBunker.MinAccountAgeHours = minutes / 60;
|
||||
SendPanicBunkerStatusAll();
|
||||
}
|
||||
|
||||
private void OnPanicBunkerMinOverallHoursChanged(int hours)
|
||||
{
|
||||
PanicBunker.MinOverallHours = hours;
|
||||
_panicBunker.MinOverallHours = hours;
|
||||
SendPanicBunkerStatusAll();
|
||||
}
|
||||
|
||||
private void UpdatePanicBunker()
|
||||
{
|
||||
var admins = PanicBunker.CountDeadminnedAdmins
|
||||
var admins = _panicBunker.CountDeadminnedAdmins
|
||||
? _adminManager.AllAdmins
|
||||
: _adminManager.ActiveAdmins;
|
||||
var hasAdmins = admins.Any();
|
||||
|
||||
if (hasAdmins && PanicBunker.DisableWithAdmins)
|
||||
if (hasAdmins && _panicBunker.DisableWithAdmins)
|
||||
{
|
||||
_config.SetCVar(CCVars.PanicBunkerEnabled, false);
|
||||
}
|
||||
else if (!hasAdmins && PanicBunker.EnableWithoutAdmins)
|
||||
else if (!hasAdmins && _panicBunker.EnableWithoutAdmins)
|
||||
{
|
||||
_config.SetCVar(CCVars.PanicBunkerEnabled, true);
|
||||
}
|
||||
@@ -306,7 +306,7 @@ namespace Content.Server.Administration.Systems
|
||||
|
||||
private void SendPanicBunkerStatusAll()
|
||||
{
|
||||
var ev = new PanicBunkerChangedEvent(PanicBunker);
|
||||
var ev = new PanicBunkerChangedEvent(_panicBunker);
|
||||
foreach (var admin in _adminManager.AllAdmins)
|
||||
{
|
||||
RaiseNetworkEvent(ev, admin);
|
||||
|
||||
@@ -102,7 +102,6 @@ namespace Content.Server.Entry
|
||||
IoCManager.Resolve<ContentNetworkResourceManager>().Initialize();
|
||||
IoCManager.Resolve<GhostKickManager>().Initialize();
|
||||
IoCManager.Resolve<ServerInfoManager>().Initialize();
|
||||
IoCManager.Resolve<ServerApi>().Initialize();
|
||||
|
||||
_voteManager.Initialize();
|
||||
_updateManager.Initialize();
|
||||
@@ -168,7 +167,6 @@ namespace Content.Server.Entry
|
||||
{
|
||||
_playTimeTracking?.Shutdown();
|
||||
_dbManager?.Shutdown();
|
||||
IoCManager.Resolve<ServerApi>().Shutdown();
|
||||
}
|
||||
|
||||
private static void LoadConfigPresets(IConfigurationManager cfg, IResourceManager res, ISawmill sawmill)
|
||||
|
||||
@@ -58,7 +58,6 @@ namespace Content.Server.IoC
|
||||
IoCManager.Register<PoissonDiskSampler>();
|
||||
IoCManager.Register<DiscordWebhook>();
|
||||
IoCManager.Register<ServerDbEntryManager>();
|
||||
IoCManager.Register<ServerApi>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -773,13 +773,6 @@ namespace Content.Shared.CCVar
|
||||
public static readonly CVarDef<bool> AdminAnnounceLogout =
|
||||
CVarDef.Create("admin.announce_logout", true, CVar.SERVERONLY);
|
||||
|
||||
/// <summary>
|
||||
/// The token used to authenticate with the admin API. Leave empty to disable the admin API. This is a secret! Do not share!
|
||||
/// </summary>
|
||||
public static readonly CVarDef<string> AdminApiToken =
|
||||
CVarDef.Create("admin.api_token", string.Empty, CVar.SERVERONLY | CVar.CONFIDENTIAL);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Should users be able to see their own notes? Admins will be able to see and set notes regardless
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user