diff --git a/src/main/java/emu/grasscutter/data/excels/CoopChapterData.java b/src/main/java/emu/grasscutter/data/excels/CoopChapterData.java index ba56218e0..89f27901f 100644 --- a/src/main/java/emu/grasscutter/data/excels/CoopChapterData.java +++ b/src/main/java/emu/grasscutter/data/excels/CoopChapterData.java @@ -13,21 +13,22 @@ import lombok.experimental.FieldDefaults; public class CoopChapterData extends GameResource { @Getter(onMethod_ = @Override) int id; + int avatarId; -// int chapterNameTextMapHash; -// int coopPageTitleTextMapHash; -// int chapterSortId; -// int avatarSortId; -// String chapterIcon; + // int chapterNameTextMapHash; + // int coopPageTitleTextMapHash; + // int chapterSortId; + // int avatarSortId; + // String chapterIcon; List unlockCond; -// int [] unlockCondTips; -// int openMaterialId; -// int openMaterialNum; -// String beginTimeStr; -// int confidenceValue; -// String pointGraphPath; -// Double graphXRatio; -// Double graphYRatio; + // int [] unlockCondTips; + // int openMaterialId; + // int openMaterialNum; + // String beginTimeStr; + // int confidenceValue; + // String pointGraphPath; + // Double graphXRatio; + // Double graphYRatio; @Data @FieldDefaults(level = AccessLevel.PRIVATE) @@ -42,4 +43,4 @@ public class CoopChapterData extends GameResource { alternate = {"args"}) int[] args; } -} \ No newline at end of file +} diff --git a/src/main/java/emu/grasscutter/data/excels/CoopPointData.java b/src/main/java/emu/grasscutter/data/excels/CoopPointData.java index 5b6dcabb7..cb71fbd91 100644 --- a/src/main/java/emu/grasscutter/data/excels/CoopPointData.java +++ b/src/main/java/emu/grasscutter/data/excels/CoopPointData.java @@ -11,13 +11,14 @@ import lombok.experimental.FieldDefaults; public class CoopPointData extends GameResource { @Getter(onMethod_ = @Override) int id; + int chapterId; String type; int acceptQuest; - int [] postPointList; -// int pointNameTextMapHash; -// int pointDecTextMapHash; + int[] postPointList; + // int pointNameTextMapHash; + // int pointDecTextMapHash; int pointPosId; -// long photoMaleHash; -// long photoFemaleHash; -} \ No newline at end of file + // long photoMaleHash; + // long photoFemaleHash; +} diff --git a/src/main/java/emu/grasscutter/game/quest/conditions/ConditionMainCoopStart.java b/src/main/java/emu/grasscutter/game/quest/conditions/ConditionMainCoopStart.java index d2eb8e425..bfd7ee176 100644 --- a/src/main/java/emu/grasscutter/game/quest/conditions/ConditionMainCoopStart.java +++ b/src/main/java/emu/grasscutter/game/quest/conditions/ConditionMainCoopStart.java @@ -18,4 +18,4 @@ public class ConditionMainCoopStart extends BaseCondition { return condition.getParam()[0] == params[0] && (condition.getParam()[1] == 0 || condition.getParam()[1] == params[1]); } -} \ No newline at end of file +} diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerCancelCoopTaskReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerCancelCoopTaskReq.java index 4a19e0cbe..ebbb8fdd4 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerCancelCoopTaskReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerCancelCoopTaskReq.java @@ -11,10 +11,11 @@ public class HandlerCancelCoopTaskReq extends PacketHandler { @Override public void handle(GameSession session, byte[] header, byte[] payload) throws Exception { - CancelCoopTaskReqOuterClass.CancelCoopTaskReq req = CancelCoopTaskReqOuterClass.CancelCoopTaskReq.parseFrom(payload); + CancelCoopTaskReqOuterClass.CancelCoopTaskReq req = + CancelCoopTaskReqOuterClass.CancelCoopTaskReq.parseFrom(payload); var chapterId = req.getChapterId(); Grasscutter.getLogger().warn("Call to unimplemented packet CancelCoopTaskReq"); // TODO: Actually cancel the quests. session.send(new PacketCancelCoopTaskRsp(chapterId)); } -} \ No newline at end of file +} diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerStartCoopPointReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerStartCoopPointReq.java index 45baf0140..63020c10b 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerStartCoopPointReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerStartCoopPointReq.java @@ -12,15 +12,20 @@ public class HandlerStartCoopPointReq extends PacketHandler { @Override public void handle(GameSession session, byte[] header, byte[] payload) throws Exception { - StartCoopPointReqOuterClass.StartCoopPointReq req = StartCoopPointReqOuterClass.StartCoopPointReq.parseFrom(payload); + StartCoopPointReqOuterClass.StartCoopPointReq req = + StartCoopPointReqOuterClass.StartCoopPointReq.parseFrom(payload); var coopPoint = req.getCoopPoint(); - var coopPointData = GameData.getCoopPointDataMap().values().stream().filter(i -> i.getId() == coopPoint).toList(); + var coopPointData = + GameData.getCoopPointDataMap().values().stream() + .filter(i -> i.getId() == coopPoint) + .toList(); if (!coopPointData.isEmpty()) { var player = session.getPlayer(); var questManager = player.getQuestManager(); - questManager.queueEvent(QuestCond.QUEST_COND_MAIN_COOP_START, coopPointData.get(0).getChapterId(), 0); + questManager.queueEvent( + QuestCond.QUEST_COND_MAIN_COOP_START, coopPointData.get(0).getChapterId(), 0); } session.send(new PacketStartCoopPointRsp(coopPoint)); } -} \ No newline at end of file +} diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketCancelCoopTaskRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketCancelCoopTaskRsp.java index a8e0d9a31..88e7b8681 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketCancelCoopTaskRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketCancelCoopTaskRsp.java @@ -13,4 +13,4 @@ public class PacketCancelCoopTaskRsp extends BasePacket { this.setData(proto); } -} \ No newline at end of file +} diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketCoopDataNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketCoopDataNotify.java index e1823f66b..004f636dc 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketCoopDataNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketCoopDataNotify.java @@ -14,32 +14,36 @@ public class PacketCoopDataNotify extends BasePacket { var proto = CoopDataNotifyOuterClass.CoopDataNotify.newBuilder(); proto.setIsHaveProgress(false); - - // TODO: implement: determine the actual current progress point. // Add every chapter and add the start point to each chapter regardless of actual progress. - GameData.getCoopChapterDataMap().values().forEach(i -> { - var chapter = CoopChapterOuterClass.CoopChapter.newBuilder(); - chapter.setId(i.getId()); + GameData.getCoopChapterDataMap() + .values() + .forEach( + i -> { + var chapter = CoopChapterOuterClass.CoopChapter.newBuilder(); + chapter.setId(i.getId()); - // TODO: implement: look at unlockCond to determine what state each chapter should be in. - // Set every chapter to "Accept" regardless of accept conditions. - chapter.setStateValue(3); // 3 == STATE_ACCEPT + // TODO: implement: look at unlockCond to determine what state each chapter should be + // in. + // Set every chapter to "Accept" regardless of accept conditions. + chapter.setStateValue(3); // 3 == STATE_ACCEPT - var point = CoopPointOuterClass.CoopPoint.newBuilder(); - var pointList = GameData.getCoopPointDataMap().values().stream() - .filter(j -> j.getChapterId() == i.getId() && j.getType().equals("POINT_START")) - .toList(); + var point = CoopPointOuterClass.CoopPoint.newBuilder(); + var pointList = + GameData.getCoopPointDataMap().values().stream() + .filter( + j -> j.getChapterId() == i.getId() && j.getType().equals("POINT_START")) + .toList(); - if (!pointList.isEmpty()) { - int pointId = pointList.get(0).getId(); - point.setId(pointId); - chapter.addCoopPointList(point); - } + if (!pointList.isEmpty()) { + int pointId = pointList.get(0).getId(); + point.setId(pointId); + chapter.addCoopPointList(point); + } - proto.addChapterList(chapter); - }); + proto.addChapterList(chapter); + }); this.setData(proto); } -} \ No newline at end of file +} diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketStartCoopPointRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketStartCoopPointRsp.java index 78429e275..681dd119f 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketStartCoopPointRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketStartCoopPointRsp.java @@ -13,4 +13,4 @@ public class PacketStartCoopPointRsp extends BasePacket { this.setData(proto); } -} \ No newline at end of file +}