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


C# Interfaces.FriendInfo類代碼示例

本文整理匯總了C#中OpenSim.Services.Interfaces.FriendInfo的典型用法代碼示例。如果您正苦於以下問題:C# FriendInfo類的具體用法?C# FriendInfo怎麽用?C# FriendInfo使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


FriendInfo類屬於OpenSim.Services.Interfaces命名空間,在下文中一共展示了FriendInfo類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: GetFriends

        public FriendInfo[] GetFriends(UUID principalID)
        {
            List<FriendInfo> infos = new List<FriendInfo>();
            List<string> query = GD.Query("PrincipalID", principalID, m_realm, "Friend,Flags");

            //These are used to get the other flags below
            List<string> keys = new List<string>();
            List<object> values = new List<object>();

            for (int i = 0; i < query.Count; i += 2)
            {
                FriendInfo info = new FriendInfo();
                info.PrincipalID = principalID;
                info.Friend = query[i];
                info.MyFlags = int.Parse(query[i + 1]);
                infos.Add(info);

                keys.Add("PrincipalID");
                keys.Add("Friend");
                values.Add(info.Friend);
                values.Add(info.PrincipalID);

                List<string> query2 = GD.Query(keys.ToArray(), values.ToArray(), m_realm, "Flags");
                if (query2.Count >= 1) infos[infos.Count - 1].TheirFlags = int.Parse(query2[0]);

                keys = new List<string>();
                values = new List<object>();
            }
            return infos.ToArray();
        }
開發者ID:x8ball,項目名稱:Aurora-Sim,代碼行數:30,代碼來源:LocalFriendsConnector.cs

示例2: RexLoginResponse

 public RexLoginResponse(UserAccount account, AgentCircuitData aCircuit, GridUserInfo pinfo,
     GridRegion destination, List<InventoryFolderBase> invSkel, FriendInfo[] friendsList, ILibraryService libService,
     string where, string startlocation, Vector3 position, Vector3 lookAt, List<InventoryItemBase> gestures, string message,
     GridRegion home, IPEndPoint clientIP, string mapTileURL, string searchURL)
     : base(account, aCircuit, pinfo, destination, invSkel, friendsList, libService, where, startlocation,
     position, lookAt, gestures, message, home, clientIP, mapTileURL, searchURL)
 {
 }
開發者ID:jonnenauha,項目名稱:ModreX,代碼行數:8,代碼來源:RexLoginResponse.cs

示例3: GetFriends

        public virtual FriendInfo[] GetFriends(string PrincipalID)
        {
            FriendsData[] data = m_Database.GetFriends(PrincipalID);
            List<FriendInfo> info = new List<FriendInfo>();

            foreach (FriendsData d in data)
            {
                FriendInfo i = new FriendInfo();

                if (!UUID.TryParse(d.PrincipalID, out i.PrincipalID))
                {
                    string tmp = string.Empty;
                    if (!Util.ParseUniversalUserIdentifier(d.PrincipalID, out i.PrincipalID, out tmp, out tmp, out tmp, out tmp))
                        // bad record. ignore this entry
                        continue;
                }
                i.Friend = d.Friend;
                i.MyFlags = Convert.ToInt32(d.Data["Flags"]);
                i.TheirFlags = Convert.ToInt32(d.Data["TheirFlags"]);

                info.Add(i);
            }

            return info.ToArray();
        }
開發者ID:BogusCurry,項目名稱:arribasim-dev,代碼行數:25,代碼來源:FriendsService.cs

