From d7269ce0ce0384ae38689783a2ef4e49e4c3362f Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Sat, 18 Jul 2020 14:52:16 -0400 Subject: [PATCH 01/10] Update EnableLogs.cs Change to 12 hour format --- Classic/scripts/autoexec/EnableLogs.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Classic/scripts/autoexec/EnableLogs.cs b/Classic/scripts/autoexec/EnableLogs.cs index 535b4d4..3184dce 100644 --- a/Classic/scripts/autoexec/EnableLogs.cs +++ b/Classic/scripts/autoexec/EnableLogs.cs @@ -18,7 +18,7 @@ function adminLog(%client, %msg) %ip = getField(strreplace(%client.getAddress(),":","\t"),1); // this is the info that will be logged - $AdminLog = formatTimeString("M-d") SPC formatTimeString("[HH:nn]") SPC %client.nameBase @ " (" @ getField(%authInfo, 0) @ ", " @ %ip @ ", " @ %client.guid @ ", " @ %client.getAddress() @ ")" @ %msg SPC "[" @ $CurrentMission @ "]"; + $AdminLog = formatTimeString("M-d") SPC formatTimeString("[hh:nn:a]") SPC %client.nameBase @ " (" @ getField(%authInfo, 0) @ ", " @ %ip @ ", " @ %client.guid @ ", " @ %client.getAddress() @ ")" @ %msg SPC "[" @ $CurrentMission @ "]"; %logpath = $Host::ClassicAdminLogPath; export("$AdminLog", %logpath, true); @@ -53,7 +53,7 @@ function connectLog(%client, %isDisconnect) else %name = %client.nameBase; - $ConnectLog = %inout SPC "#P[" @ $HostGamePlayerCount @ "]" SPC formatTimeString("M-d") SPC formatTimeString("[HH:nn]") SPC %name SPC "(" @ getField(%authInfo, 0) @ "," SPC %client.guid @ "," SPC %ip @ ")" SPC "[" @ $CurrentMission @ "]" SPC "NTC[" @ %ntc @ "]"; + $ConnectLog = %inout SPC "#P[" @ $HostGamePlayerCount @ "]" SPC formatTimeString("M-d") SPC formatTimeString("[hh:nn:a]") SPC %name SPC "(" @ getField(%authInfo, 0) @ "," SPC %client.guid @ "," SPC %ip @ ")" SPC "[" @ $CurrentMission @ "]" SPC "NTC[" @ %ntc @ "]"; %logpath = $Host::ClassicConnLogPath; export("$ConnectLog", %logpath, true); @@ -77,7 +77,7 @@ function voteLog(%client, %typeName, %arg1, %arg2, %arg3, %arg4) %arg1 = %arg1.nameBase; // this is the info that will be logged - $VoteLog = "#P[" @ $HostGamePlayerCount @ "]" SPC formatTimeString("M-d") SPC formatTimeString("[HH:nn]") SPC %client.nameBase @ " (" @ getField(%authInfo, 0) @ "," SPC %client.guid @ ") Initiated a vote:" SPC %typeName SPC %arg1 SPC %arg2 SPC %arg3 SPC %arg4 SPC "CM[" @ $CurrentMission @ "]"; + $VoteLog = "#P[" @ $HostGamePlayerCount @ "]" SPC formatTimeString("M-d") SPC formatTimeString("[hh:nn:a]") SPC %client.nameBase @ " (" @ getField(%authInfo, 0) @ "," SPC %client.guid @ ") Initiated a vote:" SPC %typeName SPC %arg1 SPC %arg2 SPC %arg3 SPC %arg4 SPC "CM[" @ $CurrentMission @ "]"; %logpath = $Host::ClassicVoteLogPath; export("$VoteLog", %logpath, true); @@ -121,7 +121,7 @@ function ClassicChatLog(%client, %id, %team, %msg) %team = "[Centerprint]"; } - $ClassicChatLog = "["@formattimestring("H:nn:ss")@"] "@%team SPC getTaggedString(%client.name)@": "@%msg; + $ClassicChatLog = "["@formattimestring("hh:nn:ss:a")@"] "@%team SPC getTaggedString(%client.name)@": "@%msg; $ClassicChatLog = stripChars($ClassicChatLog, "\c0\c1\c2\c3\c4\c5\c6\c7\c8\c9\x10\x11\co\cp"); %path = $Host::ClassicChatLogPath @ formatTimeString("/yy/mm-MM/dd.log"); export("$ClassicChatLog", %path, true); From 65d06b5dc3168c9ff691354b91afde77610941ec Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Sat, 18 Jul 2020 15:53:00 -0400 Subject: [PATCH 02/10] Update NoBaseRape.cs Made universal Not map specific If an inventory has the "invincible" tag 1 Damage wont effect it --- Classic/scripts/autoexec/NoBaseRape.cs | 37 +++----------------------- 1 file changed, 4 insertions(+), 33 deletions(-) diff --git a/Classic/scripts/autoexec/NoBaseRape.cs b/Classic/scripts/autoexec/NoBaseRape.cs index f3a43e0..8b47f44 100644 --- a/Classic/scripts/autoexec/NoBaseRape.cs +++ b/Classic/scripts/autoexec/NoBaseRape.cs @@ -10,6 +10,10 @@ function StaticShapeData::damageObject(%data, %targetObject, %sourceObject, %pos %targetname = %targetObject.getDataBlock().getName(); + //Used on some maps to make invs invincible + if( %targetObject.invincible && %targetname $= "StationInventory" ) + return; + if(!$Host::TournamentMode && $Host::NoBaseRapeEnabled && $Host::NoBaseRapePlayerCount > $TotalTeamPlayerCount) { if( %targetname $= "GeneratorLarge" || %targetname $= "StationInventory" || %targetname $= "SolarPanel" ) @@ -25,37 +29,4 @@ function StaticShapeData::damageObject(%data, %targetObject, %sourceObject, %pos parent::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType); } -function loadMissionStage2() -{ - parent::loadMissionStage2(); - - if( $CurrentMission $= "SmallCrossing" || $CurrentMission $= "Bulwark" ) - { - if (!isActivePackage(InvincibleInvToggle)) - activatePackage(InvincibleInvToggle); - } - else if (isActivePackage(InvincibleInvToggle)) - deactivatePackage(InvincibleInvToggle); -} - -}; - -// Prevent package from being activated if it is already -if (!isActivePackage(NoBaseRape)) - activatePackage(NoBaseRape); - -package InvincibleInvToggle -{ - -function StaticShapeData::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType) -{ - %targetname = %targetObject.getDataBlock().getName(); - - //Used on some maps to make invs invincible - if( %targetObject.invincible && %targetname $= "StationInventory" ) - return; - - parent::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType); -} - }; \ No newline at end of file From 7266436bcdb828bba869b9792a313939af9f10a5 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Sat, 18 Jul 2020 16:08:57 -0400 Subject: [PATCH 03/10] Update NoBaseRape.cs --- Classic/scripts/autoexec/NoBaseRape.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Classic/scripts/autoexec/NoBaseRape.cs b/Classic/scripts/autoexec/NoBaseRape.cs index 8b47f44..e93b61a 100644 --- a/Classic/scripts/autoexec/NoBaseRape.cs +++ b/Classic/scripts/autoexec/NoBaseRape.cs @@ -29,4 +29,8 @@ function StaticShapeData::damageObject(%data, %targetObject, %sourceObject, %pos parent::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType); } -}; \ No newline at end of file +}; + +// Prevent package from being activated if it is already +if (!isActivePackage(NoBaseRape)) + activatePackage(NoBaseRape); \ No newline at end of file From 8a0e3d6a65d7368555758b9c63032feec3ca9ea2 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Tue, 21 Jul 2020 15:45:26 -0400 Subject: [PATCH 04/10] Oops Rogue CTFGame in SCtFGame.cs causing issues with CTFGame --- Classic/scripts/SCtFGame.cs | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/Classic/scripts/SCtFGame.cs b/Classic/scripts/SCtFGame.cs index 4360194..39a2a07 100644 --- a/Classic/scripts/SCtFGame.cs +++ b/Classic/scripts/SCtFGame.cs @@ -1143,11 +1143,13 @@ function SCtFGame::beginStalemate(%game) { %game.stalemate = true; %game.showStalemateTargets(); + // z0dd - ZOD, 5/27/03. Added anti-turtling, return flags after x minutes if(!$Host::TournamentMode) { - messageAll( 'MsgStalemate', '\c3Anti turtle initialized. Flags will be returned to bases in %1 minutes.', $Host::ClassicAntiTurtleTime); - %game.turtleSchedule = %game.schedule($Host::ClassicAntiTurtleTime * 60000, 'antiTurtle'); + messageAll( 'MsgStalemate', "\c3Anti turtle initialized. Flags will be returned to bases in " @ $Host::ClassicAntiTurtleTime @ " minutes."); + %game.turtleSchedule = %game.schedule($Host::ClassicAntiTurtleTime * 60000, "antiTurtle"); + error(formatTimeString("HH:nn:ss") SPC "Anti-Turtle thread beginning now - ID:" SPC %game.turtleSchedule); } } @@ -1156,19 +1158,28 @@ function SCtFGame::endStalemate(%game) %game.stalemate = false; %game.hideStalemateTargets(); cancel(%game.stalemateSchedule); + cancel(%game.turtleSchedule); } -// z0dd - ZOD, 5/27/03. Anti-turtle function -function CTFGame::antiTurtle(%game) +function SCtFGame::antiTurtle(%game) { if(isEventPending(%game.turtleSchedule)) - cancel(%game.turtleSchedule); + cancel(%game.turtleSchedule); - for (%i = 1; %i <= 2; %i++) - { + if(%game.turtleSchedule > 0) + %game.turtleSchedule = 0; + + if(isEventPending(%game.stalemateSchedule)) + cancel(%game.stalemateSchedule); + + if(%game.stalemateSchedule > 0) + %game.stalemateSchedule = 0; + + for (%i = 1; %i <= Game.numTeams; %i++) Game.flagReturn($TeamFlag[%i]); - messageAll( 'MsgCTFFlagReturned', '\c3Both flags returned to bases to break stalemate.~wfx/misc/flag_return.wav', 0, 0, %i); - } + + messageAll( "", "\c3Both flags returned to bases to break stalemate.~wfx/misc/flag_return.wav"); + error(formatTimeString("HH:nn:ss") SPC "Anti-Turtle thread ended"); } function SCtFGame::flagReset(%game, %flag) From c3aa660dfd267d7b8272148cb8b9bc4a1d3eb664 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Fri, 24 Jul 2020 01:36:58 -0400 Subject: [PATCH 05/10] Update VoteMenu.cs Cant vote a time lower than the Host::TimeLimit --- Classic/scripts/autoexec/VoteMenu.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Classic/scripts/autoexec/VoteMenu.cs b/Classic/scripts/autoexec/VoteMenu.cs index aeca655..2236503 100644 --- a/Classic/scripts/autoexec/VoteMenu.cs +++ b/Classic/scripts/autoexec/VoteMenu.cs @@ -318,6 +318,9 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % messageClient(%client, "", "\c2Switching to this time wouldn't affect the time limit at all."); return; } + + if(%arg1 < $Host::TimeLimit) + return; if((!%isAdmin && $Host::AllowPlayerVoteTimeLimit) || (%isAdmin && %client.ForceVote)) { From 713d28a994b7e8694051ae548b0135121c3a4d4a Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Fri, 24 Jul 2020 14:47:20 -0400 Subject: [PATCH 06/10] VoteCooldown --- Classic/prefs/serverPrefs.cs | 1 + Classic/scripts/autoexec/VoteMenu.cs | 9 ++++++++- Classic/scripts/serverDefaults.cs | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Classic/prefs/serverPrefs.cs b/Classic/prefs/serverPrefs.cs index fd62eda..73c95fc 100644 --- a/Classic/prefs/serverPrefs.cs +++ b/Classic/prefs/serverPrefs.cs @@ -175,6 +175,7 @@ $Host::TN::beat = 3; $Host::TN::echo = 1; $Host::TournamentMode = 0; $Host::useCustomSkins = 1; +$Host::VoteCooldown = 120; $Host::VotePassPercent = 60; $Host::VoteSpread = 20; $Host::VoteTime = "45"; diff --git a/Classic/scripts/autoexec/VoteMenu.cs b/Classic/scripts/autoexec/VoteMenu.cs index 2236503..e7d3d3c 100644 --- a/Classic/scripts/autoexec/VoteMenu.cs +++ b/Classic/scripts/autoexec/VoteMenu.cs @@ -300,6 +300,12 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % } case "VoteChangeTimeLimit": + if($CMHasVoted[%client.guid] >= $Host::ClassicMaxVotes && !%isAdmin) + { + messageClient(%client, "", "\c2You have exhausted your voting rights for this mission."); + return; + } + if($CurrentMissionType $= "Siege") // Can't change time in this one { messageClient(%client, "", "\c2Cannot change the time limit in this gametype."); @@ -328,6 +334,7 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % %msg = %client.nameBase @ " initiated a vote to change the time limit to " @ %time @ "."; // VoteOvertime StartVOTimeVote(%game); + $CMHasVoted[%client.guid]++; } case "VoteMatchStart": @@ -615,7 +622,7 @@ function playerStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %tea clearBottomPrint(%client); %client.canVote = false; - %client.rescheduleVote = schedule(($Host::voteSpread * 1000) + ($Host::voteTime * 1000) , 0, "resetVotePrivs", %client); + %client.rescheduleVote = schedule(($Host::VoteCooldown * 1000) + ($Host::VoteTime * 1000) , 0, "resetVotePrivs", %client); // Log Vote voteLog(%client, %typeName, %arg1, %arg2, %arg3, %arg4); diff --git a/Classic/scripts/serverDefaults.cs b/Classic/scripts/serverDefaults.cs index 4cd8e51..cb0e2a5 100644 --- a/Classic/scripts/serverDefaults.cs +++ b/Classic/scripts/serverDefaults.cs @@ -193,6 +193,7 @@ $Host::AveragePings = 1; $Host::GuidCheck = 1; $Host::MinFlagRecordPlayerCount = 6; $Host::ItemRespawnTime = 30; +$Host::VoteCooldown = 120; //LakRabbit $Host::LakRabbitUnlimitedDJ = 1; //Unlimited disc-jumps if enabled From cc815fc534bd2bab7bd9d3a2a4c50a3881bbde52 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Fri, 24 Jul 2020 15:50:57 -0400 Subject: [PATCH 07/10] Added TKwarn Warn players of excessive tks Boot them when threshold is met --- Classic/scripts/autoexec/TKwarn.cs | 39 ++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Classic/scripts/autoexec/TKwarn.cs diff --git a/Classic/scripts/autoexec/TKwarn.cs b/Classic/scripts/autoexec/TKwarn.cs new file mode 100644 index 0000000..6940caa --- /dev/null +++ b/Classic/scripts/autoexec/TKwarn.cs @@ -0,0 +1,39 @@ +$Host::TKMax = 12; +$Host::TKWarn1 = 4; +$Host::TKWarn2 = 8; + +package TKwarn +{ + + +// From Evo +function DefaultGame::testTeamKill(%game, %victimID, %killerID) +{ + %tk = Parent::testTeamKill(%game, %victimID, %killerID); + if(!%tk) + return false; // is not a tk + + if($Host::TournamentMode || %killerID.isAdmin || %killerID.isAIcontrolled() || %victimID.isAIcontrolled()) + return true; + + // warn the player + if((%killerID.teamkills == $Host::TKWarn1 - 1) && $Host::TKWarn1 != 0) + centerprint(%killerID, "You have teamkilled " @ %killerID.teamkills + 1 @ " players.\nCut it out!", 5, 3); + // warn the player of his imminent kick + else if((%killerID.teamkills == $Host::TKWarn2 - 1) && $Host::TKWarn2 != 0) + centerprint(%killerID, "You have teamkilled " @ %killerID.teamkills + 1 @ " players.\nWith " @ $Host::TKMax @ " teamkills, you will be kicked.", 5, 3); + // kick the player + else if((%killerID.teamkills >= $Host::TKMax - 1) && $Host::TKMax != 0) + { + Game.kickClientName = %killerID.name; + kick(%killerID, false, %killerID.guid); + adminLog( %killerID, " was autokicked for too many teamkills." ); + } + return true; +} + +}; + +// Prevent package from being activated if it is already +if (!isActivePackage(TKwarn)) + activatePackage(TKwarn); \ No newline at end of file From fd0ed989c74f7abc50c9a637a434058ba72cdfa6 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Fri, 24 Jul 2020 15:55:08 -0400 Subject: [PATCH 08/10] TKwarn Vars --- Classic/prefs/serverPrefs.cs | 3 +++ Classic/scripts/autoexec/TKwarn.cs | 4 ---- Classic/scripts/serverDefaults.cs | 3 +++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Classic/prefs/serverPrefs.cs b/Classic/prefs/serverPrefs.cs index 73c95fc..7451852 100644 --- a/Classic/prefs/serverPrefs.cs +++ b/Classic/prefs/serverPrefs.cs @@ -171,6 +171,9 @@ $Host::TeamSkin4 = "dsword"; $Host::TeamSkin5 = "beagle"; $Host::TeamSkin6 = "cotp"; $Host::TimeLimit = 45; +$Host::TKMax = 12; +$Host::TKWarn1 = 4; +$Host::TKWarn2 = 8; $Host::TN::beat = 3; $Host::TN::echo = 1; $Host::TournamentMode = 0; diff --git a/Classic/scripts/autoexec/TKwarn.cs b/Classic/scripts/autoexec/TKwarn.cs index 6940caa..78f4507 100644 --- a/Classic/scripts/autoexec/TKwarn.cs +++ b/Classic/scripts/autoexec/TKwarn.cs @@ -1,7 +1,3 @@ -$Host::TKMax = 12; -$Host::TKWarn1 = 4; -$Host::TKWarn2 = 8; - package TKwarn { diff --git a/Classic/scripts/serverDefaults.cs b/Classic/scripts/serverDefaults.cs index cb0e2a5..73b9fda 100644 --- a/Classic/scripts/serverDefaults.cs +++ b/Classic/scripts/serverDefaults.cs @@ -194,6 +194,9 @@ $Host::GuidCheck = 1; $Host::MinFlagRecordPlayerCount = 6; $Host::ItemRespawnTime = 30; $Host::VoteCooldown = 120; +$Host::TKMax = 12; +$Host::TKWarn1 = 4; +$Host::TKWarn2 = 8; //LakRabbit $Host::LakRabbitUnlimitedDJ = 1; //Unlimited disc-jumps if enabled From 16fff596b26d68c2cff4b51879d79205f7300a89 Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Fri, 24 Jul 2020 22:46:06 -0400 Subject: [PATCH 09/10] Update TKwarn.cs Changed font --- Classic/scripts/autoexec/TKwarn.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Classic/scripts/autoexec/TKwarn.cs b/Classic/scripts/autoexec/TKwarn.cs index 78f4507..17257ec 100644 --- a/Classic/scripts/autoexec/TKwarn.cs +++ b/Classic/scripts/autoexec/TKwarn.cs @@ -14,10 +14,10 @@ function DefaultGame::testTeamKill(%game, %victimID, %killerID) // warn the player if((%killerID.teamkills == $Host::TKWarn1 - 1) && $Host::TKWarn1 != 0) - centerprint(%killerID, "You have teamkilled " @ %killerID.teamkills + 1 @ " players.\nCut it out!", 5, 3); + centerprint(%killerID, "You have teamkilled " @ %killerID.teamkills + 1 @ " players.\nCut it out!", 5, 3); // warn the player of his imminent kick else if((%killerID.teamkills == $Host::TKWarn2 - 1) && $Host::TKWarn2 != 0) - centerprint(%killerID, "You have teamkilled " @ %killerID.teamkills + 1 @ " players.\nWith " @ $Host::TKMax @ " teamkills, you will be kicked.", 5, 3); + centerprint(%killerID, "You have teamkilled " @ %killerID.teamkills + 1 @ " players.\nWith " @ $Host::TKMax @ " teamkills, you will be kicked.", 5, 3); // kick the player else if((%killerID.teamkills >= $Host::TKMax - 1) && $Host::TKMax != 0) { From 7ad8457783c036a5f98320a538e28da4b8effefc Mon Sep 17 00:00:00 2001 From: ChocoTaco1 Date: Sun, 26 Jul 2020 14:41:21 -0400 Subject: [PATCH 10/10] Global Water Viscosity and Console Spam fix Added Global Water Viscosity Console Spam Fix --- Classic/scripts/autoexec/TacoOverrides.cs | 30 +++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Classic/scripts/autoexec/TacoOverrides.cs b/Classic/scripts/autoexec/TacoOverrides.cs index 6ffbae6..2cf905c 100644 --- a/Classic/scripts/autoexec/TacoOverrides.cs +++ b/Classic/scripts/autoexec/TacoOverrides.cs @@ -3,6 +3,9 @@ // Various Overrides // +// Global water viscosity +$globalviscosity = 3; + package TacoOverrides { @@ -158,6 +161,33 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am Parent::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC); } +//Item 'Use' Console spam fix +function serverCmdUse(%client,%data) +{ + // Item names from the client must converted + // into DataBlocks + // %data = ItemDataBlock[%item]; + //if(isObject(%client.player)) // z0dd - ZOD, 5/18/03. Console spam fix + //%client.player.use(%data); + + //Spam Fix 7/2020 + if(isObject(%client.player) && isObject(%client.getControlObject())) + %client.getControlObject().use(%data); +} + +// Global water viscosity +function DefaultGame::missionLoadDone(%game) +{ + parent::missionLoadDone(%game); + + for(%i = 0; %i < MissionGroup.getCount(); %i++) + { + %obj = MissionGroup.getObject(%i); + if(%obj.getClassName() $= "WaterBlock") + %obj.viscosity = $globalviscosity; + } +} + }; // Prevent package from being activated if it is already