|
@@ -42,50 +42,18 @@ namespace ET.Server
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- // map.PlayerEnterRequest(player);
|
|
|
- // map.OnPlayerEntered(player);
|
|
|
- // player.OnEndEnterScene();
|
|
|
+ map.PlayerEnterRequest(player);
|
|
|
+ map.OnPlayerEntered(player);
|
|
|
|
|
|
- // response.MapInstanceId = player.Map.Id;
|
|
|
- // reply();
|
|
|
+ response.MapInstanceId = player.Map.Id;
|
|
|
+ reply();
|
|
|
|
|
|
- // player进入副本,把player基本信息上报给战斗服
|
|
|
- map.GetZoneManager().begin_playerEnterRequest(player.GetId().ToString(), map.Id.ToString().Trim(), player.toJSON4EnterScene(map))
|
|
|
- .whenCompleted(() =>
|
|
|
- {
|
|
|
- response.MapInstanceId = player.Map.Id;
|
|
|
- reply();
|
|
|
- WaitPlayerReady(session.DomainScene(), request.InstanceId, player.Id).Coroutine();
|
|
|
- },
|
|
|
- (Ice.Exception ex) =>
|
|
|
- {
|
|
|
- if (ex != null)
|
|
|
- {
|
|
|
- Log.Error($"进入场景失败...{ex.Message}");
|
|
|
- response.Error = -1;
|
|
|
- response.Message = ex.Message;
|
|
|
- reply();
|
|
|
- }
|
|
|
- });
|
|
|
- await ETTask.CompletedTask;
|
|
|
- }
|
|
|
-
|
|
|
- private static async ETTask WaitPlayerReady(Scene scene, long scnInstance, long playerid)
|
|
|
- {
|
|
|
//等待client ready消息
|
|
|
- await scene.GetComponent<ObjectWait>().Wait<Wait_PlayerReady>();
|
|
|
- //告诉战斗服 i am ready
|
|
|
-
|
|
|
- string playidstr = playerid.ToString();
|
|
|
- //设置ice战斗服中player状态为ready
|
|
|
- XmdsManagerPrx IceXmds = BattleIceAgentComponent.Instance.IceXmdsManager;
|
|
|
- IceXmds.playerReady(playidstr);
|
|
|
+ await session.DomainScene().GetComponent<ObjectWait>().Wait<Wait_PlayerReady>();
|
|
|
|
|
|
- //PKMode设置为All
|
|
|
- IceXmds.refreshPlayerPKMode(playidstr, false, (int)PkModel.All);
|
|
|
+ player.OnEndEnterScene();
|
|
|
|
|
|
- //设置为自动战斗
|
|
|
- IceXmds.autoBattle(scnInstance.ToString(), playidstr, true);
|
|
|
+ await ETTask.CompletedTask;
|
|
|
}
|
|
|
}
|
|
|
}
|