diff --git a/Classic/prefs/serverPrefs.cs b/Classic/prefs/serverPrefs.cs index bee4996..afc03ba 100644 --- a/Classic/prefs/serverPrefs.cs +++ b/Classic/prefs/serverPrefs.cs @@ -39,9 +39,8 @@ $Host::ClassicConnectLog = 1; $Host::ClassicConnLogPath = "logs/Connect/Connect.log"; $Host::ClassicCycleMisTypes = 0; $Host::ClassicDailyHardRestart = 0; -$Host::ClassicDailyHardRestartTime = "10\t00\tam"; +$Host::ClassicDailyHardRestartTime = "6\t00\tam"; $Host::ClassicEchoChat = 0; -$Host::ClassicEvoStats = 1; $Host::ClassicFairTeams = 1; $Host::ClassicLimitArmors = 0; $Host::ClassicLoadBlasterChanges = 0; @@ -69,7 +68,6 @@ $Host::ClassicRandomMisTypes = 0; $Host::ClassicRestartTime = 12; $Host::ClassicRotationCustom = 1; $Host::ClassicRotationFile = "prefs/mapRotation.cs"; -$Host::ClassicStatsType = 2; $Host::ClassicSuperAdminPassword = "changeme"; $Host::ClassicSuppressTraversalRootError = 1; $Host::ClassicTeamKillLog = 1; diff --git a/Classic/scripts/CTFGame.cs b/Classic/scripts/CTFGame.cs index e384604..0474942 100755 --- a/Classic/scripts/CTFGame.cs +++ b/Classic/scripts/CTFGame.cs @@ -466,30 +466,6 @@ function CTFGame::playerTouchEnemyFlag(%game, %player, %flag) if (%startStalemate) %game.stalemateSchedule = %game.schedule(%game.stalemateTimeMS, beginStalemate); - if($Host::ClassicEvoStats) - { - $stats::grabs[%client]++; - if($stats::grabs[%client] > $stats::grabs_counter) - { - $stats::grabs_counter = $stats::grabs[%client]; - $stats::grabs_client = getTaggedString(%client.name); - } - } - - if($Host::ClassicEvoStats) - %game.totalFlagHeldTime[%flag] = getSimTime(); - } - - if($Host::ClassicEvoStats && !%player.flagStatsWait) - { - // get the grab speed - %grabspeed = mFloor(VectorLen(setWord(%player.getVelocity(), 2, 0)) * 3.6); - - if(%grabspeed > $stats::MaxGrabSpeed || ($stats::MaxGrabSpeed $= "")) - { - $stats::MaxGrabSpeed = %grabspeed; - $stats::Grabber = getTaggedString(%client.name); - } } %flag.hide(true); @@ -566,8 +542,6 @@ function CTFGame::playerDroppedFlag(%game, %player) %game.playerLostFlagTarget(%player); - if($Host::ClassicEvoStats) - %game.totalFlagHeldTime[%flag] = 0; %player.holdingFlag = ""; //player isn't holding a flag anymore %flag.carrier = ""; //flag isn't held anymore @@ -625,65 +599,6 @@ function CTFGame::flagCap(%game, %player) %game.playerLostFlagTarget(%player); - if($Host::ClassicEvoStats) - { - %record = false; - %mincheck = false; - if($TotalTeamPlayerCount >= $Host::MinFlagRecordPlayerCount) - %mincheck = true; - if(%game.totalFlagHeldTime[%flag]) - { - %held2 = getSimTime() - %game.totalFlagHeldTime[%flag]; - %realtime = %game.formatTime(%held2, true); - %tm = %client.team; - - if(%tm == 1 || %tm == 2) - { - if((%held2 < $flagstats::heldTeam[%tm]) || $flagstats::heldTeam[%tm] == 0) - { - if(%mincheck) - { - %prevheld2 = $flagstats::heldTeam[%tm]; - $flagstats::heldTeam[%tm] = %held2; - $flagstats::realTeam[%tm] = %realTime; - $flagstats::nickTeam[%tm] = %client.nameBase; - } - %record = true; - } - } - - if(%record == true) - { - if(%mincheck) - { - %fileOut = "stats/maps/classic/" @ $CurrentMissionType @ "/" @ $CurrentMission @ ".txt"; - export("$flagstats::*", %fileOut, false); - if(%prevheld2) - %saved = "\c2Saved: \c3-" @ %game.formatTime(%prevheld2 - %held2, true) @ "\c2"; - schedule(4000, 0, "messageAll", 'MsgCTFNewRecord', "\c2It's a new record! Time: \c3"@%realtime@"\c2 " @ %saved @ "~wfx/misc/hunters_horde.wav"); - } - else - schedule(4000, 0, "messageClient", %client, '', "\c2New flag records are disabled until" SPC $Host::MinFlagRecordPlayerCount SPC "players."); - } - - bottomprint(%client, "You captured the flag in" SPC %realTime SPC "seconds.", 10, 1); - - $stats::caps[%client]++; - if($stats::caps[%client] > $stats::caps_counter) - { - $stats::caps_counter = $stats::caps[%client]; - $stats::caps_client = getTaggedString(%client.name); - } - - if(%held2 < $stats::fastestCap || !$stats::fastestCap) - { - $stats::fastestCap = %held2; - $stats::fastcap_time = %realTime; - $stats::fastcap_client = getTaggedString(%client.name); - } - } - } - //award points to player and team %teamName = %game.getTeamName(%flag.team); messageTeamExcept(%client, 'MsgCTFFlagCapped', '\c2%1 captured the %2 flag! (Held: %5)~wfx/misc/flag_capture.wav', %client.name, %teamName, %flag.team, %client.team, %held); @@ -1793,9 +1708,6 @@ function CTFGame::boundaryLoseFlag(%game, %player) %held = %game.formatTime(getSimTime() - %game.flagHeldTime[%flag], false); // z0dd - ZOD, 8/15/02. How long did player hold flag? - if($Host::ClassicEvoStats) - %game.totalFlagHeldTime[%flag] = 0; - %game.playerDroppedFlag(%player); // now for the tricky part -- throwing the flag back into the mission area diff --git a/Classic/scripts/SCtFGame.cs b/Classic/scripts/SCtFGame.cs index 6eee730..2de96a3 100755 --- a/Classic/scripts/SCtFGame.cs +++ b/Classic/scripts/SCtFGame.cs @@ -693,30 +693,6 @@ function SCtFGame::playerTouchEnemyFlag(%game, %player, %flag) if (%startStalemate) %game.stalemateSchedule = %game.schedule(%game.stalemateTimeMS, beginStalemate); - if($Host::ClassicEvoStats) - { - $stats::grabs[%client]++; - if($stats::grabs[%client] > $stats::grabs_counter) - { - $stats::grabs_counter = $stats::grabs[%client]; - $stats::grabs_client = getTaggedString(%client.name); - } - } - - if($Host::ClassicEvoStats) - %game.totalFlagHeldTime[%flag] = getSimTime(); - } - - if($Host::ClassicEvoStats && !%player.flagStatsWait) - { - // get the grab speed - %grabspeed = mFloor(VectorLen(setWord(%player.getVelocity(), 2, 0)) * 3.6); - - if(%grabspeed > $stats::MaxGrabSpeed || ($stats::MaxGrabSpeed $= "")) - { - $stats::MaxGrabSpeed = %grabspeed; - $stats::Grabber = getTaggedString(%client.name); - } } %flag.hide(true); @@ -791,9 +767,6 @@ function SCtFGame::playerDroppedFlag(%game, %player) %game.playerLostFlagTarget(%player); - if($Host::ClassicEvoStats) - %game.totalFlagHeldTime[%flag] = 0; - %player.holdingFlag = ""; //player isn't holding a flag anymore %flag.carrier = ""; //flag isn't held anymore $flagStatus[%flag.team] = ""; @@ -850,65 +823,6 @@ function SCtFGame::flagCap(%game, %player) %game.playerLostFlagTarget(%player); - if($Host::ClassicEvoStats) - { - %record = false; - %mincheck = false; - if($TotalTeamPlayerCount >= $Host::MinFlagRecordPlayerCount) - %mincheck = true; - if(%game.totalFlagHeldTime[%flag]) - { - %held2 = getSimTime() - %game.totalFlagHeldTime[%flag]; - %realtime = %game.formatTime(%held2, true); - %tm = %client.team; - - if(%tm == 1 || %tm == 2) - { - if((%held2 < $flagstats::heldTeam[%tm]) || $flagstats::heldTeam[%tm] == 0) - { - if(%mincheck) - { - %prevheld2 = $flagstats::heldTeam[%tm]; - $flagstats::heldTeam[%tm] = %held2; - $flagstats::realTeam[%tm] = %realTime; - $flagstats::nickTeam[%tm] = %client.nameBase; - } - %record = true; - } - } - - if(%record == true) - { - if(%mincheck) - { - %fileOut = "stats/maps/classic/" @ $CurrentMissionType @ "/" @ $CurrentMission @ ".txt"; - export("$flagstats::*", %fileOut, false); - if(%prevheld2) - %saved = "\c2Saved: \c3-" @ %game.formatTime(%prevheld2 - %held2, true) @ "\c2"; - schedule(4000, 0, "messageAll", 'MsgCTFNewRecord', "\c2It's a new record! Time: \c3"@%realtime@"\c2 " @ %saved @ "~wfx/misc/hunters_horde.wav"); - } - else - schedule(4000, 0, "messageClient", %client, '', "\c2New flag records are disabled until" SPC $Host::MinFlagRecordPlayerCount SPC "players."); - } - - bottomprint(%client, "You captured the flag in" SPC %realTime SPC "seconds.", 10, 1); - - $stats::caps[%client]++; - if($stats::caps[%client] > $stats::caps_counter) - { - $stats::caps_counter = $stats::caps[%client]; - $stats::caps_client = getTaggedString(%client.name); - } - - if(%held2 < $stats::fastestCap || !$stats::fastestCap) - { - $stats::fastestCap = %held2; - $stats::fastcap_time = %realTime; - $stats::fastcap_client = getTaggedString(%client.name); - } - } - } - //award points to player and team %teamName = %game.getTeamName(%flag.team); messageTeamExcept(%client, 'MsgCTFFlagCapped', '\c2%1 captured the %2 flag! (Held: %5)~wfx/misc/flag_capture.wav', %client.name, %teamName, %flag.team, %client.team, %held); @@ -1907,9 +1821,6 @@ function SCtFGame::boundaryLoseFlag(%game, %player) %held = %game.formatTime(getSimTime() - %game.flagHeldTime[%flag], false); // z0dd - ZOD, 8/15/02. How long did player hold flag? - if($Host::ClassicEvoStats) - %game.totalFlagHeldTime[%flag] = 0; - %game.playerDroppedFlag(%player); // now for the tricky part -- throwing the flag back into the mission area diff --git a/Classic/scripts/autoexec/EvoStats.cs b/Classic/scripts/autoexec/EvoStats.cs deleted file mode 100755 index f32a632..0000000 --- a/Classic/scripts/autoexec/EvoStats.cs +++ /dev/null @@ -1,428 +0,0 @@ -// Eolk - People like evo's stats a lot... so that's what we'll give them... -$weap_message[1] = "Blaster master"; -$weap_message[2] = "Plasma roaster"; -$weap_message[3] = "Chainwh0re"; -$weap_message[4] = "Disc-O-maniac"; -$weap_message[5] = "Grenade puppy"; -$weap_message[6] = "Laser turret"; -$weap_message[8] = "Mortar maniac"; -$weap_message[9] = "Missile lamer"; -$weap_message[10] = "Shocklance bee"; -$weap_message[11] = "Mine mayhem"; -$weap_message[13] = "Road killer"; -// Extra Stats -$weap_message[31] = "Demoman"; -$weap_message[21] = "Clamp Farmer"; -$weap_message[22] = "Spike Farmer"; -$weap_message[26] = "Shrike Gunner"; -$weap_message[27] = "Tailgunner"; -$weap_message[28] = "Bombardier"; -$weap_message[29] = "Tank Gunner (chain)"; -$weap_message[30] = "Tank Gunner (mortar)"; -$weap_message[31] = "Satchel Punk"; -$weap_message[50] = "Combo King (mine+disc)"; - -// Handlers -package EvoStatHandles -{ - -function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC) -{ - Parent::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC); - // call the function - if($Host::ClassicEvoStats) - handleDamageStat(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC); -} - -function DefaultGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLocation) -{ - Parent::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLocation); - // call the function - if($Host::ClassicEvoStats) - handleKillStat(%game, %clVictim, %clKiller, %damageType, %implement, %damageLocation); -} - -function ProjectileData::onCollision(%data, %projectile, %targetObject, %modifier, %position, %normal) -{ - if(isObject(%targetObject)) // Console spam fix. - { - // call the function - if($Host::ClassicEvoStats) - handleMAStat(%data, %projectile, %targetObject, %modifier, %position, %normal); - } - Parent::onCollision( %data, %projectile, %targetObject, %modifier, %position, %normal ); -} - -}; - -// Prevent package from being activated if it is already -if (!isActivePackage(EvoStatHandles)) - activatePackage(EvoStatHandles); - -// handleDamageStat(%targetObject, %sourceObject, %position, %amount, %damageType) -// Info: Calcs: Damage and SnipeShot detection. -function handleDamageStat(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC) -{ - // Reject damage that is not player initiated. - if(%damageType == 7 || %damageType == 12 || %damageType == 14 || %damageType == 24 || %damageType == 25 || %damageType == 33 || %damageType == 35 || %damageType == 36 || %damageType == 98 || %damageType == 99) - return; - - // failsafe - if(!isObject(%sourceObject) || %sourceObject $= "" || !isObject(%targetObject) || %targetObject $= "") - return; - - // don't count damage done to vehicles - if(%targetObject.isMounted()) - return; - - // Vehicle Impacts. - if(%damageType == 13){ // run down by vehicle - if(!(%attacker = %sourceObject.getControllingClient()) > 0){ - return; - } - } - // Turrets. - else if(%sourceObject.getClassName() $= "Turret" || %sourceObject.getClassName() $= "VehicleTurret" || %sourceObject.getClassName() $= "FlyingVehicle" || %sourceObject.getClassName() $= "HoverVehicle"){ - // Controlled - %attacker = %sourceObject.getControllingClient(); //is turret being controlled? - if(%attacker == 0){ // Not controlled. - // Owned - if(isObject(%sourceObject.owner)){ - %attacker = %sourceObject.owner; - } - // Automated & no-owner. - else{ - return; - } - } - } else { // Pretty much anything else. - %attacker = %sourceObject.client; - } - - %victim = %targetObject.client; - - // failsafe - if(%attacker $= "" || %victim $= "" || %attacker $= %victim) - return; - - // check if it's a tk - if(Game.numTeams > 1 && %attacker.team $= %victim.team) - return; - - // store the damage - if($Host::ClassicStatsType == 2) - { - // Teratos: Going to add mine+disc as a category... - // Teratos: Tracking only gets the second batch of damage, but we add 85% of that to make up for the first batch of damage (just a dumb estimate so damage numbers look realistic in post-game). - if(%victim.mineDisc) { - //$stats::weapon_damage[%attacker, 50] += %amount + (%amount * (%damageType == 11 ? 0.87 : 1.41)); // Mine accounts for more than disc. - $stats::weapon_damage[%attacker, 50] += %amount + $stats::last_minedisc[%attacker]; - - if($stats::weapon_damage[%attacker, 50] > $stats::weap_table[50]) - { - $stats::weap_table[50] = $stats::weapon_damage[%attacker, 50]; - $stats::client_weap_table[50] = getTaggedString(%attacker.name); - } - } - $stats::last_minedisc[%attacker] = %amount; // Track the last amount of damage so we can add it to the mine+disc. - // Teratos: END Mine+Disc Support. - - $stats::weapon_damage[%attacker, %damageType] += %amount; - - if($stats::weapon_damage[%attacker, %damageType] > $stats::weap_table[%damageType]) - { - $stats::weap_table[%damageType] = $stats::weapon_damage[%attacker, %damageType]; - $stats::client_weap_table[%damageType] = getTaggedString(%attacker.name); - } - } - - // is it a laser damage? - if(%damageType == 6) - { - // i will consider only shots that have been fired with 60% of total energy - if(%sourceObject.getEnergyLevel() / %sourceObject.getDataBlock().maxEnergy < 0.6) - return; - - %distance = mFloor(VectorDist(%position, %sourceObject.getWorldBoxCenter())); - - // max distance for sniper (this is the only fix i could find) - // if(%distance > 1000) - // %distance = 1000; - - // is it an headshot? - if(%victim.headshot) - { - %attacker.hs++; - - if( ( %attacker.showMA $= "" ) || ( %attacker.showMA == 1 ) ) - bottomPrint(%attacker, "HEADSHOT (" @ %attacker.hs @ ")! Distance is " @ %distance @ " meters.", 3); - logEcho(%attacker.nameBase @" (pl "@%attacker.player@"/cl "@%attacker@") headshot ("@%distance@")"); - - if(%attacker.hs > $stats::snipe_counter) - { - $stats::snipe_counter = %attacker.hs; - $stats::snipe_client = getTaggedString(%attacker.name); - } - if(%distance > $stats::snipe_maxdistance) - { - $stats::snipe_maxdistance = %distance; - $stats::snipe_maxdistanceclient = getTaggedString(%attacker.name); - } - } - else // no - { - if(%attacker.showMA $= "" || %attacker.showMA) - bottomPrint(%attacker, "HIT! Distance is " @ %distance @ " meters.", 3); - - if(%distance > $stats::snipe_maxdistance) - { - $stats::snipe_maxdistance = %distance; - $stats::snipe_maxdistanceclient = getTaggedString(%attacker.name); - } - } - - // this callback will allow players to autoscreenshot the shot - messageClient(%attacker, 'MsgSnipeShot', "", %distance); - } -} - -// handleKillStat(%clVictim, %clKiller, %damageType, %implement) -// Info: Calcs: Kills, TeamKills, FC kills -function handleKillStat(%game, %clVictim, %clKiller, %damageType, %implement, %damageLocation) -{ - if(%damageType == 13) // is a roadkill - %clKiller = %implement.getControllingClient(); - - - if ( !isObject( %clVictim ) || !isObject( %clKiller ) ) - return; - - // failsafe - if(%clKiller $= "" || %clVictim $= "" || %clKiller $= %clVictim) - return; - - // is it a tk? - if(%game.numTeams > 1 && %clKiller.team $= %clVictim.team) - { - $stats::tk[%clKiller]++; - - if($stats::tk[%clKiller] > $stats::tk_counter) - { - $stats::tk_counter = $stats::tk[%clKiller]; - $stats::tk_client = getTaggedString(%clKiller.name); - } - } - else // no - { - if($Host::ClassicStatsType == 1) - { - $stats::weapon_kills[%clKiller, %damageType]++; - - if($stats::weapon_kills[%clKiller, %damageType] > $stats::weap_table[%damageType]) - { - $stats::weap_table[%damageType] = $stats::weapon_kills[%clKiller, %damageType]; - $stats::client_weap_table[%damageType] = getTaggedString(%clKiller.name); - } - } - - // was the victim a fc? - if(%clVictim.plyrDiedHoldingFlag) - { - $stats::fckiller[%clKiller]++; - - if($stats::fckiller[%clKiller] > $stats::fckiller_counter) - { - $stats::fckiller_counter = $stats::fckiller[%clKiller]; - $stats::fckiller_client = getTaggedString(%clKiller.name); - } - } - } -} - -// handleMAStat(%projectile, %targetObject, %position) -// Info: MA detection -function handleMAStat(%data, %projectile, %targetObject, %modifier, %position, %normal) -{ - // failsafe - if(!isObject(%targetObject) || %targetObject $= "") - return; - - // failsafe - if(!isObject(%projectile.sourceObject) || %projectile.sourceObject $= "") - return; - - %victim = %targetObject.client; - %killer = %projectile.sourceObject.client; - - // // Altair's method - // %distance = mFloor(VectorDist(%position, %projectile.sourceObject.getWorldBoxCenter())); - - // // Evolution Method - %distance = mFloor(VectorDist(%position, %projectile.initialPosition)); - - // failsafe - if(%victim $= "" || %killer $= "") - return; - - %projectileType = %data.getName() !$= "TR2DiscProjectile" ? %data.getName() : "DiscProjectile"; - - // only disc, plasma, or blaster - if(%projectileType !$= "DiscProjectile" && %projectileType !$= "PlasmaBolt" && %projectileType !$= "EnergyBolt") - return; - - // is it a tk? - if(Game.numTeams > 1 && %killer.team $= %victim.team) - return; - - // Eolk - changes to MA code - %position = %targetObject.getPosition(); - %raycast = containerRaycast(%position, vectorAdd(%position, "0 0 -10"), $TypeMasks::ForceFieldObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::StaticObjectType | $TypeMasks::TerrainObjectType, %targetObject); - if(!isObject(firstWord(%raycast))) // We've got something... - { - switch$(%projectileType) - { - case DiscProjectile: - %killer.midairs++; - - if( ( %killer.showMA $= "" ) || ( %killer.showMA == 1 ) ) - bottomPrint(%killer, "Midair Disk (" @ %killer.midairs @ ")! Distance is " @ %distance @ " meters.", 3); - - // this callback will allow players to autoscreenshot the MA - messageClient(%killer, 'MsgMidAir', "", %distance); - logEcho(%killer.nameBase @" (pl "@%killer.player@"/cl "@%killer@") hit a midair disc shot ("@%distance@")"); - - if(%killer.midairs > $stats::ma_counter) - { - $stats::ma_counter = %killer.midairs; - $stats::ma_client = getTaggedString(%killer.name); - } - - if(%distance > $stats::ma_maxdistance) - { - $stats::ma_maxdistance = %distance; - $stats::ma_maxdistanceclient = getTaggedString(%killer.name); - } - case PlasmaBolt: - %killer.PlaMA++; - - if ( ( %killer.showMA $= "" ) || ( %killer.showMA == 1 ) ) - bottomPrint(%killer, "Midair Plasma (" @ %killer.PlaMA @ ")! Distance is " @ %distance @ " meters.", 3); - - // this callback will allow players to autoscreenshot the MA - messageClient(%killer, 'MsgPlasmaMidAir', "", %distance); - logEcho(%killer.nameBase @" (pl "@%killer.player@"/cl "@%killer@") hit a midair plasma shot ("@%distance@")"); - - if(%killer.PlaMA > $stats::PlaMA_counter) - { - $stats::PlaMA_counter = %killer.PlaMA; - $stats::PlaMA_client = getTaggedString(%killer.name); - } - - if(%distance > $stats::PlaMA_maxdistance) - { - $stats::PlaMA_maxdistance = %distance; - $stats::PlaMA_maxdistanceclient = getTaggedString(%killer.name); - } - case EnergyBolt: - %killer.blaMA++; - - if( ( %killer.showMA $= "" ) || ( %killer.showMA == 1 ) ) - bottomPrint(%killer, "Midair Blaster (" @ %killer.blaMA @ ")! Distance is " @ %distance @ " meters.", 3); - - // this callback will allow players to autoscreenshot the MA - messageClient(%killer, 'MsgBlasterMidAir', "", %distance); - logEcho(%killer.nameBase @" (pl "@%killer.player@"/cl "@%killer@") hit a midair blaster shot ("@%distance@")"); - - if(%killer.blaMA > $stats::BlaMA_counter) - { - $stats::BlaMA_counter = %killer.BlaMA; - $stats::BlaMA_client = getTaggedString(%killer.name); - } - - if(%distance > $stats::BlaMA_maxdistance) - { - $stats::BlaMA_maxdistance = %distance; - $stats::BlaMA_maxdistanceclient = getTaggedString(%killer.name); - } - } - } -} - -// sendEvoDebriefing(%client) -// Info: Send Evo stats to the debriefing page -function sendEvoDebriefing(%client) -{ - // Eolk - Remove redundant checks - messageClient(%client, 'MsgDebriefAddLine', "", '\n%1 - %2', $MissionDisplayName, $MissionTypeDisplayName); - - if($stats::MaxGrabSpeed || $stats::grabs_counter || $stats::fckiller_counter || $stats::caps_counter || $stats::fastestCap) - { - messageClient(%client, 'MsgDebriefAddLine', "", '\nFLAG STATS'); - if($stats::fastestCap) - messageClient(%client, 'MsgDebriefAddLine', "", ' Fastest Cap %1 %2', $stats::fastcap_client, $stats::fastcap_time); - if($stats::MaxGrabSpeed) - messageClient(%client, 'MsgDebriefAddLine', "", ' Flaming Ass %1 %2 Kph!', $stats::Grabber, $stats::MaxGrabSpeed); - if($stats::caps_counter) - messageClient(%client, 'MsgDebriefAddLine', "", ' Cap Mastah %1 %2', $stats::caps_client, $stats::caps_counter); - if($stats::grabs_counter) - messageClient(%client, 'MsgDebriefAddLine', "", ' Grabz0r %1 %2', $stats::grabs_client, $stats::grabs_counter); - if($stats::fckiller_counter) - messageClient(%client, 'MsgDebriefAddLine', "", ' FC killer %1 %2', $stats::fckiller_client, $stats::fckiller_counter); - } - - if($stats::BlaMA_counter || $stats::ma_counter || $stats::PlaMA_counter) - { - messageClient(%client, 'MsgDebriefAddLine', "", '\nMID AIRCHAMPIONDISTANCE'); - - if($stats::ma_counter) - messageClient(%client, 'MsgDebriefAddLine', "", ' Disk %1 (%2) %3 (%4 mt)', $stats::ma_client, $stats::ma_counter, $stats::ma_maxdistanceclient, $stats::ma_maxdistance); - if($stats::PlaMA_counter) - messageClient(%client, 'MsgDebriefAddLine', "", ' Plasma %1 (%2) %3 (%4 mt)', $stats::PlaMA_client, $stats::PlaMA_counter, $stats::PlaMA_maxdistanceclient, $stats::PlaMA_maxdistance); - if($stats::BlaMA_counter) - messageClient(%client, 'MsgDebriefAddLine', "", ' Blaster %1 (%2) %3 (%4 mt)', $stats::BlaMA_client, $stats::BlaMA_counter, $stats::BlaMA_maxdistanceclient, $stats::BlaMA_maxdistance); - } - - if($stats::snipe_counter) - messageClient(%client, 'MsgDebriefAddLine', "", '\nHeadhunter %1 (%2)!', $stats::snipe_client, $stats::snipe_counter); - - if($stats::snipe_maxdistance) - { - %x = $stats::snipe_counter ? "" : "\n"; - messageClient(%client, 'MsgDebriefAddLine', "", '%3Longest Snipeshot is %1 meters by %2', $stats::snipe_maxdistance, $stats::snipe_maxdistanceclient, %x); - } - - for(%damageType = 1; %damageType < 51; %damageType++) - { - if(%damageType == 7 || %damageType == 12 || (%damageType > 13 && %damageType < 21) || %damageType == 23 || %damageType == 24 || %damageType == 25) { - continue; - } - if(%damageType > 31 && %damageType < 50) { - continue; - } - - if($stats::weap_table[%damageType] > 0) - { - if($Host::ClassicStatsType == 2) - { - if(!%message) - { - messageClient(%client, 'MsgDebriefAddLine', "", '\nTYPEPLAYERTOTAL DAMAGE'); - %message = 1; - } - messageClient(%client, 'MsgDebriefAddLine', "", ' %1 %2 %3', $weap_message[%damageType], $stats::client_weap_table[%damageType], mFormatFloat($stats::weap_table[%damageType], "%.2f")); - } - else if($Host::ClassicStatsType == 1) - { - if(!%message) - { - messageClient(%client, 'MsgDebriefAddLine', "", '\nTYPEPLAYERKILLS'); - %message = 1; - } - messageClient(%client, 'MsgDebriefAddLine', "", ' %1 %2 %3', $weap_message[%damageType], $stats::client_weap_table[%damageType], $stats::weap_table[%damageType]); - } - } - } - - if($stats::tk_counter) - messageClient(%client, 'MsgDebriefAddLine', "", '\nAnd the best teamkiller award goes to... %1 (%2)!', $stats::tk_client, $stats::tk_counter); -} diff --git a/Classic/scripts/autoexec/dtBanSystem.cs b/Classic/scripts/autoexec/dtBanSystem.cs deleted file mode 100644 index b8a3cd6..0000000 --- a/Classic/scripts/autoexec/dtBanSystem.cs +++ /dev/null @@ -1,332 +0,0 @@ -//$Host::dtBanlist = "prefs/dtBanlist.cs"; -//$Host::KickBanTime = 20; is 20 Minutes -//$Host::BanTime = 43200; is One Month -//$Host::BanTime = 129600; is Three Months -//$Host::BanTime = 259200; is Six Months -//$Host::BanTime = 518400; is 1 year -//$Host::BanTime = 1000000; is Until you unban them (Forever) -//$Host::BanTime = BAN; is Until you unban them (Forever) - -//$dtBanList::GUID3555379 = "DAY OF THE YEAR BANNED \t YEAR BANNED \t HOUR BANNED \t MINUTE BANNED \t TIME TO BE BANNED"; -//$dtBanList::GUID3555379 = "4\t2021\t18\t31\t518400"; - -//TO UNBAN SOMEONE WITHOUT RESTARTING THE SERVER -//banList();in console -//unbanIndex(%index) %index is the number next to the players name from listBans(); -//Example: unbanold(555555,"22.222.222.222"); put ip in quotes -$dtBanList::save =1; -package dtBan -{ - -//Keep track of gags (Disconnecting and Reconnecting) -function GameConnection::onDrop(%client, %reason) -{ - %ip = %client.getAddress(); - %ip = getSubStr(%ip, 3, strLen(%ip)); - %ip = getSubStr(%ip, 0, strstr(%ip, ":")); - %ip = strReplace(%ip, ".", "_"); - - $chatGagged[%ip] = $chatGagged[%client.guid] = (%client.isGagged == 1); //save status of this - - parent::onDrop(%client, %reason); -} - -//Reapply the gag -function GameConnection::onConnect( %client, %name, %raceGender, %skin, %voice, %voicePitch ) -{ - parent::onConnect( %client, %name, %raceGender, %skin, %voice, %voicePitch ); - - %ip = %client.getAddress(); - %ip = getSubStr(%ip, 3, strLen(%ip)); - %ip = getSubStr(%ip, 0, strstr(%ip, ":")); - %ip = strReplace(%ip, ".", "_"); - - %client.isGagged = ($chatGagged[%ip] || $chatGagged[%client.guid]); //restore status -} - -function ClassicLoadBanlist() -{ - $ClassicPermaBans = 0; - if(isFile($Host::dtBanlist)) - exec($Host::dtBanlist); - $ClassicWhitelists = 0; - exec($Host::ClassicWhitelist); -} - -function BanList::add(%guid, %ipAddress, %time){ - if(%time > 999999){ - %time = "BAN"; - } - %name = getClientBanName(%guid, %ipAddress); - if (%guid > 0){ - $dtBanList::GUID[%guid] = dtBanMark() TAB %time TAB %name; - } - if (getSubStr(%ipAddress, 0, 3) $= "IP:"){ - %bareIP = getSubStr(%ipAddress, 3, strLen(%ipAddress)); - %bareIP = getSubStr(%bareIP, 0, strstr(%bareIP, ":")); - %bareIP = strReplace(%bareIP, ".", "_"); // variable access bug workaround - // add IP ban - $dtBanList::IP[%bareIP] = dtBanMark() TAB %time TAB %name; - } - %found = 0; - %eIndex = -1; - for (%i = 0; %i < 100; %i++){ - if($dtBanList::NameList[%i] !$= ""){ - if(getField($dtBanList::NameList[%i], 0) $= %name){ - %found =1; - if(%guid > 0) - $dtBanList::NameList[%i] = setField($dtBanList::NameList[%i], 1, %guid); - if(getSubStr(%ipAddress, 0, 3) $= "IP:") - $dtBanList::NameList[%i] = setField($dtBanList::NameList[%i], 2, %bareIP); - break; - } - } - else if(%eIndex == -1){ - %eIndex = %i; - } - } - if(!%found){ - if($dtBanList::NameList[%eIndex] $= ""){ - $dtBanList::NameList[%eIndex] = %name TAB %guid TAB %bareIP; - } - else{ - error("Ban Index is not empty"); - } - } - saveBanList(); -} - -function banList_checkIP(%client){ - %ip = %client.getAddress(); - %ip = getSubStr(%ip, 3, strLen(%ip)); - %ip = getSubStr(%ip, 0, strstr(%ip, ":")); - %ip = strReplace(%ip, ".", "_"); - - %time = $dtBanList::IP[%ip]; - if(getField(%time,4) $= "BAN") - return 1; - if (getFieldCount(%time) > 0){ - %delta = getBanCount(getField(%time,0), getField(%time,1),getField(%time,2),getField(%time,3)); - if (%delta < getField(%time,4)) - return 1; - else{ - for (%i = 0; %i < 100; %i++){ - if($dtBanList::NameList[%i] !$= ""){ - if(getField($dtBanList::NameList[%i], 1) $= %guid){ - unbanIndex(%i); - break; - } - } - } - $dtBanList::IP[%ip] = ""; - saveBanList(); - } - } - return 0; -} - -function banList_checkGUID(%guid){ - %time = $dtBanList::GUID[%guid]; - if(getField(%time,4) $= "BAN") - return 1; - if (getFieldCount(%time) > 0){ - %delta = getBanCount(getField(%time,0), getField(%time,1),getField(%time,2),getField(%time,3)); - if (%delta < getField(%time,4)) - return 1; - else{ - for (%i = 0; %i < 100; %i++){ - if($dtBanList::NameList[%i] !$= ""){ - if(getField($dtBanList::NameList[%i], 1) $= %guid){ - unbanIndex(%i); - break; - } - } - } - $dtBanList::GUID[%guid] = ""; - saveBanList(); - } - } - return 0; -} - -function CreateServer(%mission, %missionType) -{ - parent::CreateServer(%mission, %missionType); - - //Clean timed out bans at startup - schedule(10000,0,"banListClean",0); -} - -}; - -if (!isActivePackage(dtBan)){ - activatePackage(dtBan); -} - -function saveBanList(){ - if(!isEventPending($banEvent)) - $banEvent = schedule(1000,0,"export","$dtBanList*", $Host::dtBanlist); -} -function getClientBanName(%guid, %ip){ - %found = 0; - for (%i = 0; %i < ClientGroup.getCount(); %i++){ - %client = ClientGroup.getObject(%i); - if(%guid > 0 && %client.guid $= %guid){ - %found = 1; - break; - } - else if(%client.getAddress() $= %ip){ - %found = 1; - break; - } - } - if(%found){ - %authInfo = %client.getAuthInfo(); - %realName = getField( %authInfo, 0 ); - if(%realName !$= "") - %name = %realName; - else - %name = stripChars( detag( getTaggedString( %client.name ) ), "\cp\co\c6\c7\c8\c9\c0" ); - return trim(%name); - } - return 0; -} - -function getBanCount(%d, %year, %h, %n){ - if(%d && %year && %h && %n){ - %dif = formattimestring("yy") - %year; - %days += 365 * (%dif-1); - %days += 365 - %d; - %days += dtBanDay(); - %ht = %nt = 0; - if(formattimestring("H") > %h){ - %ht = formattimestring("H") - %h; - } - else if(formattimestring("H") < %h){ - %ht = 24 - %h; - %ht = formattimestring("H")+ %ht; - } - if(formattimestring("n") > %n){ - %nt = formattimestring("n") - %n; - } - else if(formattimestring("n") < %n){ - %nt = 60 - %n; - %nt = formattimestring("n") + %nt; - } - return mfloor((%days * 1440) + (%ht*60) + %nt); - } - return 0; - //return mfloor((%days * 1440) + (%ht*60) + %nt) TAB (%days * 1440) TAB (%ht*60) TAB %nt; -} - -function dtBanDay(){ - %date = formattimestring("mm dd yy"); - %m = getWord(%date,0);%d = getWord(%date,1);%y = getWord(%date,2); - %count = 0; - if(%y % 4 < 1){%days[2] = "29";}else{%days[2] = "28";} // leap year - %days[1] = "31";%days[3] = "31"; - %days[4] = "30"; %days[5] = "31"; %days[6] = "30"; - %days[7] = "31"; %days[8] = "31"; %days[9] = "30"; - %days[10] = "31"; %days[11] = "30"; %days[12] = "31"; - for(%i = 1; %i <= %m-1; %i++){ - %count += %days[%i]; - } - return %count + %d; -} - -function dtBanMark(){ - %date = formattimestring("mm dd yy"); - %m = getWord(%date,0);%d = getWord(%date,1);%y = getWord(%date,2); - %count = 0; - if(%y % 4 < 1){%days[2] = "29";}else{%days[2] = "28";} // leap year - %days[1] = "31";%days[3] = "31"; - %days[4] = "30"; %days[5] = "31"; %days[6] = "30"; - %days[7] = "31"; %days[8] = "31"; %days[9] = "30"; - %days[10] = "31"; %days[11] = "30"; %days[12] = "31"; - for(%i = 1; %i <= %m-1; %i++){ - %count += %days[%i]; - } - return %count + %d TAB formattimestring("yy") TAB formattimestring("H") TAB formattimestring("n"); -} - -function banList(){ - %found = 0; - for (%i = 0; %i < 100; %i++){ - %fieldList = $dtBanList::NameList[%i]; - if($dtBanList::NameList[%i] !$= ""){ - %found = 1; - error("index:" @ %i SPC "Name:" @ getField(%fieldList,0) SPC "GUID:" @ getField(%fieldList,1) SPC "IP:" @ getField(%fieldList,2)); - } - } - if(%found){ - error("Use unbanIndex(%index); to unban user from the list "); - } - else{ - error("No bans, see" SPC $Host::dtBanlist SPC "for older entries"); - } -} - -function unbanIndex(%index){ - if( $dtBanList::NameList[%index] !$= ""){ - %fieldList = $dtBanList::NameList[%index]; - %name = getField(%fieldList, 0); - $dtBanList::NameList[%index] = ""; - error("Name" SPC getField(%fieldList,0) SPC "UNBANNED"); - %guid = getField(%fieldList,1); - if($dtBanList::GUID[%guid] !$= ""){ - $dtBanList::GUID[%guid] = ""; - error("GUID" SPC %guid SPC "UNBANNED"); - } - %ip = getField(%fieldList,2); - if($dtBanList::IP[%ip] !$= ""){ - $dtBanList::IP[%ip] = ""; - error("IP" SPC %ip SPC "UNBANNED"); - } - saveBanList(); - return %name; - } - return -1; -} - -//old method -function unbanold(%guid,%ip){ - %ip = strReplace(%ip, ".", "_"); - for (%i = 0; %i < 100; %i++){ - if($dtBanList::NameList[%i] !$= ""){ - if(getField($dtBanList::NameList[%i], 2) $= %ip || getField($dtBanList::NameList[%i], 1) $= %guid){ - unbanIndex(%i); - return; - } - } - } - if($dtBanList::GUID[%guid] !$= ""){ - $dtBanList::GUID[%guid] = ""; - error("GUID" SPC %guid SPC "UNBANNED"); - } - if($dtBanList::IP[%ip] !$= ""){ - $dtBanList::IP[%ip] = ""; - error("IP" SPC %ip SPC "UNBANNED"); - } - saveBanList(); -} - -//Clean timed out bans at startup -function banListClean(){ - %found = 0; - for (%i = 0; %i < 100; %i++){ - %fieldList = $dtBanList::NameList[%i]; - if($dtBanList::NameList[%i] !$= ""){ - %guid = getField($dtBanList::NameList[%i], 1); - %ip = getField($dtBanList::NameList[%i], 2); - %time = $dtBanList::GUID[%guid]; - %delta = getBanCount(getField(%time,0), getField(%time,1),getField(%time,2),getField(%time,3)); - if (getField(%time,4) !$= "BAN" && %delta > getField(%time,4)){ - $dtBanList::NameList[%i] = ""; - $dtBanList::GUID[%guid] = ""; - $dtBanList::IP[%ip] = ""; - error("GUID" SPC %guid SPC "IP" SPC %ip SPC "UNBANNED"); - } - } - } - saveBanList(); -} \ No newline at end of file diff --git a/Classic/scripts/autoexec/zDebriefLoadingScreen.cs b/Classic/scripts/autoexec/zDebriefLoadingScreen.cs index d89b714..b43ec39 100755 --- a/Classic/scripts/autoexec/zDebriefLoadingScreen.cs +++ b/Classic/scripts/autoexec/zDebriefLoadingScreen.cs @@ -191,10 +191,9 @@ function ALTsendModInfoToClient(%client) %rapeppl = "Min No Base Rape: " @ $Host::NoBaseRapePlayerCount; %turrets = "Min Turrets: " @ $Host::EnableTurretPlayerCount; - - if($Host::ClassicEvoStats && $Host::ClassicStatsType > 0) - %stats = "Stats based on: " @ ($Host::ClassicStatsType == 1 ? "Kills" : "Damage"); - + + if($dtStats::evoStyleDebrief) + %stats = "Stats based on: " @ "Kills & Damage"; %currentmis = "Current mission: " @ $MissionDisplayName @ " (" @ $MissionTypeDisplayName @ ")"; @@ -410,8 +409,8 @@ function NORMALsendModInfoToClient(%client) %turrets = "Min Turrets: " @ $Host::EnableTurretPlayerCount; - if($Host::ClassicEvoStats && $Host::ClassicStatsType > 0) - %stats = "Stats based on: " @ ($Host::ClassicStatsType == 1 ? "Kills" : "Damage"); + if($dtStats::evoStyleDebrief) + %stats = "Stats based on: " @ "Kills & Damage"; //if($Evo::ETMMode && $ETMmode::CurrentMap <= $ETMmode::Counter) //{ diff --git a/Classic/scripts/defaultGame.cs b/Classic/scripts/defaultGame.cs index 5bb7be7..46f4386 100644 --- a/Classic/scripts/defaultGame.cs +++ b/Classic/scripts/defaultGame.cs @@ -771,9 +771,6 @@ function DefaultGame::sendDebriefing( %game, %client ) messageClient( %client, 'MsgDebriefAddLine', "", ' %1 %2', %cl.name, %score); } } - - if($Host::ClassicEvoStats && ($CurrentMissionType $= "CTF" || $CurrentMissionType $= "SCtF")) - sendEvoDebriefing(%client); } @@ -1757,12 +1754,6 @@ function DefaultGame::clientMissionDropReady(%game, %client) %client.observerStartTime = getSimTime(); commandToClient(%client, 'setHudMode', 'Observer'); %client.setControlObject( %client.camera ); - - //displayObserverHud( %client, 0 ); - // Eolk - flag stats stuff - //updateObserverFlyHud(%client); - if($Host::ClassicEvoStats && ($CurrentMissionType $= "CTF" || $CurrentMissionType $= "SCtF")) - schedule(10000, %client, updateObserverFlyHud, %client); } if( !%observer ) @@ -1783,17 +1774,6 @@ function DefaultGame::clientMissionDropReady(%game, %client) %client.setControlObject( %client.player ); } } - - if( $Host::ClassicEvoStats && ($CurrentMissionType $= "CTF" || $CurrentMissionType $= "SCtF")) - { - %nickTeam1 = ($flagstats::heldTeam1 ? $flagstats::nickTeam1 : "N/A"); - %realTeam1 = ($flagstats::heldTeam1 ? $flagstats::realTeam1 : "N/A"); - - %nickTeam2 = ($flagstats::heldTeam2 ? $flagstats::nickTeam2 : "N/A"); - %realTeam2 = ($flagstats::heldTeam2 ? $flagstats::realTeam2 : "N/A"); - - BottomPrint(%client, "Best caps on " @ $CurrentMission @ ":\n" @ getTaggedString(%game.getTeamName(1)) @ ":" SPC %nickTeam1 @ " in " @ %realTeam1 @ " seconds\n" @ getTaggedString(%game.getTeamName(2)) @ ":" SPC %nickTeam2 @ " in " @ %realTeam2 @ " seconds", 20, 3); - } } else { diff --git a/Classic/scripts/server.cs b/Classic/scripts/server.cs index c3ba505..8685f92 100644 --- a/Classic/scripts/server.cs +++ b/Classic/scripts/server.cs @@ -1248,30 +1248,6 @@ function loadMission( %missionName, %missionType, %firstMission ) sendLoadInfoToClient( %client ); } - if($Host::ClassicEvoStats) - { - deleteVariables("$*stats::*"); - if(%missionType $= "CTF" || %missionType $= "SCtF") - { - %fileIn = "stats/maps/classic/" @ %missionType @ "/" @ %missionName @ ".txt"; - - // Initialize the file if not exist - if(!isFile(%fileIn)) - { - $flagstats::heldTeam1 = 0; - $flagstats::realTeam1 = 0; - $flagstats::nickTeam1 = 0; - $flagstats::heldTeam2 = 0; - $flagstats::realTeam2 = 0; - $flagstats::nickTeam2 = 0; - - export("$flagstats::*", %fileIn, false); - } - - exec(%fileIn); - } - } - // Eolk - Testing new stuff to make map rotation less stale. if($CurrentMissionType !$= %missionType && !%firstMission) deleteVariables("$MapPlayed*"); diff --git a/Classic/scripts/serverDefaults.cs b/Classic/scripts/serverDefaults.cs index 07d1e8c..4c3c2cf 100755 --- a/Classic/scripts/serverDefaults.cs +++ b/Classic/scripts/serverDefaults.cs @@ -164,8 +164,6 @@ $Host::ClassicMOTDLines = 3; $Host::ClassicMOTDTime = 6; $Host::ClassicRotationCustom = 1; $Host::ClassicRotationFile = "prefs/mapRotation.cs"; -$Host::ClassicEvoStats = 1; //See Evo stats at the end of the mission -$Host::ClassicStatsType = 2; //Evo stats, Damage or Kills $Host::ClassicViralBanning = 1; //Ban ip and other accounts if a banned player trys to rejoin $Host::ClassicWhitelist = "prefs/whitelist.cs"; $Host::ClassicSuppressTraversalRootError = 1; //Suppress console spam error on certain indoor maps