diff options
Diffstat (limited to 'OpenSim/Region/RegionCombinerModule/RegionCombinerLargeLandChannel.cs')
-rw-r--r-- | OpenSim/Region/RegionCombinerModule/RegionCombinerLargeLandChannel.cs | 164 |
1 files changed, 164 insertions, 0 deletions
diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerLargeLandChannel.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerLargeLandChannel.cs new file mode 100644 index 0000000..146ec66 --- /dev/null +++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerLargeLandChannel.cs | |||
@@ -0,0 +1,164 @@ | |||
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.CoreModules.World.Land; | ||
34 | |||
35 | namespace OpenSim.Region.RegionCombinerModule | ||
36 | { | ||
37 | public class RegionCombinerLargeLandChannel : ILandChannel | ||
38 | { | ||
39 | // private static readonly ILog m_log = | ||
40 | // LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
41 | private RegionData RegData; | ||
42 | private ILandChannel RootRegionLandChannel; | ||
43 | private readonly List<RegionData> RegionConnections; | ||
44 | |||
45 | #region ILandChannel Members | ||
46 | |||
47 | public RegionCombinerLargeLandChannel(RegionData regData, ILandChannel rootRegionLandChannel, | ||
48 | List<RegionData> regionConnections) | ||
49 | { | ||
50 | RegData = regData; | ||
51 | RootRegionLandChannel = rootRegionLandChannel; | ||
52 | RegionConnections = regionConnections; | ||
53 | } | ||
54 | |||
55 | public List<ILandObject> ParcelsNearPoint(Vector3 position) | ||
56 | { | ||
57 | //m_log.DebugFormat("[LANDPARCELNEARPOINT]: {0}>", position); | ||
58 | return RootRegionLandChannel.ParcelsNearPoint(position - RegData.Offset); | ||
59 | } | ||
60 | |||
61 | public List<ILandObject> AllParcels() | ||
62 | { | ||
63 | return RootRegionLandChannel.AllParcels(); | ||
64 | } | ||
65 | |||
66 | public ILandObject GetLandObject(int x, int y) | ||
67 | { | ||
68 | //m_log.DebugFormat("[BIGLANDTESTINT]: <{0},{1}>", x, y); | ||
69 | |||
70 | if (x > 0 && x <= (int)Constants.RegionSize && y > 0 && y <= (int)Constants.RegionSize) | ||
71 | { | ||
72 | return RootRegionLandChannel.GetLandObject(x, y); | ||
73 | } | ||
74 | else | ||
75 | { | ||
76 | int offsetX = (x / (int)Constants.RegionSize); | ||
77 | int offsetY = (y / (int)Constants.RegionSize); | ||
78 | offsetX *= (int)Constants.RegionSize; | ||
79 | offsetY *= (int)Constants.RegionSize; | ||
80 | |||
81 | foreach (RegionData regionData in RegionConnections) | ||
82 | { | ||
83 | if (regionData.Offset.X == offsetX && regionData.Offset.Y == offsetY) | ||
84 | { | ||
85 | return regionData.RegionScene.LandChannel.GetLandObject(x - offsetX, y - offsetY); | ||
86 | } | ||
87 | } | ||
88 | ILandObject obj = new LandObject(UUID.Zero, false, RegData.RegionScene); | ||
89 | obj.LandData.Name = "NO LAND"; | ||
90 | return obj; | ||
91 | } | ||
92 | } | ||
93 | |||
94 | public ILandObject GetLandObject(int localID) | ||
95 | { | ||
96 | return RootRegionLandChannel.GetLandObject(localID); | ||
97 | } | ||
98 | |||
99 | public ILandObject GetLandObject(float x, float y) | ||
100 | { | ||
101 | //m_log.DebugFormat("[BIGLANDTESTFLOAT]: <{0},{1}>", x, y); | ||
102 | |||
103 | if (x > 0 && x <= (int)Constants.RegionSize && y > 0 && y <= (int)Constants.RegionSize) | ||
104 | { | ||
105 | return RootRegionLandChannel.GetLandObject(x, y); | ||
106 | } | ||
107 | else | ||
108 | { | ||
109 | int offsetX = (int)(x/(int) Constants.RegionSize); | ||
110 | int offsetY = (int)(y/(int) Constants.RegionSize); | ||
111 | offsetX *= (int) Constants.RegionSize; | ||
112 | offsetY *= (int) Constants.RegionSize; | ||
113 | |||
114 | foreach (RegionData regionData in RegionConnections) | ||
115 | { | ||
116 | if (regionData.Offset.X == offsetX && regionData.Offset.Y == offsetY) | ||
117 | { | ||
118 | return regionData.RegionScene.LandChannel.GetLandObject(x - offsetX, y - offsetY); | ||
119 | } | ||
120 | } | ||
121 | ILandObject obj = new LandObject(UUID.Zero, false, RegData.RegionScene); | ||
122 | obj.LandData.Name = "NO LAND"; | ||
123 | return obj; | ||
124 | } | ||
125 | } | ||
126 | |||
127 | public bool IsLandPrimCountTainted() | ||
128 | { | ||
129 | return RootRegionLandChannel.IsLandPrimCountTainted(); | ||
130 | } | ||
131 | |||
132 | public bool IsForcefulBansAllowed() | ||
133 | { | ||
134 | return RootRegionLandChannel.IsForcefulBansAllowed(); | ||
135 | } | ||
136 | |||
137 | public void UpdateLandObject(int localID, LandData data) | ||
138 | { | ||
139 | RootRegionLandChannel.UpdateLandObject(localID, data); | ||
140 | } | ||
141 | |||
142 | public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient) | ||
143 | { | ||
144 | RootRegionLandChannel.ReturnObjectsInParcel(localID, returnType, agentIDs, taskIDs, remoteClient); | ||
145 | } | ||
146 | |||
147 | public void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel) | ||
148 | { | ||
149 | RootRegionLandChannel.setParcelObjectMaxOverride(overrideDel); | ||
150 | } | ||
151 | |||
152 | public void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel) | ||
153 | { | ||
154 | RootRegionLandChannel.setSimulatorObjectMaxOverride(overrideDel); | ||
155 | } | ||
156 | |||
157 | public void SetParcelOtherCleanTime(IClientAPI remoteClient, int localID, int otherCleanTime) | ||
158 | { | ||
159 | RootRegionLandChannel.SetParcelOtherCleanTime(remoteClient, localID, otherCleanTime); | ||
160 | } | ||
161 | |||
162 | #endregion | ||
163 | } | ||
164 | } \ No newline at end of file | ||