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

Assign peer IDs randomly

This commit is contained in:
sfan5 2024-01-05 00:43:47 +01:00
parent db88d24ff8
commit 2587302987
3 changed files with 11 additions and 22 deletions

View file

@ -245,7 +245,7 @@ void TestConnection::testConnectSendReceive()
UASSERT(hand_client.last_id == 1);
// Server should have the client
UASSERT(hand_server.count == 1);
UASSERT(hand_server.last_id == 2);
UASSERT(hand_server.last_id >= 2);
//sleep_ms(50);
@ -300,7 +300,7 @@ void TestConnection::testConnectSendReceive()
UASSERT(memcmp(*sentdata, *recvdata, recvdata.getSize()) == 0);
}
session_t peer_id_client = 2;
const session_t peer_id_client = hand_server.last_id;
/*
Send a large packet
*/
@ -374,5 +374,5 @@ void TestConnection::testConnectSendReceive()
UASSERT(hand_client.count == 1);
UASSERT(hand_client.last_id == 1);
UASSERT(hand_server.count == 1);
UASSERT(hand_server.last_id == 2);
UASSERT(hand_server.last_id >= 2);
}