aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/OpenSim.World/Estate/EstateManager.cs
diff options
context:
space:
mode:
authormingchen2007-06-08 19:30:27 +0000
committermingchen2007-06-08 19:30:27 +0000
commit8157182d378de82ae7443b57a90e07267ce1466e (patch)
tree3139163f719fdbb24331a2fc4f7afd98c36e4764 /OpenSim/OpenSim.World/Estate/EstateManager.cs
parent*Merged EstateManager, EstateSettings, ParcelManager,Parcel, and ParcelData c... (diff)
downloadopensim-SC_OLD-8157182d378de82ae7443b57a90e07267ce1466e.zip
opensim-SC_OLD-8157182d378de82ae7443b57a90e07267ce1466e.tar.gz
opensim-SC_OLD-8157182d378de82ae7443b57a90e07267ce1466e.tar.bz2
opensim-SC_OLD-8157182d378de82ae7443b57a90e07267ce1466e.tar.xz
*RegionInfo in Avatar class now protected again (oops, my fault)
Diffstat (limited to 'OpenSim/OpenSim.World/Estate/EstateManager.cs')
-rw-r--r--OpenSim/OpenSim.World/Estate/EstateManager.cs152
1 files changed, 77 insertions, 75 deletions
diff --git a/OpenSim/OpenSim.World/Estate/EstateManager.cs b/OpenSim/OpenSim.World/Estate/EstateManager.cs
index 37abc6d..cbcc702 100644
--- a/OpenSim/OpenSim.World/Estate/EstateManager.cs
+++ b/OpenSim/OpenSim.World/Estate/EstateManager.cs
@@ -19,10 +19,12 @@ namespace OpenSim.world.Estate
19 public class EstateManager 19 public class EstateManager
20 { 20 {
21 private World m_world; 21 private World m_world;
22 private RegionInfo m_regInfo;
22 23
23 public EstateManager(World world) 24 public EstateManager(World world,RegionInfo reginfo)
24 { 25 {
25 m_world = world; //Estate settings found at world.m_regInfo.estateSettings 26 m_world = world; //Estate settings found at world.m_regInfo.estateSettings
27 m_regInfo = reginfo;
26 } 28 }
27 29
28 private bool convertParamStringToBool(byte[] field) 30 private bool convertParamStringToBool(byte[] field)
@@ -37,7 +39,7 @@ namespace OpenSim.world.Estate
37 39
38 public void handleEstateOwnerMessage(EstateOwnerMessagePacket packet, IClientAPI remote_client) 40 public void handleEstateOwnerMessage(EstateOwnerMessagePacket packet, IClientAPI remote_client)
39 { 41 {
40 if (remote_client.AgentId == m_world.m_regInfo.MasterAvatarAssignedUUID) 42 if (remote_client.AgentId == m_regInfo.MasterAvatarAssignedUUID)
41 { 43 {
42 switch (Helpers.FieldToUTF8String(packet.MethodData.Method)) 44 switch (Helpers.FieldToUTF8String(packet.MethodData.Method))
43 { 45 {
@@ -53,47 +55,47 @@ namespace OpenSim.world.Estate
53 } 55 }
54 else 56 else
55 { 57 {
56 m_world.m_regInfo.estateSettings.regionFlags = libsecondlife.Simulator.RegionFlags.None; 58 m_regInfo.estateSettings.regionFlags = libsecondlife.Simulator.RegionFlags.None;
57 59
58 if (convertParamStringToBool(packet.ParamList[0].Parameter)) 60 if (convertParamStringToBool(packet.ParamList[0].Parameter))
59 { 61 {
60 m_world.m_regInfo.estateSettings.regionFlags = m_world.m_regInfo.estateSettings.regionFlags | libsecondlife.Simulator.RegionFlags.BlockTerraform; 62 m_regInfo.estateSettings.regionFlags = m_regInfo.estateSettings.regionFlags | libsecondlife.Simulator.RegionFlags.BlockTerraform;
61 } 63 }
62 64
63 if (convertParamStringToBool(packet.ParamList[1].Parameter)) 65 if (convertParamStringToBool(packet.ParamList[1].Parameter))
64 { 66 {
65 m_world.m_regInfo.estateSettings.regionFlags = m_world.m_regInfo.estateSettings.regionFlags | libsecondlife.Simulator.RegionFlags.NoFly; 67 m_regInfo.estateSettings.regionFlags = m_regInfo.estateSettings.regionFlags | libsecondlife.Simulator.RegionFlags.NoFly;
66 } 68 }
67 69
68 if (convertParamStringToBool(packet.ParamList[2].Parameter)) 70 if (convertParamStringToBool(packet.ParamList[2].Parameter))
69 { 71 {
70 m_world.m_regInfo.estateSettings.regionFlags = m_world.m_regInfo.estateSettings.regionFlags | libsecondlife.Simulator.RegionFlags.AllowDamage; 72 m_regInfo.estateSettings.regionFlags = m_regInfo.estateSettings.regionFlags | libsecondlife.Simulator.RegionFlags.AllowDamage;
71 } 73 }
72 74
73 if (convertParamStringToBool(packet.ParamList[3].Parameter) == false) 75 if (convertParamStringToBool(packet.ParamList[3].Parameter) == false)
74 { 76 {
75 m_world.m_regInfo.estateSettings.regionFlags = m_world.m_regInfo.estateSettings.regionFlags | libsecondlife.Simulator.RegionFlags.BlockLandResell; 77 m_regInfo.estateSettings.regionFlags = m_regInfo.estateSettings.regionFlags | libsecondlife.Simulator.RegionFlags.BlockLandResell;
76 } 78 }
77 79
78 80
79 int tempMaxAgents = Convert.ToInt16(Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[4].Parameter))); 81 int tempMaxAgents = Convert.ToInt16(Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[4].Parameter)));
80 m_world.m_regInfo.estateSettings.maxAgents = (byte)tempMaxAgents; 82 m_regInfo.estateSettings.maxAgents = (byte)tempMaxAgents;
81 83
82 float tempObjectBonusFactor = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[5].Parameter)); 84 float tempObjectBonusFactor = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[5].Parameter));
83 m_world.m_regInfo.estateSettings.objectBonusFactor = tempObjectBonusFactor; 85 m_regInfo.estateSettings.objectBonusFactor = tempObjectBonusFactor;
84 86
85 int tempMatureLevel = Convert.ToInt16(Helpers.FieldToUTF8String(packet.ParamList[6].Parameter)); 87 int tempMatureLevel = Convert.ToInt16(Helpers.FieldToUTF8String(packet.ParamList[6].Parameter));
86 m_world.m_regInfo.estateSettings.simAccess = (libsecondlife.Simulator.SimAccess)tempMatureLevel; 88 m_regInfo.estateSettings.simAccess = (libsecondlife.Simulator.SimAccess)tempMatureLevel;
87 89
88 90
89 if (convertParamStringToBool(packet.ParamList[7].Parameter)) 91 if (convertParamStringToBool(packet.ParamList[7].Parameter))
90 { 92 {
91 m_world.m_regInfo.estateSettings.regionFlags = m_world.m_regInfo.estateSettings.regionFlags | libsecondlife.Simulator.RegionFlags.RestrictPushObject; 93 m_regInfo.estateSettings.regionFlags = m_regInfo.estateSettings.regionFlags | libsecondlife.Simulator.RegionFlags.RestrictPushObject;
92 } 94 }
93 95
94 if (convertParamStringToBool(packet.ParamList[8].Parameter)) 96 if (convertParamStringToBool(packet.ParamList[8].Parameter))
95 { 97 {
96 m_world.m_regInfo.estateSettings.regionFlags = m_world.m_regInfo.estateSettings.regionFlags | libsecondlife.Simulator.RegionFlags.AllowParcelChanges; 98 m_regInfo.estateSettings.regionFlags = m_regInfo.estateSettings.regionFlags | libsecondlife.Simulator.RegionFlags.AllowParcelChanges;
97 } 99 }
98 100
99 sendRegionInfoPacketToAll(); 101 sendRegionInfoPacketToAll();
@@ -111,16 +113,16 @@ namespace OpenSim.world.Estate
111 switch (Convert.ToInt16(splitField[0])) 113 switch (Convert.ToInt16(splitField[0]))
112 { 114 {
113 case 0: 115 case 0:
114 m_world.m_regInfo.estateSettings.terrainBase0 = tempUUID; 116 m_regInfo.estateSettings.terrainBase0 = tempUUID;
115 break; 117 break;
116 case 1: 118 case 1:
117 m_world.m_regInfo.estateSettings.terrainBase1 = tempUUID; 119 m_regInfo.estateSettings.terrainBase1 = tempUUID;
118 break; 120 break;
119 case 2: 121 case 2:
120 m_world.m_regInfo.estateSettings.terrainBase2 = tempUUID; 122 m_regInfo.estateSettings.terrainBase2 = tempUUID;
121 break; 123 break;
122 case 3: 124 case 3:
123 m_world.m_regInfo.estateSettings.terrainBase3 = tempUUID; 125 m_regInfo.estateSettings.terrainBase3 = tempUUID;
124 break; 126 break;
125 } 127 }
126 } 128 }
@@ -138,16 +140,16 @@ namespace OpenSim.world.Estate
138 switch (Convert.ToInt16(splitField[0])) 140 switch (Convert.ToInt16(splitField[0]))
139 { 141 {
140 case 0: 142 case 0:
141 m_world.m_regInfo.estateSettings.terrainDetail0 = tempUUID; 143 m_regInfo.estateSettings.terrainDetail0 = tempUUID;
142 break; 144 break;
143 case 1: 145 case 1:
144 m_world.m_regInfo.estateSettings.terrainDetail1 = tempUUID; 146 m_regInfo.estateSettings.terrainDetail1 = tempUUID;
145 break; 147 break;
146 case 2: 148 case 2:
147 m_world.m_regInfo.estateSettings.terrainDetail2 = tempUUID; 149 m_regInfo.estateSettings.terrainDetail2 = tempUUID;
148 break; 150 break;
149 case 3: 151 case 3:
150 m_world.m_regInfo.estateSettings.terrainDetail3 = tempUUID; 152 m_regInfo.estateSettings.terrainDetail3 = tempUUID;
151 break; 153 break;
152 } 154 }
153 } 155 }
@@ -168,20 +170,20 @@ namespace OpenSim.world.Estate
168 switch (Convert.ToInt16(splitField[0])) 170 switch (Convert.ToInt16(splitField[0]))
169 { 171 {
170 case 0: 172 case 0:
171 m_world.m_regInfo.estateSettings.terrainStartHeight0 = tempHeightLow; 173 m_regInfo.estateSettings.terrainStartHeight0 = tempHeightLow;
172 m_world.m_regInfo.estateSettings.terrainHeightRange0 = tempHeightHigh; 174 m_regInfo.estateSettings.terrainHeightRange0 = tempHeightHigh;
173 break; 175 break;
174 case 1: 176 case 1:
175 m_world.m_regInfo.estateSettings.terrainStartHeight1 = tempHeightLow; 177 m_regInfo.estateSettings.terrainStartHeight1 = tempHeightLow;
176 m_world.m_regInfo.estateSettings.terrainHeightRange1 = tempHeightHigh; 178 m_regInfo.estateSettings.terrainHeightRange1 = tempHeightHigh;
177 break; 179 break;
178 case 2: 180 case 2:
179 m_world.m_regInfo.estateSettings.terrainStartHeight2 = tempHeightLow; 181 m_regInfo.estateSettings.terrainStartHeight2 = tempHeightLow;
180 m_world.m_regInfo.estateSettings.terrainHeightRange2 = tempHeightHigh; 182 m_regInfo.estateSettings.terrainHeightRange2 = tempHeightHigh;
181 break; 183 break;
182 case 3: 184 case 3:
183 m_world.m_regInfo.estateSettings.terrainStartHeight3 = tempHeightLow; 185 m_regInfo.estateSettings.terrainStartHeight3 = tempHeightLow;
184 m_world.m_regInfo.estateSettings.terrainHeightRange3 = tempHeightHigh; 186 m_regInfo.estateSettings.terrainHeightRange3 = tempHeightHigh;
185 break; 187 break;
186 } 188 }
187 } 189 }
@@ -197,11 +199,11 @@ namespace OpenSim.world.Estate
197 } 199 }
198 else 200 else
199 { 201 {
200 m_world.m_regInfo.estateSettings.waterHeight = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[0].Parameter)); 202 m_regInfo.estateSettings.waterHeight = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[0].Parameter));
201 m_world.m_regInfo.estateSettings.terrainRaiseLimit = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[1].Parameter)); 203 m_regInfo.estateSettings.terrainRaiseLimit = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[1].Parameter));
202 m_world.m_regInfo.estateSettings.terrainLowerLimit = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[2].Parameter)); 204 m_regInfo.estateSettings.terrainLowerLimit = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[2].Parameter));
203 m_world.m_regInfo.estateSettings.useFixedSun = this.convertParamStringToBool(packet.ParamList[4].Parameter); 205 m_regInfo.estateSettings.useFixedSun = this.convertParamStringToBool(packet.ParamList[4].Parameter);
204 m_world.m_regInfo.estateSettings.sunHour = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[5].Parameter)); 206 m_regInfo.estateSettings.sunHour = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[5].Parameter));
205 207
206 sendRegionInfoPacketToAll(); 208 sendRegionInfoPacketToAll();
207 } 209 }
@@ -237,22 +239,22 @@ namespace OpenSim.world.Estate
237 RegionInfoPacket regionInfoPacket = new RegionInfoPacket(); 239 RegionInfoPacket regionInfoPacket = new RegionInfoPacket();
238 regionInfoPacket.AgentData.AgentID = circuitData.AgentID; 240 regionInfoPacket.AgentData.AgentID = circuitData.AgentID;
239 regionInfoPacket.AgentData.SessionID = circuitData.SessionID; 241 regionInfoPacket.AgentData.SessionID = circuitData.SessionID;
240 regionInfoPacket.RegionInfo.BillableFactor = m_world.m_regInfo.estateSettings.billableFactor; 242 regionInfoPacket.RegionInfo.BillableFactor = m_regInfo.estateSettings.billableFactor;
241 regionInfoPacket.RegionInfo.EstateID = m_world.m_regInfo.estateSettings.estateID; 243 regionInfoPacket.RegionInfo.EstateID = m_regInfo.estateSettings.estateID;
242 regionInfoPacket.RegionInfo.MaxAgents = m_world.m_regInfo.estateSettings.maxAgents; 244 regionInfoPacket.RegionInfo.MaxAgents = m_regInfo.estateSettings.maxAgents;
243 regionInfoPacket.RegionInfo.ObjectBonusFactor = m_world.m_regInfo.estateSettings.objectBonusFactor; 245 regionInfoPacket.RegionInfo.ObjectBonusFactor = m_regInfo.estateSettings.objectBonusFactor;
244 regionInfoPacket.RegionInfo.ParentEstateID = m_world.m_regInfo.estateSettings.parentEstateID; 246 regionInfoPacket.RegionInfo.ParentEstateID = m_regInfo.estateSettings.parentEstateID;
245 regionInfoPacket.RegionInfo.PricePerMeter = m_world.m_regInfo.estateSettings.pricePerMeter; 247 regionInfoPacket.RegionInfo.PricePerMeter = m_regInfo.estateSettings.pricePerMeter;
246 regionInfoPacket.RegionInfo.RedirectGridX = m_world.m_regInfo.estateSettings.redirectGridX; 248 regionInfoPacket.RegionInfo.RedirectGridX = m_regInfo.estateSettings.redirectGridX;
247 regionInfoPacket.RegionInfo.RedirectGridY = m_world.m_regInfo.estateSettings.redirectGridY; 249 regionInfoPacket.RegionInfo.RedirectGridY = m_regInfo.estateSettings.redirectGridY;
248 regionInfoPacket.RegionInfo.RegionFlags = (uint)m_world.m_regInfo.estateSettings.regionFlags; 250 regionInfoPacket.RegionInfo.RegionFlags = (uint)m_regInfo.estateSettings.regionFlags;
249 regionInfoPacket.RegionInfo.SimAccess = (byte)m_world.m_regInfo.estateSettings.simAccess; 251 regionInfoPacket.RegionInfo.SimAccess = (byte)m_regInfo.estateSettings.simAccess;
250 regionInfoPacket.RegionInfo.SimName = Helpers.StringToField(m_world.m_regInfo.RegionName); 252 regionInfoPacket.RegionInfo.SimName = Helpers.StringToField(m_regInfo.RegionName);
251 regionInfoPacket.RegionInfo.SunHour = m_world.m_regInfo.estateSettings.sunHour; 253 regionInfoPacket.RegionInfo.SunHour = m_regInfo.estateSettings.sunHour;
252 regionInfoPacket.RegionInfo.TerrainLowerLimit = m_world.m_regInfo.estateSettings.terrainLowerLimit; 254 regionInfoPacket.RegionInfo.TerrainLowerLimit = m_regInfo.estateSettings.terrainLowerLimit;
253 regionInfoPacket.RegionInfo.TerrainRaiseLimit = m_world.m_regInfo.estateSettings.terrainRaiseLimit; 255 regionInfoPacket.RegionInfo.TerrainRaiseLimit = m_regInfo.estateSettings.terrainRaiseLimit;
254 regionInfoPacket.RegionInfo.UseEstateSun = !m_world.m_regInfo.estateSettings.useFixedSun; 256 regionInfoPacket.RegionInfo.UseEstateSun = !m_regInfo.estateSettings.useFixedSun;
255 regionInfoPacket.RegionInfo.WaterHeight = m_world.m_regInfo.estateSettings.waterHeight; 257 regionInfoPacket.RegionInfo.WaterHeight = m_regInfo.estateSettings.waterHeight;
256 258
257 remote_client.OutPacket(regionInfoPacket); 259 remote_client.OutPacket(regionInfoPacket);
258 } 260 }
@@ -262,32 +264,32 @@ namespace OpenSim.world.Estate
262 System.Text.Encoding _enc = System.Text.Encoding.ASCII; 264 System.Text.Encoding _enc = System.Text.Encoding.ASCII;
263 RegionHandshakePacket handshake = new RegionHandshakePacket(); 265 RegionHandshakePacket handshake = new RegionHandshakePacket();
264 266
265 handshake.RegionInfo.BillableFactor = m_world.m_regInfo.estateSettings.billableFactor; 267 handshake.RegionInfo.BillableFactor = m_regInfo.estateSettings.billableFactor;
266 handshake.RegionInfo.IsEstateManager = false; 268 handshake.RegionInfo.IsEstateManager = false;
267 handshake.RegionInfo.TerrainHeightRange00 = m_world.m_regInfo.estateSettings.terrainHeightRange0; 269 handshake.RegionInfo.TerrainHeightRange00 = m_regInfo.estateSettings.terrainHeightRange0;
268 handshake.RegionInfo.TerrainHeightRange01 = m_world.m_regInfo.estateSettings.terrainHeightRange1; 270 handshake.RegionInfo.TerrainHeightRange01 = m_regInfo.estateSettings.terrainHeightRange1;
269 handshake.RegionInfo.TerrainHeightRange10 = m_world.m_regInfo.estateSettings.terrainHeightRange2; 271 handshake.RegionInfo.TerrainHeightRange10 = m_regInfo.estateSettings.terrainHeightRange2;
270 handshake.RegionInfo.TerrainHeightRange11 = m_world.m_regInfo.estateSettings.terrainHeightRange3; 272 handshake.RegionInfo.TerrainHeightRange11 = m_regInfo.estateSettings.terrainHeightRange3;
271 handshake.RegionInfo.TerrainStartHeight00 = m_world.m_regInfo.estateSettings.terrainStartHeight0; 273 handshake.RegionInfo.TerrainStartHeight00 = m_regInfo.estateSettings.terrainStartHeight0;
272 handshake.RegionInfo.TerrainStartHeight01 = m_world.m_regInfo.estateSettings.terrainStartHeight1; 274 handshake.RegionInfo.TerrainStartHeight01 = m_regInfo.estateSettings.terrainStartHeight1;
273 handshake.RegionInfo.TerrainStartHeight10 = m_world.m_regInfo.estateSettings.terrainStartHeight2; 275 handshake.RegionInfo.TerrainStartHeight10 = m_regInfo.estateSettings.terrainStartHeight2;
274 handshake.RegionInfo.TerrainStartHeight11 = m_world.m_regInfo.estateSettings.terrainStartHeight3; 276 handshake.RegionInfo.TerrainStartHeight11 = m_regInfo.estateSettings.terrainStartHeight3;
275 handshake.RegionInfo.SimAccess = (byte)m_world.m_regInfo.estateSettings.simAccess; 277 handshake.RegionInfo.SimAccess = (byte)m_regInfo.estateSettings.simAccess;
276 handshake.RegionInfo.WaterHeight = m_world.m_regInfo.estateSettings.waterHeight; 278 handshake.RegionInfo.WaterHeight = m_regInfo.estateSettings.waterHeight;
277 279
278 280
279 handshake.RegionInfo.RegionFlags = (uint)m_world.m_regInfo.estateSettings.regionFlags; 281 handshake.RegionInfo.RegionFlags = (uint)m_regInfo.estateSettings.regionFlags;
280 282
281 handshake.RegionInfo.SimName = _enc.GetBytes(m_world.m_regInfo.estateSettings.waterHeight + "\0"); 283 handshake.RegionInfo.SimName = _enc.GetBytes(m_regInfo.estateSettings.waterHeight + "\0");
282 handshake.RegionInfo.SimOwner = m_world.m_regInfo.MasterAvatarAssignedUUID; 284 handshake.RegionInfo.SimOwner = m_regInfo.MasterAvatarAssignedUUID;
283 handshake.RegionInfo.TerrainBase0 = m_world.m_regInfo.estateSettings.terrainBase0; 285 handshake.RegionInfo.TerrainBase0 = m_regInfo.estateSettings.terrainBase0;
284 handshake.RegionInfo.TerrainBase1 = m_world.m_regInfo.estateSettings.terrainBase1; 286 handshake.RegionInfo.TerrainBase1 = m_regInfo.estateSettings.terrainBase1;
285 handshake.RegionInfo.TerrainBase2 = m_world.m_regInfo.estateSettings.terrainBase2; 287 handshake.RegionInfo.TerrainBase2 = m_regInfo.estateSettings.terrainBase2;
286 handshake.RegionInfo.TerrainBase3 = m_world.m_regInfo.estateSettings.terrainBase3; 288 handshake.RegionInfo.TerrainBase3 = m_regInfo.estateSettings.terrainBase3;
287 handshake.RegionInfo.TerrainDetail0 = m_world.m_regInfo.estateSettings.terrainDetail0; 289 handshake.RegionInfo.TerrainDetail0 = m_regInfo.estateSettings.terrainDetail0;
288 handshake.RegionInfo.TerrainDetail1 = m_world.m_regInfo.estateSettings.terrainDetail1; 290 handshake.RegionInfo.TerrainDetail1 = m_regInfo.estateSettings.terrainDetail1;
289 handshake.RegionInfo.TerrainDetail2 = m_world.m_regInfo.estateSettings.terrainDetail2; 291 handshake.RegionInfo.TerrainDetail2 = m_regInfo.estateSettings.terrainDetail2;
290 handshake.RegionInfo.TerrainDetail3 = m_world.m_regInfo.estateSettings.terrainDetail3; 292 handshake.RegionInfo.TerrainDetail3 = m_regInfo.estateSettings.terrainDetail3;
291 handshake.RegionInfo.CacheID = LLUUID.Random(); //I guess this is for the client to remember an old setting? 293 handshake.RegionInfo.CacheID = LLUUID.Random(); //I guess this is for the client to remember an old setting?
292 294
293 remote_client.OutPacket(handshake); 295 remote_client.OutPacket(handshake);