28.09.2015, 21:04
Can someone fuckin' tell me why the fuck the server ask me always to register even if i have already an account?
This is OnPlayerConnect which handles the system:
Stats are saved perfectly without problems on quit, the only problem is i have to register AGAIN and AGAIN EVEN if the account ALREADY exists in database! (And it does, check screen)
http://s10.postimg.org/feg31yu5z/Immagine.jpg
Server log:
Mysql log:
This is OnPlayerConnect which handles the system:
Код:
new query[300], pname[24]; GetPlayerName(playerid, pname, 24); format(query, sizeof(query), "SELECT IP FROM `players` WHERE Username = '%s' LIMIT 1", pname); mysql_function_query(mConnectionHandle, query, false, "", ""); mysql_store_result(); new rows = mysql_num_rows(); if(!rows) { ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""White"Please register",""White"Welcome to "Red""SERVER_NAME""White"!\n"White"In order to start playing, you have to register!\n\n"White"Please insert a password below:", "Register", "Cancel"); } if(rows == 1) { mysql_fetch_field_row(IP[0],"IP"); GetPlayerIp(playerid, IP[1], 15); if(strlen(IP[0]) != 0 && !strcmp(IP[0], IP[1], true)) { MySQL_Login(playerid); } else if(!strlen(IP[0]) || strcmp(IP[0], IP[1], true)) { ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""White"Please log-in", ""White"Welcome back to "Red""SERVER_NAME""White"!\n"White"In order to start playing, you have to log-in!\n\n"White"Please insert "Red"your"White" password below:", "Login", "Cancel"); IsRegistered[playerid] = 1; } } mysql_free_result(); printf("%s", query);
http://s10.postimg.org/feg31yu5z/Immagine.jpg
Server log:
Quote:
[17:02:23] [join] okkkkk has joined the server (0:93.148.160.140) [17:02:23] IsPlayerBanned called. [17:02:23] SELECT IP FROM `players` WHERE Username = 'okkkkk' LIMIT 1 |
Quote:
[17:02:23] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `Bans` WHERE (`Username` = 'okkkkk' OR `IP` = '93.", callback: "(null)", format: "(null)" [17:02:23] [DEBUG] CMySQLQuery::CMySQLQuery() - constructor called [17:02:23] [DEBUG] mysql_tquery - scheduling query "SELECT * FROM `Bans` WHERE (`Username` = 'okkkkk' OR `IP` = 'HIDDEN IP') AND `Banned` = 1 LIMIT 1".. [17:02:23] [DEBUG] cache_get_row_count - connection: 1 [17:02:23] [WARNING] cache_get_row_count - no active cache [17:02:23] [DEBUG] mysql_tquery - connection: 1, query: "SELECT IP FROM `players` WHERE Username = 'okkkkk' LIMIT 1", callback: "(null)", format: "(null)" [17:02:23] [DEBUG] CMySQLQuery::CMySQLQuery() - constructor called [17:02:23] [DEBUG] mysql_tquery - scheduling query "SELECT IP FROM `players` WHERE Username = 'okkkkk' LIMIT 1".. [17:02:23] [DEBUG] cache_get_row_count - connection: 1 [17:02:23] [WARNING] cache_get_row_count - no active cache [17:02:23] [DEBUG] mysql_tquery - connection: 0, query: "UPDATE ServerStats SET TotalJoins = TotalJoins + 1", callback: "(null)", format: "(null)" [17:02:23] [ERROR] "mysql_tquery" - invalid connection handle (ID = 0) [17:02:23] [DEBUG] CMySQLQuery::Execute[()] - starting query execution [17:02:23] [DEBUG] CMySQLQuery::Execute[()] - query was successful [17:02:23] [DEBUG] CMySQLQuery::Execute[()] - no callback specified, skipping result saving [17:02:23] [DEBUG] CMySQLQuery::Execute[()] - data being passed to ProcessCallbacks() [17:02:23] [DEBUG] CMySQLQuery::Execute[()] - starting query execution [17:02:23] [DEBUG] CMySQLQuery::Execute[()] - query was successful [17:02:23] [DEBUG] CMySQLQuery::Execute[()] - no callback specified, skipping result saving [17:02:23] [DEBUG] CMySQLQuery::Execute[()] - data being passed to ProcessCallbacks() [17:02:23] [DEBUG] CMySQLQuery::~CMySQLQuery() - deconstructor called [17:02:23] [DEBUG] CMySQLQuery::~CMySQLQuery() - deconstructor called |