// // Holding place for various constants used by the Pong protocol. // public class Pong { // // Where to reach the masterServer. // public static final String MASTERHOST = "xi.cs.fsu.edu"; public static final int MASTERPORT = 20000; // // pongServer <--> masterServer protocol commands (unique positive numbers). // public static final int SERVER_ACK = 0; // acknowledgement previous packet public static final int SERVER_NAK = 1; // negative acknowledgement public static final int SERVER_LOGIN = 2; // add this server to serverList public static final int SERVER_LOGOUT = 3; // remove from serverList public static final int SERVER_LIST = 4; // return list of all servers public static final int SERVER_PING = 5; // pongServer <--> pongServer // // pongClient <--> pongServer protocol commands // public static final int CLIENT_LIST = 100; public static final int CLIENT_PING = 101; // pongClient <--> pongServer public static final int CLIENT_ACK = 102; public static final int CLIENT_NAK = 103; // // Various return codes (unique negative numbers). // public static final int SERVER_ALREADY_LOGGED_IN = -1; // server already logged in public static final int SERVER_NOT_LOGGED_IN = -2; // server not logged in public static final int SERVER_READ_FAILED = -3; // readObject() failed public static final int CLIENT_READ_FAILED = -4; // readObject() failed public static final int MAX_IDLE_TIME = 60*5; // max idle time for servers }