![]() |
Shadowrun: Awakened 29 September 2011 - Build 871
|
Writes incoming and outgoing messages to the screen. This will write all incoming and outgoing messages to the console window, or to a file if you override it and give it this functionality.
#include <PacketLogger.h>
Inheritance diagram for RakNet::PacketLogger:Public Member Functions | |
| virtual void | FormatLine (char *into, const char *dir, const char *type, unsigned int reliableMessageNumber, unsigned int frame, unsigned char messageIdentifier, const BitSize_t bitLen, unsigned long long time, const SystemAddress &local, const SystemAddress &remote, unsigned int splitPacketId, unsigned int splitPacketIndex, unsigned int splitPacketCount, unsigned int orderingIndex) |
| virtual void | FormatLine (char *into, const char *dir, const char *type, unsigned int reliableMessageNumber, unsigned int frame, const char *idToPrint, const BitSize_t bitLen, unsigned long long time, const SystemAddress &local, const SystemAddress &remote, unsigned int splitPacketId, unsigned int splitPacketIndex, unsigned int splitPacketCount, unsigned int orderingIndex) |
| virtual void | LogHeader (void) |
| Logs out a header for all the data. | |
| virtual void | OnAck (unsigned int messageNumber, SystemAddress remoteSystemAddress, RakNet::TimeMS time) |
| virtual void | OnDirectSocketReceive (const char *data, const BitSize_t bitsUsed, SystemAddress remoteSystemAddress) |
| virtual void | OnDirectSocketSend (const char *data, const BitSize_t bitsUsed, SystemAddress remoteSystemAddress) |
| Events on low level sends and receives. These functions may be called from different threads at the same time. | |
| virtual void | OnInternalPacket (InternalPacket *internalPacket, unsigned frameNumber, SystemAddress remoteSystemAddress, RakNet::TimeMS time, int isSend) |
| virtual void | OnPushBackPacket (const char *data, const BitSize_t bitsUsed, SystemAddress remoteSystemAddress) |
| virtual void | OnReliabilityLayerPacketError (const char *errorMessage, const BitSize_t bitsUsed, SystemAddress remoteSystemAddress) |
| PacketLogger () | |
| void | SetLogDirectMessages (bool send) |
| Log the direct sends and receives or not. Default true. | |
| virtual void | SetPrefix (const char *_prefix) |
| Prepend this string to output logs. | |
| virtual void | SetPrintAcks (bool print) |
| virtual void | SetPrintID (bool print) |
| virtual void | SetSuffix (const char *_suffix) |
| Append this string to output logs. (newline is useful here) | |
| virtual void | WriteLog (const char *str) |
| Override this to log strings to wherever. Log should be threadsafe. | |
| virtual void | WriteMiscellaneous (const char *type, const char *msg) |
| virtual | ~PacketLogger () |
Static Public Member Functions | |
| static const char * | BaseIDTOString (unsigned char Id) |
| static void | DestroyInstance (PacketLogger *i) |
| static PacketLogger * | GetInstance (void) |
Protected Member Functions | |
| virtual void | AddToLog (const char *str) |
| void | GetLocalTime (char buffer[128]) |
| const char * | IDTOString (unsigned char Id) |
| virtual const char * | UserIDTOString (unsigned char Id) |
Protected Attributes | |
| bool | logDirectMessages |
| char | prefix [256] |
| bool | printAcks |
| bool | printId |
| char | suffix [256] |
Definition at line 31 of file PacketLogger.h.
| RakNet::PacketLogger::PacketLogger | ( | ) |
| virtual RakNet::PacketLogger::~PacketLogger | ( | ) | [virtual] |
| virtual void RakNet::PacketLogger::AddToLog | ( | const char * | str | ) | [protected, virtual] |
Reimplemented in RakNet::ThreadsafePacketLogger.
| static const char* RakNet::PacketLogger::BaseIDTOString | ( | unsigned char | Id | ) | [static] |
| static void RakNet::PacketLogger::DestroyInstance | ( | PacketLogger * | i | ) | [static] |
| virtual void RakNet::PacketLogger::FormatLine | ( | char * | into, |
| const char * | dir, | ||
| const char * | type, | ||
| unsigned int | reliableMessageNumber, | ||
| unsigned int | frame, | ||
| const char * | idToPrint, | ||
| const BitSize_t | bitLen, | ||
| unsigned long long | time, | ||
| const SystemAddress & | local, | ||
| const SystemAddress & | remote, | ||
| unsigned int | splitPacketId, | ||
| unsigned int | splitPacketIndex, | ||
| unsigned int | splitPacketCount, | ||
| unsigned int | orderingIndex | ||
| ) | [virtual] |
| virtual void RakNet::PacketLogger::FormatLine | ( | char * | into, |
| const char * | dir, | ||
| const char * | type, | ||
| unsigned int | reliableMessageNumber, | ||
| unsigned int | frame, | ||
| unsigned char | messageIdentifier, | ||
| const BitSize_t | bitLen, | ||
| unsigned long long | time, | ||
| const SystemAddress & | local, | ||
| const SystemAddress & | remote, | ||
| unsigned int | splitPacketId, | ||
| unsigned int | splitPacketIndex, | ||
| unsigned int | splitPacketCount, | ||
| unsigned int | orderingIndex | ||
| ) | [virtual] |
| static PacketLogger* RakNet::PacketLogger::GetInstance | ( | void | ) | [static] |
| void RakNet::PacketLogger::GetLocalTime | ( | char | buffer[128] | ) | [protected] |
| const char* RakNet::PacketLogger::IDTOString | ( | unsigned char | Id | ) | [protected] |
| virtual void RakNet::PacketLogger::LogHeader | ( | void | ) | [virtual] |
| virtual void RakNet::PacketLogger::OnAck | ( | unsigned int | messageNumber, |
| SystemAddress | remoteSystemAddress, | ||
| RakNet::TimeMS | time | ||
| ) | [virtual] |
Called when we get an ack for a message we reliabily sent
| [in] | messageNumber | The numerical identifier for which message this is |
| [in] | remoteSystemAddress | The player we sent or got this packet from |
| [in] | time | The current time as returned by RakNet::GetTimeMS() |
Reimplemented from RakNet::PluginInterface2.
| virtual void RakNet::PacketLogger::OnDirectSocketReceive | ( | const char * | data, |
| const BitSize_t | bitsUsed, | ||
| SystemAddress | remoteSystemAddress | ||
| ) | [virtual] |
Called on a receive from the socket, per datagram, that does not go through the reliability layer
| [in] | data | The data being sent |
| [in] | bitsUsed | How many bits long data is |
| [in] | remoteSystemAddress | Which system this message is being sent to |
Reimplemented from RakNet::PluginInterface2.
| virtual void RakNet::PacketLogger::OnDirectSocketSend | ( | const char * | data, |
| const BitSize_t | bitsUsed, | ||
| SystemAddress | remoteSystemAddress | ||
| ) | [virtual] |
Reimplemented from RakNet::PluginInterface2.
| virtual void RakNet::PacketLogger::OnInternalPacket | ( | InternalPacket * | internalPacket, |
| unsigned | frameNumber, | ||
| SystemAddress | remoteSystemAddress, | ||
| RakNet::TimeMS | time, | ||
| int | isSend | ||
| ) | [virtual] |
Called on a send or receive of a message within the reliability layer
| [in] | internalPacket | The user message, along with all send data. |
| [in] | frameNumber | The number of frames sent or received so far for this player depending on isSend . Indicates the frame of this user message. |
| [in] | remoteSystemAddress | The player we sent or got this packet from |
| [in] | time | The current time as returned by RakNet::GetTimeMS() |
| [in] | isSend | Is this callback representing a send event or receive event? |
Reimplemented from RakNet::PluginInterface2.
| virtual void RakNet::PacketLogger::OnPushBackPacket | ( | const char * | data, |
| const BitSize_t | bitsUsed, | ||
| SystemAddress | remoteSystemAddress | ||
| ) | [virtual] |
System called RakPeerInterface::PushBackPacket
| [in] | data | The data being sent |
| [in] | bitsUsed | How many bits long data is |
| [in] | remoteSystemAddress | The player we sent or got this packet from |
Reimplemented from RakNet::PluginInterface2.
| virtual void RakNet::PacketLogger::OnReliabilityLayerPacketError | ( | const char * | errorMessage, |
| const BitSize_t | bitsUsed, | ||
| SystemAddress | remoteSystemAddress | ||
| ) | [virtual] |
Called when the reliability layer rejects a send or receive
| [in] | bitsUsed | How many bits long data is |
| [in] | remoteSystemAddress | Which system this message is being sent to |
Reimplemented from RakNet::PluginInterface2.
| void RakNet::PacketLogger::SetLogDirectMessages | ( | bool | send | ) |
| virtual void RakNet::PacketLogger::SetPrefix | ( | const char * | _prefix | ) | [virtual] |
| virtual void RakNet::PacketLogger::SetPrintAcks | ( | bool | ) | [virtual] |
| virtual void RakNet::PacketLogger::SetPrintID | ( | bool | ) | [virtual] |
| virtual void RakNet::PacketLogger::SetSuffix | ( | const char * | _suffix | ) | [virtual] |
| virtual const char* RakNet::PacketLogger::UserIDTOString | ( | unsigned char | Id | ) | [protected, virtual] |
| virtual void RakNet::PacketLogger::WriteLog | ( | const char * | str | ) | [virtual] |
Reimplemented in RakNet::PacketConsoleLogger, RakNet::PacketFileLogger, and RakNet::PacketOutputWindowLogger.
| virtual void RakNet::PacketLogger::WriteMiscellaneous | ( | const char * | type, |
| const char * | msg | ||
| ) | [virtual] |
bool RakNet::PacketLogger::logDirectMessages [protected] |
Definition at line 88 of file PacketLogger.h.
char RakNet::PacketLogger::prefix[256] [protected] |
Definition at line 91 of file PacketLogger.h.
bool RakNet::PacketLogger::printAcks [protected] |
Definition at line 90 of file PacketLogger.h.
bool RakNet::PacketLogger::printId [protected] |
Definition at line 90 of file PacketLogger.h.
char RakNet::PacketLogger::suffix[256] [protected] |
Definition at line 92 of file PacketLogger.h.
Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.