NLNET::TMessageRecord Struct Reference

#include <message_recorder.h>


Public Member Functions

void serial (NLMISC::CMemStream &stream)
 Serial to string stream.

 TMessageRecord (TNetworkEvent event, TSockId sockid, CMessage &msg, sint64 updatecounter)
 Alt. constructor.

 TMessageRecord (bool input=false)
 Default constructor.


Data Fields

TNetworkEvent Event
CMessage Message
TSockId SockId
sint64 UpdateCounter


Constructor & Destructor Documentation

NLNET::TMessageRecord::TMessageRecord bool  input = false  )  [inline]
 

Default constructor.

Definition at line 65 of file message_recorder.h.

References Message, SockId, and UpdateCounter.

00065 : UpdateCounter(0), SockId(InvalidSockId), Message( "", input ) {}

NLNET::TMessageRecord::TMessageRecord TNetworkEvent  event,
TSockId  sockid,
CMessage msg,
sint64  updatecounter
[inline]
 

Alt. constructor.

Definition at line 68 of file message_recorder.h.

References Event, Message, sint64, SockId, NLNET::TSockId, and UpdateCounter.

00068                                                                                                    :
00069                 UpdateCounter(updatecounter), Event(event), SockId(sockid), Message(msg) {}


Member Function Documentation

void NLNET::TMessageRecord::serial NLMISC::CMemStream stream  )  [inline]
 

Serial to string stream.

Definition at line 72 of file message_recorder.h.

References NLMISC::CMemStream::buffer(), NLMISC::CMemStream::bufferToFill(), Event, NLNET::EventToString(), NLMISC::IStream::isReading(), len, NLNET::CMessage::length(), Message, nlassert, NLMISC::CMemStream::serial(), NLMISC::CMemStream::serialBuffer(), NLMISC::CMemStream::serialHex(), SockId, NLMISC::CMemStream::stringMode(), NLNET::StringToEvent(), uint32, and UpdateCounter.

Referenced by NLNET::CMessageRecorder::loadNext(), and NLNET::CMessageRecorder::recordNext().

00073         {
00074                 nlassert( stream.stringMode() );
00075                 
00076                 uint32 len;
00077                 string s_event;
00078                 stream.serial( UpdateCounter );
00079                 if ( stream.isReading() )
00080                 {
00081                         stream.serial( s_event );
00082                         Event = StringToEvent( s_event );
00083                         stream.serialHex( (uint32&)SockId );
00084                         stream.serial( len );
00085                         stream.serialBuffer( Message.bufferToFill( len ), len );
00086                 }
00087                 else
00088                 {
00089                         s_event = EventToString( Event );
00090                         stream.serial( s_event );
00091                         stream.serialHex( (uint32&)SockId );
00092                         len = Message.length();
00093                         stream.serial( len );
00094                         stream.serialBuffer( const_cast<uint8*>(Message.buffer()), len ); // assumes the message contains plain text
00095                 }
00096         }


Field Documentation

TNetworkEvent NLNET::TMessageRecord::Event
 

Definition at line 100 of file message_recorder.h.

Referenced by NLNET::CMessageRecorder::checkNextOne(), NLNET::CMessageRecorder::replayConnectionAttempt(), NLNET::CMessageRecorder::replayNextDataAvailable(), serial(), and TMessageRecord().

CMessage NLNET::TMessageRecord::Message
 

Definition at line 102 of file message_recorder.h.

Referenced by NLNET::CMessageRecorder::replayConnectionAttempt(), serial(), and TMessageRecord().

TSockId NLNET::TMessageRecord::SockId
 

Definition at line 101 of file message_recorder.h.

Referenced by serial(), and TMessageRecord().

sint64 NLNET::TMessageRecord::UpdateCounter
 

Definition at line 99 of file message_recorder.h.

Referenced by NLNET::CMessageRecorder::replayConnectionAttempt(), serial(), and TMessageRecord().


The documentation for this struct was generated from the following file:
Generated on Tue Mar 16 14:08:23 2004 for NeL by doxygen 1.3.6