public abstract class CMClient extends Object
SteamClient
class.Modifier and Type | Field and Description |
---|---|
private EUniverse |
connectedUniverse
The universe.
|
(package private) Connection |
connection |
(package private) boolean |
encrypted |
(package private) ScheduledFunction |
heartBeatFunc |
(package private) short |
PortCM_Public |
(package private) short |
PortCM_PublicEncrypted |
(package private) Map<EServerType,List<IPEndPoint>> |
serverMap |
static InetAddress[] |
Servers
Bootstrap list of CM servers.
|
private Integer |
sessionId
The session ID.
|
private SteamID |
steamId
The SteamID.
|
(package private) byte[] |
tempSessionKey |
Constructor and Description |
---|
CMClient() |
CMClient(ProtocolType type)
Initializes a new instance of the
CMClient class with a specific connection type. |
Modifier and Type | Method and Description |
---|---|
void |
connect() |
void |
connect(boolean bEncrypted)
Connects this client to a Steam3 server.
|
void |
disconnect()
Disconnects this client.
|
InetAddress |
getLocalIP()
Returns the the local IP of this client.
|
(package private) static IPacketMsg |
getPacketMsg(byte[] data) |
List<IPEndPoint> |
getServersOfType(EServerType type)
Returns the list of servers matching the given type
|
(package private) void |
handleEncryptRequest(IPacketMsg packetMsg) |
(package private) void |
handleEncryptResult(IPacketMsg packetMsg) |
(package private) void |
handleLoggedOff(IPacketMsg packetMsg) |
(package private) void |
handleLogOnResponse(IPacketMsg packetMsg) |
(package private) void |
handleMulti(IPacketMsg packetMsg) |
(package private) void |
handleServerList(IPacketMsg packetMsg) |
protected abstract void |
onClientConnected()
Called when the client is connected to Steam3 and is ready to send messages.
|
protected abstract void |
onClientDisconnected()
Called when the client is physically disconnected from Steam3.
|
protected void |
onClientMsgReceived(IPacketMsg packetMsg)
Called when a client message is received from the network.
|
void |
send(IClientMsg msg)
Sends the specified client message to the server.
|
final short PortCM_PublicEncrypted
final short PortCM_Public
public static final InetAddress[] Servers
private EUniverse connectedUniverse
private Integer sessionId
private SteamID steamId
Connection connection
byte[] tempSessionKey
boolean encrypted
ScheduledFunction heartBeatFunc
Map<EServerType,List<IPEndPoint>> serverMap
public CMClient()
public CMClient(ProtocolType type)
CMClient
class with a specific connection type.type
- The connection type to use.UnsupportedOperationException
- The provided ProtocolType
is not supported. Only Tcp and Udp are available.public InetAddress getLocalIP()
public void connect()
public void connect(boolean bEncrypted)
ConnectedCallback
bEncrypted
- If set to true the underlying connection to Steam will be encrypted. This is the default mode of communication. Previous versions of SteamKit always used encryption.public void disconnect()
public void send(IClientMsg msg)
msg
- The client message to send.public List<IPEndPoint> getServersOfType(EServerType type)
type
- Server type requestedprotected void onClientMsgReceived(IPacketMsg packetMsg) throws IOException
packetMsg
- The packet message.IOException
protected abstract void onClientDisconnected()
protected abstract void onClientConnected()
static IPacketMsg getPacketMsg(byte[] data)
void handleMulti(IPacketMsg packetMsg) throws IOException
IOException
void handleLogOnResponse(IPacketMsg packetMsg)
void handleEncryptRequest(IPacketMsg packetMsg)
void handleEncryptResult(IPacketMsg packetMsg)
void handleLoggedOff(IPacketMsg packetMsg)
void handleServerList(IPacketMsg packetMsg)
Copyright © 2012. All Rights Reserved.