Bug 3033 - client_disconnect and get_user_authid
client_disconnect and get_user_authid
Status: RESOLVED WORKSFORME
Product: AMX Mod X
Classification: Unclassified
Component: Core
trunk
PC All
: P4 minor
Assigned To: amxmodx-bugs@alliedmods.net
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-08-19 10:46 PDT by Sun_Blood
Modified: 2013-06-15 15:27 PDT (History)
4 users (show)

See Also:


Attachments
L0819005.log (10.14 KB, text/plain)
2007-08-19 10:46 PDT, Sun_Blood
no flags Details
plugin.sma (1.09 KB, text/plain)
2007-08-19 10:46 PDT, Sun_Blood
no flags Details
L0822019.log (9.37 KB, text/plain)
2007-08-24 03:16 PDT, Sun_Blood
no flags Details
L0828.log (767 bytes, text/plain)
2007-09-09 13:53 PDT, Sun_Blood
no flags Details
L0828070.log (8.68 KB, text/plain)
2007-09-09 13:53 PDT, Sun_Blood
no flags Details
exampel.sma (2.34 KB, text/plain)
2007-09-09 13:53 PDT, Sun_Blood
no flags Details

Description Sun_Blood 2007-08-19 10:46:54 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.
Comment 1 Sun_Blood 2007-08-24 03:16:15 PDT
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>
Comment 2 David Anderson [:dvander] 2007-08-24 06:31:17 PDT
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.
Comment 3 David Anderson [:dvander] 2007-09-05 19:45:45 PDT
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.
Comment 4 Sun_Blood 2007-09-09 13:53:31 PDT
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
Comment 5 sawce 2008-04-10 12:56:29 PDT
No matter how many times I try to reproduce this, I cannot.
Comment 6 Sun_Blood 2008-04-10 13:48:31 PDT
Since new year this has only happen about 20 times now so maby it's not such a big deal.

Note You need to log in before you can comment on or make changes to this bug.