Class GameTicker
Inheritance
System.Object
GameTicker
Assembly: Content.Server.dll
Syntax
public sealed class GameTicker : SharedGameTicker
Fields
|
Improve this Doc
View Source
PlayersJoinedRoundNormally
How many players have joined the round through normal methods.
Useful for game rules to look at. Doesn't count observers, people in lobby, etc.
Declaration
public int PlayersJoinedRoundNormally
Field Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
PresetFailedCooldownIncrease
Declaration
public const float PresetFailedCooldownIncrease = null
Field Value
Type |
Description |
System.Single |
|
Properties
|
Improve this Doc
View Source
AllPreviousGameRules
A list storing the start times of all game rules that have been started this round.
Game rules can be started and stopped at any time, including midround.
Declaration
public IReadOnlyList<(TimeSpan, string)> AllPreviousGameRules { get; }
Property Value
Type |
Description |
IReadOnlyList<System.ValueTuple<TimeSpan, System.String>> |
|
|
Improve this Doc
View Source
CurrentPreset
The preset that's currently active.
Declaration
public GamePresetPrototype CurrentPreset { get; }
Property Value
|
Improve this Doc
View Source
DefaultMap
Declaration
public MapId DefaultMap { get; }
Property Value
Type |
Description |
Robust.Shared.Map.MapId |
|
|
Improve this Doc
View Source
DisallowLateJoin
Declaration
public bool DisallowLateJoin { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
DummyTicker
Declaration
public bool DummyTicker { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
LobbyBackground
Declaration
public string? LobbyBackground { get; }
Property Value
Type |
Description |
System.Nullable<System.String> |
|
|
Improve this Doc
View Source
LobbyDuration
Declaration
public TimeSpan LobbyDuration { get; }
Property Value
Type |
Description |
TimeSpan |
|
|
Improve this Doc
View Source
LobbyEnabled
Declaration
public bool LobbyEnabled { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
LobbySong
Declaration
public string? LobbySong { get; }
Property Value
Type |
Description |
System.Nullable<System.String> |
|
|
Improve this Doc
View Source
MaxStationOffset
Declaration
public float MaxStationOffset { get; }
Property Value
Type |
Description |
System.Single |
|
|
Improve this Doc
View Source
Paused
Declaration
public bool Paused { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
PlayerGameStatuses
The game status of a players user Id. May contain disconnected players
Declaration
public IReadOnlyDictionary<NetUserId, PlayerGameStatus> PlayerGameStatuses { get; }
Property Value
Type |
Description |
IReadOnlyDictionary<Robust.Shared.Network.NetUserId, PlayerGameStatus> |
|
|
Improve this Doc
View Source
Preset
The selected preset that will be used at the start of the next round.
Declaration
public GamePresetPrototype Preset { get; }
Property Value
|
Improve this Doc
View Source
RoundPreloadTime
How long before RoundStartTime do we load maps.
Declaration
public TimeSpan RoundPreloadTime { get; }
Property Value
Type |
Description |
TimeSpan |
|
|
Improve this Doc
View Source
RoundStartFailShutdownCount
Declaration
public int RoundStartFailShutdownCount { get; }
Property Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
RunLevel
Declaration
public GameRunLevel RunLevel { get; }
Property Value
|
Improve this Doc
View Source
ServerName
Declaration
public string? ServerName { get; }
Property Value
Type |
Description |
System.Nullable<System.String> |
|
|
Improve this Doc
View Source
StationOffset
Declaration
public bool StationOffset { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
StationRotation
Declaration
public bool StationRotation { get; }
Property Value
Type |
Description |
System.Boolean |
|
Methods
|
Improve this Doc
View Source
AddGameRule(String)
Adds a game rule to the list, but does not
start it yet, instead waiting until the rule is actually started by other code (usually roundstart)
Declaration
public EntityUid AddGameRule(string ruleId)
Parameters
Type |
Name |
Description |
System.String |
ruleId |
|
Returns
Type |
Description |
EntityUid |
The entity for the added gamerule
|
|
Improve this Doc
View Source
CanUpdateMap()
Returns true if the round's map is eligible to be updated.
Declaration
public bool CanUpdateMap()
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
ChooseRandomLobbySong()
Plays a random song from the LobbyMusic sound collection.
Declaration
public void ChooseRandomLobbySong()
|
Improve this Doc
View Source
ClearGameRules()
Declaration
public void ClearGameRules()
|
Improve this Doc
View Source
DelayStart(TimeSpan)
Declaration
public bool DelayStart(TimeSpan time)
Parameters
Type |
Name |
Description |
TimeSpan |
time |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
EndGameRule(EntityUid, GameRuleComponent)
Declaration
public bool EndGameRule(EntityUid ruleEntity, GameRuleComponent ruleData = null)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
EndRound(String)
Declaration
public void EndRound(string text = "")
Parameters
Type |
Name |
Description |
System.String |
text |
|
|
Improve this Doc
View Source
FindGamePreset(String)
Declaration
public GamePresetPrototype FindGamePreset(string preset)
Parameters
Type |
Name |
Description |
System.String |
preset |
|
Returns
|
Improve this Doc
View Source
GetActiveGameRules()
Gets all the gamerule entities which are currently active.
Declaration
public IEnumerable<EntityUid> GetActiveGameRules()
Returns
Type |
Description |
IEnumerable<EntityUid> |
|
|
Improve this Doc
View Source
GetAddedGameRules()
Gets all the gamerule entities which are currently active.
Declaration
public IEnumerable<EntityUid> GetAddedGameRules()
Returns
Type |
Description |
IEnumerable<EntityUid> |
|
|
Improve this Doc
View Source
GetAllGameRulePrototypes()
Gets all gamerule prototypes
Declaration
public IEnumerable<EntityPrototype> GetAllGameRulePrototypes()
Returns
Type |
Description |
IEnumerable<Robust.Shared.Prototypes.EntityPrototype> |
|
|
Improve this Doc
View Source
GetObserverSpawnPoint()
Declaration
public EntityCoordinates GetObserverSpawnPoint()
Returns
Type |
Description |
Robust.Shared.Map.EntityCoordinates |
|
|
Improve this Doc
View Source
Initialize()
Declaration
public override void Initialize()
Overrides
|
Improve this Doc
View Source
IsGameRuleActive(EntityUid, GameRuleComponent)
Declaration
public bool IsGameRuleActive(EntityUid ruleEntity, GameRuleComponent component = null)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IsGameRuleActive(String)
Declaration
public bool IsGameRuleActive(string rule)
Parameters
Type |
Name |
Description |
System.String |
rule |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IsGameRuleAdded(EntityUid, GameRuleComponent)
Declaration
public bool IsGameRuleAdded(EntityUid ruleEntity, GameRuleComponent component = null)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IsGameRuleAdded(String)
Declaration
public bool IsGameRuleAdded(string rule)
Parameters
Type |
Name |
Description |
System.String |
rule |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IsMapEligible(GameMapPrototype)
Declaration
public bool IsMapEligible(GameMapPrototype map)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
JoinAsObserver(IPlayerSession)
Declaration
public void JoinAsObserver(IPlayerSession player)
Parameters
Type |
Name |
Description |
Robust.Server.Player.IPlayerSession |
player |
|
|
Improve this Doc
View Source
LoadGameMap(GameMapPrototype, MapId, MapLoadOptions, Nullable<String>)
Loads a new map, allowing systems interested in it to handle loading events.
In the base game, this is required to be used if you want to load a station.
Declaration
public IReadOnlyList<EntityUid> LoadGameMap(GameMapPrototype map, MapId targetMapId, MapLoadOptions loadOptions, string? stationName = null)
Parameters
Type |
Name |
Description |
GameMapPrototype |
map |
Game map prototype to load in.
|
Robust.Shared.Map.MapId |
targetMapId |
Map to load into.
|
Robust.Server.Maps.MapLoadOptions |
loadOptions |
Map loading options, includes offset.
|
System.Nullable<System.String> |
stationName |
Name to assign to the loaded station.
|
Returns
Type |
Description |
IReadOnlyList<EntityUid> |
All loaded entities and grids.
|
|
Improve this Doc
View Source
MakeJoinGame(IPlayerSession, EntityUid, Nullable<String>, Boolean)
Makes a player join into the game and spawn on a staiton.
Declaration
public void MakeJoinGame(IPlayerSession player, EntityUid station, string? jobId = null, bool silent = false)
Parameters
Type |
Name |
Description |
Robust.Server.Player.IPlayerSession |
player |
The player joining
|
EntityUid |
station |
The station they're spawning on
|
System.Nullable<System.String> |
jobId |
An optional job for them to spawn as
|
System.Boolean |
silent |
Whether or not the player should be greeted upon joining
|
|
Improve this Doc
View Source
OnGhostAttempt(EntityUid, Boolean, Boolean, MindComponent)
Declaration
public bool OnGhostAttempt(EntityUid mindId, bool canReturnGlobal, bool viaCommand = false, MindComponent mind = null)
Parameters
Type |
Name |
Description |
EntityUid |
mindId |
|
System.Boolean |
canReturnGlobal |
|
System.Boolean |
viaCommand |
|
MindComponent |
mind |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
PauseStart(Boolean)
Declaration
public bool PauseStart(bool pause = true)
Parameters
Type |
Name |
Description |
System.Boolean |
pause |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
PlayerJoinGame(IPlayerSession, Boolean)
Declaration
public void PlayerJoinGame(IPlayerSession session, bool silent = false)
Parameters
Type |
Name |
Description |
Robust.Server.Player.IPlayerSession |
session |
|
System.Boolean |
silent |
|
|
Improve this Doc
View Source
PostInitialize()
Declaration
public void PostInitialize()
|
Improve this Doc
View Source
Respawn(IPlayerSession)
Declaration
public void Respawn(IPlayerSession player)
Parameters
Type |
Name |
Description |
Robust.Server.Player.IPlayerSession |
player |
|
|
Improve this Doc
View Source
RestartRound()
Declaration
public void RestartRound()
|
Improve this Doc
View Source
RoundDuration()
Declaration
public TimeSpan RoundDuration()
Returns
Type |
Description |
TimeSpan |
|
|
Improve this Doc
View Source
SetGamePreset(GamePresetPrototype, Boolean)
Declaration
public void SetGamePreset(GamePresetPrototype preset, bool force = false)
Parameters
|
Improve this Doc
View Source
SetGamePreset(String, Boolean)
Declaration
public void SetGamePreset(string preset, bool force = false)
Parameters
Type |
Name |
Description |
System.String |
preset |
|
System.Boolean |
force |
|
|
Improve this Doc
View Source
SetLobbySong(Nullable<String>)
Sets the current lobby song, or stops it if null.
Declaration
public void SetLobbySong(string? song)
Parameters
Type |
Name |
Description |
System.Nullable<System.String> |
song |
The lobby song to play, or null to stop any lobby songs.
|
|
Improve this Doc
View Source
ShowRoundEndScoreboard(String)
Declaration
public void ShowRoundEndScoreboard(string text = "")
Parameters
Type |
Name |
Description |
System.String |
text |
|
|
Improve this Doc
View Source
Shutdown()
Declaration
public override void Shutdown()
Overrides
|
Improve this Doc
View Source
SpawnObserver(IPlayerSession)
Spawns an observer ghost and attaches the given player to it. If the player does not yet have a mind, the
player is given a new mind with the observer role. Otherwise, the current mind is transferred to the ghost.
Declaration
public void SpawnObserver(IPlayerSession player)
Parameters
Type |
Name |
Description |
Robust.Server.Player.IPlayerSession |
player |
|
|
Improve this Doc
View Source
StartGameRule(EntityUid, GameRuleComponent)
Game rules can be 'started' separately from being added. 'Starting' them usually
happens at round start while they can be added and removed before then.
Declaration
public bool StartGameRule(EntityUid ruleEntity, GameRuleComponent ruleData = null)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
StartGameRule(String)
Game rules can be 'started' separately from being added. 'Starting' them usually
happens at round start while they can be added and removed before then.
Declaration
public bool StartGameRule(string ruleId)
Parameters
Type |
Name |
Description |
System.String |
ruleId |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
StartGameRule(String, out EntityUid)
Game rules can be 'started' separately from being added. 'Starting' them usually
happens at round start while they can be added and removed before then.
Declaration
public bool StartGameRule(string ruleId, out EntityUid ruleEntity)
Parameters
Type |
Name |
Description |
System.String |
ruleId |
|
EntityUid |
ruleEntity |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
StartRound(Boolean)
Declaration
public void StartRound(bool force = false)
Parameters
Type |
Name |
Description |
System.Boolean |
force |
|
|
Improve this Doc
View Source
StopLobbySong()
Stops the current lobby song being played.
Declaration
public void StopLobbySong()
|
Improve this Doc
View Source
TogglePause()
Declaration
public bool TogglePause()
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
ToggleReady(IPlayerSession, Boolean)
Declaration
public void ToggleReady(IPlayerSession player, bool ready)
Parameters
Type |
Name |
Description |
Robust.Server.Player.IPlayerSession |
player |
|
System.Boolean |
ready |
|
|
Improve this Doc
View Source
ToggleReadyAll(Boolean)
Declaration
public void ToggleReadyAll(bool ready)
Parameters
Type |
Name |
Description |
System.Boolean |
ready |
|
|
Improve this Doc
View Source
TryFindGamePreset(String, out GamePresetPrototype)
Declaration
public bool TryFindGamePreset(string preset, out GamePresetPrototype prototype)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Update(Single)
Declaration
public override void Update(float frameTime)
Parameters
Type |
Name |
Description |
System.Single |
frameTime |
|
|
Improve this Doc
View Source
UpdateInfoText()
Declaration
public void UpdateInfoText()