diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-03-03 20:54:59 +0000 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-03-03 20:54:59 +0000 |
commit | 81809dfba9a8329f07d68d1fd66133161234effa (patch) | |
tree | 94c6571b4be52dbd03435ffee478a41e8c062922 /Northstar.CustomServers/mod/scripts/vscripts/lobby | |
parent | fd0c66f5c84b7b6c349c3362c3e6df555c393aa5 (diff) | |
download | NorthstarMods-81809dfba9a8329f07d68d1fd66133161234effa.tar.gz NorthstarMods-81809dfba9a8329f07d68d1fd66133161234effa.zip |
spectator refactor and private match spectator support
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/lobby')
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/lobby/_lobby.gnut | 3 | ||||
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/lobby/_private_lobby.gnut | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/lobby/_lobby.gnut b/Northstar.CustomServers/mod/scripts/vscripts/lobby/_lobby.gnut index 0f37251d..33c0b8e9 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/lobby/_lobby.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/lobby/_lobby.gnut @@ -19,7 +19,8 @@ void function Lobby_Init() void function Lobby_OnClientConnectionStarted( entity player ) { - + if ( !( IsPrivateMatch() || GetCurrentPlaylistName() == "private_match" ) || !GetConVarBool( "ns_allow_spectators" ) ) + player.SetPersistentVar( "privateMatchState", 0 ) // disable spectator } void function Lobby_OnClientConnectionCompleted( entity player ) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/lobby/_private_lobby.gnut b/Northstar.CustomServers/mod/scripts/vscripts/lobby/_private_lobby.gnut index c56e537a..c410869e 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/lobby/_private_lobby.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/lobby/_private_lobby.gnut @@ -123,7 +123,10 @@ bool function ClientCommandCallback_PrivateMatchSwitchTeams( entity player, arra bool function ClientCommandCallback_PrivateMatchToggleSpectate( entity player, array<string> args ) { - // not currently working, gotta figure it out at some point + if ( file.startState == ePrivateMatchStartState.STARTING || !GetConVarBool( "ns_allow_spectators" ) ) + return true + + player.SetPersistentVar( "privateMatchState", player.GetPersistentVarAsInt( "privateMatchState" ) == 0 ? 1 : 0 ) return true } |