From c15073a49a6f7814deef65f9d935289468914cb1 Mon Sep 17 00:00:00 2001 From: BobTheBob <32057864+BobTheBob9@users.noreply.github.com> Date: Fri, 24 Dec 2021 20:05:14 +0000 Subject: fix grace period being allowed in titans --- .../mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut | 15 ++++++++------- .../mod/scripts/vscripts/_loadouts_mp.gnut | 2 +- .../mod/scripts/vscripts/gamemodes/_gamemode_lts.nut | 1 + .../mod/scripts/vscripts/gamemodes/_gamemode_ttdm.nut | 1 + .../mod/scripts/vscripts/mp/_gamestate_mp.nut | 3 +++ 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut b/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut index de4a663ec..97072ab52 100644 --- a/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut +++ b/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut @@ -127,6 +127,14 @@ void function UpdateShownPage() Hud_SetVisible( Hud_GetChild( menu, "NextModeIcon" ), false ) Hud_SetVisible( Hud_GetChild( menu, "NextGameModeName" ), false ) + if ( NSGetServerCount() == 0 ) + { + Hud_SetEnabled( serverButtons[ 0 ], true ) + Hud_SetVisible( serverButtons[ 0 ], true ) + SetButtonRuiText( serverButtons[ 0 ], "#NS_SERVERBROWSER_NOSERVERS" ) + return + } + for ( int i = 0; ( file.page * BUTTONS_PER_PAGE ) + i < NSGetServerCount() - 1 && i < serverButtons.len(); i++ ) { int serverIndex = ( file.page * BUTTONS_PER_PAGE ) + i @@ -135,13 +143,6 @@ void function UpdateShownPage() Hud_SetVisible( serverButtons[ i ], true ) SetButtonRuiText( serverButtons[ i ], NSGetServerName( serverIndex ) ) } - - if ( NSGetServerCount() == 0 ) - { - Hud_SetEnabled( serverButtons[ 0 ], true ) - Hud_SetVisible( serverButtons[ 0 ], true ) - SetButtonRuiText( serverButtons[ 0 ], "#NS_SERVERBROWSER_NOSERVERS" ) - } } void function OnServerFocused( var button ) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/_loadouts_mp.gnut b/Northstar.CustomServers/mod/scripts/vscripts/_loadouts_mp.gnut index af028e71b..abd189e82 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/_loadouts_mp.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/_loadouts_mp.gnut @@ -254,7 +254,7 @@ void function SetPlayerLoadoutDirty( entity player ) void function TryGivePilotLoadoutForGracePeriod( entity player ) { - if ( !IsLobby() && IsAlive( player ) && player.s.loadoutDirty ) + if ( !IsLobby() && IsAlive( player ) && player.s.loadoutDirty && !player.IsTitan() && !player.ContextAction_IsActive() ) { player.s.loadoutDirty = false diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_lts.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_lts.nut index 485981d8d..31c85a573 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_lts.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_lts.nut @@ -22,6 +22,7 @@ void function GamemodeLts_Init() SetShouldUseRoundWinningKillReplay( true ) SetRoundWinningKillReplayKillClasses( true, true ) // both titan and pilot kills are tracked ScoreEvent_SetupEarnMeterValuesForTitanModes() + SetLoadoutGracePeriodEnabled( false ) FlagSet( "ForceStartSpawn" ) AddCallback_OnPilotBecomesTitan( RefreshThirtySecondWallhackHighlight ) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ttdm.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ttdm.nut index c4ffada1b..a7dc00de1 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ttdm.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_ttdm.nut @@ -8,6 +8,7 @@ void function GamemodeTTDM_Init() Riff_ForceTitanExitEnabled( eTitanExitEnabled.Never ) TrackTitanDamageInPlayerGameStat( PGS_ASSAULT_SCORE ) ScoreEvent_SetupEarnMeterValuesForMixedModes() + SetLoadoutGracePeriodEnabled( false ) ClassicMP_SetCustomIntro( TTDMIntroSetup, TTDMIntroLength ) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut index 4b90b1a29..562f65e50 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut @@ -80,6 +80,9 @@ void function PIN_GameStart() void function SetGameState( int newState ) { + if ( newState == GetGameState() ) + return + SetServerVar( "gameStateChangeTime", Time() ) SetServerVar( "gameState", newState ) svGlobal.levelEnt.Signal( "GameStateChanged" ) -- cgit v1.2.3 From 15a37d022a4fb32f0d69ecd6eaa4894209b73c69 Mon Sep 17 00:00:00 2001 From: BobTheBob <32057864+BobTheBob9@users.noreply.github.com> Date: Fri, 24 Dec 2021 23:44:59 +0000 Subject: add more private lobby host settings --- Northstar.CustomServers/mod.json | 10 ++++++++++ .../mod/cfg/autoexec_ns_server.cfg | 3 ++- .../mod/scripts/vscripts/lobby/_private_lobby.gnut | 20 ++++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) 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 @@ -31,6 +31,16 @@ "DefaultValue": "mp_forwardbase_kodai" }, + { + "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", 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 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 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 -- cgit v1.2.3 From e88a2a62c7a7d1352fc3ffa88a016f2a2d7b0ad7 Mon Sep 17 00:00:00 2001 From: BobTheBob <32057864+BobTheBob9@users.noreply.github.com> Date: Sat, 25 Dec 2021 02:41:09 +0000 Subject: fix incorrect earnmeter overdrive value --- Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut index 108909a30..119b1712b 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut @@ -213,7 +213,7 @@ void function ScoreEvent_SetupEarnMeterValuesForMixedModes() // mixed modes in t { // todo needs earn/overdrive values // player-controlled stuff - ScoreEvent_SetEarnMeterValues( "KillPilot", 0.7, 0.15 ) + ScoreEvent_SetEarnMeterValues( "KillPilot", 0.07, 0.15 ) ScoreEvent_SetEarnMeterValues( "KillTitan", 0.0, 0.15 ) ScoreEvent_SetEarnMeterValues( "TitanKillTitan", 0.0, 0.0 ) // unsure ScoreEvent_SetEarnMeterValues( "PilotBatteryStolen", 0.0, 0.35 ) // this actually just doesn't have overdrive in vanilla even -- cgit v1.2.3 From e4faa247edaf389d4d52e3a3129af540bb19a0ac Mon Sep 17 00:00:00 2001 From: BobTheBob <32057864+BobTheBob9@users.noreply.github.com> Date: Sat, 25 Dec 2021 04:51:27 +0000 Subject: fix server browser showing n-1 servers --- Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut b/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut index 97072ab52..03009764a 100644 --- a/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut +++ b/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut @@ -135,7 +135,10 @@ void function UpdateShownPage() return } - for ( int i = 0; ( file.page * BUTTONS_PER_PAGE ) + i < NSGetServerCount() - 1 && i < serverButtons.len(); i++ ) + // this trycatch likely isn't necessary, but i can't test whether this'll error on higher pagecounts and want to go sleep + try + { + for ( int i = 0; ( file.page * BUTTONS_PER_PAGE ) + i < NSGetServerCount() && i < serverButtons.len(); i++ ) { int serverIndex = ( file.page * BUTTONS_PER_PAGE ) + i @@ -143,6 +146,8 @@ void function UpdateShownPage() Hud_SetVisible( serverButtons[ i ], true ) SetButtonRuiText( serverButtons[ i ], NSGetServerName( serverIndex ) ) } + } + catch(ex) {} } void function OnServerFocused( var button ) -- cgit v1.2.3