aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-12-24 23:44:59 +0000
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-12-24 23:44:59 +0000
commit15a37d022a4fb32f0d69ecd6eaa4894209b73c69 (patch)
treee294c7ba54103314e41e2bb207fc4e161f096f21
parentc15073a49a6f7814deef65f9d935289468914cb1 (diff)
downloadNorthstarMods-15a37d022a4fb32f0d69ecd6eaa4894209b73c69.tar.gz
NorthstarMods-15a37d022a4fb32f0d69ecd6eaa4894209b73c69.zip
add more private lobby host settings
-rw-r--r--Northstar.CustomServers/mod.json10
-rw-r--r--Northstar.CustomServers/mod/cfg/autoexec_ns_server.cfg3
-rw-r--r--Northstar.CustomServers/mod/scripts/vscripts/lobby/_private_lobby.gnut20
3 files changed, 32 insertions, 1 deletions
diff --git a/Northstar.CustomServers/mod.json b/Northstar.CustomServers/mod.json
index 8a37ef09d..998262417 100644
--- a/Northstar.CustomServers/mod.json
+++ b/Northstar.CustomServers/mod.json
@@ -32,6 +32,16 @@
},
{
+ "Name": "ns_private_match_only_host_can_change_settings",
+ "DefaultValue": "0"
+ },
+
+ {
+ "Name": "ns_private_match_only_host_can_start",
+ "DefaultValue": "0"
+ },
+
+ {
// default 0 because broken
"Name": "ns_private_match_override_maxplayers",
"DefaultValue": "0"
diff --git a/Northstar.CustomServers/mod/cfg/autoexec_ns_server.cfg b/Northstar.CustomServers/mod/cfg/autoexec_ns_server.cfg
index 3d323c012..cfd0ffe84 100644
--- a/Northstar.CustomServers/mod/cfg/autoexec_ns_server.cfg
+++ b/Northstar.CustomServers/mod/cfg/autoexec_ns_server.cfg
@@ -15,7 +15,8 @@ everything_unlocked 1 // unlock everything
ns_should_return_to_lobby 1 // whether the server should return to private match lobby after completing a game, if 0, this will go to the next map/mode in the playlist
net_chan_limit_mode 2 // kick clients that go over the limit
-net_chan_limit_msec_per_sec 30 // number of milliseconds of server netchan processing time clients can use per second before getting kicked
+net_chan_limit_msec_per_sec 100 // number of milliseconds of server netchan processing time clients can use per second before getting kicked
+sv_querylimit_per_sec 10 // number of connectionless packets clients can send to this server per second without getting blocked
base_tickinterval_mp 0.016666667 // default tickrate: 60 tick
sv_updaterate_mp 20 // default updaterate: 20 tick
sv_minupdaterate 20 // unsure if this actually works, but if it does, should set minimum client updaterate
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/lobby/_private_lobby.gnut b/Northstar.CustomServers/mod/scripts/vscripts/lobby/_private_lobby.gnut
index 3acd16529..b5c6ea32f 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