diff --git a/GameFiles/PT6/README.MD b/GameFiles/PT6/README.MD new file mode 100644 index 000000000..b38f41c7b --- /dev/null +++ b/GameFiles/PT6/README.MD @@ -0,0 +1,35 @@ +# T6 + +This brings IW4M-Admins's Anti-cheat to Plutonium T6 +The following limitations are known: +* Can't get the recoil from weapons fire; you have to disable this detection type manually. +* in extreme cases it can produce false positives for Snap and Offset detection. + +## Installation + + +Move `_customcallbacks.gsc` to `%localappdata%\Plutonium\storage\t6\scripts\mp\` + +Add this to the WeaponNameParserConfigurations List in the StatsPluginSettings.json file: + +``` + { + "Game": "T6", + "Delimiters": [ + "_", + "+" + ], + "WeaponSuffix": "mp", + "WeaponPrefix": null + } +``` + +Now create the following entry for __EVERY__ T6 server you are using this on in the ServerDetectionTypes list: + +``` + "1270014976": [ + "Offset", + "Strain", + "Snap" + ] +``` \ No newline at end of file diff --git a/GameFiles/PT6/storage/t6/scripts/mp/_customcallbacks.gsc b/GameFiles/PT6/storage/t6/scripts/mp/_customcallbacks.gsc new file mode 100644 index 000000000..909b02921 Binary files /dev/null and b/GameFiles/PT6/storage/t6/scripts/mp/_customcallbacks.gsc differ diff --git a/GameFiles/PT6/t6r/data/maps/mp/gametypes/_clientids.gsc.src b/GameFiles/PT6/storage/t6/scripts/mp/_customcallbacks.gsc.src similarity index 91% rename from GameFiles/PT6/t6r/data/maps/mp/gametypes/_clientids.gsc.src rename to GameFiles/PT6/storage/t6/scripts/mp/_customcallbacks.gsc.src index 59af24a40..e0916d8c4 100644 --- a/GameFiles/PT6/t6r/data/maps/mp/gametypes/_clientids.gsc.src +++ b/GameFiles/PT6/storage/t6/scripts/mp/_customcallbacks.gsc.src @@ -3,24 +3,6 @@ #include common_scripts\utility; init() -{ - level.clientid = 0; - level thread onplayerconnect(); - level thread IW4MA_init(); -} - -onplayerconnect() -{ - for ( ;; ) - { - level waittill( "connecting", player ); - player.clientid = level.clientid; - level.clientid++; - } -} - - -IW4MA_init() { SetDvarIfUninitialized( "sv_customcallbacks", true ); SetDvarIfUninitialized( "sv_framewaittime", 0.05 ); @@ -29,53 +11,52 @@ IW4MA_init() SetDvarIfUninitialized( "sv_printradarupdates", 0 ); SetDvarIfUninitialized( "sv_printradar_updateinterval", 500 ); SetDvarIfUninitialized( "sv_iw4madmin_url", "http://127.0.0.1:1624" ); - - level thread IW4MA_onPlayerConnect(); + + level thread onPlayerConnect(); if (getDvarInt("sv_printradarupdates") == 1) { level thread runRadarUpdates(); } - + level waittill( "prematch_over" ); level.callbackPlayerKilled = ::Callback_PlayerKilled; level.callbackPlayerDamage = ::Callback_PlayerDamage; level.callbackPlayerDisconnect = ::Callback_PlayerDisconnect; } -//Does not exist in T6 +//It's called slightly different in T6 +//set_dvar_if_unset(dvar, val, reset) SetDvarIfUninitialized(dvar, val) { - curval = getDvar(dvar); - if (curval == "") - SetDvar(dvar,val); + set_dvar_if_unset(dvar,val); } -IW4MA_onPlayerConnect( player ) +onPlayerConnect( player ) { for( ;; ) { level waittill( "connected", player ); player thread waitForFrameThread(); - //player thread waitForAttack(); + player thread waitForAttack(); } } -//Does not work in T6 -/*waitForAttack() +//Got added to T6 on April 2020 +waitForAttack() { self endon( "disconnect" ); - + self.lastAttackTime = 0; - + for( ;; ) { self notifyOnPlayerCommand( "player_shot", "+attack" ); self waittill( "player_shot" ); - + self.lastAttackTime = getTime(); } -}*/ +} runRadarUpdates() { @@ -95,7 +76,7 @@ runRadarUpdates() } wait( interval / 1000 ); - } + } } hitLocationToBone( hitloc ) @@ -144,7 +125,7 @@ hitLocationToBone( hitloc ) waitForFrameThread() { self endon( "disconnect" ); - + self.currentAnglePosition = 0; self.anglePositions = []; @@ -152,7 +133,7 @@ waitForFrameThread() { self.anglePositions[i] = self getPlayerAngles(); } - + for( ;; ) { self.anglePositions[self.currentAnglePosition] = self getPlayerAngles(); @@ -165,9 +146,9 @@ waitForAdditionalAngles( logString, beforeFrameCount, afterFrameCount ) { currentIndex = self.currentAnglePosition; wait( 0.05 * afterFrameCount ); - + self.angleSnapshot = []; - + for( j = 0; j < self.anglePositions.size; j++ ) { self.angleSnapshot[j] = self.anglePositions[j]; @@ -209,7 +190,7 @@ waitForAdditionalAngles( logString, beforeFrameCount, afterFrameCount ) i++; } - lastAttack = 100;//int(getTime()) - int(self.lastAttackTime); + lastAttack = int(getTime()) - int(self.lastAttackTime); isAlive = isAlive(self); logPrint(logString + ";" + anglesStr + ";" + isAlive + ";" + lastAttack + "\n" ); @@ -261,7 +242,7 @@ Callback_PlayerDamage( eInflictor, attacker, iDamage, iDFlags, sMeansOfDeath, sW { return; } - + if ( self.health - iDamage > 0 ) { self Process_Hit( "Damage", attacker, sHitLoc, sMeansOfDeath, iDamage, sWeapon ); diff --git a/GameFiles/PT6/t6r/data/maps/mp/gametypes/_clientids.gsc b/GameFiles/PT6/t6r/data/maps/mp/gametypes/_clientids.gsc deleted file mode 100644 index e511aac9b..000000000 Binary files a/GameFiles/PT6/t6r/data/maps/mp/gametypes/_clientids.gsc and /dev/null differ