|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object soc.server.SOCLocalRobotClient
class SOCLocalRobotClient
Each local robot in the SOCServer
gets its own client thread.
Equivalent to main thread in SOCRobotClient
in network games.
This class was originally SOCPlayerClient.SOCPlayerLocalRobotRunner, then moved in 1.1.09 to SOCServer.SOCPlayerLocalRobotRunner,
Split out in 2.0.00 to its own top-level class.
Before 2.0.00, the thread name prefix was robotrunner-
not localrobotclient-
.
SOCServer.setupLocalRobots(int, int)
Field Summary | |
---|---|
(package private) SOCRobotClient |
rob
This bot's client in robotClients . |
static java.util.Hashtable<java.lang.String,SOCRobotClient> |
robotClients
All the started SOCRobotClient s. |
Constructor Summary | |
---|---|
protected |
SOCLocalRobotClient(SOCRobotClient rc)
|
Method Summary | |
---|---|
static void |
createAndStartRobotClientThread(java.lang.String rname,
java.lang.String strSocketName,
int port,
java.lang.String cookie)
Create and start a robot client within a SOCLocalRobotClient thread. |
void |
run()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.util.Hashtable<java.lang.String,SOCRobotClient> robotClients
SOCRobotClient
s. Key is the bot nickname.
Note: If a bot is disconnected from the server, it's not
removed from this list, because the same bot will try to reconnect.
To see if a bot is connected, check SOCServer.robots
instead.
final SOCRobotClient rob
robotClients
.
Constructor Detail |
---|
protected SOCLocalRobotClient(SOCRobotClient rc)
Method Detail |
---|
public void run()
run
in interface java.lang.Runnable
public static void createAndStartRobotClientThread(java.lang.String rname, java.lang.String strSocketName, int port, java.lang.String cookie) throws java.lang.ClassNotFoundException, java.lang.LinkageError
SOCLocalRobotClient
thread.
After creating it, yield
the current thread and then sleep
75 milliseconds, to give the robot time to start itself up.
The SOCPlayerLocalRobotRunner's run() will add the SOCRobotClient
to robotClients
.
rname
- Name of robotstrSocketName
- Server's stringport socket name, or nullport
- Server's tcp port, if strSocketName is nullcookie
- Cookie for robot connections to server
java.lang.ClassNotFoundException
- if a robot class, or SOCDisplaylessClient,
can't be loaded. This can happen due to packaging of the server-only JAR.
java.lang.LinkageError
- for same reason as ClassNotFoundExceptionSOCServer.setupLocalRobots(int, int)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |