Fallback disable/enable (#2286)
This commit is contained in:
committed by
GitHub
parent
3989e20c29
commit
32816d48ee
@@ -9,11 +9,6 @@ using Content.Server.GameObjects.Components.Markers;
|
|||||||
using Content.Server.GameObjects.Components.Mobs;
|
using Content.Server.GameObjects.Components.Mobs;
|
||||||
using Content.Server.GameObjects.Components.Observer;
|
using Content.Server.GameObjects.Components.Observer;
|
||||||
using Content.Server.GameObjects.Components.PDA;
|
using Content.Server.GameObjects.Components.PDA;
|
||||||
using Content.Server.GameObjects.EntitySystems;
|
|
||||||
using Content.Server.GameObjects.EntitySystems.AI.Pathfinding;
|
|
||||||
using Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Accessible;
|
|
||||||
using Content.Server.GameObjects.EntitySystems.Atmos;
|
|
||||||
using Content.Server.GameObjects.EntitySystems.StationEvents;
|
|
||||||
using Content.Server.GameTicking.GamePresets;
|
using Content.Server.GameTicking.GamePresets;
|
||||||
using Content.Server.Interfaces;
|
using Content.Server.Interfaces;
|
||||||
using Content.Server.Interfaces.Chat;
|
using Content.Server.Interfaces.Chat;
|
||||||
@@ -36,7 +31,6 @@ using Robust.Server.Player;
|
|||||||
using Robust.Server.ServerStatus;
|
using Robust.Server.ServerStatus;
|
||||||
using Robust.Shared.Enums;
|
using Robust.Shared.Enums;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.GameObjects.Systems;
|
|
||||||
using Robust.Shared.Interfaces.Configuration;
|
using Robust.Shared.Interfaces.Configuration;
|
||||||
using Robust.Shared.Interfaces.GameObjects;
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
using Robust.Shared.Interfaces.Map;
|
using Robust.Shared.Interfaces.Map;
|
||||||
@@ -70,6 +64,7 @@ namespace Content.Server.GameTicking
|
|||||||
|
|
||||||
private static readonly TimeSpan UpdateRestartDelay = TimeSpan.FromSeconds(20);
|
private static readonly TimeSpan UpdateRestartDelay = TimeSpan.FromSeconds(20);
|
||||||
|
|
||||||
|
public const float PresetFailedCooldownIncrease = 30f;
|
||||||
private const string PlayerPrototypeName = "HumanMob_Content";
|
private const string PlayerPrototypeName = "HumanMob_Content";
|
||||||
private const string ObserverPrototypeName = "MobObserver";
|
private const string ObserverPrototypeName = "MobObserver";
|
||||||
private const string MapFile = "Maps/saltern.yml";
|
private const string MapFile = "Maps/saltern.yml";
|
||||||
@@ -290,6 +285,8 @@ namespace Content.Server.GameTicking
|
|||||||
DisallowLateJoin |= preset.DisallowLateJoin;
|
DisallowLateJoin |= preset.DisallowLateJoin;
|
||||||
|
|
||||||
if (!preset.Start(assignedJobs.Keys.ToList(), force))
|
if (!preset.Start(assignedJobs.Keys.ToList(), force))
|
||||||
|
{
|
||||||
|
if (_configurationManager.GetCVar<bool>("game.fallbackenabled"))
|
||||||
{
|
{
|
||||||
SetStartPreset(_configurationManager.GetCVar<string>("game.fallbackpreset"));
|
SetStartPreset(_configurationManager.GetCVar<string>("game.fallbackpreset"));
|
||||||
var newPreset = MakeGamePreset(profiles);
|
var newPreset = MakeGamePreset(profiles);
|
||||||
@@ -303,6 +300,14 @@ namespace Content.Server.GameTicking
|
|||||||
DisallowLateJoin = false;
|
DisallowLateJoin = false;
|
||||||
DisallowLateJoin |= newPreset.DisallowLateJoin;
|
DisallowLateJoin |= newPreset.DisallowLateJoin;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SendServerMessage($"Failed to start {preset.ModeTitle} mode! Restarting round...");
|
||||||
|
RestartRound();
|
||||||
|
DelayStart(TimeSpan.FromSeconds(PresetFailedCooldownIncrease));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_roundStartTimeSpan = IoCManager.Resolve<IGameTiming>().RealTime;
|
_roundStartTimeSpan = IoCManager.Resolve<IGameTiming>().RealTime;
|
||||||
_sendStatusToAll();
|
_sendStatusToAll();
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ namespace Content.Shared
|
|||||||
public static readonly CVarDef<string>
|
public static readonly CVarDef<string>
|
||||||
GameLobbyDefaultPreset = CVarDef.Create("game.defaultpreset", "Suspicion", CVar.ARCHIVE);
|
GameLobbyDefaultPreset = CVarDef.Create("game.defaultpreset", "Suspicion", CVar.ARCHIVE);
|
||||||
|
|
||||||
|
public static readonly CVarDef<bool>
|
||||||
|
GameLobbyFallbackEnabled = CVarDef.Create("game.fallbackenabled", true, CVar.ARCHIVE);
|
||||||
|
|
||||||
public static readonly CVarDef<string>
|
public static readonly CVarDef<string>
|
||||||
GameLobbyFallbackPreset = CVarDef.Create("game.fallbackpreset", "Sandbox", CVar.ARCHIVE);
|
GameLobbyFallbackPreset = CVarDef.Create("game.fallbackpreset", "Sandbox", CVar.ARCHIVE);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user