diff --git a/Classic/scripts/autoexec/ObserverCooldown.cs b/Classic/scripts/autoexec/ObserverCooldown.cs index 5fd41c7..a0e071d 100644 --- a/Classic/scripts/autoexec/ObserverCooldown.cs +++ b/Classic/scripts/autoexec/ObserverCooldown.cs @@ -12,7 +12,7 @@ function serverCmdClientMakeObserver(%client) //10 second cooldown on becoming an observer %timeDif = getSimTime() - %client.observerTimeout; %timeDif1 = getSimTime() - %client.observerMsg; - if(%timeDif > 10000 || !%client.observerTimeout || %client.isSuperAdmin) + if(%timeDif > 10000 || !%client.observerTimeout || %client.isAdmin) { %client.observerProtectStart = getSimTime(); %client.observerTimeout = getSimTime(); diff --git a/Classic/scripts/autoexec/TeamManagement.cs b/Classic/scripts/autoexec/TeamManagement.cs index adb250e..5862199 100644 --- a/Classic/scripts/autoexec/TeamManagement.cs +++ b/Classic/scripts/autoexec/TeamManagement.cs @@ -42,7 +42,7 @@ function GetTeamCounts(%game) if($countdownStarted && $MatchStarted) { //Variables - $TotalTeamPlayerCount = (Game.class $= "LakRabbitGame" || Game.class $= "DMGame") ? $TeamRank[0, count] : ($TeamRank[1, count] + $TeamRank[2, count]); + $TotalTeamPlayerCount = (Game.class $= "LakRabbitGame") ? $TeamRank[0, count] : ($TeamRank[1, count] + $TeamRank[2, count]); $AllPlayerCount = $HostGamePlayerCount; //Observers diff --git a/Classic/scripts/autoexec/flagTunnelingFix.cs b/Classic/scripts/autoexec/flagTunnelingFix.cs index 15e43cd..3012bdb 100644 --- a/Classic/scripts/autoexec/flagTunnelingFix.cs +++ b/Classic/scripts/autoexec/flagTunnelingFix.cs @@ -23,7 +23,7 @@ $flagOffset = 1;// how far to offset the flag 1m seems like it works 90% of the //expermental flag static fix //memPatch("60456c","11000018");//transform -//memPatch("6040ff","01"); //setVelocity +memPatch("6040ff","01"); //setVelocity $flagResetTime = 0;// 1000-5000 if you want this feature enabled, resets flag to stand in case of desync should not be needed //best to leave these values alone unless you understand what the code is doing diff --git a/Classic/scripts/autoexec/z_dtStats.cs b/Classic/scripts/autoexec/z_dtStats.cs index 501212f..a7e97cd 100644 --- a/Classic/scripts/autoexec/z_dtStats.cs +++ b/Classic/scripts/autoexec/z_dtStats.cs @@ -16,7 +16,7 @@ // Note See bottom of file for full log ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //-----------Settings----------- -$dtStats::version = 10.62; +$dtStats::version = 10.60; //disable stats system $dtStats::Enable = $Host::dtStatsEnable $= "" ? ($Host::dtStatsEnable = 1) : $Host::dtStatsEnable; if(!$dtStats::Enable){ return;}// so it disables with a restart @@ -94,8 +94,8 @@ $dtStats::year = 0;//not $dtStats::custom = 12;//not used // you gain extra days based on time played extra days = gameCount * expireFactor; // example being 100 games * factor of 0.596 = will gain you 60 extra days but if its over the 90 day max it will be deleted -$dtStats::expireMax = 21; -$dtStats::expireMin = 7; +$dtStats::expireMax = 90; +$dtStats::expireMin = 15; $dtStats::expireFactor["CTFGame"] = 0.596; $dtStats::expireFactor["LakRabbitGame"] = 2; $dtStats::expireFactor["DMGame"] = 6; @@ -2271,6 +2271,7 @@ if(!isObject(statsGroup)){ RootGroup.add(statsGroup); statsGroup.resetCount = -1; statsGroup.serverStart = 0; + $dtStats::leftID++; } function dtAICON(%client){ @@ -2782,11 +2783,11 @@ package dtStats{ } function DefaultGame::playerSpawned(%game, %player){ parent::playerSpawned(%game, %player); - armorTimer(%player.client.dtStats, %player.getArmorSize()); + armorTimer(%player.client.dtStats, %player.getArmorSize(), 0); } function Player::setArmor(%this,%size){//for game types that use spawn favs parent::setArmor(%this,%size); - armorTimer(%this.client.dtStats, %size); + armorTimer(%this.client.dtStats, %size, 0); } function Weapon::onPickup(%this, %obj, %shape, %amount){ parent::onPickup(%this, %obj, %shape, %amount); @@ -5063,15 +5064,18 @@ function dtStatsMissionDropReady(%game, %client){ // called when client has fini %dtStats.clientLeft = 0; %dtStats.stat["clientQuit"] = 0; %dtStats.markForDelete = 0; - if(isGameRun() && %dtStats.misSeq == $missionSequence){ + if(%dtStats.leftID == $dtStats::leftID){ + $dtServer::mapReconnects[cleanMapName($CurrentMission),%game.class]++; + } + if(isGameRun() && %dtStats.leftID == $dtStats::leftID && %dtStats.stat["score"] != 0){// make sure game is running and we are on the same map resGameStats(%client,%game.class); // restore stats; - if(%dtStats.stat["score"] != 0){ - messageClient(%client, 'MsgClient', '\crWelcome back %1. Your score has been restored.~wfx/misc/rolechange.wav', %client.name); - } } else{ resetDtStats(%dtStats,%game.class,1); } + if(%client.stat["score"] != 0){ + messageClient(%client, 'MsgClient', '\crWelcome back %1. Your score has been restored.~wfx/misc/rolechange.wav', %client.name); + } break; } } @@ -5086,21 +5090,21 @@ function dtStatsMissionDropReady(%game, %client){ // called when client has fini %dtStats.markForDelete = 0; %dtStats.name = %name; $dtStats::tbLookUP[%client.guid] = %dtStats; - resetDtStats(%dtStats,%game.class,1); } } else{ %dtStats = %client.dtStats; } - %dtStats.misSeq = $missionSequence; + %dtStats.joinPCT = (isGameRun() == 1) ? %game.getGamePct() : 0; updateTeamTime(%dtStats, -1); %dtStats.team = %client.team;// should be 0 - if(isObject(%dtStats) && %dtStats.gameData[%game.class, $dtStats::tmMode] != 1){ // game type change + if(isObject(%dtStats) && %dtStats.gameData[%game.class] != 1){ // game type change %dtStats.gameStats["totalGames","g",%game.class] = 0; %dtStats.gameStats["statsOverWrite","g",%game.class] = -1; %dtStats.gameStats["fullSet","g",%game.class] = 0; - %dtStats.gameData[%game.class, $dtStats::tmMode] = 0; + resetDtStats(%dtStats,%game.class,1); + %dtStats.gameData[%game.class] = 0; } %dtStats.mapTime = getSimTime(); } @@ -5119,11 +5123,12 @@ function dtStatsClientLeaveGame(%client){ %client.dtStats.isBot = (%client.isWatchOnly == 1); %dtStats.stat["clientQuit"] = isGameRun(); %client.dtStats.leftTime = getSimTime(); + %client.dtStats.leftID = $dtStats::leftID; if(isObject(Game)){ %client.dtStats.leftPCT = Game.getGamePct(); if(isGameRun() && %client.score != 0){ updateTeamTime(%client.dtStats, %client.dtStats.team); - armorTimer(%client.dtStats, -1); + armorTimer(%client.dtStats, 0, 1); } } else{ @@ -5733,6 +5738,7 @@ function loadTBMap(%game){ function dtSaveDone(){ $dtStats::statsSave = 0; + $dtStats::leftID++; $dtStats::teamOneCapTimes = 0; $dtStats::teamTwoCapTimes = 0; $dtStats::teamOneCapCount = 0; @@ -5746,9 +5752,6 @@ function DefaultGame::postGameStats(%game,%dtStats){ //stats to add up at the en if($dtStats::debugEchos){error("postGameStats GUID = " SPC %dtStats.guid);} if(!isObject(%dtStats)) return; - - armorTimer(%dtStats, -1); - %dtStats.stat["tournamentMode"] = $Host::TournamentMode; %dtStats.stat["null"] = getRandom(1,100); @@ -6261,7 +6264,7 @@ function loadGameStats(%dtStats,%game){// called when client joins server.cs onC %var = getField(%line,0); %dtStats.gameStats[%var,"g",%game,$dtStats::tmMode] = getFields(%line,1,getFieldCount(%line)-1); } - %dtStats.gameData[%game, $dtStats::tmMode]= 1; + %dtStats.gameData[%game,$dtStats::tmMode]= 1; %file.close(); %file.delete(); } @@ -6972,7 +6975,7 @@ function buildVarList(){ //////////////////////////////////////////////////////////////////////////////// //Stats Collecting //////////////////////////////////////////////////////////////////////////////// -function armorTimer(%dtStats, %size){ +function armorTimer(%dtStats, %size, %death){ if(%dtStats.lastArmor $= "Light" && %dtStats.ArmorTime[%dtStats.lastArmor] > 0){ %dtStats.stat["lArmorTime"] += ((getSimTime() - %dtStats.ArmorTime[%dtStats.lastArmor])/1000)/60; %dtStats.ArmorTime[%dtStats.lastArmor] = 0; @@ -6988,7 +6991,7 @@ function armorTimer(%dtStats, %size){ %dtStats.ArmorTime[%dtStats.lastArmor] = 0; %dtStats.lastArmor = 0; } - if(%size == -1){ + if(!%death){ %dtStats.ArmorTime[%size] = getSimTime(); %dtStats.lastArmor = %size; } @@ -7087,7 +7090,7 @@ function clientKillStats(%game,%clVictim, %clKiller, %damageType, %implement, %d %victimPlayer = isObject(%clVictim.player) ? %clVictim.player : %clVictim.lastPlayer; %killerPlayer = isObject(%clKiller.player) ? %clKiller.player : %clKiller.lastPlayer; %clVictim.lp = "";//last position for distMove - armorTimer(%victimDT, -1); + armorTimer(%victimDT, 0, 1); //------------------------------------------------------------------------------ %victimDT.timeToLive += getSimTime() - %clVictim.spawnTime; %victimDT.stat["timeTL"] = mFloor(((%victimDT.timeToLive/(%clVictim.stat["deaths"]+%clVictim.stat["suicides"] ? %clVictim.stat["deaths"]+%clVictim.stat["suicides"] : 1))/1000)/60); @@ -14001,7 +14004,7 @@ package dtBanSys{ name = %name; guid = %guid; ip = %bareip; - banDateTime = dtMarkDate(); + banDateTime = dtMarkDate(); banLengthMin = %time; }; dtBanList.add(%banObj); @@ -20536,7 +20539,7 @@ function mapCyleTest(){ // Misc arena things // Added LCTF Naming // serverPrefs Support -// bansystem rework doto new tribes next changes +// bansystem rework doto new tribes next changes //////////////////////////////////////////////////////////////////////////////// @@ -20555,4 +20558,4 @@ function testVarsRandomAll(%max){ dtMinMax(%varName, "misc", 1, %val, %client); } } -} +} \ No newline at end of file diff --git a/Classic/scripts/autoexec/z_dtTMRejoin.cs b/Classic/scripts/autoexec/z_dtTMRejoin.cs deleted file mode 100644 index a82b325..0000000 --- a/Classic/scripts/autoexec/z_dtTMRejoin.cs +++ /dev/null @@ -1,111 +0,0 @@ -// auto reteam clients that have drop -//script by: DarkTiger -//version 1.1 -function tmMirrorTeam(%client){ - if (!$Host::TournamentMode){ - return; - } - - if (%client.team <= 0){ - return; - } - - %guid = %client.guid; - if (%guid $= "" || %guid == 0){ - return; - } - - $TourneyRejoinTeam[%guid] = %client.team; - $TourneyRejoinSeq[%guid] = $missionSequence; - %client.recDrop = 1; - echo("TourneyRejoin: saved team info for " @ %client.nameBase - @ " (GUID:" @ %guid @ ") team=" @ %client.team - @ " seq=" @ $missionSequence); -} - -function tmRejoin(%game, %client){ - if (!$Host::TournamentMode || !$missionRunning){ - return; - } - - %guid = %client.guid; - if (%guid $= "" || %guid == 0){ - return; - } - - if ($TourneyRejoinSeq[%guid] $= ""){ - return; - } - - if ($TourneyRejoinSeq[%guid] != $missionSequence){ - $TourneyRejoinTeam[%guid] = ""; - $TourneyRejoinSeq[%guid] = ""; - return; - } - - %savedTeam = $TourneyRejoinTeam[%guid]; - - // Consume the record so a second reconnect goes through normal pick-team flow - $TourneyRejoinTeam[%guid] = ""; - $TourneyRejoinSeq[%guid] = ""; - - echo("TourneyRejoin: restoring" SPC %client.nameBase SPC "(GUID:" @ %guid @ ") to team " @ %savedTeam); - - - %game.clientChangeTeam(%client, %savedTeam, 1, true); - - //%game.clientJoinTeam( %client, %savedTeam, false ); - - if (!$MatchStarted && !$countdownStarted){ - clearBottomPrint(%client); - %client.observerMode = "pregame"; - %client.notReady = true; - centerprint(%client, "\nPress FIRE when ready.", 0, 3); - messageClient(%client, 'MsgClient', - '\c2You have been re-teamed to %1 after reconnecting. Press FIRE when ready.', - %game.getTeamName(%savedTeam)); - } - else{ - clearBottomPrint(%client); - %client.notReady = false; - commandToClient(%client, 'setHudMode', 'Standard'); - messageClient(%client, 'MsgClient', - '\c2You have been re-teamed to %1 after reconnecting.', - %game.getTeamName(%savedTeam)); - } - %client.isRejoin = 1; - messageAllExcept(%client, -1, 'MsgClient', - '\c2%1 reconnected and has been restored to %2.', - %client.name, %game.getTeamName(%savedTeam)); -} - -package TourneyRejoinPackage{ - // Mirror team to global whenever a client joins a team - function DefaultGame::clientJoinTeam(%game, %client, %team, %respawn){ - Parent::clientJoinTeam(%game, %client, %team, %respawn); - tmMirrorTeam(%client); - } - // Mirror team to global whenever a client changes team - function DefaultGame::clientChangeTeam(%game, %client, %team, %fromObs, %respawned){ - Parent::clientChangeTeam(%game, %client, %team, %fromObs, %respawned); - tmMirrorTeam(%client); - } - - function DefaultGame::clientMissionDropReady(%game, %client){ - parent::clientMissionDropReady(%game, %client); - schedule(32, 0, "tmRejoin", %game, %client); - %client.isRejoin = 0; - } - function serverCmdPlayContentSet( %client ){ - if(!%client.isRejoin){// block the join team ui if they are already ready on a team - parent::serverCmdPlayContentSet(%client); - } - else{ - %client.isRejoin = 0; - } - } -}; - -if (!isActivePackage(TourneyRejoinPackage)){ - activatePackage(TourneyRejoinPackage); -}