ManaPlus
|
#include <messageout.h>
Public Member Functions | |
MessageOut (const int16_t id) | |
~MessageOut () | |
Public Member Functions inherited from Net::MessageOut | |
virtual void | writeInt8 (const int8_t value, const char *const str) |
void | writeInt16 (const int16_t value, const char *const str) |
void | writeInt32 (const int32_t value, const char *const str) |
void | writeItemId (const int32_t value, const char *const str) |
void | writeInt64 (const int64_t value, const char *const str) |
void | writeBeingId (const BeingId value, const char *const str) |
void | writeCoordinates (const uint16_t x, const uint16_t y, unsigned char direction, const char *const str) |
void | writeString (const std::string &string, int length, const char *const str) |
void | writeStringNoLog (const std::string &string, int length, const char *const str) |
void | writeFloat (const float value, const char *const str) |
const char * | getData () const |
unsigned int | getDataSize () const |
void | resetPos () |
Private Member Functions | |
void | expand (const size_t size) const |
Private Attributes | |
Network * | mNetwork |
Additional Inherited Members | |
Static Public Member Functions inherited from Net::MessageOut | |
static unsigned char | toServerDirection (unsigned char direction) A_CONST |
Protected Member Functions inherited from Net::MessageOut | |
MessageOut (const int16_t id) | |
Protected Attributes inherited from Net::MessageOut | |
char * | mData |
unsigned int | mDataSize |
unsigned int | mPos |
uint16_t | mId |
bool | mIgnore |
Used for building an outgoing message.
Definition at line 41 of file messageout.h.
|
explicit |
Constructor.
Definition at line 37 of file messageout.cpp.
References CAST_SIZE, Ea::Network::fixSendBuffer(), Net::MessageOut::mData, mNetwork, Ea::Network::mOutBuffer, and Ea::Network::mOutSize.
|
virtual |
Reimplemented from Net::MessageOut.
Definition at line 45 of file messageout.cpp.
References DEBUGLOG2, and Net::MessageOut::mPos.
|
privatevirtual |
Expand the packet data to be able to hold more data.
NOTE: For performance enhancements this method could allocate extra memory in advance instead of expanding size every time more data is added.
Implements Net::MessageOut.
Definition at line 50 of file messageout.cpp.
References CAST_S32, CAST_U32, PacketCounters::incOutBytes(), mNetwork, and Ea::Network::mOutSize.
|
private |
Definition at line 56 of file messageout.h.
Referenced by expand(), and MessageOut().