Merge branch 'master' of http://60.1.1.230/backend/jieling_server
commit
fc7db60512
|
@ -67,6 +67,7 @@ public class GameApplication {
|
|||
app.setWebEnvironment(false);
|
||||
|
||||
configurableApplicationContext = app.run(args);
|
||||
|
||||
ServerConfiguration serverConfiguration = configurableApplicationContext.getBean(ServerConfiguration.class);
|
||||
serverProperties = serverConfiguration.getServerProperties();
|
||||
serverId = serverProperties.getId();
|
||||
|
@ -75,6 +76,8 @@ public class GameApplication {
|
|||
LOGGER.info("ServerProperties ->{},coreIp=>{}", serverProperties.toString());
|
||||
RedisUtil.getInstence().init(configurableApplicationContext);
|
||||
MongoUtil.getInstence().init(configurableApplicationContext);
|
||||
//todo 设置开服时间
|
||||
setRegisterTime();// might loop
|
||||
//注册消息处理方法
|
||||
register(configurableApplicationContext);
|
||||
ProtocolsManager protocolsManager = ProtocolsManager.getInstance();
|
||||
|
@ -85,8 +88,6 @@ public class GameApplication {
|
|||
|
||||
//http线程池初始化
|
||||
// HttpPool.init();
|
||||
//todo 设置开服时间
|
||||
setRegisterTime();// might loop
|
||||
GuilidManager.init();
|
||||
|
||||
STableManager.initialize("config");
|
||||
|
|
|
@ -170,6 +170,14 @@ public class ArenaLogic {
|
|||
|
||||
if(arenaManager.getCount() != 0){
|
||||
myscore = RedisUtil.getInstence().getZSetScore(RedisKey.ARENA_RANK,Integer.toString(curSeason), Integer.toString(uid)).intValue();
|
||||
}else{
|
||||
if(curSeason>1){
|
||||
int lastScore = RedisUtil.getInstence().getZSetScore(RedisKey.ARENA_RANK, Integer.toString(curSeason - 1), Integer.toString(uid)).intValue();
|
||||
if(lastScore!=-1){
|
||||
myscore = lastScore;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
user.getTeamPosManager().setCurTeamPosId(teamId);
|
||||
|
||||
|
@ -189,6 +197,7 @@ public class ArenaLogic {
|
|||
arenaRecord.setAttackForce( HeroLogic.getInstance().calTeamTotalForce(user, GlobalsDef.TEAM_ARENA_DEFENSE,false));
|
||||
arenaRecord.setCreateTime((int)(System.currentTimeMillis()/1000));
|
||||
arenaRecord.setId(KeyGenUtils.produceIdByModule(UUIDEnum.ARENARECORD,uid));
|
||||
arenaRecord.setFightResult(fightResult);
|
||||
RedisUtil.getInstence().putMapEntry(RedisKey.ARENA_RRECORD,Integer.toString(challengeUid),arenaRecord.getId(),arenaRecord);
|
||||
RedisUtil.getInstence().incrementZsetScore(RedisKey.ARENA_RANK,Integer.toString(curSeason),Integer.toString(challengeUid),defScoreChange);
|
||||
MessageUtil.sendRedIndication(challengeUid,GlobalsDef.ARENA_CHALLENGE_TYPE);
|
||||
|
@ -211,7 +220,11 @@ public class ArenaLogic {
|
|||
setMyArenaEnemys(uid,user);
|
||||
arenaManager.updateChallenge(fightResult);
|
||||
//组战斗数据
|
||||
ArenaInfoProto.ArenaChallengeResponse build = builder.setMyScoreChange(myscoreChange).setDefScoreChange(defScoreChange).addAllArenaEnemys(getArenaEnemyList(arenaManager.getArenaEnemies())).build();
|
||||
ArenaInfoProto.ArenaChallengeResponse build = builder
|
||||
.setMyScoreChange(myscoreChange).setDefScoreChange(defScoreChange)
|
||||
.addAllArenaEnemys(getArenaEnemyList(arenaManager.getArenaEnemies()))
|
||||
.setFightResult(fightResult)
|
||||
.build();
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.ARENA_CHALLENGE,fightResult,myscoreChange + myscore);
|
||||
Poster.getPoster().dispatchEvent(new ArenaChallengeEvent(user.getId()));
|
||||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.ARENA_CHALLENGE_RESPONSE_VALUE,build,true);
|
||||
|
@ -535,6 +548,7 @@ public class ArenaLogic {
|
|||
.setAttackInfo(arenaPersonInfo)
|
||||
.setMyScoreChange(arenaRecord.getDefScore())
|
||||
.setAttackTime(arenaRecord.getCreateTime())
|
||||
.setFightResult(arenaRecord.getFightResult())
|
||||
.build());
|
||||
}
|
||||
|
||||
|
|
|
@ -16,6 +16,8 @@ public class ArenaRecord {
|
|||
|
||||
private int createTime;
|
||||
|
||||
private int fightResult;
|
||||
|
||||
public ArenaRecord(){}
|
||||
|
||||
public int getAttackId() {
|
||||
|
@ -66,5 +68,11 @@ public class ArenaRecord {
|
|||
this.id = id;
|
||||
}
|
||||
|
||||
public int getFightResult() {
|
||||
return fightResult;
|
||||
}
|
||||
|
||||
public void setFightResult(int fightResult) {
|
||||
this.fightResult = fightResult;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -903,7 +903,7 @@ public class CombatLogic {
|
|||
ItemUtil.combineReward(user,true,randomRewardMin, times,baseItemMap,baseCardMap,baseEquipMap,baseRandomMap,BIReason.ADVENTURE_BASE_REWARD);
|
||||
int timesTemp =times;
|
||||
while (!viewBaseReward&×Temp-->0){
|
||||
ItemUtil.combineReward(user,false,sMainLevelConfig.getRandomReward(), 1f,randomItemMap,randomCardMap,randomEquipMap,randomRandomMap,BIReason.ADVENTURE_RANDOM_REWARDD);
|
||||
ItemUtil.combineReward(user,true,sMainLevelConfig.getRandomReward(), 1f,randomItemMap,randomCardMap,randomEquipMap,randomRandomMap,BIReason.ADVENTURE_RANDOM_REWARDD);
|
||||
}
|
||||
takeTimes+=times;
|
||||
}
|
||||
|
@ -926,6 +926,7 @@ public class CombatLogic {
|
|||
lastTimeTakes=times;
|
||||
}
|
||||
ItemUtil.extraAddItem(user,baseItemMap);
|
||||
ItemUtil.extraAddItem(user,randomItemMap);
|
||||
if(viewBaseReward){
|
||||
myResult = true;
|
||||
rewardStr = ItemUtil.getReward(baseItemMap, baseCardMap, baseEquipMap, baseRandomMap);
|
||||
|
|
|
@ -32,6 +32,7 @@ import org.slf4j.LoggerFactory;
|
|||
import util.MathUtils;
|
||||
import util.StringUtil;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.rmi.server.ExportException;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
@ -1291,7 +1292,7 @@ public class HeroLogic {
|
|||
effectValue += targetValue;
|
||||
heroAllAttribute.put(targetPropertyId,effectValue);
|
||||
}else{
|
||||
propertyPercentMap.put(targetPropertyId,10000+effectValue);
|
||||
propertyPercentMap.put(targetPropertyId,effectValue);
|
||||
}
|
||||
iterator.remove();
|
||||
}
|
||||
|
@ -1299,7 +1300,7 @@ public class HeroLogic {
|
|||
for(Map.Entry<Integer,Integer> item : propertyPercentMap.entrySet()){
|
||||
Integer propertyId = item.getKey();
|
||||
Integer propertyValue = heroAllAttribute.get(propertyId);
|
||||
heroAllAttribute.put(propertyId,(int)(propertyValue/10000f*item.getValue()));
|
||||
heroAllAttribute.put(propertyId,propertyValue+BigDecimal.valueOf(propertyValue/10000f).multiply(BigDecimal.valueOf(item.getValue())).intValue());
|
||||
}
|
||||
Integer maxHp = heroAllAttribute.get(HeroAttributeEnum.Hp.getPropertyId());
|
||||
Integer curHp = heroAllAttribute.get(HeroAttributeEnum.CurHP.getPropertyId());
|
||||
|
|
Loading…
Reference in New Issue