當前位置: 首頁>>代碼示例>>C#>>正文


C# Scene.IsEstateManager方法代碼示例

本文整理匯總了C#中OpenSim.Region.Framework.Scenes.Scene.IsEstateManager方法的典型用法代碼示例。如果您正苦於以下問題:C# Scene.IsEstateManager方法的具體用法?C# Scene.IsEstateManager怎麽用?C# Scene.IsEstateManager使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在OpenSim.Region.Framework.Scenes.Scene的用法示例。


在下文中一共展示了Scene.IsEstateManager方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CheckRezPerms

        // If objectID is specified (not UUID.Zero), then that object (owned by "owner") is trying to rez another object.
        // pass 0 for landImpact if you do not want this method to do any Land Impact limit checks.
        private bool CheckRezPerms(ILandObject parcel, UUID owner, UUID objectID, Vector3 objectPosition, bool isTemp, Scene scene)
        {
            DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);

            if (m_bypassPermissions) return m_bypassPermissionsValue;

            // User or object owner is an admin?
            if (IsGodUser(owner))
                return true;    // we're done here, no need to check more

            // This code block handles the Scenic option of EO (and partner) only.
            if (scene.RegionInfo.AllowRezzers == ProductRulesWho.OnlyEO)
            {
                // only the estate OWNER or PARTNER can rez in scenic regions unless it's a temprez object
                if (scene.IsEstateOwner(owner))
                    return true;
                if (scene.RegionInfo.AllowPartnerRez)
                    if (scene.IsEstateOwnerPartner(owner))
                        return true;
                if (!isTemp)    // non-temp rezzing not allowed
                    return false;
            }

            // At this point, we need to test a specific parcel.
            if (parcel == null) return false;

            // Is this a Plus region?
            if (scene.RegionInfo.Product == ProductRulesUse.PlusUse)
            {
                // If this is an unclaimed Plus parcel (or community land)
                if (scene.IsEstateOwner(parcel.landData.OwnerID))
                    return scene.IsEstateManager(owner);    // only EM can rez
                // Else only the Plus user (and possibly partner) can rez in a Plus parcel.
                if (owner == parcel.landData.OwnerID)
                    return true;
                // Otherwise, only the Plus user's partner can rez in a Plus parcel.
                if (scene.RegionInfo.AllowPartnerRez)
                {
                    UserProfileData parcelOwner = m_scene.CommsManager.UserService.GetUserProfile(parcel.landData.OwnerID);
                    if (parcelOwner != null)
                        if (parcelOwner.Partner != UUID.Zero)
                            if (parcelOwner.Partner == owner)
                                return true;
                }
                return false;
            }

            // Create enabled for everyone?
            if ((parcel.landData.Flags & ((int)ParcelFlags.CreateObjects)) == (uint)ParcelFlags.CreateObjects)
                return true;    // we're done here, no need to check more

            ulong roleNeeded = (ulong)GroupPowers.AllowRez;
            if ((parcel.landData.Flags & (uint)ParcelFlags.CreateGroupObjects) == (uint)ParcelFlags.CreateGroupObjects)
                roleNeeded = (ulong)GroupPowers.None; // if group rezzing is enabled, we just need to be a member, no specific role ability

            // Is an object rezzing the other object?
            if (objectID != UUID.Zero)
            {   // A scripted object is doing the rezzing...
                SceneObjectGroup group = this.FindObjectGroup(objectID);
                if (group == null) return false;

                // Now continue the rezzing permissions checks
                if (group.OwnerID == parcel.landData.OwnerID)
                    return true;
                // Owner doesn't match the land parcel, check partner perms.
                if (scene.RegionInfo.AllowPartnerRez)
                {   // this one is will not be called based on current products (Scenic, Plus) but completes the rule set for objects.
                    UserProfileData parcelOwner = m_scene.CommsManager.UserService.GetUserProfile(parcel.landData.OwnerID);
                    if (parcelOwner != null)
                        if (parcelOwner.Partner != UUID.Zero)
                            if (parcelOwner.Partner == group.OwnerID)
                                return true;
                }

                // Owner doesn't match the land parcel, check group perms.
                UUID activeGroupId = group.GroupID;
                // Handle the special case of active group for a worn attachment
                if (group.RootPart.IsAttachment)
                {
                    ScenePresence sp = m_scene.GetScenePresence(group.RootPart.AttachedAvatar);
                    if (sp == null)
                        return false;
                    IClientAPI client = sp.ControllingClient;
                    activeGroupId = client.ActiveGroupId;
                }

                // See if the agent or object doing the rezzing has permission itself.
                if ((parcel.landData.Flags & (uint)ParcelFlags.CreateGroupObjects) == (uint)ParcelFlags.CreateGroupObjects)
                {
                    if (activeGroupId == parcel.landData.GroupID)
                        return true;
                }

                // Create role enabled for this group member on group land?
                if (GenericParcelPermission(group.OwnerID, parcel, roleNeeded))
                    return true;    // we're done here, no need to check more

                return false;
//.........這裏部分代碼省略.........
開發者ID:M-O-S-E-S,項目名稱:halcyon,代碼行數:101,代碼來源:PermissionsModule.cs


注:本文中的OpenSim.Region.Framework.Scenes.Scene.IsEstateManager方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。