PacketLogger
RazorEnhanced packet logger.
TODO: PacketLogger Constructors
Properties
PacketLogger.PathToStringDictionary[PacketPath, String]
PacketLogger.PathToStringDictionary[PacketPath, String]
PacketLogger.StringToPathDictionary[String, PacketPath]
PacketLogger.StringToPathDictionary[String, PacketPath]
Methods
PacketLogger.AddBlacklist(packetID)
PacketLogger.AddBlacklist(packetID)
Add the packetID to the blacklist. Packets in the backlist will not be logged. (See PacketLogger.DiscardAll() )
Parameters
packetIDInt32PacketID to blacklist
PacketLogger.AddTemplate(packetTemplate)
PacketLogger.AddTemplate(packetTemplate)
Add a custom template for RazorEnhanced 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
packetTemplateStringAdd a PacketTemplate, check ./Config/packets/ folder.
PacketLogger.AddWhitelist(packetID)
PacketLogger.AddWhitelist(packetID)
Add the packetID to the whitelist. Packets in the whitelist are always. (See PacketLogger.DiscardAll() )
Parameters
packetIDInt32PacketID to whitelist
PacketLogger.DiscardAll(discardAll)
PacketLogger.DiscardAll(discardAll)
Packet logger will discard all packets, except the one in the whitelist. (See PacketLogger.AddWhitelist() )
Parameters
discardAllBooleanTrue: Log only the packet in the whitelist - False: Log everything, but the packets in the blacklist
PacketLogger.DiscardShowHeader(showHeader)
PacketLogger.DiscardShowHeader(showHeader)
Packet logger will show the headers of discarded packets.
Parameters
showHeaderBooleanTrue: Always show headers - False: Hide everything.
PacketLogger.ListenPacketPath(packetPath, active)
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
packetPathStringPossible values:
ClientToServer
ServerToClient
RazorToServer (TODO)
RazorToClient (TODO)
PacketVideo (TODO)
activeBoolean
Return
String[][]List of strings of currently active packet paths.
PacketLogger.RemoveTemplate(packetID)
PacketLogger.RemoveTemplate(packetID)
Remove a PacketTemplate for RazorEnhanced packet logger.
Parameters
packetIDInt32Remove a spacific packetID. (Default: -1 Remove All)
PacketLogger.Reset()
Reset the packet logger to defaults.
PacketLogger.SendToClient(packetData)
PacketLogger.SendToClient(packetData)
Send a packet to the client.
Parameters
packetDataByte[][]
PythonList
List[Byte]
PacketLogger.SendToServer(packetData)
PacketLogger.SendToServer(packetData)
Send a packet to the server.
Parameters
packetDataByte[][]
PythonList
List[Byte]
PacketLogger.SetOutputPath(outputpath)
PacketLogger.SetOutputPath(outputpath)
Set the RazorEnhanced packet logger. Calling it without a path it rester it to the default path.
Parameters
outputpathString(Optional) Custom output path (Default: reset to ./Desktop/Razor_Packets.log)
Return
StringThe path to the saved file.
PacketLogger.Start(outputpath, appendLogs)
PacketLogger.Start(outputpath, appendLogs)
Start the RazorEnhanced packet logger.
Parameters
outputpathString
BooleanCustom output path (Default: ./Desktop/Razor_Packets.log)
appendLogsBooleanTrue: Append - False: Overwrite (Default: False)
Return
StringThe path to the saved file.
PacketLogger.Stop()
Stop the RazorEnhanced packet logger.
Return
StringThe path to the saved file.