mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-26 22:32:57 +08:00
Merge branch 'fixmail' into unstable
# Conflicts: # src/main/java/emu/grasscutter/game/mail/Mail.java # src/main/java/emu/grasscutter/net/packet/PacketOpcodes.java # src/main/java/emu/grasscutter/server/packet/recv/HandlerGetAllMailReq.java # src/main/java/emu/grasscutter/server/packet/send/PacketGetAllMailRsp.java # src/main/java/emu/grasscutter/utils/Utils.java
This commit is contained in:
commit
95e1d77b65
@ -0,0 +1,547 @@
|
|||||||
|
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||||
|
// source: GetAllMailNotify.proto
|
||||||
|
|
||||||
|
package emu.grasscutter.net.proto;
|
||||||
|
|
||||||
|
public final class GetAllMailNotifyOuterClass {
|
||||||
|
private GetAllMailNotifyOuterClass() {}
|
||||||
|
public static void registerAllExtensions(
|
||||||
|
com.google.protobuf.ExtensionRegistryLite registry) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void registerAllExtensions(
|
||||||
|
com.google.protobuf.ExtensionRegistry registry) {
|
||||||
|
registerAllExtensions(
|
||||||
|
(com.google.protobuf.ExtensionRegistryLite) registry);
|
||||||
|
}
|
||||||
|
public interface GetAllMailNotifyOrBuilder extends
|
||||||
|
// @@protoc_insertion_point(interface_extends:GetAllMailNotify)
|
||||||
|
com.google.protobuf.MessageOrBuilder {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <code>bool is_collected = 6;</code>
|
||||||
|
* @return The isCollected.
|
||||||
|
*/
|
||||||
|
boolean getIsCollected();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* Name: PFHIOOMPNBH
|
||||||
|
* CmdId: 1442
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* Protobuf type {@code GetAllMailNotify}
|
||||||
|
*/
|
||||||
|
public static final class GetAllMailNotify extends
|
||||||
|
com.google.protobuf.GeneratedMessageV3 implements
|
||||||
|
// @@protoc_insertion_point(message_implements:GetAllMailNotify)
|
||||||
|
GetAllMailNotifyOrBuilder {
|
||||||
|
private static final long serialVersionUID = 0L;
|
||||||
|
// Use GetAllMailNotify.newBuilder() to construct.
|
||||||
|
private GetAllMailNotify(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
|
||||||
|
super(builder);
|
||||||
|
}
|
||||||
|
private GetAllMailNotify() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
@SuppressWarnings({"unused"})
|
||||||
|
protected java.lang.Object newInstance(
|
||||||
|
UnusedPrivateParameter unused) {
|
||||||
|
return new GetAllMailNotify();
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public final com.google.protobuf.UnknownFieldSet
|
||||||
|
getUnknownFields() {
|
||||||
|
return this.unknownFields;
|
||||||
|
}
|
||||||
|
private GetAllMailNotify(
|
||||||
|
com.google.protobuf.CodedInputStream input,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
this();
|
||||||
|
if (extensionRegistry == null) {
|
||||||
|
throw new java.lang.NullPointerException();
|
||||||
|
}
|
||||||
|
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
|
||||||
|
com.google.protobuf.UnknownFieldSet.newBuilder();
|
||||||
|
try {
|
||||||
|
boolean done = false;
|
||||||
|
while (!done) {
|
||||||
|
int tag = input.readTag();
|
||||||
|
switch (tag) {
|
||||||
|
case 0:
|
||||||
|
done = true;
|
||||||
|
break;
|
||||||
|
case 48: {
|
||||||
|
|
||||||
|
isCollected_ = input.readBool();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
if (!parseUnknownField(
|
||||||
|
input, unknownFields, extensionRegistry, tag)) {
|
||||||
|
done = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||||
|
throw e.setUnfinishedMessage(this);
|
||||||
|
} catch (java.io.IOException e) {
|
||||||
|
throw new com.google.protobuf.InvalidProtocolBufferException(
|
||||||
|
e).setUnfinishedMessage(this);
|
||||||
|
} finally {
|
||||||
|
this.unknownFields = unknownFields.build();
|
||||||
|
makeExtensionsImmutable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static final com.google.protobuf.Descriptors.Descriptor
|
||||||
|
getDescriptor() {
|
||||||
|
return emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.internal_static_GetAllMailNotify_descriptor;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||||
|
internalGetFieldAccessorTable() {
|
||||||
|
return emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.internal_static_GetAllMailNotify_fieldAccessorTable
|
||||||
|
.ensureFieldAccessorsInitialized(
|
||||||
|
emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify.class, emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify.Builder.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final int IS_COLLECTED_FIELD_NUMBER = 6;
|
||||||
|
private boolean isCollected_;
|
||||||
|
/**
|
||||||
|
* <code>bool is_collected = 6;</code>
|
||||||
|
* @return The isCollected.
|
||||||
|
*/
|
||||||
|
@java.lang.Override
|
||||||
|
public boolean getIsCollected() {
|
||||||
|
return isCollected_;
|
||||||
|
}
|
||||||
|
|
||||||
|
private byte memoizedIsInitialized = -1;
|
||||||
|
@java.lang.Override
|
||||||
|
public final boolean isInitialized() {
|
||||||
|
byte isInitialized = memoizedIsInitialized;
|
||||||
|
if (isInitialized == 1) return true;
|
||||||
|
if (isInitialized == 0) return false;
|
||||||
|
|
||||||
|
memoizedIsInitialized = 1;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public void writeTo(com.google.protobuf.CodedOutputStream output)
|
||||||
|
throws java.io.IOException {
|
||||||
|
if (isCollected_ != false) {
|
||||||
|
output.writeBool(6, isCollected_);
|
||||||
|
}
|
||||||
|
unknownFields.writeTo(output);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public int getSerializedSize() {
|
||||||
|
int size = memoizedSize;
|
||||||
|
if (size != -1) return size;
|
||||||
|
|
||||||
|
size = 0;
|
||||||
|
if (isCollected_ != false) {
|
||||||
|
size += com.google.protobuf.CodedOutputStream
|
||||||
|
.computeBoolSize(6, isCollected_);
|
||||||
|
}
|
||||||
|
size += unknownFields.getSerializedSize();
|
||||||
|
memoizedSize = size;
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public boolean equals(final java.lang.Object obj) {
|
||||||
|
if (obj == this) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (!(obj instanceof emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify)) {
|
||||||
|
return super.equals(obj);
|
||||||
|
}
|
||||||
|
emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify other = (emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify) obj;
|
||||||
|
|
||||||
|
if (getIsCollected()
|
||||||
|
!= other.getIsCollected()) return false;
|
||||||
|
if (!unknownFields.equals(other.unknownFields)) return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public int hashCode() {
|
||||||
|
if (memoizedHashCode != 0) {
|
||||||
|
return memoizedHashCode;
|
||||||
|
}
|
||||||
|
int hash = 41;
|
||||||
|
hash = (19 * hash) + getDescriptor().hashCode();
|
||||||
|
hash = (37 * hash) + IS_COLLECTED_FIELD_NUMBER;
|
||||||
|
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
|
||||||
|
getIsCollected());
|
||||||
|
hash = (29 * hash) + unknownFields.hashCode();
|
||||||
|
memoizedHashCode = hash;
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify parseFrom(
|
||||||
|
java.nio.ByteBuffer data)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
return PARSER.parseFrom(data);
|
||||||
|
}
|
||||||
|
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify parseFrom(
|
||||||
|
java.nio.ByteBuffer data,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
return PARSER.parseFrom(data, extensionRegistry);
|
||||||
|
}
|
||||||
|
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify parseFrom(
|
||||||
|
com.google.protobuf.ByteString data)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
return PARSER.parseFrom(data);
|
||||||
|
}
|
||||||
|
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify parseFrom(
|
||||||
|
com.google.protobuf.ByteString data,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
return PARSER.parseFrom(data, extensionRegistry);
|
||||||
|
}
|
||||||
|
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify parseFrom(byte[] data)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
return PARSER.parseFrom(data);
|
||||||
|
}
|
||||||
|
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify parseFrom(
|
||||||
|
byte[] data,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
return PARSER.parseFrom(data, extensionRegistry);
|
||||||
|
}
|
||||||
|
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify parseFrom(java.io.InputStream input)
|
||||||
|
throws java.io.IOException {
|
||||||
|
return com.google.protobuf.GeneratedMessageV3
|
||||||
|
.parseWithIOException(PARSER, input);
|
||||||
|
}
|
||||||
|
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify parseFrom(
|
||||||
|
java.io.InputStream input,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws java.io.IOException {
|
||||||
|
return com.google.protobuf.GeneratedMessageV3
|
||||||
|
.parseWithIOException(PARSER, input, extensionRegistry);
|
||||||
|
}
|
||||||
|
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify parseDelimitedFrom(java.io.InputStream input)
|
||||||
|
throws java.io.IOException {
|
||||||
|
return com.google.protobuf.GeneratedMessageV3
|
||||||
|
.parseDelimitedWithIOException(PARSER, input);
|
||||||
|
}
|
||||||
|
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify parseDelimitedFrom(
|
||||||
|
java.io.InputStream input,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws java.io.IOException {
|
||||||
|
return com.google.protobuf.GeneratedMessageV3
|
||||||
|
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
|
||||||
|
}
|
||||||
|
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify parseFrom(
|
||||||
|
com.google.protobuf.CodedInputStream input)
|
||||||
|
throws java.io.IOException {
|
||||||
|
return com.google.protobuf.GeneratedMessageV3
|
||||||
|
.parseWithIOException(PARSER, input);
|
||||||
|
}
|
||||||
|
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify parseFrom(
|
||||||
|
com.google.protobuf.CodedInputStream input,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws java.io.IOException {
|
||||||
|
return com.google.protobuf.GeneratedMessageV3
|
||||||
|
.parseWithIOException(PARSER, input, extensionRegistry);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder newBuilderForType() { return newBuilder(); }
|
||||||
|
public static Builder newBuilder() {
|
||||||
|
return DEFAULT_INSTANCE.toBuilder();
|
||||||
|
}
|
||||||
|
public static Builder newBuilder(emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify prototype) {
|
||||||
|
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder toBuilder() {
|
||||||
|
return this == DEFAULT_INSTANCE
|
||||||
|
? new Builder() : new Builder().mergeFrom(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected Builder newBuilderForType(
|
||||||
|
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
|
||||||
|
Builder builder = new Builder(parent);
|
||||||
|
return builder;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <pre>
|
||||||
|
* Name: PFHIOOMPNBH
|
||||||
|
* CmdId: 1442
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* Protobuf type {@code GetAllMailNotify}
|
||||||
|
*/
|
||||||
|
public static final class Builder extends
|
||||||
|
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
|
||||||
|
// @@protoc_insertion_point(builder_implements:GetAllMailNotify)
|
||||||
|
emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotifyOrBuilder {
|
||||||
|
public static final com.google.protobuf.Descriptors.Descriptor
|
||||||
|
getDescriptor() {
|
||||||
|
return emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.internal_static_GetAllMailNotify_descriptor;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||||
|
internalGetFieldAccessorTable() {
|
||||||
|
return emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.internal_static_GetAllMailNotify_fieldAccessorTable
|
||||||
|
.ensureFieldAccessorsInitialized(
|
||||||
|
emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify.class, emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify.Builder.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Construct using emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify.newBuilder()
|
||||||
|
private Builder() {
|
||||||
|
maybeForceBuilderInitialization();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Builder(
|
||||||
|
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
|
||||||
|
super(parent);
|
||||||
|
maybeForceBuilderInitialization();
|
||||||
|
}
|
||||||
|
private void maybeForceBuilderInitialization() {
|
||||||
|
if (com.google.protobuf.GeneratedMessageV3
|
||||||
|
.alwaysUseFieldBuilders) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder clear() {
|
||||||
|
super.clear();
|
||||||
|
isCollected_ = false;
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.Descriptors.Descriptor
|
||||||
|
getDescriptorForType() {
|
||||||
|
return emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.internal_static_GetAllMailNotify_descriptor;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify getDefaultInstanceForType() {
|
||||||
|
return emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify.getDefaultInstance();
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify build() {
|
||||||
|
emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify result = buildPartial();
|
||||||
|
if (!result.isInitialized()) {
|
||||||
|
throw newUninitializedMessageException(result);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify buildPartial() {
|
||||||
|
emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify result = new emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify(this);
|
||||||
|
result.isCollected_ = isCollected_;
|
||||||
|
onBuilt();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder clone() {
|
||||||
|
return super.clone();
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder setField(
|
||||||
|
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||||
|
java.lang.Object value) {
|
||||||
|
return super.setField(field, value);
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder clearField(
|
||||||
|
com.google.protobuf.Descriptors.FieldDescriptor field) {
|
||||||
|
return super.clearField(field);
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder clearOneof(
|
||||||
|
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
|
||||||
|
return super.clearOneof(oneof);
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder setRepeatedField(
|
||||||
|
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||||
|
int index, java.lang.Object value) {
|
||||||
|
return super.setRepeatedField(field, index, value);
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder addRepeatedField(
|
||||||
|
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||||
|
java.lang.Object value) {
|
||||||
|
return super.addRepeatedField(field, value);
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder mergeFrom(com.google.protobuf.Message other) {
|
||||||
|
if (other instanceof emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify) {
|
||||||
|
return mergeFrom((emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify)other);
|
||||||
|
} else {
|
||||||
|
super.mergeFrom(other);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder mergeFrom(emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify other) {
|
||||||
|
if (other == emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify.getDefaultInstance()) return this;
|
||||||
|
if (other.getIsCollected() != false) {
|
||||||
|
setIsCollected(other.getIsCollected());
|
||||||
|
}
|
||||||
|
this.mergeUnknownFields(other.unknownFields);
|
||||||
|
onChanged();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public final boolean isInitialized() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public Builder mergeFrom(
|
||||||
|
com.google.protobuf.CodedInputStream input,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws java.io.IOException {
|
||||||
|
emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify parsedMessage = null;
|
||||||
|
try {
|
||||||
|
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
|
||||||
|
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||||
|
parsedMessage = (emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify) e.getUnfinishedMessage();
|
||||||
|
throw e.unwrapIOException();
|
||||||
|
} finally {
|
||||||
|
if (parsedMessage != null) {
|
||||||
|
mergeFrom(parsedMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isCollected_ ;
|
||||||
|
/**
|
||||||
|
* <code>bool is_collected = 6;</code>
|
||||||
|
* @return The isCollected.
|
||||||
|
*/
|
||||||
|
@java.lang.Override
|
||||||
|
public boolean getIsCollected() {
|
||||||
|
return isCollected_;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>bool is_collected = 6;</code>
|
||||||
|
* @param value The isCollected to set.
|
||||||
|
* @return This builder for chaining.
|
||||||
|
*/
|
||||||
|
public Builder setIsCollected(boolean value) {
|
||||||
|
|
||||||
|
isCollected_ = value;
|
||||||
|
onChanged();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* <code>bool is_collected = 6;</code>
|
||||||
|
* @return This builder for chaining.
|
||||||
|
*/
|
||||||
|
public Builder clearIsCollected() {
|
||||||
|
|
||||||
|
isCollected_ = false;
|
||||||
|
onChanged();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
@java.lang.Override
|
||||||
|
public final Builder setUnknownFields(
|
||||||
|
final com.google.protobuf.UnknownFieldSet unknownFields) {
|
||||||
|
return super.setUnknownFields(unknownFields);
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public final Builder mergeUnknownFields(
|
||||||
|
final com.google.protobuf.UnknownFieldSet unknownFields) {
|
||||||
|
return super.mergeUnknownFields(unknownFields);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// @@protoc_insertion_point(builder_scope:GetAllMailNotify)
|
||||||
|
}
|
||||||
|
|
||||||
|
// @@protoc_insertion_point(class_scope:GetAllMailNotify)
|
||||||
|
private static final emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify DEFAULT_INSTANCE;
|
||||||
|
static {
|
||||||
|
DEFAULT_INSTANCE = new emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify getDefaultInstance() {
|
||||||
|
return DEFAULT_INSTANCE;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final com.google.protobuf.Parser<GetAllMailNotify>
|
||||||
|
PARSER = new com.google.protobuf.AbstractParser<GetAllMailNotify>() {
|
||||||
|
@java.lang.Override
|
||||||
|
public GetAllMailNotify parsePartialFrom(
|
||||||
|
com.google.protobuf.CodedInputStream input,
|
||||||
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
|
return new GetAllMailNotify(input, extensionRegistry);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
public static com.google.protobuf.Parser<GetAllMailNotify> parser() {
|
||||||
|
return PARSER;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public com.google.protobuf.Parser<GetAllMailNotify> getParserForType() {
|
||||||
|
return PARSER;
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.Override
|
||||||
|
public emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify getDefaultInstanceForType() {
|
||||||
|
return DEFAULT_INSTANCE;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final com.google.protobuf.Descriptors.Descriptor
|
||||||
|
internal_static_GetAllMailNotify_descriptor;
|
||||||
|
private static final
|
||||||
|
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||||
|
internal_static_GetAllMailNotify_fieldAccessorTable;
|
||||||
|
|
||||||
|
public static com.google.protobuf.Descriptors.FileDescriptor
|
||||||
|
getDescriptor() {
|
||||||
|
return descriptor;
|
||||||
|
}
|
||||||
|
private static com.google.protobuf.Descriptors.FileDescriptor
|
||||||
|
descriptor;
|
||||||
|
static {
|
||||||
|
java.lang.String[] descriptorData = {
|
||||||
|
"\n\026GetAllMailNotify.proto\"(\n\020GetAllMailNo" +
|
||||||
|
"tify\022\024\n\014is_collected\030\006 \001(\010B\033\n\031emu.grassc" +
|
||||||
|
"utter.net.protob\006proto3"
|
||||||
|
};
|
||||||
|
descriptor = com.google.protobuf.Descriptors.FileDescriptor
|
||||||
|
.internalBuildGeneratedFileFrom(descriptorData,
|
||||||
|
new com.google.protobuf.Descriptors.FileDescriptor[] {
|
||||||
|
});
|
||||||
|
internal_static_GetAllMailNotify_descriptor =
|
||||||
|
getDescriptor().getMessageTypes().get(0);
|
||||||
|
internal_static_GetAllMailNotify_fieldAccessorTable = new
|
||||||
|
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||||
|
internal_static_GetAllMailNotify_descriptor,
|
||||||
|
new java.lang.String[] { "IsCollected", });
|
||||||
|
}
|
||||||
|
|
||||||
|
// @@protoc_insertion_point(outer_class_scope)
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
@ -1,133 +1,163 @@
|
|||||||
package emu.grasscutter.game.mail;
|
package emu.grasscutter.game.mail;
|
||||||
|
|
||||||
import dev.morphia.annotations.Entity;
|
import dev.morphia.annotations.Entity;
|
||||||
import dev.morphia.annotations.Id;
|
import dev.morphia.annotations.Id;
|
||||||
import dev.morphia.annotations.Indexed;
|
import dev.morphia.annotations.Indexed;
|
||||||
import dev.morphia.annotations.Transient;
|
import dev.morphia.annotations.Transient;
|
||||||
import emu.grasscutter.database.DatabaseHelper;
|
import emu.grasscutter.database.DatabaseHelper;
|
||||||
import emu.grasscutter.game.player.Player;
|
import emu.grasscutter.game.player.Player;
|
||||||
import java.time.Instant;
|
import emu.grasscutter.net.proto.*;
|
||||||
import java.util.ArrayList;
|
import emu.grasscutter.net.proto.EquipParamOuterClass.EquipParam;
|
||||||
import java.util.List;
|
import emu.grasscutter.net.proto.MailCollectStateOuterClass.MailCollectState;
|
||||||
import org.bson.types.ObjectId;
|
import emu.grasscutter.net.proto.MailTextContentOuterClass.MailTextContent;
|
||||||
|
import org.bson.types.ObjectId;
|
||||||
@Entity(value = "mail", useDiscriminator = false)
|
|
||||||
public class Mail {
|
import java.time.Instant;
|
||||||
public MailContent mailContent;
|
import java.util.ArrayList;
|
||||||
public List<MailItem> itemList;
|
import java.util.List;
|
||||||
public long sendTime;
|
|
||||||
public long expireTime;
|
import static emu.grasscutter.net.proto.MailItemOuterClass.MailItem.*;
|
||||||
public int importance;
|
|
||||||
public boolean isRead;
|
@Entity(value = "mail", useDiscriminator = false)
|
||||||
public boolean isAttachmentGot;
|
public final class Mail {
|
||||||
public int stateValue;
|
@Id private ObjectId id;
|
||||||
@Id private ObjectId id;
|
@Indexed private int ownerUid;
|
||||||
@Indexed private int ownerUid;
|
public MailContent mailContent;
|
||||||
@Transient private boolean shouldDelete;
|
public List<MailItem> itemList;
|
||||||
|
public long sendTime;
|
||||||
public Mail() {
|
public long expireTime;
|
||||||
this(
|
public int importance;
|
||||||
new MailContent(),
|
public boolean isRead;
|
||||||
new ArrayList<MailItem>(),
|
public boolean isAttachmentGot;
|
||||||
(int) Instant.now().getEpochSecond()
|
public int stateValue;
|
||||||
+ 604800); // TODO: add expire time to send mail command
|
@Transient private boolean shouldDelete;
|
||||||
}
|
|
||||||
|
public Mail() {
|
||||||
public Mail(MailContent mailContent, List<MailItem> itemList, long expireTime) {
|
this(new MailContent(), new ArrayList<MailItem>(), (int) Instant.now().getEpochSecond() + 604800); // TODO: add expire time to send mail command
|
||||||
this(mailContent, itemList, expireTime, 0);
|
}
|
||||||
}
|
|
||||||
|
public Mail(MailContent mailContent, List<MailItem> itemList, long expireTime) {
|
||||||
public Mail(MailContent mailContent, List<MailItem> itemList, long expireTime, int importance) {
|
this(mailContent, itemList, expireTime, 0);
|
||||||
this(mailContent, itemList, expireTime, importance, 1);
|
}
|
||||||
}
|
|
||||||
|
public Mail(MailContent mailContent, List<MailItem> itemList, long expireTime, int importance) {
|
||||||
public Mail(
|
this(mailContent, itemList, expireTime, importance, 1);
|
||||||
MailContent mailContent,
|
}
|
||||||
List<MailItem> itemList,
|
|
||||||
long expireTime,
|
public Mail(MailContent mailContent, List<MailItem> itemList, long expireTime, int importance, int state) {
|
||||||
int importance,
|
this.mailContent = mailContent;
|
||||||
int state) {
|
this.itemList = itemList;
|
||||||
this.mailContent = mailContent;
|
this.sendTime = (int) Instant.now().getEpochSecond();
|
||||||
this.itemList = itemList;
|
this.expireTime = expireTime;
|
||||||
this.sendTime = (int) Instant.now().getEpochSecond();
|
this.importance = importance; // Starred mail, 0 = No star, 1 = Star.
|
||||||
this.expireTime = expireTime;
|
this.isRead = false;
|
||||||
this.importance = importance; // Starred mail, 0 = No star, 1 = Star.
|
this.isAttachmentGot = false;
|
||||||
this.isRead = false;
|
this.stateValue = state; // Different mailboxes, 1 = Default, 3 = Gift-box.
|
||||||
this.isAttachmentGot = false;
|
}
|
||||||
this.stateValue = state; // Different mailboxes, 1 = Default, 3 = Gift-box.
|
|
||||||
}
|
public ObjectId getId() {
|
||||||
|
return id;
|
||||||
public ObjectId getId() {
|
}
|
||||||
return id;
|
|
||||||
}
|
public int getOwnerUid() {
|
||||||
|
return ownerUid;
|
||||||
public int getOwnerUid() {
|
}
|
||||||
return ownerUid;
|
|
||||||
}
|
public void setOwnerUid(int ownerUid) {
|
||||||
|
this.ownerUid = ownerUid;
|
||||||
public void setOwnerUid(int ownerUid) {
|
}
|
||||||
this.ownerUid = ownerUid;
|
|
||||||
}
|
public MailDataOuterClass.MailData toProto(Player player) {
|
||||||
|
return MailDataOuterClass.MailData.newBuilder()
|
||||||
public void save() {
|
.setMailId(player.getMailId(this))
|
||||||
if (this.expireTime * 1000 < System.currentTimeMillis()) {
|
.setMailTextContent(this.mailContent.toProto())
|
||||||
DatabaseHelper.deleteMail(this);
|
.addAllItemList(this.itemList.stream().map(MailItem::toProto).toList())
|
||||||
} else {
|
.setSendTime((int) this.sendTime)
|
||||||
DatabaseHelper.saveMail(this);
|
.setExpireTime((int) this.expireTime)
|
||||||
}
|
.setImportance(this.importance)
|
||||||
}
|
.setIsRead(this.isRead)
|
||||||
|
.setIsAttachmentGot(this.isAttachmentGot)
|
||||||
@Entity
|
.setCollectState(MailCollectState.MAIL_COLLECT_STATE_NOT_COLLECTIBLE)
|
||||||
public static class MailContent {
|
.build();
|
||||||
public String title;
|
}
|
||||||
public String content;
|
|
||||||
public String sender;
|
@Entity
|
||||||
|
public static class MailContent {
|
||||||
public MailContent() {
|
public String title;
|
||||||
this.title = "";
|
public String content;
|
||||||
this.content = "loading...";
|
public String sender;
|
||||||
this.sender = "loading";
|
|
||||||
}
|
public MailContent() {
|
||||||
|
this.title = "";
|
||||||
public MailContent(String title, String content) {
|
this.content = "loading...";
|
||||||
this(title, content, "Server");
|
this.sender = "loading";
|
||||||
}
|
}
|
||||||
|
|
||||||
public MailContent(String title, String content, Player sender) {
|
public MailContent(String title, String content) {
|
||||||
this(title, content, sender.getNickname());
|
this(title, content, "Server");
|
||||||
}
|
}
|
||||||
|
|
||||||
public MailContent(String title, String content, String sender) {
|
public MailContent(String title, String content, Player sender) {
|
||||||
this.title = title;
|
this(title, content, sender.getNickname());
|
||||||
this.content = content;
|
}
|
||||||
this.sender = sender;
|
|
||||||
}
|
public MailContent(String title, String content, String sender) {
|
||||||
}
|
this.title = title;
|
||||||
|
this.content = content;
|
||||||
@Entity
|
this.sender = sender;
|
||||||
public static class MailItem {
|
}
|
||||||
public int itemId;
|
|
||||||
public int itemCount;
|
public MailTextContent toProto() {
|
||||||
public int itemLevel;
|
return MailTextContent.newBuilder()
|
||||||
|
.setTitle(this.title)
|
||||||
public MailItem() {
|
.setContent(this.content)
|
||||||
this.itemId = 11101;
|
.setSender(this.sender)
|
||||||
this.itemCount = 1;
|
.build();
|
||||||
this.itemLevel = 1;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public MailItem(int itemId) {
|
@Entity
|
||||||
this(itemId, 1);
|
public static class MailItem {
|
||||||
}
|
public int itemId;
|
||||||
|
public int itemCount;
|
||||||
public MailItem(int itemId, int itemCount) {
|
public int itemLevel;
|
||||||
this(itemId, itemCount, 1);
|
|
||||||
}
|
public MailItem() {
|
||||||
|
this.itemId = 11101;
|
||||||
public MailItem(int itemId, int itemCount, int itemLevel) {
|
this.itemCount = 1;
|
||||||
this.itemId = itemId;
|
this.itemLevel = 1;
|
||||||
this.itemCount = itemCount;
|
}
|
||||||
this.itemLevel = itemLevel;
|
|
||||||
}
|
public MailItem(int itemId) {
|
||||||
}
|
this(itemId, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MailItem(int itemId, int itemCount) {
|
||||||
|
this(itemId, itemCount, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public MailItem(int itemId, int itemCount, int itemLevel) {
|
||||||
|
this.itemId = itemId;
|
||||||
|
this.itemCount = itemCount;
|
||||||
|
this.itemLevel = itemLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MailItemOuterClass.MailItem toProto() {
|
||||||
|
return newBuilder().setEquipParam(EquipParam.newBuilder()
|
||||||
|
.setItemId(this.itemId)
|
||||||
|
.setItemNum(this.itemCount)
|
||||||
|
.setItemLevel(this.itemLevel)
|
||||||
|
.setPromoteLevel(0)//mock
|
||||||
|
.build())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void save() {
|
||||||
|
if (this.expireTime * 1000 < System.currentTimeMillis()) {
|
||||||
|
DatabaseHelper.deleteMail(this);
|
||||||
|
} else {
|
||||||
|
DatabaseHelper.saveMail(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -0,0 +1,17 @@
|
|||||||
|
package emu.grasscutter.server.packet.recv;
|
||||||
|
|
||||||
|
import emu.grasscutter.net.packet.Opcodes;
|
||||||
|
import emu.grasscutter.net.packet.PacketHandler;
|
||||||
|
import emu.grasscutter.net.packet.PacketOpcodes;
|
||||||
|
import emu.grasscutter.net.proto.GetAllMailNotifyOuterClass.GetAllMailNotify;
|
||||||
|
import emu.grasscutter.server.game.GameSession;
|
||||||
|
import emu.grasscutter.server.packet.send.PacketGetAllMailResultNotify;
|
||||||
|
|
||||||
|
@Opcodes(PacketOpcodes.GetAllMailNotify)
|
||||||
|
public final class HandlerGetAllMailNotify extends PacketHandler {
|
||||||
|
@Override
|
||||||
|
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
|
||||||
|
var req = GetAllMailNotify.parseFrom(payload);
|
||||||
|
session.send(new PacketGetAllMailResultNotify(session.getPlayer(), req.getIsCollected()));
|
||||||
|
}
|
||||||
|
}
|
@ -1,19 +0,0 @@
|
|||||||
package emu.grasscutter.server.packet.recv;
|
|
||||||
|
|
||||||
import emu.grasscutter.net.packet.Opcodes;
|
|
||||||
import emu.grasscutter.net.packet.PacketHandler;
|
|
||||||
import emu.grasscutter.net.packet.PacketOpcodes;
|
|
||||||
import emu.grasscutter.net.proto.GetAllMailReqOuterClass;
|
|
||||||
import emu.grasscutter.server.game.GameSession;
|
|
||||||
import emu.grasscutter.server.packet.send.PacketGetAllMailRsp;
|
|
||||||
|
|
||||||
@Opcodes(PacketOpcodes.GetAllMailReq)
|
|
||||||
public class HandlerGetAllMailReq extends PacketHandler {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
|
|
||||||
GetAllMailReqOuterClass.GetAllMailReq req =
|
|
||||||
GetAllMailReqOuterClass.GetAllMailReq.parseFrom(payload);
|
|
||||||
session.send(new PacketGetAllMailRsp(session.getPlayer(), req.getIsCollected()));
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,40 @@
|
|||||||
|
package emu.grasscutter.server.packet.send;
|
||||||
|
|
||||||
|
import emu.grasscutter.game.player.Player;
|
||||||
|
import emu.grasscutter.net.packet.BasePacket;
|
||||||
|
import emu.grasscutter.net.packet.PacketOpcodes;
|
||||||
|
import emu.grasscutter.net.proto.GetAllMailResultNotifyOuterClass.GetAllMailResultNotify;
|
||||||
|
import emu.grasscutter.utils.Utils;
|
||||||
|
|
||||||
|
import java.time.Instant;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public final class PacketGetAllMailResultNotify extends BasePacket {
|
||||||
|
/**
|
||||||
|
* @param player The player to fetch the mail for.
|
||||||
|
* @param gifts Is the mail for gifts?
|
||||||
|
*/
|
||||||
|
public PacketGetAllMailResultNotify(Player player, boolean gifts) {
|
||||||
|
super(PacketOpcodes.GetAllMailResultNotify);
|
||||||
|
|
||||||
|
var packet = GetAllMailResultNotify.newBuilder()
|
||||||
|
.setTransaction(player.getUid() + "-" + Utils.getCurrentSeconds() + "-" + 0)
|
||||||
|
.setIsCollected(gifts)
|
||||||
|
.setPacketBeSentNum(1)
|
||||||
|
.setPacketNum(1);
|
||||||
|
|
||||||
|
var inbox = player.getAllMail();
|
||||||
|
if (!gifts && inbox.size() > 0) {
|
||||||
|
packet.addAllMailList(inbox.stream()
|
||||||
|
.filter(mail -> mail.stateValue == 1)
|
||||||
|
.filter(mail -> mail.expireTime > Instant.now().getEpochSecond())
|
||||||
|
.map(mail -> mail.toProto(player)).toList());
|
||||||
|
} else {
|
||||||
|
// Empty mailbox.
|
||||||
|
// TODO: Implement the gift mailbox.
|
||||||
|
packet.addAllMailList(List.of());
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setData(packet.build());
|
||||||
|
}
|
||||||
|
}
|
@ -1,89 +0,0 @@
|
|||||||
package emu.grasscutter.server.packet.send;
|
|
||||||
|
|
||||||
import emu.grasscutter.game.mail.Mail;
|
|
||||||
import emu.grasscutter.game.player.Player;
|
|
||||||
import emu.grasscutter.net.packet.BasePacket;
|
|
||||||
import emu.grasscutter.net.packet.PacketOpcodes;
|
|
||||||
import emu.grasscutter.net.proto.EquipParamOuterClass;
|
|
||||||
import emu.grasscutter.net.proto.GetAllMailRspOuterClass.GetAllMailRsp;
|
|
||||||
import emu.grasscutter.net.proto.MailDataOuterClass;
|
|
||||||
import emu.grasscutter.net.proto.MailDataOuterClass.MailData;
|
|
||||||
import emu.grasscutter.net.proto.MailItemOuterClass;
|
|
||||||
import emu.grasscutter.net.proto.MailTextContentOuterClass.MailTextContent;
|
|
||||||
import java.time.Instant;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class PacketGetAllMailRsp extends BasePacket {
|
|
||||||
|
|
||||||
public PacketGetAllMailRsp(Player player, boolean isGiftMail) {
|
|
||||||
super(PacketOpcodes.GetAllMailRsp);
|
|
||||||
GetAllMailRsp.Builder proto = GetAllMailRsp.newBuilder();
|
|
||||||
|
|
||||||
if (isGiftMail) {
|
|
||||||
proto.setIsCollected(true);
|
|
||||||
} else {
|
|
||||||
proto.setIsCollected(false);
|
|
||||||
|
|
||||||
if (player.getAllMail().size() != 0) { // Make sure the player has mail
|
|
||||||
List<MailData> mailDataList = new ArrayList<MailData>();
|
|
||||||
|
|
||||||
for (Mail message : player.getAllMail()) {
|
|
||||||
if (message.stateValue == 1) { // Make sure it isn't a gift
|
|
||||||
if (message.expireTime
|
|
||||||
> (int)
|
|
||||||
Instant.now()
|
|
||||||
.getEpochSecond()) { // Make sure the message isn't expired (The game won't
|
|
||||||
// show expired mail, but I don't want to send
|
|
||||||
// unnecessary information).
|
|
||||||
if (mailDataList.size()
|
|
||||||
<= 1000) { // Make sure that there isn't over 1000 messages in the mailbox. (idk
|
|
||||||
// what will happen if there is but the game probably won't like it.)
|
|
||||||
MailTextContent.Builder mailTextContent = MailTextContent.newBuilder();
|
|
||||||
mailTextContent.setTitle(message.mailContent.title);
|
|
||||||
mailTextContent.setContent(message.mailContent.content);
|
|
||||||
mailTextContent.setSender(message.mailContent.sender);
|
|
||||||
|
|
||||||
List<MailItemOuterClass.MailItem> mailItems = new ArrayList<>();
|
|
||||||
|
|
||||||
for (Mail.MailItem item : message.itemList) {
|
|
||||||
MailItemOuterClass.MailItem.Builder mailItem =
|
|
||||||
MailItemOuterClass.MailItem.newBuilder();
|
|
||||||
EquipParamOuterClass.EquipParam.Builder itemParam =
|
|
||||||
EquipParamOuterClass.EquipParam.newBuilder();
|
|
||||||
itemParam.setItemId(item.itemId);
|
|
||||||
itemParam.setItemNum(item.itemCount);
|
|
||||||
mailItem.setEquipParam(itemParam.build());
|
|
||||||
|
|
||||||
mailItems.add(mailItem.build());
|
|
||||||
}
|
|
||||||
|
|
||||||
MailDataOuterClass.MailData.Builder mailData =
|
|
||||||
MailDataOuterClass.MailData.newBuilder();
|
|
||||||
mailData.setMailId(player.getMailId(message));
|
|
||||||
mailData.setMailTextContent(mailTextContent.build());
|
|
||||||
mailData.addAllItemList(mailItems);
|
|
||||||
mailData.setSendTime((int) message.sendTime);
|
|
||||||
mailData.setExpireTime((int) message.expireTime);
|
|
||||||
mailData.setImportance(message.importance);
|
|
||||||
mailData.setIsRead(message.isRead);
|
|
||||||
mailData.setIsAttachmentGot(message.isAttachmentGot);
|
|
||||||
mailData.setCollectStateValue(1);
|
|
||||||
|
|
||||||
mailDataList.add(mailData.build());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
proto.addAllMailList(mailDataList);
|
|
||||||
proto.setIsTruncated(
|
|
||||||
mailDataList.size()
|
|
||||||
> 1000); // When enabled this will send a notification to the user telling them
|
|
||||||
// their inbox is full and they should delete old messages when opening the
|
|
||||||
// mailbox.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.setData(proto.build());
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user