DoctorSnakes Posted March 1 Report Posted March 1 I'm making a mod which might involve sending pretty big packets, and I came across a problem where a client disconnects if they send too big of a packet. In the logs, it said something like: [Server Notification] Client {IP address here} disconnected, too large packet of {packet size here} bytes received I only found one mention of this problem on the internet, here: https://github.com/mja00/VS-LiveMap-Revival/issues/30. The author of that mod documents in their fix that this packet size limit is apparently 64 kilobytes. So, my first question is if this is correct? Is the packet size limit 64 kilobytes? I couldn't find where this log might get made in any decompilation of the Vintage Story DLLs, so I couldn't verify. It would be nice to have this properly documented somewhere. Secondly, knowing the packet size limit, what would be the best way of sending big packets while respecting this limit? The author of that mod actually fixes this issue pretty well, by compressing the big packet and then dividing it into a bunch of chunks which get sent separately. However, if I'm not mistaken interpreting the decompiled DLLs, the methods to send packets in both IServerNetworkChannel and IClientNetworkChannel seem to already compress the packets before sending them. In that LiveMap mod's case, I guess there is compression unnecessarily applied twice: once by the mod, and then by the game itself. It's probably not a big deal for performance, but it would still be preferable to have a separate method for dealing with this oneself ... and maybe that already exists with the "SendArbitraryPacket" method? I haven't looked into it that much yet, and I have no idea how to effectively use that method to communicate between the server and client. If anyone has even a basic idea of how one can send and receive packets between the client and server using those methods with "Arbitrary" in their name, please do tell about it!
Recommended Posts