fix(network): revert to legacy packet format for emulator compatibility

Remove the 'reliable' boolean field from LDNPacket and ProxyPacket
structs and all associated serialization/deserialization logic.
All packets now use reliable delivery by default via ENet layer,
matching the legacy format for full backward compatibility.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
This commit is contained in:
Zephyron
2025-12-26 16:54:31 +10:00
parent 14c97aebb7
commit aad942cf25
4 changed files with 17 additions and 41 deletions

View File

@@ -341,8 +341,8 @@ void Room::RoomImpl::HandleJoinRequest(const ENetEvent* event) {
}
if (client_version != network_version) {
SendVersionMismatch(event->peer);
return;
LOG_WARNING(Network, "Version mismatch: client version {} != server version {}, but allowing connection for backwards compatibility",
client_version, network_version);
}
// At this point the client is ready to be added to the room.
@@ -832,14 +832,10 @@ void Room::RoomImpl::HandleProxyPacket(const ENetEvent* event) {
bool broadcast;
in_packet.Read(broadcast); // Broadcast
bool reliable;
in_packet.Read(reliable); // Reliability flag
Packet out_packet;
out_packet.Append(event->packet->data, event->packet->dataLength);
const u32 enet_flags = reliable ? ENET_PACKET_FLAG_RELIABLE : ENET_PACKET_FLAG_UNSEQUENCED;
ENetPacket* enet_packet = enet_packet_create(out_packet.GetData(), out_packet.GetDataSize(),
enet_flags);
ENET_PACKET_FLAG_RELIABLE);
const auto& destination_address = remote_ip;
if (broadcast) { // Send the data to everyone except the sender
@@ -890,14 +886,10 @@ void Room::RoomImpl::HandleLdnPacket(const ENetEvent* event) {
bool broadcast;
in_packet.Read(broadcast); // Broadcast
bool reliable;
in_packet.Read(reliable); // Reliability flag
Packet out_packet;
out_packet.Append(event->packet->data, event->packet->dataLength);
const u32 enet_flags = reliable ? ENET_PACKET_FLAG_RELIABLE : ENET_PACKET_FLAG_UNSEQUENCED;
ENetPacket* enet_packet = enet_packet_create(out_packet.GetData(), out_packet.GetDataSize(),
enet_flags);
ENET_PACKET_FLAG_RELIABLE);
const auto& destination_address = remote_ip;
if (broadcast) { // Send the data to everyone except the sender