aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Communications/OGS1
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Communications/OGS1')
-rw-r--r--OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs8
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1GridServices.cs104
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs18
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs17
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1UserServices.cs63
-rw-r--r--OpenSim/Region/Communications/OGS1/Properties/AssemblyInfo.cs31
6 files changed, 130 insertions, 111 deletions
diff --git a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs
index 1807cc7..941cc30 100644
--- a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs
+++ b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs
@@ -26,17 +26,17 @@
26* 26*
27*/ 27*/
28 28
29using OpenSim.Framework;
29using OpenSim.Framework.Communications; 30using OpenSim.Framework.Communications;
30using OpenSim.Framework.Communications.Cache; 31using OpenSim.Framework.Communications.Cache;
31using OpenSim.Framework;
32using OpenSim.Framework.Servers; 32using OpenSim.Framework.Servers;
33 33
34
35namespace OpenSim.Region.Communications.OGS1 34namespace OpenSim.Region.Communications.OGS1
36{ 35{
37 public class CommunicationsOGS1 : CommunicationsManager 36 public class CommunicationsOGS1 : CommunicationsManager
38 { 37 {
39 public CommunicationsOGS1(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache ) :base(serversInfo, httpServer, assetCache, false) 38 public CommunicationsOGS1(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache)
39 : base(serversInfo, httpServer, assetCache, false)
40 { 40 {
41 OGS1GridServices gridInterComms = new OGS1GridServices(serversInfo, httpServer); 41 OGS1GridServices gridInterComms = new OGS1GridServices(serversInfo, httpServer);
42 m_gridService = gridInterComms; 42 m_gridService = gridInterComms;
@@ -46,4 +46,4 @@ namespace OpenSim.Region.Communications.OGS1
46 m_userService = new OGS1UserServices(this); 46 m_userService = new OGS1UserServices(this);
47 } 47 }
48 } 48 }
49} 49} \ No newline at end of file
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
index 3719c97..d9af95b 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
@@ -35,14 +35,12 @@ using System.Runtime.Remoting;
35using System.Runtime.Remoting.Channels; 35using System.Runtime.Remoting.Channels;
36using System.Runtime.Remoting.Channels.Tcp; 36using System.Runtime.Remoting.Channels.Tcp;
37using System.Security.Authentication; 37using System.Security.Authentication;
38
39using libsecondlife; 38using libsecondlife;
40using Nwc.XmlRpc; 39using Nwc.XmlRpc;
41using OpenSim.Framework; 40using OpenSim.Framework;
42using OpenSim.Framework.Communications; 41using OpenSim.Framework.Communications;
43using OpenSim.Framework.Console; 42using OpenSim.Framework.Console;
44using OpenSim.Framework.Servers; 43using OpenSim.Framework.Servers;
45using OpenSim.Framework;
46using OpenSim.Region.Communications.Local; 44using OpenSim.Region.Communications.Local;
47 45
48namespace OpenSim.Region.Communications.OGS1 46namespace OpenSim.Region.Communications.OGS1
@@ -65,10 +63,10 @@ namespace OpenSim.Region.Communications.OGS1
65 { 63 {
66 serversInfo = servers_info; 64 serversInfo = servers_info;
67 httpServer = httpServe; 65 httpServer = httpServe;
68 httpServer.AddXmlRPCHandler("expect_user", this.ExpectUser); 66 httpServer.AddXmlRPCHandler("expect_user", ExpectUser);
69 httpServer.AddXmlRPCHandler("check", this.PingCheckReply); 67 httpServer.AddXmlRPCHandler("check", PingCheckReply);
70 68
71 this.StartRemoting(); 69 StartRemoting();
72 } 70 }
73 71
74 /// <summary> 72 /// <summary>
@@ -99,14 +97,14 @@ namespace OpenSim.Region.Communications.OGS1
99 // Send Request 97 // Send Request
100 XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams); 98 XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams);
101 XmlRpcResponse GridResp = GridReq.Send(serversInfo.GridURL, 10000); 99 XmlRpcResponse GridResp = GridReq.Send(serversInfo.GridURL, 10000);
102 Hashtable GridRespData = (Hashtable)GridResp.Value; 100 Hashtable GridRespData = (Hashtable) GridResp.Value;
103 101
104 Hashtable griddatahash = GridRespData; 102 Hashtable griddatahash = GridRespData;
105 103
106 // Process Response 104 // Process Response
107 if (GridRespData.ContainsKey("error")) 105 if (GridRespData.ContainsKey("error"))
108 { 106 {
109 string errorstring = (string)GridRespData["error"]; 107 string errorstring = (string) GridRespData["error"];
110 MainLog.Instance.Error("Unable to connect to grid: " + errorstring); 108 MainLog.Instance.Error("Unable to connect to grid: " + errorstring);
111 return null; 109 return null;
112 } 110 }
@@ -121,8 +119,7 @@ namespace OpenSim.Region.Communications.OGS1
121 /// <returns></returns> 119 /// <returns></returns>
122 public List<SimpleRegionInfo> RequestNeighbours(uint x, uint y) 120 public List<SimpleRegionInfo> RequestNeighbours(uint x, uint y)
123 { 121 {
124 122 Hashtable respData = MapBlockQuery((int) x - 1, (int) y - 1, (int) x + 1, (int) y + 1);
125 Hashtable respData = MapBlockQuery((int)x - 1, (int)y - 1, (int)x + 1, (int)y + 1);
126 123
127 List<SimpleRegionInfo> neighbours = new List<SimpleRegionInfo>(); 124 List<SimpleRegionInfo> neighbours = new List<SimpleRegionInfo>();
128 125
@@ -134,16 +131,15 @@ namespace OpenSim.Region.Communications.OGS1
134 uint regY = Convert.ToUInt32(neighbourData["y"]); 131 uint regY = Convert.ToUInt32(neighbourData["y"]);
135 if ((x != regX) || (y != regY)) 132 if ((x != regX) || (y != regY))
136 { 133 {
137 134 string simIp = (string) neighbourData["sim_ip"];
138 string simIp = (string)neighbourData["sim_ip"];
139 135
140 int port = Convert.ToInt32(neighbourData["sim_port"]); 136 int port = Convert.ToInt32(neighbourData["sim_port"]);
141 string externalUri = (string)neighbourData["sim_uri"]; 137 string externalUri = (string) neighbourData["sim_uri"];
142 138
143 string externalIpStr = OpenSim.Framework.Util.GetHostFromDNS(simIp).ToString(); 139 string externalIpStr = Util.GetHostFromDNS(simIp).ToString();
144 SimpleRegionInfo sri = new SimpleRegionInfo(regX, regY, simIp, port); 140 SimpleRegionInfo sri = new SimpleRegionInfo(regX, regY, simIp, port);
145 sri.RemotingPort = Convert.ToUInt32(neighbourData["remoting_port"]); 141 sri.RemotingPort = Convert.ToUInt32(neighbourData["remoting_port"]);
146 sri.RegionID = new LLUUID((string)neighbourData["uuid"]); 142 sri.RegionID = new LLUUID((string) neighbourData["uuid"]);
147 143
148 neighbours.Add(sri); 144 neighbours.Add(sri);
149 } 145 }
@@ -175,11 +171,11 @@ namespace OpenSim.Region.Communications.OGS1
175 { 171 {
176 Hashtable requestData = new Hashtable(); 172 Hashtable requestData = new Hashtable();
177 requestData["region_handle"] = regionHandle.ToString(); 173 requestData["region_handle"] = regionHandle.ToString();
178 requestData["authkey"] = this.serversInfo.GridSendKey; 174 requestData["authkey"] = serversInfo.GridSendKey;
179 ArrayList SendParams = new ArrayList(); 175 ArrayList SendParams = new ArrayList();
180 SendParams.Add(requestData); 176 SendParams.Add(requestData);
181 XmlRpcRequest GridReq = new XmlRpcRequest("simulator_data_request", SendParams); 177 XmlRpcRequest GridReq = new XmlRpcRequest("simulator_data_request", SendParams);
182 XmlRpcResponse GridResp = GridReq.Send(this.serversInfo.GridURL, 3000); 178 XmlRpcResponse GridResp = GridReq.Send(serversInfo.GridURL, 3000);
183 179
184 Hashtable responseData = (Hashtable) GridResp.Value; 180 Hashtable responseData = (Hashtable) GridResp.Value;
185 181
@@ -205,7 +201,7 @@ namespace OpenSim.Region.Communications.OGS1
205 regionInfo.RegionID = new LLUUID((string) responseData["region_UUID"]); 201 regionInfo.RegionID = new LLUUID((string) responseData["region_UUID"]);
206 regionInfo.RegionName = (string) responseData["region_name"]; 202 regionInfo.RegionName = (string) responseData["region_name"];
207 203
208 m_remoteRegionInfoCache.Add( regionHandle, regionInfo ); 204 m_remoteRegionInfoCache.Add(regionHandle, regionInfo);
209 } 205 }
210 206
211 return regionInfo; 207 return regionInfo;
@@ -234,11 +230,11 @@ namespace OpenSim.Region.Communications.OGS1
234 neighbour.X = Convert.ToUInt16(n["x"]); 230 neighbour.X = Convert.ToUInt16(n["x"]);
235 neighbour.Y = Convert.ToUInt16(n["y"]); 231 neighbour.Y = Convert.ToUInt16(n["y"]);
236 232
237 neighbour.Name = (string)n["name"]; 233 neighbour.Name = (string) n["name"];
238 neighbour.Access = Convert.ToByte(n["access"]); 234 neighbour.Access = Convert.ToByte(n["access"]);
239 neighbour.RegionFlags = Convert.ToUInt32(n["region-flags"]); 235 neighbour.RegionFlags = Convert.ToUInt32(n["region-flags"]);
240 neighbour.WaterHeight = Convert.ToByte(n["water-height"]); 236 neighbour.WaterHeight = Convert.ToByte(n["water-height"]);
241 neighbour.MapImageId = new LLUUID((string)n["map-image-id"]); 237 neighbour.MapImageId = new LLUUID((string) n["map-image-id"]);
242 238
243 neighbours.Add(neighbour); 239 neighbours.Add(neighbour);
244 } 240 }
@@ -267,7 +263,7 @@ namespace OpenSim.Region.Communications.OGS1
267 parameters.Add(param); 263 parameters.Add(param);
268 XmlRpcRequest req = new XmlRpcRequest("map_block", parameters); 264 XmlRpcRequest req = new XmlRpcRequest("map_block", parameters);
269 XmlRpcResponse resp = req.Send(serversInfo.GridURL, 10000); 265 XmlRpcResponse resp = req.Send(serversInfo.GridURL, 10000);
270 Hashtable respData = (Hashtable)resp.Value; 266 Hashtable respData = (Hashtable) resp.Value;
271 return respData; 267 return respData;
272 } 268 }
273 269
@@ -300,15 +296,15 @@ namespace OpenSim.Region.Communications.OGS1
300 public XmlRpcResponse ExpectUser(XmlRpcRequest request) 296 public XmlRpcResponse ExpectUser(XmlRpcRequest request)
301 { 297 {
302 Console.WriteLine("Expecting User..."); 298 Console.WriteLine("Expecting User...");
303 Hashtable requestData = (Hashtable)request.Params[0]; 299 Hashtable requestData = (Hashtable) request.Params[0];
304 AgentCircuitData agentData = new AgentCircuitData(); 300 AgentCircuitData agentData = new AgentCircuitData();
305 agentData.SessionID = new LLUUID((string)requestData["session_id"]); 301 agentData.SessionID = new LLUUID((string) requestData["session_id"]);
306 agentData.SecureSessionID = new LLUUID((string)requestData["secure_session_id"]); 302 agentData.SecureSessionID = new LLUUID((string) requestData["secure_session_id"]);
307 agentData.firstname = (string)requestData["firstname"]; 303 agentData.firstname = (string) requestData["firstname"];
308 agentData.lastname = (string)requestData["lastname"]; 304 agentData.lastname = (string) requestData["lastname"];
309 agentData.AgentID = new LLUUID((string)requestData["agent_id"]); 305 agentData.AgentID = new LLUUID((string) requestData["agent_id"]);
310 agentData.circuitcode = Convert.ToUInt32(requestData["circuit_code"]); 306 agentData.circuitcode = Convert.ToUInt32(requestData["circuit_code"]);
311 agentData.CapsPath = (string)requestData["caps_path"]; 307 agentData.CapsPath = (string) requestData["caps_path"];
312 308
313 if (requestData.ContainsKey("child_agent") && requestData["child_agent"].Equals("1")) 309 if (requestData.ContainsKey("child_agent") && requestData["child_agent"].Equals("1"))
314 { 310 {
@@ -316,12 +312,14 @@ namespace OpenSim.Region.Communications.OGS1
316 } 312 }
317 else 313 else
318 { 314 {
319 agentData.startpos = new LLVector3(Convert.ToUInt32(requestData["startpos_x"]), Convert.ToUInt32(requestData["startpos_y"]), Convert.ToUInt32(requestData["startpos_z"])); 315 agentData.startpos =
316 new LLVector3(Convert.ToUInt32(requestData["startpos_x"]),
317 Convert.ToUInt32(requestData["startpos_y"]),
318 Convert.ToUInt32(requestData["startpos_z"]));
320 agentData.child = false; 319 agentData.child = false;
321
322 } 320 }
323 321
324 ulong regionHandle = Convert.ToUInt64((string)requestData["regionhandle"]); 322 ulong regionHandle = Convert.ToUInt64((string) requestData["regionhandle"]);
325 323
326 m_localBackend.TriggerExpectUser(regionHandle, agentData); 324 m_localBackend.TriggerExpectUser(regionHandle, agentData);
327 325
@@ -331,6 +329,7 @@ namespace OpenSim.Region.Communications.OGS1
331 } 329 }
332 330
333 #region m_interRegion Comms 331 #region m_interRegion Comms
332
334 /// <summary> 333 /// <summary>
335 /// 334 ///
336 /// </summary> 335 /// </summary>
@@ -339,13 +338,16 @@ namespace OpenSim.Region.Communications.OGS1
339 TcpChannel ch = new TcpChannel(NetworkServersInfo.RemotingListenerPort); 338 TcpChannel ch = new TcpChannel(NetworkServersInfo.RemotingListenerPort);
340 ChannelServices.RegisterChannel(ch, false); // Disabled security as Mono doesnt support this. 339 ChannelServices.RegisterChannel(ch, false); // Disabled security as Mono doesnt support this.
341 340
342 WellKnownServiceTypeEntry wellType = new WellKnownServiceTypeEntry(typeof(OGS1InterRegionRemoting), "InterRegions", WellKnownObjectMode.Singleton); 341 WellKnownServiceTypeEntry wellType =
342 new WellKnownServiceTypeEntry(typeof (OGS1InterRegionRemoting), "InterRegions",
343 WellKnownObjectMode.Singleton);
343 RemotingConfiguration.RegisterWellKnownServiceType(wellType); 344 RemotingConfiguration.RegisterWellKnownServiceType(wellType);
344 InterRegionSingleton.Instance.OnArrival += this.TriggerExpectAvatarCrossing; 345 InterRegionSingleton.Instance.OnArrival += TriggerExpectAvatarCrossing;
345 InterRegionSingleton.Instance.OnChildAgent += this.IncomingChildAgent; 346 InterRegionSingleton.Instance.OnChildAgent += IncomingChildAgent;
346 } 347 }
347 348
348 #region Methods called by regions in this instance 349 #region Methods called by regions in this instance
350
349 /// <summary> 351 /// <summary>
350 /// 352 ///
351 /// </summary> 353 /// </summary>
@@ -361,17 +363,19 @@ namespace OpenSim.Region.Communications.OGS1
361 return true; 363 return true;
362 } 364 }
363 365
364 RegionInfo regInfo = this.RequestNeighbourInfo(regionHandle); 366 RegionInfo regInfo = RequestNeighbourInfo(regionHandle);
365 if (regInfo != null) 367 if (regInfo != null)
366 { 368 {
367 //don't want to be creating a new link to the remote instance every time like we are here 369 //don't want to be creating a new link to the remote instance every time like we are here
368 bool retValue = false; 370 bool retValue = false;
369 371
370 372
371 OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting)Activator.GetObject( 373 OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting) Activator.GetObject(
372 typeof(OGS1InterRegionRemoting), 374 typeof (OGS1InterRegionRemoting),
373 "tcp://" + regInfo.RemotingAddress + ":" + regInfo.RemotingPort + "/InterRegions"); 375 "tcp://" + regInfo.RemotingAddress +
374 376 ":" + regInfo.RemotingPort +
377 "/InterRegions");
378
375 if (remObject != null) 379 if (remObject != null)
376 { 380 {
377 retValue = remObject.InformRegionOfChildAgent(regionHandle, agentData); 381 retValue = remObject.InformRegionOfChildAgent(regionHandle, agentData);
@@ -388,7 +392,7 @@ namespace OpenSim.Region.Communications.OGS1
388 392
389 return false; 393 return false;
390 } 394 }
391 catch (System.Runtime.Remoting.RemotingException e) 395 catch (RemotingException e)
392 { 396 {
393 MainLog.Instance.Error("Remoting Error: Unable to connect to remote region.\n" + e.ToString()); 397 MainLog.Instance.Error("Remoting Error: Unable to connect to remote region.\n" + e.ToString());
394 return false; 398 return false;
@@ -432,13 +436,15 @@ namespace OpenSim.Region.Communications.OGS1
432 return true; 436 return true;
433 } 437 }
434 438
435 RegionInfo regInfo = this.RequestNeighbourInfo(regionHandle); 439 RegionInfo regInfo = RequestNeighbourInfo(regionHandle);
436 if (regInfo != null) 440 if (regInfo != null)
437 { 441 {
438 bool retValue = false; 442 bool retValue = false;
439 OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting)Activator.GetObject( 443 OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting) Activator.GetObject(
440 typeof(OGS1InterRegionRemoting), 444 typeof (OGS1InterRegionRemoting),
441 "tcp://" + regInfo.RemotingAddress + ":" + regInfo.RemotingPort + "/InterRegions"); 445 "tcp://" + regInfo.RemotingAddress +
446 ":" + regInfo.RemotingPort +
447 "/InterRegions");
442 if (remObject != null) 448 if (remObject != null)
443 { 449 {
444 retValue = remObject.ExpectAvatarCrossing(regionHandle, agentID, position, isFlying); 450 retValue = remObject.ExpectAvatarCrossing(regionHandle, agentID, position, isFlying);
@@ -455,7 +461,7 @@ namespace OpenSim.Region.Communications.OGS1
455 // to inform it. 461 // to inform it.
456 return false; 462 return false;
457 } 463 }
458 catch (System.Runtime.Remoting.RemotingException e) 464 catch (RemotingException e)
459 { 465 {
460 MainLog.Instance.Error("Remoting Error: Unable to connect to remote region.\n" + e.ToString()); 466 MainLog.Instance.Error("Remoting Error: Unable to connect to remote region.\n" + e.ToString());
461 return false; 467 return false;
@@ -474,6 +480,7 @@ namespace OpenSim.Region.Communications.OGS1
474 #endregion 480 #endregion
475 481
476 #region Methods triggered by calls from external instances 482 #region Methods triggered by calls from external instances
483
477 /// <summary> 484 /// <summary>
478 /// 485 ///
479 /// </summary> 486 /// </summary>
@@ -486,7 +493,7 @@ namespace OpenSim.Region.Communications.OGS1
486 { 493 {
487 return m_localBackend.IncomingChildAgent(regionHandle, agentData); 494 return m_localBackend.IncomingChildAgent(regionHandle, agentData);
488 } 495 }
489 catch (System.Runtime.Remoting.RemotingException e) 496 catch (RemotingException e)
490 { 497 {
491 MainLog.Instance.Error("Remoting Error: Unable to connect to remote region.\n" + e.ToString()); 498 MainLog.Instance.Error("Remoting Error: Unable to connect to remote region.\n" + e.ToString());
492 return false; 499 return false;
@@ -502,18 +509,19 @@ namespace OpenSim.Region.Communications.OGS1
502 /// <returns></returns> 509 /// <returns></returns>
503 public bool TriggerExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying) 510 public bool TriggerExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying)
504 { 511 {
505
506 try 512 try
507 { 513 {
508 return m_localBackend.TriggerExpectAvatarCrossing(regionHandle, agentID, position, isFlying); 514 return m_localBackend.TriggerExpectAvatarCrossing(regionHandle, agentID, position, isFlying);
509 } 515 }
510 catch (System.Runtime.Remoting.RemotingException e) 516 catch (RemotingException e)
511 { 517 {
512 MainLog.Instance.Error("Remoting Error: Unable to connect to remote region.\n" + e.ToString()); 518 MainLog.Instance.Error("Remoting Error: Unable to connect to remote region.\n" + e.ToString());
513 return false; 519 return false;
514 } 520 }
515 } 521 }
522
516 #endregion 523 #endregion
524
517 #endregion 525 #endregion
518 } 526 }
519} 527} \ No newline at end of file
diff --git a/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs b/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs
index 0b7bd82..a127010 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs
@@ -27,17 +27,19 @@
27*/ 27*/
28 28
29using System; 29using System;
30using System.Runtime.Remoting;
30using libsecondlife; 31using libsecondlife;
31using OpenSim.Framework; 32using OpenSim.Framework;
32 33
33namespace OpenSim.Region.Communications.OGS1 34namespace OpenSim.Region.Communications.OGS1
34{ 35{
35 public delegate bool InformRegionChild(ulong regionHandle, AgentCircuitData agentData); 36 public delegate bool InformRegionChild(ulong regionHandle, AgentCircuitData agentData);
37
36 public delegate bool ExpectArrival(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying); 38 public delegate bool ExpectArrival(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying);
37 39
38 public sealed class InterRegionSingleton 40 public sealed class InterRegionSingleton
39 { 41 {
40 static readonly InterRegionSingleton instance = new InterRegionSingleton(); 42 private static readonly InterRegionSingleton instance = new InterRegionSingleton();
41 43
42 public event InformRegionChild OnChildAgent; 44 public event InformRegionChild OnChildAgent;
43 public event ExpectArrival OnArrival; 45 public event ExpectArrival OnArrival;
@@ -46,16 +48,13 @@ namespace OpenSim.Region.Communications.OGS1
46 { 48 {
47 } 49 }
48 50
49 InterRegionSingleton() 51 private InterRegionSingleton()
50 { 52 {
51 } 53 }
52 54
53 public static InterRegionSingleton Instance 55 public static InterRegionSingleton Instance
54 { 56 {
55 get 57 get { return instance; }
56 {
57 return instance;
58 }
59 } 58 }
60 59
61 public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData) 60 public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData)
@@ -79,7 +78,6 @@ namespace OpenSim.Region.Communications.OGS1
79 78
80 public class OGS1InterRegionRemoting : MarshalByRefObject 79 public class OGS1InterRegionRemoting : MarshalByRefObject
81 { 80 {
82
83 public OGS1InterRegionRemoting() 81 public OGS1InterRegionRemoting()
84 { 82 {
85 } 83 }
@@ -90,7 +88,7 @@ namespace OpenSim.Region.Communications.OGS1
90 { 88 {
91 return InterRegionSingleton.Instance.InformRegionOfChildAgent(regionHandle, agentData); 89 return InterRegionSingleton.Instance.InformRegionOfChildAgent(regionHandle, agentData);
92 } 90 }
93 catch (System.Runtime.Remoting.RemotingException e) 91 catch (RemotingException e)
94 { 92 {
95 Console.WriteLine("Remoting Error: Unable to connect to remote region.\n" + e.ToString()); 93 Console.WriteLine("Remoting Error: Unable to connect to remote region.\n" + e.ToString());
96 return false; 94 return false;
@@ -103,11 +101,11 @@ namespace OpenSim.Region.Communications.OGS1
103 { 101 {
104 return InterRegionSingleton.Instance.ExpectAvatarCrossing(regionHandle, agentID, position, isFlying); 102 return InterRegionSingleton.Instance.ExpectAvatarCrossing(regionHandle, agentID, position, isFlying);
105 } 103 }
106 catch (System.Runtime.Remoting.RemotingException e) 104 catch (RemotingException e)
107 { 105 {
108 Console.WriteLine("Remoting Error: Unable to connect to remote region.\n" + e.ToString()); 106 Console.WriteLine("Remoting Error: Unable to connect to remote region.\n" + e.ToString());
109 return false; 107 return false;
110 } 108 }
111 } 109 }
112 } 110 }
113} 111} \ No newline at end of file
diff --git a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
index 11dee2d..49fdee9 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
@@ -28,46 +28,39 @@
28 28
29using System.Collections.Generic; 29using System.Collections.Generic;
30using libsecondlife; 30using libsecondlife;
31using OpenSim.Framework;
31using OpenSim.Framework.Communications; 32using OpenSim.Framework.Communications;
32using OpenSim.Framework.Communications.Cache; 33using OpenSim.Framework.Communications.Cache;
33using OpenSim.Framework;
34
35 34
36namespace OpenSim.Region.Communications.OGS1 35namespace OpenSim.Region.Communications.OGS1
37{ 36{
38 public class OGS1InventoryService : IInventoryServices 37 public class OGS1InventoryService : IInventoryServices
39 { 38 {
40
41 public OGS1InventoryService() 39 public OGS1InventoryService()
42 { 40 {
43
44 } 41 }
45 42
46 #region IInventoryServices Members 43 #region IInventoryServices Members
47 44
48 public void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack, InventoryItemInfo itemCallBack) 45 public void RequestInventoryForUser(LLUUID userID, InventoryFolderInfo folderCallBack,
46 InventoryItemInfo itemCallBack)
49 { 47 {
50
51 } 48 }
52 49
53 public void AddNewInventoryFolder(LLUUID userID, InventoryFolderImpl folder) 50 public void AddNewInventoryFolder(LLUUID userID, InventoryFolderImpl folder)
54 { 51 {
55
56 } 52 }
57 53
58 public void AddNewInventoryItem(LLUUID userID, InventoryItemBase item) 54 public void AddNewInventoryItem(LLUUID userID, InventoryItemBase item)
59 { 55 {
60
61 } 56 }
62 57
63 public void DeleteInventoryItem(LLUUID userID, InventoryItemBase item) 58 public void DeleteInventoryItem(LLUUID userID, InventoryItemBase item)
64 { 59 {
65
66 } 60 }
67 61
68 public void CreateNewUserInventory(LLUUID user) 62 public void CreateNewUserInventory(LLUUID user)
69 { 63 {
70
71 } 64 }
72 65
73 public List<InventoryFolderBase> RequestFirstLevelFolders(LLUUID userID) 66 public List<InventoryFolderBase> RequestFirstLevelFolders(LLUUID userID)
@@ -77,4 +70,4 @@ namespace OpenSim.Region.Communications.OGS1
77 70
78 #endregion 71 #endregion
79 } 72 }
80} 73} \ No newline at end of file
diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
index 19a3c3b..d00a813 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
@@ -28,16 +28,19 @@
28 28
29using System; 29using System;
30using System.Collections; 30using System.Collections;
31using System.Net;
31using libsecondlife; 32using libsecondlife;
32using Nwc.XmlRpc; 33using Nwc.XmlRpc;
33using OpenSim.Framework.Interfaces;
34using OpenSim.Framework; 34using OpenSim.Framework;
35using OpenSim.Framework.Console;
36using OpenSim.Framework.Interfaces;
35 37
36namespace OpenSim.Region.Communications.OGS1 38namespace OpenSim.Region.Communications.OGS1
37{ 39{
38 public class OGS1UserServices :IUserService 40 public class OGS1UserServices : IUserService
39 { 41 {
40 CommunicationsOGS1 m_parent; 42 private CommunicationsOGS1 m_parent;
43
41 public OGS1UserServices(CommunicationsOGS1 parent) 44 public OGS1UserServices(CommunicationsOGS1 parent)
42 { 45 {
43 m_parent = parent; 46 m_parent = parent;
@@ -47,32 +50,41 @@ namespace OpenSim.Region.Communications.OGS1
47 { 50 {
48 if (data.Contains("error_type")) 51 if (data.Contains("error_type"))
49 { 52 {
50 Console.WriteLine("Error sent by user server when trying to get user profile: (" + data["error_type"] + "): " + data["error_desc"]); 53 Console.WriteLine("Error sent by user server when trying to get user profile: (" + data["error_type"] +
54 "): " + data["error_desc"]);
51 return null; 55 return null;
52 } 56 }
53 57
54 UserProfileData userData = new UserProfileData(); 58 UserProfileData userData = new UserProfileData();
55 userData.username = (string)data["firstname"]; 59 userData.username = (string) data["firstname"];
56 userData.surname = (string)data["lastname"]; 60 userData.surname = (string) data["lastname"];
57 userData.UUID = new LLUUID((string)data["uuid"]); 61 userData.UUID = new LLUUID((string) data["uuid"]);
58 userData.userInventoryURI = (string)data["server_inventory"]; 62 userData.userInventoryURI = (string) data["server_inventory"];
59 userData.userAssetURI = (string)data["server_asset"]; 63 userData.userAssetURI = (string) data["server_asset"];
60 userData.profileFirstText = (string)data["profile_firstlife_about"]; 64 userData.profileFirstText = (string) data["profile_firstlife_about"];
61 userData.profileFirstImage = new LLUUID((string)data["profile_firstlife_image"]); 65 userData.profileFirstImage = new LLUUID((string) data["profile_firstlife_image"]);
62 userData.profileCanDoMask = Convert.ToUInt32((string)data["profile_can_do"]); 66 userData.profileCanDoMask = Convert.ToUInt32((string) data["profile_can_do"]);
63 userData.profileWantDoMask = Convert.ToUInt32(data["profile_want_do"]); 67 userData.profileWantDoMask = Convert.ToUInt32(data["profile_want_do"]);
64 userData.profileImage = new LLUUID((string)data["profile_image"]); 68 userData.profileImage = new LLUUID((string) data["profile_image"]);
65 userData.lastLogin = Convert.ToInt32((string)data["profile_lastlogin"]); 69 userData.lastLogin = Convert.ToInt32((string) data["profile_lastlogin"]);
66 userData.homeRegion = Convert.ToUInt64((string)data["home_region"]); 70 userData.homeRegion = Convert.ToUInt64((string) data["home_region"]);
67 userData.homeLocation = new LLVector3((float)Convert.ToDecimal((string)data["home_coordinates_x"]), (float)Convert.ToDecimal((string)data["home_coordinates_y"]), (float)Convert.ToDecimal((string)data["home_coordinates_z"])); 71 userData.homeLocation =
68 userData.homeLookAt = new LLVector3((float)Convert.ToDecimal((string)data["home_look_x"]), (float)Convert.ToDecimal((string)data["home_look_y"]), (float)Convert.ToDecimal((string)data["home_look_z"])); 72 new LLVector3((float) Convert.ToDecimal((string) data["home_coordinates_x"]),
73 (float) Convert.ToDecimal((string) data["home_coordinates_y"]),
74 (float) Convert.ToDecimal((string) data["home_coordinates_z"]));
75 userData.homeLookAt =
76 new LLVector3((float) Convert.ToDecimal((string) data["home_look_x"]),
77 (float) Convert.ToDecimal((string) data["home_look_y"]),
78 (float) Convert.ToDecimal((string) data["home_look_z"]));
69 79
70 return userData; 80 return userData;
71 } 81 }
82
72 public UserProfileData GetUserProfile(string firstName, string lastName) 83 public UserProfileData GetUserProfile(string firstName, string lastName)
73 { 84 {
74 return GetUserProfile(firstName + " " + lastName); 85 return GetUserProfile(firstName + " " + lastName);
75 } 86 }
87
76 public UserProfileData GetUserProfile(string name) 88 public UserProfileData GetUserProfile(string name)
77 { 89 {
78 try 90 try
@@ -83,16 +95,18 @@ namespace OpenSim.Region.Communications.OGS1
83 parameters.Add(param); 95 parameters.Add(param);
84 XmlRpcRequest req = new XmlRpcRequest("get_user_by_name", parameters); 96 XmlRpcRequest req = new XmlRpcRequest("get_user_by_name", parameters);
85 XmlRpcResponse resp = req.Send(m_parent.NetworkServersInfo.UserURL, 3000); 97 XmlRpcResponse resp = req.Send(m_parent.NetworkServersInfo.UserURL, 3000);
86 Hashtable respData = (Hashtable)resp.Value; 98 Hashtable respData = (Hashtable) resp.Value;
87 99
88 return ConvertXMLRPCDataToUserProfile(respData); 100 return ConvertXMLRPCDataToUserProfile(respData);
89 } 101 }
90 catch (System.Net.WebException e) 102 catch (WebException e)
91 { 103 {
92 OpenSim.Framework.Console.MainLog.Instance.Warn("Error when trying to fetch profile data by name from remote user server: " + e.Message); 104 MainLog.Instance.Warn("Error when trying to fetch profile data by name from remote user server: " +
105 e.Message);
93 } 106 }
94 return null; 107 return null;
95 } 108 }
109
96 public UserProfileData GetUserProfile(LLUUID avatarID) 110 public UserProfileData GetUserProfile(LLUUID avatarID)
97 { 111 {
98 try 112 try
@@ -103,18 +117,19 @@ namespace OpenSim.Region.Communications.OGS1
103 parameters.Add(param); 117 parameters.Add(param);
104 XmlRpcRequest req = new XmlRpcRequest("get_user_by_uuid", parameters); 118 XmlRpcRequest req = new XmlRpcRequest("get_user_by_uuid", parameters);
105 XmlRpcResponse resp = req.Send(m_parent.NetworkServersInfo.UserURL, 3000); 119 XmlRpcResponse resp = req.Send(m_parent.NetworkServersInfo.UserURL, 3000);
106 Hashtable respData = (Hashtable)resp.Value; 120 Hashtable respData = (Hashtable) resp.Value;
107 121
108 return ConvertXMLRPCDataToUserProfile(respData); 122 return ConvertXMLRPCDataToUserProfile(respData);
109 } 123 }
110 catch (Exception e) 124 catch (Exception e)
111 { 125 {
112 Console.WriteLine("Error when trying to fetch profile data by uuid from remote user server: " + e.Message); 126 Console.WriteLine("Error when trying to fetch profile data by uuid from remote user server: " +
127 e.Message);
113 } 128 }
114 return null; 129 return null;
115 } 130 }
116 131
117 public void clearUserAgent(LLUUID avatarID) 132 public void clearUserAgent(LLUUID avatarID)
118 { 133 {
119 // TODO: implement 134 // TODO: implement
120 } 135 }
@@ -135,4 +150,4 @@ namespace OpenSim.Region.Communications.OGS1
135 throw new Exception("The method or operation is not implemented."); 150 throw new Exception("The method or operation is not implemented.");
136 } 151 }
137 } 152 }
138} 153} \ No newline at end of file
diff --git a/OpenSim/Region/Communications/OGS1/Properties/AssemblyInfo.cs b/OpenSim/Region/Communications/OGS1/Properties/AssemblyInfo.cs
index 2bebf9f..631cfd0 100644
--- a/OpenSim/Region/Communications/OGS1/Properties/AssemblyInfo.cs
+++ b/OpenSim/Region/Communications/OGS1/Properties/AssemblyInfo.cs
@@ -1,24 +1,28 @@
1using System.Reflection; 1using System.Reflection;
2using System.Runtime.InteropServices; 2using System.Runtime.InteropServices;
3
3// General Information about an assembly is controlled through the following 4// General Information about an assembly is controlled through the following
4// set of attributes. Change these attribute values to modify the information 5// set of attributes. Change these attribute values to modify the information
5// associated with an assembly. 6// associated with an assembly.
6[assembly: AssemblyTitle("OpenGrid.Framework.Communications.OGS1")] 7
7[assembly: AssemblyDescription("")] 8[assembly : AssemblyTitle("OpenGrid.Framework.Communications.OGS1")]
8[assembly: AssemblyConfiguration("")] 9[assembly : AssemblyDescription("")]
9[assembly: AssemblyCompany("")] 10[assembly : AssemblyConfiguration("")]
10[assembly: AssemblyProduct("OpenGrid.Framework.Communications.OGS1")] 11[assembly : AssemblyCompany("")]
11[assembly: AssemblyCopyright("Copyright © 2007")] 12[assembly : AssemblyProduct("OpenGrid.Framework.Communications.OGS1")]
12[assembly: AssemblyTrademark("")] 13[assembly : AssemblyCopyright("Copyright © 2007")]
13[assembly: AssemblyCulture("")] 14[assembly : AssemblyTrademark("")]
15[assembly : AssemblyCulture("")]
14 16
15// Setting ComVisible to false makes the types in this assembly not visible 17// Setting ComVisible to false makes the types in this assembly not visible
16// to COM components. If you need to access a type in this assembly from 18// to COM components. If you need to access a type in this assembly from
17// COM, set the ComVisible attribute to true on that type. 19// COM, set the ComVisible attribute to true on that type.
18[assembly: ComVisible(false)] 20
21[assembly : ComVisible(false)]
19 22
20// The following GUID is for the ID of the typelib if this project is exposed to COM 23// The following GUID is for the ID of the typelib if this project is exposed to COM
21[assembly: Guid("a8b2b39b-c83b-41e2-b0b5-7ccfc1fddae7")] 24
25[assembly : Guid("a8b2b39b-c83b-41e2-b0b5-7ccfc1fddae7")]
22 26
23// Version information for an assembly consists of the following four values: 27// Version information for an assembly consists of the following four values:
24// 28//
@@ -29,5 +33,6 @@ using System.Runtime.InteropServices;
29// 33//
30// You can specify all the values or you can default the Revision and Build Numbers 34// You can specify all the values or you can default the Revision and Build Numbers
31// by using the '*' as shown below: 35// by using the '*' as shown below:
32[assembly: AssemblyVersion("1.0.0.0")] 36
33[assembly: AssemblyFileVersion("1.0.0.0")] 37[assembly : AssemblyVersion("1.0.0.0")]
38[assembly : AssemblyFileVersion("1.0.0.0")] \ No newline at end of file