override public void StartUp() { this.regionData = new RegionInfo(); //need to set region info (should we even be using RegionInfo?) /* try * { * this.localConfig = new XmlConfig(m_config); * this.localConfig.LoadData(); * } * catch (Exception e) * { * Console.WriteLine(e.Message); * } * * m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Loading configuration"); * this.regionData.InitConfig(this.m_sandbox, this.localConfig); * this.localConfig.Close();*/ GridServers = new Grid(); this.SetupLocalGridServers(); AuthenticateSessionsLocal authen = new AuthenticateSessionsLocal(); this.AuthenticateSessionsHandler = authen; startuptime = DateTime.Now; AssetCache = new AssetCache(GridServers.AssetServer); InventoryCache = new InventoryCache(); m_udpServer = new UDPServer(this.regionData.IPListenPort, this.GridServers, this.AssetCache, this.InventoryCache, this.regionData, this.m_sandbox, this.user_accounts, this.m_console, this.AuthenticateSessionsHandler); this.SetupLocalWorld(); this.SetupHttpListener(); SweeperLoginServer loginServer = new SweeperLoginServer(m_endPoint, m_regionX, m_regionY); loginServer.Startup(); loginServer.SetSessionHandler(((AuthenticateSessionsLocal)this.AuthenticateSessionsHandler).AddNewSession); httpServer.AddXmlRPCHandler("login_to_simulator", loginServer.XmlRpcLoginMethod); AdminWebFront adminWebFront = new AdminWebFront("Admin", LocalWorld, InventoryCache, null); adminWebFront.LoadMethods(httpServer); //Start http server m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Starting HTTP server"); httpServer.Start(); // Start UDP server this.m_udpServer.ServerListener(); }
/// <summary> /// Performs initialisation of the world, such as loading configuration from disk. /// </summary> public virtual void StartUp() { this.regionData = new RegionInfo(); try { this.localConfig = new XmlConfig(m_config); this.localConfig.LoadData(); } catch (Exception e) { Console.WriteLine(e.Message); } m_console.WriteLine("Main.cs:Startup() - Loading configuration"); this.regionData.InitConfig(this.m_sandbox, this.localConfig); this.localConfig.Close();//for now we can close it as no other classes read from it , but this should change GridServers = new Grid(); if (m_sandbox) { GridServers.AssetDll = "OpenSim.GridInterfaces.Local.dll"; GridServers.GridDll = "OpenSim.GridInterfaces.Local.dll"; m_console.WriteLine("Starting in Sandbox mode"); } else { if (this.gridLocalAsset) { GridServers.AssetDll = "OpenSim.GridInterfaces.Local.dll"; } else { GridServers.AssetDll = "OpenSim.GridInterfaces.Remote.dll"; } GridServers.GridDll = "OpenSim.GridInterfaces.Remote.dll"; m_console.WriteLine("Starting in Grid mode"); } try { GridServers.Initialise(); } catch (Exception e) { m_console.WriteLine(e.Message + "\nSorry, could not setup the grid interface"); Environment.Exit(1); } startuptime = DateTime.Now; try { AssetCache = new AssetCache(GridServers.AssetServer); InventoryCache = new InventoryCache(); } catch (Exception e) { m_console.WriteLine(e.Message + "\nSorry, could not setup local cache"); Environment.Exit(1); } //should be passing a IGenericConfig object to these so they can read the config data they want from it GridServers.AssetServer.SetServerInfo(regionData.AssetURL, regionData.AssetSendKey); IGridServer gridServer = GridServers.GridServer; gridServer.SetServerInfo(regionData.GridURL, regionData.GridSendKey, regionData.GridRecvKey); this.physManager = new OpenSim.Physics.Manager.PhysicsManager(); this.physManager.LoadPlugins(); this.CustomiseStartup(); m_console.WriteLine("Main.cs:Startup() - Initialising HTTP server"); // HttpServer = new SimCAPSHTTPServer(GridServers.GridServer, Cfg.IPListenPort); BaseHttpServer httpServer = new BaseHttpServer(regionData.IPListenPort); LoginServer loginServer = null; LoginServer adminLoginServer = null; bool sandBoxWithLoginServer = m_loginserver && m_sandbox; if (sandBoxWithLoginServer) { loginServer = new LoginServer(gridServer, regionData.IPListenAddr, regionData.IPListenPort, regionData.RegionLocX, regionData.RegionLocY, this.user_accounts); loginServer.Startup(); if (user_accounts) { //sandbox mode with loginserver using accounts this.GridServers.UserServer = loginServer; adminLoginServer = loginServer; httpServer.AddXmlRPCHandler("login_to_simulator", loginServer.LocalUserManager.XmlRpcLoginMethod); } else { //sandbox mode with loginserver not using accounts httpServer.AddXmlRPCHandler("login_to_simulator", loginServer.XmlRpcLoginMethod); } } AdminWebFront adminWebFront = new AdminWebFront("Admin", LocalWorld, InventoryCache, adminLoginServer); adminWebFront.LoadMethods(httpServer); m_console.WriteLine("Main.cs:Startup() - Starting HTTP server"); httpServer.Start(); MainServerListener(); m_heartbeatTimer.Enabled = true; m_heartbeatTimer.Interval = 100; m_heartbeatTimer.Elapsed += new ElapsedEventHandler(this.Heartbeat); }