back_recharge
lvxinran 2020-01-07 16:43:29 +08:00
commit 9593490df6
11 changed files with 276 additions and 24 deletions

View File

@ -87318,6 +87318,24 @@ public final class PlayerInfoProto {
* </pre> * </pre>
*/ */
int getType(); int getType();
// optional int32 activiteId = 2;
/**
* <code>optional int32 activiteId = 2;</code>
*
* <pre>
*id
* </pre>
*/
boolean hasActiviteId();
/**
* <code>optional int32 activiteId = 2;</code>
*
* <pre>
*id
* </pre>
*/
int getActiviteId();
} }
/** /**
* Protobuf type {@code com.ljsd.jieling.protocols.RankRequest} * Protobuf type {@code com.ljsd.jieling.protocols.RankRequest}
@ -87375,6 +87393,11 @@ public final class PlayerInfoProto {
type_ = input.readInt32(); type_ = input.readInt32();
break; break;
} }
case 16: {
bitField0_ |= 0x00000002;
activiteId_ = input.readInt32();
break;
}
} }
} }
} catch (com.google.protobuf.InvalidProtocolBufferException e) { } catch (com.google.protobuf.InvalidProtocolBufferException e) {
@ -87439,8 +87462,33 @@ public final class PlayerInfoProto {
return type_; return type_;
} }
// optional int32 activiteId = 2;
public static final int ACTIVITEID_FIELD_NUMBER = 2;
private int activiteId_;
/**
* <code>optional int32 activiteId = 2;</code>
*
* <pre>
*id
* </pre>
*/
public boolean hasActiviteId() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>optional int32 activiteId = 2;</code>
*
* <pre>
*id
* </pre>
*/
public int getActiviteId() {
return activiteId_;
}
private void initFields() { private void initFields() {
type_ = 0; type_ = 0;
activiteId_ = 0;
} }
private byte memoizedIsInitialized = -1; private byte memoizedIsInitialized = -1;
public final boolean isInitialized() { public final boolean isInitialized() {
@ -87457,6 +87505,9 @@ public final class PlayerInfoProto {
if (((bitField0_ & 0x00000001) == 0x00000001)) { if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeInt32(1, type_); output.writeInt32(1, type_);
} }
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeInt32(2, activiteId_);
}
getUnknownFields().writeTo(output); getUnknownFields().writeTo(output);
} }
@ -87470,6 +87521,10 @@ public final class PlayerInfoProto {
size += com.google.protobuf.CodedOutputStream size += com.google.protobuf.CodedOutputStream
.computeInt32Size(1, type_); .computeInt32Size(1, type_);
} }
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(2, activiteId_);
}
size += getUnknownFields().getSerializedSize(); size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size; memoizedSerializedSize = size;
return size; return size;
@ -87588,6 +87643,8 @@ public final class PlayerInfoProto {
super.clear(); super.clear();
type_ = 0; type_ = 0;
bitField0_ = (bitField0_ & ~0x00000001); bitField0_ = (bitField0_ & ~0x00000001);
activiteId_ = 0;
bitField0_ = (bitField0_ & ~0x00000002);
return this; return this;
} }
@ -87620,6 +87677,10 @@ public final class PlayerInfoProto {
to_bitField0_ |= 0x00000001; to_bitField0_ |= 0x00000001;
} }
result.type_ = type_; result.type_ = type_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.activiteId_ = activiteId_;
result.bitField0_ = to_bitField0_; result.bitField0_ = to_bitField0_;
onBuilt(); onBuilt();
return result; return result;
@ -87639,6 +87700,9 @@ public final class PlayerInfoProto {
if (other.hasType()) { if (other.hasType()) {
setType(other.getType()); setType(other.getType());
} }
if (other.hasActiviteId()) {
setActiviteId(other.getActiviteId());
}
this.mergeUnknownFields(other.getUnknownFields()); this.mergeUnknownFields(other.getUnknownFields());
return this; return this;
} }
@ -87715,6 +87779,55 @@ public final class PlayerInfoProto {
return this; return this;
} }
// optional int32 activiteId = 2;
private int activiteId_ ;
/**
* <code>optional int32 activiteId = 2;</code>
*
* <pre>
*id
* </pre>
*/
public boolean hasActiviteId() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
* <code>optional int32 activiteId = 2;</code>
*
* <pre>
*id
* </pre>
*/
public int getActiviteId() {
return activiteId_;
}
/**
* <code>optional int32 activiteId = 2;</code>
*
* <pre>
*id
* </pre>
*/
public Builder setActiviteId(int value) {
bitField0_ |= 0x00000002;
activiteId_ = value;
onChanged();
return this;
}
/**
* <code>optional int32 activiteId = 2;</code>
*
* <pre>
*id
* </pre>
*/
public Builder clearActiviteId() {
bitField0_ = (bitField0_ & ~0x00000002);
activiteId_ = 0;
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:com.ljsd.jieling.protocols.RankRequest) // @@protoc_insertion_point(builder_scope:com.ljsd.jieling.protocols.RankRequest)
} }
@ -94832,25 +94945,26 @@ public final class PlayerInfoProto {
"protocols.Hero\0220\n\005equip\030\002 \003(\0132!.com.ljsd" + "protocols.Hero\0220\n\005equip\030\002 \003(\0132!.com.ljsd" +
".jieling.protocols.Equip\022B\n\016SpecialEffec" + ".jieling.protocols.Equip\022B\n\016SpecialEffec" +
"ts\030\003 \003(\0132*.com.ljsd.jieling.protocols.Sp" + "ts\030\003 \003(\0132*.com.ljsd.jieling.protocols.Sp" +
"ecialEffects\022\r\n\005force\030\004 \001(\005\"\033\n\013RankReque" + "ecialEffects\022\r\n\005force\030\004 \001(\005\"/\n\013RankReque" +
"st\022\014\n\004type\030\001 \001(\005\"}\n\014RankResponse\0223\n\005rank" + "st\022\014\n\004type\030\001 \001(\005\022\022\n\nactiviteId\030\002 \001(\005\"}\n\014" +
"s\030\001 \003(\0132$.com.ljsd.jieling.protocols.Use" + "RankResponse\0223\n\005ranks\030\001 \003(\0132$.com.ljsd.j" +
"rRank\0228\n\nmyRankInfo\030\002 \001(\0132$.com.ljsd.jie", "ieling.protocols.UserRank\0228\n\nmyRankInfo\030",
"ling.protocols.RankInfo\")\n\023NextActivityR" + "\002 \001(\0132$.com.ljsd.jieling.protocols.RankI" +
"equest\022\022\n\nactivityId\030\001 \001(\005\"0\n\024NextActivi" + "nfo\")\n\023NextActivityRequest\022\022\n\nactivityId" +
"tyResponse\022\n\n\002id\030\001 \001(\005\022\014\n\004time\030\002 \001(\005\"+\n\031" + "\030\001 \001(\005\"0\n\024NextActivityResponse\022\n\n\002id\030\001 \001" +
"RefreshRechargeIndication\022\016\n\006amount\030\001 \001(" + "(\005\022\014\n\004time\030\002 \001(\005\"+\n\031RefreshRechargeIndic" +
"\005\"\024\n\022VipTakeDilyRequest\"E\n\023VipTakeDilyRe" + "ation\022\016\n\006amount\030\001 \001(\005\"\024\n\022VipTakeDilyRequ" +
"sponse\022.\n\004drop\030\001 \001(\0132 .com.ljsd.jieling." + "est\"E\n\023VipTakeDilyResponse\022.\n\004drop\030\001 \001(\013" +
"protocols.Drop\"X\n\032MissingRoomRefreshResp" + "2 .com.ljsd.jieling.protocols.Drop\"X\n\032Mi" +
"onse\022:\n\005infos\030\001 \003(\0132+.com.ljsd.jieling.p" + "ssingRoomRefreshResponse\022:\n\005infos\030\001 \003(\0132" +
"rotocols.UserMissionInfo\"@\n\032MissingRoomS" + "+.com.ljsd.jieling.protocols.UserMission" +
"endHeroRequest\022\017\n\007heroIds\030\001 \003(\t\022\021\n\tmissi", "Info\"@\n\032MissingRoomSendHeroRequest\022\017\n\007he",
"onId\030\002 \001(\005\"1\n\034MissingRoomAccelerateReque" + "roIds\030\001 \003(\t\022\021\n\tmissionId\030\002 \001(\005\"1\n\034Missin" +
"st\022\021\n\tmissionId\030\001 \001(\005\"\037\n\020SexChangeReques" + "gRoomAccelerateRequest\022\021\n\tmissionId\030\001 \001(" +
"t\022\013\n\003sex\030\001 \001(\005\"\023\n\021SexChangeResponse\"K\n\023P" + "\005\"\037\n\020SexChangeRequest\022\013\n\003sex\030\001 \001(\005\"\023\n\021Se" +
"rivilegeIndication\0224\n\005infos\030\001 \003(\0132%.com." + "xChangeResponse\"K\n\023PrivilegeIndication\0224" +
"ljsd.jieling.protocols.PrivilegeB\002H\001" "\n\005infos\030\001 \003(\0132%.com.ljsd.jieling.protoco" +
"ls.PrivilegeB\002H\001"
}; };
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
@ -95606,7 +95720,7 @@ public final class PlayerInfoProto {
internal_static_com_ljsd_jieling_protocols_RankRequest_fieldAccessorTable = new internal_static_com_ljsd_jieling_protocols_RankRequest_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable( com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_com_ljsd_jieling_protocols_RankRequest_descriptor, internal_static_com_ljsd_jieling_protocols_RankRequest_descriptor,
new java.lang.String[] { "Type", }); new java.lang.String[] { "Type", "ActiviteId", });
internal_static_com_ljsd_jieling_protocols_RankResponse_descriptor = internal_static_com_ljsd_jieling_protocols_RankResponse_descriptor =
getDescriptor().getMessageTypes().get(125); getDescriptor().getMessageTypes().get(125);
internal_static_com_ljsd_jieling_protocols_RankResponse_fieldAccessorTable = new internal_static_com_ljsd_jieling_protocols_RankResponse_fieldAccessorTable = new

View File

@ -9,12 +9,14 @@ import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.StringRedisTemplate;
import java.io.*; import java.io.*;
import java.net.URL;
import java.util.Properties; import java.util.Properties;
public class DbClear { public class DbClear {
public static void main(String[] args) throws IOException { public static void main(String[] args) throws IOException {
Properties properties = new Properties(); Properties properties = new Properties();
File file = new File("serverlogic/src/main/resources/application.properties"); URL resource = DbClear.class.getClassLoader().getResource("application.properties");
File file = new File(resource.getFile());
//BufferedInputStream bufferedInputStream = new BufferedInputStream(DbClear.class.getResourceAsStream("application.properties")); //BufferedInputStream bufferedInputStream = new BufferedInputStream(DbClear.class.getResourceAsStream("application.properties"));
System.out.println(file.getAbsolutePath()); System.out.println(file.getAbsolutePath());
properties.load(new FileReader(file)); properties.load(new FileReader(file));
@ -24,6 +26,7 @@ public class DbClear {
mongoClient.dropDatabase(mongoClientURI.getDatabase()); mongoClient.dropDatabase(mongoClientURI.getDatabase());
StringRedisTemplate redisTemplate = getRedisTemplate(); StringRedisTemplate redisTemplate = getRedisTemplate();
redisTemplate.delete(redisTemplate.keys(properties.get("server.id")+"*")); redisTemplate.delete(redisTemplate.keys(properties.get("server.id")+"*"));
System.out.println("the mongo url=" + property);
} }

View File

@ -112,7 +112,7 @@ public class GMRequestHandler extends BaseHandler{
SCHero scHero = SCHero.getsCHero().get(hero.getTemplateId()); SCHero scHero = SCHero.getsCHero().get(hero.getTemplateId());
Map<Integer, SCHeroRankUpConfig> scHeroRankUpConfigByType = STableManager.getFigureConfig(HeroStaticConfig.class).getScHeroRankUpConfigByShow(GlobalsDef.UP_STAR_TYPE,scHero.getStar()); Map<Integer, SCHeroRankUpConfig> scHeroRankUpConfigByType = STableManager.getFigureConfig(HeroStaticConfig.class).getScHeroRankUpConfigByShow(GlobalsDef.UP_STAR_TYPE,scHero.getStar());
SCHeroRankUpConfig scHeroRankUpConfig = scHeroRankUpConfigByType.get(prarm2-1); SCHeroRankUpConfig scHeroRankUpConfig = scHeroRankUpConfigByType.get(prarm2-1);
hero.setLevel(cUser,scHeroRankUpConfig.getLimitLevel()); hero.setLevel(cUser,scHeroRankUpConfig.getOpenLevel());
hero.setStarBreakId(scHeroRankUpConfig.getId()); hero.setStarBreakId(scHeroRankUpConfig.getId());
scHeroRankUpConfigByType = STableManager.getFigureConfig(HeroStaticConfig.class).getScHeroRankUpConfigByShow(GlobalsDef.BREAK_TYPE,scHero.getStar()); scHeroRankUpConfigByType = STableManager.getFigureConfig(HeroStaticConfig.class).getScHeroRankUpConfigByShow(GlobalsDef.BREAK_TYPE,scHero.getStar());

View File

@ -37,6 +37,8 @@ public class FightEndRequestHandler extends BaseHandler {
MapLogic.getInstance().endMonsterAttackFight(iSession, frames,MessageTypeProto.MessageType.FIGHT_END_RESPONSE); MapLogic.getInstance().endMonsterAttackFight(iSession, frames,MessageTypeProto.MessageType.FIGHT_END_RESPONSE);
}else if(type == 6){ }else if(type == 6){
MapLogic.getInstance().endMainLevelFight(iSession, frames,fightId,MessageTypeProto.MessageType.FIGHT_END_RESPONSE); MapLogic.getInstance().endMainLevelFight(iSession, frames,fightId,MessageTypeProto.MessageType.FIGHT_END_RESPONSE);
}else if(type == 7){
} else { } else {
// MapLogic.getInstance().endFight(iSession, frames, MessageTypeProto.MessageType.FIGHT_END_RESPONSE); // MapLogic.getInstance().endFight(iSession, frames, MessageTypeProto.MessageType.FIGHT_END_RESPONSE);

View File

@ -67,7 +67,9 @@ public class StartFightRequestHandler extends BaseHandler<FightInfoProto.FightSt
MapLogic.getInstance().startMonsterAttackFight(iSession,fightId,teamId, MessageTypeProto.MessageType.FIGHT_START_RESPONSE); MapLogic.getInstance().startMonsterAttackFight(iSession,fightId,teamId, MessageTypeProto.MessageType.FIGHT_START_RESPONSE);
}else if(type == 6){ }else if(type == 6){
MapLogic.getInstance().startMainLevelFight(iSession,fightId,teamId, MessageTypeProto.MessageType.FIGHT_START_RESPONSE); MapLogic.getInstance().startMainLevelFight(iSession,fightId,teamId, MessageTypeProto.MessageType.FIGHT_START_RESPONSE);
} else { } else if(type == 7){
MapLogic.getInstance().startMainLevelFight(iSession,fightId,teamId, MessageTypeProto.MessageType.FIGHT_START_RESPONSE);
}else {
throw new ErrorCodeException(ErrorCode.newDefineCode("type is wrong:" + type)); throw new ErrorCodeException(ErrorCode.newDefineCode("type is wrong:" + type));
} }
} }

View File

@ -8,7 +8,9 @@ public enum KTGameType {
ARENA("竞技场",5), ARENA("竞技场",5),
CHALLENGE_SECURE("挑战秘境BOSS",6), CHALLENGE_SECURE("挑战秘境BOSS",6),
TAKE_SECURE_REWARD("领取秘境奖励",7), TAKE_SECURE_REWARD("领取秘境奖励",7),
CHALLENGE_MONSTERATTACK("挑战兽潮",8); CHALLENGE_MONSTERATTACK("挑战兽潮",8),
CHALLENGE_GUILD_BOSS("工会boss",9),
;
// 成员变量 // 成员变量
private String name; private String name;
private int index; private int index;

View File

@ -13,6 +13,7 @@ public class GuildMyInfo extends MongoBase {
private List<Integer> path = new ArrayList<>(); //行走路线 private List<Integer> path = new ArrayList<>(); //行走路线
private int curPos=STableManager.getFigureConfig(CommonStaticConfig.class).getInitPos();//当前位置 private int curPos=STableManager.getFigureConfig(CommonStaticConfig.class).getInitPos();//当前位置
private long preMoveTimestamp; //上次更新时间 private long preMoveTimestamp; //上次更新时间
private int maxBossHurt; //工会boss最高伤害
public void clearOfLevelGuild(){ public void clearOfLevelGuild(){
path.clear(); path.clear();
curPos = STableManager.getFigureConfig(CommonStaticConfig.class).getInitPos(); curPos = STableManager.getFigureConfig(CommonStaticConfig.class).getInitPos();
@ -74,6 +75,15 @@ public class GuildMyInfo extends MongoBase {
this.path = path; this.path = path;
} }
public int getMaxBossHurt() {
return maxBossHurt;
}
public void setMaxBossHurt(int maxBossHurt) {
updateString("maxBossHurt",maxBossHurt);
this.maxBossHurt = maxBossHurt;
}
public List<Integer> getPath() { public List<Integer> getPath() {
return path; return path;
} }

View File

@ -1,11 +1,17 @@
package com.ljsd.jieling.logic.family; package com.ljsd.jieling.logic.family;
import com.ljsd.GameApplication; import com.ljsd.GameApplication;
import com.ljsd.fight.FightType;
import com.ljsd.jieling.db.mongo.MongoUtil; import com.ljsd.jieling.db.mongo.MongoUtil;
import com.ljsd.jieling.db.redis.RedisKey; import com.ljsd.jieling.db.redis.RedisKey;
import com.ljsd.jieling.db.redis.RedisUtil; import com.ljsd.jieling.db.redis.RedisUtil;
import com.ljsd.jieling.exception.ErrorCode;
import com.ljsd.jieling.exception.ErrorCodeException;
import com.ljsd.jieling.globals.Global; import com.ljsd.jieling.globals.Global;
import com.ljsd.jieling.handler.map.behavior.BehaviorUtil; import com.ljsd.jieling.handler.map.behavior.BehaviorUtil;
import com.ljsd.jieling.ktbeans.KTGameType;
import com.ljsd.jieling.ktbeans.KtEventUtils;
import com.ljsd.jieling.ktbeans.parmsBean.ParamEventBean;
import com.ljsd.jieling.logic.blood.BloodLogic; import com.ljsd.jieling.logic.blood.BloodLogic;
import com.ljsd.jieling.logic.dao.*; import com.ljsd.jieling.logic.dao.*;
import com.ljsd.jieling.logic.dao.root.GuildCache; import com.ljsd.jieling.logic.dao.root.GuildCache;
@ -20,6 +26,7 @@ import com.ljsd.jieling.logic.mission.GameEvent;
import com.ljsd.jieling.network.session.ISession; import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.protocols.CommonProto; import com.ljsd.jieling.protocols.CommonProto;
import com.ljsd.jieling.protocols.Family; import com.ljsd.jieling.protocols.Family;
import com.ljsd.jieling.protocols.FightInfoProto;
import com.ljsd.jieling.protocols.MessageTypeProto; import com.ljsd.jieling.protocols.MessageTypeProto;
import com.ljsd.jieling.thread.ThreadManager; import com.ljsd.jieling.thread.ThreadManager;
import com.ljsd.jieling.thread.task.GuildFightMatchingTask; import com.ljsd.jieling.thread.task.GuildFightMatchingTask;
@ -1027,4 +1034,36 @@ public class GuildFightLogic {
} }
} }
public static void startFight(ISession session) throws Exception {
int uid = session.getUid();
User user = UserManager.getUser(uid);
int teamId = 901;
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId);
if (teamPosHeroInfos == null || teamPosHeroInfos.size() == 0) {
throw new ErrorCodeException(ErrorCode.newDefineCode("阵容有误!!"));
}
KtEventUtils.onKtEvent(user, ParamEventBean.UserGameType, KTGameType.CHALLENGE_GUILD_BOSS.getIndex(),1);
user.getTeamPosManager().setCurTeamPosId(teamId);
String fightInfo = 1 + "#" + teamId;
String key = RedisKey.getKey(RedisKey.LEVE_DIFFICULTY_INFO, String.valueOf(uid), false);
RedisUtil.getInstence().set(key, fightInfo, -1);
//扣除预先道具
FightInfoProto.FightStartResponse.Builder fightStartResponse = FightInfoProto.FightStartResponse.newBuilder();
/* BehaviorUtil.getLevelDifficultyifficuFightInfo(user, FightType.StoryFight,sMainLevelConfig.getMonsterGroup(), teamId, sMainLevelConfig.getRankTime(), fightStartResponse, RedisKey.LEVE_DIFFICULTY_FIGHT);
MessageUtil.sendMessage(session, 1, messageType.getNumber(), fightStartResponse.build(), true);*/
}
public static void endBossFight(ISession session){
}
public static void main(String[] args) {
Random random = new Random();
long seed = System.currentTimeMillis();
random.setSeed(seed);
}
} }

View File

@ -0,0 +1,29 @@
package config;
import manager.Table;
@Table(name ="GuildBossConfig")
public class SGuildBossConfig implements BaseConfig {
private int id;
private int monsterId;
@Override
public void init() throws Exception {
}
public int getId() {
return id;
}
public int getMonsterId() {
return monsterId;
}
}

View File

@ -0,0 +1,47 @@
package config;
import manager.STableManager;
import manager.Table;
import java.util.Map;
import java.util.TreeMap;
@Table(name ="GuildBossRewardConfig")
public class SGuildBossRewardConfig implements BaseConfig {
private int id;
private int damage;
private int[] reward;
private static TreeMap<Integer, SGuildBossRewardConfig> sGuildBossHurtRewardConfig;
@Override
public void init() throws Exception {
Map<Integer, SGuildBossRewardConfig> config = STableManager.getConfig(SGuildBossRewardConfig.class);
TreeMap<Integer, SGuildBossRewardConfig> sGuildBossHurtRewardConfigTmp = new TreeMap<>();
config.values().forEach(item ->sGuildBossHurtRewardConfigTmp.put(item.getDamage(),item));
sGuildBossHurtRewardConfig = sGuildBossHurtRewardConfigTmp;
}
public static SGuildBossRewardConfig getIndexByHurt(int hurtValue){
return sGuildBossHurtRewardConfig.lowerEntry(hurtValue).getValue();
}
public int getId() {
return id;
}
public int getDamage() {
return damage;
}
public int[] getReward() {
return reward;
}
}

View File

@ -70,6 +70,10 @@ public class SGuildSetting implements BaseConfig {
public static SGuildSetting sGuildSetting; public static SGuildSetting sGuildSetting;
private int bossTime;
private int[][] bossReward;
@Override @Override
public void init() throws Exception { public void init() throws Exception {