From 3f8c7d955425fed77e5827fb9a58865b9c622142 Mon Sep 17 00:00:00 2001 From: Hiro Date: Tue, 28 Nov 2023 06:09:14 +0200 Subject: [PATCH] implement chat bubbles + phone themes --- .../proto/GetPhoneDataCsReqOuterClass.java | 174 +++++ .../proto/GetPhoneDataScRspOuterClass.java | 664 ++++++++++++++++++ .../SelectChatBubbleCsReqOuterClass.java | 260 +++++++ .../SelectChatBubbleScRspOuterClass.java | 340 +++++++++ .../SelectPhoneThemeCsReqOuterClass.java | 260 +++++++ .../SelectPhoneThemeScRspOuterClass.java | 340 +++++++++ .../java/emu/lunarcore/data/GameData.java | 26 + .../lunarcore/data/excel/ChatBubbleExcel.java | 23 + .../lunarcore/data/excel/PhoneThemeExcel.java | 21 + .../emu/lunarcore/game/player/Player.java | 24 + .../packet/recv/HandlerGetPhoneDataCsReq.java | 17 + .../recv/HandlerSelectChatBubbleCsReq.java | 23 + .../recv/HandlerSelectPhoneThemeCsReq.java | 23 + .../packet/send/PacketGetPhoneDataScRsp.java | 32 + .../send/PacketSelectChatBubbleScRsp.java | 23 + .../send/PacketSelectPhoneThemeScRsp.java | 22 + 16 files changed, 2272 insertions(+) create mode 100644 src/generated/main/emu/lunarcore/proto/GetPhoneDataCsReqOuterClass.java create mode 100644 src/generated/main/emu/lunarcore/proto/GetPhoneDataScRspOuterClass.java create mode 100644 src/generated/main/emu/lunarcore/proto/SelectChatBubbleCsReqOuterClass.java create mode 100644 src/generated/main/emu/lunarcore/proto/SelectChatBubbleScRspOuterClass.java create mode 100644 src/generated/main/emu/lunarcore/proto/SelectPhoneThemeCsReqOuterClass.java create mode 100644 src/generated/main/emu/lunarcore/proto/SelectPhoneThemeScRspOuterClass.java create mode 100644 src/main/java/emu/lunarcore/data/excel/ChatBubbleExcel.java create mode 100644 src/main/java/emu/lunarcore/data/excel/PhoneThemeExcel.java create mode 100644 src/main/java/emu/lunarcore/server/packet/recv/HandlerGetPhoneDataCsReq.java create mode 100644 src/main/java/emu/lunarcore/server/packet/recv/HandlerSelectChatBubbleCsReq.java create mode 100644 src/main/java/emu/lunarcore/server/packet/recv/HandlerSelectPhoneThemeCsReq.java create mode 100644 src/main/java/emu/lunarcore/server/packet/send/PacketGetPhoneDataScRsp.java create mode 100644 src/main/java/emu/lunarcore/server/packet/send/PacketSelectChatBubbleScRsp.java create mode 100644 src/main/java/emu/lunarcore/server/packet/send/PacketSelectPhoneThemeScRsp.java diff --git a/src/generated/main/emu/lunarcore/proto/GetPhoneDataCsReqOuterClass.java b/src/generated/main/emu/lunarcore/proto/GetPhoneDataCsReqOuterClass.java new file mode 100644 index 0000000..82ae830 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/GetPhoneDataCsReqOuterClass.java @@ -0,0 +1,174 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.proto; + +import java.io.IOException; +import us.hebi.quickbuf.InvalidProtocolBufferException; +import us.hebi.quickbuf.JsonSink; +import us.hebi.quickbuf.JsonSource; +import us.hebi.quickbuf.MessageFactory; +import us.hebi.quickbuf.ProtoMessage; +import us.hebi.quickbuf.ProtoSink; +import us.hebi.quickbuf.ProtoSource; + +public final class GetPhoneDataCsReqOuterClass { + /** + * Protobuf type {@code GetPhoneDataCsReq} + */ + public static final class GetPhoneDataCsReq extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + private GetPhoneDataCsReq() { + } + + /** + * @return a new empty instance of {@code GetPhoneDataCsReq} + */ + public static GetPhoneDataCsReq newInstance() { + return new GetPhoneDataCsReq(); + } + + @Override + public GetPhoneDataCsReq copyFrom(final GetPhoneDataCsReq other) { + cachedSize = other.cachedSize; + return this; + } + + @Override + public GetPhoneDataCsReq mergeFrom(final GetPhoneDataCsReq other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + return this; + } + + @Override + public GetPhoneDataCsReq clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + return this; + } + + @Override + public GetPhoneDataCsReq clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof GetPhoneDataCsReq)) { + return false; + } + GetPhoneDataCsReq other = (GetPhoneDataCsReq) o; + return true; + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + } + + @Override + protected int computeSerializedSize() { + int size = 0; + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public GetPhoneDataCsReq mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 0: { + return this; + } + default: { + if (!input.skipField(tag)) { + return this; + } + tag = input.readTag(); + break; + } + } + } + } + + @Override + public void writeTo(final JsonSink output) throws IOException { + output.beginObject(); + output.endObject(); + } + + @Override + public GetPhoneDataCsReq mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public GetPhoneDataCsReq clone() { + return new GetPhoneDataCsReq().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static GetPhoneDataCsReq parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new GetPhoneDataCsReq(), data).checkInitialized(); + } + + public static GetPhoneDataCsReq parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new GetPhoneDataCsReq(), input).checkInitialized(); + } + + public static GetPhoneDataCsReq parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new GetPhoneDataCsReq(), input).checkInitialized(); + } + + /** + * @return factory for creating GetPhoneDataCsReq messages + */ + public static MessageFactory getFactory() { + return GetPhoneDataCsReqFactory.INSTANCE; + } + + private enum GetPhoneDataCsReqFactory implements MessageFactory { + INSTANCE; + + @Override + public GetPhoneDataCsReq create() { + return GetPhoneDataCsReq.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/GetPhoneDataScRspOuterClass.java b/src/generated/main/emu/lunarcore/proto/GetPhoneDataScRspOuterClass.java new file mode 100644 index 0000000..09c5e66 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/GetPhoneDataScRspOuterClass.java @@ -0,0 +1,664 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.proto; + +import java.io.IOException; +import us.hebi.quickbuf.FieldName; +import us.hebi.quickbuf.InvalidProtocolBufferException; +import us.hebi.quickbuf.JsonSink; +import us.hebi.quickbuf.JsonSource; +import us.hebi.quickbuf.MessageFactory; +import us.hebi.quickbuf.ProtoMessage; +import us.hebi.quickbuf.ProtoSink; +import us.hebi.quickbuf.ProtoSource; +import us.hebi.quickbuf.RepeatedInt; + +public final class GetPhoneDataScRspOuterClass { + /** + * Protobuf type {@code GetPhoneDataScRsp} + */ + public static final class GetPhoneDataScRsp extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 cur_chat_bubble = 2; + */ + private int curChatBubble; + + /** + * optional uint32 cur_phone_theme = 3; + */ + private int curPhoneTheme; + + /** + * optional uint32 retcode = 9; + */ + private int retcode; + + /** + * repeated uint32 owned_chat_bubbles = 10; + */ + private final RepeatedInt ownedChatBubbles = RepeatedInt.newEmptyInstance(); + + /** + * repeated uint32 owned_phone_themes = 13; + */ + private final RepeatedInt ownedPhoneThemes = RepeatedInt.newEmptyInstance(); + + private GetPhoneDataScRsp() { + } + + /** + * @return a new empty instance of {@code GetPhoneDataScRsp} + */ + public static GetPhoneDataScRsp newInstance() { + return new GetPhoneDataScRsp(); + } + + /** + * optional uint32 cur_chat_bubble = 2; + * @return whether the curChatBubble field is set + */ + public boolean hasCurChatBubble() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 cur_chat_bubble = 2; + * @return this + */ + public GetPhoneDataScRsp clearCurChatBubble() { + bitField0_ &= ~0x00000001; + curChatBubble = 0; + return this; + } + + /** + * optional uint32 cur_chat_bubble = 2; + * @return the curChatBubble + */ + public int getCurChatBubble() { + return curChatBubble; + } + + /** + * optional uint32 cur_chat_bubble = 2; + * @param value the curChatBubble to set + * @return this + */ + public GetPhoneDataScRsp setCurChatBubble(final int value) { + bitField0_ |= 0x00000001; + curChatBubble = value; + return this; + } + + /** + * optional uint32 cur_phone_theme = 3; + * @return whether the curPhoneTheme field is set + */ + public boolean hasCurPhoneTheme() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 cur_phone_theme = 3; + * @return this + */ + public GetPhoneDataScRsp clearCurPhoneTheme() { + bitField0_ &= ~0x00000002; + curPhoneTheme = 0; + return this; + } + + /** + * optional uint32 cur_phone_theme = 3; + * @return the curPhoneTheme + */ + public int getCurPhoneTheme() { + return curPhoneTheme; + } + + /** + * optional uint32 cur_phone_theme = 3; + * @param value the curPhoneTheme to set + * @return this + */ + public GetPhoneDataScRsp setCurPhoneTheme(final int value) { + bitField0_ |= 0x00000002; + curPhoneTheme = value; + return this; + } + + /** + * optional uint32 retcode = 9; + * @return whether the retcode field is set + */ + public boolean hasRetcode() { + return (bitField0_ & 0x00000004) != 0; + } + + /** + * optional uint32 retcode = 9; + * @return this + */ + public GetPhoneDataScRsp clearRetcode() { + bitField0_ &= ~0x00000004; + retcode = 0; + return this; + } + + /** + * optional uint32 retcode = 9; + * @return the retcode + */ + public int getRetcode() { + return retcode; + } + + /** + * optional uint32 retcode = 9; + * @param value the retcode to set + * @return this + */ + public GetPhoneDataScRsp setRetcode(final int value) { + bitField0_ |= 0x00000004; + retcode = value; + return this; + } + + /** + * repeated uint32 owned_chat_bubbles = 10; + * @return whether the ownedChatBubbles field is set + */ + public boolean hasOwnedChatBubbles() { + return (bitField0_ & 0x00000008) != 0; + } + + /** + * repeated uint32 owned_chat_bubbles = 10; + * @return this + */ + public GetPhoneDataScRsp clearOwnedChatBubbles() { + bitField0_ &= ~0x00000008; + ownedChatBubbles.clear(); + return this; + } + + /** + * repeated uint32 owned_chat_bubbles = 10; + * + * This method returns the internal storage object without modifying any has state. + * The returned object should not be modified and be treated as read-only. + * + * Use {@link #getMutableOwnedChatBubbles()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedInt getOwnedChatBubbles() { + return ownedChatBubbles; + } + + /** + * repeated uint32 owned_chat_bubbles = 10; + * + * This method returns the internal storage object and sets the corresponding + * has state. The returned object will become part of this message and its + * contents may be modified as long as the has state is not cleared. + * + * @return internal storage object for modifications + */ + public RepeatedInt getMutableOwnedChatBubbles() { + bitField0_ |= 0x00000008; + return ownedChatBubbles; + } + + /** + * repeated uint32 owned_chat_bubbles = 10; + * @param value the ownedChatBubbles to add + * @return this + */ + public GetPhoneDataScRsp addOwnedChatBubbles(final int value) { + bitField0_ |= 0x00000008; + ownedChatBubbles.add(value); + return this; + } + + /** + * repeated uint32 owned_chat_bubbles = 10; + * @param values the ownedChatBubbles to add + * @return this + */ + public GetPhoneDataScRsp addAllOwnedChatBubbles(final int... values) { + bitField0_ |= 0x00000008; + ownedChatBubbles.addAll(values); + return this; + } + + /** + * repeated uint32 owned_phone_themes = 13; + * @return whether the ownedPhoneThemes field is set + */ + public boolean hasOwnedPhoneThemes() { + return (bitField0_ & 0x00000010) != 0; + } + + /** + * repeated uint32 owned_phone_themes = 13; + * @return this + */ + public GetPhoneDataScRsp clearOwnedPhoneThemes() { + bitField0_ &= ~0x00000010; + ownedPhoneThemes.clear(); + return this; + } + + /** + * repeated uint32 owned_phone_themes = 13; + * + * This method returns the internal storage object without modifying any has state. + * The returned object should not be modified and be treated as read-only. + * + * Use {@link #getMutableOwnedPhoneThemes()} if you want to modify it. + * + * @return internal storage object for reading + */ + public RepeatedInt getOwnedPhoneThemes() { + return ownedPhoneThemes; + } + + /** + * repeated uint32 owned_phone_themes = 13; + * + * This method returns the internal storage object and sets the corresponding + * has state. The returned object will become part of this message and its + * contents may be modified as long as the has state is not cleared. + * + * @return internal storage object for modifications + */ + public RepeatedInt getMutableOwnedPhoneThemes() { + bitField0_ |= 0x00000010; + return ownedPhoneThemes; + } + + /** + * repeated uint32 owned_phone_themes = 13; + * @param value the ownedPhoneThemes to add + * @return this + */ + public GetPhoneDataScRsp addOwnedPhoneThemes(final int value) { + bitField0_ |= 0x00000010; + ownedPhoneThemes.add(value); + return this; + } + + /** + * repeated uint32 owned_phone_themes = 13; + * @param values the ownedPhoneThemes to add + * @return this + */ + public GetPhoneDataScRsp addAllOwnedPhoneThemes(final int... values) { + bitField0_ |= 0x00000010; + ownedPhoneThemes.addAll(values); + return this; + } + + @Override + public GetPhoneDataScRsp copyFrom(final GetPhoneDataScRsp other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + curChatBubble = other.curChatBubble; + curPhoneTheme = other.curPhoneTheme; + retcode = other.retcode; + ownedChatBubbles.copyFrom(other.ownedChatBubbles); + ownedPhoneThemes.copyFrom(other.ownedPhoneThemes); + } + return this; + } + + @Override + public GetPhoneDataScRsp mergeFrom(final GetPhoneDataScRsp other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasCurChatBubble()) { + setCurChatBubble(other.curChatBubble); + } + if (other.hasCurPhoneTheme()) { + setCurPhoneTheme(other.curPhoneTheme); + } + if (other.hasRetcode()) { + setRetcode(other.retcode); + } + if (other.hasOwnedChatBubbles()) { + getMutableOwnedChatBubbles().addAll(other.ownedChatBubbles); + } + if (other.hasOwnedPhoneThemes()) { + getMutableOwnedPhoneThemes().addAll(other.ownedPhoneThemes); + } + return this; + } + + @Override + public GetPhoneDataScRsp clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + curChatBubble = 0; + curPhoneTheme = 0; + retcode = 0; + ownedChatBubbles.clear(); + ownedPhoneThemes.clear(); + return this; + } + + @Override + public GetPhoneDataScRsp clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + ownedChatBubbles.clear(); + ownedPhoneThemes.clear(); + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof GetPhoneDataScRsp)) { + return false; + } + GetPhoneDataScRsp other = (GetPhoneDataScRsp) o; + return bitField0_ == other.bitField0_ + && (!hasCurChatBubble() || curChatBubble == other.curChatBubble) + && (!hasCurPhoneTheme() || curPhoneTheme == other.curPhoneTheme) + && (!hasRetcode() || retcode == other.retcode) + && (!hasOwnedChatBubbles() || ownedChatBubbles.equals(other.ownedChatBubbles)) + && (!hasOwnedPhoneThemes() || ownedPhoneThemes.equals(other.ownedPhoneThemes)); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 16); + output.writeUInt32NoTag(curChatBubble); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 24); + output.writeUInt32NoTag(curPhoneTheme); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeRawByte((byte) 72); + output.writeUInt32NoTag(retcode); + } + if ((bitField0_ & 0x00000008) != 0) { + for (int i = 0; i < ownedChatBubbles.length(); i++) { + output.writeRawByte((byte) 80); + output.writeUInt32NoTag(ownedChatBubbles.array()[i]); + } + } + if ((bitField0_ & 0x00000010) != 0) { + for (int i = 0; i < ownedPhoneThemes.length(); i++) { + output.writeRawByte((byte) 104); + output.writeUInt32NoTag(ownedPhoneThemes.array()[i]); + } + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(curChatBubble); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(curPhoneTheme); + } + if ((bitField0_ & 0x00000004) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode); + } + if ((bitField0_ & 0x00000008) != 0) { + size += (1 * ownedChatBubbles.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(ownedChatBubbles); + } + if ((bitField0_ & 0x00000010) != 0) { + size += (1 * ownedPhoneThemes.length()) + ProtoSink.computeRepeatedUInt32SizeNoTag(ownedPhoneThemes); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public GetPhoneDataScRsp mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 16: { + // curChatBubble + curChatBubble = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 24) { + break; + } + } + case 24: { + // curPhoneTheme + curPhoneTheme = input.readUInt32(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 72) { + break; + } + } + case 72: { + // retcode + retcode = input.readUInt32(); + bitField0_ |= 0x00000004; + tag = input.readTag(); + if (tag != 82) { + break; + } + } + case 82: { + // ownedChatBubbles [packed=true] + input.readPackedUInt32(ownedChatBubbles, tag); + bitField0_ |= 0x00000008; + tag = input.readTag(); + if (tag != 106) { + break; + } + } + case 106: { + // ownedPhoneThemes [packed=true] + input.readPackedUInt32(ownedPhoneThemes, tag); + bitField0_ |= 0x00000010; + tag = input.readTag(); + if (tag != 0) { + break; + } + } + case 0: { + return this; + } + default: { + if (!input.skipField(tag)) { + return this; + } + tag = input.readTag(); + break; + } + case 80: { + // ownedChatBubbles [packed=false] + tag = input.readRepeatedUInt32(ownedChatBubbles, tag); + bitField0_ |= 0x00000008; + break; + } + case 104: { + // ownedPhoneThemes [packed=false] + tag = input.readRepeatedUInt32(ownedPhoneThemes, tag); + bitField0_ |= 0x00000010; + break; + } + } + } + } + + @Override + public void writeTo(final JsonSink output) throws IOException { + output.beginObject(); + if ((bitField0_ & 0x00000001) != 0) { + output.writeUInt32(FieldNames.curChatBubble, curChatBubble); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt32(FieldNames.curPhoneTheme, curPhoneTheme); + } + if ((bitField0_ & 0x00000004) != 0) { + output.writeUInt32(FieldNames.retcode, retcode); + } + if ((bitField0_ & 0x00000008) != 0) { + output.writeRepeatedUInt32(FieldNames.ownedChatBubbles, ownedChatBubbles); + } + if ((bitField0_ & 0x00000010) != 0) { + output.writeRepeatedUInt32(FieldNames.ownedPhoneThemes, ownedPhoneThemes); + } + output.endObject(); + } + + @Override + public GetPhoneDataScRsp mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 94167140: + case 1828957140: { + if (input.isAtField(FieldNames.curChatBubble)) { + if (!input.trySkipNullValue()) { + curChatBubble = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case 405670747: + case -514634695: { + if (input.isAtField(FieldNames.curPhoneTheme)) { + if (!input.trySkipNullValue()) { + curPhoneTheme = input.readUInt32(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1097936398: { + if (input.isAtField(FieldNames.retcode)) { + if (!input.trySkipNullValue()) { + retcode = input.readUInt32(); + bitField0_ |= 0x00000004; + } + } else { + input.skipUnknownField(); + } + break; + } + case -1579353334: + case -1491735846: { + if (input.isAtField(FieldNames.ownedChatBubbles)) { + if (!input.trySkipNullValue()) { + input.readRepeatedUInt32(ownedChatBubbles); + bitField0_ |= 0x00000008; + } + } else { + input.skipUnknownField(); + } + break; + } + case -512676109: + case -1128638699: { + if (input.isAtField(FieldNames.ownedPhoneThemes)) { + if (!input.trySkipNullValue()) { + input.readRepeatedUInt32(ownedPhoneThemes); + bitField0_ |= 0x00000010; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public GetPhoneDataScRsp clone() { + return new GetPhoneDataScRsp().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static GetPhoneDataScRsp parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new GetPhoneDataScRsp(), data).checkInitialized(); + } + + public static GetPhoneDataScRsp parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new GetPhoneDataScRsp(), input).checkInitialized(); + } + + public static GetPhoneDataScRsp parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new GetPhoneDataScRsp(), input).checkInitialized(); + } + + /** + * @return factory for creating GetPhoneDataScRsp messages + */ + public static MessageFactory getFactory() { + return GetPhoneDataScRspFactory.INSTANCE; + } + + private enum GetPhoneDataScRspFactory implements MessageFactory { + INSTANCE; + + @Override + public GetPhoneDataScRsp create() { + return GetPhoneDataScRsp.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName curChatBubble = FieldName.forField("curChatBubble", "cur_chat_bubble"); + + static final FieldName curPhoneTheme = FieldName.forField("curPhoneTheme", "cur_phone_theme"); + + static final FieldName retcode = FieldName.forField("retcode"); + + static final FieldName ownedChatBubbles = FieldName.forField("ownedChatBubbles", "owned_chat_bubbles"); + + static final FieldName ownedPhoneThemes = FieldName.forField("ownedPhoneThemes", "owned_phone_themes"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/SelectChatBubbleCsReqOuterClass.java b/src/generated/main/emu/lunarcore/proto/SelectChatBubbleCsReqOuterClass.java new file mode 100644 index 0000000..c40b6a0 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/SelectChatBubbleCsReqOuterClass.java @@ -0,0 +1,260 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.proto; + +import java.io.IOException; +import us.hebi.quickbuf.FieldName; +import us.hebi.quickbuf.InvalidProtocolBufferException; +import us.hebi.quickbuf.JsonSink; +import us.hebi.quickbuf.JsonSource; +import us.hebi.quickbuf.MessageFactory; +import us.hebi.quickbuf.ProtoMessage; +import us.hebi.quickbuf.ProtoSink; +import us.hebi.quickbuf.ProtoSource; + +public final class SelectChatBubbleCsReqOuterClass { + /** + * Protobuf type {@code SelectChatBubbleCsReq} + */ + public static final class SelectChatBubbleCsReq extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 bubble_id = 7; + */ + private int bubbleId; + + private SelectChatBubbleCsReq() { + } + + /** + * @return a new empty instance of {@code SelectChatBubbleCsReq} + */ + public static SelectChatBubbleCsReq newInstance() { + return new SelectChatBubbleCsReq(); + } + + /** + * optional uint32 bubble_id = 7; + * @return whether the bubbleId field is set + */ + public boolean hasBubbleId() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 bubble_id = 7; + * @return this + */ + public SelectChatBubbleCsReq clearBubbleId() { + bitField0_ &= ~0x00000001; + bubbleId = 0; + return this; + } + + /** + * optional uint32 bubble_id = 7; + * @return the bubbleId + */ + public int getBubbleId() { + return bubbleId; + } + + /** + * optional uint32 bubble_id = 7; + * @param value the bubbleId to set + * @return this + */ + public SelectChatBubbleCsReq setBubbleId(final int value) { + bitField0_ |= 0x00000001; + bubbleId = value; + return this; + } + + @Override + public SelectChatBubbleCsReq copyFrom(final SelectChatBubbleCsReq other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + bubbleId = other.bubbleId; + } + return this; + } + + @Override + public SelectChatBubbleCsReq mergeFrom(final SelectChatBubbleCsReq other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasBubbleId()) { + setBubbleId(other.bubbleId); + } + return this; + } + + @Override + public SelectChatBubbleCsReq clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + bubbleId = 0; + return this; + } + + @Override + public SelectChatBubbleCsReq clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof SelectChatBubbleCsReq)) { + return false; + } + SelectChatBubbleCsReq other = (SelectChatBubbleCsReq) o; + return bitField0_ == other.bitField0_ + && (!hasBubbleId() || bubbleId == other.bubbleId); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 56); + output.writeUInt32NoTag(bubbleId); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(bubbleId); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public SelectChatBubbleCsReq mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 56: { + // bubbleId + bubbleId = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 0) { + break; + } + } + case 0: { + return this; + } + default: { + if (!input.skipField(tag)) { + return this; + } + tag = input.readTag(); + break; + } + } + } + } + + @Override + public void writeTo(final JsonSink output) throws IOException { + output.beginObject(); + if ((bitField0_ & 0x00000001) != 0) { + output.writeUInt32(FieldNames.bubbleId, bubbleId); + } + output.endObject(); + } + + @Override + public SelectChatBubbleCsReq mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case -1640052025: + case 698016174: { + if (input.isAtField(FieldNames.bubbleId)) { + if (!input.trySkipNullValue()) { + bubbleId = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public SelectChatBubbleCsReq clone() { + return new SelectChatBubbleCsReq().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static SelectChatBubbleCsReq parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new SelectChatBubbleCsReq(), data).checkInitialized(); + } + + public static SelectChatBubbleCsReq parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new SelectChatBubbleCsReq(), input).checkInitialized(); + } + + public static SelectChatBubbleCsReq parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new SelectChatBubbleCsReq(), input).checkInitialized(); + } + + /** + * @return factory for creating SelectChatBubbleCsReq messages + */ + public static MessageFactory getFactory() { + return SelectChatBubbleCsReqFactory.INSTANCE; + } + + private enum SelectChatBubbleCsReqFactory implements MessageFactory { + INSTANCE; + + @Override + public SelectChatBubbleCsReq create() { + return SelectChatBubbleCsReq.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName bubbleId = FieldName.forField("bubbleId", "bubble_id"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/SelectChatBubbleScRspOuterClass.java b/src/generated/main/emu/lunarcore/proto/SelectChatBubbleScRspOuterClass.java new file mode 100644 index 0000000..a0617bc --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/SelectChatBubbleScRspOuterClass.java @@ -0,0 +1,340 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.proto; + +import java.io.IOException; +import us.hebi.quickbuf.FieldName; +import us.hebi.quickbuf.InvalidProtocolBufferException; +import us.hebi.quickbuf.JsonSink; +import us.hebi.quickbuf.JsonSource; +import us.hebi.quickbuf.MessageFactory; +import us.hebi.quickbuf.ProtoMessage; +import us.hebi.quickbuf.ProtoSink; +import us.hebi.quickbuf.ProtoSource; + +public final class SelectChatBubbleScRspOuterClass { + /** + * Protobuf type {@code SelectChatBubbleScRsp} + */ + public static final class SelectChatBubbleScRsp extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 cur_chat_bubble = 1; + */ + private int curChatBubble; + + /** + * optional uint32 retcode = 10; + */ + private int retcode; + + private SelectChatBubbleScRsp() { + } + + /** + * @return a new empty instance of {@code SelectChatBubbleScRsp} + */ + public static SelectChatBubbleScRsp newInstance() { + return new SelectChatBubbleScRsp(); + } + + /** + * optional uint32 cur_chat_bubble = 1; + * @return whether the curChatBubble field is set + */ + public boolean hasCurChatBubble() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 cur_chat_bubble = 1; + * @return this + */ + public SelectChatBubbleScRsp clearCurChatBubble() { + bitField0_ &= ~0x00000001; + curChatBubble = 0; + return this; + } + + /** + * optional uint32 cur_chat_bubble = 1; + * @return the curChatBubble + */ + public int getCurChatBubble() { + return curChatBubble; + } + + /** + * optional uint32 cur_chat_bubble = 1; + * @param value the curChatBubble to set + * @return this + */ + public SelectChatBubbleScRsp setCurChatBubble(final int value) { + bitField0_ |= 0x00000001; + curChatBubble = value; + return this; + } + + /** + * optional uint32 retcode = 10; + * @return whether the retcode field is set + */ + public boolean hasRetcode() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 retcode = 10; + * @return this + */ + public SelectChatBubbleScRsp clearRetcode() { + bitField0_ &= ~0x00000002; + retcode = 0; + return this; + } + + /** + * optional uint32 retcode = 10; + * @return the retcode + */ + public int getRetcode() { + return retcode; + } + + /** + * optional uint32 retcode = 10; + * @param value the retcode to set + * @return this + */ + public SelectChatBubbleScRsp setRetcode(final int value) { + bitField0_ |= 0x00000002; + retcode = value; + return this; + } + + @Override + public SelectChatBubbleScRsp copyFrom(final SelectChatBubbleScRsp other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + curChatBubble = other.curChatBubble; + retcode = other.retcode; + } + return this; + } + + @Override + public SelectChatBubbleScRsp mergeFrom(final SelectChatBubbleScRsp other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasCurChatBubble()) { + setCurChatBubble(other.curChatBubble); + } + if (other.hasRetcode()) { + setRetcode(other.retcode); + } + return this; + } + + @Override + public SelectChatBubbleScRsp clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + curChatBubble = 0; + retcode = 0; + return this; + } + + @Override + public SelectChatBubbleScRsp clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof SelectChatBubbleScRsp)) { + return false; + } + SelectChatBubbleScRsp other = (SelectChatBubbleScRsp) o; + return bitField0_ == other.bitField0_ + && (!hasCurChatBubble() || curChatBubble == other.curChatBubble) + && (!hasRetcode() || retcode == other.retcode); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 8); + output.writeUInt32NoTag(curChatBubble); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 80); + output.writeUInt32NoTag(retcode); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(curChatBubble); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public SelectChatBubbleScRsp mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 8: { + // curChatBubble + curChatBubble = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 80) { + break; + } + } + case 80: { + // retcode + retcode = input.readUInt32(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 0) { + break; + } + } + case 0: { + return this; + } + default: { + if (!input.skipField(tag)) { + return this; + } + tag = input.readTag(); + break; + } + } + } + } + + @Override + public void writeTo(final JsonSink output) throws IOException { + output.beginObject(); + if ((bitField0_ & 0x00000001) != 0) { + output.writeUInt32(FieldNames.curChatBubble, curChatBubble); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt32(FieldNames.retcode, retcode); + } + output.endObject(); + } + + @Override + public SelectChatBubbleScRsp mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 94167140: + case 1828957140: { + if (input.isAtField(FieldNames.curChatBubble)) { + if (!input.trySkipNullValue()) { + curChatBubble = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1097936398: { + if (input.isAtField(FieldNames.retcode)) { + if (!input.trySkipNullValue()) { + retcode = input.readUInt32(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public SelectChatBubbleScRsp clone() { + return new SelectChatBubbleScRsp().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static SelectChatBubbleScRsp parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new SelectChatBubbleScRsp(), data).checkInitialized(); + } + + public static SelectChatBubbleScRsp parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new SelectChatBubbleScRsp(), input).checkInitialized(); + } + + public static SelectChatBubbleScRsp parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new SelectChatBubbleScRsp(), input).checkInitialized(); + } + + /** + * @return factory for creating SelectChatBubbleScRsp messages + */ + public static MessageFactory getFactory() { + return SelectChatBubbleScRspFactory.INSTANCE; + } + + private enum SelectChatBubbleScRspFactory implements MessageFactory { + INSTANCE; + + @Override + public SelectChatBubbleScRsp create() { + return SelectChatBubbleScRsp.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName curChatBubble = FieldName.forField("curChatBubble", "cur_chat_bubble"); + + static final FieldName retcode = FieldName.forField("retcode"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/SelectPhoneThemeCsReqOuterClass.java b/src/generated/main/emu/lunarcore/proto/SelectPhoneThemeCsReqOuterClass.java new file mode 100644 index 0000000..f21bdf3 --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/SelectPhoneThemeCsReqOuterClass.java @@ -0,0 +1,260 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.proto; + +import java.io.IOException; +import us.hebi.quickbuf.FieldName; +import us.hebi.quickbuf.InvalidProtocolBufferException; +import us.hebi.quickbuf.JsonSink; +import us.hebi.quickbuf.JsonSource; +import us.hebi.quickbuf.MessageFactory; +import us.hebi.quickbuf.ProtoMessage; +import us.hebi.quickbuf.ProtoSink; +import us.hebi.quickbuf.ProtoSource; + +public final class SelectPhoneThemeCsReqOuterClass { + /** + * Protobuf type {@code SelectPhoneThemeCsReq} + */ + public static final class SelectPhoneThemeCsReq extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 theme_id = 2; + */ + private int themeId; + + private SelectPhoneThemeCsReq() { + } + + /** + * @return a new empty instance of {@code SelectPhoneThemeCsReq} + */ + public static SelectPhoneThemeCsReq newInstance() { + return new SelectPhoneThemeCsReq(); + } + + /** + * optional uint32 theme_id = 2; + * @return whether the themeId field is set + */ + public boolean hasThemeId() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 theme_id = 2; + * @return this + */ + public SelectPhoneThemeCsReq clearThemeId() { + bitField0_ &= ~0x00000001; + themeId = 0; + return this; + } + + /** + * optional uint32 theme_id = 2; + * @return the themeId + */ + public int getThemeId() { + return themeId; + } + + /** + * optional uint32 theme_id = 2; + * @param value the themeId to set + * @return this + */ + public SelectPhoneThemeCsReq setThemeId(final int value) { + bitField0_ |= 0x00000001; + themeId = value; + return this; + } + + @Override + public SelectPhoneThemeCsReq copyFrom(final SelectPhoneThemeCsReq other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + themeId = other.themeId; + } + return this; + } + + @Override + public SelectPhoneThemeCsReq mergeFrom(final SelectPhoneThemeCsReq other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasThemeId()) { + setThemeId(other.themeId); + } + return this; + } + + @Override + public SelectPhoneThemeCsReq clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + themeId = 0; + return this; + } + + @Override + public SelectPhoneThemeCsReq clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof SelectPhoneThemeCsReq)) { + return false; + } + SelectPhoneThemeCsReq other = (SelectPhoneThemeCsReq) o; + return bitField0_ == other.bitField0_ + && (!hasThemeId() || themeId == other.themeId); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 16); + output.writeUInt32NoTag(themeId); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(themeId); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public SelectPhoneThemeCsReq mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 16: { + // themeId + themeId = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 0) { + break; + } + } + case 0: { + return this; + } + default: { + if (!input.skipField(tag)) { + return this; + } + tag = input.readTag(); + break; + } + } + } + } + + @Override + public void writeTo(final JsonSink output) throws IOException { + output.beginObject(); + if ((bitField0_ & 0x00000001) != 0) { + output.writeUInt32(FieldNames.themeId, themeId); + } + output.endObject(); + } + + @Override + public SelectPhoneThemeCsReq mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case -1349701436: + case 1108949841: { + if (input.isAtField(FieldNames.themeId)) { + if (!input.trySkipNullValue()) { + themeId = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public SelectPhoneThemeCsReq clone() { + return new SelectPhoneThemeCsReq().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static SelectPhoneThemeCsReq parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new SelectPhoneThemeCsReq(), data).checkInitialized(); + } + + public static SelectPhoneThemeCsReq parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new SelectPhoneThemeCsReq(), input).checkInitialized(); + } + + public static SelectPhoneThemeCsReq parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new SelectPhoneThemeCsReq(), input).checkInitialized(); + } + + /** + * @return factory for creating SelectPhoneThemeCsReq messages + */ + public static MessageFactory getFactory() { + return SelectPhoneThemeCsReqFactory.INSTANCE; + } + + private enum SelectPhoneThemeCsReqFactory implements MessageFactory { + INSTANCE; + + @Override + public SelectPhoneThemeCsReq create() { + return SelectPhoneThemeCsReq.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName themeId = FieldName.forField("themeId", "theme_id"); + } + } +} diff --git a/src/generated/main/emu/lunarcore/proto/SelectPhoneThemeScRspOuterClass.java b/src/generated/main/emu/lunarcore/proto/SelectPhoneThemeScRspOuterClass.java new file mode 100644 index 0000000..b1b3beb --- /dev/null +++ b/src/generated/main/emu/lunarcore/proto/SelectPhoneThemeScRspOuterClass.java @@ -0,0 +1,340 @@ +// Code generated by protocol buffer compiler. Do not edit! +package emu.lunarcore.proto; + +import java.io.IOException; +import us.hebi.quickbuf.FieldName; +import us.hebi.quickbuf.InvalidProtocolBufferException; +import us.hebi.quickbuf.JsonSink; +import us.hebi.quickbuf.JsonSource; +import us.hebi.quickbuf.MessageFactory; +import us.hebi.quickbuf.ProtoMessage; +import us.hebi.quickbuf.ProtoSink; +import us.hebi.quickbuf.ProtoSource; + +public final class SelectPhoneThemeScRspOuterClass { + /** + * Protobuf type {@code SelectPhoneThemeScRsp} + */ + public static final class SelectPhoneThemeScRsp extends ProtoMessage implements Cloneable { + private static final long serialVersionUID = 0L; + + /** + * optional uint32 cur_phone_theme = 6; + */ + private int curPhoneTheme; + + /** + * optional uint32 retcode = 8; + */ + private int retcode; + + private SelectPhoneThemeScRsp() { + } + + /** + * @return a new empty instance of {@code SelectPhoneThemeScRsp} + */ + public static SelectPhoneThemeScRsp newInstance() { + return new SelectPhoneThemeScRsp(); + } + + /** + * optional uint32 cur_phone_theme = 6; + * @return whether the curPhoneTheme field is set + */ + public boolean hasCurPhoneTheme() { + return (bitField0_ & 0x00000001) != 0; + } + + /** + * optional uint32 cur_phone_theme = 6; + * @return this + */ + public SelectPhoneThemeScRsp clearCurPhoneTheme() { + bitField0_ &= ~0x00000001; + curPhoneTheme = 0; + return this; + } + + /** + * optional uint32 cur_phone_theme = 6; + * @return the curPhoneTheme + */ + public int getCurPhoneTheme() { + return curPhoneTheme; + } + + /** + * optional uint32 cur_phone_theme = 6; + * @param value the curPhoneTheme to set + * @return this + */ + public SelectPhoneThemeScRsp setCurPhoneTheme(final int value) { + bitField0_ |= 0x00000001; + curPhoneTheme = value; + return this; + } + + /** + * optional uint32 retcode = 8; + * @return whether the retcode field is set + */ + public boolean hasRetcode() { + return (bitField0_ & 0x00000002) != 0; + } + + /** + * optional uint32 retcode = 8; + * @return this + */ + public SelectPhoneThemeScRsp clearRetcode() { + bitField0_ &= ~0x00000002; + retcode = 0; + return this; + } + + /** + * optional uint32 retcode = 8; + * @return the retcode + */ + public int getRetcode() { + return retcode; + } + + /** + * optional uint32 retcode = 8; + * @param value the retcode to set + * @return this + */ + public SelectPhoneThemeScRsp setRetcode(final int value) { + bitField0_ |= 0x00000002; + retcode = value; + return this; + } + + @Override + public SelectPhoneThemeScRsp copyFrom(final SelectPhoneThemeScRsp other) { + cachedSize = other.cachedSize; + if ((bitField0_ | other.bitField0_) != 0) { + bitField0_ = other.bitField0_; + curPhoneTheme = other.curPhoneTheme; + retcode = other.retcode; + } + return this; + } + + @Override + public SelectPhoneThemeScRsp mergeFrom(final SelectPhoneThemeScRsp other) { + if (other.isEmpty()) { + return this; + } + cachedSize = -1; + if (other.hasCurPhoneTheme()) { + setCurPhoneTheme(other.curPhoneTheme); + } + if (other.hasRetcode()) { + setRetcode(other.retcode); + } + return this; + } + + @Override + public SelectPhoneThemeScRsp clear() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + curPhoneTheme = 0; + retcode = 0; + return this; + } + + @Override + public SelectPhoneThemeScRsp clearQuick() { + if (isEmpty()) { + return this; + } + cachedSize = -1; + bitField0_ = 0; + return this; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (!(o instanceof SelectPhoneThemeScRsp)) { + return false; + } + SelectPhoneThemeScRsp other = (SelectPhoneThemeScRsp) o; + return bitField0_ == other.bitField0_ + && (!hasCurPhoneTheme() || curPhoneTheme == other.curPhoneTheme) + && (!hasRetcode() || retcode == other.retcode); + } + + @Override + public void writeTo(final ProtoSink output) throws IOException { + if ((bitField0_ & 0x00000001) != 0) { + output.writeRawByte((byte) 48); + output.writeUInt32NoTag(curPhoneTheme); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeRawByte((byte) 64); + output.writeUInt32NoTag(retcode); + } + } + + @Override + protected int computeSerializedSize() { + int size = 0; + if ((bitField0_ & 0x00000001) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(curPhoneTheme); + } + if ((bitField0_ & 0x00000002) != 0) { + size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode); + } + return size; + } + + @Override + @SuppressWarnings("fallthrough") + public SelectPhoneThemeScRsp mergeFrom(final ProtoSource input) throws IOException { + // Enabled Fall-Through Optimization (QuickBuffers) + int tag = input.readTag(); + while (true) { + switch (tag) { + case 48: { + // curPhoneTheme + curPhoneTheme = input.readUInt32(); + bitField0_ |= 0x00000001; + tag = input.readTag(); + if (tag != 64) { + break; + } + } + case 64: { + // retcode + retcode = input.readUInt32(); + bitField0_ |= 0x00000002; + tag = input.readTag(); + if (tag != 0) { + break; + } + } + case 0: { + return this; + } + default: { + if (!input.skipField(tag)) { + return this; + } + tag = input.readTag(); + break; + } + } + } + } + + @Override + public void writeTo(final JsonSink output) throws IOException { + output.beginObject(); + if ((bitField0_ & 0x00000001) != 0) { + output.writeUInt32(FieldNames.curPhoneTheme, curPhoneTheme); + } + if ((bitField0_ & 0x00000002) != 0) { + output.writeUInt32(FieldNames.retcode, retcode); + } + output.endObject(); + } + + @Override + public SelectPhoneThemeScRsp mergeFrom(final JsonSource input) throws IOException { + if (!input.beginObject()) { + return this; + } + while (!input.isAtEnd()) { + switch (input.readFieldHash()) { + case 405670747: + case -514634695: { + if (input.isAtField(FieldNames.curPhoneTheme)) { + if (!input.trySkipNullValue()) { + curPhoneTheme = input.readUInt32(); + bitField0_ |= 0x00000001; + } + } else { + input.skipUnknownField(); + } + break; + } + case 1097936398: { + if (input.isAtField(FieldNames.retcode)) { + if (!input.trySkipNullValue()) { + retcode = input.readUInt32(); + bitField0_ |= 0x00000002; + } + } else { + input.skipUnknownField(); + } + break; + } + default: { + input.skipUnknownField(); + break; + } + } + } + input.endObject(); + return this; + } + + @Override + public SelectPhoneThemeScRsp clone() { + return new SelectPhoneThemeScRsp().copyFrom(this); + } + + @Override + public boolean isEmpty() { + return ((bitField0_) == 0); + } + + public static SelectPhoneThemeScRsp parseFrom(final byte[] data) throws + InvalidProtocolBufferException { + return ProtoMessage.mergeFrom(new SelectPhoneThemeScRsp(), data).checkInitialized(); + } + + public static SelectPhoneThemeScRsp parseFrom(final ProtoSource input) throws IOException { + return ProtoMessage.mergeFrom(new SelectPhoneThemeScRsp(), input).checkInitialized(); + } + + public static SelectPhoneThemeScRsp parseFrom(final JsonSource input) throws IOException { + return ProtoMessage.mergeFrom(new SelectPhoneThemeScRsp(), input).checkInitialized(); + } + + /** + * @return factory for creating SelectPhoneThemeScRsp messages + */ + public static MessageFactory getFactory() { + return SelectPhoneThemeScRspFactory.INSTANCE; + } + + private enum SelectPhoneThemeScRspFactory implements MessageFactory { + INSTANCE; + + @Override + public SelectPhoneThemeScRsp create() { + return SelectPhoneThemeScRsp.newInstance(); + } + } + + /** + * Contains name constants used for serializing JSON + */ + static class FieldNames { + static final FieldName curPhoneTheme = FieldName.forField("curPhoneTheme", "cur_phone_theme"); + + static final FieldName retcode = FieldName.forField("retcode"); + } + } +} diff --git a/src/main/java/emu/lunarcore/data/GameData.java b/src/main/java/emu/lunarcore/data/GameData.java index 780d82a..f4b2fe5 100644 --- a/src/main/java/emu/lunarcore/data/GameData.java +++ b/src/main/java/emu/lunarcore/data/GameData.java @@ -2,6 +2,8 @@ package emu.lunarcore.data; import java.lang.reflect.Field; +import java.util.List; +import java.util.ArrayList; import emu.lunarcore.data.config.FloorInfo; import emu.lunarcore.data.excel.*; import emu.lunarcore.game.battle.MazeBuff; @@ -51,6 +53,8 @@ public class GameData { private static Int2ObjectMap equipmentPromotionExcelMap = new Int2ObjectOpenHashMap<>(); private static Int2ObjectMap mazeBuffExcelMap = new Int2ObjectOpenHashMap<>(); private static Int2ObjectMap cocoonExcelMap = new Int2ObjectOpenHashMap<>(); + private static Int2ObjectMap chatBubbleExcelMap = new Int2ObjectOpenHashMap<>(); + private static Int2ObjectMap phoneThemeExcelMap = new Int2ObjectOpenHashMap<>(); private static Int2ObjectMap monsterDropExcelMap = new Int2ObjectOpenHashMap<>(); private static Int2ObjectMap playerLevelExcelMap = new Int2ObjectOpenHashMap<>(); @@ -81,6 +85,28 @@ public class GameData { return map; } + public static List getAllChatBubbleIds() { + List allIds = new ArrayList<>(); + + for (Int2ObjectMap.Entry entry : chatBubbleExcelMap.int2ObjectEntrySet()) { + ChatBubbleExcel chatBubbleExcel = entry.getValue(); + allIds.add(chatBubbleExcel.getId()); + } + + return allIds; + } + + public static List getAllPhoneThemes() { + List allIds = new ArrayList<>(); + + for (Int2ObjectMap.Entry entry : phoneThemeExcelMap.int2ObjectEntrySet()) { + PhoneThemeExcel phoneThemeExcel = entry.getValue(); + allIds.add(phoneThemeExcel.getId()); + } + + return allIds; + } + public static AvatarPromotionExcel getAvatarPromotionExcel(int id, int promotion) { return avatarPromotionExcelMap.get((id << 8) + promotion); } diff --git a/src/main/java/emu/lunarcore/data/excel/ChatBubbleExcel.java b/src/main/java/emu/lunarcore/data/excel/ChatBubbleExcel.java new file mode 100644 index 0000000..9956d03 --- /dev/null +++ b/src/main/java/emu/lunarcore/data/excel/ChatBubbleExcel.java @@ -0,0 +1,23 @@ +package emu.lunarcore.data.excel; + +import emu.lunarcore.data.GameData; +import emu.lunarcore.data.GameResource; +import emu.lunarcore.data.ResourceType; +import emu.lunarcore.data.ResourceType.LoadPriority; +import emu.lunarcore.game.inventory.GameItem; +import it.unimi.dsi.fastutil.ints.IntOpenHashSet; +import lombok.Getter; + +@Getter +@ResourceType(name = {"ChatBubbleConfig.json"}, loadPriority = LoadPriority.LOW) +public class ChatBubbleExcel extends GameResource { + private int ID; + private String ShowType; + private int ShowParam; + + @Override + public int getId() { + return ID; + } + +} diff --git a/src/main/java/emu/lunarcore/data/excel/PhoneThemeExcel.java b/src/main/java/emu/lunarcore/data/excel/PhoneThemeExcel.java new file mode 100644 index 0000000..0474062 --- /dev/null +++ b/src/main/java/emu/lunarcore/data/excel/PhoneThemeExcel.java @@ -0,0 +1,21 @@ +package emu.lunarcore.data.excel; + +import emu.lunarcore.data.GameData; +import emu.lunarcore.data.GameResource; +import emu.lunarcore.data.ResourceType; +import emu.lunarcore.data.ResourceType.LoadPriority; +import emu.lunarcore.game.inventory.GameItem; +import it.unimi.dsi.fastutil.ints.IntOpenHashSet; +import lombok.Getter; + +@Getter +@ResourceType(name = {"PhoneThemeConfig.json"}, loadPriority = LoadPriority.LOW) +public class PhoneThemeExcel extends GameResource { + private int ID; + private String ShowType; + + @Override + public int getId() { + return ID; + } +} diff --git a/src/main/java/emu/lunarcore/game/player/Player.java b/src/main/java/emu/lunarcore/game/player/Player.java index 9605246..d475176 100644 --- a/src/main/java/emu/lunarcore/game/player/Player.java +++ b/src/main/java/emu/lunarcore/game/player/Player.java @@ -75,6 +75,8 @@ public class Player { private String name; private String signature; private int headIcon; + private int phoneTheme; + private int chatBubble; private int birthday; private int curBasicType; @Setter private PlayerGender gender; @@ -154,6 +156,8 @@ public class Player { this.name = GameConstants.DEFAULT_NAME; this.signature = ""; this.headIcon = 200001; + this.phoneTheme = 221000; + this.chatBubble = 220000; this.level = 1; this.stamina = GameConstants.MAX_STAMINA; this.nextStaminaRecover = System.currentTimeMillis(); @@ -230,6 +234,26 @@ public class Player { this.save(); this.sendPacket(new PacketPlayerSyncScNotify(this)); } + + public void setPhoneTheme(int themeId) { + this.phoneTheme = themeId; + this.save(); + this.sendPacket(new PacketPlayerSyncScNotify(this)); + } + + public int getPhoneTheme() { + return this.phoneTheme; + } + + public void setChatBubble(int bubbleId) { + this.chatBubble = bubbleId; + this.save(); + this.sendPacket(new PacketPlayerSyncScNotify(this)); + } + + public int getChatBubble() { + return this.chatBubble; + } public Set getUnlockedHeadIcons() { if (this.unlockedHeadIcons == null) { diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetPhoneDataCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetPhoneDataCsReq.java new file mode 100644 index 0000000..e4623ed --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerGetPhoneDataCsReq.java @@ -0,0 +1,17 @@ +package emu.lunarcore.server.packet.recv; + +import emu.lunarcore.server.game.GameSession; +import emu.lunarcore.server.packet.CmdId; +import emu.lunarcore.server.packet.Opcodes; +import emu.lunarcore.server.packet.PacketHandler; +import emu.lunarcore.server.packet.send.PacketGetPhoneDataScRsp; + +@Opcodes(CmdId.GetPhoneDataCsReq) +public class HandlerGetPhoneDataCsReq extends PacketHandler { + + @Override + public void handle(GameSession session, byte[] data) throws Exception { + session.send(new PacketGetPhoneDataScRsp(session.getPlayer())); + } + +} diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerSelectChatBubbleCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerSelectChatBubbleCsReq.java new file mode 100644 index 0000000..bd76f7d --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerSelectChatBubbleCsReq.java @@ -0,0 +1,23 @@ +package emu.lunarcore.server.packet.recv; + +import emu.lunarcore.server.game.GameSession; +import emu.lunarcore.game.player.Player; +import emu.lunarcore.server.packet.CmdId; +import emu.lunarcore.server.packet.Opcodes; +import emu.lunarcore.server.packet.PacketHandler; +import emu.lunarcore.proto.SelectChatBubbleCsReqOuterClass.SelectChatBubbleCsReq; +import emu.lunarcore.server.packet.send.PacketSelectChatBubbleScRsp; + +@Opcodes(CmdId.SelectChatBubbleCsReq) +public class HandlerSelectChatBubbleCsReq extends PacketHandler { + + @Override + public void handle(GameSession session, byte[] data) throws Exception { + + var req = SelectChatBubbleCsReq.parseFrom(data); + Player player = session.getPlayer(); + + session.send(new PacketSelectChatBubbleScRsp(player, req.getBubbleId())); + } + +} diff --git a/src/main/java/emu/lunarcore/server/packet/recv/HandlerSelectPhoneThemeCsReq.java b/src/main/java/emu/lunarcore/server/packet/recv/HandlerSelectPhoneThemeCsReq.java new file mode 100644 index 0000000..3b54762 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/recv/HandlerSelectPhoneThemeCsReq.java @@ -0,0 +1,23 @@ +package emu.lunarcore.server.packet.recv; + +import emu.lunarcore.server.game.GameSession; +import emu.lunarcore.game.player.Player; +import emu.lunarcore.server.packet.CmdId; +import emu.lunarcore.server.packet.Opcodes; +import emu.lunarcore.server.packet.PacketHandler; +import emu.lunarcore.proto.SelectPhoneThemeCsReqOuterClass.SelectPhoneThemeCsReq; +import emu.lunarcore.server.packet.send.PacketSelectPhoneThemeScRsp; + +@Opcodes(CmdId.SelectPhoneThemeCsReq) +public class HandlerSelectPhoneThemeCsReq extends PacketHandler { + + @Override + public void handle(GameSession session, byte[] data) throws Exception { + + var req = SelectPhoneThemeCsReq.parseFrom(data); + Player player = session.getPlayer(); + + session.send(new PacketSelectPhoneThemeScRsp(player, req.getThemeId())); + } + +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketGetPhoneDataScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketGetPhoneDataScRsp.java new file mode 100644 index 0000000..5fab12a --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketGetPhoneDataScRsp.java @@ -0,0 +1,32 @@ +package emu.lunarcore.server.packet.send; + +import emu.lunarcore.proto.GetPhoneDataScRspOuterClass.GetPhoneDataScRsp; +import emu.lunarcore.server.game.GameSession; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.data.GameData; +import emu.lunarcore.server.packet.CmdId; +import emu.lunarcore.game.player.Player; + +public class PacketGetPhoneDataScRsp extends BasePacket { + + public PacketGetPhoneDataScRsp(Player player) { + super(CmdId.GetPhoneDataScRsp); + + var allChatBubbles = GameData.getAllChatBubbleIds(); + var allPhoneThemes = GameData.getAllPhoneThemes(); + + var data = GetPhoneDataScRsp.newInstance() + .setCurChatBubble(player.getChatBubble()) + .setCurPhoneTheme(player.getPhoneTheme()); + + for (int chatBubbleId : allChatBubbles) { + data.addOwnedChatBubbles(chatBubbleId); + } + + for (int phoneThemeId : allPhoneThemes) { + data.addOwnedPhoneThemes(phoneThemeId); + } + + this.setData(data); + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketSelectChatBubbleScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketSelectChatBubbleScRsp.java new file mode 100644 index 0000000..1d108da --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketSelectChatBubbleScRsp.java @@ -0,0 +1,23 @@ +package emu.lunarcore.server.packet.send; + +import java.util.Collection; + +import emu.lunarcore.game.player.Player; +import emu.lunarcore.game.chat.ChatMessage; +import emu.lunarcore.proto.SelectChatBubbleScRspOuterClass.SelectChatBubbleScRsp; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; + +public class PacketSelectChatBubbleScRsp extends BasePacket { + + public PacketSelectChatBubbleScRsp(Player player, int bubbleId) { + super(CmdId.SelectChatBubbleScRsp); + + player.setChatBubble(bubbleId); + + var data = SelectChatBubbleScRsp.newInstance() + .setCurChatBubble(bubbleId); + + this.setData(data); + } +} diff --git a/src/main/java/emu/lunarcore/server/packet/send/PacketSelectPhoneThemeScRsp.java b/src/main/java/emu/lunarcore/server/packet/send/PacketSelectPhoneThemeScRsp.java new file mode 100644 index 0000000..0bd3885 --- /dev/null +++ b/src/main/java/emu/lunarcore/server/packet/send/PacketSelectPhoneThemeScRsp.java @@ -0,0 +1,22 @@ +package emu.lunarcore.server.packet.send; + +import emu.lunarcore.game.rogue.RogueMiracleData; +import emu.lunarcore.game.rogue.RogueMiracleSelectMenu; +import emu.lunarcore.proto.SelectPhoneThemeScRspOuterClass.SelectPhoneThemeScRsp; +import emu.lunarcore.server.packet.BasePacket; +import emu.lunarcore.server.packet.CmdId; +import emu.lunarcore.game.player.Player; + +public class PacketSelectPhoneThemeScRsp extends BasePacket { + + public PacketSelectPhoneThemeScRsp(Player player, int themeId) { + super(CmdId.SelectPhoneThemeScRsp); + + player.setPhoneTheme(themeId); + + var data = SelectPhoneThemeScRsp.newInstance() + .setCurPhoneTheme(themeId); + + this.setData(data); + } +}