diff options
author | Justin Clarke Casey | 2008-04-11 15:00:41 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-04-11 15:00:41 +0000 |
commit | b3892096f3bbdb3310abd9feb341b3a040bbf081 (patch) | |
tree | 37a829ab7b6d87b8b0aa4130be0adfc0ae9dc4a3 /OpenSim/Framework/RegionInfo.cs | |
parent | From: Kurt Taylor <krtaylor@us.ibm.com> (diff) | |
download | opensim-SC_OLD-b3892096f3bbdb3310abd9feb341b3a040bbf081.zip opensim-SC_OLD-b3892096f3bbdb3310abd9feb341b3a040bbf081.tar.gz opensim-SC_OLD-b3892096f3bbdb3310abd9feb341b3a040bbf081.tar.bz2 opensim-SC_OLD-b3892096f3bbdb3310abd9feb341b3a040bbf081.tar.xz |
* From: Dr Scofield <hud@zurich.ibm.com>
* This patch adds support for saving a dynamically generated region to the filesystem (as a region xml file)
* Also adds some error checknig to make sure the dynamically generated region name, id or location are not already taken.
* Thanks Dr Scofield
Diffstat (limited to 'OpenSim/Framework/RegionInfo.cs')
-rw-r--r-- | OpenSim/Framework/RegionInfo.cs | 61 |
1 files changed, 59 insertions, 2 deletions
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index 7f284d3..da20edc 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs | |||
@@ -38,8 +38,8 @@ namespace OpenSim.Framework | |||
38 | [Serializable] | 38 | [Serializable] |
39 | public class SimpleRegionInfo | 39 | public class SimpleRegionInfo |
40 | { | 40 | { |
41 | // private static readonly log4net.ILog m_log | 41 | // private static readonly log4net.ILog m_log |
42 | // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | 42 | // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); |
43 | 43 | ||
44 | public SimpleRegionInfo() | 44 | public SimpleRegionInfo() |
45 | { | 45 | { |
@@ -200,6 +200,9 @@ namespace OpenSim.Framework | |||
200 | 200 | ||
201 | public class RegionInfo : SimpleRegionInfo | 201 | public class RegionInfo : SimpleRegionInfo |
202 | { | 202 | { |
203 | // private static readonly log4net.ILog m_log | ||
204 | // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
205 | |||
203 | public string RegionName = String.Empty; | 206 | public string RegionName = String.Empty; |
204 | 207 | ||
205 | public string DataStore = String.Empty; | 208 | public string DataStore = String.Empty; |
@@ -343,6 +346,60 @@ namespace OpenSim.Framework | |||
343 | } | 346 | } |
344 | } | 347 | } |
345 | 348 | ||
349 | public bool ignoreIncomingConfiguration(string configuration_key, object configuration_result) | ||
350 | { | ||
351 | return true; | ||
352 | } | ||
353 | |||
354 | public void SaveRegionToFile(string description, string filename) { | ||
355 | configMember = new ConfigurationMember(filename, description, loadConfigurationOptionsFromMe, | ||
356 | ignoreIncomingConfiguration, false); | ||
357 | configMember.performConfigurationRetrieve(); | ||
358 | } | ||
359 | |||
360 | public void loadConfigurationOptionsFromMe() | ||
361 | { | ||
362 | configMember.addConfigurationOption("sim_UUID", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, | ||
363 | "UUID of Region (Default is recommended, random UUID)", | ||
364 | RegionID.ToString(), true); | ||
365 | configMember.addConfigurationOption("sim_name", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | ||
366 | "Region Name", RegionName, true); | ||
367 | configMember.addConfigurationOption("sim_location_x", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, | ||
368 | "Grid Location (X Axis)", m_regionLocX.ToString(), true); | ||
369 | configMember.addConfigurationOption("sim_location_y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, | ||
370 | "Grid Location (Y Axis)", m_regionLocY.ToString(), true); | ||
371 | //configMember.addConfigurationOption("datastore", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Filename for local storage", "OpenSim.db", false); | ||
372 | configMember.addConfigurationOption("internal_ip_address", | ||
373 | ConfigurationOption.ConfigurationTypes.TYPE_IP_ADDRESS, | ||
374 | "Internal IP Address for incoming UDP client connections", | ||
375 | m_internalEndPoint.Address.ToString(), | ||
376 | true); | ||
377 | configMember.addConfigurationOption("internal_ip_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32, | ||
378 | "Internal IP Port for incoming UDP client connections", | ||
379 | m_internalEndPoint.Port.ToString(), true); | ||
380 | configMember.addConfigurationOption("allow_alternate_ports", | ||
381 | ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, | ||
382 | "Allow sim to find alternate UDP ports when ports are in use?", | ||
383 | m_allow_alternate_ports.ToString(), true); | ||
384 | configMember.addConfigurationOption("external_host_name", | ||
385 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | ||
386 | "External Host Name", m_externalHostName, true); | ||
387 | configMember.addConfigurationOption("master_avatar_uuid", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, | ||
388 | "Master Avatar UUID", MasterAvatarAssignedUUID.ToString(), true); | ||
389 | configMember.addConfigurationOption("estate_covanant_uuid", | ||
390 | ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, "Estate Covenant", | ||
391 | CovenantID.ToString(), true); | ||
392 | configMember.addConfigurationOption("master_avatar_first", | ||
393 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | ||
394 | "First Name of Master Avatar", MasterAvatarFirstName, true); | ||
395 | configMember.addConfigurationOption("master_avatar_last", | ||
396 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | ||
397 | "Last Name of Master Avatar", MasterAvatarLastName, true); | ||
398 | configMember.addConfigurationOption("master_avatar_pass", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
399 | "(Sandbox Mode Only)Password for Master Avatar account", | ||
400 | MasterAvatarSandboxPassword, true); | ||
401 | } | ||
402 | |||
346 | public void loadConfigurationOptions() | 403 | public void loadConfigurationOptions() |
347 | { | 404 | { |
348 | configMember.addConfigurationOption("sim_UUID", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, | 405 | configMember.addConfigurationOption("sim_UUID", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, |