aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/General/InventoryConfig.cs67
-rw-r--r--OpenSim/Framework/General/InventoryItemBase.cs30
-rw-r--r--OpenSim/Framework/General/NetworkServersInfo.cs6
3 files changed, 101 insertions, 2 deletions
diff --git a/OpenSim/Framework/General/InventoryConfig.cs b/OpenSim/Framework/General/InventoryConfig.cs
new file mode 100644
index 0000000..9ba3e07
--- /dev/null
+++ b/OpenSim/Framework/General/InventoryConfig.cs
@@ -0,0 +1,67 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4
5namespace OpenSim.Framework
6{
7 /// <summary>
8 /// UserConfig -- For User Server Configuration
9 /// </summary>
10 public class InventoryConfig
11 {
12 public string DefaultStartupMsg = "";
13 public string UserServerURL = "";
14 public string UserSendKey = "";
15 public string UserRecvKey = "";
16
17 public string DatabaseProvider = "";
18 public static uint DefaultHttpPort = 8004;
19
20 public int HttpPort = 8004;
21
22 private ConfigurationMember configMember;
23
24 public InventoryConfig(string description, string filename)
25 {
26 configMember = new ConfigurationMember(filename, description, this.loadConfigurationOptions, this.handleIncomingConfiguration);
27 configMember.performConfigurationRetrieve();
28 }
29
30 public void loadConfigurationOptions()
31 {
32 configMember.addConfigurationOption("default_startup_message", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Default Startup Message", "Welcome to OGS", false);
33 configMember.addConfigurationOption("default_user_server", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Default User Server URI", "http://127.0.0.1:" + UserConfig.DefaultHttpPort.ToString(), false);
34 configMember.addConfigurationOption("user_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to send to user server", "null", false);
35 configMember.addConfigurationOption("user_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to expect from user server", "null", false);
36 configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "DLL for database provider", "OpenSim.Framework.Data.MySQL.dll", false);
37 configMember.addConfigurationOption("http_port", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Http Listener port", DefaultHttpPort.ToString(), false);
38 }
39
40 public bool handleIncomingConfiguration(string configuration_key, object configuration_result)
41 {
42 switch (configuration_key)
43 {
44 case "default_startup_message":
45 this.DefaultStartupMsg = (string)configuration_result;
46 break;
47 case "default_user_server":
48 this.UserServerURL = (string)configuration_result;
49 break;
50 case "user_send_key":
51 this.UserSendKey = (string)configuration_result;
52 break;
53 case "user_recv_key":
54 this.UserRecvKey = (string)configuration_result;
55 break;
56 case "database_provider":
57 this.DatabaseProvider = (string)configuration_result;
58 break;
59 case "http_port":
60 HttpPort = (int)configuration_result;
61 break;
62 }
63
64 return true;
65 }
66 }
67}
diff --git a/OpenSim/Framework/General/InventoryItemBase.cs b/OpenSim/Framework/General/InventoryItemBase.cs
index 45700ae..f782913 100644
--- a/OpenSim/Framework/General/InventoryItemBase.cs
+++ b/OpenSim/Framework/General/InventoryItemBase.cs
@@ -25,6 +25,9 @@
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26* 26*
27*/ 27*/
28using System;
29using System.Xml.Serialization;
30using System.Collections;
28using System.Collections.Generic; 31using System.Collections.Generic;
29using libsecondlife; 32using libsecondlife;
30 33
@@ -242,4 +245,29 @@ namespace OpenSim.Framework
242 /// <param name="folder">The id of the folder</param> 245 /// <param name="folder">The id of the folder</param>
243 void deleteInventoryFolder(LLUUID folder); 246 void deleteInventoryFolder(LLUUID folder);
244 } 247 }
245} \ No newline at end of file 248
249 /*
250 * .Net has some issues, serializing a dictionary, so we cannot reuse the InventoryFolder
251 * class defined in Communications.Framework.Communications.Caches. So we serialize/deserialize
252 * into this simpler class, and then use that.
253 */
254 [XmlRoot(ElementName = "inventory", IsNullable = true)]
255 public class SerializableInventory
256 {
257 [XmlRoot(ElementName = "folder", IsNullable = true)]
258 public class SerializableFolder : InventoryFolderBase
259 {
260 [XmlArray(ElementName = "folders", IsNullable = true)]
261 [XmlArrayItem(ElementName = "folder", IsNullable = true, Type = typeof(SerializableFolder))]
262 public ArrayList SubFolders;
263
264 [XmlArray(ElementName = "items", IsNullable = true)]
265 [XmlArrayItem(ElementName = "item", IsNullable = true, Type = typeof(InventoryItemBase))]
266 public ArrayList Items;
267 }
268
269 [XmlElement(ElementName = "folder", IsNullable = true)]
270 public SerializableFolder root;
271 }
272
273}
diff --git a/OpenSim/Framework/General/NetworkServersInfo.cs b/OpenSim/Framework/General/NetworkServersInfo.cs
index 98d489e..aa8aa2b 100644
--- a/OpenSim/Framework/General/NetworkServersInfo.cs
+++ b/OpenSim/Framework/General/NetworkServersInfo.cs
@@ -43,6 +43,8 @@ namespace OpenSim.Framework
43 public string UserRecvKey = ""; 43 public string UserRecvKey = "";
44 public bool isSandbox; 44 public bool isSandbox;
45 45
46 public string InventoryURL = "";
47
46 public static int DefaultHttpListenerPort = 9000; 48 public static int DefaultHttpListenerPort = 9000;
47 public int HttpListenerPort = DefaultHttpListenerPort; 49 public int HttpListenerPort = DefaultHttpListenerPort;
48 50
@@ -91,6 +93,8 @@ namespace OpenSim.Framework
91 UserSendKey = config.Configs["Network"].GetString("user_send_key", "null"); 93 UserSendKey = config.Configs["Network"].GetString("user_send_key", "null");
92 UserRecvKey = config.Configs["Network"].GetString("user_recv_key", "null"); 94 UserRecvKey = config.Configs["Network"].GetString("user_recv_key", "null");
93 AssetURL = config.Configs["Network"].GetString("asset_server_url", AssetURL); 95 AssetURL = config.Configs["Network"].GetString("asset_server_url", AssetURL);
96 InventoryURL = config.Configs["Network"].GetString("inventory_server_url",
97 "http://127.0.0.1:" + InventoryConfig.DefaultHttpPort.ToString());
94 } 98 }
95 } 99 }
96} \ No newline at end of file 100}