Skip to main content

Parsing Logs

All logs returned from RCONClientV1 and RCONClientV2 both share the same structure, and are automatically parsed into easily digestible JSON formats listed below.

note

Every log shares two common variables: type and timestamp. Because of this they will be omitted from the following definitions. The header of each definition below is its type variable.


Log Events

If polling is enabled, each log below will be fired as an event on the IRCONClient class. The eventName will be the same as its event type. Additionally, there is a special newLog event, which fires for every new log that is parsed.

Example

IRCONClient.on("playerConnected", (log) => {
console.log(log);

// Logs the following:
//
// {
// id: "LOG_HASH",
// parsed: {
// playerId: "PLAYER_ID",
// playerName: "PLAYER_NAME"
// }
// }
})

playerConnected

NameTypeComment
playerIdString
playerNameString

playerDisconnected

NameTypeComment
playerIdString
playerNameString

playerSwitchFaction

NameTypeComment
playerNameString
oldFactionStringNone, Axis, or Allies
newFactionStringNone, Axis, or Allies

matchStart

NameTypeComment
mapNameString

matchEnded

NameTypeComment
mapNameString
alliesScoreNumber
axisScoreNumber

voteStarted

NameTypeComment
voteIdNumber
voteTypeStringCan be PVR_Kick_Abuse or PVR_Kick_Cheating
executorNameString
targetNameString

voteCast

NameTypeComment
voteIdNumber
playerNameString
actionStringCan be PV_Favour, PV_Ignored, or PV_Against

voteExpiredBeforeCompletion

note

This is when a vote doesnt pass.

NameTypeComment
voteIdNumber

voteCompleted

note

This is when a vote passes.

NameTypeComment
voteIdNumber
resultStringCan be PVR_Passed or PVR_ExpiredOrCancelled

votePrematurelyExpired

note

This seems to be a bug, when a vote kick is initiated and immediately drops. You may still be able to vote but it will never actually kick the player.

NameTypeComment
voteIdNumber

votePassed

note

This is also when a vote passes, contains more detailed information

NameTypeComment
playerNameString
forVotesNumber
requiredVotesNumber
againstVotesNumber

playerKilled

NameTypeComment
killerNameString
killerFactionStringAxis or Allies
killerIdString
victimNameString
victimFactionStringAxis or Allies
victimIdString
weaponString

playerTeamKilled

NameTypeComment
killerNameString
killerFactionStringAxis or Allies
killerIdString
victimNameString
victimFactionStringAxis or Allies
victimIdString
weaponString

playerKicked

NameTypeComment
playerNameString
reasonString

playerBanned

note

To find the responsible admin ID, you will have to use data from a PlayerManager, THE ADMINISTRATOR is the actual static value in the log, not a placeholder.

NameTypeComment
temporaryBooleanTrue if the ban is temporary, otherwise is permanent.
durationNumber | nullIf the ban is temporary, the duration in hours.
bannedByStringEither VOTE or THE ADMINISTRATOR.
playerNameString
fullReasonStringThe full reason shown to the user when they're kicked.
customReasonString | nullThe custom reason provided by an admin, if any.

message

NameTypeComment
playerNameString
playerIdString
messageStringThe message, newlines are escaped.

teamChat

NameTypeComment
playerNameString
playerIdString
playerFactionStringAxis or Allies
messageStringThe message, newlines are escaped.

unitChat

NameTypeComment
playerNameString
playerIdString
playerFactionStringAxis or Allies
messageStringThe message, newlines are escaped.

playerEnteredAdminCamera

NameTypeComment
playerNameString
playerIdString

playerLeftAdminCamera

NameTypeComment
playerNameString
playerIdString