14.06.2015, 12:20
Quote:
Yes i am aware of that, but my question here is, how can i get to know when the connection is down and then when it is back up.
I need this so i could lock down the server when the connection is out so that people who should be blocked, not to join. |
Код:
public OnGameModeInit() { g_MySQL = mysql_connect(...); SetTimer("MySqlConnectionCheck", 5000, true); return 1; } forward MySqlConnectionCheck(); public MySqlConnectionCheck() { mysql_query(g_MySQL, "SELECT 1", false); if(mysql_errno() != 0) { //error, probably related to network connection } return 1; }