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