diff --git a/Ryujinx.HLE/HOS/Services/Friend/FriendServicePermissionLevel.cs b/Ryujinx.HLE/HOS/Services/Friend/FriendServicePermissionLevel.cs index 3f9cb450c1..02d37049bc 100644 --- a/Ryujinx.HLE/HOS/Services/Friend/FriendServicePermissionLevel.cs +++ b/Ryujinx.HLE/HOS/Services/Friend/FriendServicePermissionLevel.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Text; namespace Ryujinx.HLE.HOS.Services.Friend { @@ -15,10 +13,10 @@ namespace Ryujinx.HLE.HOS.Services.Friend enum FriendServicePermissionLevel { - Admin = -1, - User = FriendServicePermissionLevelMask.User, - Overlay = FriendServicePermissionLevelMask.User | FriendServicePermissionLevelMask.Overlay, - Manager = FriendServicePermissionLevelMask.User | FriendServicePermissionLevelMask.Overlay | FriendServicePermissionLevelMask.Manager, - System = FriendServicePermissionLevelMask.User | FriendServicePermissionLevelMask.System + Admin = -1, + User = FriendServicePermissionLevelMask.User, + Overlay = FriendServicePermissionLevelMask.User | FriendServicePermissionLevelMask.Overlay, + Manager = FriendServicePermissionLevelMask.User | FriendServicePermissionLevelMask.Overlay | FriendServicePermissionLevelMask.Manager, + System = FriendServicePermissionLevelMask.User | FriendServicePermissionLevelMask.System } } diff --git a/Ryujinx.HLE/HOS/Services/Friend/IFriendService.cs b/Ryujinx.HLE/HOS/Services/Friend/IFriendService.cs index 2f95155574..58e65ea750 100644 --- a/Ryujinx.HLE/HOS/Services/Friend/IFriendService.cs +++ b/Ryujinx.HLE/HOS/Services/Friend/IFriendService.cs @@ -6,6 +6,7 @@ using Ryujinx.HLE.Utilities; using System.Collections.Generic; using System.IO; using System.Runtime.InteropServices; + using static Ryujinx.HLE.HOS.ErrorCode; namespace Ryujinx.HLE.HOS.Services.Friend @@ -108,8 +109,7 @@ namespace Ryujinx.HLE.HOS.Services.Friend // Padding context.RequestData.ReadInt32(); - UInt128 uuid = context.RequestData.ReadStruct(); - + UInt128 uuid = context.RequestData.ReadStruct(); FriendFilter filter = context.RequestData.ReadStruct(); // Pid placeholder @@ -146,8 +146,7 @@ namespace Ryujinx.HLE.HOS.Services.Friend // Padding context.RequestData.ReadInt32(); - UInt128 uuid = context.RequestData.ReadStruct(); - + UInt128 uuid = context.RequestData.ReadStruct(); FriendFilter filter = context.RequestData.ReadStruct(); // Pid placeholder @@ -238,6 +237,7 @@ namespace Ryujinx.HLE.HOS.Services.Friend using (BinaryReader bufferReader = new BinaryReader(new MemoryStream(bufferContent))) { UserPresence[] userPresenceInputArray = bufferReader.ReadStructArray(elementCount); + Logger.PrintStub(LogClass.ServiceFriend, new { UserId = uuid.ToString(), userPresenceInputArray }); } diff --git a/Ryujinx.HLE/HOS/Services/Friend/IFriendServiceTypes.cs b/Ryujinx.HLE/HOS/Services/Friend/IFriendServiceTypes.cs index 2200dc606e..f797e8486d 100644 --- a/Ryujinx.HLE/HOS/Services/Friend/IFriendServiceTypes.cs +++ b/Ryujinx.HLE/HOS/Services/Friend/IFriendServiceTypes.cs @@ -49,12 +49,11 @@ namespace Ryujinx.HLE.HOS.Services.Friend public bool SamePresenceGroupApplication; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x3)] - char[] unknown; + char[] Unknown; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0xC0)] public char[] AppKeyValueStorage; - public override string ToString() { return $"UserPresence {{ UserId: {UserId}, LastTimeOnlineTimestamp: {LastTimeOnlineTimestamp}, Status: {Status}, AppKeyValueStorage: {AppKeyValueStorage} }}"; @@ -79,7 +78,7 @@ namespace Ryujinx.HLE.HOS.Services.Friend public bool IsNew; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x6)] - char[] unknown; + char[] Unknown; [MarshalAs(UnmanagedType.I1)] public bool IsValid; @@ -95,10 +94,10 @@ namespace Ryujinx.HLE.HOS.Services.Friend [StructLayout(LayoutKind.Sequential, Pack = 0x8, Size = 0x10)] struct NotificationInfo { - public NotificationEventType type; + public NotificationEventType Type; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x4)] - char[] padding; + char[] Padding; public long NetworkUserIdPlaceholder; } diff --git a/Ryujinx.HLE/HOS/Services/Friend/INotificationService.cs b/Ryujinx.HLE/HOS/Services/Friend/INotificationService.cs index 2bdef2cf1f..b9a5639215 100644 --- a/Ryujinx.HLE/HOS/Services/Friend/INotificationService.cs +++ b/Ryujinx.HLE/HOS/Services/Friend/INotificationService.cs @@ -5,6 +5,7 @@ using Ryujinx.HLE.HOS.Kernel.Threading; using Ryujinx.HLE.Utilities; using System; using System.Collections.Generic; + using static Ryujinx.HLE.HOS.ErrorCode; namespace Ryujinx.HLE.HOS.Services.Friend @@ -88,16 +89,17 @@ namespace Ryujinx.HLE.HOS.Services.Friend NotificationInfo notificationInfo = _notifications.First.Value; _notifications.RemoveFirst(); - if (notificationInfo.type == NotificationEventType.FriendListUpdate) + if (notificationInfo.Type == NotificationEventType.FriendListUpdate) { _hasFriendListUpdate = false; } - else if (notificationInfo.type == NotificationEventType.NewFriendRequest) + else if (notificationInfo.Type == NotificationEventType.NewFriendRequest) { _hasNewFriendRequest = false; } context.ResponseData.WriteStruct(notificationInfo); + return 0; } } @@ -121,7 +123,7 @@ namespace Ryujinx.HLE.HOS.Services.Friend _notifications.RemoveFirst(); } - friendListNotification.type = NotificationEventType.FriendListUpdate; + friendListNotification.Type = NotificationEventType.FriendListUpdate; _hasFriendListUpdate = true; if (_hasNewFriendRequest) @@ -134,7 +136,7 @@ namespace Ryujinx.HLE.HOS.Services.Friend _notifications.RemoveFirst(); } - newFriendRequestNotification.type = NotificationEventType.NewFriendRequest; + newFriendRequestNotification.Type = NotificationEventType.NewFriendRequest; _notifications.AddFirst(newFriendRequestNotification); } @@ -162,7 +164,7 @@ namespace Ryujinx.HLE.HOS.Services.Friend NotificationInfo newFriendRequestNotification = new NotificationInfo { - type = NotificationEventType.NewFriendRequest + Type = NotificationEventType.NewFriendRequest }; _notifications.AddLast(newFriendRequestNotification); diff --git a/Ryujinx.HLE/HOS/Services/Friend/NotificationEventHandler.cs b/Ryujinx.HLE/HOS/Services/Friend/NotificationEventHandler.cs index 83d8e3d23b..e2d903be5e 100644 --- a/Ryujinx.HLE/HOS/Services/Friend/NotificationEventHandler.cs +++ b/Ryujinx.HLE/HOS/Services/Friend/NotificationEventHandler.cs @@ -4,7 +4,7 @@ namespace Ryujinx.HLE.HOS.Services.Friend { public sealed class NotificationEventHandler { - private static NotificationEventHandler instance = null; + private static NotificationEventHandler instance; private static object instanceLock = new object(); private INotificationService[] _registry;