当前位置: 首页>>代码示例>>C#>>正文


C# IClientAPI.SendChangeUserRights方法代码示例

本文整理汇总了C#中IClientAPI.SendChangeUserRights方法的典型用法代码示例。如果您正苦于以下问题:C# IClientAPI.SendChangeUserRights方法的具体用法?C# IClientAPI.SendChangeUserRights怎么用?C# IClientAPI.SendChangeUserRights使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IClientAPI的用法示例。


在下文中一共展示了IClientAPI.SendChangeUserRights方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: client_OnGrantUserRights

        void client_OnGrantUserRights(IClientAPI sender, OpenMetaverse.UUID grantor, OpenMetaverse.UUID grantee, int rights)
        {
            if (sender.AgentId != grantor)
            {
                return;
            }

            //set the user rights on the DB
            using (ISimpleDB db = _connFactory.GetConnection())
            {
                Dictionary<string, object> parms = new Dictionary<string,object>();
                parms.Add("rights", rights);
                parms.Add("ownerID", grantor);
                parms.Add("friendID", grantee);

                db.QueryNoResults(  "UPDATE userfriends " +
                                        "SET friendPerms = ?rights " +
                                    "WHERE ownerID = ?ownerID AND friendID = ?friendID;",
                                    
                                    parms );

            }

            m_scene.CommsManager.UserService.UpdateUserFriendPerms(grantor, grantee, (uint)rights);
            sender.SendChangeUserRights(grantor, grantee, rights);
        }
开发者ID:digitalmystic,项目名称:halcyon,代码行数:26,代码来源:FriendPermissionsModule.cs

示例2: OnGrantUserRights

        private void OnGrantUserRights(IClientAPI remoteClient, UUID requester, UUID target, int rights)
        {
            if (!m_Friends.ContainsKey(remoteClient.AgentId))
                return;

            m_log.DebugFormat("[FRIENDS MODULE]: User {0} changing rights to {1} for friend {2}", requester, rights, target);
            // Let's find the friend in this user's friend list
            UserFriendData fd = m_Friends[remoteClient.AgentId];
            FriendInfo friend = null;
            foreach (FriendInfo fi in fd.Friends)
                if (fi.Friend == target.ToString())
                    friend = fi;

            if (friend != null) // Found it
            {
                // Store it on the DB
                FriendsService.StoreFriend(requester, target.ToString(), rights);

                // Store it in the local cache
                int myFlags = friend.MyFlags;
                friend.MyFlags = rights;

                // Always send this back to the original client
                remoteClient.SendChangeUserRights(requester, target, rights);

                //
                // Notify the friend
                //

                // Try local
                if (LocalGrantRights(requester, target, myFlags, rights))
                    return;

                PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { target.ToString() });
                PresenceInfo friendSession = PresenceInfo.GetOnlinePresence(friendSessions);
                if (friendSession != null)
                {
                    GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID);
                    // TODO: You might want to send the delta to save the lookup
                    // on the other end!!
                    m_FriendsSimConnector.GrantRights(region, requester, target, myFlags, rights);
                }
            }
        }
开发者ID:gumho,项目名称:diva-distribution,代码行数:44,代码来源:FriendsModule.cs

示例3: SendFriendsOnlineIfNeeded

        public override bool SendFriendsOnlineIfNeeded(IClientAPI client)
        {
//            m_log.DebugFormat("[HGFRIENDS MODULE]: Entering SendFriendsOnlineIfNeeded for {0}", client.Name);

            if (base.SendFriendsOnlineIfNeeded(client))
            {
                AgentCircuitData aCircuit = ((Scene)client.Scene).AuthenticateHandler.GetAgentCircuitData(client.AgentId);
                if (aCircuit != null && (aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0)
                {
                    UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(client.Scene.RegionInfo.ScopeID, client.AgentId);
                    if (account == null) // foreign
                    {
                        FriendInfo[] friends = GetFriends(client.AgentId);
                        foreach (FriendInfo f in friends)
                        {
                            client.SendChangeUserRights(new UUID(f.Friend), client.AgentId, f.TheirFlags);
                        }
                    }
                }
            }

//            m_log.DebugFormat("[HGFRIENDS MODULE]: Exiting SendFriendsOnlineIfNeeded for {0}", client.Name);
            return false;
        }
开发者ID:JamesStallings,项目名称:Ubit-opensim,代码行数:24,代码来源:HGFriendsModule.cs

示例4: OnGrantUserRights

        private void OnGrantUserRights(IClientAPI remoteClient, UUID requester, UUID target, int rights)
        {
            FriendInfo[] friends = GetFriends(remoteClient.AgentId);
            if (friends.Length == 0)
                return;

            MainConsole.Instance.DebugFormat("[FRIENDS MODULE]: User {0} changing rights to {1} for friend {2}", requester, rights,
                              target);
            // Let's find the friend in this user's friend list
            FriendInfo friend = null;
#if (!ISWIN)
            foreach (FriendInfo fi in friends)
            {
                if (fi.Friend == target.ToString())
                {
                    friend = fi;
                }
            }
#else
            foreach (FriendInfo fi in friends.Where(fi => fi.Friend == target.ToString()))
            {
                friend = fi;
            }
#endif

            if (friend != null) // Found it
            {
                // Store it on the DB
                FriendsService.StoreFriend(requester, target.ToString(), rights);

                // Store it in the local cache
                int myFlags = friend.MyFlags;
                friend.MyFlags = rights;

                // Always send this back to the original client
                remoteClient.SendChangeUserRights(requester, target, rights);

                //
                // Notify the friend
                //


                // Try local
                if (!LocalGrantRights(requester, target, myFlags, rights))
                {
                    SyncMessagePosterService.Post(SyncMessageHelper.FriendGrantRights(
                        requester, target, myFlags, rights, m_Scenes[0].RegionInfo.RegionHandle),
                                                  m_Scenes[0].RegionInfo.RegionHandle);
                }
            }
        }
开发者ID:TechplexEngineer,项目名称:Aurora-Sim,代码行数:51,代码来源:FriendsModule.cs

示例5: GrantRights

        public void GrantRights(IClientAPI remoteClient, UUID friendID, int rights)
        {
            UUID requester = remoteClient.AgentId;

            m_log.DebugFormat(
                "[FRIENDS MODULE]: User {0} changing rights to {1} for friend {2}",
                requester, rights, friendID);

            FriendInfo[] friends = GetFriendsFromCache(requester);
            if (friends.Length == 0)
            {
                return;
            }

            // Let's find the friend in this user's friend list
            FriendInfo friend = GetFriend(friends, friendID);

            if (friend != null) // Found it
            {
                // Store it on the DB
                if (!StoreRights(requester, friendID, rights))
                {
                    remoteClient.SendAlertMessage("Unable to grant rights.");
                    return;
                }

                // Store it in the local cache
                int myFlags = friend.MyFlags;
                friend.MyFlags = rights;

                // Always send this back to the original client
                remoteClient.SendChangeUserRights(requester, friendID, rights);

                //
                // Notify the friend
                //

                // Try local
                if (LocalGrantRights(requester, friendID, myFlags, rights))
                    return;

                PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() });
                if (friendSessions != null && friendSessions.Length > 0)
                {
                    PresenceInfo friendSession = friendSessions[0];
                    if (friendSession != null)
                    {
                        GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID);
                        // TODO: You might want to send the delta to save the lookup
                        // on the other end!!
                        m_FriendsSimConnector.GrantRights(region, requester, friendID, myFlags, rights);
                    }
                }
            }
            else
            {
                m_log.DebugFormat("[FRIENDS MODULE]: friend {0} not found for {1}", friendID, requester);
            }
        }
