Merge branch 'master_test_hw' of http://60.1.1.230/backend/jieling_server into master_test_hw
commit
5a84536aa6
|
@ -35,7 +35,7 @@ public class LogLinkedList<E> extends WrapList<E> {
|
|||
}
|
||||
|
||||
private void upString(E value){
|
||||
mongoBase.updateString(name,value);
|
||||
mongoBase.updateString(name,getWrapped());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -18,15 +18,22 @@
|
|||
</Jbean>
|
||||
|
||||
<Jbean name="LuckWheelMission">
|
||||
<Variable name="posInfoMap" type="map" key="int" value="LuckWheelPosInfo" />
|
||||
<Variable name="posInfoMap" type="map" key="int" value="LuckWheelPosInfo" />
|
||||
<Variable name="refreshTime" type="int"/>
|
||||
</Jbean>
|
||||
|
||||
|
||||
<Jbean name="SubRewardPoolInfo">
|
||||
<Variable name="subRewardPool" type="list" value="int"/>挖矿奖池
|
||||
<Variable name="lay" type="int"/>挖矿奖池层
|
||||
</Jbean>
|
||||
|
||||
<Jbean name="ActivityManager">
|
||||
<Variable name="activityMissionMap" type="map" key="int" value="ActivityMission" />
|
||||
<Variable name="senvenStartTime" type="long"/> 七日狂欢开始时间
|
||||
<Variable name="luckWheel" type="LuckWheelMission"/>幸运探宝奖池
|
||||
<Variable name="luckWheelAdvance" type="LuckWheelMission"/>高级幸运探宝奖池
|
||||
<Variable name="subRewardPoolInfo" type="SubRewardPoolInfo"/>挖矿奖池
|
||||
|
||||
</Jbean>
|
||||
|
||||
|
||||
|
|
|
@ -119,6 +119,8 @@ public class ClassDeclare implements Visitor {
|
|||
|
||||
|
||||
public void visitWrop(com.dbgen.Type type, PrintStream ps, String prefix) {
|
||||
ps.print(prefix+ "@Transient");
|
||||
ps.println();
|
||||
ps.print(prefix+ "private " + "Log"+TypeName.getName(type) + " "+ getVarname()+ "Log ;");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -157,6 +157,7 @@ public interface BIReason {
|
|||
int SPECIAL_MONSTER_REWARD = 88;//灵兽涅槃获得
|
||||
int SPECIAL_FREE_PIECE_REWARD = 89;//灵兽放生获得
|
||||
int SKIN_USE_REWARD = 90;//激活皮肤获得头像
|
||||
int SUB_ACTIVITY_FINISH = 91;//易经宝库活动结束补发
|
||||
|
||||
int ADVENTURE_UPLEVEL_CONSUME = 1000;//秘境升级
|
||||
int SECRETBOX_CONSUME = 1001;//秘盒抽卡
|
||||
|
@ -290,6 +291,8 @@ public interface BIReason {
|
|||
|
||||
int SPECIAL_FREE_PIECE_CONSUME = 1072;//灵兽放生碎片消耗
|
||||
|
||||
int SKIN_USE_CONSUME = 1073;//激活皮肤消耗
|
||||
|
||||
int SKIN_USE_CONSUME = 1073;//激活皮肤消耗
|
||||
int SUB_ACTIVITY_CONSUME = 1074;//易经宝库
|
||||
int SUB_ACTIVITY_CONSUME_FINISH = 1075;//易经宝库活动结束补发消耗
|
||||
}
|
|
@ -0,0 +1,96 @@
|
|||
package com.ljsd.jieling.handler.activity;
|
||||
|
||||
import com.google.protobuf.GeneratedMessage;
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.jbean.ActivityMission;
|
||||
import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.activity.AbstractActivity;
|
||||
import com.ljsd.jieling.logic.activity.ActivityTypeEnum;
|
||||
import com.ljsd.jieling.logic.activity.SubActivity;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.ActivityProto;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import config.SBlessingConfigNew;
|
||||
import config.SBlessingRewardPoolNew;
|
||||
import manager.STableManager;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
/**
|
||||
* Description: des
|
||||
* Author: zsx
|
||||
* CreateDate: 2020/11/7 9:47
|
||||
*/
|
||||
public class SeletSubRewardPoolRequestHandler extends BaseHandler<ActivityProto.SeletSubRewardPoolRequest>{
|
||||
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GeneratedMessage processWithProto(int uid, ActivityProto.SeletSubRewardPoolRequest proto) throws Exception {
|
||||
int selectId = proto.getSelectId();
|
||||
int activityId = proto.getActivityId();
|
||||
|
||||
//check activity
|
||||
User user = UserManager.getUser(uid);
|
||||
AbstractActivity abstractActivity = ActivityTypeEnum.getActicityType(proto.getActivityId());
|
||||
if (null == abstractActivity) {
|
||||
throw new ErrorCodeException(ErrorCode.ACTIVITY_NOT_OPEN);
|
||||
}
|
||||
ActivityMission activityMission = user.getActivityManager().getActivityMissionMap().get(proto.getActivityId());
|
||||
if(activityMission==null){
|
||||
throw new ErrorCodeException(ErrorCode.ACTIVITY_NOT_OPEN);
|
||||
}
|
||||
|
||||
|
||||
//check conf
|
||||
SBlessingConfigNew sBlessingConfigNew =SBlessingConfigNew.getsBlessingConfigNewHashMap().get(activityId);
|
||||
int finalPoolId = sBlessingConfigNew.getFinalPoolId();
|
||||
|
||||
SBlessingRewardPoolNew sBlessingRewardPoolNew = STableManager.getConfig(SBlessingRewardPoolNew.class).get(selectId);
|
||||
if(sBlessingRewardPoolNew.getPoolId()!=finalPoolId){
|
||||
throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
||||
}
|
||||
|
||||
//check leve
|
||||
|
||||
if(sBlessingRewardPoolNew.getLevelLimit()>user.getPlayerInfoManager().getLevel()){
|
||||
throw new ErrorCodeException(ErrorCode.PLAYER_LEVE_NOT);
|
||||
}
|
||||
|
||||
//check floor
|
||||
ActivityProgressInfo activityProgressInfo = activityMission.getActivityMissionMap().get(SubActivity.LAY_INDEX);
|
||||
if(activityProgressInfo!=null&&sBlessingRewardPoolNew.getFloorLimit()>activityProgressInfo.getProgrss()){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE);
|
||||
}
|
||||
|
||||
//check count
|
||||
ActivityProgressInfo activityProgressInfo1 = activityMission.getActivityMissionMap().get(SubActivity.POOL_INDEX + selectId);
|
||||
if(activityProgressInfo1!=null&&activityProgressInfo1.getProgrss()>=sBlessingRewardPoolNew.getInitializeNum()&&activityMission.getV()!=selectId){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE);
|
||||
}
|
||||
// //check had select
|
||||
if(activityMission.getV()!=0){
|
||||
ActivityProgressInfo activityProgressInfoOld = activityMission.getActivityMissionMap().get(SubActivity.POOL_INDEX + activityMission.getV());
|
||||
if(activityProgressInfoOld!=null&&activityProgressInfoOld.getProgrss()!=0){
|
||||
activityProgressInfoOld.setProgrss(activityProgressInfoOld.getProgrss()-1);
|
||||
}
|
||||
user.getActivityManager().getSubRewardPoolInfo().getSubRewardPool().remove(user.getActivityManager().getSubRewardPoolInfo().getSubRewardPool().size()-1);
|
||||
}
|
||||
activityMission.setV(selectId);
|
||||
if(activityProgressInfo1!=null){
|
||||
activityProgressInfo1.setProgrss(activityProgressInfo1.getProgrss()+1);
|
||||
}
|
||||
user.getActivityManager().getSubRewardPoolInfo().getSubRewardPool().add(selectId);
|
||||
ISession sessionByUid = OnlineUserManager.getSessionByUid(user.getId());
|
||||
abstractActivity.sendActivityProgress(sessionByUid, activityMission, null);
|
||||
return ActivityProto.SeletSubRewardPoolResponse.newBuilder().build();
|
||||
}
|
||||
}
|
|
@ -50,18 +50,25 @@ public class GetCarChallengeListHandler extends BaseHandler {
|
|||
int zsetSize = RedisUtil.getInstence().getZsetSize(key);
|
||||
List<ZsetTypedTupleWithRank> beforeList = new ArrayList<>(5);
|
||||
List<ZsetTypedTupleWithRank> afterList = new ArrayList<>(5);
|
||||
int maxWhile = 30;//最大匹配循环次数
|
||||
if(myRank == -1){
|
||||
int start = zsetSize - matchNums;
|
||||
if(start<0){
|
||||
start=0;
|
||||
int end = 0;
|
||||
while(end<maxWhile&&beforeList.size()<matchNums){
|
||||
|
||||
Set<ZSetOperations.TypedTuple<String>> beforeScore = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.CAR_DEALY_RANK, "", zsetSize-end , zsetSize-end );
|
||||
if(!beforeScore.isEmpty()){
|
||||
ZSetOperations.TypedTuple<String> beforeNext = beforeScore.iterator().next();
|
||||
if(!members.contains(Integer.parseInt(beforeNext.getValue()))){
|
||||
beforeList.add(new ZsetTypedTupleWithRank(beforeNext,zsetSize-end+1));
|
||||
}
|
||||
}
|
||||
end++;
|
||||
}
|
||||
int end=-1;
|
||||
process(start,end,members,matchNums,infos);
|
||||
// process(start,end,members,matchNums,infos);
|
||||
}else{
|
||||
int i = myRank-1;
|
||||
int j = myRank+1;
|
||||
|
||||
int maxWhile = 30;//最大匹配循环次数
|
||||
while(i>0||j<=zsetSize){
|
||||
|
||||
if(i>0){
|
||||
|
|
|
@ -3227,7 +3227,9 @@ public class MapLogic {
|
|||
skinId = 0;
|
||||
skinTime = 0;
|
||||
}
|
||||
TrailHero trailHero = new TrailHero(hero.getTemplateId(),HeroLogic.getInstance().calHeroNotBufferAttribute(user,hero,false,0),hero.getStar(),heroSkill,hero.getLevel(),skinId,skinTime);
|
||||
TrailHero trailHero = new TrailHero(hero.getTemplateId(),HeroLogic.getInstance().calHeroNotBufferAttribute(user,hero,false,0),hero.getStar(),heroSkill,hero.getLevel());
|
||||
trailHero.setSkinId(skinId);
|
||||
trailHero.setSkinTime(skinTime);
|
||||
heroInfo.put(id,trailHero);
|
||||
}
|
||||
mapManager.updateTrailHeroInfo(heroInfo);
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.ljsd.jieling.handler.map;
|
||||
|
||||
import com.ljsd.common.mogodb.MongoBase;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
@ -7,7 +9,7 @@ import java.util.Map;
|
|||
* @date 2020/5/28
|
||||
* @discribe
|
||||
*/
|
||||
public class TrailHero {
|
||||
public class TrailHero extends MongoBase {
|
||||
|
||||
private int tmpId;
|
||||
|
||||
|
@ -47,14 +49,12 @@ public class TrailHero {
|
|||
this.star = star;
|
||||
}
|
||||
|
||||
public TrailHero(int tmpId, Map<Integer, Integer> property, int star,String heroSkills,int level,int skinId,int skinTime) {
|
||||
public TrailHero(int tmpId, Map<Integer, Integer> property, int star,String heroSkills,int level) {
|
||||
this.tmpId = tmpId;
|
||||
this.property = property;
|
||||
this.star = star;
|
||||
this.heroSkills = heroSkills;
|
||||
this.level = level;
|
||||
this.skinId = skinId;
|
||||
this.skinTime = skinTime;
|
||||
}
|
||||
|
||||
public int getSkinId() {
|
||||
|
@ -80,4 +80,12 @@ public class TrailHero {
|
|||
public void setLevel(int level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public void setSkinId(int skinId) {
|
||||
this.skinId = skinId;
|
||||
}
|
||||
|
||||
public void setSkinTime(int skinTime) {
|
||||
this.skinTime = skinTime;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.ljsd.jieling.handler.map;
|
||||
|
||||
import com.ljsd.common.mogodb.MongoBase;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
|
@ -7,7 +9,7 @@ import java.util.*;
|
|||
* @date 2020/5/16
|
||||
* @discribe 试炼信息
|
||||
*/
|
||||
public class TrialInfo {
|
||||
public class TrialInfo extends MongoBase {
|
||||
//默认一层
|
||||
private int floor = 1;
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ public final class ActivityManager extends MongoBase {
|
|||
private long senvenStartTime; // 七日狂欢开始时间
|
||||
private com.ljsd.jieling.jbean.LuckWheelMission luckWheel; // 幸运探宝奖池
|
||||
private com.ljsd.jieling.jbean.LuckWheelMission luckWheelAdvance; // 高级幸运探宝奖池
|
||||
private com.ljsd.jieling.jbean.SubRewardPoolInfo subRewardPoolInfo; // 挖矿奖池
|
||||
|
||||
public ActivityManager() {
|
||||
}
|
||||
|
@ -28,6 +29,7 @@ public final class ActivityManager extends MongoBase {
|
|||
this.senvenStartTime = _o_.senvenStartTime;
|
||||
this.luckWheel = new LuckWheelMission(_o_.luckWheel);
|
||||
this.luckWheelAdvance = new LuckWheelMission(_o_.luckWheelAdvance);
|
||||
this.subRewardPoolInfo = new SubRewardPoolInfo(_o_.subRewardPoolInfo);
|
||||
}
|
||||
|
||||
public Map<Integer, com.ljsd.jieling.jbean.ActivityMission> getActivityMissionMap() {
|
||||
|
@ -48,6 +50,10 @@ public final class ActivityManager extends MongoBase {
|
|||
return this.luckWheelAdvance;
|
||||
}
|
||||
|
||||
public com.ljsd.jieling.jbean.SubRewardPoolInfo getSubRewardPoolInfo() { // 挖矿奖池
|
||||
return this.subRewardPoolInfo;
|
||||
}
|
||||
|
||||
public void setSenvenStartTime(long senvenstarttime) { // 七日狂欢开始时间
|
||||
updateString("senvenStartTime",senvenstarttime);
|
||||
this.senvenStartTime = senvenstarttime;
|
||||
|
@ -65,6 +71,12 @@ public final class ActivityManager extends MongoBase {
|
|||
this.luckWheelAdvance = luckwheeladvance;
|
||||
}
|
||||
|
||||
public void setSubRewardPoolInfo(SubRewardPoolInfo subrewardpoolinfo) { // 挖矿奖池
|
||||
updateString("subRewardPoolInfo",subrewardpoolinfo);
|
||||
subrewardpoolinfo.init(getRootId(),getMongoKey()+ ".subRewardPoolInfo");
|
||||
this.subRewardPoolInfo = subrewardpoolinfo;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
@ -74,6 +86,7 @@ public final class ActivityManager extends MongoBase {
|
|||
_sb_.append(this.senvenStartTime).append(",");
|
||||
_sb_.append(this.luckWheel).append(",");
|
||||
_sb_.append(this.luckWheelAdvance).append(",");
|
||||
_sb_.append(this.subRewardPoolInfo).append(",");
|
||||
_sb_.append(")");
|
||||
return _sb_.toString();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
package com.ljsd.jieling.jbean;
|
||||
|
||||
import com.ljsd.common.mogodb.MongoBase;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import java.util.Set;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.LinkedList;
|
||||
import org.springframework.data.annotation.Transient;
|
||||
import com.ljsd.common.mogodb.dblog.*;
|
||||
|
||||
public final class SubRewardPoolInfo extends MongoBase {
|
||||
private LinkedList<Integer> subRewardPool = new LinkedList<Integer>(); // 挖矿奖池
|
||||
@Transient
|
||||
private LogLinkedList<Integer> subRewardPoolLog ;
|
||||
private int lay; // 挖矿奖池层
|
||||
|
||||
public SubRewardPoolInfo() {
|
||||
}
|
||||
|
||||
|
||||
public SubRewardPoolInfo(SubRewardPoolInfo _o_ ) {
|
||||
this.subRewardPool = new LinkedList<Integer>();
|
||||
_o_.subRewardPool.forEach(_v_ -> this.subRewardPool.add(_v_));
|
||||
this.lay = _o_.lay;
|
||||
}
|
||||
|
||||
public List<Integer> getSubRewardPool() { // 挖矿奖池
|
||||
if( null == subRewardPoolLog && subRewardPool != null)
|
||||
subRewardPoolLog = new LogLinkedList<Integer>( this,"subRewardPool",subRewardPool);
|
||||
return this.subRewardPoolLog;
|
||||
}
|
||||
|
||||
public int getLay() { // 挖矿奖池层
|
||||
return this.lay;
|
||||
}
|
||||
|
||||
public void setLay(int lay) { // 挖矿奖池层
|
||||
updateString("lay",lay);
|
||||
this.lay = lay;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder _sb_ = new StringBuilder(super.toString());
|
||||
_sb_.append("=(");
|
||||
_sb_.append(this.subRewardPool).append(",");
|
||||
_sb_.append(this.lay).append(",");
|
||||
_sb_.append(")");
|
||||
return _sb_.toString();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.ljsd.jieling.kefu;
|
||||
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.network.server.SessionManager;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
|
||||
public class Cmd_kickuser extends GmRoleAbstract {
|
||||
|
||||
@Override
|
||||
public boolean exec(String[] args) throws Exception {
|
||||
|
||||
SessionManager instance = SessionManager.getInstance();
|
||||
ISession session= OnlineUserManager.getSessionByUid(getUser().getId());
|
||||
if (session != null) {
|
||||
MessageUtil.sendErrorCode(session, ErrorCode.kickUserCode, "您已被踢下线!");
|
||||
Thread.sleep(100);
|
||||
instance.kickOldUser(getUser().getId(), "", ErrorCode.kickUserCode, "LOSE HEART PACKET!!!!", 0);
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,162 @@
|
|||
package com.ljsd.jieling.kefu;
|
||||
|
||||
|
||||
import com.ljsd.fight.CheckFight;
|
||||
import com.ljsd.jieling.config.clazzStaticCfg.CommonStaticConfig;
|
||||
import com.ljsd.jieling.core.GlobalsDef;
|
||||
import com.ljsd.jieling.db.redis.RedisKey;
|
||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.logic.championship.ChampionshipLogic;
|
||||
import com.ljsd.jieling.logic.dao.ArenaRecord;
|
||||
import com.ljsd.jieling.logic.dao.FamilyFightInfo;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.fight.*;
|
||||
import com.ljsd.jieling.protocols.CommonProto;
|
||||
import com.ljsd.jieling.util.FightDataUtil;
|
||||
import config.SArenaRobotConfig;
|
||||
import manager.STableManager;
|
||||
import org.luaj.vm2.LuaValue;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Description: 查看巅峰赛 战斗
|
||||
* Author: zsx
|
||||
* CreateDate: 2019/9/26 11:48
|
||||
*/
|
||||
public class Cmd_review_gm extends GmAbstract {
|
||||
@Override
|
||||
public boolean exec(String[] args) throws Exception {
|
||||
|
||||
// for (int i = 0; i <150 ; i++) {
|
||||
// String key = RedisKey.getKey(RedisKey.FORCE_RANK, "", false);
|
||||
// RedisUtil.getInstence().zsetAddOne(key, String.valueOf(10000+i), 10000+i);
|
||||
// }
|
||||
if (args.length != 1) {
|
||||
return false;
|
||||
}
|
||||
String fightID = args[0];
|
||||
ArenaRecord arenaRecord = RedisUtil.getInstence().getMapEntry(RedisKey.CHAMPION_ARENA_RECORD,"", fightID, ArenaRecord.class);
|
||||
|
||||
if(arenaRecord == null){
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("arena_rrecord null"));
|
||||
}
|
||||
byte[] fightData = arenaRecord.getFightData();
|
||||
CommonProto.FightData fightDataProto = CommonProto.FightData.parseFrom(fightData);
|
||||
LuaValue getFightData;
|
||||
int snapTeamId = GlobalsDef.CHAMPION_ATTACK_TEAM;
|
||||
RedisUtil.getInstence().del(RedisUtil.getInstence().getKey(RedisKey.CHAMPION_FIGHT, ""));
|
||||
int warTime = STableManager.getFigureConfig(CommonStaticConfig.class).getsChampionshipSetting().getWarTime();
|
||||
Map<Integer, ChampionshipLogic.MemberInfo> memberInfoMap = RedisUtil.getInstence().getMapValues(RedisKey.CHAMPION_JOIN, "", Integer.class, ChampionshipLogic.MemberInfo.class);
|
||||
int attackId = arenaRecord.getAttackId();
|
||||
int defUid = arenaRecord.getDefUid();
|
||||
ChampionshipLogic.snapOneFightInfo(attackId, memberInfoMap);
|
||||
ChampionshipLogic.snapOneFightInfo(defUid, memberInfoMap);
|
||||
|
||||
long id = FightDispatcher.getFIghtId();
|
||||
EndFightProcessor endFightProcessor = new AreFightPro();
|
||||
((AreFightPro) endFightProcessor).setArenaRecord(arenaRecord);
|
||||
FightDispatcher.getMap().put(id, endFightProcessor);
|
||||
Map<Integer, GameFightType> gameFightTypeMap = new HashMap<>();
|
||||
|
||||
gameFightTypeMap.put(0, GameFightType.TOPArenaPersonFight);
|
||||
gameFightTypeMap.put(1, GameFightType.TOPArenaRobotFight);
|
||||
gameFightTypeMap.put(2, GameFightType.TOPArena2RobotFight);
|
||||
PVPFightEvent pvpFightEvent = new PVPFightEvent(attackId, snapTeamId, warTime, "", gameFightTypeMap.get(arenaRecord.getType()), defUid, snapTeamId);
|
||||
|
||||
ChampionshipLogic.MemberInfo attackMemberInfo = memberInfoMap.get(attackId);
|
||||
ChampionshipLogic.MemberInfo defMemberInfo = memberInfoMap.get(defUid);
|
||||
int minForce = 0;
|
||||
int defForce = 0;
|
||||
|
||||
if (defMemberInfo.getType() == 0) {
|
||||
FamilyFightInfo fightInfo = defMemberInfo.getFightInfo();
|
||||
//<<<<<<< HEAD
|
||||
// pvpFightEvent.setDefFightSnapData(new DefFightSnapData(fightInfo.getHeroAttribute(), fightInfo.getHeroSkills(), fightInfo.getPokenmonSkills(), fightInfo.getPassiveSkills()));
|
||||
//=======
|
||||
pvpFightEvent.setDefFightSnapData(new DefFightSnapData(fightInfo.getHeroAttribute(), fightInfo.getHeroSkills(), fightInfo.getPokenmonSkills(), fightInfo.getPassiveSkills(), defUid));
|
||||
defForce = fightInfo.getForce();
|
||||
} else {
|
||||
SArenaRobotConfig sArenaRobotConfig = SArenaRobotConfig.getsArenaRobotConfigById(defUid);
|
||||
if (sArenaRobotConfig != null) {
|
||||
defForce = sArenaRobotConfig.getTotalForce();
|
||||
}
|
||||
}
|
||||
if (attackMemberInfo.getType() == 0) {
|
||||
FamilyFightInfo fightInfo = attackMemberInfo.getFightInfo();
|
||||
//<<<<<<< HEAD
|
||||
// pvpFightEvent.setAttackFightSnapData(new DefFightSnapData(fightInfo.getHeroAttribute(), fightInfo.getHeroSkills(), fightInfo.getPokenmonSkills(), fightInfo.getPassiveSkills()));
|
||||
//=======
|
||||
pvpFightEvent.setAttackFightSnapData(new DefFightSnapData(fightInfo.getHeroAttribute(), fightInfo.getHeroSkills(), fightInfo.getPokenmonSkills(), fightInfo.getPassiveSkills(), attackId));
|
||||
minForce = fightInfo.getForce();
|
||||
} else {
|
||||
SArenaRobotConfig sArenaRobotConfig = SArenaRobotConfig.getsArenaRobotConfigById(attackId);
|
||||
if (sArenaRobotConfig != null) {
|
||||
minForce = sArenaRobotConfig.getTotalForce();
|
||||
}
|
||||
}
|
||||
if (minForce > defForce) {
|
||||
if (arenaRecord.getTurn() == 2) {
|
||||
pvpFightEvent.setRever(true);
|
||||
}
|
||||
} else {
|
||||
if (arenaRecord.getTurn() == 1 || arenaRecord.getTurn() == 3) {
|
||||
pvpFightEvent.setRever(true);
|
||||
}
|
||||
}
|
||||
|
||||
CommonProto.FightTeamInfo fightTeamInfo = null;
|
||||
CommonProto.FightTeamInfo deffightTeamInfo = null;
|
||||
if(pvpFightEvent.getAttackFightSnapData()!=null){
|
||||
fightTeamInfo = FightUtil.makeFightWithSnapData(pvpFightEvent.getAttackFightSnapData());
|
||||
}
|
||||
if(pvpFightEvent.getDefFightSnapData()!=null){
|
||||
deffightTeamInfo = FightUtil.makeFightWithSnapData(pvpFightEvent.getDefFightSnapData());
|
||||
} else{
|
||||
if(pvpFightEvent.getFightType() == GameFightType.ArenaPersonFight ||pvpFightEvent.getFightType() == GameFightType.CarPersonChallenge ){
|
||||
User defInMem = UserManager.getUserInMem(pvpFightEvent.getDefUid());
|
||||
deffightTeamInfo = FightUtil.makePersonFightData(defInMem, pvpFightEvent.getDefTeamId(),null,null);
|
||||
}else{
|
||||
deffightTeamInfo = FightUtil. makeRobotFightData(pvpFightEvent.getDefUid());
|
||||
// deffightTeamInfo = FightUtil. makeRobotFightData(pvpFightEvent.getDefUid());
|
||||
}
|
||||
|
||||
}
|
||||
if(fightTeamInfo==null){
|
||||
//<<<<<<< HEAD
|
||||
// if( pvpFightEvent.getFightType()!= GameFightType.TOPArena2RobotFight){
|
||||
// if( SArenaRobotConfig.getsArenaRobotConfigById(pvpFightEvent.getAttackUid()) !=null){
|
||||
// fightTeamInfo = FightUtil. makeRobotFightData(pvpFightEvent.getAttackUid());
|
||||
//=======
|
||||
if( pvpFightEvent.getFightType()!=GameFightType.TOPArena2RobotFight){
|
||||
if( SArenaRobotConfig.getsArenaRobotConfigById(pvpFightEvent.getAttackUid()) !=null){
|
||||
fightTeamInfo =FightUtil. makeRobotFightData(pvpFightEvent.getAttackUid());
|
||||
}else{
|
||||
User userInMem = UserManager.getUserInMem(pvpFightEvent.getAttackUid());
|
||||
fightTeamInfo = FightUtil.makePersonFightData(userInMem, pvpFightEvent.getTeamId(),pvpFightEvent.getAttackBloodMap(),null);
|
||||
}
|
||||
}else{
|
||||
fightTeamInfo = FightUtil.makeRobotFightData(pvpFightEvent.getAttackUid());
|
||||
}
|
||||
}
|
||||
|
||||
if (pvpFightEvent.isRever()) {
|
||||
deffightTeamInfo = CommonProto.FightTeamInfo.newBuilder().mergeFrom(deffightTeamInfo).setFirstCamp(1).build();
|
||||
getFightData = FightDataUtil.getFinalPlayerFightData(fightTeamInfo, deffightTeamInfo, true);//对方先手
|
||||
} else {
|
||||
getFightData = FightDataUtil.getFinalPlayerFightData(fightTeamInfo, deffightTeamInfo);
|
||||
}
|
||||
LuaValue getOptionData = FightDataUtil.getOptionData(pvpFightEvent.getAttackUid() + "");
|
||||
int[] fightResult = CheckFight.getInstance().checkFight(fightDataProto.getFightSeed(), pvpFightEvent.getMostTime(), getFightData, getOptionData, pvpFightEvent.getFightType().getFightType());
|
||||
String string = Arrays.toString(fightResult);
|
||||
LOGGER.error("__________________________"+fightResult[0]+":::"+string);
|
||||
System.out.println("string = " + string);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -78,4 +78,7 @@ public interface ActivityType {
|
|||
int ITEMS_STORE= 6000;//百宝商会
|
||||
int TRIAL_EXPERT = 70;//幻境达人
|
||||
int SHEJI_ACTIVITY = 60;//社稷大典
|
||||
int SUB_ACTIVITY = 8000;//易经宝库
|
||||
int SKIN_RECHARGE_ACTIVITY = 71;
|
||||
|
||||
}
|
||||
|
|
|
@ -59,6 +59,9 @@ public enum ActivityTypeEnum {
|
|||
ITEMS_STORE(ActivityType.ITEMS_STORE, DefaultEmptyActivity::new),
|
||||
TRIAL_EXPERT(ActivityType.TRIAL_EXPERT,TrialExpectRankActivity::new),
|
||||
SHEJI_ACTIVITY(ActivityType.SHEJI_ACTIVITY,SheJiActivity::new),
|
||||
SUB_ACTIVITY(ActivityType.SUB_ACTIVITY, SubActivity::new),
|
||||
SKIN_RECHARGE_ACTIVITY(ActivityType.SKIN_RECHARGE_ACTIVITY, DefaultEmptyActivity::new),
|
||||
|
||||
|
||||
;
|
||||
private int type;
|
||||
|
|
|
@ -0,0 +1,247 @@
|
|||
package com.ljsd.jieling.logic.activity;
|
||||
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.globals.Global;
|
||||
import com.ljsd.jieling.jbean.*;
|
||||
import com.ljsd.jieling.logic.activity.event.IEvent;
|
||||
import com.ljsd.jieling.logic.dao.Item;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.mail.MailLogic;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.CommonProto;
|
||||
import com.ljsd.jieling.protocols.PlayerInfoProto;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.*;
|
||||
import manager.STableManager;
|
||||
import util.MathUtils;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Description: 易经宝库
|
||||
* Author: zsx
|
||||
* CreateDate: 2020/11/6 22:26
|
||||
*/
|
||||
public class SubActivity extends AbstractActivity {
|
||||
|
||||
public static final int LAY_INDEX = 100;
|
||||
public static final int POOL_INDEX = 1000;
|
||||
|
||||
public SubActivity(int id) {
|
||||
super(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void initActivity(User user) throws Exception {
|
||||
//重置奖励
|
||||
randomReward(user, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume(User user) throws Exception {
|
||||
// super.onResume(user);
|
||||
//重置奖励
|
||||
randomReward(user, false);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean takeReward(ISession session, int missionId) throws Exception {
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
|
||||
// //checkAndUpdate state
|
||||
ActivityManager activityManager = user.getActivityManager();
|
||||
ActivityMission activityMission = activityManager.getActivityMissionMap().get(id);
|
||||
if (activityMission == null) {
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
if (activityMission.getActivityState() != ActivityType.OPEN_STATE || activityMission.getOpenType() == 0) {
|
||||
throw new ErrorCodeException(ErrorCode.ACTIVITY_NOT_OPEN);
|
||||
}
|
||||
ActivityProgressInfo activityProgressInfo = activityMission.getActivityMissionMap().get(missionId);
|
||||
if (activityProgressInfo == null || activityProgressInfo.getState() == ActivityType.HAD_TAKED) {
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("活动奖励已经领取"));
|
||||
}
|
||||
//check had select
|
||||
if (activityMission.getV() == 0) {
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE);
|
||||
}
|
||||
|
||||
|
||||
SBlessingConfigNew sBlessingConfigNew = SBlessingConfigNew.getsBlessingConfigNewHashMap().get(id);
|
||||
//check cost
|
||||
int[][] cost = new int[1][2];
|
||||
cost[0] = sBlessingConfigNew.getCost();
|
||||
boolean b = ItemUtil.itemCost(user, cost, BIReason.SUB_ACTIVITY_CONSUME, 1);
|
||||
if (!b) {
|
||||
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
||||
}
|
||||
int size = user.getActivityManager().getSubRewardPoolInfo().getSubRewardPool().size();
|
||||
if (size == 0) {
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE);
|
||||
}
|
||||
|
||||
//get reward
|
||||
long count = activityMission.getActivityMissionMap().values().stream().filter(activityProgressInfo1 -> activityProgressInfo1.getState() == ActivityType.HAD_TAKED).count();
|
||||
//后5个概率提前结束抽奖
|
||||
if (count != (size - 1) && count >= (size - 5) && ((Math.random() * 5) < 1)&&user.getActivityManager().getSubRewardPoolInfo().getSubRewardPool().get(user.getActivityManager().getSubRewardPoolInfo().getSubRewardPool().size() - 1)== activityMission.getV()) {
|
||||
user.getActivityManager().getSubRewardPoolInfo().getSubRewardPool().add((int) count, activityMission.getV());
|
||||
user.getActivityManager().getSubRewardPoolInfo().getSubRewardPool().remove(user.getActivityManager().getSubRewardPoolInfo().getSubRewardPool().size() - 1);
|
||||
}
|
||||
Integer rewardId = user.getActivityManager().getSubRewardPoolInfo().getSubRewardPool().get((int) count);
|
||||
|
||||
SBlessingRewardPoolNew sBlessingRewardPoolNew = STableManager.getConfig(SBlessingRewardPoolNew.class).get(rewardId);
|
||||
|
||||
|
||||
int[] reward = sBlessingRewardPoolNew.getReward();
|
||||
int[][] rewards = new int[1][];
|
||||
rewards[0] = reward;
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, rewards, BIReason.TAKE_ACTIVITY_REWARD);
|
||||
//up miss
|
||||
activityProgressInfo.setProgrss(rewardId);
|
||||
activityProgressInfo.setState(ActivityType.HAD_TAKED);
|
||||
int curLay = user.getActivityManager().getSubRewardPoolInfo().getLay();
|
||||
if (curLay != sBlessingConfigNew.getFloorCount() && rewardId == activityMission.getV()) {
|
||||
ActivityLogic.getInstance().resumeActivity(user, ActivityType.SUB_ACTIVITY);
|
||||
sendActivityProgress(session, activityManager.getActivityMissionMap().get(id), null);
|
||||
} else {
|
||||
sendActivityProgress(session, activityMission, Collections.singleton(missionId));
|
||||
}
|
||||
reportTakeActivityReward(user, rewards, missionId);
|
||||
PlayerInfoProto.TakeActivityRewardResponse build = PlayerInfoProto.TakeActivityRewardResponse.newBuilder().setDrop(drop).build();
|
||||
MessageUtil.sendMessage(session, 1, rewardResponseValue, build, true);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onEvent(IEvent event) throws Exception {
|
||||
super.onEvent(event);
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置奖励
|
||||
*/
|
||||
private void randomReward(User user, boolean start) throws Exception {
|
||||
|
||||
//init lay
|
||||
SubRewardPoolInfo subRewardPoolInfo = user.getActivityManager().getSubRewardPoolInfo();
|
||||
if (subRewardPoolInfo == null) {
|
||||
subRewardPoolInfo = new SubRewardPoolInfo();
|
||||
user.getActivityManager().setSubRewardPoolInfo(subRewardPoolInfo);
|
||||
}
|
||||
int lay = user.getActivityManager().getSubRewardPoolInfo().getLay();
|
||||
int curLay = lay + 1;
|
||||
user.getActivityManager().getSubRewardPoolInfo().setLay(curLay);
|
||||
HashMap<Integer, HashSet<SBlessingRewardPoolNew>> integerHashSetHashMap = SBlessingRewardPoolNew.getsBlessingRewardPoolNewHashMap();
|
||||
//init Activity
|
||||
ActivityMission activityMission = user.getActivityManager().getActivityMissionMap().get(id);
|
||||
ActivityProgressInfo activityProgressInfo = new ActivityProgressInfo();
|
||||
activityProgressInfo.setProgrss(curLay);
|
||||
activityProgressInfo.setState(0);
|
||||
activityMission.getActivityMissionMap().put(LAY_INDEX, activityProgressInfo);
|
||||
activityMission.setOpenType(1);
|
||||
activityMission.setActivityState(ActivityType.OPEN_STATE);
|
||||
activityMission.setV(0);
|
||||
|
||||
|
||||
//init reward
|
||||
|
||||
SBlessingConfigNew sBlessingConfigNew = SBlessingConfigNew.getsBlessingConfigNewHashMap().get(id);
|
||||
if (null == sBlessingConfigNew) {
|
||||
throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
||||
}
|
||||
int[] basicPoolId = sBlessingConfigNew.getBasicPoolId();
|
||||
if (basicPoolId.length < curLay) {
|
||||
throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
||||
}
|
||||
int poolID = basicPoolId[curLay - 1];
|
||||
HashSet<SBlessingRewardPoolNew> sBlessingRewardPoolNews = integerHashSetHashMap.get(poolID);
|
||||
if (null == sBlessingRewardPoolNews) {
|
||||
throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
||||
}
|
||||
List<int[]> ints = new LinkedList<>();
|
||||
for (SBlessingRewardPoolNew sBlessingRewardPoolNew : sBlessingRewardPoolNews) {
|
||||
for (int i = 0; i < sBlessingRewardPoolNew.getInitializeNum(); i++) {
|
||||
int[] reward = new int[2];
|
||||
reward[0] = sBlessingRewardPoolNew.getId();
|
||||
reward[1] = sBlessingRewardPoolNew.getInitializeNum();
|
||||
ints.add(reward);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int[][] ints1 = ints.toArray(new int[0][0]);
|
||||
int[] fixResult = MathUtils.randomFromWeightWithTaking(ints1, ints1.length);
|
||||
|
||||
List<Integer> list2 = Arrays.stream(fixResult).boxed().collect(Collectors.toList());
|
||||
user.getActivityManager().getSubRewardPoolInfo().getSubRewardPool().clear();
|
||||
user.getActivityManager().getSubRewardPoolInfo().getSubRewardPool().addAll(list2);
|
||||
|
||||
for (int i = 0; i <= list2.size(); i++) {
|
||||
ActivityProgressInfo activityProgressInfo1 = new ActivityProgressInfo();
|
||||
activityProgressInfo1.setProgrss(0);
|
||||
activityProgressInfo1.setState(0);
|
||||
activityMission.getActivityMissionMap().put(i + 1, activityProgressInfo1);
|
||||
}
|
||||
|
||||
//init finalRewards
|
||||
if (start) {
|
||||
int finalPoolId = sBlessingConfigNew.getFinalPoolId();
|
||||
HashSet<SBlessingRewardPoolNew> sBlessingRewardPoolNews1 = integerHashSetHashMap.get(finalPoolId);
|
||||
for (SBlessingRewardPoolNew sBlessingRewardPoolNew : sBlessingRewardPoolNews1) {
|
||||
ActivityProgressInfo activityProgressInfo1 = new ActivityProgressInfo();
|
||||
activityProgressInfo1.setProgrss(0);
|
||||
activityProgressInfo1.setState(0);
|
||||
activityMission.getActivityMissionMap().put(POOL_INDEX + sBlessingRewardPoolNew.getId(), activityProgressInfo1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityEndOnMySelf(User user) throws Exception {
|
||||
SGlobalActivity sGlobalActivity = SGlobalActivity.getsGlobalActivityMap().get(id);
|
||||
|
||||
|
||||
SBlessingConfigNew sBlessingConfigNew = SBlessingConfigNew.getsBlessingConfigNewHashMap().get(id);
|
||||
|
||||
int removeItemId = sBlessingConfigNew.getCost()[0];
|
||||
Item item = user.getItemManager().getItem(removeItemId);
|
||||
if (item != null) {
|
||||
int costNum = item.getItemNum();
|
||||
//check cost
|
||||
int[][] cost = new int[1][];
|
||||
cost[0] = new int[]{item.getItemId(), item.getItemNum()};
|
||||
ItemUtil.itemCost(user, cost, BIReason.SUB_ACTIVITY_CONSUME_FINISH, sGlobalActivity.getId());
|
||||
|
||||
SItem sItem = SItem.getsItemMap().get(removeItemId);
|
||||
//give
|
||||
int integerValue = SSpecialConfig.getIntegerValue(SSpecialConfig.ITEM_1004_RETRIEVE);
|
||||
if (integerValue == 0) {
|
||||
throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
||||
}
|
||||
int[][] rewards = new int[1][];
|
||||
rewards[0] = new int[]{16, costNum*integerValue};
|
||||
|
||||
SItem getItem = SItem.getsItemMap().get(16);
|
||||
String getName =costNum*integerValue+getItem.getName();
|
||||
String title = SErrorCodeEerverConfig.getI18NMessage("activity_item_retrieve_mail_titile");
|
||||
String content = SErrorCodeEerverConfig.getI18NMessage("activity_item_retrieve_mail_content", new Object[]{sGlobalActivity.getSesc(),sItem.getName(),costNum,getName});
|
||||
String mailReward = ItemUtil.getMailReward(rewards);
|
||||
int nowTime = (int) (TimeUtils.now() / 1000);
|
||||
MailLogic.getInstance().sendMail(user.getId(), title, content, mailReward, nowTime, Global.MAIL_EFFECTIVE_TIME);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1495,7 +1495,7 @@ public class HeroLogic{
|
|||
Map<Integer, Integer> skinInfo = user.getHeroManager().getSkinInfo();
|
||||
SHeroSkin sHeroSkin = SHeroSkin.skinMapByType.get(skin);
|
||||
if(sHeroSkin!=null&&sHeroSkin.getMonomerProperty()!=null&&sHeroSkin.getMonomerProperty().length>0){
|
||||
if(skinInfo.containsKey(skin)&&skinInfo.get(skin)>TimeUtils.nowInt()){
|
||||
if(skinInfo.containsKey(skin)&&(skinInfo.get(skin)==-1||skinInfo.get(skin)>TimeUtils.nowInt())){
|
||||
combinedAttribute(sHeroSkin.getMonomerProperty(),heroAllAttribute);
|
||||
}
|
||||
}
|
||||
|
@ -3319,6 +3319,9 @@ public class HeroLogic{
|
|||
}
|
||||
|
||||
hero.setSkin(skinId);
|
||||
if(isInTeam(user,heroId,1)){
|
||||
Poster.getPoster().dispatchEvent(new UserMainTeamForceEvent(session.getUid()));
|
||||
}
|
||||
|
||||
|
||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),null,true);
|
||||
|
|
|
@ -212,7 +212,9 @@ public class ItemLogic {
|
|||
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
||||
}
|
||||
user.getHeroManager().addSkin(sHeroSkin.getType(),time);
|
||||
ItemUtil.drop(user,new int[][]{sHeroSkin.getHeadIcon()},BIReason.SKIN_USE_REWARD);
|
||||
if(sHeroSkin.getHeadIcon()!=null&&sHeroSkin.getHeadIcon().length>0){
|
||||
ItemUtil.drop(user,new int[][]{sHeroSkin.getHeadIcon()},BIReason.SKIN_USE_REWARD);
|
||||
}
|
||||
HeroInfoProto.GetSkinIndication indication = HeroInfoProto.GetSkinIndication.newBuilder()
|
||||
.setSkinInfo(CommonProto.SkinInfo.newBuilder().setSkinId(sHeroSkin.getType()).setOverTime(time))
|
||||
.build();
|
||||
|
|
|
@ -309,8 +309,11 @@ public class PlayerLogic {
|
|||
Set<Integer> fixVipId = new HashSet<>();
|
||||
for(Map.Entry<Integer,VipInfo> vipInfoItem : vipInfo.entrySet()){
|
||||
//如果这个权限是活动 且永久了 那么需要修复
|
||||
if(vipInfoItem.getValue().getEffectTime()==0&&SPrivilegeTypeConfig.getsPrivilegeTypeConfigMap().get(vipInfoItem.getKey()).getUnlockType()==5){
|
||||
fixVipId.add(vipInfoItem.getKey());
|
||||
if(vipInfoItem.getValue().getEffectTime()==0){
|
||||
int unlockType = SPrivilegeTypeConfig.getsPrivilegeTypeConfigMap().get(vipInfoItem.getKey()).getUnlockType();
|
||||
if(unlockType==5||(unlockType==4&&SPrivilegeTypeConfig.getsPrivilegeTypeConfigMap().get(vipInfoItem.getKey()).getContinueTime().length>0)){
|
||||
fixVipId.add(vipInfoItem.getKey());
|
||||
}
|
||||
}
|
||||
if(vipInfoItem.getValue().getEffectTime()!=0 && vipInfoItem.getValue().getEffectTime()<=(TimeUtils.now()/1000)){
|
||||
if(SPrivilegeTypeConfig.getsPrivilegeTypeConfigMap().get(vipInfoItem.getKey()).getPrivilegeType()==VipPrivilegeType.ADVENTURE_BASE_REWARD){
|
||||
|
|
|
@ -803,7 +803,7 @@ public class BuyGoodsLogic {
|
|||
if(sRechargeCommodityConfig.getDailyUpdate()>=1){
|
||||
if(!refreshBagMap.containsKey(sRechargeCommodityConfig.getId())){
|
||||
Gson gson = new Gson();
|
||||
LOGGER.error(sRechargeCommodityConfig.getId()+"Exception= " + gson.toJson(refreshBagMap.keySet()));
|
||||
// LOGGER.error(sRechargeCommodityConfig.getId()+"Exception= " + gson.toJson(refreshBagMap.keySet()));
|
||||
return new RechargeResult();
|
||||
}
|
||||
endTime = refreshBagMap.get(sRechargeCommodityConfig.getId());
|
||||
|
@ -966,6 +966,20 @@ public class BuyGoodsLogic {
|
|||
}
|
||||
}
|
||||
|
||||
// if (sRechargeCommodityConfig.getTime() == 6) {
|
||||
// if (rechargeInfo.getDyGoodsCanBuyTimes().containsKey(sRechargeCommodityConfig.getId())&&rechargeInfo.getRefreshBagMap().containsKey(sRechargeCommodityConfig.getId())) {
|
||||
// long endTime = rechargeInfo.getRefreshBagMap().get(sRechargeCommodityConfig.getId());
|
||||
// if (now > endTime || rechargeInfo.getDyGoodsCanBuyTimes().get(sRechargeCommodityConfig.getId()) <= 0) {
|
||||
// continue;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
if (sRechargeCommodityConfig.getTime() == 6) {
|
||||
int dytime = rechargeInfo.getDyGoodsCanBuyTimes().getOrDefault(goodsId,0)-1;
|
||||
if(dytime <0){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
long startTime=0;
|
||||
|
|
|
@ -0,0 +1,64 @@
|
|||
package config;
|
||||
|
||||
import manager.STableManager;
|
||||
import manager.Table;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name = "BlessingConfigNew")
|
||||
public class SBlessingConfigNew implements BaseConfig {
|
||||
|
||||
private int id;
|
||||
|
||||
private int activityId;
|
||||
|
||||
private int[] cost;
|
||||
|
||||
private int floorCount;
|
||||
|
||||
private int[] basicPoolId;
|
||||
|
||||
private int finalPoolId;
|
||||
|
||||
private static HashMap<Integer, SBlessingConfigNew> sBlessingConfigNewHashMap = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
Map<Integer, SBlessingConfigNew> config = STableManager.getConfig(SBlessingConfigNew.class);
|
||||
config.forEach((integer, sBlessingConfigNew) -> sBlessingConfigNewHashMap.put(sBlessingConfigNew.getActivityId(),sBlessingConfigNew));
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static HashMap<Integer, SBlessingConfigNew> getsBlessingConfigNewHashMap() {
|
||||
return sBlessingConfigNewHashMap;
|
||||
}
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getActivityId() {
|
||||
return activityId;
|
||||
}
|
||||
|
||||
public int[] getCost() {
|
||||
return cost;
|
||||
}
|
||||
|
||||
public int getFloorCount() {
|
||||
return floorCount;
|
||||
}
|
||||
|
||||
public int[] getBasicPoolId() {
|
||||
return basicPoolId;
|
||||
}
|
||||
|
||||
public int getFinalPoolId() {
|
||||
return finalPoolId;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
package config;
|
||||
|
||||
import manager.STableManager;
|
||||
import manager.Table;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name = "BlessingRewardPoolNew")
|
||||
public class SBlessingRewardPoolNew implements BaseConfig {
|
||||
|
||||
private int id;
|
||||
|
||||
private int poolId;
|
||||
|
||||
private int[] reward;
|
||||
|
||||
private int initializeNum;
|
||||
|
||||
private int extractWeight;
|
||||
|
||||
private int floorLimit;
|
||||
|
||||
private int levelLimit;
|
||||
|
||||
private static HashMap<Integer, HashSet<SBlessingRewardPoolNew>> sBlessingRewardPoolNewHashMap = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
||||
Map<Integer, SBlessingRewardPoolNew> configs = STableManager.getConfig(SBlessingRewardPoolNew.class);
|
||||
for (SBlessingRewardPoolNew sBlessingRewardPoolNew : configs.values()) {
|
||||
HashSet<SBlessingRewardPoolNew> orDefault = sBlessingRewardPoolNewHashMap.getOrDefault(sBlessingRewardPoolNew.getPoolId(), new HashSet<>());
|
||||
orDefault.add(sBlessingRewardPoolNew);
|
||||
sBlessingRewardPoolNewHashMap.put(sBlessingRewardPoolNew.getPoolId(),orDefault);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static HashMap<Integer, HashSet<SBlessingRewardPoolNew>> getsBlessingRewardPoolNewHashMap() {
|
||||
return sBlessingRewardPoolNewHashMap;
|
||||
}
|
||||
|
||||
public static void setsBlessingRewardPoolNewHashMap(HashMap<Integer, HashSet<SBlessingRewardPoolNew>> sBlessingRewardPoolNewHashMap) {
|
||||
SBlessingRewardPoolNew.sBlessingRewardPoolNewHashMap = sBlessingRewardPoolNewHashMap;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getPoolId() {
|
||||
return poolId;
|
||||
}
|
||||
|
||||
public int[] getReward() {
|
||||
return reward;
|
||||
}
|
||||
|
||||
public int getInitializeNum() {
|
||||
return initializeNum;
|
||||
}
|
||||
|
||||
public int getExtractWeight() {
|
||||
return extractWeight;
|
||||
}
|
||||
|
||||
public int getFloorLimit() {
|
||||
return floorLimit;
|
||||
}
|
||||
|
||||
public int getLevelLimit() {
|
||||
return levelLimit;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -84,6 +84,7 @@ public class SSpecialConfig implements BaseConfig {
|
|||
public static final String DISCOUNT_MAIN = "discount_main";//关卡礼包
|
||||
|
||||
public static final String ANIMAL_BROADCAST_QUALITY = "animal_broadcast_quality";
|
||||
public static final String ITEM_1004_RETRIEVE = "item_1004_retrieve";// 结算补发道具16 # 50
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
||||
|
|
Loading…
Reference in New Issue