1use derive_new::new;
2use serde::{Deserialize, Serialize};
3
4use crate::generated::enums::*;
5use crate::{DeserializableBytes, MessageBodyExt, SerializableBytes};
6
7pub trait HasEMsg {
8 fn emsg() -> EMsg;
10 fn create() -> Self;
11}
12
13#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
14struct MsgClientJustStrings;
15
16#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
17#[repr(packed)]
18pub struct MsgClientGenericResponse {
19 result: EResult,
20}
21
22#[linked_emsg(EMsg::ChannelEncryptRequest)]
23#[derive(new, Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
24#[repr(packed)]
25pub struct MsgChannelEncryptRequest {
26 #[new(value = "1")]
27 pub protocol_version: u32,
28 #[new(value = "EUniverse::Public")]
29 pub universe: EUniverse,
30}
31
32#[linked_emsg(EMsg::ChannelEncryptResponse)]
33#[derive(new, Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
34#[repr(packed)]
35pub struct MsgChannelEncryptResponse {
36 #[new(value = "1")]
37 protocol_version: u32,
38 #[new(value = "128")]
39 key_size: u32,
40}
41
42#[linked_emsg(EMsg::ChannelEncryptResult)]
43#[derive(new, Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
44#[repr(packed)]
45pub struct MsgChannelEncryptResult {
46 #[new(value = "EResult::Invalid")]
47 pub result: EResult,
48}
49
50#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
51#[repr(packed)]
52pub struct MsgClientNewLoginKey {
53 unique_id: u32,
54 login_key: [u8; 20],
55}
56
57#[linked_emsg(EMsg::ClientNewLoginKeyAccepted)]
58#[derive(new, Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
59#[repr(packed)]
60pub struct MsgClientNewLoginKeyAccepted {
61 #[new(default)]
62 unique_id: u32,
63}
64
65#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
66#[repr(packed)]
67pub struct MsgClientLogon {
68 obfuscation_mask: u32,
69 current_protocol: u32,
70 protocol_ver_major_mask: u32,
71 protocol_ver_minor_mask: u32,
72 protocol_ver_minor_min_game_servers: u16,
73 protocol_ver_minor_min_for_supporting_e_msg_multi: u16,
74 protocol_ver_minor_min_for_supporting_e_msg_client_encrypt_pct: u16,
75 protocol_ver_minor_min_for_extended_msg_hdr: u16,
76 protocol_ver_minor_min_for_cell_id: u16,
77 protocol_ver_minor_min_for_session_id_last: u16,
78 protocol_ver_minor_min_for_server_availablity_msgs: u16,
79 protocol_ver_minor_min_clients: u16,
80 protocol_ver_minor_min_for_os_type_: u16,
81 protocol_ver_minor_min_for_ceg_apply_pe_sig: u16,
82 protocol_ver_minor_min_for_marketing_messages_2: u16,
83 protocol_ver_minor_min_for_any_proto_buf_messages: u16,
84 protocol_ver_minor_min_for_proto_buf_logged_off_message: u16,
85 protocol_ver_minor_min_for_proto_buf_multi_messages: u16,
86 protocol_ver_minor_min_for_sending_protocol_to_ufs: u16,
87 protocol_ver_minor_min_for_machine_auth: u16,
88 protocol_ver_minor_min_for_session_id_last_anon: u16,
89 protocol_ver_minor_min_for_enhanced_app_list: u16,
90 protocol_ver_minor_min_for_steam_guard_notification_ui: u16,
91 protocol_ver_minor_min_for_proto_buf_service_module_calls: u16,
92 protocol_ver_minor_min_for_gzip_multi_messages: u16,
93 protocol_ver_minor_min_for_new_voice_call_authorize: u16,
94 protocol_ver_minor_min_for_client_instance_i_ds: u16,
95}
96
97#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
98#[repr(packed)]
99pub struct MsgClientVACBanStatus {
100 num_bans: u32,
101}
102
103#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
104#[repr(packed)]
105pub struct MsgClientAppUsageEvent {
106 app_usage_event: EAppUsageEvent,
107 game_id: u64,
108 offline: u16,
109}
110
111#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
112#[repr(packed)]
113pub struct MsgClientEmailAddrInfo {
114 password_strength: u32,
115 flags_account_security_policy: u32,
116 validated: u8,
117}
118
119#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
120#[repr(packed)]
121pub struct MsgClientUpdateGuestPassesList {
122 result: EResult,
123 count_guest_passes_to_give: i32,
124 count_guest_passes_to_redeem: i32,
125}
126
127#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
128#[repr(packed)]
129pub struct MsgClientRequestedClientStats {
130 count_stats: i32,
131}
132
133#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
142#[repr(packed)]
143pub struct MsgClientOGSBeginSession {
144 account_type_: u8,
145 account_id: u64,
146 app_id: u32,
147 time_started: u32,
148}
149
150#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
151#[repr(packed)]
152pub struct MsgClientOGSBeginSessionResponse {
153 result: EResult,
154 collecting_any: u8,
155 collecting_details: u8,
156 session_id: u64,
157}
158
159#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
160#[repr(packed)]
161pub struct MsgClientOGSEndSession {
162 session_id: u64,
163 time_ended: u32,
164 reason_code: i32,
165 count_attributes: i32,
166}
167
168#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
169#[repr(packed)]
170pub struct MsgClientOGSEndSessionResponse {
171 result: EResult,
172}
173
174#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
175#[repr(packed)]
176pub struct MsgClientOGSWriteRow {
177 session_id: u64,
178 count_attributes: i32,
179}
180
181#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
182#[repr(packed)]
183pub struct MsgClientGetFriendsWhoPlayGame {
184 game_id: u64,
185}
186
187#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
188#[repr(packed)]
189pub struct MsgClientGetFriendsWhoPlayGameResponse {
190 result: EResult,
191 game_id: u64,
192 count_friends: u32,
193}
194
195#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
196#[repr(packed)]
197pub struct MsgGSPerformHardwareSurvey {
198 flags: u32,
199}
200
201#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
202#[repr(packed)]
203pub struct MsgGSGetPlayStatsResponse {
204 result: EResult,
205 rank: i32,
206 lifetime_connects: u32,
207 lifetime_minutes_played: u32,
208}
209
210#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
211#[repr(packed)]
212pub struct MsgGSGetReputationResponse {
213 result: EResult,
214 reputation_score: u32,
215 banned: u8,
216 banned_ip: u32,
217 banned_port: u16,
218 banned_game_id: u64,
219 time_ban_expires: u32,
220}
221
222#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
223#[repr(packed)]
224pub struct MsgGSDeny {
225 steam_id: u64,
226 deny_reason: EDenyReason,
227}
228
229#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
230#[repr(packed)]
231pub struct MsgGSApprove {
232 steam_id: u64,
233}
234
235#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
236#[repr(packed)]
237pub struct MsgGSKick {
238 steam_id: u64,
239 deny_reason: EDenyReason,
240 wait_til_map_change: i32,
241}
242
243#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
244#[repr(packed)]
245pub struct MsgGSGetUserGroupStatus {
246 steam_id_user: u64,
247 steam_id_group: u64,
248}
249
250#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
251#[repr(packed)]
252pub struct MsgGSGetUserGroupStatusResponse {
253 steam_id_user: u64,
254 steam_id_group: u64,
255 clan_relationship: EClanRelationship,
256 clan_rank: EClanRank,
257}
258
259#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
260#[repr(packed)]
261pub struct MsgClientJoinChat {
262 steam_id_chat: u64,
263 is_voice_speaker: u8,
264}
265
266
267#[linked_emsg(EMsg::ClientChatEnter)]
268#[derive(new, Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
269#[repr(packed)]
270pub struct MsgClientChatEnter {
271 #[new(default)]
272 steam_id_chat: u64,
273 #[new(default)]
274 steam_id_friend: u64,
275 #[new(value = "EChatRoomType::Friend")]
276 chat_room_type_: EChatRoomType,
277 #[new(default)]
278 steam_id_owner: u64,
279 #[new(default)]
280 steam_id_clan: u64,
281 #[new(default)]
282 chat_flags: u8,
283 #[new(value = "EChatRoomEnterResponse::Success")]
284 enter_response: EChatRoomEnterResponse,
285 #[new(default)]
286 num_members: i32,
287}
288
289#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
290#[repr(packed)]
291pub struct MsgClientChatMsg {
292 steam_id_chatter: u64,
293 steam_id_chat_room: u64,
294 chat_msg_type_: EChatEntryType,
295}
296
297#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
298#[repr(packed)]
299pub struct MsgClientChatMemberInfo {
300 steam_id_chat: u64,
301 type_: EChatInfoType,
302}
303
304#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
305#[repr(packed)]
306pub struct MsgClientChatAction {
307 steam_id_chat: u64,
308 steam_id_user_to_act_on: u64,
309 chat_action: EChatAction,
310}
311
312#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
313#[repr(packed)]
314pub struct MsgClientChatActionResult {
315 steam_id_chat: u64,
316 steam_id_user_acted_on: u64,
317 chat_action: EChatAction,
318 action_result: EChatActionResult,
319}
320
321#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
322#[repr(packed)]
323pub struct MsgClientChatRoomInfo {
324 steam_id_chat: u64,
325 type_: EChatInfoType,
326}
327
328#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
329#[repr(packed)]
330pub struct MsgClientSetIgnoreFriend {
331 my_steam_id: u64,
332 steam_id_friend: u64,
333 ignore: u8,
334}
335
336#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
337#[repr(packed)]
338pub struct MsgClientSetIgnoreFriendResponse {
339 friend_id: u64,
340 result: EResult,
341}
342
343#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
344#[repr(packed)]
345pub struct MsgClientLoggedOff {
346 result: EResult,
347 sec_min_reconnect_hint: i32,
348 sec_max_reconnect_hint: i32,
349}
350
351#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
352#[repr(packed)]
353pub struct MsgClientLogOnResponse {
354 result: EResult,
355 out_of_game_heartbeat_rate_sec: i32,
356 in_game_heartbeat_rate_sec: i32,
357 client_supplied_steam_id: u64,
358 ip_public: u32,
359 server_real_time: u32,
360}
361
362#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
363#[repr(packed)]
364pub struct MsgClientSendGuestPass {
365 gift_id: u64,
366 gift_type_: u8,
367 account_id: u32,
368}
369
370#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
371#[repr(packed)]
372pub struct MsgClientSendGuestPassResponse {
373 result: EResult,
374}
375
376#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
377#[repr(packed)]
378pub struct MsgClientServerUnavailable {
379 jobid_sent: u64,
380 e_msg_sent: u32,
381 e_server_type_unavailable: EServerType,
382}
383
384#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
385#[repr(packed)]
386pub struct MsgClientCreateChat {
387 chat_room_type_: EChatRoomType,
388 game_id: u64,
389 steam_id_clan: u64,
390 permission_officer: EChatPermission,
391 permission_member: EChatPermission,
392 permission_all: EChatPermission,
393 members_max: u32,
394 chat_flags: u8,
395 steam_id_friend_chat: u64,
396 steam_id_invited: u64,
397}
398
399#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
400#[repr(packed)]
401pub struct MsgClientCreateChatResponse {
402 result: EResult,
403 steam_id_chat: u64,
404 chat_room_type_: EChatRoomType,
405 steam_id_friend_chat: u64,
406}
407
408#[derive(Clone, Copy, Eq, PartialEq, Debug, Serialize, Deserialize, SteamMsg)]
409#[repr(packed)]
410pub struct MsgClientMarketingMessageUpdate2 {
411 marketing_message_update_time: u32,
412 count: u32,
413}