Author Topic: Getting a server's player count cliently?  (Read 2314 times)

/title. I've been doing alot of search for a client command. I already know the server sided method, but
what i need is a client sided command. Im thinking of a method, but i want a simple way of grabbing the
server's player count cliently without having to use multiple lines of code.

Look for a variable or function inside the player list.

NPL_List.rowCount();
I think

Thanks, didn't think to call a function from the player list GUI.

There is also the built in $ServerSO[%index] object array that holds that kind of information about every server, which is the preferred way to do it since that data is downloaded from the master server

although I'm thinking that might only be updated when you refresh server list

There is also the built in $ServerSO[%index] object array that holds that kind of information about every server, which is the preferred way to do it since that data is downloaded from the master server

although I'm thinking that might only be updated when you refresh server list
why would this be preferred? you can get the data from the server itself? if anything the master server might be wrong. since the server tells the master server, why not cut out the middleman and get it from the horses mouth?

since the server tells the master server, why not cut out the middleman and get it from the horses mouth?

Here's another reason. The server can be told to lie to the Master Server, but because the Player List functions are protected, you can't not tell a client who's actually joined your server who's on your server.

Cant you just do secureCommandToClient to give him false infos

Idk

Cant you just do secureCommandToClient to give him false infos

Idk
No, it's protected to stop people spoofing players.

why would this be preferred? you can get the data from the server itself? if anything the master server might be wrong. since the server tells the master server, why not cut out the middleman and get it from the horses mouth?

Because the data you are getting is directly representative of the data you want.  Reading the number of lines on a gui object is indirectly getting the data you want, whereas the playercount attached to the serverSO is direct and intentional.  It is still less accurate and reliable, I probably am just using preferred in poor context.  I couldn't think of a better way to describe intentional data versus something as roundabout as using guis.

Getting data from the master server isn't the best idea, because it might not have refreshed whilst the user started playing.

Don't have Blockland installed, but I think $ServerInfo::PlayerCount works (try `export("$ServerInfo::*", "blah.cs");`.

Don't have Blockland installed
What?!
No, it's protected to stop people spoofing players.
Ah ok

Also can you finally update the stupid server search on rtb with that uber simple fix. People are still complaining about using the broken version.

Also can you finally update the stupid server search on rtb with that uber simple fix. People are still complaining about using the broken version.
dude the fix was released.

dude the fix was released.
Wht
Rtb sucks why it no inform me

Why not just uh... get that player count thats right in the top of the f2 window?

Because the data you are getting is directly representative of the data you want.  Reading the number of lines on a gui object is indirectly getting the data you want, whereas the playercount attached to the serverSO is direct and intentional.  It is still less accurate and reliable, I probably am just using preferred in poor context.  I couldn't think of a better way to describe intentional data versus something as roundabout as using guis.
We're looking for accuracy. There's nothing wrong with getting info from something that gives the data you're looking for.