14.06.2011, 16:08
(
Последний раз редактировалось Blowfish; 15.06.2011 в 17:43.
)
Hello,
I just switched from StrickenKid's to G-sTyLeZzZ's mysql plugin. After changing all
the function calls I was able to compile all my filterscripts and my gamemode successfully.
But when trying to start the Server it simply crashes with a segmentation fault.
I was able to figure out that the segmentation fault somehow occurs at the following
"code structure". This worked perfectly well with StrickenKid's plugin.
Mysql log:
Thanks in advance,
Blowfish
I just switched from StrickenKid's to G-sTyLeZzZ's mysql plugin. After changing all
the function calls I was able to compile all my filterscripts and my gamemode successfully.
But when trying to start the Server it simply crashes with a segmentation fault.
I was able to figure out that the segmentation fault somehow occurs at the following
"code structure". This worked perfectly well with StrickenKid's plugin.
Код:
public OnFilterScriptInit(){
new tmp[16];
mysql = mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);
QueryString = "SELECT * FROM `cars` WHERE `cardlship` > 0";
mysql_query(QueryString, -1, 0, mysql);
mysql_store_result(mysql);
while(mysql_retrieve_row(mysql)) {
mysql_fetch_field_row(tmp, "id", mysql);
CarVars[Iterator][id] = strval(tmp);
mysql_fetch_field_row(tmp, "type", mysql);
CarVars[Iterator][type] = strval(tmp);
AHCars[Iterator][type] = strval(tmp);
mysql_fetch_field_row(tmp, "direction", mysql);
CarVars[Iterator][angle] = floatstr(tmp);
mysql_fetch_field_row(tmp, "posx", mysql);
CarVars[Iterator][posx] = floatstr(tmp);
mysql_fetch_field_row(tmp, "posy", mysql);
CarVars[Iterator][posy] = floatstr(tmp);
mysql_fetch_field_row(tmp, "posz", mysql);
CarVars[Iterator][posz] = floatstr(tmp);
mysql_fetch_field_row(tmp, "color1", mysql);
CarVars[Iterator][color1] = strval(tmp);
mysql_fetch_field_row(tmp, "color2", mysql);
CarVars[Iterator][color2] = strval(tmp);
mysql_fetch_field_row(tmp, "cardlship", mysql);
CarVars[Iterator][cardlship] = strval(tmp);
mysql_fetch_field_row(tmp, "price", mysql);
AHCars[Iterator][price] = strval(tmp);
if(!CarVars[Iterator][color1]) CarVars[Iterator][color1] = random(15);
if(!CarVars[Iterator][color2]) CarVars[Iterator][color2] = random(15);
AHCars[Iterator][carid] = CreateVehicle(
CarVars[Iterator][type],
CarVars[Iterator][posx],
CarVars[Iterator][posy],
CarVars[Iterator][posz],
CarVars[Iterator][angle],
CarVars[Iterator][color1],
CarVars[Iterator][color2],
300
);
GMtoDBCarID[Iterator][gmid] = AHCars[Iterator][carid];
GMtoDBCarID[Iterator][dbid] = CarVars[Iterator][id];
if (!FirstId) {
FirstId = AHCars[Iterator][carid];
}
Iterator++;
}
mysql_free_result(mysql);
return 1;
}
Код:
[19:27:39] ---------------------------
[19:27:39] MySQL Debugging activated (06/14/11)
[19:27:39] ---------------------------
[19:27:39]
[19:27:39] >> mysql_query( Connection handle: 1 )
[19:27:39] CMySQLHandler::Query(SELECT * FROM `cars` WHERE `cardlship` > 0) - Successfully executed.
[19:27:39] >> mysql_store_result( Connection handle: 1 )
[19:27:39] CMySQLHandler::StoreResult() - Result was stored.
[19:27:39] >> mysql_retrieve_row( Connection handle: 1 )
[19:27:39] >> mysql_fetch_field_row( Connection handle: 1 )
[19:27:39] CMySQLHandler::FetchField("id") - 3
[19:27:39] >> mysql_fetch_field_row( Connection handle: 1 )
Blowfish

