thegame.server
Class GameServerKiller

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--thegame.shared.GameConnection
              |
              +--thegame.server.GameServerKiller
All Implemented Interfaces:
GameConnectionConstants, java.lang.Runnable

public class GameServerKiller
extends GameConnection

A utility to shut down the game server.

Version:
0.99 (2000/08/28)
Author:
Erki Suurjaak

Field Summary
static java.lang.String COMMUNICATIONS_ERROR_MESSAGE
          The message shown when a communications error occurs.
static java.lang.String STARTUP_PASSWORD_PROMPT_MESSAGE
          The password prompt shown at startup.
static java.lang.String USAGE_MESSAGE
          The message shown when run with an insufficient number of command-line arguments.
 
Fields inherited from class thegame.shared.GameConnection
in, isRunning, out, socket
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Fields inherited from interface thegame.shared.GameConnectionConstants
DEFAULT_SERVER_PORT, DELIMITER, P2P_MOVE_MADE_MESSAGE, P2P_NEW_GAME_ACCEPTED_MESSAGE, P2P_NEW_GAME_REFUSED_MESSAGE, P2P_NEW_GAME_REQUESTED_MESSAGE, P2P_PLAYER_SURRENDERED_MESSAGE, P2P_TEXT_MESSAGE, P2P_WINNING_MOVE_MADE_MESSAGE, P2S_CREATE_GAME_MESSAGE, P2S_JOIN_GAME_MESSAGE, P2S_PLAYER_NAME_MESSAGE, P2S_PLAYER_QUIT_MESSAGE, P2S_PLAYER_RETURNED_TO_START_SCREEN_MESSAGE, P2S_PLAYER_WAITED_FOR_NEW_PLAYER_MESSAGE, P2S_READY_FOR_PLAYER_LIST_MESSAGE, PLAYER_TO_SYSTEM_MESSAGES, S2P_JOIN_GAME_FAILED_MESSAGE, S2P_JOIN_GAME_SUCCEEDED_MESSAGE, S2P_PLAYER_DROPPED_MESSAGE, S2P_PLAYER_JOINED_MESSAGE, S2P_PLAYER_LIST_MESSAGE, S2P_PLAYER_NAME_NOT_OK_MESSAGE, S2P_PLAYER_NAME_OK_MESSAGE, S2P_PLAYER_QUIT_MESSAGE, S2P_PLAYER_RETURNED_TO_START_SCREEN_MESSAGE, S2P_SERVER_SHUTDOWN_MESSAGE, SHUTDOWN_MESSAGE
 
Constructor Summary
GameServerKiller(java.net.Socket socket)
          Constructs a GameServerKiller.
 
Method Summary
static void main(java.lang.String[] args)
          Builds a GameServerKiller.
 void run()
          Waits for a server response.
 
Methods inherited from class thegame.shared.GameConnection
close, getMessageBody, getMessageContentsAs1DIntArray, getMessageContentsAs1DStringArray, getMessageContentsAs2DIntArray, getMessageContentsAsBoolean, getMessageID, getReadyToSendForm, send, send, send, send, send, send, setRunning
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COMMUNICATIONS_ERROR_MESSAGE

public static final java.lang.String COMMUNICATIONS_ERROR_MESSAGE
The message shown when a communications error occurs.

STARTUP_PASSWORD_PROMPT_MESSAGE

public static final java.lang.String STARTUP_PASSWORD_PROMPT_MESSAGE
The password prompt shown at startup.

USAGE_MESSAGE

public static final java.lang.String USAGE_MESSAGE
The message shown when run with an insufficient number of command-line arguments.
Constructor Detail

GameServerKiller

public GameServerKiller(java.net.Socket socket)
                 throws java.io.IOException
Constructs a GameServerKiller. Asks for an administrator password to use, sends a shutdown message to the server and waits for a response.
Parameters:
socket - the socket to use
Method Detail

main

public static void main(java.lang.String[] args)
Builds a GameServerKiller. The first argument must be the IP address of the server, the second argument may be the TCP port of the server (if unspecified, the default port will be used).

run

public void run()
Waits for a server response. Shows the message sent by the server and exits.
Overrides:
run in class java.lang.Thread