|
steam-min-cpp
|
Public Member Functions | |
Construction and Destruction | |
Client lifetime management. | |
| SteamClient (std::unique_ptr< Steam::Networking::IConnection > connection, boost::asio::io_context &ctx) | |
| Construct a Steam client using a specific connection implementation. | |
| ~SteamClient () | |
| Destructor Ensures the client disconnects from CM servers before destruction. | |
Connection Management | |
Establishing and terminating CM sessions. | |
| void | connect () |
| Establish a session with a Steam CM server. | |
| void | disconnect () |
| Disconnect from the current Steam CM server session. | |
| bool | is_connected () const |
| Check whether the client is currently connected. | |
Event System | |
Register callbacks for events emitted by the CM client. | |
| template<typename Type, typename Fn> | |
| void | on (Fn &&callback) |
| Registers a callback for a specific CMClient event. | |
Command Execution | |
Sending requests to the Steam CM server. | |
| template<typename Request> | |
| void | execute (const Request &req) |
| Send a command to the Steam CM server. | |
| Steam::SteamClient::SteamClient | ( | std::unique_ptr< Steam::Networking::IConnection > | connection, |
| boost::asio::io_context & | ctx ) |
Construct a Steam client using a specific connection implementation.
| connection | Connection backend used for communicating with Steam CM servers. |
|
inline |
Send a command to the Steam CM server.
Routes a request object through the underlying CMClient command dispatcher. Most commands produce a response message, which can be handled by registering an event listener with on.
| Request | Type representing the CM request message. |
| req | Request structure to send to the server. |
| bool Steam::SteamClient::is_connected | ( | ) | const |
Check whether the client is currently connected.
|
inline |
Registers a callback for a specific CMClient event.
Subscribes a handler to the underlying CMClient dispatch system. The callback will be invoked whenever an event of type Event is emitted by the internal network client.
| Type | Event type to listen for. |
| Fn | Callable type used as the event handler. |
| callback | Callable invoked when the specified event occurs. The callable should accept the emitted event object. |