diff options
author | David Walter Seikel | 2016-11-03 21:44:39 +1000 |
---|---|---|
committer | David Walter Seikel | 2016-11-03 21:44:39 +1000 |
commit | 134f86e8d5c414409631b25b8c6f0ee45fbd8631 (patch) | |
tree | 216b89d3fb89acfb81be1e440c25c41ab09fa96d /OpenSim/Region/RegionCombinerModule/RegionCombinerLargeLandChannel.cs | |
parent | More changing to production grid. Double oops. (diff) | |
download | opensim-SC_OLD-134f86e8d5c414409631b25b8c6f0ee45fbd8631.zip opensim-SC_OLD-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.gz opensim-SC_OLD-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.bz2 opensim-SC_OLD-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.xz |
Initial update to OpenSim 0.8.2.1 source code.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/OptionalModules/RegionCombinerModule/RegionCombinerLargeLandChannel.cs (renamed from OpenSim/Region/RegionCombinerModule/RegionCombinerLargeLandChannel.cs) | 88 |
1 files changed, 57 insertions, 31 deletions
diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerLargeLandChannel.cs b/OpenSim/Region/OptionalModules/RegionCombinerModule/RegionCombinerLargeLandChannel.cs index a133e51..4bf2a82 100644 --- a/OpenSim/Region/RegionCombinerModule/RegionCombinerLargeLandChannel.cs +++ b/OpenSim/Region/OptionalModules/RegionCombinerModule/RegionCombinerLargeLandChannel.cs | |||
@@ -27,6 +27,8 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Reflection; | ||
31 | using log4net; | ||
30 | using OpenMetaverse; | 32 | using OpenMetaverse; |
31 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
32 | using OpenSim.Region.Framework.Interfaces; | 34 | using OpenSim.Region.Framework.Interfaces; |
@@ -34,10 +36,10 @@ using OpenSim.Region.CoreModules.World.Land; | |||
34 | 36 | ||
35 | namespace OpenSim.Region.RegionCombinerModule | 37 | namespace OpenSim.Region.RegionCombinerModule |
36 | { | 38 | { |
37 | public class RegionCombinerLargeLandChannel : ILandChannel | 39 | public class RegionCombinerLargeLandChannel : ILandChannel |
38 | { | 40 | { |
39 | // private static readonly ILog m_log = | 41 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
40 | // LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 42 | |
41 | private RegionData RegData; | 43 | private RegionData RegData; |
42 | private ILandChannel RootRegionLandChannel; | 44 | private ILandChannel RootRegionLandChannel; |
43 | private readonly List<RegionData> RegionConnections; | 45 | private readonly List<RegionData> RegionConnections; |
@@ -68,42 +70,58 @@ public class RegionCombinerLargeLandChannel : ILandChannel | |||
68 | RootRegionLandChannel.Clear(setupDefaultParcel); | 70 | RootRegionLandChannel.Clear(setupDefaultParcel); |
69 | } | 71 | } |
70 | 72 | ||
71 | public ILandObject GetLandObject(int x, int y) | 73 | public ILandObject GetLandObject(Vector3 position) |
72 | { | 74 | { |
73 | //m_log.DebugFormat("[BIGLANDTESTINT]: <{0},{1}>", x, y); | 75 | return GetLandObject(position.X, position.Y); |
74 | 76 | } | |
75 | if (x > 0 && x <= (int)Constants.RegionSize && y > 0 && y <= (int)Constants.RegionSize) | ||
76 | { | ||
77 | return RootRegionLandChannel.GetLandObject(x, y); | ||
78 | } | ||
79 | else | ||
80 | { | ||
81 | int offsetX = (x / (int)Constants.RegionSize); | ||
82 | int offsetY = (y / (int)Constants.RegionSize); | ||
83 | offsetX *= (int)Constants.RegionSize; | ||
84 | offsetY *= (int)Constants.RegionSize; | ||
85 | 77 | ||
86 | foreach (RegionData regionData in RegionConnections) | 78 | public ILandObject GetLandObject(int x, int y) |
87 | { | 79 | { |
88 | if (regionData.Offset.X == offsetX && regionData.Offset.Y == offsetY) | 80 | return GetLandObject((float)x, (float)y); |
89 | { | 81 | |
90 | return regionData.RegionScene.LandChannel.GetLandObject(x - offsetX, y - offsetY); | 82 | // m_log.DebugFormat("[BIGLANDTESTINT]: <{0},{1}>", x, y); |
91 | } | 83 | // |
92 | } | 84 | // if (x > 0 && x <= (int)Constants.RegionSize && y > 0 && y <= (int)Constants.RegionSize) |
93 | ILandObject obj = new LandObject(UUID.Zero, false, RegData.RegionScene); | 85 | // { |
94 | obj.LandData.Name = "NO LAND"; | 86 | // return RootRegionLandChannel.GetLandObject(x, y); |
95 | return obj; | 87 | // } |
96 | } | 88 | // else |
89 | // { | ||
90 | // int offsetX = (x / (int)Constants.RegionSize); | ||
91 | // int offsetY = (y / (int)Constants.RegionSize); | ||
92 | // offsetX *= (int)Constants.RegionSize; | ||
93 | // offsetY *= (int)Constants.RegionSize; | ||
94 | // | ||
95 | // foreach (RegionData regionData in RegionConnections) | ||
96 | // { | ||
97 | // if (regionData.Offset.X == offsetX && regionData.Offset.Y == offsetY) | ||
98 | // { | ||
99 | // m_log.DebugFormat( | ||
100 | // "[REGION COMBINER LARGE LAND CHANNEL]: Found region {0} at offset {1},{2}", | ||
101 | // regionData.RegionScene.Name, offsetX, offsetY); | ||
102 | // | ||
103 | // return regionData.RegionScene.LandChannel.GetLandObject(x - offsetX, y - offsetY); | ||
104 | // } | ||
105 | // } | ||
106 | // //ILandObject obj = new LandObject(UUID.Zero, false, RegData.RegionScene); | ||
107 | // //obj.LandData.Name = "NO LAND"; | ||
108 | // //return obj; | ||
109 | // } | ||
110 | // | ||
111 | // m_log.DebugFormat("[REGION COMBINER LARGE LAND CHANNEL]: No region found at {0},{1}, returning null", x, y); | ||
112 | // | ||
113 | // return null; | ||
97 | } | 114 | } |
98 | 115 | ||
99 | public ILandObject GetLandObject(int localID) | 116 | public ILandObject GetLandObject(int localID) |
100 | { | 117 | { |
118 | // XXX: Possibly should be looking in every land channel, not just the root. | ||
101 | return RootRegionLandChannel.GetLandObject(localID); | 119 | return RootRegionLandChannel.GetLandObject(localID); |
102 | } | 120 | } |
103 | 121 | ||
104 | public ILandObject GetLandObject(float x, float y) | 122 | public ILandObject GetLandObject(float x, float y) |
105 | { | 123 | { |
106 | //m_log.DebugFormat("[BIGLANDTESTFLOAT]: <{0},{1}>", x, y); | 124 | // m_log.DebugFormat("[BIGLANDTESTFLOAT]: <{0},{1}>", x, y); |
107 | 125 | ||
108 | if (x > 0 && x <= (int)Constants.RegionSize && y > 0 && y <= (int)Constants.RegionSize) | 126 | if (x > 0 && x <= (int)Constants.RegionSize && y > 0 && y <= (int)Constants.RegionSize) |
109 | { | 127 | { |
@@ -120,14 +138,22 @@ public class RegionCombinerLargeLandChannel : ILandChannel | |||
120 | { | 138 | { |
121 | if (regionData.Offset.X == offsetX && regionData.Offset.Y == offsetY) | 139 | if (regionData.Offset.X == offsetX && regionData.Offset.Y == offsetY) |
122 | { | 140 | { |
141 | // m_log.DebugFormat( | ||
142 | // "[REGION COMBINER LARGE LAND CHANNEL]: Found region {0} at offset {1},{2}", | ||
143 | // regionData.RegionScene.Name, offsetX, offsetY); | ||
144 | |||
123 | return regionData.RegionScene.LandChannel.GetLandObject(x - offsetX, y - offsetY); | 145 | return regionData.RegionScene.LandChannel.GetLandObject(x - offsetX, y - offsetY); |
124 | } | 146 | } |
125 | } | 147 | } |
126 | 148 | ||
127 | ILandObject obj = new LandObject(UUID.Zero, false, RegData.RegionScene); | 149 | // ILandObject obj = new LandObject(UUID.Zero, false, RegData.RegionScene); |
128 | obj.LandData.Name = "NO LAND"; | 150 | // obj.LandData.Name = "NO LAND"; |
129 | return obj; | 151 | // return obj; |
130 | } | 152 | } |
153 | |||
154 | // m_log.DebugFormat("[REGION COMBINER LARGE LAND CHANNEL]: No region found at {0},{1}, returning null", x, y); | ||
155 | |||
156 | return null; | ||
131 | } | 157 | } |
132 | 158 | ||
133 | public bool IsForcefulBansAllowed() | 159 | public bool IsForcefulBansAllowed() |