public override bool TakeAction() { PlayerArenaLogic pa = new PlayerArenaLogic(); ArenaRankLogic ar = new ArenaRankLogic(); pa.SetUser(m_UserId); m_ResponsePacket.ArenaTokenCount = pa.MyArena.ArenaTokenCount; m_ResponsePacket.ChallengeCount = pa.MyArena.ChallengeCount; m_ResponsePacket.ClaimedFlags.AddRange(pa.MyArena.ClaimedLivenessRewardFlag); m_ResponsePacket.MyRank = ar.GetPlayerRank(m_UserId); m_ResponsePacket.WinCount = pa.MyArena.WinCount; var matchPlayers = ar.GetMatchPlayers(m_UserId); PlayerLogic p = new PlayerLogic(); foreach (var player in matchPlayers) { PBArenaPlayerAndTeamInfo enemy = new PBArenaPlayerAndTeamInfo(); enemy.Rank = player.RankId; p.SetUser(player.PlayerId); enemy.PlayerInfo = new PBPlayerInfo() { Id = player.PlayerId, Name = p.MyPlayer.Name, Level = p.MyPlayer.Level, PortraitType = p.MyPlayer.PortraitType }; m_ResponsePacket.Enemies.Add(enemy); } return(true); }
public override bool TakeAction() { ArenaRankLogic ar = new ArenaRankLogic(); List <ArenaRank> rankList; if (ar.TryGetRankList(m_RequestPacket.PageIndex, out rankList)) { m_ResponsePacket.IsLastPage = false; } else { m_ResponsePacket.IsLastPage = true; } m_ResponsePacket.MyRank = ar.GetPlayerRank(m_UserId); PlayerLogic p = new PlayerLogic(); HeroTeamLogic ht = new HeroTeamLogic(); foreach (var player in rankList) { PBArenaPlayerAndTeamInfo enemy = new PBArenaPlayerAndTeamInfo(); enemy.Rank = player.RankId; p.SetUser(player.PlayerId); enemy.PlayerInfo = new PBPlayerInfo() { Id = player.PlayerId, Name = p.MyPlayer.Name, Level = p.MyPlayer.Level, PortraitType = p.MyPlayer.PortraitType }; ht.SetUser(player.PlayerId); var team = ht.GetTeam(); foreach (int hero in team) { PBLobbyHeroInfo heroInfo = new PBLobbyHeroInfo() { Type = hero }; enemy.HeroTeam.Add(heroInfo); } m_ResponsePacket.Enemies.Add(enemy); } m_ResponsePacket.PageIndex = m_RequestPacket.PageIndex; return(true); }
public override bool TakeAction() { ArenaRankLogic ar = new ArenaRankLogic(); var matchPlayers = ar.GetMatchPlayers(m_UserId); PlayerLogic p = new PlayerLogic(); foreach (var player in matchPlayers) { PBArenaPlayerAndTeamInfo enemy = new PBArenaPlayerAndTeamInfo(); enemy.Rank = player.RankId; p.SetUser(player.PlayerId); enemy.PlayerInfo = new PBPlayerInfo() { Id = player.PlayerId, Name = p.MyPlayer.Name, Level = p.MyPlayer.Level, PortraitType = p.MyPlayer.PortraitType }; m_ResponsePacket.Enemies.Add(enemy); } return(true); }