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
packetIDInt32
PacketID to blacklist
Return
Void
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
packetTemplateString
Add a PacketTemplate, check ./Config/packets/ folder.
Return
Void
PacketLogger.AddWhitelist(packetID)
PacketLogger.AddWhitelist(packetID)
Add the packetID to the whitelist. Packets in the whitelist are always. (See PacketLogger.DiscardAll() )
Parameters
packetIDInt32
PacketID to whitelist
Return
Void
PacketLogger.DiscardAll(discardAll)
PacketLogger.DiscardAll(discardAll)
Packet logger will discard all packets, except the one in the whitelist. (See PacketLogger.AddWhitelist() )
Parameters
discardAllBoolean
True: Log only the packet in the whitelist - False: Log everything, but the packets in the blacklist
Return
Void
PacketLogger.DiscardShowHeader(showHeader)
PacketLogger.DiscardShowHeader(showHeader)
Packet logger will show the headers of discarded packets.
Parameters
showHeaderBoolean
True: Always show headers - False: Hide everything.
Return
Void
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
packetPathString
Possible 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
packetIDInt32
Remove a spacific packetID. (Default: -1 Remove All)
Return
Void
PacketLogger.Reset()
PacketLogger.Reset()
Reset the packet logger to defaults.
Return
Void
PacketLogger.SendToClient(packetData)
PacketLogger.SendToClient(packetData)
Send a packet to the client.
Parameters
packetDataByte[][] PythonList List[Byte]
Return
Void
PacketLogger.SendToServer(packetData)
PacketLogger.SendToServer(packetData)
Send a packet to the server.
Parameters
packetDataByte[][] PythonList List[Byte]
Return
Void
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
String
The path to the saved file.
PacketLogger.Start(outputpath, appendLogs)
PacketLogger.Start(outputpath, appendLogs)
Start the RazorEnhanced packet logger.
Parameters
outputpathString Boolean
Custom output path (Default: ./Desktop/Razor_Packets.log)
appendLogsBoolean
True: Append - False: Overwrite (Default: False)
Return
String
The path to the saved file.
PacketLogger.Stop()
PacketLogger.Stop()
Stop the RazorEnhanced packet logger.
Return
String
The path to the saved file.