初始编队
parent
22de4a9033
commit
0d7d9bc10d
|
@ -3,10 +3,7 @@ package com.ljsd.jieling.logic.dao;
|
||||||
import com.ljsd.common.mogodb.MongoBase;
|
import com.ljsd.common.mogodb.MongoBase;
|
||||||
import com.ljsd.jieling.protocols.CommonProto;
|
import com.ljsd.jieling.protocols.CommonProto;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class TeamPosManager extends MongoBase {
|
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() {
|
public Map<Integer, String> getTeamNames() {
|
||||||
return teamNames;
|
return teamNames;
|
||||||
|
|
|
@ -82,10 +82,12 @@ public class UserManager {
|
||||||
playerManager.setCreateTime(TimeUtils.now());
|
playerManager.setCreateTime(TimeUtils.now());
|
||||||
SGameSetting gameSetting = SGameSetting.getGameSetting();
|
SGameSetting gameSetting = SGameSetting.getGameSetting();
|
||||||
ItemUtil.drop(user,gameSetting.getBornItem());
|
ItemUtil.drop(user,gameSetting.getBornItem());
|
||||||
|
|
||||||
MapManager mapManager = user.getMapManager();
|
MapManager mapManager = user.getMapManager();
|
||||||
//TODO
|
//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 pooId =0;
|
||||||
int perCount = sLotterySetting.getPerCount();
|
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;
|
boolean isSpecial = false;
|
||||||
if(sLotterySetting.getOrderBoxPool()!=null && sLotterySetting.getOrderBoxPool().length>0){
|
if(sLotterySetting.getOrderBoxPool()!=null && sLotterySetting.getOrderBoxPool().length>0){
|
||||||
pooId = getOrderBoxPoolId(sLotterySetting);
|
pooId = getOrderBoxPoolId(sLotterySetting);
|
||||||
|
|
Loading…
Reference in New Issue