コード例 #1
0
        private void OnAgentDataUpdateRequest(IClientAPI remoteClient,
                                              UUID AgentID, UUID SessionID)
        {
            UUID   ActiveGroupID;
            string ActiveGroupName;
            ulong  ActiveGroupPowers;

            string firstname = remoteClient.FirstName;
            string lastname  = remoteClient.LastName;

            string ActiveGroupTitle = "I IZ N0T";

            ActiveGroupID     = osGroup.GroupID;
            ActiveGroupName   = osGroup.GroupName;
            ActiveGroupPowers = osGroup.GroupPowers;

            remoteClient.SendAgentDataUpdate(AgentID, ActiveGroupID, firstname,
                                             lastname, ActiveGroupPowers, ActiveGroupName,
                                             ActiveGroupTitle);
        }
コード例 #2
0
        private void SendAgentDataUpdate(IClientAPI remoteClient, UUID dataForAgentID, UUID activeGroupID, string activeGroupName, ulong activeGroupPowers, string activeGroupTitle)
        {
            if (m_debugEnabled) m_log.DebugFormat("[Groups]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);

            // TODO: All the client update functions need to be reexamined because most do too much and send too much stuff
            string firstname = "Unknown", lastname = "Unknown";
            string name = m_UserManagement.GetUserName(dataForAgentID);
            if (!string.IsNullOrEmpty(name))
            {
                string[] parts = name.Split(new char[] { ' ' });
                if (parts.Length >= 2)
                {
                    firstname = parts[0];
                    lastname = parts[1];
                }
            }
            
            remoteClient.SendAgentDataUpdate(dataForAgentID, activeGroupID, firstname,
                    lastname, activeGroupPowers, activeGroupName,
                    activeGroupTitle);
        }
コード例 #3
0
ファイル: GroupsModule.cs プロジェクト: AkiraSonoda/akisim
        private void SendAgentDataUpdate(IClientAPI remoteClient, UUID dataForAgentID, UUID activeGroupID, string activeGroupName, ulong activeGroupPowers, string activeGroupTitle)
        {
            if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);

            // TODO: All the client update functions need to be reexamined because most do too much and send too much stuff
            UserAccount account = m_sceneList[0].UserAccountService.GetUserAccount(remoteClient.Scene.RegionInfo.ScopeID, dataForAgentID);
            string firstname, lastname;
            if (account != null)
            {
                firstname = account.FirstName;
                lastname = account.LastName;
            }
            else
            {
                firstname = "Unknown";
                lastname = "Unknown";
            }

            remoteClient.SendAgentDataUpdate(dataForAgentID, activeGroupID, firstname,
                    lastname, activeGroupPowers, activeGroupName,
                    activeGroupTitle);
        }
コード例 #4
0
        private void SendAgentDataUpdate(IClientAPI remoteClient, UUID dataForAgentID, UUID activeGroupID, string activeGroupName, ulong activeGroupPowers, string activeGroupTitle)
        {
            if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);

            // TODO: All the client update functions need to be reexamined because most do too much and send too much stuff
            
            remoteClient.SendAgentDataUpdate(dataForAgentID, activeGroupID, remoteClient.FirstName,
                    remoteClient.LastName, activeGroupPowers, activeGroupName,
                    activeGroupTitle);
        }
コード例 #5
0
ファイル: GroupsModule.cs プロジェクト: NickyPerian/Aurora
        private void OnAgentDataUpdateRequest(IClientAPI remoteClient,
                                              UUID AgentID, UUID SessionID)
        {
            UUID ActiveGroupID;
            string ActiveGroupName;
            ulong ActiveGroupPowers;

            string firstname = remoteClient.FirstName;
            string lastname = remoteClient.LastName;

            string ActiveGroupTitle = "I IZ N0T";

            ActiveGroupID = osGroup.GroupID;
            ActiveGroupName = osGroup.GroupName;
            ActiveGroupPowers = osGroup.GroupPowers;

            remoteClient.SendAgentDataUpdate(AgentID, ActiveGroupID, firstname,
                                             lastname, ActiveGroupPowers, ActiveGroupName,
                                             ActiveGroupTitle);
        }
コード例 #6
0
         //tell remoteClient about its agent group info, and optionally send title to others
        private void SendDataUpdate(IClientAPI remoteClient, bool tellOthers)
        {
            if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);

            UUID activeGroupID = UUID.Zero;
            string activeGroupTitle = string.Empty;
            string activeGroupName = string.Empty;
            ulong activeGroupPowers = (ulong)GroupPowers.None;

            UUID agentID = GetRequestingAgentID(remoteClient);
            GroupMembershipData membership = m_groupData.GetAgentActiveMembership(agentID.ToString(), agentID.ToString());
            if (membership != null)
            {
                activeGroupID = membership.GroupID;
                activeGroupTitle = membership.GroupTitle;
                activeGroupPowers = membership.GroupPowers;
                activeGroupName = membership.GroupName;
            }

            UserAccount account = m_sceneList[0].UserAccountService.GetUserAccount(remoteClient.Scene.RegionInfo.ScopeID, agentID);
            string firstname, lastname;
            if (account != null)
            {
                firstname = account.FirstName;
                lastname = account.LastName;
            }
            else
            {
                firstname = "Unknown";
                lastname = "Unknown";
            }

            remoteClient.SendAgentDataUpdate(agentID, activeGroupID, firstname,
                    lastname, activeGroupPowers, activeGroupName,
                    activeGroupTitle);

            if (tellOthers)
                SendScenePresenceUpdate(agentID, activeGroupTitle);

            ScenePresence sp = (ScenePresence)remoteClient.SceneAgent;
            if (sp != null)
                sp.Grouptitle = activeGroupTitle;
        }
