mirror of
https://github.com/edubart/otclient.git
synced 2025-10-16 04:24:54 +02:00
missing files
* add questlog icon * add playertrade otui * some protocol changes for extended messages
This commit is contained in:
@@ -65,21 +65,20 @@ void OutputMessage::addU64(uint64 value)
|
||||
m_messageSize += 8;
|
||||
}
|
||||
|
||||
void OutputMessage::addString(const char* value)
|
||||
void OutputMessage::addString(const char* value, int length)
|
||||
{
|
||||
size_t stringLength = strlen(value);
|
||||
if(stringLength > 65535)
|
||||
if(length > 65535)
|
||||
throw NetworkException("[OutputMessage::addString] string length > 65535");
|
||||
checkWrite(stringLength + 2);
|
||||
addU16(stringLength);
|
||||
strcpy((char*)(m_buffer + m_writePos), value);
|
||||
m_writePos += stringLength;
|
||||
m_messageSize += stringLength;
|
||||
checkWrite(length + 2);
|
||||
addU16(length);
|
||||
memcpy((char*)(m_buffer + m_writePos), value, length);
|
||||
m_writePos += length;
|
||||
m_messageSize += length;
|
||||
}
|
||||
|
||||
void OutputMessage::addString(const std::string &value)
|
||||
void OutputMessage::addString(const std::string& value)
|
||||
{
|
||||
addString(value.c_str());
|
||||
addString(value.c_str(), value.length());
|
||||
}
|
||||
|
||||
void OutputMessage::addPaddingBytes(int bytes, uint8 byte)
|
||||
|
@@ -49,8 +49,8 @@ public:
|
||||
void addU16(uint16 value);
|
||||
void addU32(uint32 value);
|
||||
void addU64(uint64 value);
|
||||
void addString(const char* value);
|
||||
void addString(const std::string &value);
|
||||
void addString(const char* value, int length);
|
||||
void addString(const std::string& value);
|
||||
void addPaddingBytes(int bytes, uint8 byte = 0);
|
||||
|
||||
uint8* getBuffer() { return m_buffer; }
|
||||
|
Reference in New Issue
Block a user