PacketLogger

packet logger.

Table of Contents

Properties

PathToString

Syntax: PacketLogger.PathToString
Returns: Dictionary[PacketPath, String]

StringToPath

Syntax: PacketLogger.StringToPath
Returns: Dictionary[String, PacketPath]

Methods

AddBlacklist

Syntax: PacketLogger.AddBlacklist(packetID)

Add the packetID to the blacklist. Packets in the backlist will not be logged. (See PacketLogger.DiscardAll() )

Parameters:
  • packetID (Int32): PacketID to blacklist
Returns: Void

AddTemplate

Syntax: PacketLogger.AddTemplate(packetTemplate)

Add a custom template for packet logger. Example of "Damage" (0x0B) packet: { 'packetID': 0x0B, 'name': 'Damage 0x0B', 'showHexDump': true, 'fields':[ { 'name':'packetID', 'length':1, 'type':'packetID'}, { 'name':'Serial', 'length':4, 'type':'serial'}, { 'name':'Damage', 'length': 2, 'type':'int'}, ] }

Parameters:
  • packetTemplate (String): Add a PacketTemplate, check ./Persistence/packets/ folder.
Returns: Void

AddWhitelist

Syntax: PacketLogger.AddWhitelist(packetID)

Add the packetID to the whitelist. Packets in the whitelist are always. (See PacketLogger.DiscardAll() )

Parameters:
  • packetID (Int32): PacketID to whitelist
Returns: Void

DiscardAll

Syntax: PacketLogger.DiscardAll(discardAll)

Packet logger will discard all packets, except the one in the whitelist. (See PacketLogger.AddWhitelist() )

Parameters:
  • discardAll (Boolean): True: Log only the packet in the whitelist - False: Log everything, but the packets in the blacklist
Returns: Void

DiscardShowHeader

Syntax: PacketLogger.DiscardShowHeader(showHeader)

Packet logger will show the headers of discarded packets.

Parameters:
  • showHeader (Boolean): True: Always show headers - False: Hide everything.
Returns: Void

ListenPacketPath

Syntax: PacketLogger.ListenPacketPath(packetPath, active)

Packet logger will discard all packets, except the one in the whitelist. (See PacketLogger.AddWhitelist() ) If the packetPath is not set or not resognized, the function simply returns the current active paths.

Parameters:
  • packetPath (String): Possible values: ClientToServer ServerToClient RazorToServer (TODO) RazorToClient (TODO) PacketVideo (TODO)
  • active (Boolean)
Returns: String[]

RemoveTemplate

Syntax: PacketLogger.RemoveTemplate(packetID)

Remove a PacketTemplate for packet logger.

Parameters:
  • packetID (Int32): Remove a spacific packetID. (Default: -1 Remove All)
Returns: Void

Reset

Syntax: PacketLogger.Reset()

Reset the packet logger to defaults.

Returns: Void

SendToClient

Syntax: PacketLogger.SendToClient(packetData)

Send a packet to the client.

Parameters:
  • packetData (Byte[])
Returns: Void

SendToServer

Syntax: PacketLogger.SendToServer(packetData)

Send a packet to the server.

Parameters:
  • packetData (Byte[])
Returns: Void

SetOutputPath

Syntax: PacketLogger.SetOutputPath(outputpath)

Set the packet logger. Calling it without a path it rester it to the default path.

Parameters:
  • outputpath (String): (Optional) Custom output path (Default: reset to ./Desktop/Razor_Packets.log)
Returns: String

Start

Syntax: PacketLogger.Start(outputpath, appendLogs)

Start the packet logger.

Parameters:
  • outputpath (String): Custom output path (Default: ./Desktop/Razor_Packets.log)
  • appendLogs (Boolean): True: Append - False: Overwrite (Default: False)
Returns: String

Stop

Syntax: PacketLogger.Stop()

Stop the packet logger.

Returns: String