开发者ID:justasabc,项目名称:opensim75grid,代码行数:59,代码来源:FriendsModule.cs

示例6: OnGrantUserRights

        private void OnGrantUserRights(IClientAPI remoteClient, UUID requester, UUID target, int rights)
        {
            FriendInfo[] friends = GetFriends(remoteClient.AgentId);
            if (friends.Length == 0)
                return;

            m_log.DebugFormat("[FRIENDS MODULE]: User {0} changing rights to {1} for friend {2}", requester, rights, target);
            // Let's find the friend in this user's friend list
            FriendInfo friend = null;
            foreach (FriendInfo fi in friends)
            {
                if (fi.Friend == target.ToString())
                    friend = fi;
            }

            if (friend != null) // Found it
            {
                // Store it on the DB
                FriendsService.StoreFriend(requester, target.ToString(), rights);

                // Store it in the local cache
                int myFlags = friend.MyFlags;
                friend.MyFlags = rights;

                // Always send this back to the original client
                remoteClient.SendChangeUserRights(requester, target, rights);

                //
                // Notify the friend
                //

                // Try local
                if (!LocalGrantRights(requester, target, myFlags, rights))
                {
                    PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { target.ToString() });
                    if (friendSessions != null && friendSessions.Length > 0)
                    {
                        PresenceInfo friendSession = friendSessions[0];
                        if (friendSession != null)
                        {
                            GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID);
                            m_FriendsSimConnector.GrantRights(region, requester, target, myFlags, rights);
                        }
                    }
                }
            }
        }
开发者ID:shangcheng,项目名称:Aurora,代码行数:47,代码来源:FriendsModule.cs

示例7: OnGrantUserRights

        private void OnGrantUserRights(IClientAPI remoteClient, UUID requester, UUID target, int rights)
        {
            FriendInfo[] friends = GetFriends(remoteClient.AgentId);
            if (friends.Length == 0)
                return;

            m_log.DebugFormat("[FRIENDS MODULE]: User {0} changing rights to {1} for friend {2}", requester, rights, target);
            // Let's find the friend in this user's friend list
            FriendInfo friend = null;
            foreach (FriendInfo fi in friends)
            {
                if (fi.Friend == target.ToString())
                    friend = fi;
            }

            if (friend != null) // Found it
            {
                // Store it on the DB
                FriendsService.StoreFriend(requester, target.ToString(), rights);

                // Store it in the local cache
                int myFlags = friend.MyFlags;
                friend.MyFlags = rights;

                // Always send this back to the original client
                remoteClient.SendChangeUserRights(requester, target, rights);

                //
                // Notify the friend
                //

                
                // Try local
                if (!LocalGrantRights(requester, target, myFlags, rights))
                {
                    UserInfo friendSession = m_Scenes[0].RequestModuleInterface<IAgentInfoService>().GetUserInfo(target.ToString());
                    if (friendSession != null && friendSession.IsOnline)
                    {
                        GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, 
                            friendSession.CurrentRegionID);
                        AsyncMessagePostService.Post(region.RegionHandle, SyncMessageHelper.FriendGrantRights(
                            requester, target, myFlags, rights, region.RegionHandle));
                    }
                }
            }
        }
开发者ID:x8ball,项目名称:Aurora-Sim,代码行数:46,代码来源:FriendsModule.cs


注:本文中的IClientAPI.SendChangeUserRights方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。