Jump to content
  • 0

Record Online Players Code


Question

Posted

Hey guys i would like to ask if anyone has a code so we can record MOST PLAYERS online ever on server.. i am using acis latest version and i want to put it on a info window when ur char logs but i dont have the code.. can anyone help me"?

3 answers to this question

Recommended Posts

  • 0
Posted

If the code isn't private/protected/whatever, you could post it here or create a Shares topic and point the link on that topic. It would eventually help others people who also search that feature.

 

Ask to the code owner first, or ask the code owner to make it himself if he agrees.

  • 0
Posted (edited)

int maxOnlinePrev;

@Override

public void run()

{

      Connection con = L2DatabaseFactory.getInstance().getConnection();

      PreparedStatement statement = con.prepareStatement("SELECT online FROM maxOnlineTable");
      ResultSet rset = statement.executeQuery();
      maxOnlinePrev = rset.getInt("online");
      statement.close();
      rset.close();
      if (maxOnlinePrev < L2World.getInstance().getAllPlayers().size)
              con.createStatement().executeUpdate("UPDATE maxOnlineTable SET online ="+ L2World.getInstance().getAllPlayers().size);
      con.close()

}

 

handwritten, there are possible mistakes, but this is the basic structure... You could work with your RAM too to avoid db connections in tasks but that demands edits on GS.java and shutdown.java so I avoided it

Edited by xdem
Guest
This topic is now closed to further replies.


×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..