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?
when you log out or close the client the server ends your session and in doing so updates the database that you have infact logged out, however considering how buggy this source is if you encounter a fatal error (and there are quite a few) it never ends your session or updates the database, so your char in turn is rolled back to before your last session, which in turn makes the sql query he has inefficient, it would work to a point, however it will ultimately end up giving you inaccurate readings as the day progresses.
such a shame it's buggy as all hell. Might be an idea to start a new project and rebuild it from scratch, although that would take a while
Its in the works
Pokemonium 2.0 Preview - YouTube