Automatic Login
#1

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
Reply
#2

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
Reply
#3

ok so you think how to fix it to me it works
Reply
#4

IP + SAMP Serial, I think can works.
Reply
#5

I can not fix it
Reply
#6

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.
Reply
#7

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 ...
Reply
#8

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.
Reply
#9

OK.

So how to fix this cod:
PHP код:
if(strmatch(IP,DOF2_GetString(AC,"IP"))) 
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)