mirror of
https://git.citron-emu.org/citron/emulator
synced 2026-01-27 13:13:29 +00:00
Major networking enhancements to improve multiplayer performance and reduce desync issues in games like Mario Kart 8 Deluxe: Network Performance: - Add socket connection pooling in BSD service to reduce overhead - Implement unreliable packet delivery for latency-sensitive game data - Add packet reliability control for both ProxyPacket and LDNPacket - Use ENET_PACKET_FLAG_UNSEQUENCED for small UDP packets (<1200 bytes) Monitoring & Debugging: - Add PacketStatistics struct to track sent/received/dropped packets - Enhanced logging for proxy packet handling and socket lifecycle - Periodic stats logging every 100 packets for diagnostics Configuration: - Update lobby_api_url and web_api_url to https://api.ynet-fun.xyz - Add lobby API URL configuration support Socket Management: - Implement SocketPoolKey for efficient socket reuse - Store domain/type/protocol info in FileDescriptor - Max pool size limit (8 sockets per type) to prevent memory bloat - Return closed sockets to pool when room is still connected Protocol Updates: - Add 'reliable' field to ProxyPacket and LDNPacket structures - Update room.cpp packet handlers to respect reliability flags - Maintain backward compatibility with default reliable=true These changes significantly reduce packet latency for real-time game traffic while maintaining reliability for control packets. Signed-off-by: Zephyron <zephyron@citron-emu.org>