30.07.2014, 07:47
(
Последний раз редактировалось Blast3r; 30.07.2014 в 08:18.
)
Alrighty, so I've noticed this issue with MySql which sometimes occur. The thing is that it sometimes just doesn't catch player's full username, and once it doesn't it sets every online player's stats to random and bugs every password.
This is what it shows in the mysql_log.txt:
As you can see, the Username is Matt_Ri when it should be Matt_Richards. And it'll continue fetching the username like that until the server is restarted.
The code (I used newbienoob's tutorial)
OnAccountCheck:
I don't get any errors or anything, it just doesn't get full username sometimes which I don't really understand why. I hope some of you had this issues before and managed to solve it.
Cheers.
EDIT: whoops I meant to post this in scripting support, my bad.
This is what it shows in the mysql_log.txt:
Код:
[00:02:45] [DEBUG] mysql_format - connection: 1, len: 500, format: "SELECT `Password`, `ID` FROM `users` WHERE `Username` = '%e' LIMIT 1" [00:02:45] [DEBUG] mysql_tquery - connection: 1, query: "SELECT `Password`, `ID` FROM `users` WHERE `Username` = 'Matt_Ri", callback: "OnAccountCheck", format: "i"
The code (I used newbienoob's tutorial)
pawn Код:
GetPlayerIp(playerid, IP[playerid], 16);
GetPlayerName(playerid, Name[playerid], 24);
mysql_format(mysql, query, sizeof(query),"SELECT `Password`, `ID` FROM `users` WHERE `Username` = '%e' LIMIT 1", Name[playerid]);
mysql_tquery(mysql, query, "OnAccountCheck", "i", playerid);
pawn Код:
public OnAccountCheck(playerid)
{
new rows, fields;
cache_get_data(rows, fields, mysql);
if(rows)
{
cache_get_field_content(0, "Password", PlayerInfo[playerid][pPass], mysql, 129);
PlayerInfo[playerid][pID] = cache_get_field_content_int(0, "ID");
//Showing Dialog here.
}
else
{
//Showing Dialog Here.
}
return 1;
}
I don't get any errors or anything, it just doesn't get full username sometimes which I don't really understand why. I hope some of you had this issues before and managed to solve it.
Cheers.
EDIT: whoops I meant to post this in scripting support, my bad.