玩家清除 和日志打印
parent
331c386003
commit
a78faa7d4b
|
@ -193,8 +193,10 @@ public class ChampionshipLogic {
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if(schedule==2&&(ChampionshipLogic.fightTime!=3)){
|
if(schedule==2){
|
||||||
return;
|
if(fightTime!=0||realTimes!=1){
|
||||||
|
if(ChampionshipLogic.fightTime!=3) return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//胜利者积分排名
|
//胜利者积分排名
|
||||||
|
@ -366,6 +368,7 @@ public class ChampionshipLogic {
|
||||||
Map<Integer, SArenaRobotConfig> robotConfigMap = STableManager.getConfig(SArenaRobotConfig.class);
|
Map<Integer, SArenaRobotConfig> robotConfigMap = STableManager.getConfig(SArenaRobotConfig.class);
|
||||||
int nowTime = (int) (TimeUtils.now() / 1000);
|
int nowTime = (int) (TimeUtils.now() / 1000);
|
||||||
Set<Integer> joinUids = new HashSet<>(128);
|
Set<Integer> joinUids = new HashSet<>(128);
|
||||||
|
try {
|
||||||
for (ZSetOperations.TypedTuple<String> item : arenaRankInfo) {
|
for (ZSetOperations.TypedTuple<String> item : arenaRankInfo) {
|
||||||
String uidStr = item.getValue();
|
String uidStr = item.getValue();
|
||||||
int uid = Integer.parseInt(uidStr);
|
int uid = Integer.parseInt(uidStr);
|
||||||
|
@ -384,6 +387,10 @@ public class ChampionshipLogic {
|
||||||
String content = SErrorCodeEerverConfig.getI18NMessage("champion_reward_txt", new Object[]{sChampionshipReward.getTitleDesc()});
|
String content = SErrorCodeEerverConfig.getI18NMessage("champion_reward_txt", new Object[]{sChampionshipReward.getTitleDesc()});
|
||||||
MailLogic.getInstance().sendMail(user.getId(), title, content, ItemUtil.getMailReward(sChampionshipReward.getSeasonReward()), nowTime, Global.MAIL_EFFECTIVE_TIME);
|
MailLogic.getInstance().sendMail(user.getId(), title, content, ItemUtil.getMailReward(sChampionshipReward.getSeasonReward()), nowTime, Global.MAIL_EFFECTIVE_TIME);
|
||||||
}
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
System.out.println("Exception e = "+"size"+ arenaRankInfo.size()+ e.toString());
|
||||||
|
}
|
||||||
|
|
||||||
MongoUtil.getLjsdMongoTemplate().lastUpdate();
|
MongoUtil.getLjsdMongoTemplate().lastUpdate();
|
||||||
SChampionshipSetting sChampionshipSetting = STableManager.getFigureConfig(CommonStaticConfig.class).getsChampionshipSetting();
|
SChampionshipSetting sChampionshipSetting = STableManager.getFigureConfig(CommonStaticConfig.class).getsChampionshipSetting();
|
||||||
int arenaItemId = sChampionshipSetting.getArenaItem()[0];
|
int arenaItemId = sChampionshipSetting.getArenaItem()[0];
|
||||||
|
@ -1162,6 +1169,12 @@ public class ChampionshipLogic {
|
||||||
int duration = sChampionshipSetting.getGuessTime() + sChampionshipSetting.getBattleTime(); //fix 只有竞猜和战斗
|
int duration = sChampionshipSetting.getGuessTime() + sChampionshipSetting.getBattleTime(); //fix 只有竞猜和战斗
|
||||||
int progressState = getProgress((int) ((now - startTime) / 1000 % duration + 1)); //阶段
|
int progressState = getProgress((int) ((now - startTime) / 1000 % duration + 1)); //阶段
|
||||||
long round = (now - startTime) / 1000 / duration + 1;//轮数
|
long round = (now - startTime) / 1000 / duration + 1;//轮数
|
||||||
|
if(round>30){
|
||||||
|
progress=-2;
|
||||||
|
//sendAllProgressUpdate();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
roundTimes = (int) round;
|
roundTimes = (int) round;
|
||||||
long diff = round - (sChampionshipSetting.getTrialsGroup() - 1);
|
long diff = round - (sChampionshipSetting.getTrialsGroup() - 1);
|
||||||
int progressTmp;
|
int progressTmp;
|
||||||
|
@ -1226,10 +1239,6 @@ public class ChampionshipLogic {
|
||||||
}
|
}
|
||||||
progress = progressTmp;
|
progress = progressTmp;
|
||||||
scoreToRedis();
|
scoreToRedis();
|
||||||
if(fightTime==0){
|
|
||||||
// String key = RedisUtil.getInstence().getKey(RedisKey.CHAMPION_ARENA_RECORD_THREE, "");
|
|
||||||
// RedisUtil.getInstence().del(key, RedisUtil.getInstence().getKey(RedisKey.CHAMPION_ARENA_RECORD_THREE, ""));
|
|
||||||
}
|
|
||||||
fightTime++;
|
fightTime++;
|
||||||
//准备阶段
|
//准备阶段
|
||||||
selectToBattle();
|
selectToBattle();
|
||||||
|
|
|
@ -52,18 +52,18 @@ public class UserManager {
|
||||||
//离线清除逻辑
|
//离线清除逻辑
|
||||||
public static void checkOffline(){
|
public static void checkOffline(){
|
||||||
try {
|
try {
|
||||||
Set<User> collect = userMap.entrySet().stream().filter(integerUserEntry -> !OnlineUserManager.checkUidOnline(integerUserEntry.getKey())).map(Map.Entry::getValue).collect(Collectors.toSet());
|
// Set<User> collect = userMap.entrySet().stream().filter(integerUserEntry -> !OnlineUserManager.checkUidOnline(integerUserEntry.getKey())).map(Map.Entry::getValue).collect(Collectors.toSet());
|
||||||
long l = System.currentTimeMillis();
|
// long l = System.currentTimeMillis();
|
||||||
collect.forEach(integerUserEntry -> {
|
// collect.forEach(integerUserEntry -> {
|
||||||
long offLineTime = integerUserEntry.getPlayerInfoManager().getOffLineTime();
|
// long offLineTime = integerUserEntry.getPlayerInfoManager().getOffLineTime();
|
||||||
if(offLineTime<integerUserEntry.getPlayerInfoManager().getOnlineTime()){
|
// if(offLineTime<integerUserEntry.getPlayerInfoManager().getOnlineTime()){
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
if(l-offLineTime>7*60*1000&& userMapPutTime.getOrDefault(integerUserEntry.getId(),0L)>7*60*100){
|
// if(l-offLineTime>12*60*60*1000&& userMapPutTime.getOrDefault(integerUserEntry.getId(),0L)>12*60*60*1000){
|
||||||
userMap.remove(integerUserEntry.getId());
|
// userMap.remove(integerUserEntry.getId());
|
||||||
userMapPutTime.remove(integerUserEntry.getId());
|
// userMapPutTime.remove(integerUserEntry.getId());
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
LOGGER.error(e.toString());
|
LOGGER.error(e.toString());
|
||||||
}
|
}
|
||||||
|
@ -175,8 +175,13 @@ public class UserManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static User getUserInMem(int uid) {
|
public static User getUserInMem(int uid) {
|
||||||
User user = userMap.get(uid);
|
// User user = userMap.get(uid);
|
||||||
return user;
|
try {
|
||||||
|
return getUser(uid,true);
|
||||||
|
}catch (Exception e){
|
||||||
|
LOGGER.error("UserManager::getUser null exception"+uid);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
public static void removeUser(int uid) {
|
public static void removeUser(int uid) {
|
||||||
userMap.remove(uid);
|
userMap.remove(uid);
|
||||||
|
|
|
@ -297,11 +297,15 @@ public class MailLogic {
|
||||||
}
|
}
|
||||||
//发送邮件
|
//发送邮件
|
||||||
public void sendMail(int uid, String title, String content, String reward, int sendTime, int mailEffectiveTime) throws Exception {
|
public void sendMail(int uid, String title, String content, String reward, int sendTime, int mailEffectiveTime) throws Exception {
|
||||||
|
try {
|
||||||
User user = UserManager.getUser(uid);
|
User user = UserManager.getUser(uid);
|
||||||
Mail mail = new Mail(uid,title,content,reward,sendTime, mailEffectiveTime,"system",Global.MAIL_TYPE_SYS);
|
Mail mail = new Mail(uid,title,content,reward,sendTime, mailEffectiveTime,"system",Global.MAIL_TYPE_SYS);
|
||||||
user.getMailManager().addMail(mail);
|
user.getMailManager().addMail(mail);
|
||||||
LOGGER.info("sendMail==>uid={},title={},reward:{}",uid,title,reward);
|
LOGGER.info("sendMail==>uid={},title={},reward:{}",uid,title,reward);
|
||||||
MessageUtil.sendRedIndication(uid, GlobalsDef.MAIL_RED_TYPE);
|
MessageUtil.sendRedIndication(uid, GlobalsDef.MAIL_RED_TYPE);
|
||||||
|
}catch (Exception e){
|
||||||
|
LOGGER.error(e.toString()+"sendMail==>uid={},title={},reward:{}",uid,title,reward);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*每分钟检测是否有需要发的邮件
|
*每分钟检测是否有需要发的邮件
|
||||||
|
|
Loading…
Reference in New Issue