diff options
author | KittoFlora | 2009-11-15 22:20:51 +0100 |
---|---|---|
committer | KittoFlora | 2009-11-15 22:20:51 +0100 |
commit | ba77f0c2ac9e41d7c8ca00ddf4b68bc4f25deaee (patch) | |
tree | e218f290178d98e63aa8ab6aef46c1715195c32e /OpenSim/Region/CoreModules/World | |
parent | Merge branch 'master' into vehicles (diff) | |
parent | Make GroupRootUpdate be a terse update. This method is not used by opensim (i... (diff) | |
download | opensim-SC-ba77f0c2ac9e41d7c8ca00ddf4b68bc4f25deaee.zip opensim-SC-ba77f0c2ac9e41d7c8ca00ddf4b68bc4f25deaee.tar.gz opensim-SC-ba77f0c2ac9e41d7c8ca00ddf4b68bc4f25deaee.tar.bz2 opensim-SC-ba77f0c2ac9e41d7c8ca00ddf4b68bc4f25deaee.tar.xz |
Merge branch 'master' into vehicles
Diffstat (limited to 'OpenSim/Region/CoreModules/World')
15 files changed, 82 insertions, 1767 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index c261943..70a225e 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -332,10 +332,12 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
332 | { | 332 | { |
333 | sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; | 333 | sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; |
334 | 334 | ||
335 | if (assetType == (sbyte)AssetType.Unknown) | ||
336 | m_log.WarnFormat("[ARCHIVER]: Importing {0} byte asset {1} with unknown type", data.Length, uuid); | ||
337 | |||
335 | //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); | 338 | //m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType); |
336 | 339 | ||
337 | AssetBase asset = new AssetBase(new UUID(uuid), String.Empty); | 340 | AssetBase asset = new AssetBase(new UUID(uuid), String.Empty, assetType); |
338 | asset.Type = assetType; | ||
339 | asset.Data = data; | 341 | asset.Data = data; |
340 | 342 | ||
341 | // We're relying on the asset service to do the sensible thing and not store the asset if it already | 343 | // We're relying on the asset service to do the sensible thing and not store the asset if it already |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs index 5208e7a..2d2c570 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs | |||
@@ -158,9 +158,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
158 | 158 | ||
159 | m_log.DebugFormat("[ARCHIVER]: Importing asset {0}", filename); | 159 | m_log.DebugFormat("[ARCHIVER]: Importing asset {0}", filename); |
160 | 160 | ||
161 | AssetBase asset = new AssetBase(new UUID(filename), metadata.Name); | 161 | AssetBase asset = new AssetBase(new UUID(filename), metadata.Name, metadata.AssetType); |
162 | asset.Description = metadata.Description; | 162 | asset.Description = metadata.Description; |
163 | asset.Type = metadata.AssetType; | ||
164 | asset.Data = data; | 163 | asset.Data = data; |
165 | 164 | ||
166 | m_cache.Store(asset); | 165 | m_cache.Store(asset); |
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateTerrainXferHandler.cs b/OpenSim/Region/CoreModules/World/Estate/EstateTerrainXferHandler.cs index ddac515..2ff635b 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateTerrainXferHandler.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateTerrainXferHandler.cs | |||
@@ -52,16 +52,11 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
52 | 52 | ||
53 | public EstateTerrainXferHandler(IClientAPI pRemoteClient, string pClientFilename) | 53 | public EstateTerrainXferHandler(IClientAPI pRemoteClient, string pClientFilename) |
54 | { | 54 | { |
55 | 55 | m_asset = new AssetBase(UUID.Zero, pClientFilename, type); | |
56 | m_asset = new AssetBase(); | ||
57 | m_asset.FullID = UUID.Zero; | ||
58 | m_asset.Type = type; | ||
59 | m_asset.Data = new byte[0]; | 56 | m_asset.Data = new byte[0]; |
60 | m_asset.Name = pClientFilename; | ||
61 | m_asset.Description = "empty"; | 57 | m_asset.Description = "empty"; |
62 | m_asset.Local = true; | 58 | m_asset.Local = true; |
63 | m_asset.Temporary = true; | 59 | m_asset.Temporary = true; |
64 | |||
65 | } | 60 | } |
66 | 61 | ||
67 | public ulong XferID | 62 | public ulong XferID |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 93a949a..968f46a 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -1059,9 +1059,11 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1059 | if (m_scene.Permissions.IsGod(remote_client.AgentId)) | 1059 | if (m_scene.Permissions.IsGod(remote_client.AgentId)) |
1060 | { | 1060 | { |
1061 | land.LandData.OwnerID = ownerID; | 1061 | land.LandData.OwnerID = ownerID; |
1062 | land.LandData.GroupID = UUID.Zero; | ||
1063 | land.LandData.IsGroupOwned = false; | ||
1062 | 1064 | ||
1063 | m_scene.ForEachClient(SendParcelOverlay); | 1065 | m_scene.ForEachClient(SendParcelOverlay); |
1064 | land.SendLandUpdateToClient(remote_client); | 1066 | land.SendLandUpdateToClient(true, remote_client); |
1065 | } | 1067 | } |
1066 | } | 1068 | } |
1067 | } | 1069 | } |
@@ -1082,8 +1084,10 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1082 | land.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | 1084 | land.LandData.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
1083 | else | 1085 | else |
1084 | land.LandData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; | 1086 | land.LandData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; |
1087 | land.LandData.GroupID = UUID.Zero; | ||
1088 | land.LandData.IsGroupOwned = false; | ||
1085 | m_scene.ForEachClient(SendParcelOverlay); | 1089 | m_scene.ForEachClient(SendParcelOverlay); |
1086 | land.SendLandUpdateToClient(remote_client); | 1090 | land.SendLandUpdateToClient(true, remote_client); |
1087 | } | 1091 | } |
1088 | } | 1092 | } |
1089 | } | 1093 | } |
@@ -1105,9 +1109,10 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1105 | else | 1109 | else |
1106 | land.LandData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; | 1110 | land.LandData.OwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; |
1107 | land.LandData.ClaimDate = Util.UnixTimeSinceEpoch(); | 1111 | land.LandData.ClaimDate = Util.UnixTimeSinceEpoch(); |
1112 | land.LandData.GroupID = UUID.Zero; | ||
1108 | land.LandData.IsGroupOwned = false; | 1113 | land.LandData.IsGroupOwned = false; |
1109 | m_scene.ForEachClient(SendParcelOverlay); | 1114 | m_scene.ForEachClient(SendParcelOverlay); |
1110 | land.SendLandUpdateToClient(remote_client); | 1115 | land.SendLandUpdateToClient(true, remote_client); |
1111 | } | 1116 | } |
1112 | } | 1117 | } |
1113 | } | 1118 | } |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index bfe85f1..0bd225e 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs | |||
@@ -49,6 +49,8 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
49 | #pragma warning restore 0429 | 49 | #pragma warning restore 0429 |
50 | private bool[,] m_landBitmap = new bool[landArrayMax,landArrayMax]; | 50 | private bool[,] m_landBitmap = new bool[landArrayMax,landArrayMax]; |
51 | 51 | ||
52 | private int m_lastSeqId = 0; | ||
53 | |||
52 | protected LandData m_landData = new LandData(); | 54 | protected LandData m_landData = new LandData(); |
53 | protected Scene m_scene; | 55 | protected Scene m_scene; |
54 | protected List<SceneObjectGroup> primsOverMe = new List<SceneObjectGroup>(); | 56 | protected List<SceneObjectGroup> primsOverMe = new List<SceneObjectGroup>(); |
@@ -81,6 +83,10 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
81 | { | 83 | { |
82 | m_scene = scene; | 84 | m_scene = scene; |
83 | LandData.OwnerID = owner_id; | 85 | LandData.OwnerID = owner_id; |
86 | if (is_group_owned) | ||
87 | LandData.GroupID = owner_id; | ||
88 | else | ||
89 | LandData.GroupID = UUID.Zero; | ||
84 | LandData.IsGroupOwned = is_group_owned; | 90 | LandData.IsGroupOwned = is_group_owned; |
85 | } | 91 | } |
86 | 92 | ||
@@ -172,7 +178,19 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
172 | // regionFlags |= (uint)RegionFlags.AllowLandmark; | 178 | // regionFlags |= (uint)RegionFlags.AllowLandmark; |
173 | // if (landData.OwnerID == remote_client.AgentId) | 179 | // if (landData.OwnerID == remote_client.AgentId) |
174 | // regionFlags |= (uint)RegionFlags.AllowSetHome; | 180 | // regionFlags |= (uint)RegionFlags.AllowSetHome; |
175 | remote_client.SendLandProperties(sequence_id, | 181 | |
182 | int seq_id; | ||
183 | if (snap_selection && (sequence_id == 0)) | ||
184 | { | ||
185 | seq_id = m_lastSeqId; | ||
186 | } | ||
187 | else | ||
188 | { | ||
189 | seq_id = sequence_id; | ||
190 | m_lastSeqId = seq_id; | ||
191 | } | ||
192 | |||
193 | remote_client.SendLandProperties(seq_id, | ||
176 | snap_selection, request_result, LandData, | 194 | snap_selection, request_result, LandData, |
177 | (float)m_scene.RegionInfo.RegionSettings.ObjectBonus, | 195 | (float)m_scene.RegionInfo.RegionSettings.ObjectBonus, |
178 | GetParcelMaxPrimCount(this), | 196 | GetParcelMaxPrimCount(this), |
@@ -184,6 +202,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
184 | if (m_scene.Permissions.CanEditParcel(remote_client.AgentId,this)) | 202 | if (m_scene.Permissions.CanEditParcel(remote_client.AgentId,this)) |
185 | { | 203 | { |
186 | //Needs later group support | 204 | //Needs later group support |
205 | bool snap_selection = false; | ||
187 | LandData newData = LandData.Copy(); | 206 | LandData newData = LandData.Copy(); |
188 | 207 | ||
189 | if (args.AuthBuyerID != newData.AuthBuyerID || args.SalePrice != newData.SalePrice) | 208 | if (args.AuthBuyerID != newData.AuthBuyerID || args.SalePrice != newData.SalePrice) |
@@ -192,6 +211,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
192 | { | 211 | { |
193 | newData.AuthBuyerID = args.AuthBuyerID; | 212 | newData.AuthBuyerID = args.AuthBuyerID; |
194 | newData.SalePrice = args.SalePrice; | 213 | newData.SalePrice = args.SalePrice; |
214 | snap_selection = true; | ||
195 | } | 215 | } |
196 | } | 216 | } |
197 | newData.Category = args.Category; | 217 | newData.Category = args.Category; |
@@ -212,7 +232,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
212 | 232 | ||
213 | m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); | 233 | m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); |
214 | 234 | ||
215 | SendLandUpdateToAvatarsOverMe(); | 235 | SendLandUpdateToAvatarsOverMe(snap_selection); |
216 | } | 236 | } |
217 | } | 237 | } |
218 | 238 | ||
@@ -230,7 +250,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
230 | newData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects); | 250 | newData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects); |
231 | m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); | 251 | m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); |
232 | 252 | ||
233 | SendLandUpdateToAvatarsOverMe(); | 253 | SendLandUpdateToAvatarsOverMe(true); |
234 | } | 254 | } |
235 | 255 | ||
236 | public void DeedToGroup(UUID groupID) | 256 | public void DeedToGroup(UUID groupID) |
@@ -242,7 +262,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
242 | 262 | ||
243 | m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); | 263 | m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); |
244 | 264 | ||
245 | SendLandUpdateToAvatarsOverMe(); | 265 | SendLandUpdateToAvatarsOverMe(true); |
246 | } | 266 | } |
247 | 267 | ||
248 | public bool IsEitherBannedOrRestricted(UUID avatar) | 268 | public bool IsEitherBannedOrRestricted(UUID avatar) |
@@ -297,8 +317,18 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
297 | SendLandProperties(0, false, 0, remote_client); | 317 | SendLandProperties(0, false, 0, remote_client); |
298 | } | 318 | } |
299 | 319 | ||
320 | public void SendLandUpdateToClient(bool snap_selection, IClientAPI remote_client) | ||
321 | { | ||
322 | SendLandProperties(0, snap_selection, 0, remote_client); | ||
323 | } | ||
324 | |||
300 | public void SendLandUpdateToAvatarsOverMe() | 325 | public void SendLandUpdateToAvatarsOverMe() |
301 | { | 326 | { |
327 | SendLandUpdateToAvatarsOverMe(false); | ||
328 | } | ||
329 | |||
330 | public void SendLandUpdateToAvatarsOverMe(bool snap_selection) | ||
331 | { | ||
302 | List<ScenePresence> avatars = m_scene.GetAvatars(); | 332 | List<ScenePresence> avatars = m_scene.GetAvatars(); |
303 | ILandObject over = null; | 333 | ILandObject over = null; |
304 | for (int i = 0; i < avatars.Count; i++) | 334 | for (int i = 0; i < avatars.Count; i++) |
@@ -325,7 +355,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
325 | else | 355 | else |
326 | avatars[i].Invulnerable = true; | 356 | avatars[i].Invulnerable = true; |
327 | 357 | ||
328 | SendLandUpdateToClient(avatars[i].ControllingClient); | 358 | SendLandUpdateToClient(snap_selection, avatars[i].ControllingClient); |
329 | } | 359 | } |
330 | } | 360 | } |
331 | } | 361 | } |
diff --git a/OpenSim/Region/CoreModules/World/Land/RegionCombinerClientEventForwarder.cs b/OpenSim/Region/CoreModules/World/Land/RegionCombinerClientEventForwarder.cs deleted file mode 100644 index 70d6de3..0000000 --- a/OpenSim/Region/CoreModules/World/Land/RegionCombinerClientEventForwarder.cs +++ /dev/null | |||
@@ -1,94 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using OpenMetaverse; | ||
31 | using OpenSim.Region.Framework.Scenes; | ||
32 | |||
33 | namespace OpenSim.Region.CoreModules.World.Land | ||
34 | { | ||
35 | public class RegionCombinerClientEventForwarder | ||
36 | { | ||
37 | private Scene m_rootScene; | ||
38 | private Dictionary<UUID, Scene> m_virtScene = new Dictionary<UUID, Scene>(); | ||
39 | private Dictionary<UUID,RegionCombinerIndividualEventForwarder> m_forwarders = new Dictionary<UUID, | ||
40 | RegionCombinerIndividualEventForwarder>(); | ||
41 | |||
42 | public RegionCombinerClientEventForwarder(RegionConnections rootScene) | ||
43 | { | ||
44 | m_rootScene = rootScene.RegionScene; | ||
45 | } | ||
46 | |||
47 | public void AddSceneToEventForwarding(Scene virtualScene) | ||
48 | { | ||
49 | lock (m_virtScene) | ||
50 | { | ||
51 | if (m_virtScene.ContainsKey(virtualScene.RegionInfo.originRegionID)) | ||
52 | { | ||
53 | m_virtScene[virtualScene.RegionInfo.originRegionID] = virtualScene; | ||
54 | } | ||
55 | else | ||
56 | { | ||
57 | m_virtScene.Add(virtualScene.RegionInfo.originRegionID, virtualScene); | ||
58 | } | ||
59 | } | ||
60 | |||
61 | lock (m_forwarders) | ||
62 | { | ||
63 | // TODO: Fix this to unregister if this happens | ||
64 | if (m_forwarders.ContainsKey(virtualScene.RegionInfo.originRegionID)) | ||
65 | m_forwarders.Remove(virtualScene.RegionInfo.originRegionID); | ||
66 | |||
67 | RegionCombinerIndividualEventForwarder forwarder = | ||
68 | new RegionCombinerIndividualEventForwarder(m_rootScene, virtualScene); | ||
69 | m_forwarders.Add(virtualScene.RegionInfo.originRegionID, forwarder); | ||
70 | |||
71 | virtualScene.EventManager.OnNewClient += forwarder.ClientConnect; | ||
72 | virtualScene.EventManager.OnClientClosed += forwarder.ClientClosed; | ||
73 | } | ||
74 | } | ||
75 | |||
76 | public void RemoveSceneFromEventForwarding (Scene virtualScene) | ||
77 | { | ||
78 | lock (m_forwarders) | ||
79 | { | ||
80 | RegionCombinerIndividualEventForwarder forwarder = m_forwarders[virtualScene.RegionInfo.originRegionID]; | ||
81 | virtualScene.EventManager.OnNewClient -= forwarder.ClientConnect; | ||
82 | virtualScene.EventManager.OnClientClosed -= forwarder.ClientClosed; | ||
83 | m_forwarders.Remove(virtualScene.RegionInfo.originRegionID); | ||
84 | } | ||
85 | lock (m_virtScene) | ||
86 | { | ||
87 | if (m_virtScene.ContainsKey(virtualScene.RegionInfo.originRegionID)) | ||
88 | { | ||
89 | m_virtScene.Remove(virtualScene.RegionInfo.originRegionID); | ||
90 | } | ||
91 | } | ||
92 | } | ||
93 | } | ||
94 | } \ No newline at end of file | ||
diff --git a/OpenSim/Region/CoreModules/World/Land/RegionCombinerIndividualEventForwarder.cs b/OpenSim/Region/CoreModules/World/Land/RegionCombinerIndividualEventForwarder.cs deleted file mode 100644 index 2cbaf96..0000000 --- a/OpenSim/Region/CoreModules/World/Land/RegionCombinerIndividualEventForwarder.cs +++ /dev/null | |||
@@ -1,125 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using OpenMetaverse; | ||
30 | using OpenSim.Framework; | ||
31 | using OpenSim.Region.Framework.Scenes; | ||
32 | |||
33 | namespace OpenSim.Region.CoreModules.World.Land | ||
34 | { | ||
35 | public class RegionCombinerIndividualEventForwarder | ||
36 | { | ||
37 | private Scene m_rootScene; | ||
38 | private Scene m_virtScene; | ||
39 | |||
40 | public RegionCombinerIndividualEventForwarder(Scene rootScene, Scene virtScene) | ||
41 | { | ||
42 | m_rootScene = rootScene; | ||
43 | m_virtScene = virtScene; | ||
44 | } | ||
45 | |||
46 | public void ClientConnect(IClientAPI client) | ||
47 | { | ||
48 | m_virtScene.UnSubscribeToClientPrimEvents(client); | ||
49 | m_virtScene.UnSubscribeToClientPrimRezEvents(client); | ||
50 | m_virtScene.UnSubscribeToClientInventoryEvents(client); | ||
51 | m_virtScene.UnSubscribeToClientAttachmentEvents(client); | ||
52 | //m_virtScene.UnSubscribeToClientTeleportEvents(client); | ||
53 | m_virtScene.UnSubscribeToClientScriptEvents(client); | ||
54 | m_virtScene.UnSubscribeToClientGodEvents(client); | ||
55 | m_virtScene.UnSubscribeToClientNetworkEvents(client); | ||
56 | |||
57 | m_rootScene.SubscribeToClientPrimEvents(client); | ||
58 | client.OnAddPrim += LocalAddNewPrim; | ||
59 | client.OnRezObject += LocalRezObject; | ||
60 | m_rootScene.SubscribeToClientInventoryEvents(client); | ||
61 | m_rootScene.SubscribeToClientAttachmentEvents(client); | ||
62 | //m_rootScene.SubscribeToClientTeleportEvents(client); | ||
63 | m_rootScene.SubscribeToClientScriptEvents(client); | ||
64 | m_rootScene.SubscribeToClientGodEvents(client); | ||
65 | m_rootScene.SubscribeToClientNetworkEvents(client); | ||
66 | } | ||
67 | |||
68 | public void ClientClosed(UUID clientid, Scene scene) | ||
69 | { | ||
70 | } | ||
71 | |||
72 | /// <summary> | ||
73 | /// Fixes position based on the region the Rez event came in on | ||
74 | /// </summary> | ||
75 | /// <param name="remoteclient"></param> | ||
76 | /// <param name="itemid"></param> | ||
77 | /// <param name="rayend"></param> | ||
78 | /// <param name="raystart"></param> | ||
79 | /// <param name="raytargetid"></param> | ||
80 | /// <param name="bypassraycast"></param> | ||
81 | /// <param name="rayendisintersection"></param> | ||
82 | /// <param name="rezselected"></param> | ||
83 | /// <param name="removeitem"></param> | ||
84 | /// <param name="fromtaskid"></param> | ||
85 | private void LocalRezObject(IClientAPI remoteclient, UUID itemid, Vector3 rayend, Vector3 raystart, | ||
86 | UUID raytargetid, byte bypassraycast, bool rayendisintersection, bool rezselected, bool removeitem, | ||
87 | UUID fromtaskid) | ||
88 | { | ||
89 | int differenceX = (int)m_virtScene.RegionInfo.RegionLocX - (int)m_rootScene.RegionInfo.RegionLocX; | ||
90 | int differenceY = (int)m_virtScene.RegionInfo.RegionLocY - (int)m_rootScene.RegionInfo.RegionLocY; | ||
91 | rayend.X += differenceX * (int)Constants.RegionSize; | ||
92 | rayend.Y += differenceY * (int)Constants.RegionSize; | ||
93 | raystart.X += differenceX * (int)Constants.RegionSize; | ||
94 | raystart.Y += differenceY * (int)Constants.RegionSize; | ||
95 | |||
96 | m_rootScene.RezObject(remoteclient, itemid, rayend, raystart, raytargetid, bypassraycast, | ||
97 | rayendisintersection, rezselected, removeitem, fromtaskid); | ||
98 | } | ||
99 | /// <summary> | ||
100 | /// Fixes position based on the region the AddPrimShape event came in on | ||
101 | /// </summary> | ||
102 | /// <param name="ownerid"></param> | ||
103 | /// <param name="groupid"></param> | ||
104 | /// <param name="rayend"></param> | ||
105 | /// <param name="rot"></param> | ||
106 | /// <param name="shape"></param> | ||
107 | /// <param name="bypassraycast"></param> | ||
108 | /// <param name="raystart"></param> | ||
109 | /// <param name="raytargetid"></param> | ||
110 | /// <param name="rayendisintersection"></param> | ||
111 | private void LocalAddNewPrim(UUID ownerid, UUID groupid, Vector3 rayend, Quaternion rot, | ||
112 | PrimitiveBaseShape shape, byte bypassraycast, Vector3 raystart, UUID raytargetid, | ||
113 | byte rayendisintersection) | ||
114 | { | ||
115 | int differenceX = (int)m_virtScene.RegionInfo.RegionLocX - (int)m_rootScene.RegionInfo.RegionLocX; | ||
116 | int differenceY = (int)m_virtScene.RegionInfo.RegionLocY - (int)m_rootScene.RegionInfo.RegionLocY; | ||
117 | rayend.X += differenceX * (int)Constants.RegionSize; | ||
118 | rayend.Y += differenceY * (int)Constants.RegionSize; | ||
119 | raystart.X += differenceX * (int)Constants.RegionSize; | ||
120 | raystart.Y += differenceY * (int)Constants.RegionSize; | ||
121 | m_rootScene.AddNewPrim(ownerid, groupid, rayend, rot, shape, bypassraycast, raystart, raytargetid, | ||
122 | rayendisintersection); | ||
123 | } | ||
124 | } | ||
125 | } \ No newline at end of file | ||
diff --git a/OpenSim/Region/CoreModules/World/Land/RegionCombinerLargeLandChannel.cs b/OpenSim/Region/CoreModules/World/Land/RegionCombinerLargeLandChannel.cs deleted file mode 100644 index 7df836c..0000000 --- a/OpenSim/Region/CoreModules/World/Land/RegionCombinerLargeLandChannel.cs +++ /dev/null | |||
@@ -1,163 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using OpenMetaverse; | ||
31 | using OpenSim.Framework; | ||
32 | using OpenSim.Region.Framework.Interfaces; | ||
33 | |||
34 | namespace OpenSim.Region.CoreModules.World.Land | ||
35 | { | ||
36 | public class RegionCombinerLargeLandChannel : ILandChannel | ||
37 | { | ||
38 | // private static readonly ILog m_log = | ||
39 | // LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
40 | private RegionData RegData; | ||
41 | private ILandChannel RootRegionLandChannel; | ||
42 | private readonly List<RegionData> RegionConnections; | ||
43 | |||
44 | #region ILandChannel Members | ||
45 | |||
46 | public RegionCombinerLargeLandChannel(RegionData regData, ILandChannel rootRegionLandChannel, | ||
47 | List<RegionData> regionConnections) | ||
48 | { | ||
49 | RegData = regData; | ||
50 | RootRegionLandChannel = rootRegionLandChannel; | ||
51 | RegionConnections = regionConnections; | ||
52 | } | ||
53 | |||
54 | public List<ILandObject> ParcelsNearPoint(Vector3 position) | ||
55 | { | ||
56 | //m_log.DebugFormat("[LANDPARCELNEARPOINT]: {0}>", position); | ||
57 | return RootRegionLandChannel.ParcelsNearPoint(position - RegData.Offset); | ||
58 | } | ||
59 | |||
60 | public List<ILandObject> AllParcels() | ||
61 | { | ||
62 | return RootRegionLandChannel.AllParcels(); | ||
63 | } | ||
64 | |||
65 | public ILandObject GetLandObject(int x, int y) | ||
66 | { | ||
67 | //m_log.DebugFormat("[BIGLANDTESTINT]: <{0},{1}>", x, y); | ||
68 | |||
69 | if (x > 0 && x <= (int)Constants.RegionSize && y > 0 && y <= (int)Constants.RegionSize) | ||
70 | { | ||
71 | return RootRegionLandChannel.GetLandObject(x, y); | ||
72 | } | ||
73 | else | ||
74 | { | ||
75 | int offsetX = (x / (int)Constants.RegionSize); | ||
76 | int offsetY = (y / (int)Constants.RegionSize); | ||
77 | offsetX *= (int)Constants.RegionSize; | ||
78 | offsetY *= (int)Constants.RegionSize; | ||
79 | |||
80 | foreach (RegionData regionData in RegionConnections) | ||
81 | { | ||
82 | if (regionData.Offset.X == offsetX && regionData.Offset.Y == offsetY) | ||
83 | { | ||
84 | return regionData.RegionScene.LandChannel.GetLandObject(x - offsetX, y - offsetY); | ||
85 | } | ||
86 | } | ||
87 | ILandObject obj = new LandObject(UUID.Zero, false, RegData.RegionScene); | ||
88 | obj.LandData.Name = "NO LAND"; | ||
89 | return obj; | ||
90 | } | ||
91 | } | ||
92 | |||
93 | public ILandObject GetLandObject(int localID) | ||
94 | { | ||
95 | return RootRegionLandChannel.GetLandObject(localID); | ||
96 | } | ||
97 | |||
98 | public ILandObject GetLandObject(float x, float y) | ||
99 | { | ||
100 | //m_log.DebugFormat("[BIGLANDTESTFLOAT]: <{0},{1}>", x, y); | ||
101 | |||
102 | if (x > 0 && x <= (int)Constants.RegionSize && y > 0 && y <= (int)Constants.RegionSize) | ||
103 | { | ||
104 | return RootRegionLandChannel.GetLandObject(x, y); | ||
105 | } | ||
106 | else | ||
107 | { | ||
108 | int offsetX = (int)(x/(int) Constants.RegionSize); | ||
109 | int offsetY = (int)(y/(int) Constants.RegionSize); | ||
110 | offsetX *= (int) Constants.RegionSize; | ||
111 | offsetY *= (int) Constants.RegionSize; | ||
112 | |||
113 | foreach (RegionData regionData in RegionConnections) | ||
114 | { | ||
115 | if (regionData.Offset.X == offsetX && regionData.Offset.Y == offsetY) | ||
116 | { | ||
117 | return regionData.RegionScene.LandChannel.GetLandObject(x - offsetX, y - offsetY); | ||
118 | } | ||
119 | } | ||
120 | ILandObject obj = new LandObject(UUID.Zero, false, RegData.RegionScene); | ||
121 | obj.LandData.Name = "NO LAND"; | ||
122 | return obj; | ||
123 | } | ||
124 | } | ||
125 | |||
126 | public bool IsLandPrimCountTainted() | ||
127 | { | ||
128 | return RootRegionLandChannel.IsLandPrimCountTainted(); | ||
129 | } | ||
130 | |||
131 | public bool IsForcefulBansAllowed() | ||
132 | { | ||
133 | return RootRegionLandChannel.IsForcefulBansAllowed(); | ||
134 | } | ||
135 | |||
136 | public void UpdateLandObject(int localID, LandData data) | ||
137 | { | ||
138 | RootRegionLandChannel.UpdateLandObject(localID, data); | ||
139 | } | ||
140 | |||
141 | public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient) | ||
142 | { | ||
143 | RootRegionLandChannel.ReturnObjectsInParcel(localID, returnType, agentIDs, taskIDs, remoteClient); | ||
144 | } | ||
145 | |||
146 | public void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel) | ||
147 | { | ||
148 | RootRegionLandChannel.setParcelObjectMaxOverride(overrideDel); | ||
149 | } | ||
150 | |||
151 | public void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel) | ||
152 | { | ||
153 | RootRegionLandChannel.setSimulatorObjectMaxOverride(overrideDel); | ||
154 | } | ||
155 | |||
156 | public void SetParcelOtherCleanTime(IClientAPI remoteClient, int localID, int otherCleanTime) | ||
157 | { | ||
158 | RootRegionLandChannel.SetParcelOtherCleanTime(remoteClient, localID, otherCleanTime); | ||
159 | } | ||
160 | |||
161 | #endregion | ||
162 | } | ||
163 | } \ No newline at end of file | ||
diff --git a/OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs b/OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs deleted file mode 100644 index d8c5ed9..0000000 --- a/OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs +++ /dev/null | |||
@@ -1,939 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Reflection; | ||
31 | using log4net; | ||
32 | using Nini.Config; | ||
33 | using OpenMetaverse; | ||
34 | using OpenSim.Framework; | ||
35 | using OpenSim.Framework.Client; | ||
36 | using OpenSim.Region.Framework.Interfaces; | ||
37 | using OpenSim.Region.Framework.Scenes; | ||
38 | using OpenSim.Framework.Console; | ||
39 | |||
40 | namespace OpenSim.Region.CoreModules.World.Land | ||
41 | { | ||
42 | public class RegionCombinerModule : ISharedRegionModule | ||
43 | { | ||
44 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
45 | |||
46 | public string Name | ||
47 | { | ||
48 | get { return "RegionCombinerModule"; } | ||
49 | } | ||
50 | |||
51 | public Type ReplaceableInterface | ||
52 | { | ||
53 | get { return null; } | ||
54 | } | ||
55 | |||
56 | private Dictionary<UUID, RegionConnections> m_regions = new Dictionary<UUID, RegionConnections>(); | ||
57 | private bool enabledYN = false; | ||
58 | private Dictionary<UUID, Scene> m_startingScenes = new Dictionary<UUID, Scene>(); | ||
59 | |||
60 | public void Initialise(IConfigSource source) | ||
61 | { | ||
62 | IConfig myConfig = source.Configs["Startup"]; | ||
63 | enabledYN = myConfig.GetBoolean("CombineContiguousRegions", false); | ||
64 | //enabledYN = true; | ||
65 | if (enabledYN) | ||
66 | MainConsole.Instance.Commands.AddCommand("RegionCombinerModule", false, "fix-phantoms", | ||
67 | "Fix phantom objects", "Fixes phantom objects after an import to megaregions", FixPhantoms); | ||
68 | } | ||
69 | |||
70 | public void Close() | ||
71 | { | ||
72 | } | ||
73 | |||
74 | public void AddRegion(Scene scene) | ||
75 | { | ||
76 | } | ||
77 | |||
78 | public void RemoveRegion(Scene scene) | ||
79 | { | ||
80 | } | ||
81 | |||
82 | public void RegionLoaded(Scene scene) | ||
83 | { | ||
84 | if (enabledYN) | ||
85 | RegionLoadedDoWork(scene); | ||
86 | } | ||
87 | |||
88 | private void RegionLoadedDoWork(Scene scene) | ||
89 | { | ||
90 | /* | ||
91 | // For testing on a single instance | ||
92 | if (scene.RegionInfo.RegionLocX == 1004 && scene.RegionInfo.RegionLocY == 1000) | ||
93 | return; | ||
94 | // | ||
95 | */ | ||
96 | lock (m_startingScenes) | ||
97 | m_startingScenes.Add(scene.RegionInfo.originRegionID, scene); | ||
98 | |||
99 | // Give each region a standard set of non-infinite borders | ||
100 | Border northBorder = new Border(); | ||
101 | northBorder.BorderLine = new Vector3(0, (int)Constants.RegionSize, (int)Constants.RegionSize); //<--- | ||
102 | northBorder.CrossDirection = Cardinals.N; | ||
103 | scene.NorthBorders[0] = northBorder; | ||
104 | |||
105 | Border southBorder = new Border(); | ||
106 | southBorder.BorderLine = new Vector3(0, (int)Constants.RegionSize, 0); //---> | ||
107 | southBorder.CrossDirection = Cardinals.S; | ||
108 | scene.SouthBorders[0] = southBorder; | ||
109 | |||
110 | Border eastBorder = new Border(); | ||
111 | eastBorder.BorderLine = new Vector3(0, (int)Constants.RegionSize, (int)Constants.RegionSize); //<--- | ||
112 | eastBorder.CrossDirection = Cardinals.E; | ||
113 | scene.EastBorders[0] = eastBorder; | ||
114 | |||
115 | Border westBorder = new Border(); | ||
116 | westBorder.BorderLine = new Vector3(0, (int)Constants.RegionSize, 0); //---> | ||
117 | westBorder.CrossDirection = Cardinals.W; | ||
118 | scene.WestBorders[0] = westBorder; | ||
119 | |||
120 | |||
121 | |||
122 | RegionConnections regionConnections = new RegionConnections(); | ||
123 | regionConnections.ConnectedRegions = new List<RegionData>(); | ||
124 | regionConnections.RegionScene = scene; | ||
125 | regionConnections.RegionLandChannel = scene.LandChannel; | ||
126 | regionConnections.RegionId = scene.RegionInfo.originRegionID; | ||
127 | regionConnections.X = scene.RegionInfo.RegionLocX; | ||
128 | regionConnections.Y = scene.RegionInfo.RegionLocY; | ||
129 | regionConnections.XEnd = (int)Constants.RegionSize; | ||
130 | regionConnections.YEnd = (int)Constants.RegionSize; | ||
131 | |||
132 | |||
133 | lock (m_regions) | ||
134 | { | ||
135 | bool connectedYN = false; | ||
136 | |||
137 | foreach (RegionConnections conn in m_regions.Values) | ||
138 | { | ||
139 | #region commented | ||
140 | /* | ||
141 | // If we're one region over +x +y | ||
142 | //xxy | ||
143 | //xxx | ||
144 | //xxx | ||
145 | if ((((int)conn.X * (int)Constants.RegionSize) + conn.XEnd | ||
146 | == (regionConnections.X * (int)Constants.RegionSize)) | ||
147 | && (((int)conn.Y * (int)Constants.RegionSize) - conn.YEnd | ||
148 | == (regionConnections.Y * (int)Constants.RegionSize))) | ||
149 | { | ||
150 | Vector3 offset = Vector3.Zero; | ||
151 | offset.X = (((regionConnections.X * (int) Constants.RegionSize)) - | ||
152 | ((conn.X * (int) Constants.RegionSize))); | ||
153 | offset.Y = (((regionConnections.Y * (int) Constants.RegionSize)) - | ||
154 | ((conn.Y * (int) Constants.RegionSize))); | ||
155 | |||
156 | Vector3 extents = Vector3.Zero; | ||
157 | extents.Y = regionConnections.YEnd + conn.YEnd; | ||
158 | extents.X = conn.XEnd + conn.XEnd; | ||
159 | |||
160 | m_log.DebugFormat("Scene: {0} to the northwest of Scene{1}. Offset: {2}. Extents:{3}", | ||
161 | conn.RegionScene.RegionInfo.RegionName, | ||
162 | regionConnections.RegionScene.RegionInfo.RegionName, | ||
163 | offset, extents); | ||
164 | |||
165 | scene.PhysicsScene.Combine(conn.RegionScene.PhysicsScene, offset, extents); | ||
166 | |||
167 | connectedYN = true; | ||
168 | break; | ||
169 | } | ||
170 | */ | ||
171 | |||
172 | /* | ||
173 | //If we're one region over x +y | ||
174 | //xxx | ||
175 | //xxx | ||
176 | //xyx | ||
177 | if ((((int)conn.X * (int)Constants.RegionSize) | ||
178 | == (regionConnections.X * (int)Constants.RegionSize)) | ||
179 | && (((int)conn.Y * (int)Constants.RegionSize) - conn.YEnd | ||
180 | == (regionConnections.Y * (int)Constants.RegionSize))) | ||
181 | { | ||
182 | Vector3 offset = Vector3.Zero; | ||
183 | offset.X = (((regionConnections.X * (int)Constants.RegionSize)) - | ||
184 | ((conn.X * (int)Constants.RegionSize))); | ||
185 | offset.Y = (((regionConnections.Y * (int)Constants.RegionSize)) - | ||
186 | ((conn.Y * (int)Constants.RegionSize))); | ||
187 | |||
188 | Vector3 extents = Vector3.Zero; | ||
189 | extents.Y = regionConnections.YEnd + conn.YEnd; | ||
190 | extents.X = conn.XEnd; | ||
191 | |||
192 | m_log.DebugFormat("Scene: {0} to the north of Scene{1}. Offset: {2}. Extents:{3}", | ||
193 | conn.RegionScene.RegionInfo.RegionName, | ||
194 | regionConnections.RegionScene.RegionInfo.RegionName, offset, extents); | ||
195 | |||
196 | scene.PhysicsScene.Combine(conn.RegionScene.PhysicsScene, offset, extents); | ||
197 | connectedYN = true; | ||
198 | break; | ||
199 | } | ||
200 | */ | ||
201 | |||
202 | /* | ||
203 | // If we're one region over -x +y | ||
204 | //xxx | ||
205 | //xxx | ||
206 | //yxx | ||
207 | if ((((int)conn.X * (int)Constants.RegionSize) - conn.XEnd | ||
208 | == (regionConnections.X * (int)Constants.RegionSize)) | ||
209 | && (((int)conn.Y * (int)Constants.RegionSize) - conn.YEnd | ||
210 | == (regionConnections.Y * (int)Constants.RegionSize))) | ||
211 | { | ||
212 | Vector3 offset = Vector3.Zero; | ||
213 | offset.X = (((regionConnections.X * (int)Constants.RegionSize)) - | ||
214 | ((conn.X * (int)Constants.RegionSize))); | ||
215 | offset.Y = (((regionConnections.Y * (int)Constants.RegionSize)) - | ||
216 | ((conn.Y * (int)Constants.RegionSize))); | ||
217 | |||
218 | Vector3 extents = Vector3.Zero; | ||
219 | extents.Y = regionConnections.YEnd + conn.YEnd; | ||
220 | extents.X = conn.XEnd + conn.XEnd; | ||
221 | |||
222 | m_log.DebugFormat("Scene: {0} to the northeast of Scene. Offset: {2}. Extents:{3}", | ||
223 | conn.RegionScene.RegionInfo.RegionName, | ||
224 | regionConnections.RegionScene.RegionInfo.RegionName, offset, extents); | ||
225 | |||
226 | scene.PhysicsScene.Combine(conn.RegionScene.PhysicsScene, offset, extents); | ||
227 | |||
228 | |||
229 | connectedYN = true; | ||
230 | break; | ||
231 | } | ||
232 | */ | ||
233 | |||
234 | /* | ||
235 | // If we're one region over -x y | ||
236 | //xxx | ||
237 | //yxx | ||
238 | //xxx | ||
239 | if ((((int)conn.X * (int)Constants.RegionSize) - conn.XEnd | ||
240 | == (regionConnections.X * (int)Constants.RegionSize)) | ||
241 | && (((int)conn.Y * (int)Constants.RegionSize) | ||
242 | == (regionConnections.Y * (int)Constants.RegionSize))) | ||
243 | { | ||
244 | Vector3 offset = Vector3.Zero; | ||
245 | offset.X = (((regionConnections.X * (int)Constants.RegionSize)) - | ||
246 | ((conn.X * (int)Constants.RegionSize))); | ||
247 | offset.Y = (((regionConnections.Y * (int)Constants.RegionSize)) - | ||
248 | ((conn.Y * (int)Constants.RegionSize))); | ||
249 | |||
250 | Vector3 extents = Vector3.Zero; | ||
251 | extents.Y = regionConnections.YEnd; | ||
252 | extents.X = conn.XEnd + conn.XEnd; | ||
253 | |||
254 | m_log.DebugFormat("Scene: {0} to the east of Scene{1} Offset: {2}. Extents:{3}", | ||
255 | conn.RegionScene.RegionInfo.RegionName, | ||
256 | regionConnections.RegionScene.RegionInfo.RegionName, offset, extents); | ||
257 | |||
258 | scene.PhysicsScene.Combine(conn.RegionScene.PhysicsScene, offset, extents); | ||
259 | |||
260 | connectedYN = true; | ||
261 | break; | ||
262 | } | ||
263 | */ | ||
264 | |||
265 | /* | ||
266 | // If we're one region over -x -y | ||
267 | //yxx | ||
268 | //xxx | ||
269 | //xxx | ||
270 | if ((((int)conn.X * (int)Constants.RegionSize) - conn.XEnd | ||
271 | == (regionConnections.X * (int)Constants.RegionSize)) | ||
272 | && (((int)conn.Y * (int)Constants.RegionSize) + conn.YEnd | ||
273 | == (regionConnections.Y * (int)Constants.RegionSize))) | ||
274 | { | ||
275 | Vector3 offset = Vector3.Zero; | ||
276 | offset.X = (((regionConnections.X * (int)Constants.RegionSize)) - | ||
277 | ((conn.X * (int)Constants.RegionSize))); | ||
278 | offset.Y = (((regionConnections.Y * (int)Constants.RegionSize)) - | ||
279 | ((conn.Y * (int)Constants.RegionSize))); | ||
280 | |||
281 | Vector3 extents = Vector3.Zero; | ||
282 | extents.Y = regionConnections.YEnd + conn.YEnd; | ||
283 | extents.X = conn.XEnd + conn.XEnd; | ||
284 | |||
285 | m_log.DebugFormat("Scene: {0} to the northeast of Scene{1} Offset: {2}. Extents:{3}", | ||
286 | conn.RegionScene.RegionInfo.RegionName, | ||
287 | regionConnections.RegionScene.RegionInfo.RegionName, offset, extents); | ||
288 | |||
289 | scene.PhysicsScene.Combine(conn.RegionScene.PhysicsScene, offset, extents); | ||
290 | |||
291 | connectedYN = true; | ||
292 | break; | ||
293 | } | ||
294 | */ | ||
295 | #endregion | ||
296 | |||
297 | // If we're one region over +x y | ||
298 | //xxx | ||
299 | //xxy | ||
300 | //xxx | ||
301 | |||
302 | if ((((int)conn.X * (int)Constants.RegionSize) + conn.XEnd | ||
303 | >= (regionConnections.X * (int)Constants.RegionSize)) | ||
304 | && (((int)conn.Y * (int)Constants.RegionSize) | ||
305 | >= (regionConnections.Y * (int)Constants.RegionSize))) | ||
306 | { | ||
307 | Vector3 offset = Vector3.Zero; | ||
308 | offset.X = (((regionConnections.X * (int)Constants.RegionSize)) - | ||
309 | ((conn.X * (int)Constants.RegionSize))); | ||
310 | offset.Y = (((regionConnections.Y * (int)Constants.RegionSize)) - | ||
311 | ((conn.Y * (int)Constants.RegionSize))); | ||
312 | |||
313 | Vector3 extents = Vector3.Zero; | ||
314 | extents.Y = conn.YEnd; | ||
315 | extents.X = conn.XEnd + regionConnections.XEnd; | ||
316 | |||
317 | conn.UpdateExtents(extents); | ||
318 | |||
319 | m_log.DebugFormat("Scene: {0} to the west of Scene{1} Offset: {2}. Extents:{3}", | ||
320 | conn.RegionScene.RegionInfo.RegionName, | ||
321 | regionConnections.RegionScene.RegionInfo.RegionName, offset, extents); | ||
322 | |||
323 | scene.BordersLocked = true; | ||
324 | conn.RegionScene.BordersLocked = true; | ||
325 | |||
326 | RegionData ConnectedRegion = new RegionData(); | ||
327 | ConnectedRegion.Offset = offset; | ||
328 | ConnectedRegion.RegionId = scene.RegionInfo.originRegionID; | ||
329 | ConnectedRegion.RegionScene = scene; | ||
330 | conn.ConnectedRegions.Add(ConnectedRegion); | ||
331 | |||
332 | // Inform root region Physics about the extents of this region | ||
333 | conn.RegionScene.PhysicsScene.Combine(null, Vector3.Zero, extents); | ||
334 | |||
335 | // Inform Child region that it needs to forward it's terrain to the root region | ||
336 | scene.PhysicsScene.Combine(conn.RegionScene.PhysicsScene, offset, Vector3.Zero); | ||
337 | |||
338 | // Extend the borders as appropriate | ||
339 | lock (conn.RegionScene.EastBorders) | ||
340 | conn.RegionScene.EastBorders[0].BorderLine.Z += (int)Constants.RegionSize; | ||
341 | |||
342 | lock (conn.RegionScene.NorthBorders) | ||
343 | conn.RegionScene.NorthBorders[0].BorderLine.Y += (int)Constants.RegionSize; | ||
344 | |||
345 | lock (conn.RegionScene.SouthBorders) | ||
346 | conn.RegionScene.SouthBorders[0].BorderLine.Y += (int)Constants.RegionSize; | ||
347 | |||
348 | lock (scene.WestBorders) | ||
349 | { | ||
350 | |||
351 | |||
352 | scene.WestBorders[0].BorderLine.Z = (int)((scene.RegionInfo.RegionLocX - conn.RegionScene.RegionInfo.RegionLocX) * (int)Constants.RegionSize); //auto teleport West | ||
353 | |||
354 | // Trigger auto teleport to root region | ||
355 | scene.WestBorders[0].TriggerRegionX = conn.RegionScene.RegionInfo.RegionLocX; | ||
356 | scene.WestBorders[0].TriggerRegionY = conn.RegionScene.RegionInfo.RegionLocY; | ||
357 | } | ||
358 | |||
359 | // Reset Terrain.. since terrain loads before we get here, we need to load | ||
360 | // it again so it loads in the root region | ||
361 | |||
362 | scene.PhysicsScene.SetTerrain(scene.Heightmap.GetFloatsSerialised()); | ||
363 | |||
364 | // Unlock borders | ||
365 | conn.RegionScene.BordersLocked = false; | ||
366 | scene.BordersLocked = false; | ||
367 | |||
368 | // Create a client event forwarder and add this region's events to the root region. | ||
369 | if (conn.ClientEventForwarder != null) | ||
370 | conn.ClientEventForwarder.AddSceneToEventForwarding(scene); | ||
371 | connectedYN = true; | ||
372 | break; | ||
373 | } | ||
374 | |||
375 | // If we're one region over x +y | ||
376 | //xyx | ||
377 | //xxx | ||
378 | //xxx | ||
379 | if ((((int)conn.X * (int)Constants.RegionSize) | ||
380 | >= (regionConnections.X * (int)Constants.RegionSize)) | ||
381 | && (((int)conn.Y * (int)Constants.RegionSize) + conn.YEnd | ||
382 | >= (regionConnections.Y * (int)Constants.RegionSize))) | ||
383 | { | ||
384 | Vector3 offset = Vector3.Zero; | ||
385 | offset.X = (((regionConnections.X * (int)Constants.RegionSize)) - | ||
386 | ((conn.X * (int)Constants.RegionSize))); | ||
387 | offset.Y = (((regionConnections.Y * (int)Constants.RegionSize)) - | ||
388 | ((conn.Y * (int)Constants.RegionSize))); | ||
389 | |||
390 | Vector3 extents = Vector3.Zero; | ||
391 | extents.Y = regionConnections.YEnd + conn.YEnd; | ||
392 | extents.X = conn.XEnd; | ||
393 | conn.UpdateExtents(extents); | ||
394 | |||
395 | scene.BordersLocked = true; | ||
396 | conn.RegionScene.BordersLocked = true; | ||
397 | |||
398 | RegionData ConnectedRegion = new RegionData(); | ||
399 | ConnectedRegion.Offset = offset; | ||
400 | ConnectedRegion.RegionId = scene.RegionInfo.originRegionID; | ||
401 | ConnectedRegion.RegionScene = scene; | ||
402 | conn.ConnectedRegions.Add(ConnectedRegion); | ||
403 | |||
404 | m_log.DebugFormat("Scene: {0} to the northeast of Scene{1} Offset: {2}. Extents:{3}", | ||
405 | conn.RegionScene.RegionInfo.RegionName, | ||
406 | regionConnections.RegionScene.RegionInfo.RegionName, offset, extents); | ||
407 | |||
408 | conn.RegionScene.PhysicsScene.Combine(null, Vector3.Zero, extents); | ||
409 | scene.PhysicsScene.Combine(conn.RegionScene.PhysicsScene, offset, Vector3.Zero); | ||
410 | |||
411 | lock (conn.RegionScene.NorthBorders) | ||
412 | conn.RegionScene.NorthBorders[0].BorderLine.Z += (int)Constants.RegionSize; | ||
413 | lock (conn.RegionScene.EastBorders) | ||
414 | conn.RegionScene.EastBorders[0].BorderLine.Y += (int)Constants.RegionSize; | ||
415 | lock (conn.RegionScene.WestBorders) | ||
416 | conn.RegionScene.WestBorders[0].BorderLine.Y += (int)Constants.RegionSize; | ||
417 | lock (scene.SouthBorders) | ||
418 | { | ||
419 | scene.SouthBorders[0].BorderLine.Z = (int)((scene.RegionInfo.RegionLocY - conn.RegionScene.RegionInfo.RegionLocY) * (int)Constants.RegionSize); //auto teleport south | ||
420 | scene.SouthBorders[0].TriggerRegionX = conn.RegionScene.RegionInfo.RegionLocX; | ||
421 | scene.SouthBorders[0].TriggerRegionY = conn.RegionScene.RegionInfo.RegionLocY; | ||
422 | } | ||
423 | |||
424 | // Reset Terrain.. since terrain normally loads first. | ||
425 | //conn.RegionScene.PhysicsScene.SetTerrain(conn.RegionScene.Heightmap.GetFloatsSerialised()); | ||
426 | scene.PhysicsScene.SetTerrain(scene.Heightmap.GetFloatsSerialised()); | ||
427 | //conn.RegionScene.PhysicsScene.SetTerrain(conn.RegionScene.Heightmap.GetFloatsSerialised()); | ||
428 | |||
429 | scene.BordersLocked = false; | ||
430 | conn.RegionScene.BordersLocked = false; | ||
431 | if (conn.ClientEventForwarder != null) | ||
432 | conn.ClientEventForwarder.AddSceneToEventForwarding(scene); | ||
433 | connectedYN = true; | ||
434 | break; | ||
435 | } | ||
436 | |||
437 | // If we're one region over +x +y | ||
438 | //xxy | ||
439 | //xxx | ||
440 | //xxx | ||
441 | if ((((int)conn.X * (int)Constants.RegionSize) + conn.YEnd | ||
442 | >= (regionConnections.X * (int)Constants.RegionSize)) | ||
443 | && (((int)conn.Y * (int)Constants.RegionSize) + conn.YEnd | ||
444 | >= (regionConnections.Y * (int)Constants.RegionSize))) | ||
445 | { | ||
446 | Vector3 offset = Vector3.Zero; | ||
447 | offset.X = (((regionConnections.X * (int)Constants.RegionSize)) - | ||
448 | ((conn.X * (int)Constants.RegionSize))); | ||
449 | offset.Y = (((regionConnections.Y * (int)Constants.RegionSize)) - | ||
450 | ((conn.Y * (int)Constants.RegionSize))); | ||
451 | |||
452 | Vector3 extents = Vector3.Zero; | ||
453 | extents.Y = regionConnections.YEnd + conn.YEnd; | ||
454 | extents.X = regionConnections.XEnd + conn.XEnd; | ||
455 | conn.UpdateExtents(extents); | ||
456 | |||
457 | scene.BordersLocked = true; | ||
458 | conn.RegionScene.BordersLocked = true; | ||
459 | |||
460 | RegionData ConnectedRegion = new RegionData(); | ||
461 | ConnectedRegion.Offset = offset; | ||
462 | ConnectedRegion.RegionId = scene.RegionInfo.originRegionID; | ||
463 | ConnectedRegion.RegionScene = scene; | ||
464 | |||
465 | conn.ConnectedRegions.Add(ConnectedRegion); | ||
466 | |||
467 | m_log.DebugFormat("Scene: {0} to the NorthEast of Scene{1} Offset: {2}. Extents:{3}", | ||
468 | conn.RegionScene.RegionInfo.RegionName, | ||
469 | regionConnections.RegionScene.RegionInfo.RegionName, offset, extents); | ||
470 | |||
471 | conn.RegionScene.PhysicsScene.Combine(null, Vector3.Zero, extents); | ||
472 | scene.PhysicsScene.Combine(conn.RegionScene.PhysicsScene, offset, Vector3.Zero); | ||
473 | lock (conn.RegionScene.NorthBorders) | ||
474 | { | ||
475 | if (conn.RegionScene.NorthBorders.Count == 1)// && 2) | ||
476 | { | ||
477 | //compound border | ||
478 | // already locked above | ||
479 | conn.RegionScene.NorthBorders[0].BorderLine.Z += (int)Constants.RegionSize; | ||
480 | |||
481 | lock (conn.RegionScene.EastBorders) | ||
482 | conn.RegionScene.EastBorders[0].BorderLine.Y += (int)Constants.RegionSize; | ||
483 | lock (conn.RegionScene.WestBorders) | ||
484 | conn.RegionScene.WestBorders[0].BorderLine.Y += (int)Constants.RegionSize; | ||
485 | } | ||
486 | } | ||
487 | |||
488 | lock (scene.SouthBorders) | ||
489 | { | ||
490 | scene.SouthBorders[0].BorderLine.Z = (int)((scene.RegionInfo.RegionLocY - conn.RegionScene.RegionInfo.RegionLocY) * (int)Constants.RegionSize); //auto teleport south | ||
491 | scene.SouthBorders[0].TriggerRegionX = conn.RegionScene.RegionInfo.RegionLocX; | ||
492 | scene.SouthBorders[0].TriggerRegionY = conn.RegionScene.RegionInfo.RegionLocY; | ||
493 | } | ||
494 | |||
495 | lock (conn.RegionScene.EastBorders) | ||
496 | { | ||
497 | if (conn.RegionScene.EastBorders.Count == 1)// && conn.RegionScene.EastBorders.Count == 2) | ||
498 | { | ||
499 | |||
500 | conn.RegionScene.EastBorders[0].BorderLine.Z += (int)Constants.RegionSize; | ||
501 | lock (conn.RegionScene.NorthBorders) | ||
502 | conn.RegionScene.NorthBorders[0].BorderLine.Y += (int)Constants.RegionSize; | ||
503 | lock (conn.RegionScene.SouthBorders) | ||
504 | conn.RegionScene.SouthBorders[0].BorderLine.Y += (int)Constants.RegionSize; | ||
505 | |||
506 | |||
507 | } | ||
508 | } | ||
509 | |||
510 | lock (scene.WestBorders) | ||
511 | { | ||
512 | scene.WestBorders[0].BorderLine.Z = (int)((scene.RegionInfo.RegionLocX - conn.RegionScene.RegionInfo.RegionLocX) * (int)Constants.RegionSize); //auto teleport West | ||
513 | scene.WestBorders[0].TriggerRegionX = conn.RegionScene.RegionInfo.RegionLocX; | ||
514 | scene.WestBorders[0].TriggerRegionY = conn.RegionScene.RegionInfo.RegionLocY; | ||
515 | } | ||
516 | |||
517 | /* | ||
518 | else | ||
519 | { | ||
520 | conn.RegionScene.NorthBorders[0].BorderLine.Z += (int)Constants.RegionSize; | ||
521 | conn.RegionScene.EastBorders[0].BorderLine.Y += (int)Constants.RegionSize; | ||
522 | conn.RegionScene.WestBorders[0].BorderLine.Y += (int)Constants.RegionSize; | ||
523 | scene.SouthBorders[0].BorderLine.Z += (int)Constants.RegionSize; //auto teleport south | ||
524 | } | ||
525 | */ | ||
526 | |||
527 | |||
528 | // Reset Terrain.. since terrain normally loads first. | ||
529 | //conn.RegionScene.PhysicsScene.SetTerrain(conn.RegionScene.Heightmap.GetFloatsSerialised()); | ||
530 | scene.PhysicsScene.SetTerrain(scene.Heightmap.GetFloatsSerialised()); | ||
531 | //conn.RegionScene.PhysicsScene.SetTerrain(conn.RegionScene.Heightmap.GetFloatsSerialised()); | ||
532 | scene.BordersLocked = false; | ||
533 | conn.RegionScene.BordersLocked = false; | ||
534 | |||
535 | if (conn.ClientEventForwarder != null) | ||
536 | conn.ClientEventForwarder.AddSceneToEventForwarding(scene); | ||
537 | |||
538 | connectedYN = true; | ||
539 | |||
540 | //scene.PhysicsScene.Combine(conn.RegionScene.PhysicsScene, offset,extents); | ||
541 | |||
542 | break; | ||
543 | } | ||
544 | } | ||
545 | |||
546 | // If !connectYN means that this region is a root region | ||
547 | if (!connectedYN) | ||
548 | { | ||
549 | RegionData rdata = new RegionData(); | ||
550 | rdata.Offset = Vector3.Zero; | ||
551 | rdata.RegionId = scene.RegionInfo.originRegionID; | ||
552 | rdata.RegionScene = scene; | ||
553 | // save it's land channel | ||
554 | regionConnections.RegionLandChannel = scene.LandChannel; | ||
555 | |||
556 | // Substitue our landchannel | ||
557 | RegionCombinerLargeLandChannel lnd = new RegionCombinerLargeLandChannel(rdata, scene.LandChannel, | ||
558 | regionConnections.ConnectedRegions); | ||
559 | scene.LandChannel = lnd; | ||
560 | // Forward the permissions modules of each of the connected regions to the root region | ||
561 | lock (m_regions) | ||
562 | { | ||
563 | foreach (RegionData r in regionConnections.ConnectedRegions) | ||
564 | { | ||
565 | ForwardPermissionRequests(regionConnections, r.RegionScene); | ||
566 | } | ||
567 | } | ||
568 | // Create the root region's Client Event Forwarder | ||
569 | regionConnections.ClientEventForwarder = new RegionCombinerClientEventForwarder(regionConnections); | ||
570 | |||
571 | // Sets up the CoarseLocationUpdate forwarder for this root region | ||
572 | scene.EventManager.OnNewPresence += SetCourseLocationDelegate; | ||
573 | |||
574 | // Adds this root region to a dictionary of regions that are connectable | ||
575 | m_regions.Add(scene.RegionInfo.originRegionID, regionConnections); | ||
576 | } | ||
577 | } | ||
578 | // Set up infinite borders around the entire AABB of the combined ConnectedRegions | ||
579 | AdjustLargeRegionBounds(); | ||
580 | } | ||
581 | |||
582 | private void SetCourseLocationDelegate(ScenePresence presence) | ||
583 | { | ||
584 | presence.SetSendCourseLocationMethod(SendCourseLocationUpdates); | ||
585 | } | ||
586 | |||
587 | private void SendCourseLocationUpdates(UUID sceneId, ScenePresence presence) | ||
588 | { | ||
589 | RegionConnections connectiondata = null; | ||
590 | lock (m_regions) | ||
591 | { | ||
592 | if (m_regions.ContainsKey(sceneId)) | ||
593 | connectiondata = m_regions[sceneId]; | ||
594 | else | ||
595 | return; | ||
596 | } | ||
597 | |||
598 | List<ScenePresence> avatars = connectiondata.RegionScene.GetAvatars(); | ||
599 | List<Vector3> CoarseLocations = new List<Vector3>(); | ||
600 | List<UUID> AvatarUUIDs = new List<UUID>(); | ||
601 | for (int i = 0; i < avatars.Count; i++) | ||
602 | { | ||
603 | if (avatars[i].UUID != presence.UUID) | ||
604 | { | ||
605 | if (avatars[i].ParentID != 0) | ||
606 | { | ||
607 | // sitting avatar | ||
608 | SceneObjectPart sop = connectiondata.RegionScene.GetSceneObjectPart(avatars[i].ParentID); | ||
609 | if (sop != null) | ||
610 | { | ||
611 | CoarseLocations.Add(sop.AbsolutePosition + avatars[i].AbsolutePosition); | ||
612 | AvatarUUIDs.Add(avatars[i].UUID); | ||
613 | } | ||
614 | else | ||
615 | { | ||
616 | // we can't find the parent.. ! arg! | ||
617 | CoarseLocations.Add(avatars[i].AbsolutePosition); | ||
618 | AvatarUUIDs.Add(avatars[i].UUID); | ||
619 | } | ||
620 | } | ||
621 | else | ||
622 | { | ||
623 | CoarseLocations.Add(avatars[i].AbsolutePosition); | ||
624 | AvatarUUIDs.Add(avatars[i].UUID); | ||
625 | } | ||
626 | } | ||
627 | } | ||
628 | DistributeCourseLocationUpdates(CoarseLocations, AvatarUUIDs, connectiondata, presence); | ||
629 | } | ||
630 | |||
631 | private void DistributeCourseLocationUpdates(List<Vector3> locations, List<UUID> uuids, | ||
632 | RegionConnections connectiondata, ScenePresence rootPresence) | ||
633 | { | ||
634 | RegionData[] rdata = connectiondata.ConnectedRegions.ToArray(); | ||
635 | //List<IClientAPI> clients = new List<IClientAPI>(); | ||
636 | Dictionary<Vector2, RegionCourseLocationStruct> updates = new Dictionary<Vector2, RegionCourseLocationStruct>(); | ||
637 | |||
638 | // Root Region entry | ||
639 | RegionCourseLocationStruct rootupdatedata = new RegionCourseLocationStruct(); | ||
640 | rootupdatedata.Locations = new List<Vector3>(); | ||
641 | rootupdatedata.Uuids = new List<UUID>(); | ||
642 | rootupdatedata.Offset = Vector2.Zero; | ||
643 | |||
644 | rootupdatedata.UserAPI = rootPresence.ControllingClient; | ||
645 | |||
646 | if (rootupdatedata.UserAPI != null) | ||
647 | updates.Add(Vector2.Zero, rootupdatedata); | ||
648 | |||
649 | //Each Region needs an entry or we will end up with dead minimap dots | ||
650 | foreach (RegionData regiondata in rdata) | ||
651 | { | ||
652 | Vector2 offset = new Vector2(regiondata.Offset.X, regiondata.Offset.Y); | ||
653 | RegionCourseLocationStruct updatedata = new RegionCourseLocationStruct(); | ||
654 | updatedata.Locations = new List<Vector3>(); | ||
655 | updatedata.Uuids = new List<UUID>(); | ||
656 | updatedata.Offset = offset; | ||
657 | |||
658 | if (offset == Vector2.Zero) | ||
659 | updatedata.UserAPI = rootPresence.ControllingClient; | ||
660 | else | ||
661 | updatedata.UserAPI = LocateUsersChildAgentIClientAPI(offset, rootPresence.UUID, rdata); | ||
662 | |||
663 | if (updatedata.UserAPI != null) | ||
664 | updates.Add(offset, updatedata); | ||
665 | } | ||
666 | |||
667 | // go over the locations and assign them to an IClientAPI | ||
668 | for (int i = 0; i < locations.Count; i++) | ||
669 | //{locations[i]/(int) Constants.RegionSize; | ||
670 | { | ||
671 | Vector3 pPosition = new Vector3((int)locations[i].X / (int)Constants.RegionSize, | ||
672 | (int)locations[i].Y / (int)Constants.RegionSize, locations[i].Z); | ||
673 | Vector2 offset = new Vector2(pPosition.X*(int) Constants.RegionSize, | ||
674 | pPosition.Y*(int) Constants.RegionSize); | ||
675 | |||
676 | if (!updates.ContainsKey(offset)) | ||
677 | { | ||
678 | // This shouldn't happen | ||
679 | RegionCourseLocationStruct updatedata = new RegionCourseLocationStruct(); | ||
680 | updatedata.Locations = new List<Vector3>(); | ||
681 | updatedata.Uuids = new List<UUID>(); | ||
682 | updatedata.Offset = offset; | ||
683 | |||
684 | if (offset == Vector2.Zero) | ||
685 | updatedata.UserAPI = rootPresence.ControllingClient; | ||
686 | else | ||
687 | updatedata.UserAPI = LocateUsersChildAgentIClientAPI(offset, rootPresence.UUID, rdata); | ||
688 | |||
689 | updates.Add(offset,updatedata); | ||
690 | } | ||
691 | |||
692 | updates[offset].Locations.Add(locations[i]); | ||
693 | updates[offset].Uuids.Add(uuids[i]); | ||
694 | } | ||
695 | |||
696 | // Send out the CoarseLocationupdates from their respective client connection based on where the avatar is | ||
697 | foreach (Vector2 offset in updates.Keys) | ||
698 | { | ||
699 | if (updates[offset].UserAPI != null) | ||
700 | { | ||
701 | updates[offset].UserAPI.SendCoarseLocationUpdate(updates[offset].Uuids,updates[offset].Locations); | ||
702 | } | ||
703 | } | ||
704 | } | ||
705 | |||
706 | /// <summary> | ||
707 | /// Locates a the Client of a particular region in an Array of RegionData based on offset | ||
708 | /// </summary> | ||
709 | /// <param name="offset"></param> | ||
710 | /// <param name="uUID"></param> | ||
711 | /// <param name="rdata"></param> | ||
712 | /// <returns>IClientAPI or null</returns> | ||
713 | private IClientAPI LocateUsersChildAgentIClientAPI(Vector2 offset, UUID uUID, RegionData[] rdata) | ||
714 | { | ||
715 | IClientAPI returnclient = null; | ||
716 | foreach (RegionData r in rdata) | ||
717 | { | ||
718 | if (r.Offset.X == offset.X && r.Offset.Y == offset.Y) | ||
719 | { | ||
720 | return r.RegionScene.SceneGraph.GetControllingClient(uUID); | ||
721 | } | ||
722 | } | ||
723 | |||
724 | return returnclient; | ||
725 | } | ||
726 | |||
727 | public void PostInitialise() | ||
728 | { | ||
729 | } | ||
730 | |||
731 | /// <summary> | ||
732 | /// TODO: | ||
733 | /// </summary> | ||
734 | /// <param name="rdata"></param> | ||
735 | public void UnCombineRegion(RegionData rdata) | ||
736 | { | ||
737 | lock (m_regions) | ||
738 | { | ||
739 | if (m_regions.ContainsKey(rdata.RegionId)) | ||
740 | { | ||
741 | // uncombine root region and virtual regions | ||
742 | } | ||
743 | else | ||
744 | { | ||
745 | foreach (RegionConnections r in m_regions.Values) | ||
746 | { | ||
747 | foreach (RegionData rd in r.ConnectedRegions) | ||
748 | { | ||
749 | if (rd.RegionId == rdata.RegionId) | ||
750 | { | ||
751 | // uncombine virtual region | ||
752 | } | ||
753 | } | ||
754 | } | ||
755 | } | ||
756 | } | ||
757 | } | ||
758 | |||
759 | // Create a set of infinite borders around the whole aabb of the combined island. | ||
760 | private void AdjustLargeRegionBounds() | ||
761 | { | ||
762 | lock (m_regions) | ||
763 | { | ||
764 | foreach (RegionConnections rconn in m_regions.Values) | ||
765 | { | ||
766 | Vector3 offset = Vector3.Zero; | ||
767 | rconn.RegionScene.BordersLocked = true; | ||
768 | foreach (RegionData rdata in rconn.ConnectedRegions) | ||
769 | { | ||
770 | if (rdata.Offset.X > offset.X) offset.X = rdata.Offset.X; | ||
771 | if (rdata.Offset.Y > offset.Y) offset.Y = rdata.Offset.Y; | ||
772 | } | ||
773 | |||
774 | lock (rconn.RegionScene.NorthBorders) | ||
775 | { | ||
776 | Border northBorder = null; | ||
777 | // If we don't already have an infinite border, create one. | ||
778 | if (!TryGetInfiniteBorder(rconn.RegionScene.NorthBorders, out northBorder)) | ||
779 | { | ||
780 | northBorder = new Border(); | ||
781 | rconn.RegionScene.NorthBorders.Add(northBorder); | ||
782 | } | ||
783 | |||
784 | northBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, | ||
785 | offset.Y + (int) Constants.RegionSize); //<--- | ||
786 | northBorder.CrossDirection = Cardinals.N; | ||
787 | } | ||
788 | |||
789 | lock (rconn.RegionScene.SouthBorders) | ||
790 | { | ||
791 | Border southBorder = null; | ||
792 | // If we don't already have an infinite border, create one. | ||
793 | if (!TryGetInfiniteBorder(rconn.RegionScene.SouthBorders, out southBorder)) | ||
794 | { | ||
795 | southBorder = new Border(); | ||
796 | rconn.RegionScene.SouthBorders.Add(southBorder); | ||
797 | } | ||
798 | southBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, 0); //---> | ||
799 | southBorder.CrossDirection = Cardinals.S; | ||
800 | } | ||
801 | |||
802 | lock (rconn.RegionScene.EastBorders) | ||
803 | { | ||
804 | Border eastBorder = null; | ||
805 | // If we don't already have an infinite border, create one. | ||
806 | if (!TryGetInfiniteBorder(rconn.RegionScene.EastBorders, out eastBorder)) | ||
807 | { | ||
808 | eastBorder = new Border(); | ||
809 | rconn.RegionScene.EastBorders.Add(eastBorder); | ||
810 | } | ||
811 | eastBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, offset.X + (int)Constants.RegionSize); | ||
812 | //<--- | ||
813 | eastBorder.CrossDirection = Cardinals.E; | ||
814 | } | ||
815 | |||
816 | lock (rconn.RegionScene.WestBorders) | ||
817 | { | ||
818 | Border westBorder = null; | ||
819 | // If we don't already have an infinite border, create one. | ||
820 | if (!TryGetInfiniteBorder(rconn.RegionScene.WestBorders, out westBorder)) | ||
821 | { | ||
822 | westBorder = new Border(); | ||
823 | rconn.RegionScene.WestBorders.Add(westBorder); | ||
824 | |||
825 | } | ||
826 | westBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, 0); //---> | ||
827 | westBorder.CrossDirection = Cardinals.W; | ||
828 | } | ||
829 | |||
830 | rconn.RegionScene.BordersLocked = false; | ||
831 | } | ||
832 | } | ||
833 | } | ||
834 | |||
835 | /// <summary> | ||
836 | /// Try and get an Infinite border out of a listT of borders | ||
837 | /// </summary> | ||
838 | /// <param name="borders"></param> | ||
839 | /// <param name="oborder"></param> | ||
840 | /// <returns></returns> | ||
841 | public static bool TryGetInfiniteBorder(List<Border> borders, out Border oborder) | ||
842 | { | ||
843 | // Warning! Should be locked before getting here! | ||
844 | foreach (Border b in borders) | ||
845 | { | ||
846 | if (b.BorderLine.X == float.MinValue && b.BorderLine.Y == float.MaxValue) | ||
847 | { | ||
848 | oborder = b; | ||
849 | return true; | ||
850 | } | ||
851 | } | ||
852 | oborder = null; | ||
853 | return false; | ||
854 | } | ||
855 | |||
856 | public RegionData GetRegionFromPosition(Vector3 pPosition) | ||
857 | { | ||
858 | pPosition = pPosition/(int) Constants.RegionSize; | ||
859 | int OffsetX = (int) pPosition.X; | ||
860 | int OffsetY = (int) pPosition.Y; | ||
861 | foreach (RegionConnections regConn in m_regions.Values) | ||
862 | { | ||
863 | foreach (RegionData reg in regConn.ConnectedRegions) | ||
864 | { | ||
865 | if (reg.Offset.X == OffsetX && reg.Offset.Y == OffsetY) | ||
866 | return reg; | ||
867 | } | ||
868 | } | ||
869 | return new RegionData(); | ||
870 | } | ||
871 | |||
872 | public void ForwardPermissionRequests(RegionConnections BigRegion, Scene VirtualRegion) | ||
873 | { | ||
874 | if (BigRegion.PermissionModule == null) | ||
875 | BigRegion.PermissionModule = new RegionCombinerPermissionModule(BigRegion.RegionScene); | ||
876 | |||
877 | VirtualRegion.Permissions.OnBypassPermissions += BigRegion.PermissionModule.BypassPermissions; | ||
878 | VirtualRegion.Permissions.OnSetBypassPermissions += BigRegion.PermissionModule.SetBypassPermissions; | ||
879 | VirtualRegion.Permissions.OnPropagatePermissions += BigRegion.PermissionModule.PropagatePermissions; | ||
880 | VirtualRegion.Permissions.OnGenerateClientFlags += BigRegion.PermissionModule.GenerateClientFlags; | ||
881 | VirtualRegion.Permissions.OnAbandonParcel += BigRegion.PermissionModule.CanAbandonParcel; | ||
882 | VirtualRegion.Permissions.OnReclaimParcel += BigRegion.PermissionModule.CanReclaimParcel; | ||
883 | VirtualRegion.Permissions.OnDeedParcel += BigRegion.PermissionModule.CanDeedParcel; | ||
884 | VirtualRegion.Permissions.OnDeedObject += BigRegion.PermissionModule.CanDeedObject; | ||
885 | VirtualRegion.Permissions.OnIsGod += BigRegion.PermissionModule.IsGod; | ||
886 | VirtualRegion.Permissions.OnDuplicateObject += BigRegion.PermissionModule.CanDuplicateObject; | ||
887 | VirtualRegion.Permissions.OnDeleteObject += BigRegion.PermissionModule.CanDeleteObject; //MAYBE FULLY IMPLEMENTED | ||
888 | VirtualRegion.Permissions.OnEditObject += BigRegion.PermissionModule.CanEditObject; //MAYBE FULLY IMPLEMENTED | ||
889 | VirtualRegion.Permissions.OnEditParcel += BigRegion.PermissionModule.CanEditParcel; //MAYBE FULLY IMPLEMENTED | ||
890 | VirtualRegion.Permissions.OnInstantMessage += BigRegion.PermissionModule.CanInstantMessage; | ||
891 | VirtualRegion.Permissions.OnInventoryTransfer += BigRegion.PermissionModule.CanInventoryTransfer; //NOT YET IMPLEMENTED | ||
892 | VirtualRegion.Permissions.OnIssueEstateCommand += BigRegion.PermissionModule.CanIssueEstateCommand; //FULLY IMPLEMENTED | ||
893 | VirtualRegion.Permissions.OnMoveObject += BigRegion.PermissionModule.CanMoveObject; //MAYBE FULLY IMPLEMENTED | ||
894 | VirtualRegion.Permissions.OnObjectEntry += BigRegion.PermissionModule.CanObjectEntry; | ||
895 | VirtualRegion.Permissions.OnReturnObject += BigRegion.PermissionModule.CanReturnObject; //NOT YET IMPLEMENTED | ||
896 | VirtualRegion.Permissions.OnRezObject += BigRegion.PermissionModule.CanRezObject; //MAYBE FULLY IMPLEMENTED | ||
897 | VirtualRegion.Permissions.OnRunConsoleCommand += BigRegion.PermissionModule.CanRunConsoleCommand; | ||
898 | VirtualRegion.Permissions.OnRunScript += BigRegion.PermissionModule.CanRunScript; //NOT YET IMPLEMENTED | ||
899 | VirtualRegion.Permissions.OnCompileScript += BigRegion.PermissionModule.CanCompileScript; | ||
900 | VirtualRegion.Permissions.OnSellParcel += BigRegion.PermissionModule.CanSellParcel; | ||
901 | VirtualRegion.Permissions.OnTakeObject += BigRegion.PermissionModule.CanTakeObject; | ||
902 | VirtualRegion.Permissions.OnTakeCopyObject += BigRegion.PermissionModule.CanTakeCopyObject; | ||
903 | VirtualRegion.Permissions.OnTerraformLand += BigRegion.PermissionModule.CanTerraformLand; | ||
904 | VirtualRegion.Permissions.OnLinkObject += BigRegion.PermissionModule.CanLinkObject; //NOT YET IMPLEMENTED | ||
905 | VirtualRegion.Permissions.OnDelinkObject += BigRegion.PermissionModule.CanDelinkObject; //NOT YET IMPLEMENTED | ||
906 | VirtualRegion.Permissions.OnBuyLand += BigRegion.PermissionModule.CanBuyLand; //NOT YET IMPLEMENTED | ||
907 | VirtualRegion.Permissions.OnViewNotecard += BigRegion.PermissionModule.CanViewNotecard; //NOT YET IMPLEMENTED | ||
908 | VirtualRegion.Permissions.OnViewScript += BigRegion.PermissionModule.CanViewScript; //NOT YET IMPLEMENTED | ||
909 | VirtualRegion.Permissions.OnEditNotecard += BigRegion.PermissionModule.CanEditNotecard; //NOT YET IMPLEMENTED | ||
910 | VirtualRegion.Permissions.OnEditScript += BigRegion.PermissionModule.CanEditScript; //NOT YET IMPLEMENTED | ||
911 | VirtualRegion.Permissions.OnCreateObjectInventory += BigRegion.PermissionModule.CanCreateObjectInventory; //NOT IMPLEMENTED HERE | ||
912 | VirtualRegion.Permissions.OnEditObjectInventory += BigRegion.PermissionModule.CanEditObjectInventory;//MAYBE FULLY IMPLEMENTED | ||
913 | VirtualRegion.Permissions.OnCopyObjectInventory += BigRegion.PermissionModule.CanCopyObjectInventory; //NOT YET IMPLEMENTED | ||
914 | VirtualRegion.Permissions.OnDeleteObjectInventory += BigRegion.PermissionModule.CanDeleteObjectInventory; //NOT YET IMPLEMENTED | ||
915 | VirtualRegion.Permissions.OnResetScript += BigRegion.PermissionModule.CanResetScript; | ||
916 | VirtualRegion.Permissions.OnCreateUserInventory += BigRegion.PermissionModule.CanCreateUserInventory; //NOT YET IMPLEMENTED | ||
917 | VirtualRegion.Permissions.OnCopyUserInventory += BigRegion.PermissionModule.CanCopyUserInventory; //NOT YET IMPLEMENTED | ||
918 | VirtualRegion.Permissions.OnEditUserInventory += BigRegion.PermissionModule.CanEditUserInventory; //NOT YET IMPLEMENTED | ||
919 | VirtualRegion.Permissions.OnDeleteUserInventory += BigRegion.PermissionModule.CanDeleteUserInventory; //NOT YET IMPLEMENTED | ||
920 | VirtualRegion.Permissions.OnTeleport += BigRegion.PermissionModule.CanTeleport; //NOT YET IMPLEMENTED | ||
921 | VirtualRegion.Permissions.OnUseObjectReturn += BigRegion.PermissionModule.CanUseObjectReturn; //NOT YET IMPLEMENTED | ||
922 | } | ||
923 | |||
924 | #region console commands | ||
925 | public void FixPhantoms(string module, string[] cmdparams) | ||
926 | { | ||
927 | List<Scene> scenes = new List<Scene>(m_startingScenes.Values); | ||
928 | foreach (Scene s in scenes) | ||
929 | { | ||
930 | s.ForEachSOG(delegate(SceneObjectGroup e) | ||
931 | { | ||
932 | e.AbsolutePosition = e.AbsolutePosition; | ||
933 | } | ||
934 | ); | ||
935 | } | ||
936 | } | ||
937 | #endregion | ||
938 | } | ||
939 | } | ||
diff --git a/OpenSim/Region/CoreModules/World/Land/RegionCombinerPermissionModule.cs b/OpenSim/Region/CoreModules/World/Land/RegionCombinerPermissionModule.cs deleted file mode 100644 index 76ca5e3..0000000 --- a/OpenSim/Region/CoreModules/World/Land/RegionCombinerPermissionModule.cs +++ /dev/null | |||
@@ -1,275 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using OpenMetaverse; | ||
31 | using OpenSim.Framework; | ||
32 | using OpenSim.Region.Framework.Interfaces; | ||
33 | using OpenSim.Region.Framework.Scenes; | ||
34 | |||
35 | namespace OpenSim.Region.CoreModules.World.Land | ||
36 | { | ||
37 | public class RegionCombinerPermissionModule | ||
38 | { | ||
39 | private Scene m_rootScene; | ||
40 | |||
41 | public RegionCombinerPermissionModule(Scene RootScene) | ||
42 | { | ||
43 | m_rootScene = RootScene; | ||
44 | } | ||
45 | |||
46 | #region Permission Override | ||
47 | |||
48 | public bool BypassPermissions() | ||
49 | { | ||
50 | return m_rootScene.Permissions.BypassPermissions(); | ||
51 | } | ||
52 | |||
53 | public void SetBypassPermissions(bool value) | ||
54 | { | ||
55 | m_rootScene.Permissions.SetBypassPermissions(value); | ||
56 | } | ||
57 | |||
58 | public bool PropagatePermissions() | ||
59 | { | ||
60 | return m_rootScene.Permissions.PropagatePermissions(); | ||
61 | } | ||
62 | |||
63 | public uint GenerateClientFlags(UUID userid, UUID objectidid) | ||
64 | { | ||
65 | return m_rootScene.Permissions.GenerateClientFlags(userid,objectidid); | ||
66 | } | ||
67 | |||
68 | public bool CanAbandonParcel(UUID user, ILandObject parcel, Scene scene) | ||
69 | { | ||
70 | return m_rootScene.Permissions.CanAbandonParcel(user,parcel); | ||
71 | } | ||
72 | |||
73 | public bool CanReclaimParcel(UUID user, ILandObject parcel, Scene scene) | ||
74 | { | ||
75 | return m_rootScene.Permissions.CanReclaimParcel(user, parcel); | ||
76 | } | ||
77 | |||
78 | public bool CanDeedParcel(UUID user, ILandObject parcel, Scene scene) | ||
79 | { | ||
80 | return m_rootScene.Permissions.CanDeedParcel(user, parcel); | ||
81 | } | ||
82 | |||
83 | public bool CanDeedObject(UUID user, UUID @group, Scene scene) | ||
84 | { | ||
85 | return m_rootScene.Permissions.CanDeedObject(user,@group); | ||
86 | } | ||
87 | |||
88 | public bool IsGod(UUID user, Scene requestfromscene) | ||
89 | { | ||
90 | return m_rootScene.Permissions.IsGod(user); | ||
91 | } | ||
92 | |||
93 | public bool CanDuplicateObject(int objectcount, UUID objectid, UUID owner, Scene scene, Vector3 objectposition) | ||
94 | { | ||
95 | return m_rootScene.Permissions.CanDuplicateObject(objectcount, objectid, owner, objectposition); | ||
96 | } | ||
97 | |||
98 | public bool CanDeleteObject(UUID objectid, UUID deleter, Scene scene) | ||
99 | { | ||
100 | return m_rootScene.Permissions.CanDeleteObject(objectid, deleter); | ||
101 | } | ||
102 | |||
103 | public bool CanEditObject(UUID objectid, UUID editorid, Scene scene) | ||
104 | { | ||
105 | return m_rootScene.Permissions.CanEditObject(objectid, editorid); | ||
106 | } | ||
107 | |||
108 | public bool CanEditParcel(UUID user, ILandObject parcel, Scene scene) | ||
109 | { | ||
110 | return m_rootScene.Permissions.CanEditParcel(user, parcel); | ||
111 | } | ||
112 | |||
113 | public bool CanInstantMessage(UUID user, UUID target, Scene startscene) | ||
114 | { | ||
115 | return m_rootScene.Permissions.CanInstantMessage(user, target); | ||
116 | } | ||
117 | |||
118 | public bool CanInventoryTransfer(UUID user, UUID target, Scene startscene) | ||
119 | { | ||
120 | return m_rootScene.Permissions.CanInventoryTransfer(user, target); | ||
121 | } | ||
122 | |||
123 | public bool CanIssueEstateCommand(UUID user, Scene requestfromscene, bool ownercommand) | ||
124 | { | ||
125 | return m_rootScene.Permissions.CanIssueEstateCommand(user, ownercommand); | ||
126 | } | ||
127 | |||
128 | public bool CanMoveObject(UUID objectid, UUID moverid, Scene scene) | ||
129 | { | ||
130 | return m_rootScene.Permissions.CanMoveObject(objectid, moverid); | ||
131 | } | ||
132 | |||
133 | public bool CanObjectEntry(UUID objectid, bool enteringregion, Vector3 newpoint, Scene scene) | ||
134 | { | ||
135 | return m_rootScene.Permissions.CanObjectEntry(objectid, enteringregion, newpoint); | ||
136 | } | ||
137 | |||
138 | public bool CanReturnObject(UUID objectid, UUID returnerid, Scene scene) | ||
139 | { | ||
140 | return m_rootScene.Permissions.CanReturnObject(objectid, returnerid); | ||
141 | } | ||
142 | |||
143 | public bool CanRezObject(int objectcount, UUID owner, Vector3 objectposition, Scene scene) | ||
144 | { | ||
145 | return m_rootScene.Permissions.CanRezObject(objectcount, owner, objectposition); | ||
146 | } | ||
147 | |||
148 | public bool CanRunConsoleCommand(UUID user, Scene requestfromscene) | ||
149 | { | ||
150 | return m_rootScene.Permissions.CanRunConsoleCommand(user); | ||
151 | } | ||
152 | |||
153 | public bool CanRunScript(UUID script, UUID objectid, UUID user, Scene scene) | ||
154 | { | ||
155 | return m_rootScene.Permissions.CanRunScript(script, objectid, user); | ||
156 | } | ||
157 | |||
158 | public bool CanCompileScript(UUID owneruuid, int scripttype, Scene scene) | ||
159 | { | ||
160 | return m_rootScene.Permissions.CanCompileScript(owneruuid, scripttype); | ||
161 | } | ||
162 | |||
163 | public bool CanSellParcel(UUID user, ILandObject parcel, Scene scene) | ||
164 | { | ||
165 | return m_rootScene.Permissions.CanSellParcel(user, parcel); | ||
166 | } | ||
167 | |||
168 | public bool CanTakeObject(UUID objectid, UUID stealer, Scene scene) | ||
169 | { | ||
170 | return m_rootScene.Permissions.CanTakeObject(objectid, stealer); | ||
171 | } | ||
172 | |||
173 | public bool CanTakeCopyObject(UUID objectid, UUID userid, Scene inscene) | ||
174 | { | ||
175 | return m_rootScene.Permissions.CanTakeObject(objectid, userid); | ||
176 | } | ||
177 | |||
178 | public bool CanTerraformLand(UUID user, Vector3 position, Scene requestfromscene) | ||
179 | { | ||
180 | return m_rootScene.Permissions.CanTerraformLand(user, position); | ||
181 | } | ||
182 | |||
183 | public bool CanLinkObject(UUID user, UUID objectid) | ||
184 | { | ||
185 | return m_rootScene.Permissions.CanLinkObject(user, objectid); | ||
186 | } | ||
187 | |||
188 | public bool CanDelinkObject(UUID user, UUID objectid) | ||
189 | { | ||
190 | return m_rootScene.Permissions.CanDelinkObject(user, objectid); | ||
191 | } | ||
192 | |||
193 | public bool CanBuyLand(UUID user, ILandObject parcel, Scene scene) | ||
194 | { | ||
195 | return m_rootScene.Permissions.CanBuyLand(user, parcel); | ||
196 | } | ||
197 | |||
198 | public bool CanViewNotecard(UUID script, UUID objectid, UUID user, Scene scene) | ||
199 | { | ||
200 | return m_rootScene.Permissions.CanViewNotecard(script, objectid, user); | ||
201 | } | ||
202 | |||
203 | public bool CanViewScript(UUID script, UUID objectid, UUID user, Scene scene) | ||
204 | { | ||
205 | return m_rootScene.Permissions.CanViewScript(script, objectid, user); | ||
206 | } | ||
207 | |||
208 | public bool CanEditNotecard(UUID notecard, UUID objectid, UUID user, Scene scene) | ||
209 | { | ||
210 | return m_rootScene.Permissions.CanEditNotecard(notecard, objectid, user); | ||
211 | } | ||
212 | |||
213 | public bool CanEditScript(UUID script, UUID objectid, UUID user, Scene scene) | ||
214 | { | ||
215 | return m_rootScene.Permissions.CanEditScript(script, objectid, user); | ||
216 | } | ||
217 | |||
218 | public bool CanCreateObjectInventory(int invtype, UUID objectid, UUID userid) | ||
219 | { | ||
220 | return m_rootScene.Permissions.CanCreateObjectInventory(invtype, objectid, userid); | ||
221 | } | ||
222 | |||
223 | public bool CanEditObjectInventory(UUID objectid, UUID editorid, Scene scene) | ||
224 | { | ||
225 | return m_rootScene.Permissions.CanEditObjectInventory(objectid, editorid); | ||
226 | } | ||
227 | |||
228 | public bool CanCopyObjectInventory(UUID itemid, UUID objectid, UUID userid) | ||
229 | { | ||
230 | return m_rootScene.Permissions.CanCopyObjectInventory(itemid, objectid, userid); | ||
231 | } | ||
232 | |||
233 | public bool CanDeleteObjectInventory(UUID itemid, UUID objectid, UUID userid) | ||
234 | { | ||
235 | return m_rootScene.Permissions.CanDeleteObjectInventory(itemid, objectid, userid); | ||
236 | } | ||
237 | |||
238 | public bool CanResetScript(UUID prim, UUID script, UUID user, Scene scene) | ||
239 | { | ||
240 | return m_rootScene.Permissions.CanResetScript(prim, script, user); | ||
241 | } | ||
242 | |||
243 | public bool CanCreateUserInventory(int invtype, UUID userid) | ||
244 | { | ||
245 | return m_rootScene.Permissions.CanCreateUserInventory(invtype, userid); | ||
246 | } | ||
247 | |||
248 | public bool CanCopyUserInventory(UUID itemid, UUID userid) | ||
249 | { | ||
250 | return m_rootScene.Permissions.CanCopyUserInventory(itemid, userid); | ||
251 | } | ||
252 | |||
253 | public bool CanEditUserInventory(UUID itemid, UUID userid) | ||
254 | { | ||
255 | return m_rootScene.Permissions.CanEditUserInventory(itemid, userid); | ||
256 | } | ||
257 | |||
258 | public bool CanDeleteUserInventory(UUID itemid, UUID userid) | ||
259 | { | ||
260 | return m_rootScene.Permissions.CanDeleteUserInventory(itemid, userid); | ||
261 | } | ||
262 | |||
263 | public bool CanTeleport(UUID userid, Scene scene) | ||
264 | { | ||
265 | return m_rootScene.Permissions.CanTeleport(userid); | ||
266 | } | ||
267 | |||
268 | public bool CanUseObjectReturn(ILandObject landdata, uint type, IClientAPI client, List<SceneObjectGroup> retlist, Scene scene) | ||
269 | { | ||
270 | return m_rootScene.Permissions.CanUseObjectReturn(landdata, type, client, retlist); | ||
271 | } | ||
272 | |||
273 | #endregion | ||
274 | } | ||
275 | } \ No newline at end of file | ||
diff --git a/OpenSim/Region/CoreModules/World/Land/RegionConnections.cs b/OpenSim/Region/CoreModules/World/Land/RegionConnections.cs deleted file mode 100644 index 419ed74..0000000 --- a/OpenSim/Region/CoreModules/World/Land/RegionConnections.cs +++ /dev/null | |||
@@ -1,65 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using OpenMetaverse; | ||
31 | using OpenSim.Region.Framework.Interfaces; | ||
32 | using OpenSim.Region.Framework.Scenes; | ||
33 | |||
34 | namespace OpenSim.Region.CoreModules.World.Land | ||
35 | { | ||
36 | public class RegionConnections | ||
37 | { | ||
38 | /// <summary> | ||
39 | /// Root Region ID | ||
40 | /// </summary> | ||
41 | public UUID RegionId; | ||
42 | |||
43 | /// <summary> | ||
44 | /// Root Region Scene | ||
45 | /// </summary> | ||
46 | public Scene RegionScene; | ||
47 | |||
48 | /// <summary> | ||
49 | /// LargeLandChannel for combined region | ||
50 | /// </summary> | ||
51 | public ILandChannel RegionLandChannel; | ||
52 | public uint X; | ||
53 | public uint Y; | ||
54 | public int XEnd; | ||
55 | public int YEnd; | ||
56 | public List<RegionData> ConnectedRegions; | ||
57 | public RegionCombinerPermissionModule PermissionModule; | ||
58 | public RegionCombinerClientEventForwarder ClientEventForwarder; | ||
59 | public void UpdateExtents(Vector3 extents) | ||
60 | { | ||
61 | XEnd = (int)extents.X; | ||
62 | YEnd = (int)extents.Y; | ||
63 | } | ||
64 | } | ||
65 | } \ No newline at end of file | ||
diff --git a/OpenSim/Region/CoreModules/World/Land/RegionCourseLocation.cs b/OpenSim/Region/CoreModules/World/Land/RegionCourseLocation.cs deleted file mode 100644 index 175ca89..0000000 --- a/OpenSim/Region/CoreModules/World/Land/RegionCourseLocation.cs +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using OpenMetaverse; | ||
31 | using OpenSim.Framework; | ||
32 | |||
33 | namespace OpenSim.Region.CoreModules.World.Land | ||
34 | { | ||
35 | |||
36 | struct RegionCourseLocationStruct | ||
37 | { | ||
38 | public List<Vector3> Locations; | ||
39 | public List<UUID> Uuids; | ||
40 | public IClientAPI UserAPI; | ||
41 | public Vector2 Offset; | ||
42 | } | ||
43 | } \ No newline at end of file | ||
diff --git a/OpenSim/Region/CoreModules/World/Land/RegionData.cs b/OpenSim/Region/CoreModules/World/Land/RegionData.cs deleted file mode 100644 index 3383527..0000000 --- a/OpenSim/Region/CoreModules/World/Land/RegionData.cs +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using OpenMetaverse; | ||
29 | using OpenSim.Region.Framework.Scenes; | ||
30 | |||
31 | namespace OpenSim.Region.CoreModules.World.Land | ||
32 | { | ||
33 | public class RegionData | ||
34 | { | ||
35 | public UUID RegionId; | ||
36 | public Scene RegionScene; | ||
37 | public Vector3 Offset; | ||
38 | } | ||
39 | } \ No newline at end of file | ||
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index fe9de1b..c790624 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -144,6 +144,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
144 | private Dictionary<string, bool> GrantVB = new Dictionary<string, bool>(); | 144 | private Dictionary<string, bool> GrantVB = new Dictionary<string, bool>(); |
145 | private Dictionary<string, bool> GrantJS = new Dictionary<string, bool>(); | 145 | private Dictionary<string, bool> GrantJS = new Dictionary<string, bool>(); |
146 | private Dictionary<string, bool> GrantYP = new Dictionary<string, bool>(); | 146 | private Dictionary<string, bool> GrantYP = new Dictionary<string, bool>(); |
147 | private IFriendsModule m_friendsModule = null; | ||
148 | |||
147 | #endregion | 149 | #endregion |
148 | 150 | ||
149 | #region IRegionModule Members | 151 | #region IRegionModule Members |
@@ -363,6 +365,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
363 | 365 | ||
364 | public void PostInitialise() | 366 | public void PostInitialise() |
365 | { | 367 | { |
368 | m_friendsModule = m_scene.RequestModuleInterface<IFriendsModule>(); | ||
369 | |||
370 | if (m_friendsModule == null) | ||
371 | m_log.Error("[PERMISSIONS]: Friends module not found, friend permissions will not work"); | ||
372 | else | ||
373 | m_log.Info("[PERMISSIONS]: Friends module found, friend permissions enabled"); | ||
366 | } | 374 | } |
367 | 375 | ||
368 | public void Close() | 376 | public void Close() |
@@ -476,6 +484,24 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
476 | 484 | ||
477 | return false; | 485 | return false; |
478 | } | 486 | } |
487 | protected bool IsFriendWithPerms(UUID user,UUID objectOwner) | ||
488 | { | ||
489 | |||
490 | if (user == UUID.Zero) | ||
491 | return false; | ||
492 | |||
493 | if (m_friendsModule == null) | ||
494 | return false; | ||
495 | |||
496 | List<FriendListItem> profile = m_friendsModule.GetUserFriends(user); | ||
497 | |||
498 | foreach (FriendListItem item in profile) | ||
499 | { | ||
500 | if(item.Friend == objectOwner && (item.FriendPerms & (uint)FriendRights.CanModifyObjects) != 0) | ||
501 | return true; | ||
502 | } | ||
503 | return false; | ||
504 | } | ||
479 | 505 | ||
480 | protected bool IsEstateManager(UUID user) | 506 | protected bool IsEstateManager(UUID user) |
481 | { | 507 | { |
@@ -565,6 +591,9 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
565 | // Object owners should be able to edit their own content | 591 | // Object owners should be able to edit their own content |
566 | if (user == objectOwner) | 592 | if (user == objectOwner) |
567 | return objectOwnerMask; | 593 | return objectOwnerMask; |
594 | |||
595 | if (IsFriendWithPerms(user, objectOwner)) | ||
596 | return objectOwnerMask; | ||
568 | 597 | ||
569 | // Estate users should be able to edit anything in the sim | 598 | // Estate users should be able to edit anything in the sim |
570 | if (IsEstateManager(user) && m_RegionOwnerIsGod && !IsAdministrator(objectOwner)) | 599 | if (IsEstateManager(user) && m_RegionOwnerIsGod && !IsAdministrator(objectOwner)) |
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index f4b54aa..44a651f 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | |||
@@ -1077,14 +1077,12 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1077 | 1077 | ||
1078 | m_scene.RegionInfo.RegionSettings.TerrainImageID = TerrainImageUUID; | 1078 | m_scene.RegionInfo.RegionSettings.TerrainImageID = TerrainImageUUID; |
1079 | 1079 | ||
1080 | AssetBase asset = new AssetBase(); | 1080 | AssetBase asset = new AssetBase( |
1081 | asset.FullID = m_scene.RegionInfo.RegionSettings.TerrainImageID; | 1081 | m_scene.RegionInfo.RegionSettings.TerrainImageID, |
1082 | "terrainImage_" + m_scene.RegionInfo.RegionID.ToString() + "_" + lastMapRefresh.ToString(), | ||
1083 | (sbyte)AssetType.Texture); | ||
1082 | asset.Data = data; | 1084 | asset.Data = data; |
1083 | asset.Name | ||
1084 | = "terrainImage_" + m_scene.RegionInfo.RegionID.ToString() + "_" + lastMapRefresh.ToString(); | ||
1085 | asset.Description = m_scene.RegionInfo.RegionName; | 1085 | asset.Description = m_scene.RegionInfo.RegionName; |
1086 | |||
1087 | asset.Type = 0; | ||
1088 | asset.Temporary = temporary; | 1086 | asset.Temporary = temporary; |
1089 | m_scene.AssetService.Store(asset); | 1087 | m_scene.AssetService.Store(asset); |
1090 | } | 1088 | } |