Conversation
* Optionally compiled additional TCP transport layer. * Config to enable it. * Tested and functional with lcdr's tcpudp dll, udp being disabled in the dll due to port issues. * Removed unused RakNet replica manager and id manager. We've got our own replica manager since pre-open-source. * Utilizes async boost behavior. Todo: * Figure out how to do ping calculations. * Fix crashes on universe shutdown. * Test TLS on a VPS. * Remove unnecessary logging. * Test with lots of clients. * Finish "master" to "manager" naming refactor.
EmosewaMC
left a comment
There was a problem hiding this comment.
cool stuff, some comments about bounds checking but overall looks cool
| } | ||
|
|
||
| void TcpPeer::DeallocatePacket(Packet* packet) { | ||
| delete[] packet->data; |
There was a problem hiding this comment.
consider checking that packet->data is not a nullptr and also that the packet passed into here is a valid pointer as well
| } | ||
|
|
||
| void TcpTransportLayer::DeallocatePacket(Packet* packet) { | ||
| delete[] packet->data; |
There was a problem hiding this comment.
consider checking that packet->data is not a nullptr and also that the packet passed into here is a valid pointer as well
| @@ -0,0 +1,272 @@ | |||
| #define _VARIADIC_MAX 10 | |||
There was a problem hiding this comment.
Is there a particular reason for this define?
| for (const auto& c : m_Password) { | ||
| bitStream.Write<uint8_t>(c); | ||
| } |
There was a problem hiding this comment.
Consider WriteBytes here
| bitStream.Write<uint8_t>(packet->data[1]); | ||
| bitStream.Write<uint8_t>(packet->data[2]); | ||
| bitStream.Write<uint8_t>(packet->data[3]); | ||
| bitStream.Write<uint8_t>(packet->data[4]); |
There was a problem hiding this comment.
This could access undefined heap memory if data is < 5 in size, i would consider bounds checks here on a packet
| std::size_t operator()(const SystemAddress& sysAddr) const { | ||
| const std::size_t hash1 = sysAddr.binaryAddress; | ||
| const std::size_t hash2 = sysAddr.port; | ||
| return (hash1 | (hash2 << 32)); | ||
| } |
There was a problem hiding this comment.
on platforms where size_t is 32 bits, this will result in just being hash1 always. a 32 bit shift on a 4 byte value also is not a valid operation which is worth considering for a different hash value
TCP Transport Layer
Scope
This PR seeks to add an alternative TCP transport protocol. It works under the specifications of lcdr's tcpudp shim dll. The protocol initially specified the use of UDP for unreliable packets, but this is disabled in the dll due to port issues. This feature PR will assume this disabled state is permanent; UDP for unreliable packets will not be enabled.
Current status
Refactor structure
Todo