Package lineage2.commons.text

Examples of lineage2.commons.text.StrTable


   * Method getStats.
   * @return StrTable
   */
  public static StrTable getStats()
  {
    StrTable table = new StrTable("PathFind Buffers Stats");
    lock.lock();
    try
    {
      long totalUses = 0, totalPlayable = 0, totalTime = 0;
      int index = 0;
      int count;
      long uses;
      long playable;
      long itrs;
      long success;
      long overtime;
      long time;
      for (int size : sizes)
      {
        index++;
        count = 0;
        uses = 0;
        playable = 0;
        itrs = 0;
        success = 0;
        overtime = 0;
        time = 0;
        for (PathFindBuffer buff : buffers.get(size))
        {
          count++;
          uses += buff.totalUses;
          playable += buff.playableUses;
          success += buff.successUses;
          overtime += buff.overtimeUses;
          time += buff.totalTime / 1000000;
          itrs += buff.totalItr;
        }
        totalUses += uses;
        totalPlayable += playable;
        totalTime += time;
        table.set(index, "Size", size);
        table.set(index, "Count", count);
        table.set(index, "Uses (success%)", uses + "(" + String.format("%2.2f", (uses > 0) ? (success * 100.) / uses : 0) + "%)");
        table.set(index, "Uses, playble", playable + "(" + String.format("%2.2f", (uses > 0) ? (playable * 100.) / uses : 0) + "%)");
        table.set(index, "Uses, overtime", overtime + "(" + String.format("%2.2f", (uses > 0) ? (overtime * 100.) / uses : 0) + "%)");
        table.set(index, "Iter., avg", (uses > 0) ? itrs / uses : 0);
        table.set(index, "Time, avg (ms)", String.format("%1.3f", (uses > 0) ? (double) time / uses : 0.));
      }
      table.addTitle("Uses, total / playable  : " + totalUses + " / " + totalPlayable);
      table.addTitle("Uses, total time / avg (ms) : " + totalTime + " / " + String.format("%1.3f", totalUses > 0 ? (double) totalTime / totalUses : 0));
    }
    finally
    {
      lock.unlock();
    }
View Full Code Here


   * Method getStats.
   * @return StrTable
   */
  public static StrTable getStats()
  {
    StrTable table = new StrTable("L2 Objects Storage Stats");
    GameObjectArray<?> storage;
    for (int i = 0; i < storages.length; i++)
    {
      if ((storage = storages[i]) == null)
      {
        continue;
      }
      synchronized (storage)
      {
        table.set(i, "Name", storage.name);
        table.set(i, "Size / Real", storage.size() + " / " + storage.getRealSize());
        table.set(i, "Capacity / init", storage.capacity() + " / " + storage.initCapacity);
      }
    }
    return table;
  }
View Full Code Here

  public void onEvtDead(Creature killer)
  {
    final NpcInstance actor = getActor();
    super.onEvtDead(killer);
    actor.deleteMe();
    ThreadPoolManager.getInstance().schedule(new RunnableImpl()
    {
      @Override
      public void runImpl()
      {
        final NpcTemplate template = NpcHolder.getInstance().getTemplate(18602);
View Full Code Here

          getZone("[soi_hos_attack_attackup_5]").setActive(false);
          spawnRoom(6);
        }
      }
      else if(self.getNpcId() == Yehan)
        ThreadPoolManager.getInstance().schedule(new RunnableImpl(){
          @Override
          public void runImpl() throws Exception
          {
            spawnRoom(7);
            setReenterTime(System.currentTimeMillis());
View Full Code Here

   * @param time String
   * @param shutdownMode int
   */
  public void schedule(String time, int shutdownMode)
  {
    SchedulingPattern cronTime;
    try
    {
      cronTime = new SchedulingPattern(time);
    }
    catch (InvalidPatternException e)
    {
      return;
    }
    int seconds = (int) ((cronTime.next(System.currentTimeMillis()) / 1000L) - (System.currentTimeMillis() / 1000L));
    schedule(seconds, shutdownMode);
  }
View Full Code Here

  {
    _instance = this;
    _serverStarted = time();
    _listeners = new GameServerListenerList();
    new File("./log/").mkdir();
    version = new Version(GameServer.class);
    _log.info("=================================================");
    _log.info("Revision: ................ " + version.getRevisionNumber());
    _log.info("Build date: .............. " + version.getBuildDate());
    _log.info("Compiler version: ........ " + version.getBuildJdk());
    _log.info("=================================================");
View Full Code Here

    {
      synchronized (this)
      {
        if (_ai == null)
        {
          _ai = new ClonePlayerAI(this);
        }
      }
    }
    return (ClonePlayerAI) _ai;
  }
View Full Code Here

    }
    catch (Exception e)
    {
      _log.error("Unable to create ai of doorId " + _id, e);
    }
    return new DoorAI(door);
  }
View Full Code Here

   * Constructor for UserCommandHandler.
   */
  private UserCommandHandler()
  {
    registerUserCommandHandler(new ClanWarsList());
    registerUserCommandHandler(new ClanPenalty());
    registerUserCommandHandler(new CommandChannel());
    registerUserCommandHandler(new Escape());
    registerUserCommandHandler(new Loc());
    registerUserCommandHandler(new MyBirthday());
    registerUserCommandHandler(new OlympiadStat());
View Full Code Here

  /**
   * Constructor for UserCommandHandler.
   */
  private UserCommandHandler()
  {
    registerUserCommandHandler(new ClanWarsList());
    registerUserCommandHandler(new ClanPenalty());
    registerUserCommandHandler(new CommandChannel());
    registerUserCommandHandler(new Escape());
    registerUserCommandHandler(new Loc());
    registerUserCommandHandler(new MyBirthday());
View Full Code Here

TOP

Related Classes of lineage2.commons.text.StrTable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.