SendData BinaryString too long? [Solved, caused by script length]

Every time I start a server and add a player I get this on the server

11:26:55.083 - SendData: BitStream string write: BinaryString too long: 512339

And this on the client

11:26:55.268 - Disconnect from 127.0.0.1|53640
11:26:55.296 - httpGet &disconnect=true failed. Trying again. Error: &disconnect=true: Trust check failed, The operation completed successfully.
. Elapsed time: 0.00100032

The client just hangs with that text, with a completely white screen. I tried updating the place and restarting studio, and my internet connection is not the problem.

The issue started in the middle of my editing my code. I published to roblox and then tested and it happened. This is place specific too - this is only happening on the game I am currently editing.

Did I hit some sort of place or script data limit?

Edit: Figured out it was caused by the length of a script. Not sure if the limit is based on how long one script is or multiple, but I’m assuming it was script length as it reached 20k lines long. Lol.

BinaryString values are usually involved with Terrain & CSG. Do you have a massive amount of Terrain, or do you have a Union with a ton of data?

I have only a few unions, and no terrain.

I actually just figured it out just minutes later. I really did hit some sort of script data limit. Removing a bit of useless code fixed the problem, and adding it back caused it again.

I think the limit is 20k lines of code.

Guess I should really start using more module scripts :neutral_face:

(Thanks for the help though. Should have done more testing before I posted on here.)

What do you need with a script having 20,000 lines o.o

When I started working on this game I didn’t know about module scripts…

My main script runs almost everything in the game for every player. It adds up over time, and I have a lot of stuff I can remove due to remaking things. I just gotta work on my optimization.

A client gets disconnected if you sent/receive 2e5 characters to/from the server.
That’s the main reason you can’t set .Name or .Value to anything above 200k characters.
The studio’s script editor doesn’t care, though, hence you can add more than that.
(A plugin still has the limit, though, just a fact that might be useful someday?)

I thought localscripts were sent as bytecode, which might reduce the amount of characters.
(Not even sure there’s the 2e5 problem for bytecode… eh we’ll never know without testing)
Maybe it’s because in Studio’s Start Player, the actual code is sent over that you crash.

Also: 20k lines? Isn’t that a tiny bit too much?

1 Like

Oh, that’s interesting. I never knew that. And uh… yeah. I have a lot of cleaning up to do :confused:

1 Like

Thank you for submitting this report. We are currently reviewing all bug reports to ensure we have not overlooked any ongoing issues. Since this issue was reported over two years ago, can you please confirm you are still experiencing the problem? If so, please respond to this thread, and we will investigate. If we do not receive any response within 30 days, we will consider this matter resolved. Thank you.

I have not experienced this problem since, but considering how niche it is I’m not surprised.

With this game I was incredibly inefficient with my code, stuffing 20k+ lines into a single local script.