Bugzilla – Bug 3033
client_disconnect and get_user_authid
Last modified: 2013-06-15 15:27:21 PDT
This bug is hard to reproduce but it is there. It may be in the core or in the MySQL module. I have a plugin that on client_disconnect get the users steamID and sends it to a MySQL server. But on some few occasions it won't insert the steamID in the database. It will only insert blank “”. I’ am attaching an example plugin and a log file from a time when the update failed. There was no error in the amxmodx log file.
Hello agine. I am attaching an new file that maby helps discripe the problem. The first login/logout is logged correctly by amxmodx but in the second one the steamID is not logged. Mysql dump from the time <code>mysql> select * from admin_stats where server = 'hidden' and date(date_logged) = '2007-08-22'; +------+-------------------+----------------+------------------+---------------------+ | id | steamid | online_tid_sec | server | date_logged | +------+-------------------+----------------+------------------+---------------------+ | 2976 | STEAM_0:0:5872673 | 9 | hidden | 2007-08-22 09:45:48 | | 2977 | | 871 | hidden | 2007-08-22 10:01:03 | +------+-------------------+----------------+------------------+---------------------+ 2 rows in set (0.00 sec)</code>
This isn't a bug - there is no guarantee that client_disconnect() will have a valid authid because client_authorized() might never have been called. You should test if the string is empty before inserting it.
Sun_Blood requested that this be re-opened so he can give some input; I'll let it stay open a week for more comments.
Thanks for the reopening I am attaching a new sample plugin and 2 log files. Cstrike standard and the part from the AMXX log for that map. As you can see in the plugin I now have run client_authorized and I also use a true/false statement that I print out in the log files to make sure that the client have bin authorized at join and disconnect. I also have some examples from when the server is full but I provide one when the server was empty to make it easier to reed. But if you want an example from when more players are online I can provide that. This is what’s in the SQL table. <code> mysql> select id, steamid, online_tid_sec, date_logged from admin_stats where date_logged='2007-08-28 23:12:23'; +------+---------+----------------+---------------------+ | id | steamid | online_tid_sec | date_logged | +------+---------+----------------+---------------------+ | 4130 | | 1128 | 2007-08-28 23:12:23 | +------+---------+----------------+---------------------+ 1 row in set (0.00 sec)</code> I have now run this plugin almost 1 month and this error happens very rarely so it is not that big of a problem I just wanted to make you aware that it is there. Thanks for the great work whit amxx. /Sun_Blood
No matter how many times I try to reproduce this, I cannot.
Since new year this has only happen about 20 times now so maby it's not such a big deal.