NewUserConnection() public method

Do the work necessary to initiate a new user connection for a particular scene. At the moment, this consists of setting up the caps infrastructure The return bool should allow for connections to be refused, but as not all calling paths take proper notice of it let, we allowed banned users in still.
public NewUserConnection ( AgentCircuitData agent, uint teleportFlags, string &reason ) : bool
agent AgentCircuitData CircuitData of the agent who is connecting
teleportFlags uint
reason string Outputs the reason for the false response on this string
return bool
Exemplo n.º 1
0
        /// <summary>
        /// Introduce an agent into the scene by adding a new client.
        /// </summary>
        /// <returns>The scene presence added</returns>
        /// <param name='scene'></param>
        /// <param name='testClient'></param>
        /// <param name='agentData'></param>
        /// <param name='tf'></param>
        private static ScenePresence IntroduceClientToScene(
            Scene scene, IClientAPI client, AgentCircuitData agentData, TeleportFlags tf)
        {
            string reason;

            // Stage 1: tell the scene to expect a new user connection
            if (!scene.NewUserConnection(agentData, (uint)tf, null, out reason))
                Console.WriteLine("NewUserConnection failed: " + reason);

            // Stage 2: add the new client as a child agent to the scene
            scene.AddNewAgent(client, PresenceType.User);

            return scene.GetScenePresence(client.AgentId);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Add a root agent.
        /// </summary>
        ///
        /// This function
        ///
        /// 1)  Tells the scene that an agent is coming.  Normally, the login service (local if standalone, from the
        /// userserver if grid) would give initial login data back to the client and separately tell the scene that the
        /// agent was coming.
        ///
        /// 2)  Connects the agent with the scene
        ///
        /// This function performs actions equivalent with notifying the scene that an agent is
        /// coming and then actually connecting the agent to the scene.  The one step missed out is the very first
        ///
        /// <param name="scene"></param>
        /// <param name="agentData"></param>
        /// <returns></returns>
        public static TestClient AddRootAgent(Scene scene, AgentCircuitData agentData)
        {
            string reason;

            // We emulate the proper login sequence here by doing things in four stages

            // Stage 0: log the presence
            scene.PresenceService.LoginAgent(agentData.AgentID.ToString(), agentData.SessionID, agentData.SecureSessionID);

            // Stage 1: simulate login by telling the scene to expect a new user connection
            if (!scene.NewUserConnection(agentData, (uint)TeleportFlags.ViaLogin, out reason))
                Console.WriteLine("NewUserConnection failed: " + reason);

            // Stage 2: add the new client as a child agent to the scene
            TestClient client = new TestClient(agentData, scene);
            scene.AddNewClient(client);

            // Stage 3: Invoke agent crossing, which converts the child agent into a root agent (with appearance,
            // inventory, etc.)
            //scene.AgentCrossing(agentData.AgentID, new Vector3(90, 90, 90), false); OBSOLETE

            ScenePresence scp = scene.GetScenePresence(agentData.AgentID);
            scp.MakeRootAgent(new Vector3(90, 90, 90), true);

            return client;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Add a root agent.
        /// </summary>
        ///
        /// This function
        ///
        /// 1)  Tells the scene that an agent is coming.  Normally, the login service (local if standalone, from the
        /// userserver if grid) would give initial login data back to the client and separately tell the scene that the
        /// agent was coming.
        ///
        /// 2)  Connects the agent with the scene
        ///
        /// This function performs actions equivalent with notifying the scene that an agent is
        /// coming and then actually connecting the agent to the scene.  The one step missed out is the very first
        ///
        /// <param name="scene"></param>
        /// <param name="agentData"></param>
        /// <returns></returns>
        public static TestClient AddRootAgent(Scene scene, AgentCircuitData agentData)
        {
            string reason;

            // We emulate the proper login sequence here by doing things in three stages
            // Stage 1: simulate login by telling the scene to expect a new user connection
            scene.NewUserConnection(agentData, out reason);

            // Stage 2: add the new client as a child agent to the scene
            TestClient client = new TestClient(agentData, scene);
            scene.AddNewClient(client);

            // Stage 3: Invoke agent crossing, which converts the child agent into a root agent (with appearance,
            // inventory, etc.)
            //scene.AgentCrossing(agentData.AgentID, new Vector3(90, 90, 90), false); OBSOLETE

            ScenePresence scp = scene.GetScenePresence(agentData.AgentID);
            scp.MakeRootAgent(new Vector3(90,90,90), true);

            return client;
        }
Exemplo n.º 4
0
        /// <summary>
        /// Add a root agent.
        /// </summary>
        /// <remarks>
        /// This function
        ///
        /// 1)  Tells the scene that an agent is coming.  Normally, the login service (local if standalone, from the
        /// userserver if grid) would give initial login data back to the client and separately tell the scene that the
        /// agent was coming.
        ///
        /// 2)  Connects the agent with the scene
        ///
        /// This function performs actions equivalent with notifying the scene that an agent is
        /// coming and then actually connecting the agent to the scene.  The one step missed out is the very first
        /// </remarks>
        /// <param name="scene"></param>
        /// <param name="agentData"></param>
        /// <returns></returns>
        public static ScenePresence AddScenePresence(Scene scene, AgentCircuitData agentData)
        {
            string reason;

            // We emulate the proper login sequence here by doing things in four stages

            // Stage 0: log the presence
            scene.PresenceService.LoginAgent(agentData.AgentID.ToString(), agentData.SessionID, agentData.SecureSessionID);

            // Stage 1: simulate login by telling the scene to expect a new user connection
            if (!scene.NewUserConnection(agentData, (uint)TeleportFlags.ViaLogin, out reason))
                Console.WriteLine("NewUserConnection failed: " + reason);

            // Stage 2: add the new client as a child agent to the scene
            TestClient client = new TestClient(agentData, scene);
            scene.AddNewClient(client, PresenceType.User);

            // Stage 3: Complete the entrance into the region.  This converts the child agent into a root agent.
            ScenePresence scp = scene.GetScenePresence(agentData.AgentID);
            scp.CompleteMovement(client, true);
            //scp.MakeRootAgent(new Vector3(90, 90, 90), true);

            return scp;
        }