Files
tbd-station-14/Content.Server/GameTicking/GameTicker.cs
Moony ec68226e99 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 20:02:46 +11:00

96 lines
3.5 KiB
C#

using Content.Server.Administration.Logs;
using Content.Server.Chat.Managers;
using Content.Server.Maps;
using Content.Server.Preferences.Managers;
using Content.Server.Roles;
using Content.Server.Station;
using Content.Shared.Chat;
using Content.Shared.GameTicking;
using Content.Shared.GameWindow;
using Robust.Server;
using Robust.Server.Maps;
using Robust.Server.ServerStatus;
using Robust.Shared.Configuration;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Map;
using Robust.Shared.Network;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Reflection;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
using Robust.Shared.ViewVariables;
namespace Content.Server.GameTicking
{
public partial class GameTicker : SharedGameTicker
{
[ViewVariables] private bool _initialized;
[ViewVariables] private bool _postInitialized;
[ViewVariables] public MapId DefaultMap { get; private set; }
public override void Initialize()
{
base.Initialize();
DebugTools.Assert(!_initialized);
DebugTools.Assert(!_postInitialized);
// Initialize the other parts of the game ticker.
InitializeStatusShell();
InitializeCVars();
InitializePlayer();
InitializeLobbyMusic();
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 = _netManager.CreateNetMessage<MsgChatMessage>();
msg.Channel = ChatChannel.Server;
msg.Message = message;
IoCManager.Resolve<IServerNetManager>().ServerSendToAll(msg);
}
public override void Update(float frameTime)
{
base.Update(frameTime);
UpdateRoundFlow(frameTime);
}
[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 IDynamicTypeFactory _dynamicTypeFactory = 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 IReflectionManager _reflectionManager = default!;
[Dependency] private readonly IGameMapManager _gameMapManager = default!;
[Dependency] private readonly StationSystem _stationSystem = default!;
[Dependency] private readonly AdminLogSystem _adminLogSystem = default!;
}
}