|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.cuni.pogamut.Parser.GameBotConnection
public class GameBotConnection
Merely a wrapper for the GameBots2004 socket, which implements sending, closing and handling exceptions.
Nested Class Summary | |
---|---|
private class |
GameBotConnection.BufferedReaderForLog
This class is used to dump the raw data from GameBots. |
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_ADDRESS
Default address for connection ... localhost |
static int |
DEFAULT_PORT
Default port for connection ... localhost |
protected java.io.BufferedReader |
input
|
private java.util.logging.Logger |
log
|
private java.io.PrintWriter |
output
|
private java.util.logging.Logger |
rawDataLog
|
private GameBotConnection.BufferedReaderForLog |
readerForLog
|
protected java.net.InetAddress |
serverAddress
InetAddress used by the connection (remote side) |
protected int |
serverPort
Remote port of the connection. |
private java.net.Socket |
socket
|
static int |
SOCKET_TIMEOUT
|
Constructor Summary | |
---|---|
GameBotConnection()
Inicialize class. |
|
GameBotConnection(java.lang.String netAddress)
Inicialize class. |
|
GameBotConnection(java.lang.String netAddress,
int port)
Inicialize class. |
|
GameBotConnection(java.lang.String netAddress,
int port,
java.util.logging.Logger log)
Inicialize class. |
|
GameBotConnection(java.lang.String netAddress,
int port,
java.util.logging.Logger log,
java.util.logging.Logger rawDataLog)
Inicialize class. |
|
GameBotConnection(java.lang.String netAddress,
java.util.logging.Logger rawDataLog)
Inicialize class. |
Method Summary | |
---|---|
void |
close()
Clean up stuff. |
void |
connect()
Connect to Unreal Server with installed GameBot using parametr from constructor. |
java.util.logging.Logger |
getRawDataLog()
|
boolean |
isConnected()
Is class connected to GameBots? |
void |
send(java.lang.String msg)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_ADDRESS
public static final int DEFAULT_PORT
public static final int SOCKET_TIMEOUT
protected java.net.InetAddress serverAddress
protected int serverPort
private java.net.Socket socket
protected java.io.BufferedReader input
private java.io.PrintWriter output
private java.util.logging.Logger log
private java.util.logging.Logger rawDataLog
private GameBotConnection.BufferedReaderForLog readerForLog
Constructor Detail |
---|
public GameBotConnection(java.lang.String netAddress, int port, java.util.logging.Logger log) throws java.net.UnknownHostException
netAddress
- network address, where is running UT2004 server with GameBotsport
- port, where GameBots listen
java.net.UnknownHostException
- if passed hostname/ip address doesnt exists, throw exceptionpublic GameBotConnection(java.lang.String netAddress, int port, java.util.logging.Logger log, java.util.logging.Logger rawDataLog) throws java.net.UnknownHostException
netAddress
- network address, where is running UT2004 server with GameBotsport
- port, where GameBots listen
java.net.UnknownHostException
- if passed hostname/ip address doesnt exists, throw exceptionpublic GameBotConnection(java.lang.String netAddress, int port) throws java.net.UnknownHostException
netAddress
- network address, where is running UT2004 server with GameBotsport
- port, where GameBots listen
java.net.UnknownHostException
- if passed hostname/ip address doesnt exists, throw exceptionpublic GameBotConnection(java.lang.String netAddress) throws java.net.UnknownHostException
netAddress
- network address, where is running UT2004 server with GameBots
java.net.UnknownHostException
- if passed hostname/ip address doesnt exists, throw exceptionpublic GameBotConnection(java.lang.String netAddress, java.util.logging.Logger rawDataLog) throws java.net.UnknownHostException
netAddress
- network address, where is running UT2004 server with GameBots
java.net.UnknownHostException
- if passed hostname/ip address doesnt exists, throw exceptionpublic GameBotConnection() throws java.net.UnknownHostException
java.net.UnknownHostException
- if passed hostname/ip address doesnt exists, throw exceptionMethod Detail |
---|
public java.util.logging.Logger getRawDataLog()
public void connect() throws ConnectException
ConnectException
If
- socket can't be created, throw IOExceptionpublic void close() throws CantCloseConnectionException
CantCloseConnectionException
public boolean isConnected()
public void send(java.lang.String msg) throws CantWriteException
CantWriteException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |