You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Native_Connect native doesn't work properly to checking that sourcebans plugin is connected to db if plugin successfully connected to database at start, and then database goes down.
In this case, SB_Connect still returns "true", because g_hDatabase has "valid" value.
For example, I added this code to Query_ExecuteCallback: PrintToServer("EXECUTE CALLBACK: hDatabase %d, owner %d, hndl %d, error: %s", g_hDatabase, owner, hndl, error); I start game server with sourcebans, and then - stop mysql server and join to server. I get in server console: EXECUTE CALLBACK: hDatabase 9502860, owner 12517521, hndl 0, error: Can't connect to MySQL server on '127.0.0.1' (111)
And later, each SB_Connect call returns true, with this error. This is not the expected behavior.
It will be great (for properly SB_Connect working), if you add to sourcebans plugin native, that can manually close g_hDatabase handle and set g_iDatabaseState to DatabaseState_None). Or you can add this functionality to ExecuteCallback (check hndl for zero value, but hndl equals to zero even for sql syntax errors :( )
The text was updated successfully, but these errors were encountered:
ppalex7
pushed a commit
to ppalex7/SourceBans
that referenced
this issue
Jan 25, 2014
Native_Connect native doesn't work properly to checking that sourcebans plugin is connected to db if plugin successfully connected to database at start, and then database goes down.
In this case, SB_Connect still returns "true", because g_hDatabase has "valid" value.
For example, I added this code to Query_ExecuteCallback:
PrintToServer("EXECUTE CALLBACK: hDatabase %d, owner %d, hndl %d, error: %s", g_hDatabase, owner, hndl, error);
I start game server with sourcebans, and then - stop mysql server and join to server. I get in server console:EXECUTE CALLBACK: hDatabase 9502860, owner 12517521, hndl 0, error: Can't connect to MySQL server on '127.0.0.1' (111)
And later, each SB_Connect call returns true, with this error. This is not the expected behavior.
It will be great (for properly SB_Connect working), if you add to sourcebans plugin native, that can manually close g_hDatabase handle and set g_iDatabaseState to DatabaseState_None). Or you can add this functionality to ExecuteCallback (check hndl for zero value, but hndl equals to zero even for sql syntax errors :( )
The text was updated successfully, but these errors were encountered: