罗浮争锋七天未登录玩家不发奖

back_recharge
duhui 2023-03-01 16:34:20 +08:00
parent 0eed791c3d
commit f6199ba471
2 changed files with 18 additions and 19 deletions

View File

@ -67,10 +67,8 @@ public class GetWorldArenaInfoRequestHandler extends BaseHandler<WorldProto.GetW
if(diff>setting.getRestTime()[0]&&diff<setting.getRestTime()[1]){
WorldProto.GetWorldArenaInfoRequest.Builder builder1 = WorldProto.GetWorldArenaInfoRequest.newBuilder(proto);
builder1.setIsPro(true);
proto = builder1.build();
}
int crossGroup = GlobleSystemLogic.getInstence().getCrossGroup();
builder.setIsGroup(crossGroup==-1?0:1);
AbstractRank rank = RankContext.getRankEnum(RankEnum.CROSS_SERVICE_ARENA.getType());

View File

@ -740,7 +740,7 @@ public class ArenaLogic {
private void b2r(){
if(getState() != RELAX_STATE){
if(getState()==BATTLE_STATE){
if(getState() == BATTLE_STATE){
Map<Integer, ISession> sessionMap = OnlineUserManager.sessionMap;
for(Map.Entry<Integer,ISession> entry:sessionMap.entrySet()){
MessageUtil.sendIndicationMessage(entry.getValue(),1,MessageTypeProto.MessageType.GetWorldArenaInfoIndication_VALUE,null,true);
@ -756,33 +756,36 @@ public class ArenaLogic {
Set<ZSetOperations.TypedTuple<String>> rankInfo= rank.getRankByKey(String.valueOf(crossGroup), 0, -1);
int index = 0;
Iterator<ZSetOperations.TypedTuple<String>> iterator = rankInfo.iterator();
while (iterator.hasNext()){
for (ZSetOperations.TypedTuple<String> stringTypedTuple : rankInfo) {
int uid = Integer.parseInt(stringTypedTuple.getValue());
CSPlayer player = CrossServiceLogic.getPlayerByRedis(uid);
index++;
ZSetOperations.TypedTuple<String> next = iterator.next();
int uid = Integer.parseInt(next.getValue());
if (uid<1000) {
if (player == null || TimeUtils.now() > (player.getOffLineTime()+TimeUtils.WEEK)){
LOGGER.error("罗浮争锋发奖玩家未登陆时间超过七天不予发奖uid{}rank{}",uid,index);
continue;
}
if (uid < 1000) {
continue;
}
try {
User user = UserManager.getUserNotCache(uid);
if(user==null){
if (user == null) {
continue;
}
Map.Entry<Integer, SMServerArenaReward> entry = rewardMapByRank.floorEntry(index);
SMServerArenaReward value = entry.getValue();
int[][] titleReward = value.getTitleReward();
if(titleReward != null){
for(int[] reward:titleReward){
long time = TimeUtils.getBeginOfDay(TimeUtils.now() + reward[1] * 1000L)+TimeUtils.DAY;
user.getPlayerInfoManager().putUserTitleValidTime(reward[0],time);
if (titleReward != null) {
for (int[] reward : titleReward) {
long time = TimeUtils.getBeginOfDay(TimeUtils.now() + reward[1] * 1000L) + TimeUtils.DAY;
user.getPlayerInfoManager().putUserTitleValidTime(reward[0], time);
PlayerInfoProto.UserTitleAddIndication.Builder builder = PlayerInfoProto.UserTitleAddIndication.newBuilder().setDecorationId(reward[0]).setTime((int) (time / 1000));
MessageUtil.sendIndicationMessage(OnlineUserManager.getSessionByUid(user.getId()),1, MessageTypeProto.MessageType.USER_TITLE_ADD_INDICATION_VALUE,builder.build(),true);
MessageUtil.sendIndicationMessage(OnlineUserManager.getSessionByUid(user.getId()), 1, MessageTypeProto.MessageType.USER_TITLE_ADD_INDICATION_VALUE, builder.build(), true);
}
}
String content = SErrorCodeEerverConfig.getI18NMessageNeedConvert("mserverarena_reward_content",new Object[]{index},new int[]{0},"#");
MailLogic.getInstance().sendMail(uid,title,content,StringUtil.parseArrayToString(value.getSeasonReward()),TimeUtils.nowInt(),Global.MAIL_EFFECTIVE_TIME);
String content = SErrorCodeEerverConfig.getI18NMessageNeedConvert("mserverarena_reward_content", new Object[]{index}, new int[]{0}, "#");
MailLogic.getInstance().sendMail(uid, title, content, StringUtil.parseArrayToString(value.getSeasonReward()), TimeUtils.nowInt(), Global.MAIL_EFFECTIVE_TIME);
} catch (Exception e) {
e.printStackTrace();
}
@ -808,9 +811,6 @@ public class ArenaLogic {
public void e2b(){
if(getState() != BATTLE_STATE){
LOGGER.info("罗浮争霸:转到战斗状态,nowstate:{} to BATTLE_STATE",getState());
// if(getState()!=0){
// initRank();
// }
getInstance().setState(BATTLE_STATE);
initRank();
Map<Integer, ISession> sessionMap = OnlineUserManager.sessionMap;
@ -850,6 +850,7 @@ public class ArenaLogic {
}
return robotIds;
}
//初始化机器人信息
private void initRank(){
int crossGroup = GlobleSystemLogic.getInstence().getCrossGroup();