开服冲榜优化
parent
ac75bdc9e9
commit
2e8ee8398a
|
@ -9,9 +9,7 @@ import com.ljsd.jieling.logic.dao.root.User;
|
|||
import com.ljsd.jieling.logic.mail.MailLogic;
|
||||
import com.ljsd.jieling.logic.rank.RankContext;
|
||||
import com.ljsd.jieling.logic.rank.rankImpl.AbstractRank;
|
||||
import com.ljsd.jieling.network.server.ProtocolsManager;
|
||||
import com.ljsd.jieling.thread.ThreadManager;
|
||||
import com.ljsd.jieling.util.AyyncWorker;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.ToolsUtil;
|
||||
import config.*;
|
||||
|
@ -177,21 +175,21 @@ public class OpenServerCompeteRankActivity extends AbstractActivity {
|
|||
LOGGER.error("开服冲榜id为{}的玩家,{}活动,{}排行奖励发送失败,奖励已发送,{}-{}", uid, id, rankType, progressInfo.getProgrss(),progressInfo.getState());
|
||||
continue;
|
||||
}
|
||||
final int rankId = rank;
|
||||
final long count = score.longValue();
|
||||
AyyncWorker ayyncWorker = new AyyncWorker(user, true, user1 -> {
|
||||
//sendmail
|
||||
String title = getMailTitle(rankType);
|
||||
String content = getMailContent(rankType, count, rankId);
|
||||
String mailReward = ItemUtil.getMailReward(getMailReward(rankType, rankId));
|
||||
MailLogic.getInstance().sendMail(uid, title, content, mailReward, TimeUtils.nowInt(), Global.MAIL_EFFECTIVE_TIME);
|
||||
//update activity
|
||||
ActivityProgressInfo info = new ActivityProgressInfo();
|
||||
info.setState(2);
|
||||
info.setProgrss(TimeUtils.nowInt());
|
||||
mission.getActivityMissionMap().put(rankType, info);
|
||||
});
|
||||
ProtocolsManager.getInstance().updateAyncWorker(ayyncWorker);
|
||||
//sendmail
|
||||
String title = getMailTitle(rankType);
|
||||
String content = getMailContent(rankType, score.longValue(), rank);
|
||||
int[][] reward = getMailReward(rankType, rank);
|
||||
if (reward == null){
|
||||
LOGGER.error("冲榜发奖,玩家排名不发奖励,uid:{},rankid:{}, score:{}",user.getId(),rank,score.longValue());
|
||||
continue;
|
||||
}
|
||||
String mailReward = ItemUtil.getMailReward(reward);
|
||||
MailLogic.getInstance().sendMail(uid, title, content, mailReward, TimeUtils.nowInt(), Global.MAIL_EFFECTIVE_TIME);
|
||||
//update activity
|
||||
ActivityProgressInfo info = new ActivityProgressInfo();
|
||||
info.setState(2);
|
||||
info.setProgrss(TimeUtils.nowInt());
|
||||
mission.getActivityMissionMap().put(rankType, info);
|
||||
LOGGER.info("冲榜发奖中:{}-{}-{}",id,rankType,uid);
|
||||
rank++;
|
||||
} catch (Exception e) {
|
||||
|
@ -203,6 +201,7 @@ public class OpenServerCompeteRankActivity extends AbstractActivity {
|
|||
}
|
||||
|
||||
private int[][] getMailReward(int rankType, int rank){
|
||||
LOGGER.info("冲榜获取邮件奖励:type:{}, rank:{}",rankType, rank);
|
||||
SChongRankInfo rankInfo = SChongRankInfo.getMap().get(id).get(rankType);
|
||||
List<SChongRank> chongRanks = SChongRank.getMap().get(rankInfo.getId());
|
||||
int[][] result = null;
|
||||
|
|
Loading…
Reference in New Issue