Commit addfb5eb authored by WetABQ's avatar WetABQ Committed by GitHub
Browse files

[BREAKING CHANGE] proto auto compiled by gradle (#226)

* [BREAK] proto auto compiled by gradle

* [BREAK] move proto to submodule

* update gitmodules

* [BREAK] move proto to submodule

* move proto to submodule

* fix merge conflict

* fix github action after merging

* fix merge conflicts and del submodule

* upload the proto
parent 627a2f1e
...@@ -1009,6 +1009,7 @@ public class PacketOpcodes { ...@@ -1009,6 +1009,7 @@ public class PacketOpcodes {
public static final int SetNameCardRsp = 4009; public static final int SetNameCardRsp = 4009;
public static final int SetOpenStateReq = 162; public static final int SetOpenStateReq = 162;
public static final int SetOpenStateRsp = 189; public static final int SetOpenStateRsp = 189;
public static final int SetPlayerBirthdayReq = 4097; public static final int SetPlayerBirthdayReq = 4097;
public static final int SetPlayerBirthdayRsp = 4088; public static final int SetPlayerBirthdayRsp = 4088;
public static final int SetPlayerBornDataReq = 155; public static final int SetPlayerBornDataReq = 155;
...@@ -1034,8 +1035,6 @@ public class PacketOpcodes { ...@@ -1034,8 +1035,6 @@ public class PacketOpcodes {
public static final int ShowTemplateReminderNotify = 3164; public static final int ShowTemplateReminderNotify = 3164;
public static final int SignInInfoReq = 2510; public static final int SignInInfoReq = 2510;
public static final int SignInInfoRsp = 2515; public static final int SignInInfoRsp = 2515;
public static final int SitReq = 354;
public static final int SitRsp = 335;
public static final int SocialDataNotify = 4063; public static final int SocialDataNotify = 4063;
public static final int SpringUseReq = 1720; public static final int SpringUseReq = 1720;
public static final int SpringUseRsp = 1727; public static final int SpringUseRsp = 1727;
......
package emu.grasscutter.net.packet;
public class Retcode {
public static final int SUCCESS = 0;
public static final int FAIL = 1;
}
...@@ -17,7 +17,7 @@ import java.util.jar.JarEntry; ...@@ -17,7 +17,7 @@ import java.util.jar.JarEntry;
import java.util.jar.JarFile; import java.util.jar.JarFile;
/** /**
* Manages the server's plugins & the event system. * Manages the server's plugins and the event system.
*/ */
public final class PluginManager { public final class PluginManager {
private final Map<String, Plugin> plugins = new HashMap<>(); private final Map<String, Plugin> plugins = new HashMap<>();
......
...@@ -82,7 +82,7 @@ public final class PlayerHook { ...@@ -82,7 +82,7 @@ public final class PlayerHook {
public void teleport(Position position) { public void teleport(Position position) {
this.player.getPos().set(position); this.player.getPos().set(position);
this.player.sendPacket(new PacketPlayerEnterSceneNotify(this.player, this.player.sendPacket(new PacketPlayerEnterSceneNotify(this.player,
EnterType.EnterJump, EnterReason.TransPoint, EnterType.ENTER_JUMP, EnterReason.TransPoint,
this.player.getSceneId(), position this.player.getSceneId(), position
)); ));
} }
......
...@@ -126,10 +126,10 @@ public final class DispatchServer { ...@@ -126,10 +126,10 @@ public final class DispatchServer {
servers.add(server); servers.add(server);
RegionInfo serverRegion = regionQuery.getRegionInfo().toBuilder() RegionInfo serverRegion = regionQuery.getRegionInfo().toBuilder()
.setIp((Grasscutter.getConfig().getGameServerOptions().PublicIp.isEmpty() .setGateserverIp((Grasscutter.getConfig().getGameServerOptions().PublicIp.isEmpty()
? Grasscutter.getConfig().getGameServerOptions().Ip ? Grasscutter.getConfig().getGameServerOptions().Ip
: Grasscutter.getConfig().getGameServerOptions().PublicIp)) : Grasscutter.getConfig().getGameServerOptions().PublicIp))
.setPort(Grasscutter.getConfig().getGameServerOptions().PublicPort != 0 .setGateserverPort(Grasscutter.getConfig().getGameServerOptions().PublicPort != 0
? Grasscutter.getConfig().getGameServerOptions().PublicPort ? Grasscutter.getConfig().getGameServerOptions().PublicPort
: Grasscutter.getConfig().getGameServerOptions().Port) : Grasscutter.getConfig().getGameServerOptions().Port)
.setSecretKey(ByteString .setSecretKey(ByteString
...@@ -169,8 +169,8 @@ public final class DispatchServer { ...@@ -169,8 +169,8 @@ public final class DispatchServer {
servers.add(server); servers.add(server);
RegionInfo serverRegion = regionQuery.getRegionInfo().toBuilder() RegionInfo serverRegion = regionQuery.getRegionInfo().toBuilder()
.setIp(regionInfo.Ip) .setGateserverIp(regionInfo.Ip)
.setPort(regionInfo.Port) .setGateserverPort(regionInfo.Port)
.setSecretKey(ByteString .setSecretKey(ByteString
.copyFrom(FileUtils.read(Grasscutter.getConfig().KEY_FOLDER + "dispatchSeed.bin"))) .copyFrom(FileUtils.read(Grasscutter.getConfig().KEY_FOLDER + "dispatchSeed.bin")))
.build(); .build();
...@@ -181,7 +181,7 @@ public final class DispatchServer { ...@@ -181,7 +181,7 @@ public final class DispatchServer {
} }
QueryRegionListHttpRsp regionList = QueryRegionListHttpRsp.newBuilder() QueryRegionListHttpRsp regionList = QueryRegionListHttpRsp.newBuilder()
.addAllServers(servers) .addAllRegionList(servers)
.setClientSecretKey(rl.getClientSecretKey()) .setClientSecretKey(rl.getClientSecretKey())
.setClientCustomConfigEncrypted(rl.getClientCustomConfigEncrypted()) .setClientCustomConfigEncrypted(rl.getClientCustomConfigEncrypted())
.setEnableLoginPc(true) .setEnableLoginPc(true)
......
...@@ -89,7 +89,7 @@ public class GameServerPacketHandler { ...@@ -89,7 +89,7 @@ public class GameServerPacketHandler {
// Log unhandled packets // Log unhandled packets
if (Grasscutter.getConfig().getGameServerOptions().LOG_PACKETS) { if (Grasscutter.getConfig().getGameServerOptions().LOG_PACKETS) {
//Grasscutter.getLogger().info("Unhandled packet (" + opcode + "): " + PacketOpcodesUtil.getOpcodeName(opcode)); Grasscutter.getLogger().info("Unhandled packet (" + opcode + "): " + emu.grasscutter.net.packet.PacketOpcodesUtil.getOpcodeName(opcode));
} }
} }
} }
...@@ -3,11 +3,14 @@ package emu.grasscutter.server.game; ...@@ -3,11 +3,14 @@ package emu.grasscutter.server.game;
import java.io.File; import java.io.File;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.util.HashSet;
import java.util.Set;
import emu.grasscutter.Grasscutter; import emu.grasscutter.Grasscutter;
import emu.grasscutter.game.Account; import emu.grasscutter.game.Account;
import emu.grasscutter.game.GenshinPlayer; import emu.grasscutter.game.GenshinPlayer;
import emu.grasscutter.net.packet.GenshinPacket; import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.packet.PacketOpcodesUtil; import emu.grasscutter.net.packet.PacketOpcodesUtil;
import emu.grasscutter.netty.MihoyoKcpChannel; import emu.grasscutter.netty.MihoyoKcpChannel;
import emu.grasscutter.server.event.game.SendPacketEvent; import emu.grasscutter.server.event.game.SendPacketEvent;
...@@ -177,10 +180,20 @@ public class GameSession extends MihoyoKcpChannel { ...@@ -177,10 +180,20 @@ public class GameSession extends MihoyoKcpChannel {
//Grasscutter.getLogger().info("SEND: " + PacketOpcodesUtil.getOpcodeName(opcode)); //Grasscutter.getLogger().info("SEND: " + PacketOpcodesUtil.getOpcodeName(opcode));
//System.out.println(Utils.bytesToHex(genshinPacket.getData())); //System.out.println(Utils.bytesToHex(genshinPacket.getData()));
} }
private static final Set<Integer> loopPacket = Set.of(
PacketOpcodes.PingReq,
PacketOpcodes.PingRsp,
PacketOpcodes.WorldPlayerRTTNotify,
PacketOpcodes.UnionCmdNotify,
PacketOpcodes.QueryPathReq
);
private void logPacket(GenshinPacket genshinPacket) { private void logPacket(GenshinPacket genshinPacket) {
Grasscutter.getLogger().info("SEND: " + PacketOpcodesUtil.getOpcodeName(genshinPacket.getOpcode()) + " (" + genshinPacket.getOpcode() + ")"); if (!loopPacket.contains(genshinPacket.getOpcode())) {
System.out.println(Utils.bytesToHex(genshinPacket.getData())); Grasscutter.getLogger().info("SEND: " + PacketOpcodesUtil.getOpcodeName(genshinPacket.getOpcode()) + " (" + genshinPacket.getOpcode() + ")");
System.out.println(Utils.bytesToHex(genshinPacket.getData()));
}
} }
@Override @Override
...@@ -226,8 +239,10 @@ public class GameSession extends MihoyoKcpChannel { ...@@ -226,8 +239,10 @@ public class GameSession extends MihoyoKcpChannel {
// Log packet // Log packet
if (Grasscutter.getConfig().getGameServerOptions().LOG_PACKETS) { if (Grasscutter.getConfig().getGameServerOptions().LOG_PACKETS) {
Grasscutter.getLogger().info("RECV: " + PacketOpcodesUtil.getOpcodeName(opcode) + " (" + opcode + ")"); if (!loopPacket.contains(opcode)) {
System.out.println(Utils.bytesToHex(payload)); Grasscutter.getLogger().info("RECV: " + PacketOpcodesUtil.getOpcodeName(opcode) + " (" + opcode + ")");
System.out.println(Utils.bytesToHex(payload));
}
} }
// Handle // Handle
......
...@@ -19,12 +19,12 @@ public class HandlerCombatInvocationsNotify extends PacketHandler { ...@@ -19,12 +19,12 @@ public class HandlerCombatInvocationsNotify extends PacketHandler {
for (CombatInvokeEntry entry : notif.getInvokeListList()) { for (CombatInvokeEntry entry : notif.getInvokeListList()) {
switch (entry.getArgumentType()) { switch (entry.getArgumentType()) {
case CombatEvtBeingHit: case COMBAT_EVT_BEING_HIT:
// Handle damage // Handle damage
EvtBeingHitInfo hitInfo = EvtBeingHitInfo.parseFrom(entry.getCombatData()); EvtBeingHitInfo hitInfo = EvtBeingHitInfo.parseFrom(entry.getCombatData());
session.getPlayer().getScene().handleAttack(hitInfo.getAttackResult()); session.getPlayer().getScene().handleAttack(hitInfo.getAttackResult());
break; break;
case EntityMove: case ENTITY_MOVE:
// Handle movement // Handle movement
EntityMoveInfo moveInfo = EntityMoveInfo.parseFrom(entry.getCombatData()); EntityMoveInfo moveInfo = EntityMoveInfo.parseFrom(entry.getCombatData());
GenshinEntity entity = session.getPlayer().getScene().getEntityById(moveInfo.getEntityId()); GenshinEntity entity = session.getPlayer().getScene().getEntityById(moveInfo.getEntityId());
......
...@@ -3,22 +3,18 @@ package emu.grasscutter.server.packet.recv; ...@@ -3,22 +3,18 @@ package emu.grasscutter.server.packet.recv;
import emu.grasscutter.net.packet.Opcodes; import emu.grasscutter.net.packet.Opcodes;
import emu.grasscutter.net.packet.PacketHandler; import emu.grasscutter.net.packet.PacketHandler;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.SitReqOuterClass; import emu.grasscutter.net.proto.CombineReqOuterClass;
import emu.grasscutter.server.game.GameSession; import emu.grasscutter.server.game.GameSession;
import emu.grasscutter.server.packet.send.PacketSitRsp;
import emu.grasscutter.utils.Position;
@Opcodes(PacketOpcodes.SitReq) @Opcodes(PacketOpcodes.CombineReq)
public class HandleSitReq extends PacketHandler { public class HandlerCombineReq extends PacketHandler {
@Override @Override
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception { public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
SitReqOuterClass.SitReq req = SitReqOuterClass.SitReq.parseFrom(payload);
float x = req.getPosition().getX(); CombineReqOuterClass.CombineReq req = CombineReqOuterClass.CombineReq.parseFrom(payload);
float y = req.getPosition().getY();
float z = req.getPosition().getZ();
session.send(new PacketSitRsp(req.getChairId(), new Position(x, y, z), session.getPlayer().getTeamManager().getCurrentAvatarEntity().getId()));
} }
} }
\ No newline at end of file
...@@ -32,7 +32,7 @@ public class HandlerMarkMapReq extends PacketHandler { ...@@ -32,7 +32,7 @@ public class HandlerMarkMapReq extends PacketHandler {
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception { public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
MarkMapReq req = MarkMapReq.parseFrom(payload); MarkMapReq req = MarkMapReq.parseFrom(payload);
if (req.getOp() != Operation.Add) { if (req.getOp() != MarkMapReq.Operation.ADD) {
return; return;
} }
......
...@@ -3,6 +3,7 @@ package emu.grasscutter.server.packet.recv; ...@@ -3,6 +3,7 @@ package emu.grasscutter.server.packet.recv;
import emu.grasscutter.net.packet.Opcodes; import emu.grasscutter.net.packet.Opcodes;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.packet.PacketHandler; import emu.grasscutter.net.packet.PacketHandler;
import emu.grasscutter.net.proto.RetcodeOuterClass;
import emu.grasscutter.server.game.GameSession; import emu.grasscutter.server.game.GameSession;
import emu.grasscutter.server.packet.send.PacketPlayerGetForceQuitBanInfoRsp; import emu.grasscutter.server.packet.send.PacketPlayerGetForceQuitBanInfoRsp;
...@@ -14,10 +15,10 @@ public class HandlerPlayerGetForceQuitBanInfoReq extends PacketHandler { ...@@ -14,10 +15,10 @@ public class HandlerPlayerGetForceQuitBanInfoReq extends PacketHandler {
if (session.getServer().getMultiplayerManager().leaveCoop(session.getPlayer())) { if (session.getServer().getMultiplayerManager().leaveCoop(session.getPlayer())) {
// Success // Success
session.send(new PacketPlayerGetForceQuitBanInfoRsp(0)); session.send(new PacketPlayerGetForceQuitBanInfoRsp(RetcodeOuterClass.Retcode.RET_SUCC_VALUE));
} else { } else {
// Fail // Fail
session.send(new PacketPlayerGetForceQuitBanInfoRsp(1)); session.send(new PacketPlayerGetForceQuitBanInfoRsp(RetcodeOuterClass.Retcode.RET_SVR_ERROR_VALUE));
} }
} }
......
...@@ -11,7 +11,7 @@ public class PacketAvatarChangeCostumeNotify extends GenshinPacket { ...@@ -11,7 +11,7 @@ public class PacketAvatarChangeCostumeNotify extends GenshinPacket {
super(PacketOpcodes.AvatarChangeCostumeNotify); super(PacketOpcodes.AvatarChangeCostumeNotify);
AvatarChangeCostumeNotify proto = AvatarChangeCostumeNotify.newBuilder() AvatarChangeCostumeNotify proto = AvatarChangeCostumeNotify.newBuilder()
.setEntity(entity.toProto()) .setEntityInfo(entity.toProto())
.build(); .build();
this.setData(proto); this.setData(proto);
......
...@@ -3,6 +3,7 @@ package emu.grasscutter.server.packet.send; ...@@ -3,6 +3,7 @@ package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.GenshinPacket; import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.AvatarChangeCostumeRspOuterClass.AvatarChangeCostumeRsp; import emu.grasscutter.net.proto.AvatarChangeCostumeRspOuterClass.AvatarChangeCostumeRsp;
import emu.grasscutter.net.proto.RetcodeOuterClass;
public class PacketAvatarChangeCostumeRsp extends GenshinPacket { public class PacketAvatarChangeCostumeRsp extends GenshinPacket {
...@@ -21,7 +22,7 @@ public class PacketAvatarChangeCostumeRsp extends GenshinPacket { ...@@ -21,7 +22,7 @@ public class PacketAvatarChangeCostumeRsp extends GenshinPacket {
super(PacketOpcodes.AvatarChangeCostumeRsp); super(PacketOpcodes.AvatarChangeCostumeRsp);
AvatarChangeCostumeRsp proto = AvatarChangeCostumeRsp.newBuilder() AvatarChangeCostumeRsp proto = AvatarChangeCostumeRsp.newBuilder()
.setRetcode(1) .setRetcode(RetcodeOuterClass.Retcode.RET_SVR_ERROR_VALUE)
.build(); .build();
this.setData(proto); this.setData(proto);
......
...@@ -3,6 +3,7 @@ package emu.grasscutter.server.packet.send; ...@@ -3,6 +3,7 @@ package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.GenshinPacket; import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.AvatarWearFlycloakRspOuterClass.AvatarWearFlycloakRsp; import emu.grasscutter.net.proto.AvatarWearFlycloakRspOuterClass.AvatarWearFlycloakRsp;
import emu.grasscutter.net.proto.RetcodeOuterClass;
public class PacketAvatarWearFlycloakRsp extends GenshinPacket { public class PacketAvatarWearFlycloakRsp extends GenshinPacket {
public PacketAvatarWearFlycloakRsp(long avatarGuid, int costumeId) { public PacketAvatarWearFlycloakRsp(long avatarGuid, int costumeId) {
...@@ -20,7 +21,7 @@ public class PacketAvatarWearFlycloakRsp extends GenshinPacket { ...@@ -20,7 +21,7 @@ public class PacketAvatarWearFlycloakRsp extends GenshinPacket {
super(PacketOpcodes.AvatarWearFlycloakRsp); super(PacketOpcodes.AvatarWearFlycloakRsp);
AvatarWearFlycloakRsp proto = AvatarWearFlycloakRsp.newBuilder() AvatarWearFlycloakRsp proto = AvatarWearFlycloakRsp.newBuilder()
.setRetcode(1) .setRetcode(RetcodeOuterClass.Retcode.RET_SVR_ERROR_VALUE)
.build(); .build();
this.setData(proto); this.setData(proto);
......
...@@ -4,9 +4,9 @@ import java.util.List; ...@@ -4,9 +4,9 @@ import java.util.List;
import emu.grasscutter.net.packet.GenshinPacket; import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.packet.Retcode;
import emu.grasscutter.net.proto.CalcWeaponUpgradeReturnItemsRspOuterClass.CalcWeaponUpgradeReturnItemsRsp; import emu.grasscutter.net.proto.CalcWeaponUpgradeReturnItemsRspOuterClass.CalcWeaponUpgradeReturnItemsRsp;
import emu.grasscutter.net.proto.ItemParamOuterClass.ItemParam; import emu.grasscutter.net.proto.ItemParamOuterClass.ItemParam;
import emu.grasscutter.net.proto.RetcodeOuterClass;
public class PacketCalcWeaponUpgradeReturnItemsRsp extends GenshinPacket { public class PacketCalcWeaponUpgradeReturnItemsRsp extends GenshinPacket {
...@@ -25,7 +25,7 @@ public class PacketCalcWeaponUpgradeReturnItemsRsp extends GenshinPacket { ...@@ -25,7 +25,7 @@ public class PacketCalcWeaponUpgradeReturnItemsRsp extends GenshinPacket {
super(PacketOpcodes.CalcWeaponUpgradeReturnItemsRsp); super(PacketOpcodes.CalcWeaponUpgradeReturnItemsRsp);
CalcWeaponUpgradeReturnItemsRsp proto = CalcWeaponUpgradeReturnItemsRsp.newBuilder() CalcWeaponUpgradeReturnItemsRsp proto = CalcWeaponUpgradeReturnItemsRsp.newBuilder()
.setRetcode(Retcode.FAIL) .setRetcode(RetcodeOuterClass.Retcode.RET_SVR_ERROR_VALUE)
.build(); .build();
this.setData(proto); this.setData(proto);
......
...@@ -3,6 +3,7 @@ package emu.grasscutter.server.packet.send; ...@@ -3,6 +3,7 @@ package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.GenshinPacket; import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.ChangeAvatarRspOuterClass.ChangeAvatarRsp; import emu.grasscutter.net.proto.ChangeAvatarRspOuterClass.ChangeAvatarRsp;
import emu.grasscutter.net.proto.RetcodeOuterClass;
public class PacketChangeAvatarRsp extends GenshinPacket { public class PacketChangeAvatarRsp extends GenshinPacket {
...@@ -10,8 +11,8 @@ public class PacketChangeAvatarRsp extends GenshinPacket { ...@@ -10,8 +11,8 @@ public class PacketChangeAvatarRsp extends GenshinPacket {
super(PacketOpcodes.ChangeAvatarRsp); super(PacketOpcodes.ChangeAvatarRsp);
ChangeAvatarRsp p = ChangeAvatarRsp.newBuilder() ChangeAvatarRsp p = ChangeAvatarRsp.newBuilder()
.setRetcode(0) .setRetcode(RetcodeOuterClass.Retcode.RET_SVR_ERROR_VALUE)
.setCurrGuid(guid) .setCurGuid(guid)
.build(); .build();
this.setData(p); this.setData(p);
......
package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.CombineReqOuterClass;
import emu.grasscutter.net.proto.CombineRspOuterClass;
import emu.grasscutter.net.proto.ItemParamOuterClass;
import emu.grasscutter.net.proto.RetcodeOuterClass;
public class PacketCombineRsp extends GenshinPacket {
public PacketCombineRsp() {
super(PacketOpcodes.CombineRsp);
CombineRspOuterClass.CombineRsp proto = CombineRspOuterClass.CombineRsp.newBuilder()
.setRetcode(RetcodeOuterClass.Retcode.RET_SVR_ERROR_VALUE).build();
this.setData(proto);
}
public PacketCombineRsp(int retcode) {
super(PacketOpcodes.CombineRsp);
CombineRspOuterClass.CombineRsp proto = CombineRspOuterClass.CombineRsp.newBuilder()
.setRetcode(retcode).build();
this.setData(proto);
}
public PacketCombineRsp(CombineReqOuterClass.CombineReq combineReq,
Iterable<ItemParamOuterClass.ItemParam> costItemList,
Iterable<ItemParamOuterClass.ItemParam> resultItemList,
Iterable<ItemParamOuterClass.ItemParam> totalRandomItemList,
Iterable<ItemParamOuterClass.ItemParam> totalReturnItemList,
Iterable<ItemParamOuterClass.ItemParam> totalExtraItemList) {
super(PacketOpcodes.CombineRsp);
CombineRspOuterClass.CombineRsp proto = CombineRspOuterClass.CombineRsp.newBuilder()
.setRetcode(RetcodeOuterClass.Retcode.RET_SUCC_VALUE)
.setCombineId(combineReq.getCombineId())
.setCombineCount(combineReq.getCombineCount())
.setAvatarGuid(combineReq.getAvatarGuid())
.addAllCostItemList(costItemList)
.addAllResultItemList(resultItemList)
.addAllTotalRandomItemList(totalRandomItemList)
.addAllTotalReturnItemList(totalReturnItemList)
.addAllTotalExtraItemList(totalExtraItemList)
.build();
this.setData(proto);
}
}
...@@ -7,6 +7,7 @@ import emu.grasscutter.net.packet.GenshinPacket; ...@@ -7,6 +7,7 @@ import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.DoGachaRspOuterClass.DoGachaRsp; import emu.grasscutter.net.proto.DoGachaRspOuterClass.DoGachaRsp;
import emu.grasscutter.net.proto.GachaItemOuterClass.GachaItem; import emu.grasscutter.net.proto.GachaItemOuterClass.GachaItem;
import emu.grasscutter.net.proto.RetcodeOuterClass;
public class PacketDoGachaRsp extends GenshinPacket { public class PacketDoGachaRsp extends GenshinPacket {
...@@ -33,7 +34,7 @@ public class PacketDoGachaRsp extends GenshinPacket { ...@@ -33,7 +34,7 @@ public class PacketDoGachaRsp extends GenshinPacket {
super(PacketOpcodes.DoGachaRsp); super(PacketOpcodes.DoGachaRsp);
DoGachaRsp p = DoGachaRsp.newBuilder() DoGachaRsp p = DoGachaRsp.newBuilder()
.setRetcode(1) .setRetcode(RetcodeOuterClass.Retcode.RET_SVR_ERROR_VALUE)
.build(); .build();
this.setData(p); this.setData(p);
......
...@@ -5,6 +5,7 @@ import emu.grasscutter.net.packet.GenshinPacket; ...@@ -5,6 +5,7 @@ import emu.grasscutter.net.packet.GenshinPacket;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.GadgetInteractRspOuterClass.GadgetInteractRsp; import emu.grasscutter.net.proto.GadgetInteractRspOuterClass.GadgetInteractRsp;
import emu.grasscutter.net.proto.InteractTypeOuterClass.InteractType; import emu.grasscutter.net.proto.InteractTypeOuterClass.InteractType;
import emu.grasscutter.net.proto.RetcodeOuterClass;
public class PacketGadgetInteractRsp extends GenshinPacket { public class PacketGadgetInteractRsp extends GenshinPacket {
public PacketGadgetInteractRsp(EntityGadget gadget, InteractType interact) { public PacketGadgetInteractRsp(EntityGadget gadget, InteractType interact) {
...@@ -23,7 +24,7 @@ public class PacketGadgetInteractRsp extends GenshinPacket { ...@@ -23,7 +24,7 @@ public class PacketGadgetInteractRsp extends GenshinPacket {
super(PacketOpcodes.GadgetInteractRsp); super(PacketOpcodes.GadgetInteractRsp);
GadgetInteractRsp proto = GadgetInteractRsp.newBuilder() GadgetInteractRsp proto = GadgetInteractRsp.newBuilder()
.setRetcode(1) .setRetcode(RetcodeOuterClass.Retcode.RET_SVR_ERROR_VALUE)
.build(); .build();
this.setData(proto); this.setData(proto);
......
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