implement chat bubbles + phone themes

This commit is contained in:
Hiro
2023-11-28 06:09:14 +02:00
parent c23777e397
commit 3f8c7d9554
16 changed files with 2272 additions and 0 deletions

View File

@@ -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<GetPhoneDataCsReq> 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<GetPhoneDataCsReq> getFactory() {
return GetPhoneDataCsReqFactory.INSTANCE;
}
private enum GetPhoneDataCsReqFactory implements MessageFactory<GetPhoneDataCsReq> {
INSTANCE;
@Override
public GetPhoneDataCsReq create() {
return GetPhoneDataCsReq.newInstance();
}
}
/**
* Contains name constants used for serializing JSON
*/
static class FieldNames {
}
}
}

View File

@@ -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<GetPhoneDataScRsp> implements Cloneable {
private static final long serialVersionUID = 0L;
/**
* <code>optional uint32 cur_chat_bubble = 2;</code>
*/
private int curChatBubble;
/**
* <code>optional uint32 cur_phone_theme = 3;</code>
*/
private int curPhoneTheme;
/**
* <code>optional uint32 retcode = 9;</code>
*/
private int retcode;
/**
* <code>repeated uint32 owned_chat_bubbles = 10;</code>
*/
private final RepeatedInt ownedChatBubbles = RepeatedInt.newEmptyInstance();
/**
* <code>repeated uint32 owned_phone_themes = 13;</code>
*/
private final RepeatedInt ownedPhoneThemes = RepeatedInt.newEmptyInstance();
private GetPhoneDataScRsp() {
}
/**
* @return a new empty instance of {@code GetPhoneDataScRsp}
*/
public static GetPhoneDataScRsp newInstance() {
return new GetPhoneDataScRsp();
}
/**
* <code>optional uint32 cur_chat_bubble = 2;</code>
* @return whether the curChatBubble field is set
*/
public boolean hasCurChatBubble() {
return (bitField0_ & 0x00000001) != 0;
}
/**
* <code>optional uint32 cur_chat_bubble = 2;</code>
* @return this
*/
public GetPhoneDataScRsp clearCurChatBubble() {
bitField0_ &= ~0x00000001;
curChatBubble = 0;
return this;
}
/**
* <code>optional uint32 cur_chat_bubble = 2;</code>
* @return the curChatBubble
*/
public int getCurChatBubble() {
return curChatBubble;
}
/**
* <code>optional uint32 cur_chat_bubble = 2;</code>
* @param value the curChatBubble to set
* @return this
*/
public GetPhoneDataScRsp setCurChatBubble(final int value) {
bitField0_ |= 0x00000001;
curChatBubble = value;
return this;
}
/**
* <code>optional uint32 cur_phone_theme = 3;</code>
* @return whether the curPhoneTheme field is set
*/
public boolean hasCurPhoneTheme() {
return (bitField0_ & 0x00000002) != 0;
}
/**
* <code>optional uint32 cur_phone_theme = 3;</code>
* @return this
*/
public GetPhoneDataScRsp clearCurPhoneTheme() {
bitField0_ &= ~0x00000002;
curPhoneTheme = 0;
return this;
}
/**
* <code>optional uint32 cur_phone_theme = 3;</code>
* @return the curPhoneTheme
*/
public int getCurPhoneTheme() {
return curPhoneTheme;
}
/**
* <code>optional uint32 cur_phone_theme = 3;</code>
* @param value the curPhoneTheme to set
* @return this
*/
public GetPhoneDataScRsp setCurPhoneTheme(final int value) {
bitField0_ |= 0x00000002;
curPhoneTheme = value;
return this;
}
/**
* <code>optional uint32 retcode = 9;</code>
* @return whether the retcode field is set
*/
public boolean hasRetcode() {
return (bitField0_ & 0x00000004) != 0;
}
/**
* <code>optional uint32 retcode = 9;</code>
* @return this
*/
public GetPhoneDataScRsp clearRetcode() {
bitField0_ &= ~0x00000004;
retcode = 0;
return this;
}
/**
* <code>optional uint32 retcode = 9;</code>
* @return the retcode
*/
public int getRetcode() {
return retcode;
}
/**
* <code>optional uint32 retcode = 9;</code>
* @param value the retcode to set
* @return this
*/
public GetPhoneDataScRsp setRetcode(final int value) {
bitField0_ |= 0x00000004;
retcode = value;
return this;
}
/**
* <code>repeated uint32 owned_chat_bubbles = 10;</code>
* @return whether the ownedChatBubbles field is set
*/
public boolean hasOwnedChatBubbles() {
return (bitField0_ & 0x00000008) != 0;
}
/**
* <code>repeated uint32 owned_chat_bubbles = 10;</code>
* @return this
*/
public GetPhoneDataScRsp clearOwnedChatBubbles() {
bitField0_ &= ~0x00000008;
ownedChatBubbles.clear();
return this;
}
/**
* <code>repeated uint32 owned_chat_bubbles = 10;</code>
*
* 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;
}
/**
* <code>repeated uint32 owned_chat_bubbles = 10;</code>
*
* 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;
}
/**
* <code>repeated uint32 owned_chat_bubbles = 10;</code>
* @param value the ownedChatBubbles to add
* @return this
*/
public GetPhoneDataScRsp addOwnedChatBubbles(final int value) {
bitField0_ |= 0x00000008;
ownedChatBubbles.add(value);
return this;
}
/**
* <code>repeated uint32 owned_chat_bubbles = 10;</code>
* @param values the ownedChatBubbles to add
* @return this
*/
public GetPhoneDataScRsp addAllOwnedChatBubbles(final int... values) {
bitField0_ |= 0x00000008;
ownedChatBubbles.addAll(values);
return this;
}
/**
* <code>repeated uint32 owned_phone_themes = 13;</code>
* @return whether the ownedPhoneThemes field is set
*/
public boolean hasOwnedPhoneThemes() {
return (bitField0_ & 0x00000010) != 0;
}
/**
* <code>repeated uint32 owned_phone_themes = 13;</code>
* @return this
*/
public GetPhoneDataScRsp clearOwnedPhoneThemes() {
bitField0_ &= ~0x00000010;
ownedPhoneThemes.clear();
return this;
}
/**
* <code>repeated uint32 owned_phone_themes = 13;</code>
*
* 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;
}
/**
* <code>repeated uint32 owned_phone_themes = 13;</code>
*
* 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;
}
/**
* <code>repeated uint32 owned_phone_themes = 13;</code>
* @param value the ownedPhoneThemes to add
* @return this
*/
public GetPhoneDataScRsp addOwnedPhoneThemes(final int value) {
bitField0_ |= 0x00000010;
ownedPhoneThemes.add(value);
return this;
}
/**
* <code>repeated uint32 owned_phone_themes = 13;</code>
* @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<GetPhoneDataScRsp> getFactory() {
return GetPhoneDataScRspFactory.INSTANCE;
}
private enum GetPhoneDataScRspFactory implements MessageFactory<GetPhoneDataScRsp> {
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");
}
}
}

View File

@@ -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<SelectChatBubbleCsReq> implements Cloneable {
private static final long serialVersionUID = 0L;
/**
* <code>optional uint32 bubble_id = 7;</code>
*/
private int bubbleId;
private SelectChatBubbleCsReq() {
}
/**
* @return a new empty instance of {@code SelectChatBubbleCsReq}
*/
public static SelectChatBubbleCsReq newInstance() {
return new SelectChatBubbleCsReq();
}
/**
* <code>optional uint32 bubble_id = 7;</code>
* @return whether the bubbleId field is set
*/
public boolean hasBubbleId() {
return (bitField0_ & 0x00000001) != 0;
}
/**
* <code>optional uint32 bubble_id = 7;</code>
* @return this
*/
public SelectChatBubbleCsReq clearBubbleId() {
bitField0_ &= ~0x00000001;
bubbleId = 0;
return this;
}
/**
* <code>optional uint32 bubble_id = 7;</code>
* @return the bubbleId
*/
public int getBubbleId() {
return bubbleId;
}
/**
* <code>optional uint32 bubble_id = 7;</code>
* @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<SelectChatBubbleCsReq> getFactory() {
return SelectChatBubbleCsReqFactory.INSTANCE;
}
private enum SelectChatBubbleCsReqFactory implements MessageFactory<SelectChatBubbleCsReq> {
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");
}
}
}

View File

@@ -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<SelectChatBubbleScRsp> implements Cloneable {
private static final long serialVersionUID = 0L;
/**
* <code>optional uint32 cur_chat_bubble = 1;</code>
*/
private int curChatBubble;
/**
* <code>optional uint32 retcode = 10;</code>
*/
private int retcode;
private SelectChatBubbleScRsp() {
}
/**
* @return a new empty instance of {@code SelectChatBubbleScRsp}
*/
public static SelectChatBubbleScRsp newInstance() {
return new SelectChatBubbleScRsp();
}
/**
* <code>optional uint32 cur_chat_bubble = 1;</code>
* @return whether the curChatBubble field is set
*/
public boolean hasCurChatBubble() {
return (bitField0_ & 0x00000001) != 0;
}
/**
* <code>optional uint32 cur_chat_bubble = 1;</code>
* @return this
*/
public SelectChatBubbleScRsp clearCurChatBubble() {
bitField0_ &= ~0x00000001;
curChatBubble = 0;
return this;
}
/**
* <code>optional uint32 cur_chat_bubble = 1;</code>
* @return the curChatBubble
*/
public int getCurChatBubble() {
return curChatBubble;
}
/**
* <code>optional uint32 cur_chat_bubble = 1;</code>
* @param value the curChatBubble to set
* @return this
*/
public SelectChatBubbleScRsp setCurChatBubble(final int value) {
bitField0_ |= 0x00000001;
curChatBubble = value;
return this;
}
/**
* <code>optional uint32 retcode = 10;</code>
* @return whether the retcode field is set
*/
public boolean hasRetcode() {
return (bitField0_ & 0x00000002) != 0;
}
/**
* <code>optional uint32 retcode = 10;</code>
* @return this
*/
public SelectChatBubbleScRsp clearRetcode() {
bitField0_ &= ~0x00000002;
retcode = 0;
return this;
}
/**
* <code>optional uint32 retcode = 10;</code>
* @return the retcode
*/
public int getRetcode() {
return retcode;
}
/**
* <code>optional uint32 retcode = 10;</code>
* @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<SelectChatBubbleScRsp> getFactory() {
return SelectChatBubbleScRspFactory.INSTANCE;
}
private enum SelectChatBubbleScRspFactory implements MessageFactory<SelectChatBubbleScRsp> {
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");
}
}
}

View File

@@ -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<SelectPhoneThemeCsReq> implements Cloneable {
private static final long serialVersionUID = 0L;
/**
* <code>optional uint32 theme_id = 2;</code>
*/
private int themeId;
private SelectPhoneThemeCsReq() {
}
/**
* @return a new empty instance of {@code SelectPhoneThemeCsReq}
*/
public static SelectPhoneThemeCsReq newInstance() {
return new SelectPhoneThemeCsReq();
}
/**
* <code>optional uint32 theme_id = 2;</code>
* @return whether the themeId field is set
*/
public boolean hasThemeId() {
return (bitField0_ & 0x00000001) != 0;
}
/**
* <code>optional uint32 theme_id = 2;</code>
* @return this
*/
public SelectPhoneThemeCsReq clearThemeId() {
bitField0_ &= ~0x00000001;
themeId = 0;
return this;
}
/**
* <code>optional uint32 theme_id = 2;</code>
* @return the themeId
*/
public int getThemeId() {
return themeId;
}
/**
* <code>optional uint32 theme_id = 2;</code>
* @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<SelectPhoneThemeCsReq> getFactory() {
return SelectPhoneThemeCsReqFactory.INSTANCE;
}
private enum SelectPhoneThemeCsReqFactory implements MessageFactory<SelectPhoneThemeCsReq> {
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");
}
}
}

View File

@@ -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<SelectPhoneThemeScRsp> implements Cloneable {
private static final long serialVersionUID = 0L;
/**
* <code>optional uint32 cur_phone_theme = 6;</code>
*/
private int curPhoneTheme;
/**
* <code>optional uint32 retcode = 8;</code>
*/
private int retcode;
private SelectPhoneThemeScRsp() {
}
/**
* @return a new empty instance of {@code SelectPhoneThemeScRsp}
*/
public static SelectPhoneThemeScRsp newInstance() {
return new SelectPhoneThemeScRsp();
}
/**
* <code>optional uint32 cur_phone_theme = 6;</code>
* @return whether the curPhoneTheme field is set
*/
public boolean hasCurPhoneTheme() {
return (bitField0_ & 0x00000001) != 0;
}
/**
* <code>optional uint32 cur_phone_theme = 6;</code>
* @return this
*/
public SelectPhoneThemeScRsp clearCurPhoneTheme() {
bitField0_ &= ~0x00000001;
curPhoneTheme = 0;
return this;
}
/**
* <code>optional uint32 cur_phone_theme = 6;</code>
* @return the curPhoneTheme
*/
public int getCurPhoneTheme() {
return curPhoneTheme;
}
/**
* <code>optional uint32 cur_phone_theme = 6;</code>
* @param value the curPhoneTheme to set
* @return this
*/
public SelectPhoneThemeScRsp setCurPhoneTheme(final int value) {
bitField0_ |= 0x00000001;
curPhoneTheme = value;
return this;
}
/**
* <code>optional uint32 retcode = 8;</code>
* @return whether the retcode field is set
*/
public boolean hasRetcode() {
return (bitField0_ & 0x00000002) != 0;
}
/**
* <code>optional uint32 retcode = 8;</code>
* @return this
*/
public SelectPhoneThemeScRsp clearRetcode() {
bitField0_ &= ~0x00000002;
retcode = 0;
return this;
}
/**
* <code>optional uint32 retcode = 8;</code>
* @return the retcode
*/
public int getRetcode() {
return retcode;
}
/**
* <code>optional uint32 retcode = 8;</code>
* @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<SelectPhoneThemeScRsp> getFactory() {
return SelectPhoneThemeScRspFactory.INSTANCE;
}
private enum SelectPhoneThemeScRspFactory implements MessageFactory<SelectPhoneThemeScRsp> {
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");
}
}
}

View File

@@ -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<EquipmentPromotionExcel> equipmentPromotionExcelMap = new Int2ObjectOpenHashMap<>();
private static Int2ObjectMap<MazeBuffExcel> mazeBuffExcelMap = new Int2ObjectOpenHashMap<>();
private static Int2ObjectMap<CocoonExcel> cocoonExcelMap = new Int2ObjectOpenHashMap<>();
private static Int2ObjectMap<ChatBubbleExcel> chatBubbleExcelMap = new Int2ObjectOpenHashMap<>();
private static Int2ObjectMap<PhoneThemeExcel> phoneThemeExcelMap = new Int2ObjectOpenHashMap<>();
private static Int2ObjectMap<MonsterDropExcel> monsterDropExcelMap = new Int2ObjectOpenHashMap<>();
private static Int2ObjectMap<PlayerLevelExcel> playerLevelExcelMap = new Int2ObjectOpenHashMap<>();
@@ -81,6 +85,28 @@ public class GameData {
return map;
}
public static List<Integer> getAllChatBubbleIds() {
List<Integer> allIds = new ArrayList<>();
for (Int2ObjectMap.Entry<ChatBubbleExcel> entry : chatBubbleExcelMap.int2ObjectEntrySet()) {
ChatBubbleExcel chatBubbleExcel = entry.getValue();
allIds.add(chatBubbleExcel.getId());
}
return allIds;
}
public static List<Integer> getAllPhoneThemes() {
List<Integer> allIds = new ArrayList<>();
for (Int2ObjectMap.Entry<PhoneThemeExcel> 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);
}

View File

@@ -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;
}
}

View File

@@ -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;
}
}

View File

@@ -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<Integer> getUnlockedHeadIcons() {
if (this.unlockedHeadIcons == null) {

View File

@@ -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()));
}
}

View File

@@ -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()));
}
}

View File

@@ -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()));
}
}

View File

@@ -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);
}
}

View File

@@ -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);
}
}

View File

@@ -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);
}
}