mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-16 15:24:44 +01:00
General refactoring
This commit is contained in:
@@ -19,9 +19,9 @@ public final class GroupStateChangeCsReqOuterClass {
|
||||
private static final long serialVersionUID = 0L;
|
||||
|
||||
/**
|
||||
* <code>optional .GroupStateInfo group_info = 6;</code>
|
||||
* <code>optional .GroupStateInfo group_state_info = 6;</code>
|
||||
*/
|
||||
private final GroupStateInfoOuterClass.GroupStateInfo groupInfo = GroupStateInfoOuterClass.GroupStateInfo.newInstance();
|
||||
private final GroupStateInfoOuterClass.GroupStateInfo groupStateInfo = GroupStateInfoOuterClass.GroupStateInfo.newInstance();
|
||||
|
||||
private GroupStateChangeCsReq() {
|
||||
}
|
||||
@@ -34,39 +34,39 @@ public final class GroupStateChangeCsReqOuterClass {
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .GroupStateInfo group_info = 6;</code>
|
||||
* @return whether the groupInfo field is set
|
||||
* <code>optional .GroupStateInfo group_state_info = 6;</code>
|
||||
* @return whether the groupStateInfo field is set
|
||||
*/
|
||||
public boolean hasGroupInfo() {
|
||||
public boolean hasGroupStateInfo() {
|
||||
return (bitField0_ & 0x00000001) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .GroupStateInfo group_info = 6;</code>
|
||||
* <code>optional .GroupStateInfo group_state_info = 6;</code>
|
||||
* @return this
|
||||
*/
|
||||
public GroupStateChangeCsReq clearGroupInfo() {
|
||||
public GroupStateChangeCsReq clearGroupStateInfo() {
|
||||
bitField0_ &= ~0x00000001;
|
||||
groupInfo.clear();
|
||||
groupStateInfo.clear();
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .GroupStateInfo group_info = 6;</code>
|
||||
* <code>optional .GroupStateInfo group_state_info = 6;</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 #getMutableGroupInfo()} if you want to modify it.
|
||||
* Use {@link #getMutableGroupStateInfo()} if you want to modify it.
|
||||
*
|
||||
* @return internal storage object for reading
|
||||
*/
|
||||
public GroupStateInfoOuterClass.GroupStateInfo getGroupInfo() {
|
||||
return groupInfo;
|
||||
public GroupStateInfoOuterClass.GroupStateInfo getGroupStateInfo() {
|
||||
return groupStateInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .GroupStateInfo group_info = 6;</code>
|
||||
* <code>optional .GroupStateInfo group_state_info = 6;</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
|
||||
@@ -74,19 +74,20 @@ public final class GroupStateChangeCsReqOuterClass {
|
||||
*
|
||||
* @return internal storage object for modifications
|
||||
*/
|
||||
public GroupStateInfoOuterClass.GroupStateInfo getMutableGroupInfo() {
|
||||
public GroupStateInfoOuterClass.GroupStateInfo getMutableGroupStateInfo() {
|
||||
bitField0_ |= 0x00000001;
|
||||
return groupInfo;
|
||||
return groupStateInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .GroupStateInfo group_info = 6;</code>
|
||||
* @param value the groupInfo to set
|
||||
* <code>optional .GroupStateInfo group_state_info = 6;</code>
|
||||
* @param value the groupStateInfo to set
|
||||
* @return this
|
||||
*/
|
||||
public GroupStateChangeCsReq setGroupInfo(final GroupStateInfoOuterClass.GroupStateInfo value) {
|
||||
public GroupStateChangeCsReq setGroupStateInfo(
|
||||
final GroupStateInfoOuterClass.GroupStateInfo value) {
|
||||
bitField0_ |= 0x00000001;
|
||||
groupInfo.copyFrom(value);
|
||||
groupStateInfo.copyFrom(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -95,7 +96,7 @@ public final class GroupStateChangeCsReqOuterClass {
|
||||
cachedSize = other.cachedSize;
|
||||
if ((bitField0_ | other.bitField0_) != 0) {
|
||||
bitField0_ = other.bitField0_;
|
||||
groupInfo.copyFrom(other.groupInfo);
|
||||
groupStateInfo.copyFrom(other.groupStateInfo);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
@@ -106,8 +107,8 @@ public final class GroupStateChangeCsReqOuterClass {
|
||||
return this;
|
||||
}
|
||||
cachedSize = -1;
|
||||
if (other.hasGroupInfo()) {
|
||||
getMutableGroupInfo().mergeFrom(other.groupInfo);
|
||||
if (other.hasGroupStateInfo()) {
|
||||
getMutableGroupStateInfo().mergeFrom(other.groupStateInfo);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
@@ -119,7 +120,7 @@ public final class GroupStateChangeCsReqOuterClass {
|
||||
}
|
||||
cachedSize = -1;
|
||||
bitField0_ = 0;
|
||||
groupInfo.clear();
|
||||
groupStateInfo.clear();
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -130,7 +131,7 @@ public final class GroupStateChangeCsReqOuterClass {
|
||||
}
|
||||
cachedSize = -1;
|
||||
bitField0_ = 0;
|
||||
groupInfo.clearQuick();
|
||||
groupStateInfo.clearQuick();
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -144,14 +145,14 @@ public final class GroupStateChangeCsReqOuterClass {
|
||||
}
|
||||
GroupStateChangeCsReq other = (GroupStateChangeCsReq) o;
|
||||
return bitField0_ == other.bitField0_
|
||||
&& (!hasGroupInfo() || groupInfo.equals(other.groupInfo));
|
||||
&& (!hasGroupStateInfo() || groupStateInfo.equals(other.groupStateInfo));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTo(final ProtoSink output) throws IOException {
|
||||
if ((bitField0_ & 0x00000001) != 0) {
|
||||
output.writeRawByte((byte) 50);
|
||||
output.writeMessageNoTag(groupInfo);
|
||||
output.writeMessageNoTag(groupStateInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,7 +160,7 @@ public final class GroupStateChangeCsReqOuterClass {
|
||||
protected int computeSerializedSize() {
|
||||
int size = 0;
|
||||
if ((bitField0_ & 0x00000001) != 0) {
|
||||
size += 1 + ProtoSink.computeMessageSizeNoTag(groupInfo);
|
||||
size += 1 + ProtoSink.computeMessageSizeNoTag(groupStateInfo);
|
||||
}
|
||||
return size;
|
||||
}
|
||||
@@ -172,8 +173,8 @@ public final class GroupStateChangeCsReqOuterClass {
|
||||
while (true) {
|
||||
switch (tag) {
|
||||
case 50: {
|
||||
// groupInfo
|
||||
input.readMessage(groupInfo);
|
||||
// groupStateInfo
|
||||
input.readMessage(groupStateInfo);
|
||||
bitField0_ |= 0x00000001;
|
||||
tag = input.readTag();
|
||||
if (tag != 0) {
|
||||
@@ -198,7 +199,7 @@ public final class GroupStateChangeCsReqOuterClass {
|
||||
public void writeTo(final JsonSink output) throws IOException {
|
||||
output.beginObject();
|
||||
if ((bitField0_ & 0x00000001) != 0) {
|
||||
output.writeMessage(FieldNames.groupInfo, groupInfo);
|
||||
output.writeMessage(FieldNames.groupStateInfo, groupStateInfo);
|
||||
}
|
||||
output.endObject();
|
||||
}
|
||||
@@ -210,11 +211,11 @@ public final class GroupStateChangeCsReqOuterClass {
|
||||
}
|
||||
while (!input.isAtEnd()) {
|
||||
switch (input.readFieldHash()) {
|
||||
case -1483311155:
|
||||
case 1282170478: {
|
||||
if (input.isAtField(FieldNames.groupInfo)) {
|
||||
case 1415312672:
|
||||
case 1198732636: {
|
||||
if (input.isAtField(FieldNames.groupStateInfo)) {
|
||||
if (!input.trySkipNullValue()) {
|
||||
input.readMessage(groupInfo);
|
||||
input.readMessage(groupStateInfo);
|
||||
bitField0_ |= 0x00000001;
|
||||
}
|
||||
} else {
|
||||
@@ -275,7 +276,7 @@ public final class GroupStateChangeCsReqOuterClass {
|
||||
* Contains name constants used for serializing JSON
|
||||
*/
|
||||
static class FieldNames {
|
||||
static final FieldName groupInfo = FieldName.forField("groupInfo", "group_info");
|
||||
static final FieldName groupStateInfo = FieldName.forField("groupStateInfo", "group_state_info");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,9 +19,9 @@ public final class GroupStateChangeScNotifyOuterClass {
|
||||
private static final long serialVersionUID = 0L;
|
||||
|
||||
/**
|
||||
* <code>optional .GroupStateInfo group_info = 8;</code>
|
||||
* <code>optional .GroupStateInfo group_state_info = 8;</code>
|
||||
*/
|
||||
private final GroupStateInfoOuterClass.GroupStateInfo groupInfo = GroupStateInfoOuterClass.GroupStateInfo.newInstance();
|
||||
private final GroupStateInfoOuterClass.GroupStateInfo groupStateInfo = GroupStateInfoOuterClass.GroupStateInfo.newInstance();
|
||||
|
||||
private GroupStateChangeScNotify() {
|
||||
}
|
||||
@@ -34,39 +34,39 @@ public final class GroupStateChangeScNotifyOuterClass {
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .GroupStateInfo group_info = 8;</code>
|
||||
* @return whether the groupInfo field is set
|
||||
* <code>optional .GroupStateInfo group_state_info = 8;</code>
|
||||
* @return whether the groupStateInfo field is set
|
||||
*/
|
||||
public boolean hasGroupInfo() {
|
||||
public boolean hasGroupStateInfo() {
|
||||
return (bitField0_ & 0x00000001) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .GroupStateInfo group_info = 8;</code>
|
||||
* <code>optional .GroupStateInfo group_state_info = 8;</code>
|
||||
* @return this
|
||||
*/
|
||||
public GroupStateChangeScNotify clearGroupInfo() {
|
||||
public GroupStateChangeScNotify clearGroupStateInfo() {
|
||||
bitField0_ &= ~0x00000001;
|
||||
groupInfo.clear();
|
||||
groupStateInfo.clear();
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .GroupStateInfo group_info = 8;</code>
|
||||
* <code>optional .GroupStateInfo group_state_info = 8;</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 #getMutableGroupInfo()} if you want to modify it.
|
||||
* Use {@link #getMutableGroupStateInfo()} if you want to modify it.
|
||||
*
|
||||
* @return internal storage object for reading
|
||||
*/
|
||||
public GroupStateInfoOuterClass.GroupStateInfo getGroupInfo() {
|
||||
return groupInfo;
|
||||
public GroupStateInfoOuterClass.GroupStateInfo getGroupStateInfo() {
|
||||
return groupStateInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .GroupStateInfo group_info = 8;</code>
|
||||
* <code>optional .GroupStateInfo group_state_info = 8;</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
|
||||
@@ -74,20 +74,20 @@ public final class GroupStateChangeScNotifyOuterClass {
|
||||
*
|
||||
* @return internal storage object for modifications
|
||||
*/
|
||||
public GroupStateInfoOuterClass.GroupStateInfo getMutableGroupInfo() {
|
||||
public GroupStateInfoOuterClass.GroupStateInfo getMutableGroupStateInfo() {
|
||||
bitField0_ |= 0x00000001;
|
||||
return groupInfo;
|
||||
return groupStateInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .GroupStateInfo group_info = 8;</code>
|
||||
* @param value the groupInfo to set
|
||||
* <code>optional .GroupStateInfo group_state_info = 8;</code>
|
||||
* @param value the groupStateInfo to set
|
||||
* @return this
|
||||
*/
|
||||
public GroupStateChangeScNotify setGroupInfo(
|
||||
public GroupStateChangeScNotify setGroupStateInfo(
|
||||
final GroupStateInfoOuterClass.GroupStateInfo value) {
|
||||
bitField0_ |= 0x00000001;
|
||||
groupInfo.copyFrom(value);
|
||||
groupStateInfo.copyFrom(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ public final class GroupStateChangeScNotifyOuterClass {
|
||||
cachedSize = other.cachedSize;
|
||||
if ((bitField0_ | other.bitField0_) != 0) {
|
||||
bitField0_ = other.bitField0_;
|
||||
groupInfo.copyFrom(other.groupInfo);
|
||||
groupStateInfo.copyFrom(other.groupStateInfo);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
@@ -107,8 +107,8 @@ public final class GroupStateChangeScNotifyOuterClass {
|
||||
return this;
|
||||
}
|
||||
cachedSize = -1;
|
||||
if (other.hasGroupInfo()) {
|
||||
getMutableGroupInfo().mergeFrom(other.groupInfo);
|
||||
if (other.hasGroupStateInfo()) {
|
||||
getMutableGroupStateInfo().mergeFrom(other.groupStateInfo);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
@@ -120,7 +120,7 @@ public final class GroupStateChangeScNotifyOuterClass {
|
||||
}
|
||||
cachedSize = -1;
|
||||
bitField0_ = 0;
|
||||
groupInfo.clear();
|
||||
groupStateInfo.clear();
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ public final class GroupStateChangeScNotifyOuterClass {
|
||||
}
|
||||
cachedSize = -1;
|
||||
bitField0_ = 0;
|
||||
groupInfo.clearQuick();
|
||||
groupStateInfo.clearQuick();
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -145,14 +145,14 @@ public final class GroupStateChangeScNotifyOuterClass {
|
||||
}
|
||||
GroupStateChangeScNotify other = (GroupStateChangeScNotify) o;
|
||||
return bitField0_ == other.bitField0_
|
||||
&& (!hasGroupInfo() || groupInfo.equals(other.groupInfo));
|
||||
&& (!hasGroupStateInfo() || groupStateInfo.equals(other.groupStateInfo));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTo(final ProtoSink output) throws IOException {
|
||||
if ((bitField0_ & 0x00000001) != 0) {
|
||||
output.writeRawByte((byte) 66);
|
||||
output.writeMessageNoTag(groupInfo);
|
||||
output.writeMessageNoTag(groupStateInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ public final class GroupStateChangeScNotifyOuterClass {
|
||||
protected int computeSerializedSize() {
|
||||
int size = 0;
|
||||
if ((bitField0_ & 0x00000001) != 0) {
|
||||
size += 1 + ProtoSink.computeMessageSizeNoTag(groupInfo);
|
||||
size += 1 + ProtoSink.computeMessageSizeNoTag(groupStateInfo);
|
||||
}
|
||||
return size;
|
||||
}
|
||||
@@ -173,8 +173,8 @@ public final class GroupStateChangeScNotifyOuterClass {
|
||||
while (true) {
|
||||
switch (tag) {
|
||||
case 66: {
|
||||
// groupInfo
|
||||
input.readMessage(groupInfo);
|
||||
// groupStateInfo
|
||||
input.readMessage(groupStateInfo);
|
||||
bitField0_ |= 0x00000001;
|
||||
tag = input.readTag();
|
||||
if (tag != 0) {
|
||||
@@ -199,7 +199,7 @@ public final class GroupStateChangeScNotifyOuterClass {
|
||||
public void writeTo(final JsonSink output) throws IOException {
|
||||
output.beginObject();
|
||||
if ((bitField0_ & 0x00000001) != 0) {
|
||||
output.writeMessage(FieldNames.groupInfo, groupInfo);
|
||||
output.writeMessage(FieldNames.groupStateInfo, groupStateInfo);
|
||||
}
|
||||
output.endObject();
|
||||
}
|
||||
@@ -211,11 +211,11 @@ public final class GroupStateChangeScNotifyOuterClass {
|
||||
}
|
||||
while (!input.isAtEnd()) {
|
||||
switch (input.readFieldHash()) {
|
||||
case -1483311155:
|
||||
case 1282170478: {
|
||||
if (input.isAtField(FieldNames.groupInfo)) {
|
||||
case 1415312672:
|
||||
case 1198732636: {
|
||||
if (input.isAtField(FieldNames.groupStateInfo)) {
|
||||
if (!input.trySkipNullValue()) {
|
||||
input.readMessage(groupInfo);
|
||||
input.readMessage(groupStateInfo);
|
||||
bitField0_ |= 0x00000001;
|
||||
}
|
||||
} else {
|
||||
@@ -276,7 +276,7 @@ public final class GroupStateChangeScNotifyOuterClass {
|
||||
* Contains name constants used for serializing JSON
|
||||
*/
|
||||
static class FieldNames {
|
||||
static final FieldName groupInfo = FieldName.forField("groupInfo", "group_info");
|
||||
static final FieldName groupStateInfo = FieldName.forField("groupStateInfo", "group_state_info");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,9 +24,9 @@ public final class GroupStateChangeScRspOuterClass {
|
||||
private int retcode;
|
||||
|
||||
/**
|
||||
* <code>optional .GroupStateInfo group_info = 3;</code>
|
||||
* <code>optional .GroupStateInfo group_state_info = 3;</code>
|
||||
*/
|
||||
private final GroupStateInfoOuterClass.GroupStateInfo groupInfo = GroupStateInfoOuterClass.GroupStateInfo.newInstance();
|
||||
private final GroupStateInfoOuterClass.GroupStateInfo groupStateInfo = GroupStateInfoOuterClass.GroupStateInfo.newInstance();
|
||||
|
||||
private GroupStateChangeScRsp() {
|
||||
}
|
||||
@@ -76,39 +76,39 @@ public final class GroupStateChangeScRspOuterClass {
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .GroupStateInfo group_info = 3;</code>
|
||||
* @return whether the groupInfo field is set
|
||||
* <code>optional .GroupStateInfo group_state_info = 3;</code>
|
||||
* @return whether the groupStateInfo field is set
|
||||
*/
|
||||
public boolean hasGroupInfo() {
|
||||
public boolean hasGroupStateInfo() {
|
||||
return (bitField0_ & 0x00000002) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .GroupStateInfo group_info = 3;</code>
|
||||
* <code>optional .GroupStateInfo group_state_info = 3;</code>
|
||||
* @return this
|
||||
*/
|
||||
public GroupStateChangeScRsp clearGroupInfo() {
|
||||
public GroupStateChangeScRsp clearGroupStateInfo() {
|
||||
bitField0_ &= ~0x00000002;
|
||||
groupInfo.clear();
|
||||
groupStateInfo.clear();
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .GroupStateInfo group_info = 3;</code>
|
||||
* <code>optional .GroupStateInfo group_state_info = 3;</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 #getMutableGroupInfo()} if you want to modify it.
|
||||
* Use {@link #getMutableGroupStateInfo()} if you want to modify it.
|
||||
*
|
||||
* @return internal storage object for reading
|
||||
*/
|
||||
public GroupStateInfoOuterClass.GroupStateInfo getGroupInfo() {
|
||||
return groupInfo;
|
||||
public GroupStateInfoOuterClass.GroupStateInfo getGroupStateInfo() {
|
||||
return groupStateInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .GroupStateInfo group_info = 3;</code>
|
||||
* <code>optional .GroupStateInfo group_state_info = 3;</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
|
||||
@@ -116,19 +116,20 @@ public final class GroupStateChangeScRspOuterClass {
|
||||
*
|
||||
* @return internal storage object for modifications
|
||||
*/
|
||||
public GroupStateInfoOuterClass.GroupStateInfo getMutableGroupInfo() {
|
||||
public GroupStateInfoOuterClass.GroupStateInfo getMutableGroupStateInfo() {
|
||||
bitField0_ |= 0x00000002;
|
||||
return groupInfo;
|
||||
return groupStateInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* <code>optional .GroupStateInfo group_info = 3;</code>
|
||||
* @param value the groupInfo to set
|
||||
* <code>optional .GroupStateInfo group_state_info = 3;</code>
|
||||
* @param value the groupStateInfo to set
|
||||
* @return this
|
||||
*/
|
||||
public GroupStateChangeScRsp setGroupInfo(final GroupStateInfoOuterClass.GroupStateInfo value) {
|
||||
public GroupStateChangeScRsp setGroupStateInfo(
|
||||
final GroupStateInfoOuterClass.GroupStateInfo value) {
|
||||
bitField0_ |= 0x00000002;
|
||||
groupInfo.copyFrom(value);
|
||||
groupStateInfo.copyFrom(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -138,7 +139,7 @@ public final class GroupStateChangeScRspOuterClass {
|
||||
if ((bitField0_ | other.bitField0_) != 0) {
|
||||
bitField0_ = other.bitField0_;
|
||||
retcode = other.retcode;
|
||||
groupInfo.copyFrom(other.groupInfo);
|
||||
groupStateInfo.copyFrom(other.groupStateInfo);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
@@ -152,8 +153,8 @@ public final class GroupStateChangeScRspOuterClass {
|
||||
if (other.hasRetcode()) {
|
||||
setRetcode(other.retcode);
|
||||
}
|
||||
if (other.hasGroupInfo()) {
|
||||
getMutableGroupInfo().mergeFrom(other.groupInfo);
|
||||
if (other.hasGroupStateInfo()) {
|
||||
getMutableGroupStateInfo().mergeFrom(other.groupStateInfo);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
@@ -166,7 +167,7 @@ public final class GroupStateChangeScRspOuterClass {
|
||||
cachedSize = -1;
|
||||
bitField0_ = 0;
|
||||
retcode = 0;
|
||||
groupInfo.clear();
|
||||
groupStateInfo.clear();
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -177,7 +178,7 @@ public final class GroupStateChangeScRspOuterClass {
|
||||
}
|
||||
cachedSize = -1;
|
||||
bitField0_ = 0;
|
||||
groupInfo.clearQuick();
|
||||
groupStateInfo.clearQuick();
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -192,7 +193,7 @@ public final class GroupStateChangeScRspOuterClass {
|
||||
GroupStateChangeScRsp other = (GroupStateChangeScRsp) o;
|
||||
return bitField0_ == other.bitField0_
|
||||
&& (!hasRetcode() || retcode == other.retcode)
|
||||
&& (!hasGroupInfo() || groupInfo.equals(other.groupInfo));
|
||||
&& (!hasGroupStateInfo() || groupStateInfo.equals(other.groupStateInfo));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -203,7 +204,7 @@ public final class GroupStateChangeScRspOuterClass {
|
||||
}
|
||||
if ((bitField0_ & 0x00000002) != 0) {
|
||||
output.writeRawByte((byte) 26);
|
||||
output.writeMessageNoTag(groupInfo);
|
||||
output.writeMessageNoTag(groupStateInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -214,7 +215,7 @@ public final class GroupStateChangeScRspOuterClass {
|
||||
size += 1 + ProtoSink.computeUInt32SizeNoTag(retcode);
|
||||
}
|
||||
if ((bitField0_ & 0x00000002) != 0) {
|
||||
size += 1 + ProtoSink.computeMessageSizeNoTag(groupInfo);
|
||||
size += 1 + ProtoSink.computeMessageSizeNoTag(groupStateInfo);
|
||||
}
|
||||
return size;
|
||||
}
|
||||
@@ -236,8 +237,8 @@ public final class GroupStateChangeScRspOuterClass {
|
||||
}
|
||||
}
|
||||
case 26: {
|
||||
// groupInfo
|
||||
input.readMessage(groupInfo);
|
||||
// groupStateInfo
|
||||
input.readMessage(groupStateInfo);
|
||||
bitField0_ |= 0x00000002;
|
||||
tag = input.readTag();
|
||||
if (tag != 0) {
|
||||
@@ -265,7 +266,7 @@ public final class GroupStateChangeScRspOuterClass {
|
||||
output.writeUInt32(FieldNames.retcode, retcode);
|
||||
}
|
||||
if ((bitField0_ & 0x00000002) != 0) {
|
||||
output.writeMessage(FieldNames.groupInfo, groupInfo);
|
||||
output.writeMessage(FieldNames.groupStateInfo, groupStateInfo);
|
||||
}
|
||||
output.endObject();
|
||||
}
|
||||
@@ -288,11 +289,11 @@ public final class GroupStateChangeScRspOuterClass {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case -1483311155:
|
||||
case 1282170478: {
|
||||
if (input.isAtField(FieldNames.groupInfo)) {
|
||||
case 1415312672:
|
||||
case 1198732636: {
|
||||
if (input.isAtField(FieldNames.groupStateInfo)) {
|
||||
if (!input.trySkipNullValue()) {
|
||||
input.readMessage(groupInfo);
|
||||
input.readMessage(groupStateInfo);
|
||||
bitField0_ |= 0x00000002;
|
||||
}
|
||||
} else {
|
||||
@@ -355,7 +356,7 @@ public final class GroupStateChangeScRspOuterClass {
|
||||
static class FieldNames {
|
||||
static final FieldName retcode = FieldName.forField("retcode");
|
||||
|
||||
static final FieldName groupInfo = FieldName.forField("groupInfo", "group_info");
|
||||
static final FieldName groupStateInfo = FieldName.forField("groupStateInfo", "group_state_info");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,8 +71,8 @@ public class CommandArgs {
|
||||
if (this.flags == null) this.flags = new ObjectOpenHashSet<>();
|
||||
this.flags.add(arg);
|
||||
it.remove();
|
||||
} else if (arg.contains(":")) {
|
||||
String[] split = arg.split(":");
|
||||
} else if (arg.contains(":") || arg.contains(",")) {
|
||||
String[] split = arg.split("[:,]");
|
||||
if (split.length >= 2) {
|
||||
int key = Integer.parseInt(split[0]);
|
||||
int value = Integer.parseInt(split[1]);
|
||||
|
||||
@@ -7,7 +7,6 @@ import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import emu.lunarcore.game.enums.PropState;
|
||||
import emu.lunarcore.game.scene.triggers.TriggerOpenTreasureWhenMonsterDie;
|
||||
import emu.lunarcore.game.scene.triggers.TriggerPuzzleCompassWayPointController;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
|
||||
@@ -72,8 +71,6 @@ public class FloorInfo {
|
||||
// Hacky way to setup prop triggers
|
||||
if (json.contains("Maze_GroupProp_OpenTreasure_WhenMonsterDie")) {
|
||||
prop.setTrigger(new TriggerOpenTreasureWhenMonsterDie(group.getId()));
|
||||
} else if (json.contains("Maze_Chap02_X201_Event_PuzzleCompass_WayPoint_Controller")) {
|
||||
prop.setTrigger(new TriggerPuzzleCompassWayPointController(group.getId()));
|
||||
}
|
||||
|
||||
// Clear for garbage collection
|
||||
|
||||
@@ -23,6 +23,10 @@ public class CocoonExcel extends GameResource {
|
||||
return (ID << 8) + WorldLevel;
|
||||
}
|
||||
|
||||
public int getCocoonId() {
|
||||
return ID;
|
||||
}
|
||||
|
||||
public int getRandomStage() {
|
||||
return Utils.randomElement(StageIDList);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package emu.lunarcore.game.battle;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import emu.lunarcore.GameConstants;
|
||||
import emu.lunarcore.data.GameData;
|
||||
@@ -12,7 +13,9 @@ import emu.lunarcore.game.inventory.GameItem;
|
||||
import emu.lunarcore.game.player.Player;
|
||||
import emu.lunarcore.game.player.lineup.PlayerLineup;
|
||||
import emu.lunarcore.game.scene.entity.EntityMonster;
|
||||
import emu.lunarcore.proto.BattleEndStatusOuterClass.BattleEndStatus;
|
||||
import emu.lunarcore.proto.BattleEventBattleInfoOuterClass.BattleEventBattleInfo;
|
||||
import emu.lunarcore.proto.BattleStatisticsOuterClass.BattleStatistics;
|
||||
import emu.lunarcore.proto.SceneBattleInfoOuterClass.SceneBattleInfo;
|
||||
import emu.lunarcore.util.Utils;
|
||||
import it.unimi.dsi.fastutil.ints.IntArrayList;
|
||||
@@ -32,8 +35,10 @@ public class Battle {
|
||||
private final long timestamp;
|
||||
|
||||
private StageExcel stage; // Main battle stage
|
||||
private IntList turnSnapshotList; // TODO maybe turn it into a map?
|
||||
private IntList battleEvents; // TODO maybe turn it into a map?
|
||||
|
||||
// Internal battle data
|
||||
@Setter private BattleEndStatus result;
|
||||
@Setter private int staminaCost;
|
||||
@Setter private int roundsLimit;
|
||||
|
||||
@@ -42,6 +47,9 @@ public class Battle {
|
||||
@Setter private int worldLevel;
|
||||
@Setter private int cocoonWave;
|
||||
|
||||
// OnFinish Callback
|
||||
@Setter private Consumer<BattleStatistics> onFinish;
|
||||
|
||||
private Battle(Player player, PlayerLineup lineup) {
|
||||
this.id = player.getNextBattleId();
|
||||
this.player = player;
|
||||
@@ -54,10 +62,17 @@ public class Battle {
|
||||
}
|
||||
|
||||
public Battle(Player player, PlayerLineup lineup, StageExcel stage) {
|
||||
this(player, lineup, stage, true);
|
||||
}
|
||||
|
||||
public Battle(Player player, PlayerLineup lineup, StageExcel stage, boolean loadStage) {
|
||||
this(player, lineup);
|
||||
this.stage = stage;
|
||||
|
||||
if (loadStage) {
|
||||
this.loadStage(stage);
|
||||
}
|
||||
}
|
||||
|
||||
public Battle(Player player, PlayerLineup lineup, List<StageExcel> stages) {
|
||||
this(player, lineup);
|
||||
@@ -122,11 +137,11 @@ public class Battle {
|
||||
}
|
||||
}
|
||||
|
||||
public IntList getTurnSnapshotList() {
|
||||
if (this.turnSnapshotList == null) {
|
||||
this.turnSnapshotList = new IntArrayList();
|
||||
public IntList getBattleEvents() {
|
||||
if (this.battleEvents == null) {
|
||||
this.battleEvents = new IntArrayList();
|
||||
}
|
||||
return this.turnSnapshotList;
|
||||
return this.battleEvents;
|
||||
}
|
||||
|
||||
public void setCustomLevel(int level) {
|
||||
@@ -216,8 +231,8 @@ public class Battle {
|
||||
}
|
||||
|
||||
// Client turn snapshots
|
||||
if (this.turnSnapshotList != null) {
|
||||
for (int id : this.turnSnapshotList) {
|
||||
if (this.battleEvents != null) {
|
||||
for (int id : this.battleEvents) {
|
||||
var event = BattleEventBattleInfo.newInstance()
|
||||
.setBattleEventId(id);
|
||||
|
||||
|
||||
@@ -225,6 +225,7 @@ public class BattleService extends BaseGameService {
|
||||
|
||||
// Get battle object and setup variables
|
||||
Battle battle = player.getBattle();
|
||||
battle.setResult(result);
|
||||
int minimumHp = 0;
|
||||
|
||||
boolean updateStatus = true;
|
||||
@@ -311,6 +312,11 @@ public class BattleService extends BaseGameService {
|
||||
player.getRogueInstance().onBattleFinish(battle, result, stats);
|
||||
}
|
||||
|
||||
// Battle callback
|
||||
if (battle.getOnFinish() != null) {
|
||||
battle.getOnFinish().accept(stats);
|
||||
}
|
||||
|
||||
// Done - Clear battle object from player
|
||||
player.setBattle(null);
|
||||
return battle;
|
||||
|
||||
@@ -29,6 +29,7 @@ import emu.lunarcore.game.chat.ChatManager;
|
||||
import emu.lunarcore.game.chat.ChatMessage;
|
||||
import emu.lunarcore.game.enums.PlaneType;
|
||||
import emu.lunarcore.game.enums.PropState;
|
||||
import emu.lunarcore.game.enums.PropType;
|
||||
import emu.lunarcore.game.friends.FriendList;
|
||||
import emu.lunarcore.game.friends.Friendship;
|
||||
import emu.lunarcore.game.gacha.PlayerGachaInfo;
|
||||
@@ -46,7 +47,6 @@ import emu.lunarcore.game.scene.Scene;
|
||||
import emu.lunarcore.game.scene.SceneBuff;
|
||||
import emu.lunarcore.game.scene.entity.EntityProp;
|
||||
import emu.lunarcore.game.scene.entity.GameEntity;
|
||||
import emu.lunarcore.game.scene.triggers.PropTriggerType;
|
||||
import emu.lunarcore.proto.BoardDataSyncOuterClass.BoardDataSync;
|
||||
import emu.lunarcore.proto.FriendOnlineStatusOuterClass.FriendOnlineStatus;
|
||||
import emu.lunarcore.proto.HeadIconOuterClass.HeadIcon;
|
||||
@@ -606,15 +606,16 @@ public class Player implements Tickable {
|
||||
|
||||
// Save old state
|
||||
PropState oldState = prop.getState();
|
||||
PropState newState = interactExcel.getTargetState();
|
||||
|
||||
// Set group and prop state
|
||||
this.sendPacket(new PacketGroupStateChangeScNotify(getEntryId(), prop.getGroupId(), interactExcel.getTargetState()));
|
||||
prop.setState(interactExcel.getTargetState());
|
||||
this.sendPacket(new PacketGroupStateChangeScNotify(getEntryId(), prop.getGroupId(), newState));
|
||||
prop.setState(newState);
|
||||
|
||||
// Handle any extra interaction actions
|
||||
switch (prop.getExcel().getPropType()) {
|
||||
case PROP_TREASURE_CHEST -> {
|
||||
if (oldState == PropState.ChestClosed && prop.getState() == PropState.ChestUsed) {
|
||||
if (oldState == PropState.ChestClosed && newState == PropState.ChestUsed) {
|
||||
// Handle drops
|
||||
var drops = this.getServer().getDropService().calculateDropsFromProp(prop.getPropId());
|
||||
this.getInventory().addItems(drops, true);
|
||||
@@ -622,10 +623,21 @@ public class Player implements Tickable {
|
||||
}
|
||||
case PROP_MAZE_PUZZLE -> {
|
||||
// Trigger event
|
||||
this.getScene().invokePropTrigger(PropTriggerType.PUZZLE_FINISH, prop.getGroupId(), prop.getInstId());
|
||||
if (newState == PropState.Open || newState == PropState.Closed) {
|
||||
// Unlock everything in the prop's group
|
||||
for (var p : getScene().getEntitiesByGroup(EntityProp.class, prop.getGroupId())) {
|
||||
if (p.getPropType() == PropType.PROP_TREASURE_CHEST) {
|
||||
p.setState(PropState.ChestClosed);
|
||||
} else if (p.getPropType() == PropType.PROP_MAZE_PUZZLE) {
|
||||
// Skip
|
||||
} else {
|
||||
p.setState(PropState.Open);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
default -> {
|
||||
|
||||
// Skip
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package emu.lunarcore.game.player.lineup;
|
||||
|
||||
import emu.lunarcore.game.player.Player;
|
||||
|
||||
public class PlayerTempLineup extends PlayerExtraLineup {
|
||||
|
||||
public PlayerTempLineup(Player player) {
|
||||
super(player, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save() {
|
||||
// Ignored
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete() {
|
||||
// Ignored
|
||||
}
|
||||
}
|
||||
@@ -325,7 +325,7 @@ public class RogueInstance {
|
||||
if (buff.getExcel().getBattleEventBuffType() == RogueBuffAeonType.BattleEventBuff) {
|
||||
RogueBuffType type = RogueBuffType.getById(getAeonBuffType());
|
||||
if (type != null && type.getBattleEventSkill() != 0) {
|
||||
battle.getTurnSnapshotList().add(type.getBattleEventSkill());
|
||||
battle.getBattleEvents().add(type.getBattleEventSkill());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import emu.lunarcore.data.config.GroupInfo;
|
||||
import emu.lunarcore.data.config.PropInfo;
|
||||
import emu.lunarcore.data.excel.PropExcel;
|
||||
import emu.lunarcore.game.enums.PropState;
|
||||
import emu.lunarcore.game.enums.PropType;
|
||||
import emu.lunarcore.game.scene.Scene;
|
||||
import emu.lunarcore.game.scene.entity.extra.PropRogueData;
|
||||
import emu.lunarcore.proto.MotionInfoOuterClass.MotionInfo;
|
||||
@@ -54,6 +55,10 @@ public class EntityProp implements GameEntity {
|
||||
return excel.getId();
|
||||
}
|
||||
|
||||
public PropType getPropType() {
|
||||
return getExcel().getPropType();
|
||||
}
|
||||
|
||||
public boolean setState(PropState state) {
|
||||
return this.setState(state, this.getScene().isLoaded());
|
||||
}
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
package emu.lunarcore.game.scene.triggers;
|
||||
|
||||
import emu.lunarcore.game.enums.PropState;
|
||||
import emu.lunarcore.game.scene.Scene;
|
||||
import emu.lunarcore.game.scene.entity.EntityProp;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public class TriggerPuzzleCompassWayPointController extends PropTrigger {
|
||||
private int groupId;
|
||||
|
||||
public TriggerPuzzleCompassWayPointController(int groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PropTriggerType getType() {
|
||||
return PropTriggerType.PUZZLE_FINISH;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRun(int groupId, int instId) {
|
||||
return this.groupId == groupId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(Scene scene) {
|
||||
for (var prop : scene.getEntitiesByGroup(EntityProp.class, groupId)) {
|
||||
prop.setState(PropState.Open);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,10 +14,10 @@ public class HandlerGroupStateChangeCsReq extends PacketHandler {
|
||||
@Override
|
||||
public void handle(GameSession session, byte[] data) throws Exception {
|
||||
var req = GroupStateChangeCsReq.parseFrom(data);
|
||||
var groupInfo = req.getMutableGroupInfo();
|
||||
var groupStateInfo = req.getMutableGroupStateInfo();
|
||||
|
||||
session.send(new PacketGroupStateChangeScNotify(groupInfo));
|
||||
session.send(new PacketGroupStateChangeScRsp(groupInfo));
|
||||
session.send(new PacketGroupStateChangeScNotify(groupStateInfo));
|
||||
session.send(new PacketGroupStateChangeScRsp(groupStateInfo));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ public class PacketGroupStateChangeScNotify extends BasePacket {
|
||||
super(CmdId.GroupStateChangeScNotify);
|
||||
|
||||
var data = GroupStateChangeScNotify.newInstance();
|
||||
data.setGroupInfo(groupInfo);
|
||||
data.setGroupStateInfo(groupInfo);
|
||||
|
||||
this.setData(data);
|
||||
}
|
||||
@@ -22,7 +22,7 @@ public class PacketGroupStateChangeScNotify extends BasePacket {
|
||||
|
||||
var data = GroupStateChangeScNotify.newInstance();
|
||||
|
||||
data.getMutableGroupInfo()
|
||||
data.getMutableGroupStateInfo()
|
||||
.setEntryId(entryId)
|
||||
.setGroupId(groupId)
|
||||
.setGroupState(state.getVal());
|
||||
|
||||
@@ -11,7 +11,7 @@ public class PacketGroupStateChangeScRsp extends BasePacket {
|
||||
super(CmdId.GroupStateChangeScRsp);
|
||||
|
||||
var data = GroupStateChangeScNotify.newInstance();
|
||||
data.setGroupInfo(groupInfo);
|
||||
data.setGroupStateInfo(groupInfo);
|
||||
|
||||
this.setData(data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user