示例4: GetFriends

        public FriendInfo[] GetFriends(UUID PrincipalID)
        {
            Dictionary<string, object> sendData = new Dictionary<string, object>();

            sendData["PRINCIPALID"] = PrincipalID.ToString();
            sendData["METHOD"] = "getfriends";

            string reqString = WebUtils.BuildQueryString(sendData);

            List<FriendInfo> finfos = new List<FriendInfo> ();
            try
            {
                List<string> serverURIs = m_registry.RequestModuleInterface<IConfigurationService>().FindValueOf("FriendsServerURI");
                foreach (string m_ServerURI in serverURIs)
                {
                    string reply = SynchronousRestFormsRequester.MakeRequest("POST",
                        m_ServerURI,
                        reqString);
                    if (reply != string.Empty)
                    {
                        Dictionary<string, object> replyData = WebUtils.ParseXmlResponse(reply);

                        if (replyData != null)
                        {
                            if (replyData.ContainsKey("result") && (replyData["result"].ToString().ToLower() == "null"))
                                continue;

                            Dictionary<string, object>.ValueCollection finfosList = replyData.Values;
                            //m_log.DebugFormat("[FRIENDS CONNECTOR]: get neighbours returned {0} elements", rinfosList.Count);
                            foreach (object f in finfosList)
                            {
                                if (f is Dictionary<string, object>)
                                {
                                    FriendInfo finfo = new FriendInfo((Dictionary<string, object>)f);
                                    finfos.Add(finfo);
                                }
                                else
                                    m_log.DebugFormat("[FRIENDS CONNECTOR]: GetFriends {0} received invalid response type {1}",
                                        PrincipalID, f.GetType());
                            }

                        }

                        else
                            m_log.DebugFormat("[FRIENDS CONNECTOR]: GetFriends {0} received null response",
                                PrincipalID);
                    }
                }
            }
            catch (Exception e)
            {
                m_log.DebugFormat("[FRIENDS CONNECTOR]: Exception when contacting friends server: {0}", e.Message);
            }

            // Success
            return finfos.ToArray ();
        }
開發者ID:RevolutionSmythe,項目名稱:Aurora-Sim,代碼行數:57,代碼來源:FriendsServiceConnector.cs

示例5: DeleteFriendship

        byte[] DeleteFriendship(Dictionary<string, object> request)
        {
            FriendInfo friend = new FriendInfo(request);
            string secret = string.Empty;
            if (request.ContainsKey("SECRET"))
                secret = request["SECRET"].ToString();

            if (secret == string.Empty)
                return FailureResult();

            FriendInfo[] finfos = m_FriendsService.GetFriends(friend.PrincipalID);
            foreach (FriendInfo finfo in finfos)
            {
                // We check the secret here
                if (finfo.Friend.StartsWith(friend.Friend) && finfo.Friend.EndsWith(secret))
                {
                    m_log.DebugFormat("[HGFRIENDS HANDLER]: Delete friendship {0} {1}", friend.PrincipalID, friend.Friend);
                    m_FriendsService.Delete(friend.PrincipalID, finfo.Friend);
                    m_FriendsService.Delete(finfo.Friend, friend.PrincipalID.ToString());

                    return SuccessResult();
                }
            }

            return FailureResult();
        }
開發者ID:justasabc,項目名稱:opensim,代碼行數:26,代碼來源:HGFriendsServerPostHandler.cs

示例6: NewFriendship

        byte[] NewFriendship(Dictionary<string, object> request)
        {
            if (!VerifyServiceKey(request))
                return FailureResult();

            // OK, can proceed
            FriendInfo friend = new FriendInfo(request);
            UUID friendID;
            string tmp = string.Empty;
            if (!Util.ParseUniversalUserIdentifier(friend.Friend, out friendID, out tmp, out tmp, out tmp, out tmp))
                return FailureResult();


            m_log.DebugFormat("[HGFRIENDS HANDLER]: New friendship {0} {1}", friend.PrincipalID, friend.Friend);

            // If the friendship already exists, return fail
            FriendInfo[] finfos = m_FriendsService.GetFriends(friend.PrincipalID);
            foreach (FriendInfo finfo in finfos)
                if (finfo.Friend.StartsWith(friendID.ToString()))
                    return FailureResult();

            // the user needs to confirm when he gets home
            bool success = m_FriendsService.StoreFriend(friend.PrincipalID.ToString(), friend.Friend, 0);

            if (success)
                return SuccessResult();
            else
                return FailureResult();
        }
開發者ID:justasabc,項目名稱:opensim,代碼行數:29,代碼來源:HGFriendsServerPostHandler.cs

示例7: DeleteFriendship

        byte[] DeleteFriendship(Dictionary<string, object> request)
        {
            FriendInfo friend = new FriendInfo(request);
            string secret = string.Empty;
            if (request.ContainsKey("SECRET"))
                secret = request["SECRET"].ToString();

            if (secret == string.Empty)
                return BoolResult(false);

            bool success = m_TheService.DeleteFriendship(friend, secret);

            return BoolResult(success);
        }
開發者ID:p07r0457,項目名稱:opensim,代碼行數:14,代碼來源:HGFriendsServerPostHandler.cs

示例8: Login


//.........這裏部分代碼省略.........
                    {
                        home = m_GridService.GetRegionByUUID(scopeID, guinfo.HomeRegionID);

                        if (home == null && startLocation == "home")
                        {
                            m_log.WarnFormat(
                                "[LLOGIN SERVICE]: User {0} tried to login to a 'home' start location with ID {1} but this was not found.",
                                account.Name, guinfo.HomeRegionID);
                        }
                    }
                }
                else
                {
                    // something went wrong, make something up, so that we don't have to test this anywhere else
                    m_log.DebugFormat("{0} Failed to fetch GridUserInfo. Creating empty GridUserInfo as home", LogHeader);
                    guinfo = new GridUserInfo();
                    guinfo.LastPosition = guinfo.HomePosition = new Vector3(128, 128, 30);
                }
                
                //
                // Find the destination region/grid
                //
                string where = string.Empty;
                Vector3 position = Vector3.Zero;
                Vector3 lookAt = Vector3.Zero;
                GridRegion gatekeeper = null;
                TeleportFlags flags;
                GridRegion destination = FindDestination(account, scopeID, guinfo, session, startLocation, home, out gatekeeper, out where, out position, out lookAt, out flags);
                if (destination == null)
                {
                    m_PresenceService.LogoutAgent(session);

                    m_log.InfoFormat(
                        "[LLOGIN SERVICE]: Login failed for {0} {1}, reason: destination not found",
                        firstName, lastName);
                    return LLFailedLoginResponse.GridProblem;
                }
                else
                {
                    m_log.DebugFormat(
                        "[LLOGIN SERVICE]: Found destination {0}, endpoint {1} for {2} {3}",
                        destination.RegionName, destination.ExternalEndPoint, firstName, lastName);
                }

                if (account.UserLevel >= 200)
                    flags |= TeleportFlags.Godlike;
                //
                // Get the avatar
                //
                AvatarAppearance avatar = null;
                if (m_AvatarService != null)
                {
                    avatar = m_AvatarService.GetAppearance(account.PrincipalID);
                }

                //
                // Instantiate/get the simulation interface and launch an agent at the destination
                //
                string reason = string.Empty;
                GridRegion dest;
                AgentCircuitData aCircuit = LaunchAgentAtGrid(gatekeeper, destination, account, avatar, session, secureSession, position, where, 
                    clientVersion, channel, mac, id0, clientIP, flags, out where, out reason, out dest);
                destination = dest;
                if (aCircuit == null)
                {
                    m_PresenceService.LogoutAgent(session);
                    m_log.InfoFormat("[LLOGIN SERVICE]: Login failed for {0} {1}, reason: {2}", firstName, lastName, reason);
                    return new LLFailedLoginResponse("key", reason, "false");

                }
                // Get Friends list 
                FriendInfo[] friendsList = new FriendInfo[0];
                if (m_FriendsService != null)
                {
                    friendsList = m_FriendsService.GetFriends(account.PrincipalID);
//                    m_log.DebugFormat("[LLOGIN SERVICE]: Retrieved {0} friends", friendsList.Length);
                }

                //
                // Finally, fill out the response and return it
                //
                LLLoginResponse response
                    = new LLLoginResponse(
                        account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService,
                        where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP,
                        m_MapTileURL, m_ProfileURL, m_OpenIDURL, m_SearchURL, m_Currency, m_DSTZone,
                        m_DestinationGuide, m_AvatarPicker, m_ClassifiedFee);

                m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to {0} {1}", firstName, lastName);

                return response;
            }
            catch (Exception e)
            {
                m_log.WarnFormat("[LLOGIN SERVICE]: Exception processing login for {0} {1}: {2} {3}", firstName, lastName, e.ToString(), e.StackTrace);
                if (m_PresenceService != null)
                    m_PresenceService.LogoutAgent(session);
                return LLFailedLoginResponse.InternalError;
            }
        }
開發者ID:BogusCurry,項目名稱:arribasim-dev,代碼行數:101,代碼來源:LLLoginService.cs

示例9: StatusNotify

        private void StatusNotify(FriendInfo friend, UUID userID, bool online)
        {
            UUID friendID;
            if (UUID.TryParse(friend.Friend, out friendID))
            {
                // Try local
                if (LocalStatusNotification(userID, friendID, online))
                    return;

                // The friend is not here [as root]. Let's forward.
                string[] AgentLocations = PresenceService.GetAgentsLocations(new string[] { friendID.ToString() });

                if (AgentLocations != null && (AgentLocations.Length != 1 && AgentLocations[0] != "Failure")) //If this is true, this doesn't exist on the presence server and we use the legacy way
                {
                    try
                    {
                        //New style update!
                        string http = AgentLocations[0].Remove(0, 7);
                        string address = http.Split(':')[0];
                        string port = http.Split(':')[1];
                        //Create a fake GridRegion
                        GridRegion region = new GridRegion() { ExternalHostName = address, HttpPort = uint.Parse(port) };
                        //m_log.DebugFormat("[FRIENDS]: Remote Notify to region {0}", region.RegionName);
                        m_FriendsSimConnector.StatusNotify(region, userID, friendID, online);
                        return;
                    }
                    catch (Exception ex)
                    {
                        //If something goes wrong, let it fall back
                        m_log.Warn("[FRIENDS]: Error in status update: " + ex);
                    }
                }
                PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() });
                if (friendSessions != null && friendSessions.Length > 0)
                {
                    PresenceInfo friendSession = null;
                    foreach (PresenceInfo pinfo in friendSessions)
                        if (pinfo.RegionID != UUID.Zero) // let's guard against sessions-gone-bad
                        {
                            friendSession = pinfo;
                            break;
                        }

                    if (friendSession != null)
                    {
                        GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID);
                        //m_log.DebugFormat("[FRIENDS]: Remote Notify to region {0}", region.RegionName);
                        m_FriendsSimConnector.StatusNotify(region, userID, friendID, online);
                    }
                }

                // Friend is not online. Ignore.
            }
            else
            {
                m_log.WarnFormat("[FRIENDS]: Error parsing friend ID {0}", friend.Friend);
            }
        }
開發者ID:shangcheng,項目名稱:Aurora,代碼行數:58,代碼來源:FriendsModule.cs

示例10: Login


//.........這裏部分代碼省略.........
                m_log.DebugFormat("[LLOGIN SERVICE]: {0} active gestures", gestures.Count);

                //
                // From here on, things should be exactly the same for all users
                //

                //
                // Login the presence
                //
                if (m_PresenceService != null)
                {
                    success = m_PresenceService.LoginAgent(account.PrincipalID.ToString(), session, secureSession);
                    if (!success)
                    {
                        m_log.InfoFormat("[DIVA LLOGIN SERVICE]: Login failed, reason: could not login presence");
                        return LLFailedLoginResponse.GridProblem;
                    }
                }

                //
                // Change Online status and get the home region
                //
                GridRegion home = null;
                GridUserInfo guinfo = m_GridUserService.LoggedIn(account.PrincipalID.ToString());
                if (guinfo != null && (guinfo.HomeRegionID != UUID.Zero) && m_GridService != null)
                {
                    home = m_GridService.GetRegionByUUID(scopeID, guinfo.HomeRegionID);
                }
                if (guinfo == null)
                {
                    // something went wrong, make something up, so that we don't have to test this anywhere else
                    guinfo = new GridUserInfo();
                    guinfo.LastPosition = guinfo.HomePosition = new Vector3(128, 128, 30);
                }

                //
                // Find the destination region/grid
                //
                string where = string.Empty;
                Vector3 position = Vector3.Zero;
                Vector3 lookAt = Vector3.Zero;
                GridRegion gatekeeper = null;
                TeleportFlags flags = TeleportFlags.Default;
                GridRegion destination = FindDestination(account, scopeID, guinfo, session, startLocation, home, out gatekeeper, out where, out position, out lookAt, out flags);
                if (destination == null)
                {
                    m_PresenceService.LogoutAgent(session);
                    m_log.InfoFormat("[DIVA LLOGIN SERVICE]: Login failed, reason: destination not found");
                    return LLFailedLoginResponse.GridProblem;
                }

                //
                // Get the avatar
                //
                AvatarAppearance avatar = null;
                if (m_AvatarService != null)
                {
                    avatar = m_AvatarService.GetAppearance(account.PrincipalID);
                }

                //
                // Instantiate/get the simulation interface and launch an agent at the destination
                //
                string reason = string.Empty;
                GridRegion dest = null;
                AgentCircuitData aCircuit = LaunchAgentAtGrid(gatekeeper, destination, account, avatar, session, secureSession, position, where,
                    clientVersion, channel, mac, id0, clientIP, flags, out where, out reason, out dest);

                if (aCircuit == null)
                {
                    m_PresenceService.LogoutAgent(session);
                    m_log.InfoFormat("[DIVA LLOGIN SERVICE]: Login failed, reason: {0}", reason);
                    return new LLFailedLoginResponse("key", reason, "false");

                }
                // Get Friends list 
                FriendInfo[] friendsList = new FriendInfo[0];
                if (m_FriendsService != null)
                {
                    friendsList = m_FriendsService.GetFriends(account.PrincipalID);
                    m_log.DebugFormat("[DIVA LLOGIN SERVICE]: Retrieved {0} friends", friendsList.Length);
                }

                //
                // Finally, fill out the response and return it
                //
                LLLoginResponse response = new LLLoginResponse(account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService,
                    where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP, m_MapTileURL, m_SearchURL);

                m_log.DebugFormat("[DIVA LLOGIN SERVICE]: All clear. Sending login response to client.");
                return response;
            }
            catch (Exception e)
            {
                m_log.WarnFormat("[DIVA LLOGIN SERVICE]: Exception processing login for {0} {1}: {2} {3}", firstName, lastName, e.ToString(), e.StackTrace);
                if (m_PresenceService != null)
                    m_PresenceService.LogoutAgent(session);
                return LLFailedLoginResponse.InternalError;
            }
        }
開發者ID:caocao,項目名稱:diva-distribution,代碼行數:101,代碼來源:LLLoginService.cs

示例11: NewFriendship

        public bool NewFriendship(FriendInfo friend, bool verified)
        {
            UUID friendID;
            string tmp = string.Empty, url = String.Empty, first = String.Empty, last = String.Empty;
            if (!Util.ParseUniversalUserIdentifier(friend.Friend, out friendID, out url, out first, out last, out tmp))
                return false;

            m_log.DebugFormat("[HGFRIENDS SERVICE]: New friendship {0} {1} ({2})", friend.PrincipalID, friend.Friend, verified);

            // Does the friendship already exist?
            FriendInfo[] finfos = m_FriendsService.GetFriends(friend.PrincipalID);
            foreach (FriendInfo finfo in finfos)
            {
                if (finfo.Friend.StartsWith(friendID.ToString()))
                    return false;
            }
            // Verified user session. But the user needs to confirm friendship when he gets home
            if (verified)
                return m_FriendsService.StoreFriend(friend.PrincipalID.ToString(), friend.Friend, 0);

            // Does the reverted friendship exist? meaning that this user initiated the request
            finfos = m_FriendsService.GetFriends(friendID);
            bool userInitiatedOffer = false;
            foreach (FriendInfo finfo in finfos)
            {
                if (friend.Friend.StartsWith(finfo.PrincipalID.ToString()) && finfo.Friend.StartsWith(friend.PrincipalID.ToString()) && finfo.TheirFlags == -1)
                {
                    userInitiatedOffer = true;
                    // Let's delete the existing friendship relations that was stored
                    m_FriendsService.Delete(friendID, finfo.Friend);
                    break;
                }
            }

            if (userInitiatedOffer)
            {
                m_FriendsService.StoreFriend(friend.PrincipalID.ToString(), friend.Friend, 1);
                m_FriendsService.StoreFriend(friend.Friend, friend.PrincipalID.ToString(), 1);
                // notify the user
                ForwardToSim("ApproveFriendshipRequest", friendID, Util.UniversalName(first, last, url), "", friend.PrincipalID, "");
                return true;
            }
            return false;
        }
開發者ID:BogusCurry,項目名稱:arribasim-dev,代碼行數:44,代碼來源:HGFriendsService.cs

