|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.event.WindowAdapter
sarj.Sarj
public class Sarj
The main SARJ application class
| Field Summary | |
|---|---|
static javax.swing.ImageIcon |
CANCEL_ICON
|
static javax.swing.ImageIcon |
OK_ICON
|
| Constructor Summary | |
|---|---|
Sarj()
|
|
| Method Summary | |
|---|---|
void |
clearConsole()
Clears the console on the main window |
void |
connectClient()
Connects the client to the IP and port displayed on the main window |
void |
connectClient(java.lang.String ip,
int port)
Connects the client to the specified IP and port |
void |
disconnectClient()
Disconnects the client from any connected server |
void |
dispatchScript(java.lang.String scriptFile)
Runs the specified script file |
static java.lang.String |
formatTime(int seconds)
Formats seconds into mm:ss format |
java.lang.String |
getCommandBox()
Returns the value of the command combo box on the main window |
java.lang.String |
getCurrentMap()
Returns the name of the map currently being played on the server |
java.lang.String |
getGameType()
Returns the type of game running on the server |
java.lang.String |
getIPField()
Returns the value of the IP field on the main window |
int |
getNumPlayers()
Returns the number of players connected to the server |
java.lang.String |
getPasswordField()
Returns the current value stored in the password field on the main window |
java.lang.String[][] |
getPlayerData()
Returns all data within the player table on the main window |
java.lang.String[] |
getPlayerData(java.lang.String playerName)
Returns the row of the player table with the player name matching that provided |
java.lang.String |
getPortField()
Returns the value of the port field on the main window |
int |
getScoreLimit()
Returns the score limit of the game |
java.lang.String[][] |
getTeamData()
Returns all data within the team table on the main window |
java.lang.String[] |
getTeamData(java.lang.String teamName)
Returns the row of the team table with the team name matching that provided |
int |
getTimeLeft()
Returns the time left within the current game |
int |
getTimeLimit()
Returns the time limit of the current game |
java.lang.String |
getWindowTitle()
Returns the main SARJ window title |
static Sarj |
instance()
Returns the instance of the SARJ program |
static void |
main(java.lang.String[] args)
The main method |
void |
onAction(int actionID)
Called when the Perform button is clicked on the GUI |
void |
onAddAdmin(java.lang.String playerIP)
Called when the user chooses to add a player to the remote administrators list |
void |
onBanPlayer(int playerNumber)
Called when the user chooses to ban a player from the list of currently connected players |
void |
onCommand(java.lang.String command)
Called when a command is sent from the user |
void |
onConnect(java.lang.String address,
int port,
java.lang.String password)
Called when the Connect button is clicked on the GUI |
void |
onConnected()
Called when a connection is successfully established with a server, as a result of calling the connect method of a Connection object. |
void |
onDisconnect()
Called when the Disconnect button is clicked on the GUI |
void |
onDisconnected()
Called when a connection to a server is lost, either gracefully or due to error |
void |
onError(java.lang.String message)
Called when a connection error occurrs |
void |
onExit()
Called when the Exit button is clicked on the GUI, or the main GUI window is closed |
void |
onKickPlayer(int playerNumber)
Called when the user chooses to kick a player from the list of currently connected players |
void |
onRefresh()
Called when the Refresh button is clicked on the GUI, or the refresh timer triggers |
void |
onRemoveAdmin(java.lang.String playerIP)
Called when the user chooses to remove a player from the remote administrators list |
void |
onScriptButtonClick(java.lang.String name,
java.lang.String scriptFile)
Called when the user clicks on a ScriptButton |
void |
onSetTeam(int playerNumber,
int teamNumber)
Called when the user chooses to assign a connected player to a particular team |
static void |
printError(java.lang.String errorString)
Displays error messages |
void |
run()
Called when the main execution thread is started by a call to Thread.start() |
protected void |
Sarj()
Default constructor |
void |
sendData(java.lang.String data)
Sends data to a connected server |
void |
setCommandBox(java.lang.String command)
Sets the command combo box field on the main window |
void |
setIPField(java.lang.String ip)
Sets the IP field on the main window |
void |
setPasswordField(java.lang.String password)
Sets the password field on the main window |
void |
setPortField(java.lang.String port)
Sets the port field on the main window |
void |
setWindowTitle(java.lang.String title)
Sets the main SARJ window title to that specified |
void |
writeToConsole(java.lang.String text)
Writes text to the main command console |
| Methods inherited from class java.awt.event.WindowAdapter |
|---|
windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowGainedFocus, windowIconified, windowLostFocus, windowOpened, windowStateChanged |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static javax.swing.ImageIcon OK_ICON
public static javax.swing.ImageIcon CANCEL_ICON
| Constructor Detail |
|---|
public Sarj()
| Method Detail |
|---|
public static void main(java.lang.String[] args)
protected void Sarj()
public static Sarj instance()
public void run()
run in interface java.lang.Runnablepublic static void printError(java.lang.String errorString)
errorString - the error message to display
public void onConnect(java.lang.String address,
int port,
java.lang.String password)
onConnect in interface GUIListeneraddress - the address of the Soldat server, in dotted IP format
(X.X.X.X)port - the port number of the Soldat serverpassword - the remote administration password for the serverpublic void onDisconnect()
onDisconnect in interface GUIListenerpublic void onExit()
onExit in interface GUIListenerpublic void onAction(int actionID)
onAction in interface GUIListeneractionID - the ID of the action to be performedpublic void onRefresh()
onRefresh in interface GUIListenerpublic void onCommand(java.lang.String command)
onCommand in interface GUIListenercommand - the command string issued by the userpublic void onKickPlayer(int playerNumber)
onKickPlayer in interface GUIListenerplayerNumber - the unique in-game ID number of the playerpublic void onBanPlayer(int playerNumber)
onBanPlayer in interface GUIListenerplayerNumber - the unique in-game ID number of the playerpublic void onAddAdmin(java.lang.String playerIP)
onAddAdmin in interface GUIListenerplayerIP - the IP address of the playerpublic void onRemoveAdmin(java.lang.String playerIP)
onRemoveAdmin in interface GUIListenerplayerIP - the IP address of the player
public void onSetTeam(int playerNumber,
int teamNumber)
onSetTeam in interface GUIListenerplayerNumber - the unique in-game ID number of the playerteamNumber - the ID of the team to assign the player to, where
1 = alpha, 2 = beta, 3 = charlie and 4 = delta
public void onScriptButtonClick(java.lang.String name,
java.lang.String scriptFile)
onScriptButtonClick in interface GUIListenername - the name/caption of the buttonscriptFile - the script file associated with the buttonpublic void onConnected()
Connection object.
onConnected in interface ConnectionListenerpublic void onDisconnected()
onDisconnected in interface ConnectionListenerpublic void onError(java.lang.String message)
onError in interface ConnectionListenermessage - the error messagepublic static java.lang.String formatTime(int seconds)
seconds - the time to translate, in secondpublic void dispatchScript(java.lang.String scriptFile)
scriptFile - the path of the script file to executepublic java.lang.String getCurrentMap()
getCurrentMap in interface ScriptingFacadeString containing the name of the current mappublic java.lang.String getGameType()
getGameType in interface ScriptingFacadeString containing the name of the current game typepublic int getTimeLimit()
getTimeLimit in interface ScriptingFacadepublic int getTimeLeft()
getTimeLeft in interface ScriptingFacadepublic int getScoreLimit()
getScoreLimit in interface ScriptingFacadepublic int getNumPlayers()
getNumPlayers in interface ScriptingFacadepublic void setWindowTitle(java.lang.String title)
setWindowTitle in interface ScriptingFacadetitle - the new title for the windowpublic java.lang.String getWindowTitle()
getWindowTitle in interface ScriptingFacadeString containing the title of the main windowpublic java.lang.String getIPField()
getIPField in interface ScriptingFacadeString containing the value of the IP fieldpublic java.lang.String getPortField()
getPortField in interface ScriptingFacadeString containing the value of the port fieldpublic java.lang.String getPasswordField()
getPasswordField in interface ScriptingFacadepublic java.lang.String getCommandBox()
getCommandBox in interface ScriptingFacadeString containing the value of the command combo boxpublic void setIPField(java.lang.String ip)
setIPField in interface ScriptingFacadeip - the new IP address valuepublic void setPortField(java.lang.String port)
setPortField in interface ScriptingFacadeport - the new port valuepublic void setPasswordField(java.lang.String password)
setPasswordField in interface ScriptingFacadepassword - the new password valuepublic void setCommandBox(java.lang.String command)
setCommandBox in interface ScriptingFacadecommand - the new value to set the command combo box topublic void clearConsole()
clearConsole in interface ScriptingFacadepublic void disconnectClient()
disconnectClient in interface ScriptingFacade
public void connectClient(java.lang.String ip,
int port)
connectClient in interface ScriptingFacadeip - the IP address of the serverport - the port number of the serverpublic void connectClient()
connectClient in interface ScriptingFacadepublic void writeToConsole(java.lang.String text)
writeToConsole in interface ScriptingFacadetext - the text to print on the consolepublic void sendData(java.lang.String data)
sendData in interface ScriptingFacadedata - the data to sendpublic java.lang.String[] getPlayerData(java.lang.String playerName)
getPlayerData in interface ScriptingFacadeplayerName - the name of the player to match
public java.lang.String[][] getPlayerData()
getPlayerData in interface ScriptingFacadeString objects containing the data in the
tablepublic java.lang.String[] getTeamData(java.lang.String teamName)
getTeamData in interface ScriptingFacadeteamName - the name of the team to match
public java.lang.String[][] getTeamData()
getTeamData in interface ScriptingFacadeString objects containing the data in the
table
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||