Open galaxym4n opened 2 years ago
The missing entities are outside of the client's PVS, this is a Source Engine optimization technique that doesn't network some entities to the clients if they can't possibly be seen. The missing entities weren't networked and were never created on the client side, hence player.GetAll
doesn't return them.
The missing entities are outside of the client's PVS, this is a Source Engine optimization technique that doesn't network some entities to the clients if they can't possibly be seen. The missing entities weren't networked and were never created on the client side, hence
player.GetAll
doesn't return them.
Yeah,optimisation or not the problem with this is that it messes with things like scoreboards so it needs fixing...
The missing entities are outside of the client's PVS, this is a Source Engine optimization technique that doesn't network some entities to the clients if they can't possibly be seen. The missing entities weren't networked and were never created on the client side, hence
player.GetAll
doesn't return them.
Players always exist no matter what, their network vars might not sync as fast but they will exist.
I wonder if player.GetCount()
shows the correct amount, then you could probably bypass it via Entity()
and the like for the scoreboard iteration part
It's probably also worth looking at team.GetPlayers()
to see if it works around the PVS optimization.
There's also a userinfo
network stringtable that could be used for a primitive lookup, if access to those were exposed in lua
That actually could be pathway to make the function reliable on the client, in fact that's what the default HL2MP Scoreboard makes use of.
You are all speculating without seeing OP's code or any reproducible code or setup presented.
Client:
print("how many in table?") print(#player.GetAll()) print("--------------") for k, v in pairs( player.GetAll() ) do print(k) print("-----------") print(v) end
Server:
print("how many in table?") print(#player.GetAll())
that’s literally all i’m running
Players aren't necessarily available the moment you join the server (for up to 10 seconds you'll only be told about players in your pvs/area) and create the element, if you're doing that on startup. It looks that way to me anyway. Otherwise I'd try changing the map to a different one and see if the issue persists because it's not something I've ever seen before. You'll want to look at how other scoreboards like TTT do it, where they check/add and remove rows
I've always used player.GetAll() to make scoreboards and such and never had this issue before though, has GarrysMod changed something with PVS or anything similar recently which has caused this?
no
Then it doesn't explain what has happened to base/sandbox/darkrp gamemodes that has caused this issue to occur all of a sudden, and i highly doubt darkrp has caused it
garrysmod has not been updated in a while, there is no magical "update that broke it" my gamemode is based from sandbox and does not suffer from this issue
Details
Tell us exactly what happens here, every single detail that you can think of. Please include information such as which Beta Branch your game is on, the console log (opened in-game by pressing SHIFT+ESC) and the version of the game you are running, which can be retrieved via the
version
console command. Please try running a different(dev)/none beta branch and verifying your game cache integrity before reporting an issue.If you are going to post crash dumps (.mdmp or .dmp files), please either send them to robotboy655@facepunchstudios.com or create a permanent link.
Steps to reproduce
Tell us how to reproduce the problem here, step by step. If it is a modding API issue, please include minimal code to reproduce the issue on demand.
player.GetAll() is not "synced" correctly between server and client ( Like for example it says 11 on server and 4 on client, the server is always correct but client is always lower )
CLIENT: https://cdn.discordapp.com/attachments/567617926991970306/1015778173268541491/unknown.png SERVER: https://cdn.discordapp.com/attachments/567617926991970306/1015778214376919110/unknown.png
Was told to report this after talking to a few other developers as they dont see why it was happening.