Automatic Login -
EmpireSk - 23.08.2014
Hi all,
I make automatic login on the server.
PHP код:
public OnPlayerConnect(playerid)
{
if(fexist(AC))
{
ShowPlayerDialog(playerid,DIALOG_REGISTER,3,"{FFFFFF}Ъčet - Registrace","{FFFFFF}Vнtej na serveru {0000FF}XY.\nPro hranн je {FF0000}vyћadovбna {FFFFFF}registrace.\nProsнme {FF0000}zaregistrujte{FFFFFF} se.\n\n","Dбle","Odejнt");
}else{
new IP[16];
GetPlayerIp(playerid,IP,16);
if(strmatch(IP,DOF2_GetString(AC,"IP")))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
}else{
ShowPlayerDialog(playerid,DIALOG_LOGIN,3,"{FFFFFF}Ъčet - Přihlбљenн","{FFFFFF}Vнtej zpět.\nBohuћel se tvб nynějљн IP {FF0000}neshoduje{FFFFFF} s registračnн.\nProsнm ověř svoji totoћnost heslem.\n\n","Dбle","Odejнt");
}
}
SetTimerEx("Autosave",1000*60*15,true,"i",playerid);
return 1;
}
I want data from DOF2_GetString and I want to put there INI so I pawno not responding
Re: Automatic Login -
EmpireSk - 23.08.2014
Quote:
Originally Posted by ******
IPs are not a unique identifier, using them like this will let random people log in to other people's accounts.
|
When I come to the server to register and to save also save my IP and when I get on the server so me auto login but If I have a dynamic IP, and I have a different IP than I registered so I throw the dialogue log in with a password
Re: Automatic Login -
EmpireSk - 23.08.2014
ok so you think how to fix it to me it works
Respuesta: Automatic Login -
adri1 - 23.08.2014
IP + SAMP Serial, I think can works.
Re: Automatic Login -
EmpireSk - 23.08.2014
I can not fix it
Re: Automatic Login -
MissionCoder - 23.08.2014
Quote:
Originally Posted by EmpireSk
I can not fix it
|
As ****** has explained earlier - the dynamic IP means that a certain region, from time to time changes the IP. Imagine it like a house with 10 people - they have times when they are busy, so they buy 7 computers which is enough for them as they switch.
What happens if a different person comes to the computer that you just used and you don't have password? They can see all of your files.
Re: Automatic Login -
EmpireSk - 23.08.2014
Quote:
Originally Posted by MissionCoder
As ****** has explained earlier - the dynamic IP means that a certain region, from time to time changes the IP. Imagine it like a house with 10 people - they have times when they are busy, so they buy 7 computers which is enough for them as they switch.
What happens if a different person comes to the computer that you just used and you don't have password? They can see all of your files.
|
How is it possible that a friend made through DOF2 and respect him as I am writing this ...
Re: Automatic Login -
MissionCoder - 23.08.2014
I am sorry, but I was unable to understand your last post
Usually the problem with Pawno not responding is that you are missing a bracket or something similiar - so that the compiler cannot detect a problem, but it attempts to compile the code repeating it over and over again - starting an endless loop.
Re: Automatic Login -
EmpireSk - 23.08.2014
OK.
So how to fix this cod:
PHP код:
if(strmatch(IP,DOF2_GetString(AC,"IP")))
Re: Automatic Login -
MissionCoder - 23.08.2014
I couldn't find any strmatch in any PAWN documentation - therefore I am going to assume that it's either customly written or just does not exist.
What I would do is use strcmp as when it's correctly used - it can accomplish what you want.
Here is more information about it:
https://sampwiki.blast.hk/wiki/Strcmp