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!

[Release ]Checking if character is online or not

Status
Not open for further replies.
@work
Joined
Jan 26, 2008
Messages
617
Reaction score
39
I was having vacation so, was passing through some posts here...

I found there are many people interested in checking if the player is online and online player count...

I have found and already discussed also that [date].mir files are having the log our character logged in and out . . . So using this details i've programmed a login log manager that logs if the player is online or not....

You can find it here : http://forum.ragezone.com/f98/login-log-manager-656635/
-----
Problem : If a character is online and it used web service it will cause problems

Problem with the given tool : The tool is using db connection and consume more memory , It updates the table every 5 seconds so it will cause more lag issue

But here i have attached a PHP script that will not require any sql info to be added because it will not keep log of player online but this script will check if the player is online or not at runtime...

For Example :
If your character is online and you want to take Rebirth online --> it will not allow you and it will give a message that you have to log out.

If your character is offline then it will work just fine, and it will allow you to take Rebirth.

/////// LOGIC ///////

What i have studied in *.mir file is :

When your character is completely logged in game the log entry :
"[WORLD_LOGIN:E]"

When your character is completely logged out of game the log entry :
"SAFEDELETE2 :"

So, we can find the last entry of the character in the file and check if the entry is "SAFEDELETE2 :" there or not....

If it is there --> Character is logged out --> He/She can use Web service
If it is NOT there --> Character is NOT logged out --> He/She can NOT use Web service . . . .

--> In case the character logged out "yesterday" and is not logged in "today" then the log will not have any entry thats why it will display error that the character is online , So I've handled it by displaying a notice below the error you will find it in script.
 

Attachments

You must be registered for see attachments list
Last edited:
@work
Joined
Jan 26, 2008
Messages
617
Reaction score
39
Re: Checking if character is online or not

If you find any bug or have any suggestion then post here it will help us to get better and efficient functioning
 
Joined
Jan 14, 2007
Messages
509
Reaction score
85
Re: Checking if character is online or not

I think the same kind of script can be made to show the list of online players. But it will be complicated as the file changes after 12:00 am ..
Btw this one is better as i was going to use the tool u posted earlier.. and yes it consumes some ram so will switch to the php one!
 
@work
Joined
Jan 26, 2008
Messages
617
Reaction score
39
Re: Checking if character is online or not

To show players online, we need to insert the data into an db server, what I think is . . . If we make another table than using charac0 to keep the log of online players, it will cause less lag. I'll work on it and will share it here
 
Status
Not open for further replies.
Back
Top