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


C# SceneHelpers.GetScenePresence方法代碼示例

本文整理匯總了C#中OpenSim.Tests.Common.SceneHelpers.GetScenePresence方法的典型用法代碼示例。如果您正苦於以下問題:C# SceneHelpers.GetScenePresence方法的具體用法?C# SceneHelpers.GetScenePresence怎麽用?C# SceneHelpers.GetScenePresence使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在OpenSim.Tests.Common.SceneHelpers的用法示例。


在下文中一共展示了SceneHelpers.GetScenePresence方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: TestCloseAgent

        public void TestCloseAgent()
        {
            TestHelpers.InMethod();
//            log4net.Config.XmlConfigurator.Configure();

            TestScene scene = new SceneHelpers().SetupScene();
            ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1));

            Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(sp.UUID), Is.Not.Null);
            Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(1));

            scene.IncomingCloseAgent(sp.UUID);

            Assert.That(scene.GetScenePresence(sp.UUID), Is.Null);
            Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(sp.UUID), Is.Null);
            Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(0));
        }
開發者ID:OpenPlex-Sim,項目名稱:opensim,代碼行數:17,代碼來源:ScenePresenceAgentTests.cs

示例2: TestCreateRootScenePresence

        public void TestCreateRootScenePresence()
        {
            TestHelpers.InMethod();
//            TestHelpers.EnableLogging();

            UUID spUuid = TestHelpers.ParseTail(0x1);

            TestScene scene = new SceneHelpers().SetupScene();
            SceneHelpers.AddScenePresence(scene, spUuid);

            Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(spUuid), Is.Not.Null);
            Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(1));

            ScenePresence sp = scene.GetScenePresence(spUuid);
            Assert.That(sp, Is.Not.Null);
            Assert.That(sp.IsChildAgent, Is.False);
            Assert.That(sp.UUID, Is.EqualTo(spUuid));

            Assert.That(scene.GetScenePresences().Count, Is.EqualTo(1));
        }
開發者ID:rryk,項目名稱:omp-server,代碼行數:20,代碼來源:ScenePresenceAgentTests.cs

示例3: TestAddClient

        public void TestAddClient()
        {
            TestHelpers.InMethod();
//            XmlConfigurator.Configure();

            TestScene scene = new SceneHelpers().SetupScene();
            uint myCircuitCode = 123456;
            UUID myAgentUuid   = TestHelpers.ParseTail(0x1);
            UUID mySessionUuid = TestHelpers.ParseTail(0x2);
            IPEndPoint testEp = new IPEndPoint(IPAddress.Loopback, 999);

            uint port = 0;
            AgentCircuitManager acm = scene.AuthenticateHandler;

            TestLLUDPServer llUdpServer
                = new TestLLUDPServer(IPAddress.Any, ref port, 0, false, new IniConfigSource(), acm);
            llUdpServer.AddScene(scene);

            UseCircuitCodePacket uccp = new UseCircuitCodePacket();

            UseCircuitCodePacket.CircuitCodeBlock uccpCcBlock
                = new UseCircuitCodePacket.CircuitCodeBlock();
            uccpCcBlock.Code = myCircuitCode;
            uccpCcBlock.ID = myAgentUuid;
            uccpCcBlock.SessionID = mySessionUuid;
            uccp.CircuitCode = uccpCcBlock;

            byte[] uccpBytes = uccp.ToBytes();
            UDPPacketBuffer upb = new UDPPacketBuffer(testEp, uccpBytes.Length);
            upb.DataLength = uccpBytes.Length;  // God knows why this isn't set by the constructor.
            Buffer.BlockCopy(uccpBytes, 0, upb.Data, 0, uccpBytes.Length);

            llUdpServer.PacketReceived(upb);

            // Presence shouldn't exist since the circuit manager doesn't know about this circuit for authentication yet
            Assert.That(scene.GetScenePresence(myAgentUuid), Is.Null);

            AgentCircuitData acd = new AgentCircuitData();
            acd.AgentID = myAgentUuid;
            acd.SessionID = mySessionUuid;

            acm.AddNewCircuit(myCircuitCode, acd);

            llUdpServer.PacketReceived(upb);

            // Should succeed now
            ScenePresence sp = scene.GetScenePresence(myAgentUuid);
            Assert.That(sp.UUID, Is.EqualTo(myAgentUuid));

            Assert.That(llUdpServer.PacketsSent.Count, Is.EqualTo(1));

            Packet packet = llUdpServer.PacketsSent[0];
            Assert.That(packet, Is.InstanceOf(typeof(PacketAckPacket)));

            PacketAckPacket ackPacket = packet as PacketAckPacket;
            Assert.That(ackPacket.Packets.Length, Is.EqualTo(1));
            Assert.That(ackPacket.Packets[0].ID, Is.EqualTo(0));
        }
開發者ID:OpenPlex-Sim,項目名稱:opensim,代碼行數:58,代碼來源:BasicCircuitTests.cs

示例4: TestCloseAgent

        public void TestCloseAgent()
        {
            TestHelpers.InMethod();
//            TestHelpers.EnableLogging();

            TestScene scene = new SceneHelpers().SetupScene();
            ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1));

            scene.IncomingCloseAgent(sp.UUID, false);

            Assert.That(scene.GetScenePresence(sp.UUID), Is.Null);
            Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(sp.UUID), Is.Null);
            Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(0));

//            TestHelpers.DisableLogging();
        }
開發者ID:rryk,項目名稱:omp-server,代碼行數:16,代碼來源:ScenePresenceAgentTests.cs

示例5: TestCreateDuplicateRootScenePresence

        public void TestCreateDuplicateRootScenePresence()
        {
            TestHelpers.InMethod();
//            TestHelpers.EnableLogging();

            UUID spUuid = TestHelpers.ParseTail(0x1);

            // The etm is only invoked by this test to check whether an agent is still in transit if there is a dupe
            EntityTransferModule etm = new EntityTransferModule();

            IConfigSource config = new IniConfigSource();
            IConfig modulesConfig = config.AddConfig("Modules");
            modulesConfig.Set("EntityTransferModule", etm.Name);
            IConfig entityTransferConfig = config.AddConfig("EntityTransfer");

            // In order to run a single threaded regression test we do not want the entity transfer module waiting
            // for a callback from the destination scene before removing its avatar data.
            entityTransferConfig.Set("wait_for_callback", false);

            TestScene scene = new SceneHelpers().SetupScene();
            SceneHelpers.SetupSceneModules(scene, config, etm);
            SceneHelpers.AddScenePresence(scene, spUuid);
            SceneHelpers.AddScenePresence(scene, spUuid);

            Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(spUuid), Is.Not.Null);
            Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(1));

            ScenePresence sp = scene.GetScenePresence(spUuid);
            Assert.That(sp, Is.Not.Null);
            Assert.That(sp.IsChildAgent, Is.False);
            Assert.That(sp.UUID, Is.EqualTo(spUuid));
        }
開發者ID:hack13,項目名稱:opensimulator,代碼行數:32,代碼來源:ScenePresenceAgentTests.cs


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