Need help with dini registration system + i give rep for help -
osman2571 - 20.11.2014
Hey guy i have big problem about registration system in my raven's gamemode.
I make email system + verification with code,but i make when script send email
to player i make script send user password

But that password is hash code,i make registration without hash code,and now
i can login with some other password on server.
I don't know what is the problem..
I'm bored about this..
Код:
public OnPlayerRegister(playerid, password[])
{
if(IsPlayerConnected(playerid))
{
new string3[64];
new string[128];
new playersip[24];
new playername3[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername3, sizeof(playername3));
GetPlayerIp(playerid, playersip, sizeof(playersip));
format(string3, sizeof(string3), "UER X2/Users/%s.ini", playername3);
dini_Create(string3);
strmid(PlayerInfo[playerid][pKey],password, 0, strlen(password), 255);
dini_Set(string3, "Password", PlayerInfo[playerid][pKey]);
Код:
public OnPlayerUpdateEx(playerid)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 1)
{
new string3[64];
new string2[64];
new playername3[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername3, sizeof(playername3));
format(string3, sizeof(string3), "UER X2/Users/%s.ini", playername3);
strmid(PlayerInfo[playerid][pKey],dini_Get(string2,"Password"),0,strlen(dini_Get(string2,"Password")),255);
Код:
public OnPlayerLogin(playerid,password[])
{
new tmp2[256]
new string2[64];
new string[128];
new playername2[MAX_PLAYER_NAME];
new playersip[24];
GetPlayerName(playerid, playername2, sizeof(playername2));
GetPlayerIp(playerid, playersip, sizeof(playersip));
format(string2, sizeof(string2), "UER X2/Users/%s.ini", playername2);
if(dini_Exists(string2))
{
if(strcmp(PlayerInfo[playerid][pKey],password, true ) == 0 )
{
strmid(PlayerInfo[playerid][pKey],dini_Get(string2,"Password"),0,strlen(dini_Get(string2,"Password")),255);
The problem is i can login with all password..
Re: Need help with dini registration system + i give rep for help -
Jefff - 20.11.2014
PlayerInfo[playerid][pKey] is empty so strcmp returns 0 (match) you need load password before dialog login
Re: Need help with dini registration system + i give rep for help -
dominik523 - 20.11.2014
I suggest you to use y_ini or MySQL/SQLite for loading/saving purposes. Dini is not too good to use.