08/10/2018, 11:32 PM
Buenas noches, tengo un pequeño problema y no sé a que se debe, la cosa es que estoy utilizando MySQL, y cambié el PrepareQuery a ThreadQuery debido al freezeo que se siente en el servidor, pero estoy pasando todo a ThreadQuery e igual se siente el delay cuando me estoy registrando, el tiempo de las consultas al INSERTAR DATOS o al SELECCIONAR es el siguiente:
Probé en phpmyadmin y el tiempo de la consulta es el siguiente:
Este código utilizo.
Código:
[Zombie Plague] Tiempo: 0.841009.
[Zombie Plague] Tiempo: 0.793083.
[Zombie Plague] Tiempo: 0.805566.
[Zombie Plague] Tiempo: 0.781452.
[Zombie Plague] Tiempo: 0.822002.
Probé en phpmyadmin y el tiempo de la consulta es el siguiente:
Código:
INSERT INTO MyTable (id, name) VALUES ("5", "JORGE")
1 fila insertada. (La consulta tardó 0.0029 segundos.)
Este código utilizo.
Código PHP:
static query[256], data[2], time[32];
get_time("%d/%m/%Y - %H:%M:%S", time, 31);
data[0] = id;
data[1] = SQL_DATA_INSERT_REGISTER;
formatex(query, charsmax(query), "INSERT INTO %s (name, password, date_register) VALUES (^"%s^", ^"%s^", ^"%s^")",
SQL_TABLE, g_user_name[id], g_user_password[id], time);
SQL_ThreadQuery(g_sql_htuple, "SQL_DataHandled", query, data, 2);
case SQL_DATA_INSERT_REGISTER:
{
static szquery[128], idata[2];
idata[0] = data[0];
idata[1] = SQL_DATA_REGISTER;
formatex(szquery, charsmax(szquery), "SELECT MAX(id) FROM %s", SQL_TABLE);
SQL_ThreadQuery(g_sql_htuple, "SQL_DataHandled", szquery, idata, 2);
chat_color(data[0], "%s !yTiempo: %f.", SZPREFIX, queutime);
}
case SQL_DATA_REGISTER:
{
if (SQL_NumResults(query))
{
g_user_id[data[0]] = SQL_ReadResult(query, 0);
g_user_register[data[0]] = 1;
g_rank_global = SQL_ReadResult(query, 0);
chat_color(0, "%s !yBienvenido !t%s!y, sos la cuenta registrada número !g#%d!y.", SZPREFIX, g_user_name[data[0]], g_user_id[data[0]]);
SQL_FreeHandle(query);
remove_task(data[0] + TASK_SAVE);
set_task(300.0, "save_task", data[0] + TASK_SAVE, _, _, .flags = "b");
static menu[128];
format(menu, charsmax(menu), "\y¿Mostrar el menú de habilidades?^n^n\r1. \wSí^n\r2. \wNo");
show_menu(data[0], (1<<0)|(1<<1), menu, FM_NULLENT, "Show View Habs From Register");
}