Ejemplo n.º 1
0
        public SchumixBase()
        {
            try
            {
                ExitStatus = false;

                if(ServerConfig.Enabled)
                {
                    var listener = new ClientSocket(ServerConfig.Host, ServerConfig.Port, ServerConfig.Password);
                    Log.Debug("SchumixServer", sLConsole.GetString("Initiating connection."));
                    listener.Socket();

                    while(ThreadStop)
                        Thread.Sleep(100);
                }

                if(ListenerConfig.Enabled)
                {
                    Log.Debug("SchumixBot", sLConsole.GetString("SchumixListener starting..."));
                    var sListener = new SchumixListener(ListenerConfig.Port);
                    new Thread(() => sListener.Listen()).Start();
                }

                if(sPlatform.IsLinux)
                    ServicePointManager.ServerCertificateValidationCallback += (s,ce,ca,p) => true;

                WebRequest.DefaultWebProxy = null;

                Log.Debug("SchumixBase", sLConsole.GetString("Timer is starting..."));
                sTimer = new Timer();
                sTimer.Start();

                Log.Debug("SchumixBase", sLConsole.GetString("MySql is starting..."));
                DManager = new DatabaseManager();

                Log.Debug("SchumixBase", sLConsole.GetString("CacheDB is starting..."));
                sCacheDB = new CacheDB();
                sCacheDB.Load();

                Log.Notice("SchumixBase", sLConsole.GetString("Successfully connected to the database."));
                sLManager.Locale = LocalizationConfig.Locale;

                SqlInfoReConfig();

                Log.Debug("SchumixBase", sLConsole.GetString("CleanManager is starting..."));
                sCleanManager = new CleanManager();
                sCleanManager.Initialize();

                if(AddonsConfig.Enabled)
                {
                    Log.Debug("SchumixBase", sLConsole.GetString("AddonManager is loading..."));
                    sAddonManager.Initialize();
                    sAddonManager.LoadPluginsFromDirectory(AddonsConfig.Directory);
                }
            }
            catch(Exception e)
            {
                Log.Error("SchumixBase", sLConsole.GetString("Failure details: {0}"), e.Message);
            }
        }
Ejemplo n.º 2
0
 public void Connect()
 {
     DManager = new DatabaseManager();
 }