diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/RegionCombinerLargeLandChannel.cs | 163 |
1 files changed, 163 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/RegionCombinerLargeLandChannel.cs b/OpenSim/Region/CoreModules/World/Land/RegionCombinerLargeLandChannel.cs new file mode 100644 index 0000000..9e46b94 --- /dev/null +++ b/OpenSim/Region/CoreModules/World/Land/RegionCombinerLargeLandChannel.cs | |||
@@ -0,0 +1,163 @@ | |||
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 | ||