|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--wtanaka.praya.Protocol
|
+--wtanaka.praya.bnet.BnetClient
Main battle.net client class.
Return to
or the Praya Homepage
| Field Summary | |
static java.lang.String |
AWAY
|
private java.net.Socket |
clientSocket
|
static int |
CONF_CHANNEL
|
static int |
CONF_ITEM_COUNT
|
static int |
CONF_PASSWD
|
static int |
CONF_SERVER
|
static int |
CONF_STATUS
|
static int |
CONF_USERNAME
|
static java.lang.String |
DEFAULT_USERNAME
|
private static int |
floodTimeout
|
(package private) java.util.Vector |
infoLines
|
private long |
lastCommandTime
|
private boolean |
lastLineWasUserLine
|
private long |
lastTimeSent
|
private ConfigItem[] |
m_configItems
|
private int |
m_port
Port to connect to (default to 6112) |
private long |
millisecsPerCharacter
|
static java.lang.String |
OFFLINE
|
static java.lang.String |
ONLINE
|
static java.lang.String[] |
s_statusList
|
private java.io.BufferedReader |
socketInput
|
private java.io.PrintWriter |
socketOutput
|
private java.util.Vector |
userTypeVector
|
private java.util.Vector |
userVector
|
| Fields inherited from class wtanaka.praya.Protocol |
descriptionListeners, iAmGarbage, m_buddyList, m_configPanel, m_currentDescription, m_messageListeners, recipientListeners |
| Constructor Summary | |
BnetClient()
Constructor to make praya happy, since Protocols are constructed with newInstance |
|
BnetClient(java.lang.String username,
java.lang.String password)
Constructor |
|
BnetClient(java.lang.String username,
java.lang.String password,
java.lang.String hostname,
int port)
Constructor |
|
| Method Summary | |
void |
checkForNewMessages(boolean a)
Checks for new messages on the protocol. |
private void |
collectInfoLine(java.lang.String unQuotedInfoLine)
|
void |
connect()
Connects to the network, if that makes any sense. |
CommandInterface[] |
consoleCommands()
Returns a list of commands available through this console. |
void |
disconnect()
Disconnects from the network, if that makes any sense. |
ConfigItem[] |
getConfiguration()
|
java.lang.String |
getCurrentChannel()
Returns the current channel for the user. |
Recipient |
getDefaultRecipient()
|
static java.awt.Image |
getIcon()
|
ProtoObj |
getObjInstance(NormalFolder root)
Returns the sole instance of the ProtoObj for this protocol instance, creating a new one if necessary. |
java.lang.String |
getPassword()
|
int |
getPort()
|
static java.lang.String |
getProtocolDescription()
Used to describe the class of this protocol, before any instances have been created. |
java.lang.String |
getServer()
|
java.lang.String |
getUsername()
|
private void |
initConfigItems()
|
boolean |
isConnected()
Returns if the protocol is connected right now. |
void |
joinChannel(java.lang.String channelName)
|
private void |
parseServerLine(java.lang.String line)
|
private void |
readConfigFromFile()
Reads .praya/bnetrc |
void |
run()
|
private void |
sendImmediate(java.lang.String command)
|
private void |
sendInfoLine()
|
void |
sendToChannel(java.lang.String textToSend)
|
void |
sendToUser(java.lang.String username,
java.lang.String textToSend)
|
private void |
sendWaitingMesasges()
|
private void |
sendWithNoFlood(java.lang.String command)
|
void |
setAwayMessage(java.lang.String awayMsg)
|
void |
setCurrentChannel(java.lang.String channel)
Sets the current channel |
void |
setMillisecondsPerCharacter(long milsPerChar)
Sets typing speed in milliseconds per character |
void |
setPassword(java.lang.String pass)
|
void |
setPort(int port)
|
void |
setServer(java.lang.String server)
|
void |
setStatus(Status status)
Sets the currently connected user's status to the given status. |
void |
setUnAway()
|
void |
setUsername(java.lang.String s)
|
private java.lang.String |
unQuote(java.lang.String line)
|
private void |
updateCurrentDescription()
|
| Methods inherited from class java.lang.Object |
|
| Field Detail |
public static final int CONF_USERNAME
public static final int CONF_PASSWD
public static final int CONF_SERVER
public static final int CONF_STATUS
public static final int CONF_CHANNEL
public static final int CONF_ITEM_COUNT
public static final java.lang.String ONLINE
public static final java.lang.String OFFLINE
public static final java.lang.String AWAY
public static final java.lang.String[] s_statusList
public static final java.lang.String DEFAULT_USERNAME
private ConfigItem[] m_configItems
private java.net.Socket clientSocket
private java.io.PrintWriter socketOutput
private java.io.BufferedReader socketInput
private int m_port
private static final int floodTimeout
private long millisecsPerCharacter
private long lastTimeSent
private long lastCommandTime
private boolean lastLineWasUserLine
private java.util.Vector userVector
private java.util.Vector userTypeVector
java.util.Vector infoLines
| Constructor Detail |
public BnetClient()
public BnetClient(java.lang.String username,
java.lang.String password)
public BnetClient(java.lang.String username,
java.lang.String password,
java.lang.String hostname,
int port)
| Method Detail |
private final void initConfigItems()
private void readConfigFromFile()
public void connect()
throws java.io.IOException
Protocolconnect in class Protocoljava.io.IOException - if the socket cannot be created.public void disconnect()
Protocoldisconnect in class Protocolpublic boolean isConnected()
ProtocolisConnected in class Protocolpublic ConfigItem[] getConfiguration()
getConfiguration in class Protocolwtanaka.praya.Protocolprivate void updateCurrentDescription()
public void setServer(java.lang.String server)
public java.lang.String getServer()
public void setPort(int port)
public int getPort()
public void setUsername(java.lang.String s)
public java.lang.String getUsername()
public void setPassword(java.lang.String pass)
public java.lang.String getPassword()
public java.lang.String getCurrentChannel()
public void setCurrentChannel(java.lang.String channel)
public void setMillisecondsPerCharacter(long milsPerChar)
private void sendImmediate(java.lang.String command)
throws java.io.IOException
private void sendWithNoFlood(java.lang.String command)
public void joinChannel(java.lang.String channelName)
throws java.io.IOException
public void setUnAway()
throws java.io.IOException
public void setAwayMessage(java.lang.String awayMsg)
throws java.io.IOException
public void sendToChannel(java.lang.String textToSend)
throws java.io.IOException
public void sendToUser(java.lang.String username,
java.lang.String textToSend)
throws java.io.IOException
public void setStatus(Status status)
throws java.io.IOException
ProtocolsetStatus in class Protocolprivate java.lang.String unQuote(java.lang.String line)
private void sendWaitingMesasges()
private void collectInfoLine(java.lang.String unQuotedInfoLine)
private void sendInfoLine()
private void parseServerLine(java.lang.String line)
public CommandInterface[] consoleCommands()
ProtocolconsoleCommands in class Protocolpublic void run()
run in interface java.lang.Runnablepublic ProtoObj getObjInstance(NormalFolder root)
ProtocolgetObjInstance in class Protocolpublic void checkForNewMessages(boolean a)
ProtocolcheckForNewMessages in class Protocolwtanaka.praya.ProtocolisAutomatic - true if the check is generated automatically with a
timer. false if the check is generated manually by the user.public Recipient getDefaultRecipient()
getDefaultRecipient in class Protocolpublic static java.lang.String getProtocolDescription()
Protocolpublic static java.awt.Image getIcon()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||