探索优化

back_recharge
xuexinpeng 2022-04-07 10:51:34 +08:00
parent 2bd61083e2
commit 77a87f7ccd
1 changed files with 19 additions and 16 deletions

View File

@ -245,9 +245,13 @@ public class ExplorerMapLogic {
MessageUtil.sendIndicationMessage(sess, 1, MessageTypeProto.MessageType.ExplorerMapIndicationResponse_VALUE, indication.build(), true);
}
public static void sendDisappearEvent(User user) {
ISession sess = OnlineUserManager.sessionMap.get(user.getId());
List<KeyVal> event = user.getPlayerInfoManager().getExploreEvent();
if(event.size() == 0 ||event == null){
return;
}
if (event.removeIf(n -> n.getVal() < TimeUtils.nowInt())) {
user.getPlayerInfoManager().setExploreEvent(event);
PlayerInfoProto.ExplorerMapIndicationResponse.Builder indication = PlayerInfoProto.ExplorerMapIndicationResponse.newBuilder();
@ -438,17 +442,16 @@ public class ExplorerMapLogic {
if (delayId.size() > 0) {
user.getPlayerInfoManager().setExplorer(explorer);
}
//探索有消耗 整点刷出随机事件
if (explorer.size() > 0) {
Calendar calendar = Calendar.getInstance();
int minute = calendar.get(Calendar.MINUTE);
if (minute == 0) {
//sendRandomEvent(user);
}
if (explorer.size() > 0) {
sendRandomEvent(user);
}
}else{
sendDisappearEvent(user);
}
MongoUtil.getLjsdMongoTemplate().lastUpdate();
}
} catch (Exception e) {