how i can show the number of players online on the web?
Printable View
how i can show the number of players online on the web?
I cant remember the layout of the database but you could probably whip up a sql query that gets all the users online.
does anyone know how?
I just looked and the online users are held in real time on the server and not in the db
I guess you could either add in another column to the player table and change it to 1 when theyre online OR set up some kind of server socket for php
is hard to show users on the web :S
lol online users arent held in the server.
Pokemonium - Pokemon online MMORPG - Free to play MMO
(^ our is logged in page)
How did you do?
a hint
Code:select * from tablename where row != 'null'
Oh thanks.
Pretty sure it's not stored in the db. All that's in there that's login related is lastLoginTime, lastLoginIP and lastLoginServer
http://gyazo.com/ace0c30e828e4eb4d64f04db9b693a13.png
Your right he's probably ling best to ignore him
lol its works...
;)Code:select * from tablename where row != 'null'
Code:SELECT * FROM pn_members WHERE lastLoginServer not in ('null')
that wont work correctly, since if somebodys client crashes and it doesnt do the logout process, it wont update the db and it wont show them as logged out.
Your close though :]
i havent really looked at how the server handles connections but surely when someone drops there would be an ondisconnect function that gets called, shouldnt something like that be handled in there?