Offline players appear as online in the char DB
For some reason players continue to appear online (characters table, field online == 1) even after logging off and closing the game client. It does not matter whether they were logged in as a bot or not. This is causing a problem with display for many CMS sites that poll the database (or .acc on console) and show players currently logged in when they are not.
Logged out players should show 0 in the online field of characters table.
in fact this happens, I found a temporary solution directly in the database by creating an event for this...
Please share
I recommend you research on how to schedule events in MySQL with HeidiSQL. As I said, this is just an attempt to temporarily fix the problem.
Thank you very much @drozco for this and your other helpful issue reports! Details of specific issues like this are very helpful. I will investigate to fix them as soon as possible.
Please share
and as for this one, did you make progress in the research I indicated?
Negative. Not really looking at this right now.
in about 1 or 2 hours I'll be home, I'll try to share with you how I did it, maybe you can understand.
@drozco
ALTER DEFINER=`usermysql`@`%` EVENT `eventname`
ON SCHEDULE
EVERY 37 MINUTE STARTS '2022-10-17 18:45:03'
ON COMPLETION PRESERVE
ENABLE
COMMENT ''
DO BEGIN
UPDATE characters SET online = 0;
END
In addition to the above, you need to activate the mysql event system, in case if this is not configured definitively at every reboot of the host you will need to activate the event system. On linux the command is this:
SET GLOBAL event_scheduler = ON;
In the case of the event above, I set it to run every 37 minutes.
Ok I see what you're doing. Thanks for that!