aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs53
-rw-r--r--OpenSim/Client/MXP/ClientStack/MXPClientView.cs176
-rw-r--r--OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs5
-rw-r--r--OpenSim/Framework/RegionInfo.cs15
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs2
-rw-r--r--OpenSim/Framework/Util.cs44
-rw-r--r--OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs4
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs3
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs6
-rw-r--r--OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs12
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs2
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs28
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs26
-rw-r--r--OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs59
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs30
-rw-r--r--OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs26
-rw-r--r--OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs4
-rw-r--r--OpenSim/Server/Handlers/Login/LLLoginHandlers.cs12
-rw-r--r--OpenSim/Server/Handlers/Login/LLLoginServiceInConnector.cs5
-rw-r--r--OpenSim/Server/Handlers/Simulation/AgentHandlers.cs19
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs43
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs25
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs29
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs25
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianFriendsServiceConnector.cs41
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianGrid.cs14
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs22
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs44
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs22
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs42
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs25
-rw-r--r--OpenSim/Services/InventoryService/HGInventoryService.cs2
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginService.cs2
-rw-r--r--bin/OpenSim.ini.example13
-rw-r--r--bin/Robust.HG.ini.example7
-rw-r--r--bin/config-include/HyperSimianGrid.ini77
41 files changed, 546 insertions, 428 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
index 826a1b0..0608f66 100644
--- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
+++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
@@ -588,6 +588,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController
588 /// <item><term>estate_name</term> 588 /// <item><term>estate_name</term>
589 /// <description>the name of the estate to join (or to create if it doesn't 589 /// <description>the name of the estate to join (or to create if it doesn't
590 /// already exist)</description></item> 590 /// already exist)</description></item>
591 /// <item><term>region_file</term>
592 /// <description>The name of the file to persist the region specifications to.
593 /// If omitted, the region_file_template setting from OpenSim.ini will be used. (optional)</description></item>
591 /// </list> 594 /// </list>
592 /// 595 ///
593 /// XmlRpcCreateRegionMethod returns 596 /// XmlRpcCreateRegionMethod returns
@@ -701,7 +704,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
701 bool persist = Convert.ToBoolean((string) requestData["persist"]); 704 bool persist = Convert.ToBoolean((string) requestData["persist"]);
702 if (persist) 705 if (persist)
703 { 706 {
704 // default place for region XML files is in the 707 // default place for region configuration files is in the
705 // Regions directory of the config dir (aka /bin) 708 // Regions directory of the config dir (aka /bin)
706 string regionConfigPath = Path.Combine(Util.configDir(), "Regions"); 709 string regionConfigPath = Path.Combine(Util.configDir(), "Regions");
707 try 710 try
@@ -714,19 +717,36 @@ namespace OpenSim.ApplicationPlugins.RemoteController
714 { 717 {
715 // No INI setting recorded. 718 // No INI setting recorded.
716 } 719 }
717 string regionXmlPath = Path.Combine(regionConfigPath, 720
721 string regionIniPath;
722
723 if (requestData.Contains("region_file"))
724 {
725 // Make sure that the file to be created is in a subdirectory of the region storage directory.
726 string requestedFilePath = Path.Combine(regionConfigPath, (string) requestData["region_file"]);
727 string requestedDirectory = Path.GetDirectoryName(Path.GetFullPath(requestedFilePath));
728 if (requestedDirectory.StartsWith(Path.GetFullPath(regionConfigPath)))
729 regionIniPath = requestedFilePath;
730 else
731 throw new Exception("Invalid location for region file.");
732 }
733 else
734 {
735 regionIniPath = Path.Combine(regionConfigPath,
718 String.Format( 736 String.Format(
719 m_config.GetString("region_file_template", 737 m_config.GetString("region_file_template",
720 "{0}x{1}-{2}.xml"), 738 "{0}x{1}-{2}.ini"),
721 region.RegionLocX.ToString(), 739 region.RegionLocX.ToString(),
722 region.RegionLocY.ToString(), 740 region.RegionLocY.ToString(),
723 regionID.ToString(), 741 regionID.ToString(),
724 region.InternalEndPoint.Port.ToString(), 742 region.InternalEndPoint.Port.ToString(),
725 region.RegionName.Replace(" ", "_").Replace(":", "_"). 743 region.RegionName.Replace(" ", "_").Replace(":", "_").
726 Replace("/", "_"))); 744 Replace("/", "_")));
745 }
746
727 m_log.DebugFormat("[RADMIN] CreateRegion: persisting region {0} to {1}", 747 m_log.DebugFormat("[RADMIN] CreateRegion: persisting region {0} to {1}",
728 region.RegionID, regionXmlPath); 748 region.RegionID, regionIniPath);
729 region.SaveRegionToFile("dynamic region", regionXmlPath); 749 region.SaveRegionToFile("dynamic region", regionIniPath);
730 } 750 }
731 else 751 else
732 { 752 {
@@ -1700,8 +1720,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1700 destinationItem.CreationDate = item.CreationDate; 1720 destinationItem.CreationDate = item.CreationDate;
1701 destinationItem.Folder = destinationFolder.ID; 1721 destinationItem.Folder = destinationFolder.ID;
1702 1722
1703 inventoryService.AddItem(destinationItem); 1723 m_application.SceneManager.CurrentOrFirstScene.AddInventoryItem(destinationItem);
1704 m_log.DebugFormat("[RADMIN] Added item {0} to folder {1}", destinationItem.ID, destinationFolder.ID); 1724 m_log.DebugFormat("[RADMIN]: Added item {0} to folder {1}", destinationItem.ID, destinationFolder.ID);
1705 1725
1706 // Wear item 1726 // Wear item
1707 AvatarWearable newWearable = new AvatarWearable(); 1727 AvatarWearable newWearable = new AvatarWearable();
@@ -1711,7 +1731,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1711 } 1731 }
1712 else 1732 else
1713 { 1733 {
1714 m_log.WarnFormat("[RADMIN] Error transferring {0} to folder {1}", wearable.ItemID, destinationFolder.ID); 1734 m_log.WarnFormat("[RADMIN]: Error transferring {0} to folder {1}", wearable.ItemID, destinationFolder.ID);
1715 } 1735 }
1716 } 1736 }
1717 } 1737 }
@@ -1753,16 +1773,16 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1753 destinationItem.CreationDate = item.CreationDate; 1773 destinationItem.CreationDate = item.CreationDate;
1754 destinationItem.Folder = destinationFolder.ID; 1774 destinationItem.Folder = destinationFolder.ID;
1755 1775
1756 inventoryService.AddItem(destinationItem); 1776 m_application.SceneManager.CurrentOrFirstScene.AddInventoryItem(destinationItem);
1757 m_log.DebugFormat("[RADMIN] Added item {0} to folder {1}", destinationItem.ID, destinationFolder.ID); 1777 m_log.DebugFormat("[RADMIN]: Added item {0} to folder {1}", destinationItem.ID, destinationFolder.ID);
1758 1778
1759 // Attach item 1779 // Attach item
1760 avatarAppearance.SetAttachment(attachpoint, destinationItem.ID, destinationItem.AssetID); 1780 avatarAppearance.SetAttachment(attachpoint, destinationItem.ID, destinationItem.AssetID);
1761 m_log.DebugFormat("[RADMIN] Attached {0}", destinationItem.ID); 1781 m_log.DebugFormat("[RADMIN]: Attached {0}", destinationItem.ID);
1762 } 1782 }
1763 else 1783 else
1764 { 1784 {
1765 m_log.WarnFormat("[RADMIN] Error transferring {0} to folder {1}", itemID, destinationFolder.ID); 1785 m_log.WarnFormat("[RADMIN]: Error transferring {0} to folder {1}", itemID, destinationFolder.ID);
1766 } 1786 }
1767 } 1787 }
1768 } 1788 }
@@ -1860,16 +1880,16 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1860 destinationItem.CreationDate = item.CreationDate; 1880 destinationItem.CreationDate = item.CreationDate;
1861 destinationItem.Folder = extraFolder.ID; 1881 destinationItem.Folder = extraFolder.ID;
1862 1882
1863 inventoryService.AddItem(destinationItem); 1883 m_application.SceneManager.CurrentOrFirstScene.AddInventoryItem(destinationItem);
1864 inventoryMap.Add(item.ID, destinationItem.ID); 1884 inventoryMap.Add(item.ID, destinationItem.ID);
1865 m_log.DebugFormat("[RADMIN] Added item {0} to folder {1}", destinationItem.ID, extraFolder.ID); 1885 m_log.DebugFormat("[RADMIN]: Added item {0} to folder {1}", destinationItem.ID, extraFolder.ID);
1866 1886
1867 // Attach item, if original is attached 1887 // Attach item, if original is attached
1868 int attachpoint = avatarAppearance.GetAttachpoint(item.ID); 1888 int attachpoint = avatarAppearance.GetAttachpoint(item.ID);
1869 if (attachpoint != 0) 1889 if (attachpoint != 0)
1870 { 1890 {
1871 avatarAppearance.SetAttachment(attachpoint, destinationItem.ID, destinationItem.AssetID); 1891 avatarAppearance.SetAttachment(attachpoint, destinationItem.ID, destinationItem.AssetID);
1872 m_log.DebugFormat("[RADMIN] Attached {0}", destinationItem.ID); 1892 m_log.DebugFormat("[RADMIN]: Attached {0}", destinationItem.ID);
1873 } 1893 }
1874 } 1894 }
1875 } 1895 }
@@ -1888,7 +1908,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
1888 private bool CreateDefaultAvatars() 1908 private bool CreateDefaultAvatars()
1889 { 1909 {
1890 // Only load once 1910 // Only load once
1891
1892 if (m_defaultAvatarsLoaded) 1911 if (m_defaultAvatarsLoaded)
1893 { 1912 {
1894 return false; 1913 return false;
@@ -2146,7 +2165,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
2146 inventoryItem.CreationDate = GetIntegerAttribute(item,"creationdate",Util.UnixTimeSinceEpoch()); 2165 inventoryItem.CreationDate = GetIntegerAttribute(item,"creationdate",Util.UnixTimeSinceEpoch());
2147 inventoryItem.Folder = extraFolder.ID; // Parent folder 2166 inventoryItem.Folder = extraFolder.ID; // Parent folder
2148 2167
2149 inventoryService.AddItem(inventoryItem); 2168 m_application.SceneManager.CurrentOrFirstScene.AddInventoryItem(inventoryItem);
2150 m_log.DebugFormat("[RADMIN] Added item {0} to folder {1}", inventoryItem.ID, extraFolder.ID); 2169 m_log.DebugFormat("[RADMIN] Added item {0} to folder {1}", inventoryItem.ID, extraFolder.ID);
2151 } 2170 }
2152 2171
diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs
index faab371..87b99e0 100644
--- a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs
+++ b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs
@@ -305,94 +305,94 @@ namespace OpenSim.Client.MXP.ClientStack
305 305
306 #region MXP Outgoing Message Processing 306 #region MXP Outgoing Message Processing
307 307
308 private void MXPSendPrimitive(uint localID, UUID ownerID, Vector3 acc, Vector3 rvel, PrimitiveBaseShape primShape, Vector3 pos, UUID objectID, Vector3 vel, Quaternion rotation, uint flags, string text, byte[] textColor, uint parentID, byte[] particleSystem, byte clickAction, byte material, byte[] textureanim) 308// private void MXPSendPrimitive(uint localID, UUID ownerID, Vector3 acc, Vector3 rvel, PrimitiveBaseShape primShape, Vector3 pos, UUID objectID, Vector3 vel, Quaternion rotation, uint flags, string text, byte[] textColor, uint parentID, byte[] particleSystem, byte clickAction, byte material, byte[] textureanim)
309 { 309// {
310 String typeName = ToOmType(primShape.PCode); 310// String typeName = ToOmType(primShape.PCode);
311 m_log.Info("[MXP ClientStack] Transmitting Primitive" + typeName); 311// m_log.Info("[MXP ClientStack] Transmitting Primitive" + typeName);
312 312//
313 PerceptionEventMessage pe = new PerceptionEventMessage(); 313// PerceptionEventMessage pe = new PerceptionEventMessage();
314 pe.ObjectFragment.ObjectId = objectID.Guid; 314// pe.ObjectFragment.ObjectId = objectID.Guid;
315 315//
316 pe.ObjectFragment.ParentObjectId = Guid.Empty; 316// pe.ObjectFragment.ParentObjectId = Guid.Empty;
317 317//
318 // Resolving parent UUID. 318// // Resolving parent UUID.
319 OpenSim.Region.Framework.Scenes.Scene scene = (OpenSim.Region.Framework.Scenes.Scene)Scene; 319// OpenSim.Region.Framework.Scenes.Scene scene = (OpenSim.Region.Framework.Scenes.Scene)Scene;
320 if (scene.Entities.ContainsKey(parentID)) 320// if (scene.Entities.ContainsKey(parentID))
321 { 321// {
322 pe.ObjectFragment.ParentObjectId = scene.Entities[parentID].UUID.Guid; 322// pe.ObjectFragment.ParentObjectId = scene.Entities[parentID].UUID.Guid;
323 } 323// }
324 324//
325 pe.ObjectFragment.ObjectIndex = localID; 325// pe.ObjectFragment.ObjectIndex = localID;
326 pe.ObjectFragment.ObjectName = typeName + " Object"; 326// pe.ObjectFragment.ObjectName = typeName + " Object";
327 pe.ObjectFragment.OwnerId = ownerID.Guid; 327// pe.ObjectFragment.OwnerId = ownerID.Guid;
328 pe.ObjectFragment.TypeId = Guid.Empty; 328// pe.ObjectFragment.TypeId = Guid.Empty;
329 pe.ObjectFragment.TypeName = typeName; 329// pe.ObjectFragment.TypeName = typeName;
330 pe.ObjectFragment.Acceleration = ToOmVector(acc); 330// pe.ObjectFragment.Acceleration = ToOmVector(acc);
331 pe.ObjectFragment.AngularAcceleration=new MsdQuaternion4f(); 331// pe.ObjectFragment.AngularAcceleration=new MsdQuaternion4f();
332 pe.ObjectFragment.AngularVelocity = ToOmQuaternion(rvel); 332// pe.ObjectFragment.AngularVelocity = ToOmQuaternion(rvel);
333 pe.ObjectFragment.BoundingSphereRadius = primShape.Scale.Length(); 333// pe.ObjectFragment.BoundingSphereRadius = primShape.Scale.Length();
334 334//
335 pe.ObjectFragment.Location = ToOmVector(pos); 335// pe.ObjectFragment.Location = ToOmVector(pos);
336 336//
337 pe.ObjectFragment.Mass = 1.0f; 337// pe.ObjectFragment.Mass = 1.0f;
338 pe.ObjectFragment.Orientation = ToOmQuaternion(rotation); 338// pe.ObjectFragment.Orientation = ToOmQuaternion(rotation);
339 pe.ObjectFragment.Velocity =ToOmVector(vel); 339// pe.ObjectFragment.Velocity =ToOmVector(vel);
340 340//
341 OmSlPrimitiveExt ext = new OmSlPrimitiveExt(); 341// OmSlPrimitiveExt ext = new OmSlPrimitiveExt();
342 342//
343 if (!((primShape.PCode == (byte)PCode.NewTree) || (primShape.PCode == (byte)PCode.Tree) || (primShape.PCode == (byte)PCode.Grass))) 343// if (!((primShape.PCode == (byte)PCode.NewTree) || (primShape.PCode == (byte)PCode.Tree) || (primShape.PCode == (byte)PCode.Grass)))
344 { 344// {
345 345//
346 ext.PathBegin = primShape.PathBegin; 346// ext.PathBegin = primShape.PathBegin;
347 ext.PathEnd = primShape.PathEnd; 347// ext.PathEnd = primShape.PathEnd;
348 ext.PathScaleX = primShape.PathScaleX; 348// ext.PathScaleX = primShape.PathScaleX;
349 ext.PathScaleY = primShape.PathScaleY; 349// ext.PathScaleY = primShape.PathScaleY;
350 ext.PathShearX = primShape.PathShearX; 350// ext.PathShearX = primShape.PathShearX;
351 ext.PathShearY = primShape.PathShearY; 351// ext.PathShearY = primShape.PathShearY;
352 ext.PathSkew = primShape.PathSkew; 352// ext.PathSkew = primShape.PathSkew;
353 ext.ProfileBegin = primShape.ProfileBegin; 353// ext.ProfileBegin = primShape.ProfileBegin;
354 ext.ProfileEnd = primShape.ProfileEnd; 354// ext.ProfileEnd = primShape.ProfileEnd;
355 ext.PathCurve = primShape.PathCurve; 355// ext.PathCurve = primShape.PathCurve;
356 ext.ProfileCurve = primShape.ProfileCurve; 356// ext.ProfileCurve = primShape.ProfileCurve;
357 ext.ProfileHollow = primShape.ProfileHollow; 357// ext.ProfileHollow = primShape.ProfileHollow;
358 ext.PathRadiusOffset = primShape.PathRadiusOffset; 358// ext.PathRadiusOffset = primShape.PathRadiusOffset;
359 ext.PathRevolutions = primShape.PathRevolutions; 359// ext.PathRevolutions = primShape.PathRevolutions;
360 ext.PathTaperX = primShape.PathTaperX; 360// ext.PathTaperX = primShape.PathTaperX;
361 ext.PathTaperY = primShape.PathTaperY; 361// ext.PathTaperY = primShape.PathTaperY;
362 ext.PathTwist = primShape.PathTwist; 362// ext.PathTwist = primShape.PathTwist;
363 ext.PathTwistBegin = primShape.PathTwistBegin; 363// ext.PathTwistBegin = primShape.PathTwistBegin;
364 364//
365 365//
366 } 366// }
367 367//
368 ext.UpdateFlags = flags; 368// ext.UpdateFlags = flags;
369 ext.ExtraParams = primShape.ExtraParams; 369// ext.ExtraParams = primShape.ExtraParams;
370 ext.State = primShape.State; 370// ext.State = primShape.State;
371 ext.TextureEntry = primShape.TextureEntry; 371// ext.TextureEntry = primShape.TextureEntry;
372 ext.TextureAnim = textureanim; 372// ext.TextureAnim = textureanim;
373 ext.Scale = ToOmVector(primShape.Scale); 373// ext.Scale = ToOmVector(primShape.Scale);
374 ext.Text = text; 374// ext.Text = text;
375 ext.TextColor = ToOmColor(textColor); 375// ext.TextColor = ToOmColor(textColor);
376 ext.PSBlock = particleSystem; 376// ext.PSBlock = particleSystem;
377 ext.ClickAction = clickAction; 377// ext.ClickAction = clickAction;
378 ext.Material = material; 378// ext.Material = material;
379 379//
380 pe.SetExtension<OmSlPrimitiveExt>(ext); 380// pe.SetExtension<OmSlPrimitiveExt>(ext);
381 381//
382 Session.Send(pe); 382// Session.Send(pe);
383 383//
384 if (m_objectsSynchronized != -1) 384// if (m_objectsSynchronized != -1)
385 { 385// {
386 m_objectsSynchronized++; 386// m_objectsSynchronized++;
387 387//
388 if (m_objectsToSynchronize >= m_objectsSynchronized) 388// if (m_objectsToSynchronize >= m_objectsSynchronized)
389 { 389// {
390 SynchronizationEndEventMessage synchronizationEndEventMessage = new SynchronizationEndEventMessage(); 390// SynchronizationEndEventMessage synchronizationEndEventMessage = new SynchronizationEndEventMessage();
391 Session.Send(synchronizationEndEventMessage); 391// Session.Send(synchronizationEndEventMessage);
392 m_objectsSynchronized = -1; 392// m_objectsSynchronized = -1;
393 } 393// }
394 } 394// }
395 } 395// }
396 396
397 public void MXPSendAvatarData(string participantName, UUID ownerID, UUID parentId, UUID avatarID, uint avatarLocalID, Vector3 position, Quaternion rotation) 397 public void MXPSendAvatarData(string participantName, UUID ownerID, UUID parentId, UUID avatarID, uint avatarLocalID, Vector3 position, Quaternion rotation)
398 { 398 {
diff --git a/OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs b/OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs
index 2098625..7056e01 100644
--- a/OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs
+++ b/OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs
@@ -63,7 +63,7 @@ namespace OpenSim.Client.MXP.PacketHandler
63 private readonly IList<MXPClientView> m_sessionsToRemove = new List<MXPClientView>(); 63 private readonly IList<MXPClientView> m_sessionsToRemove = new List<MXPClientView>();
64 64
65 private readonly int m_port; 65 private readonly int m_port;
66 private readonly bool m_accountsAuthenticate; 66// private readonly bool m_accountsAuthenticate;
67 67
68 private readonly String m_programName; 68 private readonly String m_programName;
69 private readonly byte m_programMajorVersion; 69 private readonly byte m_programMajorVersion;
@@ -76,7 +76,7 @@ namespace OpenSim.Client.MXP.PacketHandler
76 public MXPPacketServer(int port, Dictionary<UUID, Scene> scenes, bool accountsAuthenticate) 76 public MXPPacketServer(int port, Dictionary<UUID, Scene> scenes, bool accountsAuthenticate)
77 { 77 {
78 m_port = port; 78 m_port = port;
79 m_accountsAuthenticate = accountsAuthenticate; 79// m_accountsAuthenticate = accountsAuthenticate;
80 80
81 m_scenes = scenes; 81 m_scenes = scenes;
82 82
@@ -491,7 +491,6 @@ namespace OpenSim.Client.MXP.PacketHandler
491 491
492 public bool AuthoriseUser(string participantName, string password, UUID sceneId, out UserAccount account) 492 public bool AuthoriseUser(string participantName, string password, UUID sceneId, out UserAccount account)
493 { 493 {
494 UUID userId = UUID.Zero;
495 string firstName = ""; 494 string firstName = "";
496 string lastName = ""; 495 string lastName = "";
497 account = null; 496 account = null;
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs
index ec25118..e36a72b 100644
--- a/OpenSim/Framework/RegionInfo.cs
+++ b/OpenSim/Framework/RegionInfo.cs
@@ -806,7 +806,7 @@ namespace OpenSim.Framework
806 IConfig config = source.Configs[RegionName]; 806 IConfig config = source.Configs[RegionName];
807 807
808 if (config != null) 808 if (config != null)
809 source.Configs.Remove(RegionName); 809 source.Configs.Remove(config);
810 810
811 config = source.AddConfig(RegionName); 811 config = source.AddConfig(RegionName);
812 812
@@ -865,10 +865,15 @@ namespace OpenSim.Framework
865 865
866 return; 866 return;
867 } 867 }
868 configMember = new ConfigurationMember(filename, description, loadConfigurationOptionsFromMe, 868 else if (filename.ToLower().EndsWith(".xml"))
869 ignoreIncomingConfiguration, false); 869 {
870 configMember.performConfigurationRetrieve(); 870 configMember = new ConfigurationMember(filename, description, loadConfigurationOptionsFromMe,
871 RegionFile = filename; 871 ignoreIncomingConfiguration, false);
872 configMember.performConfigurationRetrieve();
873 RegionFile = filename;
874 }
875 else
876 throw new Exception("Invalid file type for region persistence.");
872 } 877 }
873 878
874 public void loadConfigurationOptionsFromMe() 879 public void loadConfigurationOptionsFromMe()
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index 95c3e6c..d20f8c9 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -28,6 +28,7 @@
28using System; 28using System;
29using System.Collections; 29using System.Collections;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Collections.Specialized;
31using System.IO; 32using System.IO;
32using System.Net; 33using System.Net;
33using System.Net.Sockets; 34using System.Net.Sockets;
@@ -737,6 +738,7 @@ namespace OpenSim.Framework.Servers.HttpServer
737 if (methodWasFound) 738 if (methodWasFound)
738 { 739 {
739 xmlRprcRequest.Params.Add(request.Url); // Param[2] 740 xmlRprcRequest.Params.Add(request.Url); // Param[2]
741 xmlRprcRequest.Params.Add(request.Headers.Get("X-Forwarded-For")); // Param[3]
740 742
741 try 743 try
742 { 744 {
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index af5a0ce..b66d826 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -1495,5 +1495,49 @@ namespace OpenSim.Framework
1495 } 1495 }
1496 } 1496 }
1497 1497
1498 /// <summary>
1499 /// Gets the client IP address
1500 /// </summary>
1501 /// <param name="xff"></param>
1502 /// <returns></returns>
1503 public static IPEndPoint GetClientIPFromXFF(string xff)
1504 {
1505 if (xff == string.Empty)
1506 return null;
1507
1508 string[] parts = xff.Split(new char[] { ',' });
1509 if (parts.Length > 0)
1510 {
1511 try
1512 {
1513 return new IPEndPoint(IPAddress.Parse(parts[0]), 0);
1514 }
1515 catch (Exception e)
1516 {
1517 m_log.WarnFormat("[UTIL]: Exception parsing XFF header {0}: {1}", xff, e.Message);
1518 }
1519 }
1520
1521 return null;
1522 }
1523
1524 public static string GetCallerIP(Hashtable req)
1525 {
1526 if (req.ContainsKey("headers"))
1527 {
1528 try
1529 {
1530 Hashtable headers = (Hashtable)req["headers"];
1531 if (headers.ContainsKey("remote_addr") && headers["remote_addr"] != null)
1532 return headers["remote_addr"].ToString();
1533 }
1534 catch (Exception e)
1535 {
1536 m_log.WarnFormat("[UTIL]: exception in GetCallerIP: {0}", e.Message);
1537 }
1538 }
1539 return string.Empty;
1540 }
1541
1498 } 1542 }
1499} 1543}
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs
index c791cb4..4609738 100644
--- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs
+++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs
@@ -214,8 +214,6 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
214 { 214 {
215 m_userTransactions.Manager.MyScene.AssetService.Store(m_asset); 215 m_userTransactions.Manager.MyScene.AssetService.Store(m_asset);
216 216
217 IInventoryService invService = m_userTransactions.Manager.MyScene.InventoryService;
218
219 InventoryItemBase item = new InventoryItemBase(); 217 InventoryItemBase item = new InventoryItemBase();
220 item.Owner = ourClient.AgentId; 218 item.Owner = ourClient.AgentId;
221 item.CreatorId = ourClient.AgentId.ToString(); 219 item.CreatorId = ourClient.AgentId.ToString();
@@ -234,7 +232,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
234 item.Flags = (uint) wearableType; 232 item.Flags = (uint) wearableType;
235 item.CreationDate = Util.UnixTimeSinceEpoch(); 233 item.CreationDate = Util.UnixTimeSinceEpoch();
236 234
237 if (invService.AddItem(item)) 235 if (m_userTransactions.Manager.MyScene.AddInventoryItem(item))
238 ourClient.SendInventoryItemCreateUpdate(item, callbackID); 236 ourClient.SendInventoryItemCreateUpdate(item, callbackID);
239 else 237 else
240 ourClient.SendAlertMessage("Unable to create inventory item"); 238 ourClient.SendAlertMessage("Unable to create inventory item");
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
index 22c84e9..52342ec 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
@@ -406,8 +406,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
406 // Reset folder ID to the one in which we want to load it 406 // Reset folder ID to the one in which we want to load it
407 item.Folder = loadFolder.ID; 407 item.Folder = loadFolder.ID;
408 408
409 //m_userInfo.AddItem(item); 409 m_scene.AddInventoryItem(item);
410 m_scene.InventoryService.AddItem(item);
411 410
412 return item; 411 return item;
413 } 412 }
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs
index 8343091..47e34dc 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs
@@ -41,7 +41,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
41 /// </summary> 41 /// </summary>
42 public static class InventoryArchiveUtils 42 public static class InventoryArchiveUtils
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 // Character used for escaping the path delimter ("\/") and itself ("\\") in human escaped strings 46 // Character used for escaping the path delimter ("\/") and itself ("\\") in human escaped strings
47 public static readonly char ESCAPE_CHARACTER = '\\'; 47 public static readonly char ESCAPE_CHARACTER = '\\';
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
index 0218f86..d66a1d0 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs
@@ -163,7 +163,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
163 InventoryFolderBase objsFolder 163 InventoryFolderBase objsFolder
164 = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, userId, "Objects")[0]; 164 = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, userId, "Objects")[0];
165 item1.Folder = objsFolder.ID; 165 item1.Folder = objsFolder.ID;
166 scene.AddInventoryItem(userId, item1); 166 scene.AddInventoryItem(item1);
167 167
168 MemoryStream archiveWriteStream = new MemoryStream(); 168 MemoryStream archiveWriteStream = new MemoryStream();
169 archiverModule.OnInventoryArchiveSaved += SaveCompleted; 169 archiverModule.OnInventoryArchiveSaved += SaveCompleted;
@@ -282,7 +282,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
282 InventoryFolderBase objsFolder 282 InventoryFolderBase objsFolder
283 = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, userId, "Objects")[0]; 283 = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, userId, "Objects")[0];
284 item1.Folder = objsFolder.ID; 284 item1.Folder = objsFolder.ID;
285 scene.AddInventoryItem(userId, item1); 285 scene.AddInventoryItem(item1);
286 286
287 MemoryStream archiveWriteStream = new MemoryStream(); 287 MemoryStream archiveWriteStream = new MemoryStream();
288 archiverModule.OnInventoryArchiveSaved += SaveCompleted; 288 archiverModule.OnInventoryArchiveSaved += SaveCompleted;
@@ -485,7 +485,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
485 InventoryFolderBase objsFolder 485 InventoryFolderBase objsFolder
486 = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, userId, "Objects")[0]; 486 = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, userId, "Objects")[0];
487 item1.Folder = objsFolder.ID; 487 item1.Folder = objsFolder.ID;
488 scene.AddInventoryItem(userId, item1); 488 scene.AddInventoryItem(item1);
489 489
490 MemoryStream archiveWriteStream = new MemoryStream(); 490 MemoryStream archiveWriteStream = new MemoryStream();
491 archiverModule.OnInventoryArchiveSaved += SaveCompleted; 491 archiverModule.OnInventoryArchiveSaved += SaveCompleted;
diff --git a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs
index 6294935..b62df18 100644
--- a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs
+++ b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs
@@ -54,12 +54,12 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
54 }; 54 };
55 } 55 }
56 56
57 private static byte[] uintToByteArray(uint uIntValue) 57// private static byte[] uintToByteArray(uint uIntValue)
58 { 58// {
59 byte[] result = new byte[4]; 59// byte[] result = new byte[4];
60 Utils.UIntToBytesBig(uIntValue, result, 0); 60// Utils.UIntToBytesBig(uIntValue, result, 0);
61 return result; 61// return result;
62 } 62// }
63 63
64 public static OSD buildEvent(string eventName, OSD eventBody) 64 public static OSD buildEvent(string eventName, OSD eventBody)
65 { 65 {
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
index c673b31..125a397 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
@@ -132,7 +132,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
132 } 132 }
133 133
134 // DO NOT OVERRIDE THE BASE METHOD 134 // DO NOT OVERRIDE THE BASE METHOD
135 public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID, 135 public new virtual UUID DeleteToInventory(DeRezAction action, UUID folderID,
136 SceneObjectGroup objectGroup, IClientAPI remoteClient) 136 SceneObjectGroup objectGroup, IClientAPI remoteClient)
137 { 137 {
138 UUID assetID = base.DeleteToInventory(action, folderID, new List<SceneObjectGroup>() {objectGroup}, remoteClient); 138 UUID assetID = base.DeleteToInventory(action, folderID, new List<SceneObjectGroup>() {objectGroup}, remoteClient);
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index 4159610..37f6ea0 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -430,7 +430,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
430 item.Name = asset.Name; 430 item.Name = asset.Name;
431 item.AssetType = asset.Type; 431 item.AssetType = asset.Type;
432 432
433 m_Scene.InventoryService.AddItem(item); 433 m_Scene.AddInventoryItem(item);
434 434
435 if (remoteClient != null && item.Owner == remoteClient.AgentId) 435 if (remoteClient != null && item.Owner == remoteClient.AgentId)
436 { 436 {
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
index 97161fc..5b4fecb 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/ 2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs
index 915b59e..cbd9e05 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs
@@ -221,34 +221,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
221// m_log.DebugFormat( 221// m_log.DebugFormat(
222// "[LOCAL INVENTORY SERVICES CONNECTOR]: Adding inventory item {0} to user {1} folder {2}", 222// "[LOCAL INVENTORY SERVICES CONNECTOR]: Adding inventory item {0} to user {1} folder {2}",
223// item.Name, item.Owner, item.Folder); 223// item.Name, item.Owner, item.Folder);
224
225 if (UUID.Zero == item.Folder)
226 {
227 InventoryFolderBase f = m_InventoryService.GetFolderForType(item.Owner, (AssetType)item.AssetType);
228 if (f != null)
229 {
230// m_log.DebugFormat(
231// "[LOCAL INVENTORY SERVICES CONNECTOR]: Found folder {0} type {1} for item {2}",
232// f.Name, (AssetType)f.Type, item.Name);
233
234 item.Folder = f.ID;
235 }
236 else
237 {
238 f = m_InventoryService.GetRootFolder(item.Owner);
239 if (f != null)
240 {
241 item.Folder = f.ID;
242 }
243 else
244 {
245// m_log.WarnFormat(
246// "[LOCAL INVENTORY SERVICES CONNECTOR]: Could not find root folder for {0} when trying to add item {1} with no parent folder specified",
247// item.Owner, item.Name);
248 return false;
249 }
250 }
251 }
252 224
253 return m_InventoryService.AddItem(item); 225 return m_InventoryService.AddItem(item);
254 } 226 }
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs
index 4211fa9..4ab6947 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs
@@ -227,31 +227,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
227 public bool AddItem(InventoryItemBase item) 227 public bool AddItem(InventoryItemBase item)
228 { 228 {
229 if (item == null) 229 if (item == null)
230 return false; 230 return false;
231
232 if (UUID.Zero == item.Folder)
233 {
234 InventoryFolderBase f = m_RemoteConnector.GetFolderForType(item.Owner, (AssetType)item.AssetType);
235 if (f != null)
236 {
237 item.Folder = f.ID;
238 }
239 else
240 {
241 f = m_RemoteConnector.GetRootFolder(item.Owner);
242 if (f != null)
243 {
244 item.Folder = f.ID;
245 }
246 else
247 {
248 m_log.WarnFormat(
249 "[LOCAL INVENTORY SERVICES CONNECTOR]: Could not find root folder for {0} when trying to add item {1} with no parent folder specified",
250 item.Owner, item.Name);
251 return false;
252 }
253 }
254 }
255 231
256 return m_RemoteConnector.AddItem(item); 232 return m_RemoteConnector.AddItem(item);
257 } 233 }
diff --git a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
index 8ce6daf..12750c5 100644
--- a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
+++ b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs
@@ -219,7 +219,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell
219 item.CurrentPermissions |= 16; // Slam! 219 item.CurrentPermissions |= 16; // Slam!
220 item.CreationDate = Util.UnixTimeSinceEpoch(); 220 item.CreationDate = Util.UnixTimeSinceEpoch();
221 221
222 if (m_scene.InventoryService.AddItem(item)) 222 if (m_scene.AddInventoryItem(item))
223 { 223 {
224 remoteClient.SendInventoryItemCreateUpdate(item, 0); 224 remoteClient.SendInventoryItemCreateUpdate(item, 0);
225 } 225 }
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 0d9682e..5ee8955 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -70,18 +70,18 @@ namespace OpenSim.Region.Framework.Scenes
70 70
71 public void AddUploadedInventoryItem(UUID agentID, InventoryItemBase item) 71 public void AddUploadedInventoryItem(UUID agentID, InventoryItemBase item)
72 { 72 {
73 IMoneyModule money=RequestModuleInterface<IMoneyModule>(); 73 IMoneyModule money = RequestModuleInterface<IMoneyModule>();
74 if (money != null) 74 if (money != null)
75 { 75 {
76 money.ApplyUploadCharge(agentID, money.UploadCharge, "Asset upload"); 76 money.ApplyUploadCharge(agentID, money.UploadCharge, "Asset upload");
77 } 77 }
78 78
79 AddInventoryItem(agentID, item); 79 AddInventoryItem(item);
80 } 80 }
81 81
82 public bool AddInventoryItemReturned(UUID AgentId, InventoryItemBase item) 82 public bool AddInventoryItemReturned(UUID AgentId, InventoryItemBase item)
83 { 83 {
84 if (InventoryService.AddItem(item)) 84 if (AddInventoryItem(item))
85 return true; 85 return true;
86 else 86 else
87 { 87 {
@@ -92,19 +92,23 @@ namespace OpenSim.Region.Framework.Scenes
92 } 92 }
93 } 93 }
94 94
95 public void AddInventoryItem(UUID AgentID, InventoryItemBase item) 95 /// <summary>
96 /// Add the given inventory item to a user's inventory.
97 /// </summary>
98 /// <param name="item"></param>
99 public bool AddInventoryItem(InventoryItemBase item)
96 { 100 {
97 InventoryFolderBase folder; 101 InventoryFolderBase folder;
98 102
99 if (item.Folder == UUID.Zero) 103 if (item.Folder == UUID.Zero)
100 { 104 {
101 folder = InventoryService.GetFolderForType(AgentID, (AssetType)item.AssetType); 105 folder = InventoryService.GetFolderForType(item.Owner, (AssetType)item.AssetType);
102 if (folder == null) 106 if (folder == null)
103 { 107 {
104 folder = InventoryService.GetRootFolder(AgentID); 108 folder = InventoryService.GetRootFolder(item.Owner);
105 109
106 if (folder == null) 110 if (folder == null)
107 return; 111 return false;
108 } 112 }
109 113
110 item.Folder = folder.ID; 114 item.Folder = folder.ID;
@@ -113,20 +117,37 @@ namespace OpenSim.Region.Framework.Scenes
113 if (InventoryService.AddItem(item)) 117 if (InventoryService.AddItem(item))
114 { 118 {
115 int userlevel = 0; 119 int userlevel = 0;
116 if (Permissions.IsGod(AgentID)) 120 if (Permissions.IsGod(item.Owner))
117 { 121 {
118 userlevel = 1; 122 userlevel = 1;
119 } 123 }
120 EventManager.TriggerOnNewInventoryItemUploadComplete(AgentID, item.AssetID, item.Name, userlevel); 124 EventManager.TriggerOnNewInventoryItemUploadComplete(item.Owner, item.AssetID, item.Name, userlevel);
125
126 return true;
121 } 127 }
122 else 128 else
123 { 129 {
124 m_log.WarnFormat( 130 m_log.WarnFormat(
125 "[AGENT INVENTORY]: Agent {0} could not add item {1} {2}", 131 "[AGENT INVENTORY]: Agent {0} could not add item {1} {2}",
126 AgentID, item.Name, item.ID); 132 item.Owner, item.Name, item.ID);
127 133
128 return; 134 return false;
129 } 135 }
136 }
137
138 /// <summary>
139 /// Add the given inventory item to a user's inventory.
140 /// </summary>
141 /// <param name="AgentID">
142 /// A <see cref="UUID"/>
143 /// </param>
144 /// <param name="item">
145 /// A <see cref="InventoryItemBase"/>
146 /// </param>
147 [Obsolete("Use AddInventoryItem(InventoryItemBase item) instead. This was deprecated in OpenSim 0.7.1")]
148 public void AddInventoryItem(UUID AgentID, InventoryItemBase item)
149 {
150 AddInventoryItem(item);
130 } 151 }
131 152
132 /// <summary> 153 /// <summary>
@@ -137,7 +158,7 @@ namespace OpenSim.Region.Framework.Scenes
137 /// in which the item is to be placed.</param> 158 /// in which the item is to be placed.</param>
138 public void AddInventoryItem(IClientAPI remoteClient, InventoryItemBase item) 159 public void AddInventoryItem(IClientAPI remoteClient, InventoryItemBase item)
139 { 160 {
140 AddInventoryItem(remoteClient.AgentId, item); 161 AddInventoryItem(item);
141 remoteClient.SendInventoryItemCreateUpdate(item, 0); 162 remoteClient.SendInventoryItemCreateUpdate(item, 0);
142 } 163 }
143 164
@@ -529,7 +550,7 @@ namespace OpenSim.Region.Framework.Scenes
529 itemCopy.SalePrice = item.SalePrice; 550 itemCopy.SalePrice = item.SalePrice;
530 itemCopy.SaleType = item.SaleType; 551 itemCopy.SaleType = item.SaleType;
531 552
532 if (InventoryService.AddItem(itemCopy)) 553 if (AddInventoryItem(itemCopy))
533 { 554 {
534 IInventoryAccessModule invAccess = RequestModuleInterface<IInventoryAccessModule>(); 555 IInventoryAccessModule invAccess = RequestModuleInterface<IInventoryAccessModule>();
535 if (invAccess != null) 556 if (invAccess != null)
@@ -775,8 +796,10 @@ namespace OpenSim.Region.Framework.Scenes
775 item.BasePermissions = baseMask; 796 item.BasePermissions = baseMask;
776 item.CreationDate = creationDate; 797 item.CreationDate = creationDate;
777 798
778 if (InventoryService.AddItem(item)) 799 if (AddInventoryItem(item))
800 {
779 remoteClient.SendInventoryItemCreateUpdate(item, callbackID); 801 remoteClient.SendInventoryItemCreateUpdate(item, callbackID);
802 }
780 else 803 else
781 { 804 {
782 m_dialogModule.SendAlertToUser(remoteClient, "Failed to create item"); 805 m_dialogModule.SendAlertToUser(remoteClient, "Failed to create item");
@@ -1142,7 +1165,7 @@ namespace OpenSim.Region.Framework.Scenes
1142 1165
1143 agentItem.Folder = folderId; 1166 agentItem.Folder = folderId;
1144 1167
1145 AddInventoryItem(avatarId, agentItem); 1168 AddInventoryItem(agentItem);
1146 1169
1147 return agentItem; 1170 return agentItem;
1148 } 1171 }
@@ -1266,7 +1289,7 @@ namespace OpenSim.Region.Framework.Scenes
1266 { 1289 {
1267 agentItem.Folder = newFolderID; 1290 agentItem.Folder = newFolderID;
1268 1291
1269 AddInventoryItem(destID, agentItem); 1292 AddInventoryItem(agentItem);
1270 } 1293 }
1271 } 1294 }
1272 1295
@@ -1908,7 +1931,7 @@ namespace OpenSim.Region.Framework.Scenes
1908 // sets itemID so client can show item as 'attached' in inventory 1931 // sets itemID so client can show item as 'attached' in inventory
1909 grp.SetFromItemID(item.ID); 1932 grp.SetFromItemID(item.ID);
1910 1933
1911 if (InventoryService.AddItem(item)) 1934 if (AddInventoryItem(item))
1912 remoteClient.SendInventoryItemCreateUpdate(item, 0); 1935 remoteClient.SendInventoryItemCreateUpdate(item, 0);
1913 else 1936 else
1914 m_dialogModule.SendAlertToUser(remoteClient, "Operation failed"); 1937 m_dialogModule.SendAlertToUser(remoteClient, "Operation failed");
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 400f4c0..94a9dab 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2729,6 +2729,8 @@ namespace OpenSim.Region.Framework.Scenes
2729 try 2729 try
2730 { 2730 {
2731 ScenePresence sp = GetScenePresence(agentID); 2731 ScenePresence sp = GetScenePresence(agentID);
2732 PresenceService.LogoutAgent(sp.ControllingClient.SessionId);
2733
2732 if (sp != null) 2734 if (sp != null)
2733 sp.ControllingClient.Close(); 2735 sp.ControllingClient.Close();
2734 2736
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs
index 358ce22..dfc9aa3 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs
@@ -134,5 +134,35 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
134 134
135 #endregion 135 #endregion
136 136
137 [Test]
138 // llRot2Euler test.
139 public void TestllRot2Euler()
140 {
141 // 180, 90 and zero degree rotations.
142 CheckllRot2Euler(new LSL_Types.Quaternion(1.0f, 0.0f, 0.0f, 0.0f), new LSL_Types.Vector3(Math.PI, 0.0f, 0.0f));
143 CheckllRot2Euler(new LSL_Types.Quaternion(0.0f, 1.0f, 0.0f, 0.0f), new LSL_Types.Vector3(Math.PI, 0.0f, Math.PI));
144 CheckllRot2Euler(new LSL_Types.Quaternion(0.0f, 0.0f, 1.0f, 0.0f), new LSL_Types.Vector3(0.0f, 0.0f, Math.PI));
145 CheckllRot2Euler(new LSL_Types.Quaternion(0.0f, 0.0f, 0.0f, 1.0f), new LSL_Types.Vector3(0.0f, 0.0f, 0.0f));
146 CheckllRot2Euler(new LSL_Types.Quaternion(-0.5f, -0.5f, 0.5f, 0.5f), new LSL_Types.Vector3(0, -Math.PI / 2.0f, Math.PI / 2.0f));
147 CheckllRot2Euler(new LSL_Types.Quaternion(-0.707107f, 0.0f, 0.0f, -0.707107f), new LSL_Types.Vector3(Math.PI / 2.0f, 0.0f, 0.0f));
148 // A couple of messy rotations.
149 CheckllRot2Euler(new LSL_Types.Quaternion(1.0f, 5.651f, -3.1f, 67.023f), new LSL_Types.Vector3(0.037818f, 0.166447f, -0.095595f));
150 CheckllRot2Euler(new LSL_Types.Quaternion(0.719188f, -0.408934f, -0.363998f, -0.427841f), new LSL_Types.Vector3(-1.954769f, -0.174533f, 1.151917f));
151 }
152
153 private void CheckllRot2Euler(LSL_Types.Quaternion rot, LSL_Types.Vector3 eulerCheck)
154 {
155 // Call LSL function to convert quaternion rotaion to euler radians.
156 LSL_Types.Vector3 eulerCalc = m_lslApi.llRot2Euler(rot);
157 // Check upper and lower bounds of x, y and z.
158 // This type of check is performed as opposed to comparing for equal numbers, in order to allow slight
159 // differences in accuracy.
160 Assert.Greater(eulerCalc.x, eulerCheck.x - ANGLE_ACCURACY_IN_RADIANS, "TestllRot2Euler X lower bounds check fail");
161 Assert.Less(eulerCalc.x, eulerCheck.x + ANGLE_ACCURACY_IN_RADIANS, "TestllRot2Euler X upper bounds check fail");
162 Assert.Greater(eulerCalc.y, eulerCheck.y - ANGLE_ACCURACY_IN_RADIANS, "TestllRot2Euler Y lower bounds check fail");
163 Assert.Less(eulerCalc.y, eulerCheck.y + ANGLE_ACCURACY_IN_RADIANS, "TestllRot2Euler Y upper bounds check fail");
164 Assert.Greater(eulerCalc.z, eulerCheck.z - ANGLE_ACCURACY_IN_RADIANS, "TestllRot2Euler Z lower bounds check fail");
165 Assert.Less(eulerCalc.z, eulerCheck.z + ANGLE_ACCURACY_IN_RADIANS, "TestllRot2Euler Z upper bounds check fail");
166 }
137 } 167 }
138} 168}
diff --git a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs
index e50481a..d10d6fc 100644
--- a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs
@@ -54,9 +54,12 @@ namespace OpenSim.Server.Handlers.Hypergrid
54 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 54 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
55 private IUserAgentService m_UserAgentService; 55 private IUserAgentService m_UserAgentService;
56 56
57 public HomeAgentHandler(IUserAgentService userAgentService) 57 private string m_LoginServerIP;
58
59 public HomeAgentHandler(IUserAgentService userAgentService, string loginServerIP)
58 { 60 {
59 m_UserAgentService = userAgentService; 61 m_UserAgentService = userAgentService;
62 m_LoginServerIP = loginServerIP;
60 } 63 }
61 64
62 public Hashtable Handler(Hashtable request) 65 public Hashtable Handler(Hashtable request)
@@ -120,6 +123,7 @@ namespace OpenSim.Server.Handlers.Hypergrid
120 string regionname = string.Empty; 123 string regionname = string.Empty;
121 string gatekeeper_host = string.Empty; 124 string gatekeeper_host = string.Empty;
122 int gatekeeper_port = 0; 125 int gatekeeper_port = 0;
126 IPEndPoint client_ipaddress = null;
123 127
124 if (args.ContainsKey("gatekeeper_host") && args["gatekeeper_host"] != null) 128 if (args.ContainsKey("gatekeeper_host") && args["gatekeeper_host"] != null)
125 gatekeeper_host = args["gatekeeper_host"].AsString(); 129 gatekeeper_host = args["gatekeeper_host"].AsString();
@@ -144,6 +148,24 @@ namespace OpenSim.Server.Handlers.Hypergrid
144 if (args.ContainsKey("destination_name") && args["destination_name"] != null) 148 if (args.ContainsKey("destination_name") && args["destination_name"] != null)
145 regionname = args["destination_name"].ToString(); 149 regionname = args["destination_name"].ToString();
146 150
151 if (args.ContainsKey("client_ip") && args["client_ip"] != null)
152 {
153 string ip_str = args["client_ip"].ToString();
154 try
155 {
156 string callerIP = Util.GetCallerIP(request);
157 // Verify if this caller has authority to send the client IP
158 if (callerIP == m_LoginServerIP)
159 client_ipaddress = new IPEndPoint(IPAddress.Parse(ip_str), 0);
160 else
161 m_log.WarnFormat("[HOME AGENT HANDLER]: Unauthorized machine {0} tried to set client ip to {1}", callerIP, ip_str);
162 }
163 catch
164 {
165 m_log.DebugFormat("[HOME AGENT HANDLER]: Exception parsing client ip address from {0}", ip_str);
166 }
167 }
168
147 GridRegion destination = new GridRegion(); 169 GridRegion destination = new GridRegion();
148 destination.RegionID = uuid; 170 destination.RegionID = uuid;
149 destination.RegionLocX = x; 171 destination.RegionLocX = x;
@@ -166,7 +188,7 @@ namespace OpenSim.Server.Handlers.Hypergrid
166 OSDMap resp = new OSDMap(2); 188 OSDMap resp = new OSDMap(2);
167 string reason = String.Empty; 189 string reason = String.Empty;
168 190
169 bool result = m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, out reason); 191 bool result = m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, client_ipaddress, out reason);
170 192
171 resp["reason"] = OSD.FromString(reason); 193 resp["reason"] = OSD.FromString(reason);
172 resp["success"] = OSD.FromBoolean(result); 194 resp["success"] = OSD.FromBoolean(result);
diff --git a/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs b/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs
index 6b1152b..70157d5 100644
--- a/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs
@@ -66,13 +66,15 @@ namespace OpenSim.Server.Handlers.Hypergrid
66 if (m_HomeUsersService == null) 66 if (m_HomeUsersService == null)
67 throw new Exception("UserAgent server connector cannot proceed because of missing service"); 67 throw new Exception("UserAgent server connector cannot proceed because of missing service");
68 68
69 string loginServerIP = gridConfig.GetString("LoginServerIP", "127.0.0.1");
70
69 server.AddXmlRPCHandler("agent_is_coming_home", AgentIsComingHome, false); 71 server.AddXmlRPCHandler("agent_is_coming_home", AgentIsComingHome, false);
70 server.AddXmlRPCHandler("get_home_region", GetHomeRegion, false); 72 server.AddXmlRPCHandler("get_home_region", GetHomeRegion, false);
71 server.AddXmlRPCHandler("verify_agent", VerifyAgent, false); 73 server.AddXmlRPCHandler("verify_agent", VerifyAgent, false);
72 server.AddXmlRPCHandler("verify_client", VerifyClient, false); 74 server.AddXmlRPCHandler("verify_client", VerifyClient, false);
73 server.AddXmlRPCHandler("logout_agent", LogoutAgent, false); 75 server.AddXmlRPCHandler("logout_agent", LogoutAgent, false);
74 76
75 server.AddHTTPHandler("/homeagent/", new HomeAgentHandler(m_HomeUsersService).Handler); 77 server.AddHTTPHandler("/homeagent/", new HomeAgentHandler(m_HomeUsersService, loginServerIP).Handler);
76 } 78 }
77 79
78 public XmlRpcResponse GetHomeRegion(XmlRpcRequest request, IPEndPoint remoteClient) 80 public XmlRpcResponse GetHomeRegion(XmlRpcRequest request, IPEndPoint remoteClient)
diff --git a/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs b/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs
index 5bb529c..30dc65e 100644
--- a/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs
+++ b/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs
@@ -52,15 +52,24 @@ namespace OpenSim.Server.Handlers.Login
52 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 52 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
53 53
54 private ILoginService m_LocalService; 54 private ILoginService m_LocalService;
55 private bool m_Proxy;
55 56
56 public LLLoginHandlers(ILoginService service) 57 public LLLoginHandlers(ILoginService service, bool hasProxy)
57 { 58 {
58 m_LocalService = service; 59 m_LocalService = service;
60 m_Proxy = hasProxy;
59 } 61 }
60 62
61 public XmlRpcResponse HandleXMLRPCLogin(XmlRpcRequest request, IPEndPoint remoteClient) 63 public XmlRpcResponse HandleXMLRPCLogin(XmlRpcRequest request, IPEndPoint remoteClient)
62 { 64 {
63 Hashtable requestData = (Hashtable)request.Params[0]; 65 Hashtable requestData = (Hashtable)request.Params[0];
66 if (m_Proxy && request.Params[3] != null)
67 {
68 IPEndPoint ep = Util.GetClientIPFromXFF((string)request.Params[3]);
69 if (ep != null)
70 // Bang!
71 remoteClient = ep;
72 }
64 73
65 if (requestData != null) 74 if (requestData != null)
66 { 75 {
@@ -189,6 +198,7 @@ namespace OpenSim.Server.Handlers.Login
189 198
190 return map; 199 return map;
191 } 200 }
201
192 } 202 }
193 203
194} 204}
diff --git a/OpenSim/Server/Handlers/Login/LLLoginServiceInConnector.cs b/OpenSim/Server/Handlers/Login/LLLoginServiceInConnector.cs
index 67e8392..16c93c8 100644
--- a/OpenSim/Server/Handlers/Login/LLLoginServiceInConnector.cs
+++ b/OpenSim/Server/Handlers/Login/LLLoginServiceInConnector.cs
@@ -43,6 +43,7 @@ namespace OpenSim.Server.Handlers.Login
43 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 43 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
44 44
45 private ILoginService m_LoginService; 45 private ILoginService m_LoginService;
46 private bool m_Proxy;
46 47
47 public LLLoginServiceInConnector(IConfigSource config, IHttpServer server, IScene scene) : 48 public LLLoginServiceInConnector(IConfigSource config, IHttpServer server, IScene scene) :
48 base(config, server, String.Empty) 49 base(config, server, String.Empty)
@@ -81,12 +82,14 @@ namespace OpenSim.Server.Handlers.Login
81 if (loginService == string.Empty) 82 if (loginService == string.Empty)
82 throw new Exception(String.Format("No LocalServiceModule for LoginService in config file")); 83 throw new Exception(String.Format("No LocalServiceModule for LoginService in config file"));
83 84
85 m_Proxy = serverConfig.GetBoolean("HasProxy", false);
86
84 return loginService; 87 return loginService;
85 } 88 }
86 89
87 private void InitializeHandlers(IHttpServer server) 90 private void InitializeHandlers(IHttpServer server)
88 { 91 {
89 LLLoginHandlers loginHandlers = new LLLoginHandlers(m_LoginService); 92 LLLoginHandlers loginHandlers = new LLLoginHandlers(m_LoginService, m_Proxy);
90 server.AddXmlRPCHandler("login_to_simulator", loginHandlers.HandleXMLRPCLogin, false); 93 server.AddXmlRPCHandler("login_to_simulator", loginHandlers.HandleXMLRPCLogin, false);
91 server.AddXmlRPCHandler("set_login_level", loginHandlers.HandleXMLRPCSetLoginLevel, false); 94 server.AddXmlRPCHandler("set_login_level", loginHandlers.HandleXMLRPCSetLoginLevel, false);
92 server.SetDefaultLLSDHandler(loginHandlers.HandleLLSDLogin); 95 server.SetDefaultLLSDHandler(loginHandlers.HandleLLSDLogin);
diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
index 05b00e5..42ea296 100644
--- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
@@ -184,7 +184,7 @@ namespace OpenSim.Server.Handlers.Simulation
184 resp["reason"] = OSD.FromString(reason); 184 resp["reason"] = OSD.FromString(reason);
185 resp["success"] = OSD.FromBoolean(result); 185 resp["success"] = OSD.FromBoolean(result);
186 // Let's also send out the IP address of the caller back to the caller (HG 1.5) 186 // Let's also send out the IP address of the caller back to the caller (HG 1.5)
187 resp["your_ip"] = OSD.FromString(GetCallerIP(request)); 187 resp["your_ip"] = OSD.FromString(Util.GetCallerIP(request));
188 188
189 // TODO: add reason if not String.Empty? 189 // TODO: add reason if not String.Empty?
190 responsedata["int_response_code"] = HttpStatusCode.OK; 190 responsedata["int_response_code"] = HttpStatusCode.OK;
@@ -378,23 +378,6 @@ namespace OpenSim.Server.Handlers.Simulation
378 m_SimulationService.ReleaseAgent(regionID, id, ""); 378 m_SimulationService.ReleaseAgent(regionID, id, "");
379 } 379 }
380 380
381 private string GetCallerIP(Hashtable req)
382 {
383 if (req.ContainsKey("headers"))
384 {
385 try
386 {
387 Hashtable headers = (Hashtable)req["headers"];
388 if (headers.ContainsKey("remote_addr") && headers["remote_addr"] != null)
389 return headers["remote_addr"].ToString();
390 }
391 catch (Exception e)
392 {
393 m_log.WarnFormat("[AGENT HANDLER]: exception in GetCallerIP: {0}", e.Message);
394 }
395 }
396 return string.Empty;
397 }
398 } 381 }
399 382
400} 383}
diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
index 7fa086a..6d3c64a 100644
--- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
@@ -66,20 +66,34 @@ namespace OpenSim.Services.Connectors.Hypergrid
66 { 66 {
67 m_log.DebugFormat("[USER AGENT CONNECTOR]: Malformed Uri {0}: {1}", m_ServerURL, e.Message); 67 m_log.DebugFormat("[USER AGENT CONNECTOR]: Malformed Uri {0}: {1}", m_ServerURL, e.Message);
68 } 68 }
69 m_log.DebugFormat("[USER AGENT CONNECTOR]: new connector to {0} ({1})", url, m_ServerURL);
69 } 70 }
70 71
71 public UserAgentServiceConnector(IConfigSource config) 72 public UserAgentServiceConnector(IConfigSource config)
72 { 73 {
73 } 74 IConfig serviceConfig = config.Configs["UserAgentService"];
75 if (serviceConfig == null)
76 {
77 m_log.Error("[USER AGENT CONNECTOR]: UserAgentService missing from ini");
78 throw new Exception("UserAgent connector init error");
79 }
74 80
75 public bool LoginAgentToGrid(AgentCircuitData agent, GridRegion gatekeeper, GridRegion finalDestination, IPEndPoint ipaddress, out string reason) 81 string serviceURI = serviceConfig.GetString("UserAgentServerURI",
76 { 82 String.Empty);
77 // not available over remote calls 83
78 reason = "Method not available over remote calls"; 84 if (serviceURI == String.Empty)
79 return false; 85 {
86 m_log.Error("[USER AGENT CONNECTOR]: No Server URI named in section UserAgentService");
87 throw new Exception("UserAgent connector init error");
88 }
89 m_ServerURL = serviceURI;
90
91 m_log.DebugFormat("[USER AGENT CONNECTOR]: UserAgentServiceConnector started for {0}", m_ServerURL);
80 } 92 }
81 93
82 public bool LoginAgentToGrid(AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination, out string reason) 94
95 // The Login service calls this interface with a non-null [client] ipaddress
96 public bool LoginAgentToGrid(AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination, IPEndPoint ipaddress, out string reason)
83 { 97 {
84 reason = String.Empty; 98 reason = String.Empty;
85 99
@@ -90,7 +104,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
90 return false; 104 return false;
91 } 105 }
92 106
93 string uri = m_ServerURL + "/homeagent/" + aCircuit.AgentID + "/"; 107 string uri = m_ServerURL + "/homeagent/" + aCircuit.AgentID + "/";
94 108
95 Console.WriteLine(" >>> LoginAgentToGrid <<< " + uri); 109 Console.WriteLine(" >>> LoginAgentToGrid <<< " + uri);
96 110
@@ -102,7 +116,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
102 //AgentCreateRequest.Headers.Add("Authorization", authKey); 116 //AgentCreateRequest.Headers.Add("Authorization", authKey);
103 117
104 // Fill it in 118 // Fill it in
105 OSDMap args = PackCreateAgentArguments(aCircuit, gatekeeper, destination); 119 OSDMap args = PackCreateAgentArguments(aCircuit, gatekeeper, destination, ipaddress);
106 120
107 string strBuffer = ""; 121 string strBuffer = "";
108 byte[] buffer = new byte[1]; 122 byte[] buffer = new byte[1];
@@ -199,7 +213,14 @@ namespace OpenSim.Services.Connectors.Hypergrid
199 213
200 } 214 }
201 215
202 protected OSDMap PackCreateAgentArguments(AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination) 216
217 // The simulators call this interface
218 public bool LoginAgentToGrid(AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination, out string reason)
219 {
220 return LoginAgentToGrid(aCircuit, gatekeeper, destination, null, out reason);
221 }
222
223 protected OSDMap PackCreateAgentArguments(AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination, IPEndPoint ipaddress)
203 { 224 {
204 OSDMap args = null; 225 OSDMap args = null;
205 try 226 try
@@ -217,6 +238,8 @@ namespace OpenSim.Services.Connectors.Hypergrid
217 args["destination_y"] = OSD.FromString(destination.RegionLocY.ToString()); 238 args["destination_y"] = OSD.FromString(destination.RegionLocY.ToString());
218 args["destination_name"] = OSD.FromString(destination.RegionName); 239 args["destination_name"] = OSD.FromString(destination.RegionName);
219 args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString()); 240 args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString());
241 if (ipaddress != null)
242 args["client_ip"] = OSD.FromString(ipaddress.Address.ToString());
220 243
221 return args; 244 return args;
222 } 245 }
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs
index 616b5a7..3a4f84f 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs
@@ -85,27 +85,20 @@ namespace OpenSim.Services.Connectors.SimianGrid
85 85
86 public void Initialise(IConfigSource source) 86 public void Initialise(IConfigSource source)
87 { 87 {
88 if (Simian.IsSimianEnabled(source, "AssetServices", this.Name)) 88 IConfig gridConfig = source.Configs["AssetService"];
89 if (gridConfig != null)
89 { 90 {
90 IConfig gridConfig = source.Configs["AssetService"];
91 if (gridConfig == null)
92 {
93 m_log.Error("[SIMIAN ASSET CONNECTOR]: AssetService missing from OpenSim.ini");
94 throw new Exception("Asset connector init error");
95 }
96
97 string serviceUrl = gridConfig.GetString("AssetServerURI"); 91 string serviceUrl = gridConfig.GetString("AssetServerURI");
98 if (String.IsNullOrEmpty(serviceUrl)) 92 if (!String.IsNullOrEmpty(serviceUrl))
99 { 93 {
100 m_log.Error("[SIMIAN ASSET CONNECTOR]: No AssetServerURI in section AssetService"); 94 if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
101 throw new Exception("Asset connector init error"); 95 serviceUrl = serviceUrl + '/';
96 m_serverUrl = serviceUrl;
102 } 97 }
103
104 if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
105 serviceUrl = serviceUrl + '/';
106
107 m_serverUrl = serviceUrl;
108 } 98 }
99
100 if (String.IsNullOrEmpty(m_serverUrl))
101 m_log.Info("[SIMIAN ASSET CONNECTOR]: No AssetServerURI specified, disabling connector");
109 } 102 }
110 103
111 #region IAssetService 104 #region IAssetService
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs
index 7a96a05..f1c2575 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/ 2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders. 3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 * 4 *
@@ -73,24 +73,20 @@ namespace OpenSim.Services.Connectors.SimianGrid
73 73
74 public void Initialise(IConfigSource source) 74 public void Initialise(IConfigSource source)
75 { 75 {
76 if (Simian.IsSimianEnabled(source, "AuthenticationServices", this.Name)) 76 IConfig gridConfig = source.Configs["AuthenticationService"];
77 if (gridConfig != null)
77 { 78 {
78 IConfig assetConfig = source.Configs["AuthenticationService"]; 79 string serviceUrl = gridConfig.GetString("AuthenticationServerURI");
79 if (assetConfig == null) 80 if (!String.IsNullOrEmpty(serviceUrl))
80 { 81 {
81 m_log.Error("[SIMIAN AUTH CONNECTOR]: AuthenticationService missing from OpenSim.ini"); 82 if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
82 throw new Exception("Authentication connector init error"); 83 serviceUrl = serviceUrl + '/';
84 m_serverUrl = serviceUrl;
83 } 85 }
84
85 string serviceURI = assetConfig.GetString("AuthenticationServerURI");
86 if (String.IsNullOrEmpty(serviceURI))
87 {
88 m_log.Error("[SIMIAN AUTH CONNECTOR]: No Server URI named in section AuthenticationService");
89 throw new Exception("Authentication connector init error");
90 }
91
92 m_serverUrl = serviceURI;
93 } 86 }
87
88 if (String.IsNullOrEmpty(m_serverUrl))
89 m_log.Info("[SIMIAN AUTH CONNECTOR]: No AuthenticationServerURI specified, disabling connector");
94 } 90 }
95 91
96 public string Authenticate(UUID principalID, string password, int lifetime) 92 public string Authenticate(UUID principalID, string password, int lifetime)
@@ -253,7 +249,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
253 if (password == simianGridCredential || 249 if (password == simianGridCredential ||
254 "$1$" + password == simianGridCredential || 250 "$1$" + password == simianGridCredential ||
255 "$1$" + Utils.MD5String(password) == simianGridCredential || 251 "$1$" + Utils.MD5String(password) == simianGridCredential ||
256 Utils.MD5String(password) == simianGridCredential) 252 Utils.MD5String(password) == simianGridCredential ||
253 "$1$" + Utils.MD5String(password + ":") == simianGridCredential)
257 { 254 {
258 authorizeResult = Authorize(userID); 255 authorizeResult = Authorize(userID);
259 return true; 256 return true;
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs
index 734bdd2..c2e20a3 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs
@@ -78,27 +78,20 @@ namespace OpenSim.Services.Connectors.SimianGrid
78 78
79 public void Initialise(IConfigSource source) 79 public void Initialise(IConfigSource source)
80 { 80 {
81 if (Simian.IsSimianEnabled(source, "AvatarServices", this.Name)) 81 IConfig gridConfig = source.Configs["AvatarService"];
82 if (gridConfig != null)
82 { 83 {
83 IConfig gridConfig = source.Configs["AvatarService"];
84 if (gridConfig == null)
85 {
86 m_log.Error("[SIMIAN AVATAR CONNECTOR]: AvatarService missing from OpenSim.ini");
87 throw new Exception("Avatar connector init error");
88 }
89
90 string serviceUrl = gridConfig.GetString("AvatarServerURI"); 84 string serviceUrl = gridConfig.GetString("AvatarServerURI");
91 if (String.IsNullOrEmpty(serviceUrl)) 85 if (!String.IsNullOrEmpty(serviceUrl))
92 { 86 {
93 m_log.Error("[SIMIAN AVATAR CONNECTOR]: No AvatarServerURI in section AvatarService"); 87 if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
94 throw new Exception("Avatar connector init error"); 88 serviceUrl = serviceUrl + '/';
89 m_serverUrl = serviceUrl;
95 } 90 }
96
97 if (!serviceUrl.EndsWith("/"))
98 serviceUrl = serviceUrl + '/';
99
100 m_serverUrl = serviceUrl;
101 } 91 }
92
93 if (String.IsNullOrEmpty(m_serverUrl))
94 m_log.Info("[SIMIAN AVATAR CONNECTOR]: No AvatarServerURI specified, disabling connector");
102 } 95 }
103 96
104 #region IAvatarService 97 #region IAvatarService
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianFriendsServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianFriendsServiceConnector.cs
index 89f3594..1afb1e1 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianFriendsServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianFriendsServiceConnector.cs
@@ -76,38 +76,29 @@ namespace OpenSim.Services.Connectors.SimianGrid
76 76
77 public void Initialise(IConfigSource source) 77 public void Initialise(IConfigSource source)
78 { 78 {
79 bool isSimianEnabled = false; 79 IConfig gridConfig = source.Configs["FriendsService"];
80 80 if (gridConfig != null)
81 if (source.Configs["Friends"] != null)
82 {
83 string module = source.Configs["Friends"].GetString("Connector");
84 isSimianEnabled = !String.IsNullOrEmpty(module) && module.EndsWith(this.Name);
85 }
86
87 if (isSimianEnabled)
88 { 81 {
89 IConfig assetConfig = source.Configs["FriendsService"]; 82 string serviceUrl = gridConfig.GetString("FriendsServerURI");
90 if (assetConfig == null) 83 if (!String.IsNullOrEmpty(serviceUrl))
91 {
92 m_log.Error("[SIMIAN FRIENDS CONNECTOR]: FriendsService missing from OpenSim.ini");
93 throw new Exception("Friends connector init error");
94 }
95
96 string serviceURI = assetConfig.GetString("FriendsServerURI");
97 if (String.IsNullOrEmpty(serviceURI))
98 { 84 {
99 m_log.Error("[SIMIAN FRIENDS CONNECTOR]: No Server URI named in section FriendsService"); 85 if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
100 throw new Exception("Friends connector init error"); 86 serviceUrl = serviceUrl + '/';
87 m_serverUrl = serviceUrl;
101 } 88 }
102
103 m_serverUrl = serviceURI;
104 } 89 }
90
91 if (String.IsNullOrEmpty(m_serverUrl))
92 m_log.Info("[SIMIAN FRIENDS CONNECTOR]: No FriendsServerURI specified, disabling connector");
105 } 93 }
106 94
107 #region IFriendsService 95 #region IFriendsService
108 96
109 public FriendInfo[] GetFriends(UUID principalID) 97 public FriendInfo[] GetFriends(UUID principalID)
110 { 98 {
99 if (String.IsNullOrEmpty(m_serverUrl))
100 return new FriendInfo[0];
101
111 Dictionary<UUID, FriendInfo> friends = new Dictionary<UUID, FriendInfo>(); 102 Dictionary<UUID, FriendInfo> friends = new Dictionary<UUID, FriendInfo>();
112 103
113 OSDArray friendsArray = GetFriended(principalID); 104 OSDArray friendsArray = GetFriended(principalID);
@@ -156,6 +147,9 @@ namespace OpenSim.Services.Connectors.SimianGrid
156 147
157 public bool StoreFriend(UUID principalID, string friend, int flags) 148 public bool StoreFriend(UUID principalID, string friend, int flags)
158 { 149 {
150 if (String.IsNullOrEmpty(m_serverUrl))
151 return true;
152
159 NameValueCollection requestArgs = new NameValueCollection 153 NameValueCollection requestArgs = new NameValueCollection
160 { 154 {
161 { "RequestMethod", "AddGeneric" }, 155 { "RequestMethod", "AddGeneric" },
@@ -176,6 +170,9 @@ namespace OpenSim.Services.Connectors.SimianGrid
176 170
177 public bool Delete(UUID principalID, string friend) 171 public bool Delete(UUID principalID, string friend)
178 { 172 {
173 if (String.IsNullOrEmpty(m_serverUrl))
174 return true;
175
179 NameValueCollection requestArgs = new NameValueCollection 176 NameValueCollection requestArgs = new NameValueCollection
180 { 177 {
181 { "RequestMethod", "RemoveGeneric" }, 178 { "RequestMethod", "RemoveGeneric" },
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianGrid.cs b/OpenSim/Services/Connectors/SimianGrid/SimianGrid.cs
index 7d97aaa..847319c 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianGrid.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianGrid.cs
@@ -31,17 +31,3 @@ using Nini.Config;
31 31
32[assembly: Addin("SimianGrid", "1.0")] 32[assembly: Addin("SimianGrid", "1.0")]
33[assembly: AddinDependency("OpenSim", "0.5")] 33[assembly: AddinDependency("OpenSim", "0.5")]
34
35public static class Simian
36{
37 public static bool IsSimianEnabled(IConfigSource config, string moduleName, string connectorName)
38 {
39 if (config.Configs["Modules"] != null)
40 {
41 string module = config.Configs["Modules"].GetString(moduleName);
42 return !String.IsNullOrEmpty(module) && module.EndsWith(connectorName);
43 }
44
45 return false;
46 }
47} \ No newline at end of file
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
index 1ddcc75..204dbe5 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
@@ -98,24 +98,20 @@ namespace OpenSim.Services.Connectors.SimianGrid
98 98
99 public void Initialise(IConfigSource source) 99 public void Initialise(IConfigSource source)
100 { 100 {
101 if (Simian.IsSimianEnabled(source, "GridServices", this.Name)) 101 IConfig gridConfig = source.Configs["GridService"];
102 if (gridConfig != null)
102 { 103 {
103 IConfig gridConfig = source.Configs["GridService"];
104 if (gridConfig == null)
105 {
106 m_log.Error("[SIMIAN GRID CONNECTOR]: GridService missing from OpenSim.ini");
107 throw new Exception("Grid connector init error");
108 }
109
110 string serviceUrl = gridConfig.GetString("GridServerURI"); 104 string serviceUrl = gridConfig.GetString("GridServerURI");
111 if (String.IsNullOrEmpty(serviceUrl)) 105 if (!String.IsNullOrEmpty(serviceUrl))
112 { 106 {
113 m_log.Error("[SIMIAN GRID CONNECTOR]: No Server URI named in section GridService"); 107 if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
114 throw new Exception("Grid connector init error"); 108 serviceUrl = serviceUrl + '/';
109 m_serverUrl = serviceUrl;
115 } 110 }
116
117 m_serverUrl = serviceUrl;
118 } 111 }
112
113 if (String.IsNullOrEmpty(m_serverUrl))
114 m_log.Info("[SIMIAN GRID CONNECTOR]: No GridServerURI specified, disabling connector");
119 } 115 }
120 116
121 #region IGridService 117 #region IGridService
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs
index 89c1a5a..63aaad7 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs
@@ -92,38 +92,30 @@ namespace OpenSim.Services.Connectors.SimianGrid
92 92
93 public void Initialise(IConfigSource source) 93 public void Initialise(IConfigSource source)
94 { 94 {
95 if (Simian.IsSimianEnabled(source, "InventoryServices", this.Name)) 95 IConfig gridConfig = source.Configs["InventoryService"];
96 if (gridConfig != null)
96 { 97 {
97 IConfig gridConfig = source.Configs["InventoryService"];
98 if (gridConfig == null)
99 {
100 m_log.Error("[SIMIAN INVENTORY CONNECTOR]: InventoryService missing from OpenSim.ini");
101 throw new Exception("Inventory connector init error");
102 }
103
104 string serviceUrl = gridConfig.GetString("InventoryServerURI"); 98 string serviceUrl = gridConfig.GetString("InventoryServerURI");
105 if (String.IsNullOrEmpty(serviceUrl)) 99 if (!String.IsNullOrEmpty(serviceUrl))
106 { 100 {
107 m_log.Error("[SIMIAN INVENTORY CONNECTOR]: No Server URI named in section InventoryService"); 101 if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
108 throw new Exception("Inventory connector init error"); 102 serviceUrl = serviceUrl + '/';
109 } 103 m_serverUrl = serviceUrl;
110 104
111 m_serverUrl = serviceUrl; 105 gridConfig = source.Configs["UserAccountService"];
112 106 if (gridConfig != null)
113 gridConfig = source.Configs["UserAccountService"]; 107 {
114 if (gridConfig != null) 108 serviceUrl = gridConfig.GetString("UserAccountServerURI");
115 { 109 if (!String.IsNullOrEmpty(serviceUrl))
116 serviceUrl = gridConfig.GetString("UserAccountServerURI"); 110 m_userServerUrl = serviceUrl;
117 if (!String.IsNullOrEmpty(serviceUrl)) 111 }
118 m_userServerUrl = serviceUrl;
119 else
120 m_log.Info("[SIMIAN INVENTORY CONNECTOR]: No Server URI named in section UserAccountService");
121 }
122 else
123 {
124 m_log.Warn("[SIMIAN INVENTORY CONNECTOR]: UserAccountService missing from OpenSim.ini");
125 } 112 }
126 } 113 }
114
115 if (String.IsNullOrEmpty(m_serverUrl))
116 m_log.Info("[SIMIAN INVENTORY CONNECTOR]: No InventoryServerURI specified, disabling connector");
117 else if (String.IsNullOrEmpty(m_userServerUrl))
118 m_log.Info("[SIMIAN INVENTORY CONNECTOR]: No UserAccountServerURI specified, disabling connector");
127 } 119 }
128 120
129 /// <summary> 121 /// <summary>
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs
index ca23e27..778f3f4 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs
@@ -103,24 +103,20 @@ namespace OpenSim.Services.Connectors.SimianGrid
103 103
104 public void Initialise(IConfigSource source) 104 public void Initialise(IConfigSource source)
105 { 105 {
106 if (Simian.IsSimianEnabled(source, "PresenceServices", this.Name)) 106 IConfig gridConfig = source.Configs["PresenceService"];
107 if (gridConfig != null)
107 { 108 {
108 IConfig gridConfig = source.Configs["PresenceService"];
109 if (gridConfig == null)
110 {
111 m_log.Error("[SIMIAN PRESENCE CONNECTOR]: PresenceService missing from OpenSim.ini");
112 throw new Exception("Presence connector init error");
113 }
114
115 string serviceUrl = gridConfig.GetString("PresenceServerURI"); 109 string serviceUrl = gridConfig.GetString("PresenceServerURI");
116 if (String.IsNullOrEmpty(serviceUrl)) 110 if (!String.IsNullOrEmpty(serviceUrl))
117 { 111 {
118 m_log.Error("[SIMIAN PRESENCE CONNECTOR]: No PresenceServerURI in section PresenceService"); 112 if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
119 throw new Exception("Presence connector init error"); 113 serviceUrl = serviceUrl + '/';
114 m_serverUrl = serviceUrl;
120 } 115 }
121
122 m_serverUrl = serviceUrl;
123 } 116 }
117
118 if (String.IsNullOrEmpty(m_serverUrl))
119 m_log.Info("[SIMIAN PRESENCE CONNECTOR]: No PresenceServerURI specified, disabling connector");
124 } 120 }
125 121
126 #region IPresenceService 122 #region IPresenceService
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs b/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs
index d30d880..a817d7c 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs
@@ -88,44 +88,20 @@ namespace OpenSim.Services.Connectors.SimianGrid
88 88
89 public void Initialise(IConfigSource source) 89 public void Initialise(IConfigSource source)
90 { 90 {
91 if (Simian.IsSimianEnabled(source, "UserAccountServices", "SimianUserAccountServiceConnector")) 91 IConfig gridConfig = source.Configs["UserAccountService"];
92 if (gridConfig != null)
92 { 93 {
93 IConfig gridConfig = source.Configs["UserAccountService"];
94 if (gridConfig == null)
95 {
96 m_log.Error("[SIMIAN PROFILES]: UserAccountService missing from OpenSim.ini");
97 throw new Exception("Profiles init error");
98 }
99
100 string serviceUrl = gridConfig.GetString("UserAccountServerURI"); 94 string serviceUrl = gridConfig.GetString("UserAccountServerURI");
101 if (String.IsNullOrEmpty(serviceUrl)) 95 if (!String.IsNullOrEmpty(serviceUrl))
102 {
103 m_log.Error("[SIMIAN PROFILES]: No UserAccountServerURI in section UserAccountService");
104 throw new Exception("Profiles init error");
105 }
106
107 if (!serviceUrl.EndsWith("/"))
108 serviceUrl = serviceUrl + '/';
109
110 m_serverUrl = serviceUrl;
111 IConfig profilesConfig = source.Configs["Profiles"];
112 if (profilesConfig == null)
113 { 96 {
114 // Do not run this module by default. 97 if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
115 return; 98 serviceUrl = serviceUrl + '/';
116 } 99 m_serverUrl = serviceUrl;
117 else
118 {
119 // if profiles aren't enabled, we're not needed.
120 // if we're not specified as the connector to use, then we're not wanted
121 if (profilesConfig.GetString("Module", String.Empty) != Name)
122 {
123
124 return;
125 }
126 m_log.InfoFormat("[SIMIAN ACCOUNT CONNECTOR]: Initializing {0}", this.Name);
127 } 100 }
128 } 101 }
102
103 if (String.IsNullOrEmpty(m_serverUrl))
104 m_log.Info("[SIMIAN PROFILES]: No UserAccountServerURI specified, disabling connector");
129 } 105 }
130 106
131 private void ClientConnectHandler(IClientCore clientCore) 107 private void ClientConnectHandler(IClientCore clientCore)
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs
index 56c73ec..4c8662f 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs
@@ -77,25 +77,20 @@ namespace OpenSim.Services.Connectors.SimianGrid
77 77
78 public void Initialise(IConfigSource source) 78 public void Initialise(IConfigSource source)
79 { 79 {
80 if (Simian.IsSimianEnabled(source, "UserAccountServices", this.Name)) 80 IConfig gridConfig = source.Configs["UserAccountService"];
81 if (gridConfig != null)
81 { 82 {
82 IConfig assetConfig = source.Configs["UserAccountService"]; 83 string serviceUrl = gridConfig.GetString("UserAccountServerURI");
83 if (assetConfig == null) 84 if (!String.IsNullOrEmpty(serviceUrl))
84 { 85 {
85 m_log.Error("[SIMIAN ACCOUNT CONNECTOR]: UserAccountService missing from OpenSim.ini"); 86 if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("="))
86 throw new Exception("User account connector init error"); 87 serviceUrl = serviceUrl + '/';
88 m_serverUrl = serviceUrl;
87 } 89 }
88
89 string serviceURI = assetConfig.GetString("UserAccountServerURI");
90 if (String.IsNullOrEmpty(serviceURI))
91 {
92 m_log.Error("[SIMIAN ACCOUNT CONNECTOR]: No UserAccountServerURI in section UserAccountService, skipping SimianUserAccountServiceConnector");
93 throw new Exception("User account connector init error");
94 }
95
96 m_accountCache = new ExpiringCache<UUID, UserAccount>();
97 m_serverUrl = serviceURI;
98 } 90 }
91
92 if (String.IsNullOrEmpty(m_serverUrl))
93 m_log.Info("[SIMIAN ACCOUNT CONNECTOR]: No UserAccountServerURI specified, disabling connector");
99 } 94 }
100 95
101 public UserAccount GetUserAccount(UUID scopeID, string firstName, string lastName) 96 public UserAccount GetUserAccount(UUID scopeID, string firstName, string lastName)
diff --git a/OpenSim/Services/InventoryService/HGInventoryService.cs b/OpenSim/Services/InventoryService/HGInventoryService.cs
index 6e6b019..d62c008 100644
--- a/OpenSim/Services/InventoryService/HGInventoryService.cs
+++ b/OpenSim/Services/InventoryService/HGInventoryService.cs
@@ -44,7 +44,7 @@ namespace OpenSim.Services.InventoryService
44 LogManager.GetLogger( 44 LogManager.GetLogger(
45 MethodBase.GetCurrentMethod().DeclaringType); 45 MethodBase.GetCurrentMethod().DeclaringType);
46 46
47 protected IXInventoryData m_Database; 47 protected new IXInventoryData m_Database;
48 48
49 public HGInventoryService(IConfigSource config) 49 public HGInventoryService(IConfigSource config)
50 : base(config) 50 : base(config)
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs
index 09be4a2..5ccb912 100644
--- a/OpenSim/Services/LLLoginService/LLLoginService.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginService.cs
@@ -104,7 +104,7 @@ namespace OpenSim.Services.LLLoginService
104 m_GatekeeperURL = m_LoginServerConfig.GetString("GatekeeperURI", string.Empty); 104 m_GatekeeperURL = m_LoginServerConfig.GetString("GatekeeperURI", string.Empty);
105 m_MapTileURL = m_LoginServerConfig.GetString("MapTileURL", string.Empty); 105 m_MapTileURL = m_LoginServerConfig.GetString("MapTileURL", string.Empty);
106 m_SearchURL = m_LoginServerConfig.GetString("SearchURL", string.Empty); 106 m_SearchURL = m_LoginServerConfig.GetString("SearchURL", string.Empty);
107 107
108 // These are required; the others aren't 108 // These are required; the others aren't
109 if (accountService == string.Empty || authService == string.Empty) 109 if (accountService == string.Empty || authService == string.Empty)
110 throw new Exception("LoginService is missing service specifications"); 110 throw new Exception("LoginService is missing service specifications");
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example
index f95c428..9fd7e46 100644
--- a/bin/OpenSim.ini.example
+++ b/bin/OpenSim.ini.example
@@ -646,7 +646,7 @@
646 ; {2} - region UUID 646 ; {2} - region UUID
647 ; {3} - region port 647 ; {3} - region port
648 ; {4} - region name with " ", ":", "/" mapped to "_" 648 ; {4} - region name with " ", ":", "/" mapped to "_"
649 region_file_template = "{0}x{1}-{2}.xml" 649 region_file_template = "{0}x{1}-{2}.ini"
650 650
651 ; we can limit the number of regions that XmlRpcCreateRegion will 651 ; we can limit the number of regions that XmlRpcCreateRegion will
652 ; allow by setting this to a positive, non-0 number: as long as the 652 ; allow by setting this to a positive, non-0 number: as long as the
@@ -1325,11 +1325,12 @@ Message = "The MOTD module is working!"
1325[Architecture] 1325[Architecture]
1326 ; Choose exactly one and only one of the architectures below. 1326 ; Choose exactly one and only one of the architectures below.
1327 1327
1328 Include-Standalone = "config-include/Standalone.ini" 1328 Include-Standalone = "config-include/Standalone.ini"
1329 ;Include-HGStandalone = "config-include/StandaloneHypergrid.ini" 1329 ;Include-HGStandalone = "config-include/StandaloneHypergrid.ini"
1330 ;Include-Grid = "config-include/Grid.ini" 1330 ;Include-Grid = "config-include/Grid.ini"
1331 ;Include-HGGrid = "config-include/GridHypergrid.ini" 1331 ;Include-HGGrid = "config-include/GridHypergrid.ini"
1332 ;Include-SimianGrid = "config-include/SimianGrid.ini" 1332 ;Include-SimianGrid = "config-include/SimianGrid.ini"
1333 ;Include-HyperSimianGrid = "config-include/HyperSimianGrid.ini"
1333 1334
1334 ; Then choose 1335 ; Then choose
1335 ; config-include/StandaloneCommon.ini.example (if you're in standlone) OR 1336 ; config-include/StandaloneCommon.ini.example (if you're in standlone) OR
diff --git a/bin/Robust.HG.ini.example b/bin/Robust.HG.ini.example
index 554d00f..dae7a19 100644
--- a/bin/Robust.HG.ini.example
+++ b/bin/Robust.HG.ini.example
@@ -147,6 +147,9 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
147 WelcomeMessage = "Welcome, Avatar!" 147 WelcomeMessage = "Welcome, Avatar!"
148 AllowRemoteSetLoginLevel = "false" 148 AllowRemoteSetLoginLevel = "false"
149 149
150 ; If you run this login server behind a proxy, set this to true
151 ; HasProxy = true
152
150 ; Defaults for the users, if none is specified in the useraccounts table entry (ServiceURLs) 153 ; Defaults for the users, if none is specified in the useraccounts table entry (ServiceURLs)
151 ; CHANGE THIS 154 ; CHANGE THIS
152 HomeURI = "http://127.0.0.1:8002" 155 HomeURI = "http://127.0.0.1:8002"
@@ -216,6 +219,10 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
216 GridUserService = "OpenSim.Services.UserAccountService.dll:GridUserService" 219 GridUserService = "OpenSim.Services.UserAccountService.dll:GridUserService"
217 GridService = "OpenSim.Services.GridService.dll:GridService" 220 GridService = "OpenSim.Services.GridService.dll:GridService"
218 GatekeeperService = "OpenSim.Services.HypergridService.dll:GatekeeperService" 221 GatekeeperService = "OpenSim.Services.HypergridService.dll:GatekeeperService"
222
223 ;; If you separate the UserAgentService from the LoginService, set this to
224 ;; the IP address of the machine where your LoginService is
225 ;LoginServerIP = "127.0.0.1"
219 226
220; * The interface that local users get when they are in other grids. 227; * The interface that local users get when they are in other grids.
221; * This restricts the inventory operations while in other grids. 228; * This restricts the inventory operations while in other grids.
diff --git a/bin/config-include/HyperSimianGrid.ini b/bin/config-include/HyperSimianGrid.ini
new file mode 100644
index 0000000..87ffe69
--- /dev/null
+++ b/bin/config-include/HyperSimianGrid.ini
@@ -0,0 +1,77 @@
1;;
2;; Please don't change this file.
3;; All optional settings are in GridCommon.ini.example,
4;; which you can copy and change.
5;;
6
7;;
8;; In GridCommon.ini, these are the URLs you would use if SimianGrid is
9;; installed at http://www.mygrid.com/Grid/
10;;
11; AssetServerURI = "http://www.mygrid.com/Grid/?id="
12; InventoryServerURI = "http://www.mygrid.com/Grid/"
13; AvatarServerURI = "http://www.mygrid.com/Grid/"
14; PresenceServerURI = "http://www.mygrid.com/Grid/"
15; UserAccountServerURI = "http://www.mygrid.com/Grid/"
16; AuthenticationServerURI = "http://www.mygrid.com/Grid/"
17; FriendsServerURI = "http://www.mygrid.com/Grid/"
18; GroupsServerURI = "http://www.mygrid.com/Grid/"
19
20[Includes]
21 Include-Common = "config-include/GridCommon.ini"
22
23[Modules]
24 GridServices = "OpenSim.Services.Connectors.dll:SimianGridServiceConnector"
25 PresenceServices = "OpenSim.Services.Connectors.dll:SimianPresenceServiceConnector"
26 UserAccountServices = "OpenSim.Services.Connectors.dll:SimianUserAccountServiceConnector"
27 AuthenticationServices = "OpenSim.Services.Connectors.dll:SimianAuthenticationServiceConnector"
28 AssetServices = "HGAssetBroker"
29 InventoryServices = "HGInventoryBroker"
30 AvatarServices = "OpenSim.Services.Connectors.dll:SimianAvatarServiceConnector"
31
32 NeighbourServices = "RemoteNeighbourServicesConnector"
33 SimulationServices = "RemoteSimulationConnectorModule"
34 EntityTransferModule = "HGEntityTransferModule"
35 InventoryAccessModule = "HGInventoryAccessModule"
36
37 LandServiceInConnector = true
38 NeighbourServiceInConnector = true
39 SimulationServiceInConnector = true
40 LibraryModule = false
41
42 AssetCaching = "FlotsamAssetCache"
43
44[Friends]
45 Connector = "OpenSim.Services.Connectors.dll:SimianFriendsServiceConnector"
46
47[GridService]
48 LocalServiceModule = "OpenSim.Services.GridService.dll:GridService"
49 StorageProvider = "OpenSim.Data.Null.dll:NullRegionData"
50
51 AllowHypergridMapSearch = true
52
53[LibraryService]
54 LocalServiceModule = "OpenSim.Services.InventoryService.dll:LibraryService"
55 LibraryName = "OpenSim Library"
56 DefaultLibrary = "./inventory/Libraries.xml"
57
58[AssetService]
59 DefaultAssetLoader = "OpenSim.Framework.AssetLoader.Filesystem.dll"
60 LocalGridAssetService = "OpenSim.Services.Connectors.dll:SimianAssetServiceConnector"
61 HypergridAssetService = "OpenSim.Services.Connectors.dll:HGAssetServiceConnector"
62 AssetLoaderArgs = "assets/AssetSets.xml"
63
64[InventoryService]
65 LocalGridInventoryService = "OpenSim.Services.Connectors.dll:SimianInventoryServiceConnector"
66
67[Groups]
68 Enabled = true
69 Module = GroupsModule
70 DebugEnabled = false
71 NoticesEnabled = true
72 MessagingModule = GroupsMessagingModule
73 MessagingEnabled = true
74 ServicesConnectorModule = SimianGroupsServicesConnector
75
76[Profiles]
77 Module = SimianProfiles