From a1031772ebc240a3cda9cb8dcf581678be4b2143 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 10 May 2013 08:09:26 -0700 Subject: Delete debug message --- OpenSim/Region/ClientStack/Linden/Caps/AvatarPickerSearchModule.cs | 1 - 1 file changed, 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/AvatarPickerSearchModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/AvatarPickerSearchModule.cs index d7af1f2..9f2aed0 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/AvatarPickerSearchModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/AvatarPickerSearchModule.cs @@ -71,7 +71,6 @@ namespace OpenSim.Region.ClientStack.Linden return; m_URL = config.GetString("Cap_AvatarPickerSearch", string.Empty); - m_log.DebugFormat("[XXX]: Cap_AvatarPickerSearch = {0}", m_URL); // Cap doesn't exist if (m_URL != string.Empty) m_Enabled = true; -- cgit v1.1 From 48f8b884c33ba5f5b7991d1047f4f2f988eb7415 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 11 May 2013 07:15:09 -0700 Subject: Handle SetHome properly --- .../CoreModules/World/Land/LandManagementModule.cs | 59 ++++++++++++++++++++++ 1 file changed, 59 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 693de1d..c295f3a 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -74,6 +74,8 @@ namespace OpenSim.Region.CoreModules.World.Land protected IUserManagement m_userManager; protected IPrimCountModule m_primCountModule; + protected IDialogModule m_Dialog; + protected IGroupsModule m_Groups; // Minimum for parcels to work is 64m even if we don't actually use them. #pragma warning disable 0429 @@ -153,6 +155,8 @@ namespace OpenSim.Region.CoreModules.World.Land { m_userManager = m_scene.RequestModuleInterface(); m_primCountModule = m_scene.RequestModuleInterface(); + m_Dialog = m_scene.RequestModuleInterface(); + m_Groups = m_scene.RequestModuleInterface(); } public void RemoveRegion(Scene scene) @@ -212,6 +216,7 @@ namespace OpenSim.Region.CoreModules.World.Land client.OnPreAgentUpdate += ClientOnPreAgentUpdate; client.OnParcelEjectUser += ClientOnParcelEjectUser; client.OnParcelFreezeUser += ClientOnParcelFreezeUser; + client.OnSetStartLocationRequest += ClientOnSetHome; EntityBase presenceEntity; @@ -1823,6 +1828,60 @@ namespace OpenSim.Region.CoreModules.World.Land } } + /// + /// Sets the Home Point. The LoginService uses this to know where to put a user when they log-in + /// + /// + /// + /// + /// + /// + public virtual void ClientOnSetHome(IClientAPI remoteClient, ulong regionHandle, Vector3 position, Vector3 lookAt, uint flags) + { + m_log.DebugFormat("[XXX]: SetHome"); + // Let's find the parcel in question + ILandObject land = landChannel.GetLandObject(position); + if (land == null || m_scene.GridUserService == null) + { + m_Dialog.SendAlertToUser(remoteClient, "Set Home request Failed."); + return; + } + + // Can the user set home here? + bool canSetHome = false; + // (a) land owners can set home + if (remoteClient.AgentId == land.LandData.OwnerID) + canSetHome = true; + // (b) members of land-owned group in roles that can set home + if (land.LandData.IsGroupOwned && m_Groups != null) + { + ulong gpowers = remoteClient.GetGroupPowers(land.LandData.GroupID); + m_log.DebugFormat("[XXX]: GroupPowers 0x{0:x16}", gpowers); + if ((gpowers & (ulong)GroupPowers.AllowSetHome) == 1) + canSetHome = true; + } + // (c) parcels with telehubs can be the home of anyone + if (m_scene.RegionInfo.RegionSettings.TelehubObject != UUID.Zero) + { + // If the telehub in this parcel? + SceneObjectGroup telehub = m_scene.GetSceneObjectGroup(m_scene.RegionInfo.RegionSettings.TelehubObject); + if (telehub != null && land.ContainsPoint((int)telehub.AbsolutePosition.X, (int)telehub.AbsolutePosition.Y)) + canSetHome = true; + } + + if (canSetHome) + { + if (m_scene.GridUserService != null && m_scene.GridUserService.SetHome(remoteClient.AgentId.ToString(), land.RegionUUID, position, lookAt)) + // FUBAR ALERT: this needs to be "Home position set." so the viewer saves a home-screenshot. + m_Dialog.SendAlertToUser(remoteClient, "Home position set."); + else + m_Dialog.SendAlertToUser(remoteClient, "Set Home request Failed."); + } + else + m_Dialog.SendAlertToUser(remoteClient, "You are not allowed to set your home location in this parcel."); + } + + protected void InstallInterfaces() { Command clearCommand -- cgit v1.1 From a4431381fa8a4f759a9c7eb9e30ae915504d4fdc Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 11 May 2013 07:58:14 -0700 Subject: Finalize the logic for SetHome. See comments in Land/LandManagementModule.cs about who has permission to set home where. --- .../CoreModules/World/Land/LandManagementModule.cs | 47 +++++++++------------- .../Region/CoreModules/World/Land/LandObject.cs | 7 ---- OpenSim/Region/Framework/Scenes/Scene.cs | 19 --------- 3 files changed, 19 insertions(+), 54 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index c295f3a..1789d6d 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -75,7 +75,6 @@ namespace OpenSim.Region.CoreModules.World.Land protected IUserManagement m_userManager; protected IPrimCountModule m_primCountModule; protected IDialogModule m_Dialog; - protected IGroupsModule m_Groups; // Minimum for parcels to work is 64m even if we don't actually use them. #pragma warning disable 0429 @@ -156,7 +155,6 @@ namespace OpenSim.Region.CoreModules.World.Land m_userManager = m_scene.RequestModuleInterface(); m_primCountModule = m_scene.RequestModuleInterface(); m_Dialog = m_scene.RequestModuleInterface(); - m_Groups = m_scene.RequestModuleInterface(); } public void RemoveRegion(Scene scene) @@ -1838,44 +1836,37 @@ namespace OpenSim.Region.CoreModules.World.Land /// public virtual void ClientOnSetHome(IClientAPI remoteClient, ulong regionHandle, Vector3 position, Vector3 lookAt, uint flags) { - m_log.DebugFormat("[XXX]: SetHome"); // Let's find the parcel in question ILandObject land = landChannel.GetLandObject(position); if (land == null || m_scene.GridUserService == null) { - m_Dialog.SendAlertToUser(remoteClient, "Set Home request Failed."); + m_Dialog.SendAlertToUser(remoteClient, "Set Home request failed."); return; } - // Can the user set home here? - bool canSetHome = false; - // (a) land owners can set home - if (remoteClient.AgentId == land.LandData.OwnerID) - canSetHome = true; - // (b) members of land-owned group in roles that can set home - if (land.LandData.IsGroupOwned && m_Groups != null) - { - ulong gpowers = remoteClient.GetGroupPowers(land.LandData.GroupID); - m_log.DebugFormat("[XXX]: GroupPowers 0x{0:x16}", gpowers); - if ((gpowers & (ulong)GroupPowers.AllowSetHome) == 1) - canSetHome = true; - } - // (c) parcels with telehubs can be the home of anyone + // Gather some data + ulong gpowers = remoteClient.GetGroupPowers(land.LandData.GroupID); + SceneObjectGroup telehub = null; if (m_scene.RegionInfo.RegionSettings.TelehubObject != UUID.Zero) - { - // If the telehub in this parcel? - SceneObjectGroup telehub = m_scene.GetSceneObjectGroup(m_scene.RegionInfo.RegionSettings.TelehubObject); - if (telehub != null && land.ContainsPoint((int)telehub.AbsolutePosition.X, (int)telehub.AbsolutePosition.Y)) - canSetHome = true; - } + // Does the telehub exist in the scene? + telehub = m_scene.GetSceneObjectGroup(m_scene.RegionInfo.RegionSettings.TelehubObject); - if (canSetHome) - { - if (m_scene.GridUserService != null && m_scene.GridUserService.SetHome(remoteClient.AgentId.ToString(), land.RegionUUID, position, lookAt)) + // Can the user set home here? + if (// (a) gods and land managers can set home + m_scene.Permissions.IsAdministrator(remoteClient.AgentId) || + m_scene.Permissions.IsGod(remoteClient.AgentId) || + // (b) land owners can set home + remoteClient.AgentId == land.LandData.OwnerID || + // (c) members of the land-associated group in roles that can set home + ((gpowers & (ulong)GroupPowers.AllowSetHome) == (ulong)GroupPowers.AllowSetHome) || + // (d) parcels with telehubs can be the home of anyone + (telehub != null && land.ContainsPoint((int)telehub.AbsolutePosition.X, (int)telehub.AbsolutePosition.Y))) + { + if (m_scene.GridUserService.SetHome(remoteClient.AgentId.ToString(), land.RegionUUID, position, lookAt)) // FUBAR ALERT: this needs to be "Home position set." so the viewer saves a home-screenshot. m_Dialog.SendAlertToUser(remoteClient, "Home position set."); else - m_Dialog.SendAlertToUser(remoteClient, "Set Home request Failed."); + m_Dialog.SendAlertToUser(remoteClient, "Set Home request failed."); } else m_Dialog.SendAlertToUser(remoteClient, "You are not allowed to set your home location in this parcel."); diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 5969d45..8406442 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs @@ -228,13 +228,6 @@ namespace OpenSim.Region.CoreModules.World.Land if (estateModule != null) regionFlags = estateModule.GetRegionFlags(); - // In a perfect world, this would have worked. - // -// if ((landData.Flags & (uint)ParcelFlags.AllowLandmark) != 0) -// regionFlags |= (uint)RegionFlags.AllowLandmark; -// if (landData.OwnerID == remote_client.AgentId) -// regionFlags |= (uint)RegionFlags.AllowSetHome; - int seq_id; if (snap_selection && (sequence_id == 0)) { diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 80c4922..6bbcbd7 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3090,7 +3090,6 @@ namespace OpenSim.Region.Framework.Scenes { //client.OnNameFromUUIDRequest += HandleUUIDNameRequest; client.OnMoneyTransferRequest += ProcessMoneyTransferRequest; - client.OnSetStartLocationRequest += SetHomeRezPoint; client.OnRegionHandleRequest += RegionHandleRequest; } @@ -3215,7 +3214,6 @@ namespace OpenSim.Region.Framework.Scenes { //client.OnNameFromUUIDRequest -= HandleUUIDNameRequest; client.OnMoneyTransferRequest -= ProcessMoneyTransferRequest; - client.OnSetStartLocationRequest -= SetHomeRezPoint; client.OnRegionHandleRequest -= RegionHandleRequest; } @@ -3342,23 +3340,6 @@ namespace OpenSim.Region.Framework.Scenes } /// - /// Sets the Home Point. The LoginService uses this to know where to put a user when they log-in - /// - /// - /// - /// - /// - /// - public virtual void SetHomeRezPoint(IClientAPI remoteClient, ulong regionHandle, Vector3 position, Vector3 lookAt, uint flags) - { - if (GridUserService != null && GridUserService.SetHome(remoteClient.AgentId.ToString(), RegionInfo.RegionID, position, lookAt)) - // FUBAR ALERT: this needs to be "Home position set." so the viewer saves a home-screenshot. - m_dialogModule.SendAlertToUser(remoteClient, "Home position set."); - else - m_dialogModule.SendAlertToUser(remoteClient, "Set Home request Failed."); - } - - /// /// Get the avatar apperance for the given client. /// /// -- cgit v1.1