diff options
Diffstat (limited to 'OpenSim/Region/Environment/LandManagement/Land.cs')
-rw-r--r-- | OpenSim/Region/Environment/LandManagement/Land.cs | 101 |
1 files changed, 100 insertions, 1 deletions
diff --git a/OpenSim/Region/Environment/LandManagement/Land.cs b/OpenSim/Region/Environment/LandManagement/Land.cs index a738bc0..791b3ea 100644 --- a/OpenSim/Region/Environment/LandManagement/Land.cs +++ b/OpenSim/Region/Environment/LandManagement/Land.cs | |||
@@ -47,7 +47,7 @@ namespace OpenSim.Region.Environment.LandManagement | |||
47 | 47 | ||
48 | public LandData landData = new LandData(); | 48 | public LandData landData = new LandData(); |
49 | public List<SceneObjectGroup> primsOverMe = new List<SceneObjectGroup>(); | 49 | public List<SceneObjectGroup> primsOverMe = new List<SceneObjectGroup>(); |
50 | 50 | public List<libsecondlife.ParcelManager.ParcelAccessEntry> parcelAccessList = new List<ParcelManager.ParcelAccessEntry>(); | |
51 | public Scene m_scene; | 51 | public Scene m_scene; |
52 | 52 | ||
53 | private bool[,] landBitmap = new bool[64,64]; | 53 | private bool[,] landBitmap = new bool[64,64]; |
@@ -242,6 +242,105 @@ namespace OpenSim.Region.Environment.LandManagement | |||
242 | 242 | ||
243 | #endregion | 243 | #endregion |
244 | 244 | ||
245 | #region AccessList Functions | ||
246 | |||
247 | public ParcelAccessListReplyPacket.ListBlock[] createAccessListArrayByFlag(ParcelManager.AccessList flag) | ||
248 | { | ||
249 | List<ParcelAccessListReplyPacket.ListBlock> list = new List<ParcelAccessListReplyPacket.ListBlock>(); | ||
250 | foreach (ParcelManager.ParcelAccessEntry entry in parcelAccessList) | ||
251 | { | ||
252 | if (entry.Flags == flag) | ||
253 | { | ||
254 | ParcelAccessListReplyPacket.ListBlock listBlock = new ParcelAccessListReplyPacket.ListBlock(); | ||
255 | |||
256 | listBlock.Flags = (uint)0; | ||
257 | listBlock.ID = entry.AgentID; | ||
258 | listBlock.Time = 0; | ||
259 | |||
260 | list.Add(listBlock); | ||
261 | } | ||
262 | } | ||
263 | |||
264 | if (list.Count == 0) | ||
265 | { | ||
266 | ParcelAccessListReplyPacket.ListBlock listBlock = new ParcelAccessListReplyPacket.ListBlock(); | ||
267 | |||
268 | listBlock.Flags = (uint)0; | ||
269 | listBlock.ID = LLUUID.Zero; | ||
270 | listBlock.Time = 0; | ||
271 | |||
272 | list.Add(listBlock); | ||
273 | } | ||
274 | return list.ToArray(); | ||
275 | } | ||
276 | |||
277 | public void sendAccessList(LLUUID agentID, LLUUID sessionID, uint flags, int sequenceID, IClientAPI remote_client) | ||
278 | { | ||
279 | |||
280 | ParcelAccessListReplyPacket replyPacket; | ||
281 | |||
282 | if (flags == (uint)ParcelManager.AccessList.Access || flags == (uint)ParcelManager.AccessList.Both) | ||
283 | { | ||
284 | replyPacket = new ParcelAccessListReplyPacket(); | ||
285 | replyPacket.Data.AgentID = agentID; | ||
286 | replyPacket.Data.Flags = (uint)ParcelManager.AccessList.Access; | ||
287 | replyPacket.Data.LocalID = this.landData.localID; | ||
288 | replyPacket.Data.SequenceID = 0; | ||
289 | |||
290 | replyPacket.List = createAccessListArrayByFlag(ParcelManager.AccessList.Access); | ||
291 | remote_client.OutPacket((Packet)replyPacket, ThrottleOutPacketType.Task); | ||
292 | } | ||
293 | |||
294 | if (flags == (uint)ParcelManager.AccessList.Ban || flags == (uint)ParcelManager.AccessList.Both) | ||
295 | { | ||
296 | replyPacket = new ParcelAccessListReplyPacket(); | ||
297 | replyPacket.Data.AgentID = agentID; | ||
298 | replyPacket.Data.Flags = (uint)ParcelManager.AccessList.Ban; | ||
299 | replyPacket.Data.LocalID = this.landData.localID; | ||
300 | replyPacket.Data.SequenceID = 0; | ||
301 | |||
302 | replyPacket.List = createAccessListArrayByFlag(ParcelManager.AccessList.Ban); | ||
303 | remote_client.OutPacket((Packet)replyPacket, ThrottleOutPacketType.Task); | ||
304 | } | ||
305 | |||
306 | } | ||
307 | |||
308 | public void updateAccessList(uint flags, List<ParcelManager.ParcelAccessEntry> entries, IClientAPI remote_client) | ||
309 | { | ||
310 | if (entries.Count == 1 && entries[0].AgentID == LLUUID.Zero) | ||
311 | { | ||
312 | entries.Clear(); | ||
313 | } | ||
314 | |||
315 | List<ParcelManager.ParcelAccessEntry> toRemove = new List<ParcelManager.ParcelAccessEntry>(); | ||
316 | foreach (ParcelManager.ParcelAccessEntry entry in parcelAccessList) | ||
317 | { | ||
318 | if (entry.Flags == (ParcelManager.AccessList)flags) | ||
319 | { | ||
320 | toRemove.Add(entry); | ||
321 | } | ||
322 | } | ||
323 | |||
324 | foreach (ParcelManager.ParcelAccessEntry entry in toRemove) | ||
325 | { | ||
326 | parcelAccessList.Remove(entry); | ||
327 | } | ||
328 | foreach (ParcelManager.ParcelAccessEntry entry in entries) | ||
329 | { | ||
330 | ParcelManager.ParcelAccessEntry temp = new ParcelManager.ParcelAccessEntry(); | ||
331 | temp.AgentID = entry.AgentID; | ||
332 | temp.Time = new DateTime() ; //Pointless? Yes. | ||
333 | temp.Flags = (ParcelManager.AccessList)flags; | ||
334 | |||
335 | if (!this.parcelAccessList.Contains(temp)) | ||
336 | { | ||
337 | this.parcelAccessList.Add(temp); | ||
338 | } | ||
339 | } | ||
340 | } | ||
341 | |||
342 | #endregion | ||
343 | |||
245 | #region Update Functions | 344 | #region Update Functions |
246 | 345 | ||
247 | /// <summary> | 346 | /// <summary> |