SA-MP Forums

Go Back   SA-MP Forums > SA-MP Server > Server Support

Reply
 
Thread Tools Display Modes
Old 16/11/2009, 09:16 PM   #1
Timpa
Little Clucker
 
Join Date: Jan 2009
Posts: 8
Reputation: 0
Default Issue with MySQL based server

Basicly, my problem is that the server shuts down while loading the MySQL tables.

Quote:
[21:21:25] 430|200|1|0|100|0
[21:21:25] 427|500|1|10|30|0
[21:21:25] 544|1000|1|0|50|0
[21:21:25] 464|10|7|0|20|0
[21:21:25] 501|10|7|0|20|0
[21:21:25] Using existing connection!
[21:21:25] Loading Cars....
[21:21:25] SQL: SELECT carid,modelid,x,y,z,o,color1,color2,respawndelay, factionid, jobid, rentprice, buyable, lockfactionid FROM cars ORDER BY carid ASC
[21:21:25] 1|517|-2034|179|28|271|0|0|3600|0|0|0|0|0
While loading the first carID from the table something happends and the server just shuts down. There is no errors and warnings what so ever in the server log.

Quote:
Exception At Address: 0x7C928C0B



Registers:

EAX: 0x00007974 EBX: 0x00000000 ECX: 0x00000000 EDX: 0x003A0608

ESI: 0x055334F0 EDI: 0x003A0000 EBP: 0x0012FD48 ESP: 0x0012FC8C

EFLAGS: 0x00010217



Stack:

+0000: 0x01159F00 0x05533510 0x00000000 0x00000000

+0010: 0x00000028 0x0012FD00 0x609C443B 0x7FFDE000

+0020: 0x0012FCE0 0x7FFDE000 0x0012FCD4 0x0000001F

+0030: 0x003A41E0 0x0012FD20 0x00000001 0x80000000

+0040: 0x00000000 0x00000000 0x00000000 0x00007974

+0050: 0x055334F0 0x0012FCF4 0x609C4450 0x00037B68

+0060: 0x0012FD10 0x004ACAC8 0x00000000 0x017FA104

+0070: 0x00000000 0x0012FD60 0x609C28B8 0x0012FD20

+0080: 0x0012FD81 0x003A0000 0x055334F0 0x00000000

+0090: 0x003A41E0 0x00000000 0x00000000 0x0101FD60

+00A0: 0x00000006 0x0012FC8C 0x0012F8B0 0x0012FD80

+00B0: 0x7C90E920 0x7C910060 0x00000001 0x0012FD90

+00C0: 0x77C1C2DE 0x003A0000 0x00000000 0x05533510

+00D0: 0x01159F00 0x017FA104 0x00000000 0x003A41E0

+00E0: 0x055220A4 0x00000000 0x7FFFFFFF 0x0012FD5C

+00F0: 0x0012F8B0 0x0012FE5C 0x77C25C94 0x77C02070

+0100: 0xFFFFFFFF 0x0012FDD0 0x609C161B 0x05533510

+0110: 0x03D27FA0 0x00000003 0x0036EE80 0x01159F00

+0120: 0x01159F00 0xC5073000 0x43988000 0x42080000

+0130: 0x00401096 0x00000001 0x05521FA4 0x017FA104
This is taken from the crashlog about the shutdown but I doubt anyone understands it.

Anyhow, does anyone have any idea why this happend or have you might bumped into something just like it. Please post any suggestion or solution you might have since I haven't owned alot of samp servers.

Quote:
public LoadCars()
{
new resultline[1024];
new car[14][64];
new query[256];

ConnectToDatabase();

printf("Loading Cars....");
samp_mysql_real_escape_string("SELECT carid,modelid,x,y,z,o,color1,color2,respawndelay, factionid, jobid, rentprice, buyable, lockfactionid FROM cars ORDER BY carid ASC", query);
printf(" SQL: %s",query);
samp_mysql_query(query);
samp_mysql_store_result();

new carid;
//Load Cars
while(samp_mysql_fetch_row(resultline)==1)
{
printf("%s", resultline);
split(resultline, car, '|');
carid = AddStaticVehicleEx(strval(car[1]), floatstr(car[2]), floatstr(car[3]), floatstr(car[4]), floatstr(car[5]), strval(car[6]), strval(car[7]), strval(car[8]));
VehicleInfo[carid][vSQLId] = strval(car[0]);
VehicleInfo[carid][vModel] = strval(car[1]);
VehicleInfo[carid][vPos_x] = floatstr(car[2]);
VehicleInfo[carid][vPos_y] = floatstr(car[3]);
VehicleInfo[carid][vPos_z] = floatstr(car[4]);
VehicleInfo[carid][vPos_o] = floatstr(car[5]);
VehicleInfo[carid][vColor1] = strval(car[6]);
VehicleInfo[carid][vColor2] = strval(car[7]);
VehicleInfo[carid][vRespawnDelay] = strval(car[8]);
VehicleInfo[carid][vFactionId] = strval(car[9]);
VehicleInfo[carid][vJobId] = strval(car[10]);
VehicleInfo[carid][vRentPrice] = strval(car[11]);
VehicleInfo[carid][vBuyable] = strval(car[12]);
VehicleInfo[carid][vLockFactionId] = strval(car[13]);
new vcmodelid = VehicleInfo[carid][vModel]-MIN_VEHICLEMODELID;
VehicleInfo[carid][vFuel] = VehicleCostInfo[vcmodelid][vcMaxFuel];
VehicleInfo[carid][vOwnerId] = INVALID_PLAYER_ID;
VehicleInfo[carid][vRenting] = INVALID_PLAYER_ID;
if (VehicleInfo[carid][vLockFactionId] > 0)
{
VehicleInfo[carid][vLocked] = 1;
LockFCar(carid);
}
}
//for(new carz = 1; carz <= carid; carz++) LoadVehicleMods(carz);
return 1;
}
Edit: Added the pwn code for the process.
Timpa is offline   Reply With Quote
Old 16/11/2009, 09:24 PM   #2
Sergei
High-roller
 
Sergei's Avatar
 
Join Date: Mar 2008
Location: Slovenia
Posts: 2,733
Reputation: 139
Default Re: Issue with MySQL based server

It can happen because of bugged native. Ask in plugin's topic.
Sergei is offline   Reply With Quote
Old 18/11/2009, 08:05 PM   #3
VIRUXE
Big Clucker
 
Join Date: Dec 2006
Location: Portugal
Posts: 152
Reputation: 0
Default Re: Issue with MySQL based server

Switch to the alternative MySQL plugin(g-stylezzz). Atleast that one has a logging feature.
VIRUXE is offline   Reply With Quote
Old 18/11/2009, 09:14 PM   #4
Timpa
Little Clucker
 
Join Date: Jan 2009
Posts: 8
Reputation: 0
Default Re: Issue with MySQL based server

This server is only supporting the MySQL plugin made by Adrenaline. It would be really hard to replace everything especially when the server has 29 tables and atleast 8k lines natives in the gamemod. Sure that would actually fix it and isn't there another option?

If you have any experience with such things and think you might be able to sovle this mystery of mine with additional information, please PM me.
Timpa is offline   Reply With Quote
Old 19/11/2009, 08:27 AM   #5
UberSocks
Huge Clucker
 
UberSocks's Avatar
 
Join Date: Jul 2007
Location: Brisbane, Australia
Posts: 230
Reputation: 5
Default Re: Issue with MySQL based server

I had the exact same problem you are having. I found that this works as a temporary solution:

Quote:
Originally Posted by Blantas ;P*~
If you are using a Windows platform, this is the way to go. I used this and it works perfectly. Just that it is an earlier version of the plugin and will lack features which were implemented in the v0.15 release.

BTW - I also answered this question of yours in Adrenaline's topic.

Let me know if it works. Also, if you are using Linux, scroll through the pages of the topic, someone posted an earlier version of that as well.
UberSocks is offline   Reply With Quote
Old 19/11/2009, 05:14 PM   #6
Timpa
Little Clucker
 
Join Date: Jan 2009
Posts: 8
Reputation: 0
Default Re: Issue with MySQL based server

It actually did help, thanks alot.

But when you sovle an error another one occurs.

Its something wrong in this code:

Quote:
public LoadGroups()
{
new resultline[1024];
new permission[2][255];
new query[256];

ConnectToDatabase();

printf("Loading Permission Groups...");
format(query, sizeof(query), "SELECT id, name FROM groups");
printf(" SQL: %s",query);
samp_mysql_query(query);
samp_mysql_store_result();
new text[255];
new permissioncount;
while(samp_mysql_fetch_row(resultline)==1)
{
printf("%s", resultline);
split(resultline, permission, '|');
gGroups[permissioncount][gSQLId] = strval(permission[0]);
text = unreal_escape_string(permission[1]);
strmid(gGroups[permissioncount][gName],text, 0, strlen(text), 256);
// LoadGroupPermissions(gGroups[permissioncount][gSQLId]);
permissioncount++;
}
samp_mysql_free_result();
for(new i=0;i<100;i++)
{
if(gGroups[i][gSQLId])
{
LoadGroupPermissions(gGroups[i][gSQLId]);
}
}
return 1;
}
It should be right but maybe there is something wrong, anyone with an eye for details?
Timpa is offline   Reply With Quote
Old 20/11/2009, 07:41 AM   #7
UberSocks
Huge Clucker
 
UberSocks's Avatar
 
Join Date: Jul 2007
Location: Brisbane, Australia
Posts: 230
Reputation: 5
Default Re: Issue with MySQL based server

Unless you've changed the code in some sort of way (not saying you have), it should work fine.

What I did is clean the entire database before using the game mode. That means emptying the 'groups' and 'group_permissions' tables, and possibly some others. Other than that I can't really help you here. It may cause a real inconvenience for you, but this is the method I followed and it's working just fine for me. If you do decide to use the above, I would recommend dumping the SQL file, or creating a backup before you do so.

What exactly does your server console output when it crashes exactly? By knowledge I'm guessing it loads a few lines then crashes, much like the other error, but I did not receive this when attempting the same thing myself.
UberSocks is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[GameMode] CityWide Roleplay: fully MySQL based roleplay server Alex_Raven Gamemode Scripts 823 01/09/2012 03:16 AM
Question On Home Based Server gtapolicemods Server Support 2 21/12/2009 04:34 PM
MySQL account issue jamesb93 Help Archive 8 06/12/2009 10:06 AM
Slow MySQL load, or script issue? Devine Help Archive 13 16/11/2009 10:09 PM
[MySQL] Loading data from a row - issue woot Help Archive 2 22/09/2009 04:50 PM


All times are GMT. The time now is 02:18 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.