mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +00:00
Network cleanup (#6310)
* Move Connection threads to dedicated files + various cleanups * ConnectionReceiveThread::processPacket now uses function pointer table to route MT packet types * Various code style fixes * Code style with clang-format * Various SharedBuffer copy removal * SharedBuffer cannot be copied anymore using Buffer * Fix many SharedBuffer copy (thanks to delete operator)
This commit is contained in:
parent
f6a33a1a7a
commit
3cea7a349a
11 changed files with 1670 additions and 1669 deletions
|
@ -115,7 +115,7 @@ void TestConnection::testHelpers()
|
|||
infostream<<"data1[0]="<<((u32)data1[0]&0xff)<<std::endl;*/
|
||||
|
||||
UASSERT(p2.getSize() == 3 + data1.getSize());
|
||||
UASSERT(readU8(&p2[0]) == TYPE_RELIABLE);
|
||||
UASSERT(readU8(&p2[0]) == con::PACKET_TYPE_RELIABLE);
|
||||
UASSERT(readU16(&p2[1]) == seqnum);
|
||||
UASSERT(readU8(&p2[3]) == data1[0]);
|
||||
}
|
||||
|
@ -290,13 +290,13 @@ void TestConnection::testConnectSendReceive()
|
|||
infostream << "...";
|
||||
infostream << std::endl;
|
||||
|
||||
Buffer<u8> sentdata = pkt.oldForgePacket();
|
||||
SharedBuffer<u8> sentdata = pkt.oldForgePacket();
|
||||
|
||||
server.Send(peer_id_client, 0, &pkt, true);
|
||||
|
||||
//sleep_ms(3000);
|
||||
|
||||
Buffer<u8> recvdata;
|
||||
SharedBuffer<u8> recvdata;
|
||||
infostream << "** running client.Receive()" << std::endl;
|
||||
u16 peer_id = 132;
|
||||
u16 size = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue