MySQL VXRP 2 Problem
#1

Sometimes i get this error in serverlog.txt:
Код:
errorid: 2013 | error: Lost connection to MySQL server during query | resultid: -1 | extraid: -1 | callback: NULL | query: UPDATE playeraccounts SET playerBanned = '0', playerSeconds = '1505', playerSkin = '0', playerMoney = '426010', playerBankMoney = '476620', playerInterior = '0', playerVirtualWorld = '0', playerHealth = '100.000000', playerArmour = '0.000000', playerPosX = '0.000000', playerPosY = '0.000000', playerPosZ = '0.000000', playerAccent = '', playerAdminLevel = '6', playerJob = '7', playerWeapon0 = '0', playerWeapon1 = '0', playerWeapon2 = '0', playerWeapon3 = '0', playerWeapon4 = '0', playerWeapon5 = '0', playerWeapon6 = '0', playerWeapon7 = '0', playerWeapon8 = '0', playerWeapon9 = '0', playerWeapon10 = '0', playerWeapon11 = '0', playerWeapon12 = '0', playerJobSkill1 = '0', playerJobSkill2 = '0', playerMaterials = '0', playerDrugs = '0', playerHours = '162', playerLevel = '10', pExp = '50', playerWarning1 = '(null)', playerWarning2 = '(null)', playerWarning3 = '(null)', pFactionPunish = '' ,pLWarn = '' ,pFWarn = '' ,playerHospitalized = '0', playerFirstLogin = '0', playerAdminName = '', playerPrisonTime = '0', playerPrisonID = '0', playerPhoneNumber = '2902', playerCarPaintJob = '-1', playerCarLock = '1', playerStatus = '1', playerGender = '1', playerFightStyle = '0', playerCarWeapon1 = '0', playerCarWeapon2 = '0', playerCarWeapon3 = '0', playerCarWeapon4 = '0', playerCarWeapon5 = '0', playerCarLicensePlate = 'Awesome.', playerVip = '0', playerCarModel = '462', playerCarColour1 = '76', playerCarColour2 = '64', playerCarPosX = '1606.594970', playerCarPosY = '-2240.624023', playerCarPosZ = '13.139054', playerCarPosZAngle = '1.951756', playerCarMod0 = '0', playerCarMod1 = '0', playerCarMod2 = '0', playerCarMod3 = '0', playerCarMod4 = '0', playerCarMod5 = '0', playerCarMod6 = '0', playerCarTrunk1 = '0', playerCarTrunk2 = '0', playerPhoneCredit = '897', playerWalkieTalkie = '0', playerPhoneBook='1',playerGroup='0',playerGroupRank='0',playerIP='92.84.25.88',playerDropCarTimeout='0',playerRope='0',playerAdminDuty='0',playerCrimes='2',playerArrests ='0',playerWarrants ='0',playerAge ='19',playerCarMod7 = '0',playerCarMod8 ='0',playerCarMod9 ='0',playerCarMod10='0',playerCarMod11='0',playerCarMod12='0',pCarLic='1',pFlyLic='0',pBoatLic='0',pWeaponLic='0',pHeadValue = '0',pRob='148',pPremiumAccount='1', pCarLTime = 93, pFlyLTime = 0, pBoatLTime = 0, pGunLtime = 0, playerHelperLevel = 0, playerAdminPIN = 1995 WHERE playerID = '559'
[07:26:10] [debug] Server crashed while executing
This error apears when the server save accounts. I have this script for saving accounts:

