SteamClient

class SteamClient @JvmOverloads constructor(configuration: SteamConfiguration? = SteamConfiguration.createDefault()) : CMClient

Represents a single client that connects to the Steam3 network. This class is also responsible for handling the registration of client message handlers and callbacks.

Parameters

configuration

The configuration to use for this client.

Constructors

Link copied to clipboard
constructor(configuration: SteamConfiguration? = SteamConfiguration.createDefault())

Initializes a new instance of the SteamClient class with a specific configuration.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Handler used for authenticating on Steam.

Link copied to clipboard
val cellID: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Adds a new handler to the internal list of message handlers.

Link copied to clipboard
open fun connect()

Connects this client to a Steam3 server. This begins the process of connecting and encrypting the data channel between the client and the server. Results are returned asynchronously in a 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.

open fun connect(cmServer: ServerRecord)

Connects this client to a Steam3 server. This begins the process of connecting and encrypting the data channel between the client and the server. Results are returned asynchronously in a 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.

Link copied to clipboard
open fun disconnect()

Disconnects this client.

Link copied to clipboard

Gets the next callback object in the queue, and removes it.

Link copied to clipboard

Gets or sets the connection timeout used when connecting to the Steam server.

Link copied to clipboard

Returns the current endpoint this client is connected to.

Link copied to clipboard
fun <T : ClientMsgHandler> getHandler(type: Class<T>): T?

Returns a registered handler.

Link copied to clipboard

Returns the local IP of this client.

Link copied to clipboard

Returns the next available JobID for job based messages.

Link copied to clipboard

open fun getServers(type: EServerType): MutableList<InetSocketAddress>

Returns the list of servers matching the given type

Link copied to clipboard
open fun getUniverse(): EUniverse

Gets the universe of this client.

Link copied to clipboard
open fun isConnected(): Boolean

Gets a value indicating whether this instance is isConnected to the remote CM server.

Link copied to clipboard

Posts a callback to the queue. This is normally used directly by client message handlers.

Link copied to clipboard

Removes a registered handler.

Removes a registered handler by name.

Link copied to clipboard
open fun send(msg: IClientMsg)

Sends the specified client message to the server. This method automatically assigns the correct SessionID and SteamID of the message.

Link copied to clipboard
fun startJob(job: AsyncJob)
Link copied to clipboard

Blocks the calling thread until a callback object is posted to the queue, and removes it.

Blocks the calling thread until a callback object is posted to the queue, or null after the timeout has elapsed.

Link copied to clipboard

Asynchronously awaits until a callback object is posted to the queue, and removes it.