internal async Task <HashSet <ulong> > GetMyChatGroupIDs() { if (!Client.IsConnected) { return(null); } CChatRoom_GetMyChatRoomGroups_Request request = new CChatRoom_GetMyChatRoomGroups_Request(); SteamUnifiedMessages.ServiceMethodResponse response; try { response = await UnifiedChatRoomService.SendMessage(x => x.GetMyChatRoomGroups(request)); } catch (Exception e) { ArchiLogger.LogGenericWarningException(e); return(null); } if (response == null) { ArchiLogger.LogNullError(nameof(response)); return(null); } if (response.Result != EResult.OK) { return(null); } CChatRoom_GetMyChatRoomGroups_Response body = response.GetDeserializedResponse <CChatRoom_GetMyChatRoomGroups_Response>(); return(body.chat_room_groups.Select(chatRoom => chatRoom.group_summary.chat_group_id).ToHashSet()); }
static void ProcessMyJob(SteamUnifiedMessages.ServiceMethodResponse callback) { // and check for success if (callback.Result != EResult.OK) { Console.WriteLine($"Unified service request failed with {callback.Result}"); return; } // retrieve the deserialized response for the request we made // notice the naming pattern // for requests: CMyService_Method_Request // for responses: CMyService_Method_Response //CPlayer_GetGameBadgeLevels_Response resp = callback.GetDeserializedResponse<CPlayer_GetGameBadgeLevels_Response>(); CChatRoom_GetMyChatRoomGroups_Response resp = callback.GetDeserializedResponse <CChatRoom_GetMyChatRoomGroups_Response>(); //Console.WriteLine($"Our player level is {resp.}"); foreach (var chat_room_group in resp.chat_room_groups) { Console.WriteLine($"id : {chat_room_group.user_chat_group_state.chat_group_id}, name: {chat_room_group.group_summary.chat_group_name}, default_chat_id: {chat_room_group.group_summary.default_chat_id}"); } myJobID = JobID.Invalid; // now that we've completed our task, lets log off //steamUser.LogOff(); }