aboutsummaryrefslogtreecommitdiff
path: root/Northstar.CustomServers/mod/scripts/vscripts/lobby
diff options
context:
space:
mode:
authorRemy Raes <raes.remy@gmail.com>2021-12-25 23:45:33 +0100
committerRemy Raes <raes.remy@gmail.com>2021-12-25 23:45:33 +0100
commit2dbabfcfbccb83a629a747f33ccef21889349138 (patch)
tree24d7176507553af7ac03ac54093a803a8ad06eff /Northstar.CustomServers/mod/scripts/vscripts/lobby
parente93893cc0083c94044048f920a34fb46bc448b9a (diff)
parente4faa247edaf389d4d52e3a3129af540bb19a0ac (diff)
downloadNorthstarMods-2dbabfcfbccb83a629a747f33ccef21889349138.tar.gz
NorthstarMods-2dbabfcfbccb83a629a747f33ccef21889349138.zip
Merge branch 'main' into chore/french-translations
Diffstat (limited to 'Northstar.CustomServers/mod/scripts/vscripts/lobby')
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/lobby/_private_lobby.gnut20
1 files changed, 20 insertions, 0 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/lobby/_private_lobby.gnut b/Northstar.CustomServers/mod/scripts/vscripts/lobby/_private_lobby.gnut
index 3acd1652..b5c6ea32 100644
--- a/Northstar.CustomServers/mod/scripts/vscripts/lobby/_private_lobby.gnut
+++ b/Northstar.CustomServers/mod/scripts/vscripts/lobby/_private_lobby.gnut
@@ -39,6 +39,10 @@ bool function ClientCommandCallback_PrivateMatchLaunch( entity player, array<str
{
if ( file.startState == ePrivateMatchStartState.STARTING )
{
+ if ( GetConVarBool( "ns_private_match_only_host_can_start" ) )
+ if ( !NSIsPlayerIndexLocalPlayer( player.GetPlayerIndex() ) )
+ return true
+
// cancel start if we're already mid-countdown
file.startState = ePrivateMatchStartState.READY
SetUIVar( level, "privatematch_starting", ePrivateMatchStartState.READY )
@@ -62,6 +66,10 @@ bool function ClientCommandCallback_PrivateMatchSetMode( entity player, array<st
if ( args.len() != 1 )
return true
+ if ( GetConVarInt( "ns_private_match_only_host_can_change_settings" ) == 2 )
+ if ( !NSIsPlayerIndexLocalPlayer( player.GetPlayerIndex() ) )
+ return true
+
// todo: need to verify this value
file.mode = args[0]
//GameRules_SetGameMode( args[0] ) // can't do this here due to out of sync errors with new clients
@@ -80,6 +88,10 @@ bool function ClientCommandCallback_SetCustomMap( entity player, array<string> a
if ( args.len() != 1 )
return true
+ if ( GetConVarInt( "ns_private_match_only_host_can_change_settings" ) == 2 )
+ if ( !NSIsPlayerIndexLocalPlayer( player.GetPlayerIndex() ) )
+ return true
+
// todo: need to verify this value
file.map = args[0]
@@ -190,6 +202,10 @@ bool function ClientCommandCallback_PrivateMatchSetPlaylistVarOverride( entity p
{
if ( args.len() < 2 )
return true
+
+ if ( GetConVarInt( "ns_private_match_only_host_can_change_settings" ) >= 1 )
+ if ( !NSIsPlayerIndexLocalPlayer( player.GetPlayerIndex() ) )
+ return true
bool found = false
foreach ( string category in GetPrivateMatchSettingCategories() )
@@ -212,6 +228,10 @@ bool function ClientCommandCallback_PrivateMatchSetPlaylistVarOverride( entity p
bool function ClientCommandCallback_ResetMatchSettingsToDefault( entity player, array<string> args )
{
+ if ( GetConVarInt( "ns_private_match_only_host_can_change_settings" ) >= 1 )
+ if ( !NSIsPlayerIndexLocalPlayer( player.GetPlayerIndex() ) )
+ return true
+
ClearPlaylistVarOverrides()
return true
} \ No newline at end of file