コード例 #7
0
        private void OnAgentDataUpdateRequest(IClientAPI remoteClient, UUID dataForAgentID, UUID sessionID,
            bool sendToAll)
        {
            if (m_debugEnabled)
                MainConsole.Instance.DebugFormat("[GROUPS]: {0} called", MethodBase.GetCurrentMethod().Name);

            UUID activeGroupID = UUID.Zero;
            string activeGroupTitle = string.Empty;
            string activeGroupName = string.Empty;
            ulong activeGroupPowers = (ulong) GroupPowers.None;

            GroupMembershipData membership = m_cachedGroupTitles.ContainsKey(dataForAgentID)
                                                 ? m_cachedGroupTitles[dataForAgentID]
                                                 : m_groupData.GetGroupMembershipData(
                                                     GetRequestingAgentID(remoteClient),
                                                     UUID.Zero,
                                                     dataForAgentID);
            m_cachedGroupTitles[dataForAgentID] = membership;
            if (membership != null)
            {
                activeGroupID = membership.GroupID;
                activeGroupTitle = membership.GroupTitle;
                activeGroupPowers = membership.GroupPowers;
                activeGroupName = membership.GroupName;
            }

            //Gotta tell the client about their groups
            remoteClient.SendAgentDataUpdate(dataForAgentID, activeGroupID, remoteClient.Name, activeGroupPowers, activeGroupName,
                                             activeGroupTitle);

            if (sendToAll)
                SendScenePresenceUpdate(dataForAgentID, activeGroupTitle);
        }
コード例 #8
0
        private void OnAgentDataUpdateRequest(IClientAPI remoteClient, UUID dataForAgentID, UUID sessionID, bool sendToAll)
        {
            if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);

            UUID activeGroupID = UUID.Zero;
            string activeGroupTitle = string.Empty;
            string activeGroupName = string.Empty;
            ulong activeGroupPowers  = (ulong)GroupPowers.None;

            GroupMembershipData membership = m_groupData.GetAgentActiveMembership(GetRequestingAgentID(remoteClient), dataForAgentID);
            if (membership != null)
            {
                activeGroupID = membership.GroupID;
                activeGroupTitle = membership.GroupTitle;
                activeGroupPowers = membership.GroupPowers;
                activeGroupName = membership.GroupName;
            }

            //Gotta tell the client about their groups
            remoteClient.SendAgentDataUpdate (dataForAgentID, activeGroupID, remoteClient.FirstName,
                    remoteClient.LastName, activeGroupPowers, activeGroupName,
                    activeGroupTitle);

            if(sendToAll)
                SendScenePresenceUpdate(dataForAgentID, activeGroupTitle);
        }
コード例 #9
0
        private void OnAgentDataUpdateRequest(IClientAPI remoteClient,
                                              UUID AgentID, UUID SessionID)
        {
            m_log.InfoFormat("[Groups] {0} called with SessionID :: {1}", System.Reflection.MethodBase.GetCurrentMethod().Name, SessionID);

            UUID   ActiveGroupID;
            string ActiveGroupTitle  = string.Empty;
            string ActiveGroupName   = string.Empty;
            ulong  ActiveGroupPowers = (ulong)GroupPowers.None;

            if (m_AgentActiveGroup.TryGetValue(AgentID, out ActiveGroupID))
            {
                if ((ActiveGroupID != null) && (ActiveGroupID != UUID.Zero))
                {
                    osGroup           group      = m_Groups[ActiveGroupID];
                    osGroupMemberInfo membership = m_GroupMemberInfo[AgentID][ActiveGroupID];

                    ActiveGroupName = group.Name;
                    if (membership.SelectedTitleRole != UUID.Zero)
                    {
                        ActiveGroupTitle = membership.Roles[membership.SelectedTitleRole].Title;
                    }

                    // Gather up all the powers from agent's roles, then mask them with group mask
                    foreach (osgRole role in membership.Roles.Values)
                    {
                        ActiveGroupPowers |= (ulong)role.Powers;
                    }
                    ActiveGroupPowers &= (ulong)group.PowersMask;
                }
                else
                {
                    ActiveGroupID = UUID.Zero;
                }
            }
            else
            {
                // I think this is needed bcasue the TryGetValue() will set this to null
                ActiveGroupID = UUID.Zero;
            }

            string     firstname, lastname;
            IClientAPI agent;

            if (m_ActiveClients.TryGetValue(AgentID, out agent))
            {
                firstname = agent.FirstName;
                lastname  = agent.LastName;
            }
            else
            {
                firstname = "Unknown";
                lastname  = "Unknown";
            }

            m_log.InfoFormat("[Groups] Active Powers {0}, Group {1}, Title {2}", ActiveGroupPowers, ActiveGroupName, ActiveGroupTitle);



            remoteClient.SendAgentDataUpdate(AgentID, ActiveGroupID, firstname,
                                             lastname, ActiveGroupPowers, ActiveGroupName,
                                             ActiveGroupTitle);
        }