async ETVoid SpawnUnit(Monster monster) { M2T_CreateUnit response = (M2T_CreateUnit)await SessionHelper.MapSession().Call(new T2M_CreateUnit() { UnitType = (int)UnitType.Monster, RolerId = monster.Id, UnitId = 0 }); monster.UnitId = response.UnitId; }
protected async ETVoid CreatePlayerAsync(Session session, G2M_CreateUnit message, Action <M2G_CreateUnit> reply) { M2G_CreateUnit response = new M2G_CreateUnit(); // 在map服务器上创建战斗Unit M2T_CreateUnit m2T_Response = (M2T_CreateUnit)await SessionHelper.MapSession().Call(new T2M_CreateUnit() { UnitType = (int)UnitType.Player, RolerId = message.RolerId, GateSessionId = message.GateSessionId, UnitId = 0 }); response.UnitId = m2T_Response.UnitId; reply(response); }
// 创建 新的 Unit protected async ETVoid CreatePlayerAsync(T2M_CreateUnit message) { // 在map服务器上创建战斗Unit M2T_CreateUnit m2T_Response = (M2T_CreateUnit)await SessionHelper.MapSession().Call(message); }