TeamUlysses / ulib

ULib: A Lua library for more rapid development on Garry's Mod servers
http://ulyssesmod.net
Other
105 stars 55 forks source link

Flooding server with bots disconnects clients #33

Closed ayyjacks closed 2 years ago

ayyjacks commented 7 years ago

Steps to reproduce

  1. Completely vanilla server with only latest ULib installed
  2. lua_run for i = 1, 100 do RunConsoleCommand("bot") end
  3. See all clients disconnect

Expected behavior

Server should fill with bots without disconnecting any clients. Before I added ULib I was able to do this no problem.

Actual behavior

Clients disconnect with the reason "Client 0 overflowed reliable channel."

Error(s) in server console, if any

No actual errors

Error(s) in player's console, if any

Just the kick message

Version

ULib v2.63 Did not have ULX installed when I reproduced this.

Codingale commented 7 years ago

The error is because you're sending too much data at once. The net library can't take so much data at once like that.. thus the disconnect. Try a lower number, not sure if bot will replace old bots with new ones causing another connect message etc.

cannon commented 7 years ago

Try something like this:

for i=1,100 do
timer.Simple(0.1*i, function()
RunConsoleCommand("bot")
end)
end
DBotThePony commented 7 years ago

Yes, it disconnects, because ulib sends too much data at once.

ayyjacks commented 7 years ago

I realize the crashes occur because net is being flooded, but ulib should take steps to prevent that from happening. Whether it be delaying net messages or optimizing them I'm not sure, but this behavior should be fixed.

zpetty33 commented 2 years ago

ULib was updated to use the net library instead of the old umsg library. This should address this issue.