steam-min-cpp
Loading...
Searching...
No Matches
events.hpp
Go to the documentation of this file.
1
10
11#pragma once
12
13#include <cstdint>
15#include <string>
16
17
18namespace Steam::Messaging::Packets {
19class IPacketMsg;
20}
21
22namespace Steam::Events {
23
28struct Event {
29 virtual ~Event() = default;
30};
31
39 bool success;
40
42 std::string message;
43
45 static EventResult ok() { return {true, {}}; }
46
49 static EventResult fail(std::string msg) { return {false, std::move(msg)}; }
50};
51
57struct ResultEvent : Event {
60
61 ResultEvent() = default;
62 ResultEvent(EventResult r) : result(std::move(r)) {}
63
65 bool ok() const { return result.success; }
66
68 const std::string& what() const { return result.message; }
69};
70
75struct ChannelSecuredEvent : ResultEvent {
76 using ResultEvent::ResultEvent;
77};
78
83struct ClientLogonEvent : ResultEvent {
84 using ResultEvent::ResultEvent;
85
87 uint64_t steamid;
88
91
92 ClientLogonEvent(EventResult r, uint64_t s_id, int32_t c_sid)
93 : ResultEvent(std::move(r)), steamid(s_id), client_sessionid(c_sid) {}
94};
95
99struct MsgNotImplementedEvent : Event {
101 uint32_t emsg;
102
108
109 explicit MsgNotImplementedEvent(
110 uint32_t e, const Steam::Messaging::Packets::IPacketMsg* p)
111 : emsg(e), packet(p) {}
112};
113
117struct ProductInfoResult : Event {
121 uint32_t appid;
122
124 std::string sha;
125
128 };
129
133 uint32_t packageid;
134
136 std::string sha;
137
140 };
141
143 std::vector<ProductAppInfo> apps;
144
146 std::vector<ProductPackageInfo> packages;
147
148 explicit ProductInfoResult(std::vector<ProductAppInfo> a,
149 std::vector<ProductPackageInfo> p)
150 : apps(std::move(a)), packages(std::move(p)) {}
151};
152
153} // namespace Steam::Events
154
155namespace Steam::Commands {
156
158struct Command {
159 virtual ~Command() = default;
160};
161
166
169
176 uint32_t id;
177
179 uint64_t steamid;
180
183
188 uint64_t app_token = 0;
189
191 explicit GetProductInfo(uint32_t i, uint64_t s_id, int32_t c_sid)
192 : id(i), steamid(s_id), client_sessionid(c_sid) {}
193
195 explicit GetProductInfo(uint32_t i, uint64_t s_id, int32_t c_sid, uint64_t t)
196 : id(i), steamid(s_id), client_sessionid(c_sid), app_token(t) {}
197};
198} // namespace Steam::Commands
Definition packetbase.hpp:11
Request an anonymous Steam login.
Definition events.hpp:165
Request termination of the current Steam user session.
Definition events.hpp:168
Base type for commands sent to the Steam CM server.
Definition events.hpp:158
GetProductInfo(uint32_t i, uint64_t s_id, int32_t c_sid, uint64_t t)
Construct a request with an app token.
Definition events.hpp:195
uint32_t id
Target application ID.
Definition events.hpp:176
uint64_t app_token
Optional application access token.
Definition events.hpp:188
uint64_t steamid
SteamID associated with the current session.
Definition events.hpp:179
int32_t client_sessionid
Steam CM session identifier.
Definition events.hpp:182
GetProductInfo(uint32_t i, uint64_t s_id, int32_t c_sid)
Construct a request without an app token.
Definition events.hpp:191
Emitted when the channel encryption handshake completes.
Definition events.hpp:75
int32_t client_sessionid
Steam CM session identifier.
Definition events.hpp:90
uint64_t steamid
Authenticated SteamID for the session.
Definition events.hpp:87
Result information returned by operations.
Definition events.hpp:37
bool success
Indicates whether the operation succeeded.
Definition events.hpp:39
std::string message
Optional error or diagnostic message.
Definition events.hpp:42
static EventResult fail(std::string msg)
Construct a failure result.
Definition events.hpp:49
static EventResult ok()
Construct a successful result.
Definition events.hpp:45
Base type for all emitted events.
Definition events.hpp:28
const Steam::Messaging::Packets::IPacketMsg * packet
Raw packet associated with the message.
Definition events.hpp:107
uint32_t emsg
Numeric Steam message identifier.
Definition events.hpp:101
Application information entry.
Definition events.hpp:119
std::string sha
SHA hash representing the appinfo version.
Definition events.hpp:124
uint32_t appid
Application identifier.
Definition events.hpp:121
Steam::Utils::VDF::VDFNode appinfo
Parsed VDF metadata for the application.
Definition events.hpp:127
Package information entry.
Definition events.hpp:131
uint32_t packageid
Package identifier.
Definition events.hpp:133
Steam::Utils::VDF::VDFNode pkginfo
Parsed VDF metadata for the package.
Definition events.hpp:139
std::string sha
SHA hash representing the package version.
Definition events.hpp:136
std::vector< ProductPackageInfo > packages
Returned package metadata.
Definition events.hpp:146
std::vector< ProductAppInfo > apps
Returned application metadata.
Definition events.hpp:143
const std::string & what() const
Retrieve the failure message if present.
Definition events.hpp:68
bool ok() const
Check whether the operation succeeded.
Definition events.hpp:65
EventResult result
Result of the associated operation.
Definition events.hpp:59
Node in a VDF tree.
Definition vdf.hpp:40
Minimal representation and parser for Valve Data Format (VDF).