When a user is disconnected for Reliable network event overflow.
, the playerDropped
event on the server is spammed (for me about 900-1100 times). I am unsure if it happens with other disconnection avenues, but I have made a reproduction for this. Now, I know that if a script disconnects a user for Reliable network event overflow.
then it’s not a good script, but I figure I would bring it up because it’s unexpected behavior.
Reproduction
Reproduction is easy, just have a client trigger any server event an excess amount of times in one tick.
Resource for Reproducing
fxmanifest.lua
game 'common'
fx_version 'bodacious'
server_script 'server.lua'
client_script 'client.lua'
server.lua
local count = 0
AddEventHandler('playerDropped', function(reason)
if reason == 'Reliable network event overflow.' then
count = count + 1
print(('SRC: %s COUNT: %i REASON: %s'):format(source, count, reason))
end
end)
client.lua
RegisterCommand('drop', function()
for _ = 1, 1000 do
TriggerServerEvent('any_ev_name')
end
end)
Once the resource is installed, use the drop
command and that’s it. You’ll see a spam in console similar to this:
What I noticed
The event seems to be called every tick up until a certain point. I’m not sure when that “certain point” is because the user looks to be completely disconnected before it stops spamming. The amount of times it spams also doens’t seem to be correlated with the amount of times TriggerServerEvent
is called.
Other side-affects
As you can probably guess from the screenshot above, this causes some problems in other resources that expect GetPlayerName
or other similar natives not to be nil
. One such resource is chat
, which can be seen above.
Machine Info
This has happened on two separate FiveM server instances, here is the info for both machines:
Instance 1
- FXServer
2802
- Windows Server 2019
- CPU: AMD Ryzen 7 3800X
- RAM: 64GB DDR4 ECC @ 2666MHz
- GPU: None
- (Maybe) relavent variables:
-
onesync
=legacy
-
onesync_distanceCullVehicles
=true
-
onesync_forceMigration
=true
-
onesync_workaround763185
=true
-
sv_maxclients
=64
-
Instance 2
- FXServer
2745
- Windows 10 Pro
- CPU: Intel i7-8700k
- RAM: 32GB DDR4 @ 3000MHz
- GPU: NVIDIA GeForce 2080 SUPER
- (Maybe) relavent variables:
-
onesync_enabled
=true
-
sv_maxclients
=32
-