@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.
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: