diff options
Diffstat (limited to 'OpenSim/Region')
10 files changed, 163 insertions, 81 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index a7bf06d..cdd4957 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -4623,7 +4623,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4623 | } | 4623 | } |
4624 | } | 4624 | } |
4625 | 4625 | ||
4626 | public void SendLandAccessListData(List<UUID> avatars, uint accessFlag, int localLandID) | 4626 | public void SendLandAccessListData(List<LandAccessEntry> accessList, uint accessFlag, int localLandID) |
4627 | { | 4627 | { |
4628 | ParcelAccessListReplyPacket replyPacket = (ParcelAccessListReplyPacket)PacketPool.Instance.GetPacket(PacketType.ParcelAccessListReply); | 4628 | ParcelAccessListReplyPacket replyPacket = (ParcelAccessListReplyPacket)PacketPool.Instance.GetPacket(PacketType.ParcelAccessListReply); |
4629 | replyPacket.Data.AgentID = AgentId; | 4629 | replyPacket.Data.AgentID = AgentId; |
@@ -4632,12 +4632,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4632 | replyPacket.Data.SequenceID = 0; | 4632 | replyPacket.Data.SequenceID = 0; |
4633 | 4633 | ||
4634 | List<ParcelAccessListReplyPacket.ListBlock> list = new List<ParcelAccessListReplyPacket.ListBlock>(); | 4634 | List<ParcelAccessListReplyPacket.ListBlock> list = new List<ParcelAccessListReplyPacket.ListBlock>(); |
4635 | foreach (UUID avatar in avatars) | 4635 | foreach (LandAccessEntry entry in accessList) |
4636 | { | 4636 | { |
4637 | ParcelAccessListReplyPacket.ListBlock block = new ParcelAccessListReplyPacket.ListBlock(); | 4637 | ParcelAccessListReplyPacket.ListBlock block = new ParcelAccessListReplyPacket.ListBlock(); |
4638 | block.Flags = accessFlag; | 4638 | block.Flags = accessFlag; |
4639 | block.ID = avatar; | 4639 | block.ID = entry.AgentID; |
4640 | block.Time = 0; | 4640 | block.Time = entry.Expires; |
4641 | list.Add(block); | 4641 | list.Add(block); |
4642 | } | 4642 | } |
4643 | 4643 | ||
@@ -8577,13 +8577,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8577 | } | 8577 | } |
8578 | #endregion | 8578 | #endregion |
8579 | 8579 | ||
8580 | List<ParcelManager.ParcelAccessEntry> entries = new List<ParcelManager.ParcelAccessEntry>(); | 8580 | List<LandAccessEntry> entries = new List<LandAccessEntry>(); |
8581 | foreach (ParcelAccessListUpdatePacket.ListBlock block in updatePacket.List) | 8581 | foreach (ParcelAccessListUpdatePacket.ListBlock block in updatePacket.List) |
8582 | { | 8582 | { |
8583 | ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); | 8583 | LandAccessEntry entry = new LandAccessEntry(); |
8584 | entry.AgentID = block.ID; | 8584 | entry.AgentID = block.ID; |
8585 | entry.Flags = (AccessList)block.Flags; | 8585 | entry.Flags = (AccessList)block.Flags; |
8586 | entry.Time = Util.ToDateTime(block.Time); | 8586 | entry.Expires = block.Time; |
8587 | entries.Add(entry); | 8587 | entries.Add(entry); |
8588 | } | 8588 | } |
8589 | 8589 | ||
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 94bba83..1c503aa 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -550,7 +550,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
550 | 550 | ||
551 | public void ClientOnParcelAccessListUpdateRequest(UUID agentID, | 551 | public void ClientOnParcelAccessListUpdateRequest(UUID agentID, |
552 | uint flags, int landLocalID, UUID transactionID, int sequenceID, | 552 | uint flags, int landLocalID, UUID transactionID, int sequenceID, |
553 | int sections, List<ParcelManager.ParcelAccessEntry> entries, | 553 | int sections, List<LandAccessEntry> entries, |
554 | IClientAPI remote_client) | 554 | IClientAPI remote_client) |
555 | { | 555 | { |
556 | // Flags is the list to update, it can mean either the ban or | 556 | // Flags is the list to update, it can mean either the ban or |
@@ -1712,4 +1712,4 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1712 | MainConsole.Instance.Output(report.ToString()); | 1712 | MainConsole.Instance.Output(report.ToString()); |
1713 | } | 1713 | } |
1714 | } | 1714 | } |
1715 | } \ No newline at end of file | 1715 | } |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 79b13c3..3b4336f 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs | |||
@@ -418,13 +418,21 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
418 | 418 | ||
419 | public bool IsBannedFromLand(UUID avatar) | 419 | public bool IsBannedFromLand(UUID avatar) |
420 | { | 420 | { |
421 | if (m_scene.Permissions.CanEditParcelProperties(avatar, this, 0)) | 421 | ExpireAccessList(); |
422 | |||
423 | if (m_scene.Permissions.IsAdministrator(avatar)) | ||
424 | return false; | ||
425 | |||
426 | if (m_scene.RegionInfo.EstateSettings.IsEstateManager(avatar)) | ||
427 | return false; | ||
428 | |||
429 | if (avatar == LandData.OwnerID) | ||
422 | return false; | 430 | return false; |
423 | 431 | ||
424 | if ((LandData.Flags & (uint) ParcelFlags.UseBanList) > 0) | 432 | if ((LandData.Flags & (uint) ParcelFlags.UseBanList) > 0) |
425 | { | 433 | { |
426 | if (LandData.ParcelAccessList.FindIndex( | 434 | if (LandData.ParcelAccessList.FindIndex( |
427 | delegate(ParcelManager.ParcelAccessEntry e) | 435 | delegate(LandAccessEntry e) |
428 | { | 436 | { |
429 | if (e.AgentID == avatar && e.Flags == AccessList.Ban) | 437 | if (e.AgentID == avatar && e.Flags == AccessList.Ban) |
430 | return true; | 438 | return true; |
@@ -439,13 +447,21 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
439 | 447 | ||
440 | public bool IsRestrictedFromLand(UUID avatar) | 448 | public bool IsRestrictedFromLand(UUID avatar) |
441 | { | 449 | { |
442 | if (m_scene.Permissions.CanEditParcelProperties(avatar, this, 0)) | 450 | ExpireAccessList(); |
451 | |||
452 | if (m_scene.Permissions.IsAdministrator(avatar)) | ||
453 | return false; | ||
454 | |||
455 | if (m_scene.RegionInfo.EstateSettings.IsEstateManager(avatar)) | ||
456 | return false; | ||
457 | |||
458 | if (avatar == LandData.OwnerID) | ||
443 | return false; | 459 | return false; |
444 | 460 | ||
445 | if ((LandData.Flags & (uint) ParcelFlags.UseAccessList) > 0) | 461 | if ((LandData.Flags & (uint) ParcelFlags.UseAccessList) > 0) |
446 | { | 462 | { |
447 | if (LandData.ParcelAccessList.FindIndex( | 463 | if (LandData.ParcelAccessList.FindIndex( |
448 | delegate(ParcelManager.ParcelAccessEntry e) | 464 | delegate(LandAccessEntry e) |
449 | { | 465 | { |
450 | if (e.AgentID == avatar && e.Flags == AccessList.Access) | 466 | if (e.AgentID == avatar && e.Flags == AccessList.Access) |
451 | return true; | 467 | return true; |
@@ -511,19 +527,24 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
511 | 527 | ||
512 | #region AccessList Functions | 528 | #region AccessList Functions |
513 | 529 | ||
514 | public List<UUID> CreateAccessListArrayByFlag(AccessList flag) | 530 | public List<LandAccessEntry> CreateAccessListArrayByFlag(AccessList flag) |
515 | { | 531 | { |
516 | List<UUID> list = new List<UUID>(); | 532 | ExpireAccessList(); |
517 | foreach (ParcelManager.ParcelAccessEntry entry in LandData.ParcelAccessList) | 533 | |
534 | List<LandAccessEntry> list = new List<LandAccessEntry>(); | ||
535 | foreach (LandAccessEntry entry in LandData.ParcelAccessList) | ||
518 | { | 536 | { |
519 | if (entry.Flags == flag) | 537 | if (entry.Flags == flag) |
520 | { | 538 | list.Add(entry); |
521 | list.Add(entry.AgentID); | ||
522 | } | ||
523 | } | 539 | } |
524 | if (list.Count == 0) | 540 | if (list.Count == 0) |
525 | { | 541 | { |
526 | list.Add(UUID.Zero); | 542 | LandAccessEntry e = new LandAccessEntry(); |
543 | e.AgentID = UUID.Zero; | ||
544 | e.Flags = 0; | ||
545 | e.Expires = 0; | ||
546 | |||
547 | list.Add(e); | ||
527 | } | 548 | } |
528 | 549 | ||
529 | return list; | 550 | return list; |
@@ -535,20 +556,20 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
535 | 556 | ||
536 | if (flags == (uint) AccessList.Access || flags == (uint) AccessList.Both) | 557 | if (flags == (uint) AccessList.Access || flags == (uint) AccessList.Both) |
537 | { | 558 | { |
538 | List<UUID> avatars = CreateAccessListArrayByFlag(AccessList.Access); | 559 | List<LandAccessEntry> accessEntries = CreateAccessListArrayByFlag(AccessList.Access); |
539 | remote_client.SendLandAccessListData(avatars,(uint) AccessList.Access,LandData.LocalID); | 560 | remote_client.SendLandAccessListData(accessEntries,(uint) AccessList.Access,LandData.LocalID); |
540 | } | 561 | } |
541 | 562 | ||
542 | if (flags == (uint) AccessList.Ban || flags == (uint) AccessList.Both) | 563 | if (flags == (uint) AccessList.Ban || flags == (uint) AccessList.Both) |
543 | { | 564 | { |
544 | List<UUID> avatars = CreateAccessListArrayByFlag(AccessList.Ban); | 565 | List<LandAccessEntry> accessEntries = CreateAccessListArrayByFlag(AccessList.Ban); |
545 | remote_client.SendLandAccessListData(avatars, (uint)AccessList.Ban, LandData.LocalID); | 566 | remote_client.SendLandAccessListData(accessEntries, (uint)AccessList.Ban, LandData.LocalID); |
546 | } | 567 | } |
547 | } | 568 | } |
548 | 569 | ||
549 | public void UpdateAccessList(uint flags, UUID transactionID, | 570 | public void UpdateAccessList(uint flags, UUID transactionID, |
550 | int sequenceID, int sections, | 571 | int sequenceID, int sections, |
551 | List<ParcelManager.ParcelAccessEntry> entries, | 572 | List<LandAccessEntry> entries, |
552 | IClientAPI remote_client) | 573 | IClientAPI remote_client) |
553 | { | 574 | { |
554 | LandData newData = LandData.Copy(); | 575 | LandData newData = LandData.Copy(); |
@@ -558,16 +579,16 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
558 | { | 579 | { |
559 | m_listTransactions[flags] = transactionID; | 580 | m_listTransactions[flags] = transactionID; |
560 | 581 | ||
561 | List<ParcelManager.ParcelAccessEntry> toRemove = | 582 | List<LandAccessEntry> toRemove = |
562 | new List<ParcelManager.ParcelAccessEntry>(); | 583 | new List<LandAccessEntry>(); |
563 | 584 | ||
564 | foreach (ParcelManager.ParcelAccessEntry entry in newData.ParcelAccessList) | 585 | foreach (LandAccessEntry entry in newData.ParcelAccessList) |
565 | { | 586 | { |
566 | if (entry.Flags == (AccessList)flags) | 587 | if (entry.Flags == (AccessList)flags) |
567 | toRemove.Add(entry); | 588 | toRemove.Add(entry); |
568 | } | 589 | } |
569 | 590 | ||
570 | foreach (ParcelManager.ParcelAccessEntry entry in toRemove) | 591 | foreach (LandAccessEntry entry in toRemove) |
571 | { | 592 | { |
572 | newData.ParcelAccessList.Remove(entry); | 593 | newData.ParcelAccessList.Remove(entry); |
573 | } | 594 | } |
@@ -582,13 +603,13 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
582 | } | 603 | } |
583 | } | 604 | } |
584 | 605 | ||
585 | foreach (ParcelManager.ParcelAccessEntry entry in entries) | 606 | foreach (LandAccessEntry entry in entries) |
586 | { | 607 | { |
587 | ParcelManager.ParcelAccessEntry temp = | 608 | LandAccessEntry temp = |
588 | new ParcelManager.ParcelAccessEntry(); | 609 | new LandAccessEntry(); |
589 | 610 | ||
590 | temp.AgentID = entry.AgentID; | 611 | temp.AgentID = entry.AgentID; |
591 | temp.Time = entry.Time; | 612 | temp.Expires = entry.Expires; |
592 | temp.Flags = (AccessList)flags; | 613 | temp.Flags = (AccessList)flags; |
593 | 614 | ||
594 | newData.ParcelAccessList.Add(temp); | 615 | newData.ParcelAccessList.Add(temp); |
@@ -1105,5 +1126,20 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
1105 | } | 1126 | } |
1106 | 1127 | ||
1107 | #endregion | 1128 | #endregion |
1129 | |||
1130 | private void ExpireAccessList() | ||
1131 | { | ||
1132 | List<LandAccessEntry> delete = new List<LandAccessEntry>(); | ||
1133 | |||
1134 | foreach (LandAccessEntry entry in LandData.ParcelAccessList) | ||
1135 | { | ||
1136 | if (entry.Expires != 0 && entry.Expires < Util.UnixTimeSinceEpoch()) | ||
1137 | delete.Add(entry); | ||
1138 | } | ||
1139 | foreach (LandAccessEntry entry in delete) | ||
1140 | LandData.ParcelAccessList.Remove(entry); | ||
1141 | |||
1142 | m_scene.EventManager.TriggerLandObjectUpdated((uint)LandData.LocalID, this); | ||
1143 | } | ||
1108 | } | 1144 | } |
1109 | } | 1145 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index daddb90..0c36dcd 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -307,14 +307,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
307 | else | 307 | else |
308 | { | 308 | { |
309 | if (m_part.ParentGroup.m_savedScriptState != null) | 309 | if (m_part.ParentGroup.m_savedScriptState != null) |
310 | RestoreSavedScriptState(item.OldItemID, item.ItemID); | 310 | item.OldItemID = RestoreSavedScriptState(item.LoadedItemID, item.OldItemID, item.ItemID); |
311 | 311 | ||
312 | lock (m_items) | 312 | lock (m_items) |
313 | { | 313 | { |
314 | m_items[item.ItemID].OldItemID = item.OldItemID; | ||
314 | m_items[item.ItemID].PermsMask = 0; | 315 | m_items[item.ItemID].PermsMask = 0; |
315 | m_items[item.ItemID].PermsGranter = UUID.Zero; | 316 | m_items[item.ItemID].PermsGranter = UUID.Zero; |
316 | } | 317 | } |
317 | 318 | ||
318 | string script = Utils.BytesToString(asset.Data); | 319 | string script = Utils.BytesToString(asset.Data); |
319 | m_part.ParentGroup.Scene.EventManager.TriggerRezScript( | 320 | m_part.ParentGroup.Scene.EventManager.TriggerRezScript( |
320 | m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource); | 321 | m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource); |
@@ -324,17 +325,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
324 | } | 325 | } |
325 | } | 326 | } |
326 | 327 | ||
327 | private void RestoreSavedScriptState(UUID oldID, UUID newID) | 328 | private UUID RestoreSavedScriptState(UUID loadedID, UUID oldID, UUID newID) |
328 | { | 329 | { |
329 | IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>(); | 330 | IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>(); |
330 | if (engines.Length == 0) // No engine at all | 331 | if (engines.Length == 0) // No engine at all |
331 | return; | 332 | return oldID; |
332 | 333 | ||
333 | if (m_part.ParentGroup.m_savedScriptState.ContainsKey(oldID)) | 334 | UUID stateID = oldID; |
335 | if (!m_part.ParentGroup.m_savedScriptState.ContainsKey(oldID)) | ||
336 | stateID = loadedID; | ||
337 | if (m_part.ParentGroup.m_savedScriptState.ContainsKey(stateID)) | ||
334 | { | 338 | { |
335 | XmlDocument doc = new XmlDocument(); | 339 | XmlDocument doc = new XmlDocument(); |
336 | 340 | ||
337 | doc.LoadXml(m_part.ParentGroup.m_savedScriptState[oldID]); | 341 | doc.LoadXml(m_part.ParentGroup.m_savedScriptState[stateID]); |
338 | 342 | ||
339 | ////////// CRUFT WARNING /////////////////////////////////// | 343 | ////////// CRUFT WARNING /////////////////////////////////// |
340 | // | 344 | // |
@@ -351,7 +355,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
351 | 355 | ||
352 | XmlElement rootN = newDoc.CreateElement("", "State", ""); | 356 | XmlElement rootN = newDoc.CreateElement("", "State", ""); |
353 | XmlAttribute uuidA = newDoc.CreateAttribute("", "UUID", ""); | 357 | XmlAttribute uuidA = newDoc.CreateAttribute("", "UUID", ""); |
354 | uuidA.Value = oldID.ToString(); | 358 | uuidA.Value = stateID.ToString(); |
355 | rootN.Attributes.Append(uuidA); | 359 | rootN.Attributes.Append(uuidA); |
356 | XmlAttribute engineA = newDoc.CreateAttribute("", "Engine", ""); | 360 | XmlAttribute engineA = newDoc.CreateAttribute("", "Engine", ""); |
357 | engineA.Value = "XEngine"; | 361 | engineA.Value = "XEngine"; |
@@ -365,20 +369,22 @@ namespace OpenSim.Region.Framework.Scenes | |||
365 | // This created document has only the minimun data | 369 | // This created document has only the minimun data |
366 | // necessary for XEngine to parse it successfully | 370 | // necessary for XEngine to parse it successfully |
367 | 371 | ||
368 | m_part.ParentGroup.m_savedScriptState[oldID] = newDoc.OuterXml; | 372 | m_part.ParentGroup.m_savedScriptState[stateID] = newDoc.OuterXml; |
369 | } | 373 | } |
370 | 374 | ||
371 | foreach (IScriptModule e in engines) | 375 | foreach (IScriptModule e in engines) |
372 | { | 376 | { |
373 | if (e != null) | 377 | if (e != null) |
374 | { | 378 | { |
375 | if (e.SetXMLState(newID, m_part.ParentGroup.m_savedScriptState[oldID])) | 379 | if (e.SetXMLState(newID, m_part.ParentGroup.m_savedScriptState[stateID])) |
376 | break; | 380 | break; |
377 | } | 381 | } |
378 | } | 382 | } |
379 | 383 | ||
380 | m_part.ParentGroup.m_savedScriptState.Remove(oldID); | 384 | m_part.ParentGroup.m_savedScriptState.Remove(stateID); |
381 | } | 385 | } |
386 | |||
387 | return stateID; | ||
382 | } | 388 | } |
383 | 389 | ||
384 | /// <summary> | 390 | /// <summary> |
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index 3a08271..b54fcb7 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | |||
@@ -794,10 +794,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
794 | 794 | ||
795 | private static void ProcessTIOldItemID(TaskInventoryItem item, XmlTextReader reader) | 795 | private static void ProcessTIOldItemID(TaskInventoryItem item, XmlTextReader reader) |
796 | { | 796 | { |
797 | Util.ReadUUID(reader, "OldItemID"); | 797 | item.OldItemID = Util.ReadUUID(reader, "OldItemID"); |
798 | // On deserialization, the old item id MUST BE UUID.Zero!!!!! | ||
799 | // Setting this to the saved value will BREAK script persistence! | ||
800 | // item.OldItemID = Util.ReadUUID(reader, "OldItemID"); | ||
801 | } | 798 | } |
802 | 799 | ||
803 | private static void ProcessTILastOwnerID(TaskInventoryItem item, XmlTextReader reader) | 800 | private static void ProcessTILastOwnerID(TaskInventoryItem item, XmlTextReader reader) |
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index bbf3729..11f927c 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs | |||
@@ -1253,7 +1253,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
1253 | 1253 | ||
1254 | } | 1254 | } |
1255 | 1255 | ||
1256 | public void SendLandAccessListData(List<UUID> avatars, uint accessFlag, int localLandID) | 1256 | public void SendLandAccessListData(List<LandAccessEntry> accessList, uint accessFlag, int localLandID) |
1257 | { | 1257 | { |
1258 | 1258 | ||
1259 | } | 1259 | } |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index 6d40a92..81bf9ed 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | |||
@@ -940,7 +940,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
940 | public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, ILandObject lo, float simObjectBonusFactor,int parcelObjectCapacity, int simObjectCapacity, uint regionFlags) | 940 | public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, ILandObject lo, float simObjectBonusFactor,int parcelObjectCapacity, int simObjectCapacity, uint regionFlags) |
941 | { | 941 | { |
942 | } | 942 | } |
943 | public void SendLandAccessListData(List<UUID> avatars, uint accessFlag, int localLandID) | 943 | public void SendLandAccessListData(List<LandAccessEntry> accessList, uint accessFlag, int localLandID) |
944 | { | 944 | { |
945 | } | 945 | } |
946 | public void SendForceClientSelectObjects(List<uint> objectIDs) | 946 | public void SendForceClientSelectObjects(List<uint> objectIDs) |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 67dee02..0bdd84a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -5714,16 +5714,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5714 | public void llEjectFromLand(string pest) | 5714 | public void llEjectFromLand(string pest) |
5715 | { | 5715 | { |
5716 | m_host.AddScriptLPS(1); | 5716 | m_host.AddScriptLPS(1); |
5717 | UUID agentId = new UUID(); | 5717 | UUID agentID = new UUID(); |
5718 | if (UUID.TryParse(pest, out agentId)) | 5718 | if (UUID.TryParse(pest, out agentID)) |
5719 | { | 5719 | { |
5720 | ScenePresence presence = World.GetScenePresence(agentId); | 5720 | ScenePresence presence = World.GetScenePresence(agentID); |
5721 | if (presence != null) | 5721 | if (presence != null) |
5722 | { | 5722 | { |
5723 | // agent must be over the owners land | 5723 | // agent must be over the owners land |
5724 | if (m_host.OwnerID == World.LandChannel.GetLandObject( | 5724 | ILandObject land = World.LandChannel.GetLandObject(presence.AbsolutePosition.X, presence.AbsolutePosition.Y); |
5725 | presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) | 5725 | if (land == null) |
5726 | World.TeleportClientHome(agentId, presence.ControllingClient); | 5726 | return; |
5727 | |||
5728 | if (m_host.OwnerID == land.LandData.OwnerID) | ||
5729 | { | ||
5730 | World.TeleportClientHome(agentID, presence.ControllingClient); | ||
5731 | } | ||
5727 | } | 5732 | } |
5728 | } | 5733 | } |
5729 | ScriptSleep(5000); | 5734 | ScriptSleep(5000); |
@@ -6408,24 +6413,37 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6408 | m_host.AddScriptLPS(1); | 6413 | m_host.AddScriptLPS(1); |
6409 | UUID key; | 6414 | UUID key; |
6410 | ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); | 6415 | ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); |
6411 | if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageAllowed)) | 6416 | if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned)) |
6412 | { | 6417 | { |
6413 | ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); | 6418 | int expires = 0; |
6419 | if (hours != 0) | ||
6420 | expires = Util.UnixTimeSinceEpoch() + (int)(3600.0 * hours); | ||
6421 | |||
6414 | if (UUID.TryParse(avatar, out key)) | 6422 | if (UUID.TryParse(avatar, out key)) |
6415 | { | 6423 | { |
6416 | if (land.LandData.ParcelAccessList.FindIndex( | 6424 | int idx = land.LandData.ParcelAccessList.FindIndex( |
6417 | delegate(ParcelManager.ParcelAccessEntry e) | 6425 | delegate(LandAccessEntry e) |
6418 | { | 6426 | { |
6419 | if (e.AgentID == key && e.Flags == AccessList.Access) | 6427 | if (e.AgentID == key && e.Flags == AccessList.Access) |
6420 | return true; | 6428 | return true; |
6421 | return false; | 6429 | return false; |
6422 | }) == -1) | 6430 | }); |
6423 | { | 6431 | |
6424 | entry.AgentID = key; | 6432 | if (idx != -1 && (land.LandData.ParcelAccessList[idx].Expires == 0 || (expires != 0 && expires < land.LandData.ParcelAccessList[idx].Expires))) |
6425 | entry.Flags = AccessList.Access; | 6433 | return; |
6426 | entry.Time = DateTime.Now.AddHours(hours); | 6434 | |
6427 | land.LandData.ParcelAccessList.Add(entry); | 6435 | if (idx != -1) |
6428 | } | 6436 | land.LandData.ParcelAccessList.RemoveAt(idx); |
6437 | |||
6438 | LandAccessEntry entry = new LandAccessEntry(); | ||
6439 | |||
6440 | entry.AgentID = key; | ||
6441 | entry.Flags = AccessList.Access; | ||
6442 | entry.Expires = expires; | ||
6443 | |||
6444 | land.LandData.ParcelAccessList.Add(entry); | ||
6445 | |||
6446 | World.EventManager.TriggerLandObjectUpdated((uint)land.LandData.LocalID, land); | ||
6429 | } | 6447 | } |
6430 | } | 6448 | } |
6431 | ScriptSleep(100); | 6449 | ScriptSleep(100); |
@@ -9679,22 +9697,35 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
9679 | ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); | 9697 | ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); |
9680 | if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned)) | 9698 | if (World.Permissions.CanEditParcelProperties(m_host.OwnerID, land, GroupPowers.LandManageBanned)) |
9681 | { | 9699 | { |
9682 | ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); | 9700 | int expires = 0; |
9701 | if (hours != 0) | ||
9702 | expires = Util.UnixTimeSinceEpoch() + (int)(3600.0 * hours); | ||
9703 | |||
9683 | if (UUID.TryParse(avatar, out key)) | 9704 | if (UUID.TryParse(avatar, out key)) |
9684 | { | 9705 | { |
9685 | if (land.LandData.ParcelAccessList.FindIndex( | 9706 | int idx = land.LandData.ParcelAccessList.FindIndex( |
9686 | delegate(ParcelManager.ParcelAccessEntry e) | 9707 | delegate(LandAccessEntry e) |
9687 | { | 9708 | { |
9688 | if (e.AgentID == key && e.Flags == AccessList.Ban) | 9709 | if (e.AgentID == key && e.Flags == AccessList.Ban) |
9689 | return true; | 9710 | return true; |
9690 | return false; | 9711 | return false; |
9691 | }) == -1) | 9712 | }); |
9692 | { | 9713 | |
9693 | entry.AgentID = key; | 9714 | if (idx != -1 && (land.LandData.ParcelAccessList[idx].Expires == 0 || (expires != 0 && expires < land.LandData.ParcelAccessList[idx].Expires))) |
9694 | entry.Flags = AccessList.Ban; | 9715 | return; |
9695 | entry.Time = DateTime.Now.AddHours(hours); | 9716 | |
9696 | land.LandData.ParcelAccessList.Add(entry); | 9717 | if (idx != -1) |
9697 | } | 9718 | land.LandData.ParcelAccessList.RemoveAt(idx); |
9719 | |||
9720 | LandAccessEntry entry = new LandAccessEntry(); | ||
9721 | |||
9722 | entry.AgentID = key; | ||
9723 | entry.Flags = AccessList.Ban; | ||
9724 | entry.Expires = expires; | ||
9725 | |||
9726 | land.LandData.ParcelAccessList.Add(entry); | ||
9727 | |||
9728 | World.EventManager.TriggerLandObjectUpdated((uint)land.LandData.LocalID, land); | ||
9698 | } | 9729 | } |
9699 | } | 9730 | } |
9700 | ScriptSleep(100); | 9731 | ScriptSleep(100); |
@@ -9710,7 +9741,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
9710 | if (UUID.TryParse(avatar, out key)) | 9741 | if (UUID.TryParse(avatar, out key)) |
9711 | { | 9742 | { |
9712 | int idx = land.LandData.ParcelAccessList.FindIndex( | 9743 | int idx = land.LandData.ParcelAccessList.FindIndex( |
9713 | delegate(ParcelManager.ParcelAccessEntry e) | 9744 | delegate(LandAccessEntry e) |
9714 | { | 9745 | { |
9715 | if (e.AgentID == key && e.Flags == AccessList.Access) | 9746 | if (e.AgentID == key && e.Flags == AccessList.Access) |
9716 | return true; | 9747 | return true; |
@@ -9718,7 +9749,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
9718 | }); | 9749 | }); |
9719 | 9750 | ||
9720 | if (idx != -1) | 9751 | if (idx != -1) |
9752 | { | ||
9721 | land.LandData.ParcelAccessList.RemoveAt(idx); | 9753 | land.LandData.ParcelAccessList.RemoveAt(idx); |
9754 | World.EventManager.TriggerLandObjectUpdated((uint)land.LandData.LocalID, land); | ||
9755 | } | ||
9722 | } | 9756 | } |
9723 | } | 9757 | } |
9724 | ScriptSleep(100); | 9758 | ScriptSleep(100); |
@@ -9734,7 +9768,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
9734 | if (UUID.TryParse(avatar, out key)) | 9768 | if (UUID.TryParse(avatar, out key)) |
9735 | { | 9769 | { |
9736 | int idx = land.LandData.ParcelAccessList.FindIndex( | 9770 | int idx = land.LandData.ParcelAccessList.FindIndex( |
9737 | delegate(ParcelManager.ParcelAccessEntry e) | 9771 | delegate(LandAccessEntry e) |
9738 | { | 9772 | { |
9739 | if (e.AgentID == key && e.Flags == AccessList.Ban) | 9773 | if (e.AgentID == key && e.Flags == AccessList.Ban) |
9740 | return true; | 9774 | return true; |
@@ -9742,7 +9776,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
9742 | }); | 9776 | }); |
9743 | 9777 | ||
9744 | if (idx != -1) | 9778 | if (idx != -1) |
9779 | { | ||
9745 | land.LandData.ParcelAccessList.RemoveAt(idx); | 9780 | land.LandData.ParcelAccessList.RemoveAt(idx); |
9781 | World.EventManager.TriggerLandObjectUpdated((uint)land.LandData.LocalID, land); | ||
9782 | } | ||
9746 | } | 9783 | } |
9747 | } | 9784 | } |
9748 | ScriptSleep(100); | 9785 | ScriptSleep(100); |
@@ -9997,7 +10034,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
9997 | LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).LandData; | 10034 | LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).LandData; |
9998 | if (land.OwnerID == m_host.OwnerID) | 10035 | if (land.OwnerID == m_host.OwnerID) |
9999 | { | 10036 | { |
10000 | foreach (ParcelManager.ParcelAccessEntry entry in land.ParcelAccessList) | 10037 | foreach (LandAccessEntry entry in land.ParcelAccessList) |
10001 | { | 10038 | { |
10002 | if (entry.Flags == AccessList.Ban) | 10039 | if (entry.Flags == AccessList.Ban) |
10003 | { | 10040 | { |
@@ -10014,7 +10051,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10014 | LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).LandData; | 10051 | LandData land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).LandData; |
10015 | if (land.OwnerID == m_host.OwnerID) | 10052 | if (land.OwnerID == m_host.OwnerID) |
10016 | { | 10053 | { |
10017 | foreach (ParcelManager.ParcelAccessEntry entry in land.ParcelAccessList) | 10054 | foreach (LandAccessEntry entry in land.ParcelAccessList) |
10018 | { | 10055 | { |
10019 | if (entry.Flags == AccessList.Access) | 10056 | if (entry.Flags == AccessList.Access) |
10020 | { | 10057 | { |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs index b66537f..6106a65 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs | |||
@@ -138,7 +138,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
138 | LSL_Key llGetLinkKey(int linknum); | 138 | LSL_Key llGetLinkKey(int linknum); |
139 | LSL_String llGetLinkName(int linknum); | 139 | LSL_String llGetLinkName(int linknum); |
140 | LSL_Integer llGetLinkNumber(); | 140 | LSL_Integer llGetLinkNumber(); |
141 | LSL_List llGetLinkPrimitiveParams(int linknum, LSL_List rules); | 141 | LSL_Integer llGetLinkNumberOfSides(int link); |
142 | LSL_List llGetLinkPrimitiveParams(int linknum, LSL_List rules); | ||
142 | LSL_Integer llGetListEntryType(LSL_List src, int index); | 143 | LSL_Integer llGetListEntryType(LSL_List src, int index); |
143 | LSL_Integer llGetListLength(LSL_List src); | 144 | LSL_Integer llGetListLength(LSL_List src); |
144 | LSL_Vector llGetLocalPos(); | 145 | LSL_Vector llGetLocalPos(); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs index 840d3a4..83550a5 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs | |||
@@ -539,6 +539,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
539 | return m_LSL_Functions.llGetLinkNumber(); | 539 | return m_LSL_Functions.llGetLinkNumber(); |
540 | } | 540 | } |
541 | 541 | ||
542 | public LSL_Integer llGetLinkNumberOfSides(int link) | ||
543 | { | ||
544 | return m_LSL_Functions.llGetLinkNumberOfSides(link); | ||
545 | } | ||
546 | |||
542 | public LSL_Integer llGetListEntryType(LSL_List src, int index) | 547 | public LSL_Integer llGetListEntryType(LSL_List src, int index) |
543 | { | 548 | { |
544 | return m_LSL_Functions.llGetListEntryType(src, index); | 549 | return m_LSL_Functions.llGetListEntryType(src, index); |