28.03.2016, 08:58
I have this wierd problem - as always.
Ofcourse I've searched around for this error, but I can't seem to find the solution anywhere. The "wierd" part is, my script works 9/10 times. All queries are sent and received perfectly, with some exceptions. For example, sometimes on player login, the character is not loaded and hence players spawn as CJ.
The mysql_log I have looks like this:
This is what I don't understand... If the connection handle is invalid, how comes the script works almost everytime? The error comes everytime on server restart.
My guess: I do use includes for most of my script. I don't put my commands, functions, stocks etc. in the actual gamemode, but in includes, to keep track of it all.
Does the MySQL plugin initialize/verify every query/format on server start, even when they're not called? The reason why I believe this is that I call mysql_connect on OnGameModeInit and if so, the includes does not have a valid connection handle hence initialized on the top of my script. I tried putting the includes under OnGameModeInit, but it didn't give any result.
Pastebin to full login code: http://pastebin.com/Vv30SVCU
Any ideas on how to fix this?
EDIT: Running ubuntu machine on digitalocean. MySQL is localhost. Should you need any other part of the script, please ask.
Ofcourse I've searched around for this error, but I can't seem to find the solution anywhere. The "wierd" part is, my script works 9/10 times. All queries are sent and received perfectly, with some exceptions. For example, sometimes on player login, the character is not loaded and hence players spawn as CJ.
The mysql_log I have looks like this:
pawn Код:
[03:53:29] [WARNING] CMySQLConnection::Disconnect - no connection available
[03:53:29] [ERROR] mysql_format - invalid connection handle (id: 1)
[03:53:29] [ERROR] mysql_pquery - invalid connection handle (id: 1)
[03:53:29] [ERROR] mysql_format - invalid connection handle (id: 1)
[03:53:29] [ERROR] mysql_pquery - invalid connection handle (id: 1)
[03:53:29] [ERROR] mysql_format - invalid connection handle (id: 1)
[03:53:29] [ERROR] mysql_pquery - invalid connection handle (id: 1)
[03:53:29] [ERROR] mysql_format - invalid connection handle (id: 1)
[03:53:29] [ERROR] mysql_pquery - invalid connection handle (id: 1)
[03:53:29] [ERROR] mysql_format - invalid connection handle (id: 1)
[03:53:29] [ERROR] mysql_pquery - invalid connection handle (id: 1)
[03:53:29] [ERROR] mysql_format - invalid connection handle (id: 1)
[03:53:29] [ERROR] mysql_pquery - invalid connection handle (id: 1)
[03:53:29] [ERROR] mysql_format - invalid connection handle (id: 1)
[03:53:29] [ERROR] mysql_pquery - invalid connection handle (id: 1)
[03:53:29] [ERROR] mysql_format - invalid connection handle (id: 1)
[03:53:29] [ERROR] mysql_pquery - invalid connection handle (id: 1)
[03:53:29] [ERROR] mysql_format - invalid connection handle (id: 1)
[03:53:29] [ERROR] mysql_pquery - invalid connection handle (id: 1)
-----It goes on like this for 2002 lines.-----
My guess: I do use includes for most of my script. I don't put my commands, functions, stocks etc. in the actual gamemode, but in includes, to keep track of it all.
Does the MySQL plugin initialize/verify every query/format on server start, even when they're not called? The reason why I believe this is that I call mysql_connect on OnGameModeInit and if so, the includes does not have a valid connection handle hence initialized on the top of my script. I tried putting the includes under OnGameModeInit, but it didn't give any result.
Pastebin to full login code: http://pastebin.com/Vv30SVCU
Any ideas on how to fix this?
EDIT: Running ubuntu machine on digitalocean. MySQL is localhost. Should you need any other part of the script, please ask.