mirror of
https://github.com/ChocoTaco1/TacoServer.git
synced 2026-07-11 06:04:33 +00:00
NoEvo Redo
This commit is contained in:
parent
b84ddd8859
commit
facba6d9cd
36 changed files with 6686 additions and 2425 deletions
61
Classic/scripts/autoexec/EnableLogs.cs
Normal file
61
Classic/scripts/autoexec/EnableLogs.cs
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
$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);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue