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.
Account block ip
Forum rules
READ NOW: L2j Forums Rules of Conduct
READ NOW: L2j Forums Rules of Conduct
-
- Posts: 186
- Joined: Wed Jun 24, 2009 10:01 am
Re: Account block ip
example
logincontroller.java:
but this code wrong
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();
- momo61
- Posts: 1648
- Joined: Fri Jun 06, 2008 2:05 pm
- Location: Europe
Re: Account block ip
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 =)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.
cool idea ^^