コード例 #1
0
        public DatabaseManager()
        {
            byte x = 0;

            Log.Debug("DatabaseManager", sLConsole.GetString("Started the database loading."));

            if (SQLiteConfig.Enabled)
            {
                x++;
                sdatabase = new SQLite(SQLiteConfig.FileName);
            }

            if (MySqlConfig.Enabled)
            {
                x++;
                mdatabase = new MySql(MySqlConfig.Host, MySqlConfig.Port, MySqlConfig.User, MySqlConfig.Password, MySqlConfig.Database, MySqlConfig.Charset);
            }

            Log.Debug("DatabaseManager", sLConsole.GetString("Selecting the Database."));

            if (x == 0)
            {
                Log.LargeError(sLConsole.GetString("MAJOR ERROR"));
                Log.Error("DatabaseManager", sLConsole.GetString("Database type's is not selected!"));
                SchumixBase.ServerDisconnect(false);
                Thread.Sleep(1000);
                Environment.Exit(1);
            }
            else if (x == 2)
            {
                Log.LargeError(sLConsole.GetString("MAJOR ERROR"));
                Log.Error("DatabaseManager", sLConsole.GetString("2 Database are selected!"));
                SchumixBase.ServerDisconnect(false);
                Thread.Sleep(1000);
                Environment.Exit(1);
            }
        }
コード例 #2
0
ファイル: DatabaseManager.cs プロジェクト: Schumix/Schumix2
        public DatabaseManager()
        {
            byte x = 0;
            Log.Debug("DatabaseManager", sLConsole.GetString("Started the database loading."));

            if(SQLiteConfig.Enabled)
            {
                x++;
                sdatabase = new SQLite(SQLiteConfig.FileName);
            }

            if(MySqlConfig.Enabled)
            {
                x++;
                mdatabase = new MySql(MySqlConfig.Host, MySqlConfig.Port, MySqlConfig.User, MySqlConfig.Password, MySqlConfig.Database, MySqlConfig.Charset);
            }

            Log.Debug("DatabaseManager", sLConsole.GetString("Selecting the Database."));

            if(x == 0)
            {
                Log.LargeError(sLConsole.GetString("MAJOR ERROR"));
                Log.Error("DatabaseManager", sLConsole.GetString("Database type's is not selected!"));
                SchumixBase.ServerDisconnect(false);
                Thread.Sleep(1000);
                Environment.Exit(1);
            }
            else if(x == 2)
            {
                Log.LargeError(sLConsole.GetString("MAJOR ERROR"));
                Log.Error("DatabaseManager", sLConsole.GetString("2 Database are selected!"));
                SchumixBase.ServerDisconnect(false);
                Thread.Sleep(1000);
                Environment.Exit(1);
            }
        }