Код:
stock savePlayerData(const playerid)
{
	if(playerVariables[playerid][pStatus] >= 0 || playerVariables[playerid][pStatus] == -1) {
		new
		    saveQuery[4000];

		if(playerVariables[playerid][pStatus] == -1) playerVariables[playerid][pStatus] = 0;
		if(playerVariables[playerid][pCarModel] >= 1 && doesVehicleExist(playerVariables[playerid][pCarID]))
		{
		    //GetVehiclePos(playerVariables[playerid][pCarID], playerVariables[playerid][pCarPos][0], playerVariables[playerid][pCarPos][1], playerVariables[playerid][pCarPos][2]);
		    //GetVehicleZAngle(playerVariables[playerid][pCarID], playerVariables[playerid][pCarPos][3]);

            for(new i = 0; i < 13; i++)
			{
                playerVariables[playerid][pCarMods][i] = GetVehicleComponentInSlot(playerVariables[playerid][pCarID], i);
            }
		}

		if(playerVariables[playerid][pAdminDuty] == 0 && playerVariables[playerid][pEvent] == 0)
		{
			GetPlayerHealth(playerid, playerVariables[playerid][pHealth]);
			GetPlayerArmour(playerid, playerVariables[playerid][pArmour]);
		}

		// If they're not in an event and not spectating, current pos is saved. Otherwise, they'll be set back to the pos they last used /joinevent or /spec.
		/*if(playerVariables[playerid][pSpectating] == INVALID_PLAYER_ID && playerVariables[playerid][pEvent] == 0) {
			//GetPlayerPos(playerid, playerVariables[playerid][pPos][0], playerVariables[playerid][pPos][1], playerVariables[playerid][pPos][2]);
			playerVariables[playerid][pInterior] = GetPlayerInterior(playerid);
			playerVariables[playerid][pVirtualWorld] = GetPlayerVirtualWorld(playerid); // If someone disconnects while spectating.
		}*/
        mysql_store_result( );
        mysql_free_result();
		format(saveQuery, sizeof(saveQuery), "UPDATE playeraccounts SET playerBanned = '%d', playerSeconds = '%d', playerSkin = '%d', playerMoney = '%d', playerBankMoney = '%d'", playerVariables[playerid][pBanned], playerVariables[playerid][pSeconds], playerVariables[playerid][pSkin], playerVariables[playerid][pMoney], playerVariables[playerid][pBankMoney]);
        //mysql_query(saveQuery);
		format(saveQuery, sizeof(saveQuery), "%s, playerInterior = '%d', playerVirtualWorld = '%d', playerHealth = '%f', playerArmour = '%f', playerPosX = '%f', playerPosY = '%f', playerPosZ = '%f'", saveQuery, playerVariables[playerid][pInterior], playerVariables[playerid][pVirtualWorld], playerVariables[playerid][pHealth], playerVariables[playerid][pArmour], playerVariables[playerid][pPos][0], playerVariables[playerid][pPos][1], playerVariables[playerid][pPos][2]);
		//mysql_query(saveQuery);
		format(saveQuery, sizeof(saveQuery), "%s, playerAccent = '%s', playerAdminLevel = '%d', playerJob = '%d', playerWeapon0 = '%d', playerWeapon1 = '%d', playerWeapon2 = '%d', playerWeapon3 = '%d'", saveQuery, playerVariables[playerid][pAccent], playerVariables[playerid][pAdminLevel], playerVariables[playerid][pJob], playerVariables[playerid][pWeapons][0], playerVariables[playerid][pWeapons][1], playerVariables[playerid][pWeapons][2], playerVariables[playerid][pWeapons][3]);
        //mysql_query(saveQuery);
		format(saveQuery, sizeof(saveQuery), "%s, playerWeapon4 = '%d', playerWeapon5 = '%d', playerWeapon6 = '%d', playerWeapon7 = '%d', playerWeapon8 = '%d', playerWeapon9 = '%d', playerWeapon10 = '%d'", saveQuery, playerVariables[playerid][pWeapons][4], playerVariables[playerid][pWeapons][5], playerVariables[playerid][pWeapons][6], playerVariables[playerid][pWeapons][7], playerVariables[playerid][pWeapons][8], playerVariables[playerid][pWeapons][9], playerVariables[playerid][pWeapons][10]);
       // mysql_query(saveQuery);
		format(saveQuery, sizeof(saveQuery), "%s, playerWeapon11 = '%d', playerWeapon12 = '%d', playerJobSkill1 = '%d', playerJobSkill2 = '%d', playerMaterials = '%d', playerDrugs = '%d', playerHours = '%d', playerLevel = '%d', pExp = '%d'", saveQuery, playerVariables[playerid][pWeapons][11], playerVariables[playerid][pWeapons][12], playerVariables[playerid][pJobSkill][0], playerVariables[playerid][pJobSkill][1], playerVariables[playerid][pMaterials], playerVariables[playerid][pDrugs],
		playerVariables[playerid][pPlayingHours], playerVariables[playerid][pLevel], playerVariables[playerid][pExp]);
        //mysql_query(saveQuery);
		format(saveQuery, sizeof(saveQuery), "%s, playerWarning1 = '%s', playerWarning2 = '%s', playerWarning3 = '%s', pFactionPunish = '%s' ,pLWarn = '%s' ,pFWarn = '%s' ,playerHospitalized = '%d', playerFirstLogin = '%d', playerAdminName = '%s', playerPrisonTime = '%d', playerPrisonID = '%d', playerPhoneNumber = '%d'", saveQuery, playerVariables[playerid][pWarning1], playerVariables[playerid][pWarning2],
		playerVariables[playerid][pWarning3], playerVariables[playerid][pFactionPunish], playerVariables[playerid][pLWarn], playerVariables[playerid][pFWarn], playerVariables[playerid][pHospitalized], playerVariables[playerid][pFirstLogin], playerVariables[playerid][pAdminName],
		playerVariables[playerid][pPrisonTime], playerVariables[playerid][pPrisonID], playerVariables[playerid][pPhoneNumber]);
        //mysql_query(saveQuery);
		format(saveQuery, sizeof(saveQuery), "%s, playerCarPaintJob = '%d', playerCarLock = '%d', playerStatus = '%d', playerGender = '%d', playerFightStyle = '%d', playerCarWeapon1 = '%d', playerCarWeapon2 = '%d', playerCarWeapon3 = '%d', playerCarWeapon4 = '%d', playerCarWeapon5 = '%d', playerCarLicensePlate = '%s', playerVip = '%d'", saveQuery, playerVariables[playerid][pCarPaintjob], playerVariables[playerid][pCarLock],
		playerVariables[playerid][pStatus], playerVariables[playerid][pGender], playerVariables[playerid][pFightStyle], playerVariables[playerid][pCarWeapons][0], playerVariables[playerid][pCarWeapons][1], playerVariables[playerid][pCarWeapons][2], playerVariables[playerid][pCarWeapons][3], playerVariables[playerid][pCarWeapons][4], playerVariables[playerid][pCarLicensePlate], playerVariables[playerid][pVIP]);
        //mysql_query(saveQuery);
		format(saveQuery, sizeof(saveQuery), "%s, playerCarModel = '%d', playerCarColour1 = '%d', playerCarColour2 = '%d', playerCarPosX = '%f', playerCarPosY = '%f', playerCarPosZ = '%f', playerCarPosZAngle = '%f', playerCarMod0 = '%d', playerCarMod1 = '%d', playerCarMod2 = '%d', playerCarMod3 = '%d', playerCarMod4 = '%d', playerCarMod5 = '%d', playerCarMod6 = '%d'", saveQuery, playerVariables[playerid][pCarModel], playerVariables[playerid][pCarColour][0], playerVariables[playerid][pCarColour][1],
		playerVariables[playerid][pCarPos][0], playerVariables[playerid][pCarPos][1], playerVariables[playerid][pCarPos][2], playerVariables[playerid][pCarPos][3], playerVariables[playerid][pCarMods][0], playerVariables[playerid][pCarMods][1], playerVariables[playerid][pCarMods][2], playerVariables[playerid][pCarMods][3], playerVariables[playerid][pCarMods][4], playerVariables[playerid][pCarMods][5], playerVariables[playerid][pCarMods][6]);
        //mysql_query(saveQuery);
		format(saveQuery, sizeof(saveQuery), "%s, playerCarTrunk1 = '%d', playerCarTrunk2 = '%d', playerPhoneCredit = '%d', playerWalkieTalkie = '%d'", saveQuery, playerVariables[playerid][pCarTrunk][0], playerVariables[playerid][pCarTrunk][1], playerVariables[playerid][pPhoneCredit], playerVariables[playerid][pWalkieTalkie]);
        //mysql_query(saveQuery);
		format(saveQuery, sizeof(saveQuery), "%s, playerPhoneBook='%d',playerGroup='%d',playerGroupRank='%d',playerIP='%s',playerDropCarTimeout='%d',playerRope='%d',playerAdminDuty='%d',playerCrimes='%d',playerArrests ='%d',playerWarrants ='%d',playerAge ='%d',playerCarMod7 = '%d',playerCarMod8 ='%d',playerCarMod9 ='%d',playerCarMod10='%d',playerCarMod11='%d',playerCarMod12='%d',pCarLic='%d',pFlyLic='%d',pBoatLic='%d',pWeaponLic='%d',pHeadValue = '%d',pRob='%d',pPremiumAccount='%d'", saveQuery,
		playerVariables[playerid][pPhoneBook], playerVariables[playerid][pGroup], playerVariables[playerid][pGroupRank], playerVariables[playerid][pConnectionIP], playerVariables[playerid][pDropCarTimeout], playerVariables[playerid][pRope], playerVariables[playerid][pAdminDuty], playerVariables[playerid][pCrimes], playerVariables[playerid][pArrests], playerVariables[playerid][pWarrants], playerVariables[playerid][pAge], playerVariables[playerid][pCarMods][7],
		playerVariables[playerid][pCarMods][8], playerVariables[playerid][pCarMods][9], playerVariables[playerid][pCarMods][10], playerVariables[playerid][pCarMods][11], playerVariables[playerid][pCarMods][12], playerVariables[playerid][pCarLic], playerVariables[playerid][pFlyLic], playerVariables[playerid][pBoatLic], playerVariables[playerid][pWeaponLic], playerVariables[playerid][pHeadValue] , playerVariables[playerid][pRob], playerVariables[playerid][pPremiumAccount]);
        //mysql_query(saveQuery);
        format(saveQuery, sizeof(saveQuery), "%s, pCarLTime = %d, pFlyLTime = %d, pBoatLTime = %d, pGunLtime = %d",saveQuery, playerVariables[playerid][pCarLTime],playerVariables[playerid][pFlyLTime],playerVariables[playerid][pBoatLTime],playerVariables[playerid][pGunLtime]);

		if(playerVariables[playerid][pHelper] >= 0)
		    format(saveQuery, sizeof(saveQuery), "%s, playerHelperLevel = %d", saveQuery, playerVariables[playerid][pHelper]);

		if(playerVariables[playerid][pAdminLevel] >= 0)
		    format(saveQuery, sizeof(saveQuery), "%s, playerAdminPIN = %d", saveQuery, GetPVarInt(playerid, "pAdminPIN"));

		format(saveQuery, sizeof(saveQuery), "%s WHERE playerID = '%d'", saveQuery, playerVariables[playerid][pInternalID]);
  		mysql_query(saveQuery);
		mysql_free_result();
	}

	return 1;
}
Another problem is: The gamemode freeze sometimes, random times, and when somebody try to connect he get's kicked with reason
Код:
Kicking X because they didn't logon to the game.
.

Thanks for help.
Reply
#2

Quote:
Originally Posted by Petry
Посмотреть сообщение
Код:
[07:26:10] [debug] Server crashed while executing
The server crashed, but you didn't post the rest of the logs so we can know from where it's caused.

If you don't use the latest version of the crashdetect plugin (which is 4.12), then load the new version (it can be found: https://github.com/Zeex/samp-plugin-...ases/tag/v4.12)

And you'll also need to compile the scripts with debug info: https://github.com/Zeex/samp-plugin-...ith-debug-info

Re-compile the scripts you use, upload the new re-compiled files and run the server again. Join and let it save your account. After the crash, post the server log.
Reply
#3

Crash sometimes, not always.
Reply
#4

Quote:
Originally Posted by Petry
Посмотреть сообщение
Crash sometimes, not always.
It doesn't matter - crash is a crash and it must be fixed. The next time it will crash the server, post the results and send me a PM so I can check the thread.
Reply
#5

After this server restart's...
Reply
#6

I solv with saving account, but sometimes server freeze and when somebody try to connect in serverlog appears that: Kicking X because they didn't logon to the game.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)