From 8fc19d4764f7193aa80521cc0a92aa9334d4b779 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Wed, 15 Apr 2026 09:06:12 -0400 Subject: [PATCH 1/5] Update TeamManagement.cs --- Classic/scripts/autoexec/TeamManagement.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classic/scripts/autoexec/TeamManagement.cs b/Classic/scripts/autoexec/TeamManagement.cs index 5862199..adb250e 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") ? $TeamRank[0, count] : ($TeamRank[1, count] + $TeamRank[2, count]); + $TotalTeamPlayerCount = (Game.class $= "LakRabbitGame" || Game.class $= "DMGame") ? $TeamRank[0, count] : ($TeamRank[1, count] + $TeamRank[2, count]); $AllPlayerCount = $HostGamePlayerCount; //Observers From 3d3831df02df625135a59da3f60aa39b438276c7 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 <23550874+ChocoTaco1@users.noreply.github.com> Date: Sun, 14 Jun 2026 16:23:22 -0400 Subject: [PATCH 2/5] Take out mempatch --- Classic/scripts/autoexec/flagTunnelingFix.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classic/scripts/autoexec/flagTunnelingFix.cs b/Classic/scripts/autoexec/flagTunnelingFix.cs index 3012bdb..15e43cd 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 From dfdec144195612a4e1d4ac3ec433c83a89c95d6c Mon Sep 17 00:00:00 2001 From: ChocoTaco1 <23550874+ChocoTaco1@users.noreply.github.com> Date: Sun, 14 Jun 2026 16:23:32 -0400 Subject: [PATCH 3/5] Add admins --- Classic/scripts/autoexec/ObserverCooldown.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classic/scripts/autoexec/ObserverCooldown.cs b/Classic/scripts/autoexec/ObserverCooldown.cs index a0e071d..5fd41c7 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.isAdmin) + if(%timeDif > 10000 || !%client.observerTimeout || %client.isSuperAdmin) { %client.observerProtectStart = getSimTime(); %client.observerTimeout = getSimTime(); From cee7b96f09c4f4c0f6e4507566b41f9f606c6e0d Mon Sep 17 00:00:00 2001 From: ChocoTaco1 <23550874+ChocoTaco1@users.noreply.github.com> Date: Sun, 14 Jun 2026 16:23:41 -0400 Subject: [PATCH 4/5] Create z_dtTMRejoin.cs --- Classic/scripts/autoexec/z_dtTMRejoin.cs | 111 +++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 Classic/scripts/autoexec/z_dtTMRejoin.cs diff --git a/Classic/scripts/autoexec/z_dtTMRejoin.cs b/Classic/scripts/autoexec/z_dtTMRejoin.cs new file mode 100644 index 0000000..a82b325 --- /dev/null +++ b/Classic/scripts/autoexec/z_dtTMRejoin.cs @@ -0,0 +1,111 @@ +// 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); +} From ccefb6d34150278156b6915c70ab2429914f2372 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 <23550874+ChocoTaco1@users.noreply.github.com> Date: Sun, 14 Jun 2026 16:23:47 -0400 Subject: [PATCH 5/5] Update z_dtStats.cs --- Classic/scripts/autoexec/z_dtStats.cs | 51 +++++++++++++-------------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/Classic/scripts/autoexec/z_dtStats.cs b/Classic/scripts/autoexec/z_dtStats.cs index a7e97cd..501212f 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.60; +$dtStats::version = 10.62; //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 = 90; -$dtStats::expireMin = 15; +$dtStats::expireMax = 21; +$dtStats::expireMin = 7; $dtStats::expireFactor["CTFGame"] = 0.596; $dtStats::expireFactor["LakRabbitGame"] = 2; $dtStats::expireFactor["DMGame"] = 6; @@ -2271,7 +2271,6 @@ if(!isObject(statsGroup)){ RootGroup.add(statsGroup); statsGroup.resetCount = -1; statsGroup.serverStart = 0; - $dtStats::leftID++; } function dtAICON(%client){ @@ -2783,11 +2782,11 @@ package dtStats{ } function DefaultGame::playerSpawned(%game, %player){ parent::playerSpawned(%game, %player); - armorTimer(%player.client.dtStats, %player.getArmorSize(), 0); + armorTimer(%player.client.dtStats, %player.getArmorSize()); } function Player::setArmor(%this,%size){//for game types that use spawn favs parent::setArmor(%this,%size); - armorTimer(%this.client.dtStats, %size, 0); + armorTimer(%this.client.dtStats, %size); } function Weapon::onPickup(%this, %obj, %shape, %amount){ parent::onPickup(%this, %obj, %shape, %amount); @@ -5064,18 +5063,15 @@ function dtStatsMissionDropReady(%game, %client){ // called when client has fini %dtStats.clientLeft = 0; %dtStats.stat["clientQuit"] = 0; %dtStats.markForDelete = 0; - 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 + if(isGameRun() && %dtStats.misSeq == $missionSequence){ 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; } } @@ -5090,21 +5086,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] != 1){ // game type change + if(isObject(%dtStats) && %dtStats.gameData[%game.class, $dtStats::tmMode] != 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; - resetDtStats(%dtStats,%game.class,1); - %dtStats.gameData[%game.class] = 0; + %dtStats.gameData[%game.class, $dtStats::tmMode] = 0; } %dtStats.mapTime = getSimTime(); } @@ -5123,12 +5119,11 @@ 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, 0, 1); + armorTimer(%client.dtStats, -1); } } else{ @@ -5738,7 +5733,6 @@ function loadTBMap(%game){ function dtSaveDone(){ $dtStats::statsSave = 0; - $dtStats::leftID++; $dtStats::teamOneCapTimes = 0; $dtStats::teamTwoCapTimes = 0; $dtStats::teamOneCapCount = 0; @@ -5752,6 +5746,9 @@ 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); @@ -6264,7 +6261,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(); } @@ -6975,7 +6972,7 @@ function buildVarList(){ //////////////////////////////////////////////////////////////////////////////// //Stats Collecting //////////////////////////////////////////////////////////////////////////////// -function armorTimer(%dtStats, %size, %death){ +function armorTimer(%dtStats, %size){ if(%dtStats.lastArmor $= "Light" && %dtStats.ArmorTime[%dtStats.lastArmor] > 0){ %dtStats.stat["lArmorTime"] += ((getSimTime() - %dtStats.ArmorTime[%dtStats.lastArmor])/1000)/60; %dtStats.ArmorTime[%dtStats.lastArmor] = 0; @@ -6991,7 +6988,7 @@ function armorTimer(%dtStats, %size, %death){ %dtStats.ArmorTime[%dtStats.lastArmor] = 0; %dtStats.lastArmor = 0; } - if(!%death){ + if(%size == -1){ %dtStats.ArmorTime[%size] = getSimTime(); %dtStats.lastArmor = %size; } @@ -7090,7 +7087,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, 0, 1); + armorTimer(%victimDT, -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); @@ -14004,7 +14001,7 @@ package dtBanSys{ name = %name; guid = %guid; ip = %bareip; - banDateTime = dtMarkDate(); + banDateTime = dtMarkDate(); banLengthMin = %time; }; dtBanList.add(%banObj); @@ -20539,7 +20536,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 //////////////////////////////////////////////////////////////////////////////// @@ -20558,4 +20555,4 @@ function testVarsRandomAll(%max){ dtMinMax(%varName, "misc", 1, %val, %client); } } -} \ No newline at end of file +}