fix fight time

back_recharge
wangyuan 2019-10-30 14:18:05 +08:00
parent af304a8d85
commit d6e2822724
1 changed files with 6 additions and 5 deletions

View File

@ -44,6 +44,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.data.redis.core.ZSetOperations;
import util.MathUtils;
import util.StringUtil;
import util.TimeUtils;
import util.CellUtil;
@ -2074,7 +2075,7 @@ public class MapLogic {
user.getTeamPosManager().setCurTeamPosId(teamId);
String fightInfo = fightId + "#" + teamId;
String key = RedisKey.getKey(RedisKey.LEVE_DIFFICULTY_INFO, String.valueOf(uid), false);
RedisUtil.getInstence().set(key, fightInfo, sMainLevelConfig.getRankTime() + 100);
RedisUtil.getInstence().set(key, fightInfo, -1);
//扣除预先道具
FightInfoProto.FightStartResponse.Builder fightStartResponse = FightInfoProto.FightStartResponse.newBuilder();
BehaviorUtil.getLevelDifficultyifficuFightInfo(user, sMainLevelConfig.getMonsterGroup(), teamId, sMainLevelConfig.getRankTime(), fightStartResponse, RedisKey.LEVE_DIFFICULTY_FIGHT);
@ -2087,7 +2088,7 @@ public class MapLogic {
User user = UserManager.getUser(uid);
String fightKey = RedisKey.getKey(RedisKey.LEVE_DIFFICULTY_INFO, String.valueOf(uid), false);
String fightInfos = (String) RedisUtil.getInstence().get(fightKey);
if (fightInfos.isEmpty()) {
if (StringUtil.isEmpty(fightInfos)) {
LOGGER.info("endFight() uid=>{} fightKey={},fightId={} fightInfos == null", uid, fightKey, fightId);
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}
@ -2099,7 +2100,7 @@ public class MapLogic {
}
String key = RedisKey.getKey(RedisKey.LEVE_DIFFICULTY_FIGHT, Integer.toString(user.getId()), false);
Map<Object, Object> valueMap = RedisUtil.getInstence().hmget(key);
RedisUtil.getInstence().del(key);
RedisUtil.getInstence().del(key,fightKey);
if (valueMap == null || valueMap.isEmpty()) {
LOGGER.info("endFight() uid=>{} not start fight", uid);
throw new ErrorCodeException(ErrorCode.newDefineCode("此战斗已结算过 !"));
@ -2289,7 +2290,7 @@ public class MapLogic {
String fightInfo = fightId + "#" + teamId;
String key = RedisKey.getKey(RedisKey.CHALLENGE_MONSTER_INFO, String.valueOf(uid), false);
RedisUtil.getInstence().set(key, fightInfo, sFloodConfig.getBattleTime() + 100);
RedisUtil.getInstence().set(key, fightInfo, -1);
FightInfoProto.FightStartResponse.Builder fightStartResponse = FightInfoProto.FightStartResponse.newBuilder();
BehaviorUtil.getLevelDifficultyifficuFightInfo(user, sFloodConfig.getMonster(), teamId, sFloodConfig.getBattleTime(), fightStartResponse, RedisKey.CHALLENGE_MONSTER_ATTACK);
user.getUserMissionManager().onGameEvent(user,GameEvent.MONSTER_ATTACK_PLAY);
@ -2314,7 +2315,7 @@ public class MapLogic {
String key = RedisKey.getKey(RedisKey.CHALLENGE_MONSTER_ATTACK, Integer.toString(user.getId()), false);
Map<Object, Object> valueMap = RedisUtil.getInstence().hmget(key);
RedisUtil.getInstence().del(key);
RedisUtil.getInstence().del(key,fightKey);
if (valueMap == null || valueMap.isEmpty()) {
LOGGER.info("endFight() uid=>{} not start fight", uid);
throw new ErrorCodeException(ErrorCode.newDefineCode("此战斗已结算过!!"));