aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-01-27 23:14:34 +0000
committerJustin Clark-Casey (justincc)2012-01-27 23:14:34 +0000
commitabf0dd4250dcf458c8d0ef71a388a4cf89c4a1ef (patch)
tree74506e8e519bdf13305ca595b4a74eed7952c6a4 /OpenSim/Region/ScriptEngine/Shared/Api/Implementation
parentImplement osNpcGetOwner(key npc):key. This returns the owner for an 'owned' ... (diff)
parentHG Inventoty: Guard against items not found. (diff)
downloadopensim-SC_OLD-abf0dd4250dcf458c8d0ef71a388a4cf89c4a1ef.zip
opensim-SC_OLD-abf0dd4250dcf458c8d0ef71a388a4cf89c4a1ef.tar.gz
opensim-SC_OLD-abf0dd4250dcf458c8d0ef71a388a4cf89c4a1ef.tar.bz2
opensim-SC_OLD-abf0dd4250dcf458c8d0ef71a388a4cf89c4a1ef.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs69
1 files changed, 69 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 6fa812d..fb5fd45 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -10646,6 +10646,75 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
10646 return list; 10646 return list;
10647 } 10647 }
10648 10648
10649 public LSL_Integer llManageEstateAccess(int action, string avatar)
10650 {
10651 m_host.AddScriptLPS(1);
10652 EstateSettings estate = World.RegionInfo.EstateSettings;
10653 bool isAccount = false;
10654 bool isGroup = false;
10655
10656 if (!estate.IsEstateOwner(m_host.OwnerID) || !estate.IsEstateManager(m_host.OwnerID))
10657 return 0;
10658
10659 UUID id = new UUID();
10660 if (!UUID.TryParse(avatar, out id))
10661 return 0;
10662
10663 UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, id);
10664 isAccount = account != null ? true : false;
10665 if (!isAccount)
10666 {
10667 IGroupsModule groups = World.RequestModuleInterface<IGroupsModule>();
10668 if (groups != null)
10669 {
10670 GroupRecord group = groups.GetGroupRecord(id);
10671 isGroup = group != null ? true : false;
10672 if (!isGroup)
10673 return 0;
10674 }
10675 else
10676 return 0;
10677 }
10678
10679 switch (action)
10680 {
10681 case ScriptBaseClass.ESTATE_ACCESS_ALLOWED_AGENT_ADD:
10682 if (!isAccount) return 0;
10683 if (estate.HasAccess(id)) return 1;
10684 if (estate.IsBanned(id))
10685 estate.RemoveBan(id);
10686 estate.AddEstateUser(id);
10687 break;
10688 case ScriptBaseClass.ESTATE_ACCESS_ALLOWED_AGENT_REMOVE:
10689 if (!isAccount || !estate.HasAccess(id)) return 0;
10690 estate.RemoveEstateUser(id);
10691 break;
10692 case ScriptBaseClass.ESTATE_ACCESS_ALLOWED_GROUP_ADD:
10693 if (!isGroup) return 0;
10694 if (estate.GroupAccess(id)) return 1;
10695 estate.AddEstateGroup(id);
10696 break;
10697 case ScriptBaseClass.ESTATE_ACCESS_ALLOWED_GROUP_REMOVE:
10698 if (!isGroup || !estate.GroupAccess(id)) return 0;
10699 estate.RemoveEstateGroup(id);
10700 break;
10701 case ScriptBaseClass.ESTATE_ACCESS_BANNED_AGENT_ADD:
10702 if (!isAccount) return 0;
10703 if (estate.IsBanned(id)) return 1;
10704 EstateBan ban = new EstateBan();
10705 ban.EstateID = estate.EstateID;
10706 ban.BannedUserID = id;
10707 estate.AddBan(ban);
10708 break;
10709 case ScriptBaseClass.ESTATE_ACCESS_BANNED_AGENT_REMOVE:
10710 if (!isAccount || !estate.IsBanned(id)) return 0;
10711 estate.RemoveBan(id);
10712 break;
10713 default: return 0;
10714 }
10715 return 1;
10716 }
10717
10649 #region Not Implemented 10718 #region Not Implemented
10650 // 10719 //
10651 // Listing the unimplemented lsl functions here, please move 10720 // Listing the unimplemented lsl functions here, please move