diff options
author | Teravus Ovares | 2008-04-17 05:07:14 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-04-17 05:07:14 +0000 |
commit | 244bfcde5b86180981e99ac9e88eb394f20bcd09 (patch) | |
tree | a163db049045c03e475779ce082a3cdfe74aea20 /OpenSim/Region/Environment/Scenes | |
parent | moved the Thread.Sleep(500), to the correct side of the ar.AsyncWaitHandle.... (diff) | |
download | opensim-SC-244bfcde5b86180981e99ac9e88eb394f20bcd09.zip opensim-SC-244bfcde5b86180981e99ac9e88eb394f20bcd09.tar.gz opensim-SC-244bfcde5b86180981e99ac9e88eb394f20bcd09.tar.bz2 opensim-SC-244bfcde5b86180981e99ac9e88eb394f20bcd09.tar.xz |
* Implements 'Set Home to Here'
* Implements 'Teleport Home'
* User Server has to be updated for it to save your home in grid mode
* home position accuracy is in int because the grid comms ExpectUser method tries to convert to Uint and crashes if it gets a float. Added a convert to decimal in ExpectUser but to avoid a breaking change with old revisions, kept the save value in int for now. Eventually it needs to be a float, but lets release another incremental version before doing that.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 46 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneEvents.cs | 4 |
2 files changed, 48 insertions, 2 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; |
diff --git a/OpenSim/Region/Environment/Scenes/SceneEvents.cs b/OpenSim/Region/Environment/Scenes/SceneEvents.cs index 67edf6b..89c519e 100644 --- a/OpenSim/Region/Environment/Scenes/SceneEvents.cs +++ b/OpenSim/Region/Environment/Scenes/SceneEvents.cs | |||
@@ -158,7 +158,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
158 | public class MoneyTransferArgs : System.EventArgs | 158 | public class MoneyTransferArgs : System.EventArgs |
159 | { | 159 | { |
160 | public LLUUID sender; | 160 | public LLUUID sender; |
161 | public LLUUID reciever; | 161 | public LLUUID receiver; |
162 | 162 | ||
163 | // Always false. The SL protocol sucks. | 163 | // Always false. The SL protocol sucks. |
164 | public bool authenticated = false; | 164 | public bool authenticated = false; |
@@ -169,7 +169,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
169 | 169 | ||
170 | public MoneyTransferArgs(LLUUID asender, LLUUID areciever, int aamount, int atransactiontype, string adescription) { | 170 | public MoneyTransferArgs(LLUUID asender, LLUUID areciever, int aamount, int atransactiontype, string adescription) { |
171 | sender = asender; | 171 | sender = asender; |
172 | reciever = areciever; | 172 | receiver = areciever; |
173 | amount = aamount; | 173 | amount = aamount; |
174 | transactiontype = atransactiontype; | 174 | transactiontype = atransactiontype; |
175 | description = adescription; | 175 | description = adescription; |