diff options
author | Adam Frisby | 2008-05-01 18:04:42 +0000 |
---|---|---|
committer | Adam Frisby | 2008-05-01 18:04:42 +0000 |
commit | 20a9bf08f51351e1e0a9de94f184ff56cd572665 (patch) | |
tree | 52da64dab26353b903c8e4befed0178fa72a188b /OpenSim/Grid | |
parent | More config cleanup in LaunchSLClient. (diff) | |
download | opensim-SC-20a9bf08f51351e1e0a9de94f184ff56cd572665.zip opensim-SC-20a9bf08f51351e1e0a9de94f184ff56cd572665.tar.gz opensim-SC-20a9bf08f51351e1e0a9de94f184ff56cd572665.tar.bz2 opensim-SC-20a9bf08f51351e1e0a9de94f184ff56cd572665.tar.xz |
* Rolled back a few changes.
Diffstat (limited to 'OpenSim/Grid')
34 files changed, 648 insertions, 674 deletions
diff --git a/OpenSim/Grid/AssetServer/Main.cs b/OpenSim/Grid/AssetServer/Main.cs index c26c506..26f4bc8 100644 --- a/OpenSim/Grid/AssetServer/Main.cs +++ b/OpenSim/Grid/AssetServer/Main.cs | |||
@@ -46,48 +46,14 @@ namespace OpenSim.Grid.AssetServer | |||
46 | { | 46 | { |
47 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 47 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
48 | 48 | ||
49 | public static OpenAsset_Main assetserver; | 49 | public AssetConfig m_config; |
50 | 50 | ||
51 | public static OpenAsset_Main assetserver; | ||
52 | |||
51 | // Temporarily hardcoded - should be a plugin | 53 | // Temporarily hardcoded - should be a plugin |
52 | protected IAssetLoader assetLoader = new AssetLoaderFileSystem(); | 54 | protected IAssetLoader assetLoader = new AssetLoaderFileSystem(); |
53 | 55 | ||
54 | private IAssetProvider m_assetProvider; | 56 | private IAssetProvider m_assetProvider; |
55 | public AssetConfig m_config; | ||
56 | |||
57 | public OpenAsset_Main() | ||
58 | { | ||
59 | m_console = new ConsoleBase("OpenAsset", this); | ||
60 | |||
61 | MainConsole.Instance = m_console; | ||
62 | } | ||
63 | |||
64 | #region conscmd_callback Members | ||
65 | |||
66 | public override void RunCmd(string cmd, string[] cmdparams) | ||
67 | { | ||
68 | base.RunCmd(cmd, cmdparams); | ||
69 | |||
70 | switch (cmd) | ||
71 | { | ||
72 | case "help": | ||
73 | m_console.Notice( | ||
74 | @"shutdown - shutdown this asset server (USE CAUTION!) | ||
75 | stats - statistical information for this server"); | ||
76 | |||
77 | break; | ||
78 | |||
79 | case "stats": | ||
80 | m_console.Notice("STATS", Environment.NewLine + StatsManager.AssetStats.Report()); | ||
81 | break; | ||
82 | |||
83 | case "shutdown": | ||
84 | m_console.Close(); | ||
85 | Environment.Exit(0); | ||
86 | break; | ||
87 | } | ||
88 | } | ||
89 | |||
90 | #endregion | ||
91 | 57 | ||
92 | [STAThread] | 58 | [STAThread] |
93 | public static void Main(string[] args) | 59 | public static void Main(string[] args) |
@@ -112,6 +78,13 @@ namespace OpenSim.Grid.AssetServer | |||
112 | } | 78 | } |
113 | } | 79 | } |
114 | 80 | ||
81 | public OpenAsset_Main() | ||
82 | { | ||
83 | m_console = new ConsoleBase("OpenAsset", this); | ||
84 | |||
85 | MainConsole.Instance = m_console; | ||
86 | } | ||
87 | |||
115 | public void Startup() | 88 | public void Startup() |
116 | { | 89 | { |
117 | m_config = new AssetConfig("ASSET SERVER", (Path.Combine(Util.configDir(), "AssetServer_Config.xml"))); | 90 | m_config = new AssetConfig("ASSET SERVER", (Path.Combine(Util.configDir(), "AssetServer_Config.xml"))); |
@@ -187,18 +160,42 @@ namespace OpenSim.Grid.AssetServer | |||
187 | catch (Exception e) | 160 | catch (Exception e) |
188 | { | 161 | { |
189 | m_log.Warn("[ASSET]: setupDB() - Exception occured"); | 162 | m_log.Warn("[ASSET]: setupDB() - Exception occured"); |
190 | m_log.Warn("[ASSET]: " + e); | 163 | m_log.Warn("[ASSET]: " + e.ToString()); |
191 | } | 164 | } |
192 | } | 165 | } |
193 | 166 | ||
194 | public void LoadDefaultAssets() | 167 | public void LoadDefaultAssets() |
195 | { | 168 | { |
196 | assetLoader.ForEachDefaultXmlAsset(StoreAsset); | 169 | assetLoader.ForEachDefaultXmlAsset(StoreAsset); |
197 | } | 170 | } |
198 | 171 | ||
199 | protected void StoreAsset(AssetBase asset) | 172 | protected void StoreAsset(AssetBase asset) |
200 | { | 173 | { |
201 | m_assetProvider.CreateAsset(asset); | 174 | m_assetProvider.CreateAsset(asset); |
202 | } | 175 | } |
176 | |||
177 | public override void RunCmd(string cmd, string[] cmdparams) | ||
178 | { | ||
179 | base.RunCmd(cmd, cmdparams); | ||
180 | |||
181 | switch (cmd) | ||
182 | { | ||
183 | case "help": | ||
184 | m_console.Notice( | ||
185 | @"shutdown - shutdown this asset server (USE CAUTION!) | ||
186 | stats - statistical information for this server"); | ||
187 | |||
188 | break; | ||
189 | |||
190 | case "stats": | ||
191 | m_console.Notice("STATS", Environment.NewLine + StatsManager.AssetStats.Report()); | ||
192 | break; | ||
193 | |||
194 | case "shutdown": | ||
195 | m_console.Close(); | ||
196 | Environment.Exit(0); | ||
197 | break; | ||
198 | } | ||
199 | } | ||
203 | } | 200 | } |
204 | } \ No newline at end of file | 201 | } |
diff --git a/OpenSim/Grid/AssetServer/Properties/AssemblyInfo.cs b/OpenSim/Grid/AssetServer/Properties/AssemblyInfo.cs index 3bae064..6f219a6 100644 --- a/OpenSim/Grid/AssetServer/Properties/AssemblyInfo.cs +++ b/OpenSim/Grid/AssetServer/Properties/AssemblyInfo.cs | |||
@@ -60,4 +60,4 @@ using System.Runtime.InteropServices; | |||
60 | // | 60 | // |
61 | 61 | ||
62 | [assembly : AssemblyVersion("1.0.0.0")] | 62 | [assembly : AssemblyVersion("1.0.0.0")] |
63 | [assembly : AssemblyFileVersion("1.0.0.0")] \ No newline at end of file | 63 | [assembly : AssemblyFileVersion("1.0.0.0")] |
diff --git a/OpenSim/Grid/AssetServer/RestService.cs b/OpenSim/Grid/AssetServer/RestService.cs index 93f86b8..ece826e 100644 --- a/OpenSim/Grid/AssetServer/RestService.cs +++ b/OpenSim/Grid/AssetServer/RestService.cs | |||
@@ -43,8 +43,8 @@ namespace OpenSim.Grid.AssetServer | |||
43 | { | 43 | { |
44 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 44 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
45 | 45 | ||
46 | private readonly IAssetProvider m_assetProvider; | ||
47 | private OpenAsset_Main m_assetManager; | 46 | private OpenAsset_Main m_assetManager; |
47 | private IAssetProvider m_assetProvider; | ||
48 | 48 | ||
49 | /// <summary> | 49 | /// <summary> |
50 | /// Constructor. | 50 | /// Constructor. |
@@ -58,28 +58,28 @@ namespace OpenSim.Grid.AssetServer | |||
58 | m_assetManager = assetManager; | 58 | m_assetManager = assetManager; |
59 | m_assetProvider = assetProvider; | 59 | m_assetProvider = assetProvider; |
60 | } | 60 | } |
61 | 61 | ||
62 | public override byte[] Handle(string path, Stream request) | 62 | public override byte[] Handle(string path, Stream request) |
63 | { | 63 | { |
64 | string param = GetParam(path); | 64 | string param = GetParam(path); |
65 | byte[] result = new byte[] {}; | 65 | byte[] result = new byte[] {}; |
66 | 66 | ||
67 | string[] p = param.Split(new[] {'/', '?', '&'}, StringSplitOptions.RemoveEmptyEntries); | 67 | string[] p = param.Split(new char[] {'/', '?', '&'}, StringSplitOptions.RemoveEmptyEntries); |
68 | 68 | ||
69 | if (p.Length > 0) | 69 | if (p.Length > 0) |
70 | { | 70 | { |
71 | LLUUID assetID = null; | 71 | LLUUID assetID = null; |
72 | 72 | ||
73 | if (!LLUUID.TryParse(p[0], out assetID)) | 73 | if (!LLUUID.TryParse(p[0], out assetID)) |
74 | { | 74 | { |
75 | m_log.InfoFormat( | 75 | m_log.InfoFormat( |
76 | "[REST]: GET:/asset ignoring request with malformed UUID {0}", p[0]); | 76 | "[REST]: GET:/asset ignoring request with malformed UUID {0}", p[0]); |
77 | return result; | 77 | return result; |
78 | } | 78 | } |
79 | 79 | ||
80 | if (StatsManager.AssetStats != null) | 80 | if (StatsManager.AssetStats != null) |
81 | StatsManager.AssetStats.AddRequest(); | 81 | StatsManager.AssetStats.AddRequest(); |
82 | 82 | ||
83 | AssetBase asset = m_assetProvider.FetchAsset(assetID); | 83 | AssetBase asset = m_assetProvider.FetchAsset(assetID); |
84 | if (asset != null) | 84 | if (asset != null) |
85 | { | 85 | { |
@@ -94,39 +94,32 @@ namespace OpenSim.Grid.AssetServer | |||
94 | //StreamReader sr = new StreamReader(ms); | 94 | //StreamReader sr = new StreamReader(ms); |
95 | 95 | ||
96 | result = ms.GetBuffer(); | 96 | result = ms.GetBuffer(); |
97 | 97 | ||
98 | m_log.InfoFormat( | 98 | m_log.InfoFormat( |
99 | "[REST]: GET:/asset found {0} with name {1}, size {2} bytes", | 99 | "[REST]: GET:/asset found {0} with name {1}, size {2} bytes", |
100 | assetID, asset.Name, result.Length); | 100 | assetID, asset.Name, result.Length); |
101 | 101 | ||
102 | Array.Resize(ref result, (int) ms.Length); | 102 | Array.Resize<byte>(ref result, (int) ms.Length); |
103 | } | 103 | } |
104 | else | 104 | else |
105 | { | 105 | { |
106 | if (StatsManager.AssetStats != null) | 106 | if (StatsManager.AssetStats != null) |
107 | StatsManager.AssetStats.AddNotFoundRequest(); | 107 | StatsManager.AssetStats.AddNotFoundRequest(); |
108 | 108 | ||
109 | m_log.InfoFormat("[REST]: GET:/asset failed to find {0}", assetID); | 109 | m_log.InfoFormat("[REST]: GET:/asset failed to find {0}", assetID); |
110 | } | 110 | } |
111 | } | 111 | } |
112 | 112 | ||
113 | return result; | 113 | return result; |
114 | } | 114 | } |
115 | } | 115 | } |
116 | 116 | ||
117 | public class PostAssetStreamHandler : BaseStreamHandler | 117 | public class PostAssetStreamHandler : BaseStreamHandler |
118 | { | 118 | { |
119 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 119 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
120 | 120 | ||
121 | private readonly IAssetProvider m_assetProvider; | ||
122 | private OpenAsset_Main m_assetManager; | 121 | private OpenAsset_Main m_assetManager; |
123 | 122 | private IAssetProvider m_assetProvider; | |
124 | public PostAssetStreamHandler(OpenAsset_Main assetManager, IAssetProvider assetProvider) | ||
125 | : base("POST", "/assets") | ||
126 | { | ||
127 | m_assetManager = assetManager; | ||
128 | m_assetProvider = assetProvider; | ||
129 | } | ||
130 | 123 | ||
131 | public override byte[] Handle(string path, Stream request) | 124 | public override byte[] Handle(string path, Stream request) |
132 | { | 125 | { |
@@ -146,5 +139,12 @@ namespace OpenSim.Grid.AssetServer | |||
146 | 139 | ||
147 | return new byte[] {}; | 140 | return new byte[] {}; |
148 | } | 141 | } |
142 | |||
143 | public PostAssetStreamHandler(OpenAsset_Main assetManager, IAssetProvider assetProvider) | ||
144 | : base("POST", "/assets") | ||
145 | { | ||
146 | m_assetManager = assetManager; | ||
147 | m_assetProvider = assetProvider; | ||
148 | } | ||
149 | } | 149 | } |
150 | } \ No newline at end of file | 150 | } |
diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs index 32f002a..7eb9c34 100644 --- a/OpenSim/Grid/GridServer/GridManager.cs +++ b/OpenSim/Grid/GridServer/GridManager.cs | |||
@@ -44,11 +44,11 @@ namespace OpenSim.Grid.GridServer | |||
44 | { | 44 | { |
45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
46 | 46 | ||
47 | private readonly Dictionary<string, ILogData> _logplugins = new Dictionary<string, ILogData>(); | 47 | private Dictionary<string, IGridData> _plugins = new Dictionary<string, IGridData>(); |
48 | private Dictionary<string, ILogData> _logplugins = new Dictionary<string, ILogData>(); | ||
48 | 49 | ||
49 | // This is here so that the grid server can hand out MessageServer settings to regions on registration | 50 | // This is here so that the grid server can hand out MessageServer settings to regions on registration |
50 | private readonly List<MessageServerInfo> _MessageServers = new List<MessageServerInfo>(); | 51 | private List<MessageServerInfo> _MessageServers = new List<MessageServerInfo>(); |
51 | private readonly Dictionary<string, IGridData> _plugins = new Dictionary<string, IGridData>(); | ||
52 | 52 | ||
53 | public GridConfig Config; | 53 | public GridConfig Config; |
54 | 54 | ||
@@ -72,7 +72,7 @@ namespace OpenSim.Grid.GridServer | |||
72 | if (typeInterface != null) | 72 | if (typeInterface != null) |
73 | { | 73 | { |
74 | IGridData plug = | 74 | IGridData plug = |
75 | (IGridData) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); | 75 | (IGridData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); |
76 | plug.Initialise(); | 76 | plug.Initialise(); |
77 | _plugins.Add(plug.getName(), plug); | 77 | _plugins.Add(plug.getName(), plug); |
78 | m_log.Info("[DATA]: Added IGridData Interface"); | 78 | m_log.Info("[DATA]: Added IGridData Interface"); |
@@ -84,7 +84,7 @@ namespace OpenSim.Grid.GridServer | |||
84 | if (typeInterface != null) | 84 | if (typeInterface != null) |
85 | { | 85 | { |
86 | ILogData plug = | 86 | ILogData plug = |
87 | (ILogData) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); | 87 | (ILogData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); |
88 | plug.Initialise(); | 88 | plug.Initialise(); |
89 | _logplugins.Add(plug.getName(), plug); | 89 | _logplugins.Add(plug.getName(), plug); |
90 | m_log.Info("[DATA]: Added ILogData Interface"); | 90 | m_log.Info("[DATA]: Added ILogData Interface"); |
@@ -152,7 +152,7 @@ namespace OpenSim.Grid.GridServer | |||
152 | } | 152 | } |
153 | catch | 153 | catch |
154 | { | 154 | { |
155 | m_log.Warn("[storage]: Unable to find region " + handle + " via " + kvp.Key); | 155 | m_log.Warn("[storage]: Unable to find region " + handle.ToString() + " via " + kvp.Key); |
156 | } | 156 | } |
157 | } | 157 | } |
158 | return null; | 158 | return null; |
@@ -218,20 +218,20 @@ namespace OpenSim.Grid.GridServer | |||
218 | { | 218 | { |
219 | if ( | 219 | if ( |
220 | GetRegion( | 220 | GetRegion( |
221 | Util.UIntsToLong((uint) ((central_region.regionLocX + x) * Constants.RegionSize), | 221 | Util.UIntsToLong((uint)((central_region.regionLocX + x) * Constants.RegionSize), |
222 | (uint) (central_region.regionLocY + y) * Constants.RegionSize)) != null) | 222 | (uint)(central_region.regionLocY + y) * Constants.RegionSize)) != null) |
223 | { | 223 | { |
224 | neighbour = | 224 | neighbour = |
225 | GetRegion( | 225 | GetRegion( |
226 | Util.UIntsToLong((uint) ((central_region.regionLocX + x) * Constants.RegionSize), | 226 | Util.UIntsToLong((uint)((central_region.regionLocX + x) * Constants.RegionSize), |
227 | (uint) (central_region.regionLocY + y) * Constants.RegionSize)); | 227 | (uint)(central_region.regionLocY + y) * Constants.RegionSize)); |
228 | 228 | ||
229 | response += "<neighbour>"; | 229 | response += "<neighbour>"; |
230 | response += "<sim_ip>" + neighbour.serverIP + "</sim_ip>"; | 230 | response += "<sim_ip>" + neighbour.serverIP + "</sim_ip>"; |
231 | response += "<sim_port>" + neighbour.serverPort + "</sim_port>"; | 231 | response += "<sim_port>" + neighbour.serverPort.ToString() + "</sim_port>"; |
232 | response += "<locx>" + neighbour.regionLocX + "</locx>"; | 232 | response += "<locx>" + neighbour.regionLocX.ToString() + "</locx>"; |
233 | response += "<locy>" + neighbour.regionLocY + "</locy>"; | 233 | response += "<locy>" + neighbour.regionLocY.ToString() + "</locy>"; |
234 | response += "<regionhandle>" + neighbour.regionHandle + "</regionhandle>"; | 234 | response += "<regionhandle>" + neighbour.regionHandle.ToString() + "</regionhandle>"; |
235 | response += "</neighbour>"; | 235 | response += "</neighbour>"; |
236 | } | 236 | } |
237 | } | 237 | } |
@@ -287,10 +287,10 @@ namespace OpenSim.Grid.GridServer | |||
287 | RegionProfileData sim; | 287 | RegionProfileData sim; |
288 | RegionProfileData existingSim; | 288 | RegionProfileData existingSim; |
289 | 289 | ||
290 | Hashtable requestData = (Hashtable) request.Params[0]; | 290 | Hashtable requestData = (Hashtable)request.Params[0]; |
291 | LLUUID uuid; | 291 | LLUUID uuid; |
292 | 292 | ||
293 | if (!requestData.ContainsKey("UUID") || !LLUUID.TryParse((string) requestData["UUID"], out uuid)) | 293 | if (!requestData.ContainsKey("UUID") || !LLUUID.TryParse((string)requestData["UUID"], out uuid)) |
294 | { | 294 | { |
295 | m_log.Info("[GRID]: Region connected without a UUID, ignoring."); | 295 | m_log.Info("[GRID]: Region connected without a UUID, ignoring."); |
296 | return ErrorResponse("No UUID passed to grid server - unable to connect you"); | 296 | return ErrorResponse("No UUID passed to grid server - unable to connect you"); |
@@ -303,7 +303,7 @@ namespace OpenSim.Grid.GridServer | |||
303 | catch (FormatException e) | 303 | catch (FormatException e) |
304 | { | 304 | { |
305 | m_log.Info("[GRID]: Invalid login parameters, ignoring."); | 305 | m_log.Info("[GRID]: Invalid login parameters, ignoring."); |
306 | return ErrorResponse("Wrong format in login parameters. Please verify parameters." + e); | 306 | return ErrorResponse("Wrong format in login parameters. Please verify parameters." + e.ToString() ); |
307 | } | 307 | } |
308 | 308 | ||
309 | existingSim = GetRegion(sim.regionHandle); | 309 | existingSim = GetRegion(sim.regionHandle); |
@@ -329,7 +329,7 @@ namespace OpenSim.Grid.GridServer | |||
329 | { | 329 | { |
330 | DataResponse insertResponse; | 330 | DataResponse insertResponse; |
331 | 331 | ||
332 | if (existingSim == null) | 332 | if( existingSim == null ) |
333 | { | 333 | { |
334 | insertResponse = kvp.Value.AddProfile(sim); | 334 | insertResponse = kvp.Value.AddProfile(sim); |
335 | } | 335 | } |
@@ -348,20 +348,20 @@ namespace OpenSim.Grid.GridServer | |||
348 | break; | 348 | break; |
349 | case DataResponse.RESPONSE_INVALIDCREDENTIALS: | 349 | case DataResponse.RESPONSE_INVALIDCREDENTIALS: |
350 | m_log.Warn("[storage]: " + | 350 | m_log.Warn("[storage]: " + |
351 | "New sim creation failed (Invalid Credentials): " + sim.regionName); | 351 | "New sim creation failed (Invalid Credentials): " + sim.regionName); |
352 | break; | 352 | break; |
353 | case DataResponse.RESPONSE_AUTHREQUIRED: | 353 | case DataResponse.RESPONSE_AUTHREQUIRED: |
354 | m_log.Warn("[storage]: " + | 354 | m_log.Warn("[storage]: " + |
355 | "New sim creation failed (Authentication Required): " + | 355 | "New sim creation failed (Authentication Required): " + |
356 | sim.regionName); | 356 | sim.regionName); |
357 | break; | 357 | break; |
358 | } | 358 | } |
359 | } | 359 | } |
360 | catch (Exception e) | 360 | catch (Exception e) |
361 | { | 361 | { |
362 | m_log.Warn("[storage]: " + | 362 | m_log.Warn("[storage]: " + |
363 | "Unable to add region " + sim.UUID + " via " + kvp.Key); | 363 | "Unable to add region " + sim.UUID.ToString() + " via " + kvp.Key); |
364 | m_log.Warn("[storage]: " + e); | 364 | m_log.Warn("[storage]: " + e.ToString()); |
365 | } | 365 | } |
366 | } | 366 | } |
367 | 367 | ||
@@ -375,8 +375,7 @@ namespace OpenSim.Grid.GridServer | |||
375 | { | 375 | { |
376 | m_log.Warn("[grid]: Authentication failed when trying to add new region " + sim.regionName + | 376 | m_log.Warn("[grid]: Authentication failed when trying to add new region " + sim.regionName + |
377 | " at location " + sim.regionLocX + | 377 | " at location " + sim.regionLocX + |
378 | " " + sim.regionLocY + " with TheSim.regionRecvKey " + sim.regionRecvKey + "(" + Config.SimSendKey + | 378 | " " + sim.regionLocY + " with TheSim.regionRecvKey " + sim.regionRecvKey + "(" + Config.SimSendKey + ") and TheSim.regionRecvKey " + sim.regionSendKey + "(" + Config.SimRecvKey + ") "); |
379 | ") and TheSim.regionRecvKey " + sim.regionSendKey + "(" + Config.SimRecvKey + ") "); | ||
380 | } | 379 | } |
381 | else | 380 | else |
382 | { | 381 | { |
@@ -390,8 +389,7 @@ namespace OpenSim.Grid.GridServer | |||
390 | } | 389 | } |
391 | else | 390 | else |
392 | { | 391 | { |
393 | m_log.Warn("[grid]: Failed to add new region " + sim.regionName + " at location " + sim.regionLocX + " " + sim.regionLocY + | 392 | m_log.Warn("[grid]: Failed to add new region " + sim.regionName + " at location " + sim.regionLocX + " " + sim.regionLocY + " currently occupied by " + existingSim.regionName); |
394 | " currently occupied by " + existingSim.regionName); | ||
395 | return ErrorResponse("Another region already exists at that location. Try another"); | 393 | return ErrorResponse("Another region already exists at that location. Try another"); |
396 | } | 394 | } |
397 | } | 395 | } |
@@ -466,7 +464,7 @@ namespace OpenSim.Grid.GridServer | |||
466 | foreach (KeyValuePair<ulong, RegionProfileData> aSim in neighbours) | 464 | foreach (KeyValuePair<ulong, RegionProfileData> aSim in neighbours) |
467 | { | 465 | { |
468 | NeighbourBlock = new Hashtable(); | 466 | NeighbourBlock = new Hashtable(); |
469 | NeighbourBlock["sim_ip"] = Util.GetHostFromDNS(aSim.Value.serverIP).ToString(); | 467 | NeighbourBlock["sim_ip"] = Util.GetHostFromDNS(aSim.Value.serverIP.ToString()).ToString(); |
470 | NeighbourBlock["sim_port"] = aSim.Value.serverPort.ToString(); | 468 | NeighbourBlock["sim_port"] = aSim.Value.serverPort.ToString(); |
471 | NeighbourBlock["region_locx"] = aSim.Value.regionLocX.ToString(); | 469 | NeighbourBlock["region_locx"] = aSim.Value.regionLocX.ToString(); |
472 | NeighbourBlock["region_locy"] = aSim.Value.regionLocY.ToString(); | 470 | NeighbourBlock["region_locy"] = aSim.Value.regionLocY.ToString(); |
@@ -487,13 +485,13 @@ namespace OpenSim.Grid.GridServer | |||
487 | { | 485 | { |
488 | if ( | 486 | if ( |
489 | GetRegion( | 487 | GetRegion( |
490 | Helpers.UIntsToLong((uint) ((sim.regionLocX + x) * Constants.RegionSize), | 488 | Helpers.UIntsToLong((uint)((sim.regionLocX + x) * Constants.RegionSize), |
491 | (uint) (sim.regionLocY + y) * Constants.RegionSize)) != null) | 489 | (uint)(sim.regionLocY + y) * Constants.RegionSize)) != null) |
492 | { | 490 | { |
493 | neighbour = | 491 | neighbour = |
494 | GetRegion( | 492 | GetRegion( |
495 | Helpers.UIntsToLong((uint) ((sim.regionLocX + x) * Constants.RegionSize), | 493 | Helpers.UIntsToLong((uint)((sim.regionLocX + x) * Constants.RegionSize), |
496 | (uint) (sim.regionLocY + y) * Constants.RegionSize)); | 494 | (uint)(sim.regionLocY + y) * Constants.RegionSize)); |
497 | 495 | ||
498 | NeighbourBlock = new Hashtable(); | 496 | NeighbourBlock = new Hashtable(); |
499 | NeighbourBlock["sim_ip"] = Util.GetHostFromDNS(neighbour.serverIP).ToString(); | 497 | NeighbourBlock["sim_ip"] = Util.GetHostFromDNS(neighbour.serverIP).ToString(); |
@@ -521,26 +519,27 @@ namespace OpenSim.Grid.GridServer | |||
521 | RegionProfileData sim; | 519 | RegionProfileData sim; |
522 | sim = new RegionProfileData(); | 520 | sim = new RegionProfileData(); |
523 | 521 | ||
524 | sim.UUID = new LLUUID((string) requestData["UUID"]); | 522 | sim.UUID = new LLUUID((string)requestData["UUID"]); |
525 | sim.originUUID = new LLUUID((string) requestData["originUUID"]); | 523 | sim.originUUID = new LLUUID((string)requestData["originUUID"]); |
526 | 524 | ||
527 | sim.regionRecvKey = String.Empty; | 525 | sim.regionRecvKey = String.Empty; |
528 | sim.regionSendKey = String.Empty; | 526 | sim.regionSendKey = String.Empty; |
529 | 527 | ||
530 | if (requestData.ContainsKey("region_secret")) | 528 | if (requestData.ContainsKey("region_secret")) |
531 | { | 529 | { |
532 | string regionsecret = (string) requestData["region_secret"]; | 530 | string regionsecret = (string)requestData["region_secret"]; |
533 | if (regionsecret.Length > 0) | 531 | if (regionsecret.Length > 0) |
534 | sim.regionSecret = regionsecret; | 532 | sim.regionSecret = regionsecret; |
535 | else | 533 | else |
536 | sim.regionSecret = Config.SimRecvKey; | 534 | sim.regionSecret = Config.SimRecvKey; |
535 | |||
537 | } | 536 | } |
538 | else | 537 | else |
539 | { | 538 | { |
540 | sim.regionSecret = Config.SimRecvKey; | 539 | sim.regionSecret = Config.SimRecvKey; |
541 | } | 540 | } |
542 | 541 | ||
543 | 542 | ||
544 | sim.regionDataURI = String.Empty; | 543 | sim.regionDataURI = String.Empty; |
545 | sim.regionAssetURI = Config.DefaultAssetServer; | 544 | sim.regionAssetURI = Config.DefaultAssetServer; |
546 | sim.regionAssetRecvKey = Config.AssetRecvKey; | 545 | sim.regionAssetRecvKey = Config.AssetRecvKey; |
@@ -549,16 +548,16 @@ namespace OpenSim.Grid.GridServer | |||
549 | sim.regionUserSendKey = Config.UserSendKey; | 548 | sim.regionUserSendKey = Config.UserSendKey; |
550 | sim.regionUserRecvKey = Config.UserRecvKey; | 549 | sim.regionUserRecvKey = Config.UserRecvKey; |
551 | 550 | ||
552 | sim.serverIP = (string) requestData["sim_ip"]; | 551 | sim.serverIP = (string)requestData["sim_ip"]; |
553 | sim.serverPort = Convert.ToUInt32((string) requestData["sim_port"]); | 552 | sim.serverPort = Convert.ToUInt32((string)requestData["sim_port"]); |
554 | sim.httpPort = Convert.ToUInt32((string) requestData["http_port"]); | 553 | sim.httpPort = Convert.ToUInt32((string)requestData["http_port"]); |
555 | sim.remotingPort = Convert.ToUInt32((string) requestData["remoting_port"]); | 554 | sim.remotingPort = Convert.ToUInt32((string)requestData["remoting_port"]); |
556 | sim.regionLocX = Convert.ToUInt32((string) requestData["region_locx"]); | 555 | sim.regionLocX = Convert.ToUInt32((string)requestData["region_locx"]); |
557 | sim.regionLocY = Convert.ToUInt32((string) requestData["region_locy"]); | 556 | sim.regionLocY = Convert.ToUInt32((string)requestData["region_locy"]); |
558 | sim.regionLocZ = 0; | 557 | sim.regionLocZ = 0; |
559 | 558 | ||
560 | LLUUID textureID; | 559 | LLUUID textureID; |
561 | if (LLUUID.TryParse((string) requestData["map-image-id"], out textureID)) | 560 | if (LLUUID.TryParse((string)requestData["map-image-id"], out textureID)) |
562 | { | 561 | { |
563 | sim.regionMapTextureID = textureID; | 562 | sim.regionMapTextureID = textureID; |
564 | } | 563 | } |
@@ -571,23 +570,21 @@ namespace OpenSim.Grid.GridServer | |||
571 | // | 570 | // |
572 | // this particular section of the mod attempts to receive a value from the region's xml file by way of | 571 | // this particular section of the mod attempts to receive a value from the region's xml file by way of |
573 | // OSG1GridServices for the region's owner | 572 | // OSG1GridServices for the region's owner |
574 | sim.owner_uuid = (string) requestData["master_avatar_uuid"]; | 573 | sim.owner_uuid = (string)requestData["master_avatar_uuid"]; |
575 | 574 | ||
576 | try | 575 | try |
577 | { | 576 | { |
578 | sim.regionRecvKey = (string) requestData["recvkey"]; | 577 | sim.regionRecvKey = (string)requestData["recvkey"]; |
579 | sim.regionSendKey = (string) requestData["authkey"]; | 578 | sim.regionSendKey = (string)requestData["authkey"]; |
580 | } | ||
581 | catch (KeyNotFoundException) | ||
582 | { | ||
583 | } | 579 | } |
580 | catch (KeyNotFoundException) { } | ||
584 | 581 | ||
585 | sim.regionHandle = Helpers.UIntsToLong((sim.regionLocX * Constants.RegionSize), (sim.regionLocY * Constants.RegionSize)); | 582 | sim.regionHandle = Helpers.UIntsToLong((sim.regionLocX * Constants.RegionSize), (sim.regionLocY * Constants.RegionSize)); |
586 | sim.serverURI = (string) requestData["server_uri"]; | 583 | sim.serverURI = (string)requestData["server_uri"]; |
587 | 584 | ||
588 | sim.httpServerURI = "http://" + sim.serverIP + ":" + sim.httpPort + "/"; | 585 | sim.httpServerURI = "http://" + sim.serverIP + ":" + sim.httpPort + "/"; |
589 | 586 | ||
590 | sim.regionName = (string) requestData["sim_name"]; | 587 | sim.regionName = (string)requestData["sim_name"]; |
591 | return sim; | 588 | return sim; |
592 | } | 589 | } |
593 | 590 | ||
@@ -607,7 +604,7 @@ namespace OpenSim.Grid.GridServer | |||
607 | 604 | ||
608 | //RegionProfileData TheSim = null; | 605 | //RegionProfileData TheSim = null; |
609 | string uuid; | 606 | string uuid; |
610 | Hashtable requestData = (Hashtable) request.Params[0]; | 607 | Hashtable requestData = (Hashtable)request.Params[0]; |
611 | 608 | ||
612 | if (requestData.ContainsKey("UUID")) | 609 | if (requestData.ContainsKey("UUID")) |
613 | { | 610 | { |
@@ -627,7 +624,7 @@ namespace OpenSim.Grid.GridServer | |||
627 | //OpenSim.Data.MySQL.MySQLGridData dbengine = new OpenSim.Data.MySQL.MySQLGridData(); | 624 | //OpenSim.Data.MySQL.MySQLGridData dbengine = new OpenSim.Data.MySQL.MySQLGridData(); |
628 | try | 625 | try |
629 | { | 626 | { |
630 | MySQLGridData mysqldata = (MySQLGridData) (kvp.Value); | 627 | MySQLGridData mysqldata = (MySQLGridData)(kvp.Value); |
631 | //DataResponse insertResponse = mysqldata.DeleteProfile(TheSim); | 628 | //DataResponse insertResponse = mysqldata.DeleteProfile(TheSim); |
632 | DataResponse insertResponse = mysqldata.DeleteProfile(uuid); | 629 | DataResponse insertResponse = mysqldata.DeleteProfile(uuid); |
633 | switch (insertResponse) | 630 | switch (insertResponse) |
@@ -667,22 +664,22 @@ namespace OpenSim.Grid.GridServer | |||
667 | /// <returns></returns> | 664 | /// <returns></returns> |
668 | public XmlRpcResponse XmlRpcSimulatorDataRequestMethod(XmlRpcRequest request) | 665 | public XmlRpcResponse XmlRpcSimulatorDataRequestMethod(XmlRpcRequest request) |
669 | { | 666 | { |
670 | Hashtable requestData = (Hashtable) request.Params[0]; | 667 | Hashtable requestData = (Hashtable)request.Params[0]; |
671 | Hashtable responseData = new Hashtable(); | 668 | Hashtable responseData = new Hashtable(); |
672 | RegionProfileData simData = null; | 669 | RegionProfileData simData = null; |
673 | if (requestData.ContainsKey("region_UUID")) | 670 | if (requestData.ContainsKey("region_UUID")) |
674 | { | 671 | { |
675 | simData = GetRegion(new LLUUID((string) requestData["region_UUID"])); | 672 | simData = GetRegion(new LLUUID((string)requestData["region_UUID"])); |
676 | } | 673 | } |
677 | else if (requestData.ContainsKey("region_handle")) | 674 | else if (requestData.ContainsKey("region_handle")) |
678 | { | 675 | { |
679 | //CFK: The if/else below this makes this message redundant. | 676 | //CFK: The if/else below this makes this message redundant. |
680 | //CFK: Console.WriteLine("requesting data for region " + (string) requestData["region_handle"]); | 677 | //CFK: Console.WriteLine("requesting data for region " + (string) requestData["region_handle"]); |
681 | simData = GetRegion(Convert.ToUInt64((string) requestData["region_handle"])); | 678 | simData = GetRegion(Convert.ToUInt64((string)requestData["region_handle"])); |
682 | } | 679 | } |
683 | else if (requestData.ContainsKey("region_name_search")) | 680 | else if (requestData.ContainsKey("region_name_search")) |
684 | { | 681 | { |
685 | simData = GetRegion((string) requestData["region_name_search"]); | 682 | simData = GetRegion((string)requestData["region_name_search"]); |
686 | } | 683 | } |
687 | 684 | ||
688 | if (simData == null) | 685 | if (simData == null) |
@@ -693,8 +690,8 @@ namespace OpenSim.Grid.GridServer | |||
693 | } | 690 | } |
694 | else | 691 | else |
695 | { | 692 | { |
696 | m_log.Info("[DATA]: found " + simData.regionName + " regionHandle = " + | 693 | m_log.Info("[DATA]: found " + (string)simData.regionName + " regionHandle = " + |
697 | (string) requestData["region_handle"]); | 694 | (string)requestData["region_handle"]); |
698 | responseData["sim_ip"] = Util.GetHostFromDNS(simData.serverIP).ToString(); | 695 | responseData["sim_ip"] = Util.GetHostFromDNS(simData.serverIP).ToString(); |
699 | responseData["sim_port"] = simData.serverPort.ToString(); | 696 | responseData["sim_port"] = simData.serverPort.ToString(); |
700 | responseData["server_uri"] = simData.serverURI; | 697 | responseData["server_uri"] = simData.serverURI; |
@@ -716,22 +713,22 @@ namespace OpenSim.Grid.GridServer | |||
716 | { | 713 | { |
717 | int xmin = 980, ymin = 980, xmax = 1020, ymax = 1020; | 714 | int xmin = 980, ymin = 980, xmax = 1020, ymax = 1020; |
718 | 715 | ||
719 | Hashtable requestData = (Hashtable) request.Params[0]; | 716 | Hashtable requestData = (Hashtable)request.Params[0]; |
720 | if (requestData.ContainsKey("xmin")) | 717 | if (requestData.ContainsKey("xmin")) |
721 | { | 718 | { |
722 | xmin = (Int32) requestData["xmin"]; | 719 | xmin = (Int32)requestData["xmin"]; |
723 | } | 720 | } |
724 | if (requestData.ContainsKey("ymin")) | 721 | if (requestData.ContainsKey("ymin")) |
725 | { | 722 | { |
726 | ymin = (Int32) requestData["ymin"]; | 723 | ymin = (Int32)requestData["ymin"]; |
727 | } | 724 | } |
728 | if (requestData.ContainsKey("xmax")) | 725 | if (requestData.ContainsKey("xmax")) |
729 | { | 726 | { |
730 | xmax = (Int32) requestData["xmax"]; | 727 | xmax = (Int32)requestData["xmax"]; |
731 | } | 728 | } |
732 | if (requestData.ContainsKey("ymax")) | 729 | if (requestData.ContainsKey("ymax")) |
733 | { | 730 | { |
734 | ymax = (Int32) requestData["ymax"]; | 731 | ymax = (Int32)requestData["ymax"]; |
735 | } | 732 | } |
736 | //CFK: The second log is more meaningful and either standard or fast generally occurs. | 733 | //CFK: The second log is more meaningful and either standard or fast generally occurs. |
737 | //CFK: m_log.Info("[MAP]: World map request for range (" + xmin + "," + ymin + ")..(" + xmax + "," + ymax + ")"); | 734 | //CFK: m_log.Info("[MAP]: World map request for range (" + xmin + "," + ymin + ")..(" + xmax + "," + ymax + ")"); |
@@ -746,15 +743,15 @@ namespace OpenSim.Grid.GridServer | |||
746 | if (fastMode) | 743 | if (fastMode) |
747 | { | 744 | { |
748 | Dictionary<ulong, RegionProfileData> neighbours = | 745 | Dictionary<ulong, RegionProfileData> neighbours = |
749 | GetRegions((uint) xmin, (uint) ymin, (uint) xmax, (uint) ymax); | 746 | GetRegions((uint)xmin, (uint)ymin, (uint)xmax, (uint)ymax); |
750 | 747 | ||
751 | foreach (KeyValuePair<ulong, RegionProfileData> aSim in neighbours) | 748 | foreach (KeyValuePair<ulong, RegionProfileData> aSim in neighbours) |
752 | { | 749 | { |
753 | Hashtable simProfileBlock = new Hashtable(); | 750 | Hashtable simProfileBlock = new Hashtable(); |
754 | simProfileBlock["x"] = aSim.Value.regionLocX.ToString(); | 751 | simProfileBlock["x"] = aSim.Value.regionLocX.ToString(); |
755 | simProfileBlock["y"] = aSim.Value.regionLocY.ToString(); | 752 | simProfileBlock["y"] = aSim.Value.regionLocY.ToString(); |
756 | Console.WriteLine("send neighbour info for " + aSim.Value.regionLocX + " , " + | 753 | Console.WriteLine("send neighbour info for " + aSim.Value.regionLocX.ToString() + " , " + |
757 | aSim.Value.regionLocY); | 754 | aSim.Value.regionLocY.ToString()); |
758 | simProfileBlock["name"] = aSim.Value.regionName; | 755 | simProfileBlock["name"] = aSim.Value.regionName; |
759 | simProfileBlock["access"] = 21; | 756 | simProfileBlock["access"] = 21; |
760 | simProfileBlock["region-flags"] = 512; | 757 | simProfileBlock["region-flags"] = 512; |
@@ -764,15 +761,15 @@ namespace OpenSim.Grid.GridServer | |||
764 | 761 | ||
765 | // For Sugilite compatibility | 762 | // For Sugilite compatibility |
766 | simProfileBlock["regionhandle"] = aSim.Value.regionHandle.ToString(); | 763 | simProfileBlock["regionhandle"] = aSim.Value.regionHandle.ToString(); |
767 | simProfileBlock["sim_ip"] = aSim.Value.serverIP; | 764 | simProfileBlock["sim_ip"] = aSim.Value.serverIP.ToString(); |
768 | simProfileBlock["sim_port"] = aSim.Value.serverPort.ToString(); | 765 | simProfileBlock["sim_port"] = aSim.Value.serverPort.ToString(); |
769 | simProfileBlock["sim_uri"] = aSim.Value.serverURI; | 766 | simProfileBlock["sim_uri"] = aSim.Value.serverURI.ToString(); |
770 | simProfileBlock["uuid"] = aSim.Value.UUID.ToString(); | 767 | simProfileBlock["uuid"] = aSim.Value.UUID.ToString(); |
771 | simProfileBlock["remoting_port"] = aSim.Value.remotingPort; | 768 | simProfileBlock["remoting_port"] = aSim.Value.remotingPort; |
772 | 769 | ||
773 | simProfileList.Add(simProfileBlock); | 770 | simProfileList.Add(simProfileBlock); |
774 | } | 771 | } |
775 | m_log.Info("[MAP]: Fast map " + simProfileList.Count + | 772 | m_log.Info("[MAP]: Fast map " + simProfileList.Count.ToString() + |
776 | " regions @ (" + xmin + "," + ymin + ")..(" + xmax + "," + ymax + ")"); | 773 | " regions @ (" + xmin + "," + ymin + ")..(" + xmax + "," + ymax + ")"); |
777 | } | 774 | } |
778 | else | 775 | else |
@@ -782,7 +779,7 @@ namespace OpenSim.Grid.GridServer | |||
782 | { | 779 | { |
783 | for (int y = ymin; y < ymax + 1; y++) | 780 | for (int y = ymin; y < ymax + 1; y++) |
784 | { | 781 | { |
785 | ulong regHandle = Helpers.UIntsToLong((uint) (x * Constants.RegionSize), (uint) (y * Constants.RegionSize)); | 782 | ulong regHandle = Helpers.UIntsToLong((uint)(x * Constants.RegionSize), (uint)(y * Constants.RegionSize)); |
786 | simProfile = GetRegion(regHandle); | 783 | simProfile = GetRegion(regHandle); |
787 | if (simProfile != null) | 784 | if (simProfile != null) |
788 | { | 785 | { |
@@ -798,16 +795,16 @@ namespace OpenSim.Grid.GridServer | |||
798 | 795 | ||
799 | // For Sugilite compatibility | 796 | // For Sugilite compatibility |
800 | simProfileBlock["regionhandle"] = simProfile.regionHandle.ToString(); | 797 | simProfileBlock["regionhandle"] = simProfile.regionHandle.ToString(); |
801 | simProfileBlock["sim_ip"] = simProfile.serverIP; | 798 | simProfileBlock["sim_ip"] = simProfile.serverIP.ToString(); |
802 | simProfileBlock["sim_port"] = simProfile.serverPort.ToString(); | 799 | simProfileBlock["sim_port"] = simProfile.serverPort.ToString(); |
803 | simProfileBlock["sim_uri"] = simProfile.serverURI; | 800 | simProfileBlock["sim_uri"] = simProfile.serverURI.ToString(); |
804 | simProfileBlock["uuid"] = simProfile.UUID.ToString(); | 801 | simProfileBlock["uuid"] = simProfile.UUID.ToString(); |
805 | 802 | ||
806 | simProfileList.Add(simProfileBlock); | 803 | simProfileList.Add(simProfileBlock); |
807 | } | 804 | } |
808 | } | 805 | } |
809 | } | 806 | } |
810 | m_log.Info("[MAP]: Std map " + simProfileList.Count + | 807 | m_log.Info("[MAP]: Std map " + simProfileList.Count.ToString() + |
811 | " regions @ (" + xmin + "," + ymin + ")..(" + xmax + "," + ymax + ")"); | 808 | " regions @ (" + xmin + "," + ymin + ")..(" + xmax + "," + ymax + ")"); |
812 | } | 809 | } |
813 | 810 | ||
@@ -863,12 +860,12 @@ namespace OpenSim.Grid.GridServer | |||
863 | respstring = "<Root>"; | 860 | respstring = "<Root>"; |
864 | respstring += "<authkey>" + TheSim.regionSendKey + "</authkey>"; | 861 | respstring += "<authkey>" + TheSim.regionSendKey + "</authkey>"; |
865 | respstring += "<sim>"; | 862 | respstring += "<sim>"; |
866 | respstring += "<uuid>" + TheSim.UUID + "</uuid>"; | 863 | respstring += "<uuid>" + TheSim.UUID.ToString() + "</uuid>"; |
867 | respstring += "<regionname>" + TheSim.regionName + "</regionname>"; | 864 | respstring += "<regionname>" + TheSim.regionName + "</regionname>"; |
868 | respstring += "<sim_ip>" + Util.GetHostFromDNS(TheSim.serverIP) + "</sim_ip>"; | 865 | respstring += "<sim_ip>" + Util.GetHostFromDNS(TheSim.serverIP).ToString() + "</sim_ip>"; |
869 | respstring += "<sim_port>" + TheSim.serverPort + "</sim_port>"; | 866 | respstring += "<sim_port>" + TheSim.serverPort.ToString() + "</sim_port>"; |
870 | respstring += "<region_locx>" + TheSim.regionLocX + "</region_locx>"; | 867 | respstring += "<region_locx>" + TheSim.regionLocX.ToString() + "</region_locx>"; |
871 | respstring += "<region_locy>" + TheSim.regionLocY + "</region_locy>"; | 868 | respstring += "<region_locy>" + TheSim.regionLocY.ToString() + "</region_locy>"; |
872 | respstring += "<estate_id>1</estate_id>"; | 869 | respstring += "<estate_id>1</estate_id>"; |
873 | respstring += "</sim>"; | 870 | respstring += "</sim>"; |
874 | respstring += "</Root>"; | 871 | respstring += "</Root>"; |
@@ -949,12 +946,12 @@ namespace OpenSim.Grid.GridServer | |||
949 | break; | 946 | break; |
950 | 947 | ||
951 | case "region_locx": | 948 | case "region_locx": |
952 | theSim.regionLocX = Convert.ToUInt32(simnode.ChildNodes[i].InnerText); | 949 | theSim.regionLocX = Convert.ToUInt32((string)simnode.ChildNodes[i].InnerText); |
953 | theSim.regionHandle = Helpers.UIntsToLong((theSim.regionLocX * Constants.RegionSize), (theSim.regionLocY * Constants.RegionSize)); | 950 | theSim.regionHandle = Helpers.UIntsToLong((theSim.regionLocX * Constants.RegionSize), (theSim.regionLocY * Constants.RegionSize)); |
954 | break; | 951 | break; |
955 | 952 | ||
956 | case "region_locy": | 953 | case "region_locy": |
957 | theSim.regionLocY = Convert.ToUInt32(simnode.ChildNodes[i].InnerText); | 954 | theSim.regionLocY = Convert.ToUInt32((string)simnode.ChildNodes[i].InnerText); |
958 | theSim.regionHandle = Helpers.UIntsToLong((theSim.regionLocX * Constants.RegionSize), (theSim.regionLocY * Constants.RegionSize)); | 955 | theSim.regionHandle = Helpers.UIntsToLong((theSim.regionLocX * Constants.RegionSize), (theSim.regionLocY * Constants.RegionSize)); |
959 | break; | 956 | break; |
960 | } | 957 | } |
@@ -1008,28 +1005,28 @@ namespace OpenSim.Grid.GridServer | |||
1008 | catch (Exception e) | 1005 | catch (Exception e) |
1009 | { | 1006 | { |
1010 | m_log.Warn("[GRID]: GetRegionPlugin Handle " + kvp.Key + " unable to add new sim: " + | 1007 | m_log.Warn("[GRID]: GetRegionPlugin Handle " + kvp.Key + " unable to add new sim: " + |
1011 | e); | 1008 | e.ToString()); |
1012 | } | 1009 | } |
1013 | } | 1010 | } |
1014 | return "OK"; | 1011 | return "OK"; |
1015 | } | 1012 | } |
1016 | catch (Exception e) | 1013 | catch (Exception e) |
1017 | { | 1014 | { |
1018 | return "ERROR! Could not save to database! (" + e + ")"; | 1015 | return "ERROR! Could not save to database! (" + e.ToString() + ")"; |
1019 | } | 1016 | } |
1020 | } | 1017 | } |
1021 | 1018 | ||
1022 | public XmlRpcResponse XmlRPCRegisterMessageServer(XmlRpcRequest request) | 1019 | public XmlRpcResponse XmlRPCRegisterMessageServer(XmlRpcRequest request) |
1023 | { | 1020 | { |
1024 | XmlRpcResponse response = new XmlRpcResponse(); | 1021 | XmlRpcResponse response = new XmlRpcResponse(); |
1025 | Hashtable requestData = (Hashtable) request.Params[0]; | 1022 | Hashtable requestData = (Hashtable)request.Params[0]; |
1026 | Hashtable responseData = new Hashtable(); | 1023 | Hashtable responseData = new Hashtable(); |
1027 | 1024 | ||
1028 | if (requestData.Contains("uri")) | 1025 | if (requestData.Contains("uri")) |
1029 | { | 1026 | { |
1030 | string URI = (string) requestData["URI"]; | 1027 | string URI = (string)requestData["URI"]; |
1031 | string sendkey = (string) requestData["sendkey"]; | 1028 | string sendkey = (string)requestData["sendkey"]; |
1032 | string recvkey = (string) requestData["recvkey"]; | 1029 | string recvkey = (string)requestData["recvkey"]; |
1033 | MessageServerInfo m = new MessageServerInfo(); | 1030 | MessageServerInfo m = new MessageServerInfo(); |
1034 | m.URI = URI; | 1031 | m.URI = URI; |
1035 | m.sendkey = sendkey; | 1032 | m.sendkey = sendkey; |
@@ -1045,14 +1042,14 @@ namespace OpenSim.Grid.GridServer | |||
1045 | public XmlRpcResponse XmlRPCDeRegisterMessageServer(XmlRpcRequest request) | 1042 | public XmlRpcResponse XmlRPCDeRegisterMessageServer(XmlRpcRequest request) |
1046 | { | 1043 | { |
1047 | XmlRpcResponse response = new XmlRpcResponse(); | 1044 | XmlRpcResponse response = new XmlRpcResponse(); |
1048 | Hashtable requestData = (Hashtable) request.Params[0]; | 1045 | Hashtable requestData = (Hashtable)request.Params[0]; |
1049 | Hashtable responseData = new Hashtable(); | 1046 | Hashtable responseData = new Hashtable(); |
1050 | 1047 | ||
1051 | if (requestData.Contains("uri")) | 1048 | if (requestData.Contains("uri")) |
1052 | { | 1049 | { |
1053 | string URI = (string) requestData["uri"]; | 1050 | string URI = (string)requestData["uri"]; |
1054 | string sendkey = (string) requestData["sendkey"]; | 1051 | string sendkey = (string)requestData["sendkey"]; |
1055 | string recvkey = (string) requestData["recvkey"]; | 1052 | string recvkey = (string)requestData["recvkey"]; |
1056 | MessageServerInfo m = new MessageServerInfo(); | 1053 | MessageServerInfo m = new MessageServerInfo(); |
1057 | m.URI = URI; | 1054 | m.URI = URI; |
1058 | m.sendkey = sendkey; | 1055 | m.sendkey = sendkey; |
@@ -1065,4 +1062,4 @@ namespace OpenSim.Grid.GridServer | |||
1065 | return response; | 1062 | return response; |
1066 | } | 1063 | } |
1067 | } | 1064 | } |
1068 | } \ No newline at end of file | 1065 | } |
diff --git a/OpenSim/Grid/GridServer/GridServerBase.cs b/OpenSim/Grid/GridServer/GridServerBase.cs index ac33a6c..2feaac3 100644 --- a/OpenSim/Grid/GridServer/GridServerBase.cs +++ b/OpenSim/Grid/GridServer/GridServerBase.cs | |||
@@ -44,34 +44,6 @@ namespace OpenSim.Grid.GridServer | |||
44 | protected GridManager m_gridManager; | 44 | protected GridManager m_gridManager; |
45 | protected List<IGridPlugin> m_plugins = new List<IGridPlugin>(); | 45 | protected List<IGridPlugin> m_plugins = new List<IGridPlugin>(); |
46 | 46 | ||
47 | public GridServerBase() | ||
48 | { | ||
49 | m_console = new ConsoleBase("OpenGrid", this); | ||
50 | MainConsole.Instance = m_console; | ||
51 | } | ||
52 | |||
53 | #region conscmd_callback Members | ||
54 | |||
55 | public override void RunCmd(string cmd, string[] cmdparams) | ||
56 | { | ||
57 | base.RunCmd(cmd, cmdparams); | ||
58 | |||
59 | switch (cmd) | ||
60 | { | ||
61 | case "help": | ||
62 | m_console.Notice("shutdown - shutdown the grid (USE CAUTION!)"); | ||
63 | break; | ||
64 | |||
65 | case "shutdown": | ||
66 | foreach (IGridPlugin plugin in m_plugins) plugin.Close(); | ||
67 | m_console.Close(); | ||
68 | Environment.Exit(0); | ||
69 | break; | ||
70 | } | ||
71 | } | ||
72 | |||
73 | #endregion | ||
74 | |||
75 | public void Work() | 47 | public void Work() |
76 | { | 48 | { |
77 | m_console.Notice("Enter help for a list of commands\n"); | 49 | m_console.Notice("Enter help for a list of commands\n"); |
@@ -82,6 +54,12 @@ namespace OpenSim.Grid.GridServer | |||
82 | } | 54 | } |
83 | } | 55 | } |
84 | 56 | ||
57 | public GridServerBase() | ||
58 | { | ||
59 | m_console = new ConsoleBase("OpenGrid", this); | ||
60 | MainConsole.Instance = m_console; | ||
61 | } | ||
62 | |||
85 | public void managercallback(string cmd) | 63 | public void managercallback(string cmd) |
86 | { | 64 | { |
87 | switch (cmd) | 65 | switch (cmd) |
@@ -105,14 +83,14 @@ namespace OpenSim.Grid.GridServer | |||
105 | 83 | ||
106 | AddHttpHandlers(); | 84 | AddHttpHandlers(); |
107 | 85 | ||
108 | LoadGridPlugins(); | 86 | LoadGridPlugins( ); |
109 | 87 | ||
110 | m_httpServer.Start(); | 88 | m_httpServer.Start(); |
111 | 89 | ||
112 | m_console.Status("[GRID]: Starting sim status checker"); | 90 | m_console.Status("[GRID]: Starting sim status checker"); |
113 | 91 | ||
114 | Timer simCheckTimer = new Timer(3600000 * 3); // 3 Hours between updates. | 92 | Timer simCheckTimer = new Timer(3600000 * 3); // 3 Hours between updates. |
115 | simCheckTimer.Elapsed += CheckSims; | 93 | simCheckTimer.Elapsed += new ElapsedEventHandler(CheckSims); |
116 | simCheckTimer.Enabled = true; | 94 | simCheckTimer.Enabled = true; |
117 | } | 95 | } |
118 | 96 | ||
@@ -144,7 +122,7 @@ namespace OpenSim.Grid.GridServer | |||
144 | foreach (TypeExtensionNode node in nodes) | 122 | foreach (TypeExtensionNode node in nodes) |
145 | { | 123 | { |
146 | m_console.Status("[GRIDPLUGINS]: Loading OpenSim plugin " + node.Path); | 124 | m_console.Status("[GRIDPLUGINS]: Loading OpenSim plugin " + node.Path); |
147 | IGridPlugin plugin = (IGridPlugin) node.CreateInstance(); | 125 | IGridPlugin plugin = (IGridPlugin)node.CreateInstance(); |
148 | plugin.Initialise(this); | 126 | plugin.Initialise(this); |
149 | m_plugins.Add(plugin); | 127 | m_plugins.Add(plugin); |
150 | } | 128 | } |
@@ -199,5 +177,23 @@ namespace OpenSim.Grid.GridServer | |||
199 | } | 177 | } |
200 | */ | 178 | */ |
201 | } | 179 | } |
180 | |||
181 | public override void RunCmd(string cmd, string[] cmdparams) | ||
182 | { | ||
183 | base.RunCmd(cmd, cmdparams); | ||
184 | |||
185 | switch (cmd) | ||
186 | { | ||
187 | case "help": | ||
188 | m_console.Notice("shutdown - shutdown the grid (USE CAUTION!)"); | ||
189 | break; | ||
190 | |||
191 | case "shutdown": | ||
192 | foreach (IGridPlugin plugin in m_plugins) plugin.Close(); | ||
193 | m_console.Close(); | ||
194 | Environment.Exit(0); | ||
195 | break; | ||
196 | } | ||
197 | } | ||
202 | } | 198 | } |
203 | } \ No newline at end of file | 199 | } |
diff --git a/OpenSim/Grid/GridServer/IGridPlugin.cs b/OpenSim/Grid/GridServer/IGridPlugin.cs index 40d208c..fbadfce 100644 --- a/OpenSim/Grid/GridServer/IGridPlugin.cs +++ b/OpenSim/Grid/GridServer/IGridPlugin.cs | |||
@@ -38,4 +38,4 @@ namespace OpenSim.Grid.GridServer | |||
38 | void Initialise(GridServerBase gridServer); | 38 | void Initialise(GridServerBase gridServer); |
39 | void Close(); | 39 | void Close(); |
40 | } | 40 | } |
41 | } \ No newline at end of file | 41 | } |
diff --git a/OpenSim/Grid/GridServer/Program.cs b/OpenSim/Grid/GridServer/Program.cs index 06d8e3d..6eb4e15 100644 --- a/OpenSim/Grid/GridServer/Program.cs +++ b/OpenSim/Grid/GridServer/Program.cs | |||
@@ -50,4 +50,4 @@ namespace OpenSim.Grid.GridServer | |||
50 | } | 50 | } |
51 | } | 51 | } |
52 | } | 52 | } |
53 | } \ No newline at end of file | 53 | } |
diff --git a/OpenSim/Grid/GridServer/Properties/AssemblyInfo.cs b/OpenSim/Grid/GridServer/Properties/AssemblyInfo.cs index 2b07547..1468edd 100644 --- a/OpenSim/Grid/GridServer/Properties/AssemblyInfo.cs +++ b/OpenSim/Grid/GridServer/Properties/AssemblyInfo.cs | |||
@@ -60,4 +60,4 @@ using System.Runtime.InteropServices; | |||
60 | // | 60 | // |
61 | 61 | ||
62 | [assembly : AssemblyVersion("1.0.0.0")] | 62 | [assembly : AssemblyVersion("1.0.0.0")] |
63 | [assembly : AssemblyFileVersion("1.0.0.0")] \ No newline at end of file | 63 | [assembly : AssemblyFileVersion("1.0.0.0")] |
diff --git a/OpenSim/Grid/InventoryServer/GridInventoryService.cs b/OpenSim/Grid/InventoryServer/GridInventoryService.cs index c3e3a28..db9a864 100644 --- a/OpenSim/Grid/InventoryServer/GridInventoryService.cs +++ b/OpenSim/Grid/InventoryServer/GridInventoryService.cs | |||
@@ -40,7 +40,7 @@ namespace OpenSim.Grid.InventoryServer | |||
40 | /// </summary> | 40 | /// </summary> |
41 | public class GridInventoryService : InventoryServiceBase | 41 | public class GridInventoryService : InventoryServiceBase |
42 | { | 42 | { |
43 | private static readonly ILog m_log | 43 | private static readonly ILog m_log |
44 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 44 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
45 | 45 | ||
46 | public override void RequestInventoryForUser(LLUUID userID, InventoryReceiptCallback callback) | 46 | public override void RequestInventoryForUser(LLUUID userID, InventoryReceiptCallback callback) |
@@ -55,7 +55,7 @@ namespace OpenSim.Grid.InventoryServer | |||
55 | /// <param name="itemsList"></param> | 55 | /// <param name="itemsList"></param> |
56 | /// <returns>true if the inventory was retrieved, false otherwise</returns> | 56 | /// <returns>true if the inventory was retrieved, false otherwise</returns> |
57 | private bool GetUsersInventory(LLUUID userID, out List<InventoryFolderBase> folderList, | 57 | private bool GetUsersInventory(LLUUID userID, out List<InventoryFolderBase> folderList, |
58 | out List<InventoryItemBase> itemsList) | 58 | out List<InventoryItemBase> itemsList) |
59 | { | 59 | { |
60 | List<InventoryFolderBase> allFolders = GetInventorySkeleton(userID); | 60 | List<InventoryFolderBase> allFolders = GetInventorySkeleton(userID); |
61 | List<InventoryItemBase> allItems = new List<InventoryItemBase>(); | 61 | List<InventoryItemBase> allItems = new List<InventoryItemBase>(); |
@@ -109,28 +109,28 @@ namespace OpenSim.Grid.InventoryServer | |||
109 | { | 109 | { |
110 | // uncomment me to simulate an overloaded inventory server | 110 | // uncomment me to simulate an overloaded inventory server |
111 | //Thread.Sleep(20000); | 111 | //Thread.Sleep(20000); |
112 | 112 | ||
113 | LLUUID userID = new LLUUID(rawUserID); | 113 | LLUUID userID = new LLUUID(rawUserID); |
114 | 114 | ||
115 | m_log.InfoFormat("[GRID AGENT INVENTORY]: Processing request for inventory of {0}", userID); | 115 | m_log.InfoFormat("[GRID AGENT INVENTORY]: Processing request for inventory of {0}", userID); |
116 | 116 | ||
117 | InventoryCollection invCollection = new InventoryCollection(); | 117 | InventoryCollection invCollection = new InventoryCollection(); |
118 | 118 | ||
119 | List<InventoryFolderBase> allFolders = GetInventorySkeleton(userID); | 119 | List<InventoryFolderBase> allFolders = GetInventorySkeleton(userID); |
120 | 120 | ||
121 | if (null == allFolders) | 121 | if (null == allFolders) |
122 | { | 122 | { |
123 | m_log.WarnFormat("[GRID AGENT INVENTORY]: No inventory found for user {0}", rawUserID); | 123 | m_log.WarnFormat("[GRID AGENT INVENTORY]: No inventory found for user {0}", rawUserID); |
124 | 124 | ||
125 | return invCollection; | 125 | return invCollection; |
126 | } | 126 | } |
127 | 127 | ||
128 | List<InventoryItemBase> allItems = new List<InventoryItemBase>(); | 128 | List<InventoryItemBase> allItems = new List<InventoryItemBase>(); |
129 | 129 | ||
130 | foreach (InventoryFolderBase folder in allFolders) | 130 | foreach (InventoryFolderBase folder in allFolders) |
131 | { | 131 | { |
132 | List<InventoryItemBase> items = RequestFolderItems(folder.ID); | 132 | List<InventoryItemBase> items = RequestFolderItems(folder.ID); |
133 | 133 | ||
134 | if (items != null) | 134 | if (items != null) |
135 | { | 135 | { |
136 | allItems.InsertRange(0, items); | 136 | allItems.InsertRange(0, items); |
@@ -138,9 +138,9 @@ namespace OpenSim.Grid.InventoryServer | |||
138 | } | 138 | } |
139 | 139 | ||
140 | invCollection.UserID = userID; | 140 | invCollection.UserID = userID; |
141 | invCollection.Folders = allFolders; | 141 | invCollection.Folders = allFolders; |
142 | invCollection.Items = allItems; | 142 | invCollection.Items = allItems; |
143 | 143 | ||
144 | // foreach (InventoryFolderBase folder in invCollection.Folders) | 144 | // foreach (InventoryFolderBase folder in invCollection.Folders) |
145 | // { | 145 | // { |
146 | // m_log.DebugFormat("[GRID AGENT INVENTORY]: Sending back folder {0} {1}", folder.Name, folder.ID); | 146 | // m_log.DebugFormat("[GRID AGENT INVENTORY]: Sending back folder {0} {1}", folder.Name, folder.ID); |
@@ -150,14 +150,14 @@ namespace OpenSim.Grid.InventoryServer | |||
150 | // { | 150 | // { |
151 | // m_log.DebugFormat("[GRID AGENT INVENTORY]: Sending back item {0} {1}, folder {2}", item.Name, item.ID, item.Folder); | 151 | // m_log.DebugFormat("[GRID AGENT INVENTORY]: Sending back item {0} {1}, folder {2}", item.Name, item.ID, item.Folder); |
152 | // } | 152 | // } |
153 | 153 | ||
154 | m_log.InfoFormat( | 154 | m_log.InfoFormat( |
155 | "[GRID AGENT INVENTORY]: Sending back inventory response to user {0} containing {1} folders and {2} items", | 155 | "[GRID AGENT INVENTORY]: Sending back inventory response to user {0} containing {1} folders and {2} items", |
156 | invCollection.UserID, invCollection.Folders.Count, invCollection.Items.Count); | 156 | invCollection.UserID, invCollection.Folders.Count, invCollection.Items.Count); |
157 | 157 | ||
158 | return invCollection; | 158 | return invCollection; |
159 | } | 159 | } |
160 | 160 | ||
161 | /// <summary> | 161 | /// <summary> |
162 | /// Guid to UUID wrapper for same name IInventoryServices method | 162 | /// Guid to UUID wrapper for same name IInventoryServices method |
163 | /// </summary> | 163 | /// </summary> |
@@ -166,10 +166,10 @@ namespace OpenSim.Grid.InventoryServer | |||
166 | public List<InventoryFolderBase> GetInventorySkeleton(Guid rawUserID) | 166 | public List<InventoryFolderBase> GetInventorySkeleton(Guid rawUserID) |
167 | { | 167 | { |
168 | //Thread.Sleep(10000); | 168 | //Thread.Sleep(10000); |
169 | 169 | ||
170 | LLUUID userID = new LLUUID(rawUserID); | 170 | LLUUID userID = new LLUUID(rawUserID); |
171 | return GetInventorySkeleton(userID); | 171 | return GetInventorySkeleton(userID); |
172 | } | 172 | } |
173 | 173 | ||
174 | /// <summary> | 174 | /// <summary> |
175 | /// Create an inventory for the given user. | 175 | /// Create an inventory for the given user. |
@@ -196,11 +196,11 @@ namespace OpenSim.Grid.InventoryServer | |||
196 | { | 196 | { |
197 | MoveFolder(folder); | 197 | MoveFolder(folder); |
198 | } | 198 | } |
199 | 199 | ||
200 | public override void PurgeInventoryFolder(LLUUID userID, InventoryFolderBase folder) | 200 | public override void PurgeInventoryFolder(LLUUID userID, InventoryFolderBase folder) |
201 | { | 201 | { |
202 | PurgeFolder(folder); | 202 | PurgeFolder(folder); |
203 | } | 203 | } |
204 | 204 | ||
205 | public override void AddNewInventoryItem(LLUUID userID, InventoryItemBase item) | 205 | public override void AddNewInventoryItem(LLUUID userID, InventoryItemBase item) |
206 | { | 206 | { |
@@ -230,15 +230,15 @@ namespace OpenSim.Grid.InventoryServer | |||
230 | MoveExistingInventoryFolder(folder); | 230 | MoveExistingInventoryFolder(folder); |
231 | return true; | 231 | return true; |
232 | } | 232 | } |
233 | 233 | ||
234 | public bool PurgeInventoryFolder(InventoryFolderBase folder) | 234 | public bool PurgeInventoryFolder(InventoryFolderBase folder) |
235 | { | 235 | { |
236 | m_log.InfoFormat( | 236 | m_log.InfoFormat( |
237 | "[GRID AGENT INVENTORY]: Purging folder {0} {1} of its contents", folder.Name, folder.ID); | 237 | "[GRID AGENT INVENTORY]: Purging folder {0} {1} of its contents", folder.Name, folder.ID); |
238 | 238 | ||
239 | PurgeInventoryFolder(folder.Owner, folder); | 239 | PurgeInventoryFolder(folder.Owner, folder); |
240 | return true; | 240 | return true; |
241 | } | 241 | } |
242 | 242 | ||
243 | public bool AddInventoryItem(InventoryItemBase item) | 243 | public bool AddInventoryItem(InventoryItemBase item) |
244 | { | 244 | { |
@@ -267,4 +267,4 @@ namespace OpenSim.Grid.InventoryServer | |||
267 | return true; | 267 | return true; |
268 | } | 268 | } |
269 | } | 269 | } |
270 | } \ No newline at end of file | 270 | } |
diff --git a/OpenSim/Grid/InventoryServer/InventoryManager.cs b/OpenSim/Grid/InventoryServer/InventoryManager.cs index 350a618..5c65317 100644 --- a/OpenSim/Grid/InventoryServer/InventoryManager.cs +++ b/OpenSim/Grid/InventoryServer/InventoryManager.cs | |||
@@ -54,7 +54,7 @@ namespace OpenSim.Grid.InventoryServer | |||
54 | Assembly pluginAssembly = Assembly.LoadFrom(FileName); | 54 | Assembly pluginAssembly = Assembly.LoadFrom(FileName); |
55 | 55 | ||
56 | m_log.Info("[" + OpenInventory_Main.LogName + "]: " + | 56 | m_log.Info("[" + OpenInventory_Main.LogName + "]: " + |
57 | "Invenstorage: Found " + pluginAssembly.GetTypes().Length + " interfaces."); | 57 | "Invenstorage: Found " + pluginAssembly.GetTypes().Length + " interfaces."); |
58 | foreach (Type pluginType in pluginAssembly.GetTypes()) | 58 | foreach (Type pluginType in pluginAssembly.GetTypes()) |
59 | { | 59 | { |
60 | if (!pluginType.IsAbstract) | 60 | if (!pluginType.IsAbstract) |
@@ -68,7 +68,7 @@ namespace OpenSim.Grid.InventoryServer | |||
68 | plug.Initialise(dbconnect); | 68 | plug.Initialise(dbconnect); |
69 | _databasePlugin = plug; | 69 | _databasePlugin = plug; |
70 | m_log.Info("[" + OpenInventory_Main.LogName + "]: " + | 70 | m_log.Info("[" + OpenInventory_Main.LogName + "]: " + |
71 | "Invenstorage: Added IInventoryData Interface"); | 71 | "Invenstorage: Added IInventoryData Interface"); |
72 | break; | 72 | break; |
73 | } | 73 | } |
74 | } | 74 | } |
@@ -136,12 +136,10 @@ namespace OpenSim.Grid.InventoryServer | |||
136 | return fixupFolder(inventory.root, null); | 136 | return fixupFolder(inventory.root, null); |
137 | } | 137 | } |
138 | 138 | ||
139 | #region Nested type: GetInventory | ||
140 | |||
141 | public class GetInventory : BaseStreamHandler | 139 | public class GetInventory : BaseStreamHandler |
142 | { | 140 | { |
143 | private readonly SerializableInventory _inventory; | 141 | private SerializableInventory _inventory; |
144 | private readonly InventoryManager _manager; | 142 | private InventoryManager _manager; |
145 | 143 | ||
146 | public GetInventory(InventoryManager manager) | 144 | public GetInventory(InventoryManager manager) |
147 | : base("GET", "/inventory") | 145 | : base("GET", "/inventory") |
@@ -183,7 +181,7 @@ namespace OpenSim.Grid.InventoryServer | |||
183 | { | 181 | { |
184 | byte[] result = new byte[] {}; | 182 | byte[] result = new byte[] {}; |
185 | 183 | ||
186 | string[] parms = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries); | 184 | string[] parms = path.Split(new char[] {'/'}, StringSplitOptions.RemoveEmptyEntries); |
187 | if (parms.Length > 1) | 185 | if (parms.Length > 1) |
188 | { | 186 | { |
189 | if (string.Compare(parms[1], "library", true) == 0) | 187 | if (string.Compare(parms[1], "library", true) == 0) |
@@ -192,7 +190,7 @@ namespace OpenSim.Grid.InventoryServer | |||
192 | saveInventoryToStream(_inventory, ms); | 190 | saveInventoryToStream(_inventory, ms); |
193 | 191 | ||
194 | result = ms.GetBuffer(); | 192 | result = ms.GetBuffer(); |
195 | Array.Resize(ref result, (int) ms.Length); | 193 | Array.Resize<byte>(ref result, (int) ms.Length); |
196 | } | 194 | } |
197 | else if (string.Compare(parms[1], "user", true) == 0) | 195 | else if (string.Compare(parms[1], "user", true) == 0) |
198 | { | 196 | { |
@@ -205,7 +203,5 @@ namespace OpenSim.Grid.InventoryServer | |||
205 | return result; | 203 | return result; |
206 | } | 204 | } |
207 | } | 205 | } |
208 | |||
209 | #endregion | ||
210 | } | 206 | } |
211 | } \ No newline at end of file | 207 | } |
diff --git a/OpenSim/Grid/InventoryServer/Main.cs b/OpenSim/Grid/InventoryServer/Main.cs index 453d64d..870997b 100644 --- a/OpenSim/Grid/InventoryServer/Main.cs +++ b/OpenSim/Grid/InventoryServer/Main.cs | |||
@@ -40,38 +40,13 @@ namespace OpenSim.Grid.InventoryServer | |||
40 | { | 40 | { |
41 | public class OpenInventory_Main : BaseOpenSimServer, conscmd_callback | 41 | public class OpenInventory_Main : BaseOpenSimServer, conscmd_callback |
42 | { | 42 | { |
43 | public const string LogName = "INVENTORY"; | ||
44 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 43 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
45 | 44 | ||
46 | private InventoryConfig m_config; | ||
47 | private InventoryManager m_inventoryManager; | 45 | private InventoryManager m_inventoryManager; |
46 | private InventoryConfig m_config; | ||
48 | private GridInventoryService m_inventoryService; | 47 | private GridInventoryService m_inventoryService; |
49 | 48 | ||
50 | public OpenInventory_Main() | 49 | public const string LogName = "INVENTORY"; |
51 | { | ||
52 | m_console = new ConsoleBase(LogName, this); | ||
53 | MainConsole.Instance = m_console; | ||
54 | } | ||
55 | |||
56 | #region conscmd_callback Members | ||
57 | |||
58 | public override void RunCmd(string cmd, string[] cmdparams) | ||
59 | { | ||
60 | base.RunCmd(cmd, cmdparams); | ||
61 | |||
62 | switch (cmd) | ||
63 | { | ||
64 | case "add-user": | ||
65 | m_inventoryService.CreateUsersInventory(LLUUID.Random().UUID); | ||
66 | break; | ||
67 | case "shutdown": | ||
68 | m_console.Close(); | ||
69 | Environment.Exit(0); | ||
70 | break; | ||
71 | } | ||
72 | } | ||
73 | |||
74 | #endregion | ||
75 | 50 | ||
76 | [STAThread] | 51 | [STAThread] |
77 | public static void Main(string[] args) | 52 | public static void Main(string[] args) |
@@ -84,6 +59,12 @@ namespace OpenSim.Grid.InventoryServer | |||
84 | theServer.Work(); | 59 | theServer.Work(); |
85 | } | 60 | } |
86 | 61 | ||
62 | public OpenInventory_Main() | ||
63 | { | ||
64 | m_console = new ConsoleBase(LogName, this); | ||
65 | MainConsole.Instance = m_console; | ||
66 | } | ||
67 | |||
87 | public void Startup() | 68 | public void Startup() |
88 | { | 69 | { |
89 | m_log.Info("Initialising inventory manager..."); | 70 | m_log.Info("Initialising inventory manager..."); |
@@ -94,7 +75,7 @@ namespace OpenSim.Grid.InventoryServer | |||
94 | m_inventoryService.AddPlugin(m_config.DatabaseProvider, m_config.DatabaseConnect); | 75 | m_inventoryService.AddPlugin(m_config.DatabaseProvider, m_config.DatabaseConnect); |
95 | 76 | ||
96 | m_log.Info("[" + LogName + "]: Starting HTTP server ..."); | 77 | m_log.Info("[" + LogName + "]: Starting HTTP server ..."); |
97 | 78 | ||
98 | m_httpServer = new BaseHttpServer(m_config.HttpPort); | 79 | m_httpServer = new BaseHttpServer(m_config.HttpPort); |
99 | AddHttpHandlers(); | 80 | AddHttpHandlers(); |
100 | m_httpServer.Start(); | 81 | m_httpServer.Start(); |
@@ -107,11 +88,11 @@ namespace OpenSim.Grid.InventoryServer | |||
107 | m_httpServer.AddStreamHandler( | 88 | m_httpServer.AddStreamHandler( |
108 | new RestDeserialisehandler<Guid, InventoryCollection>( | 89 | new RestDeserialisehandler<Guid, InventoryCollection>( |
109 | "POST", "/GetInventory/", m_inventoryService.GetUserInventory)); | 90 | "POST", "/GetInventory/", m_inventoryService.GetUserInventory)); |
110 | 91 | ||
111 | m_httpServer.AddStreamHandler( | 92 | m_httpServer.AddStreamHandler( |
112 | new RestDeserialisehandler<Guid, bool>( | 93 | new RestDeserialisehandler<Guid, bool>( |
113 | "POST", "/CreateInventory/", m_inventoryService.CreateUsersInventory)); | 94 | "POST", "/CreateInventory/", m_inventoryService.CreateUsersInventory)); |
114 | 95 | ||
115 | m_httpServer.AddStreamHandler( | 96 | m_httpServer.AddStreamHandler( |
116 | new RestDeserialisehandler<InventoryFolderBase, bool>( | 97 | new RestDeserialisehandler<InventoryFolderBase, bool>( |
117 | "POST", "/NewFolder/", m_inventoryService.AddInventoryFolder)); | 98 | "POST", "/NewFolder/", m_inventoryService.AddInventoryFolder)); |
@@ -119,15 +100,15 @@ namespace OpenSim.Grid.InventoryServer | |||
119 | m_httpServer.AddStreamHandler( | 100 | m_httpServer.AddStreamHandler( |
120 | new RestDeserialisehandler<InventoryFolderBase, bool>( | 101 | new RestDeserialisehandler<InventoryFolderBase, bool>( |
121 | "POST", "/MoveFolder/", m_inventoryService.MoveInventoryFolder)); | 102 | "POST", "/MoveFolder/", m_inventoryService.MoveInventoryFolder)); |
122 | 103 | ||
123 | m_httpServer.AddStreamHandler( | 104 | m_httpServer.AddStreamHandler( |
124 | new RestDeserialisehandler<InventoryFolderBase, bool>( | 105 | new RestDeserialisehandler<InventoryFolderBase, bool>( |
125 | "POST", "/PurgeFolder/", m_inventoryService.PurgeInventoryFolder)); | 106 | "POST", "/PurgeFolder/", m_inventoryService.PurgeInventoryFolder)); |
126 | 107 | ||
127 | m_httpServer.AddStreamHandler( | 108 | m_httpServer.AddStreamHandler( |
128 | new RestDeserialisehandler<InventoryItemBase, bool>( | 109 | new RestDeserialisehandler<InventoryItemBase, bool>( |
129 | "POST", "/NewItem/", m_inventoryService.AddInventoryItem)); | 110 | "POST", "/NewItem/", m_inventoryService.AddInventoryItem)); |
130 | 111 | ||
131 | m_httpServer.AddStreamHandler( | 112 | m_httpServer.AddStreamHandler( |
132 | new RestDeserialisehandler<InventoryItemBase, bool>( | 113 | new RestDeserialisehandler<InventoryItemBase, bool>( |
133 | "POST", "/DeleteItem/", m_inventoryService.DeleteInvItem)); | 114 | "POST", "/DeleteItem/", m_inventoryService.DeleteInvItem)); |
@@ -153,5 +134,21 @@ namespace OpenSim.Grid.InventoryServer | |||
153 | m_console.Prompt(); | 134 | m_console.Prompt(); |
154 | } | 135 | } |
155 | } | 136 | } |
137 | |||
138 | public override void RunCmd(string cmd, string[] cmdparams) | ||
139 | { | ||
140 | base.RunCmd(cmd, cmdparams); | ||
141 | |||
142 | switch (cmd) | ||
143 | { | ||
144 | case "add-user": | ||
145 | m_inventoryService.CreateUsersInventory(LLUUID.Random().UUID); | ||
146 | break; | ||
147 | case "shutdown": | ||
148 | m_console.Close(); | ||
149 | Environment.Exit(0); | ||
150 | break; | ||
151 | } | ||
152 | } | ||
156 | } | 153 | } |
157 | } \ No newline at end of file | 154 | } |
diff --git a/OpenSim/Grid/MessagingServer/Main.cs b/OpenSim/Grid/MessagingServer/Main.cs index e6e18d4..bf793bf 100644 --- a/OpenSim/Grid/MessagingServer/Main.cs +++ b/OpenSim/Grid/MessagingServer/Main.cs | |||
@@ -44,42 +44,9 @@ namespace OpenSim.Grid.MessagingServer | |||
44 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 44 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
45 | 45 | ||
46 | private MessageServerConfig Cfg; | 46 | private MessageServerConfig Cfg; |
47 | |||
48 | private LLUUID m_lastCreatedUser = LLUUID.Random(); | ||
49 | private MessageService msgsvc; | 47 | private MessageService msgsvc; |
50 | 48 | ||
51 | private OpenMessage_Main() | 49 | private LLUUID m_lastCreatedUser = LLUUID.Random(); |
52 | { | ||
53 | m_console = new ConsoleBase("OpenMessage", this); | ||
54 | MainConsole.Instance = m_console; | ||
55 | } | ||
56 | |||
57 | #region conscmd_callback Members | ||
58 | |||
59 | public override void RunCmd(string cmd, string[] cmdparams) | ||
60 | { | ||
61 | base.RunCmd(cmd, cmdparams); | ||
62 | |||
63 | switch (cmd) | ||
64 | { | ||
65 | case "help": | ||
66 | m_console.Notice("shutdown - shutdown the message server (USE CAUTION!)"); | ||
67 | break; | ||
68 | |||
69 | case "shutdown": | ||
70 | msgsvc.deregisterWithUserServer(); | ||
71 | m_console.Close(); | ||
72 | Environment.Exit(0); | ||
73 | break; | ||
74 | } | ||
75 | } | ||
76 | |||
77 | public override void Show(string ShowWhat) | ||
78 | { | ||
79 | base.Show(ShowWhat); | ||
80 | } | ||
81 | |||
82 | #endregion | ||
83 | 50 | ||
84 | [STAThread] | 51 | [STAThread] |
85 | public static void Main(string[] args) | 52 | public static void Main(string[] args) |
@@ -88,6 +55,7 @@ namespace OpenSim.Grid.MessagingServer | |||
88 | 55 | ||
89 | m_log.Info("Launching MessagingServer..."); | 56 | m_log.Info("Launching MessagingServer..."); |
90 | 57 | ||
58 | |||
91 | 59 | ||
92 | OpenMessage_Main messageserver = new OpenMessage_Main(); | 60 | OpenMessage_Main messageserver = new OpenMessage_Main(); |
93 | 61 | ||
@@ -95,6 +63,12 @@ namespace OpenSim.Grid.MessagingServer | |||
95 | messageserver.Work(); | 63 | messageserver.Work(); |
96 | } | 64 | } |
97 | 65 | ||
66 | private OpenMessage_Main() | ||
67 | { | ||
68 | m_console = new ConsoleBase("OpenMessage", this); | ||
69 | MainConsole.Instance = m_console; | ||
70 | } | ||
71 | |||
98 | private void Work() | 72 | private void Work() |
99 | { | 73 | { |
100 | m_console.Notice("Enter help for a list of commands\n"); | 74 | m_console.Notice("Enter help for a list of commands\n"); |
@@ -144,13 +118,12 @@ namespace OpenSim.Grid.MessagingServer | |||
144 | switch (what) | 118 | switch (what) |
145 | { | 119 | { |
146 | case "user": | 120 | case "user": |
147 | 121 | ||
148 | try | 122 | try |
149 | { | 123 | { |
150 | //userID = | 124 | //userID = |
151 | //m_userManager.AddUserProfile(tempfirstname, templastname, tempMD5Passwd, regX, regY); | 125 | //m_userManager.AddUserProfile(tempfirstname, templastname, tempMD5Passwd, regX, regY); |
152 | } | 126 | } catch (Exception ex) |
153 | catch (Exception ex) | ||
154 | { | 127 | { |
155 | m_console.Error("[SERVER]: Error creating user: {0}", ex.ToString()); | 128 | m_console.Error("[SERVER]: Error creating user: {0}", ex.ToString()); |
156 | } | 129 | } |
@@ -158,7 +131,7 @@ namespace OpenSim.Grid.MessagingServer | |||
158 | try | 131 | try |
159 | { | 132 | { |
160 | //RestObjectPoster.BeginPostObject<Guid>(m_userManager._config.InventoryUrl + "CreateInventory/", | 133 | //RestObjectPoster.BeginPostObject<Guid>(m_userManager._config.InventoryUrl + "CreateInventory/", |
161 | //userID.UUID); | 134 | //userID.UUID); |
162 | } | 135 | } |
163 | catch (Exception ex) | 136 | catch (Exception ex) |
164 | { | 137 | { |
@@ -168,5 +141,28 @@ namespace OpenSim.Grid.MessagingServer | |||
168 | break; | 141 | break; |
169 | } | 142 | } |
170 | } | 143 | } |
144 | |||
145 | public override void RunCmd(string cmd, string[] cmdparams) | ||
146 | { | ||
147 | base.RunCmd(cmd, cmdparams); | ||
148 | |||
149 | switch (cmd) | ||
150 | { | ||
151 | case "help": | ||
152 | m_console.Notice("shutdown - shutdown the message server (USE CAUTION!)"); | ||
153 | break; | ||
154 | |||
155 | case "shutdown": | ||
156 | msgsvc.deregisterWithUserServer(); | ||
157 | m_console.Close(); | ||
158 | Environment.Exit(0); | ||
159 | break; | ||
160 | } | ||
161 | } | ||
162 | |||
163 | public override void Show(string ShowWhat) | ||
164 | { | ||
165 | base.Show(ShowWhat); | ||
166 | } | ||
171 | } | 167 | } |
172 | } \ No newline at end of file | 168 | } |
diff --git a/OpenSim/Grid/MessagingServer/MessageService.cs b/OpenSim/Grid/MessagingServer/MessageService.cs index 33c133d..50e06af 100644 --- a/OpenSim/Grid/MessagingServer/MessageService.cs +++ b/OpenSim/Grid/MessagingServer/MessageService.cs | |||
@@ -45,16 +45,16 @@ namespace OpenSim.Grid.MessagingServer | |||
45 | { | 45 | { |
46 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 46 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
47 | 47 | ||
48 | private readonly MessageServerConfig m_cfg; | 48 | private MessageServerConfig m_cfg; |
49 | private readonly Hashtable m_presence_BackReferences = new Hashtable(); | ||
50 | 49 | ||
51 | //A hashtable of all current presences this server knows about | 50 | //A hashtable of all current presences this server knows about |
52 | private readonly Hashtable m_presences = new Hashtable(); | 51 | private Hashtable m_presences = new Hashtable(); |
53 | 52 | ||
54 | //a hashtable of all current regions this server knows about | 53 | //a hashtable of all current regions this server knows about |
55 | private readonly Hashtable m_regionInfoCache = new Hashtable(); | 54 | private Hashtable m_regionInfoCache = new Hashtable(); |
56 | 55 | ||
57 | //A hashtable containing lists of UUIDs keyed by UUID for fast backreferencing | 56 | //A hashtable containing lists of UUIDs keyed by UUID for fast backreferencing |
57 | private Hashtable m_presence_BackReferences = new Hashtable(); | ||
58 | 58 | ||
59 | // Hashtable containing work units that need to be processed | 59 | // Hashtable containing work units that need to be processed |
60 | private Hashtable m_unProcessedWorkUnits = new Hashtable(); | 60 | private Hashtable m_unProcessedWorkUnits = new Hashtable(); |
@@ -63,13 +63,13 @@ namespace OpenSim.Grid.MessagingServer | |||
63 | { | 63 | { |
64 | m_cfg = cfg; | 64 | m_cfg = cfg; |
65 | } | 65 | } |
66 | 66 | ||
67 | #region RegionComms Methods | 67 | #region RegionComms Methods |
68 | 68 | ||
69 | #endregion | 69 | #endregion |
70 | 70 | ||
71 | #region FriendList Methods | 71 | #region FriendList Methods |
72 | 72 | ||
73 | /// <summary> | 73 | /// <summary> |
74 | /// Process Friendlist subscriptions for a user | 74 | /// Process Friendlist subscriptions for a user |
75 | /// The login method calls this for a User | 75 | /// The login method calls this for a User |
@@ -87,14 +87,14 @@ namespace OpenSim.Grid.MessagingServer | |||
87 | for (int i = 0; i < uFriendList.Count; i++) | 87 | for (int i = 0; i < uFriendList.Count; i++) |
88 | { | 88 | { |
89 | //m_presence_BackReferences.Add(userpresence.agentData.AgentID, uFriendList[i].Friend); | 89 | //m_presence_BackReferences.Add(userpresence.agentData.AgentID, uFriendList[i].Friend); |
90 | // m_presence_BackReferences.Add(uFriendList[i].Friend, userpresence.agentData.AgentID); | 90 | // m_presence_BackReferences.Add(uFriendList[i].Friend, userpresence.agentData.AgentID); |
91 | 91 | ||
92 | if (m_presences.Contains(uFriendList[i].Friend)) | 92 | if (m_presences.Contains(uFriendList[i].Friend)) |
93 | { | 93 | { |
94 | UserPresenceData friendup = (UserPresenceData) m_presences[uFriendList[i].Friend]; | 94 | UserPresenceData friendup = (UserPresenceData)m_presences[uFriendList[i].Friend]; |
95 | // Add backreference | 95 | // Add backreference |
96 | 96 | ||
97 | SubscribeToPresenceUpdates(userpresence, friendup, uFriendList[i], i); | 97 | SubscribeToPresenceUpdates(userpresence, friendup, uFriendList[i],i); |
98 | } | 98 | } |
99 | } | 99 | } |
100 | } | 100 | } |
@@ -108,10 +108,10 @@ namespace OpenSim.Grid.MessagingServer | |||
108 | /// <param name="friendpresence">P2</param> | 108 | /// <param name="friendpresence">P2</param> |
109 | /// <param name="uFriendListItem"></param> | 109 | /// <param name="uFriendListItem"></param> |
110 | /// <param name="uFriendListIndex"></param> | 110 | /// <param name="uFriendListIndex"></param> |
111 | public void SubscribeToPresenceUpdates(UserPresenceData userpresence, UserPresenceData friendpresence, | 111 | public void SubscribeToPresenceUpdates(UserPresenceData userpresence, UserPresenceData friendpresence, |
112 | FriendListItem uFriendListItem, int uFriendListIndex) | 112 | FriendListItem uFriendListItem, int uFriendListIndex) |
113 | { | 113 | { |
114 | if ((uFriendListItem.FriendListOwnerPerms & (uint) FriendRights.CanSeeOnline) != 0) | 114 | if ((uFriendListItem.FriendListOwnerPerms & (uint)FriendRights.CanSeeOnline) != 0) |
115 | { | 115 | { |
116 | // Subscribe and Send Out updates | 116 | // Subscribe and Send Out updates |
117 | if (!friendpresence.subscriptionData.Contains(friendpresence.agentData.AgentID)) | 117 | if (!friendpresence.subscriptionData.Contains(friendpresence.agentData.AgentID)) |
@@ -126,13 +126,13 @@ namespace OpenSim.Grid.MessagingServer | |||
126 | PresenceInformer friendlistupdater = new PresenceInformer(); | 126 | PresenceInformer friendlistupdater = new PresenceInformer(); |
127 | friendlistupdater.presence1 = friendpresence; | 127 | friendlistupdater.presence1 = friendpresence; |
128 | friendlistupdater.presence2 = userpresence; | 128 | friendlistupdater.presence2 = userpresence; |
129 | WaitCallback cb = friendlistupdater.go; | 129 | WaitCallback cb = new WaitCallback(friendlistupdater.go); |
130 | ThreadPool.QueueUserWorkItem(cb); | 130 | ThreadPool.QueueUserWorkItem(cb); |
131 | 131 | ||
132 | //SendRegionPresenceUpdate(friendpresence, userpresence); | 132 | //SendRegionPresenceUpdate(friendpresence, userpresence); |
133 | } | 133 | } |
134 | 134 | ||
135 | if ((uFriendListItem.FriendPerms & (uint) FriendRights.CanSeeOnline) != 0) | 135 | if ((uFriendListItem.FriendPerms & (uint)FriendRights.CanSeeOnline) != 0) |
136 | { | 136 | { |
137 | if (!friendpresence.subscriptionData.Contains(userpresence.agentData.AgentID)) | 137 | if (!friendpresence.subscriptionData.Contains(userpresence.agentData.AgentID)) |
138 | { | 138 | { |
@@ -147,9 +147,9 @@ namespace OpenSim.Grid.MessagingServer | |||
147 | friendlistupdater.presence1 = userpresence; | 147 | friendlistupdater.presence1 = userpresence; |
148 | friendlistupdater.presence2 = friendpresence; | 148 | friendlistupdater.presence2 = friendpresence; |
149 | 149 | ||
150 | WaitCallback cb2 = friendlistupdater.go; | 150 | WaitCallback cb2 = new WaitCallback(friendlistupdater.go); |
151 | ThreadPool.QueueUserWorkItem(cb2); | 151 | ThreadPool.QueueUserWorkItem(cb2); |
152 | 152 | ||
153 | //SendRegionPresenceUpdate(userpresence, friendpresence); | 153 | //SendRegionPresenceUpdate(userpresence, friendpresence); |
154 | } | 154 | } |
155 | } | 155 | } |
@@ -164,7 +164,7 @@ namespace OpenSim.Grid.MessagingServer | |||
164 | { | 164 | { |
165 | if (m_presence_BackReferences.Contains(friendID)) | 165 | if (m_presence_BackReferences.Contains(friendID)) |
166 | { | 166 | { |
167 | List<LLUUID> presenseBackReferences = (List<LLUUID>) m_presence_BackReferences[friendID]; | 167 | List<LLUUID> presenseBackReferences = (List<LLUUID>)m_presence_BackReferences[friendID]; |
168 | if (!presenseBackReferences.Contains(agentID)) | 168 | if (!presenseBackReferences.Contains(agentID)) |
169 | { | 169 | { |
170 | presenseBackReferences.Add(agentID); | 170 | presenseBackReferences.Add(agentID); |
@@ -188,7 +188,7 @@ namespace OpenSim.Grid.MessagingServer | |||
188 | { | 188 | { |
189 | if (m_presence_BackReferences.Contains(friendID)) | 189 | if (m_presence_BackReferences.Contains(friendID)) |
190 | { | 190 | { |
191 | List<LLUUID> presenseBackReferences = (List<LLUUID>) m_presence_BackReferences[friendID]; | 191 | List<LLUUID> presenseBackReferences = (List<LLUUID>)m_presence_BackReferences[friendID]; |
192 | if (presenseBackReferences.Contains(agentID)) | 192 | if (presenseBackReferences.Contains(agentID)) |
193 | { | 193 | { |
194 | presenseBackReferences.Remove(agentID); | 194 | presenseBackReferences.Remove(agentID); |
@@ -216,29 +216,29 @@ namespace OpenSim.Grid.MessagingServer | |||
216 | { | 216 | { |
217 | if (m_presences.Contains(AgentID)) | 217 | if (m_presences.Contains(AgentID)) |
218 | { | 218 | { |
219 | AgentData = (UserPresenceData) m_presences[AgentID]; | 219 | AgentData = (UserPresenceData)m_presences[AgentID]; |
220 | } | 220 | } |
221 | } | 221 | } |
222 | 222 | ||
223 | if (AgentData != null) | 223 | if (AgentData != null) |
224 | { | 224 | { |
225 | AgentsNeedingNotification = AgentData.subscriptionData; | 225 | AgentsNeedingNotification = AgentData.subscriptionData; |
226 | //lock (m_presence_BackReferences) | 226 | //lock (m_presence_BackReferences) |
227 | //{ | 227 | //{ |
228 | //if (m_presence_BackReferences.Contains(AgentID)) | 228 | //if (m_presence_BackReferences.Contains(AgentID)) |
229 | //{ | 229 | //{ |
230 | //AgentsNeedingNotification = (List<LLUUID>)m_presence_BackReferences[AgentID]; | 230 | //AgentsNeedingNotification = (List<LLUUID>)m_presence_BackReferences[AgentID]; |
231 | //} | 231 | //} |
232 | //} | 232 | //} |
233 | 233 | ||
234 | for (int i = 0; i < AgentsNeedingNotification.Count; i++) | 234 | for (int i = 0; i < AgentsNeedingNotification.Count; i++) |
235 | { | 235 | { |
236 | // TODO: Do Region Notifications | 236 | // TODO: Do Region Notifications |
237 | lock (m_presences) | 237 | lock(m_presences) |
238 | { | 238 | { |
239 | if (m_presences.Contains(AgentsNeedingNotification[i])) | 239 | if (m_presences.Contains(AgentsNeedingNotification[i])) |
240 | { | 240 | { |
241 | friendd = (UserPresenceData) m_presences[AgentsNeedingNotification[i]]; | 241 | friendd = (UserPresenceData)m_presences[AgentsNeedingNotification[i]]; |
242 | } | 242 | } |
243 | } | 243 | } |
244 | 244 | ||
@@ -266,7 +266,7 @@ namespace OpenSim.Grid.MessagingServer | |||
266 | friendlistupdater.presence1 = AgentData; | 266 | friendlistupdater.presence1 = AgentData; |
267 | friendlistupdater.presence2 = friendd; | 267 | friendlistupdater.presence2 = friendd; |
268 | 268 | ||
269 | WaitCallback cb3 = friendlistupdater.go; | 269 | WaitCallback cb3 = new WaitCallback(friendlistupdater.go); |
270 | ThreadPool.QueueUserWorkItem(cb3); | 270 | ThreadPool.QueueUserWorkItem(cb3); |
271 | 271 | ||
272 | //SendRegionPresenceUpdate(AgentData, friendd); | 272 | //SendRegionPresenceUpdate(AgentData, friendd); |
@@ -276,7 +276,7 @@ namespace OpenSim.Grid.MessagingServer | |||
276 | } | 276 | } |
277 | } | 277 | } |
278 | } | 278 | } |
279 | 279 | ||
280 | #endregion | 280 | #endregion |
281 | 281 | ||
282 | #region UserServer Comms | 282 | #region UserServer Comms |
@@ -298,17 +298,18 @@ namespace OpenSim.Grid.MessagingServer | |||
298 | parameters.Add(param); | 298 | parameters.Add(param); |
299 | XmlRpcRequest req = new XmlRpcRequest("get_user_friend_list", parameters); | 299 | XmlRpcRequest req = new XmlRpcRequest("get_user_friend_list", parameters); |
300 | XmlRpcResponse resp = req.Send(m_cfg.UserServerURL, 3000); | 300 | XmlRpcResponse resp = req.Send(m_cfg.UserServerURL, 3000); |
301 | Hashtable respData = (Hashtable) resp.Value; | 301 | Hashtable respData = (Hashtable)resp.Value; |
302 | 302 | ||
303 | if (respData.Contains("avcount")) | 303 | if (respData.Contains("avcount")) |
304 | { | 304 | { |
305 | buddylist = ConvertXMLRPCDataToFriendListItemList(respData); | 305 | buddylist = ConvertXMLRPCDataToFriendListItemList(respData); |
306 | } | 306 | } |
307 | |||
307 | } | 308 | } |
308 | catch (WebException e) | 309 | catch (WebException e) |
309 | { | 310 | { |
310 | m_log.Warn("Error when trying to fetch Avatar's friends list: " + | 311 | m_log.Warn("Error when trying to fetch Avatar's friends list: " + |
311 | e.Message); | 312 | e.Message); |
312 | // Return Empty list (no friends) | 313 | // Return Empty list (no friends) |
313 | } | 314 | } |
314 | return buddylist; | 315 | return buddylist; |
@@ -322,16 +323,16 @@ namespace OpenSim.Grid.MessagingServer | |||
322 | public List<FriendListItem> ConvertXMLRPCDataToFriendListItemList(Hashtable data) | 323 | public List<FriendListItem> ConvertXMLRPCDataToFriendListItemList(Hashtable data) |
323 | { | 324 | { |
324 | List<FriendListItem> buddylist = new List<FriendListItem>(); | 325 | List<FriendListItem> buddylist = new List<FriendListItem>(); |
325 | int buddycount = Convert.ToInt32((string) data["avcount"]); | 326 | int buddycount = Convert.ToInt32((string)data["avcount"]); |
326 | 327 | ||
327 | for (int i = 0; i < buddycount; i++) | 328 | for (int i = 0; i < buddycount; i++) |
328 | { | 329 | { |
329 | FriendListItem buddylistitem = new FriendListItem(); | 330 | FriendListItem buddylistitem = new FriendListItem(); |
330 | 331 | ||
331 | buddylistitem.FriendListOwner = new LLUUID((string) data["ownerID" + i]); | 332 | buddylistitem.FriendListOwner = new LLUUID((string)data["ownerID" + i.ToString()]); |
332 | buddylistitem.Friend = new LLUUID((string) data["friendID" + i]); | 333 | buddylistitem.Friend = new LLUUID((string)data["friendID" + i.ToString()]); |
333 | buddylistitem.FriendListOwnerPerms = (uint) Convert.ToInt32((string) data["ownerPerms" + i]); | 334 | buddylistitem.FriendListOwnerPerms = (uint)Convert.ToInt32((string)data["ownerPerms" + i.ToString()]); |
334 | buddylistitem.FriendPerms = (uint) Convert.ToInt32((string) data["friendPerms" + i]); | 335 | buddylistitem.FriendPerms = (uint)Convert.ToInt32((string)data["friendPerms" + i.ToString()]); |
335 | 336 | ||
336 | buddylist.Add(buddylistitem); | 337 | buddylist.Add(buddylistitem); |
337 | } | 338 | } |
@@ -349,7 +350,7 @@ namespace OpenSim.Grid.MessagingServer | |||
349 | public XmlRpcResponse UserLoggedOn(XmlRpcRequest request) | 350 | public XmlRpcResponse UserLoggedOn(XmlRpcRequest request) |
350 | { | 351 | { |
351 | m_log.Info("[LOGON]: User logged on, building indexes for user"); | 352 | m_log.Info("[LOGON]: User logged on, building indexes for user"); |
352 | Hashtable requestData = (Hashtable) request.Params[0]; | 353 | Hashtable requestData = (Hashtable)request.Params[0]; |
353 | 354 | ||
354 | //requestData["sendkey"] = serv.sendkey; | 355 | //requestData["sendkey"] = serv.sendkey; |
355 | //requestData["agentid"] = agentID.ToString(); | 356 | //requestData["agentid"] = agentID.ToString(); |
@@ -363,13 +364,13 @@ namespace OpenSim.Grid.MessagingServer | |||
363 | //requestData["lastname"] = lastname; | 364 | //requestData["lastname"] = lastname; |
364 | 365 | ||
365 | AgentCircuitData agentData = new AgentCircuitData(); | 366 | AgentCircuitData agentData = new AgentCircuitData(); |
366 | agentData.SessionID = new LLUUID((string) requestData["sessionid"]); | 367 | agentData.SessionID = new LLUUID((string)requestData["sessionid"]); |
367 | agentData.SecureSessionID = new LLUUID((string) requestData["secure_session_id"]); | 368 | agentData.SecureSessionID = new LLUUID((string)requestData["secure_session_id"]); |
368 | agentData.firstname = (string) requestData["firstname"]; | 369 | agentData.firstname = (string)requestData["firstname"]; |
369 | agentData.lastname = (string) requestData["lastname"]; | 370 | agentData.lastname = (string)requestData["lastname"]; |
370 | agentData.AgentID = new LLUUID((string) requestData["agentid"]); | 371 | agentData.AgentID = new LLUUID((string)requestData["agentid"]); |
371 | agentData.circuitcode = Convert.ToUInt32(requestData["circuit_code"]); | 372 | agentData.circuitcode = Convert.ToUInt32(requestData["circuit_code"]); |
372 | agentData.CapsPath = (string) requestData["caps_path"]; | 373 | agentData.CapsPath = (string)requestData["caps_path"]; |
373 | 374 | ||
374 | if (requestData.ContainsKey("child_agent") && requestData["child_agent"].Equals("1")) | 375 | if (requestData.ContainsKey("child_agent") && requestData["child_agent"].Equals("1")) |
375 | { | 376 | { |
@@ -378,13 +379,13 @@ namespace OpenSim.Grid.MessagingServer | |||
378 | else | 379 | else |
379 | { | 380 | { |
380 | agentData.startpos = | 381 | agentData.startpos = |
381 | new LLVector3(Convert.ToUInt32(requestData["positionx"]), | 382 | new LLVector3(Convert.ToUInt32(requestData["positionx"]), |
382 | Convert.ToUInt32(requestData["positiony"]), | 383 | Convert.ToUInt32(requestData["positiony"]), |
383 | Convert.ToUInt32(requestData["positionz"])); | 384 | Convert.ToUInt32(requestData["positionz"])); |
384 | agentData.child = false; | 385 | agentData.child = false; |
385 | } | 386 | } |
386 | 387 | ||
387 | ulong regionHandle = Convert.ToUInt64((string) requestData["regionhandle"]); | 388 | ulong regionHandle = Convert.ToUInt64((string)requestData["regionhandle"]); |
388 | 389 | ||
389 | UserPresenceData up = new UserPresenceData(); | 390 | UserPresenceData up = new UserPresenceData(); |
390 | up.agentData = agentData; | 391 | up.agentData = agentData; |
@@ -397,7 +398,7 @@ namespace OpenSim.Grid.MessagingServer | |||
397 | 398 | ||
398 | return new XmlRpcResponse(); | 399 | return new XmlRpcResponse(); |
399 | } | 400 | } |
400 | 401 | ||
401 | /// <summary> | 402 | /// <summary> |
402 | /// The UserServer got a Logoff message | 403 | /// The UserServer got a Logoff message |
403 | /// Cleanup time for that user. Send out presence notifications | 404 | /// Cleanup time for that user. Send out presence notifications |
@@ -406,9 +407,9 @@ namespace OpenSim.Grid.MessagingServer | |||
406 | /// <returns></returns> | 407 | /// <returns></returns> |
407 | public XmlRpcResponse UserLoggedOff(XmlRpcRequest request) | 408 | public XmlRpcResponse UserLoggedOff(XmlRpcRequest request) |
408 | { | 409 | { |
409 | Hashtable requestData = (Hashtable) request.Params[0]; | 410 | Hashtable requestData = (Hashtable)request.Params[0]; |
410 | 411 | ||
411 | LLUUID AgentID = new LLUUID((string) requestData["agentid"]); | 412 | LLUUID AgentID = new LLUUID((string)requestData["agentid"]); |
412 | 413 | ||
413 | ProcessLogOff(AgentID); | 414 | ProcessLogOff(AgentID); |
414 | 415 | ||
@@ -430,9 +431,9 @@ namespace OpenSim.Grid.MessagingServer | |||
430 | RegionProfileData regionInfo = null; | 431 | RegionProfileData regionInfo = null; |
431 | if (m_regionInfoCache.Contains(regionhandle)) | 432 | if (m_regionInfoCache.Contains(regionhandle)) |
432 | { | 433 | { |
433 | regionInfo = (RegionProfileData) m_regionInfoCache[regionhandle]; | 434 | regionInfo = (RegionProfileData)m_regionInfoCache[regionhandle]; |
434 | } | 435 | } |
435 | else | 436 | else |
436 | { | 437 | { |
437 | regionInfo = RequestRegionInfo(regionhandle); | 438 | regionInfo = RequestRegionInfo(regionhandle); |
438 | } | 439 | } |
@@ -446,8 +447,7 @@ namespace OpenSim.Grid.MessagingServer | |||
446 | /// <param name="regionHandle"></param> | 447 | /// <param name="regionHandle"></param> |
447 | /// <returns></returns> | 448 | /// <returns></returns> |
448 | public RegionProfileData RequestRegionInfo(ulong regionHandle) | 449 | public RegionProfileData RequestRegionInfo(ulong regionHandle) |
449 | { | 450 | { RegionProfileData regionProfile = null; |
450 | RegionProfileData regionProfile = null; | ||
451 | try | 451 | try |
452 | { | 452 | { |
453 | Hashtable requestData = new Hashtable(); | 453 | Hashtable requestData = new Hashtable(); |
@@ -457,8 +457,8 @@ namespace OpenSim.Grid.MessagingServer | |||
457 | SendParams.Add(requestData); | 457 | SendParams.Add(requestData); |
458 | XmlRpcRequest GridReq = new XmlRpcRequest("simulator_data_request", SendParams); | 458 | XmlRpcRequest GridReq = new XmlRpcRequest("simulator_data_request", SendParams); |
459 | XmlRpcResponse GridResp = GridReq.Send(m_cfg.GridServerURL, 3000); | 459 | XmlRpcResponse GridResp = GridReq.Send(m_cfg.GridServerURL, 3000); |
460 | 460 | ||
461 | Hashtable responseData = (Hashtable) GridResp.Value; | 461 | Hashtable responseData = (Hashtable)GridResp.Value; |
462 | 462 | ||
463 | if (responseData.ContainsKey("error")) | 463 | if (responseData.ContainsKey("error")) |
464 | { | 464 | { |
@@ -466,23 +466,23 @@ namespace OpenSim.Grid.MessagingServer | |||
466 | return null; | 466 | return null; |
467 | } | 467 | } |
468 | 468 | ||
469 | uint regX = Convert.ToUInt32((string) responseData["region_locx"]); | 469 | uint regX = Convert.ToUInt32((string)responseData["region_locx"]); |
470 | uint regY = Convert.ToUInt32((string) responseData["region_locy"]); | 470 | uint regY = Convert.ToUInt32((string)responseData["region_locy"]); |
471 | string internalIpStr = (string) responseData["sim_ip"]; | 471 | string internalIpStr = (string)responseData["sim_ip"]; |
472 | uint port = Convert.ToUInt32(responseData["sim_port"]); | 472 | uint port = Convert.ToUInt32(responseData["sim_port"]); |
473 | string externalUri = (string) responseData["sim_uri"]; | 473 | string externalUri = (string)responseData["sim_uri"]; |
474 | string neighbourExternalUri = externalUri; | 474 | string neighbourExternalUri = externalUri; |
475 | 475 | ||
476 | regionProfile = new RegionProfileData(); | 476 | regionProfile = new RegionProfileData(); |
477 | regionProfile.httpPort = (uint) Convert.ToInt32((string) responseData["http_port"]); | 477 | regionProfile.httpPort = (uint)Convert.ToInt32((string)responseData["http_port"]); |
478 | regionProfile.httpServerURI = "http://" + internalIpStr + ":" + regionProfile.httpPort + "/"; | 478 | regionProfile.httpServerURI = "http://" + internalIpStr + ":" + regionProfile.httpPort + "/"; |
479 | regionProfile.regionHandle = Helpers.UIntsToLong((regX * Constants.RegionSize), (regY * Constants.RegionSize)); | 479 | regionProfile.regionHandle = Helpers.UIntsToLong((regX * Constants.RegionSize), (regY * Constants.RegionSize)); |
480 | regionProfile.regionLocX = regX; | 480 | regionProfile.regionLocX = regX; |
481 | regionProfile.regionLocY = regY; | 481 | regionProfile.regionLocY = regY; |
482 | 482 | ||
483 | regionProfile.remotingPort = Convert.ToUInt32((string) responseData["remoting_port"]); | 483 | regionProfile.remotingPort = Convert.ToUInt32((string)responseData["remoting_port"]); |
484 | regionProfile.UUID = new LLUUID((string) responseData["region_UUID"]); | 484 | regionProfile.UUID = new LLUUID((string)responseData["region_UUID"]); |
485 | regionProfile.regionName = (string) responseData["region_name"]; | 485 | regionProfile.regionName = (string)responseData["region_name"]; |
486 | lock (m_regionInfoCache) | 486 | lock (m_regionInfoCache) |
487 | { | 487 | { |
488 | if (!m_regionInfoCache.Contains(regionHandle)) | 488 | if (!m_regionInfoCache.Contains(regionHandle)) |
@@ -494,31 +494,31 @@ namespace OpenSim.Grid.MessagingServer | |||
494 | catch (WebException) | 494 | catch (WebException) |
495 | { | 495 | { |
496 | m_log.Error("[GRID]: " + | 496 | m_log.Error("[GRID]: " + |
497 | "Region lookup failed for: " + regionHandle + | 497 | "Region lookup failed for: " + regionHandle.ToString() + |
498 | " - Is the GridServer down?"); | 498 | " - Is the GridServer down?"); |
499 | return null; | 499 | return null; |
500 | } | 500 | } |
501 | 501 | ||
502 | return regionProfile; | 502 | return regionProfile; |
503 | } | 503 | } |
504 | 504 | ||
505 | public bool registerWithUserServer() | 505 | public bool registerWithUserServer () |
506 | { | 506 | { |
507 | Hashtable UserParams = new Hashtable(); | 507 | Hashtable UserParams = new Hashtable(); |
508 | // Login / Authentication | 508 | // Login / Authentication |
509 | 509 | ||
510 | if (m_cfg.HttpSSL) | 510 | if (m_cfg.HttpSSL) |
511 | { | 511 | { |
512 | UserParams["uri"] = "https://" + m_cfg.MessageServerIP + ":" + m_cfg.HttpPort; | 512 | UserParams["uri"] = "https://" + m_cfg.MessageServerIP + ":" + m_cfg.HttpPort; |
513 | } | 513 | } |
514 | else | 514 | else |
515 | { | 515 | { |
516 | UserParams["uri"] = "http://" + m_cfg.MessageServerIP + ":" + m_cfg.HttpPort; | 516 | UserParams["uri"] = "http://" + m_cfg.MessageServerIP + ":" + m_cfg.HttpPort; |
517 | } | 517 | } |
518 | 518 | ||
519 | UserParams["recvkey"] = m_cfg.UserRecvKey; | 519 | UserParams["recvkey"] = m_cfg.UserRecvKey; |
520 | UserParams["sendkey"] = m_cfg.UserRecvKey; | 520 | UserParams["sendkey"] = m_cfg.UserRecvKey; |
521 | 521 | ||
522 | // Package into an XMLRPC Request | 522 | // Package into an XMLRPC Request |
523 | ArrayList SendParams = new ArrayList(); | 523 | ArrayList SendParams = new ArrayList(); |
524 | SendParams.Add(UserParams); | 524 | SendParams.Add(UserParams); |
@@ -530,13 +530,12 @@ namespace OpenSim.Grid.MessagingServer | |||
530 | { | 530 | { |
531 | UserReq = new XmlRpcRequest("register_messageserver", SendParams); | 531 | UserReq = new XmlRpcRequest("register_messageserver", SendParams); |
532 | UserResp = UserReq.Send(m_cfg.UserServerURL, 16000); | 532 | UserResp = UserReq.Send(m_cfg.UserServerURL, 16000); |
533 | } | 533 | } catch (Exception ex) |
534 | catch (Exception ex) | ||
535 | { | 534 | { |
536 | m_log.Error("Unable to connect to grid. Grid server not running?"); | 535 | m_log.Error("Unable to connect to grid. Grid server not running?"); |
537 | throw (ex); | 536 | throw(ex); |
538 | } | 537 | } |
539 | Hashtable GridRespData = (Hashtable) UserResp.Value; | 538 | Hashtable GridRespData = (Hashtable)UserResp.Value; |
540 | Hashtable griddatahash = GridRespData; | 539 | Hashtable griddatahash = GridRespData; |
541 | 540 | ||
542 | // Process Response | 541 | // Process Response |
@@ -584,7 +583,7 @@ namespace OpenSim.Grid.MessagingServer | |||
584 | m_log.Error("Unable to connect to grid. Grid server not running?"); | 583 | m_log.Error("Unable to connect to grid. Grid server not running?"); |
585 | throw (ex); | 584 | throw (ex); |
586 | } | 585 | } |
587 | Hashtable UserRespData = (Hashtable) UserResp.Value; | 586 | Hashtable UserRespData = (Hashtable)UserResp.Value; |
588 | Hashtable userdatahash = UserRespData; | 587 | Hashtable userdatahash = UserRespData; |
589 | 588 | ||
590 | // Process Response | 589 | // Process Response |
@@ -600,4 +599,4 @@ namespace OpenSim.Grid.MessagingServer | |||
600 | 599 | ||
601 | #endregion | 600 | #endregion |
602 | } | 601 | } |
603 | } \ No newline at end of file | 602 | } |
diff --git a/OpenSim/Grid/MessagingServer/PresenceInformer.cs b/OpenSim/Grid/MessagingServer/PresenceInformer.cs index dd2fa5b..59d0e13 100644 --- a/OpenSim/Grid/MessagingServer/PresenceInformer.cs +++ b/OpenSim/Grid/MessagingServer/PresenceInformer.cs | |||
@@ -35,16 +35,21 @@ namespace OpenSim.Grid.MessagingServer | |||
35 | { | 35 | { |
36 | public class PresenceInformer | 36 | public class PresenceInformer |
37 | { | 37 | { |
38 | public UserPresenceData presence1 = null; | ||
39 | public UserPresenceData presence2 = null; | ||
38 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 40 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
39 | public UserPresenceData presence1; | ||
40 | public UserPresenceData presence2; | ||
41 | 41 | ||
42 | public PresenceInformer() | ||
43 | { | ||
44 | |||
45 | } | ||
42 | public void go(object o) | 46 | public void go(object o) |
43 | { | 47 | { |
44 | if (presence1 != null && presence2 != null) | 48 | if (presence1 != null && presence2 != null) |
45 | { | 49 | { |
46 | SendRegionPresenceUpdate(presence1, presence2); | 50 | SendRegionPresenceUpdate(presence1, presence2); |
47 | } | 51 | } |
52 | |||
48 | } | 53 | } |
49 | 54 | ||
50 | /// <summary> | 55 | /// <summary> |
@@ -69,4 +74,4 @@ namespace OpenSim.Grid.MessagingServer | |||
69 | XmlRpcResponse RegionResp = RegionReq.Send(whichRegion.httpServerURI, 6000); | 74 | XmlRpcResponse RegionResp = RegionReq.Send(whichRegion.httpServerURI, 6000); |
70 | } | 75 | } |
71 | } | 76 | } |
72 | } \ No newline at end of file | 77 | } |
diff --git a/OpenSim/Grid/MessagingServer/UserPresenceData.cs b/OpenSim/Grid/MessagingServer/UserPresenceData.cs index 790e999..7188201 100644 --- a/OpenSim/Grid/MessagingServer/UserPresenceData.cs +++ b/OpenSim/Grid/MessagingServer/UserPresenceData.cs | |||
@@ -36,9 +36,13 @@ namespace OpenSim.Grid.MessagingServer | |||
36 | public class UserPresenceData | 36 | public class UserPresenceData |
37 | { | 37 | { |
38 | public AgentCircuitData agentData = new AgentCircuitData(); | 38 | public AgentCircuitData agentData = new AgentCircuitData(); |
39 | public List<FriendListItem> friendData = new List<FriendListItem>(); | ||
40 | public string httpURI = String.Empty; | ||
41 | public RegionProfileData regionData = new RegionProfileData(); | 39 | public RegionProfileData regionData = new RegionProfileData(); |
40 | public string httpURI = String.Empty; | ||
41 | public List<FriendListItem> friendData = new List<FriendListItem> (); | ||
42 | public List<LLUUID> subscriptionData = new List<LLUUID>(); | 42 | public List<LLUUID> subscriptionData = new List<LLUUID>(); |
43 | |||
44 | public UserPresenceData() | ||
45 | { | ||
46 | } | ||
43 | } | 47 | } |
44 | } \ No newline at end of file | 48 | } |
diff --git a/OpenSim/Grid/MessagingServer/WorkUnitBase.cs b/OpenSim/Grid/MessagingServer/WorkUnitBase.cs index 1c1503b..d25f044 100644 --- a/OpenSim/Grid/MessagingServer/WorkUnitBase.cs +++ b/OpenSim/Grid/MessagingServer/WorkUnitBase.cs | |||
@@ -30,4 +30,4 @@ namespace OpenSim.Grid.MessagingServer | |||
30 | public class WorkUnitBase | 30 | public class WorkUnitBase |
31 | { | 31 | { |
32 | } | 32 | } |
33 | } \ No newline at end of file | 33 | } |
diff --git a/OpenSim/Grid/MessagingServer/WorkUnitPresenceUpdate.cs b/OpenSim/Grid/MessagingServer/WorkUnitPresenceUpdate.cs index 625a9f6..c31f0c7 100644 --- a/OpenSim/Grid/MessagingServer/WorkUnitPresenceUpdate.cs +++ b/OpenSim/Grid/MessagingServer/WorkUnitPresenceUpdate.cs | |||
@@ -30,4 +30,4 @@ namespace OpenSim.Grid.MessagingServer | |||
30 | public class WorkUnitPresenceUpdate : WorkUnitBase | 30 | public class WorkUnitPresenceUpdate : WorkUnitBase |
31 | { | 31 | { |
32 | } | 32 | } |
33 | } \ No newline at end of file | 33 | } |
diff --git a/OpenSim/Grid/MessagingServer/XMPPHTTPService.cs b/OpenSim/Grid/MessagingServer/XMPPHTTPService.cs index 257e802..df3bc22 100644 --- a/OpenSim/Grid/MessagingServer/XMPPHTTPService.cs +++ b/OpenSim/Grid/MessagingServer/XMPPHTTPService.cs | |||
@@ -48,26 +48,28 @@ namespace OpenSim.Grid.MessagingServer | |||
48 | : base("GET", "/presence") | 48 | : base("GET", "/presence") |
49 | { | 49 | { |
50 | m_log.Info("[REST]: In Get Request"); | 50 | m_log.Info("[REST]: In Get Request"); |
51 | |||
51 | } | 52 | } |
52 | 53 | ||
53 | public override byte[] Handle(string path, Stream request) | 54 | public override byte[] Handle(string path, Stream request) |
54 | { | 55 | { |
55 | string param = GetParam(path); | 56 | string param = GetParam(path); |
56 | byte[] result = new byte[] {}; | 57 | byte[] result = new byte[] {}; |
57 | try | 58 | try |
58 | { | 59 | { |
59 | string[] p = param.Split(new[] {'/', '?', '&'}, StringSplitOptions.RemoveEmptyEntries); | 60 | string[] p = param.Split(new char[] {'/', '?', '&'}, StringSplitOptions.RemoveEmptyEntries); |
60 | 61 | ||
61 | if (p.Length > 0) | 62 | if (p.Length > 0) |
62 | { | 63 | { |
63 | LLUUID assetID = null; | 64 | LLUUID assetID = null; |
64 | 65 | ||
65 | if (!LLUUID.TryParse(p[0], out assetID)) | 66 | if (!LLUUID.TryParse(p[0], out assetID)) |
66 | { | 67 | { |
67 | m_log.InfoFormat( | 68 | m_log.InfoFormat( |
68 | "[REST]: GET:/presence ignoring request with malformed UUID {0}", p[0]); | 69 | "[REST]: GET:/presence ignoring request with malformed UUID {0}", p[0]); |
69 | return result; | 70 | return result; |
70 | } | 71 | } |
72 | |||
71 | } | 73 | } |
72 | } | 74 | } |
73 | catch (Exception e) | 75 | catch (Exception e) |
@@ -82,11 +84,6 @@ namespace OpenSim.Grid.MessagingServer | |||
82 | { | 84 | { |
83 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 85 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
84 | 86 | ||
85 | public PostXMPPStreamHandler() | ||
86 | : base("POST", "/presence") | ||
87 | { | ||
88 | } | ||
89 | |||
90 | public override byte[] Handle(string path, Stream request) | 87 | public override byte[] Handle(string path, Stream request) |
91 | { | 88 | { |
92 | string param = GetParam(path); | 89 | string param = GetParam(path); |
@@ -100,5 +97,12 @@ namespace OpenSim.Grid.MessagingServer | |||
100 | 97 | ||
101 | return new byte[] {}; | 98 | return new byte[] {}; |
102 | } | 99 | } |
100 | |||
101 | public PostXMPPStreamHandler() | ||
102 | : base("POST", "/presence") | ||
103 | { | ||
104 | |||
105 | } | ||
106 | |||
103 | } | 107 | } |
104 | } \ No newline at end of file | 108 | } |
diff --git a/OpenSim/Grid/ScriptServer/Application.cs b/OpenSim/Grid/ScriptServer/Application.cs index dc0bf62..ef93f65 100644 --- a/OpenSim/Grid/ScriptServer/Application.cs +++ b/OpenSim/Grid/ScriptServer/Application.cs | |||
@@ -39,7 +39,7 @@ namespace OpenSim.Grid.ScriptServer | |||
39 | XmlConfigurator.Configure(); | 39 | XmlConfigurator.Configure(); |
40 | 40 | ||
41 | AppDomain.CurrentDomain.UnhandledException += | 41 | AppDomain.CurrentDomain.UnhandledException += |
42 | CurrentDomain_UnhandledException; | 42 | new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); |
43 | 43 | ||
44 | // Application is starting | 44 | // Application is starting |
45 | SE = new ScriptServerMain(); | 45 | SE = new ScriptServerMain(); |
@@ -50,9 +50,9 @@ namespace OpenSim.Grid.ScriptServer | |||
50 | Console.WriteLine(String.Empty); | 50 | Console.WriteLine(String.Empty); |
51 | Console.WriteLine("APPLICATION EXCEPTION DETECTED"); | 51 | Console.WriteLine("APPLICATION EXCEPTION DETECTED"); |
52 | Console.WriteLine(String.Empty); | 52 | Console.WriteLine(String.Empty); |
53 | Console.WriteLine("Application is terminating: " + e.IsTerminating); | 53 | Console.WriteLine("Application is terminating: " + e.IsTerminating.ToString()); |
54 | //Console.WriteLine("Exception:"); | 54 | //Console.WriteLine("Exception:"); |
55 | //Console.WriteLine(e.ExceptionObject.ToString()); | 55 | //Console.WriteLine(e.ExceptionObject.ToString()); |
56 | } | 56 | } |
57 | } | 57 | } |
58 | } \ No newline at end of file | 58 | } |
diff --git a/OpenSim/Grid/ScriptServer/FakeScene.cs b/OpenSim/Grid/ScriptServer/FakeScene.cs index e037698..480050d 100644 --- a/OpenSim/Grid/ScriptServer/FakeScene.cs +++ b/OpenSim/Grid/ScriptServer/FakeScene.cs | |||
@@ -34,7 +34,7 @@ using OpenSim.Region.Environment.Scenes; | |||
34 | 34 | ||
35 | namespace OpenSim.Grid.ScriptServer | 35 | namespace OpenSim.Grid.ScriptServer |
36 | { | 36 | { |
37 | public class FakeScene : Scene | 37 | public class FakeScene: Scene |
38 | { | 38 | { |
39 | public FakeScene(RegionInfo regInfo, AgentCircuitManager authen, PermissionManager permissionManager, | 39 | public FakeScene(RegionInfo regInfo, AgentCircuitManager authen, PermissionManager permissionManager, |
40 | CommunicationsManager commsMan, SceneCommunicationService sceneGridService, | 40 | CommunicationsManager commsMan, SceneCommunicationService sceneGridService, |
@@ -48,4 +48,4 @@ namespace OpenSim.Grid.ScriptServer | |||
48 | 48 | ||
49 | // What does a scene have to do? :P | 49 | // What does a scene have to do? :P |
50 | } | 50 | } |
51 | } \ No newline at end of file | 51 | } |
diff --git a/OpenSim/Grid/ScriptServer/Properties/AssemblyInfo.cs b/OpenSim/Grid/ScriptServer/Properties/AssemblyInfo.cs index bb33e02..e4161d3 100644 --- a/OpenSim/Grid/ScriptServer/Properties/AssemblyInfo.cs +++ b/OpenSim/Grid/ScriptServer/Properties/AssemblyInfo.cs | |||
@@ -60,4 +60,4 @@ using System.Runtime.InteropServices; | |||
60 | // | 60 | // |
61 | 61 | ||
62 | [assembly : AssemblyVersion("1.0.0.0")] | 62 | [assembly : AssemblyVersion("1.0.0.0")] |
63 | [assembly : AssemblyFileVersion("1.0.0.0")] \ No newline at end of file | 63 | [assembly : AssemblyFileVersion("1.0.0.0")] |
diff --git a/OpenSim/Grid/ScriptServer/RemotingObject.cs b/OpenSim/Grid/ScriptServer/RemotingObject.cs index 6686b26..9d3065b 100644 --- a/OpenSim/Grid/ScriptServer/RemotingObject.cs +++ b/OpenSim/Grid/ScriptServer/RemotingObject.cs | |||
@@ -34,13 +34,9 @@ namespace OpenSim.Grid.ScriptServer | |||
34 | { | 34 | { |
35 | // This object will be exposed over remoting. It is a singleton, so it exists only in as one instance. | 35 | // This object will be exposed over remoting. It is a singleton, so it exists only in as one instance. |
36 | 36 | ||
37 | #region ServerRemotingObject Members | ||
38 | |||
39 | ScriptServerInterfaces.RemoteEvents ScriptServerInterfaces.ServerRemotingObject.Events() | 37 | ScriptServerInterfaces.RemoteEvents ScriptServerInterfaces.ServerRemotingObject.Events() |
40 | { | 38 | { |
41 | return ScriptServerMain.Engine.EventManager(); | 39 | return ScriptServerMain.Engine.EventManager(); |
42 | } | 40 | } |
43 | |||
44 | #endregion | ||
45 | } | 41 | } |
46 | } \ No newline at end of file | 42 | } |
diff --git a/OpenSim/Grid/ScriptServer/RemotingServer.cs b/OpenSim/Grid/ScriptServer/RemotingServer.cs index 9d75a83..7d0e334 100644 --- a/OpenSim/Grid/ScriptServer/RemotingServer.cs +++ b/OpenSim/Grid/ScriptServer/RemotingServer.cs | |||
@@ -31,10 +31,9 @@ using System.Runtime.Remoting.Channels.Tcp; | |||
31 | 31 | ||
32 | namespace OpenSim.Grid.ScriptServer | 32 | namespace OpenSim.Grid.ScriptServer |
33 | { | 33 | { |
34 | internal class RemotingServer | 34 | class RemotingServer |
35 | { | 35 | { |
36 | private readonly TcpChannel channel; | 36 | TcpChannel channel; |
37 | |||
38 | public RemotingServer(int port, string instanceName) | 37 | public RemotingServer(int port, string instanceName) |
39 | { | 38 | { |
40 | // Create an instance of a channel | 39 | // Create an instance of a channel |
@@ -43,9 +42,9 @@ namespace OpenSim.Grid.ScriptServer | |||
43 | 42 | ||
44 | // Register as an available service with the name HelloWorld | 43 | // Register as an available service with the name HelloWorld |
45 | RemotingConfiguration.RegisterWellKnownServiceType( | 44 | RemotingConfiguration.RegisterWellKnownServiceType( |
46 | typeof (RemotingObject), | 45 | typeof(RemotingObject), |
47 | instanceName, | 46 | instanceName, |
48 | WellKnownObjectMode.Singleton); | 47 | WellKnownObjectMode.Singleton); |
49 | } | 48 | } |
50 | } | 49 | } |
51 | } \ No newline at end of file | 50 | } |
diff --git a/OpenSim/Grid/ScriptServer/ScriptServer/Region/RegionBase.cs b/OpenSim/Grid/ScriptServer/ScriptServer/Region/RegionBase.cs index 4f9f2e7..a02429c 100644 --- a/OpenSim/Grid/ScriptServer/ScriptServer/Region/RegionBase.cs +++ b/OpenSim/Grid/ScriptServer/ScriptServer/Region/RegionBase.cs | |||
@@ -32,13 +32,8 @@ namespace OpenSim.Grid.ScriptServer.ScriptServer.Region | |||
32 | // These are events that the region needs to have | 32 | // These are events that the region needs to have |
33 | 33 | ||
34 | // TEMP: Using System.Delegate -- needs replacing with a real delegate | 34 | // TEMP: Using System.Delegate -- needs replacing with a real delegate |
35 | |||
36 | #region Delegates | ||
37 | |||
38 | public delegate void DefaultDelegate(); | 35 | public delegate void DefaultDelegate(); |
39 | 36 | ||
40 | #endregion | ||
41 | |||
42 | public event DefaultDelegate onScriptRez; | 37 | public event DefaultDelegate onScriptRez; |
43 | public event DefaultDelegate onstate_entry; | 38 | public event DefaultDelegate onstate_entry; |
44 | public event DefaultDelegate onstate_exit; | 39 | public event DefaultDelegate onstate_exit; |
diff --git a/OpenSim/Grid/ScriptServer/ScriptServer/Region/RegionConnectionManager.cs b/OpenSim/Grid/ScriptServer/ScriptServer/Region/RegionConnectionManager.cs index 3c20272..8c31b9b 100644 --- a/OpenSim/Grid/ScriptServer/ScriptServer/Region/RegionConnectionManager.cs +++ b/OpenSim/Grid/ScriptServer/ScriptServer/Region/RegionConnectionManager.cs | |||
@@ -29,8 +29,8 @@ namespace OpenSim.Grid.ScriptServer.ScriptServer.Region | |||
29 | { | 29 | { |
30 | public class RegionConnectionManager : RegionBase | 30 | public class RegionConnectionManager : RegionBase |
31 | { | 31 | { |
32 | private object m_Connection; | ||
33 | private ScriptServerMain m_ScriptServerMain; | 32 | private ScriptServerMain m_ScriptServerMain; |
33 | private object m_Connection; | ||
34 | 34 | ||
35 | public RegionConnectionManager(ScriptServerMain scm, object Connection) | 35 | public RegionConnectionManager(ScriptServerMain scm, object Connection) |
36 | { | 36 | { |
diff --git a/OpenSim/Grid/ScriptServer/ScriptServer/RegionCommManager.cs b/OpenSim/Grid/ScriptServer/ScriptServer/RegionCommManager.cs index c1449bf..8422bea 100644 --- a/OpenSim/Grid/ScriptServer/ScriptServer/RegionCommManager.cs +++ b/OpenSim/Grid/ScriptServer/ScriptServer/RegionCommManager.cs | |||
@@ -34,10 +34,12 @@ namespace OpenSim.Grid.ScriptServer.ScriptServer | |||
34 | { | 34 | { |
35 | internal class RegionCommManager | 35 | internal class RegionCommManager |
36 | { | 36 | { |
37 | private readonly ScriptServerMain m_ScriptServerMain; | ||
38 | private readonly List<RegionConnectionManager> Regions = new List<RegionConnectionManager>(); | ||
39 | private Thread listenThread; | 37 | private Thread listenThread; |
40 | 38 | ||
39 | private List<RegionConnectionManager> Regions = new List<RegionConnectionManager>(); | ||
40 | |||
41 | private ScriptServerMain m_ScriptServerMain; | ||
42 | |||
41 | public RegionCommManager(ScriptServerMain scm) | 43 | public RegionCommManager(ScriptServerMain scm) |
42 | { | 44 | { |
43 | m_ScriptServerMain = scm; | 45 | m_ScriptServerMain = scm; |
diff --git a/OpenSim/Grid/ScriptServer/ScriptServer/ScriptEngineLoader.cs b/OpenSim/Grid/ScriptServer/ScriptServer/ScriptEngineLoader.cs index dce92ce..4d8c559 100644 --- a/OpenSim/Grid/ScriptServer/ScriptServer/ScriptEngineLoader.cs +++ b/OpenSim/Grid/ScriptServer/ScriptServer/ScriptEngineLoader.cs | |||
@@ -51,7 +51,7 @@ namespace OpenSim.Grid.ScriptServer.ScriptServer | |||
51 | { | 51 | { |
52 | m_log.Error("[ScriptEngine]: " + | 52 | m_log.Error("[ScriptEngine]: " + |
53 | "Error loading assembly \"" + EngineName + "\": " + e.Message + ", " + | 53 | "Error loading assembly \"" + EngineName + "\": " + e.Message + ", " + |
54 | e.StackTrace); | 54 | e.StackTrace.ToString()); |
55 | } | 55 | } |
56 | return ret; | 56 | return ret; |
57 | } | 57 | } |
@@ -104,7 +104,7 @@ namespace OpenSim.Grid.ScriptServer.ScriptServer | |||
104 | ScriptServerInterfaces.ScriptEngine ret; | 104 | ScriptServerInterfaces.ScriptEngine ret; |
105 | //try | 105 | //try |
106 | //{ | 106 | //{ |
107 | ret = (ScriptServerInterfaces.ScriptEngine) Activator.CreateInstance(t); | 107 | ret = (ScriptServerInterfaces.ScriptEngine)Activator.CreateInstance(t); |
108 | //} | 108 | //} |
109 | //catch (Exception e) | 109 | //catch (Exception e) |
110 | //{ | 110 | //{ |
@@ -114,4 +114,4 @@ namespace OpenSim.Grid.ScriptServer.ScriptServer | |||
114 | return ret; | 114 | return ret; |
115 | } | 115 | } |
116 | } | 116 | } |
117 | } \ No newline at end of file | 117 | } |
diff --git a/OpenSim/Grid/ScriptServer/ScriptServer/ScriptEnginesManager.cs b/OpenSim/Grid/ScriptServer/ScriptServer/ScriptEnginesManager.cs index 9ecd179..9d67602 100644 --- a/OpenSim/Grid/ScriptServer/ScriptServer/ScriptEnginesManager.cs +++ b/OpenSim/Grid/ScriptServer/ScriptServer/ScriptEnginesManager.cs | |||
@@ -32,8 +32,8 @@ namespace OpenSim.Grid.ScriptServer.ScriptServer | |||
32 | { | 32 | { |
33 | internal class ScriptEngineManager | 33 | internal class ScriptEngineManager |
34 | { | 34 | { |
35 | private readonly ScriptEngineLoader ScriptEngineLoader; | 35 | private ScriptEngineLoader ScriptEngineLoader; |
36 | private readonly List<ScriptServerInterfaces.ScriptEngine> scriptEngines = new List<ScriptServerInterfaces.ScriptEngine>(); | 36 | private List<ScriptServerInterfaces.ScriptEngine> scriptEngines = new List<ScriptServerInterfaces.ScriptEngine>(); |
37 | private ScriptServerMain m_ScriptServerMain; | 37 | private ScriptServerMain m_ScriptServerMain; |
38 | 38 | ||
39 | // Initialize | 39 | // Initialize |
@@ -58,4 +58,4 @@ namespace OpenSim.Grid.ScriptServer.ScriptServer | |||
58 | return sei; | 58 | return sei; |
59 | } | 59 | } |
60 | } | 60 | } |
61 | } \ No newline at end of file | 61 | } |
diff --git a/OpenSim/Grid/ScriptServer/ScriptServerMain.cs b/OpenSim/Grid/ScriptServer/ScriptServerMain.cs index 131ff34..528b51c 100644 --- a/OpenSim/Grid/ScriptServer/ScriptServerMain.cs +++ b/OpenSim/Grid/ScriptServer/ScriptServerMain.cs | |||
@@ -44,20 +44,20 @@ namespace OpenSim.Grid.ScriptServer | |||
44 | // | 44 | // |
45 | // Root object. Creates objects used. | 45 | // Root object. Creates objects used. |
46 | // | 46 | // |
47 | private int listenPort = 8010; | ||
47 | 48 | ||
48 | // TEMP | 49 | // TEMP |
49 | public static ScriptServerInterfaces.ScriptEngine Engine; | 50 | public static ScriptServerInterfaces.ScriptEngine Engine; |
50 | private int listenPort = 8010; | ||
51 | //public static FakeScene m_Scene = new FakeScene(null,null,null,null,null,null,null,null,null,false, false, false); | 51 | //public static FakeScene m_Scene = new FakeScene(null,null,null,null,null,null,null,null,null,false, false, false); |
52 | 52 | ||
53 | // Objects we use | 53 | // Objects we use |
54 | internal RegionCommManager RegionScriptDaemon; // Listen for incoming from region | ||
55 | internal ScriptEngineManager ScriptEngines; // Loads scriptengines | ||
54 | //internal RemotingServer m_RemotingServer; | 56 | //internal RemotingServer m_RemotingServer; |
55 | internal TCPServer m_TCPServer; | 57 | internal TCPServer m_TCPServer; |
56 | internal RegionCommManager RegionScriptDaemon; // Listen for incoming from region | ||
57 | internal TRPC_Remote RPC; | 58 | internal TRPC_Remote RPC; |
58 | internal ScriptEngineManager ScriptEngines; // Loads scriptengines | ||
59 | 59 | ||
60 | public ScriptServerMain() | 60 | public ScriptServerMain() |
61 | { | 61 | { |
62 | m_console = CreateConsole(); | 62 | m_console = CreateConsole(); |
63 | 63 | ||
@@ -68,13 +68,13 @@ namespace OpenSim.Grid.ScriptServer | |||
68 | Engine = ScriptEngines.LoadEngine("DotNetEngine"); | 68 | Engine = ScriptEngines.LoadEngine("DotNetEngine"); |
69 | 69 | ||
70 | Engine.InitializeEngine(null, null, false, Engine.GetScriptManager()); | 70 | Engine.InitializeEngine(null, null, false, Engine.GetScriptManager()); |
71 | 71 | ||
72 | 72 | ||
73 | // Set up server | 73 | // Set up server |
74 | //m_RemotingServer = new RemotingServer(listenPort, "DotNetEngine"); | 74 | //m_RemotingServer = new RemotingServer(listenPort, "DotNetEngine"); |
75 | m_TCPServer = new TCPServer(listenPort); | 75 | m_TCPServer = new TCPServer(listenPort); |
76 | RPC = new TRPC_Remote(m_TCPServer); | 76 | RPC = new TRPC_Remote(m_TCPServer); |
77 | RPC.ReceiveCommand += RPC_ReceiveCommand; | 77 | RPC.ReceiveCommand += new TRPC_Remote.ReceiveCommandDelegate(RPC_ReceiveCommand); |
78 | m_TCPServer.StartListen(); | 78 | m_TCPServer.StartListen(); |
79 | 79 | ||
80 | Console.ReadLine(); | 80 | Console.ReadLine(); |
@@ -93,7 +93,7 @@ namespace OpenSim.Grid.ScriptServer | |||
93 | 93 | ||
94 | if (Command == "OnRezScript") | 94 | if (Command == "OnRezScript") |
95 | { | 95 | { |
96 | Engine.EventManager().OnRezScript((uint) p[0], new LLUUID((string) p[1]), (string) p[2]); | 96 | Engine.EventManager().OnRezScript((uint)p[0], new LLUUID((string)p[1]), (string)p[2]); |
97 | } | 97 | } |
98 | } | 98 | } |
99 | 99 | ||
@@ -106,4 +106,4 @@ namespace OpenSim.Grid.ScriptServer | |||
106 | return new ConsoleBase("ScriptServer", this); | 106 | return new ConsoleBase("ScriptServer", this); |
107 | } | 107 | } |
108 | } | 108 | } |
109 | } \ No newline at end of file | 109 | } |
diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs index 25e1585..0534e3b 100644 --- a/OpenSim/Grid/UserServer/Main.cs +++ b/OpenSim/Grid/UserServer/Main.cs | |||
@@ -48,61 +48,12 @@ namespace OpenSim.Grid.UserServer | |||
48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
49 | 49 | ||
50 | private UserConfig Cfg; | 50 | private UserConfig Cfg; |
51 | private LLUUID m_lastCreatedUser = LLUUID.Random(); | 51 | |
52 | |||
53 | public UserLoginService m_loginService; | ||
54 | public MessageServersConnector m_messagesService; | ||
55 | public UserManager m_userManager; | 52 | public UserManager m_userManager; |
53 | public UserLoginService m_loginService; | ||
54 | public MessageServersConnector m_messagesService; | ||
56 | 55 | ||
57 | private OpenUser_Main() | 56 | private LLUUID m_lastCreatedUser = LLUUID.Random(); |
58 | { | ||
59 | m_console = new ConsoleBase("OpenUser", this); | ||
60 | MainConsole.Instance = m_console; | ||
61 | } | ||
62 | |||
63 | #region conscmd_callback Members | ||
64 | |||
65 | public override void RunCmd(string cmd, string[] cmdparams) | ||
66 | { | ||
67 | base.RunCmd(cmd, cmdparams); | ||
68 | |||
69 | switch (cmd) | ||
70 | { | ||
71 | case "help": | ||
72 | m_console.Notice("create user - create a new user"); | ||
73 | m_console.Notice("stats - statistical information for this server"); | ||
74 | m_console.Notice("shutdown - shutdown the grid (USE CAUTION!)"); | ||
75 | break; | ||
76 | |||
77 | case "create": | ||
78 | do_create(cmdparams[0]); | ||
79 | break; | ||
80 | |||
81 | case "shutdown": | ||
82 | m_loginService.OnUserLoggedInAtLocation -= NotifyMessageServersUserLoggedInToLocation; | ||
83 | m_console.Close(); | ||
84 | Environment.Exit(0); | ||
85 | break; | ||
86 | |||
87 | case "stats": | ||
88 | m_console.Notice(StatsManager.UserStats.Report()); | ||
89 | break; | ||
90 | |||
91 | case "test-inventory": | ||
92 | // RestObjectPosterResponse<List<InventoryFolderBase>> requester = new RestObjectPosterResponse<List<InventoryFolderBase>>(); | ||
93 | // requester.ReturnResponseVal = TestResponse; | ||
94 | // requester.BeginPostObject<LLUUID>(m_userManager._config.InventoryUrl + "RootFolders/", m_lastCreatedUser); | ||
95 | SynchronousRestObjectPoster.BeginPostObject<LLUUID, List<InventoryFolderBase>>("POST", | ||
96 | m_userManager. | ||
97 | _config. | ||
98 | InventoryUrl + | ||
99 | "RootFolders/", | ||
100 | m_lastCreatedUser); | ||
101 | break; | ||
102 | } | ||
103 | } | ||
104 | |||
105 | #endregion | ||
106 | 57 | ||
107 | [STAThread] | 58 | [STAThread] |
108 | public static void Main(string[] args) | 59 | public static void Main(string[] args) |
@@ -117,6 +68,12 @@ namespace OpenSim.Grid.UserServer | |||
117 | userserver.Work(); | 68 | userserver.Work(); |
118 | } | 69 | } |
119 | 70 | ||
71 | private OpenUser_Main() | ||
72 | { | ||
73 | m_console = new ConsoleBase("OpenUser", this); | ||
74 | MainConsole.Instance = m_console; | ||
75 | } | ||
76 | |||
120 | private void Work() | 77 | private void Work() |
121 | { | 78 | { |
122 | m_console.Notice("Enter help for a list of commands\n"); | 79 | m_console.Notice("Enter help for a list of commands\n"); |
@@ -130,16 +87,16 @@ namespace OpenSim.Grid.UserServer | |||
130 | public void Startup() | 87 | public void Startup() |
131 | { | 88 | { |
132 | Cfg = new UserConfig("USER SERVER", (Path.Combine(Util.configDir(), "UserServer_Config.xml"))); | 89 | Cfg = new UserConfig("USER SERVER", (Path.Combine(Util.configDir(), "UserServer_Config.xml"))); |
133 | 90 | ||
134 | StatsManager.StartCollectingUserStats(); | 91 | StatsManager.StartCollectingUserStats(); |
135 | 92 | ||
136 | m_log.Info("[REGION]: Establishing data connection"); | 93 | m_log.Info("[REGION]: Establishing data connection"); |
137 | m_userManager = new UserManager(); | 94 | m_userManager = new UserManager(); |
138 | m_userManager._config = Cfg; | 95 | m_userManager._config = Cfg; |
139 | m_userManager.AddPlugin(Cfg.DatabaseProvider); | 96 | m_userManager.AddPlugin(Cfg.DatabaseProvider); |
140 | 97 | ||
141 | m_loginService = new UserLoginService( | 98 | m_loginService = new UserLoginService( |
142 | m_userManager, new LibraryRootFolder(), Cfg, Cfg.DefaultStartupMsg); | 99 | m_userManager, new LibraryRootFolder(), Cfg, Cfg.DefaultStartupMsg); |
143 | 100 | ||
144 | m_messagesService = new MessageServersConnector(); | 101 | m_messagesService = new MessageServersConnector(); |
145 | 102 | ||
@@ -147,7 +104,7 @@ namespace OpenSim.Grid.UserServer | |||
147 | m_userManager.OnLogOffUser += NotifyMessageServersUserLoggOff; | 104 | m_userManager.OnLogOffUser += NotifyMessageServersUserLoggOff; |
148 | 105 | ||
149 | m_log.Info("[REGION]: Starting HTTP process"); | 106 | m_log.Info("[REGION]: Starting HTTP process"); |
150 | 107 | ||
151 | m_httpServer = new BaseHttpServer(Cfg.HttpPort); | 108 | m_httpServer = new BaseHttpServer(Cfg.HttpPort); |
152 | AddHttpHandlers(); | 109 | AddHttpHandlers(); |
153 | m_httpServer.Start(); | 110 | m_httpServer.Start(); |
@@ -160,7 +117,7 @@ namespace OpenSim.Grid.UserServer | |||
160 | m_httpServer.AddXmlRPCHandler("login_to_simulator", m_loginService.XmlRpcLoginMethod); | 117 | m_httpServer.AddXmlRPCHandler("login_to_simulator", m_loginService.XmlRpcLoginMethod); |
161 | 118 | ||
162 | m_httpServer.AddHTTPHandler("login", m_loginService.ProcessHTMLLogin); | 119 | m_httpServer.AddHTTPHandler("login", m_loginService.ProcessHTMLLogin); |
163 | 120 | ||
164 | m_httpServer.SetLLSDHandler(m_loginService.LLSDLoginMethod); | 121 | m_httpServer.SetLLSDHandler(m_loginService.LLSDLoginMethod); |
165 | 122 | ||
166 | m_httpServer.AddXmlRPCHandler("get_user_by_name", m_userManager.XmlRPCGetUserMethodName); | 123 | m_httpServer.AddXmlRPCHandler("get_user_by_name", m_userManager.XmlRPCGetUserMethodName); |
@@ -171,7 +128,7 @@ namespace OpenSim.Grid.UserServer | |||
171 | m_httpServer.AddXmlRPCHandler("update_user_friend_perms", m_userManager.XmlRpcResponseXmlRPCUpdateUserFriendPerms); | 128 | m_httpServer.AddXmlRPCHandler("update_user_friend_perms", m_userManager.XmlRpcResponseXmlRPCUpdateUserFriendPerms); |
172 | m_httpServer.AddXmlRPCHandler("get_user_friend_list", m_userManager.XmlRpcResponseXmlRPCGetUserFriendList); | 129 | m_httpServer.AddXmlRPCHandler("get_user_friend_list", m_userManager.XmlRpcResponseXmlRPCGetUserFriendList); |
173 | m_httpServer.AddXmlRPCHandler("logout_of_simulator", m_userManager.XmlRPCLogOffUserMethodUUID); | 130 | m_httpServer.AddXmlRPCHandler("logout_of_simulator", m_userManager.XmlRPCLogOffUserMethodUUID); |
174 | 131 | ||
175 | // Message Server ---> User Server | 132 | // Message Server ---> User Server |
176 | m_httpServer.AddXmlRPCHandler("register_messageserver", m_messagesService.XmlRPCRegisterMessageServer); | 133 | m_httpServer.AddXmlRPCHandler("register_messageserver", m_messagesService.XmlRPCRegisterMessageServer); |
177 | m_httpServer.AddXmlRPCHandler("agent_change_region", m_messagesService.XmlRPCUserMovedtoRegion); | 134 | m_httpServer.AddXmlRPCHandler("agent_change_region", m_messagesService.XmlRPCUserMovedtoRegion); |
@@ -206,17 +163,17 @@ namespace OpenSim.Grid.UserServer | |||
206 | { | 163 | { |
207 | m_log.ErrorFormat( | 164 | m_log.ErrorFormat( |
208 | "[USERS]: A user with the name {0} {1} already exists!", tempfirstname, templastname); | 165 | "[USERS]: A user with the name {0} {1} already exists!", tempfirstname, templastname); |
209 | 166 | ||
210 | break; | 167 | break; |
211 | } | 168 | } |
212 | 169 | ||
213 | tempMD5Passwd = Util.Md5Hash(Util.Md5Hash(tempMD5Passwd) + ":" + String.Empty); | 170 | tempMD5Passwd = Util.Md5Hash(Util.Md5Hash(tempMD5Passwd) + ":" + String.Empty); |
214 | 171 | ||
215 | LLUUID userID = new LLUUID(); | 172 | LLUUID userID = new LLUUID(); |
216 | try | 173 | try |
217 | { | 174 | { |
218 | userID = m_userManager.AddUserProfile(tempfirstname, templastname, tempMD5Passwd, regX, regY); | 175 | userID = m_userManager.AddUserProfile(tempfirstname, templastname, tempMD5Passwd, regX, regY); |
219 | } | 176 | } |
220 | catch (Exception ex) | 177 | catch (Exception ex) |
221 | { | 178 | { |
222 | m_log.ErrorFormat("[USERS]: Error creating user: {0}", ex.ToString()); | 179 | m_log.ErrorFormat("[USERS]: Error creating user: {0}", ex.ToString()); |
@@ -224,35 +181,76 @@ namespace OpenSim.Grid.UserServer | |||
224 | 181 | ||
225 | try | 182 | try |
226 | { | 183 | { |
227 | bool created | 184 | bool created |
228 | = SynchronousRestObjectPoster.BeginPostObject<Guid, bool>( | 185 | = SynchronousRestObjectPoster.BeginPostObject<Guid, bool>( |
229 | "POST", m_userManager._config.InventoryUrl + "CreateInventory/", userID.UUID); | 186 | "POST", m_userManager._config.InventoryUrl + "CreateInventory/", userID.UUID); |
230 | 187 | ||
231 | if (!created) | 188 | if (!created) |
232 | { | 189 | { |
233 | throw new Exception( | 190 | throw new Exception( |
234 | String.Format( | 191 | String.Format( |
235 | "The inventory creation request for user {0} did not succeed." | 192 | "The inventory creation request for user {0} did not succeed." |
236 | + " Please contact your inventory service provider for more information.", | 193 | + " Please contact your inventory service provider for more information.", |
237 | userID)); | 194 | userID)); |
238 | } | 195 | } |
196 | |||
239 | } | 197 | } |
240 | catch (WebException e) | 198 | catch (WebException e) |
241 | { | 199 | { |
242 | m_log.ErrorFormat( | 200 | m_log.ErrorFormat( |
243 | "[USERS]: Could not contact the inventory service at {0} to create an inventory for {1}", | 201 | "[USERS]: Could not contact the inventory service at {0} to create an inventory for {1}", |
244 | m_userManager._config.InventoryUrl + "CreateInventory/", userID.UUID); | 202 | m_userManager._config.InventoryUrl + "CreateInventory/", userID.UUID); |
245 | } | 203 | } |
246 | catch (Exception e) | 204 | catch (Exception e) |
247 | { | 205 | { |
248 | m_log.ErrorFormat("[USERS]: Error creating inventory for user: {0}", e); | 206 | m_log.ErrorFormat("[USERS]: Error creating inventory for user: {0}", e); |
249 | } | 207 | } |
250 | 208 | ||
251 | m_lastCreatedUser = userID; | 209 | m_lastCreatedUser = userID; |
252 | break; | 210 | break; |
253 | } | 211 | } |
254 | } | 212 | } |
255 | 213 | ||
214 | public override void RunCmd(string cmd, string[] cmdparams) | ||
215 | { | ||
216 | base.RunCmd(cmd, cmdparams); | ||
217 | |||
218 | switch (cmd) | ||
219 | { | ||
220 | case "help": | ||
221 | m_console.Notice("create user - create a new user"); | ||
222 | m_console.Notice("stats - statistical information for this server"); | ||
223 | m_console.Notice("shutdown - shutdown the grid (USE CAUTION!)"); | ||
224 | break; | ||
225 | |||
226 | case "create": | ||
227 | do_create(cmdparams[0]); | ||
228 | break; | ||
229 | |||
230 | case "shutdown": | ||
231 | m_loginService.OnUserLoggedInAtLocation -= NotifyMessageServersUserLoggedInToLocation; | ||
232 | m_console.Close(); | ||
233 | Environment.Exit(0); | ||
234 | break; | ||
235 | |||
236 | case "stats": | ||
237 | m_console.Notice(StatsManager.UserStats.Report()); | ||
238 | break; | ||
239 | |||
240 | case "test-inventory": | ||
241 | // RestObjectPosterResponse<List<InventoryFolderBase>> requester = new RestObjectPosterResponse<List<InventoryFolderBase>>(); | ||
242 | // requester.ReturnResponseVal = TestResponse; | ||
243 | // requester.BeginPostObject<LLUUID>(m_userManager._config.InventoryUrl + "RootFolders/", m_lastCreatedUser); | ||
244 | SynchronousRestObjectPoster.BeginPostObject<LLUUID, List<InventoryFolderBase>>("POST", | ||
245 | m_userManager. | ||
246 | _config. | ||
247 | InventoryUrl + | ||
248 | "RootFolders/", | ||
249 | m_lastCreatedUser); | ||
250 | break; | ||
251 | } | ||
252 | } | ||
253 | |||
256 | public void TestResponse(List<InventoryFolderBase> resp) | 254 | public void TestResponse(List<InventoryFolderBase> resp) |
257 | { | 255 | { |
258 | m_console.Notice("response got"); | 256 | m_console.Notice("response got"); |
@@ -264,11 +262,12 @@ namespace OpenSim.Grid.UserServer | |||
264 | } | 262 | } |
265 | 263 | ||
266 | public void NotifyMessageServersUserLoggedInToLocation(LLUUID agentID, LLUUID sessionID, LLUUID RegionID, | 264 | public void NotifyMessageServersUserLoggedInToLocation(LLUUID agentID, LLUUID sessionID, LLUUID RegionID, |
267 | ulong regionhandle, float positionX, float positionY, | 265 | ulong regionhandle, float positionX, float positionY, |
268 | float positionZ, string firstname, string lastname) | 266 | float positionZ, string firstname, string lastname) |
269 | { | 267 | { |
270 | m_messagesService.TellMessageServersAboutUser(agentID, sessionID, RegionID, regionhandle, positionX, | 268 | |
271 | positionY, positionZ, firstname, lastname); | 269 | m_messagesService.TellMessageServersAboutUser( agentID, sessionID, RegionID, regionhandle, positionX, |
270 | positionY, positionZ, firstname, lastname); | ||
272 | } | 271 | } |
273 | } | 272 | } |
274 | } \ No newline at end of file | 273 | } |
diff --git a/OpenSim/Grid/UserServer/MessageServersConnector.cs b/OpenSim/Grid/UserServer/MessageServersConnector.cs index 70068e0..28f5c4c 100644 --- a/OpenSim/Grid/UserServer/MessageServersConnector.cs +++ b/OpenSim/Grid/UserServer/MessageServersConnector.cs | |||
@@ -41,12 +41,12 @@ namespace OpenSim.Grid.UserServer | |||
41 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 41 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
42 | 42 | ||
43 | public Dictionary<string, MessageServerInfo> MessageServers; | 43 | public Dictionary<string, MessageServerInfo> MessageServers; |
44 | 44 | ||
45 | public MessageServersConnector() | 45 | public MessageServersConnector() |
46 | { | 46 | { |
47 | MessageServers = new Dictionary<string, MessageServerInfo>(); | 47 | MessageServers = new Dictionary<string, MessageServerInfo>(); |
48 | } | 48 | } |
49 | 49 | ||
50 | public void RegisterMessageServer(string URI, MessageServerInfo serverData) | 50 | public void RegisterMessageServer(string URI, MessageServerInfo serverData) |
51 | { | 51 | { |
52 | lock (MessageServers) | 52 | lock (MessageServers) |
@@ -55,7 +55,7 @@ namespace OpenSim.Grid.UserServer | |||
55 | MessageServers.Add(URI, serverData); | 55 | MessageServers.Add(URI, serverData); |
56 | } | 56 | } |
57 | } | 57 | } |
58 | 58 | ||
59 | public void DeRegisterMessageServer(string URI) | 59 | public void DeRegisterMessageServer(string URI) |
60 | { | 60 | { |
61 | lock (MessageServers) | 61 | lock (MessageServers) |
@@ -64,7 +64,7 @@ namespace OpenSim.Grid.UserServer | |||
64 | MessageServers.Remove(URI); | 64 | MessageServers.Remove(URI); |
65 | } | 65 | } |
66 | } | 66 | } |
67 | 67 | ||
68 | public void AddResponsibleRegion(string URI, ulong regionhandle) | 68 | public void AddResponsibleRegion(string URI, ulong regionhandle) |
69 | { | 69 | { |
70 | if (!MessageServers.ContainsKey(URI)) | 70 | if (!MessageServers.ContainsKey(URI)) |
@@ -76,9 +76,8 @@ namespace OpenSim.Grid.UserServer | |||
76 | MessageServerInfo msginfo = MessageServers["URI"]; | 76 | MessageServerInfo msginfo = MessageServers["URI"]; |
77 | msginfo.responsibleForRegions.Add(regionhandle); | 77 | msginfo.responsibleForRegions.Add(regionhandle); |
78 | MessageServers["URI"] = msginfo; | 78 | MessageServers["URI"] = msginfo; |
79 | } | 79 | } |
80 | } | 80 | } |
81 | |||
82 | public void RemoveResponsibleRegion(string URI, ulong regionhandle) | 81 | public void RemoveResponsibleRegion(string URI, ulong regionhandle) |
83 | { | 82 | { |
84 | if (!MessageServers.ContainsKey(URI)) | 83 | if (!MessageServers.ContainsKey(URI)) |
@@ -93,20 +92,20 @@ namespace OpenSim.Grid.UserServer | |||
93 | msginfo.responsibleForRegions.Remove(regionhandle); | 92 | msginfo.responsibleForRegions.Remove(regionhandle); |
94 | MessageServers["URI"] = msginfo; | 93 | MessageServers["URI"] = msginfo; |
95 | } | 94 | } |
96 | } | 95 | } |
97 | } | ||
98 | 96 | ||
97 | } | ||
99 | public XmlRpcResponse XmlRPCRegisterMessageServer(XmlRpcRequest request) | 98 | public XmlRpcResponse XmlRPCRegisterMessageServer(XmlRpcRequest request) |
100 | { | 99 | { |
101 | XmlRpcResponse response = new XmlRpcResponse(); | 100 | XmlRpcResponse response = new XmlRpcResponse(); |
102 | Hashtable requestData = (Hashtable) request.Params[0]; | 101 | Hashtable requestData = (Hashtable)request.Params[0]; |
103 | Hashtable responseData = new Hashtable(); | 102 | Hashtable responseData = new Hashtable(); |
104 | 103 | ||
105 | if (requestData.Contains("uri")) | 104 | if (requestData.Contains("uri")) |
106 | { | 105 | { |
107 | string URI = (string) requestData["uri"]; | 106 | string URI = (string)requestData["uri"]; |
108 | string sendkey = (string) requestData["sendkey"]; | 107 | string sendkey=(string)requestData["sendkey"]; |
109 | string recvkey = (string) requestData["recvkey"]; | 108 | string recvkey=(string)requestData["recvkey"]; |
110 | MessageServerInfo m = new MessageServerInfo(); | 109 | MessageServerInfo m = new MessageServerInfo(); |
111 | m.URI = URI; | 110 | m.URI = URI; |
112 | m.sendkey = sendkey; | 111 | m.sendkey = sendkey; |
@@ -117,16 +116,15 @@ namespace OpenSim.Grid.UserServer | |||
117 | } | 116 | } |
118 | return response; | 117 | return response; |
119 | } | 118 | } |
120 | |||
121 | public XmlRpcResponse XmlRPCDeRegisterMessageServer(XmlRpcRequest request) | 119 | public XmlRpcResponse XmlRPCDeRegisterMessageServer(XmlRpcRequest request) |
122 | { | 120 | { |
123 | XmlRpcResponse response = new XmlRpcResponse(); | 121 | XmlRpcResponse response = new XmlRpcResponse(); |
124 | Hashtable requestData = (Hashtable) request.Params[0]; | 122 | Hashtable requestData = (Hashtable)request.Params[0]; |
125 | Hashtable responseData = new Hashtable(); | 123 | Hashtable responseData = new Hashtable(); |
126 | 124 | ||
127 | if (requestData.Contains("uri")) | 125 | if (requestData.Contains("uri")) |
128 | { | 126 | { |
129 | string URI = (string) requestData["uri"]; | 127 | string URI = (string)requestData["uri"]; |
130 | 128 | ||
131 | DeRegisterMessageServer(URI); | 129 | DeRegisterMessageServer(URI); |
132 | responseData["responsestring"] = "TRUE"; | 130 | responseData["responsestring"] = "TRUE"; |
@@ -134,24 +132,23 @@ namespace OpenSim.Grid.UserServer | |||
134 | } | 132 | } |
135 | return response; | 133 | return response; |
136 | } | 134 | } |
137 | |||
138 | public XmlRpcResponse XmlRPCUserMovedtoRegion(XmlRpcRequest request) | 135 | public XmlRpcResponse XmlRPCUserMovedtoRegion(XmlRpcRequest request) |
139 | { | 136 | { |
140 | XmlRpcResponse response = new XmlRpcResponse(); | 137 | XmlRpcResponse response = new XmlRpcResponse(); |
141 | Hashtable requestData = (Hashtable) request.Params[0]; | 138 | Hashtable requestData = (Hashtable)request.Params[0]; |
142 | Hashtable responseData = new Hashtable(); | 139 | Hashtable responseData = new Hashtable(); |
143 | 140 | ||
144 | if (requestData.Contains("fromuri")) | 141 | if (requestData.Contains("fromuri")) |
145 | { | 142 | { |
146 | string sURI = (string) requestData["fromuri"]; | 143 | string sURI = (string)requestData["fromuri"]; |
147 | string sagentID = (string) requestData["agentid"]; | 144 | string sagentID = (string)requestData["agentid"]; |
148 | string ssessionID = (string) requestData["sessionid"]; | 145 | string ssessionID = (string)requestData["sessionid"]; |
149 | string scurrentRegionID = (string) requestData["regionid"]; | 146 | string scurrentRegionID = (string)requestData["regionid"]; |
150 | string sregionhandle = (string) requestData["regionhandle"]; | 147 | string sregionhandle = (string)requestData["regionhandle"]; |
151 | string scurrentpos = (string) requestData["currentpos"]; | 148 | string scurrentpos = (string)requestData["currentpos"]; |
152 | //LLVector3.TryParse((string)reader["currentPos"], out retval.currentPos); | 149 | //LLVector3.TryParse((string)reader["currentPos"], out retval.currentPos); |
153 | // TODO: Okay now raise event so the user server can pass this data to the Usermanager | 150 | // TODO: Okay now raise event so the user server can pass this data to the Usermanager |
154 | 151 | ||
155 | responseData["responsestring"] = "TRUE"; | 152 | responseData["responsestring"] = "TRUE"; |
156 | response.Value = responseData; | 153 | response.Value = responseData; |
157 | } | 154 | } |
@@ -159,7 +156,7 @@ namespace OpenSim.Grid.UserServer | |||
159 | } | 156 | } |
160 | 157 | ||
161 | public void TellMessageServersAboutUser(LLUUID agentID, LLUUID sessionID, LLUUID RegionID, | 158 | public void TellMessageServersAboutUser(LLUUID agentID, LLUUID sessionID, LLUUID RegionID, |
162 | ulong regionhandle, float positionX, float positionY, | 159 | ulong regionhandle, float positionX, float positionY, |
163 | float positionZ, string firstname, string lastname) | 160 | float positionZ, string firstname, string lastname) |
164 | { | 161 | { |
165 | // Loop over registered Message Servers ( AND THERE WILL BE MORE THEN ONE :D ) | 162 | // Loop over registered Message Servers ( AND THERE WILL BE MORE THEN ONE :D ) |
@@ -176,8 +173,8 @@ namespace OpenSim.Grid.UserServer | |||
176 | foreach (MessageServerInfo serv in MessageServers.Values) | 173 | foreach (MessageServerInfo serv in MessageServers.Values) |
177 | { | 174 | { |
178 | NotifyMessageServerAboutUser(serv, agentID, sessionID, RegionID, | 175 | NotifyMessageServerAboutUser(serv, agentID, sessionID, RegionID, |
179 | regionhandle, positionX, positionY, positionZ, | 176 | regionhandle, positionX, positionY, positionZ, |
180 | firstname, lastname); | 177 | firstname, lastname); |
181 | } | 178 | } |
182 | } | 179 | } |
183 | } | 180 | } |
@@ -194,10 +191,10 @@ namespace OpenSim.Grid.UserServer | |||
194 | // { | 191 | // { |
195 | // m_log.Debug("[MSGCONNECTOR]: No Message Servers registered, ignoring"); | 192 | // m_log.Debug("[MSGCONNECTOR]: No Message Servers registered, ignoring"); |
196 | // } | 193 | // } |
197 | foreach (MessageServerInfo serv in MessageServers.Values) | 194 | foreach (MessageServerInfo serv in MessageServers.Values) |
198 | { | 195 | { |
199 | NotifyMessageServerAboutUserLogoff(serv, agentID); | 196 | NotifyMessageServerAboutUserLogoff(serv,agentID); |
200 | } | 197 | } |
201 | } | 198 | } |
202 | } | 199 | } |
203 | 200 | ||
@@ -221,10 +218,10 @@ namespace OpenSim.Grid.UserServer | |||
221 | m_log.Info("[LOGOUT]: Notified : " + serv.URI + " about user logout"); | 218 | m_log.Info("[LOGOUT]: Notified : " + serv.URI + " about user logout"); |
222 | } | 219 | } |
223 | 220 | ||
224 | private void NotifyMessageServerAboutUser(MessageServerInfo serv, | 221 | private void NotifyMessageServerAboutUser(MessageServerInfo serv, |
225 | LLUUID agentID, LLUUID sessionID, LLUUID RegionID, | 222 | LLUUID agentID, LLUUID sessionID, LLUUID RegionID, |
226 | ulong regionhandle, float positionX, float positionY, float positionZ, | 223 | ulong regionhandle, float positionX, float positionY, float positionZ, |
227 | string firstname, string lastname) | 224 | string firstname, string lastname) |
228 | { | 225 | { |
229 | Hashtable reqparams = new Hashtable(); | 226 | Hashtable reqparams = new Hashtable(); |
230 | reqparams["sendkey"] = serv.sendkey; | 227 | reqparams["sendkey"] = serv.sendkey; |
@@ -253,6 +250,7 @@ namespace OpenSim.Grid.UserServer | |||
253 | { | 250 | { |
254 | m_log.Warn("[MSGCONNECTOR]: Unable to notify Message Server about login. Presence might be borked for this user"); | 251 | m_log.Warn("[MSGCONNECTOR]: Unable to notify Message Server about login. Presence might be borked for this user"); |
255 | } | 252 | } |
253 | |||
256 | } | 254 | } |
257 | } | 255 | } |
258 | } \ No newline at end of file | 256 | } |
diff --git a/OpenSim/Grid/UserServer/Properties/AssemblyInfo.cs b/OpenSim/Grid/UserServer/Properties/AssemblyInfo.cs index eb60f11..680b357 100644 --- a/OpenSim/Grid/UserServer/Properties/AssemblyInfo.cs +++ b/OpenSim/Grid/UserServer/Properties/AssemblyInfo.cs | |||
@@ -60,4 +60,4 @@ using System.Runtime.InteropServices; | |||
60 | // | 60 | // |
61 | 61 | ||
62 | [assembly : AssemblyVersion("1.0.0.0")] | 62 | [assembly : AssemblyVersion("1.0.0.0")] |
63 | [assembly : AssemblyFileVersion("1.0.0.0")] \ No newline at end of file | 63 | [assembly : AssemblyFileVersion("1.0.0.0")] |
diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs index b19b74d..b123b8c 100644 --- a/OpenSim/Grid/UserServer/UserLoginService.cs +++ b/OpenSim/Grid/UserServer/UserLoginService.cs | |||
@@ -41,26 +41,26 @@ using OpenSim.Framework.Servers; | |||
41 | namespace OpenSim.Grid.UserServer | 41 | namespace OpenSim.Grid.UserServer |
42 | { | 42 | { |
43 | public delegate void UserLoggedInAtLocation(LLUUID agentID, LLUUID sessionID, LLUUID RegionID, | 43 | public delegate void UserLoggedInAtLocation(LLUUID agentID, LLUUID sessionID, LLUUID RegionID, |
44 | ulong regionhandle, float positionX, float positionY, float positionZ, string firstname, string lastname); | 44 | ulong regionhandle, float positionX, float positionY, float positionZ, string firstname, string lastname); |
45 | 45 | ||
46 | public class UserLoginService : LoginService | 46 | public class UserLoginService : LoginService |
47 | { | 47 | { |
48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
49 | 49 | ||
50 | private UserLoggedInAtLocation handlerUserLoggedInAtLocation; | 50 | public event UserLoggedInAtLocation OnUserLoggedInAtLocation; |
51 | 51 | ||
52 | private UserLoggedInAtLocation handlerUserLoggedInAtLocation = null; | ||
53 | |||
52 | public UserConfig m_config; | 54 | public UserConfig m_config; |
53 | 55 | ||
54 | public UserLoginService( | 56 | public UserLoginService( |
55 | UserManagerBase userManager, LibraryRootFolder libraryRootFolder, | 57 | UserManagerBase userManager, LibraryRootFolder libraryRootFolder, |
56 | UserConfig config, string welcomeMess) | 58 | UserConfig config, string welcomeMess) |
57 | : base(userManager, libraryRootFolder, welcomeMess) | 59 | : base(userManager, libraryRootFolder, welcomeMess) |
58 | { | 60 | { |
59 | m_config = config; | 61 | m_config = config; |
60 | } | 62 | } |
61 | 63 | ||
62 | public event UserLoggedInAtLocation OnUserLoggedInAtLocation; | ||
63 | |||
64 | /// <summary> | 64 | /// <summary> |
65 | /// Customises the login response and fills in missing values. | 65 | /// Customises the login response and fills in missing values. |
66 | /// </summary> | 66 | /// </summary> |
@@ -95,8 +95,7 @@ namespace OpenSim.Grid.UserServer | |||
95 | else | 95 | else |
96 | { | 96 | { |
97 | string[] startLocationRequestParsed = Util.ParseStartLocationRequest(startLocationRequest); | 97 | string[] startLocationRequestParsed = Util.ParseStartLocationRequest(startLocationRequest); |
98 | m_log.Info("[DEBUGLOGINPARSE]: 1:" + startLocationRequestParsed[0] + ", 2:" + startLocationRequestParsed[1] + ", 3:" + | 98 | m_log.Info("[DEBUGLOGINPARSE]: 1:" + startLocationRequestParsed[0] + ", 2:" + startLocationRequestParsed[1] + ", 3:" + startLocationRequestParsed[2] + ", 4:" + startLocationRequestParsed[3]); |
99 | startLocationRequestParsed[2] + ", 4:" + startLocationRequestParsed[3]); | ||
100 | if (startLocationRequestParsed[0] == "last") | 99 | if (startLocationRequestParsed[0] == "last") |
101 | { | 100 | { |
102 | // TODO: Parse out startlocationrequest string in the format; 'uri:RegionName&X&Y&Z' | 101 | // TODO: Parse out startlocationrequest string in the format; 'uri:RegionName&X&Y&Z' |
@@ -109,9 +108,9 @@ namespace OpenSim.Grid.UserServer | |||
109 | { | 108 | { |
110 | m_log.Info("[LOGIN]: Looking up Sim: " + startLocationRequestParsed[0]); | 109 | m_log.Info("[LOGIN]: Looking up Sim: " + startLocationRequestParsed[0]); |
111 | SimInfo = | 110 | SimInfo = |
112 | RegionProfileData.RequestSimProfileData( | 111 | RegionProfileData.RequestSimProfileData( |
113 | startLocationRequestParsed[0], m_config.GridServerURL, | 112 | startLocationRequestParsed[0], m_config.GridServerURL, |
114 | m_config.GridSendKey, m_config.GridRecvKey); | 113 | m_config.GridSendKey, m_config.GridRecvKey); |
115 | 114 | ||
116 | if (SimInfo == null) | 115 | if (SimInfo == null) |
117 | { | 116 | { |
@@ -120,9 +119,7 @@ namespace OpenSim.Grid.UserServer | |||
120 | RegionProfileData.RequestSimProfileData( | 119 | RegionProfileData.RequestSimProfileData( |
121 | theUser.HomeRegion, m_config.GridServerURL, | 120 | theUser.HomeRegion, m_config.GridServerURL, |
122 | m_config.GridSendKey, m_config.GridRecvKey); | 121 | m_config.GridSendKey, m_config.GridRecvKey); |
123 | } | 122 | } else { |
124 | else | ||
125 | { | ||
126 | start_x = Convert.ToInt32(startLocationRequestParsed[1]); | 123 | start_x = Convert.ToInt32(startLocationRequestParsed[1]); |
127 | start_y = Convert.ToInt32(startLocationRequestParsed[2]); | 124 | start_y = Convert.ToInt32(startLocationRequestParsed[2]); |
128 | start_z = Convert.ToInt32(startLocationRequestParsed[3]); | 125 | start_z = Convert.ToInt32(startLocationRequestParsed[3]); |
@@ -133,30 +130,30 @@ namespace OpenSim.Grid.UserServer | |||
133 | // Customise the response | 130 | // Customise the response |
134 | //CFK: This is redundant and the next message should always appear. | 131 | //CFK: This is redundant and the next message should always appear. |
135 | //CFK: m_log.Info("[LOGIN]: Home Location"); | 132 | //CFK: m_log.Info("[LOGIN]: Home Location"); |
136 | response.Home = "{'region_handle':[r" + (SimInfo.regionLocX * Constants.RegionSize) + ",r" + | 133 | response.Home = "{'region_handle':[r" + (SimInfo.regionLocX * Constants.RegionSize).ToString() + ",r" + |
137 | (SimInfo.regionLocY * Constants.RegionSize) + "], " + | 134 | (SimInfo.regionLocY * Constants.RegionSize).ToString() + "], " + |
138 | "'position':[r" + theUser.HomeLocation.X + ",r" + | 135 | "'position':[r" + theUser.HomeLocation.X.ToString() + ",r" + |
139 | theUser.HomeLocation.Y + ",r" + theUser.HomeLocation.Z + "], " + | 136 | theUser.HomeLocation.Y.ToString() + ",r" + theUser.HomeLocation.Z.ToString() + "], " + |
140 | "'look_at':[r" + theUser.HomeLocation.X + ",r" + | 137 | "'look_at':[r" + theUser.HomeLocation.X.ToString() + ",r" + |
141 | theUser.HomeLocation.Y + ",r" + theUser.HomeLocation.Z + "]}"; | 138 | theUser.HomeLocation.Y.ToString() + ",r" + theUser.HomeLocation.Z.ToString() + "]}"; |
142 | 139 | ||
143 | // Destination | 140 | // Destination |
144 | //CFK: The "Notifying" message always seems to appear, so subsume the data from this message into | 141 | //CFK: The "Notifying" message always seems to appear, so subsume the data from this message into |
145 | //CFK: the next one for X & Y and comment this one. | 142 | //CFK: the next one for X & Y and comment this one. |
146 | //CFK: m_log.Info("[LOGIN]: CUSTOMISERESPONSE: Region X: " + SimInfo.regionLocX + | 143 | //CFK: m_log.Info("[LOGIN]: CUSTOMISERESPONSE: Region X: " + SimInfo.regionLocX + |
147 | //CFK: "; Region Y: " + SimInfo.regionLocY); | 144 | //CFK: "; Region Y: " + SimInfo.regionLocY); |
148 | response.SimAddress = Util.GetHostFromDNS(SimInfo.serverURI.Split(new[] {'/', ':'})[3]).ToString(); | 145 | response.SimAddress = Util.GetHostFromDNS(SimInfo.serverURI.Split(new char[] { '/', ':' })[3]).ToString(); |
149 | response.SimPort = uint.Parse(SimInfo.serverURI.Split(new[] {'/', ':'})[4]); | 146 | response.SimPort = uint.Parse(SimInfo.serverURI.Split(new char[] { '/', ':' })[4]); |
150 | response.RegionX = SimInfo.regionLocX; | 147 | response.RegionX = SimInfo.regionLocX; |
151 | response.RegionY = SimInfo.regionLocY; | 148 | response.RegionY = SimInfo.regionLocY; |
152 | 149 | ||
153 | //Not sure if the + "/CAPS/" should in fact be +"CAPS/" depending if there is already a / as part of httpServerURI | 150 | //Not sure if the + "/CAPS/" should in fact be +"CAPS/" depending if there is already a / as part of httpServerURI |
154 | string capsPath = Util.GetRandomCapsPath(); | 151 | string capsPath = Util.GetRandomCapsPath(); |
155 | response.SeedCapability = SimInfo.httpServerURI + "CAPS/" + capsPath + "0000/"; | 152 | response.SeedCapability = SimInfo.httpServerURI + "CAPS/" + capsPath + "0000/"; |
156 | 153 | ||
157 | m_log.DebugFormat( | 154 | m_log.DebugFormat( |
158 | "[LOGIN]: Sending new CAPS seed url {0} to client {1}", | 155 | "[LOGIN]: Sending new CAPS seed url {0} to client {1}", |
159 | response.SeedCapability, response.AgentID); | 156 | response.SeedCapability, response.AgentID); |
160 | 157 | ||
161 | // Notify the target of an incoming user | 158 | // Notify the target of an incoming user |
162 | //CFK: The "Notifying" message always seems to appear, so subsume the data from this message into | 159 | //CFK: The "Notifying" message always seems to appear, so subsume the data from this message into |
@@ -166,8 +163,7 @@ namespace OpenSim.Grid.UserServer | |||
166 | 163 | ||
167 | theUser.CurrentAgent.Region = SimInfo.UUID; | 164 | theUser.CurrentAgent.Region = SimInfo.UUID; |
168 | theUser.CurrentAgent.Handle = SimInfo.regionHandle; | 165 | theUser.CurrentAgent.Handle = SimInfo.regionHandle; |
169 | if (start_x >= 0 && start_y >= 0 && start_z >= 0) | 166 | if (start_x >= 0 && start_y >= 0 && start_z >= 0) { |
170 | { | ||
171 | LLVector3 tmp_v = new LLVector3(start_x, start_y, start_z); | 167 | LLVector3 tmp_v = new LLVector3(start_x, start_y, start_z); |
172 | theUser.CurrentAgent.Position = tmp_v; | 168 | theUser.CurrentAgent.Position = tmp_v; |
173 | } | 169 | } |
@@ -190,43 +186,42 @@ namespace OpenSim.Grid.UserServer | |||
190 | // Update agent with target sim | 186 | // Update agent with target sim |
191 | 187 | ||
192 | m_log.InfoFormat( | 188 | m_log.InfoFormat( |
193 | "[LOGIN]: Telling region {0} @ {1},{2} ({3}) to expect user connection", | 189 | "[LOGIN]: Telling region {0} @ {1},{2} ({3}) to expect user connection", |
194 | SimInfo.regionName, response.RegionX, response.RegionY, SimInfo.httpServerURI); | 190 | SimInfo.regionName, response.RegionX, response.RegionY, SimInfo.httpServerURI); |
195 | 191 | ||
196 | XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams); | 192 | XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams); |
197 | XmlRpcResponse GridResp = GridReq.Send(SimInfo.httpServerURI, 6000); | 193 | XmlRpcResponse GridResp = GridReq.Send(SimInfo.httpServerURI, 6000); |
198 | 194 | ||
199 | if (GridResp.IsFault) | 195 | if (GridResp.IsFault) |
200 | { | 196 | { |
201 | m_log.ErrorFormat( | 197 | m_log.ErrorFormat( |
202 | "[LOGIN]: XMLRPC request for {0} failed, fault code: {1}, reason: {2}", | 198 | "[LOGIN]: XMLRPC request for {0} failed, fault code: {1}, reason: {2}", |
203 | SimInfo.httpServerURI, GridResp.FaultCode, GridResp.FaultString); | 199 | SimInfo.httpServerURI, GridResp.FaultCode, GridResp.FaultString); |
204 | } | 200 | } |
205 | handlerUserLoggedInAtLocation = OnUserLoggedInAtLocation; | 201 | handlerUserLoggedInAtLocation = OnUserLoggedInAtLocation; |
206 | if (handlerUserLoggedInAtLocation != null) | 202 | if (handlerUserLoggedInAtLocation != null) |
207 | { | 203 | { |
208 | //m_log.Info("[LOGIN]: Letting other objects know about login"); | 204 | //m_log.Info("[LOGIN]: Letting other objects know about login"); |
209 | handlerUserLoggedInAtLocation(theUser.ID, theUser.CurrentAgent.SessionID, theUser.CurrentAgent.Region, | 205 | handlerUserLoggedInAtLocation(theUser.ID, theUser.CurrentAgent.SessionID, theUser.CurrentAgent.Region, |
210 | theUser.CurrentAgent.Handle, theUser.CurrentAgent.Position.X, theUser.CurrentAgent.Position.Y, | 206 | theUser.CurrentAgent.Handle, theUser.CurrentAgent.Position.X,theUser.CurrentAgent.Position.Y,theUser.CurrentAgent.Position.Z, |
211 | theUser.CurrentAgent.Position.Z, | 207 | theUser.FirstName,theUser.SurName); |
212 | theUser.FirstName, theUser.SurName); | ||
213 | } | 208 | } |
214 | } | 209 | } |
215 | catch (Exception) | 210 | catch (Exception) |
216 | //catch (System.AccessViolationException) | 211 | //catch (System.AccessViolationException) |
217 | { | 212 | { |
218 | tryDefault = true; | 213 | tryDefault = true; |
219 | } | 214 | } |
220 | 215 | ||
221 | if (tryDefault) | 216 | if (tryDefault) |
222 | { | 217 | { |
223 | // Send him to default region instead | 218 | // Send him to default region instead |
224 | // Load information from the gridserver | 219 | // Load information from the gridserver |
225 | 220 | ||
226 | ulong defaultHandle = (((ulong) m_config.DefaultX * Constants.RegionSize) << 32) | ((ulong) m_config.DefaultY * Constants.RegionSize); | 221 | ulong defaultHandle = (((ulong)m_config.DefaultX * Constants.RegionSize) << 32) | ((ulong)m_config.DefaultY * Constants.RegionSize); |
227 | 222 | ||
228 | m_log.Warn( | 223 | m_log.Warn( |
229 | "[LOGIN]: Home region not available: sending to default " + defaultHandle); | 224 | "[LOGIN]: Home region not available: sending to default " + defaultHandle.ToString()); |
230 | 225 | ||
231 | try | 226 | try |
232 | { | 227 | { |
@@ -236,19 +231,19 @@ namespace OpenSim.Grid.UserServer | |||
236 | 231 | ||
237 | // Customise the response | 232 | // Customise the response |
238 | m_log.Info("[LOGIN]: Home Location"); | 233 | m_log.Info("[LOGIN]: Home Location"); |
239 | response.Home = "{'region_handle':[r" + (SimInfo.regionLocX * Constants.RegionSize) + ",r" + | 234 | response.Home = "{'region_handle':[r" + (SimInfo.regionLocX * Constants.RegionSize).ToString() + ",r" + |
240 | (SimInfo.regionLocY * Constants.RegionSize) + "], " + | 235 | (SimInfo.regionLocY * Constants.RegionSize).ToString() + "], " + |
241 | "'position':[r" + theUser.HomeLocation.X + ",r" + | 236 | "'position':[r" + theUser.HomeLocation.X.ToString() + ",r" + |
242 | theUser.HomeLocation.Y + ",r" + theUser.HomeLocation.Z + "], " + | 237 | theUser.HomeLocation.Y.ToString() + ",r" + theUser.HomeLocation.Z.ToString() + "], " + |
243 | "'look_at':[r" + theUser.HomeLocation.X + ",r" + | 238 | "'look_at':[r" + theUser.HomeLocation.X.ToString() + ",r" + |
244 | theUser.HomeLocation.Y + ",r" + theUser.HomeLocation.Z + "]}"; | 239 | theUser.HomeLocation.Y.ToString() + ",r" + theUser.HomeLocation.Z.ToString() + "]}"; |
245 | 240 | ||
246 | // Destination | 241 | // Destination |
247 | m_log.Info("[LOGIN]: " + | 242 | m_log.Info("[LOGIN]: " + |
248 | "CUSTOMISERESPONSE: Region X: " + SimInfo.regionLocX + "; Region Y: " + | 243 | "CUSTOMISERESPONSE: Region X: " + SimInfo.regionLocX + "; Region Y: " + |
249 | SimInfo.regionLocY); | 244 | SimInfo.regionLocY); |
250 | response.SimAddress = Util.GetHostFromDNS(SimInfo.serverURI.Split(new[] {'/', ':'})[3]).ToString(); | 245 | response.SimAddress = Util.GetHostFromDNS(SimInfo.serverURI.Split(new char[] { '/', ':' })[3]).ToString(); |
251 | response.SimPort = uint.Parse(SimInfo.serverURI.Split(new[] {'/', ':'})[4]); | 246 | response.SimPort = uint.Parse(SimInfo.serverURI.Split(new char[] { '/', ':' })[4]); |
252 | response.RegionX = SimInfo.regionLocX; | 247 | response.RegionX = SimInfo.regionLocX; |
253 | response.RegionY = SimInfo.regionLocY; | 248 | response.RegionY = SimInfo.regionLocY; |
254 | 249 | ||
@@ -288,16 +283,15 @@ namespace OpenSim.Grid.UserServer | |||
288 | { | 283 | { |
289 | m_log.Info("[LOGIN]: Letting other objects know about login"); | 284 | m_log.Info("[LOGIN]: Letting other objects know about login"); |
290 | handlerUserLoggedInAtLocation(theUser.ID, theUser.CurrentAgent.SessionID, theUser.CurrentAgent.Region, | 285 | handlerUserLoggedInAtLocation(theUser.ID, theUser.CurrentAgent.SessionID, theUser.CurrentAgent.Region, |
291 | theUser.CurrentAgent.Handle, theUser.CurrentAgent.Position.X, theUser.CurrentAgent.Position.Y, | 286 | theUser.CurrentAgent.Handle, theUser.CurrentAgent.Position.X, theUser.CurrentAgent.Position.Y, theUser.CurrentAgent.Position.Z, |
292 | theUser.CurrentAgent.Position.Z, | 287 | theUser.FirstName, theUser.SurName); |
293 | theUser.FirstName, theUser.SurName); | ||
294 | } | 288 | } |
295 | } | 289 | } |
296 | 290 | ||
297 | catch (Exception e) | 291 | catch (Exception e) |
298 | { | 292 | { |
299 | m_log.Warn("[LOGIN]: Default region also not available"); | 293 | m_log.Warn("[LOGIN]: Default region also not available"); |
300 | m_log.Warn("[LOGIN]: " + e); | 294 | m_log.Warn("[LOGIN]: " + e.ToString()); |
301 | } | 295 | } |
302 | } | 296 | } |
303 | } | 297 | } |
@@ -306,8 +300,8 @@ namespace OpenSim.Grid.UserServer | |||
306 | protected override InventoryData GetInventorySkeleton(LLUUID userID) | 300 | protected override InventoryData GetInventorySkeleton(LLUUID userID) |
307 | { | 301 | { |
308 | m_log.DebugFormat( | 302 | m_log.DebugFormat( |
309 | "[LOGIN]: Contacting inventory service at {0} for inventory skeleton of user {1}", | 303 | "[LOGIN]: Contacting inventory service at {0} for inventory skeleton of user {1}", |
310 | m_config.InventoryUrl, userID); | 304 | m_config.InventoryUrl, userID); |
311 | 305 | ||
312 | List<InventoryFolderBase> folders | 306 | List<InventoryFolderBase> folders |
313 | = SynchronousRestObjectPoster.BeginPostObject<Guid, List<InventoryFolderBase>>( | 307 | = SynchronousRestObjectPoster.BeginPostObject<Guid, List<InventoryFolderBase>>( |
@@ -322,23 +316,23 @@ namespace OpenSim.Grid.UserServer | |||
322 | // tools are creating the user profile directly in the database without creating the inventory. At | 316 | // tools are creating the user profile directly in the database without creating the inventory. At |
323 | // this time we'll accomodate them by lazily creating the user inventory now if it doesn't already | 317 | // this time we'll accomodate them by lazily creating the user inventory now if it doesn't already |
324 | // exist. | 318 | // exist. |
325 | bool created = | 319 | bool created = |
326 | SynchronousRestObjectPoster.BeginPostObject<Guid, bool>( | 320 | SynchronousRestObjectPoster.BeginPostObject<Guid, bool>( |
327 | "POST", m_config.InventoryUrl + "CreateInventory/", userID.UUID); | 321 | "POST", m_config.InventoryUrl + "CreateInventory/", userID.UUID); |
328 | 322 | ||
329 | if (!created) | 323 | if (!created) |
330 | { | 324 | { |
331 | throw new Exception( | 325 | throw new Exception( |
332 | String.Format( | 326 | String.Format( |
333 | "The inventory creation request for user {0} did not succeed." | 327 | "The inventory creation request for user {0} did not succeed." |
334 | + " Please contact your inventory service provider for more information.", | 328 | + " Please contact your inventory service provider for more information.", |
335 | userID)); | 329 | userID)); |
336 | } | 330 | } |
337 | else | 331 | else |
338 | { | 332 | { |
339 | m_log.InfoFormat("[LOGIN]: A new inventory skeleton was successfully created for user {0}", userID); | 333 | m_log.InfoFormat("[LOGIN]: A new inventory skeleton was successfully created for user {0}", userID); |
340 | } | 334 | } |
341 | 335 | ||
342 | folders = SynchronousRestObjectPoster.BeginPostObject<Guid, List<InventoryFolderBase>>( | 336 | folders = SynchronousRestObjectPoster.BeginPostObject<Guid, List<InventoryFolderBase>>( |
343 | "POST", m_config.InventoryUrl + "RootFolders/", userID.UUID); | 337 | "POST", m_config.InventoryUrl + "RootFolders/", userID.UUID); |
344 | } | 338 | } |
@@ -348,11 +342,11 @@ namespace OpenSim.Grid.UserServer | |||
348 | LLUUID rootID = LLUUID.Zero; | 342 | LLUUID rootID = LLUUID.Zero; |
349 | ArrayList AgentInventoryArray = new ArrayList(); | 343 | ArrayList AgentInventoryArray = new ArrayList(); |
350 | Hashtable TempHash; | 344 | Hashtable TempHash; |
351 | 345 | ||
352 | foreach (InventoryFolderBase InvFolder in folders) | 346 | foreach (InventoryFolderBase InvFolder in folders) |
353 | { | 347 | { |
354 | // m_log.DebugFormat("[LOGIN]: Received agent inventory folder {0}", InvFolder.name); | 348 | // m_log.DebugFormat("[LOGIN]: Received agent inventory folder {0}", InvFolder.name); |
355 | 349 | ||
356 | if (InvFolder.ParentID == LLUUID.Zero) | 350 | if (InvFolder.ParentID == LLUUID.Zero) |
357 | { | 351 | { |
358 | rootID = InvFolder.ID; | 352 | rootID = InvFolder.ID; |
@@ -365,16 +359,16 @@ namespace OpenSim.Grid.UserServer | |||
365 | TempHash["folder_id"] = InvFolder.ID.ToString(); | 359 | TempHash["folder_id"] = InvFolder.ID.ToString(); |
366 | AgentInventoryArray.Add(TempHash); | 360 | AgentInventoryArray.Add(TempHash); |
367 | } | 361 | } |
368 | 362 | ||
369 | return new InventoryData(AgentInventoryArray, rootID); | 363 | return new InventoryData(AgentInventoryArray, rootID); |
370 | } | 364 | } |
371 | else | 365 | else |
372 | { | 366 | { |
373 | throw new Exception( | 367 | throw new Exception( |
374 | String.Format( | 368 | String.Format( |
375 | "A root inventory folder for user {0} could not be retrieved from the inventory service", | 369 | "A root inventory folder for user {0} could not be retrieved from the inventory service", |
376 | userID)); | 370 | userID)); |
377 | } | 371 | } |
378 | } | 372 | } |
379 | } | 373 | } |
380 | } \ No newline at end of file | 374 | } |
diff --git a/OpenSim/Grid/UserServer/UserManager.cs b/OpenSim/Grid/UserServer/UserManager.cs index 0122ad0..5d0e1d6 100644 --- a/OpenSim/Grid/UserServer/UserManager.cs +++ b/OpenSim/Grid/UserServer/UserManager.cs | |||
@@ -41,11 +41,11 @@ namespace OpenSim.Grid.UserServer | |||
41 | public delegate void logOffUser(LLUUID AgentID); | 41 | public delegate void logOffUser(LLUUID AgentID); |
42 | 42 | ||
43 | public class UserManager : UserManagerBase | 43 | public class UserManager : UserManagerBase |
44 | { | 44 | { |
45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
46 | 46 | ||
47 | private logOffUser handlerLogOffUser; | ||
48 | public event logOffUser OnLogOffUser; | 47 | public event logOffUser OnLogOffUser; |
48 | private logOffUser handlerLogOffUser = null; | ||
49 | 49 | ||
50 | /// <summary> | 50 | /// <summary> |
51 | /// Deletes an active agent session | 51 | /// Deletes an active agent session |
@@ -81,17 +81,17 @@ namespace OpenSim.Grid.UserServer | |||
81 | XmlRpcResponse response = new XmlRpcResponse(); | 81 | XmlRpcResponse response = new XmlRpcResponse(); |
82 | Hashtable responseData = new Hashtable(); | 82 | Hashtable responseData = new Hashtable(); |
83 | // Query Result Information | 83 | // Query Result Information |
84 | responseData["queryid"] = queryID.ToString(); | 84 | responseData["queryid"] = (string) queryID.ToString(); |
85 | responseData["avcount"] = returnUsers.Count.ToString(); | 85 | responseData["avcount"] = (string) returnUsers.Count.ToString(); |
86 | 86 | ||
87 | for (int i = 0; i < returnUsers.Count; i++) | 87 | for (int i = 0; i < returnUsers.Count; i++) |
88 | { | 88 | { |
89 | responseData["avatarid" + i] = returnUsers[i].AvatarID.ToString(); | 89 | responseData["avatarid" + i.ToString()] = returnUsers[i].AvatarID.ToString(); |
90 | responseData["firstname" + i] = returnUsers[i].firstName; | 90 | responseData["firstname" + i.ToString()] = returnUsers[i].firstName; |
91 | responseData["lastname" + i] = returnUsers[i].lastName; | 91 | responseData["lastname" + i.ToString()] = returnUsers[i].lastName; |
92 | } | 92 | } |
93 | response.Value = responseData; | 93 | response.Value = responseData; |
94 | 94 | ||
95 | return response; | 95 | return response; |
96 | } | 96 | } |
97 | 97 | ||
@@ -101,14 +101,14 @@ namespace OpenSim.Grid.UserServer | |||
101 | Hashtable responseData = new Hashtable(); | 101 | Hashtable responseData = new Hashtable(); |
102 | // Query Result Information | 102 | // Query Result Information |
103 | 103 | ||
104 | responseData["avcount"] = returnUsers.Count.ToString(); | 104 | responseData["avcount"] = (string)returnUsers.Count.ToString(); |
105 | 105 | ||
106 | for (int i = 0; i < returnUsers.Count; i++) | 106 | for (int i = 0; i < returnUsers.Count; i++) |
107 | { | 107 | { |
108 | responseData["ownerID" + i] = returnUsers[i].FriendListOwner.UUID.ToString(); | 108 | responseData["ownerID" + i.ToString()] = returnUsers[i].FriendListOwner.UUID.ToString(); |
109 | responseData["friendID" + i] = returnUsers[i].Friend.UUID.ToString(); | 109 | responseData["friendID" + i.ToString()] = returnUsers[i].Friend.UUID.ToString(); |
110 | responseData["ownerPerms" + i] = returnUsers[i].FriendListOwnerPerms.ToString(); | 110 | responseData["ownerPerms" + i.ToString()] = returnUsers[i].FriendListOwnerPerms.ToString(); |
111 | responseData["friendPerms" + i] = returnUsers[i].FriendPerms.ToString(); | 111 | responseData["friendPerms" + i.ToString()] = returnUsers[i].FriendPerms.ToString(); |
112 | } | 112 | } |
113 | response.Value = responseData; | 113 | response.Value = responseData; |
114 | 114 | ||
@@ -156,21 +156,6 @@ namespace OpenSim.Grid.UserServer | |||
156 | return response; | 156 | return response; |
157 | } | 157 | } |
158 | 158 | ||
159 | public override UserProfileData SetupMasterUser(string firstName, string lastName) | ||
160 | { | ||
161 | throw new Exception("The method or operation is not implemented."); | ||
162 | } | ||
163 | |||
164 | public override UserProfileData SetupMasterUser(string firstName, string lastName, string password) | ||
165 | { | ||
166 | throw new Exception("The method or operation is not implemented."); | ||
167 | } | ||
168 | |||
169 | public override UserProfileData SetupMasterUser(LLUUID uuid) | ||
170 | { | ||
171 | throw new Exception("The method or operation is not implemented."); | ||
172 | } | ||
173 | |||
174 | #region XMLRPC User Methods | 159 | #region XMLRPC User Methods |
175 | 160 | ||
176 | public XmlRpcResponse XmlRPCGetAvatarPickerAvatar(XmlRpcRequest request) | 161 | public XmlRpcResponse XmlRPCGetAvatarPickerAvatar(XmlRpcRequest request) |
@@ -193,16 +178,15 @@ namespace OpenSim.Grid.UserServer | |||
193 | public XmlRpcResponse XmlRpcResponseXmlRPCAddUserFriend(XmlRpcRequest request) | 178 | public XmlRpcResponse XmlRpcResponseXmlRPCAddUserFriend(XmlRpcRequest request) |
194 | { | 179 | { |
195 | XmlRpcResponse response = new XmlRpcResponse(); | 180 | XmlRpcResponse response = new XmlRpcResponse(); |
196 | Hashtable requestData = (Hashtable) request.Params[0]; | 181 | Hashtable requestData = (Hashtable)request.Params[0]; |
197 | Hashtable responseData = new Hashtable(); | 182 | Hashtable responseData = new Hashtable(); |
198 | string returnString = "FALSE"; | 183 | string returnString = "FALSE"; |
199 | // Query Result Information | 184 | // Query Result Information |
200 | 185 | ||
201 | if (requestData.Contains("ownerID") && requestData.Contains("friendID") && requestData.Contains("friendPerms")) | 186 | if (requestData.Contains("ownerID") && requestData.Contains("friendID") && requestData.Contains("friendPerms")) |
202 | { | 187 | { |
203 | // UserManagerBase.AddNewuserFriend | 188 | // UserManagerBase.AddNewuserFriend |
204 | AddNewUserFriend(new LLUUID((string) requestData["ownerID"]), new LLUUID((string) requestData["friendID"]), | 189 | AddNewUserFriend(new LLUUID((string)requestData["ownerID"]), new LLUUID((string)requestData["friendID"]), (uint)Convert.ToInt32((string)requestData["friendPerms"])); |
205 | (uint) Convert.ToInt32((string) requestData["friendPerms"])); | ||
206 | returnString = "TRUE"; | 190 | returnString = "TRUE"; |
207 | } | 191 | } |
208 | responseData["returnString"] = returnString; | 192 | responseData["returnString"] = returnString; |
@@ -213,15 +197,15 @@ namespace OpenSim.Grid.UserServer | |||
213 | public XmlRpcResponse XmlRpcResponseXmlRPCRemoveUserFriend(XmlRpcRequest request) | 197 | public XmlRpcResponse XmlRpcResponseXmlRPCRemoveUserFriend(XmlRpcRequest request) |
214 | { | 198 | { |
215 | XmlRpcResponse response = new XmlRpcResponse(); | 199 | XmlRpcResponse response = new XmlRpcResponse(); |
216 | Hashtable requestData = (Hashtable) request.Params[0]; | 200 | Hashtable requestData = (Hashtable)request.Params[0]; |
217 | Hashtable responseData = new Hashtable(); | 201 | Hashtable responseData = new Hashtable(); |
218 | string returnString = "FALSE"; | 202 | string returnString = "FALSE"; |
219 | // Query Result Information | 203 | // Query Result Information |
220 | 204 | ||
221 | if (requestData.Contains("ownerID") && requestData.Contains("friendID")) | 205 | if (requestData.Contains("ownerID") && requestData.Contains("friendID")) |
222 | { | 206 | { |
223 | // UserManagerBase.AddNewuserFriend | 207 | // UserManagerBase.AddNewuserFriend |
224 | RemoveUserFriend(new LLUUID((string) requestData["ownerID"]), new LLUUID((string) requestData["friendID"])); | 208 | RemoveUserFriend(new LLUUID((string)requestData["ownerID"]), new LLUUID((string)requestData["friendID"])); |
225 | returnString = "TRUE"; | 209 | returnString = "TRUE"; |
226 | } | 210 | } |
227 | responseData["returnString"] = returnString; | 211 | responseData["returnString"] = returnString; |
@@ -232,14 +216,13 @@ namespace OpenSim.Grid.UserServer | |||
232 | public XmlRpcResponse XmlRpcResponseXmlRPCUpdateUserFriendPerms(XmlRpcRequest request) | 216 | public XmlRpcResponse XmlRpcResponseXmlRPCUpdateUserFriendPerms(XmlRpcRequest request) |
233 | { | 217 | { |
234 | XmlRpcResponse response = new XmlRpcResponse(); | 218 | XmlRpcResponse response = new XmlRpcResponse(); |
235 | Hashtable requestData = (Hashtable) request.Params[0]; | 219 | Hashtable requestData = (Hashtable)request.Params[0]; |
236 | Hashtable responseData = new Hashtable(); | 220 | Hashtable responseData = new Hashtable(); |
237 | string returnString = "FALSE"; | 221 | string returnString = "FALSE"; |
238 | 222 | ||
239 | if (requestData.Contains("ownerID") && requestData.Contains("friendID") && requestData.Contains("friendPerms")) | 223 | if (requestData.Contains("ownerID") && requestData.Contains("friendID") && requestData.Contains("friendPerms")) |
240 | { | 224 | { |
241 | UpdateUserFriendPerms(new LLUUID((string) requestData["ownerID"]), new LLUUID((string) requestData["friendID"]), | 225 | UpdateUserFriendPerms(new LLUUID((string)requestData["ownerID"]), new LLUUID((string)requestData["friendID"]), (uint)Convert.ToInt32((string)requestData["friendPerms"])); |
242 | (uint) Convert.ToInt32((string) requestData["friendPerms"])); | ||
243 | // UserManagerBase. | 226 | // UserManagerBase. |
244 | returnString = "TRUE"; | 227 | returnString = "TRUE"; |
245 | } | 228 | } |
@@ -251,16 +234,16 @@ namespace OpenSim.Grid.UserServer | |||
251 | public XmlRpcResponse XmlRpcResponseXmlRPCGetUserFriendList(XmlRpcRequest request) | 234 | public XmlRpcResponse XmlRpcResponseXmlRPCGetUserFriendList(XmlRpcRequest request) |
252 | { | 235 | { |
253 | XmlRpcResponse response = new XmlRpcResponse(); | 236 | XmlRpcResponse response = new XmlRpcResponse(); |
254 | Hashtable requestData = (Hashtable) request.Params[0]; | 237 | Hashtable requestData = (Hashtable)request.Params[0]; |
255 | Hashtable responseData = new Hashtable(); | 238 | Hashtable responseData = new Hashtable(); |
256 | 239 | ||
257 | List<FriendListItem> returndata = new List<FriendListItem>(); | 240 | List<FriendListItem> returndata = new List<FriendListItem>(); |
258 | 241 | ||
259 | if (requestData.Contains("ownerID")) | 242 | if (requestData.Contains("ownerID")) |
260 | { | 243 | { |
261 | returndata = GetUserFriendList(new LLUUID((string) requestData["ownerID"])); | 244 | returndata = this.GetUserFriendList(new LLUUID((string)requestData["ownerID"])); |
262 | } | 245 | } |
263 | 246 | ||
264 | return FriendListItemListtoXmlRPCResponse(returndata); | 247 | return FriendListItemListtoXmlRPCResponse(returndata); |
265 | } | 248 | } |
266 | 249 | ||
@@ -338,7 +321,7 @@ namespace OpenSim.Grid.UserServer | |||
338 | { | 321 | { |
339 | m_log.Debug("[UserManager]: Got request to update user profile"); | 322 | m_log.Debug("[UserManager]: Got request to update user profile"); |
340 | XmlRpcResponse response = new XmlRpcResponse(); | 323 | XmlRpcResponse response = new XmlRpcResponse(); |
341 | Hashtable requestData = (Hashtable) request.Params[0]; | 324 | Hashtable requestData = (Hashtable)request.Params[0]; |
342 | Hashtable responseData = new Hashtable(); | 325 | Hashtable responseData = new Hashtable(); |
343 | 326 | ||
344 | UserProfileData userProfile; | 327 | UserProfileData userProfile; |
@@ -347,7 +330,7 @@ namespace OpenSim.Grid.UserServer | |||
347 | return CreateUnknownUserErrorResponse(); | 330 | return CreateUnknownUserErrorResponse(); |
348 | } | 331 | } |
349 | 332 | ||
350 | LLUUID UserUUID = new LLUUID((string) requestData["avatar_uuid"]); | 333 | LLUUID UserUUID = new LLUUID((string)requestData["avatar_uuid"]); |
351 | userProfile = GetUserProfile(UserUUID); | 334 | userProfile = GetUserProfile(UserUUID); |
352 | if (null == userProfile) | 335 | if (null == userProfile) |
353 | { | 336 | { |
@@ -359,33 +342,33 @@ namespace OpenSim.Grid.UserServer | |||
359 | } | 342 | } |
360 | if (requestData.Contains("FLImageID")) | 343 | if (requestData.Contains("FLImageID")) |
361 | { | 344 | { |
362 | userProfile.FirstLifeImage = new LLUUID((string) requestData["FLImageID"]); | 345 | userProfile.FirstLifeImage = new LLUUID((string)requestData["FLImageID"]); |
363 | } | 346 | } |
364 | if (requestData.Contains("ImageID")) | 347 | if (requestData.Contains("ImageID")) |
365 | { | 348 | { |
366 | userProfile.Image = new LLUUID((string) requestData["ImageID"]); | 349 | userProfile.Image = new LLUUID((string)requestData["ImageID"]); |
367 | } | 350 | } |
368 | // dont' know how yet | 351 | // dont' know how yet |
369 | if (requestData.Contains("MaturePublish")) | 352 | if (requestData.Contains("MaturePublish")) |
370 | { | 353 | { |
371 | } | 354 | } |
372 | if (requestData.Contains("AboutText")) | 355 | if (requestData.Contains("AboutText")) |
373 | { | 356 | { |
374 | userProfile.AboutText = (string) requestData["AboutText"]; | 357 | userProfile.AboutText = (string)requestData["AboutText"]; |
375 | } | 358 | } |
376 | if (requestData.Contains("FLAboutText")) | 359 | if (requestData.Contains("FLAboutText")) |
377 | { | 360 | { |
378 | userProfile.FirstLifeAboutText = (string) requestData["FLAboutText"]; | 361 | userProfile.FirstLifeAboutText = (string)requestData["FLAboutText"]; |
379 | } | 362 | } |
380 | // not in DB yet. | 363 | // not in DB yet. |
381 | if (requestData.Contains("ProfileURL")) | 364 | if (requestData.Contains("ProfileURL")) |
382 | { | 365 | { |
383 | } | 366 | } |
384 | if (requestData.Contains("home_region")) | 367 | if (requestData.Contains("home_region")) |
385 | { | 368 | { |
386 | try | 369 | try |
387 | { | 370 | { |
388 | userProfile.HomeRegion = Convert.ToUInt64((string) requestData["home_region"]); | 371 | userProfile.HomeRegion = Convert.ToUInt64((string)requestData["home_region"]); |
389 | } | 372 | } |
390 | catch (ArgumentException) | 373 | catch (ArgumentException) |
391 | { | 374 | { |
@@ -399,23 +382,25 @@ namespace OpenSim.Grid.UserServer | |||
399 | { | 382 | { |
400 | m_log.Error("[PROFILE]:Failed to set home region, Value was too large"); | 383 | m_log.Error("[PROFILE]:Failed to set home region, Value was too large"); |
401 | } | 384 | } |
385 | |||
402 | } | 386 | } |
403 | if (requestData.Contains("home_pos_x")) | 387 | if (requestData.Contains("home_pos_x")) |
404 | { | 388 | { |
405 | try | 389 | try |
406 | { | 390 | { |
407 | userProfile.HomeLocationX = (float) Convert.ToDecimal((string) requestData["home_pos_x"]); | 391 | userProfile.HomeLocationX = (float)Convert.ToDecimal((string)requestData["home_pos_x"]); |
408 | } | 392 | } |
409 | catch (InvalidCastException) | 393 | catch (InvalidCastException) |
410 | { | 394 | { |
411 | m_log.Error("[PROFILE]:Failed to set home postion x"); | 395 | m_log.Error("[PROFILE]:Failed to set home postion x"); |
412 | } | 396 | } |
397 | |||
413 | } | 398 | } |
414 | if (requestData.Contains("home_pos_y")) | 399 | if (requestData.Contains("home_pos_y")) |
415 | { | 400 | { |
416 | try | 401 | try |
417 | { | 402 | { |
418 | userProfile.HomeLocationY = (float) Convert.ToDecimal((string) requestData["home_pos_y"]); | 403 | userProfile.HomeLocationY = (float)Convert.ToDecimal((string)requestData["home_pos_y"]); |
419 | } | 404 | } |
420 | catch (InvalidCastException) | 405 | catch (InvalidCastException) |
421 | { | 406 | { |
@@ -426,7 +411,7 @@ namespace OpenSim.Grid.UserServer | |||
426 | { | 411 | { |
427 | try | 412 | try |
428 | { | 413 | { |
429 | userProfile.HomeLocationZ = (float) Convert.ToDecimal((string) requestData["home_pos_z"]); | 414 | userProfile.HomeLocationZ = (float)Convert.ToDecimal((string)requestData["home_pos_z"]); |
430 | } | 415 | } |
431 | catch (InvalidCastException) | 416 | catch (InvalidCastException) |
432 | { | 417 | { |
@@ -437,7 +422,7 @@ namespace OpenSim.Grid.UserServer | |||
437 | { | 422 | { |
438 | try | 423 | try |
439 | { | 424 | { |
440 | userProfile.HomeLookAtX = (float) Convert.ToDecimal((string) requestData["home_look_x"]); | 425 | userProfile.HomeLookAtX = (float)Convert.ToDecimal((string)requestData["home_look_x"]); |
441 | } | 426 | } |
442 | catch (InvalidCastException) | 427 | catch (InvalidCastException) |
443 | { | 428 | { |
@@ -448,7 +433,7 @@ namespace OpenSim.Grid.UserServer | |||
448 | { | 433 | { |
449 | try | 434 | try |
450 | { | 435 | { |
451 | userProfile.HomeLookAtY = (float) Convert.ToDecimal((string) requestData["home_look_y"]); | 436 | userProfile.HomeLookAtY = (float)Convert.ToDecimal((string)requestData["home_look_y"]); |
452 | } | 437 | } |
453 | catch (InvalidCastException) | 438 | catch (InvalidCastException) |
454 | { | 439 | { |
@@ -457,9 +442,9 @@ namespace OpenSim.Grid.UserServer | |||
457 | } | 442 | } |
458 | if (requestData.Contains("home_look_z")) | 443 | if (requestData.Contains("home_look_z")) |
459 | { | 444 | { |
460 | try | 445 | try |
461 | { | 446 | { |
462 | userProfile.HomeLookAtZ = (float) Convert.ToDecimal((string) requestData["home_look_z"]); | 447 | userProfile.HomeLookAtZ = (float)Convert.ToDecimal((string)requestData["home_look_z"]); |
463 | } | 448 | } |
464 | catch (InvalidCastException) | 449 | catch (InvalidCastException) |
465 | { | 450 | { |
@@ -476,18 +461,18 @@ namespace OpenSim.Grid.UserServer | |||
476 | public XmlRpcResponse XmlRPCLogOffUserMethodUUID(XmlRpcRequest request) | 461 | public XmlRpcResponse XmlRPCLogOffUserMethodUUID(XmlRpcRequest request) |
477 | { | 462 | { |
478 | XmlRpcResponse response = new XmlRpcResponse(); | 463 | XmlRpcResponse response = new XmlRpcResponse(); |
479 | Hashtable requestData = (Hashtable) request.Params[0]; | 464 | Hashtable requestData = (Hashtable)request.Params[0]; |
480 | 465 | ||
481 | if (requestData.Contains("avatar_uuid")) | 466 | if (requestData.Contains("avatar_uuid")) |
482 | { | 467 | { |
483 | try | 468 | try |
484 | { | 469 | { |
485 | LLUUID userUUID = new LLUUID((string) requestData["avatar_uuid"]); | 470 | LLUUID userUUID = new LLUUID((string)requestData["avatar_uuid"]); |
486 | LLUUID RegionID = new LLUUID((string) requestData["region_uuid"]); | 471 | LLUUID RegionID = new LLUUID((string)requestData["region_uuid"]); |
487 | ulong regionhandle = (ulong) Convert.ToInt64((string) requestData["region_handle"]); | 472 | ulong regionhandle = (ulong)Convert.ToInt64((string)requestData["region_handle"]); |
488 | float posx = (float) Convert.ToDecimal((string) requestData["region_pos_x"]); | 473 | float posx = (float)Convert.ToDecimal((string)requestData["region_pos_x"]); |
489 | float posy = (float) Convert.ToDecimal((string) requestData["region_pos_y"]); | 474 | float posy = (float)Convert.ToDecimal((string)requestData["region_pos_y"]); |
490 | float posz = (float) Convert.ToDecimal((string) requestData["region_pos_z"]); | 475 | float posz = (float)Convert.ToDecimal((string)requestData["region_pos_z"]); |
491 | 476 | ||
492 | handlerLogOffUser = OnLogOffUser; | 477 | handlerLogOffUser = OnLogOffUser; |
493 | if (handlerLogOffUser != null) | 478 | if (handlerLogOffUser != null) |
@@ -510,5 +495,20 @@ namespace OpenSim.Grid.UserServer | |||
510 | } | 495 | } |
511 | 496 | ||
512 | #endregion | 497 | #endregion |
498 | |||
499 | public override UserProfileData SetupMasterUser(string firstName, string lastName) | ||
500 | { | ||
501 | throw new Exception("The method or operation is not implemented."); | ||
502 | } | ||
503 | |||
504 | public override UserProfileData SetupMasterUser(string firstName, string lastName, string password) | ||
505 | { | ||
506 | throw new Exception("The method or operation is not implemented."); | ||
507 | } | ||
508 | |||
509 | public override UserProfileData SetupMasterUser(LLUUID uuid) | ||
510 | { | ||
511 | throw new Exception("The method or operation is not implemented."); | ||
512 | } | ||
513 | } | 513 | } |
514 | } \ No newline at end of file | 514 | } |