-
-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sending data with more than 1250 bytes #23
Comments
Riptide isn't designed for sending huge amounts of data, maybe try sending the save over http instead. It will be faster, more secure, and in theory can be any size. |
Sorry, I normally make singleplayergames. how would I do that? |
You could modify the source code to increase the limit. The reason messages are limited to that size is because Riptide is built for speed, and larger messages are more likely to take longer to send. In order for message instances to be reusable, they need a pre-allocated byte array which requires setting some kind of maximum size, and 1250 is less than MTU but bigger than most games will ever need a message to be.
What kind of stuff are clients storing that the server doesn't know about?
Sending the raw data and making the server create the JSON file locally will be more efficient than creating the JSON file on the client and sending that whole thing over. |
Yes I realized this. I fixed the problem by making a generic class, that can split a bytearray into several bytearrays with an index, and then put them together in the right order. It works fine, and I can send big chunks of data with many small messages.
this is my first ever multiplayer game, and it will only be playable with friends cooperatively. So I don't need to keep track of for example player-abilities, loadouts or just inventorys on the server. Instead I just send it as a savefile when needed.
I figued as much. that's why I didn't want to do this. |
7f67328 adds the ability to modify the max payload size for messages and will be part of v1.3.0, so you could use that to avoid having to split data. However, the aforementioned considerations still apply, so it may still not be something that you actually want to do. |
I am creating a player-hosted multiplayer survival game, so there is a lot of stuff that isn't stored on the server, but on the clients. because of this when the game gets saved I need to send a relatively big JSON savefile from every client to the server. Currently I need to break it down into several messages, because a message can't have more than 1250 bytes. However this is obviously not ideal, and as the savefile gets bigger because there is more data that needs to be saved It will get more and more complicated. So I wanted to ask: is there a possibility to send bigger chunks of data with riptide? and if this isn't possible: is there a reason for it not to be possible?
The text was updated successfully, but these errors were encountered: