back_recharge
lvxinran 2020-03-27 14:04:47 +08:00
commit 6b9ac180e8
39 changed files with 1553 additions and 1195 deletions

View File

@ -77694,6 +77694,16 @@ public final class CommonProto {
*/
com.ljsd.jieling.protocols.CommonProto.UserMissionInfoOrBuilder getTasksOrBuilder(
int index);
// optional int32 refreshTime = 3;
/**
* <code>optional int32 refreshTime = 3;</code>
*/
boolean hasRefreshTime();
/**
* <code>optional int32 refreshTime = 3;</code>
*/
int getRefreshTime();
}
/**
* Protobuf type {@code com.ljsd.jieling.protocols.RefreshTask}
@ -77759,6 +77769,11 @@ public final class CommonProto {
tasks_.add(input.readMessage(com.ljsd.jieling.protocols.CommonProto.UserMissionInfo.PARSER, extensionRegistry));
break;
}
case 24: {
bitField0_ |= 0x00000002;
refreshTime_ = input.readInt32();
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
@ -77862,9 +77877,26 @@ public final class CommonProto {
return tasks_.get(index);
}
// optional int32 refreshTime = 3;
public static final int REFRESHTIME_FIELD_NUMBER = 3;
private int refreshTime_;
/**
* <code>optional int32 refreshTime = 3;</code>
*/
public boolean hasRefreshTime() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>optional int32 refreshTime = 3;</code>
*/
public int getRefreshTime() {
return refreshTime_;
}
private void initFields() {
type_ = 0;
tasks_ = java.util.Collections.emptyList();
refreshTime_ = 0;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
@ -77884,6 +77916,9 @@ public final class CommonProto {
for (int i = 0; i < tasks_.size(); i++) {
output.writeMessage(2, tasks_.get(i));
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeInt32(3, refreshTime_);
}
getUnknownFields().writeTo(output);
}
@ -77901,6 +77936,10 @@ public final class CommonProto {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, tasks_.get(i));
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(3, refreshTime_);
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
@ -78026,6 +78065,8 @@ public final class CommonProto {
} else {
tasksBuilder_.clear();
}
refreshTime_ = 0;
bitField0_ = (bitField0_ & ~0x00000004);
return this;
}
@ -78067,6 +78108,10 @@ public final class CommonProto {
} else {
result.tasks_ = tasksBuilder_.build();
}
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000002;
}
result.refreshTime_ = refreshTime_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
@ -78112,6 +78157,9 @@ public final class CommonProto {
}
}
}
if (other.hasRefreshTime()) {
setRefreshTime(other.getRefreshTime());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
@ -78428,6 +78476,39 @@ public final class CommonProto {
return tasksBuilder_;
}
// optional int32 refreshTime = 3;
private int refreshTime_ ;
/**
* <code>optional int32 refreshTime = 3;</code>
*/
public boolean hasRefreshTime() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
* <code>optional int32 refreshTime = 3;</code>
*/
public int getRefreshTime() {
return refreshTime_;
}
/**
* <code>optional int32 refreshTime = 3;</code>
*/
public Builder setRefreshTime(int value) {
bitField0_ |= 0x00000004;
refreshTime_ = value;
onChanged();
return this;
}
/**
* <code>optional int32 refreshTime = 3;</code>
*/
public Builder clearRefreshTime() {
bitField0_ = (bitField0_ & ~0x00000004);
refreshTime_ = 0;
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:com.ljsd.jieling.protocols.RefreshTask)
}
@ -89691,45 +89772,46 @@ public final class CommonProto {
"serverId\030\005 \001(\005\022\r\n\005level\030\006 \001(\005\022\014\n\004rank\030\007 " +
"\001(\005\022\r\n\005score\030\010 \001(\005\"H\n\026LuckWheelRewardPos" +
"Info\022\013\n\003pos\030\001 \001(\005\022\016\n\006luckId\030\002 \001(\005\022\021\n\tluc" +
"kTimes\030\003 \001(\005\"W\n\013RefreshTask\022\014\n\004type\030\001 \001(" +
"kTimes\030\003 \001(\005\"l\n\013RefreshTask\022\014\n\004type\030\001 \001(" +
"\005\022:\n\005tasks\030\002 \003(\0132+.com.ljsd.jieling.prot" +
"ocols.UserMissionInfo\"\221\001\n\021MainLevelRankI",
"nfo\022\013\n\003uid\030\001 \001(\005\022\r\n\005level\030\002 \001(\005\022\014\n\004name\030" +
"\003 \001(\t\022\017\n\007fightId\030\004 \001(\005\022\014\n\004head\030\005 \001(\005\022\014\n\004" +
"rank\030\006 \001(\005\022\022\n\ntotalForce\030\007 \001(\005\022\021\n\theadFr" +
"ame\030\010 \001(\005\"B\n\017ChampionBetInfo\022\n\n\002id\030\001 \001(\t" +
"\022\020\n\010redCoins\030\002 \001(\005\022\021\n\tblueCoins\030\003 \001(\005\"\323\001" +
"\n\022ChampionBattleInfo\0227\n\006myInfo\030\001 \001(\0132\'.c" +
"om.ljsd.jieling.protocols.TeamOneInfo\022:\n" +
"\tenemyInfo\030\002 \001(\0132\'.com.ljsd.jieling.prot" +
"ocols.TeamOneInfo\022\016\n\006result\030\003 \001(\005\0228\n\tfig" +
"htData\030\004 \001(\0132%.com.ljsd.jieling.protocol",
"s.FightData\"\367\001\n\026ChampionBattlePairInfo\022;" +
"\n\nattackInfo\030\001 \001(\0132\'.com.ljsd.jieling.pr" +
"otocols.TeamOneInfo\0228\n\007defInfo\030\002 \001(\0132\'.c" +
"om.ljsd.jieling.protocols.TeamOneInfo\022\023\n" +
"\013fightResult\030\003 \001(\005\022\n\n\002id\030\004 \001(\t\022\022\n\nroundT" +
"Imes\030\005 \001(\005\022\016\n\006teamId\030\006 \001(\005\022\020\n\010position\030\007" +
" \001(\005\022\017\n\007isGUess\030\010 \001(\005\"q\n\nRedPackage\022\020\n\010u" +
"serName\030\001 \001(\t\022\r\n\005redId\030\002 \001(\005\022\r\n\005isGet\030\003 " +
"\001(\005\022\020\n\010getCount\030\004 \001(\005\022\017\n\007redType\030\005 \001(\005\022\020" +
"\n\010sendTime\030\006 \001(\005\"\211\001\n\014RedOneDetail\022\013\n\003uid",
"\030\001 \001(\005\022\014\n\004head\030\002 \001(\005\022\021\n\theadFrame\030\003 \001(\005\022" +
"\014\n\004name\030\004 \001(\t\022\014\n\004time\030\005 \001(\005\022\r\n\005count\030\006 \001" +
"(\005\022\016\n\006itemId\030\007 \001(\005\022\020\n\010position\030\010 \001(\005\"Z\n\030" +
"ExpeditionSimpleBossInfo\022\017\n\007heroTid\030\001 \001(" +
"\005\022\014\n\004star\030\002 \001(\005\022\r\n\005level\030\003 \001(\005\022\020\n\010remain" +
"Hp\030\004 \001(\001\"\202\001\n\022ExpeditionTeamInfo\022B\n\004hero\030" +
"\001 \003(\01324.com.ljsd.jieling.protocols.Exped" +
"itionSimpleBossInfo\022\024\n\014PokemonInfos\030\002 \003(" +
"\005\022\022\n\ntotalForce\030\003 \001(\005\"\251\001\n\022ExpeditionNode" +
"Info\022\016\n\006sortId\030\001 \001(\005\022\013\n\003lay\030\002 \001(\005\022\014\n\004typ",
"e\030\003 \001(\005\022D\n\014bossTeaminfo\030\004 \001(\0132..com.ljsd" +
".jieling.protocols.ExpeditionTeamInfo\022\r\n" +
"\005state\030\005 \001(\005\022\023\n\013holyEquipID\030\006 \003(\005\"<\n\030Exp" +
"editionSimpleHeroInfo\022\016\n\006heroId\030\001 \001(\t\022\020\n" +
"\010remainHp\030\002 \001(\001\"/\n\017ExpeditionEquip\022\n\n\002id" +
"\030\001 \001(\t\022\020\n\010equiptId\030\002 \001(\005B\002H\001"
"ocols.UserMissionInfo\022\023\n\013refreshTime\030\003 \001",
"(\005\"\221\001\n\021MainLevelRankInfo\022\013\n\003uid\030\001 \001(\005\022\r\n" +
"\005level\030\002 \001(\005\022\014\n\004name\030\003 \001(\t\022\017\n\007fightId\030\004 " +
"\001(\005\022\014\n\004head\030\005 \001(\005\022\014\n\004rank\030\006 \001(\005\022\022\n\ntotal" +
"Force\030\007 \001(\005\022\021\n\theadFrame\030\010 \001(\005\"B\n\017Champi" +
"onBetInfo\022\n\n\002id\030\001 \001(\t\022\020\n\010redCoins\030\002 \001(\005\022" +
"\021\n\tblueCoins\030\003 \001(\005\"\323\001\n\022ChampionBattleInf" +
"o\0227\n\006myInfo\030\001 \001(\0132\'.com.ljsd.jieling.pro" +
"tocols.TeamOneInfo\022:\n\tenemyInfo\030\002 \001(\0132\'." +
"com.ljsd.jieling.protocols.TeamOneInfo\022\016" +
"\n\006result\030\003 \001(\005\0228\n\tfightData\030\004 \001(\0132%.com.",
"ljsd.jieling.protocols.FightData\"\367\001\n\026Cha" +
"mpionBattlePairInfo\022;\n\nattackInfo\030\001 \001(\0132" +
"\'.com.ljsd.jieling.protocols.TeamOneInfo" +
"\0228\n\007defInfo\030\002 \001(\0132\'.com.ljsd.jieling.pro" +
"tocols.TeamOneInfo\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\006teamI" +
"d\030\006 \001(\005\022\020\n\010position\030\007 \001(\005\022\017\n\007isGUess\030\010 \001" +
"(\005\"q\n\nRedPackage\022\020\n\010userName\030\001 \001(\t\022\r\n\005re" +
"dId\030\002 \001(\005\022\r\n\005isGet\030\003 \001(\005\022\020\n\010getCount\030\004 \001" +
"(\005\022\017\n\007redType\030\005 \001(\005\022\020\n\010sendTime\030\006 \001(\005\"\211\001",
"\n\014RedOneDetail\022\013\n\003uid\030\001 \001(\005\022\014\n\004head\030\002 \001(" +
"\005\022\021\n\theadFrame\030\003 \001(\005\022\014\n\004name\030\004 \001(\t\022\014\n\004ti" +
"me\030\005 \001(\005\022\r\n\005count\030\006 \001(\005\022\016\n\006itemId\030\007 \001(\005\022" +
"\020\n\010position\030\010 \001(\005\"Z\n\030ExpeditionSimpleBos" +
"sInfo\022\017\n\007heroTid\030\001 \001(\005\022\014\n\004star\030\002 \001(\005\022\r\n\005" +
"level\030\003 \001(\005\022\020\n\010remainHp\030\004 \001(\001\"\202\001\n\022Expedi" +
"tionTeamInfo\022B\n\004hero\030\001 \003(\01324.com.ljsd.ji" +
"eling.protocols.ExpeditionSimpleBossInfo" +
"\022\024\n\014PokemonInfos\030\002 \003(\005\022\022\n\ntotalForce\030\003 \001" +
"(\005\"\251\001\n\022ExpeditionNodeInfo\022\016\n\006sortId\030\001 \001(",
"\005\022\013\n\003lay\030\002 \001(\005\022\014\n\004type\030\003 \001(\005\022D\n\014bossTeam" +
"info\030\004 \001(\0132..com.ljsd.jieling.protocols." +
"ExpeditionTeamInfo\022\r\n\005state\030\005 \001(\005\022\023\n\013hol" +
"yEquipID\030\006 \003(\005\"<\n\030ExpeditionSimpleHeroIn" +
"fo\022\016\n\006heroId\030\001 \001(\t\022\020\n\010remainHp\030\002 \001(\001\"/\n\017" +
"ExpeditionEquip\022\n\n\002id\030\001 \001(\t\022\020\n\010equiptId\030" +
"\002 \001(\005B\002H\001"
};
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
@ -90251,7 +90333,7 @@ public final class CommonProto {
internal_static_com_ljsd_jieling_protocols_RefreshTask_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_com_ljsd_jieling_protocols_RefreshTask_descriptor,
new java.lang.String[] { "Type", "Tasks", });
new java.lang.String[] { "Type", "Tasks", "RefreshTime", });
internal_static_com_ljsd_jieling_protocols_MainLevelRankInfo_descriptor =
getDescriptor().getMessageTypes().get(85);
internal_static_com_ljsd_jieling_protocols_MainLevelRankInfo_fieldAccessorTable = new

