***********************
PHP FIX - WORKING BETA
***********************
PHP Code:
/*
GUNGAME PHP SQL v2.0(for gungame 2.13 beta) By Bonkaz aKa 2inspyr
Massive credit to KRIM for the original version and parts of his code which i used.
Gungame PHP SQL is free software;
you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation.
*/
you need 2 have the tables setup in your database for this to work, this is only a bridge between the gungame.stats file and your database. Edit the config file to suit your settings, upload to a webserver, IMPORTANT: make sure that whatever folder these file are in is CHMOD 777, if you upload it in its current structure to your public_html it will work as is, but the public will have access to execute the php file. It needs to be setup somewhere public dont have access to and run with CRON to make it secure.
ADDED PSYCHOSTATS MODULE BETA 1.0 26/5/10
for this to work correctly, you will need to have a current installation of psychostats (tested on 3.2 nightly). your gungame tables should be in the same database as your psychostats, this module will use the config from psychostats to connect to the database. upload the files in thier current structure, this will work with the "default" and "default-blue" themes currently.
it will also add a new link "gungame" to the link bar at the top so you can access the ranks.
preview can be seen here on my psychostats
http://www.gigabitgaming.com/ggstats/gungame.php CURRENTLY OFFLINE FOR UPDATING
future:
i will add the gungame rank into the users pages as well as having thier rank displayed on a main page. i might also intergrate it into the main "ranks" page.
********************
AMXX CODE FIX
********************
this code seems to be doing the job.
this is what ive modified:
PHP Code:
stock SQL_ExecuteAndLog(Handle:queryHandle,const queryStr[]="")
{
if(!SQL_Execute(queryHandle))
{
static error[256];
new errnum = SQL_QueryError(queryHandle,error,255);
if(queryStr[0])
{
log_amx("Could not execute query [%s] -- err #%i [%s]",queryStr,errnum,error);
}
else
{
SQL_GetQueryString(queryHandle,mkQuery,255);
log_amx("Could not execute query [%s] -- err #%i [%s]",mkQuery,errnum,error);
}
if(errnum == 2006)
{
new host[32], user[32], pass[32], dbname[32];
get_pcvar_string(gg_sql_host,host,31);
get_pcvar_string(gg_sql_user,user,31);
get_pcvar_string(gg_sql_pass,pass,31);
get_pcvar_string(gg_sql_db,dbname,31);
new sqlErrorCode, sqlError[1024];
tuple = SQL_MakeDbTuple(host,user,pass,dbname);
if(tuple)
{
db = SQL_Connect(tuple,sqlErrorCode,sqlError,1023);
}
if(db == Empty_Handle)
{
log_amx("Could not connect to database. Error #%i: %s",sqlErrorCode,sqlError);
return 0;
}
else
{
SQL_Execute(queryHandle)
log_amx("Error #%i : Reconnected : Resent query [%s]",errnum,queryStr);
return 1;
}
}
else
{
return 0;
}
}
return 1;
}
Original:
PHP Code:
stock SQL_ExecuteAndLog(Handle:queryHandle,const queryStr[]="")
{
if(!SQL_Execute(queryHandle))
{
static error[256];
new errnum = SQL_QueryError(queryHandle,error,255);
if(queryStr[0]) log_amx("Could not execute query [%s] -- err #%i [%s]",queryStr,errnum,error);
else
{
SQL_GetQueryString(queryHandle,mkQuery,255);
log_amx("Could not execute query [%s] -- err #%i [%s]",mkQuery,errnum,error);
}
return 0;
}
return 1;
}
basically it allows the plugin to reconnect to the database if it throws the "mysql database has gone away" error and resend the command it failed on, and send the rest through as your now reconnected.
download compiled or uncompiled version below.
cheers
2inspyr