Merge branch 'master' into equip_develop
# Conflicts: # serverlogic/src/main/java/com/ljsd/jieling/logic/player/PlayerLogic.javaback_recharge
commit
7acbce59c5
|
@ -39,6 +39,7 @@ dependencies {
|
||||||
compile("com.fasterxml.jackson.core:jackson-databind:2.3.3")
|
compile("com.fasterxml.jackson.core:jackson-databind:2.3.3")
|
||||||
compile group: 'com.googlecode.protobuf-java-format', name: 'protobuf-java-format', version: '1.2'
|
compile group: 'com.googlecode.protobuf-java-format', name: 'protobuf-java-format', version: '1.2'
|
||||||
compile group: 'com.google.code.gson', name: 'gson', version: '2.2.4'
|
compile group: 'com.google.code.gson', name: 'gson', version: '2.2.4'
|
||||||
|
compile group: 'cn.thinkingdata', name: 'thinkingdatasdk', version: '1.5.1'
|
||||||
// compile("org.luaj:luaj-jse:3.0.1")
|
// compile("org.luaj:luaj-jse:3.0.1")
|
||||||
compile("org.apache.thrift:libthrift:0.9.2")
|
compile("org.apache.thrift:libthrift:0.9.2")
|
||||||
compile("com.alibaba:fastjson:1.2.47")
|
compile("com.alibaba:fastjson:1.2.47")
|
||||||
|
|
|
@ -71,22 +71,22 @@ public class ReliveExpeditionHeroRequest extends BaseHandler<Expedition.ReliveEx
|
||||||
}
|
}
|
||||||
Set<String> ids = new HashSet<>();
|
Set<String> ids = new HashSet<>();
|
||||||
// 更新队伍血量
|
// 更新队伍血量
|
||||||
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(1001);
|
//List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(1001);
|
||||||
Iterator<TeamPosHeroInfo> iterator = teamPosHeroInfos.iterator();
|
// Iterator<TeamPosHeroInfo> iterator = teamPosHeroInfos.iterator();
|
||||||
while (iterator.hasNext()){
|
// while (iterator.hasNext()){
|
||||||
TeamPosHeroInfo teamPosHeroInfo = iterator.next();
|
// TeamPosHeroInfo teamPosHeroInfo = iterator.next();
|
||||||
Hero hero = user.getHeroManager().getHero(teamPosHeroInfo.getHeroId());
|
// Hero hero = user.getHeroManager().getHero(teamPosHeroInfo.getHeroId());
|
||||||
if (hero == null) {
|
// if (hero == null) {
|
||||||
continue;
|
// continue;
|
||||||
}
|
// }
|
||||||
ids.add(hero.getId());
|
// ids.add(hero.getId());
|
||||||
}
|
// }
|
||||||
|
|
||||||
expeditionManager.getHeroHPWithChange().clear();
|
expeditionManager.getHeroHPWithChange().clear();
|
||||||
|
|
||||||
//更新节点
|
//更新节点
|
||||||
Expedition.ExpeditionNodeInfoIndication.Builder builder = Expedition.ExpeditionNodeInfoIndication.newBuilder();
|
Expedition.ExpeditionNodeInfoIndication.Builder builder = Expedition.ExpeditionNodeInfoIndication.newBuilder();
|
||||||
builder.addAllHeroInfo(ExpeditionLogic.getInstance().getAllHeroInfo(user,ids));
|
builder.addAllHeroInfo(ExpeditionLogic.getInstance().getAllHeroInfo(user,new HashSet<>()));
|
||||||
MessageUtil.sendIndicationMessage(iSession, 1, MessageTypeProto.MessageType.EXPEDITION_NOINFO_INDICATION_VALUE, builder.build(), true);
|
MessageUtil.sendIndicationMessage(iSession, 1, MessageTypeProto.MessageType.EXPEDITION_NOINFO_INDICATION_VALUE, builder.build(), true);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -0,0 +1,58 @@
|
||||||
|
package com.ljsd.jieling.handler.arena;
|
||||||
|
|
||||||
|
import com.google.protobuf.GeneratedMessage;
|
||||||
|
import com.ljsd.jieling.exception.ErrorCode;
|
||||||
|
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||||
|
import com.ljsd.jieling.globals.BIReason;
|
||||||
|
import com.ljsd.jieling.handler.BaseHandler;
|
||||||
|
import com.ljsd.jieling.logic.dao.ArenaManager;
|
||||||
|
import com.ljsd.jieling.logic.dao.UserManager;
|
||||||
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
|
import com.ljsd.jieling.protocols.ArenaInfoProto;
|
||||||
|
import com.ljsd.jieling.protocols.CommonProto;
|
||||||
|
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||||
|
import com.ljsd.jieling.util.ItemUtil;
|
||||||
|
import config.SArenaBattleReward;
|
||||||
|
import manager.STableManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description: des
|
||||||
|
* Author: zsx
|
||||||
|
* CreateDate: 2020/7/6 21:19
|
||||||
|
*/
|
||||||
|
public class TakeArenaBattleRewardRequestHandler extends BaseHandler<ArenaInfoProto.TakeArenaBattleRewardRequest> {
|
||||||
|
@Override
|
||||||
|
public MessageTypeProto.MessageType getMessageCode() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GeneratedMessage processWithProto(int uid, ArenaInfoProto.TakeArenaBattleRewardRequest proto) throws Exception {
|
||||||
|
|
||||||
|
int missionId = proto.getMissionId();
|
||||||
|
//check cfg
|
||||||
|
SArenaBattleReward sArenaBattleReward = STableManager.getConfig(SArenaBattleReward.class).get(missionId);
|
||||||
|
if(sArenaBattleReward==null){
|
||||||
|
throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
User user = UserManager.getUser(uid);
|
||||||
|
ArenaManager arenaManager = user.getArenaManager();
|
||||||
|
//幂等
|
||||||
|
boolean contains = arenaManager.getHadTakeReward().contains(missionId);
|
||||||
|
if(contains){
|
||||||
|
throw new ErrorCodeException(ErrorCode.HAD_TAKE_REWARD);
|
||||||
|
}
|
||||||
|
|
||||||
|
//check condition
|
||||||
|
boolean b = sArenaBattleReward.getBattleTimes() > arenaManager.getFailNums() + arenaManager.getSuccessNums();
|
||||||
|
if(b){
|
||||||
|
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE);
|
||||||
|
}
|
||||||
|
arenaManager.getHadTakeReward().add(missionId);
|
||||||
|
//drop
|
||||||
|
int[][] reward = sArenaBattleReward.getReward();
|
||||||
|
CommonProto.Drop.Builder drop = ItemUtil.drop(user, reward, BIReason.EXPEDITION_BOX_REWARD);
|
||||||
|
return ArenaInfoProto.TakeArenaBattleRewardResponse.newBuilder().setDrop(drop).build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,10 +2,7 @@ package com.ljsd.jieling.logic.dao;
|
||||||
|
|
||||||
import com.ljsd.common.mogodb.MongoBase;
|
import com.ljsd.common.mogodb.MongoBase;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
|
|
||||||
public class ArenaManager extends MongoBase {
|
public class ArenaManager extends MongoBase {
|
||||||
|
@ -26,7 +23,7 @@ public class ArenaManager extends MongoBase {
|
||||||
|
|
||||||
|
|
||||||
private List<ArenaEnemy> arenaEnemies;
|
private List<ArenaEnemy> arenaEnemies;
|
||||||
|
private List<Integer> hadTakeReward;
|
||||||
|
|
||||||
public void updateChallenge(int fightResult){
|
public void updateChallenge(int fightResult){
|
||||||
if(fightResult == 1){
|
if(fightResult == 1){
|
||||||
|
@ -89,12 +86,14 @@ public class ArenaManager extends MongoBase {
|
||||||
this.count=0;
|
this.count=0;
|
||||||
this.flushTime=0;
|
this.flushTime=0;
|
||||||
this.flushNums=0;
|
this.flushNums=0;
|
||||||
|
hadTakeReward=new LinkedList<>();
|
||||||
updateString("season",season);
|
updateString("season",season);
|
||||||
updateString("failNums",failNums);
|
updateString("failNums",failNums);
|
||||||
updateString("successNums",successNums);
|
updateString("successNums",successNums);
|
||||||
updateString("count",count);
|
updateString("count",count);
|
||||||
updateString("flushTime",flushTime);
|
updateString("flushTime",flushTime);
|
||||||
updateString("flushNums",flushNums);
|
updateString("flushNums",flushNums);
|
||||||
|
updateString("hadTakeReward",hadTakeReward);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTopMaxRank() {
|
public int getTopMaxRank() {
|
||||||
|
@ -105,4 +104,13 @@ public class ArenaManager extends MongoBase {
|
||||||
this.topMaxRank = topMaxRank;
|
this.topMaxRank = topMaxRank;
|
||||||
updateString("topMaxRank",topMaxRank);
|
updateString("topMaxRank",topMaxRank);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Integer> getHadTakeReward() {
|
||||||
|
if(null ==hadTakeReward){
|
||||||
|
hadTakeReward= new LinkedList<>();
|
||||||
|
}
|
||||||
|
updateString("hadTakeReward",hadTakeReward);
|
||||||
|
return hadTakeReward;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,12 +60,28 @@ public class Hero extends MongoBase {
|
||||||
this.id = KeyGenUtils.produceIdByModule(UUIDEnum.HERO, uid);
|
this.id = KeyGenUtils.produceIdByModule(UUIDEnum.HERO, uid);
|
||||||
this.templateId = heroTid;
|
this.templateId = heroTid;
|
||||||
this.level = initStar;
|
this.level = initStar;
|
||||||
int[] heroStar = SItem.getsItemMap().get(heroTid).getHeroStar();
|
SCHero hero1 = SCHero.getsCHero().get(heroTid);
|
||||||
this.star =heroStar[1] ;
|
int initCfgStar = hero1.getStar();
|
||||||
|
int maxStar = hero1.getMaxRank();
|
||||||
|
if(hero.getStar()<initCfgStar){
|
||||||
|
this.star =initCfgStar;
|
||||||
|
}else if(hero.getStar()>maxStar){
|
||||||
|
this.star=maxStar;
|
||||||
|
}else {
|
||||||
|
this.star = hero.getStar();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(initCfgStar!=hero.getStar()){
|
||||||
|
Map<Integer, SCHeroRankUpConfig> scHeroRankUpConfigByType = STableManager.getFigureConfig(HeroStaticConfig.class).getScHeroRankUpConfigByShow(GlobalsDef.UP_STAR_TYPE,initCfgStar);
|
||||||
|
if(scHeroRankUpConfigByType!=null) {
|
||||||
|
SCHeroRankUpConfig scHeroRankUpConfig = scHeroRankUpConfigByType.get(hero.getStar()-1);
|
||||||
|
starBreakId = scHeroRankUpConfig.getId();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.equipByPositionMap = new HashMap<>();
|
this.equipByPositionMap = new HashMap<>();
|
||||||
this.soulEquipByPositionMap = hero.soulEquipByPositionMap;
|
this.soulEquipByPositionMap = hero.soulEquipByPositionMap;
|
||||||
this.breakId = hero.breakId;
|
this.breakId = hero.breakId;
|
||||||
this.starBreakId = hero.starBreakId;
|
|
||||||
this.createTime = (int)(System.currentTimeMillis()/1000);
|
this.createTime = (int)(System.currentTimeMillis()/1000);
|
||||||
this.speed = hero.speed;
|
this.speed = hero.speed;
|
||||||
this.especialEquipLevel = hero.especialEquipLevel;
|
this.especialEquipLevel = hero.especialEquipLevel;
|
||||||
|
@ -85,10 +101,10 @@ public class Hero extends MongoBase {
|
||||||
this.especialEquipLevel = 1;
|
this.especialEquipLevel = 1;
|
||||||
if(initStar!=scHero.getStar()){
|
if(initStar!=scHero.getStar()){
|
||||||
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());
|
||||||
if(scHeroRankUpConfigByType!=null) {
|
if(scHeroRankUpConfigByType!=null) {
|
||||||
SCHeroRankUpConfig scHeroRankUpConfig = scHeroRankUpConfigByType.get(initStar-1);
|
SCHeroRankUpConfig scHeroRankUpConfig = scHeroRankUpConfigByType.get(initStar-1);
|
||||||
starBreakId = scHeroRankUpConfig.getId();
|
starBreakId = scHeroRankUpConfig.getId();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
createTime = (int)(System.currentTimeMillis()/1000);
|
createTime = (int)(System.currentTimeMillis()/1000);
|
||||||
|
|
|
@ -480,10 +480,10 @@ public class ExpeditionLogic {
|
||||||
}
|
}
|
||||||
int ints = staffsSet.size()+1;//默认品质
|
int ints = staffsSet.size()+1;//默认品质
|
||||||
try {
|
try {
|
||||||
ints = MathUtils.randomFromWeight(cfg.getHolyProbability());
|
ints = MathUtils.randomFromWeight(cfg.getHolyProbability());
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
break;
|
break;
|
||||||
// e.printStackTrace();
|
// e.printStackTrace();
|
||||||
}
|
}
|
||||||
Map<Integer, Integer> type2holy2weight = STableManager.getFigureConfig(CommonStaticConfig.class).getType2holy2weight(ints);
|
Map<Integer, Integer> type2holy2weight = STableManager.getFigureConfig(CommonStaticConfig.class).getType2holy2weight(ints);
|
||||||
int i1 = ranndomFromWeight(type2holy2weight);
|
int i1 = ranndomFromWeight(type2holy2weight);
|
||||||
|
@ -747,7 +747,7 @@ public class ExpeditionLogic {
|
||||||
}
|
}
|
||||||
SExpeditionHolyConfig orDefault = effectItems.getOrDefault(sExpeditionHolyConfig.geteffect(), null);
|
SExpeditionHolyConfig orDefault = effectItems.getOrDefault(sExpeditionHolyConfig.geteffect(), null);
|
||||||
if(null!=orDefault&&sExpeditionHolyConfig.gettype()<=orDefault.gettype()){
|
if(null!=orDefault&&sExpeditionHolyConfig.gettype()<=orDefault.gettype()){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
effectItems.put(sExpeditionHolyConfig.geteffect(),sExpeditionHolyConfig);
|
effectItems.put(sExpeditionHolyConfig.geteffect(),sExpeditionHolyConfig);
|
||||||
}
|
}
|
||||||
|
@ -873,8 +873,8 @@ public class ExpeditionLogic {
|
||||||
// if(isTemp){
|
// if(isTemp){
|
||||||
// user.getExpeditionManager().addEquipToTemp(user, newequip);
|
// user.getExpeditionManager().addEquipToTemp(user, newequip);
|
||||||
// }else {
|
// }else {
|
||||||
user.getExpeditionManager().addEquip(user, newequip);
|
user.getExpeditionManager().addEquip(user, newequip);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
newHero.updateEquipPositionMap(next.getKey(), equipId);
|
newHero.updateEquipPositionMap(next.getKey(), equipId);
|
||||||
}
|
}
|
||||||
|
@ -888,11 +888,11 @@ public class ExpeditionLogic {
|
||||||
Jewel j = (Jewel) propertyItem;
|
Jewel j = (Jewel) propertyItem;
|
||||||
Jewel newequip = new Jewel(user.getId(), j.getEquipId());
|
Jewel newequip = new Jewel(user.getId(), j.getEquipId());
|
||||||
|
|
||||||
// if(isTemp){
|
// if(isTemp){
|
||||||
// user.getExpeditionManager().addEquipToTemp(user, newequip);
|
// user.getExpeditionManager().addEquipToTemp(user, newequip);
|
||||||
// }else {
|
// }else {
|
||||||
user.getExpeditionManager().addEquip(user, newequip);
|
user.getExpeditionManager().addEquip(user, newequip);
|
||||||
// }
|
// }
|
||||||
newHero.addJewel(newequip.getId());
|
newHero.addJewel(newequip.getId());
|
||||||
}
|
}
|
||||||
if(isTemp){
|
if(isTemp){
|
||||||
|
@ -918,9 +918,30 @@ public class ExpeditionLogic {
|
||||||
|
|
||||||
//random ids
|
//random ids
|
||||||
TreeSet<Integer> tempid = new TreeSet<>();
|
TreeSet<Integer> tempid = new TreeSet<>();
|
||||||
|
Set<Integer> tempType = new HashSet<>();
|
||||||
|
int i=0;
|
||||||
while (tempid.size()<size){
|
while (tempid.size()<size){
|
||||||
|
if(i>1000){
|
||||||
|
LOGGER.error("getRandomTidException:条件不匹配");
|
||||||
|
break;
|
||||||
|
}
|
||||||
int i1 = ranndomFromWeight(cfg);
|
int i1 = ranndomFromWeight(cfg);
|
||||||
|
SExpeditionRecruitConfig sExpeditionRecruitConfig = STableManager.getConfig(SExpeditionRecruitConfig.class).get(i1);
|
||||||
|
SCHero hero1 = SCHero.getsCHero().get(sExpeditionRecruitConfig.getHeroId());
|
||||||
|
i++;
|
||||||
|
if(hero1==null){
|
||||||
|
LOGGER.error("英雄配置不存在"+i1);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
int propertyName = hero1.getPropertyName();
|
||||||
|
if(tempType.contains(propertyName)){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
tempid.add(i1);
|
tempid.add(i1);
|
||||||
|
tempType.add(propertyName);
|
||||||
|
i++;
|
||||||
|
|
||||||
}
|
}
|
||||||
return tempid;
|
return tempid;
|
||||||
|
|
||||||
|
|
|
@ -593,6 +593,18 @@ public class GuildLogic {
|
||||||
RedisUtil.getInstence().removeMapEntrys(RedisKey.USER_LEVEL_GUILD_INFO,"",String.valueOf(applyId));
|
RedisUtil.getInstence().removeMapEntrys(RedisKey.USER_LEVEL_GUILD_INFO,"",String.valueOf(applyId));
|
||||||
Poster.getPoster().dispatchEvent(new GuildForceChangeEvent(targetUser.getId(),targetUser.getPlayerInfoManager().getGuildId(),1,targetUser.getPlayerInfoManager().getMaxForce()));
|
Poster.getPoster().dispatchEvent(new GuildForceChangeEvent(targetUser.getId(),targetUser.getPlayerInfoManager().getGuildId(),1,targetUser.getPlayerInfoManager().getMaxForce()));
|
||||||
|
|
||||||
|
|
||||||
|
Family.GuildHelpInfoIndication.Builder builder = Family.GuildHelpInfoIndication.newBuilder();
|
||||||
|
for (Map.Entry<Integer, Integer> entry : targetUser.getGuildMyInfo().getGuidHelpInfo().entrySet()) {
|
||||||
|
builder.addGuildHelpInfo(CommonProto.GuildHelpInfo.newBuilder()
|
||||||
|
.setHadtakenum(targetUser.getGuildMyInfo().getGuidHelpHadTakeInfo().getOrDefault(entry.getKey(),0))
|
||||||
|
.setType(entry.getKey())
|
||||||
|
.setNum(entry.getValue()));
|
||||||
|
}
|
||||||
|
|
||||||
|
//notify all change
|
||||||
|
Family.GuildHelpInfoIndication build = builder.setUid(targetUser.getId()).setName(targetUser.getPlayerInfoManager().getNickName()).build();
|
||||||
|
GuildLogic.sendIndicationToMember(GuilidManager.guildInfoMap.get(guildInfo.getId()), MessageTypeProto.MessageType.GuildHelpInfoIndication,build);
|
||||||
// targetUser.getUserMissionManager().onGameEvent(targetUser, GameEvent.JOIN_FAMILY);
|
// targetUser.getUserMissionManager().onGameEvent(targetUser, GameEvent.JOIN_FAMILY);
|
||||||
}finally {
|
}finally {
|
||||||
RedisUtil.getInstence().releaseDistributedLock(RedisKey.OPERATE_FAMILY_APPLY_JOIN,Integer.toString(applyId), Integer.toString(applyId));
|
RedisUtil.getInstence().releaseDistributedLock(RedisKey.OPERATE_FAMILY_APPLY_JOIN,Integer.toString(applyId), Integer.toString(applyId));
|
||||||
|
@ -1380,7 +1392,7 @@ public class GuildLogic {
|
||||||
RedisUtil.getInstence().putMapEntry(RedisKey.USER_LEVEL_GUILD_INFO,"",String.valueOf(user.getId()),guildId);
|
RedisUtil.getInstence().putMapEntry(RedisKey.USER_LEVEL_GUILD_INFO,"",String.valueOf(user.getId()),guildId);
|
||||||
//删除战力
|
//删除战力
|
||||||
Poster.getPoster().dispatchEvent(new GuildForceChangeEvent(user.getId(),user.getPlayerInfoManager().getGuildId(),3,0-user.getPlayerInfoManager().getMaxForce()));
|
Poster.getPoster().dispatchEvent(new GuildForceChangeEvent(user.getId(),user.getPlayerInfoManager().getGuildId(),3,0-user.getPlayerInfoManager().getMaxForce()));
|
||||||
//notify all
|
//notify ALL
|
||||||
Family.GuildHelpInfoIndication.Builder build = Family.GuildHelpInfoIndication.newBuilder();
|
Family.GuildHelpInfoIndication.Builder build = Family.GuildHelpInfoIndication.newBuilder();
|
||||||
for (Map.Entry<Integer, Integer> entry : user.getGuildMyInfo().getGuidHelpInfo().entrySet()) {
|
for (Map.Entry<Integer, Integer> entry : user.getGuildMyInfo().getGuidHelpInfo().entrySet()) {
|
||||||
//通知前端清除公会成员援助信息
|
//通知前端清除公会成员援助信息
|
||||||
|
@ -1436,4 +1448,5 @@ public class GuildLogic {
|
||||||
MailLogic.getInstance().sendMail(user.getId(),title,content,mailReward,(int) (TimeUtils.now()/1000), Global.MAIL_EFFECTIVE_TIME);
|
MailLogic.getInstance().sendMail(user.getId(),title,content,mailReward,(int) (TimeUtils.now()/1000), Global.MAIL_EFFECTIVE_TIME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1705,9 +1705,9 @@ public class HeroLogic{
|
||||||
float score = sPropertyConfig.getScore();
|
float score = sPropertyConfig.getScore();
|
||||||
|
|
||||||
result += propertyValue*score;
|
result += propertyValue*score;
|
||||||
// LOGGER.info("the propertyId={} the value is ={},propertyValue={},score={},result ={},the value={}",propertyId,propertyValue*score,propertyValue,score,result,propertyValue*score);
|
// LOGGER.info("the propertyId={} the value is ={},propertyValue={},score={},result ={},the value={}",propertyId,propertyValue*score,propertyValue,score,result,propertyValue*score);
|
||||||
}
|
}
|
||||||
// System.out.println(result);
|
// System.out.println(result);
|
||||||
return (int)result;
|
return (int)result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1813,7 +1813,7 @@ public class HeroLogic{
|
||||||
|
|
||||||
private void wearJewel(Hero hero,EquipManager equipManager,String equipId)throws Exception{
|
private void wearJewel(Hero hero,EquipManager equipManager,String equipId)throws Exception{
|
||||||
Jewel equip =(Jewel)equipManager.getEquipMap().get(equipId);
|
Jewel equip =(Jewel)equipManager.getEquipMap().get(equipId);
|
||||||
if( null == equip || null == hero ){
|
if( null == equip || null == hero ||hero.getJewelInfo().contains(equipId)){
|
||||||
throw new ErrorCodeException(ErrorCode.HERO_EQUIP_ERR);
|
throw new ErrorCodeException(ErrorCode.HERO_EQUIP_ERR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -246,7 +246,7 @@ public class PlayerLogic {
|
||||||
int vipLevel = playerInfoManager.getVipLevel();
|
int vipLevel = playerInfoManager.getVipLevel();
|
||||||
playerInfoManager.setVipLevel(vipLevel+1);
|
playerInfoManager.setVipLevel(vipLevel+1);
|
||||||
user.getUserMissionManager().onGameEvent(user,GameEvent.VIP_LEVLUP,playerInfoManager.getVipLevel());
|
user.getUserMissionManager().onGameEvent(user,GameEvent.VIP_LEVLUP,playerInfoManager.getVipLevel());
|
||||||
// CombatLogic.getInstance().getNewAdventureReward(user, true,TimeUtils.nowInt());
|
CombatLogic.getInstance().getNewAdventureReward(user, true,TimeUtils.nowInt());
|
||||||
List<CommonProto.UserMissionInfo> missionList = new ArrayList<>();
|
List<CommonProto.UserMissionInfo> missionList = new ArrayList<>();
|
||||||
MissionLoigc.getVipMission(user,missionList);
|
MissionLoigc.getVipMission(user,missionList);
|
||||||
CommonProto.VipBaseInfo vipInfoProto = CommonProto.VipBaseInfo.newBuilder()
|
CommonProto.VipBaseInfo vipInfoProto = CommonProto.VipBaseInfo.newBuilder()
|
||||||
|
@ -654,8 +654,8 @@ public class PlayerLogic {
|
||||||
for(String equipId : hero.getJewelInfo()){
|
for(String equipId : hero.getJewelInfo()){
|
||||||
builder.addEquip(CBean2Proto.getEquipProto(equipMap.get(equipId)));
|
builder.addEquip(CBean2Proto.getEquipProto(equipMap.get(equipId)));
|
||||||
}
|
}
|
||||||
for(Integer equipId : hero.getEquipByPositionMap().values()){
|
for(String equipId : hero.getEquipByPositionMap().values()){
|
||||||
builder.addEquip(CBean2Proto.getEquipProto(equipId));
|
builder.addEquip(CBean2Proto.getEquipProto(equipMap.get(equipId)));
|
||||||
}
|
}
|
||||||
builder.setForce(HeroLogic.getInstance().calForce(heroNotBufferAttribute));
|
builder.setForce(HeroLogic.getInstance().calForce(heroNotBufferAttribute));
|
||||||
builder.setHero(CBean2Proto.getHero(hero));
|
builder.setHero(CBean2Proto.getHero(hero));
|
||||||
|
|
|
@ -285,10 +285,10 @@ public class BuyGoodsLogic {
|
||||||
}else {
|
}else {
|
||||||
rechargeInfo.putDyGoodsCanBuyTimes(goodsId,dytime);
|
rechargeInfo.putDyGoodsCanBuyTimes(goodsId,dytime);
|
||||||
}
|
}
|
||||||
// List<CommonProto.GiftGoodsInfo> goodsBagInfo = new ArrayList<>(SRechargeCommodityConfig.rechargeCommodityConfigMap.size());
|
List<CommonProto.GiftGoodsInfo> goodsBagInfo = new ArrayList<>(SRechargeCommodityConfig.rechargeCommodityConfigMap.size());
|
||||||
// BuyGoodsLogic.getGoodsBagInfo(uid, goodsBagInfo,false);
|
BuyGoodsLogic.getGoodsBagInfo(uid, goodsBagInfo,false);
|
||||||
// PlayerInfoProto.AllGiftGoodsIndication build = PlayerInfoProto.AllGiftGoodsIndication.newBuilder().addAllGiftGoodsInfo(goodsBagInfo).build();
|
PlayerInfoProto.AllGiftGoodsIndication build = PlayerInfoProto.AllGiftGoodsIndication.newBuilder().addAllGiftGoodsInfo(goodsBagInfo).build();
|
||||||
// MessageUtil.sendIndicationMessage(session,1, MessageTypeProto.MessageType.ALL_GIFTGOODS_INDICATION_VALUE,build,true);
|
MessageUtil.sendIndicationMessage(session,1, MessageTypeProto.MessageType.ALL_GIFTGOODS_INDICATION_VALUE,build,true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -121,7 +121,7 @@ public class ThreadManager implements IManager {
|
||||||
scheduledFutureSets.add(scheduledExecutor.scheduleAtFixedRate(platConfigureTask, 10, SLEEP_INTEVAL_TIME, TimeUnit.SECONDS));
|
scheduledFutureSets.add(scheduledExecutor.scheduleAtFixedRate(platConfigureTask, 10, SLEEP_INTEVAL_TIME, TimeUnit.SECONDS));
|
||||||
scheduledFutureSets.add( scheduledExecutor.scheduleAtFixedRate(new MinuteTask(), delayForMinute, 60, TimeUnit.SECONDS));
|
scheduledFutureSets.add( scheduledExecutor.scheduleAtFixedRate(new MinuteTask(), delayForMinute, 60, TimeUnit.SECONDS));
|
||||||
scheduledFutureSets.add( scheduledExecutor.scheduleAtFixedRate(new SecondsTask(), 0, 1, TimeUnit.SECONDS));
|
scheduledFutureSets.add( scheduledExecutor.scheduleAtFixedRate(new SecondsTask(), 0, 1, TimeUnit.SECONDS));
|
||||||
scheduledFutureSets.add( scheduledExecutor.scheduleAtFixedRate(new FetchBloodyEndDataThread(), 0, 1, TimeUnit.SECONDS));
|
// scheduledFutureSets.add( scheduledExecutor.scheduleAtFixedRate(new FetchBloodyEndDataThread(), 0, 1, TimeUnit.SECONDS));
|
||||||
scheduledFutureSets.add( scheduledExecutor.scheduleAtFixedRate(new Thread(){
|
scheduledFutureSets.add( scheduledExecutor.scheduleAtFixedRate(new Thread(){
|
||||||
public void run () {
|
public void run () {
|
||||||
long lastMilis = System.currentTimeMillis();
|
long lastMilis = System.currentTimeMillis();
|
||||||
|
|
|
@ -38,8 +38,8 @@ public class MessageUtil {
|
||||||
backMessage = new byte[0];
|
backMessage = new byte[0];
|
||||||
} else {
|
} else {
|
||||||
backMessage = generatedMessage.toByteArray();
|
backMessage = generatedMessage.toByteArray();
|
||||||
if (backMessage.length != 0)
|
//if (backMessage.length != 0)
|
||||||
LOGGER.info("\r\n" + "uid:" + uid + ":\r\n" + JsonFormat.printToString(generatedMessage));
|
//LOGGER.info("\r\n" + "uid:" + uid + ":\r\n" + JsonFormat.printToString(generatedMessage));
|
||||||
}
|
}
|
||||||
|
|
||||||
int length = PackageConstant.UID_FIELD_LEN + PackageConstant.TOKEN_LEN
|
int length = PackageConstant.UID_FIELD_LEN + PackageConstant.TOKEN_LEN
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
package config;
|
||||||
|
|
||||||
|
import manager.Table;
|
||||||
|
|
||||||
|
@Table(name ="ArenaBattleReward")
|
||||||
|
public class SArenaBattleReward implements BaseConfig {
|
||||||
|
|
||||||
|
private int id;
|
||||||
|
|
||||||
|
private int battleTimes;
|
||||||
|
|
||||||
|
private int[][] reward;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init() throws Exception {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getBattleTimes() {
|
||||||
|
return battleTimes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[][] getReward() {
|
||||||
|
return reward;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue