Ejemplo n.º 1
0
        //开始创建副本
        public IEnumerator NotifyCreateChangeSceneCoroutine(Coroutine co,
                                                            ObjPlayer Character,
                                                            int scneneId,
                                                            int x,
                                                            int y,
                                                            AsyncReturnValue <ErrorCodes> error)
        {
            //GM命令切换场景,根据合服ID进行
            var serverLogicId = SceneExtension.GetServerLogicId(Character.ServerId);
            var sceneInfo     = new ChangeSceneInfo
            {
                SceneId   = scneneId,
                ServerId  = serverLogicId,
                SceneGuid = 0,
                Type      = (int)eScnenChangeType.Position
            };

            sceneInfo.Guids.Add(Character.ObjId);
            sceneInfo.Pos = new SceneParam();
            sceneInfo.Pos.Param.Add(x);
            sceneInfo.Pos.Param.Add(y);
            Character.BeginChangeScene();
            var msgChgScene = SceneServer.Instance.SceneAgent.SBChangeSceneByTeam(Character.ObjId, sceneInfo);

            yield return(msgChgScene.SendAndWaitUntilDone(co, TimeSpan.FromSeconds(30)));
        }