aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie2013-05-12 03:24:57 +0100
committerMelanie2013-05-12 03:24:57 +0100
commite8f4c7128fc65f12ef33b152e14b072809667642 (patch)
treea1708d78fa0ef078bf4d47233477fe531149e1ad /OpenSim/Region
parentMerge branch 'master' into careminster (diff)
parentFinalize the logic for SetHome. See comments in Land/LandManagementModule.cs ... (diff)
downloadopensim-SC_OLD-e8f4c7128fc65f12ef33b152e14b072809667642.zip
opensim-SC_OLD-e8f4c7128fc65f12ef33b152e14b072809667642.tar.gz
opensim-SC_OLD-e8f4c7128fc65f12ef33b152e14b072809667642.tar.bz2
opensim-SC_OLD-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')
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/AvatarPickerSearchModule.cs1
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs51
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandObject.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs29
4 files changed, 50 insertions, 38 deletions
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
71 return; 71 return;
72 72
73 m_URL = config.GetString("Cap_AvatarPickerSearch", string.Empty); 73 m_URL = config.GetString("Cap_AvatarPickerSearch", string.Empty);
74 m_log.DebugFormat("[XXX]: Cap_AvatarPickerSearch = {0}", m_URL);
75 // Cap doesn't exist 74 // Cap doesn't exist
76 if (m_URL != string.Empty) 75 if (m_URL != string.Empty)
77 m_Enabled = true; 76 m_Enabled = true;
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 {
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 1023e25..3aabd14 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3246,7 +3246,6 @@ namespace OpenSim.Region.Framework.Scenes
3246 { 3246 {
3247 //client.OnNameFromUUIDRequest += HandleUUIDNameRequest; 3247 //client.OnNameFromUUIDRequest += HandleUUIDNameRequest;
3248 client.OnMoneyTransferRequest += ProcessMoneyTransferRequest; 3248 client.OnMoneyTransferRequest += ProcessMoneyTransferRequest;
3249 client.OnSetStartLocationRequest += SetHomeRezPoint;
3250 client.OnRegionHandleRequest += RegionHandleRequest; 3249 client.OnRegionHandleRequest += RegionHandleRequest;
3251 } 3250 }
3252 3251
@@ -3373,7 +3372,6 @@ namespace OpenSim.Region.Framework.Scenes
3373 { 3372 {
3374 //client.OnNameFromUUIDRequest -= HandleUUIDNameRequest; 3373 //client.OnNameFromUUIDRequest -= HandleUUIDNameRequest;
3375 client.OnMoneyTransferRequest -= ProcessMoneyTransferRequest; 3374 client.OnMoneyTransferRequest -= ProcessMoneyTransferRequest;
3376 client.OnSetStartLocationRequest -= SetHomeRezPoint;
3377 client.OnRegionHandleRequest -= RegionHandleRequest; 3375 client.OnRegionHandleRequest -= RegionHandleRequest;
3378 } 3376 }
3379 3377
@@ -3500,33 +3498,6 @@ namespace OpenSim.Region.Framework.Scenes
3500 } 3498 }
3501 3499
3502 /// <summary> 3500 /// <summary>
3503 /// Sets the Home Point. The LoginService uses this to know where to put a user when they log-in
3504 /// </summary>
3505 /// <param name="remoteClient"></param>
3506 /// <param name="regionHandle"></param>
3507 /// <param name="position"></param>
3508 /// <param name="lookAt"></param>
3509 /// <param name="flags"></param>
3510 public virtual void SetHomeRezPoint(IClientAPI remoteClient, ulong regionHandle, Vector3 position, Vector3 lookAt, uint flags)
3511 {
3512 //Add half the avatar's height so that the user doesn't fall through prims
3513 ScenePresence presence;
3514 if (TryGetScenePresence(remoteClient.AgentId, out presence))
3515 {
3516 if (presence.Appearance != null)
3517 {
3518 position.Z = position.Z + (presence.Appearance.AvatarHeight / 2);
3519 }
3520 }
3521
3522 if (GridUserService != null && GridUserService.SetHome(remoteClient.AgentId.ToString(), RegionInfo.RegionID, position, lookAt))
3523 // FUBAR ALERT: this needs to be "Home position set." so the viewer saves a home-screenshot.
3524 m_dialogModule.SendAlertToUser(remoteClient, "Home position set.");
3525 else
3526 m_dialogModule.SendAlertToUser(remoteClient, "Set Home request Failed.");
3527 }
3528
3529 /// <summary>
3530 /// Get the avatar apperance for the given client. 3501 /// Get the avatar apperance for the given client.
3531 /// </summary> 3502 /// </summary>
3532 /// <param name="client"></param> 3503 /// <param name="client"></param>