Beispiel #1
0
        public bool Start()
        {
            HEVConsole.LineJump();
            HEVConsole.Print("-- (Settings) --");
            bool settingsLoad = Settings.ConfigRead();

            if (settingsLoad)
            {
                HEVConsole.Print("-> Loaded.", EPrintType.eSuccess);
            }
            else
            {
                HEVConsole.Print("-> Failed.", EPrintType.eError);
            }
            HEVConsole.LineJump();
            HEVConsole.Print("-- (Config) --");
            bool configLoad = Config.ConfigRead();

            if (configLoad)
            {
                HEVConsole.Print("-> Loaded.", EPrintType.eSuccess);
            }
            else
            {
                HEVConsole.Print("-> Failed.", EPrintType.eError);
            }
            HEVConsole.LineJump();
            HEVConsole.Print("-- (Discord) --");
            Instance.DiscordSDKReady = DiscordSDK.ConfigValidate();
            if (Instance.DiscordSDKReady)
            {
                HEVConsole.Print("-> User Enabled.", EPrintType.eSuccess);
            }
            else
            {
                HEVConsole.Print("-> User Disabled.", EPrintType.eWarning);
            }
            Instance.DiscordBotReady = DiscordBot.ConfigValidate();
            if (Instance.DiscordBotReady)
            {
                HEVConsole.Print("-> Bot Enabled.", EPrintType.eSuccess);
            }
            else
            {
                HEVConsole.Print("-> Bot Disabled.", EPrintType.eWarning);
            }
            HEVConsole.LineJump();

            // Not implemented
            HEVConsole.Print("-- (Twitch) --");
            Instance.TwitchSDKReady = TwitchSDK.ConfigValidate();
            if (Instance.TwitchSDKReady)
            {
                HEVConsole.Print("-> User Enabled.", EPrintType.eSuccess);
            }
            else
            {
                HEVConsole.Print("-> User Disabled.", EPrintType.eWarning);
            }
            Instance.TwitchBotReady = TwitchBot.ConfigValidate();
            if (Instance.TwitchBotReady)
            {
                HEVConsole.Print("-> Bot Enabled.", EPrintType.eSuccess);
            }
            else
            {
                HEVConsole.Print("-> Bot Disabled.", EPrintType.eWarning);
            }
            HEVConsole.LineJump();

            // Now checks every one before

            if (!settingsLoad)
            {
                return(false);
            }
            if (!Settings.ConfigValidate())
            {
                return(false);
            }

            if (!configLoad)
            {
                return(false);
            }
            if (!Config.ConfigValidate())
            {
                return(false);
            }

            Chat = new ChatManager();
            Chat.Start();

            return(true);
        }
Beispiel #2
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);
        }