Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Players Online

Newbie Spellweaver
Joined
Apr 17, 2012
Messages
13
Reaction score
0
how i can show the number of players online on the web?
 
Newbie Spellweaver
Joined
May 11, 2009
Messages
95
Reaction score
8
I cant remember the layout of the database but you could probably whip up a sql query that gets all the users online.
 
Newbie Spellweaver
Joined
May 11, 2009
Messages
95
Reaction score
8
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
 
Newbie Spellweaver
Joined
May 11, 2009
Messages
95
Reaction score
8
Pretty sure it's not stored in the db. All that's in there that's login related is lastLoginTime, lastLoginIP and lastLoginServer
Robotrono - Players Online - RaGEZONE Forums
 
Newbie Spellweaver
Joined
Apr 17, 2012
Messages
13
Reaction score
0
lol its works...


Code:
select * from tablename where row != 'null'

;)

Code:
SELECT * FROM pn_members WHERE lastLoginServer not in ('null')
 
Joined
Aug 16, 2006
Messages
1,251
Reaction score
200
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 :]
 
Banned
Banned
Joined
Aug 4, 2011
Messages
852
Reaction score
331
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 :]

Give the me the database structures and i'll work it out.
 
Newbie Spellweaver
Joined
May 11, 2009
Messages
95
Reaction score
8
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?
 
Joined
Aug 16, 2006
Messages
1,251
Reaction score
200
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.
 
Newbie Spellweaver
Joined
May 11, 2009
Messages
95
Reaction score
8
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
 
Back
Top