Example #1
0
        protected override void StartupSpecific()
        {
            AssetConfig config = new AssetConfig("ASSET SERVER", (Path.Combine(Util.configDir(), "AssetServer_Config.xml")));

            m_log.Info("[ASSET]: Setting up asset DB");
            setupDB(config);

            m_log.Info("[ASSET]: Loading default asset set from '" + config.AssetSetsLocation + "'");
            LoadDefaultAssets(config.AssetSetsLocation);

            m_log.Info("[ASSET]: Starting HTTP process");
            m_httpServer = new BaseHttpServer(config.HttpPort);

            m_stats = StatsManager.StartCollectingAssetStats();

            AddHttpHandlers();

            m_httpServer.Start();

            base.StartupSpecific();
        }
Example #2
0
 public void setupDB(AssetConfig config)
 {
     try
     {
         m_assetProvider = DataPluginFactory.LoadDataPlugin<IAssetDataPlugin>(config.DatabaseProvider, config.DatabaseConnect);
         if (m_assetProvider == null)
         {
             m_log.Error("[ASSET]: Failed to load a database plugin, server halting");
             Environment.Exit(-1);
         }
     }
     catch (Exception e)
     {
         m_log.Warn("[ASSET]: setupDB() - Exception occured");
         m_log.Warn("[ASSET]: " + e.ToString());
     }
 }