Exemplo n.º 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);
            }
        }
Exemplo n.º 2
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);
            }
        }