Proper VoteLogging

This commit is contained in:
ChocoTaco1 2020-04-04 13:48:22 -04:00
parent bf5ae873c1
commit 58bb1cb4f9
4 changed files with 35 additions and 3 deletions

View file

@ -72,6 +72,8 @@ $Host::ClassicTelnetPort = 666;
$Host::ClassicTkLimit = 0;
$Host::ClassicUseHighPerformanceCounter = 0;
$Host::ClassicViralBanning = 1;
$Host::ClassicVoteLog = 1;
$Host::ClassicVoteLogPath = "logs/Vote/Vote.log";
$Host::ClassicWhitelist = "prefs/whitelist.cs";
$Host::CRCTextures = 0;
$Host::Dedicated = 1;

View file

@ -1,5 +1,7 @@
$Host::ClassicAdminLog = 1;
$Host::ClassicConnectLog = 1;
//$Host::ClassicAdminLog = 1;
//$Host::ClassicConnectLog = 1;
//$Host::ClassicVoteLog = 1;
//exec("scripts/autoexec/EnableLogs.cs");
//Enable Logs
@ -58,4 +60,23 @@ function connectLog(%client, %isDisconnect)
logEcho($ConnectLog);
echo($ConnectLog);
}
}
// voteLog(%client, %votemsg)
// Info: Logs the vote events
function voteLog(%client, %votemsg)
{
if($Host::ClassicVoteLog)
{
// get the client info
%authInfo = %client.getAuthInfo();
%ip = getField(strreplace(%client.getAddress(),":","\t"),1);
// 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 %votemsg SPC "CM[" @ $CurrentMission @ "]";
%logpath = $Host::ClassicVoteLogPath;
export("$VoteLog", %logpath, true);
logEcho($VoteLog);
}
}

View file

@ -607,7 +607,14 @@ function playerStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %tea
%client.canVote = false;
%client.rescheduleVote = schedule(($Host::voteSpread * 1000) + ($Host::voteTime * 1000) , 0, "resetVotePrivs", %client);
echo("Vote Initiated by" SPC %client.nameBase SPC %typeName SPC %arg1 SPC %arg2 SPC %arg3 SPC %arg4);
echo(%msg);
// Log Vote
if($Host::ClassicVoteLog)
{
%votemsg = %typeName SPC %arg1 SPC %arg2 SPC %arg3 SPC %arg4;
voteLog(%client, %votemsg);
}
if($Host::EnableVoteSoundReminders > 0)
{

View file

@ -169,6 +169,8 @@ $Host::ClassicViralBanning = 1;
$Host::ClassicWhitelist = "prefs/whitelist.cs";
$Host::ClassicSuppressTraversalRootError = 1;
$Host::ClassicMaxVotes = 5;
$Host::ClassicVoteLog = 1;
$Host::ClassicVoteLogPath = "logs/Vote/Vote.log";
$Host::ServerRules1 = "\c2if\c4(\c3%client.fun == \c5true \c4&& \c3%client.Llama_Grabs \c4< \c51\c4)";
$Host::ServerRules2 = " \c1Be_Courteous\c4(\c2%client, %game\c4);";
$Host::ServerRules3 = "\c2else if\c4(\c3%client.attitude \c4!$ = \c5%client.fun\c4)";