aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBarichello <artur@barichello.me>2022-02-05 00:57:40 -0300
committerBarichello <artur@barichello.me>2022-02-05 01:04:45 -0300
commit773764cd36b29231a7d5ede670cb3ae7fd3886ba (patch)
tree7152c5ea757cd41bf93d3f44ca3ec9b6a79d8c26
parent74064c469b18067bb6693b3f27e9955fc3a1d17e (diff)
downloadNorthstarMods-773764cd36b29231a7d5ede670cb3ae7fd3886ba.tar.gz
NorthstarMods-773764cd36b29231a7d5ede670cb3ae7fd3886ba.zip
Add GameStateToString
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/_utility_shared.nut28
1 files changed, 28 insertions, 0 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/_utility_shared.nut b/Northstar.CustomServers/mod/scripts/vscripts/_utility_shared.nut
index e3cb0dbf..c5887f2b 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/_utility_shared.nut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/_utility_shared.nut
@@ -1191,6 +1191,34 @@ int function GetGameState()
return expect int( GetServerVar( "gameState" ) )
}
+string function GameStateToString()
+{
+ switch ( GetGameState() )
+ {
+ case eGameState.WaitingForCustomStart:
+ return "WaitingForCustomStart"
+ case eGameState.WaitingForPlayers:
+ return "WaitingForPlayers"
+ case eGameState.PickLoadout:
+ return "PickLoadout"
+ case eGameState.Prematch:
+ return "Prematch"
+ case eGameState.Playing:
+ return "Playing"
+ case eGameState.SuddenDeath:
+ return "SuddenDeath"
+ case eGameState.SwitchingSides:
+ return "SwitchingSides"
+ case eGameState.WinnerDetermined:
+ return "WinnerDetermined"
+ case eGameState.Epilogue:
+ return "Epilogue"
+ case eGameState.Postmatch:
+ return "Postmatch"
+ }
+ unreachable
+}
+
bool function GamePlaying()
{
return GetGameState() == eGameState.Playing