diff options
author | Melanie | 2012-01-26 23:07:31 +0000 |
---|---|---|
committer | Melanie | 2012-01-26 23:07:31 +0000 |
commit | 9d60b84f7805b78ae9413b4dc66c2fbbf387e503 (patch) | |
tree | 6aa89951925561a5dbe031b9a92e9dd49c0a272a /OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |
parent | Merge branch 'master' into careminster (diff) | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC-9d60b84f7805b78ae9413b4dc66c2fbbf387e503.zip opensim-SC-9d60b84f7805b78ae9413b4dc66c2fbbf387e503.tar.gz opensim-SC-9d60b84f7805b78ae9413b4dc66c2fbbf387e503.tar.bz2 opensim-SC-9d60b84f7805b78ae9413b4dc66c2fbbf387e503.tar.xz |
Merge branch 'master' into careminster
Conflicts:
OpenSim/Framework/EstateSettings.cs
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 69 |
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 23e3e15..9c4bfb6 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -11516,6 +11516,75 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11516 | return list; | 11516 | return list; |
11517 | } | 11517 | } |
11518 | 11518 | ||
11519 | public LSL_Integer llManageEstateAccess(int action, string avatar) | ||
11520 | { | ||
11521 | m_host.AddScriptLPS(1); | ||
11522 | EstateSettings estate = World.RegionInfo.EstateSettings; | ||
11523 | bool isAccount = false; | ||
11524 | bool isGroup = false; | ||
11525 | |||
11526 | if (!estate.IsEstateOwner(m_host.OwnerID) || !estate.IsEstateManager(m_host.OwnerID)) | ||
11527 | return 0; | ||
11528 | |||
11529 | UUID id = new UUID(); | ||
11530 | if (!UUID.TryParse(avatar, out id)) | ||
11531 | return 0; | ||
11532 | |||
11533 | UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, id); | ||
11534 | isAccount = account != null ? true : false; | ||
11535 | if (!isAccount) | ||
11536 | { | ||
11537 | IGroupsModule groups = World.RequestModuleInterface<IGroupsModule>(); | ||
11538 | if (groups != null) | ||
11539 | { | ||
11540 | GroupRecord group = groups.GetGroupRecord(id); | ||
11541 | isGroup = group != null ? true : false; | ||
11542 | if (!isGroup) | ||
11543 | return 0; | ||
11544 | } | ||
11545 | else | ||
11546 | return 0; | ||
11547 | } | ||
11548 | |||
11549 | switch (action) | ||
11550 | { | ||
11551 | case ScriptBaseClass.ESTATE_ACCESS_ALLOWED_AGENT_ADD: | ||
11552 | if (!isAccount) return 0; | ||
11553 | if (estate.HasAccess(id)) return 1; | ||
11554 | if (estate.IsBanned(id, World.GetUserFlags(id))) | ||
11555 | estate.RemoveBan(id); | ||
11556 | estate.AddEstateUser(id); | ||
11557 | break; | ||
11558 | case ScriptBaseClass.ESTATE_ACCESS_ALLOWED_AGENT_REMOVE: | ||
11559 | if (!isAccount || !estate.HasAccess(id)) return 0; | ||
11560 | estate.RemoveEstateUser(id); | ||
11561 | break; | ||
11562 | case ScriptBaseClass.ESTATE_ACCESS_ALLOWED_GROUP_ADD: | ||
11563 | if (!isGroup) return 0; | ||
11564 | if (estate.GroupAccess(id)) return 1; | ||
11565 | estate.AddEstateGroup(id); | ||
11566 | break; | ||
11567 | case ScriptBaseClass.ESTATE_ACCESS_ALLOWED_GROUP_REMOVE: | ||
11568 | if (!isGroup || !estate.GroupAccess(id)) return 0; | ||
11569 | estate.RemoveEstateGroup(id); | ||
11570 | break; | ||
11571 | case ScriptBaseClass.ESTATE_ACCESS_BANNED_AGENT_ADD: | ||
11572 | if (!isAccount) return 0; | ||
11573 | if (estate.IsBanned(id, World.GetUserFlags(id))) return 1; | ||
11574 | EstateBan ban = new EstateBan(); | ||
11575 | ban.EstateID = estate.EstateID; | ||
11576 | ban.BannedUserID = id; | ||
11577 | estate.AddBan(ban); | ||
11578 | break; | ||
11579 | case ScriptBaseClass.ESTATE_ACCESS_BANNED_AGENT_REMOVE: | ||
11580 | if (!isAccount || !estate.IsBanned(id, World.GetUserFlags(id))) return 0; | ||
11581 | estate.RemoveBan(id); | ||
11582 | break; | ||
11583 | default: return 0; | ||
11584 | } | ||
11585 | return 1; | ||
11586 | } | ||
11587 | |||
11519 | #region Not Implemented | 11588 | #region Not Implemented |
11520 | // | 11589 | // |
11521 | // Listing the unimplemented lsl functions here, please move | 11590 | // Listing the unimplemented lsl functions here, please move |