Exemplo n.º 1
0
        /// <summary>
        /// UserServer sends an expect_user method
        /// this handles the method and provisions the
        /// necessary info for presence to work
        /// </summary>
        /// <param name="request">UserServer Data</param>
        /// <returns></returns>
        public XmlRpcResponse UserLoggedOn(XmlRpcRequest request, IPEndPoint remoteClient)
        {
            Hashtable requestData = (Hashtable)request.Params[0];

            AgentCircuitData agentData = new AgentCircuitData();

            agentData.SessionID       = new UUID((string)requestData["sessionid"]);
            agentData.SecureSessionID = new UUID((string)requestData["secure_session_id"]);
            agentData.FirstName       = (string)requestData["firstname"];
            agentData.LastName        = (string)requestData["lastname"];
            agentData.AgentID         = new UUID((string)requestData["agentid"]);
            agentData.CircuitCode     = Convert.ToUInt32(requestData["circuit_code"]);
            agentData.CapsPath        = (string)requestData["caps_path"];

            if (requestData.ContainsKey("child_agent") && requestData["child_agent"].Equals("1"))
            {
                agentData.child = true;
            }
            else
            {
                agentData.startpos =
                    new Vector3(Convert.ToSingle(requestData["positionx"]),
                                Convert.ToSingle(requestData["positiony"]),
                                Convert.ToSingle(requestData["positionz"]));
                agentData.child = false;
            }

            ulong regionHandle = Convert.ToUInt64((string)requestData["regionhandle"]);

            m_log.InfoFormat("[LOGON]: User {0} {1} logged into region {2} as {3} agent, building indexes for user",
                             agentData.FirstName, agentData.LastName, regionHandle, agentData.child ? "child" : "root");

            UserPresenceData up = new UserPresenceData();

            up.agentData  = agentData;
            up.friendData = GetUserFriendList(agentData.AgentID);

            // Null reference exception in een by Vinhold on GW grid in enqueuePresenceUpdate with a null receiver.regionData
            // Should never be null but GetRegionInfo() can return that. Probably crash/quit/disconnect during login.
            RegionProfileData regionData = m_regionModule.GetRegionInfo(regionHandle);

            if (regionData != null) // else go with non-null default UserPresenceData.regionData
            {
                up.regionData         = regionData;
                up.OnlineYN           = true;
                up.lookupUserRegionYN = false;
                ProcessFriendListSubscriptions(up);
            }

            return(new XmlRpcResponse());
        }
Exemplo n.º 2
0
        /// <summary>
        /// UserServer sends an expect_user method
        /// this handles the method and provisions the
        /// necessary info for presence to work
        /// </summary>
        /// <param name="request">UserServer Data</param>
        /// <returns></returns>
        public XmlRpcResponse UserLoggedOn(XmlRpcRequest request, IPEndPoint remoteClient)
        {
            Hashtable requestData = (Hashtable)request.Params[0];

            AgentCircuitData agentData = new AgentCircuitData();

            agentData.SessionID       = new UUID((string)requestData["sessionid"]);
            agentData.SecureSessionID = new UUID((string)requestData["secure_session_id"]);
            agentData.firstname       = (string)requestData["firstname"];
            agentData.lastname        = (string)requestData["lastname"];
            agentData.AgentID         = new UUID((string)requestData["agentid"]);
            agentData.circuitcode     = Convert.ToUInt32(requestData["circuit_code"]);
            agentData.CapsPath        = (string)requestData["caps_path"];

            if (requestData.ContainsKey("child_agent") && requestData["child_agent"].Equals("1"))
            {
                agentData.child = true;
            }
            else
            {
                agentData.startpos =
                    new Vector3(Convert.ToSingle(requestData["positionx"]),
                                Convert.ToSingle(requestData["positiony"]),
                                Convert.ToSingle(requestData["positionz"]));
                agentData.child = false;
            }

            ulong regionHandle = Convert.ToUInt64((string)requestData["regionhandle"]);

            m_log.InfoFormat("[LOGON]: User {0} {1} logged into region {2} as {3} agent, building indexes for user",
                             agentData.firstname, agentData.lastname, regionHandle, agentData.child ? "child" : "root");

            UserPresenceData up = new UserPresenceData();

            up.agentData          = agentData;
            up.friendData         = GetUserFriendList(agentData.AgentID);
            up.regionData         = m_regionModule.GetRegionInfo(regionHandle);
            up.OnlineYN           = true;
            up.lookupUserRegionYN = false;
            ProcessFriendListSubscriptions(up);

            return(new XmlRpcResponse());
        }