Skip to main content

steam_protos/messages/
friends.rs

1//! Friends-related protobuf messages
2
3use prost::Message;
4
5/// Friends list message
6#[derive(Clone, PartialEq, Message)]
7pub struct CMsgClientFriendsList {
8    #[prost(bool, optional, tag = "1")]
9    pub bincremental: Option<bool>,
10    #[prost(message, repeated, tag = "2")]
11    pub friends: Vec<cmsg_client_friends_list::Friend>,
12    #[prost(uint32, optional, tag = "3")]
13    pub max_friend_count: Option<u32>,
14    #[prost(uint32, optional, tag = "4")]
15    pub active_friend_count: Option<u32>,
16    #[prost(bool, optional, tag = "5")]
17    pub friends_limit_hit: Option<bool>,
18}
19
20pub mod cmsg_client_friends_list {
21    use prost::Message;
22
23    #[derive(Clone, PartialEq, Message)]
24    pub struct Friend {
25        #[prost(fixed64, optional, tag = "1")]
26        pub ulfriendid: Option<u64>,
27        #[prost(uint32, optional, tag = "2")]
28        pub efriendrelationship: Option<u32>,
29    }
30}
31
32/// Persona state message
33#[derive(Clone, PartialEq, Message)]
34pub struct CMsgClientPersonaState {
35    #[prost(uint32, optional, tag = "1")]
36    pub status_flags: Option<u32>,
37    #[prost(message, repeated, tag = "2")]
38    pub friends: Vec<cmsg_client_persona_state::Friend>,
39}
40
41pub mod cmsg_client_persona_state {
42    use prost::Message;
43
44    #[derive(Clone, PartialEq, Message)]
45    pub struct Friend {
46        #[prost(fixed64, optional, tag = "1")]
47        pub friendid: Option<u64>,
48        #[prost(uint32, optional, tag = "2")]
49        pub persona_state: Option<u32>,
50        #[prost(uint32, optional, tag = "3")]
51        pub game_played_app_id: Option<u32>,
52        #[prost(uint32, optional, tag = "4")]
53        pub game_server_ip: Option<u32>,
54        #[prost(uint32, optional, tag = "5")]
55        pub game_server_port: Option<u32>,
56        #[prost(uint32, optional, tag = "6")]
57        pub persona_state_flags: Option<u32>,
58        #[prost(uint32, optional, tag = "7")]
59        pub online_session_instances: Option<u32>,
60        #[prost(bool, optional, tag = "10")]
61        pub persona_set_by_user: Option<bool>,
62        #[prost(string, optional, tag = "15")]
63        pub player_name: Option<String>,
64        #[prost(uint32, optional, tag = "20")]
65        pub query_port: Option<u32>,
66        #[prost(fixed64, optional, tag = "25")]
67        pub steamid_source: Option<u64>,
68        #[prost(bytes = "vec", optional, tag = "31")]
69        pub avatar_hash: Option<Vec<u8>>,
70        #[prost(uint32, optional, tag = "45")]
71        pub last_logoff: Option<u32>,
72        #[prost(uint32, optional, tag = "46")]
73        pub last_logon: Option<u32>,
74        #[prost(uint32, optional, tag = "47")]
75        pub last_seen_online: Option<u32>,
76        #[prost(uint32, optional, tag = "50")]
77        pub clan_rank: Option<u32>,
78        #[prost(string, optional, tag = "55")]
79        pub game_name: Option<String>,
80        #[prost(fixed64, optional, tag = "56")]
81        pub gameid: Option<u64>,
82        #[prost(bytes = "vec", optional, tag = "60")]
83        pub game_data_blob: Option<Vec<u8>>,
84        #[prost(message, optional, tag = "64")]
85        pub clan_data: Option<ClanData>,
86        #[prost(string, optional, tag = "65")]
87        pub clan_tag: Option<String>,
88        #[prost(message, repeated, tag = "71")]
89        pub rich_presence: Vec<Kv>,
90        #[prost(fixed64, optional, tag = "72")]
91        pub broadcast_id: Option<u64>,
92        #[prost(fixed64, optional, tag = "73")]
93        pub game_lobby_id: Option<u64>,
94        #[prost(uint32, optional, tag = "74")]
95        pub watching_broadcast_accountid: Option<u32>,
96        #[prost(uint32, optional, tag = "75")]
97        pub watching_broadcast_appid: Option<u32>,
98        #[prost(uint32, optional, tag = "76")]
99        pub watching_broadcast_viewers: Option<u32>,
100        #[prost(string, optional, tag = "77")]
101        pub watching_broadcast_title: Option<String>,
102        #[prost(bool, optional, tag = "78")]
103        pub is_community_banned: Option<bool>,
104        #[prost(bool, optional, tag = "79")]
105        pub player_name_pending_review: Option<bool>,
106        #[prost(bool, optional, tag = "80")]
107        pub avatar_pending_review: Option<bool>,
108        #[prost(bool, optional, tag = "81")]
109        pub on_steam_deck: Option<bool>,
110        #[prost(uint32, optional, tag = "83")]
111        pub gaming_device_type: Option<u32>,
112    }
113
114    #[derive(Clone, PartialEq, Message)]
115    pub struct ClanData {
116        #[prost(uint32, optional, tag = "1")]
117        pub ogg_app_id: Option<u32>,
118        #[prost(uint64, optional, tag = "2")]
119        pub chat_group_id: Option<u64>,
120    }
121
122    #[derive(Clone, PartialEq, Message)]
123    pub struct Kv {
124        #[prost(string, optional, tag = "1")]
125        pub key: Option<String>,
126        #[prost(string, optional, tag = "2")]
127        pub value: Option<String>,
128    }
129}
130
131/// Change status request
132#[derive(Clone, PartialEq, Message)]
133pub struct CMsgClientChangeStatus {
134    #[prost(uint32, optional, tag = "1")]
135    pub persona_state: Option<u32>,
136    #[prost(string, optional, tag = "2")]
137    pub player_name: Option<String>,
138    #[prost(bool, optional, tag = "3")]
139    pub is_auto_generated_name: Option<bool>,
140    #[prost(bool, optional, tag = "4")]
141    pub high_priority: Option<bool>,
142    #[prost(bool, optional, tag = "5")]
143    pub persona_set_by_user: Option<bool>,
144    #[prost(uint32, optional, tag = "6")]
145    pub persona_state_flags: Option<u32>,
146    #[prost(bool, optional, tag = "7")]
147    pub need_persona_response: Option<bool>,
148    #[prost(bool, optional, tag = "8")]
149    pub is_client_idle: Option<bool>,
150}
151
152/// Add friend request
153#[derive(Clone, PartialEq, Message)]
154pub struct CMsgClientAddFriend {
155    #[prost(fixed64, optional, tag = "1")]
156    pub steamid_to_add: Option<u64>,
157    #[prost(string, optional, tag = "2")]
158    pub accountname_or_email_to_add: Option<String>,
159}
160
161/// Add friend response
162#[derive(Clone, PartialEq, Message)]
163pub struct CMsgClientAddFriendResponse {
164    #[prost(int32, optional, tag = "1")]
165    pub eresult: Option<i32>,
166    #[prost(fixed64, optional, tag = "2")]
167    pub steam_id_added: Option<u64>,
168    #[prost(string, optional, tag = "3")]
169    pub persona_name_added: Option<String>,
170}
171
172/// Remove friend request
173#[derive(Clone, PartialEq, Message)]
174pub struct CMsgClientRemoveFriend {
175    #[prost(fixed64, optional, tag = "1")]
176    pub friendid: Option<u64>,
177}
178
179/// Request friend data
180#[derive(Clone, PartialEq, Message)]
181pub struct CMsgClientRequestFriendData {
182    #[prost(uint32, optional, tag = "1")]
183    pub persona_state_requested: Option<u32>,
184    #[prost(fixed64, repeated, packed = "false", tag = "2")]
185    pub friends: Vec<u64>,
186}
187
188/// Create friends group request
189#[derive(Clone, PartialEq, Message)]
190pub struct CMsgClientCreateFriendsGroup {
191    #[prost(fixed64, optional, tag = "1")]
192    pub steamid: Option<u64>,
193    #[prost(string, optional, tag = "2")]
194    pub groupname: Option<String>,
195    #[prost(fixed64, repeated, packed = "false", tag = "3")]
196    pub steamid_friends: Vec<u64>,
197}
198
199/// Create friends group response
200#[derive(Clone, PartialEq, Message)]
201pub struct CMsgClientCreateFriendsGroupResponse {
202    #[prost(uint32, optional, tag = "1")]
203    pub eresult: Option<u32>,
204    #[prost(int32, optional, tag = "2")]
205    pub groupid: Option<i32>,
206}
207
208/// Delete friends group request
209#[derive(Clone, PartialEq, Message)]
210pub struct CMsgClientDeleteFriendsGroup {
211    #[prost(fixed64, optional, tag = "1")]
212    pub steamid: Option<u64>,
213    #[prost(int32, optional, tag = "2")]
214    pub groupid: Option<i32>,
215}
216
217/// Delete friends group response
218#[derive(Clone, PartialEq, Message)]
219pub struct CMsgClientDeleteFriendsGroupResponse {
220    #[prost(uint32, optional, tag = "1")]
221    pub eresult: Option<u32>,
222}
223
224/// Rename friends group request
225#[derive(Clone, PartialEq, Message)]
226pub struct CMsgClientRenameFriendsGroup {
227    #[prost(int32, optional, tag = "1")]
228    pub groupid: Option<i32>,
229    #[prost(string, optional, tag = "2")]
230    pub groupname: Option<String>,
231}
232
233/// Add friend to group request
234#[derive(Clone, PartialEq, Message)]
235pub struct CMsgClientAddFriendToGroup {
236    #[prost(int32, optional, tag = "1")]
237    pub groupid: Option<i32>,
238    #[prost(fixed64, optional, tag = "2")]
239    pub steamiduser: Option<u64>,
240}
241
242/// Add friend to group response
243#[derive(Clone, PartialEq, Message)]
244pub struct CMsgClientAddFriendToGroupResponse {
245    #[prost(uint32, optional, tag = "1")]
246    pub eresult: Option<u32>,
247}
248
249/// Remove friend from group request
250#[derive(Clone, PartialEq, Message)]
251pub struct CMsgClientRemoveFriendFromGroup {
252    #[prost(int32, optional, tag = "1")]
253    pub groupid: Option<i32>,
254    #[prost(fixed64, optional, tag = "2")]
255    pub steamiduser: Option<u64>,
256}
257
258/// Remove friend from group response
259#[derive(Clone, PartialEq, Message)]
260pub struct CMsgClientRemoveFriendFromGroupResponse {
261    #[prost(uint32, optional, tag = "1")]
262    pub eresult: Option<u32>,
263}
264
265/// Invite to game request
266#[derive(Clone, PartialEq, Message)]
267pub struct CMsgClientInviteToGame {
268    #[prost(fixed64, optional, tag = "1")]
269    pub steam_id_dest: Option<u64>,
270    #[prost(fixed64, optional, tag = "2")]
271    pub steam_id_src: Option<u64>,
272    #[prost(string, optional, tag = "3")]
273    pub connect_string: Option<String>,
274    #[prost(string, optional, tag = "4")]
275    pub remote_play: Option<String>,
276}
277
278/// Set player nickname request (EMsg = AMClientSetPlayerNickname)
279#[derive(Clone, PartialEq, Message)]
280pub struct CMsgClientSetPlayerNickname {
281    #[prost(fixed64, optional, tag = "1")]
282    pub steamid: Option<u64>,
283    #[prost(string, optional, tag = "2")]
284    pub nickname: Option<String>,
285}
286
287/// Set player nickname response
288#[derive(Clone, PartialEq, Message)]
289pub struct CMsgClientSetPlayerNicknameResponse {
290    #[prost(uint32, optional, tag = "1")]
291    pub eresult: Option<u32>,
292}
293
294/// Get friends steam levels request (EMsg = ClientFSGetFriendsSteamLevels)
295#[derive(Clone, PartialEq, Message)]
296pub struct CMsgClientFSGetFriendsSteamLevels {
297    #[prost(uint32, repeated, packed = "false", tag = "1")]
298    pub accountids: Vec<u32>,
299}
300
301/// Get friends steam levels response
302#[derive(Clone, PartialEq, Message)]
303pub struct CMsgClientFSGetFriendsSteamLevelsResponse {
304    #[prost(message, repeated, tag = "1")]
305    pub friends: Vec<cmsg_client_fs_get_friends_steam_levels_response::Friend>,
306}
307
308pub mod cmsg_client_fs_get_friends_steam_levels_response {
309    use prost::Message;
310
311    #[derive(Clone, PartialEq, Message)]
312    pub struct Friend {
313        #[prost(uint32, optional, tag = "1")]
314        pub accountid: Option<u32>,
315        #[prost(uint32, optional, tag = "2")]
316        pub level: Option<u32>,
317    }
318}
319
320/// Get nickname list request (Player.GetNicknameList#1)
321#[derive(Clone, PartialEq, Message)]
322pub struct CPlayerGetNicknameListRequest {}
323
324/// Get nickname list response
325#[derive(Clone, PartialEq, Message)]
326pub struct CPlayerGetNicknameListResponse {
327    #[prost(message, repeated, tag = "1")]
328    pub nicknames: Vec<c_player_get_nickname_list_response::PlayerNickname>,
329}
330
331pub mod c_player_get_nickname_list_response {
332    use prost::Message;
333
334    #[derive(Clone, PartialEq, Message)]
335    pub struct PlayerNickname {
336        #[prost(uint32, optional, tag = "1")]
337        pub accountid: Option<u32>,
338        #[prost(string, optional, tag = "2")]
339        pub nickname: Option<String>,
340    }
341}
342
343/// Get persona name history request (EMsg = ClientAMGetPersonaNameHistory)
344#[derive(Clone, PartialEq, Message)]
345pub struct CMsgClientAMGetPersonaNameHistory {
346    #[prost(int32, optional, tag = "1")]
347    pub id_count: Option<i32>,
348    #[prost(message, repeated, tag = "2")]
349    pub ids: Vec<cmsg_client_am_get_persona_name_history::IdInstance>,
350}
351
352pub mod cmsg_client_am_get_persona_name_history {
353    use prost::Message;
354
355    #[derive(Clone, PartialEq, Message)]
356    pub struct IdInstance {
357        #[prost(fixed64, optional, tag = "1")]
358        pub steamid: Option<u64>,
359    }
360}
361
362/// Get persona name history response
363#[derive(Clone, PartialEq, Message)]
364pub struct CMsgClientAMGetPersonaNameHistoryResponse {
365    #[prost(message, repeated, tag = "2")]
366    pub responses: Vec<cmsg_client_am_get_persona_name_history_response::NameTableInstance>,
367}
368
369pub mod cmsg_client_am_get_persona_name_history_response {
370    use prost::Message;
371
372    #[derive(Clone, PartialEq, Message)]
373    pub struct NameTableInstance {
374        #[prost(int32, optional, tag = "1")]
375        pub eresult: Option<i32>,
376        #[prost(fixed64, optional, tag = "2")]
377        pub steamid: Option<u64>,
378        #[prost(message, repeated, tag = "3")]
379        pub names: Vec<NameInstance>,
380    }
381
382    #[derive(Clone, PartialEq, Message)]
383    pub struct NameInstance {
384        #[prost(string, optional, tag = "1")]
385        pub name: Option<String>,
386        #[prost(uint32, optional, tag = "2")]
387        pub name_since: Option<u32>,
388    }
389}
390
391// ============================================================================
392// Quick Invite Link Messages (UserAccount service)
393// ============================================================================
394
395/// Create friend invite token request (UserAccount.CreateFriendInviteToken#1)
396#[derive(Clone, PartialEq, Message)]
397pub struct CUserAccountCreateFriendInviteTokenRequest {
398    /// Maximum number of times this invite can be used (0 = unlimited)
399    #[prost(uint32, optional, tag = "1")]
400    pub invite_limit: Option<u32>,
401    /// Duration in seconds that the invite is valid (0 = no expiry)
402    #[prost(uint32, optional, tag = "2")]
403    pub invite_duration: Option<u32>,
404    /// Optional note for this invite
405    #[prost(string, optional, tag = "3")]
406    pub invite_note: Option<String>,
407}
408
409/// Create friend invite token response
410#[derive(Clone, PartialEq, Message)]
411pub struct CUserAccountCreateFriendInviteTokenResponse {
412    /// The invite token string
413    #[prost(string, optional, tag = "1")]
414    pub invite_token: Option<String>,
415    /// Maximum uses for this invite
416    #[prost(uint64, optional, tag = "2")]
417    pub invite_limit: Option<u64>,
418    /// Duration in seconds
419    #[prost(uint64, optional, tag = "3")]
420    pub invite_duration: Option<u64>,
421    /// Unix timestamp when created
422    #[prost(fixed32, optional, tag = "4")]
423    pub time_created: Option<u32>,
424    /// Whether the token is currently valid
425    #[prost(bool, optional, tag = "5")]
426    pub valid: Option<bool>,
427}
428
429/// Get friend invite tokens request (UserAccount.GetFriendInviteTokens#1)
430#[derive(Clone, PartialEq, Message)]
431pub struct CUserAccountGetFriendInviteTokensRequest {}
432
433/// Get friend invite tokens response
434#[derive(Clone, PartialEq, Message)]
435pub struct CUserAccountGetFriendInviteTokensResponse {
436    /// List of all invite tokens for this account
437    #[prost(message, repeated, tag = "1")]
438    pub tokens: Vec<CUserAccountCreateFriendInviteTokenResponse>,
439}
440
441/// View friend invite token request (UserAccount.ViewFriendInviteToken#1)
442#[derive(Clone, PartialEq, Message)]
443pub struct CUserAccountViewFriendInviteTokenRequest {
444    /// SteamID of the invite link owner
445    #[prost(fixed64, optional, tag = "1")]
446    pub steamid: Option<u64>,
447    /// The invite token to check
448    #[prost(string, optional, tag = "2")]
449    pub invite_token: Option<String>,
450}
451
452/// View friend invite token response
453#[derive(Clone, PartialEq, Message)]
454pub struct CUserAccountViewFriendInviteTokenResponse {
455    /// Whether the invite is valid
456    #[prost(bool, optional, tag = "1")]
457    pub valid: Option<bool>,
458    /// SteamID of the invite owner
459    #[prost(uint64, optional, tag = "2")]
460    pub steamid: Option<u64>,
461    /// Duration in seconds
462    #[prost(uint64, optional, tag = "3")]
463    pub invite_duration: Option<u64>,
464}
465
466/// Redeem friend invite token request (UserAccount.RedeemFriendInviteToken#1)
467#[derive(Clone, PartialEq, Message)]
468pub struct CUserAccountRedeemFriendInviteTokenRequest {
469    /// SteamID of the invite link owner
470    #[prost(fixed64, optional, tag = "1")]
471    pub steamid: Option<u64>,
472    /// The invite token to redeem
473    #[prost(string, optional, tag = "2")]
474    pub invite_token: Option<String>,
475}
476
477/// Redeem friend invite token response
478#[derive(Clone, PartialEq, Message)]
479pub struct CUserAccountRedeemFriendInviteTokenResponse {}
480
481/// Revoke friend invite token request (UserAccount.RevokeFriendInviteToken#1)
482#[derive(Clone, PartialEq, Message)]
483pub struct CUserAccountRevokeFriendInviteTokenRequest {
484    /// The invite token to revoke
485    #[prost(string, optional, tag = "1")]
486    pub invite_token: Option<String>,
487}
488
489/// Revoke friend invite token response
490#[derive(Clone, PartialEq, Message)]
491pub struct CUserAccountRevokeFriendInviteTokenResponse {}
492
493// ============================================================================
494// Unified Friends List Messages (FriendsList service)
495// ============================================================================
496
497/// Get friends list request (FriendsList.GetFriendsList#1)
498#[derive(Clone, PartialEq, Message)]
499pub struct CFriendsListGetFriendsListRequest {
500    #[prost(uint32, optional, tag = "1")]
501    pub role_mask: Option<u32>,
502}
503
504/// Get friends list response
505#[derive(Clone, PartialEq, Message)]
506pub struct CFriendsListGetFriendsListResponse {
507    #[prost(message, optional, tag = "1")]
508    pub friendslist: Option<CMsgClientFriendsList>,
509}