mirror of
https://github.com/ChocoTaco1/TacoServer.git
synced 2026-01-20 00:24:49 +00:00
61 lines
1.9 KiB
C#
61 lines
1.9 KiB
C#
$Host::ClassicAdminLog = 1;
|
|
$Host::ClassicConnectLog = 1;
|
|
//exec("scripts/autoexec/EnableLogs.cs");
|
|
|
|
//Enable Logs
|
|
setlogmode(1);
|
|
|
|
// adminLog(%client, %msg)
|
|
// Info: Logs the admin events
|
|
function adminLog(%client, %msg)
|
|
{
|
|
if(%client.isAdmin && $Host::ClassicAdminLog)
|
|
{
|
|
// get the client info
|
|
%authInfo = %client.getAuthInfo();
|
|
%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 @ "]";
|
|
|
|
%logpath = $Host::ClassicAdminLogPath;
|
|
export("$AdminLog", %logpath, true);
|
|
logEcho($AdminLog);
|
|
echo($AdminLog);
|
|
}
|
|
}
|
|
|
|
// connectLog(%client, %realname, %tag)
|
|
// Info: Logs the connections
|
|
function connectLog(%client, %isDisconnect)
|
|
{
|
|
if($Host::ClassicConnectLog && !%client.isAIControlled())
|
|
{
|
|
// get the client info
|
|
%authInfo = %client.getAuthInfo();
|
|
%ip = getField(strreplace(%client.getAddress(),":","\t"),1);
|
|
|
|
// net tournament client present?
|
|
if (!%client.t2csri_sentComCertDone)
|
|
%ntc = "N";
|
|
else
|
|
%ntc = "Y";
|
|
|
|
if(%isDisconnect)
|
|
%inout = "[Drop]";
|
|
else
|
|
%inout = "[Join]";
|
|
|
|
if(%client.isSmurf)
|
|
%name = stripChars( detag( getTaggedString( %client.name ) ), "\cp\co\c6\c7\c8\c9" );
|
|
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 @ "]";
|
|
|
|
%logpath = $Host::ClassicConnLogPath;
|
|
export("$ConnectLog", %logpath, true);
|
|
logEcho($ConnectLog);
|
|
echo($ConnectLog);
|
|
}
|
|
} |