org.starhope.appius.game
Class AppiusClaudiusCaecus

java.lang.Object
  extended by org.starhope.appius.game.AppiusClaudiusCaecus

public class AppiusClaudiusCaecus
extends Object

Appius Claudius Caecus is a game server application framework. Extensible using Java classes loaded from its extensive library of configurable options, Appius provides a network server for real-time data exchange.

Originally titled “Braque,” this application was developed for use with the videogame (work in progress) “Sideres.” It was designed to operate with a messaging protocol called “Cubist,” which has since been defined in terms of a simple JSON + \0 wire protocol.

Since that time, I have repurposed the game engine for use with Tootsville™ (http://www.Tootsville.com/) and set up a new series of communications supports designed to be compatible with the ActionScript 3 libraries for Smart Fox Server Pro.

The server should still be able to operate on its own with minimal changes. Most of the Tootsville-specific code has been isolated into the com.tootsville.* package, but replacement code for some methods might be needed to create a stand-alone game. Also, some default configuration values are Tootsville-oriented.

This class in general operates as both the main game thread and socket listener — in the static methods and variables — and the client-connected user thread — in the instance methods and variables. The “metronome” timer thread also runs using the static methods of this class.

Author:
brpocock@star-hope.org

Field Summary
private static PreparedStatement blatherStatement
          Prepared statement used to inject log entries into the log
private static long bootTime
          The time at which the server was started
(package private) static Set<Long> bugsMailed
          when were bugs eMailed? Don't blow up my mailbox
private static GaiusValeriusCatullus catullus
          WRITEME: Document this brpocock@star-hope.org
private static Collection<RoomListener> defaultListeners
          Default listeners are called for actions on all rooms in the world
static int DELAY_MS
          The delay before the first run of the NPC manager task.
private static boolean doUserLoadTest
          If true, the internal user system load testing should be enabled
private static int highWaterUsers
          The most users who have been online since the server started
private static boolean isFollower
          If true, this is a follower server in a cluster (not the leader)
(package private) static SimpleDateFormat isoDate
          The date format used for system messages.
private static Connection journalDB
          The connection to the journal database, used by blather
private static Kalendor kalendor
          the kalendor
private static Timer kalendorTimer
          WRITEME: Document this brpocock@star-hope.org
private static boolean keepRunning
          If this ever transitions to “false,” stop listening for new connections.
private static boolean knowWhyJournalDBOut
          If the journaling database goes offline, this variable will keep from getting a flood of bug reports.
private static long lastMetronomeTick
          The time at which the global metronome thread last ticked.
(package private) static Collection<ListeningThread> listeningThreads
          all listeners who might be active
private static ListeningThread mainListeningThread
          WRITEME
(package private) static Timer metronome
          The timer driving the global metronome.
private static ConcurrentSkipListSet<AcceptsMetronomeTicks> metronomeListeners
          Collection of arbitrary objects who wish to receive Metronome ticks
(package private) static Thread metronomeThread
          The global metronome thread.
private static String motd
          Message of the day
private static Timer quaestorTimer
          WRITEME: Document this brpocock@star-hope.org
private static Collection<String> quenchedAddresses
          addresses from which connections are not accepted
private static long serialVersionUID
          The version of the serialized form of this class.
private static ConcurrentHashMap<String,ServerThread> serverThreads
          All live server threads
private static ZoneSpawner spawner
          WRITEME: Document this brpocock@star-hope.org
private static boolean started
          A global boolean flag to indicate that the server has started up successfully
private static long tGameStatePump
          Time at which the Game State pump last ran
private static ConcurrentHashMap<String,ThreadGroup> threadGroups
          Thread groups, by name.
private static long tStats
          Time at which the server statistics were last “reportBug” mailed
static int TWENTY_ONE_YEARS_MSEC
          The number of milliseconds in 21 years.
 String versionInformation
          The version information, published here for implementations to refer back to.
 
Constructor Summary
AppiusClaudiusCaecus()
           
 
Method Summary
static void add(AcceptsMetronomeTicks listener)
          Add a thread to the Metronome tick event schedule without that thread being
static void add(ListeningThread listeningThread)
           
static void add(Zone zone)
          Add a Zone to the global Zones list
static void addDefaultListener(RoomListener listener)
          Add a default room listener to all rooms in every zone (except limbo rooms)
static void addZone(String zoneName, Zone zone)
          Deprecated. use add(Zone)
static void blather(String message)
          Print a debugging message at low urgency, from a random place
static void blather(String user, String room, String address, String message, boolean urgent)
          Write out a log message to the log file and/or database
private static void blatherToJournal(String user, String room, String address, String message, boolean urgent)
          Write out a log message to the database
static void bugDuplex(String subject, String message)
          Write out an error message to the log file and/or mail, as appropriate
private static Zone createLoginZone()
          Create the $Eden special login zone.
static Error fatalBug(Exception e)
          The exception passed in will be reported, as per reportBug, and then re-thrown as an Error, killing the process responsible
static Error fatalBug(String string)
          Report a bug, and throw a fatal Error.
static Error fatalBug(String string, Throwable t)
          Report a bug, and throw a fatal Error.
private static int getAccurateHeadcount()
          Get the accurate number of users in all zones.
static Collection<AbstractUser> getAllUsers()
          Get a collection of all users in all zones.
static LinkedList<Zone> getAllZones()
           
static long getBootTime()
          Get the server start time
static GaiusValeriusCatullus getCatullus()
           
static Charon getCharon()
          Get the Charon reaper thread
static String getClusterLeader()
          Get the hostname of the cluster leader, or this server if it is the cluster leader
static Collection<RoomListener> getDefaultListeners()
          Get the set of default room listeners upon all rooms in the world
static int getHighWaterUsers()
          Get the high-water mark count of users
static Kalendor getKalendor()
           
static long getLastMetronomeTick()
           
static Zone getLoginZone()
           
static String getMOTD()
           
static Set<String> getQuenchedAddresses()
          WRITEME: Document this method brpocock@star-hope.org
(package private) static Class<? extends RunCommands> getRCClass()
          WRITEME: Document this method brpocock@star-hope.org
static String getRev()
          Get the revision number of this file
static String getServerHostname()
          Get the hostname on which the server process is running
static String getServerPorts()
           
(package private) static String getStackTrace(Throwable throwable, String prefix)
          Deprecated. Use BugReporter.getStackTrace(Throwable,String) instead
static int getThreadCount()
          Returns the number of server threads running.
static ThreadGroup getThreadGroup(String string)
          WRITEME: Document this method brpocock@star-hope.org
static Zone getZone(String zoneName)
          Find a Zone object for a given zone name
static ZoneSpawner getZoneSpawner()
          WRITEME: Document this method brpocock@star-hope.org
private static void installShutdownHooks()
          WRITEME: Document this method brpocock@star-hope.org
static boolean isFollower()
           
static boolean isLeader()
           
static boolean isZoneActive(String zoneName)
          Determine whether a zone is active
private static void listenForever()
          Begin threads to listen on the stream and batch ports.
static void logEvent(String verb, String zoneName, String userName, String targetName, HashMap<String,String> details)
          Record an event to the journal
static void main(String[] argv)
          This is the main routine to run Appius as a stand-alone server.
static void migrateAll(String otherHost, int otherPort)
           Migrate all users to another host.
private static void parseArgV(String[] argv)
          Parse command-line arguments (for the loosest definition of “parse”)
static void quenchConnectionsFrom(InetAddress address)
          WRITEME: Document this method brpocock@star-hope.org
static void remove(AcceptsMetronomeTicks listener)
          Remove a metronome listener
static void remove(ListeningThread listeningThread)
           
static void remove(Zone whichZone)
          Deprecated. Use TheZones.remove(AbstractZone) instead
static void reportBug(String string)
           Report a bug.
static void reportBug(String reason, Throwable throwable)
          Report a bug to the automatic bug-tracking systems.
static void reportBug(Throwable e)
           
static void reportClientBug(String string)
          Report a bug from the client application.
static void reportClientBug(String string, Thread thread)
          Report a bug from the client application.
static void reportDesignBug(String string)
          Report a bug regarding room layouts and such
private static void reportRestartBefore()
          WRITEME: Document this method brpocock@star-hope.org
private static void reportRestartFinal()
          WRITEME: Document this method brpocock@star-hope.org
static void restart()
          This should restart the server, but it doesn't work (yet) XXX
static void restartMetronome()
          Attempt to restart the global metronome — this probably won't work as currently implemented (?)
private static void runCommands()
          Run the initial "run commands" (RC) for the game in question.
private static void sayGoodMorning()
          Print the “good morning” banners to the logs
private static void sendStatsMail(long t)
          Send an eMail with server statistics, if the timer has elapsed
static void setMOTD(String string)
          Set the message of the day string
static void shutdown()
          WRITEME: Document this method brpocock@star-hope.org
static void startMetronome()
          Start the global metronome to ticking
static void startTicking(ServerThread thread)
          Register an object (usually a server thread) who wishes to begin accepting metronome ticks.
private static void startUserLoadTest()
          Start the parallel user load test threads
static void stopMetronome()
           
static void stopTicking(AcceptsMetronomeTicks thread)
          Stop sending metronome ticks to a particular object.
static String stringify(StackTraceElement[] stackTrace)
          Deprecated. Use LibMisc.stringify(StackTraceElement[]) instead
static String stringify(Throwable e)
          Deprecated. Use LibMisc.stringify(Throwable) instead
static void tick()
          The main metronome single-threaded tick
private static void tickGameStatePump(long t)
          Send a metronome tick to the game state pump
private static void tickMetronomeListeners(long t, long deltaT)
          Tick all listeners to the Metronome
private static void tickServerThreads(long t, long deltaT, boolean dumpUserThreads)
          Tick all server threads
static void traceThis()
          Force a stack backtrace without an exception being thrown.
static void traceThis(String string)
          Force a stack backtrace without an exception being thrown.
static void unquench(InetAddress address)
          WRITEME: Document this method brpocock@star-hope.org
static void updateHighWaterMark()
          Update the high water mark, if necessary
static void wallops(AbstractUser user, String string)
          Write a message to all online operators
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

blatherStatement

private static PreparedStatement blatherStatement
Prepared statement used to inject log entries into the log


bootTime

private static final long bootTime
The time at which the server was started


defaultListeners

private static Collection<RoomListener> defaultListeners
Default listeners are called for actions on all rooms in the world


DELAY_MS

public static final int DELAY_MS
The delay before the first run of the NPC manager task.

See Also:
Constant Field Values

doUserLoadTest

private static boolean doUserLoadTest
If true, the internal user system load testing should be enabled


highWaterUsers

private static int highWaterUsers
The most users who have been online since the server started


isFollower

private static boolean isFollower
If true, this is a follower server in a cluster (not the leader)


isoDate

static final SimpleDateFormat isoDate
The date format used for system messages. A constant.


mainListeningThread

private static ListeningThread mainListeningThread
WRITEME


quaestorTimer

private static Timer quaestorTimer
WRITEME: Document this brpocock@star-hope.org


kalendorTimer

private static Timer kalendorTimer
WRITEME: Document this brpocock@star-hope.org


versionInformation

public final String versionInformation
The version information, published here for implementations to refer back to.

See Also:
Constant Field Values

journalDB

private static Connection journalDB
The connection to the journal database, used by blather


keepRunning

private static boolean keepRunning
If this ever transitions to “false,” stop listening for new connections. Global kill switch.


knowWhyJournalDBOut

private static boolean knowWhyJournalDBOut
If the journaling database goes offline, this variable will keep from getting a flood of bug reports. On every successful write to the journal database, this flag is reset to false. However, after any failure, it flip-flops to true, allowing only one bug report to be mailed at a time.


lastMetronomeTick

private static long lastMetronomeTick
The time at which the global metronome thread last ticked.


metronome

static Timer metronome
The timer driving the global metronome.


metronomeListeners

private static final ConcurrentSkipListSet<AcceptsMetronomeTicks> metronomeListeners
Collection of arbitrary objects who wish to receive Metronome ticks


metronomeThread

static Thread metronomeThread
The global metronome thread.


motd

private static String motd
Message of the day


serialVersionUID

private static final long serialVersionUID
The version of the serialized form of this class.

See Also:
Constant Field Values

serverThreads

private static ConcurrentHashMap<String,ServerThread> serverThreads
All live server threads


started

private static boolean started
A global boolean flag to indicate that the server has started up successfully


tGameStatePump

private static long tGameStatePump
Time at which the Game State pump last ran


tStats

private static long tStats
Time at which the server statistics were last “reportBug” mailed


TWENTY_ONE_YEARS_MSEC

public static final int TWENTY_ONE_YEARS_MSEC
The number of milliseconds in 21 years. Used for autovivification of accounts.

See Also:
Constant Field Values

listeningThreads

static Collection<ListeningThread> listeningThreads
all listeners who might be active


quenchedAddresses

private static Collection<String> quenchedAddresses
addresses from which connections are not accepted


threadGroups

private static ConcurrentHashMap<String,ThreadGroup> threadGroups
Thread groups, by name.


bugsMailed

static Set<Long> bugsMailed
when were bugs eMailed? Don't blow up my mailbox


kalendor

private static final Kalendor kalendor
the kalendor


spawner

private static ZoneSpawner spawner
WRITEME: Document this brpocock@star-hope.org


catullus

private static GaiusValeriusCatullus catullus
WRITEME: Document this brpocock@star-hope.org

Constructor Detail

AppiusClaudiusCaecus

public AppiusClaudiusCaecus()
Method Detail

getCatullus

public static GaiusValeriusCatullus getCatullus()
Returns:
the C. Valerius Catullus object for remote method invocation

getMOTD

public static String getMOTD()
Returns:
the motd

getQuenchedAddresses

public static Set<String> getQuenchedAddresses()
WRITEME: Document this method brpocock@star-hope.org

Returns:
WRITEME

getRCClass

static Class<? extends RunCommands> getRCClass()
                                        throws NotFoundException
WRITEME: Document this method brpocock@star-hope.org

Returns:
WRITEME
Throws:
NotFoundException - WRITEME

getRev

public static String getRev()
Get the revision number of this file

Returns:
The revision number of this file

getServerHostname

public static String getServerHostname()
Get the hostname on which the server process is running

Returns:
the hostname of the local host

getServerPorts

public static String getServerPorts()
Returns:
a string listing all active server ports, comma-joined

getStackTrace

@Deprecated
static String getStackTrace(Throwable throwable,
                                       String prefix)
Deprecated. Use BugReporter.getStackTrace(Throwable,String) instead

This extracts a stack backtrace from a Throwable into a string format for a bug report. Each line is preceded by the supplied prefix string, followed the stack backtrace element. The string does not end with a newline.

Parameters:
throwable - A Throwable from which to extract a stack trace
prefix - The string with which to separate lines of the trace.
Returns:
The stacktrace as a string

getThreadCount

public static int getThreadCount()
Returns the number of server threads running. There are more threads in the VM, because there are also bookkeeping threads, the main listener, the metronome, etc.

Returns:
The number of server threads running

getThreadGroup

public static ThreadGroup getThreadGroup(String string)
WRITEME: Document this method brpocock@star-hope.org

Parameters:
string - WRITEME
Returns:
WRITEME

getZone

public static Zone getZone(String zoneName)
Find a Zone object for a given zone name

Parameters:
zoneName - The name of the zone to be found
Returns:
The Zone object, if the selected Zone exists; else, null

getZoneSpawner

public static ZoneSpawner getZoneSpawner()
WRITEME: Document this method brpocock@star-hope.org

Returns:
WRITEME

installShutdownHooks

private static void installShutdownHooks()
WRITEME: Document this method brpocock@star-hope.org


isFollower

public static boolean isFollower()
Returns:
true, if this is a follower server in a cluster (not the leader)

isLeader

public static boolean isLeader()
Returns:
true, if this is the leader server in a cluster (not a follower)

isZoneActive

public static boolean isZoneActive(String zoneName)
Determine whether a zone is active

Parameters:
zoneName - the name of the zone
Returns:
true, if the zone is active

listenForever

private static void listenForever()
Begin threads to listen on the stream and batch ports.


logEvent

public static void logEvent(String verb,
                            String zoneName,
                            String userName,
                            String targetName,
                            HashMap<String,String> details)
Record an event to the journal

Parameters:
verb - The verb describing the event
zoneName - The zone in which it occurred
userName - The user causing the action
targetName - The target of the action, if any
details - Additional details

main

public static void main(String[] argv)
                 throws IOException
This is the main routine to run Appius as a stand-alone server.

Parameters:
argv - Any command-line arguments
Throws:
IOException - if there's an I/O exception

migrateAll

public static void migrateAll(String otherHost,
                              int otherPort)

Migrate all users to another host. They will attempt to connect to identical zones as the ones which are currently active.

This is a low-level function and does nothing to ensure that the given zone actually exists on the other server

Parameters:
otherHost - the other host to which users should migrate
otherPort - the other host's listening port to which users should migrate

parseArgV

private static void parseArgV(String[] argv)
                       throws NumberFormatException
Parse command-line arguments (for the loosest definition of “parse”)

Parameters:
argv - Command-line arguments “vector”
Throws:
NumberFormatException - if a numerical parameter can't be interpreted properly

quenchConnectionsFrom

public static void quenchConnectionsFrom(InetAddress address)
WRITEME: Document this method brpocock@star-hope.org

Parameters:
address - WRITEME

remove

public static void remove(AcceptsMetronomeTicks listener)
Remove a metronome listener

Parameters:
listener - The listener to deregister

remove

public static void remove(ListeningThread listeningThread)
Parameters:
listeningThread - WRITEME

remove

@Deprecated
public static void remove(Zone whichZone)
Deprecated. Use TheZones.remove(AbstractZone) instead

Remove a zone from the server

Parameters:
whichZone - The zone to be removed

reportBug

public static void reportBug(String string)

Report a bug.

This is used to catch either ‘impossible things’ or things that are so bad that immediate programmer intervention is needed.

Bug reports should eventually be funneled into the bug-tracking system or similar automatically, and forwarded to the systems programmers via eMail and SMS.

Parameters:
string - Bug report

reportBug

public static void reportBug(String reason,
                             Throwable throwable)
Report a bug to the automatic bug-tracking systems. This is an exception which "should never" be thrown, being caught and referred back for programmer intervention.

Parameters:
reason - The reason this is a bug, if known.
throwable - The "impossible" exception.

reportBug

public static void reportBug(Throwable e)
Parameters:
e - An exception to report

reportClientBug

public static void reportClientBug(String string)
Report a bug from the client application.

Parameters:
string - The client application's bug

reportClientBug

public static void reportClientBug(String string,
                                   Thread thread)
Report a bug from the client application.

Parameters:
string - The client application's bug
thread - The associated server thread, whose information will be prepended, if present. (null is a valid answer, for backward compatibility)

reportDesignBug

public static void reportDesignBug(String string)
Report a bug regarding room layouts and such

Parameters:
string - The client application's bug

reportRestartBefore

private static void reportRestartBefore()
WRITEME: Document this method brpocock@star-hope.org


reportRestartFinal

private static void reportRestartFinal()
WRITEME: Document this method brpocock@star-hope.org


restart

public static void restart()
This should restart the server, but it doesn't work (yet) XXX


restartMetronome

public static void restartMetronome()
Attempt to restart the global metronome — this probably won't work as currently implemented (?)


runCommands

private static void runCommands()
Run the initial "run commands" (RC) for the game in question. This is an auto-started script which is run once to initialize the game world for game-specific (e.g. Tootsville™-specific) initialization; it often will do things such as add default event listeners to rooms or initialize things.


sayGoodMorning

private static void sayGoodMorning()
Print the “good morning” banners to the logs


sendStatsMail

private static void sendStatsMail(long t)
Send an eMail with server statistics, if the timer has elapsed

Parameters:
t - the current time

setMOTD

public static void setMOTD(String string)
Set the message of the day string

Parameters:
string - new message of the day

shutdown

public static void shutdown()
WRITEME: Document this method brpocock@star-hope.org


startMetronome

public static void startMetronome()
Start the global metronome to ticking


startTicking

public static void startTicking(ServerThread thread)
Register an object (usually a server thread) who wishes to begin accepting metronome ticks.

Parameters:
thread - the thread who wants to accept ticks now

startUserLoadTest

private static void startUserLoadTest()
Start the parallel user load test threads


stopMetronome

public static void stopMetronome()

stopTicking

public static void stopTicking(AcceptsMetronomeTicks thread)
Stop sending metronome ticks to a particular object. If that object happens to be a Thread as well, also sends the Thread an Thread.interrupt(). If it's an instance of ServerThread, it will first call the thread's ServerThread.end() method.

Parameters:
thread - the object who doesn't want to get any more ticks

stringify

@Deprecated
public static String stringify(StackTraceElement[] stackTrace)
Deprecated. Use LibMisc.stringify(StackTraceElement[]) instead

Create a pure string version of a stack backtrace

Parameters:
stackTrace - An array of StackTraceElements:s
Returns:
A string version of the entire stack backtrace

stringify

@Deprecated
public static String stringify(Throwable e)
Deprecated. Use LibMisc.stringify(Throwable) instead

Parameters:
e - A Throwable to be stringified into a backtrace
Returns:
The string form

tick

public static void tick()
The main metronome single-threaded tick


tickGameStatePump

private static void tickGameStatePump(long t)
Send a metronome tick to the game state pump

Parameters:
t - The current time

tickMetronomeListeners

private static void tickMetronomeListeners(long t,
                                           long deltaT)
Tick all listeners to the Metronome

Parameters:
t - the current time in milliseconds (at the start of the global “tick”)
deltaT - the time since the last metronome tick

tickServerThreads

private static void tickServerThreads(long t,
                                      long deltaT,
                                      boolean dumpUserThreads)
Tick all server threads

Parameters:
t - The time at the start of the tick
deltaT - The time since the last tick
dumpUserThreads - If true, dump out the status information on each thread to STDOUT

traceThis

public static void traceThis()
Force a stack backtrace without an exception being thrown. For debugging purposes, principally.


traceThis

public static void traceThis(String string)
Force a stack backtrace without an exception being thrown. For debugging purposes, principally.

Parameters:
string - A string to be used as a label on the trace

unquench

public static void unquench(InetAddress address)
WRITEME: Document this method brpocock@star-hope.org

Parameters:
address - WRITEME

updateHighWaterMark

public static void updateHighWaterMark()
Update the high water mark, if necessary


wallops

public static void wallops(AbstractUser user,
                           String string)
Write a message to all online operators

Parameters:
user - The user sending the message
string - The message to broadcast

add

public static void add(AcceptsMetronomeTicks listener)
Add a thread to the Metronome tick event schedule without that thread being

Parameters:
listener - The listener who wishes to receive Metronome ticks.

add

public static void add(ListeningThread listeningThread)
Parameters:
listeningThread - to be added

add

public static void add(Zone zone)
Add a Zone to the global Zones list

Parameters:
zone - the Zone to be added

addDefaultListener

public static void addDefaultListener(RoomListener listener)
Add a default room listener to all rooms in every zone (except limbo rooms)

Parameters:
listener - the new default listener to be added

addZone

@Deprecated
public static void addZone(String zoneName,
                                      Zone zone)
Deprecated. use add(Zone)

Parameters:
zoneName - The zone's name (ignored)
zone - The Zone object

blather

public static void blather(String message)
Print a debugging message at low urgency, from a random place

Parameters:
message - The message

blather

public static void blather(String user,
                           String room,
                           String address,
                           String message,
                           boolean urgent)
Write out a log message to the log file and/or database

Parameters:
user - The user name and ID responsible
room - The room and zone in which the action occurred
address - The user's remote socket's IP address and port number
message - The event which occurred
urgent - Urgent messages are written even when debugging is disabled

blatherToJournal

private static void blatherToJournal(String user,
                                     String room,
                                     String address,
                                     String message,
                                     boolean urgent)
Write out a log message to the database

Parameters:
user - The user name and ID responsible
room - The room and zone in which the action occurred
address - The user's remote socket's IP address and port number
message - The event which occurred
urgent - Urgent messages are written even when debugging is disabled

bugDuplex

public static void bugDuplex(String subject,
                             String message)
Write out an error message to the log file and/or mail, as appropriate

Parameters:
subject - The subject
message - The error message

createLoginZone

private static Zone createLoginZone()
Create the $Eden special login zone. Normally happens on the lead server of a cluster during start-up

Returns:
the login zone

fatalBug

public static Error fatalBug(Exception e)
The exception passed in will be reported, as per reportBug, and then re-thrown as an Error, killing the process responsible

Parameters:
e - An exception to report
Returns:
the error (in theory), which can't be used, but makes the source code more legible.
Throws:
Error - (based upon the exception) every time. Since the Error is also thrown, it's never actually received by the caller, but it makes the compiler happy to write it into a throw clause, so it realizes that the flow will not continue.

fatalBug

public static Error fatalBug(String string)
Report a bug, and throw a fatal Error.

Parameters:
string - The error to report
Returns:
a copy of the Error. Since the Error is also thrown, it's never actually received by the caller, but it makes the compiler happy to write it into a throw clause, so it realizes that the flow will not continue.

fatalBug

public static Error fatalBug(String string,
                             Throwable t)
Report a bug, and throw a fatal Error.

Parameters:
string - A description of the error to report
t - An exception to escalate to the Error
Returns:
a copy of the Error. Since the Error is also thrown, it's never actually received by the caller, but it makes the compiler happy to write it into a throw clause, so it realizes that the flow will not continue.

getAccurateHeadcount

private static int getAccurateHeadcount()
Get the accurate number of users in all zones.

Returns:
The number of users in all zones.

getAllUsers

public static Collection<AbstractUser> getAllUsers()
Get a collection of all users in all zones.

Returns:
all users in all Zones

getAllZones

public static LinkedList<Zone> getAllZones()
Returns:
All active zones in the multiverse

getBootTime

public static long getBootTime()
Get the server start time

Returns:
The time at which the server started in milliseconds since epoch

getCharon

public static Charon getCharon()
Get the Charon reaper thread

Returns:
Charon

getClusterLeader

public static String getClusterLeader()
Get the hostname of the cluster leader, or this server if it is the cluster leader

Returns:
the hostname of the cluster leader

getDefaultListeners

public static Collection<RoomListener> getDefaultListeners()
Get the set of default room listeners upon all rooms in the world

Returns:
the default room listeners

getHighWaterUsers

public static int getHighWaterUsers()
Get the high-water mark count of users

Returns:
the highest number of simultaneous users who have been online since server boot

getKalendor

public static Kalendor getKalendor()
Returns:
the kalendor

getLastMetronomeTick

public static long getLastMetronomeTick()
Returns:
the time at which the metronome last ticked

getLoginZone

public static Zone getLoginZone()
Returns:
the login zone