Beispiel #1
0
        public static bool ConfigRead()
        {
            bool    status = false;
            IniData data   = null;

            (data, status) = HEVIO.FileINIRead(Instance.FileConfig);
            if (!status)
            {
                if (!ConfigWrite())
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            }


            if (!data.DataINIReadWrite("Twitch", "Guild", ref Instance.TwitchGuild))
            {
                status = false;
            }
            if (!data.DataINIReadWrite("Twitch", "Channel", ref Instance.TwitchChannel))
            {
                status = false;
            }
            if (!data.DataINIReadWrite("Twitch", "UserName", ref Instance.TwitchUserName))
            {
                status = false;
            }
            if (!data.DataINIReadWrite("Twitch", "BotName", ref Instance.TwitchBotName))
            {
                status = false;
            }
            if (!data.DataINIReadWrite("Twitch", "BotToken", ref Instance.TwitchBotToken))
            {
                status = false;
            }
            if (!data.DataINIReadWrite("Twitch", "UserBlackList", ref Instance.TwitchUserBlackList))
            {
                status = false;
            }
            if (!data.DataINIReadWrite("Twitch", "BotBlackList", ref Instance.TwitchBotBlackList))
            {
                status = false;
            }

            if (!status)
            {
                status = HEVIO.FileINIWrite(Instance.FileConfig, data);
            }
            return(status);
        }
Beispiel #2
0
        public static bool ConfigRead()
        {
            bool    status = false;
            IniData data   = null;

            (data, status) = HEVIO.FileINIRead(Instance.FileConfig);
            if (!status)
            {
                if (!ConfigWrite())
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            }

            if (!data.DataINIReadWrite("Discord", "Guild", ref Instance.DiscordGuild))
            {
                status = false;
            }
            if (!data.DataINIReadWrite("Discord", "Channel", ref Instance.DiscordChannel))
            {
                status = false;
            }
            if (!data.DataINIReadWrite("Discord", "UserName", ref Instance.DiscordUserName))
            {
                status = false;
            }


            if (!status)
            {
                status = HEVIO.FileINIWrite(Instance.FileConfig, data);
            }
            return(status);
        }
Beispiel #3
0
        public static bool ConfigRead()
        {
            bool    status = false;
            IniData data   = null;

            if (!SetupConfig())
            {
                return(false);
            }
            (data, status) = HEVIO.FileINIRead(Instance.FileConfig);
            if (!status)
            {
                if (!ConfigWrite())
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            }

            HEVConsole.Print("1");


            if (!data.DataINIReadWrite("Profile", "UserName", ref Instance.ConfUserName))
            {
                status = false;
            }
            if (!data.DataINIReadWrite("Profile", "Website", ref Instance.ConfWebsite))
            {
                status = false;
            }
            if (!data.DataINIReadWrite("Configuration", "Language", ref Instance.ConfLanguage))
            {
                status = false;
            }
            if (!data.DataINIReadWrite("Configuration", "DiscordUser", ref Instance.ConfDiscordSDK))
            {
                status = false;
            }
            if (!data.DataINIReadWrite("Configuration", "DiscordBot", ref Instance.ConfDiscordBot))
            {
                status = false;
            }
            if (!data.DataINIReadWrite("Configuration", "TwitchUser", ref Instance.ConfTwitchSDK))
            {
                status = false;
            }
            if (!data.DataINIReadWrite("Configuration", "TwitchBot", ref Instance.ConfTwitchBot))
            {
                status = false;
            }
            if (!data.DataINIReadWrite("Configuration", "ComputerRank", ref Instance.ConfComputerRank))
            {
                status = false;
            }
            if (!data.DataINIReadWrite("Configuration", "UserBlackListString", ref Instance.UserBlackList))
            {
                status = false;
            }
            if (!data.DataINIReadWrite("Configuration", "BotBlackListString", ref Instance.BotBlackList))
            {
                status = false;
            }
            if (!data.DataINIReadWrite("Configuration", "RPGGame", ref Instance.ConfRPGGame))
            {
                status = false;
            }

            if (!status)
            {
                status = HEVIO.FileINIWrite(Instance.FileConfig, data);
            }

            // Get the settings of every system
            if (!DiscordSDK.ConfigRead())
            {
                return(false);
            }
            if (!DiscordBot.ConfigRead())
            {
                return(false);
            }
            if (!TwitchSDK.ConfigRead())
            {
                return(false);
            }
            if (!TwitchBot.ConfigRead())
            {
                return(false);
            }
            return(status);
        }