diff --git a/external/3rd/library/soePlatform/ChatAPI/projects/ChatAPI/ChatAPICore.cpp b/external/3rd/library/soePlatform/ChatAPI/projects/ChatAPI/ChatAPICore.cpp index e1d79635..74c02624 100644 --- a/external/3rd/library/soePlatform/ChatAPI/projects/ChatAPI/ChatAPICore.cpp +++ b/external/3rd/library/soePlatform/ChatAPI/projects/ChatAPI/ChatAPICore.cpp @@ -1875,11 +1875,18 @@ void ChatAPICore::responseCallback(short type, ByteStream::ReadIterator &iter) { MKickRoom M(iter); ChatRoomCore *destRoomCore = getRoomCore(M.getRoomID()); + + if (!destRoomCore) { + _chatdebug_("ChatAPI:destroomCore is null!"); + break; + } + if (!M.getSrcAvatar() || !M.getDestAvatar()) { _chatdebug_("ChatAPI:BadData: MESSAGE_KICKROOM: M.getSrcAvatar()=%p, M.getDestAvatar()=%p\n", M.getSrcAvatar(), M.getDestAvatar()); break; } + ChatAvatar *destAvatar = M.getDestAvatar()->getNewChatAvatar(); ChatAvatar *srcAvatar = M.getSrcAvatar()->getNewChatAvatar(); ChatAvatarCore *kickedAvatar = destRoomCore ? destRoomCore->removeAvatar(destAvatar->getAvatarID()) : NULL; diff --git a/external/3rd/library/soePlatform/ChatAPI/utils/UdpLibrary/UdpMisc.cpp b/external/3rd/library/soePlatform/ChatAPI/utils/UdpLibrary/UdpMisc.cpp index a88ab603..754343fe 100644 --- a/external/3rd/library/soePlatform/ChatAPI/utils/UdpLibrary/UdpMisc.cpp +++ b/external/3rd/library/soePlatform/ChatAPI/utils/UdpLibrary/UdpMisc.cpp @@ -87,10 +87,10 @@ int UdpMisc::Crc32(const void *buffer, int bufferLen, int encryptValue) 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D}; int crc = 0xffffffff; - crc = (crc >> (8 & 0x00FFFFFFL)) ^ crc32_table[(crc ^ (encryptValue & 0xff)) & 0x000000FFL]; - crc = (crc >> (8 & 0x00FFFFFFL)) ^ crc32_table[(crc ^ ((encryptValue >> 8) & 0xff)) & 0x000000FFL]; - crc = (crc >> (8 & 0x00FFFFFFL)) ^ crc32_table[(crc ^ ((encryptValue >> 16) & 0xff)) & 0x000000FFL]; - crc = (crc >> (8 & 0x00FFFFFFL)) ^ crc32_table[(crc ^ ((encryptValue >> 24) & 0xff)) & 0x000000FFL]; + crc = (crc >> 8) & 0x00FFFFFFL) ^ crc32_table[(crc ^ (encryptValue & 0xff)) & 0x000000FFL]; + crc = (crc >> 8) & 0x00FFFFFFL) ^ crc32_table[(crc ^ ((encryptValue >> 8) & 0xff)) & 0x000000FFL]; + crc = (crc >> 8) & 0x00FFFFFFL) ^ crc32_table[(crc ^ ((encryptValue >> 16) & 0xff)) & 0x000000FFL]; + crc = (crc >> 8) & 0x00FFFFFFL) ^ crc32_table[(crc ^ ((encryptValue >> 24) & 0xff)) & 0x000000FFL]; const udp_uchar *bufPtr = (const udp_uchar *)buffer; const udp_uchar *endPtr = (const udp_uchar *)buffer + bufferLen;