罗浮,bug优化
parent
0227b97065
commit
9295289b88
|
@ -305,6 +305,7 @@ public class RedisKey {
|
|||
public static final String LUOFU_ARENA_MY_PRON = "LUOFU_ARENA_MY_PRON";//我自己的膜拜信息
|
||||
public static final String LUOFU_ARENA_RRECORD = "LUOFU_ARENA_RRECORD";//罗浮战斗记录
|
||||
public static final String LUOFU_REGISTER_PLAYER = "LUOFU_REGISTER_PLAYER";//罗浮报名玩家信息
|
||||
public static final String LUOFU_RANK_FIRST_MARK = "LUOFU_RANK_FIRST_MARK";//罗浮第一次初始化排行榜标记
|
||||
|
||||
public static final String GUILD_SERVERID = "GUILD_SERVERID";
|
||||
public static final String CROSS_RANK_UPDATE = "CROSS_RANK_UPDATE";
|
||||
|
|
|
@ -41,6 +41,8 @@ public class GetWorldArenaInfoRequestHandler extends BaseHandler<WorldProto.GetW
|
|||
WorldProto.GetWorldArenaInfoResponse.Builder builder = WorldProto.GetWorldArenaInfoResponse.newBuilder();
|
||||
AbstractRank rank = RankContext.getRankEnum(RankEnum.CROSS_SERVICE_ARENA.getType());
|
||||
int type = proto.getType();
|
||||
// 第一次初始化排行榜检测
|
||||
LuofuLogic.getInstance().firstInitRank();
|
||||
//获取我的排名
|
||||
CommonProto.ArenaInfo.Builder arenaInfo = CommonProto.ArenaInfo.newBuilder();
|
||||
Integer registerType = LuofuLogic.getRegisterType(user.getId());
|
||||
|
|
|
@ -59,13 +59,12 @@ public class LuofuWorshipHandler extends BaseHandler<WorldProto.GetWorldArenaPro
|
|||
worship.putWorship(challengeUid);
|
||||
int count = LuofuLogic.getInstance().getBeWorshipCount(challengeUid);
|
||||
count++;
|
||||
long timeS = TimeUtils.getToTomorrowTimeS();
|
||||
|
||||
redisUtil.putmap(RedisKey.LUOFU_ARENA_PROUD_COUNT, String.valueOf(challengeUid), count);
|
||||
redisUtil.expireMills(RedisKey.LUOFU_ARENA_PROUD_COUNT, timeS);
|
||||
redisUtil.expireMills(RedisKey.LUOFU_ARENA_PROUD_COUNT, LuofuLogic.calNextRegisterTime());
|
||||
|
||||
redisUtil.putmap(RedisKey.LUOFU_ARENA_MY_PRON, String.valueOf(user.getId()), worship);
|
||||
redisUtil.expireMills(RedisKey.LUOFU_ARENA_MY_PRON, timeS);
|
||||
redisUtil.expireMills(RedisKey.LUOFU_ARENA_MY_PRON, TimeUtils.getToTomorrowTimeS());
|
||||
|
||||
WorldProto.GetWorldArenaProudResponse.Builder builder = WorldProto.GetWorldArenaProudResponse.newBuilder();
|
||||
builder.setDrop(drop);
|
||||
|
|
|
@ -47,7 +47,6 @@ import com.ljsd.jieling.network.server.ProtocolsManager;
|
|||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.thread.task.RPCGmServerTask;
|
||||
import com.ljsd.jieling.thread.task.RPCServerTask;
|
||||
import com.ljsd.jieling.thread.task.RPCWorldServerTask;
|
||||
import com.ljsd.jieling.util.CBean2Proto;
|
||||
import com.ljsd.jieling.util.ConfigurableApplicationContextManager;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
|
@ -291,7 +290,7 @@ public class GlobalDataManaager implements IManager {
|
|||
StoreLogic.getInstance().checkGlobalStore(true);
|
||||
new RPCServerTask().start();
|
||||
new RPCGmServerTask().start();
|
||||
new RPCWorldServerTask().start();
|
||||
// new RPCWorldServerTask().start();
|
||||
new UserLevelEventHandler();
|
||||
new RemoveEventHeroHandler();
|
||||
new FightMainEventHandler();
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.ljsd.jieling.db.mongo.MongoUtil;
|
|||
import com.ljsd.jieling.db.mongo.core.CServerInfo;
|
||||
import com.ljsd.jieling.db.redis.RedisKey;
|
||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||
import com.ljsd.jieling.logic.GlobleSystemLogic;
|
||||
import com.ljsd.jieling.logic.dao.PlayerManager;
|
||||
import com.ljsd.jieling.logic.dao.TeamEnum;
|
||||
import com.ljsd.jieling.logic.dao.cross.CSPlayer;
|
||||
|
@ -91,6 +92,10 @@ public class CrossServiceLogic {
|
|||
RedisUtil.getInstence().setObject(getKey(player.getUserId()),player,EXPIRE);
|
||||
}
|
||||
|
||||
public static int getCrossId(){
|
||||
return GlobleSystemLogic.getInstence().getCrossGroup();
|
||||
}
|
||||
|
||||
private static CSPlayer formatUserToPlayer(User user){
|
||||
CSPlayer csPlayer = RedisUtil.getInstence().getObject(getKey(user.getId()), CSPlayer.class);
|
||||
if (csPlayer == null) {
|
||||
|
|
|
@ -73,7 +73,7 @@ public class LuofuLogic {
|
|||
Long[] timeLong = luofuSetting.getTimeLong();
|
||||
// 每个阶段的初始时间
|
||||
long registerStart = timeLong[0], registerEnd = timeLong[1];
|
||||
long initRankStart = timeLong[2], initRankEnd = timeLong[1];
|
||||
long initRankStart = timeLong[2], initRankEnd = timeLong[3];
|
||||
long fightStart = timeLong[4], fightEnd = timeLong[5];
|
||||
long sendRewardStart = timeLong[6], sendRewardEnd = timeLong[7];
|
||||
// 每个阶段的间隔时间
|
||||
|
@ -215,6 +215,24 @@ public class LuofuLogic {
|
|||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.LuofuStatusInfoResponse_VALUE, builder.build(), true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 第一次初始化排行榜
|
||||
*/
|
||||
public void firstInitRank(){
|
||||
int crossId = CrossServiceLogic.getCrossId();
|
||||
if (crossId == -1){
|
||||
return;
|
||||
}
|
||||
String key = RedisKey.LUOFU_RANK_FIRST_MARK + ":" + crossId;
|
||||
String mark = RedisUtil.getInstence().getObject(key, String.class);
|
||||
if (mark != null){
|
||||
return;
|
||||
}
|
||||
RedisUtil.getInstence().set(key, "1");
|
||||
LOGGER.info("罗浮争锋,第一次初始化排行榜....");
|
||||
TaskKit.scheduleOne(this::initRankRobot, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 罗浮争锋 初始化排行榜机器人信息
|
||||
*/
|
||||
|
|
|
@ -116,7 +116,7 @@ public class ThreadManager implements IManager {
|
|||
int delayForMinute = 60 - (now%60);
|
||||
LOGGER.info("delayForMinute---->>>>{}" ,delayForMinute);
|
||||
// 每分钟任务
|
||||
scheduledFutureSets.add(scheduledExecutor.scheduleAtFixedRate(new MinuteTask(), delayForMinute, 1, TimeUnit.MINUTES));
|
||||
scheduledFutureSets.add(scheduledExecutor.scheduleAtFixedRate(new MinuteTask(), delayForMinute, 60, TimeUnit.SECONDS));
|
||||
// 每秒钟任务
|
||||
scheduledFutureSets.add(scheduledExecutor.scheduleAtFixedRate(new SecondsTask(), delayForMinute + 10, 1, TimeUnit.SECONDS));
|
||||
// 战力任务
|
||||
|
|
Loading…
Reference in New Issue