Esempio n. 1
0
        [CommandHipc(2)] // 4.0.0+
        // MakeLanguageCode(nn::settings::Language language_index) -> nn::settings::LanguageCode
        public ResultCode MakeLanguageCode(ServiceCtx context)
        {
            int languageIndex = context.RequestData.ReadInt32();

            if ((uint)languageIndex >= (uint)SystemStateMgr.LanguageCodes.Length)
            {
                return(ResultCode.LanguageOutOfRange);
            }

            context.ResponseData.Write(SystemStateMgr.GetLanguageCode(languageIndex));

            return(ResultCode.Success);
        }
Esempio n. 2
0
        // MakeLanguageCode(nn::settings::Language language_index) -> nn::settings::LanguageCode
        public static long MakeLanguageCode(ServiceCtx context)
        {
            int languageIndex = context.RequestData.ReadInt32();

            if ((uint)languageIndex >= (uint)SystemStateMgr.LanguageCodes.Length)
            {
                return(MakeError(ErrorModule.Settings, SettingsError.LanguageOutOfRange));
            }

            context.ResponseData.Write(SystemStateMgr.GetLanguageCode(languageIndex));

            return(0);
        }
Esempio n. 3
0
        public ResultCode GetAvailableLanguagesCodesImpl(ServiceCtx context, ulong position, ulong size, int maxSize)
        {
            int count = (int)(size / 8);

            if (count > maxSize)
            {
                count = maxSize;
            }

            for (int index = 0; index < count; index++)
            {
                context.Memory.Write(position, SystemStateMgr.GetLanguageCode(index));

                position += 8;
            }

            context.ResponseData.Write(count);

            return(ResultCode.Success);
        }
Esempio n. 4
0
        public static long GetAvailableLanguagesCodesMethod(ServiceCtx Context, long Position, long Size)
        {
            int Count = (int)(Size / 8);

            if (Count > SystemStateMgr.LanguageCodes.Length)
            {
                Count = SystemStateMgr.LanguageCodes.Length;
            }

            for (int Index = 0; Index < Count; Index++)
            {
                Context.Memory.WriteInt64(Position, SystemStateMgr.GetLanguageCode(Index));

                Position += 8;
            }

            Context.ResponseData.Write(Count);

            return(0);
        }
Esempio n. 5
0
        public static long GetAvailableLanguagesCodesImpl(ServiceCtx context, long position, long size)
        {
            int count = (int)(size / 8);

            if (count > SystemStateMgr.LanguageCodes.Length)
            {
                count = SystemStateMgr.LanguageCodes.Length;
            }

            for (int index = 0; index < count; index++)
            {
                context.Memory.WriteInt64(position, SystemStateMgr.GetLanguageCode(index));

                position += 8;
            }

            context.ResponseData.Write(count);

            return(0);
        }
Esempio n. 6
0
        public static long GetAvailableLanguageCodes(ServiceCtx Context)
        {
            long Position = Context.Request.RecvListBuff[0].Position;
            long Size     = Context.Request.RecvListBuff[0].Size;

            int Count = (int)(Size / 8);

            if (Count > SystemStateMgr.LanguageCodes.Length)
            {
                Count = SystemStateMgr.LanguageCodes.Length;
            }

            for (int Index = 0; Index < Count; Index++)
            {
                Context.Memory.WriteInt64(Position, SystemStateMgr.GetLanguageCode(Index));

                Position += 8;
            }

            Context.ResponseData.Write(Count);

            return(0);
        }