初始编队
parent
22de4a9033
commit
0d7d9bc10d
|
@ -3,10 +3,7 @@ package com.ljsd.jieling.logic.dao;
|
|||
import com.ljsd.common.mogodb.MongoBase;
|
||||
import com.ljsd.jieling.protocols.CommonProto;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
public class TeamPosManager extends MongoBase {
|
||||
|
||||
|
@ -43,6 +40,20 @@ public class TeamPosManager extends MongoBase {
|
|||
|
||||
}
|
||||
|
||||
public void addTeamOfInitPlayer(Collection<Hero> heros) throws Exception {
|
||||
List<TeamPosHeroInfo> teamPosHeroInfoList = new ArrayList<>(5);
|
||||
int position =1;
|
||||
for(Hero hero : heros){
|
||||
if(position>5){
|
||||
break;
|
||||
}
|
||||
TeamPosHeroInfo teamPosHeroInfo = new TeamPosHeroInfo(hero.getId(), position++);
|
||||
teamPosHeroInfoList.add(teamPosHeroInfo);
|
||||
}
|
||||
teamPosForHero.put(1,teamPosHeroInfoList);
|
||||
updateString("teamPosForHero",teamPosForHero);
|
||||
}
|
||||
|
||||
|
||||
public Map<Integer, String> getTeamNames() {
|
||||
return teamNames;
|
||||
|
|
|
@ -82,10 +82,12 @@ public class UserManager {
|
|||
playerManager.setCreateTime(TimeUtils.now());
|
||||
SGameSetting gameSetting = SGameSetting.getGameSetting();
|
||||
ItemUtil.drop(user,gameSetting.getBornItem());
|
||||
|
||||
MapManager mapManager = user.getMapManager();
|
||||
//TODO
|
||||
|
||||
HeroManager heroManager = user.getHeroManager();
|
||||
Map<String, Hero> heroMap = heroManager.getHeroMap();
|
||||
TeamPosManager teamPosManager = user.getTeamPosManager();
|
||||
teamPosManager.addTeamOfInitPlayer(heroMap.values());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -52,6 +52,14 @@ public class HeroLogic {
|
|||
//筛选卡池
|
||||
int pooId =0;
|
||||
int perCount = sLotterySetting.getPerCount();
|
||||
HeroManager heroManager = user.getHeroManager();
|
||||
if(heroManager!=null&& heroManager.getHeroMap()!=null){
|
||||
if(heroManager.getHeroMap().size() + perCount > SGameSetting.getGameSetting().getHeroNumlimit()){
|
||||
MessageUtil.sendErrorResponse(session, 0, MessageTypeProto.MessageType.HERO_RAND_RESPONSE_VALUE,"超出数量上限");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
boolean isSpecial = false;
|
||||
if(sLotterySetting.getOrderBoxPool()!=null && sLotterySetting.getOrderBoxPool().length>0){
|
||||
pooId = getOrderBoxPoolId(sLotterySetting);
|
||||
|
|
Loading…
Reference in New Issue