Asks the server to remove all current module class definitions from memory. Subsequently
instantiated modules will use the newly loaded module class definitions, allowing module
developers to update Union Server's modules at runtime without restarting the server.
Note that currently running modules are not reloaded. For example, if a room module is
already active for a room, clearModuleCache()
will not affect that module. If the
active module's class file has changed and clearModuleCache()
is invoked, then the new
class definition will not be used until the next time the room is removed and recreated.
The clearModuleCache()
method does not affect script modules. Union Server always uses
the latest version of all script modules on disk, so there is no script module cache to
clear.
Returns the approximate current time on the server in UTC, using "milliseconds from January 1 1970" format. The time is approximated by adding the following two values:
syncTime()
).To retrieve the most accurate possible approximation, first call syncTime()
, then call
getServerTime()
from within the ServerEvent.TIME_SYNC
callback.
Returns the version of the UPC protocol in use by Union Server.
Returns the version of the Union Server to which Orbiter is currently connected.
Indicates whether the current client is currently watching for processed UPCs.
Asks Union Server to reset server-side UPC-processing statistics. If the request is
granted, Union Server clears its list of the longest UPC-message-processing times. The
statistics-reset is reflected in any subsequent UPCStatsSnapshot retrieval. By default,
resetUPCStats()
requires administrator privileges.
Sends a message to the entire server. To receive the message, recipient clients must register a message listener via MessageManager's addMessageListener() method.
The name of the message to invoke.
Indicates whether to send the message to the current client (i.e., the client that invoked sendMessage()). Defaults to false (don't echo to the sender).
Specifies one or more filters for the message. A filter specifies a requirement that each client must meet in order to receive the message. For example, a filter might indicate that only those clients with the attribute "team" set to "red" should receive the message. For complete details, see the Filter class. If filters is null, all clients on the server receive the message.
Sends the specified message to the specified server module.
The ID of the module to which the message will be sent. Modules are assigned IDs in the server's union.xml configuration file.
The name of the message to send.
The message arguments, specified as dynamic instance variables on a generic object.
Asks the server to stop sending UPC-processing notifications. By default,
stopWatchingForProcessedUPCs()
requires administrator privileges.
Asks the server to send the current time. When the time is received,
ServerEvent.TIME_SYNC
fires. Use getServerTime()
to retrieve the current approximate
time on the server (i.e., the last sync time plus elapsed time on the client). If
syncTime()
has never been called, getServerTime()
returns the client connection time
plus time elapsed on the client.
Asks the server to notify the current client upon processing any UPC message.
Notifications trigger the ServerEvent.UPC_PROCESSED
event. Details about each message
processed are provided in a UPCProcessingRecord
accessible via the ServerEvent's
getUPCProcessingRecord()
method. By default, watchForProcessedUPCs()
requires
administrator privileges.
Provides access to global server data and functions, and a means of communicating with server modules. To access the Server object, use getServer()