diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-05-17 01:03:34 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-05-17 01:03:34 +0300 |
commit | 5d77b00cba5398482c4eb9422ae4f06ae3509b8f (patch) | |
tree | ea8c4b6a012d4c9e27e227621197330f8fc2eacd /src/net/eathena/guildhandler.cpp | |
parent | 0c5402def993b1df930cda7fcdaff4f865a84fdb (diff) | |
download | plus-5d77b00cba5398482c4eb9422ae4f06ae3509b8f.tar.gz plus-5d77b00cba5398482c4eb9422ae4f06ae3509b8f.tar.bz2 plus-5d77b00cba5398482c4eb9422ae4f06ae3509b8f.tar.xz plus-5d77b00cba5398482c4eb9422ae4f06ae3509b8f.zip |
Fix sending packets for version 20151001 and bigger.
Diffstat (limited to 'src/net/eathena/guildhandler.cpp')
-rw-r--r-- | src/net/eathena/guildhandler.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/net/eathena/guildhandler.cpp b/src/net/eathena/guildhandler.cpp index 3da443dda..9d5e15f48 100644 --- a/src/net/eathena/guildhandler.cpp +++ b/src/net/eathena/guildhandler.cpp @@ -34,6 +34,7 @@ #include "debug.h" extern Net::GuildHandler *guildHandler; +extern int packetVersion; namespace EAthena { @@ -125,9 +126,17 @@ void GuildHandler::chat(const std::string &text) const const std::string str = std::string(localPlayer->getName()).append( " : ").append(text); createOutPacket(CMSG_GUILD_MESSAGE); - outMsg.writeInt16(CAST_U16(str.size() + 4 + 1), "len"); - outMsg.writeString(str, CAST_S32(str.length()), "message"); - outMsg.writeInt8(0, "zero byte"); + if (packetVersion >= 20151001) + { + outMsg.writeInt16(CAST_U16(str.size() + 4), "len"); + outMsg.writeString(str, CAST_S32(str.length()), "message"); + } + else + { + outMsg.writeInt16(CAST_U16(str.size() + 4 + 1), "len"); + outMsg.writeString(str, CAST_S32(str.length()), "message"); + outMsg.writeInt8(0, "zero byte"); + } } void GuildHandler::memberList() const |