8#include <steamclient/network/cmclient.hpp>
34 SteamClient(std::unique_ptr<Steam::Networking::IConnection> connection,
35 boost::asio::io_context& ctx);
74 template <
typename Type,
typename Fn>
75 void on(Fn&& callback) {
76 network_->template
on<Type>(std::forward<Fn>(callback));
92 template <
typename Request>
94 network_->execute(req);
100 std::unique_ptr<Steam::Messaging::CMClient> network_;
void execute(const Request &req)
Send a command to the Steam CM server.
Definition client.hpp:93
void on(Fn &&callback)
Registers a callback for a specific CMClient event.
Definition client.hpp:75
~SteamClient()
Destructor Ensures the client disconnects from CM servers before destruction.
SteamClient(std::unique_ptr< Steam::Networking::IConnection > connection, boost::asio::io_context &ctx)
Construct a Steam client using a specific connection implementation.
bool is_connected() const
Check whether the client is currently connected.
void disconnect()
Disconnect from the current Steam CM server session.
void connect()
Establish a session with a Steam CM server.
Abstract transport interface used by the Steam networking layer.