1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-27 17:28:41 +00:00

Send initial dummy packet as empty

No functional change and no compatibility implicatons
but this better matches what is documented everywhere.
This commit is contained in:
sfan5 2024-01-05 11:13:43 +01:00
parent eeb873b23c
commit abf3142b26
2 changed files with 10 additions and 4 deletions

View file

@ -277,8 +277,8 @@ void TestConnection::testConnectSendReceive()
Simple send-receive test
*/
{
NetworkPacket pkt;
pkt.putRawPacket((u8*) "Hello World !", 14, 0);
NetworkPacket pkt(0x4b, 0);
pkt.putRawString("Hello World !", 14);
auto sentdata = pkt.oldForgePacket();
@ -306,9 +306,9 @@ void TestConnection::testConnectSendReceive()
*/
{
const int datasize = 30000;
NetworkPacket pkt(0, datasize);
NetworkPacket pkt(0xff, datasize);
for (u16 i=0; i<datasize; i++) {
pkt << (u8) i/4;
pkt << static_cast<u8>(i/4);
}
infostream << "Sending data (size=" << datasize << "):";