Account block ip

This is not a Support area! Discuss about the Server here. Non-Server related discussion goes in Off-Topic Discussion.
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
streamsss
Posts: 186
Joined: Wed Jun 24, 2009 10:01 am

Account block ip

Post by streamsss »

It is possible to realise the account block on IP?
To add new column Allow_IP, to bring pair of changes in a login, etc.
Very useful thing for protection gm an account.
sorry for my bad english.
streamsss
Posts: 186
Joined: Wed Jun 24, 2009 10:01 am

Re: Account block ip

Post by streamsss »

example
logincontroller.java:

Code: Select all

con = L2DatabaseFactory.getInstance().getConnection();			PreparedStatement statement = con.prepareStatement("SELECT password, accessLevel, lastServer, AllowIPs FROM accounts WHERE login=?");			statement.setString(1, user);			ResultSet rset = statement.executeQuery();			if (rset.next())			{			        NetList allowedList;        client.account_fields = new StatsSet(rset, account_field_columns);        allowedIps = rset.getString("AllowIPs");        if ((allowedIps != null) && (!(allowedIps.isEmpty())) && (!(allowedIps.equals("*"))))        {          allowedList = new NetList();          allowedList.LoadFromString(allowedIps, ",");          if (!(allowedList.isIpInNets(client.getIpAddress()))) {            Status localStatus1 = new Status().setState(State.IP_ACCESS_DENIED);             return localStatus1;				expected = Base64.decode(rset.getString("password"));				access = rset.getInt("accessLevel");				lastServer = rset.getInt("lastServer");				if (lastServer <= 0)					lastServer = 1; // minServerId is 1 in Interlude				if (Config.DEBUG)					_log.fine("account exists");			}			rset.close();			statement.close();
but this code wrong
User avatar
momo61
Posts: 1648
Joined: Fri Jun 06, 2008 2:05 pm
Location: Europe

Re: Account block ip

Post by momo61 »

streamsss wrote:It is possible to realise the account block on IP?
To add new column Allow_IP, to bring pair of changes in a login, etc.
Very useful thing for protection gm an account.
sorry for my bad english.
true. If you have like a norwegian server, and you have a norwegian head GM with high access, it would be more secure to allow only IPs from norway to enter that account =)

cool idea ^^
Post Reply