onPlayerJoining & onPlayerDropped (spam)
What happened?
Hello. I am AdminPlus one of the developers for lifestylerp & we currently are having a major mass disconnects in timeouts. We average 600 players & randomly the server will just like "freeze" & a server/sync hitch tends to happen & network thread starts spamming & the entire server starts dropping in chunks. I noticed on different threads & posts within CFX discord that other servers were having the same issue. I am not sure if this has something to do with it but onPlayerJoining & onPlayerDropped tends to spam an event for each player - so once they leave your scope it sends an triggerclientevent for onPlayerDropped & when they enter your scope it sends onPlayerJoining. During large crowds this can be very spammy & about hitting after 500+ players is where the hitch & drops happen (not all the time), & I am not sure if this has something to do with it.
--
During gameplay we do not get any hitch warnings whatsoever as we run constant profilers for optimization purposes aside.
Peds = We use stasiek_selldrugs heavily modified so each ped after each transaction is deleted & unnetworked, aside from automatic ped wipe. Objects = we don't really run much resources regarding object spawn. Vehicles = we have automatic vehicle wipes every hour or so.
Expected result
Not time out possibly
Reproduction steps
- Removed all escrowed resources & various others to almost a sandbox / normal server base.
- Searched for "onPlayerDropped" & "onPlayerJoining" & playerEnteredScope & playerLeftScope
- Ran event loggers, statebag loggers, changed some events with large bytes from normal to latent.
- Removed various resources we have found that is spamming callbacks/events to reduce load within the server.
- Switched hosts 2-3 times.
- Switched to different artifacts including latent-fix artifact.
Importancy
Unknown
Area(s)
OneSync
Specific version(s)
FiveM 3095 | Artifact 25770 | txAdmin: 8.0.1
Additional information
No response
example video: https://streamable.com/s8kr7y
This seems to be intentional OneSync behavior, probably so for compatibility with scripts not made for OneSync. Every time a player enters another player's scope or leaves that player's scope an onPlayerJoining or onPlayerDrop event respectively is fired for the player.
This corresponds with the player ped appearing on the client and allows clients to monitor players appearing/disappearing (though state bags change handlers are better for this). The event is very small, around 15B and I doubt it's causing any of your issues.
Can you upload a screenshot or video of what happens in your server console when the issues appears?
Hello itsAdminPlus
I was checking the fivem github and saw your comment on #4012 about your 600 player server dropping people in chunks after hitches Is it still giving you trouble
Im Yassine I deal with FiveM and RedM network problems like lag drops and ddos I can take a look for free and tell you whats really causing it
You can reach me on discord knoxz7
Thank you