aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Services/Acc/IManagerForApplication.cs
blob: 9312b2bc82cfb67e739b6188407ed76f7e0b1b1d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using Ryujinx.Common.Logging;
using Ryujinx.HLE.HOS.Ipc;
using Ryujinx.HLE.Utilities;
using System.Collections.Generic;

namespace Ryujinx.HLE.HOS.Services.Acc
{
    class IManagerForApplication : IpcService
    {
        private UInt128 Uuid;

        private Dictionary<int, ServiceProcessRequest> m_Commands;

        public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;

        public IManagerForApplication(UInt128 Uuid)
        {
            m_Commands = new Dictionary<int, ServiceProcessRequest>()
            {
                { 0, CheckAvailability },
                { 1, GetAccountId      }
            };

            this.Uuid = Uuid;
        }

        // CheckAvailability()
        public long CheckAvailability(ServiceCtx Context)
        {
            Logger.PrintStub(LogClass.ServiceAcc, "Stubbed.");

            return 0;
        }

        // GetAccountId() -> nn::account::NetworkServiceAccountId
        public long GetAccountId(ServiceCtx Context)
        {
            long NetworkServiceAccountId = 0xcafe;

            Logger.PrintStub(LogClass.ServiceAcc, $"Stubbed. NetworkServiceAccountId: {NetworkServiceAccountId}");

            Context.ResponseData.Write(NetworkServiceAccountId);

            return 0;
        }
    }
}