diff options
author | mingchen | 2007-12-16 19:53:27 +0000 |
---|---|---|
committer | mingchen | 2007-12-16 19:53:27 +0000 |
commit | e2ed1a4e1f2776e5b929207f1ca6e271a4d6f6e1 (patch) | |
tree | b309a467295e79cb133d1b4daffac3e2dd30af27 /OpenSim/Region/Environment | |
parent | Reposition 'user profile not found' messages to stop spurious messages caused... (diff) | |
download | opensim-SC-e2ed1a4e1f2776e5b929207f1ca6e271a4d6f6e1.zip opensim-SC-e2ed1a4e1f2776e5b929207f1ca6e271a4d6f6e1.tar.gz opensim-SC-e2ed1a4e1f2776e5b929207f1ca6e271a4d6f6e1.tar.bz2 opensim-SC-e2ed1a4e1f2776e5b929207f1ca6e271a4d6f6e1.tar.xz |
*Adding and Removing Avatars from the Access/Ban List for a parcel now works, but the actual ban lines, etc are not done.
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r-- | OpenSim/Region/Environment/LandManagement/Land.cs | 101 | ||||
-rw-r--r-- | OpenSim/Region/Environment/LandManagement/LandManager.cs | 24 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 2 |
3 files changed, 126 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> |
diff --git a/OpenSim/Region/Environment/LandManagement/LandManager.cs b/OpenSim/Region/Environment/LandManagement/LandManager.cs index c0fa296..0fa2c23 100644 --- a/OpenSim/Region/Environment/LandManagement/LandManager.cs +++ b/OpenSim/Region/Environment/LandManagement/LandManager.cs | |||
@@ -554,6 +554,30 @@ namespace OpenSim.Region.Environment.LandManagement | |||
554 | } | 554 | } |
555 | } | 555 | } |
556 | 556 | ||
557 | |||
558 | public void handleParcelAccessRequest(LLUUID agentID, LLUUID sessionID, uint flags, int sequenceID, int landLocalID, IClientAPI remote_client) | ||
559 | { | ||
560 | if (landList.ContainsKey(landLocalID)) | ||
561 | { | ||
562 | landList[landLocalID].sendAccessList(agentID, sessionID, flags, sequenceID,remote_client); | ||
563 | } | ||
564 | } | ||
565 | |||
566 | public void handleParcelAccessUpdateRequest(LLUUID agentID, LLUUID sessionID,uint flags, int landLocalID, List<libsecondlife.ParcelManager.ParcelAccessEntry> entries, IClientAPI remote_client) | ||
567 | { | ||
568 | if (landList.ContainsKey(landLocalID)) | ||
569 | { | ||
570 | if (agentID == landList[landLocalID].landData.ownerID) | ||
571 | { | ||
572 | landList[landLocalID].updateAccessList(flags, entries, remote_client); | ||
573 | } | ||
574 | } | ||
575 | else | ||
576 | { | ||
577 | Console.WriteLine("INVALID LOCAL LAND ID"); | ||
578 | } | ||
579 | } | ||
580 | |||
557 | public void resetAllLandPrimCounts() | 581 | public void resetAllLandPrimCounts() |
558 | { | 582 | { |
559 | foreach (Land p in landList.Values) | 583 | foreach (Land p in landList.Values) |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index aad977a..828cb75 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -1093,6 +1093,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
1093 | client.OnParcelSelectObjects += new ParcelSelectObjects(m_LandManager.handleParcelSelectObjectsRequest); | 1093 | client.OnParcelSelectObjects += new ParcelSelectObjects(m_LandManager.handleParcelSelectObjectsRequest); |
1094 | client.OnParcelObjectOwnerRequest += | 1094 | client.OnParcelObjectOwnerRequest += |
1095 | new ParcelObjectOwnerRequest(m_LandManager.handleParcelObjectOwnersRequest); | 1095 | new ParcelObjectOwnerRequest(m_LandManager.handleParcelObjectOwnersRequest); |
1096 | client.OnParcelAccessListRequest += new ParcelAccessListRequest(m_LandManager.handleParcelAccessRequest); | ||
1097 | client.OnParcelAccessListUpdateRequest += new ParcelAccessListUpdateRequest(m_LandManager.handleParcelAccessUpdateRequest); | ||
1096 | 1098 | ||
1097 | client.OnEstateOwnerMessage += new EstateOwnerMessageRequest(m_estateManager.handleEstateOwnerMessage); | 1099 | client.OnEstateOwnerMessage += new EstateOwnerMessageRequest(m_estateManager.handleEstateOwnerMessage); |
1098 | client.OnRequestGodlikePowers += handleRequestGodlikePowers; | 1100 | client.OnRequestGodlikePowers += handleRequestGodlikePowers; |