This commit is contained in:
MarcEricMartel
2023-10-29 14:54:36 -04:00
parent 0b07d46dba
commit b54f8c31e5
9 changed files with 56 additions and 71 deletions

View File

@@ -166,7 +166,7 @@ namespace netprot {
void sendPack(SOCKET sock, T* pack, char** buf, uint32_t* buflen) {
netprot::Serialize(pack, buf, buflen);
memset(&buf[*buflen], '\0', sizeof(uint64_t) + sizeof(uint8_t));
buflen += sizeof(uint64_t) + sizeof(uint8_t);
buflen += (sizeof(uint64_t) + sizeof(uint8_t));
send(sock, *buf, *buflen, 0);
*buflen = BUFFER_LENGTH;
}
@@ -176,7 +176,7 @@ namespace netprot {
sockaddr_in addr = *sockad;
netprot::Serialize(pack, buf, buflen);
memset(&buf[*buflen], '\0', sizeof(uint64_t) + sizeof(uint8_t));
buflen += sizeof(uint64_t) + sizeof(uint8_t);
buflen += (sizeof(uint64_t) + sizeof(uint8_t));
sendto(sock, *buf, *buflen, 0, (sockaddr*)&addr, sizeof(addr));
*buflen = BUFFER_LENGTH;
}