无尽修改
parent
f708a2f546
commit
8e87514b8f
|
@ -20,6 +20,6 @@ public class FamilyDefendDetailInfoHandler extends BaseHandler {
|
||||||
byte[] bytes = netData.parseClientProtoNetData();
|
byte[] bytes = netData.parseClientProtoNetData();
|
||||||
Family.FamilyDefendDetailViewRequest request = Family.FamilyDefendDetailViewRequest.parseFrom(bytes);
|
Family.FamilyDefendDetailViewRequest request = Family.FamilyDefendDetailViewRequest.parseFrom(bytes);
|
||||||
|
|
||||||
GuildFightLogic.viewDefendDetailInfo(iSession,request.getPlayerId(), MessageTypeProto.MessageType.FAMILY_VIEW_DEFEND_DETAIL_RESPONSE);
|
GuildFightLogic.viewDefendDetailInfo(iSession,request.getPlayerId(),request.getGid(), MessageTypeProto.MessageType.FAMILY_VIEW_DEFEND_DETAIL_RESPONSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,11 +95,9 @@ public class GuildFightLogic {
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public static void viewDefendDetailInfo(ISession session, int uid, MessageTypeProto.MessageType messageType) throws Exception {
|
public static void viewDefendDetailInfo(ISession session, int uid,int gid ,MessageTypeProto.MessageType messageType) throws Exception {
|
||||||
User user = UserManager.getUser(uid);
|
|
||||||
int guildId = user.getPlayerInfoManager().getGuildId();
|
FamilyFightInfo fightInfo = RedisUtil.getInstence().getMapEntry(RedisKey.FAMILY_FIGHT, String.valueOf(gid), String.valueOf(uid), FamilyFightInfo.class);
|
||||||
FamilyFightInfo fightInfo = RedisUtil.getInstence().getMapEntry(RedisKey.FAMILY_FIGHT, String.valueOf(guildId), String.valueOf(uid), FamilyFightInfo.class);
|
|
||||||
TeamPosManager teamPosManager = user.getTeamPosManager();
|
|
||||||
CommonProto.Team.Builder team = CommonProto.Team.newBuilder();
|
CommonProto.Team.Builder team = CommonProto.Team.newBuilder();
|
||||||
CommonProto.TeamOneTeamInfo.Builder oneInfo = CommonProto.TeamOneTeamInfo.newBuilder();
|
CommonProto.TeamOneTeamInfo.Builder oneInfo = CommonProto.TeamOneTeamInfo.newBuilder();
|
||||||
if(fightInfo!=null){
|
if(fightInfo!=null){
|
||||||
|
@ -113,7 +111,10 @@ public class GuildFightLogic {
|
||||||
oneInfo.addRemainHp(remainHp);
|
oneInfo.addRemainHp(remainHp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
oneInfo.setTotalForce(fightInfo.getForce());
|
||||||
}else{
|
}else{
|
||||||
|
User user = UserManager.getUser(uid);
|
||||||
|
TeamPosManager teamPosManager = user.getTeamPosManager();
|
||||||
List<TeamPosHeroInfo> teamPosHeroInfos = teamPosManager.getTeamPosForHero().get(501);
|
List<TeamPosHeroInfo> teamPosHeroInfos = teamPosManager.getTeamPosForHero().get(501);
|
||||||
if(teamPosHeroInfos==null){
|
if(teamPosHeroInfos==null){
|
||||||
teamPosHeroInfos = teamPosManager.getTeamPosForHero().get(1);
|
teamPosHeroInfos = teamPosManager.getTeamPosForHero().get(1);
|
||||||
|
@ -121,18 +122,18 @@ public class GuildFightLogic {
|
||||||
for(TeamPosHeroInfo heroInfo:teamPosHeroInfos){
|
for(TeamPosHeroInfo heroInfo:teamPosHeroInfos){
|
||||||
team.addHeroTid(user.getHeroManager().getHero(heroInfo.getHeroId()).getTemplateId());
|
team.addHeroTid(user.getHeroManager().getHero(heroInfo.getHeroId()).getTemplateId());
|
||||||
}
|
}
|
||||||
}
|
int force = HeroLogic.getInstance().calTeamTotalForce(user, 501, false);
|
||||||
oneInfo.setTeam(team);
|
if(force==0){
|
||||||
int force = HeroLogic.getInstance().calTeamTotalForce(user, 501, false);
|
force = HeroLogic.getInstance().calTeamTotalForce(user, 1, false);
|
||||||
if(force==0){
|
}
|
||||||
force = HeroLogic.getInstance().calTeamTotalForce(user, 1, false);
|
oneInfo.setTotalForce(force);
|
||||||
}
|
if (teamPosManager.getTeamPosForPoken().get(1) != null && teamPosManager.getTeamPosForPoken().get(1).size() > 0) {
|
||||||
oneInfo.setTotalForce(force);
|
for (TeamPosForPokenInfo posForPokenInfo : teamPosManager.getTeamPosForPoken().get(1)) {
|
||||||
if (teamPosManager.getTeamPosForPoken().get(1) != null && teamPosManager.getTeamPosForPoken().get(1).size() > 0) {
|
oneInfo.addPokemonInfos(posForPokenInfo.getPokenId());
|
||||||
for (TeamPosForPokenInfo posForPokenInfo : teamPosManager.getTeamPosForPoken().get(1)) {
|
}
|
||||||
oneInfo.addPokemonInfos(posForPokenInfo.getPokenId());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
oneInfo.setTeam(team);
|
||||||
Family.FamilyDefendDetailViewResponse.Builder response = Family.FamilyDefendDetailViewResponse.newBuilder();
|
Family.FamilyDefendDetailViewResponse.Builder response = Family.FamilyDefendDetailViewResponse.newBuilder();
|
||||||
response.setTeamInfo(oneInfo);
|
response.setTeamInfo(oneInfo);
|
||||||
MessageUtil.sendMessage(session, 1, messageType.getNumber(), response.build(), true);
|
MessageUtil.sendMessage(session, 1, messageType.getNumber(), response.build(), true);
|
||||||
|
|
Loading…
Reference in New Issue