public void InitalizeTables(
            AsyncRPGDataContext dbContext,
            Logger logger)
        {
            // Save the server constants into the DB
            ConfigQueries.InitializeConfig(
                dbContext,
                m_config.APPLICATION_VERSION,
                m_config.APPLICATION_WEB_URL,
                m_config.APPLICATION_DEBUG_WEB_URL,
                m_config.ACCOUNT_CLIENT_URL,
                m_config.WEB_SERVICE_EMAIL_ADDRESS,
                m_config.WEB_SERVICE_EMAIL_HOST,
                m_config.WEB_SERVICE_EMAIL_PORT,
                m_config.WEB_SERVICE_EMAIL_USERNAME,
                m_config.WEB_SERVICE_EMAIL_PASSWORD,
                m_config.DEFAULT_IRC_SERVER,
                m_config.DEFAULT_IRC_PORT);

            // Create test accounts
            AccountQueries.CreateAccountNoEmailVerify(
                dbContext,
                "test",
                AccountQueries.ClientPasswordHash("password"),
                "*****@*****.**",
                DatabaseConstants.OpsLevel.player);
            AccountQueries.CreateAccountNoEmailVerify(
                dbContext,
                "test2",
                AccountQueries.ClientPasswordHash("password"),
                "*****@*****.**",
                DatabaseConstants.OpsLevel.player);

            // Re-import the mob type JSON data into the DB
            {
                MobTypeImporter importer = new MobTypeImporter(logger);

                importer.ParseMobTypes(dbContext, m_config.MOBS_DIRECTORY + "/mob_types.json");
            }

            // Re-import the mob spawn tables JSON data into the DB (dependent on mob types)
            {
                MobSpawnTableImporter importer = new MobSpawnTableImporter(logger);

                importer.ParseMobSpawnTables(dbContext, m_config.MOBS_DIRECTORY + "/mob_spawn_tables.json");
            }

            // Re-import the room template XML into the DB (dependent on mob types and spawn tables)
            // This also does some import processing on the room templates (visibility, nav-mesh, etc).
            {
                RoomTemplateImporter importer = new RoomTemplateImporter(logger);

                importer.ParseRoomTemplates(dbContext, m_config.MAPS_DIRECTORY);
            }
        }
示例#2
0
        public void InitalizeTables(
            AsyncRPGDataContext dbContext,
            Logger logger)
        {
            // Save the server constants into the DB
            ConfigQueries.InitializeConfig(
                dbContext,
                m_config.APPLICATION_VERSION,
                m_config.APPLICATION_WEB_URL,
                m_config.APPLICATION_DEBUG_WEB_URL,
                m_config.ACCOUNT_CLIENT_URL,
                m_config.WEB_SERVICE_EMAIL_ADDRESS,
                m_config.WEB_SERVICE_EMAIL_HOST,
                m_config.WEB_SERVICE_EMAIL_PORT,
                m_config.WEB_SERVICE_EMAIL_USERNAME,
                m_config.WEB_SERVICE_EMAIL_PASSWORD,
                m_config.DEFAULT_IRC_SERVER,
                m_config.DEFAULT_IRC_PORT);

            // Create test accounts
            AccountQueries.CreateAccountNoEmailVerify(
                dbContext,
                "test",
                AccountQueries.ClientPasswordHash("password"),
                "*****@*****.**",
                DatabaseConstants.OpsLevel.player);
            AccountQueries.CreateAccountNoEmailVerify(
                dbContext,
                "test2",
                AccountQueries.ClientPasswordHash("password"),
                "*****@*****.**",
                DatabaseConstants.OpsLevel.player);

            // Re-import the mob type JSON data into the DB
            {
                MobTypeImporter importer = new MobTypeImporter(logger);

                importer.ParseMobTypes(dbContext, m_config.MOBS_DIRECTORY + "/mob_types.json");
            }

            // Re-import the mob spawn tables JSON data into the DB (dependent on mob types)
            {
                MobSpawnTableImporter importer = new MobSpawnTableImporter(logger);

                importer.ParseMobSpawnTables(dbContext, m_config.MOBS_DIRECTORY + "/mob_spawn_tables.json");
            }

            // Re-import the room template XML into the DB (dependent on mob types and spawn tables)
            // This also does some import processing on the room templates (visibility, nav-mesh, etc).
            {
                RoomTemplateImporter importer = new RoomTemplateImporter(logger);

                importer.ParseRoomTemplates(dbContext, m_config.MAPS_DIRECTORY);
            }
        }