public class SServerCoach extends AbstractUDPClient implements ActionsCoach
Thread.State, Thread.UncaughtExceptionHandler
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
SServerCoach(String teamName,
ControllerCoach o)
A part constructor for SServerCoach (assumes localhost:6002)
|
SServerCoach(String teamName,
ControllerCoach con,
int port,
String hostname)
The full constructor for SServerCoach
|
Modifier and Type | Method and Description |
---|---|
void |
bye()
This is used to disconnect a coach from the server.
|
void |
changePlayerType(int unum,
int playerType)
This command changes a specified players type.
|
void |
connect()
Connects to the server via AbstractUDPClient.
|
void |
eye(boolean eyeOn)
Turns on or off the sending of "(see_global ...)" information from the server.
|
String |
getInitMessage()
Returns the init message for this client.
|
String |
getTeamName()
Returns the team name the coach is connected to.
|
void |
getTeamNames()
This command provides information about the names of both teams and which side they are playing on.
|
void |
handleError(String error)
The method used to show errors.
|
boolean |
isTeamEast()
Is the coach with the east of west team?
|
void |
look()
This command provides information about the positions of the following objects on the field.
|
void |
received(String msg)
Received a message.
|
void |
say(String message)
This command broadcasts the message throughout the field.
|
void |
setTeamEast(boolean is)
Sets the team as east or west.
|
void |
start()
Start the thread.
|
void |
teamGraphic(XPMImage xpm)
This command sends a team graphic to the SServer.
|
getDescription, isRunning, pauseMilliseconds, run, send, stopRunning, toStateString
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, stop, suspend, toString, yield
public SServerCoach(String teamName, ControllerCoach o)
teamName
- The team name.o
- a ControllerCoach
object.public SServerCoach(String teamName, ControllerCoach con, int port, String hostname)
teamName
- The teams name.con
- a ControllerCoach
object.port
- The port to connect to.hostname
- The host address.public String getInitMessage()
getInitMessage
in class AbstractUDPClient
public void connect()
public void start()
start
in class AbstractUDPClient
public void received(String msg) throws IOException
received
in class AbstractUDPClient
msg
- The message received.IOException
- if any.public void eye(boolean eyeOn)
eye
in interface ActionsCoach
eyeOn
- True to turn see_global on, false to turn it off.public void look()
look
in interface ActionsCoach
public void getTeamNames()
getTeamNames
in interface ActionsCoach
public void changePlayerType(int unum, int playerType)
changePlayerType
in interface ActionsCoach
unum
- The players uniform number (1~11 on pitch usually, subs <= 14).playerType
- A player type between 0 (the standard player) and 18. However, player.conf can change this.public void say(String message)
say
in interface ActionsCoach
message
- A valid String to say.public void teamGraphic(XPMImage xpm)
teamGraphic
in interface ActionsCoach
xpm
- An XPMImage to use.public void bye()
bye
in interface ActionsCoach
public void handleError(String error)
handleError
in interface ActionsCoach
error
- The error to show.public boolean isTeamEast()
isTeamEast
in interface ActionsCoach
public void setTeamEast(boolean is)
setTeamEast
in interface ActionsCoach
is
- true if east.public String getTeamName()
getTeamName
in interface ActionsCoach
Copyright © 2003–2015 Atan. All rights reserved.