|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.camelspotting.jotl.ServerMonitor
public class ServerMonitor
This is one of the primary access points for any user of the library. It's for monitoring an ongoing OpenTTD game. It can do updates continously or manually.
Constructor Summary | |
---|---|
ServerMonitor(GameQuerier gameQuerier,
int updateInterval,
boolean updateNow,
OpenTTDListener... otls)
Main constructor for creating the server handler. |
Method Summary | |
---|---|
void |
addListeners(OpenTTDListener... otls)
Method for registering listeners for any events. |
String |
getServerName()
Getter for the monitored server's hostname. |
boolean |
isPaused()
Getter for easily finding out whether the game is paused or not. |
void |
removeListeners(OpenTTDListener... otls)
Method for deregistering listeners. |
void |
setUpdateInterval(int ms)
This method is for altering the update interval. |
void |
start()
This method is for starting the continous updating. |
void |
stop()
This method overrides the setUpdateInterval-method that refuses to lower the interval to lower than 2000 and sets it to -1. |
void |
update()
This method is public so that any API-user might update manually. also for the automatic update process. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ServerMonitor(GameQuerier gameQuerier, int updateInterval, boolean updateNow, OpenTTDListener... otls) throws JOTLException
host
- the server to monitorlocalPort
- the local port to useremotePort
- the remote port to useupdateInterval
- update interval in milliseconds, 0 or less for
manualupdateNow
- do an update at once?otls
- any initial listeners?
JOTLException
start()
Method Detail |
---|
public boolean isPaused()
ServerHandler
has stopped
querying the OpenTTD server.
public String getServerName()
public void setUpdateInterval(int ms)
ms
- the number of milliseconds to setstart()
,
stop()
public void start()
public void stop()
setUpdateInterval(int ms)
,
start()
public final void update() throws JOTLException
JOTLException
OpenTTDEvent
public final void addListeners(OpenTTDListener... otls)
otls
- the listener to addpublic final void removeListeners(OpenTTDListener... otls)
otls
- the listeners to remove
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |