Anti MultiAccount [MySQL] -
GospodinX - 18.07.2018
Hi guys
I'm creating Anti MultiAccount in MySQL.I have big problems with MultiAccounts on my server so I need strong security.
Now I'm make that every connection on my server log in mysql.With information about ip and time login.
Every time when player connect on my server I use this.
Код:
format(eQuery, sizeof(eQuery), "INSERT INTO MULTI(IP, Name,Country,date) VALUES ('%s', '%s' , '%s' ,UNIX_TIMESTAMP())", ip, GetName(playerid),country);
mysql_tquery(g_SQL, eQuery);
Now I don't know how that Admins can see possible multiaccounts so I need:
1) How to get all player IP from MULTI table but without repetition same IP's
2) How to get all connected players but without repetition
For example:
Quote:
A player is login with IP adress 127.0.0.1
B player is also login with 127.0.0.1 IP adress
|
So A and B player are conncted!They are possible multiaccounts,how to get them(But without repetition of course)
Admins will check this on
Admin Panel,not in sa-mp server,so i need just help about mysql query!
Re: Anti MultiAccount [MySQL] -
Calisthenics - 18.07.2018
1)
pawn Код:
SELECT DISTINCT IP FROM MULTI WHERE Name='GospodinX'
2)
pawn Код:
SELECT DISTINCT Name FROM MULTI WHERE IP='127.0.0.1' ORDER BY Name
DISTINCT is like GROUP BY. No duplicates.
Re: Anti MultiAccount [MySQL] -
GospodinX - 18.07.2018
Hi!
Thank you very much,that is what i needed!
Last question about it:
Is possible to "connect" it two query(1 and 2) in one:
To get all IP adress from GospodinX and to get all connected names with all ip.
I hope you can understand me.
If GospodinX have three IP adress,i want to see all connected players from all ip adress in one query.
Gospodin
X 127.0.0.1
Gospodin
X 127.0.0.2
Gospodin
Y 127.0.0.1
Gospodin
Z 127.0.0.2
They are all connected,so i want to get it names...
Thank you again,this was very helpful for me!
Re: Anti MultiAccount [MySQL] -
Calisthenics - 18.07.2018
Combining them in one query will return incorrect results as it will group by the first column.
Show a dialog list with all IPs of a certain player. Clicking on any IP will execute the second query that will show another dialog with all players under that IP.