diff options
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/LandManagementModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | 51 |
1 files changed, 50 insertions, 1 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 |