From 773764cd36b29231a7d5ede670cb3ae7fd3886ba Mon Sep 17 00:00:00 2001 From: Barichello Date: Sat, 5 Feb 2022 00:57:40 -0300 Subject: Add GameStateToString --- .../mod/scripts/vscripts/_utility_shared.nut | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'Northstar.CustomServers/mod/scripts/vscripts') 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 -- cgit v1.2.3