当前位置: 首页>>代码示例>>C#>>正文


C# ScenePresence.SendOtherAgentsAppearanceToClient方法代码示例

本文整理汇总了C#中OpenSim.Region.Framework.Scenes.ScenePresence.SendOtherAgentsAppearanceToClient方法的典型用法代码示例。如果您正苦于以下问题:C# ScenePresence.SendOtherAgentsAppearanceToClient方法的具体用法?C# ScenePresence.SendOtherAgentsAppearanceToClient怎么用?C# ScenePresence.SendOtherAgentsAppearanceToClient使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OpenSim.Region.Framework.Scenes.ScenePresence的用法示例。


在下文中一共展示了ScenePresence.SendOtherAgentsAppearanceToClient方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CrossAgentToNewRegionPost

        public void CrossAgentToNewRegionPost(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion,
            bool isFlying, string version)
        {
            agent.ControllingClient.RequestClientInfo();

            string agentcaps;
            if (!agent.KnownRegions.TryGetValue(neighbourRegion.RegionHandle, out agentcaps))
            {
                m_log.ErrorFormat("[ENTITY TRANSFER MODULE]: No ENTITY TRANSFER MODULE information for region handle {0}, exiting CrossToNewRegion.",
                                 neighbourRegion.RegionHandle);
                return;
            }

            // No turning back
            agent.IsChildAgent = true;

            string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentcaps);

            m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID);

            Vector3 vel2 = new Vector3(agent.Velocity.X, agent.Velocity.Y, 0);

            if (m_eqModule != null)
            {
                m_eqModule.CrossRegion(
                    neighbourRegion.RegionHandle, pos + agent.Velocity, vel2 /* agent.Velocity */,
                    neighbourRegion.ExternalEndPoint,
                    capsPath, agent.UUID, agent.ControllingClient.SessionId,
                    neighbourRegion.RegionSizeX, neighbourRegion.RegionSizeY);
            }
            else
            {
                m_log.ErrorFormat("{0} Using old CrossRegion packet. Varregion will not work!!", LogHeader);
                agent.ControllingClient.CrossRegion(neighbourRegion.RegionHandle, pos + agent.Velocity, agent.Velocity, neighbourRegion.ExternalEndPoint,
                                            capsPath);
            }

            // SUCCESS!
            m_entityTransferStateMachine.UpdateInTransit(agent.UUID, AgentTransferState.ReceivedAtDestination);

            // Unlike a teleport, here we do not wait for the destination region to confirm the receipt.
            m_entityTransferStateMachine.UpdateInTransit(agent.UUID, AgentTransferState.CleaningUp);

            agent.MakeChildAgent();

            // FIXME: Possibly this should occur lower down after other commands to close other agents,
            // but not sure yet what the side effects would be.
            m_entityTransferStateMachine.ResetFromTransit(agent.UUID);

            // now we have a child agent in this region. Request all interesting data about other (root) agents
            agent.SendOtherAgentsAvatarDataToClient();
            agent.SendOtherAgentsAppearanceToClient();

            // Backwards compatibility. Best effort
            if (version == "Unknown" || version == string.Empty)
            {
                m_log.DebugFormat("[ENTITY TRANSFER MODULE]: neighbor with old version, passing attachments one by one...");
                Thread.Sleep(3000); // wait a little now that we're not waiting for the callback
                CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true);
            }

            // Next, let's close the child agent connections that are too far away.
            uint neighbourx;
            uint neighboury;
            Util.RegionHandleToRegionLoc(neighbourRegion.RegionHandle, out neighbourx, out neighboury);

            agent.CloseChildAgents(neighbourx, neighboury);

            AgentHasMovedAway(agent, false);

            // the user may change their profile information in other region,
            // so the userinfo in UserProfileCache is not reliable any more, delete it
            // REFACTORING PROBLEM. Well, not a problem, but this method is HORRIBLE!
//            if (agent.Scene.NeedSceneCacheClear(agent.UUID))
//            {
//                m_log.DebugFormat(
//                    "[ENTITY TRANSFER MODULE]: User {0} is going to another region", agent.UUID);
//            }

            //m_log.Debug("AFTER CROSS");
            //Scene.DumpChildrenSeeds(UUID);
            //DumpKnownRegions();

            return;
        }
开发者ID:Kubwa,项目名称:opensim,代码行数:85,代码来源:EntityTransferModule.cs


注:本文中的OpenSim.Region.Framework.Scenes.ScenePresence.SendOtherAgentsAppearanceToClient方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。