MonsterInvestigation (boss icon in map)

This commit is contained in:
Akka
2022-06-18 19:07:39 +08:00
committed by Melledy
parent 80c61466e3
commit 706dc5e4c7
7 changed files with 159 additions and 13 deletions

View File

@@ -14,7 +14,11 @@ public class HandlerGetInvestigationMonsterReq extends PacketHandler {
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
var req = GetInvestigationMonsterReqOuterClass.GetInvestigationMonsterReq.parseFrom(payload);
session.send(new PacketGetInvestigationMonsterRsp(req.getCityIdListList()));
session.send(new PacketGetInvestigationMonsterRsp(
session.getPlayer(),
session.getServer().getWorldDataManager(),
req.getCityIdListList()));
}
}

View File

@@ -1,18 +1,23 @@
package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.game.world.WorldDataManager;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.GetActivityInfoRspOuterClass;
import emu.grasscutter.net.proto.GetInvestigationMonsterRspOuterClass;
import java.util.List;
public class PacketGetInvestigationMonsterRsp extends BasePacket {
public PacketGetInvestigationMonsterRsp(List<Integer> cityIdListList) {
public PacketGetInvestigationMonsterRsp(Player player, WorldDataManager worldDataManager, List<Integer> cityIdListList) {
super(PacketOpcodes.GetInvestigationMonsterRsp);
var resp = GetActivityInfoRspOuterClass.GetActivityInfoRsp.newBuilder();
var resp = GetInvestigationMonsterRspOuterClass.GetInvestigationMonsterRsp.newBuilder();
cityIdListList.forEach(id -> resp.addAllMonsterList(worldDataManager.getInvestigationMonstersByCityId(player, id)));
this.setData(resp.build());