Merge branch 'master_test_hw' into master_test_journey
commit
3f862e1ce3
|
|
@ -15,8 +15,8 @@ public interface Global {
|
|||
int CHANGENAME = 64; // 改名卡
|
||||
int EXP = 17;//经验
|
||||
int TREASURE_SCORE = 68;//孙龙宝藏积分
|
||||
int DAILY_TASK_REMOVE_ITEM = 30;//日常任务道具
|
||||
|
||||
int DAILY_TASK_REMOVE_ITEM = 30;//日常任务道具
|
||||
int MISSING_ROOM_ITEM = 79;
|
||||
int SEND_CARD_COUNT = 20; // 每页发送卡牌个数
|
||||
int SEND_ITEM_COUNT = 200; // 每页发送道具个数
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ import com.ljsd.jieling.logic.player.PlayerLogic;
|
|||
import com.ljsd.jieling.logic.rank.rankImpl.AbstractRank;
|
||||
import com.ljsd.jieling.logic.rank.RankContext;
|
||||
import com.ljsd.jieling.logic.rank.RankEnum;
|
||||
import com.ljsd.jieling.logic.store.BuyGoodsLogic;
|
||||
import com.ljsd.jieling.logic.store.StoreLogic;
|
||||
import com.ljsd.jieling.logic.store.StoreType;
|
||||
|
||||
|
|
@ -2160,6 +2161,12 @@ public class MapLogic {
|
|||
FightInfoProto.MainLevelFightUpdateIndication build = FightInfoProto.MainLevelFightUpdateIndication.newBuilder().setState(mainLevelManager.getState()).setFightId(mainLevelManager.getFightId()).build();
|
||||
MessageUtil.sendIndicationMessage(session,1, MessageTypeProto.MessageType.MAIN_LEVEL_FIGHT_UPDATE_INDICATION_VALUE,build,true);
|
||||
MessageUtil.sendMessage(session, 1, messageType.getNumber(), fightEndResponse.build(), true);
|
||||
|
||||
int integerValue = SSpecialConfig.getIntegerValue(SSpecialConfig.DISCOUNT_MAIN);
|
||||
if (sMainLevelConfig.getSortId() % integerValue == 0) {
|
||||
openRechargeBagIds(session, user, 25);
|
||||
}
|
||||
|
||||
// String rankKey = RedisKey.getKey(RedisKey.MAINLEVEL_RANK, "", false);
|
||||
// RedisUtil.getInstence().zsetAddOne(rankKey, String.valueOf(user.getId()), sMainLevelConfig.getVirtureId());
|
||||
RankContext.getRankEnum(RankEnum.MAIN_LEVEL_RANK.getType()).addRank(uid,"",sMainLevelConfig.getVirtureId(),user.getPlayerInfoManager().getMaxForce());
|
||||
|
|
@ -2167,6 +2174,46 @@ public class MapLogic {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启礼包
|
||||
* @param session
|
||||
* @param user
|
||||
* @param type
|
||||
* @throws Exception
|
||||
*/
|
||||
public void openRechargeBagIds(ISession session, User user, int type) throws Exception {
|
||||
Map<Integer, SRechargeCommodityConfig> integerSRechargeCommodityConfigMap = SRechargeCommodityConfig.rechargeIndetions.get(type);
|
||||
if (integerSRechargeCommodityConfigMap == null || integerSRechargeCommodityConfigMap.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
RechargeInfo rechargeInfo = user.getPlayerInfoManager().getRechargeInfo();
|
||||
double saveAmt = rechargeInfo.getSaveAmt();
|
||||
int sendRechargeId = 0;
|
||||
long lastTime = 0;
|
||||
for (SRechargeCommodityConfig sRechargeCommodityConfig : integerSRechargeCommodityConfigMap.values()) {
|
||||
if (saveAmt >= sRechargeCommodityConfig.getDiscountType()[1] && saveAmt <= sRechargeCommodityConfig.getDiscountType()[2]) {
|
||||
sendRechargeId = sRechargeCommodityConfig.getId();
|
||||
lastTime = sRechargeCommodityConfig.getDiscountType()[3] * 3600 * 1000L;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (sendRechargeId == 0) {
|
||||
LOGGER.info("sendRechargeId indetion id==0 uid=>{} saveAmt=>{}", user.getId(), saveAmt);
|
||||
} else {
|
||||
if (!rechargeInfo.getBuyGoodsTimes().containsKey(sendRechargeId)) {
|
||||
rechargeInfo.updateBuyGoodsTimes(sendRechargeId, 0);
|
||||
rechargeInfo.putDyGoodsCanBuyTimes(sendRechargeId, 1);
|
||||
} else {
|
||||
rechargeInfo.putDyGoodsCanBuyTimes(sendRechargeId, rechargeInfo.getDyGoodsCanBuyTimes().get(sendRechargeId) + 1);
|
||||
}
|
||||
rechargeInfo.updateRefreshMapByKey(sendRechargeId, TimeUtils.now() + lastTime);
|
||||
List<CommonProto.GiftGoodsInfo> goodsBagInfo = new ArrayList<>(SRechargeCommodityConfig.rechargeCommodityConfigMap.size());
|
||||
BuyGoodsLogic.getGoodsBagInfo(user.getId(), goodsBagInfo, false);
|
||||
PlayerInfoProto.AllGiftGoodsIndication goodsBuild = PlayerInfoProto.AllGiftGoodsIndication.newBuilder().addAllGiftGoodsInfo(goodsBagInfo).build();
|
||||
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.ALL_GIFTGOODS_INDICATION_VALUE, goodsBuild, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void openNextMainLevel(User user,int fightId) throws Exception {
|
||||
int level = user.getPlayerInfoManager().getLevel();
|
||||
|
|
@ -2302,6 +2349,25 @@ public class MapLogic {
|
|||
user.getUserMissionManager().onGameEvent(user,GameEvent.MONSTER_ATTACK_LEVEL);
|
||||
MessageUtil.sendMessage(session, 1, messageType.getNumber(), fightEndResponse.build(), true);
|
||||
|
||||
String stringValue = SSpecialConfig.getStringValue(SSpecialConfig.DISCOUNT_MONSTER_LEVEL);
|
||||
if (stringValue != null && !stringValue.isEmpty()) {
|
||||
String[] split1 = stringValue.split("\\|");
|
||||
String[] split2 = split1[0].split("#");
|
||||
boolean ifTreer = false;
|
||||
if (checkFightId > Integer.parseInt(split2[split2.length - 1])) {
|
||||
if (checkFightId % Integer.parseInt(split1[1]) == 0) {
|
||||
ifTreer = true;
|
||||
}
|
||||
} else {
|
||||
List<String> strings = Arrays.asList(split2);
|
||||
if (strings.contains(Integer.toString(checkFightId))) {
|
||||
ifTreer = true;
|
||||
}
|
||||
}
|
||||
if (ifTreer) {
|
||||
openRechargeBagIds(session, user, 26);
|
||||
}
|
||||
}
|
||||
List<CommonProto.Item> itemDrop = drop.getItemlistList();
|
||||
List<Integer> itemIdList = new ArrayList<>();
|
||||
List<Integer> itemNumList = new ArrayList<>();
|
||||
|
|
|
|||
|
|
@ -165,6 +165,9 @@ public class CumulationData {
|
|||
//森罗幻境中参与小游戏次数
|
||||
private int playMiniGameTimes;
|
||||
|
||||
//日常任务活跃度达到num
|
||||
private int daily_task_remove_item;
|
||||
|
||||
public Result updateData(MissionType missionType, Object...parm) throws Exception {
|
||||
return DataManagerDistributor.updateData(this, missionType,parm);
|
||||
}
|
||||
|
|
@ -367,4 +370,12 @@ public class CumulationData {
|
|||
public void setPlayMiniGameTimes(int playMiniGameTimes) {
|
||||
this.playMiniGameTimes = playMiniGameTimes;
|
||||
}
|
||||
|
||||
public int getDaily_task_remove_item() {
|
||||
return daily_task_remove_item;
|
||||
}
|
||||
|
||||
public void setDaily_task_remove_item(int daily_task_remove_item) {
|
||||
this.daily_task_remove_item = daily_task_remove_item;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,7 +80,8 @@ public class Hero extends MongoBase {
|
|||
}
|
||||
|
||||
this.equipByPositionMap = new HashMap<>();
|
||||
this.soulEquipByPositionMap = hero.soulEquipByPositionMap;
|
||||
// this.soulEquipByPositionMap = hero.soulEquipByPositionMap;
|
||||
this.soulEquipByPositionMap = new HashMap<>();
|
||||
this.breakId = hero.breakId;
|
||||
this.createTime = (int)(System.currentTimeMillis()/1000);
|
||||
this.speed = hero.speed;
|
||||
|
|
|
|||
|
|
@ -53,20 +53,20 @@ public class UserManager {
|
|||
//离线清除逻辑
|
||||
public static void checkOffline(){
|
||||
try {
|
||||
// Set<User> collect = userMap.entrySet().stream().filter(integerUserEntry -> !OnlineUserManager.checkUidOnline(integerUserEntry.getKey())).map(Map.Entry::getValue).collect(Collectors.toSet());
|
||||
// long l = System.currentTimeMillis();
|
||||
// collect.forEach(integerUserEntry -> {
|
||||
// long offLineTime = integerUserEntry.getPlayerInfoManager().getOffLineTime();
|
||||
// if(offLineTime<integerUserEntry.getPlayerInfoManager().getOnlineTime()){
|
||||
// return;
|
||||
// }
|
||||
// if(l-offLineTime>12*60*60*1000&& userMapPutTime.getOrDefault(integerUserEntry.getId(),0L)>12*60*60*1000){
|
||||
// userMap.remove(integerUserEntry.getId());
|
||||
// userMapPutTime.remove(integerUserEntry.getId());
|
||||
// }
|
||||
// });
|
||||
Set<User> collect = userMap.entrySet().stream().filter(integerUserEntry -> !OnlineUserManager.checkUidOnline(integerUserEntry.getKey())).map(Map.Entry::getValue).collect(Collectors.toSet());
|
||||
long l = System.currentTimeMillis();
|
||||
collect.forEach(integerUserEntry -> {
|
||||
long offLineTime = integerUserEntry.getPlayerInfoManager().getOffLineTime();
|
||||
if(offLineTime<integerUserEntry.getPlayerInfoManager().getOnlineTime()){
|
||||
return;
|
||||
}
|
||||
if(l-offLineTime>12*60*60*1000&& userMapPutTime.getOrDefault(integerUserEntry.getId(),0L)>12*60*60*1000){
|
||||
userMap.remove(integerUserEntry.getId());
|
||||
userMapPutTime.remove(integerUserEntry.getId());
|
||||
}
|
||||
});
|
||||
}catch (Exception e){
|
||||
LOGGER.error(e.toString());
|
||||
LOGGER.error("Exception离线清除逻辑err={}",e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ 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.globals.BIReason;
|
||||
import com.ljsd.jieling.globals.Global;
|
||||
import com.ljsd.jieling.handler.map.behavior.BehaviorUtil;
|
||||
import com.ljsd.jieling.logic.GlobalDataManaager;
|
||||
|
|
@ -26,6 +27,7 @@ import com.ljsd.jieling.logic.store.StoreLogic;
|
|||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.CommonProto;
|
||||
import com.ljsd.jieling.protocols.Expedition;
|
||||
import com.ljsd.jieling.protocols.HeroInfoProto;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.util.*;
|
||||
import config.*;
|
||||
|
|
@ -146,7 +148,7 @@ public class ExpeditionLogic {
|
|||
continue;
|
||||
}
|
||||
if(user.getExpeditionManager().getLay()<=entry.getKey()){//条件未达成
|
||||
continue;
|
||||
continue;
|
||||
}
|
||||
itemArrs.add(entry.getValue());
|
||||
}
|
||||
|
|
@ -235,7 +237,7 @@ public class ExpeditionLogic {
|
|||
//移除已经删除的hero
|
||||
Set<String> removeId = heroHP.keySet().stream().filter(k -> {
|
||||
if(heroMap.keySet().contains(k))
|
||||
return heroMap.get(k).getLevel()<20;
|
||||
return heroMap.get(k).getLevel()<20;
|
||||
if(heroMapTemp.keySet().contains(k))
|
||||
return heroMapTemp.get(k).getLevel()<20;
|
||||
return !heroMap.keySet().contains(k) && !heroMapTemp.keySet().contains(k);
|
||||
|
|
@ -325,21 +327,21 @@ public class ExpeditionLogic {
|
|||
}
|
||||
Set<ZSetOperations.TypedTuple<String>> typedTuples = RedisUtil.getInstence().rangeByScoreWithScores(RedisKey.AREDEF_TEAM_FORCE_RANK, "", 0, randomForce);
|
||||
|
||||
// if (typedTuples.size() == 0) {
|
||||
//战力没有获取到 从机器人中选
|
||||
// if (typedTuples.size() == 0) {
|
||||
//战力没有获取到 从机器人中选
|
||||
// Set<Integer> set = ArenaLogic.randomRobot(SArenaSetting.getSArenaSetting().getScore(), 1);
|
||||
//// if (set.size() == 0) {
|
||||
//// throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
||||
//// }
|
||||
// int robotId = set.iterator().next();
|
||||
//提前战力排序 支持战力查找机器人
|
||||
int robotId= SArenaRobotStaticConfig.getFloorForce2robotId((int)randomForce);
|
||||
SArenaRobotConfig sArenaRobotConfig = SArenaRobotConfig.getsArenaRobotConfigById(robotId);
|
||||
snapOneFightInfo(nodeInfo, sArenaRobotConfig);
|
||||
// } else {
|
||||
// String serarchIdFromRank = typedTuples.iterator().next().getValue();
|
||||
// snapOneFightInfo(user, nodeInfo, Integer.valueOf(serarchIdFromRank));
|
||||
// }
|
||||
//提前战力排序 支持战力查找机器人
|
||||
int robotId= SArenaRobotStaticConfig.getFloorForce2robotId((int)randomForce);
|
||||
SArenaRobotConfig sArenaRobotConfig = SArenaRobotConfig.getsArenaRobotConfigById(robotId);
|
||||
snapOneFightInfo(nodeInfo, sArenaRobotConfig);
|
||||
// } else {
|
||||
// String serarchIdFromRank = typedTuples.iterator().next().getValue();
|
||||
// snapOneFightInfo(user, nodeInfo, Integer.valueOf(serarchIdFromRank));
|
||||
// }
|
||||
}
|
||||
|
||||
if(nodeInfo.getType()==ExpeditionLogic.NODETYPE_GREED||nodeInfo.getType() ==ExpeditionLogic.NODETYPE_TRY){
|
||||
|
|
@ -836,14 +838,17 @@ public class ExpeditionLogic {
|
|||
finalstar=50;
|
||||
}
|
||||
SCHero hero1 = SCHero.getsCHero().get(tempid);
|
||||
if (null != hero1) {
|
||||
SCHeroRankUpConfig scHeroRankUpConfig = STableManager.getConfig(SCHeroRankUpConfig.class).get(hero1.getStar());
|
||||
if(null !=scHeroRankUpConfig&&finalstar>scHeroRankUpConfig.getOpenLevel()){
|
||||
finalstar=scHeroRankUpConfig.getOpenLevel();
|
||||
}
|
||||
|
||||
if (hero1 == null) {
|
||||
throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
||||
}
|
||||
|
||||
SCHeroRankUpConfig scHeroRankUpConfig = STableManager.getConfig(SCHeroRankUpConfig.class).get(hero1.getStar());
|
||||
if (null != scHeroRankUpConfig && finalstar > scHeroRankUpConfig.getOpenLevel()) {
|
||||
finalstar = scHeroRankUpConfig.getOpenLevel();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//random tempid
|
||||
Hero newHero = new Hero(uid,tempid,finalstar,hero);
|
||||
|
||||
|
|
@ -867,6 +872,14 @@ public class ExpeditionLogic {
|
|||
PropertyItem propertyItem = user.getEquipManager().getEquipMap().get(jewel);
|
||||
if (propertyItem == null)
|
||||
continue;
|
||||
|
||||
SJewelConfig config = STableManager.getConfig(SJewelConfig.class).get(propertyItem.getEquipId());
|
||||
if(config==null){
|
||||
continue;
|
||||
}
|
||||
if(hero1.getPropertyName()!=config.getRace()){
|
||||
continue;
|
||||
}
|
||||
Jewel j = (Jewel) propertyItem;
|
||||
Jewel newequip = new Jewel(user.getId(), j.getEquipId());
|
||||
|
||||
|
|
@ -877,6 +890,33 @@ public class ExpeditionLogic {
|
|||
// }
|
||||
newHero.addJewel(newequip.getId());
|
||||
}
|
||||
|
||||
|
||||
Map<Integer, Integer> soulEquipByPositionMap = hero.getSoulEquipByPositionMap();
|
||||
for (Map.Entry<Integer,Integer> entry:soulEquipByPositionMap.entrySet()) {
|
||||
SEquipConfig sEquipConfig = STableManager.getConfig(SEquipConfig.class).get(entry.getValue());
|
||||
if (sEquipConfig == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Set<Integer> cacheIds = new HashSet<>();
|
||||
int equipId = entry.getValue();
|
||||
if (sEquipConfig.getRangeHeroTids() != null && !sEquipConfig.getRangeHeroTids().contains(tempid)) {
|
||||
continue;
|
||||
}
|
||||
if (sEquipConfig.getLimit() == 1) {
|
||||
user.getHeroManager().getHeroMap().values().forEach(itemHero -> {
|
||||
cacheIds.addAll(itemHero.getSoulEquipByPositionMap().values());
|
||||
});
|
||||
if (cacheIds.contains(equipId)) {
|
||||
cacheIds.add(equipId);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
newHero.updateSoulEquipPositionMap(entry.getKey(),entry.getValue());
|
||||
}
|
||||
|
||||
|
||||
if(isTemp){
|
||||
user.getExpeditionManager().addHeroToTemp(newHero,nodeId);
|
||||
}else {
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import com.ljsd.jieling.exception.ErrorCodeException;
|
|||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.globals.Global;
|
||||
|
||||
import com.ljsd.jieling.globals.GlobalItemType;
|
||||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.logic.activity.event.*;
|
||||
|
|
@ -137,6 +138,33 @@ public class HeroLogic{
|
|||
// equipList.add(CBean2Proto.getEquipProto(equipInfo));
|
||||
// }
|
||||
// }
|
||||
//fix user item
|
||||
|
||||
ItemManager itemManager = user.getItemManager();
|
||||
EquipManager equipManager = user.getEquipManager();
|
||||
Set<Integer> set = new HashSet<>(itemManager.getItemMap().keySet());
|
||||
for (Integer integer : set) {
|
||||
try {
|
||||
SItem sItem = SItem.getsItemMap().get(integer);
|
||||
if (sItem != null) {
|
||||
int itemType = sItem.getItemType();
|
||||
if (itemType == GlobalItemType.JEWEL) {
|
||||
LOGGER.error("Excepeion 背包入库错误" + integer);
|
||||
for (int i = 0; i < itemManager.getItemMap().get(integer).getItemNum(); i++) {
|
||||
Jewel equip = new Jewel(user.getId(), integer);
|
||||
equipManager.addEquip(user, equip);
|
||||
}
|
||||
itemManager.removeItem(integer);
|
||||
|
||||
}
|
||||
} else {
|
||||
LOGGER.error("Exception SItem配置不存在 id:" + integer);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("Exception :" + e.toString());
|
||||
}
|
||||
}
|
||||
;
|
||||
//宝器
|
||||
if(type==4){
|
||||
Map<String, PropertyItem> equipMap = user.getEquipManager().getEquipMap();
|
||||
|
|
|
|||
|
|
@ -795,8 +795,10 @@ public class ItemLogic {
|
|||
}
|
||||
|
||||
|
||||
for(String item:items){
|
||||
user.getEquipManager().getEquipMap().remove(item);
|
||||
if(items!=null&&items.size()>0){
|
||||
for(String item:items){
|
||||
user.getEquipManager().remove(item);
|
||||
}
|
||||
}
|
||||
boolean itemCost = ItemUtil.itemCost(user, sJewelRankupConfig.getUpExpend(), BIReason.JEWEL_BUILD_OR_UP_CONSUME, 1);
|
||||
if(!itemCost){
|
||||
|
|
|
|||
|
|
@ -488,7 +488,7 @@ public class MissionLoigc {
|
|||
|
||||
if(missionStateChangeInfos!=null && !missionStateChangeInfos.isEmpty()){
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, missionStateChangeInfos.get(0).getRewwardGroups(), BIReason.TAKE_MISSION_REWARD);
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.DAILY_TASK_TYPE,missionId);
|
||||
// user.getUserMissionManager().onGameEvent(user,GameEvent.DAILY_TASK_TYPE,missionId,user);
|
||||
ReportUtil.onReportEvent(user, ReportEventEnum.MISSION_COMPLETE.getType(),String.valueOf(missionId),type);
|
||||
PlayerInfoProto.TakeMissionRewardResponse build = PlayerInfoProto.TakeMissionRewardResponse.newBuilder().setDrop(drop).build();
|
||||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.TAKE_MISSION_REWARD_RESPONSE_VALUE,build,true);
|
||||
|
|
|
|||
|
|
@ -17,6 +17,9 @@ public class DailyTaskManager extends AbstractDataManager{
|
|||
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
ItemManager itemManager = ((User)parm[1]).getItemManager();
|
||||
Item item = itemManager.getItem(Global.DAILY_TASK_REMOVE_ITEM);
|
||||
data.setDaily_task_remove_item(data.getDaily_task_remove_item()+(int)parm[0]);
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
|
||||
|
|
@ -27,16 +30,20 @@ public class DailyTaskManager extends AbstractDataManager{
|
|||
|
||||
@Override
|
||||
public boolean isFinish(User user,CumulationData data, int[][] cfgValue, Object... parm) {
|
||||
ItemManager itemManager = user.getItemManager();
|
||||
Item item = itemManager.getItem(Global.DAILY_TASK_REMOVE_ITEM);
|
||||
return item!=null&&item.getItemNum()>=cfgValue[1][0];
|
||||
// ItemManager itemManager = user.getItemManager();
|
||||
// Item item = itemManager.getItem(Global.DAILY_TASK_REMOVE_ITEM);
|
||||
// return item!=null&&item.getItemNum()>=cfgValue[1][0];
|
||||
|
||||
|
||||
return data.getDaily_task_remove_item()>=cfgValue[1][0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getProcess(User user, CumulationData data, int[] missionSubType) {
|
||||
ItemManager itemManager = user.getItemManager();
|
||||
Item item = itemManager.getItem(Global.DAILY_TASK_REMOVE_ITEM);
|
||||
return item==null?0:item.getItemNum();
|
||||
// ItemManager itemManager = user.getItemManager();
|
||||
// Item item = itemManager.getItem(Global.DAILY_TASK_REMOVE_ITEM);
|
||||
// return item==null?0:item.getItemNum();
|
||||
return data.getDaily_task_remove_item();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ public class ExpeditionPassManger extends AbstractDataManager{
|
|||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
int type = (int) parm[0];
|
||||
if(type==-1){
|
||||
if(type==-1||type>2){
|
||||
type=3;
|
||||
}
|
||||
data.expedition_floor_times.put(type,data.expedition_floor_times.getOrDefault(type, 0)+1);
|
||||
|
|
|
|||
|
|
@ -146,9 +146,9 @@ public class BuyGoodsLogic {
|
|||
double price = priceTemp==0?0:SExchangeRate.doubleIntegerHashMap.get(cfgType).get((int)priceTemp);
|
||||
if(amount!=-999&&MathUtils.doubleEquals(amount,price)){
|
||||
LOGGER.error("金额不对the uid={},the goodId={}, amount={},real={}", uid, goodsId, amount,price);
|
||||
// resultRes.setResultCode(0);
|
||||
// resultRes.setResultMsg("前后端金额不对"+amount+"realMoney = " + realMoney);
|
||||
// return resultRes;
|
||||
resultRes.setResultCode(0);
|
||||
resultRes.setResultMsg("前后端金额不对"+amount+"realMoney = " + String.valueOf(price));
|
||||
return resultRes;
|
||||
}
|
||||
RechargeInfo rechargeInfo = user.getPlayerInfoManager().getRechargeInfo();
|
||||
Map<Integer, Integer> buyGoodsTimes = rechargeInfo.getBuyGoodsTimes();
|
||||
|
|
@ -164,12 +164,33 @@ public class BuyGoodsLogic {
|
|||
int type = sRechargeCommodityConfig.getType();
|
||||
if(limit!=0){
|
||||
if(buyCount>limit){
|
||||
LOGGER.error("the uid={},the goodId={}, is over limit={}",uid,goodsId,buyCount);
|
||||
LOGGER.error("sendGoods the uid={},the goodId={}, is over limit={}",uid,goodsId,buyCount);
|
||||
resultRes.setResultCode(0);
|
||||
resultRes.setResultMsg("over limit");
|
||||
return resultRes;
|
||||
}
|
||||
}else {
|
||||
// 25闯关礼包、26、心魔试炼礼包
|
||||
if (sRechargeCommodityConfig.getTime() == 6) {
|
||||
if (!rechargeInfo.getBuyGoodsTimes().containsKey(goodsId)) {
|
||||
LOGGER.error("sendGoods the uid={},the goodId={}, is not open={}",uid,goodsId,buyCount);
|
||||
resultRes.setResultCode(0);
|
||||
resultRes.setResultMsg("not open");
|
||||
return resultRes;
|
||||
}
|
||||
if (!rechargeInfo.getDyGoodsCanBuyTimes().containsKey(goodsId)) {
|
||||
LOGGER.error("sendGoods the uid={},the goodId={}, is not open={}",uid,goodsId,buyCount);
|
||||
resultRes.setResultCode(0);
|
||||
resultRes.setResultMsg("not open");
|
||||
return resultRes;
|
||||
}
|
||||
if (rechargeInfo.getDyGoodsCanBuyTimes().get(goodsId) <= 0) {
|
||||
LOGGER.error("sendGoods the uid={},the goodId={}, buyCount=>{}, is over limit={}",uid, goodsId, buyCount, rechargeInfo.getDyGoodsCanBuyTimes().get(goodsId));
|
||||
resultRes.setResultCode(0);
|
||||
resultRes.setResultMsg("over limit");
|
||||
return resultRes;
|
||||
}
|
||||
}
|
||||
if(sRechargeCommodityConfig.getTime()==4&&(sRechargeCommodityConfig.getDiscountType().length==3||sRechargeCommodityConfig.getDiscountType().length==4)){
|
||||
int[] discountType = sRechargeCommodityConfig.getDiscountType();
|
||||
int temptype = discountType[0];
|
||||
|
|
@ -181,7 +202,6 @@ public class BuyGoodsLogic {
|
|||
resultRes.setResultMsg("over limit");
|
||||
return resultRes;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -355,7 +375,8 @@ public class BuyGoodsLogic {
|
|||
|
||||
ISession session = OnlineUserManager.getSessionByUid(uid);
|
||||
//特殊礼包次数
|
||||
if(sRechargeCommodityConfig.getTime()==4&&(sRechargeCommodityConfig.getDiscountType().length==3||sRechargeCommodityConfig.getDiscountType().length==4)){
|
||||
if((sRechargeCommodityConfig.getTime()==4 || sRechargeCommodityConfig.getTime()==6)
|
||||
&&(sRechargeCommodityConfig.getDiscountType().length==3||sRechargeCommodityConfig.getDiscountType().length==4)){
|
||||
int[] discountType = sRechargeCommodityConfig.getDiscountType();
|
||||
int temptype = discountType[0];
|
||||
int tempvalue = discountType[1];
|
||||
|
|
@ -560,6 +581,11 @@ public class BuyGoodsLogic {
|
|||
}
|
||||
|
||||
for(SRechargeCommodityConfig sRechargeCommodityConfig :SRechargeCommodityConfig.rechargeCommodityConfigMap.values()){
|
||||
// 25闯关礼包、26、心魔试炼礼包 特殊处理
|
||||
if ((sRechargeCommodityConfig.getShowType() == 25 || sRechargeCommodityConfig.getShowType() == 26)
|
||||
&& !rechargeInfo.getBuyGoodsTimes().containsKey(sRechargeCommodityConfig.getId())) {
|
||||
continue;
|
||||
}
|
||||
int limit = sRechargeCommodityConfig.getLimit();
|
||||
int goodsId = sRechargeCommodityConfig.getId();
|
||||
Integer buyTimes = buyGoodsTimes.get(goodsId);
|
||||
|
|
@ -761,8 +787,15 @@ public class BuyGoodsLogic {
|
|||
rechargeInfo.getCacheSendedTypes().put(goodsId, startTime);
|
||||
}
|
||||
}
|
||||
|
||||
}else{
|
||||
} else if (time == 6) {
|
||||
if (rechargeInfo.getDyGoodsCanBuyTimes().containsKey(sRechargeCommodityConfig.getId())) {
|
||||
endTime = rechargeInfo.getRefreshBagMap().get(sRechargeCommodityConfig.getId());
|
||||
if (now > endTime || rechargeInfo.getDyGoodsCanBuyTimes().get(sRechargeCommodityConfig.getId()) <= 0) {
|
||||
return new RechargeResult();
|
||||
}
|
||||
startTime = endTime - sRechargeCommodityConfig.getDiscountType()[3] * 3600000;
|
||||
}
|
||||
} else {
|
||||
if(sRechargeCommodityConfig.getDailyUpdate()>=1){
|
||||
if(!refreshBagMap.containsKey(sRechargeCommodityConfig.getId())){
|
||||
Gson gson = new Gson();
|
||||
|
|
|
|||
|
|
@ -624,6 +624,9 @@ public class ItemUtil {
|
|||
} else if (sItem.getItemType() == GlobalItemType.SOUL_MARK) {
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.GOT_SOUL_MARK, sItem.getId(), itemNum);
|
||||
}
|
||||
if(sItem.getId()==Global.DAILY_TASK_REMOVE_ITEM){
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.DAILY_TASK_TYPE,itemNum,user);
|
||||
}
|
||||
//日志记录
|
||||
ItemLogic.getInstance().addItemLog(new ItemLog(user.getId(),0,user.getPlayerInfoManager().getLevel(),String.valueOf(TimeUtils.now()),reason,sItem.getId(),itemNum,item.getItemNum()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,8 +38,8 @@ public class MessageUtil {
|
|||
backMessage = new byte[0];
|
||||
} else {
|
||||
backMessage = generatedMessage.toByteArray();
|
||||
if (backMessage.length != 0)
|
||||
LOGGER.info("wrappedBuffer uid=>{}, generatedMessage=>{}", uid, JsonFormat.printToString(generatedMessage));
|
||||
// if (backMessage.length != 0)
|
||||
// LOGGER.info("wrappedBuffer uid=>{}, generatedMessage=>{}", uid, JsonFormat.printToString(generatedMessage));
|
||||
}
|
||||
|
||||
int length = PackageConstant.UID_FIELD_LEN + PackageConstant.TOKEN_LEN
|
||||
|
|
@ -63,9 +63,9 @@ public class MessageUtil {
|
|||
}
|
||||
int[] secretKey = Tea.KEY;
|
||||
byte[] bytes1 = Tea.encrypt2(bytes, secretKey);
|
||||
if (backMessage.length != 0) {
|
||||
LOGGER.info("wrappedBuffer uid=>{} sendbyte=>{}", uid, bytes1.length);
|
||||
}
|
||||
// if (backMessage.length != 0) {
|
||||
// LOGGER.info("wrappedBuffer uid=>{} sendbyte=>{}", uid, bytes1.length);
|
||||
// }
|
||||
return bytes1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,6 +41,8 @@ public class SMainLevelConfig implements BaseConfig {
|
|||
|
||||
private int virtureId; //虚拟id,关卡是自增的。
|
||||
|
||||
private int sortId;
|
||||
|
||||
public static Map<Integer, SMainLevelConfig> config;
|
||||
public static Map<Integer, SMainLevelConfig> sMainLevelConfigByVirtureIdMap;
|
||||
public static Map<Integer,SMainLevelConfig> fightPreMap;
|
||||
|
|
@ -131,4 +133,8 @@ public class SMainLevelConfig implements BaseConfig {
|
|||
public void setVirtureId(int virtureId) {
|
||||
this.virtureId = virtureId;
|
||||
}
|
||||
|
||||
public int getSortId() {
|
||||
return sortId;
|
||||
}
|
||||
}
|
||||
|
|
@ -61,7 +61,7 @@ public class SRechargeCommodityConfig implements BaseConfig {
|
|||
|
||||
private int[] passiveSkill;
|
||||
|
||||
|
||||
private int showType;
|
||||
|
||||
public static Map<Integer, SRechargeCommodityConfig> rechargeCommodityConfigMap;
|
||||
public static Map<String, SRechargeCommodityConfig> sdkRechargeCommodityConfigMap;
|
||||
|
|
@ -70,6 +70,8 @@ public class SRechargeCommodityConfig implements BaseConfig {
|
|||
public static TreeMap<Integer,Integer> rechargePlayerLevelMap;
|
||||
public static Set<SRechargeCommodityConfig> refreshItemInfo;
|
||||
|
||||
public static Map<Integer, Map<Integer, SRechargeCommodityConfig>> rechargeIndetions;
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
Map<Integer, SRechargeCommodityConfig> config = STableManager.getConfig(SRechargeCommodityConfig.class);
|
||||
|
|
@ -81,6 +83,7 @@ public class SRechargeCommodityConfig implements BaseConfig {
|
|||
|
||||
TreeMap<Integer,Integer> rechargePlayerLevelTemp = new TreeMap<>();
|
||||
Set<SRechargeCommodityConfig> refreshItemInfoTmp = new HashSet<>();
|
||||
Map<Integer, Map<Integer, SRechargeCommodityConfig>> rechargeIndetionsTemp = new HashMap<>();
|
||||
for(SRechargeCommodityConfig sRechargeCommodityConfig : config.values()){
|
||||
sdkRechargeCommodityConfigMap.put(sRechargeCommodityConfig.getRechargeId(),sRechargeCommodityConfig);
|
||||
sdkRechargeCommodityConfigMap.put(sRechargeCommodityConfig.getRechargeId2(),sRechargeCommodityConfig);
|
||||
|
|
@ -121,13 +124,19 @@ public class SRechargeCommodityConfig implements BaseConfig {
|
|||
if(!StringUtil.isEmpty(endtime)){
|
||||
sRechargeCommodityConfig.setEndTimeLong(Long.parseLong(endtime));
|
||||
}
|
||||
if (sRechargeCommodityConfig.getShowType() == 25 || sRechargeCommodityConfig.getShowType() == 26) {
|
||||
if (!rechargeIndetionsTemp.containsKey(sRechargeCommodityConfig.getShowType())) {
|
||||
rechargeIndetionsTemp.put(sRechargeCommodityConfig.getShowType(), new HashMap<>());
|
||||
}
|
||||
rechargeIndetionsTemp.get(sRechargeCommodityConfig.getShowType()).put(sRechargeCommodityConfig.getId(), sRechargeCommodityConfig);
|
||||
}
|
||||
}
|
||||
rechargeCommodityConfigMap = config;
|
||||
rechargeLevelMap = rechargeLevelMapTmp;
|
||||
recharegeHeroTime = recharegeHeroTimeTmp;
|
||||
refreshItemInfo = refreshItemInfoTmp;
|
||||
rechargePlayerLevelMap = rechargePlayerLevelTemp;
|
||||
|
||||
rechargeIndetions = rechargeIndetionsTemp;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -254,4 +263,8 @@ public class SRechargeCommodityConfig implements BaseConfig {
|
|||
public String getRechargeId3() {
|
||||
return rechargeId3;
|
||||
}
|
||||
|
||||
public int getShowType() {
|
||||
return showType;
|
||||
}
|
||||
}
|
||||
|
|
@ -78,6 +78,10 @@ public class SSpecialConfig implements BaseConfig {
|
|||
public static final String SKY_TREASURE_SCORE_INGIFT = "sky_treasure_score_ingift";//天宫密保购买默认获得积分
|
||||
public static final String FREETRAVEL_EVENT_TIME = "FreeTravel_event_Time";//事件持续时间(分钟)-2个小时
|
||||
|
||||
public static final String DISCOUNT_MONSTER_LEVEL = "discount_monster_level";// 心魔试炼折扣礼包触发条件
|
||||
|
||||
public static final String DISCOUNT_MAIN = "discount_main";//关卡礼包
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue