From b27f4e489c6d9148a33b25aa58fd708e9d27c952 Mon Sep 17 00:00:00 2001 From: zhangshanxue Date: Fri, 27 Nov 2020 15:26:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E6=AD=A5=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/rpc/thrift/ServiceKey.java | 1 + .../main/java/rpc/world/WorldCommonProto.java | 5954 +++++++++++++++++ .../src/main/java/rpc/world/WorldProto.java | 4 +- .../thrift/idl/InnerInvalidOperException.java | 2 +- .../com/global/thrift/idl/InnerResult.java | 2 +- .../global/thrift/idl/RPCgTGRequestIFace.java | 2 +- .../thrift/idl/InnerInvalidOperException.java | 2 +- .../com/global/thrift/idl/InnerResult.java | 2 +- .../global/thrift/idl/RPCgTGRequestIFace.java | 2 +- .../main/java/com/ljsd/GameLogicService.java | 3 +- .../jieling/config/json/CoreSettings.java | 9 + .../ljsd/jieling/logic/GlobleSystemLogic.java | 3 +- .../jieling/logic/activity/ActivityLogic.java | 6 +- .../thrift/idl/InvalidOperException.java | 2 +- .../thrift/idl/RPCMatchRequestIFace.java | 2 +- .../jieling/thrift/idl/RPCRequestIFace.java | 2 +- .../jieling/thrift/idl/RechargeResult.java | 2 +- .../com/ljsd/jieling/thrift/idl/Result.java | 2 +- .../thrift/idl/InnerInvalidOperException.java | 2 +- .../com/world/thrift/idl/InnerResult.java | 2 +- .../world/thrift/idl/RPCgTwRequestIFace.java | 2 +- .../world/thrift/idl/RPCwTgRequestIFace.java | 1199 ++++ .../thrift/idl/InnerInvalidOperException.java | 2 +- .../com/global/thrift/idl/InnerResult.java | 2 +- .../global/thrift/idl/RPCgTGRequestIFace.java | 2 +- .../thrift/idl/InvalidOperException.java | 2 +- .../thrift/idl/RPCMatchRequestIFace.java | 2 +- .../jieling/thrift/idl/RPCRequestIFace.java | 2 +- .../jieling/thrift/idl/RechargeResult.java | 2 +- .../com/ljsd/jieling/thrift/idl/Result.java | 2 +- .../world/thrift/idl/RPCwTgRequestIFace.java | 1199 ++++ serverlogic/src/main/thrift/idl/world.thrift | 5 + worldserver/src/main/java/com/IManager.java | 17 + .../{world => }/WorldServerApplication.java | 14 +- ...ConfigurableApplicationContextManager.java | 2 +- .../world/function/ArenaWorldFunction.java | 20 + .../com/world/function/FunctionIdEnum.java | 53 + .../com/world/function/FunctionManager.java | 14 + .../function/TimeControllerOfFunction.java | 44 + .../GetWorldArenaInfoRequestHandler.java | 40 +- .../com/world/logic/arean/ArenaEnemy.java | 30 + .../com/world/logic/arean/ArenaLogic.java | 548 ++ .../java/com/world/logic/dao/UserManager.java | 194 + .../java/com/world/network/MessageUtil.java | 204 + .../java/com/world/network/NetManager.java | 57 + .../com/world/network/NettyProperties.java | 130 + .../network/NettyServerAutoConfiguration.java | 18 + .../world/network/OnlineServerManager.java | 68 + .../com/world/network/server/AuthManager.java | 51 + .../com/world/network/server/Blocker.java | 55 + .../network/server/ProtocolsManager.java | 147 + .../world/network/server/SessionManager.java | 201 + .../com/world/network/server/gsHelper.java | 123 + .../com/world/network/session/ISession.java | 165 + .../network/session/ISessionFactory.java | 11 + .../main/java/com/world/redis/RedisKey.java | 9 +- .../main/java/com/world/redis/RedisUtil.java | 24 + .../thrift/idl/InnerInvalidOperException.java | 2 +- .../com/world/thrift/idl/InnerResult.java | 2 +- .../world/thrift/idl/RPCgTwRequestIFace.java | 2 +- .../world/thrift/idl/RPCwTgRequestIFace.java | 1199 ++++ .../thrift/idl/pool/ClientAdapterPo.java | 62 + 62 files changed, 11887 insertions(+), 46 deletions(-) create mode 100644 gamecommon/src/main/java/rpc/world/WorldCommonProto.java create mode 100644 serverlogic/src/main/java/com/world/thrift/idl/RPCwTgRequestIFace.java create mode 100644 serverlogic/src/main/thrift/idl/gen-java/com/world/thrift/idl/RPCwTgRequestIFace.java create mode 100644 worldserver/src/main/java/com/IManager.java rename worldserver/src/main/java/com/{world => }/WorldServerApplication.java (85%) create mode 100644 worldserver/src/main/java/com/world/function/ArenaWorldFunction.java create mode 100644 worldserver/src/main/java/com/world/function/FunctionIdEnum.java create mode 100644 worldserver/src/main/java/com/world/function/FunctionManager.java create mode 100644 worldserver/src/main/java/com/world/function/TimeControllerOfFunction.java create mode 100644 worldserver/src/main/java/com/world/logic/arean/ArenaEnemy.java create mode 100644 worldserver/src/main/java/com/world/logic/arean/ArenaLogic.java create mode 100644 worldserver/src/main/java/com/world/logic/dao/UserManager.java create mode 100644 worldserver/src/main/java/com/world/network/MessageUtil.java create mode 100644 worldserver/src/main/java/com/world/network/NetManager.java create mode 100644 worldserver/src/main/java/com/world/network/NettyProperties.java create mode 100644 worldserver/src/main/java/com/world/network/NettyServerAutoConfiguration.java create mode 100644 worldserver/src/main/java/com/world/network/OnlineServerManager.java create mode 100644 worldserver/src/main/java/com/world/network/server/AuthManager.java create mode 100644 worldserver/src/main/java/com/world/network/server/Blocker.java create mode 100644 worldserver/src/main/java/com/world/network/server/ProtocolsManager.java create mode 100644 worldserver/src/main/java/com/world/network/server/SessionManager.java create mode 100644 worldserver/src/main/java/com/world/network/server/gsHelper.java create mode 100644 worldserver/src/main/java/com/world/network/session/ISession.java create mode 100644 worldserver/src/main/java/com/world/network/session/ISessionFactory.java create mode 100644 worldserver/src/main/java/com/world/thrift/idl/RPCwTgRequestIFace.java create mode 100644 worldserver/src/main/java/com/world/thrift/idl/pool/ClientAdapterPo.java diff --git a/gamecommon/src/main/java/rpc/thrift/ServiceKey.java b/gamecommon/src/main/java/rpc/thrift/ServiceKey.java index db418dfb6..810f7e2e8 100644 --- a/gamecommon/src/main/java/rpc/thrift/ServiceKey.java +++ b/gamecommon/src/main/java/rpc/thrift/ServiceKey.java @@ -10,4 +10,5 @@ public class ServiceKey { public static final String GM_CANCLE_SCENE = "GM_CANCLE_SCENE"; public static final String RPC_GLOBAL = "RPC_GGLOBAL"; public static final String RPC_WORLD = "RPC_WORLD"; + public static final String RPC_GS= "RPC_GS"; } diff --git a/gamecommon/src/main/java/rpc/world/WorldCommonProto.java b/gamecommon/src/main/java/rpc/world/WorldCommonProto.java new file mode 100644 index 000000000..308f2c51a --- /dev/null +++ b/gamecommon/src/main/java/rpc/world/WorldCommonProto.java @@ -0,0 +1,5954 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: gtwprotos/WorldCommonProto.proto + +package rpc.world; + +public final class WorldCommonProto { + private WorldCommonProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + } + public interface GetWorldArenaInfoRequestOrBuilder + extends com.google.protobuf.MessageOrBuilder { + } + /** + * Protobuf type {@code rpc.world.GetWorldArenaInfoRequest} + */ + public static final class GetWorldArenaInfoRequest extends + com.google.protobuf.GeneratedMessage + implements GetWorldArenaInfoRequestOrBuilder { + // Use GetWorldArenaInfoRequest.newBuilder() to construct. + private GetWorldArenaInfoRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private GetWorldArenaInfoRequest(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final GetWorldArenaInfoRequest defaultInstance; + public static GetWorldArenaInfoRequest getDefaultInstance() { + return defaultInstance; + } + + public GetWorldArenaInfoRequest getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetWorldArenaInfoRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + 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; + 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.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaInfoRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaInfoRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + rpc.world.WorldCommonProto.GetWorldArenaInfoRequest.class, rpc.world.WorldCommonProto.GetWorldArenaInfoRequest.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public GetWorldArenaInfoRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetWorldArenaInfoRequest(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private void initFields() { + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static rpc.world.WorldCommonProto.GetWorldArenaInfoRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static rpc.world.WorldCommonProto.GetWorldArenaInfoRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static rpc.world.WorldCommonProto.GetWorldArenaInfoRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static rpc.world.WorldCommonProto.GetWorldArenaInfoRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static rpc.world.WorldCommonProto.GetWorldArenaInfoRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static rpc.world.WorldCommonProto.GetWorldArenaInfoRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static rpc.world.WorldCommonProto.GetWorldArenaInfoRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static rpc.world.WorldCommonProto.GetWorldArenaInfoRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static rpc.world.WorldCommonProto.GetWorldArenaInfoRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static rpc.world.WorldCommonProto.GetWorldArenaInfoRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(rpc.world.WorldCommonProto.GetWorldArenaInfoRequest prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code rpc.world.GetWorldArenaInfoRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements rpc.world.WorldCommonProto.GetWorldArenaInfoRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaInfoRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaInfoRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + rpc.world.WorldCommonProto.GetWorldArenaInfoRequest.class, rpc.world.WorldCommonProto.GetWorldArenaInfoRequest.Builder.class); + } + + // Construct using rpc.world.WorldCommonProto.GetWorldArenaInfoRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaInfoRequest_descriptor; + } + + public rpc.world.WorldCommonProto.GetWorldArenaInfoRequest getDefaultInstanceForType() { + return rpc.world.WorldCommonProto.GetWorldArenaInfoRequest.getDefaultInstance(); + } + + public rpc.world.WorldCommonProto.GetWorldArenaInfoRequest build() { + rpc.world.WorldCommonProto.GetWorldArenaInfoRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public rpc.world.WorldCommonProto.GetWorldArenaInfoRequest buildPartial() { + rpc.world.WorldCommonProto.GetWorldArenaInfoRequest result = new rpc.world.WorldCommonProto.GetWorldArenaInfoRequest(this); + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof rpc.world.WorldCommonProto.GetWorldArenaInfoRequest) { + return mergeFrom((rpc.world.WorldCommonProto.GetWorldArenaInfoRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(rpc.world.WorldCommonProto.GetWorldArenaInfoRequest other) { + if (other == rpc.world.WorldCommonProto.GetWorldArenaInfoRequest.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + rpc.world.WorldCommonProto.GetWorldArenaInfoRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (rpc.world.WorldCommonProto.GetWorldArenaInfoRequest) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + // @@protoc_insertion_point(builder_scope:rpc.world.GetWorldArenaInfoRequest) + } + + static { + defaultInstance = new GetWorldArenaInfoRequest(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:rpc.world.GetWorldArenaInfoRequest) + } + + public interface GetWorldArenaInfoResponseOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // optional .rpc.protocols.ArenaInfo arenaInfo = 1; + /** + * optional .rpc.protocols.ArenaInfo arenaInfo = 1; + */ + boolean hasArenaInfo(); + /** + * optional .rpc.protocols.ArenaInfo arenaInfo = 1; + */ + rpc.protocols.CommonProto.ArenaInfo getArenaInfo(); + /** + * optional .rpc.protocols.ArenaInfo arenaInfo = 1; + */ + rpc.protocols.CommonProto.ArenaInfoOrBuilder getArenaInfoOrBuilder(); + + // optional int32 stage = 2; + /** + * optional int32 stage = 2; + * + *
+     *1 未开始 2 战斗阶段 3 膜拜阶段
+     * 
+ */ + boolean hasStage(); + /** + * optional int32 stage = 2; + * + *
+     *1 未开始 2 战斗阶段 3 膜拜阶段
+     * 
+ */ + int getStage(); + + // optional int32 endTime = 3; + /** + * optional int32 endTime = 3; + * + *
+     *阶段结束时间戳
+     * 
+ */ + boolean hasEndTime(); + /** + * optional int32 endTime = 3; + * + *
+     *阶段结束时间戳
+     * 
+ */ + int getEndTime(); + } + /** + * Protobuf type {@code rpc.world.GetWorldArenaInfoResponse} + */ + public static final class GetWorldArenaInfoResponse extends + com.google.protobuf.GeneratedMessage + implements GetWorldArenaInfoResponseOrBuilder { + // Use GetWorldArenaInfoResponse.newBuilder() to construct. + private GetWorldArenaInfoResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private GetWorldArenaInfoResponse(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final GetWorldArenaInfoResponse defaultInstance; + public static GetWorldArenaInfoResponse getDefaultInstance() { + return defaultInstance; + } + + public GetWorldArenaInfoResponse getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetWorldArenaInfoResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + 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; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + rpc.protocols.CommonProto.ArenaInfo.Builder subBuilder = null; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + subBuilder = arenaInfo_.toBuilder(); + } + arenaInfo_ = input.readMessage(rpc.protocols.CommonProto.ArenaInfo.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(arenaInfo_); + arenaInfo_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000001; + break; + } + case 16: { + bitField0_ |= 0x00000002; + stage_ = input.readInt32(); + break; + } + case 24: { + bitField0_ |= 0x00000004; + endTime_ = input.readInt32(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaInfoResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaInfoResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + rpc.world.WorldCommonProto.GetWorldArenaInfoResponse.class, rpc.world.WorldCommonProto.GetWorldArenaInfoResponse.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public GetWorldArenaInfoResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetWorldArenaInfoResponse(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + // optional .rpc.protocols.ArenaInfo arenaInfo = 1; + public static final int ARENAINFO_FIELD_NUMBER = 1; + private rpc.protocols.CommonProto.ArenaInfo arenaInfo_; + /** + * optional .rpc.protocols.ArenaInfo arenaInfo = 1; + */ + public boolean hasArenaInfo() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional .rpc.protocols.ArenaInfo arenaInfo = 1; + */ + public rpc.protocols.CommonProto.ArenaInfo getArenaInfo() { + return arenaInfo_; + } + /** + * optional .rpc.protocols.ArenaInfo arenaInfo = 1; + */ + public rpc.protocols.CommonProto.ArenaInfoOrBuilder getArenaInfoOrBuilder() { + return arenaInfo_; + } + + // optional int32 stage = 2; + public static final int STAGE_FIELD_NUMBER = 2; + private int stage_; + /** + * optional int32 stage = 2; + * + *
+     *1 未开始 2 战斗阶段 3 膜拜阶段
+     * 
+ */ + public boolean hasStage() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 stage = 2; + * + *
+     *1 未开始 2 战斗阶段 3 膜拜阶段
+     * 
+ */ + public int getStage() { + return stage_; + } + + // optional int32 endTime = 3; + public static final int ENDTIME_FIELD_NUMBER = 3; + private int endTime_; + /** + * optional int32 endTime = 3; + * + *
+     *阶段结束时间戳
+     * 
+ */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional int32 endTime = 3; + * + *
+     *阶段结束时间戳
+     * 
+ */ + public int getEndTime() { + return endTime_; + } + + private void initFields() { + arenaInfo_ = rpc.protocols.CommonProto.ArenaInfo.getDefaultInstance(); + stage_ = 0; + endTime_ = 0; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeMessage(1, arenaInfo_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt32(2, stage_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeInt32(3, endTime_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, arenaInfo_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, stage_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, endTime_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static rpc.world.WorldCommonProto.GetWorldArenaInfoResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static rpc.world.WorldCommonProto.GetWorldArenaInfoResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static rpc.world.WorldCommonProto.GetWorldArenaInfoResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static rpc.world.WorldCommonProto.GetWorldArenaInfoResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static rpc.world.WorldCommonProto.GetWorldArenaInfoResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static rpc.world.WorldCommonProto.GetWorldArenaInfoResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static rpc.world.WorldCommonProto.GetWorldArenaInfoResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static rpc.world.WorldCommonProto.GetWorldArenaInfoResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static rpc.world.WorldCommonProto.GetWorldArenaInfoResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static rpc.world.WorldCommonProto.GetWorldArenaInfoResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(rpc.world.WorldCommonProto.GetWorldArenaInfoResponse prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code rpc.world.GetWorldArenaInfoResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements rpc.world.WorldCommonProto.GetWorldArenaInfoResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaInfoResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaInfoResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + rpc.world.WorldCommonProto.GetWorldArenaInfoResponse.class, rpc.world.WorldCommonProto.GetWorldArenaInfoResponse.Builder.class); + } + + // Construct using rpc.world.WorldCommonProto.GetWorldArenaInfoResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getArenaInfoFieldBuilder(); + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + if (arenaInfoBuilder_ == null) { + arenaInfo_ = rpc.protocols.CommonProto.ArenaInfo.getDefaultInstance(); + } else { + arenaInfoBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + stage_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + endTime_ = 0; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaInfoResponse_descriptor; + } + + public rpc.world.WorldCommonProto.GetWorldArenaInfoResponse getDefaultInstanceForType() { + return rpc.world.WorldCommonProto.GetWorldArenaInfoResponse.getDefaultInstance(); + } + + public rpc.world.WorldCommonProto.GetWorldArenaInfoResponse build() { + rpc.world.WorldCommonProto.GetWorldArenaInfoResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public rpc.world.WorldCommonProto.GetWorldArenaInfoResponse buildPartial() { + rpc.world.WorldCommonProto.GetWorldArenaInfoResponse result = new rpc.world.WorldCommonProto.GetWorldArenaInfoResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + if (arenaInfoBuilder_ == null) { + result.arenaInfo_ = arenaInfo_; + } else { + result.arenaInfo_ = arenaInfoBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.stage_ = stage_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.endTime_ = endTime_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof rpc.world.WorldCommonProto.GetWorldArenaInfoResponse) { + return mergeFrom((rpc.world.WorldCommonProto.GetWorldArenaInfoResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(rpc.world.WorldCommonProto.GetWorldArenaInfoResponse other) { + if (other == rpc.world.WorldCommonProto.GetWorldArenaInfoResponse.getDefaultInstance()) return this; + if (other.hasArenaInfo()) { + mergeArenaInfo(other.getArenaInfo()); + } + if (other.hasStage()) { + setStage(other.getStage()); + } + if (other.hasEndTime()) { + setEndTime(other.getEndTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + rpc.world.WorldCommonProto.GetWorldArenaInfoResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (rpc.world.WorldCommonProto.GetWorldArenaInfoResponse) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // optional .rpc.protocols.ArenaInfo arenaInfo = 1; + private rpc.protocols.CommonProto.ArenaInfo arenaInfo_ = rpc.protocols.CommonProto.ArenaInfo.getDefaultInstance(); + private com.google.protobuf.SingleFieldBuilder< + rpc.protocols.CommonProto.ArenaInfo, rpc.protocols.CommonProto.ArenaInfo.Builder, rpc.protocols.CommonProto.ArenaInfoOrBuilder> arenaInfoBuilder_; + /** + * optional .rpc.protocols.ArenaInfo arenaInfo = 1; + */ + public boolean hasArenaInfo() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional .rpc.protocols.ArenaInfo arenaInfo = 1; + */ + public rpc.protocols.CommonProto.ArenaInfo getArenaInfo() { + if (arenaInfoBuilder_ == null) { + return arenaInfo_; + } else { + return arenaInfoBuilder_.getMessage(); + } + } + /** + * optional .rpc.protocols.ArenaInfo arenaInfo = 1; + */ + public Builder setArenaInfo(rpc.protocols.CommonProto.ArenaInfo value) { + if (arenaInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + arenaInfo_ = value; + onChanged(); + } else { + arenaInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * optional .rpc.protocols.ArenaInfo arenaInfo = 1; + */ + public Builder setArenaInfo( + rpc.protocols.CommonProto.ArenaInfo.Builder builderForValue) { + if (arenaInfoBuilder_ == null) { + arenaInfo_ = builderForValue.build(); + onChanged(); + } else { + arenaInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * optional .rpc.protocols.ArenaInfo arenaInfo = 1; + */ + public Builder mergeArenaInfo(rpc.protocols.CommonProto.ArenaInfo value) { + if (arenaInfoBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001) && + arenaInfo_ != rpc.protocols.CommonProto.ArenaInfo.getDefaultInstance()) { + arenaInfo_ = + rpc.protocols.CommonProto.ArenaInfo.newBuilder(arenaInfo_).mergeFrom(value).buildPartial(); + } else { + arenaInfo_ = value; + } + onChanged(); + } else { + arenaInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * optional .rpc.protocols.ArenaInfo arenaInfo = 1; + */ + public Builder clearArenaInfo() { + if (arenaInfoBuilder_ == null) { + arenaInfo_ = rpc.protocols.CommonProto.ArenaInfo.getDefaultInstance(); + onChanged(); + } else { + arenaInfoBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + /** + * optional .rpc.protocols.ArenaInfo arenaInfo = 1; + */ + public rpc.protocols.CommonProto.ArenaInfo.Builder getArenaInfoBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getArenaInfoFieldBuilder().getBuilder(); + } + /** + * optional .rpc.protocols.ArenaInfo arenaInfo = 1; + */ + public rpc.protocols.CommonProto.ArenaInfoOrBuilder getArenaInfoOrBuilder() { + if (arenaInfoBuilder_ != null) { + return arenaInfoBuilder_.getMessageOrBuilder(); + } else { + return arenaInfo_; + } + } + /** + * optional .rpc.protocols.ArenaInfo arenaInfo = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + rpc.protocols.CommonProto.ArenaInfo, rpc.protocols.CommonProto.ArenaInfo.Builder, rpc.protocols.CommonProto.ArenaInfoOrBuilder> + getArenaInfoFieldBuilder() { + if (arenaInfoBuilder_ == null) { + arenaInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder< + rpc.protocols.CommonProto.ArenaInfo, rpc.protocols.CommonProto.ArenaInfo.Builder, rpc.protocols.CommonProto.ArenaInfoOrBuilder>( + arenaInfo_, + getParentForChildren(), + isClean()); + arenaInfo_ = null; + } + return arenaInfoBuilder_; + } + + // optional int32 stage = 2; + private int stage_ ; + /** + * optional int32 stage = 2; + * + *
+       *1 未开始 2 战斗阶段 3 膜拜阶段
+       * 
+ */ + public boolean hasStage() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 stage = 2; + * + *
+       *1 未开始 2 战斗阶段 3 膜拜阶段
+       * 
+ */ + public int getStage() { + return stage_; + } + /** + * optional int32 stage = 2; + * + *
+       *1 未开始 2 战斗阶段 3 膜拜阶段
+       * 
+ */ + public Builder setStage(int value) { + bitField0_ |= 0x00000002; + stage_ = value; + onChanged(); + return this; + } + /** + * optional int32 stage = 2; + * + *
+       *1 未开始 2 战斗阶段 3 膜拜阶段
+       * 
+ */ + public Builder clearStage() { + bitField0_ = (bitField0_ & ~0x00000002); + stage_ = 0; + onChanged(); + return this; + } + + // optional int32 endTime = 3; + private int endTime_ ; + /** + * optional int32 endTime = 3; + * + *
+       *阶段结束时间戳
+       * 
+ */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional int32 endTime = 3; + * + *
+       *阶段结束时间戳
+       * 
+ */ + public int getEndTime() { + return endTime_; + } + /** + * optional int32 endTime = 3; + * + *
+       *阶段结束时间戳
+       * 
+ */ + public Builder setEndTime(int value) { + bitField0_ |= 0x00000004; + endTime_ = value; + onChanged(); + return this; + } + /** + * optional int32 endTime = 3; + * + *
+       *阶段结束时间戳
+       * 
+ */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000004); + endTime_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:rpc.world.GetWorldArenaInfoResponse) + } + + static { + defaultInstance = new GetWorldArenaInfoResponse(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:rpc.world.GetWorldArenaInfoResponse) + } + + public interface GetWorldArenaInfoIndicationOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // optional .rpc.protocols.ArenaInfo arenaInfo = 1; + /** + * optional .rpc.protocols.ArenaInfo arenaInfo = 1; + */ + boolean hasArenaInfo(); + /** + * optional .rpc.protocols.ArenaInfo arenaInfo = 1; + */ + rpc.protocols.CommonProto.ArenaInfo getArenaInfo(); + /** + * optional .rpc.protocols.ArenaInfo arenaInfo = 1; + */ + rpc.protocols.CommonProto.ArenaInfoOrBuilder getArenaInfoOrBuilder(); + + // optional int32 stage = 2; + /** + * optional int32 stage = 2; + * + *
+     *1 未开始 2 战斗阶段 3 膜拜阶段
+     * 
+ */ + boolean hasStage(); + /** + * optional int32 stage = 2; + * + *
+     *1 未开始 2 战斗阶段 3 膜拜阶段
+     * 
+ */ + int getStage(); + + // optional int32 endTime = 3; + /** + * optional int32 endTime = 3; + * + *
+     *阶段结束时间戳
+     * 
+ */ + boolean hasEndTime(); + /** + * optional int32 endTime = 3; + * + *
+     *阶段结束时间戳
+     * 
+ */ + int getEndTime(); + } + /** + * Protobuf type {@code rpc.world.GetWorldArenaInfoIndication} + */ + public static final class GetWorldArenaInfoIndication extends + com.google.protobuf.GeneratedMessage + implements GetWorldArenaInfoIndicationOrBuilder { + // Use GetWorldArenaInfoIndication.newBuilder() to construct. + private GetWorldArenaInfoIndication(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private GetWorldArenaInfoIndication(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final GetWorldArenaInfoIndication defaultInstance; + public static GetWorldArenaInfoIndication getDefaultInstance() { + return defaultInstance; + } + + public GetWorldArenaInfoIndication getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetWorldArenaInfoIndication( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + 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; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + rpc.protocols.CommonProto.ArenaInfo.Builder subBuilder = null; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + subBuilder = arenaInfo_.toBuilder(); + } + arenaInfo_ = input.readMessage(rpc.protocols.CommonProto.ArenaInfo.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(arenaInfo_); + arenaInfo_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000001; + break; + } + case 16: { + bitField0_ |= 0x00000002; + stage_ = input.readInt32(); + break; + } + case 24: { + bitField0_ |= 0x00000004; + endTime_ = input.readInt32(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaInfoIndication_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaInfoIndication_fieldAccessorTable + .ensureFieldAccessorsInitialized( + rpc.world.WorldCommonProto.GetWorldArenaInfoIndication.class, rpc.world.WorldCommonProto.GetWorldArenaInfoIndication.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public GetWorldArenaInfoIndication parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetWorldArenaInfoIndication(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + // optional .rpc.protocols.ArenaInfo arenaInfo = 1; + public static final int ARENAINFO_FIELD_NUMBER = 1; + private rpc.protocols.CommonProto.ArenaInfo arenaInfo_; + /** + * optional .rpc.protocols.ArenaInfo arenaInfo = 1; + */ + public boolean hasArenaInfo() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional .rpc.protocols.ArenaInfo arenaInfo = 1; + */ + public rpc.protocols.CommonProto.ArenaInfo getArenaInfo() { + return arenaInfo_; + } + /** + * optional .rpc.protocols.ArenaInfo arenaInfo = 1; + */ + public rpc.protocols.CommonProto.ArenaInfoOrBuilder getArenaInfoOrBuilder() { + return arenaInfo_; + } + + // optional int32 stage = 2; + public static final int STAGE_FIELD_NUMBER = 2; + private int stage_; + /** + * optional int32 stage = 2; + * + *
+     *1 未开始 2 战斗阶段 3 膜拜阶段
+     * 
+ */ + public boolean hasStage() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 stage = 2; + * + *
+     *1 未开始 2 战斗阶段 3 膜拜阶段
+     * 
+ */ + public int getStage() { + return stage_; + } + + // optional int32 endTime = 3; + public static final int ENDTIME_FIELD_NUMBER = 3; + private int endTime_; + /** + * optional int32 endTime = 3; + * + *
+     *阶段结束时间戳
+     * 
+ */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional int32 endTime = 3; + * + *
+     *阶段结束时间戳
+     * 
+ */ + public int getEndTime() { + return endTime_; + } + + private void initFields() { + arenaInfo_ = rpc.protocols.CommonProto.ArenaInfo.getDefaultInstance(); + stage_ = 0; + endTime_ = 0; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeMessage(1, arenaInfo_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt32(2, stage_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeInt32(3, endTime_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, arenaInfo_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, stage_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, endTime_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static rpc.world.WorldCommonProto.GetWorldArenaInfoIndication parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static rpc.world.WorldCommonProto.GetWorldArenaInfoIndication parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static rpc.world.WorldCommonProto.GetWorldArenaInfoIndication parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static rpc.world.WorldCommonProto.GetWorldArenaInfoIndication parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static rpc.world.WorldCommonProto.GetWorldArenaInfoIndication parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static rpc.world.WorldCommonProto.GetWorldArenaInfoIndication parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static rpc.world.WorldCommonProto.GetWorldArenaInfoIndication parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static rpc.world.WorldCommonProto.GetWorldArenaInfoIndication parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static rpc.world.WorldCommonProto.GetWorldArenaInfoIndication parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static rpc.world.WorldCommonProto.GetWorldArenaInfoIndication parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(rpc.world.WorldCommonProto.GetWorldArenaInfoIndication prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code rpc.world.GetWorldArenaInfoIndication} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements rpc.world.WorldCommonProto.GetWorldArenaInfoIndicationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaInfoIndication_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaInfoIndication_fieldAccessorTable + .ensureFieldAccessorsInitialized( + rpc.world.WorldCommonProto.GetWorldArenaInfoIndication.class, rpc.world.WorldCommonProto.GetWorldArenaInfoIndication.Builder.class); + } + + // Construct using rpc.world.WorldCommonProto.GetWorldArenaInfoIndication.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getArenaInfoFieldBuilder(); + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + if (arenaInfoBuilder_ == null) { + arenaInfo_ = rpc.protocols.CommonProto.ArenaInfo.getDefaultInstance(); + } else { + arenaInfoBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + stage_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + endTime_ = 0; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaInfoIndication_descriptor; + } + + public rpc.world.WorldCommonProto.GetWorldArenaInfoIndication getDefaultInstanceForType() { + return rpc.world.WorldCommonProto.GetWorldArenaInfoIndication.getDefaultInstance(); + } + + public rpc.world.WorldCommonProto.GetWorldArenaInfoIndication build() { + rpc.world.WorldCommonProto.GetWorldArenaInfoIndication result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public rpc.world.WorldCommonProto.GetWorldArenaInfoIndication buildPartial() { + rpc.world.WorldCommonProto.GetWorldArenaInfoIndication result = new rpc.world.WorldCommonProto.GetWorldArenaInfoIndication(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + if (arenaInfoBuilder_ == null) { + result.arenaInfo_ = arenaInfo_; + } else { + result.arenaInfo_ = arenaInfoBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.stage_ = stage_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.endTime_ = endTime_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof rpc.world.WorldCommonProto.GetWorldArenaInfoIndication) { + return mergeFrom((rpc.world.WorldCommonProto.GetWorldArenaInfoIndication)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(rpc.world.WorldCommonProto.GetWorldArenaInfoIndication other) { + if (other == rpc.world.WorldCommonProto.GetWorldArenaInfoIndication.getDefaultInstance()) return this; + if (other.hasArenaInfo()) { + mergeArenaInfo(other.getArenaInfo()); + } + if (other.hasStage()) { + setStage(other.getStage()); + } + if (other.hasEndTime()) { + setEndTime(other.getEndTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + rpc.world.WorldCommonProto.GetWorldArenaInfoIndication parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (rpc.world.WorldCommonProto.GetWorldArenaInfoIndication) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // optional .rpc.protocols.ArenaInfo arenaInfo = 1; + private rpc.protocols.CommonProto.ArenaInfo arenaInfo_ = rpc.protocols.CommonProto.ArenaInfo.getDefaultInstance(); + private com.google.protobuf.SingleFieldBuilder< + rpc.protocols.CommonProto.ArenaInfo, rpc.protocols.CommonProto.ArenaInfo.Builder, rpc.protocols.CommonProto.ArenaInfoOrBuilder> arenaInfoBuilder_; + /** + * optional .rpc.protocols.ArenaInfo arenaInfo = 1; + */ + public boolean hasArenaInfo() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional .rpc.protocols.ArenaInfo arenaInfo = 1; + */ + public rpc.protocols.CommonProto.ArenaInfo getArenaInfo() { + if (arenaInfoBuilder_ == null) { + return arenaInfo_; + } else { + return arenaInfoBuilder_.getMessage(); + } + } + /** + * optional .rpc.protocols.ArenaInfo arenaInfo = 1; + */ + public Builder setArenaInfo(rpc.protocols.CommonProto.ArenaInfo value) { + if (arenaInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + arenaInfo_ = value; + onChanged(); + } else { + arenaInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * optional .rpc.protocols.ArenaInfo arenaInfo = 1; + */ + public Builder setArenaInfo( + rpc.protocols.CommonProto.ArenaInfo.Builder builderForValue) { + if (arenaInfoBuilder_ == null) { + arenaInfo_ = builderForValue.build(); + onChanged(); + } else { + arenaInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * optional .rpc.protocols.ArenaInfo arenaInfo = 1; + */ + public Builder mergeArenaInfo(rpc.protocols.CommonProto.ArenaInfo value) { + if (arenaInfoBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001) && + arenaInfo_ != rpc.protocols.CommonProto.ArenaInfo.getDefaultInstance()) { + arenaInfo_ = + rpc.protocols.CommonProto.ArenaInfo.newBuilder(arenaInfo_).mergeFrom(value).buildPartial(); + } else { + arenaInfo_ = value; + } + onChanged(); + } else { + arenaInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * optional .rpc.protocols.ArenaInfo arenaInfo = 1; + */ + public Builder clearArenaInfo() { + if (arenaInfoBuilder_ == null) { + arenaInfo_ = rpc.protocols.CommonProto.ArenaInfo.getDefaultInstance(); + onChanged(); + } else { + arenaInfoBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + /** + * optional .rpc.protocols.ArenaInfo arenaInfo = 1; + */ + public rpc.protocols.CommonProto.ArenaInfo.Builder getArenaInfoBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getArenaInfoFieldBuilder().getBuilder(); + } + /** + * optional .rpc.protocols.ArenaInfo arenaInfo = 1; + */ + public rpc.protocols.CommonProto.ArenaInfoOrBuilder getArenaInfoOrBuilder() { + if (arenaInfoBuilder_ != null) { + return arenaInfoBuilder_.getMessageOrBuilder(); + } else { + return arenaInfo_; + } + } + /** + * optional .rpc.protocols.ArenaInfo arenaInfo = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + rpc.protocols.CommonProto.ArenaInfo, rpc.protocols.CommonProto.ArenaInfo.Builder, rpc.protocols.CommonProto.ArenaInfoOrBuilder> + getArenaInfoFieldBuilder() { + if (arenaInfoBuilder_ == null) { + arenaInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder< + rpc.protocols.CommonProto.ArenaInfo, rpc.protocols.CommonProto.ArenaInfo.Builder, rpc.protocols.CommonProto.ArenaInfoOrBuilder>( + arenaInfo_, + getParentForChildren(), + isClean()); + arenaInfo_ = null; + } + return arenaInfoBuilder_; + } + + // optional int32 stage = 2; + private int stage_ ; + /** + * optional int32 stage = 2; + * + *
+       *1 未开始 2 战斗阶段 3 膜拜阶段
+       * 
+ */ + public boolean hasStage() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 stage = 2; + * + *
+       *1 未开始 2 战斗阶段 3 膜拜阶段
+       * 
+ */ + public int getStage() { + return stage_; + } + /** + * optional int32 stage = 2; + * + *
+       *1 未开始 2 战斗阶段 3 膜拜阶段
+       * 
+ */ + public Builder setStage(int value) { + bitField0_ |= 0x00000002; + stage_ = value; + onChanged(); + return this; + } + /** + * optional int32 stage = 2; + * + *
+       *1 未开始 2 战斗阶段 3 膜拜阶段
+       * 
+ */ + public Builder clearStage() { + bitField0_ = (bitField0_ & ~0x00000002); + stage_ = 0; + onChanged(); + return this; + } + + // optional int32 endTime = 3; + private int endTime_ ; + /** + * optional int32 endTime = 3; + * + *
+       *阶段结束时间戳
+       * 
+ */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional int32 endTime = 3; + * + *
+       *阶段结束时间戳
+       * 
+ */ + public int getEndTime() { + return endTime_; + } + /** + * optional int32 endTime = 3; + * + *
+       *阶段结束时间戳
+       * 
+ */ + public Builder setEndTime(int value) { + bitField0_ |= 0x00000004; + endTime_ = value; + onChanged(); + return this; + } + /** + * optional int32 endTime = 3; + * + *
+       *阶段结束时间戳
+       * 
+ */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000004); + endTime_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:rpc.world.GetWorldArenaInfoIndication) + } + + static { + defaultInstance = new GetWorldArenaInfoIndication(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:rpc.world.GetWorldArenaInfoIndication) + } + + public interface GetWorldArenaChallengeRequestOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // optional int32 teamId = 1; + /** + * optional int32 teamId = 1; + * + *
+     * 本人进攻队伍id
+     * 
+ */ + boolean hasTeamId(); + /** + * optional int32 teamId = 1; + * + *
+     * 本人进攻队伍id
+     * 
+ */ + int getTeamId(); + + // optional int32 challengeServerid = 2; + /** + * optional int32 challengeServerid = 2; + * + *
+     * 对手Serverid
+     * 
+ */ + boolean hasChallengeServerid(); + /** + * optional int32 challengeServerid = 2; + * + *
+     * 对手Serverid
+     * 
+ */ + int getChallengeServerid(); + + // optional int32 challengeUid = 3; + /** + * optional int32 challengeUid = 3; + * + *
+     * 对手uid
+     * 
+ */ + boolean hasChallengeUid(); + /** + * optional int32 challengeUid = 3; + * + *
+     * 对手uid
+     * 
+ */ + int getChallengeUid(); + + // optional int32 skipFight = 4; + /** + * optional int32 skipFight = 4; + * + *
+     * 1:标识跳过战斗 0: 不跳过战斗
+     * 
+ */ + boolean hasSkipFight(); + /** + * optional int32 skipFight = 4; + * + *
+     * 1:标识跳过战斗 0: 不跳过战斗
+     * 
+ */ + int getSkipFight(); + } + /** + * Protobuf type {@code rpc.world.GetWorldArenaChallengeRequest} + * + *
+   *跨服天梯挑战
+   * 
+ */ + public static final class GetWorldArenaChallengeRequest extends + com.google.protobuf.GeneratedMessage + implements GetWorldArenaChallengeRequestOrBuilder { + // Use GetWorldArenaChallengeRequest.newBuilder() to construct. + private GetWorldArenaChallengeRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private GetWorldArenaChallengeRequest(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final GetWorldArenaChallengeRequest defaultInstance; + public static GetWorldArenaChallengeRequest getDefaultInstance() { + return defaultInstance; + } + + public GetWorldArenaChallengeRequest getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetWorldArenaChallengeRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + 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; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + teamId_ = input.readInt32(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + challengeServerid_ = input.readInt32(); + break; + } + case 24: { + bitField0_ |= 0x00000004; + challengeUid_ = input.readInt32(); + break; + } + case 32: { + bitField0_ |= 0x00000008; + skipFight_ = input.readInt32(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaChallengeRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaChallengeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + rpc.world.WorldCommonProto.GetWorldArenaChallengeRequest.class, rpc.world.WorldCommonProto.GetWorldArenaChallengeRequest.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public GetWorldArenaChallengeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetWorldArenaChallengeRequest(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + // optional int32 teamId = 1; + public static final int TEAMID_FIELD_NUMBER = 1; + private int teamId_; + /** + * optional int32 teamId = 1; + * + *
+     * 本人进攻队伍id
+     * 
+ */ + public boolean hasTeamId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 teamId = 1; + * + *
+     * 本人进攻队伍id
+     * 
+ */ + public int getTeamId() { + return teamId_; + } + + // optional int32 challengeServerid = 2; + public static final int CHALLENGESERVERID_FIELD_NUMBER = 2; + private int challengeServerid_; + /** + * optional int32 challengeServerid = 2; + * + *
+     * 对手Serverid
+     * 
+ */ + public boolean hasChallengeServerid() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 challengeServerid = 2; + * + *
+     * 对手Serverid
+     * 
+ */ + public int getChallengeServerid() { + return challengeServerid_; + } + + // optional int32 challengeUid = 3; + public static final int CHALLENGEUID_FIELD_NUMBER = 3; + private int challengeUid_; + /** + * optional int32 challengeUid = 3; + * + *
+     * 对手uid
+     * 
+ */ + public boolean hasChallengeUid() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional int32 challengeUid = 3; + * + *
+     * 对手uid
+     * 
+ */ + public int getChallengeUid() { + return challengeUid_; + } + + // optional int32 skipFight = 4; + public static final int SKIPFIGHT_FIELD_NUMBER = 4; + private int skipFight_; + /** + * optional int32 skipFight = 4; + * + *
+     * 1:标识跳过战斗 0: 不跳过战斗
+     * 
+ */ + public boolean hasSkipFight() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional int32 skipFight = 4; + * + *
+     * 1:标识跳过战斗 0: 不跳过战斗
+     * 
+ */ + public int getSkipFight() { + return skipFight_; + } + + private void initFields() { + teamId_ = 0; + challengeServerid_ = 0; + challengeUid_ = 0; + skipFight_ = 0; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(1, teamId_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt32(2, challengeServerid_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeInt32(3, challengeUid_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeInt32(4, skipFight_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, teamId_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, challengeServerid_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, challengeUid_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, skipFight_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static rpc.world.WorldCommonProto.GetWorldArenaChallengeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static rpc.world.WorldCommonProto.GetWorldArenaChallengeRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static rpc.world.WorldCommonProto.GetWorldArenaChallengeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static rpc.world.WorldCommonProto.GetWorldArenaChallengeRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static rpc.world.WorldCommonProto.GetWorldArenaChallengeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static rpc.world.WorldCommonProto.GetWorldArenaChallengeRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static rpc.world.WorldCommonProto.GetWorldArenaChallengeRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static rpc.world.WorldCommonProto.GetWorldArenaChallengeRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static rpc.world.WorldCommonProto.GetWorldArenaChallengeRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static rpc.world.WorldCommonProto.GetWorldArenaChallengeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(rpc.world.WorldCommonProto.GetWorldArenaChallengeRequest prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code rpc.world.GetWorldArenaChallengeRequest} + * + *
+     *跨服天梯挑战
+     * 
+ */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements rpc.world.WorldCommonProto.GetWorldArenaChallengeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaChallengeRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaChallengeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + rpc.world.WorldCommonProto.GetWorldArenaChallengeRequest.class, rpc.world.WorldCommonProto.GetWorldArenaChallengeRequest.Builder.class); + } + + // Construct using rpc.world.WorldCommonProto.GetWorldArenaChallengeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + teamId_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + challengeServerid_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + challengeUid_ = 0; + bitField0_ = (bitField0_ & ~0x00000004); + skipFight_ = 0; + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaChallengeRequest_descriptor; + } + + public rpc.world.WorldCommonProto.GetWorldArenaChallengeRequest getDefaultInstanceForType() { + return rpc.world.WorldCommonProto.GetWorldArenaChallengeRequest.getDefaultInstance(); + } + + public rpc.world.WorldCommonProto.GetWorldArenaChallengeRequest build() { + rpc.world.WorldCommonProto.GetWorldArenaChallengeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public rpc.world.WorldCommonProto.GetWorldArenaChallengeRequest buildPartial() { + rpc.world.WorldCommonProto.GetWorldArenaChallengeRequest result = new rpc.world.WorldCommonProto.GetWorldArenaChallengeRequest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.teamId_ = teamId_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.challengeServerid_ = challengeServerid_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.challengeUid_ = challengeUid_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.skipFight_ = skipFight_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof rpc.world.WorldCommonProto.GetWorldArenaChallengeRequest) { + return mergeFrom((rpc.world.WorldCommonProto.GetWorldArenaChallengeRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(rpc.world.WorldCommonProto.GetWorldArenaChallengeRequest other) { + if (other == rpc.world.WorldCommonProto.GetWorldArenaChallengeRequest.getDefaultInstance()) return this; + if (other.hasTeamId()) { + setTeamId(other.getTeamId()); + } + if (other.hasChallengeServerid()) { + setChallengeServerid(other.getChallengeServerid()); + } + if (other.hasChallengeUid()) { + setChallengeUid(other.getChallengeUid()); + } + if (other.hasSkipFight()) { + setSkipFight(other.getSkipFight()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + rpc.world.WorldCommonProto.GetWorldArenaChallengeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (rpc.world.WorldCommonProto.GetWorldArenaChallengeRequest) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // optional int32 teamId = 1; + private int teamId_ ; + /** + * optional int32 teamId = 1; + * + *
+       * 本人进攻队伍id
+       * 
+ */ + public boolean hasTeamId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 teamId = 1; + * + *
+       * 本人进攻队伍id
+       * 
+ */ + public int getTeamId() { + return teamId_; + } + /** + * optional int32 teamId = 1; + * + *
+       * 本人进攻队伍id
+       * 
+ */ + public Builder setTeamId(int value) { + bitField0_ |= 0x00000001; + teamId_ = value; + onChanged(); + return this; + } + /** + * optional int32 teamId = 1; + * + *
+       * 本人进攻队伍id
+       * 
+ */ + public Builder clearTeamId() { + bitField0_ = (bitField0_ & ~0x00000001); + teamId_ = 0; + onChanged(); + return this; + } + + // optional int32 challengeServerid = 2; + private int challengeServerid_ ; + /** + * optional int32 challengeServerid = 2; + * + *
+       * 对手Serverid
+       * 
+ */ + public boolean hasChallengeServerid() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 challengeServerid = 2; + * + *
+       * 对手Serverid
+       * 
+ */ + public int getChallengeServerid() { + return challengeServerid_; + } + /** + * optional int32 challengeServerid = 2; + * + *
+       * 对手Serverid
+       * 
+ */ + public Builder setChallengeServerid(int value) { + bitField0_ |= 0x00000002; + challengeServerid_ = value; + onChanged(); + return this; + } + /** + * optional int32 challengeServerid = 2; + * + *
+       * 对手Serverid
+       * 
+ */ + public Builder clearChallengeServerid() { + bitField0_ = (bitField0_ & ~0x00000002); + challengeServerid_ = 0; + onChanged(); + return this; + } + + // optional int32 challengeUid = 3; + private int challengeUid_ ; + /** + * optional int32 challengeUid = 3; + * + *
+       * 对手uid
+       * 
+ */ + public boolean hasChallengeUid() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional int32 challengeUid = 3; + * + *
+       * 对手uid
+       * 
+ */ + public int getChallengeUid() { + return challengeUid_; + } + /** + * optional int32 challengeUid = 3; + * + *
+       * 对手uid
+       * 
+ */ + public Builder setChallengeUid(int value) { + bitField0_ |= 0x00000004; + challengeUid_ = value; + onChanged(); + return this; + } + /** + * optional int32 challengeUid = 3; + * + *
+       * 对手uid
+       * 
+ */ + public Builder clearChallengeUid() { + bitField0_ = (bitField0_ & ~0x00000004); + challengeUid_ = 0; + onChanged(); + return this; + } + + // optional int32 skipFight = 4; + private int skipFight_ ; + /** + * optional int32 skipFight = 4; + * + *
+       * 1:标识跳过战斗 0: 不跳过战斗
+       * 
+ */ + public boolean hasSkipFight() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional int32 skipFight = 4; + * + *
+       * 1:标识跳过战斗 0: 不跳过战斗
+       * 
+ */ + public int getSkipFight() { + return skipFight_; + } + /** + * optional int32 skipFight = 4; + * + *
+       * 1:标识跳过战斗 0: 不跳过战斗
+       * 
+ */ + public Builder setSkipFight(int value) { + bitField0_ |= 0x00000008; + skipFight_ = value; + onChanged(); + return this; + } + /** + * optional int32 skipFight = 4; + * + *
+       * 1:标识跳过战斗 0: 不跳过战斗
+       * 
+ */ + public Builder clearSkipFight() { + bitField0_ = (bitField0_ & ~0x00000008); + skipFight_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:rpc.world.GetWorldArenaChallengeRequest) + } + + static { + defaultInstance = new GetWorldArenaChallengeRequest(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:rpc.world.GetWorldArenaChallengeRequest) + } + + public interface GetWorldArenaChallengeResponseOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // optional int32 mySortChange = 1; + /** + * optional int32 mySortChange = 1; + * + *
+     *我的名次变化值
+     * 
+ */ + boolean hasMySortChange(); + /** + * optional int32 mySortChange = 1; + * + *
+     *我的名次变化值
+     * 
+ */ + int getMySortChange(); + + // repeated .rpc.protocols.ArenaEnemy arenaEnemys = 2; + /** + * repeated .rpc.protocols.ArenaEnemy arenaEnemys = 2; + * + *
+     *新的一批对手信息
+     * 
+ */ + java.util.List + getArenaEnemysList(); + /** + * repeated .rpc.protocols.ArenaEnemy arenaEnemys = 2; + * + *
+     *新的一批对手信息
+     * 
+ */ + rpc.protocols.CommonProto.ArenaEnemy getArenaEnemys(int index); + /** + * repeated .rpc.protocols.ArenaEnemy arenaEnemys = 2; + * + *
+     *新的一批对手信息
+     * 
+ */ + int getArenaEnemysCount(); + /** + * repeated .rpc.protocols.ArenaEnemy arenaEnemys = 2; + * + *
+     *新的一批对手信息
+     * 
+ */ + java.util.List + getArenaEnemysOrBuilderList(); + /** + * repeated .rpc.protocols.ArenaEnemy arenaEnemys = 2; + * + *
+     *新的一批对手信息
+     * 
+ */ + rpc.protocols.CommonProto.ArenaEnemyOrBuilder getArenaEnemysOrBuilder( + int index); + + // optional .rpc.protocols.FightData fightData = 3; + /** + * optional .rpc.protocols.FightData fightData = 3; + * + *
+     * 战斗数据 
+     * 
+ */ + boolean hasFightData(); + /** + * optional .rpc.protocols.FightData fightData = 3; + * + *
+     * 战斗数据 
+     * 
+ */ + rpc.protocols.CommonProto.FightData getFightData(); + /** + * optional .rpc.protocols.FightData fightData = 3; + * + *
+     * 战斗数据 
+     * 
+ */ + rpc.protocols.CommonProto.FightDataOrBuilder getFightDataOrBuilder(); + + // optional int32 fightResult = 4; + /** + * optional int32 fightResult = 4; + * + *
+     * 战斗结果 -1 时 表示挑战目标排名发生变化 需刷新
+     * 
+ */ + boolean hasFightResult(); + /** + * optional int32 fightResult = 4; + * + *
+     * 战斗结果 -1 时 表示挑战目标排名发生变化 需刷新
+     * 
+ */ + int getFightResult(); + + // optional .rpc.protocols.Drop drop = 5; + /** + * optional .rpc.protocols.Drop drop = 5; + */ + boolean hasDrop(); + /** + * optional .rpc.protocols.Drop drop = 5; + */ + rpc.protocols.CommonProto.Drop getDrop(); + /** + * optional .rpc.protocols.Drop drop = 5; + */ + rpc.protocols.CommonProto.DropOrBuilder getDropOrBuilder(); + } + /** + * Protobuf type {@code rpc.world.GetWorldArenaChallengeResponse} + */ + public static final class GetWorldArenaChallengeResponse extends + com.google.protobuf.GeneratedMessage + implements GetWorldArenaChallengeResponseOrBuilder { + // Use GetWorldArenaChallengeResponse.newBuilder() to construct. + private GetWorldArenaChallengeResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private GetWorldArenaChallengeResponse(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final GetWorldArenaChallengeResponse defaultInstance; + public static GetWorldArenaChallengeResponse getDefaultInstance() { + return defaultInstance; + } + + public GetWorldArenaChallengeResponse getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetWorldArenaChallengeResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + 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; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + mySortChange_ = input.readInt32(); + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + arenaEnemys_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + arenaEnemys_.add(input.readMessage(rpc.protocols.CommonProto.ArenaEnemy.PARSER, extensionRegistry)); + break; + } + case 26: { + rpc.protocols.CommonProto.FightData.Builder subBuilder = null; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + subBuilder = fightData_.toBuilder(); + } + fightData_ = input.readMessage(rpc.protocols.CommonProto.FightData.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(fightData_); + fightData_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000002; + break; + } + case 32: { + bitField0_ |= 0x00000004; + fightResult_ = input.readInt32(); + break; + } + case 42: { + rpc.protocols.CommonProto.Drop.Builder subBuilder = null; + if (((bitField0_ & 0x00000008) == 0x00000008)) { + subBuilder = drop_.toBuilder(); + } + drop_ = input.readMessage(rpc.protocols.CommonProto.Drop.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(drop_); + drop_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000008; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + arenaEnemys_ = java.util.Collections.unmodifiableList(arenaEnemys_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaChallengeResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaChallengeResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + rpc.world.WorldCommonProto.GetWorldArenaChallengeResponse.class, rpc.world.WorldCommonProto.GetWorldArenaChallengeResponse.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public GetWorldArenaChallengeResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetWorldArenaChallengeResponse(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + // optional int32 mySortChange = 1; + public static final int MYSORTCHANGE_FIELD_NUMBER = 1; + private int mySortChange_; + /** + * optional int32 mySortChange = 1; + * + *
+     *我的名次变化值
+     * 
+ */ + public boolean hasMySortChange() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 mySortChange = 1; + * + *
+     *我的名次变化值
+     * 
+ */ + public int getMySortChange() { + return mySortChange_; + } + + // repeated .rpc.protocols.ArenaEnemy arenaEnemys = 2; + public static final int ARENAENEMYS_FIELD_NUMBER = 2; + private java.util.List arenaEnemys_; + /** + * repeated .rpc.protocols.ArenaEnemy arenaEnemys = 2; + * + *
+     *新的一批对手信息
+     * 
+ */ + public java.util.List getArenaEnemysList() { + return arenaEnemys_; + } + /** + * repeated .rpc.protocols.ArenaEnemy arenaEnemys = 2; + * + *
+     *新的一批对手信息
+     * 
+ */ + public java.util.List + getArenaEnemysOrBuilderList() { + return arenaEnemys_; + } + /** + * repeated .rpc.protocols.ArenaEnemy arenaEnemys = 2; + * + *
+     *新的一批对手信息
+     * 
+ */ + public int getArenaEnemysCount() { + return arenaEnemys_.size(); + } + /** + * repeated .rpc.protocols.ArenaEnemy arenaEnemys = 2; + * + *
+     *新的一批对手信息
+     * 
+ */ + public rpc.protocols.CommonProto.ArenaEnemy getArenaEnemys(int index) { + return arenaEnemys_.get(index); + } + /** + * repeated .rpc.protocols.ArenaEnemy arenaEnemys = 2; + * + *
+     *新的一批对手信息
+     * 
+ */ + public rpc.protocols.CommonProto.ArenaEnemyOrBuilder getArenaEnemysOrBuilder( + int index) { + return arenaEnemys_.get(index); + } + + // optional .rpc.protocols.FightData fightData = 3; + public static final int FIGHTDATA_FIELD_NUMBER = 3; + private rpc.protocols.CommonProto.FightData fightData_; + /** + * optional .rpc.protocols.FightData fightData = 3; + * + *
+     * 战斗数据 
+     * 
+ */ + public boolean hasFightData() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional .rpc.protocols.FightData fightData = 3; + * + *
+     * 战斗数据 
+     * 
+ */ + public rpc.protocols.CommonProto.FightData getFightData() { + return fightData_; + } + /** + * optional .rpc.protocols.FightData fightData = 3; + * + *
+     * 战斗数据 
+     * 
+ */ + public rpc.protocols.CommonProto.FightDataOrBuilder getFightDataOrBuilder() { + return fightData_; + } + + // optional int32 fightResult = 4; + public static final int FIGHTRESULT_FIELD_NUMBER = 4; + private int fightResult_; + /** + * optional int32 fightResult = 4; + * + *
+     * 战斗结果 -1 时 表示挑战目标排名发生变化 需刷新
+     * 
+ */ + public boolean hasFightResult() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional int32 fightResult = 4; + * + *
+     * 战斗结果 -1 时 表示挑战目标排名发生变化 需刷新
+     * 
+ */ + public int getFightResult() { + return fightResult_; + } + + // optional .rpc.protocols.Drop drop = 5; + public static final int DROP_FIELD_NUMBER = 5; + private rpc.protocols.CommonProto.Drop drop_; + /** + * optional .rpc.protocols.Drop drop = 5; + */ + public boolean hasDrop() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional .rpc.protocols.Drop drop = 5; + */ + public rpc.protocols.CommonProto.Drop getDrop() { + return drop_; + } + /** + * optional .rpc.protocols.Drop drop = 5; + */ + public rpc.protocols.CommonProto.DropOrBuilder getDropOrBuilder() { + return drop_; + } + + private void initFields() { + mySortChange_ = 0; + arenaEnemys_ = java.util.Collections.emptyList(); + fightData_ = rpc.protocols.CommonProto.FightData.getDefaultInstance(); + fightResult_ = 0; + drop_ = rpc.protocols.CommonProto.Drop.getDefaultInstance(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(1, mySortChange_); + } + for (int i = 0; i < arenaEnemys_.size(); i++) { + output.writeMessage(2, arenaEnemys_.get(i)); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeMessage(3, fightData_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeInt32(4, fightResult_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeMessage(5, drop_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, mySortChange_); + } + for (int i = 0; i < arenaEnemys_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, arenaEnemys_.get(i)); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, fightData_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, fightResult_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, drop_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static rpc.world.WorldCommonProto.GetWorldArenaChallengeResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static rpc.world.WorldCommonProto.GetWorldArenaChallengeResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static rpc.world.WorldCommonProto.GetWorldArenaChallengeResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static rpc.world.WorldCommonProto.GetWorldArenaChallengeResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static rpc.world.WorldCommonProto.GetWorldArenaChallengeResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static rpc.world.WorldCommonProto.GetWorldArenaChallengeResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static rpc.world.WorldCommonProto.GetWorldArenaChallengeResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static rpc.world.WorldCommonProto.GetWorldArenaChallengeResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static rpc.world.WorldCommonProto.GetWorldArenaChallengeResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static rpc.world.WorldCommonProto.GetWorldArenaChallengeResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(rpc.world.WorldCommonProto.GetWorldArenaChallengeResponse prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code rpc.world.GetWorldArenaChallengeResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements rpc.world.WorldCommonProto.GetWorldArenaChallengeResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaChallengeResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaChallengeResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + rpc.world.WorldCommonProto.GetWorldArenaChallengeResponse.class, rpc.world.WorldCommonProto.GetWorldArenaChallengeResponse.Builder.class); + } + + // Construct using rpc.world.WorldCommonProto.GetWorldArenaChallengeResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getArenaEnemysFieldBuilder(); + getFightDataFieldBuilder(); + getDropFieldBuilder(); + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + mySortChange_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + if (arenaEnemysBuilder_ == null) { + arenaEnemys_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + arenaEnemysBuilder_.clear(); + } + if (fightDataBuilder_ == null) { + fightData_ = rpc.protocols.CommonProto.FightData.getDefaultInstance(); + } else { + fightDataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + fightResult_ = 0; + bitField0_ = (bitField0_ & ~0x00000008); + if (dropBuilder_ == null) { + drop_ = rpc.protocols.CommonProto.Drop.getDefaultInstance(); + } else { + dropBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaChallengeResponse_descriptor; + } + + public rpc.world.WorldCommonProto.GetWorldArenaChallengeResponse getDefaultInstanceForType() { + return rpc.world.WorldCommonProto.GetWorldArenaChallengeResponse.getDefaultInstance(); + } + + public rpc.world.WorldCommonProto.GetWorldArenaChallengeResponse build() { + rpc.world.WorldCommonProto.GetWorldArenaChallengeResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public rpc.world.WorldCommonProto.GetWorldArenaChallengeResponse buildPartial() { + rpc.world.WorldCommonProto.GetWorldArenaChallengeResponse result = new rpc.world.WorldCommonProto.GetWorldArenaChallengeResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.mySortChange_ = mySortChange_; + if (arenaEnemysBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + arenaEnemys_ = java.util.Collections.unmodifiableList(arenaEnemys_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.arenaEnemys_ = arenaEnemys_; + } else { + result.arenaEnemys_ = arenaEnemysBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000002; + } + if (fightDataBuilder_ == null) { + result.fightData_ = fightData_; + } else { + result.fightData_ = fightDataBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000004; + } + result.fightResult_ = fightResult_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000008; + } + if (dropBuilder_ == null) { + result.drop_ = drop_; + } else { + result.drop_ = dropBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof rpc.world.WorldCommonProto.GetWorldArenaChallengeResponse) { + return mergeFrom((rpc.world.WorldCommonProto.GetWorldArenaChallengeResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(rpc.world.WorldCommonProto.GetWorldArenaChallengeResponse other) { + if (other == rpc.world.WorldCommonProto.GetWorldArenaChallengeResponse.getDefaultInstance()) return this; + if (other.hasMySortChange()) { + setMySortChange(other.getMySortChange()); + } + if (arenaEnemysBuilder_ == null) { + if (!other.arenaEnemys_.isEmpty()) { + if (arenaEnemys_.isEmpty()) { + arenaEnemys_ = other.arenaEnemys_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureArenaEnemysIsMutable(); + arenaEnemys_.addAll(other.arenaEnemys_); + } + onChanged(); + } + } else { + if (!other.arenaEnemys_.isEmpty()) { + if (arenaEnemysBuilder_.isEmpty()) { + arenaEnemysBuilder_.dispose(); + arenaEnemysBuilder_ = null; + arenaEnemys_ = other.arenaEnemys_; + bitField0_ = (bitField0_ & ~0x00000002); + arenaEnemysBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getArenaEnemysFieldBuilder() : null; + } else { + arenaEnemysBuilder_.addAllMessages(other.arenaEnemys_); + } + } + } + if (other.hasFightData()) { + mergeFightData(other.getFightData()); + } + if (other.hasFightResult()) { + setFightResult(other.getFightResult()); + } + if (other.hasDrop()) { + mergeDrop(other.getDrop()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + rpc.world.WorldCommonProto.GetWorldArenaChallengeResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (rpc.world.WorldCommonProto.GetWorldArenaChallengeResponse) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // optional int32 mySortChange = 1; + private int mySortChange_ ; + /** + * optional int32 mySortChange = 1; + * + *
+       *我的名次变化值
+       * 
+ */ + public boolean hasMySortChange() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 mySortChange = 1; + * + *
+       *我的名次变化值
+       * 
+ */ + public int getMySortChange() { + return mySortChange_; + } + /** + * optional int32 mySortChange = 1; + * + *
+       *我的名次变化值
+       * 
+ */ + public Builder setMySortChange(int value) { + bitField0_ |= 0x00000001; + mySortChange_ = value; + onChanged(); + return this; + } + /** + * optional int32 mySortChange = 1; + * + *
+       *我的名次变化值
+       * 
+ */ + public Builder clearMySortChange() { + bitField0_ = (bitField0_ & ~0x00000001); + mySortChange_ = 0; + onChanged(); + return this; + } + + // repeated .rpc.protocols.ArenaEnemy arenaEnemys = 2; + private java.util.List arenaEnemys_ = + java.util.Collections.emptyList(); + private void ensureArenaEnemysIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + arenaEnemys_ = new java.util.ArrayList(arenaEnemys_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + rpc.protocols.CommonProto.ArenaEnemy, rpc.protocols.CommonProto.ArenaEnemy.Builder, rpc.protocols.CommonProto.ArenaEnemyOrBuilder> arenaEnemysBuilder_; + + /** + * repeated .rpc.protocols.ArenaEnemy arenaEnemys = 2; + * + *
+       *新的一批对手信息
+       * 
+ */ + public java.util.List getArenaEnemysList() { + if (arenaEnemysBuilder_ == null) { + return java.util.Collections.unmodifiableList(arenaEnemys_); + } else { + return arenaEnemysBuilder_.getMessageList(); + } + } + /** + * repeated .rpc.protocols.ArenaEnemy arenaEnemys = 2; + * + *
+       *新的一批对手信息
+       * 
+ */ + public int getArenaEnemysCount() { + if (arenaEnemysBuilder_ == null) { + return arenaEnemys_.size(); + } else { + return arenaEnemysBuilder_.getCount(); + } + } + /** + * repeated .rpc.protocols.ArenaEnemy arenaEnemys = 2; + * + *
+       *新的一批对手信息
+       * 
+ */ + public rpc.protocols.CommonProto.ArenaEnemy getArenaEnemys(int index) { + if (arenaEnemysBuilder_ == null) { + return arenaEnemys_.get(index); + } else { + return arenaEnemysBuilder_.getMessage(index); + } + } + /** + * repeated .rpc.protocols.ArenaEnemy arenaEnemys = 2; + * + *
+       *新的一批对手信息
+       * 
+ */ + public Builder setArenaEnemys( + int index, rpc.protocols.CommonProto.ArenaEnemy value) { + if (arenaEnemysBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureArenaEnemysIsMutable(); + arenaEnemys_.set(index, value); + onChanged(); + } else { + arenaEnemysBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .rpc.protocols.ArenaEnemy arenaEnemys = 2; + * + *
+       *新的一批对手信息
+       * 
+ */ + public Builder setArenaEnemys( + int index, rpc.protocols.CommonProto.ArenaEnemy.Builder builderForValue) { + if (arenaEnemysBuilder_ == null) { + ensureArenaEnemysIsMutable(); + arenaEnemys_.set(index, builderForValue.build()); + onChanged(); + } else { + arenaEnemysBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .rpc.protocols.ArenaEnemy arenaEnemys = 2; + * + *
+       *新的一批对手信息
+       * 
+ */ + public Builder addArenaEnemys(rpc.protocols.CommonProto.ArenaEnemy value) { + if (arenaEnemysBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureArenaEnemysIsMutable(); + arenaEnemys_.add(value); + onChanged(); + } else { + arenaEnemysBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .rpc.protocols.ArenaEnemy arenaEnemys = 2; + * + *
+       *新的一批对手信息
+       * 
+ */ + public Builder addArenaEnemys( + int index, rpc.protocols.CommonProto.ArenaEnemy value) { + if (arenaEnemysBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureArenaEnemysIsMutable(); + arenaEnemys_.add(index, value); + onChanged(); + } else { + arenaEnemysBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .rpc.protocols.ArenaEnemy arenaEnemys = 2; + * + *
+       *新的一批对手信息
+       * 
+ */ + public Builder addArenaEnemys( + rpc.protocols.CommonProto.ArenaEnemy.Builder builderForValue) { + if (arenaEnemysBuilder_ == null) { + ensureArenaEnemysIsMutable(); + arenaEnemys_.add(builderForValue.build()); + onChanged(); + } else { + arenaEnemysBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .rpc.protocols.ArenaEnemy arenaEnemys = 2; + * + *
+       *新的一批对手信息
+       * 
+ */ + public Builder addArenaEnemys( + int index, rpc.protocols.CommonProto.ArenaEnemy.Builder builderForValue) { + if (arenaEnemysBuilder_ == null) { + ensureArenaEnemysIsMutable(); + arenaEnemys_.add(index, builderForValue.build()); + onChanged(); + } else { + arenaEnemysBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .rpc.protocols.ArenaEnemy arenaEnemys = 2; + * + *
+       *新的一批对手信息
+       * 
+ */ + public Builder addAllArenaEnemys( + java.lang.Iterable values) { + if (arenaEnemysBuilder_ == null) { + ensureArenaEnemysIsMutable(); + super.addAll(values, arenaEnemys_); + onChanged(); + } else { + arenaEnemysBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .rpc.protocols.ArenaEnemy arenaEnemys = 2; + * + *
+       *新的一批对手信息
+       * 
+ */ + public Builder clearArenaEnemys() { + if (arenaEnemysBuilder_ == null) { + arenaEnemys_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + arenaEnemysBuilder_.clear(); + } + return this; + } + /** + * repeated .rpc.protocols.ArenaEnemy arenaEnemys = 2; + * + *
+       *新的一批对手信息
+       * 
+ */ + public Builder removeArenaEnemys(int index) { + if (arenaEnemysBuilder_ == null) { + ensureArenaEnemysIsMutable(); + arenaEnemys_.remove(index); + onChanged(); + } else { + arenaEnemysBuilder_.remove(index); + } + return this; + } + /** + * repeated .rpc.protocols.ArenaEnemy arenaEnemys = 2; + * + *
+       *新的一批对手信息
+       * 
+ */ + public rpc.protocols.CommonProto.ArenaEnemy.Builder getArenaEnemysBuilder( + int index) { + return getArenaEnemysFieldBuilder().getBuilder(index); + } + /** + * repeated .rpc.protocols.ArenaEnemy arenaEnemys = 2; + * + *
+       *新的一批对手信息
+       * 
+ */ + public rpc.protocols.CommonProto.ArenaEnemyOrBuilder getArenaEnemysOrBuilder( + int index) { + if (arenaEnemysBuilder_ == null) { + return arenaEnemys_.get(index); } else { + return arenaEnemysBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .rpc.protocols.ArenaEnemy arenaEnemys = 2; + * + *
+       *新的一批对手信息
+       * 
+ */ + public java.util.List + getArenaEnemysOrBuilderList() { + if (arenaEnemysBuilder_ != null) { + return arenaEnemysBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(arenaEnemys_); + } + } + /** + * repeated .rpc.protocols.ArenaEnemy arenaEnemys = 2; + * + *
+       *新的一批对手信息
+       * 
+ */ + public rpc.protocols.CommonProto.ArenaEnemy.Builder addArenaEnemysBuilder() { + return getArenaEnemysFieldBuilder().addBuilder( + rpc.protocols.CommonProto.ArenaEnemy.getDefaultInstance()); + } + /** + * repeated .rpc.protocols.ArenaEnemy arenaEnemys = 2; + * + *
+       *新的一批对手信息
+       * 
+ */ + public rpc.protocols.CommonProto.ArenaEnemy.Builder addArenaEnemysBuilder( + int index) { + return getArenaEnemysFieldBuilder().addBuilder( + index, rpc.protocols.CommonProto.ArenaEnemy.getDefaultInstance()); + } + /** + * repeated .rpc.protocols.ArenaEnemy arenaEnemys = 2; + * + *
+       *新的一批对手信息
+       * 
+ */ + public java.util.List + getArenaEnemysBuilderList() { + return getArenaEnemysFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + rpc.protocols.CommonProto.ArenaEnemy, rpc.protocols.CommonProto.ArenaEnemy.Builder, rpc.protocols.CommonProto.ArenaEnemyOrBuilder> + getArenaEnemysFieldBuilder() { + if (arenaEnemysBuilder_ == null) { + arenaEnemysBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + rpc.protocols.CommonProto.ArenaEnemy, rpc.protocols.CommonProto.ArenaEnemy.Builder, rpc.protocols.CommonProto.ArenaEnemyOrBuilder>( + arenaEnemys_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + arenaEnemys_ = null; + } + return arenaEnemysBuilder_; + } + + // optional .rpc.protocols.FightData fightData = 3; + private rpc.protocols.CommonProto.FightData fightData_ = rpc.protocols.CommonProto.FightData.getDefaultInstance(); + private com.google.protobuf.SingleFieldBuilder< + rpc.protocols.CommonProto.FightData, rpc.protocols.CommonProto.FightData.Builder, rpc.protocols.CommonProto.FightDataOrBuilder> fightDataBuilder_; + /** + * optional .rpc.protocols.FightData fightData = 3; + * + *
+       * 战斗数据 
+       * 
+ */ + public boolean hasFightData() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional .rpc.protocols.FightData fightData = 3; + * + *
+       * 战斗数据 
+       * 
+ */ + public rpc.protocols.CommonProto.FightData getFightData() { + if (fightDataBuilder_ == null) { + return fightData_; + } else { + return fightDataBuilder_.getMessage(); + } + } + /** + * optional .rpc.protocols.FightData fightData = 3; + * + *
+       * 战斗数据 
+       * 
+ */ + public Builder setFightData(rpc.protocols.CommonProto.FightData value) { + if (fightDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fightData_ = value; + onChanged(); + } else { + fightDataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + return this; + } + /** + * optional .rpc.protocols.FightData fightData = 3; + * + *
+       * 战斗数据 
+       * 
+ */ + public Builder setFightData( + rpc.protocols.CommonProto.FightData.Builder builderForValue) { + if (fightDataBuilder_ == null) { + fightData_ = builderForValue.build(); + onChanged(); + } else { + fightDataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + return this; + } + /** + * optional .rpc.protocols.FightData fightData = 3; + * + *
+       * 战斗数据 
+       * 
+ */ + public Builder mergeFightData(rpc.protocols.CommonProto.FightData value) { + if (fightDataBuilder_ == null) { + if (((bitField0_ & 0x00000004) == 0x00000004) && + fightData_ != rpc.protocols.CommonProto.FightData.getDefaultInstance()) { + fightData_ = + rpc.protocols.CommonProto.FightData.newBuilder(fightData_).mergeFrom(value).buildPartial(); + } else { + fightData_ = value; + } + onChanged(); + } else { + fightDataBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + return this; + } + /** + * optional .rpc.protocols.FightData fightData = 3; + * + *
+       * 战斗数据 
+       * 
+ */ + public Builder clearFightData() { + if (fightDataBuilder_ == null) { + fightData_ = rpc.protocols.CommonProto.FightData.getDefaultInstance(); + onChanged(); + } else { + fightDataBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + /** + * optional .rpc.protocols.FightData fightData = 3; + * + *
+       * 战斗数据 
+       * 
+ */ + public rpc.protocols.CommonProto.FightData.Builder getFightDataBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getFightDataFieldBuilder().getBuilder(); + } + /** + * optional .rpc.protocols.FightData fightData = 3; + * + *
+       * 战斗数据 
+       * 
+ */ + public rpc.protocols.CommonProto.FightDataOrBuilder getFightDataOrBuilder() { + if (fightDataBuilder_ != null) { + return fightDataBuilder_.getMessageOrBuilder(); + } else { + return fightData_; + } + } + /** + * optional .rpc.protocols.FightData fightData = 3; + * + *
+       * 战斗数据 
+       * 
+ */ + private com.google.protobuf.SingleFieldBuilder< + rpc.protocols.CommonProto.FightData, rpc.protocols.CommonProto.FightData.Builder, rpc.protocols.CommonProto.FightDataOrBuilder> + getFightDataFieldBuilder() { + if (fightDataBuilder_ == null) { + fightDataBuilder_ = new com.google.protobuf.SingleFieldBuilder< + rpc.protocols.CommonProto.FightData, rpc.protocols.CommonProto.FightData.Builder, rpc.protocols.CommonProto.FightDataOrBuilder>( + fightData_, + getParentForChildren(), + isClean()); + fightData_ = null; + } + return fightDataBuilder_; + } + + // optional int32 fightResult = 4; + private int fightResult_ ; + /** + * optional int32 fightResult = 4; + * + *
+       * 战斗结果 -1 时 表示挑战目标排名发生变化 需刷新
+       * 
+ */ + public boolean hasFightResult() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional int32 fightResult = 4; + * + *
+       * 战斗结果 -1 时 表示挑战目标排名发生变化 需刷新
+       * 
+ */ + public int getFightResult() { + return fightResult_; + } + /** + * optional int32 fightResult = 4; + * + *
+       * 战斗结果 -1 时 表示挑战目标排名发生变化 需刷新
+       * 
+ */ + public Builder setFightResult(int value) { + bitField0_ |= 0x00000008; + fightResult_ = value; + onChanged(); + return this; + } + /** + * optional int32 fightResult = 4; + * + *
+       * 战斗结果 -1 时 表示挑战目标排名发生变化 需刷新
+       * 
+ */ + public Builder clearFightResult() { + bitField0_ = (bitField0_ & ~0x00000008); + fightResult_ = 0; + onChanged(); + return this; + } + + // optional .rpc.protocols.Drop drop = 5; + private rpc.protocols.CommonProto.Drop drop_ = rpc.protocols.CommonProto.Drop.getDefaultInstance(); + private com.google.protobuf.SingleFieldBuilder< + rpc.protocols.CommonProto.Drop, rpc.protocols.CommonProto.Drop.Builder, rpc.protocols.CommonProto.DropOrBuilder> dropBuilder_; + /** + * optional .rpc.protocols.Drop drop = 5; + */ + public boolean hasDrop() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional .rpc.protocols.Drop drop = 5; + */ + public rpc.protocols.CommonProto.Drop getDrop() { + if (dropBuilder_ == null) { + return drop_; + } else { + return dropBuilder_.getMessage(); + } + } + /** + * optional .rpc.protocols.Drop drop = 5; + */ + public Builder setDrop(rpc.protocols.CommonProto.Drop value) { + if (dropBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + drop_ = value; + onChanged(); + } else { + dropBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + return this; + } + /** + * optional .rpc.protocols.Drop drop = 5; + */ + public Builder setDrop( + rpc.protocols.CommonProto.Drop.Builder builderForValue) { + if (dropBuilder_ == null) { + drop_ = builderForValue.build(); + onChanged(); + } else { + dropBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + return this; + } + /** + * optional .rpc.protocols.Drop drop = 5; + */ + public Builder mergeDrop(rpc.protocols.CommonProto.Drop value) { + if (dropBuilder_ == null) { + if (((bitField0_ & 0x00000010) == 0x00000010) && + drop_ != rpc.protocols.CommonProto.Drop.getDefaultInstance()) { + drop_ = + rpc.protocols.CommonProto.Drop.newBuilder(drop_).mergeFrom(value).buildPartial(); + } else { + drop_ = value; + } + onChanged(); + } else { + dropBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + return this; + } + /** + * optional .rpc.protocols.Drop drop = 5; + */ + public Builder clearDrop() { + if (dropBuilder_ == null) { + drop_ = rpc.protocols.CommonProto.Drop.getDefaultInstance(); + onChanged(); + } else { + dropBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + /** + * optional .rpc.protocols.Drop drop = 5; + */ + public rpc.protocols.CommonProto.Drop.Builder getDropBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getDropFieldBuilder().getBuilder(); + } + /** + * optional .rpc.protocols.Drop drop = 5; + */ + public rpc.protocols.CommonProto.DropOrBuilder getDropOrBuilder() { + if (dropBuilder_ != null) { + return dropBuilder_.getMessageOrBuilder(); + } else { + return drop_; + } + } + /** + * optional .rpc.protocols.Drop drop = 5; + */ + private com.google.protobuf.SingleFieldBuilder< + rpc.protocols.CommonProto.Drop, rpc.protocols.CommonProto.Drop.Builder, rpc.protocols.CommonProto.DropOrBuilder> + getDropFieldBuilder() { + if (dropBuilder_ == null) { + dropBuilder_ = new com.google.protobuf.SingleFieldBuilder< + rpc.protocols.CommonProto.Drop, rpc.protocols.CommonProto.Drop.Builder, rpc.protocols.CommonProto.DropOrBuilder>( + drop_, + getParentForChildren(), + isClean()); + drop_ = null; + } + return dropBuilder_; + } + + // @@protoc_insertion_point(builder_scope:rpc.world.GetWorldArenaChallengeResponse) + } + + static { + defaultInstance = new GetWorldArenaChallengeResponse(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:rpc.world.GetWorldArenaChallengeResponse) + } + + public interface GetWorldArenaProudRequestOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // optional int32 challengeServerid = 1; + /** + * optional int32 challengeServerid = 1; + * + *
+     * 对手Serverid
+     * 
+ */ + boolean hasChallengeServerid(); + /** + * optional int32 challengeServerid = 1; + * + *
+     * 对手Serverid
+     * 
+ */ + int getChallengeServerid(); + + // optional int32 challengeUid = 2; + /** + * optional int32 challengeUid = 2; + * + *
+     * 对手uid
+     * 
+ */ + boolean hasChallengeUid(); + /** + * optional int32 challengeUid = 2; + * + *
+     * 对手uid
+     * 
+ */ + int getChallengeUid(); + } + /** + * Protobuf type {@code rpc.world.GetWorldArenaProudRequest} + * + *
+   *膜拜
+   * 
+ */ + public static final class GetWorldArenaProudRequest extends + com.google.protobuf.GeneratedMessage + implements GetWorldArenaProudRequestOrBuilder { + // Use GetWorldArenaProudRequest.newBuilder() to construct. + private GetWorldArenaProudRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private GetWorldArenaProudRequest(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final GetWorldArenaProudRequest defaultInstance; + public static GetWorldArenaProudRequest getDefaultInstance() { + return defaultInstance; + } + + public GetWorldArenaProudRequest getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetWorldArenaProudRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + 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; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + challengeServerid_ = input.readInt32(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + challengeUid_ = input.readInt32(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaProudRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaProudRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + rpc.world.WorldCommonProto.GetWorldArenaProudRequest.class, rpc.world.WorldCommonProto.GetWorldArenaProudRequest.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public GetWorldArenaProudRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetWorldArenaProudRequest(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + // optional int32 challengeServerid = 1; + public static final int CHALLENGESERVERID_FIELD_NUMBER = 1; + private int challengeServerid_; + /** + * optional int32 challengeServerid = 1; + * + *
+     * 对手Serverid
+     * 
+ */ + public boolean hasChallengeServerid() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 challengeServerid = 1; + * + *
+     * 对手Serverid
+     * 
+ */ + public int getChallengeServerid() { + return challengeServerid_; + } + + // optional int32 challengeUid = 2; + public static final int CHALLENGEUID_FIELD_NUMBER = 2; + private int challengeUid_; + /** + * optional int32 challengeUid = 2; + * + *
+     * 对手uid
+     * 
+ */ + public boolean hasChallengeUid() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 challengeUid = 2; + * + *
+     * 对手uid
+     * 
+ */ + public int getChallengeUid() { + return challengeUid_; + } + + private void initFields() { + challengeServerid_ = 0; + challengeUid_ = 0; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(1, challengeServerid_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt32(2, challengeUid_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, challengeServerid_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, challengeUid_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static rpc.world.WorldCommonProto.GetWorldArenaProudRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static rpc.world.WorldCommonProto.GetWorldArenaProudRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static rpc.world.WorldCommonProto.GetWorldArenaProudRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static rpc.world.WorldCommonProto.GetWorldArenaProudRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static rpc.world.WorldCommonProto.GetWorldArenaProudRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static rpc.world.WorldCommonProto.GetWorldArenaProudRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static rpc.world.WorldCommonProto.GetWorldArenaProudRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static rpc.world.WorldCommonProto.GetWorldArenaProudRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static rpc.world.WorldCommonProto.GetWorldArenaProudRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static rpc.world.WorldCommonProto.GetWorldArenaProudRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(rpc.world.WorldCommonProto.GetWorldArenaProudRequest prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code rpc.world.GetWorldArenaProudRequest} + * + *
+     *膜拜
+     * 
+ */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements rpc.world.WorldCommonProto.GetWorldArenaProudRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaProudRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaProudRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + rpc.world.WorldCommonProto.GetWorldArenaProudRequest.class, rpc.world.WorldCommonProto.GetWorldArenaProudRequest.Builder.class); + } + + // Construct using rpc.world.WorldCommonProto.GetWorldArenaProudRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + challengeServerid_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + challengeUid_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaProudRequest_descriptor; + } + + public rpc.world.WorldCommonProto.GetWorldArenaProudRequest getDefaultInstanceForType() { + return rpc.world.WorldCommonProto.GetWorldArenaProudRequest.getDefaultInstance(); + } + + public rpc.world.WorldCommonProto.GetWorldArenaProudRequest build() { + rpc.world.WorldCommonProto.GetWorldArenaProudRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public rpc.world.WorldCommonProto.GetWorldArenaProudRequest buildPartial() { + rpc.world.WorldCommonProto.GetWorldArenaProudRequest result = new rpc.world.WorldCommonProto.GetWorldArenaProudRequest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.challengeServerid_ = challengeServerid_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.challengeUid_ = challengeUid_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof rpc.world.WorldCommonProto.GetWorldArenaProudRequest) { + return mergeFrom((rpc.world.WorldCommonProto.GetWorldArenaProudRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(rpc.world.WorldCommonProto.GetWorldArenaProudRequest other) { + if (other == rpc.world.WorldCommonProto.GetWorldArenaProudRequest.getDefaultInstance()) return this; + if (other.hasChallengeServerid()) { + setChallengeServerid(other.getChallengeServerid()); + } + if (other.hasChallengeUid()) { + setChallengeUid(other.getChallengeUid()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + rpc.world.WorldCommonProto.GetWorldArenaProudRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (rpc.world.WorldCommonProto.GetWorldArenaProudRequest) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // optional int32 challengeServerid = 1; + private int challengeServerid_ ; + /** + * optional int32 challengeServerid = 1; + * + *
+       * 对手Serverid
+       * 
+ */ + public boolean hasChallengeServerid() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 challengeServerid = 1; + * + *
+       * 对手Serverid
+       * 
+ */ + public int getChallengeServerid() { + return challengeServerid_; + } + /** + * optional int32 challengeServerid = 1; + * + *
+       * 对手Serverid
+       * 
+ */ + public Builder setChallengeServerid(int value) { + bitField0_ |= 0x00000001; + challengeServerid_ = value; + onChanged(); + return this; + } + /** + * optional int32 challengeServerid = 1; + * + *
+       * 对手Serverid
+       * 
+ */ + public Builder clearChallengeServerid() { + bitField0_ = (bitField0_ & ~0x00000001); + challengeServerid_ = 0; + onChanged(); + return this; + } + + // optional int32 challengeUid = 2; + private int challengeUid_ ; + /** + * optional int32 challengeUid = 2; + * + *
+       * 对手uid
+       * 
+ */ + public boolean hasChallengeUid() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 challengeUid = 2; + * + *
+       * 对手uid
+       * 
+ */ + public int getChallengeUid() { + return challengeUid_; + } + /** + * optional int32 challengeUid = 2; + * + *
+       * 对手uid
+       * 
+ */ + public Builder setChallengeUid(int value) { + bitField0_ |= 0x00000002; + challengeUid_ = value; + onChanged(); + return this; + } + /** + * optional int32 challengeUid = 2; + * + *
+       * 对手uid
+       * 
+ */ + public Builder clearChallengeUid() { + bitField0_ = (bitField0_ & ~0x00000002); + challengeUid_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:rpc.world.GetWorldArenaProudRequest) + } + + static { + defaultInstance = new GetWorldArenaProudRequest(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:rpc.world.GetWorldArenaProudRequest) + } + + public interface GetWorldArenaProudResponseOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // optional .rpc.protocols.Drop drop = 1; + /** + * optional .rpc.protocols.Drop drop = 1; + * + *
+     *膜拜奖励  (头像框奖励)
+     * 
+ */ + boolean hasDrop(); + /** + * optional .rpc.protocols.Drop drop = 1; + * + *
+     *膜拜奖励  (头像框奖励)
+     * 
+ */ + rpc.protocols.CommonProto.Drop getDrop(); + /** + * optional .rpc.protocols.Drop drop = 1; + * + *
+     *膜拜奖励  (头像框奖励)
+     * 
+ */ + rpc.protocols.CommonProto.DropOrBuilder getDropOrBuilder(); + } + /** + * Protobuf type {@code rpc.world.GetWorldArenaProudResponse} + */ + public static final class GetWorldArenaProudResponse extends + com.google.protobuf.GeneratedMessage + implements GetWorldArenaProudResponseOrBuilder { + // Use GetWorldArenaProudResponse.newBuilder() to construct. + private GetWorldArenaProudResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private GetWorldArenaProudResponse(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final GetWorldArenaProudResponse defaultInstance; + public static GetWorldArenaProudResponse getDefaultInstance() { + return defaultInstance; + } + + public GetWorldArenaProudResponse getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetWorldArenaProudResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + 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; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + rpc.protocols.CommonProto.Drop.Builder subBuilder = null; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + subBuilder = drop_.toBuilder(); + } + drop_ = input.readMessage(rpc.protocols.CommonProto.Drop.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(drop_); + drop_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000001; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaProudResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaProudResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + rpc.world.WorldCommonProto.GetWorldArenaProudResponse.class, rpc.world.WorldCommonProto.GetWorldArenaProudResponse.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public GetWorldArenaProudResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetWorldArenaProudResponse(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + // optional .rpc.protocols.Drop drop = 1; + public static final int DROP_FIELD_NUMBER = 1; + private rpc.protocols.CommonProto.Drop drop_; + /** + * optional .rpc.protocols.Drop drop = 1; + * + *
+     *膜拜奖励  (头像框奖励)
+     * 
+ */ + public boolean hasDrop() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional .rpc.protocols.Drop drop = 1; + * + *
+     *膜拜奖励  (头像框奖励)
+     * 
+ */ + public rpc.protocols.CommonProto.Drop getDrop() { + return drop_; + } + /** + * optional .rpc.protocols.Drop drop = 1; + * + *
+     *膜拜奖励  (头像框奖励)
+     * 
+ */ + public rpc.protocols.CommonProto.DropOrBuilder getDropOrBuilder() { + return drop_; + } + + private void initFields() { + drop_ = rpc.protocols.CommonProto.Drop.getDefaultInstance(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeMessage(1, drop_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, drop_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static rpc.world.WorldCommonProto.GetWorldArenaProudResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static rpc.world.WorldCommonProto.GetWorldArenaProudResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static rpc.world.WorldCommonProto.GetWorldArenaProudResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static rpc.world.WorldCommonProto.GetWorldArenaProudResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static rpc.world.WorldCommonProto.GetWorldArenaProudResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static rpc.world.WorldCommonProto.GetWorldArenaProudResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static rpc.world.WorldCommonProto.GetWorldArenaProudResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static rpc.world.WorldCommonProto.GetWorldArenaProudResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static rpc.world.WorldCommonProto.GetWorldArenaProudResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static rpc.world.WorldCommonProto.GetWorldArenaProudResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(rpc.world.WorldCommonProto.GetWorldArenaProudResponse prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code rpc.world.GetWorldArenaProudResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements rpc.world.WorldCommonProto.GetWorldArenaProudResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaProudResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaProudResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + rpc.world.WorldCommonProto.GetWorldArenaProudResponse.class, rpc.world.WorldCommonProto.GetWorldArenaProudResponse.Builder.class); + } + + // Construct using rpc.world.WorldCommonProto.GetWorldArenaProudResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getDropFieldBuilder(); + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + if (dropBuilder_ == null) { + drop_ = rpc.protocols.CommonProto.Drop.getDefaultInstance(); + } else { + dropBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaProudResponse_descriptor; + } + + public rpc.world.WorldCommonProto.GetWorldArenaProudResponse getDefaultInstanceForType() { + return rpc.world.WorldCommonProto.GetWorldArenaProudResponse.getDefaultInstance(); + } + + public rpc.world.WorldCommonProto.GetWorldArenaProudResponse build() { + rpc.world.WorldCommonProto.GetWorldArenaProudResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public rpc.world.WorldCommonProto.GetWorldArenaProudResponse buildPartial() { + rpc.world.WorldCommonProto.GetWorldArenaProudResponse result = new rpc.world.WorldCommonProto.GetWorldArenaProudResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + if (dropBuilder_ == null) { + result.drop_ = drop_; + } else { + result.drop_ = dropBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof rpc.world.WorldCommonProto.GetWorldArenaProudResponse) { + return mergeFrom((rpc.world.WorldCommonProto.GetWorldArenaProudResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(rpc.world.WorldCommonProto.GetWorldArenaProudResponse other) { + if (other == rpc.world.WorldCommonProto.GetWorldArenaProudResponse.getDefaultInstance()) return this; + if (other.hasDrop()) { + mergeDrop(other.getDrop()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + rpc.world.WorldCommonProto.GetWorldArenaProudResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (rpc.world.WorldCommonProto.GetWorldArenaProudResponse) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // optional .rpc.protocols.Drop drop = 1; + private rpc.protocols.CommonProto.Drop drop_ = rpc.protocols.CommonProto.Drop.getDefaultInstance(); + private com.google.protobuf.SingleFieldBuilder< + rpc.protocols.CommonProto.Drop, rpc.protocols.CommonProto.Drop.Builder, rpc.protocols.CommonProto.DropOrBuilder> dropBuilder_; + /** + * optional .rpc.protocols.Drop drop = 1; + * + *
+       *膜拜奖励  (头像框奖励)
+       * 
+ */ + public boolean hasDrop() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional .rpc.protocols.Drop drop = 1; + * + *
+       *膜拜奖励  (头像框奖励)
+       * 
+ */ + public rpc.protocols.CommonProto.Drop getDrop() { + if (dropBuilder_ == null) { + return drop_; + } else { + return dropBuilder_.getMessage(); + } + } + /** + * optional .rpc.protocols.Drop drop = 1; + * + *
+       *膜拜奖励  (头像框奖励)
+       * 
+ */ + public Builder setDrop(rpc.protocols.CommonProto.Drop value) { + if (dropBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + drop_ = value; + onChanged(); + } else { + dropBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * optional .rpc.protocols.Drop drop = 1; + * + *
+       *膜拜奖励  (头像框奖励)
+       * 
+ */ + public Builder setDrop( + rpc.protocols.CommonProto.Drop.Builder builderForValue) { + if (dropBuilder_ == null) { + drop_ = builderForValue.build(); + onChanged(); + } else { + dropBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * optional .rpc.protocols.Drop drop = 1; + * + *
+       *膜拜奖励  (头像框奖励)
+       * 
+ */ + public Builder mergeDrop(rpc.protocols.CommonProto.Drop value) { + if (dropBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001) && + drop_ != rpc.protocols.CommonProto.Drop.getDefaultInstance()) { + drop_ = + rpc.protocols.CommonProto.Drop.newBuilder(drop_).mergeFrom(value).buildPartial(); + } else { + drop_ = value; + } + onChanged(); + } else { + dropBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * optional .rpc.protocols.Drop drop = 1; + * + *
+       *膜拜奖励  (头像框奖励)
+       * 
+ */ + public Builder clearDrop() { + if (dropBuilder_ == null) { + drop_ = rpc.protocols.CommonProto.Drop.getDefaultInstance(); + onChanged(); + } else { + dropBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + /** + * optional .rpc.protocols.Drop drop = 1; + * + *
+       *膜拜奖励  (头像框奖励)
+       * 
+ */ + public rpc.protocols.CommonProto.Drop.Builder getDropBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getDropFieldBuilder().getBuilder(); + } + /** + * optional .rpc.protocols.Drop drop = 1; + * + *
+       *膜拜奖励  (头像框奖励)
+       * 
+ */ + public rpc.protocols.CommonProto.DropOrBuilder getDropOrBuilder() { + if (dropBuilder_ != null) { + return dropBuilder_.getMessageOrBuilder(); + } else { + return drop_; + } + } + /** + * optional .rpc.protocols.Drop drop = 1; + * + *
+       *膜拜奖励  (头像框奖励)
+       * 
+ */ + private com.google.protobuf.SingleFieldBuilder< + rpc.protocols.CommonProto.Drop, rpc.protocols.CommonProto.Drop.Builder, rpc.protocols.CommonProto.DropOrBuilder> + getDropFieldBuilder() { + if (dropBuilder_ == null) { + dropBuilder_ = new com.google.protobuf.SingleFieldBuilder< + rpc.protocols.CommonProto.Drop, rpc.protocols.CommonProto.Drop.Builder, rpc.protocols.CommonProto.DropOrBuilder>( + drop_, + getParentForChildren(), + isClean()); + drop_ = null; + } + return dropBuilder_; + } + + // @@protoc_insertion_point(builder_scope:rpc.world.GetWorldArenaProudResponse) + } + + static { + defaultInstance = new GetWorldArenaProudResponse(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:rpc.world.GetWorldArenaProudResponse) + } + + public interface GetWorldArenaRecordInfoResponseOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // repeated .rpc.protocols.ArenaRecordInfo arenaRecordInfo = 1; + /** + * repeated .rpc.protocols.ArenaRecordInfo arenaRecordInfo = 1; + */ + java.util.List + getArenaRecordInfoList(); + /** + * repeated .rpc.protocols.ArenaRecordInfo arenaRecordInfo = 1; + */ + rpc.protocols.CommonProto.ArenaRecordInfo getArenaRecordInfo(int index); + /** + * repeated .rpc.protocols.ArenaRecordInfo arenaRecordInfo = 1; + */ + int getArenaRecordInfoCount(); + /** + * repeated .rpc.protocols.ArenaRecordInfo arenaRecordInfo = 1; + */ + java.util.List + getArenaRecordInfoOrBuilderList(); + /** + * repeated .rpc.protocols.ArenaRecordInfo arenaRecordInfo = 1; + */ + rpc.protocols.CommonProto.ArenaRecordInfoOrBuilder getArenaRecordInfoOrBuilder( + int index); + } + /** + * Protobuf type {@code rpc.world.GetWorldArenaRecordInfoResponse} + * + *
+   *跨服天梯挑战与被挑战 战斗记录
+   * 
+ */ + public static final class GetWorldArenaRecordInfoResponse extends + com.google.protobuf.GeneratedMessage + implements GetWorldArenaRecordInfoResponseOrBuilder { + // Use GetWorldArenaRecordInfoResponse.newBuilder() to construct. + private GetWorldArenaRecordInfoResponse(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private GetWorldArenaRecordInfoResponse(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final GetWorldArenaRecordInfoResponse defaultInstance; + public static GetWorldArenaRecordInfoResponse getDefaultInstance() { + return defaultInstance; + } + + public GetWorldArenaRecordInfoResponse getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetWorldArenaRecordInfoResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + 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; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + arenaRecordInfo_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + arenaRecordInfo_.add(input.readMessage(rpc.protocols.CommonProto.ArenaRecordInfo.PARSER, extensionRegistry)); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + arenaRecordInfo_ = java.util.Collections.unmodifiableList(arenaRecordInfo_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaRecordInfoResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaRecordInfoResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + rpc.world.WorldCommonProto.GetWorldArenaRecordInfoResponse.class, rpc.world.WorldCommonProto.GetWorldArenaRecordInfoResponse.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public GetWorldArenaRecordInfoResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetWorldArenaRecordInfoResponse(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + // repeated .rpc.protocols.ArenaRecordInfo arenaRecordInfo = 1; + public static final int ARENARECORDINFO_FIELD_NUMBER = 1; + private java.util.List arenaRecordInfo_; + /** + * repeated .rpc.protocols.ArenaRecordInfo arenaRecordInfo = 1; + */ + public java.util.List getArenaRecordInfoList() { + return arenaRecordInfo_; + } + /** + * repeated .rpc.protocols.ArenaRecordInfo arenaRecordInfo = 1; + */ + public java.util.List + getArenaRecordInfoOrBuilderList() { + return arenaRecordInfo_; + } + /** + * repeated .rpc.protocols.ArenaRecordInfo arenaRecordInfo = 1; + */ + public int getArenaRecordInfoCount() { + return arenaRecordInfo_.size(); + } + /** + * repeated .rpc.protocols.ArenaRecordInfo arenaRecordInfo = 1; + */ + public rpc.protocols.CommonProto.ArenaRecordInfo getArenaRecordInfo(int index) { + return arenaRecordInfo_.get(index); + } + /** + * repeated .rpc.protocols.ArenaRecordInfo arenaRecordInfo = 1; + */ + public rpc.protocols.CommonProto.ArenaRecordInfoOrBuilder getArenaRecordInfoOrBuilder( + int index) { + return arenaRecordInfo_.get(index); + } + + private void initFields() { + arenaRecordInfo_ = java.util.Collections.emptyList(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + for (int i = 0; i < arenaRecordInfo_.size(); i++) { + output.writeMessage(1, arenaRecordInfo_.get(i)); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < arenaRecordInfo_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, arenaRecordInfo_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static rpc.world.WorldCommonProto.GetWorldArenaRecordInfoResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static rpc.world.WorldCommonProto.GetWorldArenaRecordInfoResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static rpc.world.WorldCommonProto.GetWorldArenaRecordInfoResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static rpc.world.WorldCommonProto.GetWorldArenaRecordInfoResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static rpc.world.WorldCommonProto.GetWorldArenaRecordInfoResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static rpc.world.WorldCommonProto.GetWorldArenaRecordInfoResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static rpc.world.WorldCommonProto.GetWorldArenaRecordInfoResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static rpc.world.WorldCommonProto.GetWorldArenaRecordInfoResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static rpc.world.WorldCommonProto.GetWorldArenaRecordInfoResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static rpc.world.WorldCommonProto.GetWorldArenaRecordInfoResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(rpc.world.WorldCommonProto.GetWorldArenaRecordInfoResponse prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code rpc.world.GetWorldArenaRecordInfoResponse} + * + *
+     *跨服天梯挑战与被挑战 战斗记录
+     * 
+ */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements rpc.world.WorldCommonProto.GetWorldArenaRecordInfoResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaRecordInfoResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaRecordInfoResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + rpc.world.WorldCommonProto.GetWorldArenaRecordInfoResponse.class, rpc.world.WorldCommonProto.GetWorldArenaRecordInfoResponse.Builder.class); + } + + // Construct using rpc.world.WorldCommonProto.GetWorldArenaRecordInfoResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getArenaRecordInfoFieldBuilder(); + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + if (arenaRecordInfoBuilder_ == null) { + arenaRecordInfo_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + arenaRecordInfoBuilder_.clear(); + } + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return rpc.world.WorldCommonProto.internal_static_rpc_world_GetWorldArenaRecordInfoResponse_descriptor; + } + + public rpc.world.WorldCommonProto.GetWorldArenaRecordInfoResponse getDefaultInstanceForType() { + return rpc.world.WorldCommonProto.GetWorldArenaRecordInfoResponse.getDefaultInstance(); + } + + public rpc.world.WorldCommonProto.GetWorldArenaRecordInfoResponse build() { + rpc.world.WorldCommonProto.GetWorldArenaRecordInfoResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public rpc.world.WorldCommonProto.GetWorldArenaRecordInfoResponse buildPartial() { + rpc.world.WorldCommonProto.GetWorldArenaRecordInfoResponse result = new rpc.world.WorldCommonProto.GetWorldArenaRecordInfoResponse(this); + int from_bitField0_ = bitField0_; + if (arenaRecordInfoBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + arenaRecordInfo_ = java.util.Collections.unmodifiableList(arenaRecordInfo_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.arenaRecordInfo_ = arenaRecordInfo_; + } else { + result.arenaRecordInfo_ = arenaRecordInfoBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof rpc.world.WorldCommonProto.GetWorldArenaRecordInfoResponse) { + return mergeFrom((rpc.world.WorldCommonProto.GetWorldArenaRecordInfoResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(rpc.world.WorldCommonProto.GetWorldArenaRecordInfoResponse other) { + if (other == rpc.world.WorldCommonProto.GetWorldArenaRecordInfoResponse.getDefaultInstance()) return this; + if (arenaRecordInfoBuilder_ == null) { + if (!other.arenaRecordInfo_.isEmpty()) { + if (arenaRecordInfo_.isEmpty()) { + arenaRecordInfo_ = other.arenaRecordInfo_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureArenaRecordInfoIsMutable(); + arenaRecordInfo_.addAll(other.arenaRecordInfo_); + } + onChanged(); + } + } else { + if (!other.arenaRecordInfo_.isEmpty()) { + if (arenaRecordInfoBuilder_.isEmpty()) { + arenaRecordInfoBuilder_.dispose(); + arenaRecordInfoBuilder_ = null; + arenaRecordInfo_ = other.arenaRecordInfo_; + bitField0_ = (bitField0_ & ~0x00000001); + arenaRecordInfoBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getArenaRecordInfoFieldBuilder() : null; + } else { + arenaRecordInfoBuilder_.addAllMessages(other.arenaRecordInfo_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + rpc.world.WorldCommonProto.GetWorldArenaRecordInfoResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (rpc.world.WorldCommonProto.GetWorldArenaRecordInfoResponse) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // repeated .rpc.protocols.ArenaRecordInfo arenaRecordInfo = 1; + private java.util.List arenaRecordInfo_ = + java.util.Collections.emptyList(); + private void ensureArenaRecordInfoIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + arenaRecordInfo_ = new java.util.ArrayList(arenaRecordInfo_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + rpc.protocols.CommonProto.ArenaRecordInfo, rpc.protocols.CommonProto.ArenaRecordInfo.Builder, rpc.protocols.CommonProto.ArenaRecordInfoOrBuilder> arenaRecordInfoBuilder_; + + /** + * repeated .rpc.protocols.ArenaRecordInfo arenaRecordInfo = 1; + */ + public java.util.List getArenaRecordInfoList() { + if (arenaRecordInfoBuilder_ == null) { + return java.util.Collections.unmodifiableList(arenaRecordInfo_); + } else { + return arenaRecordInfoBuilder_.getMessageList(); + } + } + /** + * repeated .rpc.protocols.ArenaRecordInfo arenaRecordInfo = 1; + */ + public int getArenaRecordInfoCount() { + if (arenaRecordInfoBuilder_ == null) { + return arenaRecordInfo_.size(); + } else { + return arenaRecordInfoBuilder_.getCount(); + } + } + /** + * repeated .rpc.protocols.ArenaRecordInfo arenaRecordInfo = 1; + */ + public rpc.protocols.CommonProto.ArenaRecordInfo getArenaRecordInfo(int index) { + if (arenaRecordInfoBuilder_ == null) { + return arenaRecordInfo_.get(index); + } else { + return arenaRecordInfoBuilder_.getMessage(index); + } + } + /** + * repeated .rpc.protocols.ArenaRecordInfo arenaRecordInfo = 1; + */ + public Builder setArenaRecordInfo( + int index, rpc.protocols.CommonProto.ArenaRecordInfo value) { + if (arenaRecordInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureArenaRecordInfoIsMutable(); + arenaRecordInfo_.set(index, value); + onChanged(); + } else { + arenaRecordInfoBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .rpc.protocols.ArenaRecordInfo arenaRecordInfo = 1; + */ + public Builder setArenaRecordInfo( + int index, rpc.protocols.CommonProto.ArenaRecordInfo.Builder builderForValue) { + if (arenaRecordInfoBuilder_ == null) { + ensureArenaRecordInfoIsMutable(); + arenaRecordInfo_.set(index, builderForValue.build()); + onChanged(); + } else { + arenaRecordInfoBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .rpc.protocols.ArenaRecordInfo arenaRecordInfo = 1; + */ + public Builder addArenaRecordInfo(rpc.protocols.CommonProto.ArenaRecordInfo value) { + if (arenaRecordInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureArenaRecordInfoIsMutable(); + arenaRecordInfo_.add(value); + onChanged(); + } else { + arenaRecordInfoBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .rpc.protocols.ArenaRecordInfo arenaRecordInfo = 1; + */ + public Builder addArenaRecordInfo( + int index, rpc.protocols.CommonProto.ArenaRecordInfo value) { + if (arenaRecordInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureArenaRecordInfoIsMutable(); + arenaRecordInfo_.add(index, value); + onChanged(); + } else { + arenaRecordInfoBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .rpc.protocols.ArenaRecordInfo arenaRecordInfo = 1; + */ + public Builder addArenaRecordInfo( + rpc.protocols.CommonProto.ArenaRecordInfo.Builder builderForValue) { + if (arenaRecordInfoBuilder_ == null) { + ensureArenaRecordInfoIsMutable(); + arenaRecordInfo_.add(builderForValue.build()); + onChanged(); + } else { + arenaRecordInfoBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .rpc.protocols.ArenaRecordInfo arenaRecordInfo = 1; + */ + public Builder addArenaRecordInfo( + int index, rpc.protocols.CommonProto.ArenaRecordInfo.Builder builderForValue) { + if (arenaRecordInfoBuilder_ == null) { + ensureArenaRecordInfoIsMutable(); + arenaRecordInfo_.add(index, builderForValue.build()); + onChanged(); + } else { + arenaRecordInfoBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .rpc.protocols.ArenaRecordInfo arenaRecordInfo = 1; + */ + public Builder addAllArenaRecordInfo( + java.lang.Iterable values) { + if (arenaRecordInfoBuilder_ == null) { + ensureArenaRecordInfoIsMutable(); + super.addAll(values, arenaRecordInfo_); + onChanged(); + } else { + arenaRecordInfoBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .rpc.protocols.ArenaRecordInfo arenaRecordInfo = 1; + */ + public Builder clearArenaRecordInfo() { + if (arenaRecordInfoBuilder_ == null) { + arenaRecordInfo_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + arenaRecordInfoBuilder_.clear(); + } + return this; + } + /** + * repeated .rpc.protocols.ArenaRecordInfo arenaRecordInfo = 1; + */ + public Builder removeArenaRecordInfo(int index) { + if (arenaRecordInfoBuilder_ == null) { + ensureArenaRecordInfoIsMutable(); + arenaRecordInfo_.remove(index); + onChanged(); + } else { + arenaRecordInfoBuilder_.remove(index); + } + return this; + } + /** + * repeated .rpc.protocols.ArenaRecordInfo arenaRecordInfo = 1; + */ + public rpc.protocols.CommonProto.ArenaRecordInfo.Builder getArenaRecordInfoBuilder( + int index) { + return getArenaRecordInfoFieldBuilder().getBuilder(index); + } + /** + * repeated .rpc.protocols.ArenaRecordInfo arenaRecordInfo = 1; + */ + public rpc.protocols.CommonProto.ArenaRecordInfoOrBuilder getArenaRecordInfoOrBuilder( + int index) { + if (arenaRecordInfoBuilder_ == null) { + return arenaRecordInfo_.get(index); } else { + return arenaRecordInfoBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .rpc.protocols.ArenaRecordInfo arenaRecordInfo = 1; + */ + public java.util.List + getArenaRecordInfoOrBuilderList() { + if (arenaRecordInfoBuilder_ != null) { + return arenaRecordInfoBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(arenaRecordInfo_); + } + } + /** + * repeated .rpc.protocols.ArenaRecordInfo arenaRecordInfo = 1; + */ + public rpc.protocols.CommonProto.ArenaRecordInfo.Builder addArenaRecordInfoBuilder() { + return getArenaRecordInfoFieldBuilder().addBuilder( + rpc.protocols.CommonProto.ArenaRecordInfo.getDefaultInstance()); + } + /** + * repeated .rpc.protocols.ArenaRecordInfo arenaRecordInfo = 1; + */ + public rpc.protocols.CommonProto.ArenaRecordInfo.Builder addArenaRecordInfoBuilder( + int index) { + return getArenaRecordInfoFieldBuilder().addBuilder( + index, rpc.protocols.CommonProto.ArenaRecordInfo.getDefaultInstance()); + } + /** + * repeated .rpc.protocols.ArenaRecordInfo arenaRecordInfo = 1; + */ + public java.util.List + getArenaRecordInfoBuilderList() { + return getArenaRecordInfoFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + rpc.protocols.CommonProto.ArenaRecordInfo, rpc.protocols.CommonProto.ArenaRecordInfo.Builder, rpc.protocols.CommonProto.ArenaRecordInfoOrBuilder> + getArenaRecordInfoFieldBuilder() { + if (arenaRecordInfoBuilder_ == null) { + arenaRecordInfoBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + rpc.protocols.CommonProto.ArenaRecordInfo, rpc.protocols.CommonProto.ArenaRecordInfo.Builder, rpc.protocols.CommonProto.ArenaRecordInfoOrBuilder>( + arenaRecordInfo_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + arenaRecordInfo_ = null; + } + return arenaRecordInfoBuilder_; + } + + // @@protoc_insertion_point(builder_scope:rpc.world.GetWorldArenaRecordInfoResponse) + } + + static { + defaultInstance = new GetWorldArenaRecordInfoResponse(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:rpc.world.GetWorldArenaRecordInfoResponse) + } + + private static com.google.protobuf.Descriptors.Descriptor + internal_static_rpc_world_GetWorldArenaInfoRequest_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_rpc_world_GetWorldArenaInfoRequest_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_rpc_world_GetWorldArenaInfoResponse_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_rpc_world_GetWorldArenaInfoResponse_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_rpc_world_GetWorldArenaInfoIndication_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_rpc_world_GetWorldArenaInfoIndication_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_rpc_world_GetWorldArenaChallengeRequest_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_rpc_world_GetWorldArenaChallengeRequest_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_rpc_world_GetWorldArenaChallengeResponse_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_rpc_world_GetWorldArenaChallengeResponse_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_rpc_world_GetWorldArenaProudRequest_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_rpc_world_GetWorldArenaProudRequest_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_rpc_world_GetWorldArenaProudResponse_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_rpc_world_GetWorldArenaProudResponse_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_rpc_world_GetWorldArenaRecordInfoResponse_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_rpc_world_GetWorldArenaRecordInfoResponse_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 gtwprotos/WorldCommonProto.proto\022\trpc." + + "world\032\021CommonProto.proto\"\032\n\030GetWorldAren" + + "aInfoRequest\"h\n\031GetWorldArenaInfoRespons" + + "e\022+\n\tarenaInfo\030\001 \001(\0132\030.rpc.protocols.Are" + + "naInfo\022\r\n\005stage\030\002 \001(\005\022\017\n\007endTime\030\003 \001(\005\"j" + + "\n\033GetWorldArenaInfoIndication\022+\n\tarenaIn" + + "fo\030\001 \001(\0132\030.rpc.protocols.ArenaInfo\022\r\n\005st" + + "age\030\002 \001(\005\022\017\n\007endTime\030\003 \001(\005\"s\n\035GetWorldAr" + + "enaChallengeRequest\022\016\n\006teamId\030\001 \001(\005\022\031\n\021c" + + "hallengeServerid\030\002 \001(\005\022\024\n\014challengeUid\030\003", + " \001(\005\022\021\n\tskipFight\030\004 \001(\005\"\313\001\n\036GetWorldAren" + + "aChallengeResponse\022\024\n\014mySortChange\030\001 \001(\005" + + "\022.\n\013arenaEnemys\030\002 \003(\0132\031.rpc.protocols.Ar" + + "enaEnemy\022+\n\tfightData\030\003 \001(\0132\030.rpc.protoc" + + "ols.FightData\022\023\n\013fightResult\030\004 \001(\005\022!\n\004dr" + + "op\030\005 \001(\0132\023.rpc.protocols.Drop\"L\n\031GetWorl" + + "dArenaProudRequest\022\031\n\021challengeServerid\030" + + "\001 \001(\005\022\024\n\014challengeUid\030\002 \001(\005\"?\n\032GetWorldA" + + "renaProudResponse\022!\n\004drop\030\001 \001(\0132\023.rpc.pr" + + "otocols.Drop\"Z\n\037GetWorldArenaRecordInfoR", + "esponse\0227\n\017arenaRecordInfo\030\001 \003(\0132\036.rpc.p" + + "rotocols.ArenaRecordInfoB\002H\001" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + internal_static_rpc_world_GetWorldArenaInfoRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_rpc_world_GetWorldArenaInfoRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_rpc_world_GetWorldArenaInfoRequest_descriptor, + new java.lang.String[] { }); + internal_static_rpc_world_GetWorldArenaInfoResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_rpc_world_GetWorldArenaInfoResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_rpc_world_GetWorldArenaInfoResponse_descriptor, + new java.lang.String[] { "ArenaInfo", "Stage", "EndTime", }); + internal_static_rpc_world_GetWorldArenaInfoIndication_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_rpc_world_GetWorldArenaInfoIndication_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_rpc_world_GetWorldArenaInfoIndication_descriptor, + new java.lang.String[] { "ArenaInfo", "Stage", "EndTime", }); + internal_static_rpc_world_GetWorldArenaChallengeRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_rpc_world_GetWorldArenaChallengeRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_rpc_world_GetWorldArenaChallengeRequest_descriptor, + new java.lang.String[] { "TeamId", "ChallengeServerid", "ChallengeUid", "SkipFight", }); + internal_static_rpc_world_GetWorldArenaChallengeResponse_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_rpc_world_GetWorldArenaChallengeResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_rpc_world_GetWorldArenaChallengeResponse_descriptor, + new java.lang.String[] { "MySortChange", "ArenaEnemys", "FightData", "FightResult", "Drop", }); + internal_static_rpc_world_GetWorldArenaProudRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_rpc_world_GetWorldArenaProudRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_rpc_world_GetWorldArenaProudRequest_descriptor, + new java.lang.String[] { "ChallengeServerid", "ChallengeUid", }); + internal_static_rpc_world_GetWorldArenaProudResponse_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_rpc_world_GetWorldArenaProudResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_rpc_world_GetWorldArenaProudResponse_descriptor, + new java.lang.String[] { "Drop", }); + internal_static_rpc_world_GetWorldArenaRecordInfoResponse_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_rpc_world_GetWorldArenaRecordInfoResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_rpc_world_GetWorldArenaRecordInfoResponse_descriptor, + new java.lang.String[] { "ArenaRecordInfo", }); + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + rpc.protocols.CommonProto.getDescriptor(), + }, assigner); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/gamecommon/src/main/java/rpc/world/WorldProto.java b/gamecommon/src/main/java/rpc/world/WorldProto.java index 185739382..a38e44b53 100644 --- a/gamecommon/src/main/java/rpc/world/WorldProto.java +++ b/gamecommon/src/main/java/rpc/world/WorldProto.java @@ -1,5 +1,5 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! -// source: gtwprotos/WorldProto.proto +// source: wtgprotos/WorldProto.proto package rpc.world; @@ -5864,7 +5864,7 @@ public final class WorldProto { descriptor; static { java.lang.String[] descriptorData = { - "\n\032gtwprotos/WorldProto.proto\022\trpc.world\032" + + "\n\032wtgprotos/WorldProto.proto\022\trpc.world\032" + "\021CommonProto.proto\"\032\n\030GetWorldArenaInfoR" + "equest\"h\n\031GetWorldArenaInfoResponse\022+\n\ta" + "renaInfo\030\001 \001(\0132\030.rpc.protocols.ArenaInfo" + diff --git a/globalidserver/src/main/java/com/global/thrift/idl/InnerInvalidOperException.java b/globalidserver/src/main/java/com/global/thrift/idl/InnerInvalidOperException.java index c54a0d837..f46a1a07c 100644 --- a/globalidserver/src/main/java/com/global/thrift/idl/InnerInvalidOperException.java +++ b/globalidserver/src/main/java/com/global/thrift/idl/InnerInvalidOperException.java @@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory; /** * Structs can also be exceptions, if they are nasty. */ -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-19") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-20") public class InnerInvalidOperException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("InnerInvalidOperException"); diff --git a/globalidserver/src/main/java/com/global/thrift/idl/InnerResult.java b/globalidserver/src/main/java/com/global/thrift/idl/InnerResult.java index c590bd26d..6b4774c6c 100644 --- a/globalidserver/src/main/java/com/global/thrift/idl/InnerResult.java +++ b/globalidserver/src/main/java/com/global/thrift/idl/InnerResult.java @@ -34,7 +34,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-19") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-20") public class InnerResult implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("InnerResult"); diff --git a/globalidserver/src/main/java/com/global/thrift/idl/RPCgTGRequestIFace.java b/globalidserver/src/main/java/com/global/thrift/idl/RPCgTGRequestIFace.java index a2cc95b47..f1ab5acf1 100644 --- a/globalidserver/src/main/java/com/global/thrift/idl/RPCgTGRequestIFace.java +++ b/globalidserver/src/main/java/com/global/thrift/idl/RPCgTGRequestIFace.java @@ -34,7 +34,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-19") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-20") public class RPCgTGRequestIFace { public interface Iface { diff --git a/serverlogic/src/main/java/com/global/thrift/idl/InnerInvalidOperException.java b/serverlogic/src/main/java/com/global/thrift/idl/InnerInvalidOperException.java index c54a0d837..f46a1a07c 100644 --- a/serverlogic/src/main/java/com/global/thrift/idl/InnerInvalidOperException.java +++ b/serverlogic/src/main/java/com/global/thrift/idl/InnerInvalidOperException.java @@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory; /** * Structs can also be exceptions, if they are nasty. */ -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-19") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-20") public class InnerInvalidOperException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("InnerInvalidOperException"); diff --git a/serverlogic/src/main/java/com/global/thrift/idl/InnerResult.java b/serverlogic/src/main/java/com/global/thrift/idl/InnerResult.java index c590bd26d..6b4774c6c 100644 --- a/serverlogic/src/main/java/com/global/thrift/idl/InnerResult.java +++ b/serverlogic/src/main/java/com/global/thrift/idl/InnerResult.java @@ -34,7 +34,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-19") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-20") public class InnerResult implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("InnerResult"); diff --git a/serverlogic/src/main/java/com/global/thrift/idl/RPCgTGRequestIFace.java b/serverlogic/src/main/java/com/global/thrift/idl/RPCgTGRequestIFace.java index a2cc95b47..f1ab5acf1 100644 --- a/serverlogic/src/main/java/com/global/thrift/idl/RPCgTGRequestIFace.java +++ b/serverlogic/src/main/java/com/global/thrift/idl/RPCgTGRequestIFace.java @@ -34,7 +34,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-19") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-20") public class RPCgTGRequestIFace { public interface Iface { diff --git a/serverlogic/src/main/java/com/ljsd/GameLogicService.java b/serverlogic/src/main/java/com/ljsd/GameLogicService.java index e1b2fee57..dd25dea53 100644 --- a/serverlogic/src/main/java/com/ljsd/GameLogicService.java +++ b/serverlogic/src/main/java/com/ljsd/GameLogicService.java @@ -66,7 +66,8 @@ public class GameLogicService implements IService { CoreSettings coreSettings = ConfigurableApplicationContextManager.getBean(CoreSettings.class); String ip = coreSettings.getIp(); int port = coreSettings.getGmport(); - String rpcUrl = ip + ":" + port; + int worldport = coreSettings.getWorldport(); + String rpcUrl = ip + ":" + port+ ":" + worldport; RedisUtil.getInstence().set(RedisKey.LOGIC_SERVER_INFO+RedisKey.Delimiter_colon+GameApplication.serverId,gson.toJson(rpcUrl)); } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/config/json/CoreSettings.java b/serverlogic/src/main/java/com/ljsd/jieling/config/json/CoreSettings.java index 34c650c53..2283f89b1 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/config/json/CoreSettings.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/config/json/CoreSettings.java @@ -12,6 +12,7 @@ public class CoreSettings { private String ip; private int port; + private int worldport; private int gmport; private int area; private int id; @@ -27,6 +28,14 @@ public class CoreSettings { this.ip = ip; } + public int getWorldport() { + return worldport; + } + + public void setWorldport(int worldport) { + this.worldport = worldport; + } + public int getWeight() { return weight; } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/GlobleSystemLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/GlobleSystemLogic.java index 819b36ed4..2aa704433 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/GlobleSystemLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/GlobleSystemLogic.java @@ -178,6 +178,7 @@ public class GlobleSystemLogic implements IEventHandler { + } public static int getGloableWorldLeveCache() { @@ -186,7 +187,7 @@ public class GlobleSystemLogic implements IEventHandler { private static void setGloableWorldLeveCache(int gloableWorldLeveCache) { GLOABLE_WORLD_LEVE_CACHE = gloableWorldLeveCache; - RedisUtil.getInstence().putMapEntry(RedisKey.USER_SERVER_INFO,"",String.valueOf(GameApplication.areaId),gloableWorldLeveCache); + RedisUtil.getInstence().putMapEntry(RedisKey.SERVER_WORLDLEVE_INFO,"",String.valueOf(GameApplication.areaId),gloableWorldLeveCache); } public static int getGloableWorldLeveCacheLine() { diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/activity/ActivityLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/activity/ActivityLogic.java index 22568b93e..5dc24dd44 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/activity/ActivityLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/activity/ActivityLogic.java @@ -24,9 +24,6 @@ import com.ljsd.jieling.logic.mission.event.MissionEventDistributor; import com.ljsd.jieling.logic.player.PlayerLogic; import com.ljsd.jieling.logic.store.StoreLogic; import com.ljsd.jieling.network.session.ISession; -import rpc.protocols.CommonProto; -import rpc.protocols.MessageTypeProto; -import rpc.protocols.PlayerInfoProto; import com.ljsd.jieling.util.InnerMessageUtil; import com.ljsd.jieling.util.ItemUtil; import com.ljsd.jieling.util.MessageUtil; @@ -36,6 +33,9 @@ import manager.STableManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.data.redis.core.ZSetOperations; +import rpc.protocols.CommonProto; +import rpc.protocols.MessageTypeProto; +import rpc.protocols.PlayerInfoProto; import util.MathUtils; import util.TimeUtils; diff --git a/serverlogic/src/main/java/com/ljsd/jieling/thrift/idl/InvalidOperException.java b/serverlogic/src/main/java/com/ljsd/jieling/thrift/idl/InvalidOperException.java index 21d79a56f..8aba71dbd 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/thrift/idl/InvalidOperException.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/thrift/idl/InvalidOperException.java @@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory; /** * Structs can also be exceptions, if they are nasty. */ -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-19") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-20") public class InvalidOperException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("InvalidOperException"); diff --git a/serverlogic/src/main/java/com/ljsd/jieling/thrift/idl/RPCMatchRequestIFace.java b/serverlogic/src/main/java/com/ljsd/jieling/thrift/idl/RPCMatchRequestIFace.java index ab1480448..7e02b5f7d 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/thrift/idl/RPCMatchRequestIFace.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/thrift/idl/RPCMatchRequestIFace.java @@ -34,7 +34,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-19") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-20") public class RPCMatchRequestIFace { public interface Iface { diff --git a/serverlogic/src/main/java/com/ljsd/jieling/thrift/idl/RPCRequestIFace.java b/serverlogic/src/main/java/com/ljsd/jieling/thrift/idl/RPCRequestIFace.java index 72806d8c3..2afd894e5 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/thrift/idl/RPCRequestIFace.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/thrift/idl/RPCRequestIFace.java @@ -34,7 +34,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-19") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-20") public class RPCRequestIFace { public interface Iface { diff --git a/serverlogic/src/main/java/com/ljsd/jieling/thrift/idl/RechargeResult.java b/serverlogic/src/main/java/com/ljsd/jieling/thrift/idl/RechargeResult.java index 36699e213..6e04b9322 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/thrift/idl/RechargeResult.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/thrift/idl/RechargeResult.java @@ -34,7 +34,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-19") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-20") public class RechargeResult implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RechargeResult"); diff --git a/serverlogic/src/main/java/com/ljsd/jieling/thrift/idl/Result.java b/serverlogic/src/main/java/com/ljsd/jieling/thrift/idl/Result.java index aad419c52..393a36a71 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/thrift/idl/Result.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/thrift/idl/Result.java @@ -34,7 +34,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-19") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-20") public class Result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Result"); diff --git a/serverlogic/src/main/java/com/world/thrift/idl/InnerInvalidOperException.java b/serverlogic/src/main/java/com/world/thrift/idl/InnerInvalidOperException.java index def7b9423..25fe8a166 100644 --- a/serverlogic/src/main/java/com/world/thrift/idl/InnerInvalidOperException.java +++ b/serverlogic/src/main/java/com/world/thrift/idl/InnerInvalidOperException.java @@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory; /** * Structs can also be exceptions, if they are nasty. */ -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-19") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-20") public class InnerInvalidOperException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("InnerInvalidOperException"); diff --git a/serverlogic/src/main/java/com/world/thrift/idl/InnerResult.java b/serverlogic/src/main/java/com/world/thrift/idl/InnerResult.java index ab6447a26..9d1771a79 100644 --- a/serverlogic/src/main/java/com/world/thrift/idl/InnerResult.java +++ b/serverlogic/src/main/java/com/world/thrift/idl/InnerResult.java @@ -34,7 +34,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-19") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-20") public class InnerResult implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("InnerResult"); diff --git a/serverlogic/src/main/java/com/world/thrift/idl/RPCgTwRequestIFace.java b/serverlogic/src/main/java/com/world/thrift/idl/RPCgTwRequestIFace.java index fd07dcba8..9a76caddf 100644 --- a/serverlogic/src/main/java/com/world/thrift/idl/RPCgTwRequestIFace.java +++ b/serverlogic/src/main/java/com/world/thrift/idl/RPCgTwRequestIFace.java @@ -34,7 +34,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-19") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-20") public class RPCgTwRequestIFace { public interface Iface { diff --git a/serverlogic/src/main/java/com/world/thrift/idl/RPCwTgRequestIFace.java b/serverlogic/src/main/java/com/world/thrift/idl/RPCwTgRequestIFace.java new file mode 100644 index 000000000..d52fbd228 --- /dev/null +++ b/serverlogic/src/main/java/com/world/thrift/idl/RPCwTgRequestIFace.java @@ -0,0 +1,1199 @@ +/** + * Autogenerated by Thrift Compiler (0.9.2) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package com.world.thrift.idl; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-20") +public class RPCwTgRequestIFace { + + public interface Iface { + + public InnerResult messageRequest(int uid, int protpId, ByteBuffer message) throws org.apache.thrift.TException; + + } + + public interface AsyncIface { + + public void messageRequest(int uid, int protpId, ByteBuffer message, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + } + + public static class Client extends org.apache.thrift.TServiceClient implements Iface { + public static class Factory implements org.apache.thrift.TServiceClientFactory { + public Factory() {} + public Client getClient(org.apache.thrift.protocol.TProtocol prot) { + return new Client(prot); + } + public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { + return new Client(iprot, oprot); + } + } + + public Client(org.apache.thrift.protocol.TProtocol prot) + { + super(prot, prot); + } + + public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { + super(iprot, oprot); + } + + public InnerResult messageRequest(int uid, int protpId, ByteBuffer message) throws org.apache.thrift.TException + { + send_messageRequest(uid, protpId, message); + return recv_messageRequest(); + } + + public void send_messageRequest(int uid, int protpId, ByteBuffer message) throws org.apache.thrift.TException + { + messageRequest_args args = new messageRequest_args(); + args.setUid(uid); + args.setProtpId(protpId); + args.setMessage(message); + sendBase("messageRequest", args); + } + + public InnerResult recv_messageRequest() throws org.apache.thrift.TException + { + messageRequest_result result = new messageRequest_result(); + receiveBase(result, "messageRequest"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "messageRequest failed: unknown result"); + } + + } + public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { + public static class Factory implements org.apache.thrift.async.TAsyncClientFactory { + private org.apache.thrift.async.TAsyncClientManager clientManager; + private org.apache.thrift.protocol.TProtocolFactory protocolFactory; + public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) { + this.clientManager = clientManager; + this.protocolFactory = protocolFactory; + } + public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) { + return new AsyncClient(protocolFactory, clientManager, transport); + } + } + + public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) { + super(protocolFactory, clientManager, transport); + } + + public void messageRequest(int uid, int protpId, ByteBuffer message, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + messageRequest_call method_call = new messageRequest_call(uid, protpId, message, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class messageRequest_call extends org.apache.thrift.async.TAsyncMethodCall { + private int uid; + private int protpId; + private ByteBuffer message; + public messageRequest_call(int uid, int protpId, ByteBuffer message, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.uid = uid; + this.protpId = protpId; + this.message = message; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("messageRequest", org.apache.thrift.protocol.TMessageType.CALL, 0)); + messageRequest_args args = new messageRequest_args(); + args.setUid(uid); + args.setProtpId(protpId); + args.setMessage(message); + args.write(prot); + prot.writeMessageEnd(); + } + + public InnerResult getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_messageRequest(); + } + } + + } + + public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { + private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); + public Processor(I iface) { + super(iface, getProcessMap(new HashMap>())); + } + + protected Processor(I iface, Map> processMap) { + super(iface, getProcessMap(processMap)); + } + + private static Map> getProcessMap(Map> processMap) { + processMap.put("messageRequest", new messageRequest()); + return processMap; + } + + public static class messageRequest extends org.apache.thrift.ProcessFunction { + public messageRequest() { + super("messageRequest"); + } + + public messageRequest_args getEmptyArgsInstance() { + return new messageRequest_args(); + } + + protected boolean isOneway() { + return false; + } + + public messageRequest_result getResult(I iface, messageRequest_args args) throws org.apache.thrift.TException { + messageRequest_result result = new messageRequest_result(); + result.success = iface.messageRequest(args.uid, args.protpId, args.message); + return result; + } + } + + } + + public static class AsyncProcessor extends org.apache.thrift.TBaseAsyncProcessor { + private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName()); + public AsyncProcessor(I iface) { + super(iface, getProcessMap(new HashMap>())); + } + + protected AsyncProcessor(I iface, Map> processMap) { + super(iface, getProcessMap(processMap)); + } + + private static Map> getProcessMap(Map> processMap) { + processMap.put("messageRequest", new messageRequest()); + return processMap; + } + + public static class messageRequest extends org.apache.thrift.AsyncProcessFunction { + public messageRequest() { + super("messageRequest"); + } + + public messageRequest_args getEmptyArgsInstance() { + return new messageRequest_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(InnerResult o) { + messageRequest_result result = new messageRequest_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + messageRequest_result result = new messageRequest_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, messageRequest_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.messageRequest(args.uid, args.protpId, args.message,resultHandler); + } + } + + } + + public static class messageRequest_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("messageRequest_args"); + + private static final org.apache.thrift.protocol.TField UID_FIELD_DESC = new org.apache.thrift.protocol.TField("uid", org.apache.thrift.protocol.TType.I32, (short)1); + private static final org.apache.thrift.protocol.TField PROTP_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("protpId", org.apache.thrift.protocol.TType.I32, (short)2); + private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)3); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new messageRequest_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new messageRequest_argsTupleSchemeFactory()); + } + + public int uid; // required + public int protpId; // required + public ByteBuffer message; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + UID((short)1, "uid"), + PROTP_ID((short)2, "protpId"), + MESSAGE((short)3, "message"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // UID + return UID; + case 2: // PROTP_ID + return PROTP_ID; + case 3: // MESSAGE + return MESSAGE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __UID_ISSET_ID = 0; + private static final int __PROTPID_ISSET_ID = 1; + private byte __isset_bitfield = 0; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.UID, new org.apache.thrift.meta_data.FieldMetaData("uid", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.PROTP_ID, new org.apache.thrift.meta_data.FieldMetaData("protpId", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(messageRequest_args.class, metaDataMap); + } + + public messageRequest_args() { + } + + public messageRequest_args( + int uid, + int protpId, + ByteBuffer message) + { + this(); + this.uid = uid; + setUidIsSet(true); + this.protpId = protpId; + setProtpIdIsSet(true); + this.message = org.apache.thrift.TBaseHelper.copyBinary(message); + } + + /** + * Performs a deep copy on other. + */ + public messageRequest_args(messageRequest_args other) { + __isset_bitfield = other.__isset_bitfield; + this.uid = other.uid; + this.protpId = other.protpId; + if (other.isSetMessage()) { + this.message = org.apache.thrift.TBaseHelper.copyBinary(other.message); + } + } + + public messageRequest_args deepCopy() { + return new messageRequest_args(this); + } + + @Override + public void clear() { + setUidIsSet(false); + this.uid = 0; + setProtpIdIsSet(false); + this.protpId = 0; + this.message = null; + } + + public int getUid() { + return this.uid; + } + + public messageRequest_args setUid(int uid) { + this.uid = uid; + setUidIsSet(true); + return this; + } + + public void unsetUid() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UID_ISSET_ID); + } + + /** Returns true if field uid is set (has been assigned a value) and false otherwise */ + public boolean isSetUid() { + return EncodingUtils.testBit(__isset_bitfield, __UID_ISSET_ID); + } + + public void setUidIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UID_ISSET_ID, value); + } + + public int getProtpId() { + return this.protpId; + } + + public messageRequest_args setProtpId(int protpId) { + this.protpId = protpId; + setProtpIdIsSet(true); + return this; + } + + public void unsetProtpId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PROTPID_ISSET_ID); + } + + /** Returns true if field protpId is set (has been assigned a value) and false otherwise */ + public boolean isSetProtpId() { + return EncodingUtils.testBit(__isset_bitfield, __PROTPID_ISSET_ID); + } + + public void setProtpIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PROTPID_ISSET_ID, value); + } + + public byte[] getMessage() { + setMessage(org.apache.thrift.TBaseHelper.rightSize(message)); + return message == null ? null : message.array(); + } + + public ByteBuffer bufferForMessage() { + return org.apache.thrift.TBaseHelper.copyBinary(message); + } + + public messageRequest_args setMessage(byte[] message) { + this.message = message == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(message, message.length)); + return this; + } + + public messageRequest_args setMessage(ByteBuffer message) { + this.message = org.apache.thrift.TBaseHelper.copyBinary(message); + return this; + } + + public void unsetMessage() { + this.message = null; + } + + /** Returns true if field message is set (has been assigned a value) and false otherwise */ + public boolean isSetMessage() { + return this.message != null; + } + + public void setMessageIsSet(boolean value) { + if (!value) { + this.message = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case UID: + if (value == null) { + unsetUid(); + } else { + setUid((Integer)value); + } + break; + + case PROTP_ID: + if (value == null) { + unsetProtpId(); + } else { + setProtpId((Integer)value); + } + break; + + case MESSAGE: + if (value == null) { + unsetMessage(); + } else { + setMessage((ByteBuffer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case UID: + return Integer.valueOf(getUid()); + + case PROTP_ID: + return Integer.valueOf(getProtpId()); + + case MESSAGE: + return getMessage(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case UID: + return isSetUid(); + case PROTP_ID: + return isSetProtpId(); + case MESSAGE: + return isSetMessage(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof messageRequest_args) + return this.equals((messageRequest_args)that); + return false; + } + + public boolean equals(messageRequest_args that) { + if (that == null) + return false; + + boolean this_present_uid = true; + boolean that_present_uid = true; + if (this_present_uid || that_present_uid) { + if (!(this_present_uid && that_present_uid)) + return false; + if (this.uid != that.uid) + return false; + } + + boolean this_present_protpId = true; + boolean that_present_protpId = true; + if (this_present_protpId || that_present_protpId) { + if (!(this_present_protpId && that_present_protpId)) + return false; + if (this.protpId != that.protpId) + return false; + } + + boolean this_present_message = true && this.isSetMessage(); + boolean that_present_message = true && that.isSetMessage(); + if (this_present_message || that_present_message) { + if (!(this_present_message && that_present_message)) + return false; + if (!this.message.equals(that.message)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_uid = true; + list.add(present_uid); + if (present_uid) + list.add(uid); + + boolean present_protpId = true; + list.add(present_protpId); + if (present_protpId) + list.add(protpId); + + boolean present_message = true && (isSetMessage()); + list.add(present_message); + if (present_message) + list.add(message); + + return list.hashCode(); + } + + @Override + public int compareTo(messageRequest_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetUid()).compareTo(other.isSetUid()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUid()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uid, other.uid); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetProtpId()).compareTo(other.isSetProtpId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetProtpId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.protpId, other.protpId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMessage()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("messageRequest_args("); + boolean first = true; + + sb.append("uid:"); + sb.append(this.uid); + first = false; + if (!first) sb.append(", "); + sb.append("protpId:"); + sb.append(this.protpId); + first = false; + if (!first) sb.append(", "); + sb.append("message:"); + if (this.message == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.message, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class messageRequest_argsStandardSchemeFactory implements SchemeFactory { + public messageRequest_argsStandardScheme getScheme() { + return new messageRequest_argsStandardScheme(); + } + } + + private static class messageRequest_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, messageRequest_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // UID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.uid = iprot.readI32(); + struct.setUidIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // PROTP_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.protpId = iprot.readI32(); + struct.setProtpIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // MESSAGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.message = iprot.readBinary(); + struct.setMessageIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, messageRequest_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(UID_FIELD_DESC); + oprot.writeI32(struct.uid); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(PROTP_ID_FIELD_DESC); + oprot.writeI32(struct.protpId); + oprot.writeFieldEnd(); + if (struct.message != null) { + oprot.writeFieldBegin(MESSAGE_FIELD_DESC); + oprot.writeBinary(struct.message); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class messageRequest_argsTupleSchemeFactory implements SchemeFactory { + public messageRequest_argsTupleScheme getScheme() { + return new messageRequest_argsTupleScheme(); + } + } + + private static class messageRequest_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, messageRequest_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetUid()) { + optionals.set(0); + } + if (struct.isSetProtpId()) { + optionals.set(1); + } + if (struct.isSetMessage()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetUid()) { + oprot.writeI32(struct.uid); + } + if (struct.isSetProtpId()) { + oprot.writeI32(struct.protpId); + } + if (struct.isSetMessage()) { + oprot.writeBinary(struct.message); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, messageRequest_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.uid = iprot.readI32(); + struct.setUidIsSet(true); + } + if (incoming.get(1)) { + struct.protpId = iprot.readI32(); + struct.setProtpIdIsSet(true); + } + if (incoming.get(2)) { + struct.message = iprot.readBinary(); + struct.setMessageIsSet(true); + } + } + } + + } + + public static class messageRequest_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("messageRequest_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new messageRequest_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new messageRequest_resultTupleSchemeFactory()); + } + + public InnerResult success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InnerResult.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(messageRequest_result.class, metaDataMap); + } + + public messageRequest_result() { + } + + public messageRequest_result( + InnerResult success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public messageRequest_result(messageRequest_result other) { + if (other.isSetSuccess()) { + this.success = new InnerResult(other.success); + } + } + + public messageRequest_result deepCopy() { + return new messageRequest_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public InnerResult getSuccess() { + return this.success; + } + + public messageRequest_result setSuccess(InnerResult success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((InnerResult)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof messageRequest_result) + return this.equals((messageRequest_result)that); + return false; + } + + public boolean equals(messageRequest_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(messageRequest_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("messageRequest_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (success != null) { + success.validate(); + } + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class messageRequest_resultStandardSchemeFactory implements SchemeFactory { + public messageRequest_resultStandardScheme getScheme() { + return new messageRequest_resultStandardScheme(); + } + } + + private static class messageRequest_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, messageRequest_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new InnerResult(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, messageRequest_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class messageRequest_resultTupleSchemeFactory implements SchemeFactory { + public messageRequest_resultTupleScheme getScheme() { + return new messageRequest_resultTupleScheme(); + } + } + + private static class messageRequest_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, messageRequest_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, messageRequest_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new InnerResult(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + } + +} diff --git a/serverlogic/src/main/thrift/idl/gen-java/com/global/thrift/idl/InnerInvalidOperException.java b/serverlogic/src/main/thrift/idl/gen-java/com/global/thrift/idl/InnerInvalidOperException.java index c54a0d837..f46a1a07c 100644 --- a/serverlogic/src/main/thrift/idl/gen-java/com/global/thrift/idl/InnerInvalidOperException.java +++ b/serverlogic/src/main/thrift/idl/gen-java/com/global/thrift/idl/InnerInvalidOperException.java @@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory; /** * Structs can also be exceptions, if they are nasty. */ -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-19") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-20") public class InnerInvalidOperException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("InnerInvalidOperException"); diff --git a/serverlogic/src/main/thrift/idl/gen-java/com/global/thrift/idl/InnerResult.java b/serverlogic/src/main/thrift/idl/gen-java/com/global/thrift/idl/InnerResult.java index c590bd26d..6b4774c6c 100644 --- a/serverlogic/src/main/thrift/idl/gen-java/com/global/thrift/idl/InnerResult.java +++ b/serverlogic/src/main/thrift/idl/gen-java/com/global/thrift/idl/InnerResult.java @@ -34,7 +34,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-19") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-20") public class InnerResult implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("InnerResult"); diff --git a/serverlogic/src/main/thrift/idl/gen-java/com/global/thrift/idl/RPCgTGRequestIFace.java b/serverlogic/src/main/thrift/idl/gen-java/com/global/thrift/idl/RPCgTGRequestIFace.java index a2cc95b47..f1ab5acf1 100644 --- a/serverlogic/src/main/thrift/idl/gen-java/com/global/thrift/idl/RPCgTGRequestIFace.java +++ b/serverlogic/src/main/thrift/idl/gen-java/com/global/thrift/idl/RPCgTGRequestIFace.java @@ -34,7 +34,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-19") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-20") public class RPCgTGRequestIFace { public interface Iface { diff --git a/serverlogic/src/main/thrift/idl/gen-java/com/ljsd/jieling/thrift/idl/InvalidOperException.java b/serverlogic/src/main/thrift/idl/gen-java/com/ljsd/jieling/thrift/idl/InvalidOperException.java index 21d79a56f..8aba71dbd 100644 --- a/serverlogic/src/main/thrift/idl/gen-java/com/ljsd/jieling/thrift/idl/InvalidOperException.java +++ b/serverlogic/src/main/thrift/idl/gen-java/com/ljsd/jieling/thrift/idl/InvalidOperException.java @@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory; /** * Structs can also be exceptions, if they are nasty. */ -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-19") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-20") public class InvalidOperException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("InvalidOperException"); diff --git a/serverlogic/src/main/thrift/idl/gen-java/com/ljsd/jieling/thrift/idl/RPCMatchRequestIFace.java b/serverlogic/src/main/thrift/idl/gen-java/com/ljsd/jieling/thrift/idl/RPCMatchRequestIFace.java index ab1480448..7e02b5f7d 100644 --- a/serverlogic/src/main/thrift/idl/gen-java/com/ljsd/jieling/thrift/idl/RPCMatchRequestIFace.java +++ b/serverlogic/src/main/thrift/idl/gen-java/com/ljsd/jieling/thrift/idl/RPCMatchRequestIFace.java @@ -34,7 +34,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-19") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-20") public class RPCMatchRequestIFace { public interface Iface { diff --git a/serverlogic/src/main/thrift/idl/gen-java/com/ljsd/jieling/thrift/idl/RPCRequestIFace.java b/serverlogic/src/main/thrift/idl/gen-java/com/ljsd/jieling/thrift/idl/RPCRequestIFace.java index 72806d8c3..2afd894e5 100644 --- a/serverlogic/src/main/thrift/idl/gen-java/com/ljsd/jieling/thrift/idl/RPCRequestIFace.java +++ b/serverlogic/src/main/thrift/idl/gen-java/com/ljsd/jieling/thrift/idl/RPCRequestIFace.java @@ -34,7 +34,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-19") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-20") public class RPCRequestIFace { public interface Iface { diff --git a/serverlogic/src/main/thrift/idl/gen-java/com/ljsd/jieling/thrift/idl/RechargeResult.java b/serverlogic/src/main/thrift/idl/gen-java/com/ljsd/jieling/thrift/idl/RechargeResult.java index 36699e213..6e04b9322 100644 --- a/serverlogic/src/main/thrift/idl/gen-java/com/ljsd/jieling/thrift/idl/RechargeResult.java +++ b/serverlogic/src/main/thrift/idl/gen-java/com/ljsd/jieling/thrift/idl/RechargeResult.java @@ -34,7 +34,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-19") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-20") public class RechargeResult implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RechargeResult"); diff --git a/serverlogic/src/main/thrift/idl/gen-java/com/ljsd/jieling/thrift/idl/Result.java b/serverlogic/src/main/thrift/idl/gen-java/com/ljsd/jieling/thrift/idl/Result.java index aad419c52..393a36a71 100644 --- a/serverlogic/src/main/thrift/idl/gen-java/com/ljsd/jieling/thrift/idl/Result.java +++ b/serverlogic/src/main/thrift/idl/gen-java/com/ljsd/jieling/thrift/idl/Result.java @@ -34,7 +34,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-19") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-20") public class Result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Result"); diff --git a/serverlogic/src/main/thrift/idl/gen-java/com/world/thrift/idl/RPCwTgRequestIFace.java b/serverlogic/src/main/thrift/idl/gen-java/com/world/thrift/idl/RPCwTgRequestIFace.java new file mode 100644 index 000000000..d52fbd228 --- /dev/null +++ b/serverlogic/src/main/thrift/idl/gen-java/com/world/thrift/idl/RPCwTgRequestIFace.java @@ -0,0 +1,1199 @@ +/** + * Autogenerated by Thrift Compiler (0.9.2) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package com.world.thrift.idl; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-20") +public class RPCwTgRequestIFace { + + public interface Iface { + + public InnerResult messageRequest(int uid, int protpId, ByteBuffer message) throws org.apache.thrift.TException; + + } + + public interface AsyncIface { + + public void messageRequest(int uid, int protpId, ByteBuffer message, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + } + + public static class Client extends org.apache.thrift.TServiceClient implements Iface { + public static class Factory implements org.apache.thrift.TServiceClientFactory { + public Factory() {} + public Client getClient(org.apache.thrift.protocol.TProtocol prot) { + return new Client(prot); + } + public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { + return new Client(iprot, oprot); + } + } + + public Client(org.apache.thrift.protocol.TProtocol prot) + { + super(prot, prot); + } + + public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { + super(iprot, oprot); + } + + public InnerResult messageRequest(int uid, int protpId, ByteBuffer message) throws org.apache.thrift.TException + { + send_messageRequest(uid, protpId, message); + return recv_messageRequest(); + } + + public void send_messageRequest(int uid, int protpId, ByteBuffer message) throws org.apache.thrift.TException + { + messageRequest_args args = new messageRequest_args(); + args.setUid(uid); + args.setProtpId(protpId); + args.setMessage(message); + sendBase("messageRequest", args); + } + + public InnerResult recv_messageRequest() throws org.apache.thrift.TException + { + messageRequest_result result = new messageRequest_result(); + receiveBase(result, "messageRequest"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "messageRequest failed: unknown result"); + } + + } + public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { + public static class Factory implements org.apache.thrift.async.TAsyncClientFactory { + private org.apache.thrift.async.TAsyncClientManager clientManager; + private org.apache.thrift.protocol.TProtocolFactory protocolFactory; + public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) { + this.clientManager = clientManager; + this.protocolFactory = protocolFactory; + } + public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) { + return new AsyncClient(protocolFactory, clientManager, transport); + } + } + + public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) { + super(protocolFactory, clientManager, transport); + } + + public void messageRequest(int uid, int protpId, ByteBuffer message, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + messageRequest_call method_call = new messageRequest_call(uid, protpId, message, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class messageRequest_call extends org.apache.thrift.async.TAsyncMethodCall { + private int uid; + private int protpId; + private ByteBuffer message; + public messageRequest_call(int uid, int protpId, ByteBuffer message, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.uid = uid; + this.protpId = protpId; + this.message = message; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("messageRequest", org.apache.thrift.protocol.TMessageType.CALL, 0)); + messageRequest_args args = new messageRequest_args(); + args.setUid(uid); + args.setProtpId(protpId); + args.setMessage(message); + args.write(prot); + prot.writeMessageEnd(); + } + + public InnerResult getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_messageRequest(); + } + } + + } + + public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { + private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); + public Processor(I iface) { + super(iface, getProcessMap(new HashMap>())); + } + + protected Processor(I iface, Map> processMap) { + super(iface, getProcessMap(processMap)); + } + + private static Map> getProcessMap(Map> processMap) { + processMap.put("messageRequest", new messageRequest()); + return processMap; + } + + public static class messageRequest extends org.apache.thrift.ProcessFunction { + public messageRequest() { + super("messageRequest"); + } + + public messageRequest_args getEmptyArgsInstance() { + return new messageRequest_args(); + } + + protected boolean isOneway() { + return false; + } + + public messageRequest_result getResult(I iface, messageRequest_args args) throws org.apache.thrift.TException { + messageRequest_result result = new messageRequest_result(); + result.success = iface.messageRequest(args.uid, args.protpId, args.message); + return result; + } + } + + } + + public static class AsyncProcessor extends org.apache.thrift.TBaseAsyncProcessor { + private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName()); + public AsyncProcessor(I iface) { + super(iface, getProcessMap(new HashMap>())); + } + + protected AsyncProcessor(I iface, Map> processMap) { + super(iface, getProcessMap(processMap)); + } + + private static Map> getProcessMap(Map> processMap) { + processMap.put("messageRequest", new messageRequest()); + return processMap; + } + + public static class messageRequest extends org.apache.thrift.AsyncProcessFunction { + public messageRequest() { + super("messageRequest"); + } + + public messageRequest_args getEmptyArgsInstance() { + return new messageRequest_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(InnerResult o) { + messageRequest_result result = new messageRequest_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + messageRequest_result result = new messageRequest_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, messageRequest_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.messageRequest(args.uid, args.protpId, args.message,resultHandler); + } + } + + } + + public static class messageRequest_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("messageRequest_args"); + + private static final org.apache.thrift.protocol.TField UID_FIELD_DESC = new org.apache.thrift.protocol.TField("uid", org.apache.thrift.protocol.TType.I32, (short)1); + private static final org.apache.thrift.protocol.TField PROTP_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("protpId", org.apache.thrift.protocol.TType.I32, (short)2); + private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)3); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new messageRequest_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new messageRequest_argsTupleSchemeFactory()); + } + + public int uid; // required + public int protpId; // required + public ByteBuffer message; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + UID((short)1, "uid"), + PROTP_ID((short)2, "protpId"), + MESSAGE((short)3, "message"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // UID + return UID; + case 2: // PROTP_ID + return PROTP_ID; + case 3: // MESSAGE + return MESSAGE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __UID_ISSET_ID = 0; + private static final int __PROTPID_ISSET_ID = 1; + private byte __isset_bitfield = 0; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.UID, new org.apache.thrift.meta_data.FieldMetaData("uid", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.PROTP_ID, new org.apache.thrift.meta_data.FieldMetaData("protpId", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(messageRequest_args.class, metaDataMap); + } + + public messageRequest_args() { + } + + public messageRequest_args( + int uid, + int protpId, + ByteBuffer message) + { + this(); + this.uid = uid; + setUidIsSet(true); + this.protpId = protpId; + setProtpIdIsSet(true); + this.message = org.apache.thrift.TBaseHelper.copyBinary(message); + } + + /** + * Performs a deep copy on other. + */ + public messageRequest_args(messageRequest_args other) { + __isset_bitfield = other.__isset_bitfield; + this.uid = other.uid; + this.protpId = other.protpId; + if (other.isSetMessage()) { + this.message = org.apache.thrift.TBaseHelper.copyBinary(other.message); + } + } + + public messageRequest_args deepCopy() { + return new messageRequest_args(this); + } + + @Override + public void clear() { + setUidIsSet(false); + this.uid = 0; + setProtpIdIsSet(false); + this.protpId = 0; + this.message = null; + } + + public int getUid() { + return this.uid; + } + + public messageRequest_args setUid(int uid) { + this.uid = uid; + setUidIsSet(true); + return this; + } + + public void unsetUid() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UID_ISSET_ID); + } + + /** Returns true if field uid is set (has been assigned a value) and false otherwise */ + public boolean isSetUid() { + return EncodingUtils.testBit(__isset_bitfield, __UID_ISSET_ID); + } + + public void setUidIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UID_ISSET_ID, value); + } + + public int getProtpId() { + return this.protpId; + } + + public messageRequest_args setProtpId(int protpId) { + this.protpId = protpId; + setProtpIdIsSet(true); + return this; + } + + public void unsetProtpId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PROTPID_ISSET_ID); + } + + /** Returns true if field protpId is set (has been assigned a value) and false otherwise */ + public boolean isSetProtpId() { + return EncodingUtils.testBit(__isset_bitfield, __PROTPID_ISSET_ID); + } + + public void setProtpIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PROTPID_ISSET_ID, value); + } + + public byte[] getMessage() { + setMessage(org.apache.thrift.TBaseHelper.rightSize(message)); + return message == null ? null : message.array(); + } + + public ByteBuffer bufferForMessage() { + return org.apache.thrift.TBaseHelper.copyBinary(message); + } + + public messageRequest_args setMessage(byte[] message) { + this.message = message == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(message, message.length)); + return this; + } + + public messageRequest_args setMessage(ByteBuffer message) { + this.message = org.apache.thrift.TBaseHelper.copyBinary(message); + return this; + } + + public void unsetMessage() { + this.message = null; + } + + /** Returns true if field message is set (has been assigned a value) and false otherwise */ + public boolean isSetMessage() { + return this.message != null; + } + + public void setMessageIsSet(boolean value) { + if (!value) { + this.message = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case UID: + if (value == null) { + unsetUid(); + } else { + setUid((Integer)value); + } + break; + + case PROTP_ID: + if (value == null) { + unsetProtpId(); + } else { + setProtpId((Integer)value); + } + break; + + case MESSAGE: + if (value == null) { + unsetMessage(); + } else { + setMessage((ByteBuffer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case UID: + return Integer.valueOf(getUid()); + + case PROTP_ID: + return Integer.valueOf(getProtpId()); + + case MESSAGE: + return getMessage(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case UID: + return isSetUid(); + case PROTP_ID: + return isSetProtpId(); + case MESSAGE: + return isSetMessage(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof messageRequest_args) + return this.equals((messageRequest_args)that); + return false; + } + + public boolean equals(messageRequest_args that) { + if (that == null) + return false; + + boolean this_present_uid = true; + boolean that_present_uid = true; + if (this_present_uid || that_present_uid) { + if (!(this_present_uid && that_present_uid)) + return false; + if (this.uid != that.uid) + return false; + } + + boolean this_present_protpId = true; + boolean that_present_protpId = true; + if (this_present_protpId || that_present_protpId) { + if (!(this_present_protpId && that_present_protpId)) + return false; + if (this.protpId != that.protpId) + return false; + } + + boolean this_present_message = true && this.isSetMessage(); + boolean that_present_message = true && that.isSetMessage(); + if (this_present_message || that_present_message) { + if (!(this_present_message && that_present_message)) + return false; + if (!this.message.equals(that.message)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_uid = true; + list.add(present_uid); + if (present_uid) + list.add(uid); + + boolean present_protpId = true; + list.add(present_protpId); + if (present_protpId) + list.add(protpId); + + boolean present_message = true && (isSetMessage()); + list.add(present_message); + if (present_message) + list.add(message); + + return list.hashCode(); + } + + @Override + public int compareTo(messageRequest_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetUid()).compareTo(other.isSetUid()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUid()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uid, other.uid); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetProtpId()).compareTo(other.isSetProtpId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetProtpId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.protpId, other.protpId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMessage()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("messageRequest_args("); + boolean first = true; + + sb.append("uid:"); + sb.append(this.uid); + first = false; + if (!first) sb.append(", "); + sb.append("protpId:"); + sb.append(this.protpId); + first = false; + if (!first) sb.append(", "); + sb.append("message:"); + if (this.message == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.message, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class messageRequest_argsStandardSchemeFactory implements SchemeFactory { + public messageRequest_argsStandardScheme getScheme() { + return new messageRequest_argsStandardScheme(); + } + } + + private static class messageRequest_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, messageRequest_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // UID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.uid = iprot.readI32(); + struct.setUidIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // PROTP_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.protpId = iprot.readI32(); + struct.setProtpIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // MESSAGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.message = iprot.readBinary(); + struct.setMessageIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, messageRequest_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(UID_FIELD_DESC); + oprot.writeI32(struct.uid); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(PROTP_ID_FIELD_DESC); + oprot.writeI32(struct.protpId); + oprot.writeFieldEnd(); + if (struct.message != null) { + oprot.writeFieldBegin(MESSAGE_FIELD_DESC); + oprot.writeBinary(struct.message); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class messageRequest_argsTupleSchemeFactory implements SchemeFactory { + public messageRequest_argsTupleScheme getScheme() { + return new messageRequest_argsTupleScheme(); + } + } + + private static class messageRequest_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, messageRequest_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetUid()) { + optionals.set(0); + } + if (struct.isSetProtpId()) { + optionals.set(1); + } + if (struct.isSetMessage()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetUid()) { + oprot.writeI32(struct.uid); + } + if (struct.isSetProtpId()) { + oprot.writeI32(struct.protpId); + } + if (struct.isSetMessage()) { + oprot.writeBinary(struct.message); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, messageRequest_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.uid = iprot.readI32(); + struct.setUidIsSet(true); + } + if (incoming.get(1)) { + struct.protpId = iprot.readI32(); + struct.setProtpIdIsSet(true); + } + if (incoming.get(2)) { + struct.message = iprot.readBinary(); + struct.setMessageIsSet(true); + } + } + } + + } + + public static class messageRequest_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("messageRequest_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new messageRequest_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new messageRequest_resultTupleSchemeFactory()); + } + + public InnerResult success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InnerResult.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(messageRequest_result.class, metaDataMap); + } + + public messageRequest_result() { + } + + public messageRequest_result( + InnerResult success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public messageRequest_result(messageRequest_result other) { + if (other.isSetSuccess()) { + this.success = new InnerResult(other.success); + } + } + + public messageRequest_result deepCopy() { + return new messageRequest_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public InnerResult getSuccess() { + return this.success; + } + + public messageRequest_result setSuccess(InnerResult success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((InnerResult)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof messageRequest_result) + return this.equals((messageRequest_result)that); + return false; + } + + public boolean equals(messageRequest_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(messageRequest_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("messageRequest_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (success != null) { + success.validate(); + } + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class messageRequest_resultStandardSchemeFactory implements SchemeFactory { + public messageRequest_resultStandardScheme getScheme() { + return new messageRequest_resultStandardScheme(); + } + } + + private static class messageRequest_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, messageRequest_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new InnerResult(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, messageRequest_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class messageRequest_resultTupleSchemeFactory implements SchemeFactory { + public messageRequest_resultTupleScheme getScheme() { + return new messageRequest_resultTupleScheme(); + } + } + + private static class messageRequest_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, messageRequest_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, messageRequest_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new InnerResult(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + } + +} diff --git a/serverlogic/src/main/thrift/idl/world.thrift b/serverlogic/src/main/thrift/idl/world.thrift index a4152558d..e4c3b556b 100644 --- a/serverlogic/src/main/thrift/idl/world.thrift +++ b/serverlogic/src/main/thrift/idl/world.thrift @@ -21,3 +21,8 @@ service RPCgTwRequestIFace{ } +service RPCwTgRequestIFace{ + InnerResult messageRequest(1:i32 uid,2:i32 protpId,3:binary message); +} + + diff --git a/worldserver/src/main/java/com/IManager.java b/worldserver/src/main/java/com/IManager.java new file mode 100644 index 000000000..67c8be346 --- /dev/null +++ b/worldserver/src/main/java/com/IManager.java @@ -0,0 +1,17 @@ +package com; + + +/** + * Description: 服务器管理 + * Author: zsx + * CreateDate: 2019/11/6 17:00 + */ +public interface IManager { + + //manager init + void init() throws Exception; + + //manager exit + void exit() throws Exception; + +} diff --git a/worldserver/src/main/java/com/world/WorldServerApplication.java b/worldserver/src/main/java/com/WorldServerApplication.java similarity index 85% rename from worldserver/src/main/java/com/world/WorldServerApplication.java rename to worldserver/src/main/java/com/WorldServerApplication.java index 68e10fde7..6dc620fbb 100644 --- a/worldserver/src/main/java/com/world/WorldServerApplication.java +++ b/worldserver/src/main/java/com/WorldServerApplication.java @@ -1,7 +1,8 @@ -package com.world; +package com; import com.world.config.ConfigurableApplicationContextManager; import com.world.config.CoreSettings; +import com.world.network.NetManager; import com.world.redis.RedisUtil; import com.world.thread.ThreadManager; import com.world.thrift.idl.pool.RPCServerTask; @@ -16,6 +17,8 @@ import org.springframework.scheduling.annotation.EnableScheduling; /** * Description: 提供跨服玩法 + * 不入库玩家数据 + * 不对逻辑服做推送服务 * Author: zsx * CreateDate: 2020/11/19 11:48 */ @@ -26,7 +29,7 @@ import org.springframework.scheduling.annotation.EnableScheduling; public class WorldServerApplication { private static final Logger LOGGER = LoggerFactory.getLogger(WorldServerApplication.class); public static CoreSettings bean; - public static void main(String[] args) { + public static void main(String[] args)throws Exception { ConfigurableApplicationContextManager.init(args); @@ -40,7 +43,12 @@ public class WorldServerApplication { } WorldRpcService.initHandler("com.world.handler",WorldServerApplication.class.getClassLoader()); - new RPCServerTask().start(); + + + // new RPCServerTask().start(); + //切换netty通信 + NetManager.getInstance().init(); + RedisUtil.getInstence().init(); bean = ConfigurableApplicationContextManager.getBean(CoreSettings.class); LOGGER.info("ServerProperties ->{}", bean.toString()); diff --git a/worldserver/src/main/java/com/world/config/ConfigurableApplicationContextManager.java b/worldserver/src/main/java/com/world/config/ConfigurableApplicationContextManager.java index 78fa82ae2..b3674dba3 100644 --- a/worldserver/src/main/java/com/world/config/ConfigurableApplicationContextManager.java +++ b/worldserver/src/main/java/com/world/config/ConfigurableApplicationContextManager.java @@ -1,6 +1,6 @@ package com.world.config; -import com.world.WorldServerApplication; +import com.WorldServerApplication; import org.springframework.boot.SpringApplication; import org.springframework.context.ConfigurableApplicationContext; diff --git a/worldserver/src/main/java/com/world/function/ArenaWorldFunction.java b/worldserver/src/main/java/com/world/function/ArenaWorldFunction.java new file mode 100644 index 000000000..7ab9f8410 --- /dev/null +++ b/worldserver/src/main/java/com/world/function/ArenaWorldFunction.java @@ -0,0 +1,20 @@ +package com.world.function; + +/** + * Description: 跨服天梯 + * Author: zsx + * CreateDate: 2020/11/20 11:31 + */ +public class ArenaWorldFunction implements FunctionManager { + + @Override + public void closeAction ()throws Exception { + // ArenaLogic.getInstance().sendReward(GlobalsDef.ARENA_SEASON_REWARD); + } + + @Override + public void startAction(TimeControllerOfFunction timeControllerOfFunction) { + // ArenaLogic.getInstance().updateArenaSeason(timeControllerOfFunction.getTimes()); + + } +} diff --git a/worldserver/src/main/java/com/world/function/FunctionIdEnum.java b/worldserver/src/main/java/com/world/function/FunctionIdEnum.java new file mode 100644 index 000000000..9baf25eff --- /dev/null +++ b/worldserver/src/main/java/com/world/function/FunctionIdEnum.java @@ -0,0 +1,53 @@ +package com.world.function; + +import rpc.protocols.MessageTypeProto; + +import java.util.HashMap; +import java.util.Map; + +/** + * 82 + */ +public enum FunctionIdEnum { + + Arena(82, new ArenaWorldFunction()), + ; + + private int functionType; + private FunctionManager manager; + private int[] protos; + private static Map functionIdEnumMap = new HashMap<>(); + private static Map protoMap = new HashMap<>(); + static { + FunctionIdEnum[] values = FunctionIdEnum.values(); + for(FunctionIdEnum functionIdEnum : values){ + functionIdEnumMap.put(functionIdEnum.getFunctionType(),functionIdEnum); + for(int proto:functionIdEnum.getProtos()){ + protoMap.put(proto,functionIdEnum); + } + } + } + FunctionIdEnum(int functionType, FunctionManager manager,int... protos) { + this.manager = manager; + this.functionType = functionType; + this.protos = protos; + } + + public int getFunctionType() { + return functionType; + } + + public FunctionManager getManager() { + return manager; + } + + public int[] getProtos() { + return protos; + } + public static FunctionIdEnum getFunctionIdEnumByProto(int protoId){ + return protoMap.get(protoId); + } + public static FunctionIdEnum getFunctionIdEnumByType(int functionType) { + return functionIdEnumMap.get(functionType); + } +} diff --git a/worldserver/src/main/java/com/world/function/FunctionManager.java b/worldserver/src/main/java/com/world/function/FunctionManager.java new file mode 100644 index 000000000..8a70ac9af --- /dev/null +++ b/worldserver/src/main/java/com/world/function/FunctionManager.java @@ -0,0 +1,14 @@ +package com.world.function; + +import com.ljsd.jieling.logic.dao.TimeControllerOfFunction; + +/** + * @author lvxinran + * @date 2019/11/23 + * @discribe + */ +public interface FunctionManager { + void startAction(TimeControllerOfFunction timeControllerOfFunction) throws Exception; + + void closeAction() throws Exception; +} diff --git a/worldserver/src/main/java/com/world/function/TimeControllerOfFunction.java b/worldserver/src/main/java/com/world/function/TimeControllerOfFunction.java new file mode 100644 index 000000000..1941ba75e --- /dev/null +++ b/worldserver/src/main/java/com/world/function/TimeControllerOfFunction.java @@ -0,0 +1,44 @@ +package com.world.function; + + +public class TimeControllerOfFunction { + + private int id; + private int status; + private long startTime; + private long endTime; + private int times; //开了几次 + + public TimeControllerOfFunction(){} + + public TimeControllerOfFunction(int id, int status, long startTime, long endTime) { + this.id = id; + this.status = status; + this.startTime = startTime; + this.endTime = endTime; + } + + public int getId() { + return id; + } + + public int getStatus() { + return status; + } + + public long getStartTime() { + return startTime; + } + + public long getEndTime() { + return endTime; + } + + public int getTimes() { + return times; + } + + public void setTimes(int times) { + this.times = times; + } +} diff --git a/worldserver/src/main/java/com/world/handler/GetWorldArenaInfoRequestHandler.java b/worldserver/src/main/java/com/world/handler/GetWorldArenaInfoRequestHandler.java index cc36e700d..a0cbd3108 100644 --- a/worldserver/src/main/java/com/world/handler/GetWorldArenaInfoRequestHandler.java +++ b/worldserver/src/main/java/com/world/handler/GetWorldArenaInfoRequestHandler.java @@ -1,12 +1,19 @@ package com.world.handler; import com.google.protobuf.GeneratedMessage; -import com.world.WorldServerApplication; +import com.WorldServerApplication; +import config.SArenaSetting; import rpc.global.GlobalProto; import rpc.net.RpcMessage; import rpc.net.gtGBaseHandler; +import rpc.protocols.ArenaInfoProto; +import rpc.protocols.CommonProto; import rpc.world.WorldProto; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + /** * Description: 获取跨服竞技场信息 * Author: zsx @@ -18,8 +25,37 @@ public class GetWorldArenaInfoRequestHandler extends gtGBaseHandler arenaEnemies = new ArrayList<>(); +// Set robotIds = ArenaLogic.randomRobot(score, 5); +// ArenaLogic.getInstance().toArenaEnemy(uid,robotIds,arenaEnemies, GlobalsDef.ARENA_ROBOT_TYPE); +// arenaManager.setArenaEnemies(arenaEnemies); +// } +// +// CommonProto.ArenaInfo build = CommonProto.ArenaInfo.newBuilder() +// .setFailNums(arenaManager.getFailNums()) +// .setSuccessNums(arenaManager.getSuccessNums()) +// .setScore(score) +// .addAllHadTakeBox(arenaManager.getHadTakeReward()) +// .addAllArenaEnemys(ArenaLogic.getInstance().getArenaEnemyList(arenaManager.getArenaEnemies())) +// .build(); + + // ArenaInfoProto.GetArenaInfoResponse getArenaInfoResponse = ArenaInfoProto.GetArenaInfoResponse.newBuilder().setArenaInfo(build).build(); + + //获取竞技场信息 WorldProto.GetWorldArenaInfoResponse.newBuilder().build(); return GlobalProto.GetWorldServerResponse.newBuilder().setIp(WorldServerApplication.bean.getIp()).setPort(WorldServerApplication.bean.getIp()).setGroup(1).build(); } diff --git a/worldserver/src/main/java/com/world/logic/arean/ArenaEnemy.java b/worldserver/src/main/java/com/world/logic/arean/ArenaEnemy.java new file mode 100644 index 000000000..0cfb0e5fb --- /dev/null +++ b/worldserver/src/main/java/com/world/logic/arean/ArenaEnemy.java @@ -0,0 +1,30 @@ +package com.world.logic.arean; + +public class ArenaEnemy { + private int enemyId; + // 0:玩家,1:机器人 + private int enemyType; + // 0:未挑战,1:挑战成功,2:挑战失败 + private int enemyStatus; + + + public ArenaEnemy(int enemyId, int enemyType, int enemyStatus) { + this.enemyId = enemyId; + this.enemyType = enemyType; + this.enemyStatus = enemyStatus; + } + + public int getEnemyId() { + return enemyId; + } + + public int getEnemyType() { + return enemyType; + } + + public int getEnemyStatus() { + return enemyStatus; + } + + +} diff --git a/worldserver/src/main/java/com/world/logic/arean/ArenaLogic.java b/worldserver/src/main/java/com/world/logic/arean/ArenaLogic.java new file mode 100644 index 000000000..4427ee451 --- /dev/null +++ b/worldserver/src/main/java/com/world/logic/arean/ArenaLogic.java @@ -0,0 +1,548 @@ +package com.world.logic.arean; + + +import com.ljsd.jieling.core.GlobalsDef; +import com.ljsd.jieling.core.VipPrivilegeType; +import com.ljsd.jieling.db.mongo.MongoUtil; +import com.ljsd.jieling.db.redis.RedisKey; +import com.ljsd.jieling.db.redis.RedisUtil; +import com.ljsd.jieling.exception.ErrorCode; +import com.ljsd.jieling.exception.ErrorCodeException; +import com.ljsd.jieling.globals.BIReason; +import com.ljsd.jieling.globals.Global; +import com.ljsd.jieling.handler.map.behavior.BehaviorUtil; +import com.ljsd.jieling.logic.OnlineUserManager; +import com.ljsd.jieling.logic.dao.root.User; +import com.ljsd.jieling.logic.fight.result.FightResult; +import com.ljsd.jieling.logic.hero.HeroLogic; +import com.ljsd.jieling.logic.mail.MailLogic; +import com.ljsd.jieling.logic.mission.GameEvent; +import com.ljsd.jieling.logic.mission.event.MissionEventDistributor; +import com.ljsd.jieling.logic.player.PlayerLogic; +import com.ljsd.jieling.network.session.ISession; +import config.*; +import manager.STableManager; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.data.redis.core.ZSetOperations; +import rpc.protocols.ArenaInfoProto; +import rpc.protocols.CommonProto; +import rpc.protocols.FightInfoProto; +import rpc.protocols.MessageTypeProto; +import util.MathUtils; +import util.StringUtil; +import util.TimeUtils; + +import java.util.*; + +public class ArenaLogic { + private static final Logger LOGGER = LoggerFactory.getLogger(ArenaLogic.class); + + private ArenaLogic(){} + + + + public static class Instance { + public final static ArenaLogic instance = new ArenaLogic(); + } + + public static ArenaLogic getInstance() { + return ArenaLogic.Instance.instance; + } + + private int curSeason; + private int viewSeason; + + public int getCurSeason() { + return curSeason; + } + + public int getViewSeason() { + return viewSeason; + } + + public List getArenaEnemyList(List arenaEnemies) throws Exception { + List arenaEnemyList = new ArrayList<>(arenaEnemies.size()); + for(ArenaEnemy arenaEnemy : arenaEnemies){ + int enemyId = arenaEnemy.getEnemyId(); + int enemyType = arenaEnemy.getEnemyType(); + arenaEnemyList.add(getArenaEnemy(enemyId,enemyType)); + } + return arenaEnemyList; + } + + public CommonProto.ArenaEnemy getArenaEnemy( int enemyId ,int enemyType) throws Exception { + if(enemyType == 0){ //机器人 + SArenaRobotConfig sArenaRobotConfig = SArenaRobotConfig.getsArenaRobotConfigById(enemyId); + CommonProto.Team teamBuild = CommonProto.Team.newBuilder().addAllHeroTid(sArenaRobotConfig.getHeroList()).build(); + CommonProto.ArenaPersonInfo personInfoBuild = CommonProto.ArenaPersonInfo.newBuilder() + .setUid(enemyId) + .setLevel(sArenaRobotConfig.getRobotLevel()) + .setName(sArenaRobotConfig.getRobotName()) + .setScore(sArenaRobotConfig.getRobotScore()) + .setTotalForce(sArenaRobotConfig.getTotalForce()) + .build(); + return CommonProto.ArenaEnemy.newBuilder() + .setPersonInfo(personInfoBuild) + .setTeam(teamBuild) + .build(); + }else{ + + User user = UserManager.getUser(enemyId); + int totalForce = HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.TEAM_ARENA_DEFENSE,false); + List teamPosHeroInfoList = user.getTeamPosManager().getTeamPosForHero().get(GlobalsDef.TEAM_ARENA_DEFENSE); + Map heroMap = user.getHeroManager().getHeroMap(); + List heroTids = new ArrayList<>(teamPosHeroInfoList.size()); + for(TeamPosHeroInfo teamPosHeroInfo:teamPosHeroInfoList){ + heroTids.add(heroMap.get(teamPosHeroInfo.getHeroId()).getTemplateId()); + } + CommonProto.Team teamBuild = CommonProto.Team.newBuilder().addAllHeroTid(heroTids).build(); + PlayerManager playerInfoManager = user.getPlayerInfoManager(); + int score = RedisUtil.getInstence().getZSetScore(RedisKey.ARENA_RANK, Integer.toString(curSeason), Integer.toString(enemyId)).intValue(); + if(score == -1){ + score = SArenaSetting.getSArenaSetting().getScore(); + } + CommonProto.ArenaPersonInfo personInfoBuild = CommonProto.ArenaPersonInfo.newBuilder() + .setUid(enemyId) + .setLevel(playerInfoManager.getLevel()) + .setName(playerInfoManager.getNickName()) + .setScore(score) + .setHead(playerInfoManager.getHead()) + .setTotalForce(totalForce) + .build(); + return CommonProto.ArenaEnemy.newBuilder() + .setPersonInfo(personInfoBuild) + .setTeam(teamBuild) + .build(); + } + } + + + + public void setMyArenaEnemys(int uid,User user){ + int score = RedisUtil.getInstence().getZSetScore(RedisKey.ARENA_RANK,Integer.toString(curSeason), Integer.toString(uid)).intValue(); + if(score == -1){ + score = SArenaSetting.getSArenaSetting().getScore(); + } + ArenaManager arenaManager = user.getArenaManager(); + List arenaEnemies = new ArrayList<>(); + if(curSeason ==1 && arenaManager.getFlushNums() robotIds = randomRobot(score, 5); + toArenaEnemy(uid,robotIds,arenaEnemies,GlobalsDef.ARENA_ROBOT_TYPE); + }else{ + Set robotIds = randomPerson(uid,score,true); + int type = GlobalsDef.ARENA_PLAYER_TYPE; + toArenaEnemy(uid,robotIds,arenaEnemies,type); + if(robotIds.isEmpty()){ + if(curSeason>1){ + robotIds = randomPerson(uid,score,false); + } + toArenaEnemy(uid,robotIds,arenaEnemies,type); + } + int size = robotIds.size(); + if(size<5){ + robotIds = randomRobot(score, 5-size); + type = GlobalsDef.ARENA_ROBOT_TYPE; + toArenaEnemy(uid,robotIds,arenaEnemies,type); + } + } + arenaManager.setArenaEnemies(arenaEnemies); + } + + + + + public static int getFightResultByPersonToPerson(User mine, int myteamId, User defUser, int defTeamId, ArenaRecord arenaRecord, ArenaInfoProto.ArenaChallengeResponse.Builder builder) throws Exception { + PVPFightEvent pvpFightEvent = new PVPFightEvent(mine.getId(),myteamId,SArenaSetting.getSArenaSetting().getMostTime(),"", GameFightType.ArenaPersonFight,defUser.getId(),defTeamId); + int myforce = HeroLogic.getInstance().calTeamTotalForce(mine, GlobalsDef.TEAM_ARENA_DEFENSE, false); + int defForce = HeroLogic.getInstance().calTeamTotalForce(defUser, GlobalsDef.TEAM_ARENA_DEFENSE, false); + arenaRecord.setAttackForce(myforce); + if(myforce enemys) { + for (ArenaEnemy data : enemys) { + if (data.getEnemyId() == challengeUid) { + return data; + } + } + return null; + } + + +// +// public void randomEnemys(ISession session) throws Exception { +// if(curSeason == 0){ +// throw new ErrorCodeException(ErrorCode.newDefineCode("season_close")); +// } +// int uid = session.getUid(); +// SArenaSetting sArenaSetting = SArenaSetting.getSArenaSetting(); +// if(sArenaSetting == null){ +// throw new ErrorCodeException(ErrorCode.CFG_NULL); +// } +// User user = UserManager.getUser(uid); +// ArenaManager arenaManager = user.getArenaManager(); +// int flushEnenyTime = arenaManager.getFlushTime(); +// int coldTime = sArenaSetting.getColdTime(); +// int now = (int)(TimeUtils.now()/1000); +// if( now - flushEnenyTime < coldTime-1 ){ +// throw new ErrorCodeException(ErrorCode.ARENA_RANDOM_ENEMY_CODE_TIME); +// } +// //刷新选手 +// setMyArenaEnemys(uid,user); +// arenaManager.setFlushTime(now); +// ArenaInfoProto.ArenaRandomResponse build = ArenaInfoProto.ArenaRandomResponse.newBuilder().addAllArenaEnemys(getArenaEnemyList(arenaManager.getArenaEnemies())).build(); +// MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.ARENA_RANDOM_ENEMY_RESPONSE_VALUE,build,true); +// } + + public static Set randomRobot(int userSscore,int nums){ + Set robotIds = new HashSet<>(5); + Map config = STableManager.getConfig(SArenaRobotSetting.class); + for(SArenaRobotSetting sArenaRobotSetting : config.values()){ + int playerLevelMin = sArenaRobotSetting.getPlayerScoreMin(); + int playerLevelMax = sArenaRobotSetting.getPlayerScoreMax(); + if(userSscore>=playerLevelMin && userSscore<=playerLevelMax){ + int poolId = sArenaRobotSetting.getPool(); + List sArenaRobotConfigsByPool = SArenaRobotConfig.getSArenaRobotConfigsByPool(poolId); + int size = sArenaRobotConfigsByPool.size(); + while (robotIds.size() < nums){ + robotIds.add(sArenaRobotConfigsByPool.get(MathUtils.randomInt(size)).getId()); + } + } + } + return robotIds; + } + + public Set randomPerson(int uid,int myScore,boolean useCurSeason){ + Set result = new HashSet<>(5); + int[][] interval = SArenaSetting.getSArenaSetting().getInterval(); + int matchSeason = curSeason; + if(!useCurSeason){ + matchSeason = curSeason - 1; + } + for(int[] item: interval){ + int low = item[0]; + int high = item[1]; + Set arenaRank = RedisUtil.getInstence().getZsetRange(RedisKey.ARENA_RANK,Integer.toString(matchSeason), myScore * low / 10000.0f-1, myScore * high / 10000.0f +1); + LOGGER.info("curSeason={},matchSeason={},the uid={},the myscore={},the low={},the high={},mylow={},myhigh={},",curSeason,matchSeason,uid,myScore,low,high,myScore * low / 10000.0f-1,myScore * high / 10000.0f +1); + if(arenaRank!=null && !arenaRank.isEmpty()){ + arenaRank.remove(Integer.toString(uid)); + String s = randomSet(arenaRank); + if(!StringUtil.isEmpty(s)){ + result.add(Integer.parseInt(s)); + } + } + } + return result; + } + + private String randomSet(Set infos){ + if(infos == null || infos.isEmpty()){ + return null; + } + int num = MathUtils.randomInt(infos.size()); + for(String id : infos){ + if(num-- == 0){ + return id; + } + } + return null; + + } + + public void toArenaEnemy(int uid,Set enemyList,List arenaEnemies,int type){ + for(Integer enemyId: enemyList){ + if(1 == type && enemyId == uid){ + continue; + } + arenaEnemies.add(new ArenaEnemy(enemyId,type,type)); + } + } + + + public void getWorldRankByPage(ISession session,int page) throws Exception { + if (page == 0) { + page = 1; + } + int start = (page - 1) * 20, end = page * 20 - 1; + List arenaRankMemberInfo = new ArrayList<>(20); + + int rankEndLine = SSpecialConfig.getIntegerValue(SSpecialConfig.ARENA_RANKINGSHOWNUM); + if(end> arenaRankInfo = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.ARENA_RANK, Integer.toString(viewSeason), start, end); + for (ZSetOperations.TypedTuple item : arenaRankInfo) { + String value = item.getValue(); + int score = item.getScore().intValue(); + int uid = Integer.parseInt(value); + User user = UserManager.getUser(uid,true); + if (null == user) { + continue; + } + int totalForce = HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.TEAM_ARENA_DEFENSE, false); + List teamPosHeroInfoList = user.getTeamPosManager().getTeamPosForHero().get(GlobalsDef.TEAM_ARENA_DEFENSE); + Map heroMap = user.getHeroManager().getHeroMap(); + List heroTids = new ArrayList<>(teamPosHeroInfoList.size()); + for (TeamPosHeroInfo teamPosHeroInfo : teamPosHeroInfoList) { + heroTids.add(heroMap.get(teamPosHeroInfo.getHeroId()).getTemplateId()); + } + CommonProto.Team teamBuild = CommonProto.Team.newBuilder().addAllHeroTid(heroTids).build(); + PlayerManager playerInfoManager = user.getPlayerInfoManager(); + CommonProto.ArenaPersonInfo personInfoBuild = CommonProto.ArenaPersonInfo.newBuilder() + .setUid(uid) + .setLevel(playerInfoManager.getLevel()) + .setName(playerInfoManager.getNickName()) + .setScore(score) + .setHead(playerInfoManager.getHead()) + .setRank(++start) + .setTotalForce(totalForce) + .setHeadFrame(playerInfoManager.getHeadFrame()) + .build(); + arenaRankMemberInfo.add(CommonProto.ArenaEnemy.newBuilder() + .setPersonInfo(personInfoBuild) + .setTeam(teamBuild) + .build()); + } + } + int uid = session.getUid(); + int score = RedisUtil.getInstence().getZSetScore(RedisKey.ARENA_RANK,Integer.toString(viewSeason), Integer.toString(uid)).intValue(); + int myRank =-1; + if(score == -1){ + score = SArenaSetting.getSArenaSetting().getScore(); + }else{ + myRank= RedisUtil.getInstence().getZSetreverseRank(RedisKey.ARENA_RANK,Integer.toString(viewSeason),Integer.toString(uid)).intValue(); + } + + ArenaInfoProto.GetArenaRankInfoResponse buildResponse = ArenaInfoProto.GetArenaRankInfoResponse.newBuilder() + .addAllRankInfos(arenaRankMemberInfo) + .setMyRank(myRank) + .setMyscore(score) + .build(); + MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.ARENA_RANK_RESPONSE_VALUE,buildResponse,true); + + } + + + + + /** + * + Sa: 实际胜负值, 胜 = 1 负=0 + + Ra: A选手比赛前的分 Rb: B选手比赛前的分数 + R'a: A选手比赛完的分数 R'b: B选手比赛完的分数 + + Ea:EA = 1/(1+10^[(Rb-Ra)/400]) + Eb: EB = 1/(1+10^[(Ra-Rb)/400]) + R'a = Ra + K(Sa-Ea) + R'b = Rb + K(Sb-Eb) + * + */ + public int calScore(int myScore,int defScore,int result){ + SArenaSetting sArenaSetting = SArenaSetting.getSArenaSetting(); + int k = sArenaSetting.getK(); + double ea = 1.0/(1 + Math.pow(10,(defScore - myScore)/400.0f)); + int parm = result == 1?1:-1; + return (int)(k*(result-ea) + 0.5*parm); + } + + + public void getFightReplayData(ISession iSession,int type,String fightId) throws Exception { + int uid = iSession.getUid(); + ArenaRecord arenaRecord=null; + if(type == 2){ + arenaRecord = RedisUtil.getInstence().getMapEntry(RedisKey.CHAMPION_ARENA_RECORD,"", fightId, ArenaRecord.class); + }else if(type == 1){ + arenaRecord = RedisUtil.getInstence().getMapEntry(RedisKey.ARENA_RRECORD, Integer.toString(uid), fightId, ArenaRecord.class); + }else if(type == 3){ + arenaRecord = RedisUtil.getInstence().get(RedisKey.GUILDBOSS_ARENA_RECORD, fightId, ArenaRecord.class); + } + if(arenaRecord == null){ + throw new ErrorCodeException(ErrorCode.newDefineCode("arena_rrecord null")); + } + byte[] fightData = arenaRecord.getFightData(); + CommonProto.FightData fightDataProto = CommonProto.FightData.parseFrom(fightData); + FightInfoProto.FightRePlayResponse build = FightInfoProto.FightRePlayResponse.newBuilder().setFightData(fightDataProto).build(); + MessageUtil.sendMessage(iSession,1, MessageTypeProto.MessageType.VIEW_FIGHTREPLAY_RESPONSE_VALUE,build,true); + } + + + /** + * 发送结算奖励 + * @param type + * @throws Exception + */ + public void sendReward(int type) throws Exception { + if(curSeason == 0){ + return; + } + String title; + String content; + if(type == GlobalsDef.ARENA_DAILY_REWARD){ + title = SErrorCodeEerverConfig.getI18NMessage("arena_daily_reward_title"); + }else{ + title = SErrorCodeEerverConfig.getI18NMessage("arena_season_reward_title"); + } + Set> arenaRankInfo = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.ARENA_RANK,Integer.toString(curSeason), 0, -1); + if(type == GlobalsDef.ARENA_SEASON_REWARD){ + curSeason=0; + } + int rank = 1; + int nowTime =(int) (TimeUtils.now()/1000); + for(ZSetOperations.TypedTuple item : arenaRankInfo){ + String value = item.getValue(); + int uid = Integer.parseInt(value); + User user = UserManager.getUser(uid, true); + if (null == user) { + continue; + } + if(type == GlobalsDef.ARENA_DAILY_REWARD){ + MissionEventDistributor.requestStart(); + user.getUserMissionManager().onGameEvent(user,GameEvent.ARENA_UPDATE_RANK,rank); + ISession sessionByUid = OnlineUserManager.getSessionByUid(uid); + if(sessionByUid!=null){ + MissionEventDistributor.requestEnd(sessionByUid,true); + } + + } + if(type == GlobalsDef.ARENA_DAILY_REWARD){ + content = SErrorCodeEerverConfig.getI18NMessage("arena_daily_reward_txt",new Object[]{rank}); + }else{ + content = SErrorCodeEerverConfig.getI18NMessage("arena_season_reward_txt",new Object[]{rank}); + user.getPlayerInfoManager().removeRed(GlobalsDef.ARENA_CHALLENGE_TYPE); + String key = RedisUtil.getInstence().getKey(RedisKey.ARENA_RRECORD, Integer.toString(uid)); + RedisUtil.getInstence().del(key); + + } + String rewardByRank = getRewardByRank(rank++, type); + if(!"".equals(rewardByRank)){ + MailLogic.getInstance().sendMail(user.getId(),title,content,rewardByRank,nowTime, Global.MAIL_EFFECTIVE_TIME); + } + } + MongoUtil.getInstence().lastUpdate(); + } + + public String getRewardByRank(int rank,int type){ + Map config = STableManager.getConfig(SArenaReward.class); + for(SArenaReward sArenaReward : config.values()){ + int minRank = sArenaReward.getMinRank(); + int maxRank = sArenaReward.getMaxRank(); + if(rank>=minRank && rank<=maxRank){ + if(type == GlobalsDef.ARENA_DAILY_REWARD){ + int[][] dailyReward = sArenaReward.getDailyReward(); + return StringUtil.parseArrayToString(dailyReward); + }else{ + int[][] seasonReward = sArenaReward.getSeasonReward(); + return StringUtil.parseArrayToString(seasonReward); + } + } + } + return ""; + } + + public void updateArenaSeason(int curSeason){ + this.curSeason = curSeason; + if(this.curSeason!=0){ + viewSeason = this.curSeason; + } + } + + + public void playWithSb(ISession session,int challengeUid,int myteamId) throws Exception { + User mine = UserManager.getUser(session.getUid()); + User defUser = UserManager.getUser(challengeUid); + if(!defUser.getTeamPosManager().getTeamPosForHero().containsKey(1)){ + throw new ErrorCodeException(ErrorCode.newDefineCode("对方未设置阵容")); + } + + int myforce = HeroLogic.getInstance().calTeamTotalForce(mine, myteamId, false); + int deforce = HeroLogic.getInstance().calTeamTotalForce(defUser, 1, false); + CommonProto.FightTeamInfo fightTeamInfo = BehaviorUtil.getFightTeamInfo(mine,myteamId,true); + CommonProto.FightTeamInfo deffightTeamInfo = BehaviorUtil.getFightTeamInfo(defUser,1,false); + + if(myforce userMap = new ConcurrentHashMap<>(); + private static Map userMapPutTime = new ConcurrentHashMap<>(); //离线读入 + + public static void addUser(User user) { + userMap.put(user.getId(), user); + userMapPutTime.put(user.getId(),TimeUtils.now()); + } + + public static boolean isUserExist(int uid) { + return userMap.containsKey(uid); + } + + + //离线清除逻辑 + public static void checkOffline(){ + try { + Set collect = userMap.entrySet().stream().filter(integerUserEntry -> !OnlineUserManager.checkUidOnline(integerUserEntry.getKey())).map(Map.Entry::getValue).collect(Collectors.toSet()); + long l = System.currentTimeMillis(); + collect.forEach(integerUserEntry -> { + long offLineTime = integerUserEntry.getPlayerInfoManager().getOffLineTime(); + if(offLineTime12*60*60*1000&& userMapPutTime.getOrDefault(integerUserEntry.getId(),0L)>12*60*60*1000){ + userMap.remove(integerUserEntry.getId()); + userMapPutTime.remove(integerUserEntry.getId()); + } + }); + }catch (Exception e){ + LOGGER.error("Exception离线清除逻辑err={}",e.toString()); + } + } + + + public static User userLogin(int uid,String openId,String channel,int pid,int gid,String platform,String ip,String channle_id,String bundle_id) throws Exception { + + User user = null; + if (!UserManager.isUserExist(uid)){ + user = MongoUtil.getInstence().getMyMongoTemplate().findById(User.getCollectionName(), uid, User.class); + if (user == null) { + user = registerUser(uid,openId,channel,pid,gid,platform,ip,channle_id,bundle_id); + } + UserManager.addUser(user); + }else{ + user = getUser(uid); + user.getPlayerInfoManager().setGid(gid); + user.getPlayerInfoManager().setPid(pid); + } + return user; + } + + + private static User registerUser(int uid,String openId,String channel,int pid,int gid,String platform,String ip,String channle_id,String bundle_id) throws Exception { + User user = new User(uid); + UserManager.addUser(user); + initPlayer(user,openId,channel,pid,gid,platform,ip,channle_id,bundle_id); + MongoUtil.getInstence().getMyMongoTemplate().save(user.getId(),user); + PlayerLogic.getInstance().sendTestWelfareMail(user,1,1); + return user; + } + + private static void initPlayer(User user,String openId,String channel,int pid,int gid,String platform,String ip,String channle_id,String bundle_id) throws Exception { + SGameSetting gameSetting = STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting(); + PlayerManager playerManager = user.getPlayerInfoManager(); + long now = TimeUtils.now(); + playerManager.setNickName(Integer.toString(user.getId())); + playerManager.setOpenId(openId); + playerManager.setLevel(1); + playerManager.setExp(0); + //todo 改默认 + playerManager.setHead(STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting().getDefaultHead()); + playerManager.updateGuidePoint(1,1); + playerManager.setCreateTime(now); + playerManager.setLoginTime(now); + playerManager.setSendDays(1); + playerManager.updateVipInfo(GlobalsDef.LEVEL_UNLOCK_PRIVILEGE,1); + playerManager.updateVipInfo(GlobalsDef.VIP_UNLOCK_PRIVILEGE,0); + playerManager.setRechargeInfo(new RechargeInfo()); + playerManager.setPhoneBindInfo(new PhoneBindInfo("")); + playerManager.setChannel(channel); + playerManager.setPid(pid); + playerManager.setGid(gid); + playerManager.setPlatform(platform); + playerManager.setIp(ip); + playerManager.setChannel_id(channle_id); + playerManager.setBundle_id(bundle_id); + playerManager.setHeadFrame(STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting().getDefaultPicture()); + SPlayerLevelConfig sPlayerLevelConfig = SPlayerLevelConfig.getsPlayerLevelConfigMap().get(1); + playerManager.setMaxStamina(sPlayerLevelConfig.getMaxEnergy()); + playerManager.setRideLevel(1); + PlayerLogic.getInstance().vipflushEveryDay(user,null); + ActivityLogic.getInstance().newPlayerOpenActivityMission(user); + PlayerLogic.getInstance().playerInfoUpdate(user); + user.getMainLevelManager().init(); + user.getUserMissionManager().onGameEvent(user, GameEvent.USER_LEVELUP,0,1); + user.getUserMissionManager().onGameEvent(user, GameEvent.DAILY_REFRESH,0); + user.getUserMissionManager().onGameEvent(user, GameEvent.BLOODY_REFRESH,0); + user.getUserMissionManager().onGameEvent(user, GameEvent.MISSING_ROOM_REFRESH,0); + user.getUserMissionManager().onGameEvent(user, GameEvent.ACHIEVE_REFRESH, 0); + user.getUserMissionManager().onGameEvent(user, GameEvent.BEGINNER); + user.getUserMissionManager().onGameEvent(user, GameEvent.VIP_LEVLUP,0); + Poster.getPoster().dispatchEvent(new NewWelfareEvent(user, NewWelfareTypeEnum.LOGIN_TIMES.getType(),1)); + ReportUtil.onReportEvent(user, ReportEventEnum.CREATE_ROLE.getType());//先发送注册事件 + ItemUtil.drop(user,gameSetting.getBornItem(), BIReason.USER_BORN_REWARD); + HeroManager heroManager = user.getHeroManager(); + Map heroMap = heroManager.getHeroMap(); + TeamPosManager teamPosManager = user.getTeamPosManager(); + List teamHeros = new ArrayList<>(1); + teamHeros.add(heroMap.values().iterator().next()); + teamPosManager.addTeamOfInitPlayer(teamHeros); + int force = HeroLogic.getInstance().calTeamTotalForce(user, 1, true); + playerManager.setMaxForce(force); + user.getExpeditionManager().setExpeditionLeve(1); + + + // user.getExpeditionManager().setForceSnap(force); +// KtEventUtils.onKtEvent(user, ParamEventBean.UserRegister); + } + + + public static User getUser(int uid) throws Exception { + return getUser(uid,false); + } + + public static User getUser(int uid,boolean canNull) throws Exception { + User user = userMap.get(uid); + if (user != null) { + return user; + } + user = MongoUtil.getInstence().getMyMongoTemplate().findById(User.getCollectionName(), uid, User.class); + if (null == user) { + if(canNull){ + return null; + } + throw new Exception("UserManager::getUser null exception"+uid); + } + UserManager.addUser(user); + return user; + } + + public static User getUserInMem(int uid) { + // User user = userMap.get(uid); + try { + return getUser(uid,true); + }catch (Exception e){ + LOGGER.error("UserManager::getUser null exception"+uid); + } + return null; + } + public static void removeUser(int uid) { + userMap.remove(uid); + } + + + public static String getNewToken(int userId) { + + return "33521"; + } +} diff --git a/worldserver/src/main/java/com/world/network/MessageUtil.java b/worldserver/src/main/java/com/world/network/MessageUtil.java new file mode 100644 index 000000000..1b2b9dea5 --- /dev/null +++ b/worldserver/src/main/java/com/world/network/MessageUtil.java @@ -0,0 +1,204 @@ +package com.world.network; + +import com.google.protobuf.GeneratedMessage; +import com.googlecode.protobuf.format.JsonFormat; +import com.ljsd.jieling.netty.PackageConstant; +import com.ljsd.jieling.netty.cocdex.Tea; +import com.world.network.session.ISession; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import rpc.protocols.CommonProto; +import rpc.protocols.MessageTypeProto; + +import java.util.ArrayList; +import java.util.List; + +/** + * 这里是以备之后切netty使用 + * thrift有问答的访问模式有局限 + */ +public class MessageUtil { + + private static final Logger LOGGER = LoggerFactory.getLogger(MessageUtil.class); + + public static byte[] wrappedBuffer(int uid, int token, int index, int result, int msgId, GeneratedMessage generatedMessage) { + byte[] backMessage; + if (generatedMessage == null) { + backMessage = new byte[0]; + } else { + backMessage = generatedMessage.toByteArray(); + if (backMessage.length != 0) + LOGGER.info("wrappedBuffer uid=>{}, generatedMessage=>{}", uid, JsonFormat.printToString(generatedMessage)); + } + + return wrappedBuffer(uid, token, index, result, msgId, backMessage); + } + + + public static byte[] wrappedBuffer(int uid, int token, int index, int result, int msgId,byte[] backMessage) { + int length = PackageConstant.UID_FIELD_LEN + PackageConstant.TOKEN_LEN + + PackageConstant.MSG_ID_FIELD_LEN + PackageConstant.INDEX_FIELD_LEN + + PackageConstant.RESULT_LEN + backMessage.length; + byte[] bytes = new byte[length]; + int pos = 0; + Tea.intToByte(bytes, pos, uid); + pos += PackageConstant.UID_FIELD_LEN; + Tea.intToByte(bytes, pos, token); + pos += PackageConstant.TOKEN_LEN; + Tea.intToByte(bytes, pos, msgId); + pos += PackageConstant.MSG_ID_FIELD_LEN; + Tea.intToByte(bytes, pos, index); + pos += PackageConstant.INDEX_FIELD_LEN; + Tea.intToByte(bytes, pos, result); + pos += PackageConstant.RESULT_LEN; + + if (backMessage.length != 0) { + System.arraycopy(backMessage, 0, bytes, pos, backMessage.length); + } + int[] secretKey = Tea.KEY; + byte[] bytes1 = Tea.encrypt2(bytes, secretKey); +// if (backMessage.length != 0) { +// LOGGER.info("wrappedBuffer uid=>{} sendbyte=>{}", uid, bytes1.length); +// } + return bytes1; + } + + public static void sendMessage(int[] uids, int result, int msgId, GeneratedMessage generatedMessage, boolean flush) { + for(int i=0; i()); + } + + //服务器逻辑错误返回,一般情况是业务逻辑错误 + public static void sendErrorResponse(ISession session,int errorCode,int msgId, String errMsg,List param) throws Exception { + GeneratedMessage generatedMessage = null; + if( null == errMsg){ + errMsg=""; + } + generatedMessage = CommonProto.ErrorResponse.newBuilder().setErrCode(errorCode).setErrMsg(errMsg).addAllErrParams(param).build(); + LOGGER.error("send error msg,the uid={},the msgId={},the errMsg={}",session.getUid(),msgId,errMsg); + byte[] byteBuf = wrappedBuffer(session.getUid(), session.getToken(), session.getIndex(), + 0,msgId, generatedMessage); + session.writeAndFlush(byteBuf); + session.putBackMassageToMap(byteBuf); + } + + + + + +} diff --git a/worldserver/src/main/java/com/world/network/NetManager.java b/worldserver/src/main/java/com/world/network/NetManager.java new file mode 100644 index 000000000..9d17b743d --- /dev/null +++ b/worldserver/src/main/java/com/world/network/NetManager.java @@ -0,0 +1,57 @@ +package com.world.network; + +import com.IManager; +import com.WorldServerApplication; +import com.ljsd.jieling.NetWorkFactory; +import com.ljsd.jieling.netty.config.EndPortCfg; +import com.ljsd.jieling.netty.server.NettyGameServer; +import com.world.config.ConfigurableApplicationContextManager; +import com.world.network.server.SessionManager; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Description: 网络服务管理器 + * Author: zsx + * CreateDate: 2019/11/6 17:34 + */ +public class NetManager implements IManager { + + private static final Logger LOGGER = LoggerFactory.getLogger(WorldServerApplication.class); + public final static NetManager instance = new NetManager(); + + public static NetManager getInstance() { + return instance; + } + + private static NettyGameServer nettyServer = null; + + @Override + @SuppressWarnings("unchecked") + public void init() throws Exception { + try { + final NettyServerAutoConfiguration netServerConfig = ConfigurableApplicationContextManager.getBean(NettyServerAutoConfiguration.class); + NettyProperties properties = netServerConfig.getNettyProperties(); + LOGGER.info("main->NettyServerAutoConfiguration start..."); + //连接处理 + nettyServer = NetWorkFactory.getServer(new EndPortCfg(properties.getTcpPort(), properties.getReadTimeout(), + properties.getWriteTimeout(), properties.getAllTimeout()), SessionManager.getInstance()); + nettyServer.start(); + + } catch (Exception e) { + LOGGER.error("main->msg={}", e.getMessage(), e); + } + } + + @Override + public void exit() throws Exception { + LOGGER.info("close->QuartzManager.getInstance().shutdownJob-------------------"); + try { + nettyServer.stop(); + } catch (Exception e) { + LOGGER.error("close->msg={}", e.getMessage(), e); + } + LOGGER.info("close->nettyServer.stop-------------------"); + } + +} diff --git a/worldserver/src/main/java/com/world/network/NettyProperties.java b/worldserver/src/main/java/com/world/network/NettyProperties.java new file mode 100644 index 000000000..67b72bd2a --- /dev/null +++ b/worldserver/src/main/java/com/world/network/NettyProperties.java @@ -0,0 +1,130 @@ +package com.world.network; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + + +@Configuration +@ConfigurationProperties(prefix = "netty") +public class NettyProperties { + + private int logintcpPort; + private int chatTcpPort; + private int tcpPort; + private int udpPort; + private String udpTargetIp; + private int udpTargetPort; + private int reconnectDelay=300000; + private int bossThreadCount=2; + private int workerThreadCount=2; + private int readTimeout=600; + private int writeTimeout=600; + private int allTimeout=1000; + private String tcpIp; + + public NettyProperties(){} + + public int getLogintcpPort() { + return logintcpPort; + } + + public void setLogintcpPort(int logintcpPort) { + this.logintcpPort = logintcpPort; + } + + public int getTcpPort() { + return tcpPort; + } + + public void setTcpPort(int tcpPort) { + this.tcpPort = tcpPort; + } + + public int getUdpPort() { + return udpPort; + } + + public void setUdpPort(int udpPort) { + this.udpPort = udpPort; + } + + public int getReconnectDelay() { + return reconnectDelay; + } + + public void setReconnectDelay(int reconnectDelay) { + this.reconnectDelay = reconnectDelay; + } + + public int getBossThreadCount() { + return bossThreadCount; + } + + public void setBossThreadCount(int bossThreadCount) { + this.bossThreadCount = bossThreadCount; + } + + public int getWorkerThreadCount() { + return workerThreadCount; + } + + public void setWorkerThreadCount(int workerThreadCount) { + this.workerThreadCount = workerThreadCount; + } + + public int getReadTimeout() { + return readTimeout; + } + + public void setReadTimeout(int readTimeout) { + this.readTimeout = readTimeout; + } + + public int getWriteTimeout() { + return writeTimeout; + } + + public void setWriteTimeout(int writeTimeout) { + this.writeTimeout = writeTimeout; + } + + public int getAllTimeout() { + return allTimeout; + } + + public void setAllTimeout(int allTimeout) { + this.allTimeout = allTimeout; + } + + public String getUdpTargetIp() { + return udpTargetIp; + } + + public void setUdpTargetIp(String udpTargetIp) { + this.udpTargetIp = udpTargetIp; + } + + public int getUdpTargetPort() { + return udpTargetPort; + } + + public void setUdpTargetPort(int udpTargetPort) { + this.udpTargetPort = udpTargetPort; + } + + public int getChatTcpPort() { + return chatTcpPort; + } + + public void setChatTcpPort(int chatTcpPort) { + this.chatTcpPort = chatTcpPort; + } + + public String getTcpIp() { + return tcpIp; + } + + public void setTcpIp(String tcpIp) { + this.tcpIp = tcpIp; + } +} diff --git a/worldserver/src/main/java/com/world/network/NettyServerAutoConfiguration.java b/worldserver/src/main/java/com/world/network/NettyServerAutoConfiguration.java new file mode 100644 index 000000000..fb314a9f5 --- /dev/null +++ b/worldserver/src/main/java/com/world/network/NettyServerAutoConfiguration.java @@ -0,0 +1,18 @@ +package com.world.network; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Configuration; + + +@Configuration +@EnableConfigurationProperties(NettyProperties.class) +public class NettyServerAutoConfiguration { + + @Autowired + private NettyProperties nettyProperties; + + public NettyProperties getNettyProperties() { + return nettyProperties; + } +} diff --git a/worldserver/src/main/java/com/world/network/OnlineServerManager.java b/worldserver/src/main/java/com/world/network/OnlineServerManager.java new file mode 100644 index 000000000..0cb2b01b4 --- /dev/null +++ b/worldserver/src/main/java/com/world/network/OnlineServerManager.java @@ -0,0 +1,68 @@ +package com.world.network; + +import com.world.network.session.ISession; + +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +public class OnlineServerManager { + public static Map sessionMap = new ConcurrentHashMap<>(); + public static void serverOnline(int serverId, ISession session) { + sessionMap.put(serverId, session); + } + + public static void checkOnline(){ + // UserManager.checkOffline(); + } + + + public static void userOffline(int uid) { + sessionMap.remove(uid); + } + + /** + * 通过uid获取Session + * + * @param uid + * @return + */ + public static ISession getSessionByUid(int uid) { + if (sessionMap == null) { + return null; + } + return sessionMap.get(uid); + } + + /** + * 检测玩家是否在线 + * + * @param uid + * @return + */ + public static boolean checkUidOnline(int uid) { + if (sessionMap == null) { + return false; + } + return sessionMap.containsKey(uid); + } + + static class DefinaMap extends HashMap{ + + @Override + public boolean remove(Object key, Object value) { + return super.remove(key, value); + } + + @Override + public v put(k key, v value) { + return super.put(key, value); + } + + @Override + public void clear() { + super.clear(); + } + } + +} diff --git a/worldserver/src/main/java/com/world/network/server/AuthManager.java b/worldserver/src/main/java/com/world/network/server/AuthManager.java new file mode 100644 index 000000000..92e5f1965 --- /dev/null +++ b/worldserver/src/main/java/com/world/network/server/AuthManager.java @@ -0,0 +1,51 @@ +package com.world.network.server; + +import com.ljsd.jieling.db.redis.RedisKey; +import com.ljsd.jieling.db.redis.RedisUtil; +import com.ljsd.jieling.netty.cocdex.PacketNetData; +import com.ljsd.jieling.network.session.ISession; + +/** + * Description: 登录校验 + * Author: zsx + * CreateDate: 2019/11/20 20:41 + */ + class AuthManager { + + + static boolean auVertiyFromRedis(ISession session, PacketNetData packetNetData) { + int uid = packetNetData.getUserId(); + int token = packetNetData.getToken(); + session.setUid(uid); + String tokenKey = RedisKey.getKey(RedisKey.TOKEN, String.valueOf(uid), false); + if (tokenKey.isEmpty()) { + return false; + } + String tokenK = (String) RedisUtil.getInstence().get(tokenKey); + if (null == tokenK || tokenK.isEmpty()) { + return false; + } + int serverToken = Integer.parseInt((String) RedisUtil.getInstence().get(tokenKey)); + if (token == serverToken) { + session.setToken(token); + session.setUserLoginTime(System.currentTimeMillis()); + return true; + } + return false; + } + + + static boolean auCheck(ISession session, PacketNetData packetNetData) { + if (session.getToken() != packetNetData.getToken()) { + SessionManager.getInstance().serverKick(session,"您的账号token不正确,请退出游戏重新登陆!"); + return false; + } + + boolean b = Blocker.checkForbidUser(session); + if (b) { + return false; + } + return true; + } + +} diff --git a/worldserver/src/main/java/com/world/network/server/Blocker.java b/worldserver/src/main/java/com/world/network/server/Blocker.java new file mode 100644 index 000000000..66af9d682 --- /dev/null +++ b/worldserver/src/main/java/com/world/network/server/Blocker.java @@ -0,0 +1,55 @@ +package com.world.network.server; + +import com.ljsd.jieling.exception.ErrorCode; +import com.ljsd.jieling.logic.OnlineUserManager; +import com.ljsd.jieling.network.session.ISession; +import com.ljsd.jieling.util.MessageUtil; +import io.netty.util.internal.ConcurrentSet; + +import java.util.Set; +import java.util.concurrent.atomic.AtomicInteger; + +/** + * Description: 检查 + * Author: zsx + * CreateDate: 2019/11/5 14:42 + */ +public class Blocker { + + public static final AtomicInteger maxAllowedOnlineAccountCount = new AtomicInteger(5000); + private static ConcurrentSet forbidLogin = new ConcurrentSet<>(); + + public static boolean checkForbidUser(ISession iSession){ + if(forbidLogin.size()<1){ + return false; + } + if(iSession!=null) { + if(forbidLogin.contains(iSession.getUid())){ + MessageUtil.sendErrorCode(iSession, ErrorCode.reloginCode, "您已被踢下线!"); + iSession.setOfflineType(ErrorCode.reloginCode); + return true; + } + } + return false; + } + + public static boolean checkFlow(ISession iSession){ + if(iSession!=null) { + if(OnlineUserManager.sessionMap.size()>maxAllowedOnlineAccountCount.get()){ + MessageUtil.sendErrorCode(iSession, ErrorCode.ONLINE_FLOW.code(), "当前在线人数过多,请稍等哦!"); + iSession.setOfflineType(ErrorCode.reloginCode); + return false; + } + } + return true; + } + + static Set getForbidLogin() { + return forbidLogin; + } + + static void setForbidLogin(Set forbidLogin) { + Blocker.forbidLogin.clear(); + Blocker.forbidLogin.addAll(forbidLogin); + } +} diff --git a/worldserver/src/main/java/com/world/network/server/ProtocolsManager.java b/worldserver/src/main/java/com/world/network/server/ProtocolsManager.java new file mode 100644 index 000000000..25572d70a --- /dev/null +++ b/worldserver/src/main/java/com/world/network/server/ProtocolsManager.java @@ -0,0 +1,147 @@ +package com.world.network.server; + +import com.WorldServerApplication; +import com.ljsd.jieling.netty.cocdex.PacketNetData; +import com.ljsd.jieling.protocol.ProtocolsAbstract; +import com.world.config.ConfigurableApplicationContextManager; +import com.world.handler.BaseHandler; +import com.world.network.session.ISession; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.NoSuchBeanDefinitionException; +import org.springframework.stereotype.Component; +import rpc.protocols.MessageTypeProto; +import util.ClassLoaderHelper; + +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +/** + * + * world 模块协议解析 + */ +@Component +public class ProtocolsManager implements ProtocolsAbstract { + + private static final Logger LOGGER = LoggerFactory.getLogger(ProtocolsManager.class); + private static ProtocolsManager instance = new ProtocolsManager(); + private Map handlers = new HashMap<>(); + private static ClassLoader classLoader = WorldServerApplication.class.getClassLoader(); + + public static ProtocolsManager getInstance() { + return instance; + } + + + private void addHandler(BaseHandler handler) { + if(null==handler.getMessageCode()){ + String simpleName = handler.getClass().getSimpleName(); + int index = simpleName.indexOf("Handler"); + if(index != -1) + { + simpleName = simpleName.substring(0, index); + int number = getProtoIdBySimpleName(simpleName); + if(number == 0){ + //没写协议号 + return; + } + handlers.put(number, handler); + } + return; + } + handlers.put(handler.getMessageCode().getNumber(), handler); + } + + public static int getProtoIdBySimpleName(String name){ + try { + MessageTypeProto.MessageType messageType = MessageTypeProto.MessageType.valueOf(name); + return messageType.getNumber(); + }catch (IllegalArgumentException e){ + return 0; + } + + + } + + + public void processMessage(ISession session, PacketNetData packetNetData) { + BaseHandler baseHandler = handlers.get(packetNetData.getMsgId()); + if (baseHandler == null) { + //检查一下 是否有getMessageCode()返回null 或者就没有定义handler + try { + // MessageUtil.sendErrorResponse(session, 0, session.getLastMsgId() + 1,"request unknow commond : 通知服务器开发人员"); + }catch (Exception e){} + LOGGER.info("request unknow commond : " + packetNetData.getMsgId()); + return; + } else { + // addEntry(packetNetData); + } + } + + + + public boolean addEntry(PacketNetData packetNetData) { +// int userId = packetNetData.getUserId(); +// try { +// +// HandlerLogicThread handlerThread = handlerThreads[userId % HANDLER_THREAD_NUM]; +// if (handlerThread == null) { +// LOGGER.error("addEntry->uid={};handlerThread is null", userId); +// return true; +// } +// handlerThread.addEntry(packetNetData); +// } catch (Exception e) { +// LOGGER.error("addEntry->uid={},mType={};request not return", userId, packetNetData.getMsgId(), e); +// } + return false; + } + + + public BaseHandler getHandler(int msgNum) { + return handlers.get(msgNum); + } + + + public void initHandler(String pck){ + List> handlers = new LinkedList<>(); + try + { + try { + ClassLoaderHelper.findLocalClass(pck, BaseHandler.class, classLoader, handlers); + }catch (RuntimeException e){ + + } + try { + ClassLoaderHelper.findClassJar(pck, BaseHandler.class, classLoader, handlers); + }catch (RuntimeException e){ + + } + + handlers.forEach(hand -> + { + BaseHandler baseHandler = null; + try { + baseHandler = (BaseHandler) ConfigurableApplicationContextManager.getBean(hand); + } catch (NoSuchBeanDefinitionException e1) { + try { + baseHandler = (BaseHandler) hand.newInstance(); + } catch (Exception ex) { + } + } catch (Exception e) { + e.printStackTrace(); + } + if (null != baseHandler) { + addHandler(baseHandler); + } + }); + } + catch(RuntimeException e2) + { + } + } + + +} + diff --git a/worldserver/src/main/java/com/world/network/server/SessionManager.java b/worldserver/src/main/java/com/world/network/server/SessionManager.java new file mode 100644 index 000000000..457eec7bf --- /dev/null +++ b/worldserver/src/main/java/com/world/network/server/SessionManager.java @@ -0,0 +1,201 @@ +package com.world.network.server; + +import com.google.gson.Gson; + +import com.ljsd.jieling.netty.cocdex.PacketNetData; +import com.ljsd.jieling.netty.server.IChannel; +import com.ljsd.jieling.protocol.INetConnet; +import com.ljsd.jieling.protocol.INetReceived; +import com.ljsd.jieling.protocol.INetSession; +import com.ljsd.jieling.protocol.INetWorkHandler; +import com.world.network.OnlineServerManager; +import com.world.network.session.ISession; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import rpc.protocols.MessageTypeProto; +import util.NetUtils; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * Description: session管理器 + *

+ * INetSession session创建 添加和删除 由之前的sessionfactory迁移过来 + * INetReceived nett消息接收回调 ProtocolsAbstract 出来的接口 + * INetConnet ProtocolsAbstract 拆出来的 + *

+ * 1初始化session + * 2session校验 + *

+ *

+ * Author: zsx + * CreateDate: 2019/11/5 17:05 + */ +public class SessionManager implements INetSession, INetReceived, INetConnet, INetWorkHandler { + + private Map currentSessions = new ConcurrentHashMap<>(); + + private static final Logger LOGGER = LoggerFactory.getLogger(SessionManager.class); + + private static SessionManager instance = new SessionManager(); + + public static SessionManager getInstance() { + return instance; + } + + public void OnsessionAdd(ISession gameSession) { + currentSessions.put(gameSession.getId(),gameSession); + } + + @Override + public void OnsessionRemove(String id) { + currentSessions.remove(id); + } + + @Override + public void onReceive(ISession session, Object obj) { + + + + PacketNetData packetNetData = new PacketNetData((byte[]) obj); + + //处理心跳 + if (packetNetData.getMsgId() == MessageTypeProto.MessageType.HEART_BEAT_REQUEST_VALUE) { + dealHeartBeat(session); + return; + } + + if (packetNetData.getMsgId() == MessageTypeProto.MessageType.ACK_INDICATION_REQUEST_VALUE) { + ackIndication(session, packetNetData.getIndex()); + return; + } + + + if (checkIndex(session, packetNetData) != 0) { + return; + } + + ProtocolsManager.getInstance().processMessage(session,packetNetData); + } + + + private void dealHeartBeat(ISession session) { + session.setHeartBreatNums(3); + // MessageUtil.sendHeartBeat(session); + } + + + private void ackIndication(ISession iSession, int ackId) { + LOGGER.info("the uid={},the ackId={}", iSession.getUid(), ackId); + iSession.clearIndication(ackId); + // MessageUtil.sendAck(iSession, ackId); + } + + private Gson gson = new Gson(); + + + private int checkIndex(ISession iSession, PacketNetData packetNetData) { + /* if(packetNetData.getMsgId() == MessageTypeProto.MessageType.LOGIN_REQUEST_VALUE || packetNetData.getMsgId() == MessageTypeProto.MessageType.RECONNECT_REQUEST_VALUE){ + return 0; + }*/ + int index = packetNetData.getIndex(); + + if (iSession.getIndex() >= index) { + byte[] message = iSession.getCacheMessage(index); + if (message == null) { + //TODO error + LOGGER.info("the uid={},the msg={} is processing,the index={},the sessionIndex={}", iSession.getUid(), MessageTypeProto.MessageType.valueOf(packetNetData.getMsgId()), index, iSession.getIndex()); + return 1; + } else { + LOGGER.info("the uid={},the msg={} reback", iSession.getUid(), MessageTypeProto.MessageType.valueOf(packetNetData.getMsgId())); + iSession.writeAndFlush(message); + return 1; + } + } else { + iSession.setIndex(index); + } + return 0; + } + + + @Override + public void offLine(ISession session) { + + LOGGER.info("player offLine ..{}",session.getUid()); + synchronized (session) { + if (session.getUid() == 0) { + LOGGER.error("offLine->uid={}", session.getUid()); + return; + } + OnlineServerManager.userOffline(session.getUid()); + } + } + + + + @Override + public void readIdel(ISession iSession) { + //对端口扫描直接关闭 + if (iSession.getUid() == 0) { + iSession.close(); + return; + } + String remoteAddress = ""; + if (!iSession.getChannel().isClosed() && iSession.getChannel().isConnected()) { + remoteAddress = NetUtils.toAddressString(iSession.getChannel().getRemoteAddress()); + } + + LOGGER.error("readIdea->uid={},iSessionId={},HeartBreatNums={},remoteAddress={};not receieve heart breat", + iSession.getUid(), iSession.getId(), iSession.getHeartBreatNums(), remoteAddress); + int heartBreatNums = iSession.getHeartBreatNums(); + heartBreatNums--; + if (heartBreatNums <= 0) { + if (!OnlineServerManager.sessionMap.containsKey(iSession.getUid())) { + iSession.close(); + return; + } + ISession oldSession = OnlineServerManager.sessionMap.get(iSession.getUid()); + if (iSession.getId().equals(oldSession.getId())) { + kickOldUser(iSession.getUid(), "", 000, "LOSE HEART PACKET!!!!", 0); + } + return; + } + iSession.setHeartBreatNums(heartBreatNums); + } + + public boolean kickOldUser(int uid, String uToken, int errorCode, String errorMsg, long requestTime) { + if (OnlineServerManager.sessionMap.size() != 0 && OnlineServerManager.sessionMap.keySet().contains(uid)) { + if (requestTime != 0 && requestTime < OnlineServerManager.sessionMap.get(uid).getUserLoginTime()) { + LOGGER.info("kickOldUser->uid={},requestTime={},userLoginTime={}", + uid, requestTime, OnlineServerManager.sessionMap.get(uid).getUserLoginTime()); + return false; + } + } + + if (!OnlineServerManager.checkUidOnline(uid)) { + LOGGER.info("kickOldUser->uid={};isNotOnline", uid); + return false; + } + ISession oldSession = OnlineServerManager.getSessionByUid(uid); + if (oldSession == null) { + LOGGER.info("kickOldUser->uid={};oldSessionisNull", uid); + OnlineServerManager.userOffline(uid); + return false; + } + oldSession.setOfflineType(errorCode); + + + offLine(oldSession); + oldSession.close(); + return true; + } + + @Override + public ISession createGameSession(IChannel channel, INetWorkHandler handler) { + return new ISession(channel, handler); + } + + + +} diff --git a/worldserver/src/main/java/com/world/network/server/gsHelper.java b/worldserver/src/main/java/com/world/network/server/gsHelper.java new file mode 100644 index 000000000..88aab2433 --- /dev/null +++ b/worldserver/src/main/java/com/world/network/server/gsHelper.java @@ -0,0 +1,123 @@ +package com.world.network.server; + +import com.global.thrift.idl.InnerResult; +import com.global.thrift.idl.RPCgTGRequestIFace; +import com.google.protobuf.GeneratedMessage; +import com.ljsd.GameApplication; +import com.ljsd.jieling.config.json.CoreSettings; +import com.ljsd.jieling.thrift.pool.ClientAdapterPo; +import com.ljsd.jieling.util.ConfigurableApplicationContextManager; +import com.world.redis.RedisKey; +import com.world.redis.RedisUtil; +import com.world.thrift.idl.InnerResult; +import com.world.thrift.idl.RPCgTwRequestIFace; +import com.world.thrift.idl.RPCwTgRequestIFace; +import com.world.thrift.idl.pool.ClientAdapterPo; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import rpc.net.GlobalProtocolsManager; +import rpc.net.RpcMessage; +import rpc.net.gtGBaseHandler; +import rpc.thrift.ServiceKey; +import util.StringUtil; + +import java.nio.ByteBuffer; + +/** + * Description: 链接逻辑服 获取逻辑服信息 + * Author: zsx + * CreateDate: 2020/11/17 19:52 + */ +public class gsHelper extends GlobalProtocolsManager { + private static final Logger LOGGER = LoggerFactory.getLogger(gsHelper.class); + public static gsHelper instance = new gsHelper(); + + private gsHelper() { + } + + public static boolean sendMessageToWord(int serverId,int uid, GeneratedMessage message)throws Exception{ + + ClientAdapterPo rPCClient = null; + String rpcString = RedisUtil.getInstence().getObject(RedisKey.LOGIC_SERVER_INFO, String.valueOf(serverId), String.class, -1); + if (null == rpcString) { + LOGGER.error("Exception send err rpcString dsid=>{},uid=>{},cmd=>{}", serverId, uid); + return false; + } + String thriftIp = rpcString.split(":")[0]; + String thriftPort = rpcString.split(":")[2]; + if (thriftIp == null || thriftIp.isEmpty() || null == thriftPort || thriftPort.isEmpty()) { + return false; + } + String serviceKey = StringUtil.getServiceKey(ServiceKey.RPC_WORLD, thriftIp,thriftPort); + try { + rPCClient = ClientAdapterPo.getClientAdapterPo(serviceKey); + InnerResult innerResult = rPCClient.getClient().messageRequest(uid,getProtoIdBySimpleName(message.getClass().getSimpleName()) , ByteBuffer.wrap(message.toByteArray())); + processMessage( new RpcMessage(0,uid, innerResult.getProtpId(),ByteBuffer.wrap(innerResult.getMessage()))); + } catch (Exception e) { + LOGGER.info("callback=>",e); + return false; + }finally { + if (rPCClient != null){ + rPCClient.returnObject(serviceKey); + }else{ + LOGGER.info("callback=> rPCClient is null "); + } + } + return true; + } + + public static void setWorldInfo(WorldInfo worldInfo) { + gsHelper.worldInfo = worldInfo; + } + + private static InnerResult processMessage(RpcMessage message) throws Exception { + gtGBaseHandler baseHandler = getHandlers().get(message.getProtpId()); + if (baseHandler == null) { + //检查一下 没有定义handler + LOGGER.info("request unknow commond : " + message.getProtpId()); + throw new Exception("request unknow commond"); + } else { + baseHandler.execute(message);//client not return + return new InnerResult(); + } + } + + + + + public static class WorldInfo { + String ip; + String port; + int myGroup; + + public WorldInfo(String ip, String port, int myGroup) { + this.ip = ip; + this.port = port; + this.myGroup = myGroup; + } + + public String getIp() { + return ip; + } + + public void setIp(String ip) { + this.ip = ip; + } + + public String getPort() { + return port; + } + + public void setPort(String port) { + this.port = port; + } + + public int getMyGroup() { + return myGroup; + } + + public void setMyGroup(int myGroup) { + this.myGroup = myGroup; + } + } +} diff --git a/worldserver/src/main/java/com/world/network/session/ISession.java b/worldserver/src/main/java/com/world/network/session/ISession.java new file mode 100644 index 000000000..a563ef349 --- /dev/null +++ b/worldserver/src/main/java/com/world/network/session/ISession.java @@ -0,0 +1,165 @@ +package com.world.network.session; + +import com.ljsd.jieling.netty.NettyGameSession; +import com.ljsd.jieling.netty.server.IChannel; +import com.ljsd.jieling.protocol.INetWorkHandler; +import util.TimeUtils; + +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicInteger; + +public class ISession extends NettyGameSession { + + + private int token; + private int index = -1; //客戶端index + private AtomicInteger indicationIndex = new AtomicInteger(1); //服務端index + private boolean kick; + private int fiveReady; //客户端可以接受服务器5点刷新 + private byte[] fiveByteBuf; //五点推送数据缓存 + private int lastMsgId;//最后客户端请求协议 + + + private ConcurrentHashMap indexToMessage = new ConcurrentHashMap(); + private ConcurrentHashMap indexToIndication = new ConcurrentHashMap(); + + public static class IndicationMsg { + private long create; + private byte[] msg; + private int retryTimes; + + public long getCreate() { + return create; + } + + public byte[] getMsg() { + return msg; + } + + public int getRetryTimes() { + return retryTimes; + } + + public void setRetryTimes(int retryTimes) { + this.retryTimes = retryTimes; + } + + public IndicationMsg(long crateTime, byte[] msg) { + this.create = crateTime; + this.msg = msg; + } + } + + private int heartBreatNums = 3; + +//<<<<<<< HEAD +//======= +// public ISession() { +// this.id = UUID.randomUUID().toString(); +// this.loginTime = System.currentTimeMillis(); +// } +// +// @Override +// public void postClose() { +//>>>>>>> 843e4f921d5bc65ced6568bf5fc4b58b2b17cf54 + + public ISession(IChannel channel, INetWorkHandler handler) { + super(channel, handler); + } + + + public int getToken() { + return token; + } + + public void setToken(int token) { + this.token = token; + } + + public int getHeartBreatNums() { + return heartBreatNums; + } + + public void setHeartBreatNums(int heartBreatNums) { + this.heartBreatNums = heartBreatNums; + } + + public int getIndex() { + return index; + } + + public void setIndex(int index) { + this.index = index; + } + + public boolean isKick() { + return kick; + } + + public void setKick(boolean kick) { + this.kick = kick; + } + + public ConcurrentHashMap getIndexToMessage() { + return indexToMessage; + } + + public void setIndexToMessage(ConcurrentHashMap indexToMessage) { + this.indexToMessage = indexToMessage; + } + + public void putBackMassageToMap(byte[] backMessage) { + this.indexToMessage.clear(); + this.indexToMessage.putIfAbsent(this.index, backMessage); + } + + public void putBackIndicationToMap(int index, byte[] backMessage) { + this.indexToIndication.putIfAbsent(index, new IndicationMsg(TimeUtils.now(), backMessage)); + } + + public void clearIndication(int ackId) { + this.indexToIndication.remove(ackId); + } + + public byte[] getCacheMessage(int index) { + return this.indexToMessage.get(index); + } + + public ConcurrentHashMap getIndexToIndication() { + return indexToIndication; + } + + + public int getIndicationIndex() { + return indicationIndex.getAndIncrement(); + } + + public int getFiveReady() { + return fiveReady; + } + + public void setFiveReady(int fiveReady) { + this.fiveReady = fiveReady; + } + + public void updateIndicationIndex(int index) { + this.indicationIndex.set(index); + } + + public byte[] getFiveByteBuf() { + return fiveByteBuf; + } + + public void setFiveByteBuf(byte[] fiveByteBuf) { + this.fiveByteBuf = fiveByteBuf; + } + + + public int getLastMsgId() { + return lastMsgId; + } + + public void setLastMsgId(int lastMsgId) { + this.lastMsgId = lastMsgId; + } +} diff --git a/worldserver/src/main/java/com/world/network/session/ISessionFactory.java b/worldserver/src/main/java/com/world/network/session/ISessionFactory.java new file mode 100644 index 000000000..3df417035 --- /dev/null +++ b/worldserver/src/main/java/com/world/network/session/ISessionFactory.java @@ -0,0 +1,11 @@ +package com.world.network.session; + +import com.ljsd.jieling.session.GameSession; +import com.ljsd.jieling.session.GameSessionFactory; + +public class ISessionFactory implements GameSessionFactory { + @Override + public GameSession createGameSession() { + return null; + } +} diff --git a/worldserver/src/main/java/com/world/redis/RedisKey.java b/worldserver/src/main/java/com/world/redis/RedisKey.java index 231592f77..6adb429db 100644 --- a/worldserver/src/main/java/com/world/redis/RedisKey.java +++ b/worldserver/src/main/java/com/world/redis/RedisKey.java @@ -4,13 +4,6 @@ public class RedisKey { public final static String Delimiter_colon = ":"; - public static final String MATCH_UID_KEY = "MATCH_UID_KEY"; - public static final String MATCH_ROOM_KEY = "MATCH_ROOM_KEY"; - public static final String BLOODY_ROOM_ID = "BLOODY_ROOM_ID"; - public static final String BLOODY_ROOM_ADDRESS = "BLOODY_ROOM_ADDRESS"; //房间服务器地址信息 - public static final String USER_LOGIN_URL = "USER_LOGIN_URL"; //房间服务器地址信息 - public static final String BLOODY_SERVER_INFO = "BLOODY_SERVER_INFO"; //房间服务器地址信息 - public static final String MATCH_SERVER_INFO = "MATCH_SERVER_INFO"; //匹配服务器地址信息 - public static final String MATCH_SIZE = "MATCH_SIZE"; //匹配人数设置 + public static final String LOGIC_SERVER_INFO = "LOGIC_SERVER_INFO"; } diff --git a/worldserver/src/main/java/com/world/redis/RedisUtil.java b/worldserver/src/main/java/com/world/redis/RedisUtil.java index d527d73fe..393f8ed8a 100644 --- a/worldserver/src/main/java/com/world/redis/RedisUtil.java +++ b/worldserver/src/main/java/com/world/redis/RedisUtil.java @@ -5,12 +5,14 @@ import com.google.gson.Gson; import com.world.config.ConfigurableApplicationContextManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.data.redis.RedisConnectionFailureException; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.util.CollectionUtils; import java.util.ArrayList; import java.util.List; import java.util.Set; +import java.util.concurrent.TimeUnit; /** * Author: zsx @@ -80,6 +82,28 @@ public class RedisUtil { } return gson.fromJson(source,clazz); } + /** + * 获取Object + * + * @param key + * @return + */ + public T getObject(String type, String key, Class clazz, int expireTime) { + try { + String valueStr = redisTemplate.opsForValue().get(type + RedisKey.Delimiter_colon + key); + if (valueStr == null) { + return null; + } + if (expireTime > 0) { + redisTemplate.expire(type + key, expireTime, TimeUnit.SECONDS); + } + return gson.fromJson(valueStr, clazz); + } catch (RedisConnectionFailureException e) { + LOGGER.error("------------------Redis 连接失败------------------msg={}", e); + } + return null; + } + public Long increment(String key) { diff --git a/worldserver/src/main/java/com/world/thrift/idl/InnerInvalidOperException.java b/worldserver/src/main/java/com/world/thrift/idl/InnerInvalidOperException.java index def7b9423..25fe8a166 100644 --- a/worldserver/src/main/java/com/world/thrift/idl/InnerInvalidOperException.java +++ b/worldserver/src/main/java/com/world/thrift/idl/InnerInvalidOperException.java @@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory; /** * Structs can also be exceptions, if they are nasty. */ -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-19") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-20") public class InnerInvalidOperException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("InnerInvalidOperException"); diff --git a/worldserver/src/main/java/com/world/thrift/idl/InnerResult.java b/worldserver/src/main/java/com/world/thrift/idl/InnerResult.java index ab6447a26..9d1771a79 100644 --- a/worldserver/src/main/java/com/world/thrift/idl/InnerResult.java +++ b/worldserver/src/main/java/com/world/thrift/idl/InnerResult.java @@ -34,7 +34,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-19") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-20") public class InnerResult implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("InnerResult"); diff --git a/worldserver/src/main/java/com/world/thrift/idl/RPCgTwRequestIFace.java b/worldserver/src/main/java/com/world/thrift/idl/RPCgTwRequestIFace.java index fd07dcba8..9a76caddf 100644 --- a/worldserver/src/main/java/com/world/thrift/idl/RPCgTwRequestIFace.java +++ b/worldserver/src/main/java/com/world/thrift/idl/RPCgTwRequestIFace.java @@ -34,7 +34,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-19") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-20") public class RPCgTwRequestIFace { public interface Iface { diff --git a/worldserver/src/main/java/com/world/thrift/idl/RPCwTgRequestIFace.java b/worldserver/src/main/java/com/world/thrift/idl/RPCwTgRequestIFace.java new file mode 100644 index 000000000..d52fbd228 --- /dev/null +++ b/worldserver/src/main/java/com/world/thrift/idl/RPCwTgRequestIFace.java @@ -0,0 +1,1199 @@ +/** + * Autogenerated by Thrift Compiler (0.9.2) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package com.world.thrift.idl; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2020-11-20") +public class RPCwTgRequestIFace { + + public interface Iface { + + public InnerResult messageRequest(int uid, int protpId, ByteBuffer message) throws org.apache.thrift.TException; + + } + + public interface AsyncIface { + + public void messageRequest(int uid, int protpId, ByteBuffer message, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + } + + public static class Client extends org.apache.thrift.TServiceClient implements Iface { + public static class Factory implements org.apache.thrift.TServiceClientFactory { + public Factory() {} + public Client getClient(org.apache.thrift.protocol.TProtocol prot) { + return new Client(prot); + } + public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { + return new Client(iprot, oprot); + } + } + + public Client(org.apache.thrift.protocol.TProtocol prot) + { + super(prot, prot); + } + + public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { + super(iprot, oprot); + } + + public InnerResult messageRequest(int uid, int protpId, ByteBuffer message) throws org.apache.thrift.TException + { + send_messageRequest(uid, protpId, message); + return recv_messageRequest(); + } + + public void send_messageRequest(int uid, int protpId, ByteBuffer message) throws org.apache.thrift.TException + { + messageRequest_args args = new messageRequest_args(); + args.setUid(uid); + args.setProtpId(protpId); + args.setMessage(message); + sendBase("messageRequest", args); + } + + public InnerResult recv_messageRequest() throws org.apache.thrift.TException + { + messageRequest_result result = new messageRequest_result(); + receiveBase(result, "messageRequest"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "messageRequest failed: unknown result"); + } + + } + public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { + public static class Factory implements org.apache.thrift.async.TAsyncClientFactory { + private org.apache.thrift.async.TAsyncClientManager clientManager; + private org.apache.thrift.protocol.TProtocolFactory protocolFactory; + public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) { + this.clientManager = clientManager; + this.protocolFactory = protocolFactory; + } + public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) { + return new AsyncClient(protocolFactory, clientManager, transport); + } + } + + public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) { + super(protocolFactory, clientManager, transport); + } + + public void messageRequest(int uid, int protpId, ByteBuffer message, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + messageRequest_call method_call = new messageRequest_call(uid, protpId, message, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class messageRequest_call extends org.apache.thrift.async.TAsyncMethodCall { + private int uid; + private int protpId; + private ByteBuffer message; + public messageRequest_call(int uid, int protpId, ByteBuffer message, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.uid = uid; + this.protpId = protpId; + this.message = message; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("messageRequest", org.apache.thrift.protocol.TMessageType.CALL, 0)); + messageRequest_args args = new messageRequest_args(); + args.setUid(uid); + args.setProtpId(protpId); + args.setMessage(message); + args.write(prot); + prot.writeMessageEnd(); + } + + public InnerResult getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_messageRequest(); + } + } + + } + + public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { + private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); + public Processor(I iface) { + super(iface, getProcessMap(new HashMap>())); + } + + protected Processor(I iface, Map> processMap) { + super(iface, getProcessMap(processMap)); + } + + private static Map> getProcessMap(Map> processMap) { + processMap.put("messageRequest", new messageRequest()); + return processMap; + } + + public static class messageRequest extends org.apache.thrift.ProcessFunction { + public messageRequest() { + super("messageRequest"); + } + + public messageRequest_args getEmptyArgsInstance() { + return new messageRequest_args(); + } + + protected boolean isOneway() { + return false; + } + + public messageRequest_result getResult(I iface, messageRequest_args args) throws org.apache.thrift.TException { + messageRequest_result result = new messageRequest_result(); + result.success = iface.messageRequest(args.uid, args.protpId, args.message); + return result; + } + } + + } + + public static class AsyncProcessor extends org.apache.thrift.TBaseAsyncProcessor { + private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName()); + public AsyncProcessor(I iface) { + super(iface, getProcessMap(new HashMap>())); + } + + protected AsyncProcessor(I iface, Map> processMap) { + super(iface, getProcessMap(processMap)); + } + + private static Map> getProcessMap(Map> processMap) { + processMap.put("messageRequest", new messageRequest()); + return processMap; + } + + public static class messageRequest extends org.apache.thrift.AsyncProcessFunction { + public messageRequest() { + super("messageRequest"); + } + + public messageRequest_args getEmptyArgsInstance() { + return new messageRequest_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(InnerResult o) { + messageRequest_result result = new messageRequest_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + messageRequest_result result = new messageRequest_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, messageRequest_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.messageRequest(args.uid, args.protpId, args.message,resultHandler); + } + } + + } + + public static class messageRequest_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("messageRequest_args"); + + private static final org.apache.thrift.protocol.TField UID_FIELD_DESC = new org.apache.thrift.protocol.TField("uid", org.apache.thrift.protocol.TType.I32, (short)1); + private static final org.apache.thrift.protocol.TField PROTP_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("protpId", org.apache.thrift.protocol.TType.I32, (short)2); + private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)3); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new messageRequest_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new messageRequest_argsTupleSchemeFactory()); + } + + public int uid; // required + public int protpId; // required + public ByteBuffer message; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + UID((short)1, "uid"), + PROTP_ID((short)2, "protpId"), + MESSAGE((short)3, "message"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // UID + return UID; + case 2: // PROTP_ID + return PROTP_ID; + case 3: // MESSAGE + return MESSAGE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __UID_ISSET_ID = 0; + private static final int __PROTPID_ISSET_ID = 1; + private byte __isset_bitfield = 0; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.UID, new org.apache.thrift.meta_data.FieldMetaData("uid", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.PROTP_ID, new org.apache.thrift.meta_data.FieldMetaData("protpId", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(messageRequest_args.class, metaDataMap); + } + + public messageRequest_args() { + } + + public messageRequest_args( + int uid, + int protpId, + ByteBuffer message) + { + this(); + this.uid = uid; + setUidIsSet(true); + this.protpId = protpId; + setProtpIdIsSet(true); + this.message = org.apache.thrift.TBaseHelper.copyBinary(message); + } + + /** + * Performs a deep copy on other. + */ + public messageRequest_args(messageRequest_args other) { + __isset_bitfield = other.__isset_bitfield; + this.uid = other.uid; + this.protpId = other.protpId; + if (other.isSetMessage()) { + this.message = org.apache.thrift.TBaseHelper.copyBinary(other.message); + } + } + + public messageRequest_args deepCopy() { + return new messageRequest_args(this); + } + + @Override + public void clear() { + setUidIsSet(false); + this.uid = 0; + setProtpIdIsSet(false); + this.protpId = 0; + this.message = null; + } + + public int getUid() { + return this.uid; + } + + public messageRequest_args setUid(int uid) { + this.uid = uid; + setUidIsSet(true); + return this; + } + + public void unsetUid() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UID_ISSET_ID); + } + + /** Returns true if field uid is set (has been assigned a value) and false otherwise */ + public boolean isSetUid() { + return EncodingUtils.testBit(__isset_bitfield, __UID_ISSET_ID); + } + + public void setUidIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UID_ISSET_ID, value); + } + + public int getProtpId() { + return this.protpId; + } + + public messageRequest_args setProtpId(int protpId) { + this.protpId = protpId; + setProtpIdIsSet(true); + return this; + } + + public void unsetProtpId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PROTPID_ISSET_ID); + } + + /** Returns true if field protpId is set (has been assigned a value) and false otherwise */ + public boolean isSetProtpId() { + return EncodingUtils.testBit(__isset_bitfield, __PROTPID_ISSET_ID); + } + + public void setProtpIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PROTPID_ISSET_ID, value); + } + + public byte[] getMessage() { + setMessage(org.apache.thrift.TBaseHelper.rightSize(message)); + return message == null ? null : message.array(); + } + + public ByteBuffer bufferForMessage() { + return org.apache.thrift.TBaseHelper.copyBinary(message); + } + + public messageRequest_args setMessage(byte[] message) { + this.message = message == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(message, message.length)); + return this; + } + + public messageRequest_args setMessage(ByteBuffer message) { + this.message = org.apache.thrift.TBaseHelper.copyBinary(message); + return this; + } + + public void unsetMessage() { + this.message = null; + } + + /** Returns true if field message is set (has been assigned a value) and false otherwise */ + public boolean isSetMessage() { + return this.message != null; + } + + public void setMessageIsSet(boolean value) { + if (!value) { + this.message = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case UID: + if (value == null) { + unsetUid(); + } else { + setUid((Integer)value); + } + break; + + case PROTP_ID: + if (value == null) { + unsetProtpId(); + } else { + setProtpId((Integer)value); + } + break; + + case MESSAGE: + if (value == null) { + unsetMessage(); + } else { + setMessage((ByteBuffer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case UID: + return Integer.valueOf(getUid()); + + case PROTP_ID: + return Integer.valueOf(getProtpId()); + + case MESSAGE: + return getMessage(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case UID: + return isSetUid(); + case PROTP_ID: + return isSetProtpId(); + case MESSAGE: + return isSetMessage(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof messageRequest_args) + return this.equals((messageRequest_args)that); + return false; + } + + public boolean equals(messageRequest_args that) { + if (that == null) + return false; + + boolean this_present_uid = true; + boolean that_present_uid = true; + if (this_present_uid || that_present_uid) { + if (!(this_present_uid && that_present_uid)) + return false; + if (this.uid != that.uid) + return false; + } + + boolean this_present_protpId = true; + boolean that_present_protpId = true; + if (this_present_protpId || that_present_protpId) { + if (!(this_present_protpId && that_present_protpId)) + return false; + if (this.protpId != that.protpId) + return false; + } + + boolean this_present_message = true && this.isSetMessage(); + boolean that_present_message = true && that.isSetMessage(); + if (this_present_message || that_present_message) { + if (!(this_present_message && that_present_message)) + return false; + if (!this.message.equals(that.message)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_uid = true; + list.add(present_uid); + if (present_uid) + list.add(uid); + + boolean present_protpId = true; + list.add(present_protpId); + if (present_protpId) + list.add(protpId); + + boolean present_message = true && (isSetMessage()); + list.add(present_message); + if (present_message) + list.add(message); + + return list.hashCode(); + } + + @Override + public int compareTo(messageRequest_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetUid()).compareTo(other.isSetUid()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUid()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uid, other.uid); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetProtpId()).compareTo(other.isSetProtpId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetProtpId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.protpId, other.protpId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMessage()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("messageRequest_args("); + boolean first = true; + + sb.append("uid:"); + sb.append(this.uid); + first = false; + if (!first) sb.append(", "); + sb.append("protpId:"); + sb.append(this.protpId); + first = false; + if (!first) sb.append(", "); + sb.append("message:"); + if (this.message == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.message, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class messageRequest_argsStandardSchemeFactory implements SchemeFactory { + public messageRequest_argsStandardScheme getScheme() { + return new messageRequest_argsStandardScheme(); + } + } + + private static class messageRequest_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, messageRequest_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // UID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.uid = iprot.readI32(); + struct.setUidIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // PROTP_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.protpId = iprot.readI32(); + struct.setProtpIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // MESSAGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.message = iprot.readBinary(); + struct.setMessageIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, messageRequest_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(UID_FIELD_DESC); + oprot.writeI32(struct.uid); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(PROTP_ID_FIELD_DESC); + oprot.writeI32(struct.protpId); + oprot.writeFieldEnd(); + if (struct.message != null) { + oprot.writeFieldBegin(MESSAGE_FIELD_DESC); + oprot.writeBinary(struct.message); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class messageRequest_argsTupleSchemeFactory implements SchemeFactory { + public messageRequest_argsTupleScheme getScheme() { + return new messageRequest_argsTupleScheme(); + } + } + + private static class messageRequest_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, messageRequest_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetUid()) { + optionals.set(0); + } + if (struct.isSetProtpId()) { + optionals.set(1); + } + if (struct.isSetMessage()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetUid()) { + oprot.writeI32(struct.uid); + } + if (struct.isSetProtpId()) { + oprot.writeI32(struct.protpId); + } + if (struct.isSetMessage()) { + oprot.writeBinary(struct.message); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, messageRequest_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.uid = iprot.readI32(); + struct.setUidIsSet(true); + } + if (incoming.get(1)) { + struct.protpId = iprot.readI32(); + struct.setProtpIdIsSet(true); + } + if (incoming.get(2)) { + struct.message = iprot.readBinary(); + struct.setMessageIsSet(true); + } + } + } + + } + + public static class messageRequest_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("messageRequest_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new messageRequest_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new messageRequest_resultTupleSchemeFactory()); + } + + public InnerResult success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, InnerResult.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(messageRequest_result.class, metaDataMap); + } + + public messageRequest_result() { + } + + public messageRequest_result( + InnerResult success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public messageRequest_result(messageRequest_result other) { + if (other.isSetSuccess()) { + this.success = new InnerResult(other.success); + } + } + + public messageRequest_result deepCopy() { + return new messageRequest_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public InnerResult getSuccess() { + return this.success; + } + + public messageRequest_result setSuccess(InnerResult success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((InnerResult)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof messageRequest_result) + return this.equals((messageRequest_result)that); + return false; + } + + public boolean equals(messageRequest_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(messageRequest_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("messageRequest_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (success != null) { + success.validate(); + } + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class messageRequest_resultStandardSchemeFactory implements SchemeFactory { + public messageRequest_resultStandardScheme getScheme() { + return new messageRequest_resultStandardScheme(); + } + } + + private static class messageRequest_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, messageRequest_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new InnerResult(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, messageRequest_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class messageRequest_resultTupleSchemeFactory implements SchemeFactory { + public messageRequest_resultTupleScheme getScheme() { + return new messageRequest_resultTupleScheme(); + } + } + + private static class messageRequest_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, messageRequest_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, messageRequest_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new InnerResult(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + } + +} diff --git a/worldserver/src/main/java/com/world/thrift/idl/pool/ClientAdapterPo.java b/worldserver/src/main/java/com/world/thrift/idl/pool/ClientAdapterPo.java new file mode 100644 index 000000000..f304d6f86 --- /dev/null +++ b/worldserver/src/main/java/com/world/thrift/idl/pool/ClientAdapterPo.java @@ -0,0 +1,62 @@ +package com.world.thrift.idl.pool; + + +import com.world.thrift.idl.RPCgTwRequestIFace; +import org.apache.commons.pool2.impl.GenericKeyedObjectPool; +import org.apache.thrift.protocol.TBinaryProtocol; +import org.apache.thrift.protocol.TProtocol; +import org.apache.thrift.transport.TTransport; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import rpc.thrift.ServiceKey; + +/** + * Created by Administrator on 2015/4/7. + */ +public class ClientAdapterPo{ + + private static final Logger LOGGER = LoggerFactory.getLogger(ClientAdapterPo.class); + + private TTransport tTransport; + + private T client; + + private final static GenericKeyedObjectPool pool = ThriftPoolUtils.getInstance().getThriftPool(); + + public final static ClientAdapterPo getClientAdapterPo(String key) throws Exception{ + + ClientAdapterPo clientPo = new ClientAdapterPo(); + TTransport transport = pool.borrowObject(key); + TProtocol protocol = new TBinaryProtocol(transport); + Object object = getClientByEnum(key,protocol); + clientPo.setClient(object); + clientPo.settTransport(transport); + return clientPo; + } + + private final static Object getClientByEnum(String serviceKey, TProtocol protocol){ + String[] key = serviceKey.trim().split("\\|"); + if(key[0].equals(ServiceKey.RPC_GS)){ + return new RPCgTwRequestIFace.Client(protocol); + } + return null; + } + + + public void returnObject(String keyEnum){ + pool.returnObject(keyEnum,tTransport); + } + private void settTransport(TTransport tTransport) { + this.tTransport = tTransport; + } + + public T getClient() { + return client; + } + private void setClient(T client) { + this.client = client; + } + + private ClientAdapterPo() { + } +}