How to know how many player online

10/20/2015 02:22 dido025#1
I am sorry for asking too many questions but i want to know how many player online on my server :)
10/20/2015 02:39 Spirited#2
You need to specify more when you ask questions. You're running a TQ binary server and you need to specify that; else, someone's going to give you some C# code which isn't going to help you in the slightest. A server and its code aren't general things, they're extremely specific.
10/20/2015 02:58 dido025#3
i want to put a bar on my website that contains the number of the players online in the server
10/20/2015 04:08 Spirited#4
Moronic affluence is ruining this community. Every time I ask you for specification, you give me jack all. Again, specify. What type of website is it? PHP, just HTML? What type of server is this for? The same TQ Binary server you were asking about previously? Speak in more than one sentence at a time, damn it.
10/20/2015 15:07 turk55#5
@Spirited
You should just stop replying to threads you know are doomed from the beginning, saves you a lot of headache and might stop them from asking stupid questions in a stupid way.
10/20/2015 15:38 Mr_PoP#6
you can use this PHP code to check how many connections are on the game port , it will work with all type of games and servers , since it just checks the port connections , not a game related matter

PHP Code:
<?php echo (exec('netstat -a -n |find "5816" |find "ESTABLISHED" /c')-2); ?>
10/20/2015 17:32 dido025#7
Quote:
Originally Posted by Spirited View Post
Moronic affluence is ruining this community. Every time I ask you for specification, you give me jack all. Again, specify. What type of website is it? PHP, just HTML? What type of server is this for? The same TQ Binary server you were asking about previously? Speak in more than one sentence at a time, damn it.
for the same server and my website is php :handsdown:
10/21/2015 21:32 pintinho12#8
Quote:
Originally Posted by dido025 View Post
for the same server and my website is php :handsdown:
Mr_Pop gave you an reply that will overload your server probably if your site get many requests, but it's already something you can use (if you have good logic, it still might be useful). Good luck.
10/21/2015 22:08 Spirited#9
Why is there a minus two in that php function?
"How many connections are established to my server netstat?"
Zero.
"Let's subtract two from that."
10/23/2015 10:11 Mr_PoP#10
Quote:
Originally Posted by Spirited View Post
Why is there a minus two in that php function?
"How many connections are established to my server netstat?"
Zero.
"Let's subtract two from that."
I'm not sure why you are being sarcastic! If you don't understand the point of "-2" use your brain for like 5 secs you will figure it out , but let me give you a hint , when your server "listen on" that port for up coming connections , doesn't that considered as a connection? oh well yeah it does, so next time Google, before you act sarcastic maybe?!

PS: figure the second connection yourself, I already explained one :)
10/23/2015 10:18 Spirited#11
Quote:
Originally Posted by Mr_PoP View Post
I'm not sure why you are being sarcastic! If you don't understand the point of "-2" use your brain for like 5 secs you will figure it out , but let me give you a hint , when your server "listen on" that port for up coming connections , doesn't that considered as a connection? oh well yeah it does, so next time Google, before you act sarcastic maybe?!

PS: figure the second connection yourself, I already explained one :)
You don't even know what your sodding command does. No, it doesn't return two for the account and game servers unless someone's connected because you're finding based on the "ESTABLISHED" string. A listening server doesn't have an additional "ESTABLISHED" status until someone connects to it; it has the "LISTENING" status only. God, no wonder a few trash servers had -2 as the player counts. It was because they were using your broken script.

Edit: What you should be doing is finding against the local endpoint. That way, you wouldn't be trying to do something stupid like subtracting 2 from the connection count - it would just be the number of remote connections. "Google, before you act sarcastic maybe?!"
10/23/2015 10:28 Mr_PoP#12
Quote:
Originally Posted by Spirited View Post
You don't even know what your sodding command does. No, it doesn't return two for the account and game servers unless someone's connected because you're finding based on the "ESTABLISHED" string. A listening server doesn't have an additional "ESTABLISHED" status until someone connects to it; it has the "LISTENING" status only. God, no wonder a few trash servers had -2 as the player counts. It was because they were using your broken script.

Edit: What you should be doing is finding against the local endpoint. That way, you wouldn't be trying to do something stupid like subtracting 2 from the connection count - it would just be the number of remote connections.
I was clear about it works when you listen on the ports, and yes I agree it was an old script , it's not efficient , but it gives him a starting point?! ,I'm not going to spoonfeed him! my point of argument with you is that you were being sarcastic instead of discussing what is the wrong with the script to help him!
10/23/2015 10:40 Spirited#13
Quote:
Originally Posted by Mr_PoP View Post
I was clear about it works when you listen on the ports, and yes I agree it was an old script , it's not efficient , but it gives him a starting point?! ,I'm not going to spoonfeed him! my point of argument with you is that you were being sarcastic instead of discussing what is the wrong with the script to help him!
It handles the lower bounding edge case for no connections incorrectly. It is, therefore, incorrect. If you actually read what I wrote, I wouldn't have to repeat this. Edit: Regardless, this isn't my problem to fix and I have class and work in the morning. Cheers.
10/23/2015 15:26 KraHen#14
netstat. Heh. I'm still not sure if it is retarded or genius.