max account limitation per IP

Open discussion forum. For topics that do not fit anywhere else.

Moderator: POL Developer

Post Reply
yayafan
New User
Posts: 25
Joined: Sun Mar 15, 2015 2:26 am

max account limitation per IP

Post by yayafan » Mon Nov 20, 2017 11:33 pm

Hello,
Does anyone know how to limit the maximum accounts per IP ?
In my shard some one register a lot of new accounts to get new player starting gold , I'm running POL99 server. I'm wondering whether there is a setting in some .cfg file.
Thanks!

User avatar
CWO
POL Expert
Posts: 1148
Joined: Sat Feb 04, 2006 5:49 pm
Location: Chicago, IL USA

Re: max account limitation per IP

Post by CWO » Tue Nov 21, 2017 1:15 am

There's no limitation in a configuration file but you can script it into your account creation process. You can set a last IP address to the account upon creation and login (on login in case their IP changes) and then do something like this on account creation:

Code: Select all

foreach account in ListAccounts()
	if (account.getprop("LastIP") == who.ip)
		//Don't create the account
	endif
endforeach
//Create the account
account.setprop("LastIP", who.ip)
be mindful that even with this, it's very easy to circumvent (VPNs or easily changeable dynamic IPs) and there really is no good way to ensure that each person has only one account.

yayafan
New User
Posts: 25
Joined: Sun Mar 15, 2015 2:26 am

Re: max account limitation per IP

Post by yayafan » Tue Nov 21, 2017 3:11 am

hello,

Thanks for your suggestion.

I want to create a script that can limit the numbers of same IP , such as 2 or 3. I will try to write one.

BR!

User avatar
*Edwards
Forum Regular
Posts: 301
Joined: Fri Dec 28, 2007 11:19 pm
Location: Montreal, Canada

Re: max account limitation per IP

Post by *Edwards » Tue Nov 21, 2017 12:54 pm


guialtran
Grandmaster Poster
Posts: 120
Joined: Wed Jul 30, 2008 12:42 pm

Re: max account limitation per IP

Post by guialtran » Tue Nov 21, 2017 1:37 pm

call this in your LOGON and reconnect

Code: Select all


function checkiponline( who )
	var maxipson := 2;//Catching on your CFG
	var address := who.ip;
    var ips := 0;
	foreach player in ( EnumerateOnlineCharacters() )
		if( player.ip == address )
			ips += 1;
			if( ips > maxipson )
				return 0;//to disconnect
			endif
		endif
	endforeach
	return 1;//do not disconnect
endfunction

yayafan
New User
Posts: 25
Joined: Sun Mar 15, 2015 2:26 am

Re: max account limitation per IP

Post by yayafan » Tue Nov 21, 2017 3:51 pm

Thank to everyone above!

Post Reply