aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application
diff options
context:
space:
mode:
authorlbsa712007-10-26 14:08:36 +0000
committerlbsa712007-10-26 14:08:36 +0000
commit070047ce1bc74cceebd5e817a0e042a7390c5f24 (patch)
tree074326d9e948655f5b2c0c378d601d611e1d4f4d /OpenSim/Region/Application
parentRegion ground texture was not marked as temporary, when being created, and as... (diff)
downloadopensim-SC_OLD-070047ce1bc74cceebd5e817a0e042a7390c5f24.zip
opensim-SC_OLD-070047ce1bc74cceebd5e817a0e042a7390c5f24.tar.gz
opensim-SC_OLD-070047ce1bc74cceebd5e817a0e042a7390c5f24.tar.bz2
opensim-SC_OLD-070047ce1bc74cceebd5e817a0e042a7390c5f24.tar.xz
* Added prototypical AvatarFactory module interface to load avatar parameters
* Added dump_assets_to_file option to enable asset dumping for debug * normalized some namespaces * InventoryFolder renamed to InventoryFolderImpl to
Diffstat (limited to 'OpenSim/Region/Application')
-rw-r--r--OpenSim/Region/Application/OpenSimMain.cs103
1 files changed, 63 insertions, 40 deletions
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs
index f550ee2..fdaaa51 100644
--- a/OpenSim/Region/Application/OpenSimMain.cs
+++ b/OpenSim/Region/Application/OpenSimMain.cs
@@ -44,7 +44,7 @@ using OpenSim.Region.Environment;
44using OpenSim.Region.Environment.Scenes; 44using OpenSim.Region.Environment.Scenes;
45using OpenSim.Region.Physics.Manager; 45using OpenSim.Region.Physics.Manager;
46using System.Globalization; 46using System.Globalization;
47using RegionInfo=OpenSim.Framework.Types.RegionInfo; 47using RegionInfo = OpenSim.Framework.Types.RegionInfo;
48 48
49namespace OpenSim 49namespace OpenSim
50{ 50{
@@ -78,21 +78,25 @@ namespace OpenSim
78 private readonly string m_logFilename = ("region-console.log"); 78 private readonly string m_logFilename = ("region-console.log");
79 private bool m_permissions = false; 79 private bool m_permissions = false;
80 80
81 private bool standaloneAuthenticate = false; 81 private bool m_standaloneAuthenticate = false;
82 private string standaloneWelcomeMessage = null; 82 private string m_standaloneWelcomeMessage = null;
83 private string standaloneInventoryPlugin = "OpenSim.Framework.Data.SQLite.dll"; 83 private string m_standaloneInventoryPlugin = "OpenSim.Framework.Data.SQLite.dll";
84 private string standaloneAssetPlugin = "OpenSim.Framework.Data.SQLite.dll"; 84 private string m_standaloneAssetPlugin = "OpenSim.Framework.Data.SQLite.dll";
85 private string standaloneUserPlugin = "OpenSim.Framework.Data.DB4o.dll"; 85 private string m_standaloneUserPlugin = "OpenSim.Framework.Data.DB4o.dll";
86 86
87 private string m_assetStorage = "db4o"; 87 private string m_assetStorage = "db4o";
88 88
89 public ConsoleCommand CreateAccount = null; 89 public ConsoleCommand CreateAccount = null;
90 private bool m_dumpAssetsToFile;
90 91
91 public OpenSimMain(IConfigSource configSource) 92 public OpenSimMain(IConfigSource configSource)
92 : base() 93 : base()
93 { 94 {
94 string iniFile = configSource.Configs["Startup"].GetString("inifile", "OpenSim.ini"); 95 IConfig startupConfig = configSource.Configs["Startup"];
95 string useExecutePathString = configSource.Configs["Startup"].GetString("useexecutepath", "false").ToLower(); 96
97 string iniFile = startupConfig.GetString("inifile", "OpenSim.ini");
98 string useExecutePathString = startupConfig.GetString("useexecutepath", "false").ToLower();
99
96 bool useExecutePath = false; 100 bool useExecutePath = false;
97 if (useExecutePathString == "true" || useExecutePathString == "" || useExecutePathString == "1" || useExecutePathString == "yes") 101 if (useExecutePathString == "true" || useExecutePathString == "" || useExecutePathString == "1" || useExecutePathString == "yes")
98 { 102 {
@@ -112,38 +116,57 @@ namespace OpenSim
112 //(as if someone has bothered to enter a command line arg, we should take notice of it) 116 //(as if someone has bothered to enter a command line arg, we should take notice of it)
113 m_config.Merge(configSource); 117 m_config.Merge(configSource);
114 } 118 }
119 else
120 {
121 m_config = configSource;
122 }
115 123
116 ReadConfigSettings(); 124 ReadConfigSettings();
117
118 } 125 }
119 126
120 protected void ReadConfigSettings() 127 protected void ReadConfigSettings()
121 { 128 {
122 m_networkServersInfo = new NetworkServersInfo(); 129 m_networkServersInfo = new NetworkServersInfo();
123 m_sandbox = !m_config.Configs["Startup"].GetBoolean("gridmode", false);
124 m_physicsEngine = m_config.Configs["Startup"].GetString("physics", "basicphysics");
125 m_verbose = m_config.Configs["Startup"].GetBoolean("verbose", true);
126 m_permissions = m_config.Configs["Startup"].GetBoolean("serverside_object_permissions", false);
127 130
128 m_storageDLL = m_config.Configs["Startup"].GetString("storage_plugin", "OpenSim.DataStore.NullStorage.dll"); 131 IConfig startupConfig = m_config.Configs["Startup"];
132
133 if (startupConfig != null )
134 {
135 m_sandbox = !startupConfig.GetBoolean("gridmode", false);
136 m_physicsEngine = startupConfig.GetString("physics", "basicphysics");
137 m_verbose = startupConfig.GetBoolean("verbose", true);
138 m_permissions = startupConfig.GetBoolean("serverside_object_permissions", false);
139
140 m_storageDLL = startupConfig.GetString("storage_plugin", "OpenSim.DataStore.NullStorage.dll");
129 141
130 m_startupCommandsFile = m_config.Configs["Startup"].GetString("startup_console_commands_file", ""); 142 m_startupCommandsFile = startupConfig.GetString("startup_console_commands_file", "");
131 m_shutdownCommandsFile = m_config.Configs["Startup"].GetString("shutdown_console_commands_file", ""); 143 m_shutdownCommandsFile = startupConfig.GetString("shutdown_console_commands_file", "");
132 144
133 m_scriptEngine = m_config.Configs["Startup"].GetString("script_engine", "DotNetEngine"); 145 m_scriptEngine = startupConfig.GetString("script_engine", "DotNetEngine");
134 146
135 m_assetStorage = m_config.Configs["Startup"].GetString("asset_database", "db4o"); 147 m_assetStorage = startupConfig.GetString("asset_database", "db4o");
136 148
137 m_config.Configs["Startup"].GetBoolean("default_modules", true); 149 // wtf?
138 m_config.Configs["Startup"].GetBoolean("default_shared_modules", true); 150 startupConfig.GetBoolean("default_modules", true);
139 m_config.Configs["Startup"].GetString("except_modules", ""); 151 startupConfig.GetBoolean("default_shared_modules", true);
140 m_config.Configs["Startup"].GetString("except_shared_modules", ""); 152 startupConfig.GetString("except_modules", "");
153 startupConfig.GetString("except_shared_modules", "");
154 }
155
156 IConfig standaloneConfig = m_config.Configs["StandAlone"];
157 if (standaloneConfig != null)
158 {
159 m_standaloneAuthenticate = standaloneConfig.GetBoolean("accounts_authenticate", false);
160 m_standaloneWelcomeMessage = standaloneConfig.GetString("welcome_message", "Welcome to OpenSim");
161 m_standaloneInventoryPlugin =
162 standaloneConfig.GetString("inventory_plugin", "OpenSim.Framework.Data.SQLite.dll");
163 m_standaloneUserPlugin =
164 standaloneConfig.GetString("userDatabase_plugin", "OpenSim.Framework.Data.DB4o.dll");
165 m_standaloneAssetPlugin = standaloneConfig.GetString("asset_plugin", "OpenSim.Framework.Data.SQLite.dll");
166
167 m_dumpAssetsToFile = standaloneConfig.GetBoolean("dump_assets_to_file", false);
168 }
141 169
142 standaloneAuthenticate = m_config.Configs["StandAlone"].GetBoolean("accounts_authenticate", false);
143 standaloneWelcomeMessage = m_config.Configs["StandAlone"].GetString("welcome_message", "Welcome to OpenSim");
144 standaloneInventoryPlugin = m_config.Configs["StandAlone"].GetString("inventory_plugin", "OpenSim.Framework.Data.SQLite.dll");
145 standaloneUserPlugin = m_config.Configs["StandAlone"].GetString("userDatabase_plugin", "OpenSim.Framework.Data.DB4o.dll");
146 standaloneAssetPlugin = m_config.Configs["StandAlone"].GetString("asset_plugin", "OpenSim.Framework.Data.SQLite.dll");
147 m_networkServersInfo.loadFromConfiguration(m_config); 170 m_networkServersInfo.loadFromConfiguration(m_config);
148 } 171 }
149 172
@@ -168,22 +191,22 @@ namespace OpenSim
168 if (m_sandbox) 191 if (m_sandbox)
169 { 192 {
170 LocalInventoryService inventoryService = new LocalInventoryService(); 193 LocalInventoryService inventoryService = new LocalInventoryService();
171 inventoryService.AddPlugin(standaloneInventoryPlugin); 194 inventoryService.AddPlugin(m_standaloneInventoryPlugin);
172 195
173 LocalUserServices userService = new LocalUserServices(m_networkServersInfo, m_networkServersInfo.DefaultHomeLocX, m_networkServersInfo.DefaultHomeLocY, inventoryService ); 196 LocalUserServices userService = new LocalUserServices(m_networkServersInfo, m_networkServersInfo.DefaultHomeLocX, m_networkServersInfo.DefaultHomeLocY, inventoryService);
174 userService.AddPlugin( standaloneUserPlugin ); 197 userService.AddPlugin(m_standaloneUserPlugin);
175 198
176 LocalBackEndServices backendService = new LocalBackEndServices(); 199 LocalBackEndServices backendService = new LocalBackEndServices();
177 200
178 CommunicationsLocal localComms = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache, userService, inventoryService, backendService, backendService); 201 CommunicationsLocal localComms = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache, userService, inventoryService, backendService, backendService, m_dumpAssetsToFile);
179 m_commsManager = localComms; 202 m_commsManager = localComms;
180 203
181 m_loginService = new LocalLoginService(userService, standaloneWelcomeMessage, localComms, m_networkServersInfo, standaloneAuthenticate); 204 m_loginService = new LocalLoginService(userService, m_standaloneWelcomeMessage, localComms, m_networkServersInfo, m_standaloneAuthenticate);
182 m_loginService.OnLoginToRegion += backendService.AddNewSession; 205 m_loginService.OnLoginToRegion += backendService.AddNewSession;
183 206
184 m_httpServer.AddXmlRPCHandler("login_to_simulator", m_loginService.XmlRpcLoginMethod); 207 m_httpServer.AddXmlRPCHandler("login_to_simulator", m_loginService.XmlRpcLoginMethod);
185 208
186 if (standaloneAuthenticate) 209 if (m_standaloneAuthenticate)
187 { 210 {
188 this.CreateAccount = localComms.doCreate; 211 this.CreateAccount = localComms.doCreate;
189 } 212 }
@@ -209,7 +232,7 @@ namespace OpenSim
209 configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); 232 configFiles = Directory.GetFiles(regionConfigPath, "*.xml");
210 } 233 }
211 234
212 m_moduleLoader = new ModuleLoader( m_log, m_config ); 235 m_moduleLoader = new ModuleLoader(m_log, m_config);
213 MainLog.Instance.Verbose("Loading Shared Modules"); 236 MainLog.Instance.Verbose("Loading Shared Modules");
214 m_moduleLoader.LoadDefaultSharedModules(); 237 m_moduleLoader.LoadDefaultSharedModules();
215 238
@@ -240,10 +263,10 @@ namespace OpenSim
240 } 263 }
241 else 264 else
242 { 265 {
243 MainLog.Instance.Verbose("STARTUP","No startup command script specified. Moving on..."); 266 MainLog.Instance.Verbose("STARTUP", "No startup command script specified. Moving on...");
244 } 267 }
245 268
246 MainLog.Instance.Status("STARTUP","Startup complete, serving " + m_udpServers.Count.ToString() + " region(s)"); 269 MainLog.Instance.Status("STARTUP", "Startup complete, serving " + m_udpServers.Count.ToString() + " region(s)");
247 } 270 }
248 271
249 public UDPServer CreateRegion(RegionInfo regionInfo) 272 public UDPServer CreateRegion(RegionInfo regionInfo)
@@ -289,7 +312,7 @@ namespace OpenSim
289 312
290 protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager, AgentCircuitManager circuitManager) 313 protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager, AgentCircuitManager circuitManager)
291 { 314 {
292 return new Scene(regionInfo, circuitManager, m_commsManager, m_assetCache, storageManager, m_httpServer, m_moduleLoader); 315 return new Scene(regionInfo, circuitManager, m_commsManager, m_assetCache, storageManager, m_httpServer, m_moduleLoader, m_dumpAssetsToFile);
293 } 316 }
294 317
295 protected override void Initialize() 318 protected override void Initialize()
@@ -307,7 +330,7 @@ namespace OpenSim
307 } 330 }
308 else 331 else
309 { 332 {
310 SQLAssetServer sqlAssetServer = new SQLAssetServer(standaloneAssetPlugin); 333 SQLAssetServer sqlAssetServer = new SQLAssetServer(m_standaloneAssetPlugin);
311 sqlAssetServer.LoadDefaultAssets(); 334 sqlAssetServer.LoadDefaultAssets();
312 assetServer = sqlAssetServer; 335 assetServer = sqlAssetServer;
313 } 336 }
@@ -408,7 +431,7 @@ namespace OpenSim
408 } 431 }
409 else 432 else
410 { 433 {
411 MainLog.Instance.Error("COMMANDFILE","Command script missing. Can not run commands"); 434 MainLog.Instance.Error("COMMANDFILE", "Command script missing. Can not run commands");
412 } 435 }
413 } 436 }
414 437