示例12: GetFriendsFromService

        public override FriendInfo[] GetFriendsFromService(IClientAPI client)
        {
            //            m_log.DebugFormat("[HGFRIENDS MODULE]: Entering GetFriendsFromService for {0}", client.Name);
            Boolean agentIsLocal = true;
            if (UserManagementModule != null)
                agentIsLocal = UserManagementModule.IsLocalGridUser(client.AgentId);

            if (agentIsLocal)
                return base.GetFriendsFromService(client);

            FriendInfo[] finfos = new FriendInfo[0];
            // Foreigner
            AgentCircuitData agentClientCircuit = ((Scene)(client.Scene)).AuthenticateHandler.GetAgentCircuitData(client.CircuitCode);
            if (agentClientCircuit != null)
            {
                // Note that this is calling a different interface than base; this one calls with a string param!
                finfos = FriendsService.GetFriends(client.AgentId.ToString());
                m_log.DebugFormat("[HGFRIENDS MODULE]: Fetched {0} local friends for visitor {1}", finfos.Length, client.AgentId.ToString());
            }

            //            m_log.DebugFormat("[HGFRIENDS MODULE]: Exiting GetFriendsFromService for {0}", client.Name);

            return finfos;
        }
開發者ID:AkiraSonoda,項目名稱:akisim,代碼行數:24,代碼來源:HGFriendsModule.cs

示例13: Login


//.........這裏部分代碼省略.........
                    return LLFailedLoginResponse.InventoryProblem;
                }
                List<InventoryFolderBase> inventorySkel = m_InventoryService.GetInventorySkeleton(account.PrincipalID);
                if (m_RequireInventory && ((inventorySkel == null) || (inventorySkel != null && inventorySkel.Count == 0)))
                {
                    m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: unable to retrieve user inventory");
                    return LLFailedLoginResponse.InventoryProblem;
                }

                //
                // Login the presence
                //
                if (m_PresenceService != null)
                {
                    success = m_PresenceService.LoginAgent(account.PrincipalID.ToString(), session, secureSession);
                    if (!success)
                    {
                        m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: could not login presence");
                        return LLFailedLoginResponse.GridProblem;
                    }
                }

                //
                // Change Online status and get the home region
                //
                GridRegion home = null;
                GridUserInfo guinfo = m_GridUserService.LoggedIn(account.PrincipalID.ToString());
                if (guinfo != null && (guinfo.HomeRegionID != UUID.Zero) && m_GridService != null)
                {
                    home = m_GridService.GetRegionByUUID(scopeID, guinfo.HomeRegionID);
                }
                if (guinfo == null)
                {
                    // something went wrong, make something up, so that we don't have to test this anywhere else
                    guinfo = new GridUserInfo();
                    guinfo.LastPosition = guinfo.HomePosition = new Vector3(128, 128, 30);               
                }
                
                //
                // Find the destination region/grid
                //
                string where = string.Empty;
                Vector3 position = Vector3.Zero;
                Vector3 lookAt = Vector3.Zero;
                GridRegion gatekeeper = null;
                GridRegion destination = FindDestination(account, scopeID, guinfo, session, startLocation, home, out gatekeeper, out where, out position, out lookAt);
                if (destination == null)
                {
                    m_PresenceService.LogoutAgent(session);
                    m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: destination not found");
                    return LLFailedLoginResponse.GridProblem;
                }

                //
                // Get the avatar
                //
                AvatarData avatar = null;
                if (m_AvatarService != null)
                {
                    avatar = m_AvatarService.GetAvatar(account.PrincipalID);
                }

                //
                // Instantiate/get the simulation interface and launch an agent at the destination
                //
                string reason = string.Empty;
                AgentCircuitData aCircuit = LaunchAgentAtGrid(gatekeeper, destination, account, avatar, session, secureSession, position, where, clientVersion, out where, out reason);

                if (aCircuit == null)
                {
                    m_PresenceService.LogoutAgent(session);
                    m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: {0}", reason);
                    return LLFailedLoginResponse.AuthorizationProblem;

                }
                // Get Friends list 
                FriendInfo[] friendsList = new FriendInfo[0];
                if (m_FriendsService != null)
                {
                    friendsList = m_FriendsService.GetFriends(account.PrincipalID);
                    m_log.DebugFormat("[LLOGIN SERVICE]: Retrieved {0} friends", friendsList.Length);
                }

                //
                // Finally, fill out the response and return it
                //
                LLLoginResponse response = new LLLoginResponse(account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService,
                    where, startLocation, position, lookAt, m_WelcomeMessage, home, clientIP);

                m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to client.");
                return response;
            }
            catch (Exception e)
            {
                m_log.WarnFormat("[LLOGIN SERVICE]: Exception processing login for {0} {1}: {2} {3}", firstName, lastName, e.ToString(), e.StackTrace);
                if (m_PresenceService != null)
                    m_PresenceService.LogoutAgent(session);
                return LLFailedLoginResponse.InternalError;
            }
        }
