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 | |
parent | Reposition 'user profile not found' messages to stop spurious messages caused... (diff) | |
download | opensim-SC_OLD-e2ed1a4e1f2776e5b929207f1ca6e271a4d6f6e1.zip opensim-SC_OLD-e2ed1a4e1f2776e5b929207f1ca6e271a4d6f6e1.tar.gz opensim-SC_OLD-e2ed1a4e1f2776e5b929207f1ca6e271a4d6f6e1.tar.bz2 opensim-SC_OLD-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')
-rw-r--r-- | OpenSim/Region/ClientStack/ClientView.cs | 36 | ||||
-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 | ||||
-rw-r--r-- | OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs | 2 |
5 files changed, 158 insertions, 7 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index 065e5e0..41e44a5 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs | |||
@@ -516,6 +516,8 @@ namespace OpenSim.Region.ClientStack | |||
516 | 516 | ||
517 | public event UUIDNameRequest OnNameFromUUIDRequest; | 517 | public event UUIDNameRequest OnNameFromUUIDRequest; |
518 | 518 | ||
519 | public event ParcelAccessListRequest OnParcelAccessListRequest; | ||
520 | public event ParcelAccessListUpdateRequest OnParcelAccessListUpdateRequest; | ||
519 | public event ParcelPropertiesRequest OnParcelPropertiesRequest; | 521 | public event ParcelPropertiesRequest OnParcelPropertiesRequest; |
520 | public event ParcelDivideRequest OnParcelDivideRequest; | 522 | public event ParcelDivideRequest OnParcelDivideRequest; |
521 | public event ParcelJoinRequest OnParcelJoinRequest; | 523 | public event ParcelJoinRequest OnParcelJoinRequest; |
@@ -3117,8 +3119,33 @@ namespace OpenSim.Region.ClientStack | |||
3117 | break; | 3119 | break; |
3118 | 3120 | ||
3119 | #region Parcel related packets | 3121 | #region Parcel related packets |
3122 | case PacketType.ParcelAccessListRequest: | ||
3123 | ParcelAccessListRequestPacket requestPacket = (ParcelAccessListRequestPacket)Pack; | ||
3124 | if (OnParcelAccessListRequest != null) | ||
3125 | { | ||
3126 | OnParcelAccessListRequest(requestPacket.AgentData.AgentID, requestPacket.AgentData.SessionID, requestPacket.Data.Flags, requestPacket.Data.SequenceID, requestPacket.Data.LocalID,this); | ||
3127 | } | ||
3128 | break; | ||
3120 | 3129 | ||
3130 | case PacketType.ParcelAccessListUpdate: | ||
3131 | ParcelAccessListUpdatePacket updatePacket = (ParcelAccessListUpdatePacket)Pack; | ||
3132 | List<ParcelManager.ParcelAccessEntry> entries = new List<ParcelManager.ParcelAccessEntry>(); | ||
3133 | foreach (ParcelAccessListUpdatePacket.ListBlock block in updatePacket.List) | ||
3134 | { | ||
3135 | ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); | ||
3136 | entry.AgentID = block.ID; | ||
3137 | entry.Flags = (ParcelManager.AccessList)block.Flags; | ||
3138 | entry.Time = new DateTime(); | ||
3139 | entries.Add(entry); | ||
3140 | } | ||
3141 | |||
3142 | if (OnParcelAccessListUpdateRequest != null) | ||
3143 | { | ||
3144 | OnParcelAccessListUpdateRequest(updatePacket.AgentData.AgentID, updatePacket.AgentData.SessionID, updatePacket.Data.Flags, updatePacket.Data.LocalID, entries, this); | ||
3145 | } | ||
3146 | break; | ||
3121 | case PacketType.ParcelPropertiesRequest: | 3147 | case PacketType.ParcelPropertiesRequest: |
3148 | |||
3122 | ParcelPropertiesRequestPacket propertiesRequest = (ParcelPropertiesRequestPacket) Pack; | 3149 | ParcelPropertiesRequestPacket propertiesRequest = (ParcelPropertiesRequestPacket) Pack; |
3123 | if (OnParcelPropertiesRequest != null) | 3150 | if (OnParcelPropertiesRequest != null) |
3124 | { | 3151 | { |
@@ -3151,10 +3178,10 @@ namespace OpenSim.Region.ClientStack | |||
3151 | } | 3178 | } |
3152 | break; | 3179 | break; |
3153 | case PacketType.ParcelPropertiesUpdate: | 3180 | case PacketType.ParcelPropertiesUpdate: |
3154 | ParcelPropertiesUpdatePacket updatePacket = (ParcelPropertiesUpdatePacket) Pack; | 3181 | ParcelPropertiesUpdatePacket parcelPropertiesPacket = (ParcelPropertiesUpdatePacket) Pack; |
3155 | if (OnParcelPropertiesUpdateRequest != null) | 3182 | if (OnParcelPropertiesUpdateRequest != null) |
3156 | { | 3183 | { |
3157 | OnParcelPropertiesUpdateRequest(updatePacket, this); | 3184 | OnParcelPropertiesUpdateRequest(parcelPropertiesPacket, this); |
3158 | } | 3185 | } |
3159 | break; | 3186 | break; |
3160 | case PacketType.ParcelSelectObjects: | 3187 | case PacketType.ParcelSelectObjects: |
@@ -3283,10 +3310,7 @@ namespace OpenSim.Region.ClientStack | |||
3283 | // TODO: handle this packet | 3310 | // TODO: handle this packet |
3284 | MainLog.Instance.Warn("CLIENT", "unhandled AgentDataUpdateRequest packet"); | 3311 | MainLog.Instance.Warn("CLIENT", "unhandled AgentDataUpdateRequest packet"); |
3285 | break; | 3312 | break; |
3286 | case PacketType.ParcelAccessListRequest: | 3313 | |
3287 | // TODO: handle this packet | ||
3288 | MainLog.Instance.Warn("CLIENT", "unhandled ParcelAccessListRequest packet"); | ||
3289 | break; | ||
3290 | case PacketType.ParcelDwellRequest: | 3314 | case PacketType.ParcelDwellRequest: |
3291 | // TODO: handle this packet | 3315 | // TODO: handle this packet |
3292 | MainLog.Instance.Warn("CLIENT", "unhandled ParcelDwellRequest packet"); | 3316 | MainLog.Instance.Warn("CLIENT", "unhandled ParcelDwellRequest packet"); |
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; |
diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs index 9b2cdda..505d0bb 100644 --- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs | |||
@@ -131,6 +131,8 @@ namespace SimpleApp | |||
131 | public event ParcelJoinRequest OnParcelJoinRequest; | 131 | public event ParcelJoinRequest OnParcelJoinRequest; |
132 | public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; | 132 | public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; |
133 | 133 | ||
134 | public event ParcelAccessListRequest OnParcelAccessListRequest; | ||
135 | public event ParcelAccessListUpdateRequest OnParcelAccessListUpdateRequest; | ||
134 | public event ParcelSelectObjects OnParcelSelectObjects; | 136 | public event ParcelSelectObjects OnParcelSelectObjects; |
135 | public event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest; | 137 | public event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest; |
136 | public event ObjectDeselect OnObjectDeselect; | 138 | public event ObjectDeselect OnObjectDeselect; |