View File

@ -93975,6 +93975,483 @@ public final class PlayerInfoProto {
// @@protoc_insertion_point(class_scope:com.ljsd.jieling.protocols.PrivilegeIndication)
}
public interface TreasureRefreshTimeResponseOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// optional int32 dayTime = 1;
/**
* <code>optional int32 dayTime = 1;</code>
*/
boolean hasDayTime();
/**
* <code>optional int32 dayTime = 1;</code>
*/
int getDayTime();
// optional int32 weekTime = 2;
/**
* <code>optional int32 weekTime = 2;</code>
*/
boolean hasWeekTime();
/**
* <code>optional int32 weekTime = 2;</code>
*/
int getWeekTime();
}
/**
* Protobuf type {@code com.ljsd.jieling.protocols.TreasureRefreshTimeResponse}
*/
public static final class TreasureRefreshTimeResponse extends
com.google.protobuf.GeneratedMessage
implements TreasureRefreshTimeResponseOrBuilder {
// Use TreasureRefreshTimeResponse.newBuilder() to construct.
private TreasureRefreshTimeResponse(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
this.unknownFields = builder.getUnknownFields();
}
private TreasureRefreshTimeResponse(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
private static final TreasureRefreshTimeResponse defaultInstance;
public static TreasureRefreshTimeResponse getDefaultInstance() {
return defaultInstance;
}
public TreasureRefreshTimeResponse getDefaultInstanceForType() {
return defaultInstance;
}
private final com.google.protobuf.UnknownFieldSet unknownFields;
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private TreasureRefreshTimeResponse(
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;
dayTime_ = input.readInt32();
break;
}
case 16: {
bitField0_ |= 0x00000002;
weekTime_ = 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 com.ljsd.jieling.protocols.PlayerInfoProto.internal_static_com_ljsd_jieling_protocols_TreasureRefreshTimeResponse_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.ljsd.jieling.protocols.PlayerInfoProto.internal_static_com_ljsd_jieling_protocols_TreasureRefreshTimeResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.ljsd.jieling.protocols.PlayerInfoProto.TreasureRefreshTimeResponse.class, com.ljsd.jieling.protocols.PlayerInfoProto.TreasureRefreshTimeResponse.Builder.class);
}
public static com.google.protobuf.Parser<TreasureRefreshTimeResponse> PARSER =
new com.google.protobuf.AbstractParser<TreasureRefreshTimeResponse>() {
public TreasureRefreshTimeResponse parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new TreasureRefreshTimeResponse(input, extensionRegistry);
}
};
@java.lang.Override
public com.google.protobuf.Parser<TreasureRefreshTimeResponse> getParserForType() {
return PARSER;
}
private int bitField0_;
// optional int32 dayTime = 1;
public static final int DAYTIME_FIELD_NUMBER = 1;
private int dayTime_;
/**
* <code>optional int32 dayTime = 1;</code>
*/
public boolean hasDayTime() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>optional int32 dayTime = 1;</code>
*/
public int getDayTime() {
return dayTime_;
}
// optional int32 weekTime = 2;
public static final int WEEKTIME_FIELD_NUMBER = 2;
private int weekTime_;
/**
* <code>optional int32 weekTime = 2;</code>
*/
public boolean hasWeekTime() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>optional int32 weekTime = 2;</code>
*/
public int getWeekTime() {
return weekTime_;
}
private void initFields() {
dayTime_ = 0;
weekTime_ = 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, dayTime_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeInt32(2, weekTime_);
}
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, dayTime_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(2, weekTime_);
}
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 com.ljsd.jieling.protocols.PlayerInfoProto.TreasureRefreshTimeResponse parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.ljsd.jieling.protocols.PlayerInfoProto.TreasureRefreshTimeResponse parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.ljsd.jieling.protocols.PlayerInfoProto.TreasureRefreshTimeResponse parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.ljsd.jieling.protocols.PlayerInfoProto.TreasureRefreshTimeResponse parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.ljsd.jieling.protocols.PlayerInfoProto.TreasureRefreshTimeResponse parseFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static com.ljsd.jieling.protocols.PlayerInfoProto.TreasureRefreshTimeResponse parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseFrom(input, extensionRegistry);
}
public static com.ljsd.jieling.protocols.PlayerInfoProto.TreasureRefreshTimeResponse parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input);
}
public static com.ljsd.jieling.protocols.PlayerInfoProto.TreasureRefreshTimeResponse parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return PARSER.parseDelimitedFrom(input, extensionRegistry);
}
public static com.ljsd.jieling.protocols.PlayerInfoProto.TreasureRefreshTimeResponse parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return PARSER.parseFrom(input);
}
public static com.ljsd.jieling.protocols.PlayerInfoProto.TreasureRefreshTimeResponse 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(com.ljsd.jieling.protocols.PlayerInfoProto.TreasureRefreshTimeResponse 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 com.ljsd.jieling.protocols.TreasureRefreshTimeResponse}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder>
implements com.ljsd.jieling.protocols.PlayerInfoProto.TreasureRefreshTimeResponseOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.ljsd.jieling.protocols.PlayerInfoProto.internal_static_com_ljsd_jieling_protocols_TreasureRefreshTimeResponse_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.ljsd.jieling.protocols.PlayerInfoProto.internal_static_com_ljsd_jieling_protocols_TreasureRefreshTimeResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.ljsd.jieling.protocols.PlayerInfoProto.TreasureRefreshTimeResponse.class, com.ljsd.jieling.protocols.PlayerInfoProto.TreasureRefreshTimeResponse.Builder.class);
}
// Construct using com.ljsd.jieling.protocols.PlayerInfoProto.TreasureRefreshTimeResponse.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();
dayTime_ = 0;
bitField0_ = (bitField0_ & ~0x00000001);
weekTime_ = 0;
bitField0_ = (bitField0_ & ~0x00000002);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.ljsd.jieling.protocols.PlayerInfoProto.internal_static_com_ljsd_jieling_protocols_TreasureRefreshTimeResponse_descriptor;
}
public com.ljsd.jieling.protocols.PlayerInfoProto.TreasureRefreshTimeResponse getDefaultInstanceForType() {
return com.ljsd.jieling.protocols.PlayerInfoProto.TreasureRefreshTimeResponse.getDefaultInstance();
}
public com.ljsd.jieling.protocols.PlayerInfoProto.TreasureRefreshTimeResponse build() {
com.ljsd.jieling.protocols.PlayerInfoProto.TreasureRefreshTimeResponse result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public com.ljsd.jieling.protocols.PlayerInfoProto.TreasureRefreshTimeResponse buildPartial() {
com.ljsd.jieling.protocols.PlayerInfoProto.TreasureRefreshTimeResponse result = new com.ljsd.jieling.protocols.PlayerInfoProto.TreasureRefreshTimeResponse(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.dayTime_ = dayTime_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.weekTime_ = weekTime_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.ljsd.jieling.protocols.PlayerInfoProto.TreasureRefreshTimeResponse) {
return mergeFrom((com.ljsd.jieling.protocols.PlayerInfoProto.TreasureRefreshTimeResponse)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.ljsd.jieling.protocols.PlayerInfoProto.TreasureRefreshTimeResponse other) {
if (other == com.ljsd.jieling.protocols.PlayerInfoProto.TreasureRefreshTimeResponse.getDefaultInstance()) return this;
if (other.hasDayTime()) {
setDayTime(other.getDayTime());
}
if (other.hasWeekTime()) {
setWeekTime(other.getWeekTime());
}
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 {
com.ljsd.jieling.protocols.PlayerInfoProto.TreasureRefreshTimeResponse parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.ljsd.jieling.protocols.PlayerInfoProto.TreasureRefreshTimeResponse) e.getUnfinishedMessage();
throw e;
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
// optional int32 dayTime = 1;
private int dayTime_ ;
/**
* <code>optional int32 dayTime = 1;</code>
*/
public boolean hasDayTime() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
* <code>optional int32 dayTime = 1;</code>
*/
public int getDayTime() {
return dayTime_;
}
/**
* <code>optional int32 dayTime = 1;</code>
*/
public Builder setDayTime(int value) {
bitField0_ |= 0x00000001;
dayTime_ = value;
onChanged();
return this;
}
/**
* <code>optional int32 dayTime = 1;</code>
*/
public Builder clearDayTime() {
bitField0_ = (bitField0_ & ~0x00000001);
dayTime_ = 0;
onChanged();
return this;
}
// optional int32 weekTime = 2;
private int weekTime_ ;
/**
* <code>optional int32 weekTime = 2;</code>
*/
public boolean hasWeekTime() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>optional int32 weekTime = 2;</code>
*/
public int getWeekTime() {
return weekTime_;
}
/**
* <code>optional int32 weekTime = 2;</code>
*/
public Builder setWeekTime(int value) {
bitField0_ |= 0x00000002;
weekTime_ = value;
onChanged();
return this;
}
/**
* <code>optional int32 weekTime = 2;</code>
*/
public Builder clearWeekTime() {
bitField0_ = (bitField0_ & ~0x00000002);
weekTime_ = 0;
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:com.ljsd.jieling.protocols.TreasureRefreshTimeResponse)
}
static {
defaultInstance = new TreasureRefreshTimeResponse(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:com.ljsd.jieling.protocols.TreasureRefreshTimeResponse)
}
private static com.google.protobuf.Descriptors.Descriptor
internal_static_com_ljsd_jieling_protocols_ErrorMsgResponse_descriptor;
private static
@ -94660,6 +95137,11 @@ public final class PlayerInfoProto {
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_com_ljsd_jieling_protocols_PrivilegeIndication_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_com_ljsd_jieling_protocols_TreasureRefreshTimeResponse_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_com_ljsd_jieling_protocols_TreasureRefreshTimeResponse_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
@ -94964,7 +95446,9 @@ public final class PlayerInfoProto {
"\005\"\037\n\020SexChangeRequest\022\013\n\003sex\030\001 \001(\005\"\023\n\021Se" +
"xChangeResponse\"K\n\023PrivilegeIndication\0224" +
"\n\005infos\030\001 \003(\0132%.com.ljsd.jieling.protoco" +
"ls.PrivilegeB\002H\001"
"ls.Privilege\"@\n\033TreasureRefreshTimeRespo" +
"nse\022\017\n\007dayTime\030\001 \001(\005\022\020\n\010weekTime\030\002 \001(\005B\002" +
"H\001"
};
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
@ -95793,6 +96277,12 @@ public final class PlayerInfoProto {
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_com_ljsd_jieling_protocols_PrivilegeIndication_descriptor,
new java.lang.String[] { "Infos", });
internal_static_com_ljsd_jieling_protocols_TreasureRefreshTimeResponse_descriptor =
getDescriptor().getMessageTypes().get(137);
internal_static_com_ljsd_jieling_protocols_TreasureRefreshTimeResponse_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_com_ljsd_jieling_protocols_TreasureRefreshTimeResponse_descriptor,
new java.lang.String[] { "DayTime", "WeekTime", });
return null;
}
};

View File

@ -21,7 +21,7 @@ public class NetWorkFactory {
return new NettyGameServer(cfg, handler);
}
public static NettyGameClient getClient(MessageLite gameMessage, EndPortCfg cfg, INetWorkHandler handler) throws ConnectException {
return new NettyGameClient(gameMessage, cfg, handler);
public static NettyGameClient getClient(EndPortCfg cfg, INetWorkHandler handler) throws ConnectException {
return new NettyGameClient(cfg, handler);
}
}

View File

@ -22,7 +22,6 @@ import java.util.concurrent.ConcurrentHashMap;
public abstract class AbstractClient<T extends NettyGameSession> extends AbstractEndport {
protected Logger LOGGER = LoggerFactory.getLogger(AbstractClient.class);
//不对外暴露接口
private T gameSession;
private InetSocketAddress localAddress;
final int readTimeout;
final int writeTimeout;
@ -49,39 +48,31 @@ public abstract class AbstractClient<T extends NettyGameSession> extends Abstrac
@Override
public void connected(IChannel channel) {
if (handler instanceof INetSession) {
gameSession = ((INetSession<T>) handler).createGameSession(channel, handler);
if (null != gameSession) {
LOGGER.info("seission" + gameSession + "channelActive: " + gameSession.getChannel().getRemoteAddress() + " ,uid: " +
gameSession.getUid() + " ,areaId: " + gameSession.getAreaId());
this.gameSession = gameSession;
String sessionId = gameSession.getId();
channel.setBindSessionId(sessionId);
gameSession.open();
}
}
// if (handler instanceof INetSession) {
// gameSession = ((INetSession<T>) handler).createGameSession(channel, handler);
// if (null != gameSession) {
// LOGGER.info("seission" + gameSession + "channelActive: " + gameSession.getChannel().getRemoteAddress() + " ,uid: " +
// gameSession.getUid() + " ,areaId: " + gameSession.getAreaId());
// this.gameSession = gameSession;
// String sessionId = gameSession.getId();
// channel.setBindSessionId(sessionId);
// gameSession.open();
// }
// }
}
@Override
public void disconnected(IChannel channel) {
if (handler instanceof INetConnet) {
if (null != this.gameSession) {
LOGGER.info("channelInactive->uid={},seission={},remoteAddress={}",
gameSession.getUid(), gameSession, gameSession.getChannel().getRemoteAddress());
((INetConnet) handler).offLine(gameSession);
gameSession.close();
gameSession = null;
}
((INetConnet) handler).offLine(null);
}
}
@Override
public void received(IChannel channel, Object msg) {
if (null != gameSession) {
gameSession.received(msg);
}
((INetReceived) handler).onReceive(null,msg);
}
@Override
@ -92,11 +83,8 @@ public abstract class AbstractClient<T extends NettyGameSession> extends Abstrac
@Override
public void idle(IChannel channel) {
if (handler instanceof INetConnet) {
if (null != gameSession) {
((INetConnet) handler).readIdel(gameSession);
}
((INetConnet) handler).readIdel(null);
}
}

View File

@ -1,58 +1,32 @@
package com.ljsd.jieling.netty.server;
import com.google.protobuf.MessageLite;
import com.ljsd.jieling.netty.NettyGameSession;
import com.ljsd.jieling.netty.cocdex.Int32FrameDecoder;
import com.ljsd.jieling.netty.cocdex.Int32LengthFieldPrepender;
import com.ljsd.jieling.netty.cocdex.PacketNetData;
import com.ljsd.jieling.netty.cocdex.TeaDecoder;
import com.ljsd.jieling.netty.cocdex.TeaEncoder;
import com.ljsd.jieling.netty.config.EndPortCfg;
import com.ljsd.jieling.netty.handler.GameMessageHandler;
import com.ljsd.jieling.netty.handler.ServerResponseMessageHandler;
import com.ljsd.jieling.protocol.*;
import com.ljsd.jieling.session.GameSession;
import com.ljsd.jieling.session.GameSessionFactory;
import com.ljsd.jieling.protocol.INetWorkHandler;
import io.netty.bootstrap.Bootstrap;
import io.netty.buffer.PooledByteBufAllocator;
import io.netty.channel.*;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioSocketChannel;
import io.netty.handler.codec.protobuf.ProtobufDecoder;
import io.netty.handler.codec.protobuf.ProtobufEncoder;
import io.netty.handler.timeout.IdleStateHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import util.StringUtil;
import util.TimeUtils;
import java.lang.reflect.Type;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
public class NettyGameClient extends AbstractClient {
private static final Logger LOGGER = LoggerFactory.getLogger(NettyGameClient.class);
private static Bootstrap bootstrap = null;
//key位IP+Port的组合
private static Map<String, Channel> channels = new ConcurrentHashMap<>();
private final MessageLite gameMessage;
// public NettyGameClient(int readTimeout, int writeTimeout,
// int allTimeout, MessageLite gameMessage, ProtocolsAbstract protocols, GameSessionFactory<T> sessionFactory) {
// super(readTimeout, writeTimeout, allTimeout);
//
// this.protocols = protocols;
// this.sessionFactory = sessionFactory;
// }
//
public NettyGameClient( MessageLite gameMessage, EndPortCfg endPortCfg, INetWorkHandler channelHandler) {
super(endPortCfg, channelHandler);
this.gameMessage = gameMessage;
public NettyGameClient(EndPortCfg endPortCfg, INetWorkHandler iNetWorkHandler) {
super(endPortCfg, iNetWorkHandler);
}
public void start() {
public Channel start() {
try {
EventLoopGroup group = new NioEventLoopGroup(1);
bootstrap = new Bootstrap();
@ -69,41 +43,20 @@ public class NettyGameClient extends AbstractClient {
protected void initChannel(Channel ch) throws Exception {
ChannelPipeline p = ch.pipeline();
p.addLast(new Int32FrameDecoder());
p.addLast(new ProtobufDecoder(gameMessage));
p.addLast(new TeaDecoder());
// 心跳检测处理
p.addLast(new IdleStateHandler(readTimeout, writeTimeout, allTimeout, TimeUnit.SECONDS));
p.addLast(new Int32LengthFieldPrepender());
p.addLast(new ProtobufEncoder());
p.addLast(new ServerResponseMessageHandler(NettyGameClient.this));
p.addLast(new TeaEncoder());
p.addLast(new GameMessageHandler(NettyGameClient.this));
// p.addLast(new ServerResponseMessageHandler(NettyGameClient.this));
}
});
return bootstrap.connect(getLocalAddress().getHostName(),getLocalAddress().getPort()).sync().channel();//"39.100.38.60",16080).sync().channel();
} catch (Exception e) {
LOGGER.error("start->msg={}", e.getMessage(), e);
}
}
public static Channel getChannel(String serverIp, int port) {
try {
String key = serverIp + ":" + port;
Channel channel = channels.get(key);
if(channel == null || !channel.isOpen() || !channel.isActive()) {
channel = bootstrap.connect(serverIp, port).sync().channel();
channels.put(key, channel);
}
return channel;
} catch (Exception e) {
LOGGER.error("getChannel->serverIp={},port={},msg={}", serverIp, port, e.getMessage(), e);
}
return null;
}
public static Channel getChannel(String serverIpPort) {
String strs[] = serverIpPort.split(":");
return getChannel(strs[0], Integer.parseInt(strs[1]));
}
@Override
public void close() {
@ -111,4 +64,6 @@ public class NettyGameClient extends AbstractClient {
}
}

View File

@ -62,6 +62,7 @@ public enum FunctionIdEnum {
WorkShopCreateProtectEquip(103,null),
WorkShopRebuildEquip(104,null,MessageTypeProto.MessageType.WORKSHOP_REBUILD_REQUEST_VALUE),
Expedition(64,null),
Achieve(65,null),
;
private int functionType;

View File

@ -41,5 +41,6 @@ public interface VipPrivilegeType {
int GUILD_BOSS_CHALLENGE_TIMES = 37; //公会boss挑战次数
int UNLOCK_GUILD_BOSS_SWEEP = 1002; //公会boss扫荡
int EXPEDITION_RELIVE = 1003; //猎妖之路免费复活次数
int SIGN_AGAIN = 1005; //每日签到充值后再领一次
}

View File

@ -24,6 +24,7 @@ import com.ljsd.jieling.util.ItemUtil;
import com.ljsd.jieling.util.MessageUtil;
import config.SExpeditionFloorConfig;
import config.SExpeditionHolyConfig;
import config.SExpeditionNodeConfig;
import config.SExpeditionSetting;
import manager.STableManager;
import org.luaj.vm2.LuaValue;
@ -195,11 +196,11 @@ public class EndExpeditionBattleRequest extends BaseHandler<Expedition.EndExpedi
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.EXPEDITION_NOINFO_INDICATION_VALUE, builder.build(), true);
//drop
SExpeditionFloorConfig sExpeditionFloorConfig = STableManager.getConfig(SExpeditionFloorConfig.class).get(oldlay);
if (sExpeditionFloorConfig == null) {
SExpeditionNodeConfig sExpeditionNodeConfig = STableManager.getConfig(SExpeditionNodeConfig.class).get(nodeInfo.getType());
if (sExpeditionNodeConfig == null) {
throw new ErrorCodeException(ErrorCode.CFG_NULL);
}
CommonProto.Drop.Builder drop = ItemUtil.drop(user, sExpeditionFloorConfig.getReward(),1,0,BIReason.EXPEDITION_DROP_REWARD);
CommonProto.Drop.Builder drop = ItemUtil.drop(user, sExpeditionNodeConfig.getreward(),1,0,BIReason.EXPEDITION_DROP_REWARD);
Expedition.EndExpeditionBattleResponse.Builder response = Expedition.EndExpeditionBattleResponse.newBuilder();
response.setResult(resultCode);
response.setDrop(drop);

View File

@ -60,6 +60,7 @@ public class GetPlayerInfoHandler extends BaseHandler{
userId, token,msgId,msgIndex,getPlayerInfoRequest.getNum(),getPlayerInfoRequest.getStr());
User user = UserManager.getUser(userId);
BuyGoodsLogic.initOwernBagInfo(user);
PlayerLogic.getInstance().sendDayilyMail(user,-1);
QuestionLogic.getInstence().onLogin(user);
PlayerManager playerInfoManager = user.getPlayerInfoManager();

View File

@ -1,10 +1,12 @@
package com.ljsd.jieling.handler;
import com.ljsd.jieling.core.VipPrivilegeType;
import com.ljsd.jieling.exception.ErrorCode;
import com.ljsd.jieling.exception.ErrorCodeException;
import com.ljsd.jieling.globals.BIReason;
import com.ljsd.jieling.logic.dao.UserManager;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.logic.player.PlayerLogic;
import com.ljsd.jieling.netty.cocdex.PacketNetData;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.protocols.CommonProto;
@ -47,6 +49,12 @@ public class SignInHandler extends BaseHandler {
throw new ErrorCodeException(ErrorCode.newDefineCode("day out0findex"));
}
//check 道具
boolean check = PlayerLogic.getInstance().check(user, VipPrivilegeType.SIGN_AGAIN, 1);
if(!check){
throw new ErrorCodeException("次数不足");
}
PlayerLogic.getInstance().checkAndUpdate(user, VipPrivilegeType.SIGN_AGAIN, 1);
user.getPlayerInfoManager().setSignTotay(1);
int[] reward = sign.getreward();

View File

@ -1,23 +0,0 @@
package com.ljsd.jieling.handler.pokeemon;
import com.ljsd.jieling.handler.BaseHandler;
import com.ljsd.jieling.logic.hero.HeroLogic;
import com.ljsd.jieling.netty.cocdex.PacketNetData;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.protocols.HeroInfoProto;
import com.ljsd.jieling.protocols.MessageTypeProto;
import org.springframework.stereotype.Component;
@Component
public class RingFireAdvanceHandler extends BaseHandler {
@Override
public MessageTypeProto.MessageType getMessageCode() {
return MessageTypeProto.MessageType.RINGFIRE_ADVANCED_REQUEST;
}
@Override
public void process(ISession iSession, PacketNetData netData) throws Exception {
HeroInfoProto.RingFirAdvanceRequest ringFirAdvanceRequest = HeroInfoProto.RingFirAdvanceRequest.parseFrom(netData.parseClientProtoNetData());
HeroLogic.getInstance().ringFireAdvanced(iSession,ringFirAdvanceRequest.getPokemonId());
}
}

View File

@ -1,23 +0,0 @@
package com.ljsd.jieling.handler.pokeemon;
import com.ljsd.jieling.handler.BaseHandler;
import com.ljsd.jieling.logic.hero.HeroLogic;
import com.ljsd.jieling.netty.cocdex.PacketNetData;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.protocols.HeroInfoProto;
import com.ljsd.jieling.protocols.MessageTypeProto;
import org.springframework.stereotype.Component;
@Component
public class RingFireLoadHandler extends BaseHandler {
@Override
public MessageTypeProto.MessageType getMessageCode() {
return MessageTypeProto.MessageType.RINGFIRE_LOAD_REQUEST;
}
@Override
public void process(ISession iSession, PacketNetData netData) throws Exception {
HeroInfoProto.RingFireLoadRequest ringFireLoadRequest = HeroInfoProto.RingFireLoadRequest.parseFrom(netData.parseClientProtoNetData());
HeroLogic.getInstance().ringFireLoad(iSession,ringFireLoadRequest.getPokemonId(),ringFireLoadRequest.getComonpentId());
}
}

View File

@ -1,24 +0,0 @@
package com.ljsd.jieling.handler.workshop;
import com.ljsd.jieling.handler.BaseHandler;
import com.ljsd.jieling.logic.item.WorkShopLogic;
import com.ljsd.jieling.netty.cocdex.PacketNetData;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.protocols.MessageTypeProto;
import com.ljsd.jieling.protocols.PlayerInfoProto;
import org.springframework.stereotype.Component;
@Component
public class CookFoodHandler extends BaseHandler {
@Override
public MessageTypeProto.MessageType getMessageCode() {
return MessageTypeProto.MessageType.COOK_FOOD_REQUEST;
}
@Override
public void process(ISession iSession, PacketNetData netData) throws Exception {
byte[] bytes = netData.parseClientProtoNetData();
PlayerInfoProto.CookFoodRequest cookFoodRequest = PlayerInfoProto.CookFoodRequest.parseFrom(bytes);
WorkShopLogic.getInstance().makeFood(iSession,cookFoodRequest.getMaterialIdList(),cookFoodRequest.getNums());
}
}

View File

@ -40,7 +40,7 @@ public class HotfixUtil implements IEventHandler {
@Override
public void onEvent(IEvent event) throws Exception {
doWork(SysUtil.getPath("../conf/hotfix.json"));
doWork(SysUtil.getPath("conf/hotfix.json"));
}

View File

@ -91,7 +91,6 @@ public class UserManager {
SPlayerLevelConfig sPlayerLevelConfig = SPlayerLevelConfig.getsPlayerLevelConfigMap().get(1);
playerManager.setMaxStamina(sPlayerLevelConfig.getMaxEnergy());
playerManager.setRideLevel(1);
BuyGoodsLogic.initOwernBagInfo(user);
PlayerLogic.getInstance().vipflushEveryDay(user,null);
ActivityLogic.getInstance().newPlayerOpenActivityMission(user);
PlayerLogic.getInstance().playerInfoUpdate(user);
@ -100,6 +99,7 @@ public class UserManager {
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);
Poster.getPoster().dispatchEvent(new NewWelfareEvent(user, NewWelfareTypeEnum.LOGIN_TIMES.getType(),1));
ItemUtil.drop(user,gameSetting.getBornItem(), BIReason.USER_BORN_REWARD);

View File

@ -36,6 +36,8 @@ public class UserMissionManager extends MongoBase {
private ServenMissionIdsType sevenHappyMissionType =new ServenMissionIdsType();
private BloodyMissionIdsType bloodyMissionIdsType =new BloodyMissionIdsType();
private MissingRoomMissionType missingRoomMissionType = new MissingRoomMissionType();
private AchieveMissionIdsType achievementMissionTypMap = new AchieveMissionIdsType();
//数据累加项
private CumulationData cumulationData = new CumulationData();
private CumulationData dailyCumulationData = new CumulationData();
@ -45,6 +47,7 @@ public class UserMissionManager extends MongoBase {
private CumulationData treasureWeekCumulationData = new CumulationData();
private CumulationData treasureMonthCumulationData = new CumulationData();
private CumulationData sevenHappyCumulationData = new CumulationData();
private CumulationData achievementMap = new CumulationData();
public void openMission(User user,GameEvent event,Map<GameMisionType, List<MissionStateChangeInfo>> missionTypeEnumListMap, Object... parm) throws Exception {
ISession session= OnlineUserManager.getSessionByUid(user.getId());
@ -145,6 +148,17 @@ public class UserMissionManager extends MongoBase {
bloodyMissionIdsType.getRewardedMissionIds().clear();
bloodyMissionIdsType.getDoingMissionIds().addAll(bloodyMissionIds);
updateString("bloodyMissionIdsType",bloodyMissionIdsType);
break;
case ACHIEVE_REFRESH:
Set<Integer> ds =STableManager.getConfig(SAchievementConfig.class).keySet();
achievementMissionTypMap.getDoingMissionIds().clear();
achievementMissionTypMap.getFinishMissionIds().clear();
achievementMissionTypMap.getRewardedMissionIds().clear();
achievementMissionTypMap.getDoingMissionIds().addAll(ds);
achievementMap =new CumulationData();
updateString("achievementMissionTypMap",achievementMissionTypMap);
updateString("achievementMap",achievementMap);
break;
case MISSING_ROOM_REFRESH:
Map<Integer,Integer> mustAppear = new HashMap<>();
@ -245,6 +259,13 @@ public class UserMissionManager extends MongoBase {
updateString("treasureMissionIdsType",treasureMissionIdsType);
}
break;
case ACHIEVE_REWARD:{
int missId = (int)parm[0];
achievementMissionTypMap.rewardMission(missId, missionTypeEnumListMap.get(GameMisionType.ACHIEVEMISSION));
updateString("achievementMissionTypMap",achievementMissionTypMap);
}
break;
case SEVENHAPPY_MISSION_REWARD:{
int missionId = (int) parm[0];
List<MissionStateChangeInfo> missionStateChangeInfos = missionTypeEnumListMap.get(GameMisionType.SEVENMISSION);
@ -270,6 +291,8 @@ public class UserMissionManager extends MongoBase {
missingRoomMissionType.rewardMission((int)parm[0],missionTypeEnumListMap.get(GameMisionType.MISSINGROOMMISSION));
updateString("missingRoomMissionType",missingRoomMissionType);
}
break;
default:
break;
@ -357,6 +380,20 @@ public class UserMissionManager extends MongoBase {
}
}
if(!achievementMissionTypMap.getDoingMissionIds().isEmpty() ){
List<SAchievementConfig> sAchievementConfigs = SAchievementConfig.sTaskConfigByTypeMap.get(missionType.getMissionTypeValue());
if(sAchievementConfigs!=null&&sAchievementConfigs.size()!=0){
CumulationData.Result result= achievementMap.updateData(missionType, parm);
if(result!=null){
achievementMissionTypMap.calCumulationDataResult(user,result,missionTypeEnumListMap.get(GameMisionType.ACHIEVEMISSION),achievementMap);
updateString("achievementMap",achievementMap);
updateString("achievementMissionTypMap",achievementMissionTypMap);
}
}
}
CumulationData.Result result = cumulationData.updateData(missionType, parm);
if(result!=null){
vipMissionIdsType.calCumulationDataResult(user,result,missionTypeEnumListMap.get(GameMisionType.VIPMISSION),cumulationData);
@ -487,4 +524,12 @@ public class UserMissionManager extends MongoBase {
public MissingRoomMissionType getMissingRoomMissionType() {
return missingRoomMissionType;
}
public AchieveMissionIdsType getAchievementMissionTypMap() {
return achievementMissionTypMap;
}
public CumulationData getAchievementMap() {
return achievementMap;
}
}

View File

@ -360,9 +360,15 @@ public class ExpeditionLogic {
// }
Set<Integer> staffsSet = new HashSet<>();
while (staffsSet.size()<3){
int[][] holyProbability = cfg.getHolyProbability();
SExpeditionNodeConfig sExpeditionNodeConfig = STableManager.getConfig(SExpeditionNodeConfig.class).get(type);
if(null!=sExpeditionNodeConfig && sExpeditionNodeConfig.getHolyProbability().length==3){
for (int j = 0; j <holyProbability.length ; j++) {
holyProbability[j][1]+= sExpeditionNodeConfig.getHolyProbability()[j][1];
}
}
int ints = MathUtils.randomFromWeight(cfg.getHolyProbability());
Map<Integer, Integer> type2holy2weight = STableManager.getFigureConfig(CommonStaticConfig.class).getType2holy2weight(ints);
int i1 = ranndomFromWeight(type2holy2weight);

View File

@ -1240,36 +1240,7 @@ public class HeroLogic{
});
ProtocolsManager.getInstance().updateAyncWorker(ayyncWorker);
}
//天赋异妖加成
Map<Integer, Pokemon> ringFireMap = pokemonManager.getRingFireMap();
for(Map.Entry<Integer,Pokemon> item : ringFireMap.entrySet()){
Pokemon pokemon = item.getValue();
int allStage = pokemon.getAllStage();
SRingFireConfig sRingFireConfig = SRingFireConfig.getsRingFireByRingIdAndLevel(pokemon.getId(), allStage);
if(sRingFireConfig == null){
continue;
}
int[][] property = sRingFireConfig.getProperty();
if(property != null){
combinedAttribute(property,heroAllAttribute);
}
for(int i=1;i<allStage;i++){
SRingFireConfig sRingFireConfigTmp = SRingFireConfig.getsRingFireByRingIdAndLevel(pokemon.getId(), i);
int[] fireIds = sRingFireConfigTmp.getFireId();
for(int fireId : fireIds){
SRingFireMaterialConfig sRingFireMaterialConfig = SRingFireMaterialConfig.config.get(fireId);
int[][] comonpentIdProperty = sRingFireMaterialConfig.getProperty();
combinedAttribute(comonpentIdProperty,heroAllAttribute);
}
}
Set<Integer> comonpentIds= pokemon.getComonpentsLevelMap().keySet();
for(Integer comonpentId : comonpentIds){
SRingFireMaterialConfig sRingFireMaterialConfig = SRingFireMaterialConfig.config.get(comonpentId);
int[][] comonpentIdProperty = sRingFireMaterialConfig.getProperty();
combinedAttribute(comonpentIdProperty,heroAllAttribute);
}
}
//工坊科技树加成
Map<Integer, Integer> techProfressionMap = user.getWorkShopController().getTechnologyMap().get(scHero.getProfession());
if(techProfressionMap!=null){
@ -2056,88 +2027,8 @@ public class HeroLogic{
MessageUtil.sendMessage(session,1,MessageTypeProto.MessageType.GET_RINGFIRE_INFO_RESPONSE_VALUE,builder.build(),true);
}
//天赋异妖相关 组件放置
public void ringFireLoad(ISession session, int pokemonId, int comonpentId) throws Exception {
int uid = session.getUid();
User user = UserManager.getUser(uid);
PokemonManager pokemonManager = user.getPokemonManager();
Pokemon pokemon = pokemonManager.getRingFireMap().get(pokemonId);
if(pokemon == null){
pokemon = new Pokemon(pokemonId);
pokemon.setAllStage(1);
pokemonManager.addRingFirePokemon(pokemon);
}
SRingTypeConfig sRingTypeConfig = SRingTypeConfig.config.get(pokemonId);
if(sRingTypeConfig == null){
throw new ErrorCodeException(ErrorCode.CFG_NULL);
}
int level = user.getPlayerInfoManager().getLevel();
if(level<sRingTypeConfig.getPlayerLevel()){
throw new ErrorCodeException(ErrorCode.newDefineCode("level not"));
}
if(pokemon.getComonpentsLevelMap().containsKey(comonpentId)){
throw new ErrorCodeException(ErrorCode.newDefineCode("repeated"));
}
SRingFireConfig sRingFireConfig = SRingFireConfig.getsRingFireByRingIdAndLevel(pokemonId, pokemon.getAllStage());
if(sRingFireConfig == null){
throw new ErrorCodeException(ErrorCode.CFG_NULL);
}
int[] fireIds = sRingFireConfig.getFireId();
boolean exists =false;
for(int fireId:fireIds){
if(fireId == comonpentId){
exists = true;
break;
}
}
if(!exists){
throw new ErrorCodeException(ErrorCode.newDefineCode("not exists"));
}
SRingFireMaterialConfig sRingFireMaterialConfig = SRingFireMaterialConfig.config.get(comonpentId);
boolean enough = ItemUtil.itemCost(user, sRingFireMaterialConfig.getMaterial(), BIReason.RINGFIRE_LOAD_CONSUME, comonpentId);
if(!enough){
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
}
pokemon.upOrActiveComonpent(comonpentId);
//发送成功消息
MessageUtil.sendMessage(session,1,MessageTypeProto.MessageType.RINGFIRE_LOAD_RESPONSE_VALUE,null,true);
}
//天赋异妖进阶
public void ringFireAdvanced(ISession session,int pokemonId) throws Exception {
int uid = session.getUid();
User user = UserManager.getUser(uid);
PokemonManager pokemonManager = user.getPokemonManager();
Pokemon pokemon = pokemonManager.getRingFireMap().get(pokemonId);
if(pokemon == null){
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}
SRingTypeConfig sRingTypeConfig = SRingTypeConfig.config.get(pokemonId);
if(sRingTypeConfig == null){
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}
int level = user.getPlayerInfoManager().getLevel();
if(level<sRingTypeConfig.getPlayerLevel()){
throw new ErrorCodeException(ErrorCode.newDefineCode("level not"));
}
int allStage = pokemon.getAllStage();
SRingFireConfig sRingFireConfig = SRingFireConfig.getsRingFireByRingIdAndLevel(pokemonId, allStage);
if(sRingFireConfig == null){
throw new ErrorCodeException(ErrorCode.CFG_NULL);
}
int[] fireIds = sRingFireConfig.getFireId();
Map<Integer, Integer> comonpentsLevelMap1 = pokemon.getComonpentsLevelMap();
for(int fireId:fireIds){
if(!comonpentsLevelMap1.containsKey(fireId)){
throw new ErrorCodeException(ErrorCode.newDefineCode("not full"));
}
}
pokemon.setAllStage(pokemon.getAllStage() + 1);
pokemon.clearComonpentsLevelMap();
user.getUserMissionManager().onGameEvent(user,GameEvent.RINGFIRE_ADVANCE);
//发送成功消息
MessageUtil.sendMessage(session,1,MessageTypeProto.MessageType.RINGFIRE_ADVANCED_RESPONSE_VALUE,null,true);
}
public String getEcoForce11A(User user){

View File

@ -131,82 +131,9 @@ public class WorkShopLogic {
return WorkShopLogic.Instance.instance;
}
private SMysteryFoodPoolConfig randomFromFoodPool(int poolId){
List<SMysteryFoodPoolConfig> sMysteryFoodPoolConfigs = SMysteryFoodPoolConfig.getsMysteryFoodPoolConfigByPoold(poolId);
int totalWeightByPool = SMysteryFoodPoolConfig.getTotalWeightByPool(poolId);
int randomWeight = MathUtils.randomInt(totalWeightByPool) + 1;
int weight=0;
for(SMysteryFoodPoolConfig sMysteryFoodPoolConfig:sMysteryFoodPoolConfigs){
weight += sMysteryFoodPoolConfig.getWeight();
if(randomWeight>=weight){
return sMysteryFoodPoolConfig;
}
}
return null;
}
public void makeFood(ISession session,List<Integer> materials,int nums) throws Exception {
int uid = session.getUid();
User user = UserManager.getUser(uid);
SMysteryFoodSetting sMysteryFoodSetting = SMysteryFoodSetting.getsMysteryFoodSetting();
if(sMysteryFoodSetting.getNum() != materials.size()){
return;
}
WorkShopController workShopController = user.getWorkShopController();
SWorkShopSetting sWorkShopSetting = SWorkShopSetting.getsWorkShopSettingByLevel(workShopController.getCookLevel());
float baseLevelRate = sWorkShopSetting.getAddSuccessRate();
float addRate =0.0f;
Map<Integer, Float> addRateByQuality = sMysteryFoodSetting.getAddRateByQuality();
Set<Integer> cache = new HashSet<>();
for(Integer id : materials){
if(cache.contains(id)){
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.COOK_FOOD_RESPONSE_VALUE,null,true);
return;
}
cache.add(id);
Map<Integer, SItem> integerSItemMap = SItem.getsItemMap();
SItem sItem = integerSItemMap.get(id);
if(!addRateByQuality.containsKey(sItem.getQuantity())){
continue;
}
addRate += addRateByQuality.get(sItem.getQuantity());
}
//算出概率
float myRate =baseLevelRate + addRate;
int poolTotalWeight = sWorkShopSetting.getCookTotalWeight() ;
int totalFailExp=0;
int[][] drop = new int[nums][];
int i=0;
while(nums--<0){
if(MathUtils.randomInt(100) < 100*myRate){
//筛选池子
int[][] poolWeight = sWorkShopSetting.getPoolRate();
int randomWeight = MathUtils.randomInt(poolTotalWeight)+1;
int weight=0;
for(int[] poolWeightInfo : poolWeight){
weight+=poolWeightInfo[1];
if(randomWeight>=weight){
SMysteryFoodPoolConfig sMysteryFoodPoolConfig = randomFromFoodPool(poolWeightInfo[0]);
int itemId = sMysteryFoodPoolConfig.getItemId();
drop[i++] = new int[]{itemId,1};
totalFailExp+=sMysteryFoodPoolConfig.getExp();
}
}
}
//失败 熟练度加成
int failExp = sMysteryFoodSetting.getFailExp();
totalFailExp+=failExp;
}
CommonProto.Drop.Builder dropThing = ItemUtil.drop(user, drop,BIReason.WORKSHOP_MAKEFOOD);
CommonProto.WorkShopBaseInfo workShopBaseInfo = CommonProto.WorkShopBaseInfo.newBuilder().setType(GlobalsDef.COOK_SHOP_TYPE).setLevle(workShopController.getCookLevel()).setExp(workShopController.getCookExp()).build();
PlayerInfoProto.CookFoodResponse build = PlayerInfoProto.CookFoodResponse.newBuilder().setWorkShopBaseInfo(workShopBaseInfo).setDrop(dropThing).build();
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.COOK_FOOD_RESPONSE_VALUE,build,true);
}
private int[][] times2Array(int [][] array,int times){
int[][] result = new int[array.length][];

View File

@ -8,6 +8,7 @@ public enum GameEvent {
TREASH_WEEK_REFRESH,//孙龙的宝藏周任务
TREASH_MONTH_REFRESH,//孙龙的宝藏月任务
SERVENHAPPY_REFRESH,//七日狂欢
ACHIEVE_REFRESH,//成就刷新
MISSING_ROOM_REFRESH,//迷宫寻宝刷新
BEGINNER,//新手
@ -35,6 +36,7 @@ public enum GameEvent {
MISSING_ROOM_MISSION_REWARD,//迷宫寻宝领奖
WORKSHOP_CREATE_EQUIP,//打造装备
ADVENTURE_TAKEREWARD, //收取秘境奖励
ACHIEVE_REWARD,// 领取成就的宝藏
BUY_MATERIAL,//购买道具
RINGFIRE_ADVANCE,//天赋进阶
@ -72,5 +74,5 @@ public enum GameEvent {
JOIN_FAMILY,//加入公会次数
FRIEND_APPLY,//提出好友申请次数
COPY_COHERO_TIMES//通关剧情副本和精英本
}

View File

@ -9,6 +9,8 @@ public enum GameMisionType {
BEGINNERMISSION(6),
BLOODYMISSION(7),
MISSINGROOMMISSION(8),
ACHIEVEMISSION(9),
;
private int type;

View File

@ -2,6 +2,8 @@ package com.ljsd.jieling.logic.mission;
import com.ljsd.jieling.config.clazzStaticCfg.TaskStaticConfig;
import com.ljsd.jieling.core.FunctionIdEnum;
import com.ljsd.jieling.core.HandlerLogicThread;
import com.ljsd.jieling.dataReport.reportBeans_37.Repot37EventUtil;
import com.ljsd.jieling.exception.ErrorCode;
import com.ljsd.jieling.exception.ErrorCodeException;
@ -17,6 +19,7 @@ import com.ljsd.jieling.logic.activity.event.MissingRoomBestEvent;
import com.ljsd.jieling.logic.activity.event.Poster;
import com.ljsd.jieling.logic.dao.*;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.logic.expedition.ExpeditionLogic;
import com.ljsd.jieling.logic.hero.HeroLogic;
import com.ljsd.jieling.logic.mission.main.*;
import com.ljsd.jieling.network.session.ISession;
@ -47,6 +50,7 @@ public class MissionLoigc {
getBeginnerMisssion(user,missionList);
getBloodyMisison(user,missionList);
getMissingRoomMission(user,missionList);
getAchieveMission(user,missionList);
PlayerInfoProto.GetMissionResponse build = PlayerInfoProto.GetMissionResponse.newBuilder().addAllUserMissionInfo(missionList).build();
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.GET_MISSION_RESPONSE_VALUE,build,true);
}
@ -312,6 +316,32 @@ public class MissionLoigc {
}
}
public static void getAchieveMission(User user ,List<CommonProto.UserMissionInfo> missionList){
SGlobalSystemConfig sGlobalSystemConfig = STableManager.getConfig(SGlobalSystemConfig.class).get(FunctionIdEnum.Achieve.getFunctionType());
if (sGlobalSystemConfig!=null&&!HandlerLogicThread.checkOpen(user,sGlobalSystemConfig)) {
return;
}
UserMissionManager userMissionManager = user.getUserMissionManager();
AchieveMissionIdsType achievementMissionTypMap = userMissionManager.getAchievementMissionTypMap();
CumulationData achievementdata = userMissionManager.getAchievementMap();
Set<Integer> doingMissionIds = achievementMissionTypMap.getDoingMissionIds();
Set<Integer> finishMissionIds = achievementMissionTypMap.getFinishMissionIds();
for (SAchievementConfig sAchievementConfig : STableManager.getConfig(SAchievementConfig.class).values()) {
int state = 2;
int missionId = sAchievementConfig.getId();
int progrss = sAchievementConfig.getValues()[1][0];
if (doingMissionIds.contains(missionId)) {
progrss = getDoingProgress(user, achievementdata, sAchievementConfig.getType(), sAchievementConfig.getValues()[0]);
state = 0;
} else if (finishMissionIds.contains(missionId)) {
state = 1;
}
missionList.add(CommonProto.UserMissionInfo.newBuilder().setMissionId(missionId).setState(state).setType(GameMisionType.ACHIEVEMISSION.getType()).setProgress(progrss).build());
}
}
public static void takeMissionReward(ISession session,int type,int missionId) throws Exception {
int uid = session.getUid();
User user = UserManager.getUser(uid);
@ -397,6 +427,12 @@ public class MissionLoigc {
missionStateChangeInfos = gameMisionTypeListMap.get(GameMisionType.MISSINGROOMMISSION);
}
if(type==GameMisionType.ACHIEVEMISSION.getType()){
Map<GameMisionType, List<MissionStateChangeInfo>> gameMisionTypeListMap = userMissionManager.onGameEvent(user, GameEvent.ACHIEVE_REWARD, missionId);
missionStateChangeInfos = gameMisionTypeListMap.get(GameMisionType.ACHIEVEMISSION);
}
if(missionStateChangeInfos!=null && !missionStateChangeInfos.isEmpty()){
CommonProto.Drop.Builder drop = ItemUtil.drop(user, missionStateChangeInfos.get(0).getRewwardGroups(), BIReason.TAKE_MISSION_REWARD);
PlayerInfoProto.TakeMissionRewardResponse build = PlayerInfoProto.TakeMissionRewardResponse.newBuilder().setDrop(drop).build();
@ -502,6 +538,20 @@ public class MissionLoigc {
}
}
break;
case COMHERO_STORY_PASS:
Map<Integer, CrossInfo> crossMap = user.getMapManager().getCrossInfoMap();
for(Map.Entry<Integer,CrossInfo> item : crossMap.entrySet()){
CrossInfo value = item.getValue();
if(value.getStars().contains(MapLogic.STAR_1)){
Integer fightId = item.getKey();
SChallengeConfig sChallengeConfig = SChallengeConfig.sChallengeConfigs.get(fightId);
if(sChallengeConfig.getType() == 1 && sChallengeConfig.getType() == 3){
count++;
break;
}
}
}
break;
case KILL_INVASIONBOSS:
count = cumulationData.getKillInvasionbossCount();
break;
@ -547,15 +597,6 @@ public class MissionLoigc {
count=cumulationData.finsihDayilyTimes;
break;
case RING_FIREA_DVANCED:
Map<Integer, Pokemon> ringFireMap = user.getPokemonManager().getRingFireMap();
for(Pokemon pokemonTmp : ringFireMap.values()){
int pokemonId = pokemonTmp.getId();
int allStage = pokemonTmp.getAllStage();
SRingFireConfig sRingFireConfig = SRingFireConfig.getsRingFireByRingIdAndLevel(pokemonId, allStage);
if(sRingFireConfig != null && pokemonId== missionSubType[0] && allStage>=missionSubType[1]){
count++;
}
}
break;
case COPY_STORY_LEVLE:
count=cumulationData.copyMaxLevel;

View File

@ -85,6 +85,7 @@ public enum MissionType {
TAKE_FRIEND_GIFT(66),//领取好友友情点
JOIN_FAMILY(69),
FRIEND_APPLY(71),//提出%s次好友申请
COMHERO_STORY_PASS(72), //通关剧情副本或精英副本%s次
;
private int missionType;
@ -231,6 +232,8 @@ public enum MissionType {
return JOIN_FAMILY;
case 71:
return FRIEND_APPLY;
case 72:
return COMHERO_STORY_PASS;
default:
return null;
}

View File

@ -40,6 +40,8 @@ public class DataManagerDistributor {
judges.put(MissionType.LEVEL_STORY_PASS,new FightDataManager());
judges.put(MissionType.GENERAL_STORY_PASS,new FightDataManager());
judges.put(MissionType.HERO_STORY_PASS,new FightDataManager());
judges.put(MissionType.COMHERO_STORY_PASS,new FightDataManager());
judges.put(MissionType.KILL_INVASIONBOSS,new KillInvasionBossDataManager());
judges.put(MissionType.SECRETBOX_TIMES,new SecretboxRandomManager());

View File

@ -36,8 +36,12 @@ public class FightDataManager implements BaseDataManager{
if(sChallengeConfig.getType() == 3){
result = new CumulationData.Result(missionType);
}
}
}else if(missionType ==MissionType.COMHERO_STORY_PASS){
SChallengeConfig sChallengeConfig = SChallengeConfig.sChallengeConfigs.get(fightId);
if(sChallengeConfig.getType() == 3||sChallengeConfig.getType() == 1){
result = new CumulationData.Result(missionType);
}
}
}
return result;

View File

@ -10,6 +10,7 @@ import com.ljsd.jieling.protocols.CommonProto;
import com.ljsd.jieling.protocols.MessageTypeProto;
import com.ljsd.jieling.protocols.PlayerInfoProto;
import com.ljsd.jieling.util.MessageUtil;
import manager.STableManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -33,7 +34,7 @@ public class MissionEventDistributor {
eventProcessor.put(GameEvent.BLOODY_REFRESH,new DailyRefreshEventProcess());
eventProcessor.put(GameEvent.TREASH_REFRESH,new TreasureRefreshEventProcess());
eventProcessor.put(GameEvent.TREASH_WEEK_REFRESH,new TreasureRefreshEventProcess());
eventProcessor.put(GameEvent.ACHIEVE_REFRESH,new DailyRefreshEventProcess());
eventProcessor.put(GameEvent.TREASH_MONTH_REFRESH,new TreasureRefreshEventProcess());
eventProcessor.put(GameEvent.SERVENHAPPY_REFRESH,new TreasureRefreshEventProcess());
eventProcessor.put(GameEvent.BEGINNER,new BeginneRefreshEventProcessor());
@ -177,6 +178,7 @@ public class MissionEventDistributor {
eventProcessor.put(GameEvent.BEGINNER_MISSION_REWARD,new RewardEventProcessor());
eventProcessor.put(GameEvent.BLOODY_MISSION_REWARD,new RewardEventProcessor());
eventProcessor.put(GameEvent.MISSING_ROOM_MISSION_REWARD,new RewardEventProcessor());
eventProcessor.put(GameEvent.ACHIEVE_REWARD,new RewardEventProcessor());
typeList = new ArrayList<>();
@ -289,6 +291,12 @@ public class MissionEventDistributor {
eventEnumListMap.put(GameEvent.FRIEND_APPLY,typeList);
eventProcessor.put(GameEvent.FRIEND_APPLY,new CumulationDataEventProcessor());
typeList = new ArrayList<>();
typeList.add(MissionType.COMHERO_STORY_PASS);
eventEnumListMap.put(GameEvent.COPY_COHERO_TIMES,typeList);
eventProcessor.put(GameEvent.COPY_COHERO_TIMES,new CumulationDataEventProcessor());
}
private static final ThreadLocal<Map<GameMisionType, List<MissionStateChangeInfo>>> threadMissionChangeList =
@ -315,6 +323,8 @@ public class MissionEventDistributor {
missionTypeEnumListMap.put(GameMisionType.BEGINNERMISSION, new ArrayList<>());
missionTypeEnumListMap.put(GameMisionType.BLOODYMISSION, new ArrayList<>());
missionTypeEnumListMap.put(GameMisionType.MISSINGROOMMISSION, new ArrayList<>());
missionTypeEnumListMap.put(GameMisionType.ACHIEVEMISSION, new ArrayList<>());
} else {
missionTypeEnumListMap.get(GameMisionType.VIPMISSION).clear();
@ -325,6 +335,8 @@ public class MissionEventDistributor {
missionTypeEnumListMap.get(GameMisionType.BEGINNERMISSION).clear();
missionTypeEnumListMap.get(GameMisionType.BLOODYMISSION).clear();
missionTypeEnumListMap.get(GameMisionType.MISSINGROOMMISSION).clear();
missionTypeEnumListMap.get(GameMisionType.ACHIEVEMISSION).clear();
}
threadMissionChangeList.set(missionTypeEnumListMap);
@ -360,7 +372,7 @@ public class MissionEventDistributor {
if(gameMisionType==GameMisionType.MISSINGROOMMISSION){
continue;
}
if(gameMisionType == GameMisionType.COPYMISSION || gameMisionType == GameMisionType.TREASUREMISSION || gameMisionType == GameMisionType.SEVENMISSION || gameMisionType == GameMisionType.BLOODYMISSION){
if(gameMisionType == GameMisionType.COPYMISSION || gameMisionType == GameMisionType.TREASUREMISSION || gameMisionType == GameMisionType.SEVENMISSION || gameMisionType == GameMisionType.BLOODYMISSION|| gameMisionType == GameMisionType.ACHIEVEMISSION){
progress = missionStateChangeInfo.getProgress();
}
if(missionState == MissionState.DOING){
@ -391,6 +403,12 @@ public class MissionEventDistributor {
STreasureSunlongTaskConfig sunlongTaskConfig = STreasureSunlongTaskConfig.treasureTaskConfig.get(missionStateChangeInfo.getMissionId());
progress= sunlongTaskConfig.getTaskValue()[1][0];
}
if(gameMisionType == GameMisionType.ACHIEVEMISSION){
SAchievementConfig achievementConfig = STableManager.getConfig(SAchievementConfig.class).get(missionStateChangeInfo.getMissionId());
progress= achievementConfig.getValues()[1][0];
}
if(gameMisionType == GameMisionType.SEVENMISSION){
STreasureTaskConfig sTreasureTaskConfig = STreasureTaskConfig.sTreasureTaskConfigMap.get(missionStateChangeInfo.getMissionId());
if(sTreasureTaskConfig.getTaskType() != MissionType.SENVER_HAPPY.getMissionTypeValue()){
@ -424,4 +442,5 @@ public class MissionEventDistributor {
processor.onGameEvent(user, missionTypeEnumListMap,event,parm );
return missionTypeEnumListMap;
}
}

View File

@ -0,0 +1,70 @@
package com.ljsd.jieling.logic.mission.main;
import com.ljsd.jieling.logic.dao.CumulationData;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.logic.mission.MissionLoigc;
import com.ljsd.jieling.logic.mission.MissionState;
import com.ljsd.jieling.logic.mission.MissionType;
import config.SAchievementConfig;
import config.SBloodyBattleTask;
import config.STreasureSunlongTaskConfig;
import manager.STableManager;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
public class AchieveMissionIdsType extends AbstractMissionType{
@Override
public void openMission(User user, int missionId, List<MissionStateChangeInfo> missionTypeEnumList) {
}
@Override
public int[][] reward(int missionId) {
SAchievementConfig sDailyTasksConfigById = STableManager.getConfig(SAchievementConfig.class).get(missionId);
return sDailyTasksConfigById.getReward();
}
@Override
public void calCumulationDataResult(User user, CumulationData.Result result, List<MissionStateChangeInfo> missionStateChangeInfos, CumulationData cumulationData) {
Set<Integer> doingMissionIds = getDoingMissionIds();
List<SAchievementConfig> sAchievementConfigs = SAchievementConfig.sTaskConfigByTypeMap.get(result.subType.getMissionTypeValue());
if(sAchievementConfigs == null){
return;
}
for(SAchievementConfig sAchievementConfig : sAchievementConfigs){
int id = sAchievementConfig.getId();
if(!doingMissionIds.contains(sAchievementConfig.getId())){
continue;
}
int doingProgress = MissionLoigc.getDoingProgress(user, cumulationData, sAchievementConfig.getType(), sAchievementConfig.getValues()[0]);
//完成
int finishParm = sAchievementConfig.getValues()[1][0];
if (doingProgress<finishParm) {
boolean flag = false;
for (MissionStateChangeInfo missionStateChangeInfo : missionStateChangeInfos) {
if (missionStateChangeInfo.getMissionId() == id) {
flag = true;
}
}
if (!flag) {
MissionStateChangeInfo doingInfo = new MissionStateChangeInfo(id, MissionState.DOING, doingProgress);
missionStateChangeInfos.add(doingInfo);
}
continue;
}
MissionStateChangeInfo finishInfo = new MissionStateChangeInfo(id,
MissionState.FINISH, null);
missionStateChangeInfos.removeIf(next -> next.getMissionId() == id);
missionStateChangeInfos.add(finishInfo);
doingMissionIds.remove(id);
getFinishMissionIds().add(id);
}
}
}

View File

@ -126,12 +126,9 @@ public class BuyGoodsLogic {
}
endTime +=sRechargeCommodityConfig.getContiueDays() * 24 * 3600;
rechargeInfo.updateGoodsTypeDuration(sRechargeCommodityConfig.getId(),endTime);
if(needSendMail){
triggerEvent(user,sRechargeCommodityConfig,nowTime);
}
}
triggerEvent(user,sRechargeCommodityConfig,nowTime);
int[][] baseReward = sRechargeCommodityConfig.getBaseReward();
int length = baseReward.length;
String rewardStr="";
@ -189,6 +186,7 @@ public class BuyGoodsLogic {
}
}
rechargeInfo.setSaveAmt(price+saveAmt);
user.getPlayerInfoManager().addRechargedaily(price);
//TODO 用事件分发
ActivityLogic.getInstance().updateActivityMissionProgress(user, ActivityType.RechargeTotal,price);
@ -510,15 +508,18 @@ public class BuyGoodsLogic {
public static void initOwernBagInfo(User user){
long now = TimeUtils.now();
long createTime = user.getPlayerInfoManager().getCreateTime();
Map<Integer, Long> initBagMap = new HashMap<>(SRechargeCommodityConfig.refreshItemInfo.size());
Map<Integer, Long> refreshBagMap = user.getPlayerInfoManager().getRechargeInfo().getRefreshBagMap();
for(SRechargeCommodityConfig sRechargeCommodityConfig : SRechargeCommodityConfig.refreshItemInfo){
long endTime = ToolsUtil.getTimeLong(sRechargeCommodityConfig.getStartTimeLong(),sRechargeCommodityConfig.getEndTimeLong(),sRechargeCommodityConfig.getTime(),createTime,1) + TimeUtils.ONE_DAY * sRechargeCommodityConfig.getDailyUpdate();
while (endTime<now){
endTime += SRechargeCommodityConfig.rechargeCommodityConfigMap.get(sRechargeCommodityConfig.getId()).getDailyUpdate() * TimeUtils.ONE_DAY ;
}
initBagMap.put(sRechargeCommodityConfig.getId(),endTime);
if(!refreshBagMap.containsKey(sRechargeCommodityConfig.getId()) || refreshBagMap.get(sRechargeCommodityConfig.getId())!=endTime){
refreshBagMap.put(sRechargeCommodityConfig.getId(),endTime);
}
}
user.getPlayerInfoManager().getRechargeInfo().setRefreshBagMap(initBagMap);
user.getPlayerInfoManager().getRechargeInfo().setRefreshBagMap(refreshBagMap);
}

View File

@ -92,6 +92,25 @@ public class ThreadManager implements IManager {
}
}
public static void main(String[] args) {
int now = (int)(System.currentTimeMillis()/1000);
// testTask 已秒为单位 延迟10s, 间隔30s为周期执行
int delayForMinute = 60 - (now%60);
ScheduledThreadPoolExecutor scheduledThreadPoolExecutor = new ScheduledThreadPoolExecutor(8, new ScheduleThreadFactory());
scheduledThreadPoolExecutor.scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
System.out.println(new Date());
try {
Thread.sleep(20000);
} catch (InterruptedException e) {
e.printStackTrace();
}
System.out.printf(Thread.currentThread().getName());
}
},0,2, TimeUnit.SECONDS);
}
public static void go() {
int now = (int)(System.currentTimeMillis()/1000);

View File

@ -45,6 +45,7 @@ import java.util.stream.Collectors;
public class ItemUtil {
private static Map<Integer,String> dropRewardMap = new ConcurrentHashMap<>();
private static Set<Integer> dropAddition = new HashSet<>();//掉落权重加成id
public static Map<Integer,String> equipQulityNameMap = new HashMap<>(2);
private static final Logger LOGGER = LoggerFactory.getLogger(ItemUtil.class);
@ -170,14 +171,14 @@ public class ItemUtil {
if (sRewardGroup == null) {
continue;
}
selectDrop(sRewardGroup, itemMap, cardMap, equipMap, randomMap, dropRatio);
selectDrop(user,sRewardGroup, itemMap, cardMap, equipMap, randomMap, dropRatio);
int[] extraDropGroupIds = activityExtraDropGroupId(user, dropGroupId);
for (int dropExtraGroupId : extraDropGroupIds) {
SRewardGroup sRewardGroupExtra = SRewardGroup.getsRewardItemMap().get(dropExtraGroupId);
if (sRewardGroupExtra == null) {
continue;
}
selectDrop(sRewardGroupExtra, itemMap, cardMap, equipMap, randomMap, dropRatio);
selectDrop(user,sRewardGroupExtra, itemMap, cardMap, equipMap, randomMap, dropRatio);
}
}
}
@ -353,20 +354,41 @@ public class ItemUtil {
getMap(items.getKey(), items.getValue(), itemMap, cardMap,equipMap,randomMap,1);
}
}
private static void selectDrop(SRewardGroup sRewardGroup,Map<Integer, Integer> itemMap, Map<Integer, Integer> cardMap,Map<Integer,Integer> equipMap,Map<Integer,Integer> randomMap , float dropRatio) {
private static void selectDrop(User user, SRewardGroup sRewardGroup,Map<Integer, Integer> itemMap, Map<Integer, Integer> cardMap,Map<Integer,Integer> equipMap,Map<Integer,Integer> randomMap , float dropRatio) {
String dropInfo = dropRewardMap.get(sRewardGroup.getId());
String rewardStr = dropInfo.split("\\|")[0];
String weight = dropInfo.split("\\|")[1];
String[] rewards= rewardStr.split("#");
String[] weights= rewardStr.split("#");
for (int i = 0; i < rewards.length; i++) {
int rewardId = Integer.valueOf(rewards[i]);
if (dropAddition.contains(rewardId)) {
int dropWeight = Integer.valueOf(weights[i]);
SRewardItem sRewardItem = SRewardItem.getsDropMap().get(rewardId);
//权重加成 1等级权重加成
int[] chanceAddition = sRewardItem.getChanceAddition();
if(chanceAddition.length==3){
int part= chanceAddition[1];
int sumWeight= chanceAddition[2];
if(chanceAddition[0]==1){//等级
dropWeight = dropWeight+sumWeight*(user.getPlayerInfoManager().getLevel()/ part);
}
//扩展其他权重
}
weights[i] =String.valueOf(dropWeight);
}
}
switch (sRewardGroup.getIsUpset()) {
case GlobalItemType.ALL_DROP:
getMap(StringUtil.parseFiledInt(rewardStr),itemMap,cardMap,equipMap,randomMap,dropRatio);
getMap(user,StringUtil.parseFiledInt(rewardStr),itemMap,cardMap,equipMap,randomMap,dropRatio);
break;
case GlobalItemType.WEIGHT_DROP:
getRandomMap(sRewardGroup.getRewardMaxNum(),rewardStr.split("#"),weight.split("#"),
getRandomMap(user,sRewardGroup.getRewardMaxNum(),rewards,weights,
itemMap,cardMap,equipMap,randomMap,dropRatio);
break;
case GlobalItemType.SUCCESSIVELY_RANDOM:
getSuccessivelyRandmoMap(sRewardGroup,rewardStr.split("#"),weight.split("#"),
getSuccessivelyRandmoMap(user,sRewardGroup,rewards,weights,
itemMap,cardMap,equipMap,randomMap,dropRatio);
break;
default:
@ -374,7 +396,7 @@ public class ItemUtil {
}
}
private static void getSuccessivelyRandmoMap(SRewardGroup sRewardGroup, String[]
private static void getSuccessivelyRandmoMap(User user,SRewardGroup sRewardGroup, String[]
rewardArr, String[] weightArr, Map<Integer, Integer> itemMap, Map<Integer, Integer>
cardMap, Map<Integer,Integer> equipMap, Map<Integer,Integer> randomMap, float dropRatio) {
for (int i = 0 ; i < sRewardGroup.getRewardMaxNum();i++){
@ -391,7 +413,7 @@ public class ItemUtil {
id = Integer.parseInt(rewardArr[index]);
}
SRewardItem sRewardItem = SRewardItem.getsDropMap().get(id);
int itemNum = getItemNum(sRewardItem);
int itemNum = getItemNum(user,sRewardItem);
if (itemNum <= 0){
continue;
}
@ -399,7 +421,7 @@ public class ItemUtil {
}
}
private static void getRandomMap(int randomItemNum ,String[] rewardArr,String[] weightArr, Map<Integer, Integer> itemMap, Map<Integer, Integer> cardMap,
private static void getRandomMap(User user,int randomItemNum ,String[] rewardArr,String[] weightArr, Map<Integer, Integer> itemMap, Map<Integer, Integer> cardMap,
Map<Integer,Integer> equipMap,Map<Integer,Integer> randomMap ,float dropRatio) {
for (int i = 0 ; i < randomItemNum;i++){
int index = MathUtils.randomForStrArray(weightArr);
@ -408,7 +430,7 @@ public class ItemUtil {
}
int id = Integer.parseInt(rewardArr[index]);
SRewardItem sRewardItem = SRewardItem.getsDropMap().get(id);
int itemNum = getItemNum(sRewardItem);
int itemNum = getItemNum(user,sRewardItem);
if (itemNum <= 0){
continue;
}
@ -421,17 +443,34 @@ public class ItemUtil {
* @param sRewardItem
* @return
*/
private static int getItemNum(SRewardItem sRewardItem) {
private static int getItemNum(User user,SRewardItem sRewardItem) {
int itemNum ;
if (sRewardItem.getRandomMin() == sRewardItem.getRandomMax()) {
return sRewardItem.getRandomMin();
itemNum = sRewardItem.getRandomMin();
}else {
itemNum = MathUtils.numRount(MathUtils.random(sRewardItem.getRandomMin(), sRewardItem.getRandomMax()) * sRewardItem.getGrowChance());
}
return MathUtils.numRount(MathUtils.random(sRewardItem.getRandomMin(), sRewardItem.getRandomMax()) * sRewardItem.getGrowChance());
//权重加成 1等级权重加成
int[] addition = sRewardItem.getAddition();
if(addition.length==2){
int weight= addition[1];
if(addition[0]==1){
itemNum = itemNum+(int)(itemNum*((float)user.getPlayerInfoManager().getLevel()/(float) weight));
}
//扩展其他权重
}
return itemNum;
}
private static void getMap(int[] itemInfo, Map<Integer, Integer> itemMap,Map<Integer, Integer> cardMap,Map<Integer,Integer> equipMap,Map<Integer,Integer> randomMap ,float dropRatio) {
private static void getMap(User user,int[] itemInfo, Map<Integer, Integer> itemMap,Map<Integer, Integer> cardMap,Map<Integer,Integer> equipMap,Map<Integer,Integer> randomMap ,float dropRatio) {
for (int id :itemInfo){
SRewardItem sRewardItem = SRewardItem.getsDropMap().get(id);
int itemNum = getItemNum(sRewardItem);
int itemNum = getItemNum(user,sRewardItem);
if (itemNum <= 0){
continue;
}
@ -1396,6 +1435,9 @@ public class ItemUtil {
if (sRewardItem == null){
continue;
}
if(sRewardItem.getChanceAddition().length!=0){
dropAddition.add(dropId);
}
if (rewardStr.length() == 0){
rewardStr = new StringBuilder(String.valueOf(sRewardItem.getId()));
}else{
@ -1406,8 +1448,8 @@ public class ItemUtil {
}else{
weight.append("#").append(sRewardItem.getChance());
}
dropMap.put(sRewardGroup.getId(),rewardStr +"|"+weight);
}
dropMap.put(sRewardGroup.getId(),rewardStr +"|"+weight);
}
dropRewardMap = dropMap;
}

View File

@ -37,7 +37,7 @@ public class MessageUtil {
backMessage = new byte[0];
} else {
backMessage = generatedMessage.toByteArray();
// LOGGER.info(JsonFormat.printToString(generatedMessage));
LOGGER.info(JsonFormat.printToString(generatedMessage));
}
int length = PackageConstant.UID_FIELD_LEN + PackageConstant.TOKEN_LEN

View File

@ -0,0 +1,59 @@
package config;
import manager.STableManager;
import manager.Table;
import java.util.*;
@Table(name ="AchievementConfig")
public class SAchievementConfig implements BaseConfig {
private int id;
private int type;
private int[][] values;
private int[][] reward;
public static Map<Integer, Set<Integer>> setTMap;
public static Map<Integer, List<SAchievementConfig>> sTaskConfigByTypeMap;
@Override
public void init() throws Exception {
Map<Integer, SAchievementConfig> configTmp = STableManager.getConfig(SAchievementConfig.class);
Map<Integer, List<SAchievementConfig>> configListTmp = new HashMap<>();
for(SAchievementConfig sAchievementConfig : configTmp.values()){
int taskType = sAchievementConfig.getType();
if(!configListTmp.containsKey(taskType)){
configListTmp.put(taskType,new ArrayList<>());
}
configListTmp.get(taskType).add(sAchievementConfig);
}
sTaskConfigByTypeMap = configListTmp;
}
public int getId() {
return id;
}
public int getType() {
return type;
}
public int[][] getValues() {
return values;
}
public int[][] getReward() {
return reward;
}
public static Map<Integer, List<SAchievementConfig>> getsTaskConfigByTypeMap() {
return sTaskConfigByTypeMap;
}
public static void setsTaskConfigByTypeMap(Map<Integer, List<SAchievementConfig>> sTaskConfigByTypeMap) {
SAchievementConfig.sTaskConfigByTypeMap = sTaskConfigByTypeMap;
}
}

View File

@ -0,0 +1,43 @@
package config;
import manager.STableManager;
import manager.Table;
import java.util.Map;
@Table(name ="ExpeditionNodeConfig")
public class SExpeditionNodeConfig implements BaseConfig {
private int id;
private int type;
private int[] reward;
private int[][] holyProbability;
@Override
public void init() throws Exception {
}
public int getId() {
return id;
}
public int gettype() {
return type;
}
public int[] getreward() {
return reward;
}
public int[][] getHolyProbability() {
return holyProbability;
}
}

View File

@ -1,66 +0,0 @@
package config;
import manager.STableManager;
import manager.Table;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Table(name ="MysteryFoodPoolConfig")
public class SMysteryFoodPoolConfig implements BaseConfig {
private int id;
private int itemId;
private int weight;
private int exp;
private int pool;
private static Map<Integer,List<SMysteryFoodPoolConfig>> sMysteryFoodPoolConfigByPoolMap;
private static Map<Integer,Integer> totalWeightByPoolMap;
@Override
public void init() throws Exception {
Map<Integer, SMysteryFoodPoolConfig> config = STableManager.getConfig(SMysteryFoodPoolConfig.class);
sMysteryFoodPoolConfigByPoolMap = new HashMap<>();
for(SMysteryFoodPoolConfig sMysteryFoodPoolConfig : config.values()){
sMysteryFoodPoolConfigByPoolMap.computeIfAbsent(pool,v->new ArrayList<>()).add(sMysteryFoodPoolConfig);
}
}
public static List<SMysteryFoodPoolConfig> getsMysteryFoodPoolConfigByPoold(int poolId) {
return sMysteryFoodPoolConfigByPoolMap.get(poolId);
}
public static int getTotalWeightByPool(int pool) {
return totalWeightByPoolMap.get(pool);
}
public int getId() {
return id;
}
public int getItemId() {
return itemId;
}
public int getWeight() {
return weight;
}
public int getExp() {
return exp;
}
public int getPool() {
return pool;
}
}

View File

@ -1,76 +0,0 @@
package config;
import manager.STableManager;
import manager.Table;
import java.util.HashMap;
import java.util.Map;
@Table(name ="RingFireConfig")
public class SRingFireConfig implements BaseConfig {
private int id;
private int ringId;
private int ringQuality;
private int ringLevel;
private int playerLevel;
private int[] fireId;
private int[][] property;
private static Map<Integer,Map<Integer,SRingFireConfig>> sRingFireByRingIdAndLevelMap;
@Override
public void init() throws Exception {
Map<Integer, SRingFireConfig> config = STableManager.getConfig(SRingFireConfig.class);
sRingFireByRingIdAndLevelMap = new HashMap<>();
for(SRingFireConfig sRingFireConfig : config.values()){
int ringId = sRingFireConfig.getRingId();
int ringLevel = sRingFireConfig.getRingLevel();
sRingFireByRingIdAndLevelMap.computeIfAbsent(ringId,v->new HashMap<>()).put(ringLevel,sRingFireConfig);
}
}
public static SRingFireConfig getsRingFireByRingIdAndLevel(int ringId,int ringLevel) {
if(!sRingFireByRingIdAndLevelMap.containsKey(ringId)){
return null;
}
return sRingFireByRingIdAndLevelMap.get(ringId).get(ringLevel);
}
public int getID() {
return id;
}
public int getRingId() {
return ringId;
}
public int getRingQuality() {
return ringQuality;
}
public int getRingLevel() {
return ringLevel;
}
public int getPlayerLevel() {
return playerLevel;
}
public int[] getFireId() {
return fireId;
}
public int[][] getProperty() {
return property;
}
}

View File

@ -1,50 +0,0 @@
package config;
import manager.STableManager;
import manager.Table;
import java.util.HashMap;
import java.util.Map;
@Table(name ="RingFireMaterialConfig")
public class SRingFireMaterialConfig implements BaseConfig {
private int id;
private int fireId;
private int[][] property;
private int[][] material;
public static Map<Integer, SRingFireMaterialConfig> config;
@Override
public void init() throws Exception {
Map<Integer, SRingFireMaterialConfig> configTmp = STableManager.getConfig(SRingFireMaterialConfig.class);
Map<Integer, SRingFireMaterialConfig> configMap = new HashMap<>();
for(SRingFireMaterialConfig sRingFireMaterialConfig : configTmp.values()){
configMap.put(sRingFireMaterialConfig.getFireId(),sRingFireMaterialConfig);
}
config = configMap;
}
public int getId() {
return id;
}
public int getFireId() {
return fireId;
}
public int[][] getProperty() {
return property;
}
public int[][] getMaterial() {
return material;
}
}

View File

@ -1,39 +0,0 @@
package config;
import manager.STableManager;
import manager.Table;
import java.util.Map;
@Table(name ="RingTypeConfig")
public class SRingTypeConfig implements BaseConfig {
private int id;
private int ringId;
private int playerLevel;
public static Map<Integer, SRingTypeConfig> config;
@Override
public void init() throws Exception {
config = STableManager.getConfig(SRingTypeConfig.class);
}
public int getId() {
return id;
}
public int getRingId() {
return ringId;
}
public int getPlayerLevel() {
return playerLevel;
}
}

View File

@ -1,72 +0,0 @@
package config;
import manager.STableManager;
import manager.Table;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Table(name ="TreasureConfig")
public class STreasureConfig implements BaseConfig {
private int id;
private int activityId;
private int type;
private int points;
private int[][] reward;
private int[][] treasureReward;
public static Map<Integer, List<STreasureConfig>> configByActivityIdMap = new HashMap<>();
public static Map<Integer, STreasureConfig> configMap = new HashMap<>();
@Override
public void init() throws Exception {
Map<Integer, STreasureConfig> config = STableManager.getConfig(STreasureConfig.class);
Map<Integer, List<STreasureConfig>> configByActivityIdMapTmp = new HashMap<>();
for(STreasureConfig sTreasureConfig : config.values()){
int activityId = sTreasureConfig.getActivityId();
if(!configByActivityIdMapTmp.containsKey(activityId)){
configByActivityIdMapTmp.put(activityId,new ArrayList<>());
}
configByActivityIdMapTmp.get(activityId).add(sTreasureConfig);
}
configByActivityIdMap = configByActivityIdMapTmp;
configMap = config;
}
public int getId() {
return id;
}
public int getActivityId() {
return activityId;
}
public int getType() {
return type;
}
public int getPoints() {
return points;
}
public int[][] getReward() {
return reward;
}
public int[][] getTreasureReward() {
return treasureReward;
}
}