69 value = (
unsigned short) ENET_NET_TO_HOST_16(t);
86 value = ENET_NET_TO_HOST_32(t);
100 if (fixedLength != length)
104 return std::string();
115 if (length < 0 || mPos + length >
mLength)
118 return std::string();
123 const char *stringEnd = (
const char *)memchr(stringBeg,
'\0', length);
125 stringEnd ? stringEnd - stringBeg : length);
bool readValueType(ManaServ::ValueType type)
uint16_t readInt16()
Reads an unsigned 16-bit integer from the message.
unsigned int mLength
The length of the data.
const char * mData
The message data.
unsigned int mPos
Actual position in the packet.
std::string readString(int length=-1)
Reads a string.
MessageIn(const char *data, unsigned int length)
bool mDebugMode
Includes debugging information.
uint32_t readInt32()
Reads an unsigned 32-bit integer from the message.
uint8_t readInt8()
Reads an unsigned 8-bit integer from the message.
unsigned short mId
The message ID.
ValueType
The type of a value in a message.