diff --git a/SQCSim-common/netprotocol.cpp b/SQCSim-common/netprotocol.cpp index 792364b..5bad78b 100644 --- a/SQCSim-common/netprotocol.cpp +++ b/SQCSim-common/netprotocol.cpp @@ -925,14 +925,16 @@ bool netprot::Deserialize(Chat* chat, char* buf, uint32_t *buflen) { (uint64_t)dstt[6] << 8 | (uint64_t)dstt[7]; - size_t messsize = std::strlen(buf + sizeof(uint64_t) * 3) + 1; + size_t messsize = std::strlen(&buf[sizeof(uint64_t) * 3]) + 1; if (messsize > 140) return false; + std::cout << messsize << ": " << &buf[1 + sizeof(uint64_t) * 3] << std::endl; + strcpy(chat->mess, messsize, &buf[1 + sizeof(uint64_t) * 3]); - *buflen = messsize + sizeof(uint64_t) * 3 + 1; + //*buflen = messsize + sizeof(uint64_t) * 3 + 1; return true; }