package com.transjam.util; /** * Defines text commands and flags used in TransJam protocol. * @author (C) 2000 Phil Burk, SoftSynth.com */ public class Globals { public final static int PROTOCOL_VERSION = 1; public final static int DEFAULT_PORT = 17952; public final static String VALIDATION_MSG = "TransJam - Copyright 2001 Phil Burk"; /** Commands exchanged between client and server. * CMD_C_ means Client sends command * CMD_S_ means Server sends command * CMD_CS_ means Client and Server both send command * * Attributes for the command follow the text string. * Parameters in >< brackets are passed it eh content field of the commend element. * Forexample, the joinroom command is documented as: * * CMD_C_JOIN_ROOM = "joinroom"; // maxclients, flags, >roomName< * * and is transmitted as: * * bonkers */ // LOGIN public final static String CMD_C_REQUEST_LOGIN = "requestlogin"; // >userName< public final static String CMD_S_GRANT_LOGIN = "grantlogin"; // uid public final static String CMD_S_DENY_LOGIN = "denylogin"; // >reason< public final static String CMD_CS_VALIDATE = "validate"; // >Copyright Burk message< public final static String CMD_CS_INFO = "info"; // version, >miscellaneous information about server or client< public final static String CMD_CS_LOGOUT = "logout"; // ROOM MANAGEMENT public final static String CMD_C_JOIN_NEW_ROOM = "joinnewroom"; // maxC, flags, >roomName< public final static String CMD_C_JOIN_ROOM = "joinroom"; // maxclients, flags, >roomName< public final static String CMD_C_JOIN_OLD_ROOM = "joinoldroom"; // >roomName< public final static String CMD_C_LEAVE_ROOM = "leaveroom"; // Go up one in room hierarchy. public final static String CMD_S_ENTER_ROOM = "enterroom"; // level, >roomName< public final static String CMD_S_DENY_ROOM = "denyroom"; // >roomName< public final static String CMD_S_NO_ROOM = "noroom"; // >roomName< public final static String CMD_C_REQUEST_ROOM_LIST = "listrooms"; public final static String CMD_S_ADD_ROOM = "addroom"; // maxC, numC, flags, >roomName< public final static String CMD_S_UPDATE_ROOM = "updateroom"; // maxC, numC, flags, >roomName< public final static String CMD_S_DELETE_ROOM = "deleteroom"; // >roomName< public final static String CMD_S_END_LIST = "endlist"; // ROOM USERS public final static String CMD_C_REQUEST_USER_LIST = "listusers"; public final static String CMD_S_ADD_USER = "adduser"; // uid, >userName< public final static String CMD_S_DELETE_USER = "deleteuser"; // uid // THINGS public final static String CMD_C_REQUEST_THING_LIST = "listthings"; public final static String CMD_C_LOCK_NEW_THING = "locknewthing"; // name, >contents< public final static String CMD_CS_LOCK_THING = "lockthing"; // name, {uid_requester} ; server is null requester public final static String CMD_C_LOCK_OLD_THING = "lockoldthing"; // name public final static String CMD_S_ADD_THING = "addthing"; // name public final static String CMD_S_DENY_THING = "denything"; // name ; could not be created public final static String CMD_S_NO_THING = "nothing"; // name ; not found public final static String CMD_CS_GRANT_LOCK = "grantlock"; // name, {uid_requester} ; server is null requester public final static String CMD_CS_DENY_LOCK = "denylock"; // name, uid_requester public final static String CMD_CS_MODIFY_THING = "modifything"; // name, >contents< public final static String CMD_S_DENY_MOD = "denymod"; // name, >contents< public final static String CMD_CS_UNLOCK_THING = "unlockthing"; // name public final static String CMD_CS_DELETE_THING = "deletething"; // name // CHAT public final static String CMD_CS_CHAT = "chat"; // flags, {uid}, >message< public final static int FLAG_CHAT_FRONT = (1<<0); // send recipients chat window to front to get attention public final static String CMD_CS_SEND_ALL = "sendall"; // {uid}, >message< public final static String CMD_CS_SEND_USER = "senduser"; // uid, >message< public final static String CMD_CS_SEND_OTHERS = "sendothers"; // {uid}, >message< public final static String CMD_CS_SEND_SELF = "sendself"; // >message< ; useful for sending synchronized commands from gui to listener public final static String CMD_S_ERROR = "error"; // errorNum, >message< /** The echo is sent in response to a request at the lowest level of the client. * Applications do not need to respond. */ public final static String CMD_CS_REQUEST_ECHO = "reqecho"; // {>message<} public final static String CMD_CS_ECHO = "echo"; // {>message<} // acknowledgement public final static String CMD_CS_SYNC = "sync"; // >index< public final static String CMD_S_BROADCAST = "broadcast"; // >message< , broadcast message from server administrator }