功能刷新和大闹天宫试炼节点bug
parent
f9b2a3e52a
commit
9a4e721ba7
|
@ -217,12 +217,13 @@ public class RedisKey {
|
|||
public final static String CHAMPION_CHOSE_TEAM_INFO = "CHAMPION_CHOSE_TEAM_INFO";
|
||||
public final static String CHAMPION_FINAL_TEAM_INFO = "CHAMPION_FINAL_TEAM_INFO";
|
||||
public final static String CHAMPION_BET_MINE = "CHAMPION_BET_MINE"; // 我的竞猜 selectIdForRedis value: winUid
|
||||
public final static String CHAMPION_BET_DETAIL = "CHAMPION_BET_DETAIL"; // 我的竞猜 selectUid + ":" +winUid
|
||||
public final static String CHAMPION_BET_DETAIL = "CHAMPION_BET_DETAIL"; // 我的竞猜 selectUid + ":" +winUid 本次比赛竞猜当前玩家的的 所有玩家及竞猜道具信息
|
||||
public final static String CHAMPION_BET_ALL = "CHAMPION_BET_ALL"; // 竞猜信息 selectUid + ":" +winUid
|
||||
public final static String CHAMPION_FINAL_RECODED_IDS = "CHAMPION_FINAL_RECODED_IDS"; // 巅峰赛決賽信息 //没发现什么用
|
||||
public final static String CHAMPION_GUESSS_UIDS = "CHAMPION_GUESSS_UIDS"; // 巅峰赛发送竞猜币信息
|
||||
public final static String CHAMPION_ARENA_RECORD_THREE = "CHAMPION_ARENA_RECORD_THREE";//三局两胜缓存
|
||||
|
||||
public final static String CHAMPION_SCHEDULE = "CHAMPION_SCHEDULE";//赛程
|
||||
public final static String PIDGIDTEMP = "PIDGIDTEMP";
|
||||
|
||||
public final static String GUILDBOSS_ARENA_RECORD = "GUILDBOSS_ARENA_RECORD";
|
||||
|
|
|
@ -282,6 +282,9 @@ public class EndExpeditionBattleRequest extends BaseHandler<Expedition.EndExpedi
|
|||
}
|
||||
Hero hero1 = ExpeditionLogic.createHero(i, uid, hero,-1);
|
||||
drop.addHero(CBean2Proto.getHero(hero1));
|
||||
for(Integer equipId : hero1.getEquipByPositionMap().values()){
|
||||
drop.addEquipId(CBean2Proto.getEquipProto(equipId));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -69,8 +69,22 @@ public class ChampionshipLogic {
|
|||
gameFightTypeMap.put(0, GameFightType.TOPArenaPersonFight);
|
||||
gameFightTypeMap.put(1, GameFightType.TOPArenaRobotFight);
|
||||
gameFightTypeMap.put(2, GameFightType.TOPArena2RobotFight);
|
||||
init();
|
||||
}
|
||||
|
||||
|
||||
public static void init(){
|
||||
try {
|
||||
String key = RedisUtil.getInstence().getKey(RedisKey.CHAMPION_SCHEDULE, "");
|
||||
Object result = RedisUtil.getInstence().get(key);
|
||||
if (result != null) {
|
||||
schedule = Integer.valueOf((String) result);
|
||||
}
|
||||
}catch (Exception e){
|
||||
LOGGER.info("Exception the init={}");
|
||||
}
|
||||
|
||||
}
|
||||
public static int getProgress() {
|
||||
return progress;
|
||||
}
|
||||
|
@ -87,6 +101,13 @@ public class ChampionshipLogic {
|
|||
return schedule;
|
||||
}
|
||||
|
||||
public static void setSchedule(int schedule) {
|
||||
ChampionshipLogic.schedule = schedule;
|
||||
String key = RedisUtil.getInstence().getKey(RedisKey.CHAMPION_SCHEDULE, "");
|
||||
RedisUtil.getInstence().set(key, String.valueOf(ChampionshipLogic.schedule));
|
||||
|
||||
}
|
||||
|
||||
public static int getRealTimes() {
|
||||
return realTimes;
|
||||
}
|
||||
|
@ -789,7 +810,7 @@ public class ChampionshipLogic {
|
|||
delKeys.add(RedisUtil.getInstence().getKey(RedisKey.CHAMPION_FINAL_RECODED_IDS, ""));
|
||||
delKeys.add(RedisUtil.getInstence().getKey(RedisKey.CHAMPION_GUESSS_UIDS, ""));
|
||||
delKeys.add(RedisUtil.getInstence().getKey(RedisKey.CHAMPION_ARENA_RECORD_THREE, ""));
|
||||
|
||||
delKeys.add(RedisUtil.getInstence().getKey(RedisKey.CHAMPION_SCHEDULE, ""));
|
||||
//我的历史结果
|
||||
joinUids.forEach(uid -> {
|
||||
delKeys.add(RedisUtil.getInstence().getKey(RedisKey.CHAMPION_MY_BATTLLE_IDS, Integer.toString(uid)));
|
||||
|
@ -876,6 +897,13 @@ public class ChampionshipLogic {
|
|||
|
||||
/**
|
||||
* 1.选出参战人员 人永远是进攻方
|
||||
*
|
||||
* arenaRecordMap 所有战斗双方记录对象
|
||||
* CHAMPION_ARENA_RECORD 当前所有战斗双方记录
|
||||
* CHAMPION_CUR_JOIN_IDS 当前所有战斗双方记录的id
|
||||
* CHAMPION_JOIN 参加的成员
|
||||
*
|
||||
*
|
||||
*/
|
||||
public static void selectToBattle() {
|
||||
RedisUtil.getInstence().del(RedisUtil.getInstence().getKey(RedisKey.CHAMPION_CUR_JOIN_IDS, ""));
|
||||
|
@ -969,6 +997,7 @@ public class ChampionshipLogic {
|
|||
arenaRecordIds.addAll(arenaRecordMap.keySet());
|
||||
RedisUtil.getInstence().lSet(RedisKey.CHAMPION_CUR_JOIN_IDS, "", arenaRecordIds);
|
||||
if (schedule == 2) {
|
||||
//记录4强 8强的人 方便索引
|
||||
if (arenaRecordIds.size() >= 4) {
|
||||
RedisUtil.getInstence().lSet(RedisKey.CHAMPION_FINAL32_JOIN_IDS, "", arenaRecordIds);
|
||||
LOGGER.info("the rountTimes={},the size={}", roundTimes, arenaRecordIds.size());
|
||||
|
@ -1000,6 +1029,9 @@ public class ChampionshipLogic {
|
|||
return RedisUtil.getInstence().getMapEntrys(RedisKey.CHAMPION_ARENA_RECORD, "", ids, ArenaRecord.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取本次竞猜id
|
||||
*/
|
||||
public static String getSelectIdForRedis() {
|
||||
String key = RedisUtil.getInstence().getKey(RedisKey.CHAMPION_CUR_BETID, "");
|
||||
Object result = RedisUtil.getInstence().get(key);
|
||||
|
@ -1207,7 +1239,7 @@ public class ChampionshipLogic {
|
|||
// //竞猜阶段取消,改成直接战斗 fix 又改回来了
|
||||
// progressState = progressState==1?2:progressState;
|
||||
progressTmp = 100 + roundTimes * 10 + progressState;
|
||||
schedule = 1;
|
||||
setSchedule(1);
|
||||
fightTime=2;
|
||||
if (progressTmp == progress) {
|
||||
return;
|
||||
|
@ -1215,7 +1247,7 @@ public class ChampionshipLogic {
|
|||
} else {//决赛
|
||||
|
||||
if (realTimes>5) {
|
||||
schedule = 2;
|
||||
setSchedule(2);
|
||||
if (progress != -2) {
|
||||
progress = -2;
|
||||
ChampionshipLogic.close();
|
||||
|
@ -1229,7 +1261,7 @@ public class ChampionshipLogic {
|
|||
scoreToRedis();
|
||||
realTimes=1;
|
||||
fightTime=0;
|
||||
schedule = 2;
|
||||
setSchedule(2);
|
||||
selectToJoinFinal();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue