From f00a45cc99113f2fe412284a17637039b735b3f7 Mon Sep 17 00:00:00 2001 From: Dinorush Date: Mon, 14 Feb 2022 21:24:26 -0500 Subject: Fix non-player and invalid ent assist crashes + self-assists --- Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_gg.gnut | 5 ++++- .../mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut | 3 +++ .../mod/scripts/vscripts/mp/_base_gametype_mp.gnut | 3 +++ Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut | 3 +++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_gg.gnut b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_gg.gnut index 4d3d6612..b27892f7 100644 --- a/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_gg.gnut +++ b/Northstar.Custom/mod/scripts/vscripts/gamemodes/_gamemode_gg.gnut @@ -81,7 +81,10 @@ void function OnPlayerKilled( entity victim, entity attacker, var damageInfo ) table alreadyAssisted foreach( DamageHistoryStruct attackerInfo in victim.e.recentDamageHistory ) { - if( attackerInfo.attacker != attacker && !( attackerInfo.attacker.GetEncodedEHandle() in alreadyAssisted ) ) + if ( !IsValid( attackerInfo.attacker ) || !attackerInfo.attacker.IsPlayer() || attackerInfo.attacker == victim ) + continue + + if ( attackerInfo.attacker != attacker && !( attackerInfo.attacker.GetEncodedEHandle() in alreadyAssisted ) ) { if ( attackerInfo.damageSourceId != eDamageSourceId.melee_pilot_emptyhanded ) { alreadyAssisted[attackerInfo.attacker.GetEncodedEHandle()] <- true diff --git a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut index a3ea5172..962549b4 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/gamemodes/_gamemode_tdm.nut @@ -16,6 +16,9 @@ void function GiveScoreForPlayerKill( entity victim, entity attacker, var damage table alreadyAssisted foreach( DamageHistoryStruct attackerInfo in victim.e.recentDamageHistory ) { + if ( !IsValid( attackerInfo.attacker ) || !attackerInfo.attacker.IsPlayer() || attackerInfo.attacker == victim ) + continue + bool exists = attackerInfo.attacker.GetEncodedEHandle() in alreadyAssisted ? true : false if( attackerInfo.attacker != attacker && !exists ) { diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut index feca3bd5..18684b05 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut @@ -284,6 +284,9 @@ void function PostDeathThread_MP( entity player, var damageInfo ) // based on ga table alreadyAssisted foreach( DamageHistoryStruct attackerInfo in player.e.recentDamageHistory ) { + if ( !IsValid( attackerInfo.attacker ) || !attackerInfo.attacker.IsPlayer() || attackerInfo.attacker == player ) + continue + bool exists = attackerInfo.attacker.GetEncodedEHandle() in alreadyAssisted ? true : false if( attackerInfo.attacker != attacker && !exists ) { diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut index b7fd4d52..36862d8a 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_score.nut @@ -194,6 +194,9 @@ void function ScoreEvent_TitanKilled( entity victim, entity attacker, var damage table alreadyAssisted foreach( DamageHistoryStruct attackerInfo in victim.e.recentDamageHistory ) { + if ( !IsValid( attackerInfo.attacker ) || !attackerInfo.attacker.IsPlayer() || attackerInfo.attacker == victim ) + continue + bool exists = attackerInfo.attacker.GetEncodedEHandle() in alreadyAssisted ? true : false if( attackerInfo.attacker != attacker && !exists ) { -- cgit v1.2.3 From 031089460eda53bd4af5e0b1bf7a0dfb7d41ef3e Mon Sep 17 00:00:00 2001 From: Dinorush <62536724+Dinorush@users.noreply.github.com> Date: Tue, 15 Feb 2022 01:25:19 -0500 Subject: Check attacker validity JFS --- .../mod/scripts/vscripts/mp/_base_gametype_mp.gnut | 23 +++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut index 18684b05..b3f1c5cb 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut @@ -282,20 +282,21 @@ void function PostDeathThread_MP( entity player, var damageInfo ) // based on ga int methodOfDeath = DamageInfo_GetDamageSourceIdentifier( damageInfo ) table alreadyAssisted - foreach( DamageHistoryStruct attackerInfo in player.e.recentDamageHistory ) + if ( IsValid( attacker ) ) { - if ( !IsValid( attackerInfo.attacker ) || !attackerInfo.attacker.IsPlayer() || attackerInfo.attacker == player ) - continue - - bool exists = attackerInfo.attacker.GetEncodedEHandle() in alreadyAssisted ? true : false - if( attackerInfo.attacker != attacker && !exists ) + foreach( DamageHistoryStruct attackerInfo in player.e.recentDamageHistory ) { - alreadyAssisted[attackerInfo.attacker.GetEncodedEHandle()] <- true - Remote_CallFunction_NonReplay( attackerInfo.attacker, "ServerCallback_SetAssistInformation", attackerInfo.damageSourceId, attacker.GetEncodedEHandle(), player.GetEncodedEHandle(), attackerInfo.time ) - AddPlayerScore(attackerInfo.attacker, "PilotAssist" ) - } - + if ( !IsValid( attackerInfo.attacker ) || !attackerInfo.attacker.IsPlayer() || attackerInfo.attacker == player ) + continue + bool exists = attackerInfo.attacker.GetEncodedEHandle() in alreadyAssisted ? true : false + if( attackerInfo.attacker != attacker && !exists ) + { + alreadyAssisted[attackerInfo.attacker.GetEncodedEHandle()] <- true + Remote_CallFunction_NonReplay( attackerInfo.attacker, "ServerCallback_SetAssistInformation", attackerInfo.damageSourceId, attacker.GetEncodedEHandle(), player.GetEncodedEHandle(), attackerInfo.time ) + AddPlayerScore(attackerInfo.attacker, "PilotAssist" ) + } + } } player.p.rematchOrigin = player.p.deathOrigin -- cgit v1.2.3 From 482380091f93a2d86ea2f959fca6aadd2646700a Mon Sep 17 00:00:00 2001 From: ASpoonPlaysGames <66967891+ASpoonPlaysGames@users.noreply.github.com> Date: Wed, 16 Feb 2022 10:00:15 +0000 Subject: Fixed battery bug in LTS (#218) Remove all batteries from players at the end of a round for round-based modes --- Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut index 5d27a17e..85cc0de5 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut @@ -666,7 +666,7 @@ void function CleanUpEntitiesForRoundEnd() foreach ( entity player in GetPlayerArray() ) { ClearTitanAvailable( player ) - + player.SetPlayerNetInt( "batteryCount", 0 ) if ( IsAlive( player ) ) player.Die( svGlobal.worldspawn, svGlobal.worldspawn, { damageSourceId = eDamageSourceId.round_end } ) } @@ -675,7 +675,6 @@ void function CleanUpEntitiesForRoundEnd() { if ( !IsValid( npc ) ) continue - // kill rather than destroy, as destroying will cause issues with children which is an issue especially for dropships and titans npc.Die( svGlobal.worldspawn, svGlobal.worldspawn, { damageSourceId = eDamageSourceId.round_end } ) } @@ -854,4 +853,4 @@ float function GetTimeLimit_ForGameMode() // default to 10 mins, because that seems reasonable return GetCurrentPlaylistVarFloat( playlistString, 10 ) -} \ No newline at end of file +} -- cgit v1.2.3 From 2fbac6097ed995960f7a3fd5b1b0943d78150e15 Mon Sep 17 00:00:00 2001 From: Dinorush <62536724+Dinorush@users.noreply.github.com> Date: Wed, 16 Feb 2022 05:13:19 -0500 Subject: Cleanup tracked player projectiles on round end (#219) --- Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut | 1 + 1 file changed, 1 insertion(+) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut index 85cc0de5..aa14477a 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut @@ -666,6 +666,7 @@ void function CleanUpEntitiesForRoundEnd() foreach ( entity player in GetPlayerArray() ) { ClearTitanAvailable( player ) + PROTO_CleanupTrackedProjectiles( player ) player.SetPlayerNetInt( "batteryCount", 0 ) if ( IsAlive( player ) ) player.Die( svGlobal.worldspawn, svGlobal.worldspawn, { damageSourceId = eDamageSourceId.round_end } ) -- cgit v1.2.3 From 031d351db8900f5f7dc8aed0ea59e9f902667b84 Mon Sep 17 00:00:00 2001 From: Tom Barham Date: Thu, 17 Feb 2022 00:29:39 +1000 Subject: Log player UIDs on connect (#220) --- Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut index b3f1c5cb..d7514b29 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_base_gametype_mp.gnut @@ -132,7 +132,7 @@ void function CodeCallback_OnClientConnectionStarted( entity player ) callbackFunc( player ) } - printl( "Player connect started: " + player ) + printl( "Player connect started: " + player + "---UID:" + player.GetUID() ) InitPassives( player ) } -- cgit v1.2.3