public abstract class CMClient
extends java.lang.Object
SteamClient class.| Constructor and Description |
|---|
CMClient(SteamConfiguration configuration) |
| Modifier and Type | Method and Description |
|---|---|
void |
connect()
Connects this client to a Steam3 server.
|
void |
connect(ServerRecord cmServer)
Connects this client to a Steam3 server.
|
void |
disconnect()
Disconnects this client.
|
java.lang.Integer |
getCellID() |
SteamConfiguration |
getConfiguration() |
long |
getConnectionTimeout()
Gets or sets the connection timeout used when connecting to the Steam server.
|
java.net.InetSocketAddress |
getCurrentEndpoint()
Returns the current endpoint this client is connected to.
|
IDebugNetworkListener |
getDebugNetworkListener() |
java.net.InetAddress |
getLocalIP()
Returns the local IP of this client.
|
static IPacketMsg |
getPacketMsg(byte[] data) |
SmartCMServerList |
getServers() |
java.util.List<java.net.InetSocketAddress> |
getServers(EServerType type)
Returns the list of servers matching the given type
|
java.lang.Integer |
getSessionID()
Gets the session ID of this client.
|
long |
getSessionToken() |
SteamID |
getSteamID()
Gets the SteamID of this client.
|
EUniverse |
getUniverse()
Gets the universe of this client.
|
boolean |
isConnected()
Gets a value indicating whether this instance is isConnected to the remote CM server.
|
boolean |
isExpectDisconnection() |
protected void |
onClientConnected()
Called when the client is securely isConnected to Steam3.
|
protected void |
onClientDisconnected(boolean userInitiated)
Called when the client is physically disconnected from Steam3.
|
protected boolean |
onClientMsgReceived(IPacketMsg packetMsg) |
void |
send(IClientMsg msg)
Sends the specified client message to the server.
|
void |
setDebugNetworkListener(IDebugNetworkListener debugNetworkListener)
Sets the network listening interface.
|
void |
setExpectDisconnection(boolean expectDisconnection) |
public CMClient(SteamConfiguration configuration)
public void connect()
ConnectedCallback. If the
server that SteamKit attempts to connect to is down, a DisconnectedCallback will be posted instead.
SteamKit will not attempt to reconnect to Steam, you must handle this callback and call Connect again preferably
after a short delay. SteamKit will randomly select a CM server from its internal list.public void connect(ServerRecord cmServer)
ConnectedCallback. If the
server that SteamKit attempts to connect to is down, a DisconnectedCallback will be posted instead.
SteamKit will not attempt to reconnect to Steam, you must handle this callback and call Connect again preferably
after a short delay.cmServer - The ServerRecord of the CM server to connect to.public void disconnect()
public void send(IClientMsg msg)
msg - The client message to send.public java.util.List<java.net.InetSocketAddress> getServers(EServerType type)
type - Server type requestedprotected boolean onClientMsgReceived(IPacketMsg packetMsg)
protected void onClientConnected()
protected void onClientDisconnected(boolean userInitiated)
userInitiated - whether the disconnect was initialized by the clientpublic static IPacketMsg getPacketMsg(byte[] data)
public SteamConfiguration getConfiguration()
public SmartCMServerList getServers()
public java.net.InetAddress getLocalIP()
public java.net.InetSocketAddress getCurrentEndpoint()
public EUniverse getUniverse()
public boolean isConnected()
public long getSessionToken()
public java.lang.Integer getCellID()
public java.lang.Integer getSessionID()
public SteamID getSteamID()
public long getConnectionTimeout()
public IDebugNetworkListener getDebugNetworkListener()
NetHookNetworkListener class.public void setDebugNetworkListener(IDebugNetworkListener debugNetworkListener)
NetHookNetworkListener class.debugNetworkListener - the listenerpublic boolean isExpectDisconnection()
public void setExpectDisconnection(boolean expectDisconnection)