探索优化

back_recharge
xuexinpeng 2022-04-07 11:32:31 +08:00
parent 77679ba892
commit 814d5d6cd9
1 changed files with 4 additions and 5 deletions

View File

@ -232,7 +232,7 @@ public class ExplorerMapLogic {
int eventId = rankExplore.getEventList()[randomEventId];
LOGGER.info("explore add eventId:" + eventId + " randomMapId: " + randomMapId + 1);
user.getPlayerInfoManager().addExploreEvent(new KeyVal(eventId, TimeUtils.nowInt() + exploreEventConfig.get(eventId).getTime(), randomMapId + 1));
PlayerInfoProto.ExplorerMapIndicationResponse.Builder indication = PlayerInfoProto.ExplorerMapIndicationResponse.newBuilder();
PlayerInfoProto.ExplorerMapIndicationEventResponse.Builder indication = PlayerInfoProto.ExplorerMapIndicationEventResponse.newBuilder();
List<KeyVal> event = user.getPlayerInfoManager().getExploreEvent();
//删除过期的
if (event.removeIf(n -> n.getVal() < TimeUtils.nowInt())) {
@ -242,8 +242,7 @@ public class ExplorerMapLogic {
indication.addRandEvent(CommonProto.CommKeyVal.newBuilder().setKey(keyVal.getKey()).setVal(keyVal.getVal()).
setVal2(keyVal.getVa2()).build());
}
MessageUtil.sendIndicationMessage(sess, 1, MessageTypeProto.MessageType.ExplorerMapIndicationResponse_VALUE, indication.build(), true);
MessageUtil.sendIndicationMessage(sess, 1, MessageTypeProto.MessageType.ExplorerMapIndicationEventResponse_VALUE, indication.build(), true);
}
public static void sendDisappearEvent(User user) {
@ -254,12 +253,12 @@ public class ExplorerMapLogic {
}
if (event.removeIf(n -> n.getVal() < TimeUtils.nowInt())) {
user.getPlayerInfoManager().setExploreEvent(event);
PlayerInfoProto.ExplorerMapIndicationResponse.Builder indication = PlayerInfoProto.ExplorerMapIndicationResponse.newBuilder();
PlayerInfoProto.ExplorerMapIndicationEventResponse.Builder indication = PlayerInfoProto.ExplorerMapIndicationEventResponse.newBuilder();
for (KeyVal keyVal : event) {
indication.addRandEvent(CommonProto.CommKeyVal.newBuilder().setKey(keyVal.getKey()).setVal(keyVal.getVal()).
setVal2(keyVal.getVa2()).build());
}
MessageUtil.sendIndicationMessage(sess, 1, MessageTypeProto.MessageType.ExplorerMapIndicationResponse_VALUE, indication.build(), true);
MessageUtil.sendIndicationMessage(sess, 1, MessageTypeProto.MessageType.ExplorerMapIndicationEventResponse_VALUE, indication.build(), true);
}
}