Files
OldThink/Content.Server/GameTicking/GameTicker.cs

112 lines
4.2 KiB
C#
Raw Normal View History

Refactor how jobs are handed out (#5422) * Completely refactor how job spawning works * Remove remains of old system. * Squash the final bug, cleanup. * Attempt to fix tests * Adjusts packed's round-start crew roster, re-enables a bunch of old roles. Also adds the Central Command Official as a proper role. * pretty up ui * refactor StationSystem into the correct folder & namespace. * remove a log, make sure the lobby gets updated if a new map is spontaneously added. * re-add accidentally removed log * We do a little logging * we do a little resolving * we do a little documenting * Renamed OverflowJob to FallbackOverflowJob Allows stations to configure their own roundstart overflow job list. * narrator: it did not compile * oops * support having no overflow jobs * filescope for consistency * small fixes * Bumps a few role counts for Packed, namely engis * log moment * E * Update Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml Co-authored-by: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> * Update Content.Server/Maps/GameMapPrototype.cs Co-authored-by: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> * factored job logic, cleanup. * e * Address reviews * Remove the concept of a "default" grid. It has no future in our new multi-station world * why was clickable using that in the first place * fix bad evil bug that almost slipped through also adds chemist * rms obsolete things from chemist * Adds a sanity fallback * address reviews * adds ability to set name * fuck * cleanup joingame
2021-11-26 03:02:46 -06:00
using Content.Server.Administration.Logs;
2022-02-21 14:11:39 -08:00
using Content.Server.Administration.Managers;
2021-12-04 12:35:33 +01:00
using Content.Server.CharacterAppearance.Systems;
2021-06-09 22:19:39 +02:00
using Content.Server.Chat.Managers;
using Content.Server.Database;
2021-12-21 21:23:29 +01:00
using Content.Server.Ghost;
using Content.Server.Maps;
2021-12-04 12:35:33 +01:00
using Content.Server.PDA;
2021-06-09 22:19:39 +02:00
using Content.Server.Preferences.Managers;
Refactor how jobs are handed out (#5422) * Completely refactor how job spawning works * Remove remains of old system. * Squash the final bug, cleanup. * Attempt to fix tests * Adjusts packed's round-start crew roster, re-enables a bunch of old roles. Also adds the Central Command Official as a proper role. * pretty up ui * refactor StationSystem into the correct folder & namespace. * remove a log, make sure the lobby gets updated if a new map is spontaneously added. * re-add accidentally removed log * We do a little logging * we do a little resolving * we do a little documenting * Renamed OverflowJob to FallbackOverflowJob Allows stations to configure their own roundstart overflow job list. * narrator: it did not compile * oops * support having no overflow jobs * filescope for consistency * small fixes * Bumps a few role counts for Packed, namely engis * log moment * E * Update Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml Co-authored-by: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> * Update Content.Server/Maps/GameMapPrototype.cs Co-authored-by: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> * factored job logic, cleanup. * e * Address reviews * Remove the concept of a "default" grid. It has no future in our new multi-station world * why was clickable using that in the first place * fix bad evil bug that almost slipped through also adds chemist * rms obsolete things from chemist * Adds a sanity fallback * address reviews * adds ability to set name * fuck * cleanup joingame
2021-11-26 03:02:46 -06:00
using Content.Server.Station;
using Content.Shared.Chat;
2021-12-21 21:23:29 +01:00
using Content.Shared.Damage;
using Content.Shared.GameTicking;
using Robust.Server;
using Robust.Server.Maps;
using Robust.Server.ServerStatus;
using Robust.Shared.Configuration;
2021-12-21 21:23:29 +01:00
#if EXCEPTION_TOLERANCE
using Robust.Shared.Exceptions;
#endif
using Robust.Shared.Map;
using Robust.Shared.Network;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
namespace Content.Server.GameTicking
{
public sealed partial class GameTicker : SharedGameTicker
{
[ViewVariables] private bool _initialized;
[ViewVariables] private bool _postInitialized;
[ViewVariables] public MapId DefaultMap { get; private set; }
private ISawmill _sawmill = default!;
public override void Initialize()
{
base.Initialize();
DebugTools.Assert(!_initialized);
DebugTools.Assert(!_postInitialized);
_sawmill = _logManager.GetSawmill("ticker");
// Initialize the other parts of the game ticker.
InitializeStatusShell();
InitializeCVars();
InitializePlayer();
InitializeLobbyMusic();
2022-03-13 19:33:19 -07:00
InitializeLobbyBackground();
InitializeGamePreset();
InitializeJobController();
InitializeUpdates();
_initialized = true;
}
public void PostInitialize()
{
DebugTools.Assert(_initialized);
DebugTools.Assert(!_postInitialized);
// We restart the round now that entities are initialized and prototypes have been loaded.
RestartRound();
_postInitialized = true;
}
private void SendServerMessage(string message)
{
var msg = new MsgChatMessage();
msg.Channel = ChatChannel.Server;
msg.Message = message;
IoCManager.Resolve<IServerNetManager>().ServerSendToAll(msg);
}
public override void Update(float frameTime)
{
base.Update(frameTime);
UpdateRoundFlow(frameTime);
2019-10-18 14:28:39 +02:00
}
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly IMapLoader _mapLoader = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly IConfigurationManager _configurationManager = default!;
[Dependency] private readonly IChatManager _chatManager = default!;
[Dependency] private readonly IServerNetManager _netManager = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IRobustRandom _robustRandom = default!;
[Dependency] private readonly IServerPreferencesManager _prefsManager = default!;
[Dependency] private readonly IBaseServer _baseServer = default!;
[Dependency] private readonly IWatchdogApi _watchdogApi = default!;
[Dependency] private readonly IGameMapManager _gameMapManager = default!;
[Dependency] private readonly IServerDbManager _db = default!;
[Dependency] private readonly ILogManager _logManager = default!;
2021-12-21 21:23:29 +01:00
#if EXCEPTION_TOLERANCE
[Dependency] private readonly IRuntimeLog _runtimeLog = default!;
#endif
Refactor how jobs are handed out (#5422) * Completely refactor how job spawning works * Remove remains of old system. * Squash the final bug, cleanup. * Attempt to fix tests * Adjusts packed's round-start crew roster, re-enables a bunch of old roles. Also adds the Central Command Official as a proper role. * pretty up ui * refactor StationSystem into the correct folder & namespace. * remove a log, make sure the lobby gets updated if a new map is spontaneously added. * re-add accidentally removed log * We do a little logging * we do a little resolving * we do a little documenting * Renamed OverflowJob to FallbackOverflowJob Allows stations to configure their own roundstart overflow job list. * narrator: it did not compile * oops * support having no overflow jobs * filescope for consistency * small fixes * Bumps a few role counts for Packed, namely engis * log moment * E * Update Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml Co-authored-by: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> * Update Content.Server/Maps/GameMapPrototype.cs Co-authored-by: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> * factored job logic, cleanup. * e * Address reviews * Remove the concept of a "default" grid. It has no future in our new multi-station world * why was clickable using that in the first place * fix bad evil bug that almost slipped through also adds chemist * rms obsolete things from chemist * Adds a sanity fallback * address reviews * adds ability to set name * fuck * cleanup joingame
2021-11-26 03:02:46 -06:00
[Dependency] private readonly StationSystem _stationSystem = default!;
[Dependency] private readonly AdminLogSystem _adminLogSystem = default!;
2021-12-04 12:35:33 +01:00
[Dependency] private readonly HumanoidAppearanceSystem _humanoidAppearanceSystem = default!;
[Dependency] private readonly PDASystem _pdaSystem = default!;
2021-12-21 21:23:29 +01:00
[Dependency] private readonly DamageableSystem _damageable = default!;
[Dependency] private readonly GhostSystem _ghosts = default!;
2022-02-21 14:11:39 -08:00
[Dependency] private readonly RoleBanManager _roleBanManager = default!;
}
}