Proper Chatlogs (Goon Style)

This commit is contained in:
ChocoTaco1 2020-04-08 12:09:58 -04:00
parent 1aec861aab
commit ae753ab0cf
4 changed files with 45 additions and 0 deletions

View file

@ -30,6 +30,8 @@ $Host::ClassicBadWordFilter = 0;
$Host::ClassicBanlist = "prefs/banlist.cs";
$Host::ClassicBalancedBots = 0;
$Host::ClassicCanKickBots = 0;
$Host::ClassicChatLog = 1;
$Host::ClassicChatLogPath = "logs/Chat/";
$Host::ClassicConnectLog = 1;
$Host::ClassicConnLogPath = "logs/Connect/Connect.log";
$Host::ClassicCycleMisTypes = 0;

View file

@ -83,4 +83,39 @@ function voteLog(%client, %typeName, %arg1, %arg2, %arg3, %arg4)
export("$VoteLog", %logpath, true);
logEcho($VoteLog);
}
}
// From Goon
// Slightly more elegant solution rather than spamming console
function ClassicChatLog(%client, %id, %team, %msg)
{
// We don't care about bots.
if(%client.isAIControlled())
return;
// Don't log voicepack stuff.
if(strstr(%msg, "~w") != -1)
return;
switch$(%id)
{
case 0:
%team = "[Global]";
case 1:
%team = "["@getTaggedString(Game.getTeamName(%team))@"]";
case 2:
%team = "[Admin]";
case 3:
%team = "[Bottomprint]";
case 4:
%team = "[Centerprint]";
}
// Make it all uppercase
%team = strupr(%team);
$ClassicChatLog = "["@formattimestring("H:nn:ss")@"]" SPC %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);
}

View file

@ -266,6 +266,9 @@ function chatMessageTeam( %sender, %team, %msgString, %a1, %a2, %a3, %a4, %a5, %
if ( %obj.team == %sender.team )
chatMessageClient( %obj, %sender, %sender.voiceTag, %sender.voicePitch, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 );
}
if($Host::ClassicChatLog)
ClassicChatLog(%sender, 1, %sender.team, %a2);
}
function cannedChatMessageTeam( %sender, %team, %msgString, %name, %string, %keys )
@ -319,6 +322,9 @@ function chatMessageAll( %sender, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7,
echo( stripTaggedVar(%sender.name), ": ", %a2 );
}
//echo( "SAY: " @ stripchars(detag(gettaggedstring(%sender.name)),"\cp\co\c6\c7\c8\c9") @ " \"" @ %a2 @ "\"");
if($Host::ClassicChatLog)
ClassicChatLog(%sender, 0, 0, %a2);
}
function cannedChatMessageAll( %sender, %msgString, %name, %string, %keys )

View file

@ -156,6 +156,8 @@ $Host::LoadScreenMOTD4 = "Big CTF games Fridays, Saturdays, and Sundays!"; //M
$Host::ClassicBanlist = "prefs/banlist.cs";
$Host::ClassicAdminLog = 1;
$Host::ClassicAdminLogPath = "logs/Admin/log.txt";
$Host::ClassicChatLog = 1;
$Host::ClassicChatLogPath = "logs/Chat/";
$Host::ClassicConnectLog = 1;
$Host::ClassicConnLogPath = "logs/Connect/log.txt";
$Host::ClassicMOTD = "<color:3cb4b4><font:Sui Generis:22>Discord PUB\n<color:3cb4b4><font:Univers:16>Server Hosted/Provided by Branzone/Ravin\n<color:3cb4b4><font:Univers:16>Get Mappacks at https://playt2.com/";