friend.cpp 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. // Copyright 2018 yuzu emulator team
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #include "common/logging/log.h"
  5. #include "core/hle/ipc_helpers.h"
  6. #include "core/hle/service/friend/friend.h"
  7. #include "core/hle/service/friend/interface.h"
  8. namespace Service::Friend {
  9. class IFriendService final : public ServiceFramework<IFriendService> {
  10. public:
  11. IFriendService() : ServiceFramework("IFriendService") {
  12. static const FunctionInfo functions[] = {
  13. {0, nullptr, "GetCompletionEvent"},
  14. {1, nullptr, "Cancel"},
  15. {10100, nullptr, "GetFriendListIds"},
  16. {10101, nullptr, "GetFriendList"},
  17. {10102, nullptr, "UpdateFriendInfo"},
  18. {10110, nullptr, "GetFriendProfileImage"},
  19. {10200, nullptr, "SendFriendRequestForApplication"},
  20. {10211, nullptr, "AddFacedFriendRequestForApplication"},
  21. {10400, nullptr, "GetBlockedUserListIds"},
  22. {10500, nullptr, "GetProfileList"},
  23. {10600, nullptr, "DeclareOpenOnlinePlaySession"},
  24. {10601, nullptr, "DeclareCloseOnlinePlaySession"},
  25. {10610, nullptr, "UpdateUserPresence"},
  26. {10700, nullptr, "GetPlayHistoryRegistrationKey"},
  27. {10701, nullptr, "GetPlayHistoryRegistrationKeyWithNetworkServiceAccountId"},
  28. {10702, nullptr, "AddPlayHistory"},
  29. {11000, nullptr, "GetProfileImageUrl"},
  30. {20100, nullptr, "GetFriendCount"},
  31. {20101, nullptr, "GetNewlyFriendCount"},
  32. {20102, nullptr, "GetFriendDetailedInfo"},
  33. {20103, nullptr, "SyncFriendList"},
  34. {20104, nullptr, "RequestSyncFriendList"},
  35. {20110, nullptr, "LoadFriendSetting"},
  36. {20200, nullptr, "GetReceivedFriendRequestCount"},
  37. {20201, nullptr, "GetFriendRequestList"},
  38. {20300, nullptr, "GetFriendCandidateList"},
  39. {20301, nullptr, "GetNintendoNetworkIdInfo"},
  40. {20302, nullptr, "GetSnsAccountLinkage"},
  41. {20303, nullptr, "GetSnsAccountProfile"},
  42. {20304, nullptr, "GetSnsAccountFriendList"},
  43. {20400, nullptr, "GetBlockedUserList"},
  44. {20401, nullptr, "SyncBlockedUserList"},
  45. {20500, nullptr, "GetProfileExtraList"},
  46. {20501, nullptr, "GetRelationship"},
  47. {20600, nullptr, "GetUserPresenceView"},
  48. {20700, nullptr, "GetPlayHistoryList"},
  49. {20701, nullptr, "GetPlayHistoryStatistics"},
  50. {20800, nullptr, "LoadUserSetting"},
  51. {20801, nullptr, "SyncUserSetting"},
  52. {20900, nullptr, "RequestListSummaryOverlayNotification"},
  53. {21000, nullptr, "GetExternalApplicationCatalog"},
  54. {30100, nullptr, "DropFriendNewlyFlags"},
  55. {30101, nullptr, "DeleteFriend"},
  56. {30110, nullptr, "DropFriendNewlyFlag"},
  57. {30120, nullptr, "ChangeFriendFavoriteFlag"},
  58. {30121, nullptr, "ChangeFriendOnlineNotificationFlag"},
  59. {30200, nullptr, "SendFriendRequest"},
  60. {30201, nullptr, "SendFriendRequestWithApplicationInfo"},
  61. {30202, nullptr, "CancelFriendRequest"},
  62. {30203, nullptr, "AcceptFriendRequest"},
  63. {30204, nullptr, "RejectFriendRequest"},
  64. {30205, nullptr, "ReadFriendRequest"},
  65. {30210, nullptr, "GetFacedFriendRequestRegistrationKey"},
  66. {30211, nullptr, "AddFacedFriendRequest"},
  67. {30212, nullptr, "CancelFacedFriendRequest"},
  68. {30213, nullptr, "GetFacedFriendRequestProfileImage"},
  69. {30214, nullptr, "GetFacedFriendRequestProfileImageFromPath"},
  70. {30215, nullptr, "SendFriendRequestWithExternalApplicationCatalogId"},
  71. {30216, nullptr, "ResendFacedFriendRequest"},
  72. {30217, nullptr, "SendFriendRequestWithNintendoNetworkIdInfo"},
  73. {30300, nullptr, "GetSnsAccountLinkPageUrl"},
  74. {30301, nullptr, "UnlinkSnsAccount"},
  75. {30400, nullptr, "BlockUser"},
  76. {30401, nullptr, "BlockUserWithApplicationInfo"},
  77. {30402, nullptr, "UnblockUser"},
  78. {30500, nullptr, "GetProfileExtraFromFriendCode"},
  79. {30700, nullptr, "DeletePlayHistory"},
  80. {30810, nullptr, "ChangePresencePermission"},
  81. {30811, nullptr, "ChangeFriendRequestReception"},
  82. {30812, nullptr, "ChangePlayLogPermission"},
  83. {30820, nullptr, "IssueFriendCode"},
  84. {30830, nullptr, "ClearPlayLog"},
  85. {49900, nullptr, "DeleteNetworkServiceAccountCache"},
  86. };
  87. RegisterHandlers(functions);
  88. }
  89. };
  90. void Module::Interface::CreateFriendService(Kernel::HLERequestContext& ctx) {
  91. IPC::ResponseBuilder rb{ctx, 2, 0, 1};
  92. rb.Push(RESULT_SUCCESS);
  93. rb.PushIpcInterface<IFriendService>();
  94. LOG_DEBUG(Service_ACC, "called");
  95. }
  96. Module::Interface::Interface(std::shared_ptr<Module> module, const char* name)
  97. : ServiceFramework(name), module(std::move(module)) {}
  98. void InstallInterfaces(SM::ServiceManager& service_manager) {
  99. auto module = std::make_shared<Module>();
  100. std::make_shared<Friend>(module, "friend:a")->InstallAsService(service_manager);
  101. std::make_shared<Friend>(module, "friend:m")->InstallAsService(service_manager);
  102. std::make_shared<Friend>(module, "friend:s")->InstallAsService(service_manager);
  103. std::make_shared<Friend>(module, "friend:u")->InstallAsService(service_manager);
  104. std::make_shared<Friend>(module, "friend:v")->InstallAsService(service_manager);
  105. }
  106. } // namespace Service::Friend