back_recharge
parent
a1e2bffd8b
commit
d516374225
|
|
@ -1,15 +1,20 @@
|
||||||
package com.ljsd.fight;
|
package com.ljsd.fight;
|
||||||
|
|
||||||
public class LingMaiSecretArea {
|
public class LingMaiSecretArea {
|
||||||
private int id;
|
private int id;
|
||||||
private int uid;
|
private int uid;
|
||||||
private String serverName;
|
private String serverName;
|
||||||
private String name;
|
private int occupyTime;//占领的时长 以分钟为单位
|
||||||
private long getAwardTimeOrOccupyTime;//得到奖励的时间(10分钟倒计时/被打下去或者打别人 时候有修改)或者占领的灵脉的时间
|
|
||||||
private long beginOccupyTime;//占领的时间点 占领第一次的时候、打下别人的时候、被别人打下的时候
|
// 下面这四个参数用不到了
|
||||||
//当日总积分 = score1+基础收益*occupyTime
|
@Deprecated
|
||||||
private int score1;//当前结算分 被人打下去后 这个分才会有值
|
private String name;
|
||||||
private int occupyTime;//占领的时长 以分钟为单位
|
@Deprecated
|
||||||
|
private long getAwardTimeOrOccupyTime;//得到奖励的时间(10分钟倒计时/被打下去或者打别人 时候有修改)或者占领的灵脉的时间
|
||||||
|
@Deprecated
|
||||||
|
private long beginOccupyTime;//占领的时间点 占领第一次的时候、打下别人的时候、被别人打下的时候
|
||||||
|
@Deprecated
|
||||||
|
private int score1;//当前结算分 被人打下去后 这个分才会有值
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return id;
|
return id;
|
||||||
|
|
|
||||||
|
|
@ -27,11 +27,7 @@ import com.ljsd.jieling.logic.fight.PVEFightEvent;
|
||||||
import com.ljsd.jieling.logic.fight.result.FightResult;
|
import com.ljsd.jieling.logic.fight.result.FightResult;
|
||||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||||
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.session.ISession;
|
import com.ljsd.jieling.network.session.ISession;
|
||||||
import com.ljsd.jieling.thrift.idl.CrossArenaManager;
|
|
||||||
import com.ljsd.jieling.util.MessageUtil;
|
import com.ljsd.jieling.util.MessageUtil;
|
||||||
import config.SArenaSetting;
|
import config.SArenaSetting;
|
||||||
import config.SLodeConfig;
|
import config.SLodeConfig;
|
||||||
|
|
@ -74,7 +70,8 @@ public class CrossLingmaiSecretAreaBattleHandler extends BaseHandler<ArenaInfoPr
|
||||||
ArenaManager arenaManager = user.getArenaManager();
|
ArenaManager arenaManager = user.getArenaManager();
|
||||||
int group = SMServerLodeSetting.getGroupByLevel(arenaManager.getCrossLingmaiFirstLevel());
|
int group = SMServerLodeSetting.getGroupByLevel(arenaManager.getCrossLingmaiFirstLevel());
|
||||||
//CROSS_LINGMAISECRET_INFO:跨服分组:分组
|
//CROSS_LINGMAISECRET_INFO:跨服分组:分组
|
||||||
Map<String, LingMaiSecretArea> lingMaiMap = RedisUtil.getInstence().getMapValues(RedisKey.CROSS_LINGMAISECRET_INFO, crossGroup + RedisKey.Delimiter_colon + group, String.class, LingMaiSecretArea.class);
|
String groupKey = crossGroup + RedisKey.Delimiter_colon + group;
|
||||||
|
Map<String, LingMaiSecretArea> lingMaiMap = CrossLingmaiLogic.getInstance().getLingmaiMap(crossGroup,group);
|
||||||
int myLingmaiId = CrossLingmaiLogic.getInstance().getLingmaiIdOccupy(uid, lingMaiMap);
|
int myLingmaiId = CrossLingmaiLogic.getInstance().getLingmaiIdOccupy(uid, lingMaiMap);
|
||||||
if (myLingmaiId != 0 && myLingmaiId < id) {
|
if (myLingmaiId != 0 && myLingmaiId < id) {
|
||||||
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.CrossLingmaiSecretAreaResponse.getNumber(), res.build(), true);
|
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.CrossLingmaiSecretAreaResponse.getNumber(), res.build(), true);
|
||||||
|
|
@ -95,12 +92,13 @@ public class CrossLingmaiSecretAreaBattleHandler extends BaseHandler<ArenaInfoPr
|
||||||
throw new ErrorCodeException(ErrorCode.REFRESH_WHEL_TIME_NOT, "挑战次数不足");
|
throw new ErrorCodeException(ErrorCode.REFRESH_WHEL_TIME_NOT, "挑战次数不足");
|
||||||
}
|
}
|
||||||
SLodeConfig config = SLodeConfig.lodeConfig.get(id);
|
SLodeConfig config = SLodeConfig.lodeConfig.get(id);
|
||||||
AbstractRank rank = RankContext.getRankEnum(RankEnum.CROSS_LINGMAI_RANK_PERSON.getType());
|
if (config == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String serverName = CrossServiceLogic.simplifyServerName(GameApplication.serverId);
|
||||||
|
int nowInt = TimeUtils.nowInt();
|
||||||
|
//没人占领 攻击机器人 pve
|
||||||
if (!lingMaiMap.containsKey(String.valueOf(id))) {
|
if (!lingMaiMap.containsKey(String.valueOf(id))) {
|
||||||
//没人占领 攻击机器人 pve
|
|
||||||
if (config == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
PVEFightEvent pveFightEvent = new PVEFightEvent(user.getId(), TeamEnum.CROSS_LING_MAI_SECRET_AREA.getTeamId(), 20, "", GameFightType.CrossLingMaiSecretFight, config.getGuard(), 3);
|
PVEFightEvent pveFightEvent = new PVEFightEvent(user.getId(), TeamEnum.CROSS_LING_MAI_SECRET_AREA.getTeamId(), 20, "", GameFightType.CrossLingMaiSecretFight, config.getGuard(), 3);
|
||||||
FightResult fightResult = FightDispatcher.dispatcher(pveFightEvent);
|
FightResult fightResult = FightDispatcher.dispatcher(pveFightEvent);
|
||||||
CommonProto.FightData fightData = CommonProto.FightData.newBuilder()
|
CommonProto.FightData fightData = CommonProto.FightData.newBuilder()
|
||||||
|
|
@ -115,59 +113,36 @@ public class CrossLingmaiSecretAreaBattleHandler extends BaseHandler<ArenaInfoPr
|
||||||
LOGGER.error("跨服灵脉秘境机器人战斗结果:"+fightResult.getResult());
|
LOGGER.error("跨服灵脉秘境机器人战斗结果:"+fightResult.getResult());
|
||||||
if (fightResult.getResult() == -1) {
|
if (fightResult.getResult() == -1) {
|
||||||
throw new ErrorCodeException(ErrorCode.FIGHT_EXCEPTION);
|
throw new ErrorCodeException(ErrorCode.FIGHT_EXCEPTION);
|
||||||
} else if (fightResult.getResult() == 1) {
|
}
|
||||||
//赢了
|
//赢了
|
||||||
|
if (fightResult.getResult() == 1) {
|
||||||
//结算已有的灵脉
|
//结算已有的灵脉
|
||||||
int score =0;
|
|
||||||
if (myLingmaiId != 0){
|
if (myLingmaiId != 0){
|
||||||
LingMaiSecretArea myLingmai = lingMaiMap.get(String.valueOf(myLingmaiId));
|
LingMaiSecretArea myLingmai = lingMaiMap.get(String.valueOf(myLingmaiId));
|
||||||
config = SLodeConfig.lodeConfig.get(myLingmaiId);
|
CrossLingmaiLogic.getInstance().sendNormalMail(uid,myLingmai);
|
||||||
//int minute = ((TimeUtils.nowInt() - (int)myLingmai.getGetAwardTimeOrOccupyTime()) / 60) > 10 ? 10 : ((TimeUtils.nowInt() - (int)myLingmai.getGetAwardTimeOrOccupyTime()) / 60);
|
|
||||||
int minute = ((TimeUtils.nowInt() - (int)myLingmai.getGetAwardTimeOrOccupyTime()) / 60);
|
|
||||||
int second = Math.min(((TimeUtils.nowInt() - (int) myLingmai.getGetAwardTimeOrOccupyTime()) % 60), 60);
|
|
||||||
myLingmai.setScore1(myLingmai.getScore1() + minute*config.getRewardList()[0][1]+(second*config.getRewardList()[0][1]/60));
|
|
||||||
//myLingmai.setGetAwardTimeOrOccupyTime(TimeUtils.nowInt());
|
|
||||||
LOGGER.info("uid:"+uid+"first occupy myLingmaiId: "+myLingmaiId+" minute:"+minute+"second:"+second);
|
|
||||||
score = myLingmai.getScore1() + config.getRewardList()[0][1] * myLingmai.getOccupyTime()/60;
|
|
||||||
rank = RankContext.getRankEnum(RankEnum.CROSS_LINGMAI_RANK_PERSON.getType());
|
|
||||||
rank.addRank(user.getId(), String.valueOf(crossGroup) + RedisKey.Delimiter_colon + group, score);
|
|
||||||
//清除已有灵脉数据
|
//清除已有灵脉数据
|
||||||
lingMaiMap.remove(String.valueOf(myLingmaiId));
|
RedisUtil.getInstence().removeMapEntrys(RedisKey.CROSS_LINGMAISECRET_INFO, groupKey, String.valueOf(myLingmaiId));
|
||||||
RedisUtil.getInstence().removeMapEntrys(RedisKey.CROSS_LINGMAISECRET_INFO,
|
|
||||||
crossGroup + RedisKey.Delimiter_colon + group, String.valueOf(myLingmaiId));
|
|
||||||
}
|
}
|
||||||
LingMaiSecretArea lingMaiSecretArea = new LingMaiSecretArea();
|
LingMaiSecretArea lingMaiSecretArea = new LingMaiSecretArea();
|
||||||
lingMaiSecretArea.setId(id);
|
lingMaiSecretArea.setId(id);
|
||||||
lingMaiSecretArea.setUid(uid);
|
lingMaiSecretArea.setUid(uid);
|
||||||
String serverName = CrossServiceLogic.simplifyServerName(GameApplication.serverId);
|
|
||||||
lingMaiSecretArea.setServerName(serverName);
|
lingMaiSecretArea.setServerName(serverName);
|
||||||
lingMaiSecretArea.setGetAwardTimeOrOccupyTime(TimeUtils.nowInt());
|
lingMaiSecretArea.setOccupyTime(nowInt);
|
||||||
lingMaiSecretArea.setBeginOccupyTime(TimeUtils.nowInt());
|
RedisUtil.getInstence().putMapEntry(RedisKey.CROSS_LINGMAISECRET_INFO, groupKey, String.valueOf(id), lingMaiSecretArea);
|
||||||
if(myLingmaiId != 0&&score!=0){
|
|
||||||
lingMaiSecretArea.setScore1(score);
|
|
||||||
}
|
|
||||||
//被打下榜 重新上
|
|
||||||
if(myLingmaiId ==0){
|
|
||||||
double disappearScore = rank.getScoreById(uid, crossGroup + RedisKey.Delimiter_colon + group);
|
|
||||||
if(disappearScore>0){
|
|
||||||
lingMaiSecretArea.setScore1((int) disappearScore);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
RedisUtil.getInstence().putMapEntry(RedisKey.CROSS_LINGMAISECRET_INFO, crossGroup + RedisKey.Delimiter_colon + group, String.valueOf(id), lingMaiSecretArea);
|
|
||||||
}
|
}
|
||||||
res.setResult(fightResult.getResult());
|
res.setResult(fightResult.getResult());
|
||||||
} else {
|
}
|
||||||
//PVP
|
|
||||||
// 组装真人数据
|
// PVP 组装真人数据
|
||||||
|
else {
|
||||||
// 战斗逻辑
|
// 战斗逻辑
|
||||||
int defUid = lingMaiMap.get(String.valueOf(id)).getUid();
|
int defUid = lingMaiMap.get(String.valueOf(id)).getUid();
|
||||||
CSPlayer csPlayer = CrossServiceLogic.getPlayerByRedis(defUid);
|
CSPlayer csPlayer = CrossServiceLogic.getPlayerByRedis(defUid);
|
||||||
if (csPlayer == null) {
|
if (csPlayer == null) {
|
||||||
throw new ErrorCodeException(ErrorCode.USE_NOT_EXIT);
|
throw new ErrorCodeException(ErrorCode.USE_NOT_EXIT);
|
||||||
}
|
}
|
||||||
//其他服玩家rpc 数据调用
|
|
||||||
int myforce = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.CROSS_LING_MAI_SECRET_AREA.getTeamId(), false);
|
int myforce = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.CROSS_LING_MAI_SECRET_AREA.getTeamId(), false);
|
||||||
|
//其他服玩家rpc 数据调用
|
||||||
User defuser = PlayerLogic.getInstance().getUserByRpc(defUid);
|
User defuser = PlayerLogic.getInstance().getUserByRpc(defUid);
|
||||||
int defforce = HeroLogic.getInstance().calTeamTotalForce(defuser, TeamEnum.CROSS_LING_MAI_SECRET_AREA.getTeamId(), false);
|
int defforce = HeroLogic.getInstance().calTeamTotalForce(defuser, TeamEnum.CROSS_LING_MAI_SECRET_AREA.getTeamId(), false);
|
||||||
// 本人
|
// 本人
|
||||||
|
|
@ -191,51 +166,25 @@ public class CrossLingmaiSecretAreaBattleHandler extends BaseHandler<ArenaInfoPr
|
||||||
LOGGER.error("跨服灵脉秘境真人战斗结果:"+result);
|
LOGGER.error("跨服灵脉秘境真人战斗结果:"+result);
|
||||||
if (result == 1) {
|
if (result == 1) {
|
||||||
//赢了 我有灵脉 我没灵脉
|
//赢了 我有灵脉 我没灵脉
|
||||||
//别人积分收益结算
|
|
||||||
LingMaiSecretArea oldOwner = lingMaiMap.get(String.valueOf(id));//上一个占领者
|
|
||||||
//int minute = ((TimeUtils.nowInt() - (int)oldOwner.getGetAwardTimeOrOccupyTime()) / 60) > 10 ? 10 : ((TimeUtils.nowInt() - (int)oldOwner.getGetAwardTimeOrOccupyTime()) / 60);
|
|
||||||
int minute = ((TimeUtils.nowInt() - (int)oldOwner.getGetAwardTimeOrOccupyTime()) / 60);
|
|
||||||
int second = Math.min(((TimeUtils.nowInt() - (int) oldOwner.getGetAwardTimeOrOccupyTime()) % 60), 60);
|
|
||||||
long tempScore = (long) second * config.getRewardList()[0][1] / 60;
|
|
||||||
LOGGER.info("uid:"+uid+"pvp other occupy id:"+id+" minute:"+minute+"second:"+second);
|
|
||||||
//oldOwner.setScore1(oldOwner.getScore1()+minute*config.getRewardList()[0][1]+(int)tempScore);
|
|
||||||
int score1 =oldOwner.getScore1()+minute*config.getRewardList()[0][1]+(int)tempScore;
|
|
||||||
long scoreOld = score1 + config.getRewardList()[0][1]*(long)oldOwner.getOccupyTime()/60;
|
|
||||||
rank.addRank(defUid, String.valueOf(crossGroup) + RedisKey.Delimiter_colon + group, scoreOld);
|
|
||||||
LingMaiSecretArea myLingmai =null;
|
|
||||||
if (myLingmaiId != 0) {
|
if (myLingmaiId != 0) {
|
||||||
//本人已有灵脉结算
|
//本人已有灵脉结算
|
||||||
myLingmai = lingMaiMap.get(String.valueOf(myLingmaiId));//上一个占领者
|
LingMaiSecretArea myLingmai = lingMaiMap.get(String.valueOf(myLingmaiId));
|
||||||
config = SLodeConfig.lodeConfig.get(myLingmaiId);
|
CrossLingmaiLogic.getInstance().sendNormalMail(uid,myLingmai);
|
||||||
//minute = ((TimeUtils.nowInt() - (int)myLingmai.getGetAwardTimeOrOccupyTime()) / 60) > 10 ? 10 : ((TimeUtils.nowInt() - (int)myLingmai.getGetAwardTimeOrOccupyTime()) / 60);
|
//清除已有灵脉数据
|
||||||
minute = ((TimeUtils.nowInt() - (int)myLingmai.getGetAwardTimeOrOccupyTime()) / 60);
|
RedisUtil.getInstence().removeMapEntrys(RedisKey.CROSS_LINGMAISECRET_INFO, groupKey, String.valueOf(myLingmai.getId()));
|
||||||
second = Math.min(((TimeUtils.nowInt() - (int) myLingmai.getGetAwardTimeOrOccupyTime()) % 60), 60);
|
|
||||||
LOGGER.info("uid:"+uid+"pvp owner occupy id:"+myLingmaiId+" minute:"+minute+"second:"+second);
|
|
||||||
tempScore =((long) second * config.getRewardList()[0][1] / 60);
|
|
||||||
score1 = myLingmai.getScore1()+minute*config.getRewardList()[0][1]+(int)tempScore;
|
|
||||||
//long newScore = score1+
|
|
||||||
//myLingmai.setScore1(myLingmai.getScore1()+minute*config.getRewardList()[0][1]+(int)tempScore);
|
|
||||||
myLingmai.setGetAwardTimeOrOccupyTime(TimeUtils.nowInt());
|
|
||||||
//我的
|
|
||||||
long score = score1 + config.getRewardList()[0][1] * (long)myLingmai.getOccupyTime()/60;
|
|
||||||
rank = RankContext.getRankEnum(RankEnum.CROSS_LINGMAI_RANK_PERSON.getType());
|
|
||||||
rank.addRank(user.getId(), String.valueOf(crossGroup) + RedisKey.Delimiter_colon + group, score);
|
|
||||||
myLingmai.setScore1((int)score);
|
|
||||||
//两边都计算分 置换
|
|
||||||
//oldOwner.setScore1(score);
|
|
||||||
oldOwner.setGetAwardTimeOrOccupyTime(TimeUtils.nowInt());
|
|
||||||
oldOwner.setId(myLingmaiId);
|
|
||||||
oldOwner.setBeginOccupyTime(TimeUtils.nowInt());
|
|
||||||
oldOwner.setOccupyTime(0);
|
|
||||||
oldOwner.setScore1((int)scoreOld);
|
|
||||||
RedisUtil.getInstence().putMapEntry(RedisKey.CROSS_LINGMAISECRET_INFO, crossGroup + RedisKey.Delimiter_colon + group, String.valueOf(myLingmaiId), oldOwner);
|
|
||||||
}
|
}
|
||||||
//易主
|
// 给失败者发邮件
|
||||||
LingMaiSecretArea lingMaiSecretArea = CrossLingmaiLogic.getLingaMaiData(id, uid,crossGroup,group);
|
LingMaiSecretArea nowLingMai = lingMaiMap.get(String.valueOf(id));
|
||||||
if(myLingmai!=null){
|
CrossLingmaiLogic.getInstance().sendBeAckMail(nowLingMai.getUid(),nowLingMai,uid);
|
||||||
lingMaiSecretArea.setScore1(myLingmai.getScore1());
|
//清除已有灵脉数据
|
||||||
}
|
RedisUtil.getInstence().removeMapEntrys(RedisKey.CROSS_LINGMAISECRET_INFO, groupKey, String.valueOf(nowLingMai.getId()));
|
||||||
RedisUtil.getInstence().putMapEntry(RedisKey.CROSS_LINGMAISECRET_INFO, crossGroup + RedisKey.Delimiter_colon + group, String.valueOf(id), lingMaiSecretArea);
|
|
||||||
|
// 更新灵脉信息
|
||||||
|
nowLingMai.setUid(uid);
|
||||||
|
nowLingMai.setServerName(serverName);
|
||||||
|
nowLingMai.setOccupyTime(nowInt);
|
||||||
|
RedisUtil.getInstence().putMapEntry(RedisKey.CROSS_LINGMAISECRET_INFO, groupKey, String.valueOf(id), nowLingMai);
|
||||||
|
|
||||||
//挑战者记录
|
//挑战者记录
|
||||||
String key1 = RedisKey.getKey(RedisKey.CROSS_LINGMAISECRET_RECORD, String.valueOf(user.getId()), false);
|
String key1 = RedisKey.getKey(RedisKey.CROSS_LINGMAISECRET_RECORD, String.valueOf(user.getId()), false);
|
||||||
long defLenth = redisUtil.lGetListSize(key1);
|
long defLenth = redisUtil.lGetListSize(key1);
|
||||||
|
|
@ -250,9 +199,10 @@ public class CrossLingmaiSecretAreaBattleHandler extends BaseHandler<ArenaInfoPr
|
||||||
String ackServerName = CrossServiceLogic.simplifyServerName(csPlayer.getServerId());
|
String ackServerName = CrossServiceLogic.simplifyServerName(csPlayer.getServerId());
|
||||||
arenaRecord.setServerName(ackServerName);
|
arenaRecord.setServerName(ackServerName);
|
||||||
//arenaRecord.setPracticeLevel(user.getHeroManager().getPracticeLevel());//修行等级 TODO
|
//arenaRecord.setPracticeLevel(user.getHeroManager().getPracticeLevel());//修行等级 TODO
|
||||||
arenaRecord.setCreateTime(TimeUtils.nowInt());
|
arenaRecord.setCreateTime(nowInt);
|
||||||
String defarenaRecordJson = new Gson().toJson(arenaRecord);
|
String defarenaRecordJson = new Gson().toJson(arenaRecord);
|
||||||
redisUtil.lSet(key1, defarenaRecordJson);
|
redisUtil.lSet(key1, defarenaRecordJson);
|
||||||
|
|
||||||
//被挑战者记录
|
//被挑战者记录
|
||||||
String key2 = RedisKey.getKey(RedisKey.CROSS_LINGMAISECRET_RECORD, String.valueOf(defUid), false);
|
String key2 = RedisKey.getKey(RedisKey.CROSS_LINGMAISECRET_RECORD, String.valueOf(defUid), false);
|
||||||
long defLenth2 = redisUtil.lGetListSize(key2);
|
long defLenth2 = redisUtil.lGetListSize(key2);
|
||||||
|
|
@ -264,8 +214,8 @@ public class CrossLingmaiSecretAreaBattleHandler extends BaseHandler<ArenaInfoPr
|
||||||
arenaRecordDef.setUserName(user.getPlayerInfoManager().getNickName());
|
arenaRecordDef.setUserName(user.getPlayerInfoManager().getNickName());
|
||||||
arenaRecordDef.setId(String.valueOf(id));
|
arenaRecordDef.setId(String.valueOf(id));
|
||||||
arenaRecordDef.setPracticeLevel(user.getHeroManager().getPracticeLevel());
|
arenaRecordDef.setPracticeLevel(user.getHeroManager().getPracticeLevel());
|
||||||
arenaRecordDef.setCreateTime(TimeUtils.nowInt());
|
arenaRecordDef.setCreateTime(nowInt);
|
||||||
ackServerName = CrossServiceLogic.simplifyServerName(GameApplication.serverId);
|
ackServerName = serverName;
|
||||||
arenaRecordDef.setServerName(ackServerName);
|
arenaRecordDef.setServerName(ackServerName);
|
||||||
String defarenaRecordJsonDef = new Gson().toJson(arenaRecordDef);
|
String defarenaRecordJsonDef = new Gson().toJson(arenaRecordDef);
|
||||||
redisUtil.lSet(key2, defarenaRecordJsonDef);
|
redisUtil.lSet(key2, defarenaRecordJsonDef);
|
||||||
|
|
|
||||||
|
|
@ -62,14 +62,13 @@ public class CrossLingmaiSecretAreaInfoHandler extends BaseHandler<ArenaInfoProt
|
||||||
//开启新一轮活动了 删除数据
|
//开启新一轮活动了 删除数据
|
||||||
String key = RedisKey.getKey(RedisKey.CROSS_LINGMAISECRET_RECORD, String.valueOf(uid), false);
|
String key = RedisKey.getKey(RedisKey.CROSS_LINGMAISECRET_RECORD, String.valueOf(uid), false);
|
||||||
RedisUtil.getInstence().del(key);
|
RedisUtil.getInstence().del(key);
|
||||||
|
|
||||||
}
|
}
|
||||||
int group = SMServerLodeSetting.getGroupByLevel(arenaManager.getCrossLingmaiFirstLevel());
|
int group = SMServerLodeSetting.getGroupByLevel(arenaManager.getCrossLingmaiFirstLevel());
|
||||||
int page = request.getPage();
|
int page = request.getPage();
|
||||||
//CROSS_LINGMAISECRET_INFO:跨服分组:分组
|
//CROSS_LINGMAISECRET_INFO:跨服分组:分组
|
||||||
Map<String, LingMaiSecretArea> lingMaiMap = RedisUtil.getInstence().getMapValues(RedisKey.CROSS_LINGMAISECRET_INFO, crossGroup + RedisKey.Delimiter_colon + group, String.class, LingMaiSecretArea.class);
|
Map<String, LingMaiSecretArea> lingMaiMap = CrossLingmaiLogic.getInstance().getLingmaiMap(crossGroup,group);
|
||||||
if (page == 0) {
|
if (page == 0) {
|
||||||
int id = lingMaiMap.values().stream().filter(n -> n.getUid() == uid).limit(1).mapToInt(n -> n.getId()).sum();
|
int id = lingMaiMap.values().stream().filter(n -> n.getUid() == uid).limit(1).mapToInt(LingMaiSecretArea::getId).sum();
|
||||||
if (SLodeConfig.lodeConfig.get(id) != null) {
|
if (SLodeConfig.lodeConfig.get(id) != null) {
|
||||||
page = SLodeConfig.lodeConfig.get(id).getPageNo();
|
page = SLodeConfig.lodeConfig.get(id).getPageNo();
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -94,9 +93,9 @@ public class CrossLingmaiSecretAreaInfoHandler extends BaseHandler<ArenaInfoProt
|
||||||
int myOccupyTime = 0;
|
int myOccupyTime = 0;
|
||||||
//自己相关的
|
//自己相关的
|
||||||
List<LingMaiSecretArea> matchMyInfoList = lingMaiMap.values().stream().filter(n -> n.getUid() == uid).collect(Collectors.toList());
|
List<LingMaiSecretArea> matchMyInfoList = lingMaiMap.values().stream().filter(n -> n.getUid() == uid).collect(Collectors.toList());
|
||||||
if (matchMyInfoList != null && matchMyInfoList.size() > 0) {
|
if (matchMyInfoList.size() > 0) {
|
||||||
myOccupyId = matchMyInfoList.get(0).getId();
|
myOccupyId = matchMyInfoList.get(0).getId();
|
||||||
myOccupyTime = (int) matchMyInfoList.get(0).getBeginOccupyTime();
|
myOccupyTime = matchMyInfoList.get(0).getOccupyTime();
|
||||||
}
|
}
|
||||||
//当前页面数据
|
//当前页面数据
|
||||||
for (SLodeConfig config : pageConfig) {
|
for (SLodeConfig config : pageConfig) {
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ import org.slf4j.LoggerFactory;
|
||||||
import rpc.protocols.CommonProto;
|
import rpc.protocols.CommonProto;
|
||||||
import rpc.protocols.PlayerInfoProto;
|
import rpc.protocols.PlayerInfoProto;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
@ -47,6 +48,7 @@ public class ReportUtil {
|
||||||
|
|
||||||
//对外接口只有一个(关闭数数上报 2022 4 25)
|
//对外接口只有一个(关闭数数上报 2022 4 25)
|
||||||
public static void onReportEvent(User user,int type,Object... param) throws Exception {
|
public static void onReportEvent(User user,int type,Object... param) throws Exception {
|
||||||
|
LOGGER.info("*************埋点信息**********,uid:{},type:{},param:{}",user.getId(),type, Arrays.asList(param));
|
||||||
// if(!GameApplication.serverProperties.isSendlog37()){
|
// if(!GameApplication.serverProperties.isSendlog37()){
|
||||||
// ta=null;
|
// ta=null;
|
||||||
// return;
|
// return;
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,6 @@ class SignInSumActivity extends AbstractActivity {
|
||||||
reSetValue(UserManager.getUser(session.getUid()));
|
reSetValue(UserManager.getUser(session.getUid()));
|
||||||
}
|
}
|
||||||
reportTakeActivityReward(UserManager.getUser(session.getUid()),config.getReward(),missionId);
|
reportTakeActivityReward(UserManager.getUser(session.getUid()),config.getReward(),missionId);
|
||||||
ActivityMission activityMission = UserManager.getUser(session.getUid()).getActivityManager().getActivityMissionMap().get(this.id);
|
|
||||||
sendActivityProgress(session, null);
|
sendActivityProgress(session, null);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|
|
||||||
|
|
@ -41,4 +41,13 @@ public class AutoRechargeBackEvent implements IEvent {
|
||||||
public String getRechargeMethod() {
|
public String getRechargeMethod() {
|
||||||
return rechargeMethod;
|
return rechargeMethod;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "AutoRechargeBackEvent{" +
|
||||||
|
"userId=" + userId +
|
||||||
|
", giftId=" + giftId +
|
||||||
|
", rechargeMethod='" + rechargeMethod + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -844,7 +844,7 @@ public class ArenaLogic {
|
||||||
|
|
||||||
private void checkState(){
|
private void checkState(){
|
||||||
TimeControllerOfFunction timeControllerOfFunction = GlobalDataManaager.getInstance().getTimeControllerOfFunctionByFunctinoType(FunctionIdEnum.World_Arena);
|
TimeControllerOfFunction timeControllerOfFunction = GlobalDataManaager.getInstance().getTimeControllerOfFunctionByFunctinoType(FunctionIdEnum.World_Arena);
|
||||||
if(null ==timeControllerOfFunction){
|
if(null == timeControllerOfFunction){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
long diff = (System.currentTimeMillis() - timeControllerOfFunction.getStartTime())/1000;
|
long diff = (System.currentTimeMillis() - timeControllerOfFunction.getStartTime())/1000;
|
||||||
|
|
|
||||||
|
|
@ -13,19 +13,13 @@ import com.ljsd.jieling.logic.mail.MailLogic;
|
||||||
import com.ljsd.jieling.logic.rank.RankContext;
|
import com.ljsd.jieling.logic.rank.RankContext;
|
||||||
import com.ljsd.jieling.logic.rank.RankEnum;
|
import com.ljsd.jieling.logic.rank.RankEnum;
|
||||||
import com.ljsd.jieling.logic.rank.rankImpl.AbstractRank;
|
import com.ljsd.jieling.logic.rank.rankImpl.AbstractRank;
|
||||||
import config.SErrorCodeEerverConfig;
|
import config.*;
|
||||||
import config.SLodeConfig;
|
|
||||||
import config.SLodeRankReward;
|
|
||||||
import config.SMServerLodeSetting;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import util.StringUtil;
|
import util.StringUtil;
|
||||||
import util.TimeUtils;
|
import util.TimeUtils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -57,7 +51,7 @@ public class CrossLingmaiLogic {
|
||||||
lingMaiSecretArea.setBeginOccupyTime(TimeUtils.nowInt());
|
lingMaiSecretArea.setBeginOccupyTime(TimeUtils.nowInt());
|
||||||
if(disappearScore>0){
|
if(disappearScore>0){
|
||||||
Map<String, LingMaiSecretArea> lingMaiMap = RedisUtil.getInstence().getMapValues(RedisKey.CROSS_LINGMAISECRET_INFO, crossGroup + RedisKey.Delimiter_colon + group, String.class, LingMaiSecretArea.class);
|
Map<String, LingMaiSecretArea> lingMaiMap = RedisUtil.getInstence().getMapValues(RedisKey.CROSS_LINGMAISECRET_INFO, crossGroup + RedisKey.Delimiter_colon + group, String.class, LingMaiSecretArea.class);
|
||||||
if(!lingMaiMap.values().stream().anyMatch(n->n.getUid()==uid)){
|
if(lingMaiMap.values().stream().noneMatch(n->n.getUid()==uid)){
|
||||||
lingMaiSecretArea.setScore1((int) disappearScore);
|
lingMaiSecretArea.setScore1((int) disappearScore);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -66,6 +60,7 @@ public class CrossLingmaiLogic {
|
||||||
|
|
||||||
public static void updateLingmaiData(Map<String, LingMaiSecretArea> lingMaiMap, int crossGroup, int group) {
|
public static void updateLingmaiData(Map<String, LingMaiSecretArea> lingMaiMap, int crossGroup, int group) {
|
||||||
int nowTime = TimeUtils.nowInt();
|
int nowTime = TimeUtils.nowInt();
|
||||||
|
String groupkey = crossGroup + RedisKey.Delimiter_colon + group;
|
||||||
for (Map.Entry<String, LingMaiSecretArea> map : lingMaiMap.entrySet()) {
|
for (Map.Entry<String, LingMaiSecretArea> map : lingMaiMap.entrySet()) {
|
||||||
try {
|
try {
|
||||||
User user = UserManager.getUser(map.getValue().getUid());
|
User user = UserManager.getUser(map.getValue().getUid());
|
||||||
|
|
@ -74,23 +69,21 @@ public class CrossLingmaiLogic {
|
||||||
if (config != null) {
|
if (config != null) {
|
||||||
int occupyTime = (int) map.getValue().getGetAwardTimeOrOccupyTime();
|
int occupyTime = (int) map.getValue().getGetAwardTimeOrOccupyTime();
|
||||||
//分钟
|
//分钟
|
||||||
//int minute = (nowTime - occupyTime) / 60 >= 10 ? 10 : (nowTime - occupyTime) / 60;
|
|
||||||
int minute = (nowTime - occupyTime) / 60;
|
int minute = (nowTime - occupyTime) / 60;
|
||||||
//秒
|
//秒
|
||||||
int second = (nowTime - occupyTime) % 60 >= 60 ? 60 : (nowTime - occupyTime) % 60;
|
int second = Math.min((nowTime - occupyTime) % 60, 60);
|
||||||
//difVal =1 ;
|
//difVal =1 ;
|
||||||
LOGGER.error("玩家" + map.getValue().getUid() + "原有秒:"+map.getValue().getOccupyTime()+" 获得秒:" + (minute*60+second));
|
LOGGER.error("玩家" + map.getValue().getUid() + "原有秒:"+map.getValue().getOccupyTime()+" 获得秒:" + (minute*60+second));
|
||||||
map.getValue().setOccupyTime(map.getValue().getOccupyTime() + minute*60+second);
|
map.getValue().setOccupyTime(map.getValue().getOccupyTime() + minute*60+second);
|
||||||
map.getValue().setGetAwardTimeOrOccupyTime(nowTime);
|
map.getValue().setGetAwardTimeOrOccupyTime(nowTime);
|
||||||
|
|
||||||
RedisUtil.getInstence().putMapEntry(RedisKey.CROSS_LINGMAISECRET_INFO,
|
RedisUtil.getInstence().putMapEntry(RedisKey.CROSS_LINGMAISECRET_INFO, groupkey, map.getKey(), map.getValue());
|
||||||
crossGroup + RedisKey.Delimiter_colon + group, map.getKey(), map.getValue());
|
|
||||||
AbstractRank rank = RankContext.getRankEnum(RankEnum.CROSS_LINGMAI_RANK_PERSON.getType());
|
AbstractRank rank = RankContext.getRankEnum(RankEnum.CROSS_LINGMAI_RANK_PERSON.getType());
|
||||||
LOGGER.error("minute:"+map.getValue().getOccupyTime()+" per:"+(config.getRewardList()[0][1]/60));
|
LOGGER.error("minute:"+map.getValue().getOccupyTime()+" per:"+(config.getRewardList()[0][1]/60));
|
||||||
long score = (long)map.getValue().getOccupyTime() * config.getRewardList()[0][1]/60 + map.getValue().getScore1();
|
long score = (long)map.getValue().getOccupyTime() * config.getRewardList()[0][1]/60 + map.getValue().getScore1();
|
||||||
double test = rank.getScoreById(user.getId(), crossGroup + RedisKey.Delimiter_colon + group);
|
double test = rank.getScoreById(user.getId(), groupkey);
|
||||||
LOGGER.error("之前是:" + test + "之后是:" + score);
|
LOGGER.error("之前是:" + test + "之后是:" + score);
|
||||||
rank.addRank(user.getId(), String.valueOf(crossGroup) + RedisKey.Delimiter_colon + group, score);
|
rank.addRank(user.getId(), groupkey, score);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
@ -106,7 +99,7 @@ public class CrossLingmaiLogic {
|
||||||
long mondayZeroTime = TimeUtils.getWeekZero(1);
|
long mondayZeroTime = TimeUtils.getWeekZero(1);
|
||||||
List<Integer> sendWeekDay = new ArrayList<>();
|
List<Integer> sendWeekDay = new ArrayList<>();
|
||||||
for (int[] everyTime : battleTime) {
|
for (int[] everyTime : battleTime) {
|
||||||
sendWeekDay.add(TimeUtils.getDayOfWeekBytime(mondayZeroTime + (everyTime[1]+3) * 1000));
|
sendWeekDay.add(TimeUtils.getDayOfWeekBytime(mondayZeroTime + (everyTime[1]+3) * 1000L));
|
||||||
}
|
}
|
||||||
return sendWeekDay;
|
return sendWeekDay;
|
||||||
}
|
}
|
||||||
|
|
@ -119,7 +112,7 @@ public class CrossLingmaiLogic {
|
||||||
long mondayZeroTime = TimeUtils.getWeekZero(1);
|
long mondayZeroTime = TimeUtils.getWeekZero(1);
|
||||||
//休战期
|
//休战期
|
||||||
for (int[] everyTime : restTime) {
|
for (int[] everyTime : restTime) {
|
||||||
if (TimeUtils.now() >= mondayZeroTime + everyTime[0] * 1000 && TimeUtils.now() <= mondayZeroTime + everyTime[1] * 1000) {
|
if (TimeUtils.now() >= mondayZeroTime + everyTime[0] * 1000L && TimeUtils.now() <= mondayZeroTime + everyTime[1] * 1000L) {
|
||||||
result[0] = 2;
|
result[0] = 2;
|
||||||
result[1] = (int) (mondayZeroTime / 1000) + everyTime[1];
|
result[1] = (int) (mondayZeroTime / 1000) + everyTime[1];
|
||||||
return;
|
return;
|
||||||
|
|
@ -127,7 +120,7 @@ public class CrossLingmaiLogic {
|
||||||
}
|
}
|
||||||
//抢夺期
|
//抢夺期
|
||||||
for (int[] everyTime : battleTime) {
|
for (int[] everyTime : battleTime) {
|
||||||
if (TimeUtils.now() > mondayZeroTime + everyTime[0] * 1000 && TimeUtils.now() < mondayZeroTime + everyTime[1] * 1000) {
|
if (TimeUtils.now() > mondayZeroTime + everyTime[0] * 1000L && TimeUtils.now() < mondayZeroTime + everyTime[1] * 1000L) {
|
||||||
result[0] = 1;
|
result[0] = 1;
|
||||||
result[1] = (int) (mondayZeroTime / 1000) + everyTime[1];
|
result[1] = (int) (mondayZeroTime / 1000) + everyTime[1];
|
||||||
return;
|
return;
|
||||||
|
|
@ -146,6 +139,92 @@ public class CrossLingmaiLogic {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getReward(int multiple, int[][] reward){
|
||||||
|
StringBuilder builder = new StringBuilder();
|
||||||
|
for (int[] ints : reward) {
|
||||||
|
builder.append(ints[0]).append("#").append(ints[1]*multiple).append("|");
|
||||||
|
}
|
||||||
|
if (builder.length() <= 0){
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return builder.substring(0,builder.length()-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, LingMaiSecretArea> getLingmaiMap(int crossGroup, int group){
|
||||||
|
int nowInt = TimeUtils.nowInt();
|
||||||
|
String groupKey = crossGroup + RedisKey.Delimiter_colon + group;
|
||||||
|
int second = SSpecialConfig.getIntegerValue(SSpecialConfig.lingmai_basic_configuration);
|
||||||
|
Map<String, LingMaiSecretArea> mapValues = RedisUtil.getInstence().getMapValues(RedisKey.CROSS_LINGMAISECRET_INFO, groupKey, String.class, LingMaiSecretArea.class);
|
||||||
|
Iterator<Map.Entry<String, LingMaiSecretArea>> iterator = mapValues.entrySet().iterator();
|
||||||
|
while (iterator.hasNext()){
|
||||||
|
Map.Entry<String, LingMaiSecretArea> next = iterator.next();
|
||||||
|
LingMaiSecretArea lingMaiSecretArea = next.getValue();
|
||||||
|
int time = nowInt - lingMaiSecretArea.getOccupyTime();
|
||||||
|
if (time > second){
|
||||||
|
iterator.remove();
|
||||||
|
sendNormalMail(lingMaiSecretArea.getUid(),lingMaiSecretArea);
|
||||||
|
RedisUtil.getInstence().removeMapEntrys(RedisKey.CROSS_LINGMAISECRET_INFO, groupKey, String.valueOf(lingMaiSecretArea.getId()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return mapValues;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void sendNormalMail(int uid, LingMaiSecretArea myLingmai){
|
||||||
|
int nowInt = TimeUtils.nowInt();
|
||||||
|
SLodeConfig sLodeConfig = SLodeConfig.lodeConfig.get(myLingmai.getId());
|
||||||
|
int time = (nowInt - myLingmai.getOccupyTime()) / 60;
|
||||||
|
int minute = SSpecialConfig.getIntegerValue(SSpecialConfig.lingmai_basic_configuration)/60;
|
||||||
|
int minTime = Math.min(time, minute);
|
||||||
|
String title = SErrorCodeEerverConfig.getI18NMessage("LingmaikaicaiReward_mail_title");
|
||||||
|
String content = SErrorCodeEerverConfig.getI18NMessage("LingmaikaicaiReward_mail_txt", new Object[]{minTime});
|
||||||
|
String reward = CrossLingmaiLogic.getInstance().getReward(minTime, sLodeConfig.getRewardList());
|
||||||
|
MailLogic.getInstance().sendMail(uid,title,content,reward,nowInt,Global.MAIL_EFFECTIVE_TIME);
|
||||||
|
LOGGER.info("灵脉发送正常结束邮件:{}",uid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void sendBeAckMail(int uid, LingMaiSecretArea myLingmai, int ackId){
|
||||||
|
int nowInt = TimeUtils.nowInt();
|
||||||
|
SLodeConfig sLodeConfig = SLodeConfig.lodeConfig.get(myLingmai.getId());
|
||||||
|
int time = (nowInt - myLingmai.getOccupyTime()) / 60;
|
||||||
|
int minute = SSpecialConfig.getIntegerValue(SSpecialConfig.lingmai_basic_configuration)/60;
|
||||||
|
int minTime = Math.min(time, minute);
|
||||||
|
String title = SErrorCodeEerverConfig.getI18NMessage("LingmaikaicaiReward1_mail_title");
|
||||||
|
String content = SErrorCodeEerverConfig.getI18NMessage("LingmaikaicaiReward1_mail_txt", new Object[]{ackId,minTime});
|
||||||
|
String reward = CrossLingmaiLogic.getInstance().getReward(minTime, sLodeConfig.getRewardList());
|
||||||
|
MailLogic.getInstance().sendMail(uid,title,content,reward,nowInt,Global.MAIL_EFFECTIVE_TIME);
|
||||||
|
LOGGER.info("灵脉发送被占领结束邮件:{}",uid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initData(){
|
||||||
|
//初始化数据
|
||||||
|
int crossGroup = GlobleSystemLogic.getInstence().getCrossGroup();
|
||||||
|
if (crossGroup == -1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 清理组别1
|
||||||
|
String groupKey1 = crossGroup + RedisKey.Delimiter_colon + 1;
|
||||||
|
Map<String, LingMaiSecretArea> mapValues = RedisUtil.getInstence().getMapValues(RedisKey.CROSS_LINGMAISECRET_INFO, groupKey1, String.class, LingMaiSecretArea.class);
|
||||||
|
for (LingMaiSecretArea value : mapValues.values()) {
|
||||||
|
sendNormalMail(value.getUid(),value);
|
||||||
|
}
|
||||||
|
String key1 = RedisUtil.getInstence().getKey(RedisKey.CROSS_LINGMAISECRET_INFO, groupKey1);
|
||||||
|
RedisUtil.getInstence().del(key1);
|
||||||
|
LOGGER.info("灵脉初始化,key:{}, 长度:{}",key1,mapValues.size());
|
||||||
|
mapValues.clear();
|
||||||
|
|
||||||
|
// 清理组别2
|
||||||
|
String groupKey2 = crossGroup + RedisKey.Delimiter_colon + 2;
|
||||||
|
Map<String, LingMaiSecretArea> mapValue2 = RedisUtil.getInstence().getMapValues(RedisKey.CROSS_LINGMAISECRET_INFO, groupKey1, String.class, LingMaiSecretArea.class);
|
||||||
|
for (LingMaiSecretArea value : mapValue2.values()) {
|
||||||
|
sendNormalMail(value.getUid(),value);
|
||||||
|
}
|
||||||
|
String key2 = RedisUtil.getInstence().getKey(RedisKey.CROSS_LINGMAISECRET_INFO, groupKey2);
|
||||||
|
RedisUtil.getInstence().del(key2);
|
||||||
|
LOGGER.info("灵脉初始化,key:{}, 长度:{}",key2,mapValue2.size());
|
||||||
|
mapValue2.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 占领奖励 每十分钟发放一次
|
* 占领奖励 每十分钟发放一次
|
||||||
*/
|
*/
|
||||||
|
|
@ -169,35 +248,22 @@ public class CrossLingmaiLogic {
|
||||||
if (crossGroup == -1) {
|
if (crossGroup == -1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String rkey1 = RedisUtil.getInstence().getKey(RedisKey.CROSS_LINGMAI_RANK_PERSON, Integer.toString(crossGroup) + RedisKey.Delimiter_colon + "1");
|
String rkey1 = RedisUtil.getInstence().getKey(RedisKey.CROSS_LINGMAI_RANK_PERSON, crossGroup + RedisKey.Delimiter_colon + "1");
|
||||||
String rkey2 = RedisUtil.getInstence().getKey(RedisKey.CROSS_LINGMAI_RANK_PERSON, Integer.toString(crossGroup) + RedisKey.Delimiter_colon + "2");
|
String rkey2 = RedisUtil.getInstence().getKey(RedisKey.CROSS_LINGMAI_RANK_PERSON, crossGroup + RedisKey.Delimiter_colon + "2");
|
||||||
Set<String> arenaRank1 = RedisUtil.getInstence().getReverseZset(rkey1, 0, -1);
|
Set<String> arenaRank1 = RedisUtil.getInstence().getReverseZset(rkey1, 0, -1);
|
||||||
Set<String> arenaRank2 = RedisUtil.getInstence().getReverseZset(rkey2, 0, -1);
|
Set<String> arenaRank2 = RedisUtil.getInstence().getReverseZset(rkey2, 0, -1);
|
||||||
sendMailReward(arenaRank1);
|
sendMailReward(arenaRank1);
|
||||||
sendMailReward(arenaRank2);
|
sendMailReward(arenaRank2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initData(){
|
|
||||||
//初始化数据
|
|
||||||
int crossGroup = GlobleSystemLogic.getInstence().getCrossGroup();
|
|
||||||
if (crossGroup == -1) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
String rkey1 = RedisUtil.getInstence().getKey(RedisKey.CROSS_LINGMAI_RANK_PERSON, Integer.toString(crossGroup) + RedisKey.Delimiter_colon + "1");
|
|
||||||
String rkey2 = RedisUtil.getInstence().getKey(RedisKey.CROSS_LINGMAI_RANK_PERSON, Integer.toString(crossGroup) + RedisKey.Delimiter_colon + "2");
|
|
||||||
RedisUtil.getInstence().del(rkey1);
|
|
||||||
RedisUtil.getInstence().del(rkey2);
|
|
||||||
String inf1 = RedisUtil.getInstence().getKey(RedisKey.CROSS_LINGMAISECRET_INFO, Integer.toString(crossGroup) + RedisKey.Delimiter_colon + "1");
|
|
||||||
String inf2 = RedisUtil.getInstence().getKey(RedisKey.CROSS_LINGMAISECRET_INFO, Integer.toString(crossGroup) + RedisKey.Delimiter_colon + "2");
|
|
||||||
RedisUtil.getInstence().del(inf1);
|
|
||||||
RedisUtil.getInstence().del(inf2);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void sendMailReward(Set<String> arenaRank) {
|
public void sendMailReward(Set<String> arenaRank) {
|
||||||
List<Integer> arenaRankfilt = arenaRank.stream().mapToInt(n -> Integer.parseInt(n)).boxed().collect(Collectors.toList());
|
List<Integer> arenaRankfilt = arenaRank.stream().mapToInt(Integer::parseInt).boxed().collect(Collectors.toList());
|
||||||
String title = SErrorCodeEerverConfig.getI18NMessage("LingmaiReward_mail_title");
|
String title = SErrorCodeEerverConfig.getI18NMessage("LingmaiReward_mail_title");
|
||||||
for (int i = 0; i < arenaRankfilt.size(); i++) {
|
for (int i = 0; i < arenaRankfilt.size(); i++) {
|
||||||
SLodeRankReward config = SLodeRankReward.getIdByScore(i + 1);
|
SLodeRankReward config = SLodeRankReward.getIdByScore(i + 1);
|
||||||
|
if (config == null){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
String content = SErrorCodeEerverConfig.getI18NMessageNeedConvert("LingmaiReward_mail_txt", new Object[]{(i + 1)}, new int[0], "#");
|
String content = SErrorCodeEerverConfig.getI18NMessageNeedConvert("LingmaiReward_mail_txt", new Object[]{(i + 1)}, new int[0], "#");
|
||||||
MailLogic.getInstance().sendMail(arenaRankfilt.get(i), title, content,
|
MailLogic.getInstance().sendMail(arenaRankfilt.get(i), title, content,
|
||||||
|
|
@ -208,61 +274,7 @@ public class CrossLingmaiLogic {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO 之后删除
|
|
||||||
public void fixBug(){
|
|
||||||
LOGGER.error("lingmaimijing6");
|
|
||||||
//初始化数据
|
|
||||||
int crossGroup = GlobleSystemLogic.getInstence().getCrossGroup();
|
|
||||||
if (crossGroup == -1) {
|
|
||||||
LOGGER.error("lingmaifenzu:"+crossGroup);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Map<String, LingMaiSecretArea> lingMaiMap1 = RedisUtil.getInstence().getMapValues(RedisKey.CROSS_LINGMAISECRET_INFO, crossGroup + RedisKey.Delimiter_colon + 1, String.class, LingMaiSecretArea.class);
|
|
||||||
Map<String, LingMaiSecretArea> lingMaiMap2 = RedisUtil.getInstence().getMapValues(RedisKey.CROSS_LINGMAISECRET_INFO, crossGroup + RedisKey.Delimiter_colon + 2, String.class, LingMaiSecretArea.class);
|
|
||||||
LOGGER.error("lingmaimijing4");
|
|
||||||
fixBugUpdateLingmaiData(lingMaiMap1,crossGroup,1);
|
|
||||||
LOGGER.error("lingmaimijing5");
|
|
||||||
fixBugUpdateLingmaiData(lingMaiMap2,crossGroup,2);
|
|
||||||
LOGGER.error("lingmaimijing1");
|
|
||||||
//排行榜删除
|
|
||||||
String rkey1 = RedisUtil.getInstence().getKey(RedisKey.CROSS_LINGMAI_RANK_PERSON, Integer.toString(crossGroup) + RedisKey.Delimiter_colon + "1");
|
|
||||||
String rkey2 = RedisUtil.getInstence().getKey(RedisKey.CROSS_LINGMAI_RANK_PERSON, Integer.toString(crossGroup) + RedisKey.Delimiter_colon + "2");
|
|
||||||
RedisUtil.getInstence().del(rkey1);
|
|
||||||
LOGGER.error("lingmaimijing2"+rkey1);
|
|
||||||
RedisUtil.getInstence().del(rkey2);
|
|
||||||
LOGGER.error("lingmaimijing3"+rkey2);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void fixBugUpdateLingmaiData(Map<String, LingMaiSecretArea> lingMaiMap,int crossGroup,int group) {
|
|
||||||
for (Map.Entry<String, LingMaiSecretArea> map : lingMaiMap.entrySet()) {
|
|
||||||
try{
|
|
||||||
User user = UserManager.getUser(map.getValue().getUid());
|
|
||||||
if (user != null) {
|
|
||||||
SLodeConfig config = SLodeConfig.lodeConfig.get(map.getValue().getId());
|
|
||||||
if(config !=null){
|
|
||||||
map.getValue().setGetAwardTimeOrOccupyTime(TimeUtils.nowInt());
|
|
||||||
map.getValue().setBeginOccupyTime(TimeUtils.nowInt());
|
|
||||||
LOGGER.error("lingmaimijing1");
|
|
||||||
map.getValue().setScore1(0);
|
|
||||||
map.getValue().setOccupyTime(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
RedisUtil.getInstence().putMapEntrys(RedisKey.CROSS_LINGMAISECRET_INFO, crossGroup + RedisKey.Delimiter_colon + group, lingMaiMap);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static class Instance {
|
public static class Instance {
|
||||||
public final static CrossLingmaiLogic instance = new CrossLingmaiLogic();
|
public final static CrossLingmaiLogic instance = new CrossLingmaiLogic();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -451,7 +451,11 @@ public class GuildLogic {
|
||||||
Set<Integer> value = memberEntry.getValue();
|
Set<Integer> value = memberEntry.getValue();
|
||||||
for(Integer uidTmp : value){
|
for(Integer uidTmp : value){
|
||||||
User userTmp = PlayerLogic.getInstance().getUserByRpc(uidTmp);
|
User userTmp = PlayerLogic.getInstance().getUserByRpc(uidTmp);
|
||||||
builder.addFamilyUserInfo(CBean2Proto.getFamilyUserInfo(userTmp,position));
|
if (userTmp != null){
|
||||||
|
builder.addFamilyUserInfo(CBean2Proto.getFamilyUserInfo(userTmp,position));
|
||||||
|
}else {
|
||||||
|
LOGGER.error("获取工会成员信息报错,本人id:{},工会id:{},报错成员id:{}",uid,guildInfo.getId(),uidTmp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MessageUtil.sendMessage(session,1,msgId,builder.build(),true);
|
MessageUtil.sendMessage(session,1,msgId,builder.build(),true);
|
||||||
|
|
|
||||||
|
|
@ -163,8 +163,7 @@ public class SevenWorldLogic {
|
||||||
int ranking = builder.getMyRankInfo().getRank();
|
int ranking = builder.getMyRankInfo().getRank();
|
||||||
int integral = (int) builder.getMyRankInfo().getParam1();
|
int integral = (int) builder.getMyRankInfo().getParam1();
|
||||||
int count = user.getPlayerInfoManager().getSevenWorldOpenTierCount();
|
int count = user.getPlayerInfoManager().getSevenWorldOpenTierCount();
|
||||||
return PlayerInfoProto.SevenWorldInfoResponse.newBuilder()
|
return PlayerInfoProto.SevenWorldInfoResponse.newBuilder().setId(tier).setRanking(ranking).setIntegral(integral).setTotalTier(count).build();
|
||||||
.setId(tier).setRanking(ranking).setIntegral(integral).setTotalTier(count).build();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -342,7 +342,7 @@ public class MinuteTask extends Thread {
|
||||||
}
|
}
|
||||||
|
|
||||||
//每日分钟数是10的倍数执行 0 分 10分 20分 30分....60分
|
//每日分钟数是10的倍数执行 0 分 10分 20分 30分....60分
|
||||||
public void every10IntMul()throws Exception {
|
public void every10IntMul() {
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
int hour = calendar.get(Calendar.HOUR_OF_DAY);
|
int hour = calendar.get(Calendar.HOUR_OF_DAY);
|
||||||
int minute = calendar.get(Calendar.MINUTE);
|
int minute = calendar.get(Calendar.MINUTE);
|
||||||
|
|
@ -351,32 +351,10 @@ public class MinuteTask extends Thread {
|
||||||
//周二 四 六 开放 9点-21点
|
//周二 四 六 开放 9点-21点
|
||||||
List<Integer> weekDay = CrossLingmaiLogic.getSendRewardWeekDay();
|
List<Integer> weekDay = CrossLingmaiLogic.getSendRewardWeekDay();
|
||||||
if(weekDay.contains(w)){
|
if(weekDay.contains(w)){
|
||||||
//占领奖励
|
|
||||||
if(hour>=9&&hour<21){
|
|
||||||
int mod = minute%10;
|
|
||||||
if(mod ==0 ){
|
|
||||||
CrossLingmaiLogic.getInstance().sendOccypyReward();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(hour==21&& minute==0){
|
|
||||||
CrossLingmaiLogic.getInstance().sendOccypyReward();
|
|
||||||
}
|
|
||||||
//结算每日排行奖励
|
|
||||||
if(hour ==21 && minute==0){
|
|
||||||
CrossLingmaiLogic.getInstance().sendMailReward();
|
|
||||||
}
|
|
||||||
//0点清除数据
|
//0点清除数据
|
||||||
if(hour == 0&& minute==0){
|
if(hour==0 && minute==0){
|
||||||
CrossLingmaiLogic.getInstance().initData();
|
CrossLingmaiLogic.getInstance().initData();
|
||||||
}
|
}
|
||||||
|
|
||||||
//bug 修复
|
|
||||||
/*if(w==4){
|
|
||||||
if(hour ==10 && minute ==50){
|
|
||||||
LOGGER.error("lingmaimijing0 000000");
|
|
||||||
CrossLingmaiLogic.getInstance().fixBug();
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -136,6 +136,7 @@ public class SSpecialConfig implements BaseConfig {
|
||||||
public static final String EquipTalismanaUpperLimit = "EquipTalismanaUpperLimit ";//法宝等级上限
|
public static final String EquipTalismanaUpperLimit = "EquipTalismanaUpperLimit ";//法宝等级上限
|
||||||
public static final String EquipRankResetCost = "EquipRankResetCost";//摘星阁装备强化精炼重置消耗
|
public static final String EquipRankResetCost = "EquipRankResetCost";//摘星阁装备强化精炼重置消耗
|
||||||
public static final String ShenZhunTeQuan = "ShenZhunTeQuan";//神尊特权加个兑换10仙晶兑换1神尊经验
|
public static final String ShenZhunTeQuan = "ShenZhunTeQuan";//神尊特权加个兑换10仙晶兑换1神尊经验
|
||||||
|
public static final String lingmai_basic_configuration = "lingmai_basic_configuration";//灵脉秘境最大占矿时间(s)
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() throws Exception {
|
public void init() throws Exception {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue