cpu性能优化
parent
619899b028
commit
1493bbfbca
|
@ -73,16 +73,15 @@ public class TasuilingxiaoHandler extends BaseHandler<ActivityProto.Tasuilingxia
|
|||
// 获取怪物组
|
||||
int[][] contents = sMonsterGroup.getContents();
|
||||
double bossBlood = 0.0; //怪物初始化血量
|
||||
for (int i = 0; i < contents.length; i++) {
|
||||
int[] ints = contents[i];
|
||||
for (int j = 0; j < ints.length; j++) {
|
||||
if (ints[j] == 0){
|
||||
for (int[] ints : contents) {
|
||||
for (int anInt : ints) {
|
||||
if (anInt == 0) {
|
||||
// 怪物不存在
|
||||
continue;
|
||||
}
|
||||
SMonsterConfig monsterConfig = STableManager.getConfig(SMonsterConfig.class).get(ints[j]);
|
||||
SMonsterConfig monsterConfig = STableManager.getConfig(SMonsterConfig.class).get(anInt);
|
||||
// 计算总血量
|
||||
bossBlood+=monsterConfig.getHp();
|
||||
bossBlood += monsterConfig.getHp();
|
||||
}
|
||||
}
|
||||
//输
|
||||
|
@ -104,7 +103,7 @@ public class TasuilingxiaoHandler extends BaseHandler<ActivityProto.Tasuilingxia
|
|||
int goal = 0;
|
||||
List<Integer> listState =mission.getActivityMissionMap().entrySet().stream()
|
||||
.sorted(Map.Entry.comparingByKey()).map(e->e.getValue().getState()).collect(Collectors.toList());
|
||||
List<Integer>dropList = new ArrayList<Integer>();
|
||||
List<Integer>dropList = new ArrayList<>();
|
||||
for (int i = 0; i < damageListData.length; i++) {
|
||||
int[] ints = damageListData[i];
|
||||
if(ints[0] > lessBlood){
|
||||
|
|
|
@ -27,7 +27,6 @@ import com.ljsd.jieling.util.SysUtil;
|
|||
import config.SGameSetting;
|
||||
import config.SPlayerLevelConfig;
|
||||
import manager.STableManager;
|
||||
import org.apache.lucene.util.RamUsageEstimator;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import util.TimeUtils;
|
||||
|
@ -74,7 +73,7 @@ public class UserManager {
|
|||
//离线清除逻辑
|
||||
public static void checkOffline(){
|
||||
try {
|
||||
LOGGER.info("user map value size is {}", RamUsageEstimator.humanSizeOf(userMap));
|
||||
// LOGGER.info("user map value size is {}", RamUsageEstimator.humanSizeOf(userMap));
|
||||
Set<User> collect = userMap.entrySet().stream()
|
||||
.filter(integerUserEntry -> !OnlineUserManager.checkUidOnline(integerUserEntry.getKey()))
|
||||
.map(Map.Entry::getValue).collect(Collectors.toSet());
|
||||
|
|
|
@ -880,7 +880,7 @@ public class BuyGoodsNewLogic {
|
|||
if (user == null) {
|
||||
continue;
|
||||
}
|
||||
LOGGER.info("每秒钟坚持游戏内礼包缓存==================={}",value.getUid());
|
||||
// LOGGER.info("每秒钟坚持游戏内礼包缓存==================={}",value.getUid());
|
||||
AyyncWorker ayyncWorker = new AyyncWorker(user, false, user1 -> sendGiftGooodsIndication(user1.getId()));
|
||||
ProtocolsManager.getInstance().updateAyncWorker(ayyncWorker);
|
||||
}
|
||||
|
|
|
@ -146,14 +146,20 @@ public class MinuteTask extends Thread {
|
|||
LOGGER.error("Exception::=>{}",e.toString());
|
||||
}
|
||||
try {
|
||||
BuyGoodsNewLogic.minuteCheckReharge();
|
||||
RedisUtil.getInstence().set(RedisKey.ONLINE_NUM+RedisKey.Delimiter_colon+GameApplication.serverId, String.valueOf(OnlineUserManager.sessionMap.entrySet().size()));
|
||||
DeathPathLogic.getInstance().statusCheck();
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
LOGGER.error("Exception::=>{}",e.toString());
|
||||
}
|
||||
|
||||
try {
|
||||
BuyGoodsNewLogic.minuteCheckReharge();
|
||||
String key2 = RedisUtil.getInstence().getKey2(RedisKey.ONLINE_NUM, String.valueOf(GameApplication.serverId));
|
||||
RedisUtil.getInstence().set(key2, String.valueOf(OnlineUserManager.sessionMap.entrySet().size()));
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
try {
|
||||
GuildFightLogic.minuteCheckForCarFight();
|
||||
reportUserOnline();
|
||||
|
|
Loading…
Reference in New Issue