Merge branch 'master_test_hw' of http://60.1.1.230/backend/jieling_server into master_test_hw
commit
33bd562ea6
|
@ -125,7 +125,7 @@ public class TakeLayRewardHandler extends BaseHandler<Expedition.TakeExpeditionB
|
|||
|
||||
user.getExpeditionManager().addScore(score);
|
||||
Map<Integer, Integer> rewardStatusMap = user.getExpeditionManager().getWorldTreasureReward().getRewardStatusMap();
|
||||
ExpeditionLogic.sendTreasureRewardUpdate(iSession,user.getExpeditionManager().getWorldTreasureReward().getScore(),rewardStatusMap,user.getExpeditionManager().getWorldTreasureReward().getCreateTime());
|
||||
ExpeditionLogic.sendTreasureRewardUpdate(iSession,user.getExpeditionManager().getWorldTreasureReward().getScore(),rewardStatusMap,user.getExpeditionManager().getWorldTreasureReward().getCreateTime(),expeditionManager.getWorldTreasureReward().getIsBuy());
|
||||
|
||||
Expedition.TakeExpeditionBoxRewardResponse builder = Expedition.TakeExpeditionBoxRewardResponse.newBuilder().setDrop(drop).addAllLeve(objects).build();
|
||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.EXPEDITION_TAKE_BOXREWARD_RESONSE_VALUE, builder, true);
|
||||
|
|
|
@ -59,7 +59,7 @@ public class TakeTreasureRewardHandler extends BaseHandler<Expedition.Expedition
|
|||
worldTreasureReward.updateMissionStatus(id,changeState);
|
||||
Map<Integer,Integer> stateUpdateMap = new HashMap<>();
|
||||
stateUpdateMap.put(id,changeState);
|
||||
ExpeditionLogic.sendTreasureRewardUpdate(iSession,worldTreasureReward.getScore(),stateUpdateMap,worldTreasureReward.getCreateTime());
|
||||
ExpeditionLogic.sendTreasureRewardUpdate(iSession,worldTreasureReward.getScore(),stateUpdateMap,worldTreasureReward.getCreateTime(),worldTreasureReward.getIsBuy());
|
||||
}else{
|
||||
Map<Integer,Integer> stateUpdateMap = new HashMap<>();
|
||||
Set<SWorldBossTreasureConfig> sWorldBossTreasureConfigs = idsByPeriods.get(round);
|
||||
|
@ -76,7 +76,7 @@ public class TakeTreasureRewardHandler extends BaseHandler<Expedition.Expedition
|
|||
throw new ErrorCodeException("无奖励可领取");
|
||||
}
|
||||
user.getExpeditionManager().onlyUpdateTreasureReward();
|
||||
ExpeditionLogic.sendTreasureRewardUpdate(iSession,worldTreasureReward.getScore(),stateUpdateMap,worldTreasureReward.getCreateTime());
|
||||
ExpeditionLogic.sendTreasureRewardUpdate(iSession,worldTreasureReward.getScore(),stateUpdateMap,worldTreasureReward.getCreateTime(),worldTreasureReward.getIsBuy());
|
||||
}
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, drops, BIReason.EXCEPTION_TREASURE_REWARD);
|
||||
Expedition.ExpeditionTakeTreasureResponse build = Expedition.ExpeditionTakeTreasureResponse.newBuilder().setDrop(drop).build();
|
||||
|
|
|
@ -2306,7 +2306,7 @@ public class MapLogic {
|
|||
itemIdList.add(item.getItemId());
|
||||
itemIdList.add(item.getItemNum());
|
||||
});
|
||||
ReportUtil.onReportEvent(user,ReportEventEnum.COMPLETE_XINMO.getType(),checkFightId,sFloodConfig.getMonster(),MonsterUtil.getMonsterForce(new int[]{sFloodConfig.getMonster()}),new Date(),"",itemIdList,itemNumList);
|
||||
ReportUtil.onReportEvent(user,ReportEventEnum.COMPLETE_XINMO.getType(),checkFightId,sFloodConfig.getMonster(),MonsterUtil.getMonsterForce(new int[]{sFloodConfig.getMonster()}),new Date(),"",itemIdList,itemNumList,resultCode==1?"成功":"失败");
|
||||
}
|
||||
|
||||
|
||||
|
@ -3110,17 +3110,15 @@ public class MapLogic {
|
|||
}
|
||||
}
|
||||
CommonProto.Drop drop = builder.getDrop();
|
||||
if(!isFailed){
|
||||
List<CommonProto.Item> itemDrop = drop.getItemlistList();
|
||||
List<Integer> itemIdList = new ArrayList<>();
|
||||
List<Integer> itemNumList = new ArrayList<>();
|
||||
itemDrop.forEach(item->{
|
||||
itemIdList.add(item.getItemId());
|
||||
itemIdList.add(item.getItemNum());
|
||||
});
|
||||
ReportUtil.onReportEvent(user,ReportEventEnum.COMPLETE_DAILY_DUNGEON.getType(),id,sDailyChallengeConfig.getMonsterId(),MonsterUtil.getMonsterForce(new int[]{sDailyChallengeConfig.getMonsterId()}),new Date(),"",0,itemIdList,itemNumList,type==1?"挑战":"扫荡");
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.DAILY_CHALLENGE,sDailyChallengeConfig.getType());
|
||||
}
|
||||
List<CommonProto.Item> itemDrop = drop.getItemlistList();
|
||||
List<Integer> itemIdList = new ArrayList<>();
|
||||
List<Integer> itemNumList = new ArrayList<>();
|
||||
itemDrop.forEach(item->{
|
||||
itemIdList.add(item.getItemId());
|
||||
itemIdList.add(item.getItemNum());
|
||||
});
|
||||
ReportUtil.onReportEvent(user,ReportEventEnum.COMPLETE_DAILY_DUNGEON.getType(),id,sDailyChallengeConfig.getMonsterId(),MonsterUtil.getMonsterForce(new int[]{sDailyChallengeConfig.getMonsterId()}),new Date(),"",0,itemIdList,itemNumList,type==1?"挑战":"扫荡",isFailed?"失败":"通过");
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.DAILY_CHALLENGE,sDailyChallengeConfig.getType());
|
||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),builder.build());
|
||||
}
|
||||
|
||||
|
|
|
@ -46,9 +46,9 @@ public enum ReportEventEnum {
|
|||
SEND_MESSAGE(32,"send_message", new CommonEventHandler(),new String[]{"message_type","message_content"}),
|
||||
OPEN_MAIL(33,"open_mail", new CommonEventHandler(),new String[]{""}),
|
||||
//-------新一期
|
||||
COMPLETE_DAILY_DUNGEON(35,"complete_daily_dungeon", new CommonEventHandler(),new String[]{"stage_id","enemy_id","enemy_capacity","start_time","enemy_hero_list","left_challenge_nums","rewards_id_list","rewards_num_list","pass_type"}),
|
||||
COMPLETE_DAILY_DUNGEON(35,"complete_daily_dungeon", new CommonEventHandler(),new String[]{"stage_id","enemy_id","enemy_capacity","start_time","enemy_hero_list","left_challenge_nums","rewards_id_list","rewards_num_list","pass_type","Combat_results"}),
|
||||
|
||||
COMPLETE_XINMO(37,"complete_xinmo", new CommonEventHandler(),new String[]{"stage_id","enemy_id","enemy_capacity","start_time","enemy_hero_list","rewards_id_list","rewards_num_list"}),
|
||||
COMPLETE_XINMO(37,"complete_xinmo", new CommonEventHandler(),new String[]{"stage_id","enemy_id","enemy_capacity","start_time","enemy_hero_list","rewards_id_list","rewards_num_list","Combat_results"}),
|
||||
|
||||
COMPLETE_CHECHI(39,"start_chechi", new CommonEventHandler(),new String[]{"stage_id","stage_type","Integral_entrance","Integral"}),
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ public class WorldTreasureReward extends MongoBase {
|
|||
private int createTime; //取当天零点 根据其可以推算出期数。
|
||||
private int round;
|
||||
private int score;
|
||||
private int isBuy;
|
||||
private Map<Integer,Integer> rewardStatusMap = new HashMap<>(); //领取状态 1:表示领取基础奖励 2:表示领取额外奖励。
|
||||
|
||||
WorldTreasureReward(){
|
||||
|
@ -34,6 +35,7 @@ public class WorldTreasureReward extends MongoBase {
|
|||
}
|
||||
score = 0;
|
||||
rewardStatusMap = new HashMap<>();
|
||||
setIsBuy(0);
|
||||
updateRound(round+1);
|
||||
}
|
||||
|
||||
|
@ -83,5 +85,12 @@ public class WorldTreasureReward extends MongoBase {
|
|||
this.firstStartTime = firstStartTime;
|
||||
}
|
||||
|
||||
public int getIsBuy() {
|
||||
return isBuy;
|
||||
}
|
||||
|
||||
public void setIsBuy(int isBuy) {
|
||||
this.isBuy = isBuy;
|
||||
updateString("isBuy",isBuy);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -795,15 +795,16 @@ public class ExpeditionLogic {
|
|||
Map<Integer, Set<SWorldBossTreasureConfig>> idsByPeriods = worldBossTreasureStaticConfig.getIdsByPeriods();
|
||||
Map<Integer,Integer> changeStateMap = new HashMap<>(rewardStatusMap);
|
||||
idsByPeriods.get(worldTreasureReward.getRound()).forEach(item->changeStateMap.putIfAbsent(item.getId(),0));
|
||||
sendTreasureRewardUpdate(session,0,changeStateMap,worldTreasureReward.getCreateTime());
|
||||
sendTreasureRewardUpdate(session,0,changeStateMap,worldTreasureReward.getCreateTime(),worldTreasureReward.getIsBuy());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void sendTreasureRewardUpdate(ISession iSession,int score,Map<Integer,Integer> changeStatusMap,int time){
|
||||
public static void sendTreasureRewardUpdate(ISession iSession,int score,Map<Integer,Integer> changeStatusMap,int time,int isBuy){
|
||||
Expedition.TreasureStateIndicaion.Builder builder = Expedition.TreasureStateIndicaion.newBuilder().setScore(score);
|
||||
builder.setResetTime(time);
|
||||
changeStatusMap.forEach((id,status)-> builder.addTreasureRewardState(Expedition.TreasureRewardState.newBuilder().setId(id).setState(status).build()));
|
||||
builder.setIsBuy(isBuy);
|
||||
MessageUtil.sendIndicationMessage(iSession,1, MessageTypeProto.MessageType.EXPEDITION_TREASURE_STATE_INDICATION_VALUE,builder.build(),true);
|
||||
|
||||
}
|
||||
|
@ -1027,6 +1028,7 @@ public class ExpeditionLogic {
|
|||
response.addAllTreasureRewardState(states);
|
||||
response.setScore(worldTreasureReward.getScore());
|
||||
response.setResetTime(worldTreasureReward.getCreateTime());
|
||||
response.setIsBuy(worldTreasureReward.getIsBuy());
|
||||
}else {
|
||||
response.setResetTime(-1);
|
||||
}
|
||||
|
|
|
@ -356,14 +356,7 @@ public class GuildChallengeLogic {
|
|||
SGuildCheckpointConfig config = STableManager.getConfig(SGuildCheckpointConfig.class).get(guildInfo.getCurrBossId());
|
||||
int[] attributePromote = config.getAttributePromote();
|
||||
int maxCount = attributePromote.length;
|
||||
if(guildInfo.getBuffIndex()>=maxCount){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
int[][] attributePromotePrice = config.getAttributePromotePrice();
|
||||
boolean itemCost = ItemUtil.itemCost(user, new int[][]{{attributePromotePrice[0][0], attributePromotePrice[1][guildInfo.getBuffIndex()]}}, BIReason.GUILD_CHALLENGE_BUFF_BUY_CONSUME, 1);
|
||||
if(!itemCost){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
|
||||
|
||||
synchronized (lockMap.get(guildId)){
|
||||
int time;
|
||||
|
@ -376,6 +369,14 @@ public class GuildChallengeLogic {
|
|||
}
|
||||
time = TimeUtils.nowInt() + 3600;
|
||||
}
|
||||
if(guildInfo.getBuffIndex()>=maxCount){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
int[][] attributePromotePrice = config.getAttributePromotePrice();
|
||||
boolean itemCost = ItemUtil.itemCost(user, new int[][]{{attributePromotePrice[0][0], attributePromotePrice[1][guildInfo.getBuffIndex()]}}, BIReason.GUILD_CHALLENGE_BUFF_BUY_CONSUME, 1);
|
||||
if(!itemCost){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
guildInfo.setBuffIndex(guildInfo.getBuffIndex()+1);
|
||||
int fiveTime = (int)(TimeUtils.getLastOrUnderHour(TimeUtils.now(), 5, 0, false)/1000);
|
||||
guildInfo.setBuffOverTime(Math.min(time,fiveTime));
|
||||
|
|
|
@ -1550,6 +1550,15 @@ public class HeroLogic{
|
|||
combinedAttribute(config.get(buildLevelProperty).getProperty(),heroAllAttribute);
|
||||
}
|
||||
}
|
||||
//魂印
|
||||
Map<Integer, Integer> soulEquipByPositionMap = hero.getSoulEquipByPositionMap();
|
||||
soulEquipByPositionMap.forEach((k,v)->{
|
||||
SEquipConfig sEquipConfig = STableManager.getConfig(SEquipConfig.class).get(v);
|
||||
int[][] property = sEquipConfig.getProperty();
|
||||
if(property!=null&&property.length>0&&property[0].length>0){
|
||||
combinedAttribute(property,heroAllAttribute);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//皮肤、称号加成
|
||||
|
|
|
@ -113,7 +113,7 @@ public class BuyGoodsLogic {
|
|||
sRechargeCommodityConfig =SRechargeCommodityConfig.rechargeCommodityConfigMap.get(goodsId);
|
||||
}else {
|
||||
sRechargeCommodityConfig = SRechargeCommodityConfig.sdkRechargeCommodityConfigMap.get(sdkGoodsId);
|
||||
sRechargeCommodityConfig.getId();
|
||||
goodsId = sRechargeCommodityConfig.getId();
|
||||
}
|
||||
|
||||
|
||||
|
@ -398,8 +398,9 @@ public class BuyGoodsLogic {
|
|||
}
|
||||
if(type==GiftGoodsType.SKY_TREASURE){
|
||||
user.getExpeditionManager().getWorldTreasureReward().setScore(user.getExpeditionManager().getWorldTreasureReward().getScore()+SSpecialConfig.getIntegerValue(SSpecialConfig.SKY_TREASURE_SCORE_INGIFT));
|
||||
user.getExpeditionManager().getWorldTreasureReward().setIsBuy(1);
|
||||
Map<Integer, Integer> rewardStatusMap = user.getExpeditionManager().getWorldTreasureReward().getRewardStatusMap();
|
||||
ExpeditionLogic.sendTreasureRewardUpdate(OnlineUserManager.getSessionByUid(user.getId()),user.getExpeditionManager().getWorldTreasureReward().getScore(),rewardStatusMap,user.getExpeditionManager().getWorldTreasureReward().getCreateTime());
|
||||
ExpeditionLogic.sendTreasureRewardUpdate(OnlineUserManager.getSessionByUid(user.getId()),user.getExpeditionManager().getWorldTreasureReward().getScore(),rewardStatusMap,user.getExpeditionManager().getWorldTreasureReward().getCreateTime(),1);
|
||||
}
|
||||
if(sRechargeCommodityConfig.getTime() ==5){
|
||||
rechargeInfo.updateRefreshMapByKey(sRechargeCommodityConfig.getId(),TimeUtils.now()+sRechargeCommodityConfig.getDailyUpdate()*TimeUtils.DAY);
|
||||
|
@ -410,20 +411,31 @@ public class BuyGoodsLogic {
|
|||
// Poster.getPoster().dispatchEvent(new NewWelfareEvent(user, NewWelfareTypeEnum.RECHARGE_BUY.getType(),goodsId));
|
||||
MongoUtil.getLjsdMongoTemplate().lastUpdate();
|
||||
sendGiftGooodsIndication(uid);
|
||||
onChargeSuccess(uid,sRechargeCommodityConfig.getPrice(),0,orderId);//充值成功上报
|
||||
onChargeSuccess(uid,price,0,orderId,cfgType);//充值成功上报
|
||||
Map<Integer, Integer> mapReward = ItemUtil.arrayToMap(baseReward);
|
||||
ReportUtil.onReportEvent(user, ReportEventEnum.ORDER_COMPLETE.getType(),orderId,price,user.getPlayerInfoManager().getBundle_id(),user.getPlayerInfoManager().getChannel_id(),String.valueOf(GameApplication.serverId),String.valueOf(goodsId),sRechargeCommodityConfig.getName(),new ArrayList<>(mapReward.keySet()),new ArrayList<>(mapReward.values()),new Date());
|
||||
return resultRes;
|
||||
|
||||
}
|
||||
private static void onChargeSuccess(int uid,double amount,int virtualAmount,String orderId){
|
||||
private static void onChargeSuccess(int uid,double amount,int virtualAmount,String orderId,int cfgType){
|
||||
String currency_type = "CNY";
|
||||
switch (cfgType){
|
||||
case 1:
|
||||
currency_type="CNY";
|
||||
break;
|
||||
case 2:
|
||||
currency_type = "USD";
|
||||
break;
|
||||
default:break;
|
||||
|
||||
}
|
||||
RechargeEvent rechargeEvent = new RechargeEvent();
|
||||
rechargeEvent.setModule("GameAnalysis");
|
||||
rechargeEvent.setIp("");
|
||||
rechargeEvent.setName("charge");
|
||||
rechargeEvent.setIndex(GameApplication.serverProperties.getAppId()==null?"APPID":GameApplication.serverProperties.getAppId());
|
||||
rechargeEvent.setIdentify(String.valueOf(uid));
|
||||
rechargeEvent.setProperties(new RechargeEventProp(orderId,amount*100,virtualAmount,"CNY","",""));
|
||||
rechargeEvent.setProperties(new RechargeEventProp(orderId,amount*100,virtualAmount,currency_type,"",""));
|
||||
String s = DataMessageUtils.sendRechargePost(rechargeEvent);
|
||||
if(s!=null&&s.equals("1")){
|
||||
LOGGER.info("{}充值上报成功,价格为{}",uid,amount);
|
||||
|
|
|
@ -1261,7 +1261,7 @@ public class ItemUtil {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
if (entry.getValue() <= 0) {
|
||||
if (entry.getValue() < 0) {
|
||||
LOGGER.info("checkCost uid=>{} use negative item itemId=>{} count=>{}", user.getId(), entry.getKey(), entry.getValue());
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
package PACKAGE_NAME;
|
||||
|
||||
public class Test {
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
package db;
|
||||
|
||||
public class Test {
|
||||
}
|
Loading…
Reference in New Issue