/*public int numTickGroups() { return ticks.size(); }*/ public String[][] threadInfo() { ArrayList<String[]> V = new ArrayList(); for (Iterator<CMLibrary> e = CMLib.libraries(); e.hasNext(); ) { CMLibrary lib = e.next(); SupportThread thread = lib.getSupportThread(); if (thread != null) { String[] S = new String[3]; S[0] = thread.getName(); S[1] = CMLib.english().returnTime(thread.milliTotal, thread.tickTotal); S[2] = thread.status; V.add(S); } } return V.toArray(new String[V.size()][]); }
public void run() { long nextStart = System.currentTimeMillis(); try { while (!dead) { long timeToSleep = nextStart - System.currentTimeMillis(); if (timeToSleep > 10) Thread.sleep(timeToSleep); nextStart += Tickable.TIME_TICK; if ((CMProps.Bools.MUDSTARTED.property()) && (!CMLib.threads().isAllSuspended())) { globalTickCount++; for (Iterator<Exit> iter = exits.iterator(); iter.hasNext(); ) { Exit exit = iter.next(); try { if (!exit.tick(globalTickCount)) exits.remove(exit); } catch (Exception e) { Log.errOut("ServiceEngine", e.toString()); } } for (Iterator<TimeClock> iter = clocks.iterator(); iter.hasNext(); ) { TimeClock clock = iter.next(); try { if (!clock.tick(globalTickCount)) clocks.remove(clock); } catch (Exception e) { Log.errOut("ServiceEngine", e.toString()); } } } } } catch (InterruptedException e) { } }
public String[] mobTimes() { long totalMOBMillis = 0; long topMOBMillis = 0; String topMOBClient = ""; for (Session S : CMLib.sessions().toArray()) { totalMOBMillis += S.getTotalMillis(); if (S.getTotalMillis() > topMOBMillis) { topMOBMillis = S.getTotalMillis(); MOB M = S.mob(); topMOBClient = (M == null) ? S.getAddress() : M.name(); } } return new String[] { CMLib.english().returnTime(totalMOBMillis, 0), CMLib.english().returnTime(topMOBMillis, 0), topMOBClient }; }
public void shutdown() { tickActQueue.clear(); dead = true; CMLib.killThread(this, 10, 1); }