社稷大典公会排行发奖
parent
5fcfaa1f36
commit
4b389f5a8f
|
@ -1,8 +1,10 @@
|
|||
package com.ljsd.jieling.logic.activity;
|
||||
|
||||
import com.ljsd.jieling.core.Lockeys;
|
||||
import com.ljsd.jieling.db.mongo.MongoUtil;
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.globals.Global;
|
||||
import com.ljsd.jieling.jbean.ActivityMission;
|
||||
import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
||||
|
@ -19,9 +21,12 @@ import com.ljsd.jieling.logic.mail.MailLogic;
|
|||
import com.ljsd.jieling.logic.rank.RankContext;
|
||||
import com.ljsd.jieling.logic.rank.RankEnum;
|
||||
import com.ljsd.jieling.logic.rank.rankImpl.AbstractRank;
|
||||
import com.ljsd.jieling.network.server.ProtocolsManager;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.ArenaInfoProto;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.thread.ThreadManager;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.*;
|
||||
import config.*;
|
||||
import manager.STableManager;
|
||||
import org.springframework.data.redis.core.ZSetOperations;
|
||||
|
@ -166,7 +171,7 @@ class SheJiActivity extends AbstractActivity {
|
|||
// }
|
||||
if (rank2miss.containsKey(rank)) {
|
||||
if (rank <= 10 && score <2500) {
|
||||
missionId = 11;
|
||||
missionId = rank2miss.get(11);
|
||||
} else {
|
||||
missionId = rank2miss.get(rank);
|
||||
}
|
||||
|
@ -177,14 +182,25 @@ class SheJiActivity extends AbstractActivity {
|
|||
continue;
|
||||
}
|
||||
}
|
||||
//checkAndUpdate value
|
||||
SGodSacrificeConfig sActivityRankingReward1 = SGodSacrificeConfig.getsGodSacrificeConfigMap().get(missionId);
|
||||
//sendmail
|
||||
|
||||
String title = SErrorCodeEerverConfig.getI18NMessage("personal_activity_reward_title", new Object[]{sGlobalActivity.getSesc()});
|
||||
String content = SErrorCodeEerverConfig.getI18NMessage("personal_activity_reward_txt", new Object[]{sGlobalActivity.getSesc(), rank++});
|
||||
String mailReward = ItemUtil.getMailReward(sActivityRankingReward1.getRankingReward());
|
||||
MailLogic.getInstance().sendMail(uid, title, content, mailReward, nowTime, Global.MAIL_EFFECTIVE_TIME);
|
||||
final int finalIndex = rank;
|
||||
AyyncWorker ayyncWorker = new AyyncWorker(user, true, new AyncWorkerRunnable() {
|
||||
@Override
|
||||
public void work(User user) throws Exception {
|
||||
|
||||
//checkAndUpdate value
|
||||
SGodSacrificeConfig sActivityRankingReward1 = SGodSacrificeConfig.getsGodSacrificeConfigMap().get(missionId);
|
||||
//sendmail
|
||||
|
||||
String title = SErrorCodeEerverConfig.getI18NMessage("personal_activity_reward_title", new Object[]{sGlobalActivity.getSesc()});
|
||||
String content = SErrorCodeEerverConfig.getI18NMessage("personal_activity_reward_txt", new Object[]{sGlobalActivity.getSesc(), finalIndex});
|
||||
String mailReward = ItemUtil.getMailReward(sActivityRankingReward1.getRankingReward());
|
||||
MailLogic.getInstance().sendMail(uid, title, content, mailReward, nowTime, Global.MAIL_EFFECTIVE_TIME);
|
||||
|
||||
}
|
||||
});
|
||||
ProtocolsManager.getInstance().updateAyncWorker(ayyncWorker);
|
||||
rank++;
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("id为{}的玩家,{}活动排行奖励没有发成功", uid, id);
|
||||
System.out.println(e);
|
||||
|
@ -222,20 +238,22 @@ class SheJiActivity extends AbstractActivity {
|
|||
sendUids.addAll(items);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
for (Integer uid : sendUids) {
|
||||
try {
|
||||
User user = UserManager.getUser(uid, true);
|
||||
if (null == user) {
|
||||
continue;
|
||||
}
|
||||
long l = user.getPlayerInfoManager().getCreateTime() + sGodSacrificeSetting.getLifeLimit() * TimeUtils.ONE_DAY;
|
||||
int i = nowTime * 1000;
|
||||
|
||||
if (user.getPlayerInfoManager().getCreateTime() + sGodSacrificeSetting.getLifeLimit() * TimeUtils.ONE_DAY - TimeUtils.now() > 0) {
|
||||
continue;
|
||||
}
|
||||
if (user.getGuildMyInfo().getJoinTime() + sGodSacrificeSetting.getJoinLimit() * TimeUtils.ONE_DAY - TimeUtils.now() > 0) {
|
||||
continue;
|
||||
}
|
||||
// if (user.getGuildMyInfo().getJoinTime() + sGodSacrificeSetting.getJoinLimit() * TimeUtils.ONE_DAY - TimeUtils.now() > 0) {
|
||||
// continue;
|
||||
// }
|
||||
int missionId;
|
||||
if (rank2miss.containsKey(rankIndex)) {
|
||||
missionId = rank2miss.get(rankIndex);
|
||||
|
@ -246,13 +264,23 @@ class SheJiActivity extends AbstractActivity {
|
|||
continue;
|
||||
}
|
||||
}
|
||||
//checkAndUpdate value
|
||||
SGodSacrificeConfig sActivityRankingReward1 = SGodSacrificeConfig.getsGodSacrificeConfigMap().get(missionId);
|
||||
//sendmail
|
||||
String title = SErrorCodeEerverConfig.getI18NMessage("guild_activity_reward_title", new Object[]{sGlobalActivity.getSesc()});
|
||||
String content = SErrorCodeEerverConfig.getI18NMessage("guild_activity_reward_txt", new Object[]{sGlobalActivity.getSesc(), rankIndex});
|
||||
String mailReward = ItemUtil.getMailReward(sActivityRankingReward1.getRankingReward());
|
||||
MailLogic.getInstance().sendMail(uid, title, content, mailReward, nowTime, Global.MAIL_EFFECTIVE_TIME);
|
||||
final int finalIndex = rankIndex;
|
||||
AyyncWorker ayyncWorker = new AyyncWorker(user, true, new AyncWorkerRunnable() {
|
||||
@Override
|
||||
public void work(User user) throws Exception {
|
||||
|
||||
//checkAndUpdate value
|
||||
SGodSacrificeConfig sActivityRankingReward1 = SGodSacrificeConfig.getsGodSacrificeConfigMap().get(missionId);
|
||||
//sendmail
|
||||
String title = SErrorCodeEerverConfig.getI18NMessage("guild_activity_reward_title", new Object[]{sGlobalActivity.getSesc()});
|
||||
String content = SErrorCodeEerverConfig.getI18NMessage("guild_activity_reward_txt", new Object[]{sGlobalActivity.getSesc(), finalIndex});
|
||||
String mailReward = ItemUtil.getMailReward(sActivityRankingReward1.getRankingReward());
|
||||
MailLogic.getInstance().sendMail(uid, title, content, mailReward, nowTime, Global.MAIL_EFFECTIVE_TIME);
|
||||
|
||||
}
|
||||
});
|
||||
ProtocolsManager.getInstance().updateAyncWorker(ayyncWorker);
|
||||
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("id为{}的玩家,{}活动排行奖励没有发成功", uid, id);
|
||||
System.out.println(e);
|
||||
|
|
Loading…
Reference in New Issue