aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Land
diff options
context:
space:
mode:
authorMelanie2013-05-12 03:24:57 +0100
committerMelanie2013-05-12 03:24:57 +0100
commite8f4c7128fc65f12ef33b152e14b072809667642 (patch)
treea1708d78fa0ef078bf4d47233477fe531149e1ad /OpenSim/Region/CoreModules/World/Land
parentMerge branch 'master' into careminster (diff)
parentFinalize the logic for SetHome. See comments in Land/LandManagementModule.cs ... (diff)
downloadopensim-SC-e8f4c7128fc65f12ef33b152e14b072809667642.zip
opensim-SC-e8f4c7128fc65f12ef33b152e14b072809667642.tar.gz
opensim-SC-e8f4c7128fc65f12ef33b152e14b072809667642.tar.bz2
opensim-SC-e8f4c7128fc65f12ef33b152e14b072809667642.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs OpenSim/Region/Framework/Scenes/Scene.cs
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Land')
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs51
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandObject.cs7
2 files changed, 50 insertions, 8 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
index b4f7d51..317dfd8 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -74,6 +74,7 @@ namespace OpenSim.Region.CoreModules.World.Land
74 74
75 protected IUserManagement m_userManager; 75 protected IUserManagement m_userManager;
76 protected IPrimCountModule m_primCountModule; 76 protected IPrimCountModule m_primCountModule;
77 protected IDialogModule m_Dialog;
77 78
78 // Minimum for parcels to work is 64m even if we don't actually use them. 79 // Minimum for parcels to work is 64m even if we don't actually use them.
79 #pragma warning disable 0429 80 #pragma warning disable 0429
@@ -161,6 +162,7 @@ namespace OpenSim.Region.CoreModules.World.Land
161 { 162 {
162 m_userManager = m_scene.RequestModuleInterface<IUserManagement>(); 163 m_userManager = m_scene.RequestModuleInterface<IUserManagement>();
163 m_primCountModule = m_scene.RequestModuleInterface<IPrimCountModule>(); 164 m_primCountModule = m_scene.RequestModuleInterface<IPrimCountModule>();
165 m_Dialog = m_scene.RequestModuleInterface<IDialogModule>();
164 } 166 }
165 167
166 public void RemoveRegion(Scene scene) 168 public void RemoveRegion(Scene scene)
@@ -213,6 +215,7 @@ namespace OpenSim.Region.CoreModules.World.Land
213 client.OnPreAgentUpdate += ClientOnPreAgentUpdate; 215 client.OnPreAgentUpdate += ClientOnPreAgentUpdate;
214 client.OnParcelEjectUser += ClientOnParcelEjectUser; 216 client.OnParcelEjectUser += ClientOnParcelEjectUser;
215 client.OnParcelFreezeUser += ClientOnParcelFreezeUser; 217 client.OnParcelFreezeUser += ClientOnParcelFreezeUser;
218 client.OnSetStartLocationRequest += ClientOnSetHome;
216 219
217 EntityBase presenceEntity; 220 EntityBase presenceEntity;
218 if (m_scene.Entities.TryGetValue(client.AgentId, out presenceEntity) && presenceEntity is ScenePresence) 221 if (m_scene.Entities.TryGetValue(client.AgentId, out presenceEntity) && presenceEntity is ScenePresence)
@@ -1894,7 +1897,53 @@ namespace OpenSim.Region.CoreModules.World.Land
1894 land.LandData.ParcelAccessList.Add(entry); 1897 land.LandData.ParcelAccessList.Add(entry);
1895 } 1898 }
1896 } 1899 }
1897 1900
1901 /// <summary>
1902 /// Sets the Home Point. The LoginService uses this to know where to put a user when they log-in
1903 /// </summary>
1904 /// <param name="remoteClient"></param>
1905 /// <param name="regionHandle"></param>
1906 /// <param name="position"></param>
1907 /// <param name="lookAt"></param>
1908 /// <param name="flags"></param>
1909 public virtual void ClientOnSetHome(IClientAPI remoteClient, ulong regionHandle, Vector3 position, Vector3 lookAt, uint flags)
1910 {
1911 // Let's find the parcel in question
1912 ILandObject land = landChannel.GetLandObject(position);
1913 if (land == null || m_scene.GridUserService == null)
1914 {
1915 m_Dialog.SendAlertToUser(remoteClient, "Set Home request failed.");
1916 return;
1917 }
1918
1919 // Gather some data
1920 ulong gpowers = remoteClient.GetGroupPowers(land.LandData.GroupID);
1921 SceneObjectGroup telehub = null;
1922 if (m_scene.RegionInfo.RegionSettings.TelehubObject != UUID.Zero)
1923 // Does the telehub exist in the scene?
1924 telehub = m_scene.GetSceneObjectGroup(m_scene.RegionInfo.RegionSettings.TelehubObject);
1925
1926 // Can the user set home here?
1927 if (// (a) gods and land managers can set home
1928 m_scene.Permissions.IsAdministrator(remoteClient.AgentId) ||
1929 m_scene.Permissions.IsGod(remoteClient.AgentId) ||
1930 // (b) land owners can set home
1931 remoteClient.AgentId == land.LandData.OwnerID ||
1932 // (c) members of the land-associated group in roles that can set home
1933 ((gpowers & (ulong)GroupPowers.AllowSetHome) == (ulong)GroupPowers.AllowSetHome) ||
1934 // (d) parcels with telehubs can be the home of anyone
1935 (telehub != null && land.ContainsPoint((int)telehub.AbsolutePosition.X, (int)telehub.AbsolutePosition.Y)))
1936 {
1937 if (m_scene.GridUserService.SetHome(remoteClient.AgentId.ToString(), land.RegionUUID, position, lookAt))
1938 // FUBAR ALERT: this needs to be "Home position set." so the viewer saves a home-screenshot.
1939 m_Dialog.SendAlertToUser(remoteClient, "Home position set.");
1940 else
1941 m_Dialog.SendAlertToUser(remoteClient, "Set Home request failed.");
1942 }
1943 else
1944 m_Dialog.SendAlertToUser(remoteClient, "You are not allowed to set your home location in this parcel.");
1945 }
1946
1898 protected void InstallInterfaces() 1947 protected void InstallInterfaces()
1899 { 1948 {
1900 Command clearCommand 1949 Command clearCommand
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
index 07d00c0..31f8a3f 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
@@ -249,13 +249,6 @@ namespace OpenSim.Region.CoreModules.World.Land
249 if (estateModule != null) 249 if (estateModule != null)
250 regionFlags = estateModule.GetRegionFlags(); 250 regionFlags = estateModule.GetRegionFlags();
251 251
252 // In a perfect world, this would have worked.
253 //
254// if ((landData.Flags & (uint)ParcelFlags.AllowLandmark) != 0)
255// regionFlags |= (uint)RegionFlags.AllowLandmark;
256// if (landData.OwnerID == remote_client.AgentId)
257// regionFlags |= (uint)RegionFlags.AllowSetHome;
258
259 int seq_id; 252 int seq_id;
260 if (snap_selection && (sequence_id == 0)) 253 if (snap_selection && (sequence_id == 0))
261 { 254 {