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:
parent
5e89371ecd
commit
ee9258cefd
11 changed files with 94 additions and 239 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue