public class SteamClient extends CMClient
| Constructor and Description |
|---|
SteamClient()
Initializes a new instance of the
SteamClient class with the default configuration. |
SteamClient(SteamConfiguration configuration)
Initializes a new instance of the
SteamClient class with a specific configuration. |
| Modifier and Type | Method and Description |
|---|---|
void |
addHandler(ClientMsgHandler handler)
Adds a new handler to the internal list of message handlers.
|
void |
freeLastCallback()
Frees the last callback in the queue.
|
java.util.List<ICallbackMsg> |
getAllCallbacks(boolean freeLast,
long timeout)
Blocks the calling thread until the queue contains a callback object.
|
ICallbackMsg |
getCallback()
Gets the next callback object in the queue.
|
ICallbackMsg |
getCallback(boolean freeLast)
Gets the next callback object in the queue, and optionally frees it.
|
<T extends ClientMsgHandler> |
getHandler(java.lang.Class<T> type)
Returns a registered handler.
|
in.dragonbra.javasteam.steam.steamclient.AsyncJobManager |
getJobManager() |
JobID |
getNextJobID()
Returns the next available JobID for job based messages.
|
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 |
postCallback(CallbackMsg msg)
Posts a callback to the queue.
|
void |
removeHandler(java.lang.Class<? extends ClientMsgHandler> handler)
Removes a registered handler by name.
|
void |
removeHandler(ClientMsgHandler handler)
Removes a registered handler.
|
void |
startJob(in.dragonbra.javasteam.types.AsyncJob job) |
ICallbackMsg |
waitForCallback()
Blocks the calling thread until a callback object is posted to the queue.
|
ICallbackMsg |
waitForCallback(boolean freeLast)
Blocks the calling thread until a callback object is posted to the queue, and optionally frees it.
|
ICallbackMsg |
waitForCallback(boolean freeLast,
long timeout)
Blocks the calling thread until a callback object is posted to the queue, and optionally frees it.
|
ICallbackMsg |
waitForCallback(long timeout)
Blocks the calling thread until a callback object is posted to the queue, or null after the timeout has elapsed.
|
connect, connect, disconnect, getCellID, getConfiguration, getConnectionTimeout, getCurrentEndpoint, getDebugNetworkListener, getLocalIP, getPacketMsg, getServers, getServers, getSessionID, getSessionToken, getSteamID, getUniverse, isConnected, isExpectDisconnection, send, setDebugNetworkListener, setExpectDisconnectionpublic SteamClient()
SteamClient class with the default configuration.public SteamClient(SteamConfiguration configuration)
SteamClient class with a specific configuration.configuration - The configuration to use for this client.public void addHandler(ClientMsgHandler handler)
handler - The handler to add.public void removeHandler(java.lang.Class<? extends ClientMsgHandler> handler)
handler - The handler name to remove.public void removeHandler(ClientMsgHandler handler)
handler - The handler name to remove.public <T extends ClientMsgHandler> T getHandler(java.lang.Class<T> type)
T - The type of the handler to cast to. Must derive from ClientMsgHandler.type - The type of the handler to cast to. Must derive from ClientMsgHandler.public ICallbackMsg getCallback()
public ICallbackMsg getCallback(boolean freeLast)
freeLast - if set to true this function also frees the last callback if one existed.public ICallbackMsg waitForCallback()
public ICallbackMsg waitForCallback(long timeout)
timeout - The length of time to block in ms.public ICallbackMsg waitForCallback(boolean freeLast)
freeLast - if set to true this function also frees the last callback if one existed.public ICallbackMsg waitForCallback(boolean freeLast, long timeout)
freeLast - if set to true this function also frees the last callback if one existed.timeout - The length of time to block.public java.util.List<ICallbackMsg> getAllCallbacks(boolean freeLast, long timeout)
freeLast - if set to true this function also frees all callbacks.timeout - The length of time to block.public void freeLastCallback()
public void postCallback(CallbackMsg msg)
msg - The message.public JobID getNextJobID()
public void startJob(in.dragonbra.javasteam.types.AsyncJob job)
public in.dragonbra.javasteam.steam.steamclient.AsyncJobManager getJobManager()
protected boolean onClientMsgReceived(IPacketMsg packetMsg)
onClientMsgReceived in class CMClientprotected void onClientConnected()
CMClientonClientConnected in class CMClientprotected void onClientDisconnected(boolean userInitiated)
CMClientonClientDisconnected in class CMClientuserInitiated - whether the disconnect was initialized by the client