diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/General/InventoryConfig.cs | 67 | ||||
-rw-r--r-- | OpenSim/Framework/General/InventoryItemBase.cs | 30 | ||||
-rw-r--r-- | OpenSim/Framework/General/NetworkServersInfo.cs | 6 | ||||
-rw-r--r-- | OpenSim/Grid/InventoryServer/InventoryManager.cs | 170 | ||||
-rw-r--r-- | OpenSim/Grid/InventoryServer/Main.cs | 55 | ||||
-rw-r--r-- | OpenSim/Region/Application/OpenSimMain.cs | 3 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs | 24 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Modules/ChatModule.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Modules/WorldCommModule.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/ScenePresence.cs | 2 |
12 files changed, 296 insertions, 71 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 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | |||
5 | namespace 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 | */ |
28 | using System; | ||
29 | using System.Xml.Serialization; | ||
30 | using System.Collections; | ||
28 | using System.Collections.Generic; | 31 | using System.Collections.Generic; |
29 | using libsecondlife; | 32 | using 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 | } |
diff --git a/OpenSim/Grid/InventoryServer/InventoryManager.cs b/OpenSim/Grid/InventoryServer/InventoryManager.cs index 016b8bb..ca9ebf4 100644 --- a/OpenSim/Grid/InventoryServer/InventoryManager.cs +++ b/OpenSim/Grid/InventoryServer/InventoryManager.cs | |||
@@ -26,37 +26,36 @@ | |||
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | using System; | 28 | using System; |
29 | using System.Collections; | 29 | using System.IO; |
30 | using System.Collections.Generic; | ||
31 | using System.Text; | 30 | using System.Text; |
32 | using OpenGrid.Framework.Data; | ||
33 | using libsecondlife; | ||
34 | using System.Reflection; | 31 | using System.Reflection; |
35 | 32 | using System.Collections; | |
33 | using System.Collections.Generic; | ||
36 | using System.Xml; | 34 | using System.Xml; |
37 | using Nwc.XmlRpc; | 35 | using System.Xml.Serialization; |
38 | using OpenSim.Framework.Sims; | 36 | using libsecondlife; |
39 | using OpenSim.Framework.Inventory; | ||
40 | using OpenSim.Framework.Utilities; | ||
41 | 37 | ||
42 | using System.Security.Cryptography; | 38 | using OpenSim.Framework; |
39 | using OpenSim.Framework.Console; | ||
40 | using OpenSim.Framework.Servers; | ||
43 | 41 | ||
44 | namespace OpenGridServices.InventoryServer | 42 | namespace OpenSim.Grid.InventoryServer |
45 | { | 43 | { |
46 | class InventoryManager | 44 | |
45 | public class InventoryManager | ||
47 | { | 46 | { |
48 | Dictionary<string, IInventoryData> _plugins = new Dictionary<string, IInventoryData>(); | 47 | IInventoryData _databasePlugin; |
49 | 48 | ||
50 | /// <summary> | 49 | /// <summary> |
51 | /// Adds a new inventory server plugin - user servers will be requested in the order they were loaded. | 50 | /// Adds a new inventory server plugin - user servers will be requested in the order they were loaded. |
52 | /// </summary> | 51 | /// </summary> |
53 | /// <param name="FileName">The filename to the inventory server plugin DLL</param> | 52 | /// <param name="FileName">The filename to the inventory server plugin DLL</param> |
54 | public void AddPlugin(string FileName) | 53 | public void AddDatabasePlugin(string FileName) |
55 | { | 54 | { |
56 | OpenSim.Framework.Console.MainConsole.Instance.Verbose( "Invenstorage: Attempting to load " + FileName); | 55 | MainLog.Instance.Verbose(OpenInventory_Main.LogName, "Invenstorage: Attempting to load " + FileName); |
57 | Assembly pluginAssembly = Assembly.LoadFrom(FileName); | 56 | Assembly pluginAssembly = Assembly.LoadFrom(FileName); |
58 | 57 | ||
59 | OpenSim.Framework.Console.MainConsole.Instance.Verbose( "Invenstorage: Found " + pluginAssembly.GetTypes().Length + " interfaces."); | 58 | MainLog.Instance.Verbose(OpenInventory_Main.LogName, "Invenstorage: Found " + pluginAssembly.GetTypes().Length + " interfaces."); |
60 | foreach (Type pluginType in pluginAssembly.GetTypes()) | 59 | foreach (Type pluginType in pluginAssembly.GetTypes()) |
61 | { | 60 | { |
62 | if (!pluginType.IsAbstract) | 61 | if (!pluginType.IsAbstract) |
@@ -67,8 +66,9 @@ namespace OpenGridServices.InventoryServer | |||
67 | { | 66 | { |
68 | IInventoryData plug = (IInventoryData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); | 67 | IInventoryData plug = (IInventoryData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); |
69 | plug.Initialise(); | 68 | plug.Initialise(); |
70 | this._plugins.Add(plug.getName(), plug); | 69 | _databasePlugin = plug; |
71 | OpenSim.Framework.Console.MainConsole.Instance.Verbose( "Invenstorage: Added IUserData Interface"); | 70 | MainLog.Instance.Verbose(OpenInventory_Main.LogName, "Invenstorage: Added IInventoryData Interface"); |
71 | break; | ||
72 | } | 72 | } |
73 | 73 | ||
74 | typeInterface = null; | 74 | typeInterface = null; |
@@ -78,48 +78,132 @@ namespace OpenGridServices.InventoryServer | |||
78 | pluginAssembly = null; | 78 | pluginAssembly = null; |
79 | } | 79 | } |
80 | 80 | ||
81 | public List<InventoryFolderBase> getRootFolders(LLUUID user) | 81 | protected static SerializableInventory loadInventoryFromXmlFile(string fileName) |
82 | { | ||
83 | FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read); | ||
84 | XmlReader reader = new XmlTextReader(fs); | ||
85 | XmlSerializer x = new XmlSerializer(typeof(SerializableInventory)); | ||
86 | SerializableInventory inventory = (SerializableInventory)x.Deserialize(reader); | ||
87 | fs.Close(); | ||
88 | fs.Dispose(); | ||
89 | return inventory; | ||
90 | } | ||
91 | |||
92 | protected static void saveInventoryToStream(SerializableInventory inventory, Stream s) | ||
82 | { | 93 | { |
83 | foreach (KeyValuePair<string, IInventoryData> kvp in _plugins) | 94 | XmlTextWriter writer = new XmlTextWriter(s, Encoding.UTF8); |
95 | writer.Formatting = Formatting.Indented; | ||
96 | XmlSerializer x = new XmlSerializer(typeof(SerializableInventory)); | ||
97 | x.Serialize(writer, inventory); | ||
98 | } | ||
99 | |||
100 | protected static bool fixupFolder(SerializableInventory.SerializableFolder f, SerializableInventory.SerializableFolder parent) | ||
101 | { | ||
102 | bool modified = false; | ||
103 | |||
104 | // ensure we have a valid folder id | ||
105 | if (f.folderID == LLUUID.Zero) | ||
84 | { | 106 | { |
85 | try | 107 | f.folderID = LLUUID.Random(); |
86 | { | 108 | modified = true; |
87 | return kvp.Value.getUserRootFolders(user); | 109 | } |
88 | } | 110 | |
89 | catch (Exception e) | 111 | // ensure we have valid agent id |
90 | { | 112 | if (f.agentID == LLUUID.Zero) |
91 | OpenSim.Framework.Console.MainConsole.Instance.Notice("Unable to get root folders via " + kvp.Key + " (" + e.ToString() + ")"); | 113 | { |
92 | } | 114 | if (parent != null) |
115 | f.agentID = parent.agentID; | ||
116 | else | ||
117 | f.agentID = f.folderID; | ||
118 | modified = true; | ||
119 | } | ||
120 | |||
121 | if (f.parentID == LLUUID.Zero && parent != null) | ||
122 | { | ||
123 | f.parentID = parent.folderID; | ||
124 | modified = true; | ||
93 | } | 125 | } |
94 | return null; | 126 | |
127 | |||
128 | foreach (SerializableInventory.SerializableFolder child in f.SubFolders) | ||
129 | { | ||
130 | modified |= fixupFolder(child, f); | ||
131 | } | ||
132 | |||
133 | return modified; | ||
95 | } | 134 | } |
96 | 135 | ||
97 | public XmlRpcResponse XmlRpcInventoryRequest(XmlRpcRequest request) | 136 | protected static bool fixupInventory(SerializableInventory inventory) |
98 | { | 137 | { |
99 | XmlRpcResponse response = new XmlRpcResponse(); | 138 | return fixupFolder(inventory.root, null); |
100 | Hashtable requestData = (Hashtable)request.Params[0]; | 139 | } |
101 | 140 | ||
102 | Hashtable responseData = new Hashtable(); | 141 | public class GetInventory : BaseStreamHandler |
142 | { | ||
143 | private SerializableInventory _inventory; | ||
144 | private InventoryManager _manager; | ||
145 | public GetInventory(InventoryManager manager) | ||
146 | : base("GET", "/inventory") | ||
147 | { | ||
148 | _manager = manager; | ||
103 | 149 | ||
104 | // Stuff happens here | 150 | _inventory = loadInventoryFromXmlFile("Inventory_Library.xml"); |
151 | if (fixupInventory(_inventory)) | ||
152 | { | ||
153 | FileStream fs = new FileStream("Inventory_Library.xml", FileMode.Truncate, FileAccess.Write); | ||
154 | saveInventoryToStream(_inventory, fs); | ||
155 | fs.Flush(); | ||
156 | fs.Close(); | ||
157 | MainLog.Instance.Debug(OpenInventory_Main.LogName, "Modified"); | ||
158 | } | ||
159 | } | ||
105 | 160 | ||
106 | if (requestData.ContainsKey("Access-type")) | 161 | private void CreateDefaultInventory(LLUUID userID) |
107 | { | 162 | { |
108 | if (requestData["access-type"] == "rootfolders") | 163 | } |
164 | |||
165 | private byte[] GetUserInventory(LLUUID userID) | ||
166 | { | ||
167 | MainLog.Instance.Notice(OpenInventory_Main.LogName, "Getting Inventory for user {0}", userID.ToStringHyphenated()); | ||
168 | byte[] result = new byte[] { }; | ||
169 | |||
170 | InventoryFolderBase fb = _manager._databasePlugin.getUserRootFolder(userID); | ||
171 | if (fb == null) | ||
109 | { | 172 | { |
110 | // responseData["rootfolders"] = | 173 | MainLog.Instance.Notice(OpenInventory_Main.LogName, "Inventory not found for user {0}, creating new", userID.ToStringHyphenated()); |
174 | CreateDefaultInventory(userID); | ||
111 | } | 175 | } |
176 | |||
177 | return result; | ||
112 | } | 178 | } |
113 | else | 179 | |
180 | override public byte[] Handle(string path, Stream request) | ||
114 | { | 181 | { |
115 | responseData["error"] = "No access-type specified."; | 182 | byte[] result = new byte[] { }; |
116 | } | ||
117 | 183 | ||
184 | string[] parms = path.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); | ||
185 | if (parms.Length >= 1) | ||
186 | { | ||
187 | if (string.Compare(parms[1], "library", true) == 0) | ||
188 | { | ||
118 | 189 | ||
119 | // Stuff stops happening here | 190 | MemoryStream ms = new MemoryStream(); |
191 | saveInventoryToStream(_inventory, ms); | ||
120 | 192 | ||
121 | response.Value = responseData; | 193 | result = ms.GetBuffer(); |
122 | return response; | 194 | Array.Resize<byte>(ref result, (int)ms.Length); |
195 | } | ||
196 | else if (string.Compare(parms[1], "user", true) == 0) | ||
197 | { | ||
198 | if (parms.Length >= 2) | ||
199 | { | ||
200 | result = GetUserInventory(new LLUUID(parms[2])); | ||
201 | } | ||
202 | } | ||
203 | } | ||
204 | return result; | ||
205 | } | ||
123 | } | 206 | } |
207 | |||
124 | } | 208 | } |
125 | } | 209 | } |
diff --git a/OpenSim/Grid/InventoryServer/Main.cs b/OpenSim/Grid/InventoryServer/Main.cs index 97addb0..1bc396b 100644 --- a/OpenSim/Grid/InventoryServer/Main.cs +++ b/OpenSim/Grid/InventoryServer/Main.cs | |||
@@ -31,48 +31,71 @@ using System.Collections.Generic; | |||
31 | using System.Reflection; | 31 | using System.Reflection; |
32 | using System.IO; | 32 | using System.IO; |
33 | using System.Text; | 33 | using System.Text; |
34 | |||
34 | using libsecondlife; | 35 | using libsecondlife; |
35 | using OpenSim.Framework.User; | 36 | |
36 | using OpenSim.Framework.Sims; | 37 | using OpenSim.Framework; |
37 | using OpenSim.Framework.Inventory; | ||
38 | using OpenSim.Framework.Interfaces; | ||
39 | using OpenSim.Framework.Console; | 38 | using OpenSim.Framework.Console; |
40 | using OpenSim.Servers; | 39 | using OpenSim.Framework.Servers; |
41 | using OpenSim.Framework.Utilities; | 40 | |
41 | using InventoryManager = OpenSim.Grid.InventoryServer.InventoryManager; | ||
42 | 42 | ||
43 | namespace OpenGridServices.InventoryServer | 43 | namespace OpenSim.Grid.InventoryServer |
44 | { | 44 | { |
45 | public class OpenInventory_Main : BaseServer, conscmd_callback | 45 | public class OpenInventory_Main : conscmd_callback |
46 | { | 46 | { |
47 | ConsoleBase m_console; | 47 | LogBase m_console; |
48 | InventoryManager m_inventoryManager; | 48 | InventoryManager m_inventoryManager; |
49 | InventoryConfig m_config; | ||
49 | 50 | ||
51 | public const string LogName = "INVENTORY"; | ||
52 | |||
53 | [STAThread] | ||
50 | public static void Main(string[] args) | 54 | public static void Main(string[] args) |
51 | { | 55 | { |
56 | OpenInventory_Main theServer = new OpenInventory_Main(); | ||
57 | theServer.Startup(); | ||
58 | |||
59 | theServer.Work(); | ||
52 | } | 60 | } |
53 | 61 | ||
54 | public OpenInventory_Main() | 62 | public OpenInventory_Main() |
55 | { | 63 | { |
56 | m_console = new ConsoleBase("opengrid-inventory-console.log", "OpenInventory", this, false); | 64 | m_console = new LogBase("opengrid-inventory-console.log", LogName, this, true); |
57 | MainConsole.Instance = m_console; | 65 | MainLog.Instance = m_console; |
58 | } | 66 | } |
59 | 67 | ||
60 | public void Startup() | 68 | public void Startup() |
61 | { | 69 | { |
62 | MainConsole.Instance.Notice("Initialising inventory manager..."); | 70 | MainLog.Instance.Notice("Initialising inventory manager..."); |
71 | m_config = new InventoryConfig(LogName, (Path.Combine(Util.configDir(), "InventoryServer_Config.xml"))); | ||
72 | |||
63 | m_inventoryManager = new InventoryManager(); | 73 | m_inventoryManager = new InventoryManager(); |
74 | m_inventoryManager.AddDatabasePlugin(m_config.DatabaseProvider); | ||
75 | MainLog.Instance.Notice(LogName, "Starting HTTP server ..."); | ||
76 | BaseHttpServer httpServer = new BaseHttpServer(m_config.HttpPort); | ||
64 | 77 | ||
65 | MainConsole.Instance.Notice("Starting HTTP server"); | 78 | httpServer.AddStreamHandler(new InventoryManager.GetInventory(m_inventoryManager)); |
66 | BaseHttpServer httpServer = new BaseHttpServer(8004); | ||
67 | 79 | ||
68 | httpServer.AddXmlRPCHandler("rootfolders", m_inventoryManager.XmlRpcInventoryRequest); | 80 | httpServer.Start(); |
69 | //httpServer.AddRestHandler("GET","/rootfolders/",Rest | 81 | MainLog.Instance.Notice(LogName, "Started HTTP server"); |
82 | } | ||
83 | |||
84 | private void Work() | ||
85 | { | ||
86 | m_console.Notice("Enter help for a list of commands\n"); | ||
87 | |||
88 | while (true) | ||
89 | { | ||
90 | m_console.MainLogPrompt(); | ||
91 | } | ||
70 | } | 92 | } |
71 | 93 | ||
72 | public void RunCmd(string cmd, string[] cmdparams) | 94 | public void RunCmd(string cmd, string[] cmdparams) |
73 | { | 95 | { |
74 | switch (cmd) | 96 | switch (cmd) |
75 | { | 97 | { |
98 | case "quit": | ||
76 | case "shutdown": | 99 | case "shutdown": |
77 | m_console.Close(); | 100 | m_console.Close(); |
78 | Environment.Exit(0); | 101 | Environment.Exit(0); |
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index 7245482..6be067f 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs | |||
@@ -175,6 +175,7 @@ namespace OpenSim | |||
175 | config.Set("user_send_key", "null"); | 175 | config.Set("user_send_key", "null"); |
176 | config.Set("user_recv_key", "null"); | 176 | config.Set("user_recv_key", "null"); |
177 | config.Set("asset_server_url", "http://127.0.0.1:" + AssetConfig.DefaultHttpPort.ToString()); | 177 | config.Set("asset_server_url", "http://127.0.0.1:" + AssetConfig.DefaultHttpPort.ToString()); |
178 | config.Set("inventory_server_url", "http://127.0.0.1:" + InventoryConfig.DefaultHttpPort.ToString()); | ||
178 | } | 179 | } |
179 | } | 180 | } |
180 | 181 | ||
@@ -774,4 +775,4 @@ namespace OpenSim | |||
774 | 775 | ||
775 | #endregion | 776 | #endregion |
776 | } | 777 | } |
777 | } \ No newline at end of file | 778 | } |
diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs index 7d1780c..89e5465 100644 --- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs +++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs | |||
@@ -770,4 +770,4 @@ namespace OpenSim.Region.ClientStack | |||
770 | OutPacket(logReply); | 770 | OutPacket(logReply); |
771 | } | 771 | } |
772 | } | 772 | } |
773 | } \ No newline at end of file | 773 | } |
diff --git a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs index 941cc30..1281a44 100644 --- a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs +++ b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs | |||
@@ -42,8 +42,8 @@ namespace OpenSim.Region.Communications.OGS1 | |||
42 | m_gridService = gridInterComms; | 42 | m_gridService = gridInterComms; |
43 | m_interRegion = gridInterComms; | 43 | m_interRegion = gridInterComms; |
44 | 44 | ||
45 | m_inventoryService = new OGS1InventoryService(); | 45 | m_inventoryService = new OGS1InventoryService(serversInfo.InventoryURL); |
46 | m_userService = new OGS1UserServices(this); | 46 | m_userService = new OGS1UserServices(this); |
47 | } | 47 | } |
48 | } | 48 | } |
49 | } \ No newline at end of file | 49 | } |
diff --git a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs index 49fdee9..85df353 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs | |||
@@ -25,7 +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 | */ |
28 | 28 | using System; | |
29 | using System.IO; | ||
30 | using System.Xml.Serialization; | ||
29 | using System.Collections.Generic; | 31 | using System.Collections.Generic; |
30 | using libsecondlife; | 32 | using libsecondlife; |
31 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
@@ -36,8 +38,11 @@ namespace OpenSim.Region.Communications.OGS1 | |||
36 | { | 38 | { |
37 | public class OGS1InventoryService : IInventoryServices | 39 | public class OGS1InventoryService : IInventoryServices |
38 | { | 40 | { |
39 | public OGS1InventoryService() | 41 | string _inventoryServerUrl; |
42 | |||
43 | public OGS1InventoryService(string inventoryServerUrl) | ||
40 | { | 44 | { |
45 | _inventoryServerUrl = inventoryServerUrl; | ||
41 | } | 46 | } |
42 | 47 | ||
43 | #region IInventoryServices Members | 48 | #region IInventoryServices Members |
@@ -45,6 +50,19 @@ namespace OpenSim.Region.Communications.OGS1 | |||
45 | public void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, | 50 | public void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, |
46 | InventoryItemInfo itemCallBack) | 51 | InventoryItemInfo itemCallBack) |
47 | { | 52 | { |
53 | //TODO! Uncomment when all is done | ||
54 | //SerializableInventory userInventory = null; | ||
55 | |||
56 | //RestClient inventoryServer = new RestClient(_inventoryServerUrl); | ||
57 | //inventoryServer.AddResourcePath("inventory"); | ||
58 | //inventoryServer.AddResourcePath("user"); | ||
59 | //inventoryServer.AddResourcePath(userID.ToStringHyphenated()); | ||
60 | |||
61 | //using (Stream userInventoryStream = inventoryServer.Request()) | ||
62 | //{ | ||
63 | // XmlSerializer x = new XmlSerializer(typeof(SerializableInventory)); | ||
64 | // userInventory = (SerializableInventory)x.Deserialize(userInventoryStream); | ||
65 | //} | ||
48 | } | 66 | } |
49 | 67 | ||
50 | public void AddNewInventoryFolder(LLUUID userID, InventoryFolderImpl folder) | 68 | public void AddNewInventoryFolder(LLUUID userID, InventoryFolderImpl folder) |
@@ -70,4 +88,4 @@ namespace OpenSim.Region.Communications.OGS1 | |||
70 | 88 | ||
71 | #endregion | 89 | #endregion |
72 | } | 90 | } |
73 | } \ No newline at end of file | 91 | } |
diff --git a/OpenSim/Region/Environment/Modules/ChatModule.cs b/OpenSim/Region/Environment/Modules/ChatModule.cs index 9d4187a..99b69e1 100644 --- a/OpenSim/Region/Environment/Modules/ChatModule.cs +++ b/OpenSim/Region/Environment/Modules/ChatModule.cs | |||
@@ -431,4 +431,4 @@ namespace OpenSim.Region.Environment.Modules | |||
431 | m_tcp.Close(); | 431 | m_tcp.Close(); |
432 | } | 432 | } |
433 | } | 433 | } |
434 | } \ No newline at end of file | 434 | } |
diff --git a/OpenSim/Region/Environment/Modules/WorldCommModule.cs b/OpenSim/Region/Environment/Modules/WorldCommModule.cs index 7a631d7..5af2ce3 100644 --- a/OpenSim/Region/Environment/Modules/WorldCommModule.cs +++ b/OpenSim/Region/Environment/Modules/WorldCommModule.cs | |||
@@ -490,4 +490,4 @@ namespace OpenSim.Region.Environment.Modules | |||
490 | return m_id; | 490 | return m_id; |
491 | } | 491 | } |
492 | } | 492 | } |
493 | } \ No newline at end of file | 493 | } |
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 5155b41..3b73893 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -1059,4 +1059,4 @@ namespace OpenSim.Region.Environment.Scenes | |||
1059 | SendOurAppearance(m_controllingClient); | 1059 | SendOurAppearance(m_controllingClient); |
1060 | } | 1060 | } |
1061 | } | 1061 | } |
1062 | } \ No newline at end of file | 1062 | } |