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 0126f6b27..cce009aba 100644 --- a/bloodybattle/src/main/java/com/ljsd/jieling/protocols/ArenaInfoProto.java +++ b/bloodybattle/src/main/java/com/ljsd/jieling/protocols/ArenaInfoProto.java @@ -12945,31 +12945,41 @@ public final class ArenaInfoProto { */ int getBetResult(); - // optional .com.ljsd.jieling.protocols.FightData fightData = 3; + // optional int32 myBetCoins = 3; /** - * optional .com.ljsd.jieling.protocols.FightData fightData = 3; + * optional int32 myBetCoins = 3; * *
-     *战斗数据
+     * 我的下注
      * 
*/ - boolean hasFightData(); + boolean hasMyBetCoins(); /** - * optional .com.ljsd.jieling.protocols.FightData fightData = 3; + * optional int32 myBetCoins = 3; * *
-     *战斗数据
+     * 我的下注
      * 
*/ - com.ljsd.jieling.protocols.CommonProto.FightData getFightData(); + int getMyBetCoins(); + + // optional int32 myWinCoins = 4; /** - * optional .com.ljsd.jieling.protocols.FightData fightData = 3; + * optional int32 myWinCoins = 4; * *
-     *战斗数据
+     * 我获取
      * 
*/ - com.ljsd.jieling.protocols.CommonProto.FightDataOrBuilder getFightDataOrBuilder(); + boolean hasMyWinCoins(); + /** + * optional int32 myWinCoins = 4; + * + *
+     * 我获取
+     * 
+ */ + int getMyWinCoins(); } /** * Protobuf type {@code com.ljsd.jieling.protocols.ChampionMyBetDetail} @@ -13040,17 +13050,14 @@ public final class ArenaInfoProto { betResult_ = input.readInt32(); break; } - case 26: { - com.ljsd.jieling.protocols.CommonProto.FightData.Builder subBuilder = null; - if (((bitField0_ & 0x00000004) == 0x00000004)) { - subBuilder = fightData_.toBuilder(); - } - fightData_ = input.readMessage(com.ljsd.jieling.protocols.CommonProto.FightData.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(fightData_); - fightData_ = subBuilder.buildPartial(); - } + case 24: { bitField0_ |= 0x00000004; + myBetCoins_ = input.readInt32(); + break; + } + case 32: { + bitField0_ |= 0x00000008; + myWinCoins_ = input.readInt32(); break; } } @@ -13151,44 +13158,59 @@ public final class ArenaInfoProto { return betResult_; } - // optional .com.ljsd.jieling.protocols.FightData fightData = 3; - public static final int FIGHTDATA_FIELD_NUMBER = 3; - private com.ljsd.jieling.protocols.CommonProto.FightData fightData_; + // optional int32 myBetCoins = 3; + public static final int MYBETCOINS_FIELD_NUMBER = 3; + private int myBetCoins_; /** - * optional .com.ljsd.jieling.protocols.FightData fightData = 3; + * optional int32 myBetCoins = 3; * *
-     *战斗数据
+     * 我的下注
      * 
*/ - public boolean hasFightData() { + public boolean hasMyBetCoins() { return ((bitField0_ & 0x00000004) == 0x00000004); } /** - * optional .com.ljsd.jieling.protocols.FightData fightData = 3; + * optional int32 myBetCoins = 3; * *
-     *战斗数据
+     * 我的下注
      * 
*/ - public com.ljsd.jieling.protocols.CommonProto.FightData getFightData() { - return fightData_; + public int getMyBetCoins() { + return myBetCoins_; + } + + // optional int32 myWinCoins = 4; + public static final int MYWINCOINS_FIELD_NUMBER = 4; + private int myWinCoins_; + /** + * optional int32 myWinCoins = 4; + * + *
+     * 我获取
+     * 
+ */ + public boolean hasMyWinCoins() { + return ((bitField0_ & 0x00000008) == 0x00000008); } /** - * optional .com.ljsd.jieling.protocols.FightData fightData = 3; + * optional int32 myWinCoins = 4; * *
-     *战斗数据
+     * 我获取
      * 
*/ - public com.ljsd.jieling.protocols.CommonProto.FightDataOrBuilder getFightDataOrBuilder() { - return fightData_; + public int getMyWinCoins() { + return myWinCoins_; } private void initFields() { enemyPairInfo_ = com.ljsd.jieling.protocols.ArenaInfoProto.ChampionTwoEnemInfo.getDefaultInstance(); betResult_ = 0; - fightData_ = com.ljsd.jieling.protocols.CommonProto.FightData.getDefaultInstance(); + myBetCoins_ = 0; + myWinCoins_ = 0; } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -13209,7 +13231,10 @@ public final class ArenaInfoProto { output.writeInt32(2, betResult_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeMessage(3, fightData_); + output.writeInt32(3, myBetCoins_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeInt32(4, myWinCoins_); } getUnknownFields().writeTo(output); } @@ -13230,7 +13255,11 @@ public final class ArenaInfoProto { } if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, fightData_); + .computeInt32Size(3, myBetCoins_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, myWinCoins_); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; @@ -13341,7 +13370,6 @@ public final class ArenaInfoProto { private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { getEnemyPairInfoFieldBuilder(); - getFightDataFieldBuilder(); } } private static Builder create() { @@ -13358,12 +13386,10 @@ public final class ArenaInfoProto { bitField0_ = (bitField0_ & ~0x00000001); betResult_ = 0; bitField0_ = (bitField0_ & ~0x00000002); - if (fightDataBuilder_ == null) { - fightData_ = com.ljsd.jieling.protocols.CommonProto.FightData.getDefaultInstance(); - } else { - fightDataBuilder_.clear(); - } + myBetCoins_ = 0; bitField0_ = (bitField0_ & ~0x00000004); + myWinCoins_ = 0; + bitField0_ = (bitField0_ & ~0x00000008); return this; } @@ -13407,11 +13433,11 @@ public final class ArenaInfoProto { if (((from_bitField0_ & 0x00000004) == 0x00000004)) { to_bitField0_ |= 0x00000004; } - if (fightDataBuilder_ == null) { - result.fightData_ = fightData_; - } else { - result.fightData_ = fightDataBuilder_.build(); + result.myBetCoins_ = myBetCoins_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; } + result.myWinCoins_ = myWinCoins_; result.bitField0_ = to_bitField0_; onBuilt(); return result; @@ -13434,8 +13460,11 @@ public final class ArenaInfoProto { if (other.hasBetResult()) { setBetResult(other.getBetResult()); } - if (other.hasFightData()) { - mergeFightData(other.getFightData()); + if (other.hasMyBetCoins()) { + setMyBetCoins(other.getMyBetCoins()); + } + if (other.hasMyWinCoins()) { + setMyWinCoins(other.getMyWinCoins()); } this.mergeUnknownFields(other.getUnknownFields()); return this; @@ -13666,157 +13695,102 @@ public final class ArenaInfoProto { return this; } - // optional .com.ljsd.jieling.protocols.FightData fightData = 3; - 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 int32 myBetCoins = 3; + private int myBetCoins_ ; /** - * optional .com.ljsd.jieling.protocols.FightData fightData = 3; + * optional int32 myBetCoins = 3; * *
-       *战斗数据
+       * 我的下注
        * 
*/ - public boolean hasFightData() { + public boolean hasMyBetCoins() { return ((bitField0_ & 0x00000004) == 0x00000004); } /** - * optional .com.ljsd.jieling.protocols.FightData fightData = 3; + * optional int32 myBetCoins = 3; * *
-       *战斗数据
+       * 我的下注
        * 
*/ - public com.ljsd.jieling.protocols.CommonProto.FightData getFightData() { - if (fightDataBuilder_ == null) { - return fightData_; - } else { - return fightDataBuilder_.getMessage(); - } + public int getMyBetCoins() { + return myBetCoins_; } /** - * optional .com.ljsd.jieling.protocols.FightData fightData = 3; + * optional int32 myBetCoins = 3; * *
-       *战斗数据
+       * 我的下注
        * 
*/ - public Builder setFightData(com.ljsd.jieling.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 .com.ljsd.jieling.protocols.FightData fightData = 3; - * - *
-       *战斗数据
-       * 
- */ - public Builder setFightData( - com.ljsd.jieling.protocols.CommonProto.FightData.Builder builderForValue) { - if (fightDataBuilder_ == null) { - fightData_ = builderForValue.build(); - onChanged(); - } else { - fightDataBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000004; - return this; - } - /** - * optional .com.ljsd.jieling.protocols.FightData fightData = 3; - * - *
-       *战斗数据
-       * 
- */ - public Builder mergeFightData(com.ljsd.jieling.protocols.CommonProto.FightData value) { - if (fightDataBuilder_ == null) { - if (((bitField0_ & 0x00000004) == 0x00000004) && - 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_ |= 0x00000004; - return this; - } - /** - * optional .com.ljsd.jieling.protocols.FightData fightData = 3; - * - *
-       *战斗数据
-       * 
- */ - public Builder clearFightData() { - if (fightDataBuilder_ == null) { - fightData_ = com.ljsd.jieling.protocols.CommonProto.FightData.getDefaultInstance(); - onChanged(); - } else { - fightDataBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - /** - * optional .com.ljsd.jieling.protocols.FightData fightData = 3; - * - *
-       *战斗数据
-       * 
- */ - public com.ljsd.jieling.protocols.CommonProto.FightData.Builder getFightDataBuilder() { + public Builder setMyBetCoins(int value) { bitField0_ |= 0x00000004; + myBetCoins_ = value; onChanged(); - return getFightDataFieldBuilder().getBuilder(); + return this; } /** - * optional .com.ljsd.jieling.protocols.FightData fightData = 3; + * optional int32 myBetCoins = 3; * *
-       *战斗数据
+       * 我的下注
        * 
*/ - public com.ljsd.jieling.protocols.CommonProto.FightDataOrBuilder getFightDataOrBuilder() { - if (fightDataBuilder_ != null) { - return fightDataBuilder_.getMessageOrBuilder(); - } else { - return fightData_; - } + public Builder clearMyBetCoins() { + bitField0_ = (bitField0_ & ~0x00000004); + myBetCoins_ = 0; + onChanged(); + return this; + } + + // optional int32 myWinCoins = 4; + private int myWinCoins_ ; + /** + * optional int32 myWinCoins = 4; + * + *
+       * 我获取
+       * 
+ */ + public boolean hasMyWinCoins() { + return ((bitField0_ & 0x00000008) == 0x00000008); } /** - * optional .com.ljsd.jieling.protocols.FightData fightData = 3; + * optional int32 myWinCoins = 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 int getMyWinCoins() { + return myWinCoins_; + } + /** + * optional int32 myWinCoins = 4; + * + *
+       * 我获取
+       * 
+ */ + public Builder setMyWinCoins(int value) { + bitField0_ |= 0x00000008; + myWinCoins_ = value; + onChanged(); + return this; + } + /** + * optional int32 myWinCoins = 4; + * + *
+       * 我获取
+       * 
+ */ + public Builder clearMyWinCoins() { + bitField0_ = (bitField0_ & ~0x00000008); + myWinCoins_ = 0; + onChanged(); + return this; } // @@protoc_insertion_point(builder_scope:com.ljsd.jieling.protocols.ChampionMyBetDetail) @@ -16558,21 +16532,20 @@ public final class ArenaInfoProto { "rotocols.ArenaEnemy\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\022" + - "\n\n\002id\030\005 \001(\t\"\252\001\n\023ChampionMyBetDetail\022F\n\re" + + "\n\n\002id\030\005 \001(\t\"\230\001\n\023ChampionMyBetDetail\022F\n\re" + "nemyPairInfo\030\001 \001(\0132/.com.ljsd.jieling.pr" + "otocols.ChampionTwoEnemInfo\022\021\n\tbetResult", - "\030\002 \001(\005\0228\n\tfightData\030\003 \001(\0132%.com.ljsd.jie" + - "ling.protocols.FightData\"o\n%ChanpionGetA" + - "llMyBattleHistoryResponse\022F\n\renemyPairIn" + - "fo\030\001 \003(\0132/.com.ljsd.jieling.protocols.Ch" + - "ampionTwoEnemInfo\"p\n\037ChampionGetAllMyBet" + - "InfoResponse\022M\n\024championMyBetDetails\030\001 \003" + - "(\0132/.com.ljsd.jieling.protocols.Champion" + - "MyBetDetail\"(\n\030ChampionViewFinalRequest\022" + - "\014\n\004type\030\001 \001(\005\"o\n\031ChampionViewFinalRespon" + - "se\022R\n\026championBattlePairInfo\030\001 \003(\01322.com", - ".ljsd.jieling.protocols.ChampionBattlePa" + - "irInfoB\002H\001" + "\030\002 \001(\005\022\022\n\nmyBetCoins\030\003 \001(\005\022\022\n\nmyWinCoins" + + "\030\004 \001(\005\"o\n%ChanpionGetAllMyBattleHistoryR" + + "esponse\022F\n\renemyPairInfo\030\001 \003(\0132/.com.ljs" + + "d.jieling.protocols.ChampionTwoEnemInfo\"" + + "p\n\037ChampionGetAllMyBetInfoResponse\022M\n\024ch" + + "ampionMyBetDetails\030\001 \003(\0132/.com.ljsd.jiel" + + "ing.protocols.ChampionMyBetDetail\"(\n\030Cha" + + "mpionViewFinalRequest\022\014\n\004type\030\001 \001(\005\"o\n\031C" + + "hampionViewFinalResponse\022R\n\026championBatt" + + "lePairInfo\030\001 \003(\01322.com.ljsd.jieling.prot", + "ocols.ChampionBattlePairInfoB\002H\001" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { @@ -16686,7 +16659,7 @@ public final class ArenaInfoProto { internal_static_com_ljsd_jieling_protocols_ChampionMyBetDetail_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_com_ljsd_jieling_protocols_ChampionMyBetDetail_descriptor, - new java.lang.String[] { "EnemyPairInfo", "BetResult", "FightData", }); + new java.lang.String[] { "EnemyPairInfo", "BetResult", "MyBetCoins", "MyWinCoins", }); internal_static_com_ljsd_jieling_protocols_ChanpionGetAllMyBattleHistoryResponse_descriptor = getDescriptor().getMessageTypes().get(18); internal_static_com_ljsd_jieling_protocols_ChanpionGetAllMyBattleHistoryResponse_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 9a32e2377..66042de3e 100644 --- a/bloodybattle/src/main/java/com/ljsd/jieling/protocols/CommonProto.java +++ b/bloodybattle/src/main/java/com/ljsd/jieling/protocols/CommonProto.java @@ -81019,6 +81019,24 @@ public final class CommonProto { * */ int getTeamId(); + + // optional int32 position = 7; + /** + * optional int32 position = 7; + * + *
+     *位置 1 2 3 4 一次从左到右
+     * 
+ */ + boolean hasPosition(); + /** + * optional int32 position = 7; + * + *
+     *位置 1 2 3 4 一次从左到右
+     * 
+ */ + int getPosition(); } /** * Protobuf type {@code com.ljsd.jieling.protocols.ChampionBattlePairInfo} @@ -81101,6 +81119,11 @@ public final class CommonProto { teamId_ = input.readInt32(); break; } + case 56: { + bitField0_ |= 0x00000040; + position_ = input.readInt32(); + break; + } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { @@ -81354,6 +81377,30 @@ public final class CommonProto { return teamId_; } + // optional int32 position = 7; + public static final int POSITION_FIELD_NUMBER = 7; + private int position_; + /** + * optional int32 position = 7; + * + *
+     *位置 1 2 3 4 一次从左到右
+     * 
+ */ + public boolean hasPosition() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * optional int32 position = 7; + * + *
+     *位置 1 2 3 4 一次从左到右
+     * 
+ */ + public int getPosition() { + return position_; + } + private void initFields() { attackName_ = ""; defName_ = ""; @@ -81361,6 +81408,7 @@ public final class CommonProto { id_ = ""; roundTImes_ = 0; teamId_ = 0; + position_ = 0; } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -81392,6 +81440,9 @@ public final class CommonProto { if (((bitField0_ & 0x00000020) == 0x00000020)) { output.writeInt32(6, teamId_); } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + output.writeInt32(7, position_); + } getUnknownFields().writeTo(output); } @@ -81425,6 +81476,10 @@ public final class CommonProto { size += com.google.protobuf.CodedOutputStream .computeInt32Size(6, teamId_); } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(7, position_); + } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; @@ -81553,6 +81608,8 @@ public final class CommonProto { bitField0_ = (bitField0_ & ~0x00000010); teamId_ = 0; bitField0_ = (bitField0_ & ~0x00000020); + position_ = 0; + bitField0_ = (bitField0_ & ~0x00000040); return this; } @@ -81605,6 +81662,10 @@ public final class CommonProto { to_bitField0_ |= 0x00000020; } result.teamId_ = teamId_; + if (((from_bitField0_ & 0x00000040) == 0x00000040)) { + to_bitField0_ |= 0x00000040; + } + result.position_ = position_; result.bitField0_ = to_bitField0_; onBuilt(); return result; @@ -81645,6 +81706,9 @@ public final class CommonProto { if (other.hasTeamId()) { setTeamId(other.getTeamId()); } + if (other.hasPosition()) { + setPosition(other.getPosition()); + } this.mergeUnknownFields(other.getUnknownFields()); return this; } @@ -82065,6 +82129,55 @@ public final class CommonProto { return this; } + // optional int32 position = 7; + private int position_ ; + /** + * optional int32 position = 7; + * + *
+       *位置 1 2 3 4 一次从左到右
+       * 
+ */ + public boolean hasPosition() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * optional int32 position = 7; + * + *
+       *位置 1 2 3 4 一次从左到右
+       * 
+ */ + public int getPosition() { + return position_; + } + /** + * optional int32 position = 7; + * + *
+       *位置 1 2 3 4 一次从左到右
+       * 
+ */ + public Builder setPosition(int value) { + bitField0_ |= 0x00000040; + position_ = value; + onChanged(); + return this; + } + /** + * optional int32 position = 7; + * + *
+       *位置 1 2 3 4 一次从左到右
+       * 
+ */ + public Builder clearPosition() { + bitField0_ = (bitField0_ & ~0x00000040); + position_ = 0; + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:com.ljsd.jieling.protocols.ChampionBattlePairInfo) } @@ -82773,10 +82886,11 @@ public final class CommonProto { "\022:\n\tenemyInfo\030\002 \001(\0132\'.com.ljsd.jieling.p" + "rotocols.TeamOneInfo\022\016\n\006result\030\003 \001(\005\0228\n\t" + "fightData\030\004 \001(\0132%.com.ljsd.jieling.proto" + - "cols.FightData\"\202\001\n\026ChampionBattlePairInf" + + "cols.FightData\"\224\001\n\026ChampionBattlePairInf" + "o\022\022\n\nattackName\030\001 \001(\t\022\017\n\007defName\030\002 \001(\t\022\023", "\n\013fightResult\030\003 \001(\005\022\n\n\002id\030\004 \001(\t\022\022\n\nround" + - "TImes\030\005 \001(\005\022\016\n\006teamId\030\006 \001(\005B\002H\001" + "TImes\030\005 \001(\005\022\016\n\006teamId\030\006 \001(\005\022\020\n\010position\030" + + "\007 \001(\005B\002H\001" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { @@ -83322,7 +83436,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", "Id", "RoundTImes", "TeamId", }); + new java.lang.String[] { "AttackName", "DefName", "FightResult", "Id", "RoundTImes", "TeamId", "Position", }); return null; } }; 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 51ce9f406..17ad0d8b0 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 @@ -287,12 +287,7 @@ public class ArenaLogic { .build(); builder.setFightData(build); //数据互换 - byte[] snapRecord = CommonProto.FightData.newBuilder() - .setFightMaxTime(SArenaSetting.getSArenaSetting().getMostTime()) - .setFightSeed(seed) - .setHeroFightInfos(deffightTeamInfo) - .addMonsterList(fightTeamInfo) - .build().toByteArray(); + byte[] snapRecord = build.toByteArray(); arenaRecord.setFightData(snapRecord); return fightResult.getCheckResult()[0]; } 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 e2cab97b7..558d114f2 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 @@ -2,10 +2,12 @@ package com.ljsd.jieling.logic.championship; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; +import com.googlecode.protobuf.format.JsonFormat; import com.ljsd.jieling.config.clazzStaticCfg.CommonStaticConfig; import com.ljsd.jieling.core.FunctionIdEnum; import com.ljsd.jieling.core.GlobalsDef; import com.ljsd.jieling.core.HandlerLogicThread; +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; @@ -80,6 +82,7 @@ public class ChampionshipLogic { }else{ arenaRecodeds = RedisUtil.getInstence().lGet(RedisKey.CHAMPION_FINAL4_JOIN_IDS, "", 0, -1); } + SChampionshipSetting sChampionshipSetting = STableManager.getFigureConfig(CommonStaticConfig.class).getsChampionshipSetting(); List arenaIds = new ArrayList<>(arenaRecodeds); List arenaRecords = RedisUtil.getInstence().getMapEntrys(RedisKey.CHAMPION_ARENA_RECORD, "", arenaIds, ArenaRecord.class); Map config = STableManager.getConfig(SArenaRobotConfig.class); @@ -91,13 +94,17 @@ public class ChampionshipLogic { String attackName = getRoleNameById(attackId, config); String defName = getRoleNameById(defUid, config); int fightResult = arenaRecord.getFightResult(); - if (curArenaRecordIds.contains(arenaRecord.getId()) && progress % 10 % 4 != 0) { + if (arenaRecord.getRoundTims() == roundTimes && progress % 10 % 4 != 3) { + fightResult = -1; + } + if(fightResult == -2){ fightResult = -1; } int teamId=1; if(type == 1){ teamId = memberPerOfTeam.get(attackId) +1; } + builder.addChampionBattlePairInfo(CommonProto.ChampionBattlePairInfo.newBuilder() .setAttackName(attackName) .setDefName(defName) @@ -105,6 +112,7 @@ public class ChampionshipLogic { .setRoundTImes(arenaRecord.getRoundTims()) .setTeamId(teamId) .setId(arenaRecord.getId()) + .setPosition(arenaRecord.getNums()+1) ); } MessageUtil.sendMessage(iSession,1, MessageTypeProto.MessageType.CHAMPION_VIEW_FINAL_RESPONSE_VALUE,builder.build(),true); @@ -248,6 +256,17 @@ public class ChampionshipLogic { */ public static void start() { LOGGER.info("the champion start..."); + Set> arenaRankInfoInRedis = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.CHAMPION_RANK, Integer.toString(1), 0, -1); + Map robotConfigMap = STableManager.getConfig(SArenaRobotConfig.class); + Set joinUids = new HashSet<>(128); + for(ZSetOperations.TypedTuple item : arenaRankInfoInRedis){ + String uidStr = item.getValue(); + int uid = Integer.parseInt(uidStr); + if(!robotConfigMap.containsKey(uid)){ + joinUids.add(uid); + } + } + clearReidsWhenEnd(joinUids); SChampionshipSetting sChampionshipSetting = STableManager.getFigureConfig(CommonStaticConfig.class).getsChampionshipSetting(); int championshipPlayer = sChampionshipSetting.getChampionshipPlayer(); int curSeason = ArenaLogic.getInstance().getCurSeason(); @@ -297,7 +316,7 @@ public class ChampionshipLogic { } int trialsGroup = sChampionshipSetting.getTrialsGroup(); int nums = championshipPlayer / trialsGroup; - List> memberOfTeamOfGroup = getMemberOfTeamOfGroup(memberInfos, nums); + List> memberOfTeamOfGroup = getMemberOfTeamOfGroup(memberInfos, nums,false); String key = RedisUtil.getInstence().getKey(RedisKey.CHAMPION_JOIN, ""); RedisUtil.getInstence().del(key, RedisUtil.getInstence().getKey(RedisKey.CHAMPION_RANK, "")); RedisUtil.getInstence().updateZsetScores(RedisKey.CHAMPION_RANK,"",arenaRankInfoForChampion); @@ -328,6 +347,7 @@ public class ChampionshipLogic { 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); + Set joinUids = new HashSet<>(128); for(ZSetOperations.TypedTuple item : arenaRankInfo){ String uidStr = item.getValue(); int uid = Integer.parseInt(uidStr); @@ -341,45 +361,37 @@ public class ChampionshipLogic { String content = SErrorCodeEerverConfig.getI18NMessage("champion_reward_txt",new Object[]{rank++}); MailLogic.getInstance().sendMail(user.getId(),title,content,ItemUtil.getMailReward(sChampionshipReward.getSeasonReward()),nowTime, Global.MAIL_EFFECTIVE_TIME); } + clearReidsWhenEnd(joinUids); } /** - * 巅峰赛开始准备工作 - * 1.数据准备:制作参与巅峰赛 - * 2.告知前端现在是准备阶段,并告诉我是否加入了巅峰赛 + * 用于测试使用 */ public static void whenStart() throws Exception { - /* TimeControllerOfFunction timeControllerOfFunction = GlobalDataManaager.getInstance().getTimeControllerOfFunctionByFunctinoType(FunctionIdEnum.TopBattle); - if( null == timeControllerOfFunction){ - progress = -1; - return; - } - String key = RedisUtil.getInstence().getKey(RedisKey.CHAMPION_JOIN, ""); - Type type = new TypeToken>() { - }.getType(); - Object championJoins = RedisUtil.getInstence().get(key);*/ - - // start(); - /* for(int i=1;i<8;i++){ + start(); + for(int i=1;i<8;i++){ roundTimes=i; selectToBattle(); - switchBet(); + switchBet(47); scoreToRedis(); } selectToJoinFinal(); schedule=2; - for(int i=8;i<12;i++){ + for(int i=8;i<13;i++){ roundTimes=i; selectToBattle(); - switchBet(); + switchBet(47); scoreToRedis(); - }*/ + } + + progress=253; + endTime=1576665312; } @@ -391,7 +403,7 @@ public class ChampionshipLogic { * @param groupNums 分成几组 * @return */ - private static List> getMemberOfTeamOfGroup(List memberInfoList,int groupNums){ + private static List> getMemberOfTeamOfGroup(List memberInfoList,int groupNums,boolean teamUpdate){ Collections.shuffle(memberInfoList); int index=0; List> memberOfTeamTmp = new ArrayList<>(); @@ -402,7 +414,9 @@ public class ChampionshipLogic { for(MemberInfo memberInfo : memberInfoList){ int teamId = (index++ % groupNums); memberOfTeamTmp.get(teamId).add(memberInfo.getUid()); - if(schedule == 1){ + if(teamUpdate){ + memberInfo.setTeamId(teamId*100); + }else{ memberInfo.setTeamId(teamId); } } @@ -422,23 +436,18 @@ public class ChampionshipLogic { int uid = session.getUid(); //组装数据 int myRank = RedisUtil.getInstence().getZSetreverseRank(RedisKey.CHAMPION_RANK, "", Integer.toString(uid)).intValue(); - String myCurJoinBattleId = getMyCurJoinBattleId(uid); ArenaInfoProto.ChampionGetInfoResponse.Builder builder = ArenaInfoProto.ChampionGetInfoResponse.newBuilder().setProgress(progress).setEndTime(endTime).setMyrank(myRank); if(myRank!=-1){ MemberInfo memberInfo = RedisUtil.getInstence().getMapEntry(RedisKey.CHAMPION_JOIN, "", Integer.toString(uid), MemberInfo.class); builder.setMyscore(memberInfo.getScore()); - } - if(!StringUtil.isEmpty(myCurJoinBattleId)){ builder.setJoinState(1); - ArenaRecord arenaRecord =RedisUtil.getInstence().getMapValue(RedisKey.CHAMPION_ARENA_RECORD,"",myCurJoinBattleId,ArenaRecord.class); + String key = RedisUtil.getInstence().getKey(RedisKey.CHAMPION_MY_BATTLLE_IDS, Integer.toString(uid)); + Object latestKey = RedisUtil.getInstence().lGetIndex(key, -1); + ArenaRecord arenaRecord = RedisUtil.getInstence().getMapValue(RedisKey.CHAMPION_ARENA_RECORD, "", latestKey.toString(), ArenaRecord.class); int enemyId = arenaRecord.getDefUid(); int fightResult = arenaRecord.getFightResult(); - if(uid == enemyId){ - enemyId = arenaRecord.getAttackId(); - fightResult=1^fightResult; - } CommonProto.ChampionBattleInfo.Builder builder1 = CommonProto.ChampionBattleInfo.newBuilder(); - if(progress%10%4 != 0){ + if(roundTimes == arenaRecord.getRoundTims() && (progress%10%4 != 3 || fightResult==-2)){ fightResult =-1; } if(fightResult!=-1){ @@ -467,9 +476,12 @@ public class ChampionshipLogic { ArenaRecord arenaRecord = RedisUtil.getInstence().getMapValue(RedisKey.CHAMPION_ARENA_RECORD, "", selectIdForRedis, ArenaRecord.class); if(type == 0){ int fightResult=arenaRecord.getFightResult(); - if(progress%10%4 != 3){ + if(arenaRecord.getRoundTims() == roundTimes && progress%10%4 != 3){ fightResult =-1; } + if(fightResult == -2){ + fightResult=-1; + } int myGuessID = 0; String guessUidStr = RedisUtil.getInstence().getMapEntry(RedisKey.CHAMPION_BET_MINE, Integer.toString(uid), selectIdForRedis, String.class); if(!StringUtil.isEmpty(guessUidStr)) { @@ -552,7 +564,7 @@ public class ChampionshipLogic { throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE); } - List memberIds = getMermberTeam().get(memberInfo.getTeamId()); + List memberIds = getMermberTeam().get(memberInfo.getTeamId()%100); ArenaInfoProto.ChampionGetWorldRankResponse.Builder builder = ArenaInfoProto.ChampionGetWorldRankResponse.newBuilder(); List arenaRankMemberInfo = new ArrayList<>(8); Map uidRankMap = new HashMap<>(); @@ -583,36 +595,31 @@ public class ChampionshipLogic { //查看我的战斗记录 public static void viewAllMyBattleInfo(ISession session) throws Exception { int uid = session.getUid(); - Map mapValues = RedisUtil.getInstence().getMapValues(RedisKey.CHAMPION_MY_BATTLLE_IDS, Integer.toString(uid), String.class, Integer.class); - List ids = new ArrayList<>(mapValues.keySet()); - List myArenaRecordInfos = RedisUtil.getInstence().getMapEntrys(RedisKey.CHAMPION_ARENA_RECORD, "", ids, ArenaRecord.class); + List myArenaIds = RedisUtil.getInstence().lGet(RedisKey.CHAMPION_MY_BATTLLE_IDS, Integer.toString(uid), 0, -1); ArenaInfoProto.ChanpionGetAllMyBattleHistoryResponse.Builder builder = ArenaInfoProto.ChanpionGetAllMyBattleHistoryResponse.newBuilder(); - Map robotConfigMap = STableManager.getConfig(SArenaRobotConfig.class); - for(ArenaRecord arenaRecord : myArenaRecordInfos){ - int enemyId = arenaRecord.getDefUid(); - if(arenaRecord.getDefUid() == uid){ - enemyId = arenaRecord.getAttackId(); - } - - int fightResult = arenaRecord.getFightResult(); - if(roundTimes == arenaRecord.getRoundTims()){ - if(progress%10%4 != 0){ + if(myArenaIds!=null){ + List ids = new ArrayList<>(myArenaIds); + List myArenaRecordInfos = RedisUtil.getInstence().getMapEntrys(RedisKey.CHAMPION_ARENA_RECORD, "", ids, ArenaRecord.class); + Map robotConfigMap = STableManager.getConfig(SArenaRobotConfig.class); + for(ArenaRecord arenaRecord : myArenaRecordInfos){ + int enemyId = arenaRecord.getDefUid(); + int fightResult = arenaRecord.getFightResult(); + if(roundTimes == arenaRecord.getRoundTims()){ + if(progress%10%4 != 0 || fightResult==-2){ + fightResult =-1; + } + } + if(fightResult == -2){ fightResult =-1; } + int enemyType = robotConfigMap.containsKey(enemyId)?0:1; + CommonProto.ArenaEnemy arenaEnemy = ArenaLogic.getInstance().getArenaEnemy(enemyId, enemyType); + ArenaInfoProto.ChampionTwoEnemInfo build = ArenaInfoProto.ChampionTwoEnemInfo.newBuilder().setBlueEnemy(arenaEnemy).setRoundTimes(arenaRecord.getRoundTims()) + .setFightResult(fightResult) + .setId(arenaRecord.getId()) + .build(); + builder.addEnemyPairInfo(build); } - if(fightResult == -2){ - fightResult =-1; - } - if(fightResult!=-1 && enemyId!=arenaRecord.getDefUid()){ - fightResult = 1^0; - } - int enemyType = robotConfigMap.containsKey(enemyId)?0:1; - CommonProto.ArenaEnemy arenaEnemy = ArenaLogic.getInstance().getArenaEnemy(enemyId, enemyType); - ArenaInfoProto.ChampionTwoEnemInfo build = ArenaInfoProto.ChampionTwoEnemInfo.newBuilder().setBlueEnemy(arenaEnemy).setRoundTimes(arenaRecord.getRoundTims()) - .setFightResult(fightResult) - .setId(arenaRecord.getId()) - .build(); - builder.addEnemyPairInfo(build); } MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.CHAMPION_GET_MYHISTORY_RESPONSE_VALUE,builder.build(),true); } @@ -659,8 +666,6 @@ public class ChampionshipLogic { Map config = STableManager.getConfig(SArenaRobotConfig.class); if(config.containsKey(uid)){ - SArenaRobotConfig sArenaRobotConfig = config.get(uid); - return; } MemberInfo memberInfo = joinMembers.get(uid); @@ -770,7 +775,7 @@ public class ChampionshipLogic { } ArenaRecord arenaRecord = RedisUtil.getInstence().getMapValue(RedisKey.CHAMPION_ARENA_RECORD, "", selectUid, ArenaRecord.class); if(arenaRecord.getAttackId()!=winUid && arenaRecord.getDefUid()!=winUid){ - LOGGER.error("the uid={} guess winner={} is not exists",uid,winUid); + LOGGER.error("the uid={} guess winner={} is not exists,recordId={}",uid,winUid,arenaRecord.getId()); throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE); } User user = UserManager.getUser(uid); @@ -794,14 +799,33 @@ public class ChampionshipLogic { /** * 回收资源 */ - public static void clearReidsWhenEnd(){ + public static void clearReidsWhenEnd( Set joinUids){ List delKeys = new ArrayList<>(); String betAllKey = RedisUtil.getInstence().getKey(RedisKey.CHAMPION_BET_ALL, ""); Set betDetails = RedisUtil.getInstence().getZset(betAllKey, 0, -1); for(String betInfo : betDetails){ + Map userDeatails = RedisUtil.getInstence().getMapValues(RedisKey.CHAMPION_BET_DETAIL, betInfo, Integer.class, Integer.class); + userDeatails.keySet().forEach(uid->{ + delKeys.add(RedisUtil.getInstence().getKey(RedisKey.CHAMPION_BET_MINE,Integer.toString(uid))); + }); delKeys.add(RedisUtil.getInstence().getKey(RedisKey.CHAMPION_BET_DETAIL, betInfo)); } delKeys.add(betAllKey); + delKeys.add( RedisUtil.getInstence().getKey(RedisKey.CHAMPION_ARENA_RECORD, "")); + delKeys.add( RedisUtil.getInstence().getKey(RedisKey.CHAMPION_CHOSE_TEAM_INFO, "")); + delKeys.add( RedisUtil.getInstence().getKey(RedisKey.CHAMPION_CUR_JOIN_IDS, "")); + delKeys.add( RedisUtil.getInstence().getKey(RedisKey.CHAMPION_JOIN, "")); + delKeys.add( RedisUtil.getInstence().getKey(RedisKey.CHAMPION_CUR_BETID, "")); + delKeys.add( RedisUtil.getInstence().getKey(RedisKey.CHAMPION_FINAL32_JOIN_IDS, "")); + delKeys.add( RedisUtil.getInstence().getKey(RedisKey.CHAMPION_FINAL4_JOIN_IDS, "")); + delKeys.add( RedisUtil.getInstence().getKey(RedisKey.CHAMPION_FINAL_TEAM_INFO, "")); + + //我的历史结果 + joinUids.forEach(uid->{ + delKeys.add( RedisUtil.getInstence().getKey(RedisKey.CHAMPION_MY_BATTLLE_IDS, Integer.toString(uid))); + }); + RedisUtil.getInstence().del(delKeys.toArray(new String[0])); + } /** @@ -839,6 +863,7 @@ public class ChampionshipLogic { drop[0][0] = arenaItem[0]; drop[0][1] = mineWinCoins; ItemUtil.drop(user, drop, BIReason.CHAMPIION_BET_WIN_REWARD); + MongoUtil.getLjsdMongoTemplate().lastUpdate(); } }); ProtocolsManager.getInstance().updateAyncWorker(ayyncWorker); @@ -862,23 +887,22 @@ public class ChampionshipLogic { if(!betHistorys.isEmpty()){ List ids = new ArrayList<>(betHistorys.keySet()); List arenaRecords = RedisUtil.getInstence().getMapEntrys(RedisKey.CHAMPION_ARENA_RECORD, "", ids, ArenaRecord.class); - String selectIdForRedis = getSelectIdForRedis(); Map arenaRobotConfigMap = STableManager.getConfig(SArenaRobotConfig.class); for(ArenaRecord arenaRecord: arenaRecords){ int attactkUidType = arenaRobotConfigMap.containsKey(arenaRecord.getAttackId())?0:1; - int defUidType = arenaRobotConfigMap.containsKey(arenaRecord.getAttackId())?0:1; + int defUidType = arenaRobotConfigMap.containsKey(arenaRecord.getDefUid())?0:1; CommonProto.ArenaEnemy attackEnemy = ArenaLogic.getInstance().getArenaEnemy(arenaRecord.getAttackId(), attactkUidType); CommonProto.ArenaEnemy defEnemy = ArenaLogic.getInstance().getArenaEnemy(arenaRecord.getDefUid(), defUidType); int fightResult = arenaRecord.getFightResult(); int guessState = 3; - if(arenaRecord.getId().equals(selectIdForRedis)){ - if(progress%10%4!=0){ + if(arenaRecord.getRoundTims()==roundTimes){ + if(progress%10%4!=3){ fightResult=-1; } - if(progress%10%4 == 4){ + if(progress%10%4 == 0){ guessState=0; } - if(progress%10%4 == 3){ + if(progress%10%4 == 1 || progress%10%4 == 2){ guessState=1; } } @@ -886,20 +910,31 @@ public class ChampionshipLogic { fightResult =-1; } ArenaInfoProto.ChampionMyBetDetail.Builder betDetailBuilder = ArenaInfoProto.ChampionMyBetDetail.newBuilder(); + String guessUid = betHistorys.get(arenaRecord.getId()); + Integer mineBetCoins = RedisUtil.getInstence().getMapEntry(RedisKey.CHAMPION_BET_DETAIL, arenaRecord.getId() + ":" + guessUid, Integer.toString(uid), Integer.class); + int myWinCoins =0; if(fightResult>=0){ int winner = arenaRecord.getAttackId(); + int loseer = arenaRecord .getDefUid(); if(fightResult == 0){ winner = arenaRecord.getDefUid(); + loseer = arenaRecord.getAttackId(); } - String guessUid = betHistorys.get(arenaRecord.getId()); + if(!StringUtil.isEmpty(guessUid) && guessUid.equals(winner)){ guessState = 2; + Double winnerCoins = RedisUtil.getInstence().getZSetScore(RedisKey.CHAMPION_BET_ALL, "", arenaRecord.getId() + ":" + winner); + Double loseCoins = RedisUtil.getInstence().getZSetScore(RedisKey.CHAMPION_BET_ALL, "", arenaRecord.getId() + ":" + loseer); + myWinCoins = (int)(winnerCoins/(winnerCoins+loseCoins)*mineBetCoins); } - // betDetailBuilder.setFightData(CommonProto.FightData.parseFrom(arenaRecord.getFightData())); } - builder.addChampionMyBetDetails(betDetailBuilder.setBetResult(guessState).setEnemyPairInfo( - ArenaInfoProto.ChampionTwoEnemInfo.newBuilder().setRedEnemy(attackEnemy).setBlueEnemy(defEnemy).setFightResult(fightResult) - )); + + builder.addChampionMyBetDetails(betDetailBuilder.setBetResult(guessState) + .setEnemyPairInfo(ArenaInfoProto.ChampionTwoEnemInfo.newBuilder().setRedEnemy(attackEnemy).setBlueEnemy(defEnemy).setFightResult(fightResult).setId(arenaRecord.getId()).setRoundTimes(arenaRecord.getRoundTims())) + .setMyBetCoins(mineBetCoins) + .setMyWinCoins(myWinCoins) + + ); } } @@ -976,6 +1011,12 @@ public class ChampionshipLogic { } }); } + int times = 0; + int length = possibleJoin.size(); + if(length<8){ + length=8; + } + length = length / 8; for(int i=0;i10){ + arenaRecord.setNums(times++); + }else{ + arenaRecord.setNums(times++%length); + } arenaRecordMap.put(arenaRecord.getId(),arenaRecord); } @@ -1002,6 +1048,7 @@ public class ChampionshipLogic { if(schedule == 2){ if(arenaRecordIds.size()>=4){ RedisUtil.getInstence().lSet(RedisKey.CHAMPION_FINAL32_JOIN_IDS,"",arenaRecordIds); + LOGGER.info("the rountTimes={},the size={}",roundTimes,arenaRecordIds.size()); }else{ RedisUtil.getInstence().lSet(RedisKey.CHAMPION_FINAL4_JOIN_IDS,"",arenaRecordIds); } @@ -1012,10 +1059,13 @@ public class ChampionshipLogic { int defUid = arenaRecord.getDefUid(); int attackId = arenaRecord.getAttackId(); if(!robotConfigMap.containsKey(defUid)){ - RedisUtil.getInstence().putMapEntry(RedisKey.CHAMPION_MY_BATTLLE_IDS, Integer.toString(defUid),id, 0); + String key = RedisUtil.getInstence().getKey(RedisKey.CHAMPION_MY_BATTLLE_IDS, Integer.toString(defUid)); + RedisUtil.getInstence().lSet(key,id); } if(!robotConfigMap.containsKey(attackId)){ - RedisUtil.getInstence().putMapEntry(RedisKey.CHAMPION_MY_BATTLLE_IDS, Integer.toString(attackId),id, 0); + String key = RedisUtil.getInstence().getKey(RedisKey.CHAMPION_MY_BATTLLE_IDS, Integer.toString(attackId)); + RedisUtil.getInstence().lSet(key,id); + } }); @@ -1058,7 +1108,7 @@ public class ChampionshipLogic { } } RedisUtil.getInstence().updateZsetScores(RedisKey.CHAMPION_RANK,"",arenaRankInfoForChampion); - List> finalmemberOfTeam = getMemberOfTeamOfGroup(canJoinFinal,knockoutGroup); + List> finalmemberOfTeam = getMemberOfTeamOfGroup(canJoinFinal,knockoutGroup,true); for(int i=0;i { +/* InnerMessageUtil.broadcastWithRandom(user1 -> { if(user1==null){ return; } @@ -1093,10 +1143,32 @@ public class ChampionshipLogic { return; } MissionEventDistributor.requestStart(); - ItemUtil.drop(user1,itemNum, BIReason.CHAMPIION_BET_REWARD); + CommonProto.Drop.Builder drop = + LOGGER.info("drop--->>>>>>>>> uid ={},drop={}",session.getUid(), JsonFormat.printToString(drop.build())); MissionEventDistributor.requestEnd(session,true); - }, new LinkedList<>(OnlineUserManager.sessionMap.keySet()),1); + MongoUtil.getLjsdMongoTemplate().lastUpdate(); + }, new LinkedList<>(OnlineUserManager.sessionMap.keySet()),1);*/ + SGlobalSystemConfig sGlobalSystemConfig = STableManager.getConfig(SGlobalSystemConfig.class).get(functionId); + OnlineUserManager.sessionMap.values().forEach(session->{ + try { + User user = UserManager.getUser(session.getUid()); + AyyncWorker ayyncWorker = new AyyncWorker(user, true, new AyncWorkerRunnable() { + @Override + public void work(User user) throws Exception { + if(!HandlerLogicThread.checkOpen(user, sGlobalSystemConfig)){ + return; + } + ItemUtil.drop(user, itemNum, BIReason.CHAMPIION_BET_REWARD); + MongoUtil.getLjsdMongoTemplate().lastUpdate(); + } + }); + ProtocolsManager.getInstance().updateAyncWorker(ayyncWorker); + } catch (Exception e) { + e.printStackTrace(); + } + }); + snapPlayFightInfo(); selectBetTeam(); } @@ -1106,6 +1178,7 @@ public class ChampionshipLogic { public static void getWorldRankByPage(ISession session,int type,int page) throws Exception { if(type == 1){ getMyTeamInfo(session); + return; } if (page == 0) { page = 1; @@ -1198,6 +1271,7 @@ public class ChampionshipLogic { .setRank(start) .setTotalForce(totalForce) .setHeadFrame(playerInfoManager.getHeadFrame()) + .setScore(score) .build(); return builder.setPersonInfo(personInfoBuild) .build(); @@ -1225,9 +1299,21 @@ public class ChampionshipLogic { }else {//决赛 int totalWiner =sChampionshipSetting.getChampionshipPlayer()/ sChampionshipSetting.getTrialsGroup() * sChampionshipSetting.getTrialsGroupWinner(); if(diff>totalWiner){ + if(isServerStart){ + schedule=2; + progress= 253; + endTime = (int)( startTime/1000 + (round-1)*duration + getDuratimeByProgressState(3)); + + } + return; } if(Math.pow(2,diff)>=totalWiner){ + if(isServerStart){ + schedule=2; + progress= 253; + endTime = (int)( startTime/1000 + (round-1)*duration + getDuratimeByProgressState(3)); + } return; } @@ -1251,7 +1337,7 @@ public class ChampionshipLogic { selectToBattle(); } if(progress%10%4==1){ //竞猜阶段 后台自动运行战斗 - switchBet(); + switchBet(timeControllerOfFunction.getId()); }else if(progress%10%4==3){ //结算阶段 //等待玩家数据分数入redis scoreToRedis(); diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/ArenaRecord.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/ArenaRecord.java index 32b24bb7e..adab724b9 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/ArenaRecord.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/dao/ArenaRecord.java @@ -24,6 +24,8 @@ public class ArenaRecord { private int roundTims; //决赛阶段赋值 十位表示队伍id 个位表示第几轮 + private int nums =1; + public ArenaRecord(){} public int getAttackId() { @@ -105,4 +107,12 @@ public class ArenaRecord { public void setRoundTims(int roundTims) { this.roundTims = roundTims; } + + public int getNums() { + return nums; + } + + public void setNums(int nums) { + this.nums = nums; + } } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/thread/task/RetrySendIndicationThread.java b/serverlogic/src/main/java/com/ljsd/jieling/thread/task/RetrySendIndicationThread.java index a054ba15f..8ab6f4c4c 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/thread/task/RetrySendIndicationThread.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/thread/task/RetrySendIndicationThread.java @@ -27,7 +27,7 @@ public class RetrySendIndicationThread extends Thread{ try { doWork(); Thread.sleep(20); - } catch (InterruptedException e) { + } catch (Exception e) { e.printStackTrace(); } }