MySQL not loading on server restart
#1

Hello,

My server is connecting to my corresponding MySQL server each time I restart my server from my host's control panel (a mass restart), however, when I restart my server via. rcon gmx, it never reloads the SQL.

It's a strange bug but I was wondering if anyone could help me with it. Here is my OnGameModeInit and OnGameModeExit parts of my code:

Код:
public OnGameModeInit()
{
    mainconnection = mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);
    sqlconnection = mysql_connect(HOUSE_HOST, HOUSE_USER, HOUSE_NAME, HOUSE_PASSWORD);

.....
Defines.. (all the SQL_Host and blah blah below are filled in, in my game mode)

Код:
//Server database
#define SQL_HOST "N/A" // The SQL host that the game mode will connect to.
#define SQL_USER "N/A"
#define SQL_PASS "N/A"
#define SQL_DB 	 "N/A"

#define HOUSE_TABLE_NAME "Houses"

//House database
#define HOUSE_HOST "N/A"
#define HOUSE_USER "N/A"
#define HOUSE_PASSWORD "N/A"
#define HOUSE_NAME "N/A"
Код:
public OnGameModeExit()
{
	for(new i=1; i < MAX_DVEHICLES; i++)
	{
		if(VehicleCreated[i])
		{
			DestroyVehicle(VehicleID[i]);
			if(VehicleCreated[i] == VEHICLE_DEALERSHIP)
			{
				Delete3DTextLabel(VehicleLabel[i]);
			}
		}
	}
	for(new i=1; i < MAX_DEALERSHIPS; i++)
	{
		if(DealershipCreated[i])
		{
			Delete3DTextLabel(DealershipLabel[i]);
		}
	}
	TextDrawHideForAll(Textdraw0);
	TextDrawDestroy(Textdraw0);
	TextDrawHideForAll(Textdraw1);
	TextDrawDestroy(Textdraw1);
	FadeExit();
	Delete3DTextLabel(Text3D:armysupplies);
    return 1;
}
Cheers
Reply
#2

Try closing the connection in OnGameModeExit, this MUST be done to prevent an exception/mem leak. IIRC.
Reply
#3

I've tried that with

mysql_close(sqlconnection);
mysql_close(mainconnection);

Still nothing.
Any other tips?
Reply
#4

Still not working.. does anyone else have any other ideas? This is sort of important :P
Reply
#5

do you have mySQL_init(); under OnGameModeInit() ??
Reply
#6

MySQL Init just returns an error, don't think that fits in with my plugin...
Reply
#7

sorry, I assumed bluegills r7 as you didnt mention which plugin you were using.
Reply
#8

No, no. My fault entirely. I am using Strikenkid's I believe.. however, I have tried BlueG's as well, same traffic.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)