開發者ID:mcortez,項目名稱:opensim,代碼行數:101,代碼來源:LLLoginService.cs

示例14: StoreFriend

        public bool StoreFriend(UUID PrincipalID, string Friend, int flags)
        {
            FriendInfo finfo = new FriendInfo();
            finfo.PrincipalID = PrincipalID;
            finfo.Friend = Friend;
            finfo.MyFlags = flags;

            Dictionary<string, object> sendData = finfo.ToKeyValuePairs();

            sendData["METHOD"] = "storefriend";

            string reqString = ServerUtils.BuildQueryString(sendData);

            string reply = string.Empty;
            try
            {
                reply = SynchronousRestFormsRequester.MakeRequest("POST",
                        m_ServerURI + "/friends",
                        ServerUtils.BuildQueryString(sendData));
            }
            catch (Exception e)
            {
                m_log.DebugFormat("[FRIENDS CONNECTOR]: Exception when contacting friends server: {0}", e.Message);
                return false;
            }

            if (reply != string.Empty)
            {
                Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);

                if ((replyData != null) && replyData.ContainsKey("Result") && (replyData["Result"] != null))
                {
                    bool success = false;
                    Boolean.TryParse(replyData["Result"].ToString(), out success);
                    return success;
                }
                else
                    m_log.DebugFormat("[FRIENDS CONNECTOR]: StoreFriend {0} {1} received null response",
                        PrincipalID, Friend);
            }
            else
                m_log.DebugFormat("[FRIENDS CONNECTOR]: StoreFriend received null reply");

            return false;

        }
開發者ID:AlexRa,項目名稱:opensim-mods-Alex,代碼行數:46,代碼來源:FriendsServiceConnector.cs

示例15: GetFriends

        protected FriendInfo[] GetFriends(Dictionary<string, object> sendData, string PrincipalID)
        {
            string reqString = ServerUtils.BuildQueryString(sendData);
            string uri = m_ServerURI + "/friends";

            try
            {
                string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString, m_Auth);
                if (reply != string.Empty)
                {
                    Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);

                    if (replyData != null)
                    {
                        if (replyData.ContainsKey("result") && (replyData["result"].ToString().ToLower() == "null"))
                        {
                        return new FriendInfo[0];
                        }

                        List<FriendInfo> finfos = new List<FriendInfo>();
                        Dictionary<string, object>.ValueCollection finfosList = replyData.Values;
                        //m_log.DebugFormat("[FRIENDS SERVICE CONNECTOR]: get neighbours returned {0} elements", rinfosList.Count);
                        foreach (object f in finfosList)
                        {
                            if (f is Dictionary<string, object>)
                            {
                                FriendInfo finfo = new FriendInfo((Dictionary<string, object>)f);
                                finfos.Add(finfo);
                            }
                            else
                                m_log.DebugFormat("[FRIENDS SERVICE CONNECTOR]: GetFriends {0} received invalid response type {1}",
                                    PrincipalID, f.GetType());
                        }

                        // Success
                        return finfos.ToArray();
                    }
                    else
                        m_log.DebugFormat("[FRIENDS SERVICE CONNECTOR]: GetFriends {0} received null response",
                            PrincipalID);

                }
            }
            catch (Exception e)
            {
                m_log.DebugFormat("[FRIENDS SERVICE CONNECTOR]: Exception when contacting friends server at {0}: {1}", uri, e.Message);
            }

            return new FriendInfo[0];

        }
開發者ID:BogusCurry,項目名稱:arribasim-dev,代碼行數:51,代碼來源:FriendsServicesConnector.cs


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