diff options
author | Melanie Thielker | 2009-01-13 23:29:54 +0000 |
---|---|---|
committer | Melanie Thielker | 2009-01-13 23:29:54 +0000 |
commit | 1c3542303c11b2186fe23268266c02e717cc5aae (patch) | |
tree | 09a521a1a9944be8e2a6ce0c721a809efab8d76f | |
parent | * Add a second logoffuser message with the region secret. (diff) | |
download | opensim-SC_OLD-1c3542303c11b2186fe23268266c02e717cc5aae.zip opensim-SC_OLD-1c3542303c11b2186fe23268266c02e717cc5aae.tar.gz opensim-SC_OLD-1c3542303c11b2186fe23268266c02e717cc5aae.tar.bz2 opensim-SC_OLD-1c3542303c11b2186fe23268266c02e717cc5aae.tar.xz |
Change fake parcel ids to allow a Z coordinate. Change TP by lure
to also transmit and use a Z coordinate.
-rw-r--r-- | OpenSim/Framework/Util.cs | 28 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Modules/Avatar/Lure/LureModule.cs | 8 |
2 files changed, 29 insertions, 7 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 8e7eac7..7217ece 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -806,8 +806,19 @@ namespace OpenSim.Framework | |||
806 | { | 806 | { |
807 | (byte)regionHandle, (byte)(regionHandle >> 8), (byte)(regionHandle >> 16), (byte)(regionHandle >> 24), | 807 | (byte)regionHandle, (byte)(regionHandle >> 8), (byte)(regionHandle >> 16), (byte)(regionHandle >> 24), |
808 | (byte)(regionHandle >> 32), (byte)(regionHandle >> 40), (byte)(regionHandle >> 48), (byte)(regionHandle << 56), | 808 | (byte)(regionHandle >> 32), (byte)(regionHandle >> 40), (byte)(regionHandle >> 48), (byte)(regionHandle << 56), |
809 | (byte)x, (byte)(x >> 8), (byte)(x >> 16), (byte)(x >> 24), | 809 | (byte)x, (byte)(x >> 8), 0, 0, |
810 | (byte)y, (byte)(y >> 8), (byte)(y >> 16), (byte)(y >> 24) }; | 810 | (byte)y, (byte)(y >> 8), 0, 0 }; |
811 | return new UUID(bytes, 0); | ||
812 | } | ||
813 | |||
814 | public static UUID BuildFakeParcelID(ulong regionHandle, uint x, uint y, uint z) | ||
815 | { | ||
816 | byte[] bytes = | ||
817 | { | ||
818 | (byte)regionHandle, (byte)(regionHandle >> 8), (byte)(regionHandle >> 16), (byte)(regionHandle >> 24), | ||
819 | (byte)(regionHandle >> 32), (byte)(regionHandle >> 40), (byte)(regionHandle >> 48), (byte)(regionHandle << 56), | ||
820 | (byte)x, (byte)(x >> 8), (byte)z, (byte)(z >> 8), | ||
821 | (byte)y, (byte)(y >> 8), 0, 0 }; | ||
811 | return new UUID(bytes, 0); | 822 | return new UUID(bytes, 0); |
812 | } | 823 | } |
813 | 824 | ||
@@ -815,8 +826,17 @@ namespace OpenSim.Framework | |||
815 | { | 826 | { |
816 | byte[] bytes = parcelID.GetBytes(); | 827 | byte[] bytes = parcelID.GetBytes(); |
817 | regionHandle = Utils.BytesToUInt64(bytes); | 828 | regionHandle = Utils.BytesToUInt64(bytes); |
818 | x = Utils.BytesToUInt(bytes, 8); | 829 | x = Utils.BytesToUInt(bytes, 8) & 0xffff; |
819 | y = Utils.BytesToUInt(bytes, 12); | 830 | y = Utils.BytesToUInt(bytes, 12) & 0xffff; |
831 | } | ||
832 | |||
833 | public static void ParseFakeParcelID(UUID parcelID, out ulong regionHandle, out uint x, out uint y, out uint z) | ||
834 | { | ||
835 | byte[] bytes = parcelID.GetBytes(); | ||
836 | regionHandle = Utils.BytesToUInt64(bytes); | ||
837 | x = Utils.BytesToUInt(bytes, 8) & 0xffff; | ||
838 | z = (Utils.BytesToUInt(bytes, 8) & 0xffff0000) >> 16; | ||
839 | y = Utils.BytesToUInt(bytes, 12) & 0xffff; | ||
820 | } | 840 | } |
821 | 841 | ||
822 | public static void FakeParcelIDToGlobalPosition(UUID parcelID, out uint x, out uint y) | 842 | public static void FakeParcelIDToGlobalPosition(UUID parcelID, out uint x, out uint y) |
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Lure/LureModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Lure/LureModule.cs index 7228dd6..7bb6843 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Lure/LureModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Lure/LureModule.cs | |||
@@ -119,7 +119,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Lure | |||
119 | UUID dest = Util.BuildFakeParcelID( | 119 | UUID dest = Util.BuildFakeParcelID( |
120 | scene.RegionInfo.RegionHandle, | 120 | scene.RegionInfo.RegionHandle, |
121 | (uint)presence.AbsolutePosition.X, | 121 | (uint)presence.AbsolutePosition.X, |
122 | (uint)presence.AbsolutePosition.Y); | 122 | (uint)presence.AbsolutePosition.Y, |
123 | (uint)presence.AbsolutePosition.Z); | ||
123 | 124 | ||
124 | m_log.DebugFormat("TP invite with message {0}", message); | 125 | m_log.DebugFormat("TP invite with message {0}", message); |
125 | 126 | ||
@@ -146,13 +147,14 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Lure | |||
146 | ulong handle = 0; | 147 | ulong handle = 0; |
147 | uint x = 128; | 148 | uint x = 128; |
148 | uint y = 128; | 149 | uint y = 128; |
150 | uint z = 70; | ||
149 | 151 | ||
150 | Util.ParseFakeParcelID(lureID, out handle, out x, out y); | 152 | Util.ParseFakeParcelID(lureID, out handle, out x, out y, out z); |
151 | 153 | ||
152 | Vector3 position = new Vector3(); | 154 | Vector3 position = new Vector3(); |
153 | position.X = (float)x; | 155 | position.X = (float)x; |
154 | position.Y = (float)y; | 156 | position.Y = (float)y; |
155 | position.Z = 0.0f; | 157 | position.Z = (float)z; |
156 | 158 | ||
157 | scene.RequestTeleportLocation(client, handle, position, | 159 | scene.RequestTeleportLocation(client, handle, position, |
158 | Vector3.Zero, teleportFlags); | 160 | Vector3.Zero, teleportFlags); |