From 1b6811a4bee5dcb518ded7a243e8d30be7a3b779 Mon Sep 17 00:00:00 2001 From: wangyuan Date: Mon, 16 Dec 2019 18:14:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=85=E5=B3=B0=E8=B5=9B32=204?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jieling/protocols/ArenaInfoProto.java | 268 ++++++++--- .../ljsd/jieling/protocols/CommonProto.java | 425 +++++++++++------- .../jieling/protocols/MessageTypeProto.java | 8 + .../com/ljsd/jieling/db/redis/RedisKey.java | 4 +- .../jieling/logic/GlobalDataManaager.java | 4 - .../ljsd/jieling/logic/arena/ArenaLogic.java | 10 +- .../logic/championship/ChampionshipLogic.java | 83 ++-- 7 files changed, 541 insertions(+), 261 deletions(-) diff --git a/bloodybattle/src/main/java/com/ljsd/jieling/protocols/ArenaInfoProto.java b/bloodybattle/src/main/java/com/ljsd/jieling/protocols/ArenaInfoProto.java index e906d6e88..00101a068 100644 --- a/bloodybattle/src/main/java/com/ljsd/jieling/protocols/ArenaInfoProto.java +++ b/bloodybattle/src/main/java/com/ljsd/jieling/protocols/ArenaInfoProto.java @@ -10543,23 +10543,31 @@ public final class ArenaInfoProto { com.ljsd.jieling.protocols.CommonProto.ArenaEnemyOrBuilder getRankInfosOrBuilder( int index); - // optional int32 myRank = 3; + // optional .com.ljsd.jieling.protocols.ArenaEnemy myInfo = 3; /** - * optional int32 myRank = 3; + * optional .com.ljsd.jieling.protocols.ArenaEnemy myInfo = 3; * *
      * 我的排名
      * 
*/ - boolean hasMyRank(); + boolean hasMyInfo(); /** - * optional int32 myRank = 3; + * optional .com.ljsd.jieling.protocols.ArenaEnemy myInfo = 3; * *
      * 我的排名
      * 
*/ - int getMyRank(); + com.ljsd.jieling.protocols.CommonProto.ArenaEnemy getMyInfo(); + /** + * optional .com.ljsd.jieling.protocols.ArenaEnemy myInfo = 3; + * + *
+     * 我的排名
+     * 
+ */ + com.ljsd.jieling.protocols.CommonProto.ArenaEnemyOrBuilder getMyInfoOrBuilder(); } /** * Protobuf type {@code com.ljsd.jieling.protocols.ChampionGetWorldRankResponse} @@ -10620,9 +10628,17 @@ public final class ArenaInfoProto { rankInfos_.add(input.readMessage(com.ljsd.jieling.protocols.CommonProto.ArenaEnemy.PARSER, extensionRegistry)); break; } - case 24: { + case 26: { + com.ljsd.jieling.protocols.CommonProto.ArenaEnemy.Builder subBuilder = null; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + subBuilder = myInfo_.toBuilder(); + } + myInfo_ = input.readMessage(com.ljsd.jieling.protocols.CommonProto.ArenaEnemy.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(myInfo_); + myInfo_ = subBuilder.buildPartial(); + } bitField0_ |= 0x00000001; - myRank_ = input.readInt32(); break; } } @@ -10724,33 +10740,43 @@ public final class ArenaInfoProto { return rankInfos_.get(index); } - // optional int32 myRank = 3; - public static final int MYRANK_FIELD_NUMBER = 3; - private int myRank_; + // optional .com.ljsd.jieling.protocols.ArenaEnemy myInfo = 3; + public static final int MYINFO_FIELD_NUMBER = 3; + private com.ljsd.jieling.protocols.CommonProto.ArenaEnemy myInfo_; /** - * optional int32 myRank = 3; + * optional .com.ljsd.jieling.protocols.ArenaEnemy myInfo = 3; * *
      * 我的排名
      * 
*/ - public boolean hasMyRank() { + public boolean hasMyInfo() { return ((bitField0_ & 0x00000001) == 0x00000001); } /** - * optional int32 myRank = 3; + * optional .com.ljsd.jieling.protocols.ArenaEnemy myInfo = 3; * *
      * 我的排名
      * 
*/ - public int getMyRank() { - return myRank_; + public com.ljsd.jieling.protocols.CommonProto.ArenaEnemy getMyInfo() { + return myInfo_; + } + /** + * optional .com.ljsd.jieling.protocols.ArenaEnemy myInfo = 3; + * + *
+     * 我的排名
+     * 
+ */ + public com.ljsd.jieling.protocols.CommonProto.ArenaEnemyOrBuilder getMyInfoOrBuilder() { + return myInfo_; } private void initFields() { rankInfos_ = java.util.Collections.emptyList(); - myRank_ = 0; + myInfo_ = com.ljsd.jieling.protocols.CommonProto.ArenaEnemy.getDefaultInstance(); } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -10768,7 +10794,7 @@ public final class ArenaInfoProto { output.writeMessage(1, rankInfos_.get(i)); } if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(3, myRank_); + output.writeMessage(3, myInfo_); } getUnknownFields().writeTo(output); } @@ -10785,7 +10811,7 @@ public final class ArenaInfoProto { } if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(3, myRank_); + .computeMessageSize(3, myInfo_); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; @@ -10896,6 +10922,7 @@ public final class ArenaInfoProto { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { getRankInfosFieldBuilder(); + getMyInfoFieldBuilder(); } } private static Builder create() { @@ -10910,7 +10937,11 @@ public final class ArenaInfoProto { } else { rankInfosBuilder_.clear(); } - myRank_ = 0; + if (myInfoBuilder_ == null) { + myInfo_ = com.ljsd.jieling.protocols.CommonProto.ArenaEnemy.getDefaultInstance(); + } else { + myInfoBuilder_.clear(); + } bitField0_ = (bitField0_ & ~0x00000002); return this; } @@ -10952,7 +10983,11 @@ public final class ArenaInfoProto { if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000001; } - result.myRank_ = myRank_; + if (myInfoBuilder_ == null) { + result.myInfo_ = myInfo_; + } else { + result.myInfo_ = myInfoBuilder_.build(); + } result.bitField0_ = to_bitField0_; onBuilt(); return result; @@ -10995,8 +11030,8 @@ public final class ArenaInfoProto { } } } - if (other.hasMyRank()) { - setMyRank(other.getMyRank()); + if (other.hasMyInfo()) { + mergeMyInfo(other.getMyInfo()); } this.mergeUnknownFields(other.getUnknownFields()); return this; @@ -11337,54 +11372,158 @@ public final class ArenaInfoProto { return rankInfosBuilder_; } - // optional int32 myRank = 3; - private int myRank_ ; + // optional .com.ljsd.jieling.protocols.ArenaEnemy myInfo = 3; + private com.ljsd.jieling.protocols.CommonProto.ArenaEnemy myInfo_ = com.ljsd.jieling.protocols.CommonProto.ArenaEnemy.getDefaultInstance(); + private com.google.protobuf.SingleFieldBuilder< + com.ljsd.jieling.protocols.CommonProto.ArenaEnemy, com.ljsd.jieling.protocols.CommonProto.ArenaEnemy.Builder, com.ljsd.jieling.protocols.CommonProto.ArenaEnemyOrBuilder> myInfoBuilder_; /** - * optional int32 myRank = 3; + * optional .com.ljsd.jieling.protocols.ArenaEnemy myInfo = 3; * *
        * 我的排名
        * 
*/ - public boolean hasMyRank() { + public boolean hasMyInfo() { return ((bitField0_ & 0x00000002) == 0x00000002); } /** - * optional int32 myRank = 3; + * optional .com.ljsd.jieling.protocols.ArenaEnemy myInfo = 3; * *
        * 我的排名
        * 
*/ - public int getMyRank() { - return myRank_; + public com.ljsd.jieling.protocols.CommonProto.ArenaEnemy getMyInfo() { + if (myInfoBuilder_ == null) { + return myInfo_; + } else { + return myInfoBuilder_.getMessage(); + } } /** - * optional int32 myRank = 3; + * optional .com.ljsd.jieling.protocols.ArenaEnemy myInfo = 3; * *
        * 我的排名
        * 
*/ - public Builder setMyRank(int value) { + public Builder setMyInfo(com.ljsd.jieling.protocols.CommonProto.ArenaEnemy value) { + if (myInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + myInfo_ = value; + onChanged(); + } else { + myInfoBuilder_.setMessage(value); + } bitField0_ |= 0x00000002; - myRank_ = value; - onChanged(); return this; } /** - * optional int32 myRank = 3; + * optional .com.ljsd.jieling.protocols.ArenaEnemy myInfo = 3; * *
        * 我的排名
        * 
*/ - public Builder clearMyRank() { - bitField0_ = (bitField0_ & ~0x00000002); - myRank_ = 0; - onChanged(); + public Builder setMyInfo( + com.ljsd.jieling.protocols.CommonProto.ArenaEnemy.Builder builderForValue) { + if (myInfoBuilder_ == null) { + myInfo_ = builderForValue.build(); + onChanged(); + } else { + myInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; return this; } + /** + * optional .com.ljsd.jieling.protocols.ArenaEnemy myInfo = 3; + * + *
+       * 我的排名
+       * 
+ */ + public Builder mergeMyInfo(com.ljsd.jieling.protocols.CommonProto.ArenaEnemy value) { + if (myInfoBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002) && + myInfo_ != com.ljsd.jieling.protocols.CommonProto.ArenaEnemy.getDefaultInstance()) { + myInfo_ = + com.ljsd.jieling.protocols.CommonProto.ArenaEnemy.newBuilder(myInfo_).mergeFrom(value).buildPartial(); + } else { + myInfo_ = value; + } + onChanged(); + } else { + myInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + * optional .com.ljsd.jieling.protocols.ArenaEnemy myInfo = 3; + * + *
+       * 我的排名
+       * 
+ */ + public Builder clearMyInfo() { + if (myInfoBuilder_ == null) { + myInfo_ = com.ljsd.jieling.protocols.CommonProto.ArenaEnemy.getDefaultInstance(); + onChanged(); + } else { + myInfoBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + /** + * optional .com.ljsd.jieling.protocols.ArenaEnemy myInfo = 3; + * + *
+       * 我的排名
+       * 
+ */ + public com.ljsd.jieling.protocols.CommonProto.ArenaEnemy.Builder getMyInfoBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getMyInfoFieldBuilder().getBuilder(); + } + /** + * optional .com.ljsd.jieling.protocols.ArenaEnemy myInfo = 3; + * + *
+       * 我的排名
+       * 
+ */ + public com.ljsd.jieling.protocols.CommonProto.ArenaEnemyOrBuilder getMyInfoOrBuilder() { + if (myInfoBuilder_ != null) { + return myInfoBuilder_.getMessageOrBuilder(); + } else { + return myInfo_; + } + } + /** + * optional .com.ljsd.jieling.protocols.ArenaEnemy myInfo = 3; + * + *
+       * 我的排名
+       * 
+ */ + private com.google.protobuf.SingleFieldBuilder< + com.ljsd.jieling.protocols.CommonProto.ArenaEnemy, com.ljsd.jieling.protocols.CommonProto.ArenaEnemy.Builder, com.ljsd.jieling.protocols.CommonProto.ArenaEnemyOrBuilder> + getMyInfoFieldBuilder() { + if (myInfoBuilder_ == null) { + myInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.ljsd.jieling.protocols.CommonProto.ArenaEnemy, com.ljsd.jieling.protocols.CommonProto.ArenaEnemy.Builder, com.ljsd.jieling.protocols.CommonProto.ArenaEnemyOrBuilder>( + myInfo_, + getParentForChildren(), + isClean()); + myInfo_ = null; + } + return myInfoBuilder_; + } // @@protoc_insertion_point(builder_scope:com.ljsd.jieling.protocols.ChampionGetWorldRankResponse) } @@ -16772,31 +16911,32 @@ public final class ArenaInfoProto { "ocols.ChampionBetInfo\022\016\n\006winUid\030\003 \001(\005\"3\n" + "\022ChampionBetReqeust\022\016\n\006winUid\030\001 \001(\005\022\r\n\005c" + "oins\030\002 \001(\005\"+\n\033ChampionGetWorldRankReques" + - "t\022\014\n\004page\030\001 \001(\005\"i\n\034ChampionGetWorldRankR" + - "esponse\0229\n\trankInfos\030\001 \003(\0132&.com.ljsd.ji", - "eling.protocols.ArenaEnemy\022\016\n\006myRank\030\003 \001" + - "(\005\"s\n\035ChampionGetMyTeamInfoResponse\022R\n\026c" + - "hampionTeamPersonInfo\030\001 \003(\01322.com.ljsd.j" + - "ieling.protocols.ChampionTeamPersonInfo\"" + - "\263\001\n\023ChampionTwoEnemInfo\0228\n\010redEnemy\030\001 \001(" + - "\0132&.com.ljsd.jieling.protocols.ArenaEnem" + - "y\0229\n\tblueEnemy\030\002 \001(\0132&.com.ljsd.jieling." + - "protocols.ArenaEnemy\022\023\n\013fightResult\030\003 \001(" + - "\005\022\022\n\nroundTimes\030\004 \001(\005\"\252\001\n\023ChampionMyBetD" + - "etail\022F\n\renemyPairInfo\030\001 \001(\0132/.com.ljsd.", - "jieling.protocols.ChampionTwoEnemInfo\022\021\n" + - "\tbetResult\030\002 \001(\005\0228\n\tfightData\030\003 \001(\0132%.co" + - "m.ljsd.jieling.protocols.FightData\"o\n%Ch" + - "anpionGetAllMyBattleHistoryResponse\022F\n\re" + - "nemyPairInfo\030\001 \003(\0132/.com.ljsd.jieling.pr" + - "otocols.ChampionTwoEnemInfo\"p\n\037ChampionG" + - "etAllMyBetInfoResponse\022M\n\024championMyBetD" + - "etails\030\001 \003(\0132/.com.ljsd.jieling.protocol" + - "s.ChampionMyBetDetail\"(\n\030ChampionViewFin" + - "alRequest\022\014\n\004type\030\001 \001(\005\"o\n\031ChampionViewF", - "inalResponse\022R\n\026championBattlePairInfo\030\001" + - " \003(\01322.com.ljsd.jieling.protocols.Champi" + - "onBattlePairInfoB\002H\001" + "t\022\014\n\004page\030\001 \001(\005\"\221\001\n\034ChampionGetWorldRank" + + "Response\0229\n\trankInfos\030\001 \003(\0132&.com.ljsd.j", + "ieling.protocols.ArenaEnemy\0226\n\006myInfo\030\003 " + + "\001(\0132&.com.ljsd.jieling.protocols.ArenaEn" + + "emy\"s\n\035ChampionGetMyTeamInfoResponse\022R\n\026" + + "championTeamPersonInfo\030\001 \003(\01322.com.ljsd." + + "jieling.protocols.ChampionTeamPersonInfo" + + "\"\263\001\n\023ChampionTwoEnemInfo\0228\n\010redEnemy\030\001 \001" + + "(\0132&.com.ljsd.jieling.protocols.ArenaEne" + + "my\0229\n\tblueEnemy\030\002 \001(\0132&.com.ljsd.jieling" + + ".protocols.ArenaEnemy\022\023\n\013fightResult\030\003 \001" + + "(\005\022\022\n\nroundTimes\030\004 \001(\005\"\252\001\n\023ChampionMyBet", + "Detail\022F\n\renemyPairInfo\030\001 \001(\0132/.com.ljsd" + + ".jieling.protocols.ChampionTwoEnemInfo\022\021" + + "\n\tbetResult\030\002 \001(\005\0228\n\tfightData\030\003 \001(\0132%.c" + + "om.ljsd.jieling.protocols.FightData\"o\n%C" + + "hanpionGetAllMyBattleHistoryResponse\022F\n\r" + + "enemyPairInfo\030\001 \003(\0132/.com.ljsd.jieling.p" + + "rotocols.ChampionTwoEnemInfo\"p\n\037Champion" + + "GetAllMyBetInfoResponse\022M\n\024championMyBet" + + "Details\030\001 \003(\0132/.com.ljsd.jieling.protoco" + + "ls.ChampionMyBetDetail\"(\n\030ChampionViewFi", + "nalRequest\022\014\n\004type\030\001 \001(\005\"o\n\031ChampionView" + + "FinalResponse\022R\n\026championBattlePairInfo\030" + + "\001 \003(\01322.com.ljsd.jieling.protocols.Champ" + + "ionBattlePairInfoB\002H\001" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { @@ -16898,7 +17038,7 @@ public final class ArenaInfoProto { internal_static_com_ljsd_jieling_protocols_ChampionGetWorldRankResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_com_ljsd_jieling_protocols_ChampionGetWorldRankResponse_descriptor, - new java.lang.String[] { "RankInfos", "MyRank", }); + new java.lang.String[] { "RankInfos", "MyInfo", }); internal_static_com_ljsd_jieling_protocols_ChampionGetMyTeamInfoResponse_descriptor = getDescriptor().getMessageTypes().get(16); internal_static_com_ljsd_jieling_protocols_ChampionGetMyTeamInfoResponse_fieldAccessorTable = new diff --git a/bloodybattle/src/main/java/com/ljsd/jieling/protocols/CommonProto.java b/bloodybattle/src/main/java/com/ljsd/jieling/protocols/CommonProto.java index 300d74f6e..5363df3ed 100644 --- a/bloodybattle/src/main/java/com/ljsd/jieling/protocols/CommonProto.java +++ b/bloodybattle/src/main/java/com/ljsd/jieling/protocols/CommonProto.java @@ -81509,41 +81509,68 @@ public final class CommonProto { */ int getFightResult(); - // optional .com.ljsd.jieling.protocols.FightData fightData = 4; + // optional string id = 4; /** - * optional .com.ljsd.jieling.protocols.FightData fightData = 4; + * optional string id = 4; * *
-     *战斗数据
+     * 唯一标识 用于请求战斗回放
      * 
*/ - boolean hasFightData(); + boolean hasId(); /** - * optional .com.ljsd.jieling.protocols.FightData fightData = 4; + * optional string id = 4; * *
-     *战斗数据
+     * 唯一标识 用于请求战斗回放
      * 
*/ - com.ljsd.jieling.protocols.CommonProto.FightData getFightData(); + java.lang.String getId(); /** - * optional .com.ljsd.jieling.protocols.FightData fightData = 4; + * optional string id = 4; * *
-     *战斗数据
+     * 唯一标识 用于请求战斗回放
      * 
*/ - com.ljsd.jieling.protocols.CommonProto.FightDataOrBuilder getFightDataOrBuilder(); + com.google.protobuf.ByteString + getIdBytes(); // optional int32 roundTImes = 5; /** * optional int32 roundTImes = 5; + * + *
+     *第几场
+     * 
*/ boolean hasRoundTImes(); /** * optional int32 roundTImes = 5; + * + *
+     *第几场
+     * 
*/ int getRoundTImes(); + + // optional int32 teamId = 6; + /** + * optional int32 teamId = 6; + * + *
+     * 第几组
+     * 
+ */ + boolean hasTeamId(); + /** + * optional int32 teamId = 6; + * + *
+     * 第几组
+     * 
+ */ + int getTeamId(); } /** * Protobuf type {@code com.ljsd.jieling.protocols.ChampionBattlePairInfo} @@ -81612,16 +81639,8 @@ public final class CommonProto { break; } case 34: { - com.ljsd.jieling.protocols.CommonProto.FightData.Builder subBuilder = null; - if (((bitField0_ & 0x00000008) == 0x00000008)) { - subBuilder = fightData_.toBuilder(); - } - fightData_ = input.readMessage(com.ljsd.jieling.protocols.CommonProto.FightData.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(fightData_); - fightData_ = subBuilder.buildPartial(); - } bitField0_ |= 0x00000008; + id_ = input.readBytes(); break; } case 40: { @@ -81629,6 +81648,11 @@ public final class CommonProto { roundTImes_ = input.readInt32(); break; } + case 48: { + bitField0_ |= 0x00000020; + teamId_ = input.readInt32(); + break; + } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { @@ -81779,38 +81803,59 @@ public final class CommonProto { return fightResult_; } - // optional .com.ljsd.jieling.protocols.FightData fightData = 4; - public static final int FIGHTDATA_FIELD_NUMBER = 4; - private com.ljsd.jieling.protocols.CommonProto.FightData fightData_; + // optional string id = 4; + public static final int ID_FIELD_NUMBER = 4; + private java.lang.Object id_; /** - * optional .com.ljsd.jieling.protocols.FightData fightData = 4; + * optional string id = 4; * *
-     *战斗数据
+     * 唯一标识 用于请求战斗回放
      * 
*/ - public boolean hasFightData() { + public boolean hasId() { return ((bitField0_ & 0x00000008) == 0x00000008); } /** - * optional .com.ljsd.jieling.protocols.FightData fightData = 4; + * optional string id = 4; * *
-     *战斗数据
+     * 唯一标识 用于请求战斗回放
      * 
*/ - public com.ljsd.jieling.protocols.CommonProto.FightData getFightData() { - return fightData_; + public java.lang.String getId() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + id_ = s; + } + return s; + } } /** - * optional .com.ljsd.jieling.protocols.FightData fightData = 4; + * optional string id = 4; * *
-     *战斗数据
+     * 唯一标识 用于请求战斗回放
      * 
*/ - public com.ljsd.jieling.protocols.CommonProto.FightDataOrBuilder getFightDataOrBuilder() { - return fightData_; + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } // optional int32 roundTImes = 5; @@ -81818,23 +81863,56 @@ public final class CommonProto { private int roundTImes_; /** * optional int32 roundTImes = 5; + * + *
+     *第几场
+     * 
*/ public boolean hasRoundTImes() { return ((bitField0_ & 0x00000010) == 0x00000010); } /** * optional int32 roundTImes = 5; + * + *
+     *第几场
+     * 
*/ public int getRoundTImes() { return roundTImes_; } + // optional int32 teamId = 6; + public static final int TEAMID_FIELD_NUMBER = 6; + private int teamId_; + /** + * optional int32 teamId = 6; + * + *
+     * 第几组
+     * 
+ */ + public boolean hasTeamId() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * optional int32 teamId = 6; + * + *
+     * 第几组
+     * 
+ */ + public int getTeamId() { + return teamId_; + } + private void initFields() { attackName_ = ""; defName_ = ""; fightResult_ = 0; - fightData_ = com.ljsd.jieling.protocols.CommonProto.FightData.getDefaultInstance(); + id_ = ""; roundTImes_ = 0; + teamId_ = 0; } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -81858,11 +81936,14 @@ public final class CommonProto { output.writeInt32(3, fightResult_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeMessage(4, fightData_); + output.writeBytes(4, getIdBytes()); } if (((bitField0_ & 0x00000010) == 0x00000010)) { output.writeInt32(5, roundTImes_); } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeInt32(6, teamId_); + } getUnknownFields().writeTo(output); } @@ -81886,12 +81967,16 @@ public final class CommonProto { } if (((bitField0_ & 0x00000008) == 0x00000008)) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, fightData_); + .computeBytesSize(4, getIdBytes()); } if (((bitField0_ & 0x00000010) == 0x00000010)) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(5, roundTImes_); } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(6, teamId_); + } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; @@ -82000,7 +82085,6 @@ public final class CommonProto { } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - getFightDataFieldBuilder(); } } private static Builder create() { @@ -82015,14 +82099,12 @@ public final class CommonProto { bitField0_ = (bitField0_ & ~0x00000002); fightResult_ = 0; bitField0_ = (bitField0_ & ~0x00000004); - if (fightDataBuilder_ == null) { - fightData_ = com.ljsd.jieling.protocols.CommonProto.FightData.getDefaultInstance(); - } else { - fightDataBuilder_.clear(); - } + id_ = ""; bitField0_ = (bitField0_ & ~0x00000008); roundTImes_ = 0; bitField0_ = (bitField0_ & ~0x00000010); + teamId_ = 0; + bitField0_ = (bitField0_ & ~0x00000020); return this; } @@ -82066,15 +82148,15 @@ public final class CommonProto { if (((from_bitField0_ & 0x00000008) == 0x00000008)) { to_bitField0_ |= 0x00000008; } - if (fightDataBuilder_ == null) { - result.fightData_ = fightData_; - } else { - result.fightData_ = fightDataBuilder_.build(); - } + result.id_ = id_; if (((from_bitField0_ & 0x00000010) == 0x00000010)) { to_bitField0_ |= 0x00000010; } result.roundTImes_ = roundTImes_; + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000020; + } + result.teamId_ = teamId_; result.bitField0_ = to_bitField0_; onBuilt(); return result; @@ -82104,12 +82186,17 @@ public final class CommonProto { if (other.hasFightResult()) { setFightResult(other.getFightResult()); } - if (other.hasFightData()) { - mergeFightData(other.getFightData()); + if (other.hasId()) { + bitField0_ |= 0x00000008; + id_ = other.id_; + onChanged(); } if (other.hasRoundTImes()) { setRoundTImes(other.getRoundTImes()); } + if (other.hasTeamId()) { + setTeamId(other.getTeamId()); + } this.mergeUnknownFields(other.getUnknownFields()); return this; } @@ -82334,175 +82421,132 @@ public final class CommonProto { return this; } - // optional .com.ljsd.jieling.protocols.FightData fightData = 4; - private com.ljsd.jieling.protocols.CommonProto.FightData fightData_ = com.ljsd.jieling.protocols.CommonProto.FightData.getDefaultInstance(); - private com.google.protobuf.SingleFieldBuilder< - com.ljsd.jieling.protocols.CommonProto.FightData, com.ljsd.jieling.protocols.CommonProto.FightData.Builder, com.ljsd.jieling.protocols.CommonProto.FightDataOrBuilder> fightDataBuilder_; + // optional string id = 4; + private java.lang.Object id_ = ""; /** - * optional .com.ljsd.jieling.protocols.FightData fightData = 4; + * optional string id = 4; * *
-       *战斗数据
+       * 唯一标识 用于请求战斗回放
        * 
*/ - public boolean hasFightData() { + public boolean hasId() { return ((bitField0_ & 0x00000008) == 0x00000008); } /** - * optional .com.ljsd.jieling.protocols.FightData fightData = 4; + * optional string id = 4; * *
-       *战斗数据
+       * 唯一标识 用于请求战斗回放
        * 
*/ - public com.ljsd.jieling.protocols.CommonProto.FightData getFightData() { - if (fightDataBuilder_ == null) { - return fightData_; + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + java.lang.String s = ((com.google.protobuf.ByteString) ref) + .toStringUtf8(); + id_ = s; + return s; } else { - return fightDataBuilder_.getMessage(); + return (java.lang.String) ref; } } /** - * optional .com.ljsd.jieling.protocols.FightData fightData = 4; + * optional string id = 4; * *
-       *战斗数据
+       * 唯一标识 用于请求战斗回放
        * 
*/ - public Builder setFightData(com.ljsd.jieling.protocols.CommonProto.FightData value) { - if (fightDataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - fightData_ = value; - onChanged(); + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; } else { - fightDataBuilder_.setMessage(value); + return (com.google.protobuf.ByteString) ref; } - bitField0_ |= 0x00000008; - return this; } /** - * optional .com.ljsd.jieling.protocols.FightData fightData = 4; + * optional string id = 4; * *
-       *战斗数据
+       * 唯一标识 用于请求战斗回放
        * 
*/ - public Builder setFightData( - com.ljsd.jieling.protocols.CommonProto.FightData.Builder builderForValue) { - if (fightDataBuilder_ == null) { - fightData_ = builderForValue.build(); - onChanged(); - } else { - fightDataBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000008; - return this; - } - /** - * optional .com.ljsd.jieling.protocols.FightData fightData = 4; - * - *
-       *战斗数据
-       * 
- */ - public Builder mergeFightData(com.ljsd.jieling.protocols.CommonProto.FightData value) { - if (fightDataBuilder_ == null) { - if (((bitField0_ & 0x00000008) == 0x00000008) && - fightData_ != com.ljsd.jieling.protocols.CommonProto.FightData.getDefaultInstance()) { - fightData_ = - com.ljsd.jieling.protocols.CommonProto.FightData.newBuilder(fightData_).mergeFrom(value).buildPartial(); - } else { - fightData_ = value; - } - onChanged(); - } else { - fightDataBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000008; - return this; - } - /** - * optional .com.ljsd.jieling.protocols.FightData fightData = 4; - * - *
-       *战斗数据
-       * 
- */ - public Builder clearFightData() { - if (fightDataBuilder_ == null) { - fightData_ = com.ljsd.jieling.protocols.CommonProto.FightData.getDefaultInstance(); - onChanged(); - } else { - fightDataBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000008); - return this; - } - /** - * optional .com.ljsd.jieling.protocols.FightData fightData = 4; - * - *
-       *战斗数据
-       * 
- */ - public com.ljsd.jieling.protocols.CommonProto.FightData.Builder getFightDataBuilder() { - bitField0_ |= 0x00000008; + public Builder setId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + id_ = value; onChanged(); - return getFightDataFieldBuilder().getBuilder(); + return this; } /** - * optional .com.ljsd.jieling.protocols.FightData fightData = 4; + * optional string id = 4; * *
-       *战斗数据
+       * 唯一标识 用于请求战斗回放
        * 
*/ - public com.ljsd.jieling.protocols.CommonProto.FightDataOrBuilder getFightDataOrBuilder() { - if (fightDataBuilder_ != null) { - return fightDataBuilder_.getMessageOrBuilder(); - } else { - return fightData_; - } + public Builder clearId() { + bitField0_ = (bitField0_ & ~0x00000008); + id_ = getDefaultInstance().getId(); + onChanged(); + return this; } /** - * optional .com.ljsd.jieling.protocols.FightData fightData = 4; + * optional string id = 4; * *
-       *战斗数据
+       * 唯一标识 用于请求战斗回放
        * 
*/ - private com.google.protobuf.SingleFieldBuilder< - com.ljsd.jieling.protocols.CommonProto.FightData, com.ljsd.jieling.protocols.CommonProto.FightData.Builder, com.ljsd.jieling.protocols.CommonProto.FightDataOrBuilder> - getFightDataFieldBuilder() { - if (fightDataBuilder_ == null) { - fightDataBuilder_ = new com.google.protobuf.SingleFieldBuilder< - com.ljsd.jieling.protocols.CommonProto.FightData, com.ljsd.jieling.protocols.CommonProto.FightData.Builder, com.ljsd.jieling.protocols.CommonProto.FightDataOrBuilder>( - fightData_, - getParentForChildren(), - isClean()); - fightData_ = null; - } - return fightDataBuilder_; + public Builder setIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + id_ = value; + onChanged(); + return this; } // optional int32 roundTImes = 5; private int roundTImes_ ; /** * optional int32 roundTImes = 5; + * + *
+       *第几场
+       * 
*/ public boolean hasRoundTImes() { return ((bitField0_ & 0x00000010) == 0x00000010); } /** * optional int32 roundTImes = 5; + * + *
+       *第几场
+       * 
*/ public int getRoundTImes() { return roundTImes_; } /** * optional int32 roundTImes = 5; + * + *
+       *第几场
+       * 
*/ public Builder setRoundTImes(int value) { bitField0_ |= 0x00000010; @@ -82512,6 +82556,10 @@ public final class CommonProto { } /** * optional int32 roundTImes = 5; + * + *
+       *第几场
+       * 
*/ public Builder clearRoundTImes() { bitField0_ = (bitField0_ & ~0x00000010); @@ -82520,6 +82568,55 @@ public final class CommonProto { return this; } + // optional int32 teamId = 6; + private int teamId_ ; + /** + * optional int32 teamId = 6; + * + *
+       * 第几组
+       * 
+ */ + public boolean hasTeamId() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * optional int32 teamId = 6; + * + *
+       * 第几组
+       * 
+ */ + public int getTeamId() { + return teamId_; + } + /** + * optional int32 teamId = 6; + * + *
+       * 第几组
+       * 
+ */ + public Builder setTeamId(int value) { + bitField0_ |= 0x00000020; + teamId_ = value; + onChanged(); + return this; + } + /** + * optional int32 teamId = 6; + * + *
+       * 第几组
+       * 
+ */ + public Builder clearTeamId() { + bitField0_ = (bitField0_ & ~0x00000020); + teamId_ = 0; + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:com.ljsd.jieling.protocols.ChampionBattlePairInfo) } @@ -83234,11 +83331,11 @@ public final class CommonProto { "s.TeamOneInfo\022:\n\tenemyInfo\030\002 \001(\0132\'.com.l" + "jsd.jieling.protocols.TeamOneInfo\022\016\n\006res" + "ult\030\003 \001(\005\0228\n\tfightData\030\004 \001(\0132%.com.ljsd." + - "jieling.protocols.FightData\"\240\001\n\026Champion", + "jieling.protocols.FightData\"\202\001\n\026Champion", "BattlePairInfo\022\022\n\nattackName\030\001 \001(\t\022\017\n\007de" + - "fName\030\002 \001(\t\022\023\n\013fightResult\030\003 \001(\005\0228\n\tfigh" + - "tData\030\004 \001(\0132%.com.ljsd.jieling.protocols" + - ".FightData\022\022\n\nroundTImes\030\005 \001(\005B\002H\001" + "fName\030\002 \001(\t\022\023\n\013fightResult\030\003 \001(\005\022\n\n\002id\030\004" + + " \001(\t\022\022\n\nroundTImes\030\005 \001(\005\022\016\n\006teamId\030\006 \001(\005" + + "B\002H\001" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { @@ -83790,7 +83887,7 @@ public final class CommonProto { internal_static_com_ljsd_jieling_protocols_ChampionBattlePairInfo_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_com_ljsd_jieling_protocols_ChampionBattlePairInfo_descriptor, - new java.lang.String[] { "AttackName", "DefName", "FightResult", "FightData", "RoundTImes", }); + new java.lang.String[] { "AttackName", "DefName", "FightResult", "Id", "RoundTImes", "TeamId", }); return null; } }; diff --git a/bloodybattle/src/main/java/com/ljsd/jieling/protocols/MessageTypeProto.java b/bloodybattle/src/main/java/com/ljsd/jieling/protocols/MessageTypeProto.java index 4e62733a8..9ac71ed20 100644 --- a/bloodybattle/src/main/java/com/ljsd/jieling/protocols/MessageTypeProto.java +++ b/bloodybattle/src/main/java/com/ljsd/jieling/protocols/MessageTypeProto.java @@ -559,6 +559,10 @@ public final class MessageTypeProto { CHAMPION_PROGRESS_UPDATE_INDICATION(86, 10217), /** * CHAMPION_VIEW_FINAL_REQUEST = 10218; + * + *
+     *查看32强
+     * 
*/ CHAMPION_VIEW_FINAL_REQUEST(87, 10218), /** @@ -3529,6 +3533,10 @@ public final class MessageTypeProto { public static final int CHAMPION_PROGRESS_UPDATE_INDICATION_VALUE = 10217; /** * CHAMPION_VIEW_FINAL_REQUEST = 10218; + * + *
+     *查看32强
+     * 
*/ public static final int CHAMPION_VIEW_FINAL_REQUEST_VALUE = 10218; /** diff --git a/serverlogic/src/main/java/com/ljsd/jieling/db/redis/RedisKey.java b/serverlogic/src/main/java/com/ljsd/jieling/db/redis/RedisKey.java index 9f696bc69..79cd09310 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/db/redis/RedisKey.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/db/redis/RedisKey.java @@ -200,7 +200,8 @@ public class RedisKey { public final static String CHAMPION_JOIN = "CHAMPION_JOIN"; public final static String CHAMPION_ARENA_RECORD = "CHAMPION_ARENA_RECORD"; public final static String CHAMPION_CUR_JOIN_IDS = "CHAMPION_CUR_JOIN_IDS"; - public final static String CHAMPION_FINAL_JOIN_IDS = "CHAMPION_CUR_JOIN_IDS"; + public final static String CHAMPION_FINAL32_JOIN_IDS = "CHAMPION_FINAL32_JOIN_IDS"; + public final static String CHAMPION_FINAL4_JOIN_IDS = "CHAMPION_FINAL4_JOIN_IDS"; public final static String CHAMPION_MY_BATTLLE_IDS = "CHAMPION_MY_BATTLLE_IDS"; public final static String CHAMPION_CUR_BETID = "CHAMPION_CUR_BETID"; @@ -212,7 +213,6 @@ public class RedisKey { public final static String CHAMPION_BET_MINE = "CHAMPION_BET_MINE"; // 我的竞猜 public final static String CHAMPION_BET_ALL = "CHAMPION_BET_ALL"; // 竞猜信息 - public final static String CHAMPION_BET_RANK = "CHAMPION_BET_RANK"; // 巅峰赛排名 public final static String CHAMPION_FINAL_RECODED_IDS = "CHAMPION_FINAL_RECODED_IDS"; // 巅峰赛決賽信息 public final static String PIDGIDTEMP = "PIDGIDTEMP"; diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/GlobalDataManaager.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/GlobalDataManaager.java index 597405ae1..ab900e8ce 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/GlobalDataManaager.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/GlobalDataManaager.java @@ -245,11 +245,7 @@ public class GlobalDataManaager implements IManager { new UserLevelEventHandler(); new RemoveEventHeroHandler(); new FightMainEventHandler(); - // ChampionshipLogic. start(); ChampionshipLogic.minuteCheck(true); - // ChampionshipLogic. selectToBattle(); - // ChampionshipLogic. switchBet(); - } catch (Exception e) { LOGGER.error("e",e); } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/arena/ArenaLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/arena/ArenaLogic.java index 693b0e6ea..51ce9f406 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/arena/ArenaLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/arena/ArenaLogic.java @@ -593,11 +593,17 @@ public class ArenaLogic { public void getFightReplayData(ISession iSession,int type,String fightId) throws Exception { int uid = iSession.getUid(); - ArenaRecord arenaRecord = RedisUtil.getInstence().getMapEntry(RedisKey.ARENA_RRECORD, Integer.toString(uid), fightId, ArenaRecord.class); + 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); + + } if(arenaRecord == null){ throw new ErrorCodeException(ErrorCode.newDefineCode("arena_rrecord null")); } - byte[] fightData = arenaRecord.getFightData(); + 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); diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/championship/ChampionshipLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/championship/ChampionshipLogic.java index a9c540fbd..8061b0044 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/championship/ChampionshipLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/championship/ChampionshipLogic.java @@ -68,22 +68,46 @@ public class ChampionshipLogic { Type valueType = new TypeToken>() { }.getType(); Map> finalmemberOfTeam = RedisUtil.getInstence().getMapValues(RedisKey.CHAMPION_FINAL_TEAM_INFO, "", Integer.class, valueType); - List arenaRecodeds = RedisUtil.getInstence().lGet(RedisKey.CHAMPION_FINAL_JOIN_IDS, "", 0, -1); + Map memberPerOfTeam = new HashMap<>(); + List arenaRecodeds = new ArrayList<>(); + if(type == 1){ + arenaRecodeds = RedisUtil.getInstence().lGet(RedisKey.CHAMPION_FINAL32_JOIN_IDS, "", 0, -1); + finalmemberOfTeam.forEach((k,v)->{ + v.forEach(memberId->{ + memberPerOfTeam.put(memberId,k); + }); + }); + }else{ + arenaRecodeds = RedisUtil.getInstence().lGet(RedisKey.CHAMPION_FINAL4_JOIN_IDS, "", 0, -1); + } List arenaIds = new ArrayList<>(arenaRecodeds); List arenaRecords = RedisUtil.getInstence().getMapEntrys(RedisKey.CHAMPION_ARENA_RECORD, "", arenaIds, ArenaRecord.class); Map config = STableManager.getConfig(SArenaRobotConfig.class); + List curArenaRecordIds = RedisUtil.getInstence().lGet(RedisKey.CHAMPION_CUR_JOIN_IDS, "", 0, -1); + ArenaInfoProto.ChampionViewFinalResponse.Builder builder = ArenaInfoProto.ChampionViewFinalResponse.newBuilder(); for (ArenaRecord arenaRecord : arenaRecords) { int attackId = arenaRecord.getAttackId(); int defUid = arenaRecord.getDefUid(); String attackName = getRoleNameById(attackId, config); - String defName = getRoleNameById(attackId, config); + String defName = getRoleNameById(defUid, config); int fightResult = arenaRecord.getFightResult(); - if (progress % 10 % 4 != 0) { + if (curArenaRecordIds.contains(arenaRecord.getId()) && progress % 10 % 4 != 0) { fightResult = -1; } - - + int teamId=1; + if(type == 1){ + teamId = memberPerOfTeam.get(attackId) +1; + } + builder.addChampionBattlePairInfo(CommonProto.ChampionBattlePairInfo.newBuilder() + .setAttackName(attackName) + .setDefName(defName) + .setFightResult(fightResult) + .setRoundTImes(arenaRecord.getRoundTims()) + .setTeamId(teamId) + .setId(arenaRecord.getId()) + ); } + MessageUtil.sendMessage(iSession,1, MessageTypeProto.MessageType.CHAMPION_VIEW_FINAL_RESPONSE_VALUE,builder.build(),true); } public static String getRoleNameById(int uid,Map config ) throws Exception { @@ -301,7 +325,7 @@ public class ChampionshipLogic { }); int rank=1; - Set> arenaRankInfo = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.CHAMPION_BET_RANK, Integer.toString(1), 0, -1); + Set> arenaRankInfo = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.CHAMPION_RANK, Integer.toString(1), 0, -1); Map robotConfigMap = STableManager.getConfig(SArenaRobotConfig.class); int nowTime = (int)(TimeUtils.now()/1000); for(ZSetOperations.TypedTuple item : arenaRankInfo){ @@ -349,14 +373,13 @@ public class ChampionshipLogic { selectToJoinFinal(); schedule=2; - for(int i=8;i<13;i++){ + for(int i=8;i<12;i++){ roundTimes=i; selectToBattle(); switchBet(); scoreToRedis(); - } -*/ + }*/ } @@ -971,11 +994,19 @@ public class ChampionshipLogic { arenaRecord.setRoundTims(roundTimes); arenaRecordMap.put(arenaRecord.getId(),arenaRecord); } + } RedisUtil.getInstence().putMapEntrys(RedisKey.CHAMPION_ARENA_RECORD,"",arenaRecordMap); arenaRecordIds.addAll(arenaRecordMap.keySet()); RedisUtil.getInstence().lSet(RedisKey.CHAMPION_CUR_JOIN_IDS,"",arenaRecordIds); - RedisUtil.getInstence().lSet(RedisKey.CHAMPION_FINAL_JOIN_IDS,"",arenaRecordIds); + if(schedule == 2){ + if(arenaRecordIds.size()>=4){ + RedisUtil.getInstence().lSet(RedisKey.CHAMPION_FINAL32_JOIN_IDS,"",arenaRecordIds); + }else{ + RedisUtil.getInstence().lSet(RedisKey.CHAMPION_FINAL4_JOIN_IDS,"",arenaRecordIds); + } + + } Map robotConfigMap = STableManager.getConfig(SArenaRobotConfig.class); arenaRecordMap.forEach((id,arenaRecord)->{ int defUid = arenaRecord.getDefUid(); @@ -1080,9 +1111,11 @@ public class ChampionshipLogic { List arenaRankMemberInfo = new ArrayList<>(20); int rankEndLine = STableManager.getFigureConfig(CommonStaticConfig.class).getsChampionshipSetting().getChampionshipPlayer(); - + int myUid = session.getUid(); + CommonProto.ArenaEnemy myInfo = null; + ArenaInfoProto.ChampionGetWorldRankResponse.Builder builder = ArenaInfoProto.ChampionGetWorldRankResponse.newBuilder(); if(end> arenaRankInfo = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.CHAMPION_BET_RANK, Integer.toString(1), start, end); + Set> arenaRankInfo = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.CHAMPION_RANK,"", start, end); for (ZSetOperations.TypedTuple item : arenaRankInfo) { String value = item.getValue(); int uid = Integer.parseInt(value); @@ -1093,23 +1126,23 @@ public class ChampionshipLogic { continue; } arenaRankMemberInfo.add(enemyInfo); + if(uid == myUid){ + myInfo = enemyInfo; + } } } - int uid = session.getUid(); - int score = RedisUtil.getInstence().getZSetScore(RedisKey.CHAMPION_BET_RANK,Integer.toString(1), Integer.toString(uid)).intValue(); - int myRank =-1; - if(score == -1){ - score =0; - }else{ - myRank= RedisUtil.getInstence().getZSetreverseRank(RedisKey.CHAMPION_BET_RANK,Integer.toString(1),Integer.toString(uid)).intValue(); + if(myInfo==null && end>=rankEndLine){ + int myRank= RedisUtil.getInstence().getZSetreverseRank(RedisKey.CHAMPION_RANK,"",Integer.toString(myUid)).intValue(); + if(myRank != -1){ + myInfo=getEnemyInfo(myUid, myRank); + } + } + if(myInfo!=null){ + builder.setMyInfo(myInfo); } - 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); + ArenaInfoProto.ChampionGetWorldRankResponse buildResponse = builder.addAllRankInfos(arenaRankMemberInfo).build(); + MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.CHAMPION_GET_RANK_RESPONSE_VALUE,buildResponse,true); }