diff options
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 08cf3d8..20572a9 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -1581,9 +1581,55 @@ namespace OpenSim.Region.Environment.Scenes | |||
1581 | 1581 | ||
1582 | client.OnObjectIncludeInSearch += m_innerScene.MakeObjectSearchable; | 1582 | client.OnObjectIncludeInSearch += m_innerScene.MakeObjectSearchable; |
1583 | 1583 | ||
1584 | client.OnTeleportHomeRequest += TeleportClientHome; | ||
1585 | |||
1586 | client.OnSetStartLocationRequest += SetHomeRezPoint; | ||
1587 | |||
1584 | EventManager.TriggerOnNewClient(client); | 1588 | EventManager.TriggerOnNewClient(client); |
1585 | } | 1589 | } |
1590 | public virtual void TeleportClientHome(LLUUID AgentId, IClientAPI client) | ||
1591 | { | ||
1592 | UserProfileData UserProfile = CommsManager.UserService.GetUserProfile(AgentId); | ||
1593 | if (UserProfile != null) | ||
1594 | { | ||
1595 | ulong homeRegion = UserProfile.HomeRegion; | ||
1596 | LLVector3 homePostion = new LLVector3(UserProfile.HomeLocationX,UserProfile.HomeLocationY,UserProfile.HomeLocationZ); | ||
1597 | LLVector3 homeLookat = new LLVector3(UserProfile.HomeLookAt); | ||
1598 | RequestTeleportLocation(client, homeRegion, homePostion,homeLookat,(uint)0); | ||
1599 | |||
1600 | } | ||
1601 | |||
1586 | 1602 | ||
1603 | } | ||
1604 | |||
1605 | public virtual void SetHomeRezPoint(IClientAPI remoteClient, ulong regionHandle, LLVector3 position, LLVector3 lookAt, uint flags) | ||
1606 | { | ||
1607 | UserProfileData UserProfile = CommsManager.UserService.GetUserProfile(remoteClient.AgentId); | ||
1608 | if (UserProfile != null) | ||
1609 | { | ||
1610 | // I know I'm ignoring the regionHandle provided by the teleport location request. | ||
1611 | // reusing the TeleportLocationRequest delegate, so regionHandle isn't valid | ||
1612 | UserProfile.HomeRegion = RegionInfo.RegionHandle; | ||
1613 | |||
1614 | // We cast these to an int so as not to cause a breaking change with old regions | ||
1615 | // Newer regions treat this as a float on the ExpectUser method.. so we need to wait a few | ||
1616 | // releases before setting these to floats. (r4257) | ||
1617 | UserProfile.HomeLocationX = (int)position.X; | ||
1618 | UserProfile.HomeLocationY = (int)position.Y; | ||
1619 | UserProfile.HomeLocationZ = (int)position.Z; | ||
1620 | UserProfile.HomeLookAtX = (int)lookAt.X; | ||
1621 | UserProfile.HomeLookAtY = (int)lookAt.Y; | ||
1622 | UserProfile.HomeLookAtZ = (int)lookAt.Z; | ||
1623 | CommsManager.UserService.UpdateUserProfileProperties(UserProfile); | ||
1624 | |||
1625 | remoteClient.SendAgentAlertMessage("Set home to here if supported by login service",false); | ||
1626 | } | ||
1627 | else | ||
1628 | { | ||
1629 | remoteClient.SendAgentAlertMessage("Set Home request Failed",false); | ||
1630 | } | ||
1631 | |||
1632 | } | ||
1587 | protected virtual ScenePresence CreateAndAddScenePresence(IClientAPI client, bool child) | 1633 | protected virtual ScenePresence CreateAndAddScenePresence(IClientAPI client, bool child) |
1588 | { | 1634 | { |
1589 | ScenePresence avatar = null; | 1635 | ScenePresence avatar = null; |