12.12.2012, 19:06
Hello, i have a big problems with my registration system.
I have a public COD server with a medium player base and restarting the server for trying to fix this problem is becoming annoying and stressing.
The problem is, sometimes when a player register, the server creates BLANK account file (0 kb without variables inside, like money, pass etc.)
I tried everything, even rescripting the registration system, but nothing.
This is the registration part:
Use file path:
Registration dialog code:
Sometimes it create the player file and sometimes not.
It's a problem because when the server creates the blank account file, players cant even login!
Please help.
Thanks.
I have a public COD server with a medium player base and restarting the server for trying to fix this problem is becoming annoying and stressing.
The problem is, sometimes when a player register, the server creates BLANK account file (0 kb without variables inside, like money, pass etc.)
I tried everything, even rescripting the registration system, but nothing.
This is the registration part:
Use file path:
pawn Код:
#define PATH "/Users/%s"
pawn Код:
case DIALOG_REGISTER:
{
if(!response)
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Registering...","{FF0000}You have entered an invalid password.\n""Type your password below to register a new account.","Register","Quit");
}
if(response)
{
new Year, Month, Day, Hour, Minute, Second;
getdate(Year, Month, Day);
gettime(Hour, Minute, Second);
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
new IP[16];
GetPlayerIp(playerid,IP,16);
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Cash",1500);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Deaths",0);
INI_WriteInt(File,"NoPm",0);
INI_WriteInt(File,"Mute",0);
INI_WriteInt(File,"Vip",0);
INI_WriteInt(File,"C4",0);
INI_WriteInt(File,"Banned",0);
INI_WriteInt(File,"Cookies",0);
INI_WriteInt(File,"Warn",0);
INI_WriteInt(File, "RegisterDate_day", Day);
INI_WriteInt(File, "RegisterDate_mon", Month);
INI_WriteInt(File, "RegisterDate_year",Year);
INI_WriteInt(File, "RegisterDate_hour",Hour);
INI_WriteInt(File, "RegisterDate_min", Minute);
INI_WriteInt(File, "RegisterDate_sec", Second);
INI_WriteInt(File, "Ip", IP[playerid]);
INI_WriteInt(File, "Min", 0);
INI_WriteInt(File, "Hour", 0);
INI_WriteInt(File, "Sec", 0);
INI_WriteInt(File, "Jailed", 0);
INI_WriteInt(File, "Logged", 1);
INI_WriteInt(File, "AdminActions", 0);
INI_WriteInt(File, "Rank", 0);
INI_Close(File);
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
SetTimerEx("TimeOnServer", 1000, 1, "i", playerid);
SetPlayerCash(playerid, PlayerInfo[playerid][pCash]);
SetPlayerWantedLevel(playerid, PlayerInfo[playerid][pRank]);
SCM(playerid,-1,"{F70505}Registered and autologged! {FF0000}Now all your data are auto saved.");
TotalRegister++;
new msg[250], name[MAX_PLAYER_NAME];
new msg2[250];
new plrIP[16];
GetPlayerIp(playerid, plrIP, sizeof(plrIP));
getdate(Year, Month, Day);
gettime(Hour, Minute, Second);
GetPlayerName(playerid, name, sizeof(name));
format(msg, sizeof(msg), "4%s (%d) has registered a new account on Cod Samp - Ip: %s - %02d/%02d/%d - %02d:%02d:%02d - Total Accounts: %d", name, playerid,plrIP,Day,Month,Year,Hour,Minute,Second,TotalRegister);
IRC_GroupSay(gGroupID, IRC_ACHANNEL, msg);
format(msg2, sizeof(msg2), "%s (%d) has registered a new account on Cod Samp - Ip: %s - %02d/%02d/%d - %02d:%02d:%02d - Total Accounts: %d", name, playerid,plrIP,Day,Month,Year,Hour,Minute,Second,TotalRegister);
AccountsLog(msg2);
format(LastAccount,sizeof(LastAccount),"%s (%d) has registered a new account on Cod Samp - Ip: %s - %02d/%02d/%d - %02d:%02d:%02d - Total Accounts: %d", name, playerid,plrIP,Day,Month,Year,Hour,Minute,Second,TotalRegister);
}
It's a problem because when the server creates the blank account file, players cant even login!
Please help.
Thanks.