TeamKill Logging

This commit is contained in:
ChocoTaco 2021-09-13 17:33:21 -04:00
parent aea38be3b5
commit e6af4d968b
4 changed files with 32 additions and 3 deletions

View file

@ -69,6 +69,8 @@ $Host::ClassicRotationFile = "prefs/mapRotation.cs";
$Host::ClassicStatsType = 2; $Host::ClassicStatsType = 2;
$Host::ClassicSuperAdminPassword = "changeme"; $Host::ClassicSuperAdminPassword = "changeme";
$Host::ClassicSuppressTraversalRootError = 1; $Host::ClassicSuppressTraversalRootError = 1;
$Host::ClassicTeamKillLog = 1;
$Host::ClassicTeamKillLogPath = "logs/TeamKills/teamkills.log";
$Host::ClassicTelnet = 1; $Host::ClassicTelnet = 1;
$Host::ClassicTelnetListenPass = "changeme"; $Host::ClassicTelnetListenPass = "changeme";
$Host::ClassicTelnetPassword = "changeme"; $Host::ClassicTelnetPassword = "changeme";

18
Classic/scripts/autoexec/EnableLogs.cs Normal file → Executable file
View file

@ -154,3 +154,21 @@ function ClassicChatLog(%client, %id, %team, %msg)
%path = $Host::ClassicChatLogPath @ formatTimeString("/yy/mm-MM/dd.log"); %path = $Host::ClassicChatLogPath @ formatTimeString("/yy/mm-MM/dd.log");
export("$ClassicChatLog", %path, true); export("$ClassicChatLog", %path, true);
} }
// Log Teamkills
function teamkillLog(%victimID, %killerID)
{
if(!$Host::ClassicTeamKillLog)
return;
//echo("TK Log");
//Note: %killerID.teamkills + 1 as this is added later
$teamkillLog = "#P[" @ $HostGamePlayerCount @ "]" SPC formatTimeString("M-d") SPC formatTimeString("[hh:nn:a]") SPC %killerID.nameBase @ " (" @ getField(%authInfo, 0) @ "," SPC %killerID.guid @ ") teamkilled" SPC %victimID.nameBase SPC "and has" SPC (%killerID.teamkills + 1) SPC "tks. CM[" @ $CurrentMission @ "]";
$teamkillLog = stripChars($teamkillLog, "\c0\c1\c2\c3\c4\c5\c6\c7\c8\c9\x10\x11\co\cp");
%logpath = $Host::ClassicTeamKillLogPath;
export("$teamkillLog", %logpath, true);
logEcho($teamkillLog);
echo($teamkillLog);
}

11
Classic/scripts/autoexec/TKwarn.cs Normal file → Executable file
View file

@ -3,7 +3,6 @@
package TKwarn package TKwarn
{ {
// From Evo // From Evo
function DefaultGame::testTeamKill(%game, %victimID, %killerID) function DefaultGame::testTeamKill(%game, %victimID, %killerID)
{ {
@ -11,7 +10,15 @@ function DefaultGame::testTeamKill(%game, %victimID, %killerID)
if(!%tk) if(!%tk)
return false; // is not a tk return false; // is not a tk
if($Host::TournamentMode || %killerID.isAdmin || %killerID.isAIcontrolled() || %victimID.isAIcontrolled()) // No Bots
if(%killerID.isAIcontrolled() || %victimID.isAIcontrolled())
return true;
// Log TeamKill
teamkillLog(%victimID, %killerID);
// No Admins
if(%killerID.isAdmin)
return true; return true;
// Ignore this map // Ignore this map

View file

@ -203,6 +203,8 @@ $Host::KickObserverTimeout = 1200; //How long player can stay in obs
$Host::dtBanlist = "prefs/dtBanlist.cs"; //Alternate Ban System $Host::dtBanlist = "prefs/dtBanlist.cs"; //Alternate Ban System
$Host::VoteCooldown = 120; //Time cooldown that dosnt allow a player to vote again after theyve initiated a vote (120 is 2 mins) $Host::VoteCooldown = 120; //Time cooldown that dosnt allow a player to vote again after theyve initiated a vote (120 is 2 mins)
$Host::VoteDelayTime = 120; //Delay the ability to vote (For everyone) at the beginning of the match (120 is 2 minutes) $Host::VoteDelayTime = 120; //Delay the ability to vote (For everyone) at the beginning of the match (120 is 2 minutes)
$Host::ClassicTeamKillLog = 1; //Enable/Disable Teamkill Logging
$Host::ClassicTeamKillLogPath = "logs/TeamKills/teamkills.log"; //TeamKill Log Path
//LakRabbit //LakRabbit
$Host::LakRabbitUnlimitedDJ = 1; //Unlimited disc-jumps if enabled $Host::LakRabbitUnlimitedDJ = 1; //Unlimited disc-jumps if enabled