Commit aa06583a authored by ShigemoriHakura's avatar ShigemoriHakura Committed by GitHub
Browse files

fix achievement proto (#507)

* fix achievement proto

TakeAchievementRewardReq tells client the achievements achieved or not and it's progress.

* add import
parent 48d1e026
...@@ -10,6 +10,7 @@ import emu.grasscutter.net.packet.PacketHandler; ...@@ -10,6 +10,7 @@ import emu.grasscutter.net.packet.PacketHandler;
import emu.grasscutter.server.game.GameSession; import emu.grasscutter.server.game.GameSession;
import emu.grasscutter.server.game.GameSession.SessionState; import emu.grasscutter.server.game.GameSession.SessionState;
import emu.grasscutter.server.packet.send.PacketPlayerLoginRsp; import emu.grasscutter.server.packet.send.PacketPlayerLoginRsp;
import emu.grasscutter.server.packet.send.PacketTakeAchievementRewardReq;
@Opcodes(PacketOpcodes.PlayerLoginReq) // Sends initial data packets @Opcodes(PacketOpcodes.PlayerLoginReq) // Sends initial data packets
public class HandlerPlayerLoginReq extends PacketHandler { public class HandlerPlayerLoginReq extends PacketHandler {
...@@ -47,6 +48,7 @@ public class HandlerPlayerLoginReq extends PacketHandler { ...@@ -47,6 +48,7 @@ public class HandlerPlayerLoginReq extends PacketHandler {
// Final packet to tell client logging in is done // Final packet to tell client logging in is done
session.send(new PacketPlayerLoginRsp(session)); session.send(new PacketPlayerLoginRsp(session));
session.send(new PacketTakeAchievementRewardReq(session));
} }
} }
package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.AchievementInfoOuterClass;
import emu.grasscutter.net.proto.AchievementInfoOuterClass.AchievementInfo;
import emu.grasscutter.net.proto.TakeAchievementRewardReqOuterClass.TakeAchievementRewardReq;
import emu.grasscutter.server.game.GameSession;
import java.util.ArrayList;
import java.util.List;
public class PacketTakeAchievementRewardReq extends BasePacket {
public PacketTakeAchievementRewardReq(GameSession session) {
super(PacketOpcodes.TakeAchievementRewardReq);
List<AchievementInfo> a_list = new ArrayList<>();
a_list.add(AchievementInfo.newBuilder().setId(82044).setStatusValue(2).setCurrent(0).setGoal(1).build());
a_list.add(AchievementInfo.newBuilder().setId(81205).setStatusValue(2).setCurrent(0).setGoal(1).build());
TakeAchievementRewardReq proto = TakeAchievementRewardReq.newBuilder()
.addAllAList(a_list)
.build();
this.setData(proto);
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment