diff options
author | Ac_K <Acoustik666@gmail.com> | 2018-09-26 00:59:29 +0200 |
---|---|---|
committer | gdkchan <gab.dark.100@gmail.com> | 2018-09-25 19:59:29 -0300 |
commit | 40282da93a45c90b3d5a696199ee353a1ae8c730 (patch) | |
tree | 5ad7365b6db5a7c0579d32bdcce22f45f2f5e27d | |
parent | 2562ca6c3fe6ef328e0926c9cbcd6bb52abb328f (diff) |
Implement friend:a IFriendService: 10101 (#429)
* Implement friend:a IFriendService: 10101
* Update Profile Picture
* Update IFriendServiceTypes.cs
* Update IFriendServiceTypes.cs
* Update IFriendService.cs
* Update IFriendServiceTypes.cs
* Update IFriendServiceTypes.cs
* Update IFriendService.cs
-rw-r--r-- | Ryujinx.HLE/HOS/Services/Friend/IFriendService.cs | 56 | ||||
-rw-r--r-- | Ryujinx.HLE/HOS/Services/Friend/IFriendServiceTypes.cs | 20 | ||||
-rw-r--r-- | Ryujinx.HLE/RyujinxProfileImage.jpg | bin | 5394 -> 52969 bytes |
3 files changed, 73 insertions, 3 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Friend/IFriendService.cs b/Ryujinx.HLE/HOS/Services/Friend/IFriendService.cs index 3b06ba8a..d476f5d0 100644 --- a/Ryujinx.HLE/HOS/Services/Friend/IFriendService.cs +++ b/Ryujinx.HLE/HOS/Services/Friend/IFriendService.cs @@ -15,11 +15,50 @@ namespace Ryujinx.HLE.HOS.Services.Friend { m_Commands = new Dictionary<int, ServiceProcessRequest>() { + { 10101, GetFriendList }, { 10601, DeclareCloseOnlinePlaySession }, { 10610, UpdateUserPresence } }; } + // nn::friends::GetFriendListGetFriendListIds(nn::account::Uid, int Unknown0, nn::friends::detail::ipc::SizedFriendFilter, ulong Unknown1) -> int CounterIds, array<nn::account::NetworkServiceAccountId> + public long GetFriendList(ServiceCtx Context) + { + UserId Uuid = new UserId( + Context.RequestData.ReadInt64(), + Context.RequestData.ReadInt64()); + + int Unknown0 = Context.RequestData.ReadInt32(); + + FriendFilter Filter = new FriendFilter() + { + PresenceStatus = (PresenceStatusFilter)Context.RequestData.ReadInt32(), + IsFavoriteOnly = Context.RequestData.ReadBoolean(), + IsSameAppPresenceOnly = Context.RequestData.ReadBoolean(), + IsSameAppPlayedOnly = Context.RequestData.ReadBoolean(), + IsArbitraryAppPlayedOnly = Context.RequestData.ReadBoolean(), + PresenceGroupId = Context.RequestData.ReadInt64() + }; + + long Unknown1 = Context.RequestData.ReadInt64(); + + // There are no friends online, so we return 0 because the nn::account::NetworkServiceAccountId array is empty. + Context.ResponseData.Write(0); + + Context.Device.Log.PrintStub(LogClass.ServiceFriend, $"Stubbed. UserId: {Uuid.UserIdHex} - " + + $"Unknown0: {Unknown0} - " + + $"PresenceStatus: {Filter.PresenceStatus} - " + + $"IsFavoriteOnly: {Filter.IsFavoriteOnly} - " + + $"IsSameAppPresenceOnly: {Filter.IsSameAppPresenceOnly} - " + + $"IsSameAppPlayedOnly: {Filter.IsSameAppPlayedOnly} - " + + $"IsArbitraryAppPlayedOnly: {Filter.IsArbitraryAppPlayedOnly} - " + + $"PresenceGroupId: {Filter.PresenceGroupId} - " + + $"Unknown1: {Unknown1}"); + + return 0; + } + + // DeclareCloseOnlinePlaySession(nn::account::Uid) public long DeclareCloseOnlinePlaySession(ServiceCtx Context) { UserId Uuid = new UserId( @@ -31,19 +70,30 @@ namespace Ryujinx.HLE.HOS.Services.Friend Profile.OnlinePlayState = OpenCloseState.Closed; } + Context.Device.Log.PrintStub(LogClass.ServiceFriend, $"Stubbed. Uuid: {Uuid.UserIdHex} - " + + $"OnlinePlayState: {Profile.OnlinePlayState}"); + return 0; } + // UpdateUserPresence(nn::account::Uid, ulong Unknown0) -> buffer<Unknown1, type: 0x19, size: 0xe0> public long UpdateUserPresence(ServiceCtx Context) { UserId Uuid = new UserId( Context.RequestData.ReadInt64(), Context.RequestData.ReadInt64()); - //TODO. - Context.Device.Log.PrintStub(LogClass.ServiceFriend, "Stubbed."); + long Unknown0 = Context.RequestData.ReadInt64(); + + long Position = Context.Request.PtrBuff[0].Position; + long Size = Context.Request.PtrBuff[0].Size; + + //Todo: Write the buffer content. + + Context.Device.Log.PrintStub(LogClass.ServiceFriend, $"Stubbed. Uuid: {Uuid.UserIdHex} - " + + $"Unknown0: {Unknown0}"); return 0; } } -}
\ No newline at end of file +} diff --git a/Ryujinx.HLE/HOS/Services/Friend/IFriendServiceTypes.cs b/Ryujinx.HLE/HOS/Services/Friend/IFriendServiceTypes.cs new file mode 100644 index 00000000..31459f7d --- /dev/null +++ b/Ryujinx.HLE/HOS/Services/Friend/IFriendServiceTypes.cs @@ -0,0 +1,20 @@ +namespace Ryujinx.HLE.HOS.Services.Friend +{ + enum PresenceStatusFilter + { + None, + Online, + OnlinePlay, + OnlineOrOnlinePlay + } + + struct FriendFilter + { + public PresenceStatusFilter PresenceStatus; + public bool IsFavoriteOnly; + public bool IsSameAppPresenceOnly; + public bool IsSameAppPlayedOnly; + public bool IsArbitraryAppPlayedOnly; + public long PresenceGroupId; + } +} diff --git a/Ryujinx.HLE/RyujinxProfileImage.jpg b/Ryujinx.HLE/RyujinxProfileImage.jpg Binary files differindex fe9ec2a9..55e4c43c 100644 --- a/Ryujinx.HLE/RyujinxProfileImage.jpg +++ b/Ryujinx.HLE/RyujinxProfileImage.jpg |