Client disconnects once replicated string reaches 1024 characters
I am currently working on a multiplayer chat system, the problem is that if a client player sends a message containing more than 1023 characters (including whitespace), it disconnects the client. The client disconnecting is apparently intended behavior (see a staff's response: https://answers.unrealengine.com/questions/259674/client-disconnecting-while-pie.html ). What I find interesting is that the cut-off is at 1024, which I doubt is a coincidence due to that number being a power of 2. My variable holding the message is a string, which is said to be 16 bytes per chararacter. 1024 characters at 16 bytes each is 16,384 bytes, which is 16 kibibytes. My thoughts are that this behavior is intended, though it does seem strange.
The process of sending a message via my chat system is simple, a client player types in a message, the message is sent to the server, and has operations performed on the string, and then the server sends the new message to each client player and displays it.
Edit: All of my variables were previously of type text, I switched them over because I thought that this would fix the issue, but the result is still the same.
I apologize for the delay, it took me some time to narrow this down to a small enough project to examine. I was able to reproduce this in your project as well as a smaller test project, so I've entered a bug report for the issue (UE-21827). I'll post here if I see any update on it.
I believe you are correct and this may be a buffer overflow problem as mentioned in the linked post, however I do not know whether that's intentional given how small a 1024 character text or string is. My recommendation for your chat system would be to limit the length of sent messages to 1023 characters for now.
Thanks for the report!
answered Oct 05 '15 at 11:48 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here