Grant that all SQL Transactions finish until Restart Server
#1

hello,

How i can grant that all sql transactions finish until i execute rcon command gmx?

Im using MySQL Plugin R7 that using threads..

I have any form that know thread ids of unfinished transactions to wait for threads end with any function like pthread_join (like in c++)?

My command is:

Код:
CMD:ggmx(playerid, params[])
{
   	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
	new string[128];
	format(string, sizeof(string), "AdmCmd: %s has issued an instant server restart.", RPN(playerid));
	SendClientMessageToAll(COLOR_LIGHTRED, string);
	
	foreach(Player, i)
	{
		if(IsPlayerLoggedIn(i))
		{
		    SaveChar(i);
		}
	}
	SaveFactions();
	SaveFamilies();
	SavePoints();
	SaveBiz();
	SaveHouses();
	SaveDoors();
	SaveGates();
	SaveMapIcons();
	SaveArrestPoint();
	SaveDrugs();
	SaveMOTDS();
	SendRconCommand("gmx");

			
	return 1;
}
But its logical that when server executes SendRconCommand("gmx") exists threads of sql querys that not finish and server restart, cancel threads and information aren't saved..


I have any way to resolve this?

Regards
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)