1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-22 17:18:39 +00:00

Clean up some packet-related code

This commit is contained in:
sfan5 2025-02-22 16:37:45 +01:00
parent 5e89371ecd
commit ee9258cefd
11 changed files with 94 additions and 239 deletions

View file

@ -273,7 +273,7 @@ void TestConnection::testConnectSendReceive()
UASSERT(server.ReceiveTimeoutMs(&recvpacket, timeout_ms));
infostream << "** Server received: peer_id=" << pkt.getPeerId()
<< ", size=" << pkt.getSize()
<< ", data=" << (const char*)pkt.getU8Ptr(0)
<< ", data=" << pkt.getString(0)
<< std::endl;
auto recvdata = pkt.oldForgePacket();
@ -298,7 +298,7 @@ void TestConnection::testConnectSendReceive()
infostream << " ";
char buf[10];
porting::mt_snprintf(buf, sizeof(buf), "%.2X",
((int)((const char *)pkt.getU8Ptr(0))[i]) & 0xff);
((int)(pkt.getString(0))[i]) & 0xff);
infostream<<buf;
}
if (datasize > 20)