aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid
diff options
context:
space:
mode:
authorlbsa712008-03-12 09:50:12 +0000
committerlbsa712008-03-12 09:50:12 +0000
commitf1b8712da3da326400c04892bd0cce56e832fc17 (patch)
treec416833c7607843543f3dc9830bc6172846c8596 /OpenSim/Grid
parent* Refactored out creation of LoginResponse (diff)
downloadopensim-SC_OLD-f1b8712da3da326400c04892bd0cce56e832fc17.zip
opensim-SC_OLD-f1b8712da3da326400c04892bd0cce56e832fc17.tar.gz
opensim-SC_OLD-f1b8712da3da326400c04892bd0cce56e832fc17.tar.bz2
opensim-SC_OLD-f1b8712da3da326400c04892bd0cce56e832fc17.tar.xz
* Refactored some internals in Grid Server Main
Diffstat (limited to 'OpenSim/Grid')
-rw-r--r--OpenSim/Grid/GridServer/Main.cs45
1 files changed, 21 insertions, 24 deletions
diff --git a/OpenSim/Grid/GridServer/Main.cs b/OpenSim/Grid/GridServer/Main.cs
index b13ab0c..bf78cf9 100644
--- a/OpenSim/Grid/GridServer/Main.cs
+++ b/OpenSim/Grid/GridServer/Main.cs
@@ -40,17 +40,7 @@ namespace OpenSim.Grid.GridServer
40 public class OpenGrid_Main : BaseOpenSimServer, conscmd_callback 40 public class OpenGrid_Main : BaseOpenSimServer, conscmd_callback
41 { 41 {
42 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 42 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
43 43 private GridConfig m_config;
44 public GridConfig Cfg;
45
46 public static OpenGrid_Main thegrid;
47
48 public static bool setuponly;
49
50 //public LLUUID highestUUID;
51
52 // private SimProfileManager m_simProfileManager;
53
54 private GridManager m_gridManager; 44 private GridManager m_gridManager;
55 45
56 [STAThread] 46 [STAThread]
@@ -58,16 +48,20 @@ namespace OpenSim.Grid.GridServer
58 { 48 {
59 log4net.Config.XmlConfigurator.Configure(); 49 log4net.Config.XmlConfigurator.Configure();
60 50
61 if (args.Length > 0) 51 OpenGrid_Main app = new OpenGrid_Main();
52
53 if (args.Length > 0 && args[0] == "-setuponly")
62 { 54 {
63 if (args[0] == "-setuponly") setuponly = true; 55 app.Config();
64 } 56 }
65 m_log.Info("Starting...\n"); 57 else
58 {
59 m_log.Info("Starting...\n");
66 60
67 thegrid = new OpenGrid_Main(); 61 app.Startup();
68 thegrid.Startup();
69 62
70 thegrid.Work(); 63 app.Work();
64 }
71 } 65 }
72 66
73 private void Work() 67 private void Work()
@@ -98,18 +92,16 @@ namespace OpenSim.Grid.GridServer
98 92
99 public void Startup() 93 public void Startup()
100 { 94 {
101 Cfg = new GridConfig("GRID SERVER", (Path.Combine(Util.configDir(), "GridServer_Config.xml"))); 95 Config();
102 //Yeah srsly, that's it.
103 if (setuponly) Environment.Exit(0);
104 96
105 m_log.Info("[GRID]: Connecting to Storage Server"); 97 m_log.Info("[GRID]: Connecting to Storage Server");
106 m_gridManager = new GridManager(); 98 m_gridManager = new GridManager();
107 m_gridManager.AddPlugin(Cfg.DatabaseProvider); // Made of win 99 m_gridManager.AddPlugin(m_config.DatabaseProvider); // Made of win
108 m_gridManager.Config = Cfg; 100 m_gridManager.Config = m_config;
109 101
110 m_log.Info("[GRID]: Starting HTTP process"); 102 m_log.Info("[GRID]: Starting HTTP process");
111 BaseHttpServer httpServer = new BaseHttpServer(Cfg.HttpPort); 103 BaseHttpServer httpServer = new BaseHttpServer(m_config.HttpPort);
112 //GridManagementAgent GridManagerAgent = new GridManagementAgent(httpServer, "gridserver", Cfg.SimSendKey, Cfg.SimRecvKey, managercallback); 104 //GridManagementAgent GridManagerAgent = new GridManagementAgent(httpServer, "gridserver", m_config.SimSendKey, m_config.SimRecvKey, managercallback);
113 105
114 httpServer.AddXmlRPCHandler("simulator_login", m_gridManager.XmlRpcSimulatorLoginMethod); 106 httpServer.AddXmlRPCHandler("simulator_login", m_gridManager.XmlRpcSimulatorLoginMethod);
115 httpServer.AddXmlRPCHandler("simulator_data_request", m_gridManager.XmlRpcSimulatorDataRequestMethod); 107 httpServer.AddXmlRPCHandler("simulator_data_request", m_gridManager.XmlRpcSimulatorDataRequestMethod);
@@ -140,6 +132,11 @@ namespace OpenSim.Grid.GridServer
140 simCheckTimer.Enabled = true; 132 simCheckTimer.Enabled = true;
141 } 133 }
142 134
135 private void Config()
136 {
137 m_config = new GridConfig("GRID SERVER", (Path.Combine(Util.configDir(), "GridServer_Config.xml")));
138 }
139
143 public void CheckSims(object sender, ElapsedEventArgs e) 140 public void CheckSims(object sender, ElapsedEventArgs e)
144 { 141 {
145 /* 142 /*