8#include <steamclient/network/cmclient.hpp>
34 SteamClient(std::unique_ptr<Steam::Networking::IConnection> connection);
73 template <
typename Type,
typename Fn>
74 void on(Fn&& callback) {
75 network_->template
on<Type>(std::forward<Fn>(callback));
91 template <
typename Request>
93 network_->execute(req);
99 std::unique_ptr<Steam::Messaging::CMClient> network_;
void execute(const Request &req)
Send a command to the Steam CM server.
Definition client.hpp:92
void on(Fn &&callback)
Registers a callback for a specific CMClient event.
Definition client.hpp:74
~SteamClient()
Destructor Ensures the client disconnects from CM servers before destruction.
SteamClient(std::unique_ptr< Steam::Networking::IConnection > connection)
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.