From 9b7c99f0cfd8fbcd3ce31e0be6fa68f5bedef78b Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Wed, 29 Sep 2010 14:24:32 -0700 Subject: Made IGridUserService.SetLastPosition() more flexible to allow different possible implementations. This doesn't change any behavior or any Robust code, but it simplifies the SimianGrid connector by using the standard OpenSim interface for setting last position now --- .../ServiceConnectorsOut/GridUser/ActivityDetector.cs | 9 +++++++-- .../GridUser/LocalGridUserServiceConnector.cs | 4 ++-- .../GridUser/RemoteGridUserServiceConnector.cs | 4 ++-- 3 files changed, 11 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs index 83c8eac..116a1dc 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs @@ -69,9 +69,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser public void OnMakeRootAgent(ScenePresence sp) { - m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected root presence {0} in {1}", sp.UUID, sp.Scene.RegionInfo.RegionName); + UUID sessionID = UUID.Zero; + + IClientAPI client; + if (m_aScene.TryGetClient(sp.UUID, out client)) + sessionID = client.SessionId; - m_GridUserService.SetLastPosition(sp.UUID.ToString(), sp.Scene.RegionInfo.RegionID, sp.AbsolutePosition, sp.Lookat); + m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected root presence {0} in {1}", sp.UUID, sp.Scene.RegionInfo.RegionName); + m_GridUserService.SetLastPosition(sp.UUID.ToString(), sessionID, sp.Scene.RegionInfo.RegionID, sp.AbsolutePosition, sp.Lookat); } public void OnNewClient(IClientAPI client) diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/LocalGridUserServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/LocalGridUserServiceConnector.cs index d914a57..76e030f 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/LocalGridUserServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/LocalGridUserServiceConnector.cs @@ -162,9 +162,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser return m_GridUserService.SetHome(userID, homeID, homePosition, homeLookAt); } - public bool SetLastPosition(string userID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt) + public bool SetLastPosition(string userID, UUID sessionID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt) { - return m_GridUserService.SetLastPosition(userID, regionID, lastPosition, lastLookAt); + return m_GridUserService.SetLastPosition(userID, sessionID, regionID, lastPosition, lastLookAt); } public GridUserInfo GetGridUserInfo(string userID) diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/RemoteGridUserServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/RemoteGridUserServiceConnector.cs index e3e2e61..fb11e9a 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/RemoteGridUserServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/RemoteGridUserServiceConnector.cs @@ -137,9 +137,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser return m_RemoteConnector.SetHome(userID, regionID, position, lookAt); } - public bool SetLastPosition(string userID, UUID regionID, Vector3 position, Vector3 lookAt) + public bool SetLastPosition(string userID, UUID sessionID, UUID regionID, Vector3 position, Vector3 lookAt) { - return m_RemoteConnector.SetLastPosition(userID, regionID, position, lookAt); + return m_RemoteConnector.SetLastPosition(userID, sessionID, regionID, position, lookAt); } public GridUserInfo GetGridUserInfo(string userID) -- cgit v1.1 From b6e0563ad7ad7f6fc396229823d7e76cd31dced7 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Wed, 29 Sep 2010 14:34:02 -0700 Subject: Part two of the previous commit, making IGridUserService.LoggedOut() more flexible without changing current behavior --- .../CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs | 2 +- .../ServiceConnectorsOut/GridUser/LocalGridUserServiceConnector.cs | 4 ++-- .../ServiceConnectorsOut/GridUser/RemoteGridUserServiceConnector.cs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs index 116a1dc..f523c73 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs @@ -104,7 +104,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser } } m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName); - m_GridUserService.LoggedOut(client.AgentId.ToString(), client.Scene.RegionInfo.RegionID, position, lookat); + m_GridUserService.LoggedOut(client.AgentId.ToString(), client.SessionId, client.Scene.RegionInfo.RegionID, position, lookat); } } diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/LocalGridUserServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/LocalGridUserServiceConnector.cs index 76e030f..985acec 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/LocalGridUserServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/LocalGridUserServiceConnector.cs @@ -152,9 +152,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser return m_GridUserService.LoggedIn(userID); } - public bool LoggedOut(string userID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt) + public bool LoggedOut(string userID, UUID sessionID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt) { - return m_GridUserService.LoggedOut(userID, regionID, lastPosition, lastLookAt); + return m_GridUserService.LoggedOut(userID, sessionID, regionID, lastPosition, lastLookAt); } public bool SetHome(string userID, UUID homeID, Vector3 homePosition, Vector3 homeLookAt) diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/RemoteGridUserServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/RemoteGridUserServiceConnector.cs index fb11e9a..95b3591 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/RemoteGridUserServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/RemoteGridUserServiceConnector.cs @@ -126,9 +126,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser return null; } - public bool LoggedOut(string userID, UUID region, Vector3 position, Vector3 lookat) + public bool LoggedOut(string userID, UUID sessionID, UUID region, Vector3 position, Vector3 lookat) { - return m_RemoteConnector.LoggedOut(userID, region, position, lookat); + return m_RemoteConnector.LoggedOut(userID, sessionID, region, position, lookat); } -- cgit v1.1 From 1255c7ceb6e7450b7e2b496e0ad0b0d7cd9dc295 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Wed, 29 Sep 2010 14:39:13 -0700 Subject: Cleanup: Removed an unreferenced variable from ActivityDetector.cs --- .../ServiceConnectorsOut/GridUser/ActivityDetector.cs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs index f523c73..a64f785 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs @@ -42,7 +42,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private IGridUserService m_GridUserService; - private Scene m_aScene; public ActivityDetector(IGridUserService guservice) { @@ -56,9 +55,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser // But we could trigger the position update more often scene.EventManager.OnMakeRootAgent += OnMakeRootAgent; scene.EventManager.OnNewClient += OnNewClient; - - if (m_aScene == null) - m_aScene = scene; } public void RemoveRegion(Scene scene) @@ -69,14 +65,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser public void OnMakeRootAgent(ScenePresence sp) { - UUID sessionID = UUID.Zero; - - IClientAPI client; - if (m_aScene.TryGetClient(sp.UUID, out client)) - sessionID = client.SessionId; - m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected root presence {0} in {1}", sp.UUID, sp.Scene.RegionInfo.RegionName); - m_GridUserService.SetLastPosition(sp.UUID.ToString(), sessionID, sp.Scene.RegionInfo.RegionID, sp.AbsolutePosition, sp.Lookat); + m_GridUserService.SetLastPosition(sp.UUID.ToString(), UUID.Zero, sp.Scene.RegionInfo.RegionID, sp.AbsolutePosition, sp.Lookat); } public void OnNewClient(IClientAPI client) -- cgit v1.1 From 29646bcf6773c55e7e0ddc1bb86160ca5b5cf4f2 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 30 Sep 2010 02:47:07 +0200 Subject: Fix an inventory fetch issue --- OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index 4d97db7..21c36d3 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs @@ -515,6 +515,9 @@ namespace OpenSim.Region.Framework.Scenes public void HandleFetchInventoryDescendents(IClientAPI remoteClient, UUID folderID, UUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder) { + if (folderID == UUID.Zero) + return; + // FIXME MAYBE: We're not handling sortOrder! // TODO: This code for looking in the folder for the library should be folded somewhere else -- cgit v1.1 From 90b51dc7d67507e27c4baa529e979de19dce8de1 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 30 Sep 2010 15:52:33 +0100 Subject: Forward-port 0.6 fix --- .../CoreModules/World/Objects/BuySell/BuySellModule.cs | 14 +++++++++++++- OpenSim/Region/Framework/Interfaces/IBuySellModule.cs | 4 ++-- .../OptionalModules/World/MoneyModule/SampleMoneyModule.cs | 4 ++-- 3 files changed, 17 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs index c8fb9da..a674d60 100644 --- a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs +++ b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs @@ -104,7 +104,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell part.GetProperties(client); } - public bool BuyObject(IClientAPI remoteClient, UUID categoryID, uint localID, byte saleType) + public bool BuyObject(IClientAPI remoteClient, UUID categoryID, uint localID, byte saleType, int salePrice) { SceneObjectPart part = m_scene.GetSceneObjectPart(localID); @@ -114,6 +114,18 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell if (part.ParentGroup == null) return false; + if (part.ObjectSaleType != saleType) + { + m_dialogModule.SendAlertToUser(remoteClient, "This item is not available for the type of sale specified"); + return false; + } + + if (part.SalePrice != salePrice) + { + m_dialogModule.SendAlertToUser(remoteClient, "This item is not available for the price specified"); + return false; + } + SceneObjectGroup group = part.ParentGroup; switch (saleType) diff --git a/OpenSim/Region/Framework/Interfaces/IBuySellModule.cs b/OpenSim/Region/Framework/Interfaces/IBuySellModule.cs index 0132bae..d1ce4c0 100644 --- a/OpenSim/Region/Framework/Interfaces/IBuySellModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IBuySellModule.cs @@ -42,6 +42,6 @@ namespace OpenSim.Region.Framework.Interfaces /// /// True on a successful purchase, false on failure /// - bool BuyObject(IClientAPI remoteClient, UUID categoryID, uint localID, byte saleType); + bool BuyObject(IClientAPI remoteClient, UUID categoryID, uint localID, byte saleType, int salePrice); } -} \ No newline at end of file +} diff --git a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs index cc51c3b..d364df6 100644 --- a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs +++ b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs @@ -814,7 +814,7 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule IBuySellModule module = s.RequestModuleInterface(); if (module != null) - module.BuyObject(remoteClient, categoryID, localID, saleType); + module.BuyObject(remoteClient, categoryID, localID, saleType, salePrice); } } @@ -825,4 +825,4 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule Gift = 2, Purchase = 3 } -} \ No newline at end of file +} -- cgit v1.1 From eb58d910987ad34ffbd27bdee670925c1a11884e Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 30 Sep 2010 15:57:52 +0100 Subject: Prevent dropping someone else's attachments --- OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index cb39e46..28c50ab 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -409,6 +409,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments if (part == null || part.ParentGroup == null) return; + if (part.ParentGroup.RootPart.AttachedAvatar != remoteClient.AgentId) + return; + UUID inventoryID = part.ParentGroup.GetFromItemID(); ScenePresence presence; -- cgit v1.1