07.08.2011, 12:41
My server goes crazy if it can't connect to the db.. It have to print one time "** Server couldn't connect to the database, try again.. **" that, and one time this ** Server couldn't connect to the database, server shutdown.**,
(see the log below)
(see the log below)
Код:
stock MySQLConnect()
{
mysql_debug(1);
mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);
if(mysql_ping() == -1) return CheckMySQL();
return 1;
}
stock CheckMySQL()
{
if(mysql_ping() == -1)
{
print("** Server couldn't connect to the database, try again.. **");
mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);
if(mysql_ping() == -1)
{
print("** Server couldn't connect to the database, server shutdown.**");
return SendRconCommand("exit");
}
}
return 1;
}
Код:
[14:26:25] ** Server couldn't connect to the database, try again.. ** [14:26:26] ** Server couldn't connect to the database, server shutdown.** [14:26:26] ** Server couldn't connect to the database, try again.. ** [14:26:27] ** Server couldn't connect to the database, server shutdown.** [14:26:27] ** Server couldn't connect to the database, try again.. ** [14:26:28] ** Server couldn't connect to the database, server shutdown.** [14:26:28] ** Server couldn't connect to the database, try again.. ** [14:26:29] ** Server couldn't connect to the database, server shutdown.** [14:26:30] ** Server couldn't connect to the database, try again.. ** [14:26:31] ** Server couldn't connect to the database, server shutdown.** [14:26:31] ** Server couldn't connect to the database, try again.. ** [14:26:32] ** Server couldn't connect to the database, server shutdown.** [14:26:32] ** Server couldn't connect to the database, try again.. ** [14:26:33] ** Server couldn't connect to the database, server shutdown.** [14:26:33] ** Server couldn't connect to the database, try again.. ** [14:26:34] ** Server couldn't connect to the database, server shutdown.** [14:26:34] ** Server couldn't connect to the database, try again.. ** [14:26:35] ** Server couldn't connect to the database, server shutdown.** [14:26:35] ** Server couldn't connect to the database, try again.. ** [14:26:36] ** Server couldn't connect to the database, server shutdown.** [14:26:36] ** Server couldn't connect to the database, try again.. ** [14:26:37] ** Server couldn't connect to the database, server shutdown.** [14:26:37] ** Server couldn't connect to the database, try again.. ** [14:26:38] ** Server couldn't connect to the database, server shutdown.** [14:26:38] [14:26:38] _______________________________________ [14:26:38][*] Server started[*] [14:26:38] _______________________________________ [14:26:38] [14:26:38] Number of vehicle models: 13 [14:26:38] --- Server Shutting Down.

