示例#1
0
        private void ForwardFriendshipOffer(UUID agentID, UUID friendID, GridInstantMessage im)
        {
            // !!!!!!!! This is a hack so that we don't have to keep state (transactionID/imSessionID)
            // We stick this agent's ID as imSession, so that it's directly available on the receiving end
            im.imSessionID = im.fromAgentID;

            // Try the local sim
            UserAccount account = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, agentID);

            im.fromAgentName = (account == null) ? "Unknown" : account.FirstName + " " + account.LastName;

            if (LocalFriendshipOffered(friendID, im))
            {
                return;
            }

            // The prospective friend is not here [as root]. Let's forward.
            UserInfo friendSession = m_Scenes[0].RequestModuleInterface <IAgentInfoService>().GetUserInfo(friendID.ToString());

            if (friendSession != null && friendSession.IsOnline)
            {
                GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.CurrentRegionID);
                AsyncMessagePostService.Post(region.RegionHandle, SyncMessageHelper.FriendshipOffered(
                                                 agentID, friendID, im, region.RegionHandle));
            }
            // If the prospective friend is not online, he'll get the message upon login.
        }
示例#2
0
        private void ForwardFriendshipOffer(UUID agentID, UUID friendID, GridInstantMessage im)
        {
            // !!!!!!!! This is a hack so that we don't have to keep state (transactionID/imSessionID)
            // We stick this agent's ID as imSession, so that it's directly available on the receiving end
            im.SessionID = im.FromAgentID;

            // Try the local sim
            UserAccount account = UserAccountService.GetUserAccount(m_scene.RegionInfo.AllScopeIDs, agentID);

            im.FromAgentName = (account == null) ? "Unknown" : account.Name;

            if (LocalFriendshipOffered(friendID, im))
            {
                return;
            }

            // The prospective friend is not here [as root]. Let's4 forward.
            SyncMessagePosterService.PostToServer(SyncMessageHelper.FriendshipOffered(agentID, friendID, im,
                                                                                      m_scene.RegionInfo.RegionID));
            // If the prospective friend is not online, he'll get the message upon login.
        }