Jump to content

Question

Posted

i want to add a config that allow me to set how many acc can a player create on one ip!  i hope to understund what i mean.. is like the "characters per acc''  anyone can help me?

1 answer to this question

Recommended Posts

  • 0
Posted

if (Config.AUTO_CREATE_ACCOUNTS)

{

+ if (Config.YOUR_CONFIG)

+ {

+ java.sql.Connection connection = null;

+ try

+ {

+ PreparedStatement pstatement;

+ ResultSet rs;

+ connection = L2DatabaseFactory.getInstance().getConnection();

+ pstatement = connection.prepareStatement("SELECT * FROM accounts WHERE access_level=0");

+ rs = pstatement.executeQuery();

+            

+ while (rs.next())

+ {

+ if (rs.getString("lastIp") == null)

+ continue;

+ }

+ pstatement.close();

+ }catch (Exception e)

+ {

+ System.out.println("Error: " +e);

+ }finally {try { con.close(); } catch (Exception e) {}}

+ }

 

Maybe it works :) I'm too lazy to open eclipse :D

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...