Merge branch 'master_test_hw' into master_test_combin
commit
7c5c28d6a1
|
@ -3,6 +3,7 @@ package util;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
|
@ -367,4 +368,10 @@ public class MathUtils {
|
|||
return result;
|
||||
}
|
||||
|
||||
public static double doubleAdd(double d1 ,double d2){
|
||||
BigDecimal b1 = new BigDecimal(Double.toString(d1));
|
||||
BigDecimal b2 = new BigDecimal(Double.toString(d2));
|
||||
return b1.add(b2).doubleValue();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.ljsd.jieling.config.clazzStaticCfg;
|
||||
|
||||
import config.SExpeditionFloorConfig;
|
||||
import config.SRaceTowerRewardConfig;
|
||||
import manager.AbstractClassStaticConfig;
|
||||
import manager.STableManager;
|
||||
|
|
|
@ -4,6 +4,8 @@ import com.ljsd.jieling.core.VipPrivilegeType;
|
|||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.SignInEvent;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||
|
@ -55,8 +57,15 @@ public class SignInHandler extends BaseHandler {
|
|||
throw new ErrorCodeException("次数不足");
|
||||
}
|
||||
PlayerLogic.getInstance().checkAndUpdate(user, VipPrivilegeType.SIGN_AGAIN, 1);
|
||||
|
||||
boolean todayFirstSign = user.getPlayerInfoManager().getSignTotay() == 0;
|
||||
user.getPlayerInfoManager().setSignTotay(1);
|
||||
|
||||
if (todayFirstSign) {
|
||||
//累计签到事件
|
||||
Poster.getPoster().dispatchEvent(new SignInEvent(user.getId()));
|
||||
}
|
||||
|
||||
int[] reward = sign.getreward();
|
||||
int[][] cost = new int[1][];
|
||||
cost[0] = reward;
|
||||
|
|
|
@ -66,7 +66,7 @@ public class DoHeroChangeRequestHandler extends BaseHandler<HeroInfoProto.DoHer
|
|||
CommonProto.Drop.Builder drop = CommonProto.Drop.newBuilder();
|
||||
//random tempid
|
||||
Hero newHero = new Hero(uid,hero.getChangeId(),hero.getLevel(),hero);
|
||||
newHero.setCreateTime(0);
|
||||
newHero.setCreateType(0);
|
||||
newHero.setEquipByPositionMap(hero.getEquipByPositionMap());
|
||||
newHero.setJewelInfo(hero.getJewelInfo());
|
||||
user.getHeroManager().addHero(newHero);
|
||||
|
|
|
@ -2819,7 +2819,7 @@ public class MapLogic {
|
|||
*/
|
||||
public void checkTrialReset(User user) throws Exception {
|
||||
MapManager mapManager = user.getMapManager();
|
||||
|
||||
StoreManager storeManager = user.getStoreManager();
|
||||
//判断试炼本是否跨了周期
|
||||
TrialInfo trialInfo = mapManager.getTrialInfo();
|
||||
TimeControllerOfFunction openTimeOfFuntionCacheByType = GlobalDataManaager.getInstance().getOpenTimeOfFuntionCacheByType(FunctionIdEnum.Trial);
|
||||
|
@ -2845,6 +2845,7 @@ public class MapLogic {
|
|||
resetMapInfo(user,false);
|
||||
}
|
||||
}
|
||||
storeManager.removeStoreInfo(8);
|
||||
mapManager.setTrialInfo(trialInfo);
|
||||
}
|
||||
|
||||
|
|
|
@ -817,9 +817,14 @@ public class MapManager extends MongoBase {
|
|||
trialInfo.setMapGameInfo(info);
|
||||
updateString("trialInfo.mapGameInfo",info);
|
||||
}
|
||||
public void updateBombUseCount(int bombUseCount){
|
||||
|
||||
public void updateBombUseCount(int bombUseCount) {
|
||||
trialInfo.setBombUseTimes(bombUseCount);
|
||||
updateString("trialInfo.bombUseTimes",bombUseCount);
|
||||
updateString("trialInfo.bombUseTimes", bombUseCount);
|
||||
}
|
||||
public void updateMapMonsterHp(Map<Integer,List<Integer>> monsterHp){
|
||||
trialInfo.setMonsterHp(monsterHp);
|
||||
updateString("trialInfo.monsterHp",monsterHp);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -35,8 +35,12 @@ public class TrialInfo {
|
|||
|
||||
private MapGameInfo mapGameInfo = new MapGameInfo();
|
||||
|
||||
|
||||
private int bombUseTimes;
|
||||
|
||||
private Map<Integer,List<Integer>> monsterHp = new HashMap<>();
|
||||
|
||||
|
||||
public Set<Integer> getTowerReceivedReward() {
|
||||
return towerReceivedReward;
|
||||
}
|
||||
|
@ -141,11 +145,20 @@ public class TrialInfo {
|
|||
this.mapGameInfo = mapGameInfo;
|
||||
}
|
||||
|
||||
|
||||
public int getBombUseTimes() {
|
||||
return bombUseTimes;
|
||||
}
|
||||
|
||||
public void setBombUseTimes(int bombUseTimes) {
|
||||
this.bombUseTimes = bombUseTimes;
|
||||
|
||||
}
|
||||
public Map<Integer, List<Integer>> getMonsterHp() {
|
||||
return monsterHp;
|
||||
}
|
||||
|
||||
public void setMonsterHp(Map<Integer, List<Integer>> monsterHp) {
|
||||
this.monsterHp = monsterHp;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,6 +62,8 @@ public class FourtyTwoBehavior extends BaseBehavior {
|
|||
mapManager.setTrialFloor(floor + 1);
|
||||
mapManager.setTrialEnergy(0);
|
||||
mapManager.setMapIntoFlag(2);
|
||||
//换层清除数据
|
||||
mapManager.updateMapMonsterHp(new HashMap<>());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -366,7 +366,15 @@ public class TowerMap extends AbstractMap {
|
|||
int groupId = option[0];
|
||||
int destoryXY = mapManager.getTriggerXY();
|
||||
|
||||
//更新血量
|
||||
TrialInfo trialInfo = mapManager.getTrialInfo();
|
||||
Map<Integer, List<Integer>> monsterHp = trialInfo.getMonsterHp();
|
||||
|
||||
PVEFightEvent pveFightEvent = new PVEFightEvent(uid, mapManager.getTeamId(), 10, "", GameFightType.MapFastFight, groupId, 3);
|
||||
//怪物剩余血量
|
||||
if(monsterHp!=null&&!monsterHp.isEmpty()&&monsterHp.containsKey(cell.getCellId())){
|
||||
pveFightEvent.setMonsterRemainHp(monsterHp.get(cell.getCellId()));
|
||||
}
|
||||
FightResult fightResult = FightDispatcher.dispatcher(pveFightEvent);
|
||||
int[] checkResult = fightResult.getCheckResult();
|
||||
|
||||
|
@ -374,11 +382,10 @@ public class TowerMap extends AbstractMap {
|
|||
//校验结果码 1:胜利
|
||||
int resultCode = checkResult[0];
|
||||
if (resultCode == -1) {
|
||||
// throw new ErrorCodeException(ErrorCode.FIGHT_EXCEPTION);
|
||||
throw new ErrorCodeException(ErrorCode.FIGHT_EXCEPTION);
|
||||
}
|
||||
mapManager.setLastFightResult(resultCode);
|
||||
//更新血量
|
||||
TrialInfo trialInfo = mapManager.getTrialInfo();
|
||||
|
||||
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(mapManager.getTeamId());
|
||||
if(teamPosHeroInfos==null||teamPosHeroInfos.size()!=1){
|
||||
// throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
|
@ -391,6 +398,15 @@ public class TowerMap extends AbstractMap {
|
|||
Map<Integer, Integer> property = trailHero.getProperty();
|
||||
Cell createCell = null;
|
||||
if (resultCode == 0) {
|
||||
//记录怪剩余血量
|
||||
List<Integer> hpList= new ArrayList<>();
|
||||
for(int i = 2;i<checkResult.length;i++){
|
||||
hpList.add(checkResult[i]);
|
||||
}
|
||||
if(monsterHp!=null){
|
||||
monsterHp.put(cell.getCellId(),hpList);
|
||||
}
|
||||
mapManager.updateMapMonsterHp(monsterHp);
|
||||
remainHp = 0;
|
||||
}else{
|
||||
//判断是否是打败的boss
|
||||
|
|
|
@ -85,118 +85,7 @@ public class Cmd_changename extends GmRoleAbstract {
|
|||
}
|
||||
}
|
||||
if("recharge".equals(args[2])){
|
||||
Gson gson = new Gson();
|
||||
Map<String,String> rechargeInfoMap = new HashMap<>();
|
||||
|
||||
|
||||
Map<Integer,Integer> realBuyGoodsTimes = new HashMap<>();
|
||||
Map<Integer,Integer> hotGoods = new HashMap<>();
|
||||
rechargeInfoMap= gson.fromJson(args[3],rechargeInfoMap.getClass());
|
||||
String rechargeInfoFileStr = rechargeInfoMap.get(String.valueOf(user.getId()));
|
||||
if(rechargeInfoFileStr == null){
|
||||
return false;
|
||||
}
|
||||
RechargeInfo rechargeInfoFile = gson.fromJson(rechargeInfoFileStr,RechargeInfo.class);
|
||||
realBuyGoodsTimes = rechargeInfoFile.getBuyGoodsTimes();
|
||||
hotGoods=new HashMap<>(realBuyGoodsTimes);
|
||||
Map<Integer,Integer> oldBuyGoodsTimes = user.getPlayerInfoManager().getRechargeInfo().getBuyGoodsTimes();
|
||||
|
||||
for (Map.Entry<Integer,Integer> entry:oldBuyGoodsTimes.entrySet() ) {
|
||||
if(realBuyGoodsTimes.containsKey(entry.getKey())){
|
||||
int finalvalue = realBuyGoodsTimes.get(entry.getKey())-entry.getValue();
|
||||
|
||||
if(finalvalue==0){
|
||||
realBuyGoodsTimes.remove(entry.getKey());
|
||||
}else if(finalvalue>0){
|
||||
realBuyGoodsTimes.put(entry.getKey(),finalvalue);
|
||||
}else {
|
||||
//日志记录不对
|
||||
LOGGER.info("cmd_________recharge:err");
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
int hotRechargeMoney = 0;
|
||||
for (Map.Entry<Integer,Integer> entry:realBuyGoodsTimes.entrySet()) {
|
||||
if(entry.getKey()==1||entry.getKey()==2||entry.getKey()==3||entry.getKey()==4||entry.getKey()==5||entry.getKey()==13||entry.getKey()==14||entry.getKey()==15||entry.getKey()==16){
|
||||
SRechargeCommodityConfig sRechargeCommodityConfig = SRechargeCommodityConfig.rechargeCommodityConfigMap.get(entry.getKey());
|
||||
int price =sRechargeCommodityConfig.getPrice();
|
||||
hotRechargeMoney+=entry.getValue()*price;
|
||||
}
|
||||
}
|
||||
|
||||
//月卡
|
||||
boolean mulvip =false;
|
||||
if(realBuyGoodsTimes.containsKey(9)||realBuyGoodsTimes.containsKey(10)||realBuyGoodsTimes.containsKey(11)){
|
||||
mulvip =true;
|
||||
}
|
||||
|
||||
|
||||
RechargeInfo rechargeInfo = user.getPlayerInfoManager().getRechargeInfo();
|
||||
int saveAmt = rechargeInfo.getSaveAmt();
|
||||
|
||||
|
||||
//成长礼金
|
||||
if(realBuyGoodsTimes.containsKey(7)||realBuyGoodsTimes.containsKey(8)){
|
||||
// if(!user.getActivityManager().getActivityMissionMap().containsKey(6)){
|
||||
ActivityLogic.getInstance().openActivityReallyOpen(user, ActivityType.GrowthFund);
|
||||
//}
|
||||
}
|
||||
// int[][] costItemArr = StringUtil.parseFiledInt2(rewardStr);
|
||||
// for (int i = 0; i <costItemArr.length ; i++) {
|
||||
// if(costItemArr[i][0]==Global.SOULCRYSTAL){
|
||||
// rechargeInfo.addSoulCrystalAmt(costItemArr[i][1]);
|
||||
// }
|
||||
// }
|
||||
//充值金额
|
||||
rechargeInfo.setSaveAmt(hotRechargeMoney+saveAmt);
|
||||
//累计充值
|
||||
// ActivityLogic.getInstance().updateActivityMissionProgress(user, ActivityType.RechargeTotal,rechargeInfo.getSaveAmt());
|
||||
//限时累计充值
|
||||
ActivityLogic.getInstance().updateActivityMissionProgress(user, ActivityType.RECHARGE_NUM,hotRechargeMoney);
|
||||
|
||||
Map<Integer, Integer> goodsDurationMap = user.getPlayerInfoManager().getRechargeInfo().getGoodsDurationMap();
|
||||
Integer nowTime =(int)(System.currentTimeMillis()/1000);
|
||||
for(Integer goodsId : hotGoods.keySet()){
|
||||
if(goodsDurationMap.containsKey(goodsId)){
|
||||
LOGGER.info("the uid={} already send the goods={}",user.getId(),goodsId);
|
||||
continue;
|
||||
}
|
||||
SRechargeCommodityConfig sRechargeCommodityConfig = SRechargeCommodityConfig.rechargeCommodityConfigMap.get(goodsId);
|
||||
int goodsType = sRechargeCommodityConfig.getType();
|
||||
if(goodsType == GiftGoodsType.MONTHCARD || goodsType == GiftGoodsType.LUXURYMONTHCARD || goodsType == GiftGoodsType.WEEKCARD){
|
||||
Integer endTime = null;
|
||||
boolean needSendMail = false;
|
||||
for(Map.Entry<Integer,Integer> goodsDurationItem : goodsDurationMap.entrySet()){
|
||||
if(SRechargeCommodityConfig.rechargeCommodityConfigMap.get(goodsDurationItem.getKey()).getType() == goodsType){
|
||||
endTime = goodsDurationItem.getValue();
|
||||
}
|
||||
}
|
||||
if(endTime == null || nowTime>endTime){
|
||||
endTime = nowTime;
|
||||
needSendMail = true;
|
||||
}
|
||||
|
||||
endTime +=sRechargeCommodityConfig.getContiueDays() * 24 * 3600;
|
||||
rechargeInfo.updateGoodsTypeDuration(sRechargeCommodityConfig.getId(),endTime);
|
||||
if(needSendMail){
|
||||
int[] openPrivilege = sRechargeCommodityConfig.getOpenPrivilege();
|
||||
if(openPrivilege!=null && openPrivilege.length>0){
|
||||
for(int privilege:openPrivilege){
|
||||
user.getPlayerInfoManager().addVipInfo(privilege);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
user.getPlayerInfoManager().getRechargeInfo().setBuyGoodsTimes(hotGoods);
|
||||
|
||||
LOGGER.info("cmd_________recharge:hotRechargeMoney"+hotRechargeMoney+"重复月卡:"+mulvip);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -72,16 +72,20 @@ public class SituationLogic {
|
|||
runnable.run();
|
||||
}
|
||||
private void checkStatus(){
|
||||
if(status==null||overTime==null||openConfig==null){
|
||||
status = new int[4];
|
||||
openConfig = SSpecialConfig.getTwiceArrayValue(SSpecialConfig.XUANYUAN_OPEN_TIME);
|
||||
overTime = new int[4];
|
||||
doCheck();
|
||||
}else{
|
||||
if(TimeUtils.getHourOfDay()!=5){
|
||||
return;
|
||||
try{
|
||||
if(status==null||overTime==null||openConfig==null){
|
||||
status = new int[4];
|
||||
openConfig = SSpecialConfig.getTwiceArrayValue(SSpecialConfig.XUANYUAN_OPEN_TIME);
|
||||
overTime = new int[4];
|
||||
doCheck();
|
||||
}else{
|
||||
if(TimeUtils.getHourOfDay()!=5){
|
||||
return;
|
||||
}
|
||||
doCheck();
|
||||
}
|
||||
doCheck();
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
private void doCheck(){
|
||||
|
@ -89,7 +93,7 @@ public class SituationLogic {
|
|||
int hourOfDay = TimeUtils.getHourOfDay();
|
||||
int week = TimeUtils.getDayOfWeek();
|
||||
if(hourOfDay<5){
|
||||
week = week==0?7:week-1;
|
||||
week = week==1?7:week-1;
|
||||
}
|
||||
boolean isIndication = false;
|
||||
for(int[] config:openConfig){
|
||||
|
@ -285,7 +289,7 @@ public class SituationLogic {
|
|||
User userInMem = UserManager.getUserInMem(pveFightEvent.getAttackUid());
|
||||
CommonProto.FightTeamInfo fightTeamInfo = FightUtil.getFightTeamInfoWithSomeBuff(userInMem, pveFightEvent.getTeamId(),pveFightEvent.getAttackBloodMap(),buffInfo);
|
||||
int fightSeed = FightUtil.getFightSeed();
|
||||
List<CommonProto.FightTeamInfo> monsterfightTeamInfos = FightUtil.makeMonsterFightData(pveFightEvent.getMonsterGroupId(), pveFightEvent.getNums());
|
||||
List<CommonProto.FightTeamInfo> monsterfightTeamInfos = FightUtil.makeMonsterFightData(pveFightEvent.getMonsterGroupId(), pveFightEvent.getNums(),null);
|
||||
LuaValue getFightData = FightDataUtil.getFinalFightData(fightTeamInfo, monsterfightTeamInfos);
|
||||
LuaValue getOptionData = FightDataUtil.getOptionData(pveFightEvent.getAttackUid()+"");
|
||||
int[] fightResult = CheckFight.getInstance().checkFight(fightSeed, fightEvent.getMostTime(), getFightData, getOptionData, fightEvent.getFightType().getFightType());
|
||||
|
|
|
@ -66,5 +66,6 @@ public interface ActivityType {
|
|||
int COPY_PASS = 55; // 开服福利 副本限时通过奖励
|
||||
|
||||
int NEW_EIGHT_LOGIN = 56;//新的八日登录
|
||||
int SIGN_BOX= 57;//累计签到宝箱
|
||||
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ public enum ActivityTypeEnum {
|
|||
COPY_EXPERT(ActivityType.COPY_EXPERT, CopyExpectRankActivity::new),
|
||||
LEVEL_EXPERT(ActivityType.LEVEL_EXPERT, LevelExpectActivity::new),
|
||||
STAMINA_EXPERT(ActivityType.STAMINA_EXPERT, StaminaExpectRankActivity::new),
|
||||
SIGN_IN(ActivityType.SIGN_IN, SignInSumActivity::new),
|
||||
//SIGN_IN(ActivityType.SIGN_IN, SignInSumActivity::new),//因为签到没有走活动,所以SignInSunActivity类用作了累计签到奖励活动,此类暂时先不删
|
||||
RECHARGE_NUM(ActivityType.RECHARGE_NUM, RechargeSumActivity::new),
|
||||
ESPECIALEQUIP_EXPERT(ActivityType.ESPECIALEQUIP_EXPERT, EspecialEquipExpectActivity::new),
|
||||
SOULEQUIP_EXPERT(ActivityType.SOULEQUIP_EXPERT, SoulEquipExpectActivity::new),
|
||||
|
@ -49,7 +49,8 @@ public enum ActivityTypeEnum {
|
|||
ECPEDITION_ACTIVITY(ActivityType.ECPEDITION_ACTIVITY,DefaultEmptyActivity::new),
|
||||
COPY_PASS(ActivityType.COPY_PASS,ChapterRewardActivity::new),
|
||||
NEW_EIGHT_LOGIN(ActivityType.NEW_EIGHT_LOGIN,NewEightActivity::new),
|
||||
BEAUTY_BAG(ActivityType.BEAUTY_BAG,LimitRandomCardActivity::new)
|
||||
BEAUTY_BAG(ActivityType.BEAUTY_BAG,LimitRandomCardActivity::new),
|
||||
SIGN_BOX(ActivityType.SIGN_BOX,SignInSumActivity::new)
|
||||
|
||||
;
|
||||
private int type;
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.ljsd.jieling.logic.activity;
|
|||
import com.ljsd.jieling.jbean.ActivityMission;
|
||||
import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import config.SActivityRewardConfig;
|
||||
|
@ -43,7 +44,10 @@ class DailyRechargeActivity extends AbstractActivity {
|
|||
|
||||
@Override
|
||||
boolean takeRewardsProcess(ISession session, SActivityRewardConfig sActivityRewardConfig, ActivityProgressInfo activityProgressInfo) throws Exception {
|
||||
return checkValue(session, sActivityRewardConfig, activityProgressInfo);
|
||||
int[][] values = sActivityRewardConfig.getValues();
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
int value = user.getActivityManager().getActivityMissionMap().get(sActivityRewardConfig.getActivityId()).getV();
|
||||
return value/1000 >= values[0][0];
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,18 +1,17 @@
|
|||
package com.ljsd.jieling.logic.activity;
|
||||
|
||||
import com.ljsd.jieling.config.clazzStaticCfg.TaskStaticConfig;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.globals.Global;
|
||||
import com.ljsd.jieling.jbean.ActivityMission;
|
||||
import com.ljsd.jieling.logic.dao.Item;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.mail.MailLogic;
|
||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||
import com.ljsd.jieling.logic.mission.main.ServenMissionIdsType;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.ToolsUtil;
|
||||
import config.SErrorCodeEerverConfig;
|
||||
import config.SGlobalActivity;
|
||||
import config.SSevenDaysScore;
|
||||
import config.STreasureTaskConfig;
|
||||
import config.*;
|
||||
import manager.STableManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -57,7 +56,7 @@ public class DefaultEmptyActivity extends AbstractActivity{
|
|||
}*/
|
||||
}
|
||||
}else if(sGlobalActivity.getType() == ActivityType.EXCHANGEANDDROP){
|
||||
/* int shopId = sGlobalActivity.getShopId();
|
||||
int shopId = sGlobalActivity.getShopId()[0];
|
||||
SStoreConfig sStoreConfig = SStoreConfig.getSstoreConfigBuyStore().get(shopId).get(0);
|
||||
int removeItemId = sStoreConfig.getCost()[0][0];
|
||||
Item item = user.getItemManager().getItem(removeItemId);
|
||||
|
@ -65,7 +64,7 @@ public class DefaultEmptyActivity extends AbstractActivity{
|
|||
int[][] cost= new int[1][];
|
||||
cost[0] = new int[]{item.getItemId(),item.getItemNum()};
|
||||
ItemUtil.itemCost(user,cost, BIReason.EXCHANGE_ACTIVITY_CLOSE,sGlobalActivity.getId());
|
||||
}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ public class LuckyCatActivity extends AbstractActivity {
|
|||
throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
||||
}
|
||||
|
||||
if (activityMission.getV() < sLuckyRewardConfig.getRmbValue()) {
|
||||
if (activityMission.getV()/1000 < sLuckyRewardConfig.getRmbValue()) {
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("value illegality"));
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.ljsd.jieling.logic.activity;
|
|||
import com.ljsd.jieling.jbean.ActivityMission;
|
||||
import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import config.SActivityRewardConfig;
|
||||
|
@ -31,7 +32,10 @@ class RechargeSumActivity extends AbstractActivity {
|
|||
|
||||
@Override
|
||||
boolean takeRewardsProcess(ISession session, SActivityRewardConfig sActivityRewardConfig, ActivityProgressInfo activityProgressInfo) throws Exception {
|
||||
return checkValue(session, sActivityRewardConfig, activityProgressInfo);
|
||||
int[][] values = sActivityRewardConfig.getValues();
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
int value = user.getActivityManager().getActivityMissionMap().get(sActivityRewardConfig.getActivityId()).getV();
|
||||
return value/1000 >= values[0][0];
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ class RechargeSumDayActivity extends AbstractActivity {
|
|||
if (activityProgressInfo == null || activityProgressInfo.getProgrss() == 1) {
|
||||
return;
|
||||
}
|
||||
if (count >= SActivityRewardConfig.getsActivityRewardConfigByMissionId(missionId).getValues()[0][0]) {
|
||||
if (count/1000 >= SActivityRewardConfig.getsActivityRewardConfigByMissionId(missionId).getValues()[0][0]) {
|
||||
activityProgressInfo.setProgrss(1);
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ class RechargeTotalActivity extends AbstractActivity {
|
|||
User user = UserManager.getUser(session.getUid());
|
||||
RechargeInfo rechargeInfo = user.getPlayerInfoManager().getRechargeInfo();
|
||||
int days = TimeUtils.differentDaysByHour(rechargeInfo.getCreateTime(), now,5) + 1;
|
||||
if (missionProgress < values[0][0] || days < values[0][1]) {
|
||||
if (missionProgress/1000 < values[0][0] || days < values[0][1]) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -1,15 +1,32 @@
|
|||
package com.ljsd.jieling.logic.activity;
|
||||
|
||||
import com.ljsd.jieling.jbean.ActivityMission;
|
||||
import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
||||
import com.ljsd.jieling.logic.activity.event.IEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.SignInEvent;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import config.SActivityRewardConfig;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* 签到不走活动 没有逻辑处理
|
||||
*/
|
||||
@Deprecated
|
||||
class SignInSumActivity extends AbstractActivity {
|
||||
|
||||
//签到宝箱领完第七天之后,重置进度
|
||||
public static int RESET_DAYS_AFTER_RECEIVED = 7;
|
||||
|
||||
public SignInSumActivity(int id) {
|
||||
super(id);
|
||||
Poster.getPoster().listenEvent(this, SignInEvent.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEvent(IEvent event) throws Exception {
|
||||
if(!(event instanceof SignInEvent)) return;
|
||||
update(UserManager.getUser(((SignInEvent) event).getUid()),1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -17,4 +34,23 @@ class SignInSumActivity extends AbstractActivity {
|
|||
activityMission.setV(count + activityMission.getV());
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean takeRewardsProcess(ISession session, SActivityRewardConfig sActivityRewardConfig, ActivityProgressInfo activityProgressInfo) throws Exception {
|
||||
return checkValue(session, sActivityRewardConfig, activityProgressInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean takeReward(ISession session, int missionId) throws Exception {
|
||||
boolean result = super.takeReward(session, missionId);
|
||||
if (result) {
|
||||
//取得活动奖励配置,判断下如果是7天的宝箱,则重置进度,takeReward成功之后,sActivityRewardConfig一定在
|
||||
SActivityRewardConfig config = SActivityRewardConfig.getsActivityRewardConfigByMissionId(missionId);
|
||||
if (config.getValues()[0][0]== RESET_DAYS_AFTER_RECEIVED) {
|
||||
reSetValue(UserManager.getUser(session.getUid()));
|
||||
}
|
||||
ActivityMission activityMission = UserManager.getUser(session.getUid()).getActivityManager().getActivityMissionMap().get(this.id);
|
||||
sendActivityProgress(session, activityMission, null);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
package com.ljsd.jieling.logic.activity.event;
|
||||
|
||||
|
||||
/**
|
||||
* 每日签到事件
|
||||
* 用作处理累计签到宝箱
|
||||
*/
|
||||
public class SignInEvent implements IEvent{
|
||||
private int uid;
|
||||
|
||||
public SignInEvent(int uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public int getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(int uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
}
|
|
@ -48,6 +48,7 @@ public class HeroFiveStarGetEventHandler implements IEventHandler {
|
|||
long lasttime = rechargeInfo.getTypeBagMap().get(((HeroFiveStarGetEvent) event).getStar());
|
||||
|
||||
int diffHourTemp = (int) ((now - lasttime) / 3600 / 1000);
|
||||
//做一个验证,如果前一次的成长礼没有超出购买时间,才增加次数,否则重置为1次
|
||||
if (diffHourTemp < 2) {
|
||||
rechargeInfo.addDyGoodsCanBuyTimes(goodsId);
|
||||
}else {
|
||||
|
|
|
@ -46,8 +46,8 @@ public class LeveGiftEventHander implements IEventHandler {
|
|||
return;
|
||||
}
|
||||
RechargeInfo rechargeInfo = user.getPlayerInfoManager().getRechargeInfo();
|
||||
int saveAmt = rechargeInfo.getSaveAmt();
|
||||
Map.Entry<Integer, Integer> entry = SRechargeCommodityConfig.rechargePlayerLevelMap.floorEntry(saveAmt);
|
||||
double saveAmt = rechargeInfo.getSaveAmt();
|
||||
Map.Entry<Integer, Integer> entry = SRechargeCommodityConfig.rechargePlayerLevelMap.floorEntry((int)saveAmt);
|
||||
SRechargeCommodityConfig orDefault = STableManager.getConfig(SRechargeCommodityConfig.class).getOrDefault(entry.getValue(), null);
|
||||
if(orDefault==null){
|
||||
return;
|
||||
|
|
|
@ -8,6 +8,7 @@ import com.ljsd.jieling.logic.dao.root.User;
|
|||
import config.SMonthcardConfig;
|
||||
import config.SPrivilegeTypeConfig;
|
||||
import manager.STableManager;
|
||||
import util.MathUtils;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.util.*;
|
||||
|
@ -85,7 +86,7 @@ public class PlayerManager extends MongoBase {
|
|||
|
||||
private int signTotay;//今天是否签到
|
||||
|
||||
private int rechargedaily;
|
||||
private double rechargedaily;
|
||||
|
||||
private long onlineTime;
|
||||
|
||||
|
@ -487,17 +488,17 @@ public class PlayerManager extends MongoBase {
|
|||
return signTotay;
|
||||
}
|
||||
|
||||
public int getRechargedaily() {
|
||||
public double getRechargedaily() {
|
||||
return rechargedaily;
|
||||
}
|
||||
|
||||
public void setRechargedaily(int rechargedaily) {
|
||||
public void setRechargedaily(double rechargedaily) {
|
||||
updateString("rechargedaily", rechargedaily);
|
||||
this.rechargedaily = rechargedaily;
|
||||
}
|
||||
|
||||
public void addRechargedaily(int rechargedaily) {
|
||||
this.rechargedaily += rechargedaily;
|
||||
public void addRechargedaily(double rechargedaily) {
|
||||
this.rechargedaily = MathUtils.doubleAdd(rechargedaily,this.rechargedaily);
|
||||
updateString("rechargedaily", this.rechargedaily);
|
||||
}
|
||||
|
||||
|
|
|
@ -9,10 +9,12 @@ import java.util.*;
|
|||
|
||||
public class RechargeInfo extends MongoBase{
|
||||
|
||||
private int saveAmt;//累计充值
|
||||
private double saveAmt;//累计充值
|
||||
private int soulCrystalAmt;//累计充值购买魂晶
|
||||
private int monthSaveAmt ; //月卡累计总额
|
||||
private int smonthSaveAmt ; //豪华月卡累计总额
|
||||
|
||||
private double monthSaveAmt ; //月卡累计总额
|
||||
private double smonthSaveAmt ; //豪华月卡累计总额
|
||||
|
||||
private int isFirst;
|
||||
private long createTime;
|
||||
private int isDayFirst;
|
||||
|
@ -95,7 +97,7 @@ public class RechargeInfo extends MongoBase{
|
|||
return false;
|
||||
}
|
||||
|
||||
public void setSaveAmt(int saveAmt){
|
||||
public void setSaveAmt(double saveAmt){
|
||||
if(this.saveAmt == 0){
|
||||
createTime = System.currentTimeMillis();
|
||||
updateString("createTime",createTime);
|
||||
|
@ -143,7 +145,7 @@ public class RechargeInfo extends MongoBase{
|
|||
}
|
||||
|
||||
|
||||
public int getSaveAmt() {
|
||||
public double getSaveAmt() {
|
||||
return saveAmt;
|
||||
}
|
||||
|
||||
|
@ -180,14 +182,14 @@ public class RechargeInfo extends MongoBase{
|
|||
this.goodseSendDailyMap.put(goodsType,sendTime);
|
||||
}
|
||||
|
||||
public int getSoulCrystalAmt() {
|
||||
return soulCrystalAmt;
|
||||
}
|
||||
|
||||
public void addSoulCrystalAmt(int soulCrystalAmt) {
|
||||
this.soulCrystalAmt += soulCrystalAmt;
|
||||
updateString("soulCrystalAmt",soulCrystalAmt);
|
||||
}
|
||||
// public int getSoulCrystalAmt() {
|
||||
// return soulCrystalAmt;
|
||||
// }
|
||||
//
|
||||
// public void addSoulCrystalAmt(int soulCrystalAmt) {
|
||||
// this.soulCrystalAmt += soulCrystalAmt;
|
||||
// updateString("soulCrystalAmt",soulCrystalAmt);
|
||||
// }
|
||||
|
||||
public Map<Integer, Long> getTypeBagMap() {
|
||||
return typeBagMap;
|
||||
|
@ -243,20 +245,20 @@ public class RechargeInfo extends MongoBase{
|
|||
updateString("refreshBagMap", refreshBagMap);
|
||||
}
|
||||
|
||||
public int getMonthSaveAmt() {
|
||||
public double getMonthSaveAmt() {
|
||||
return monthSaveAmt;
|
||||
}
|
||||
|
||||
public void setMonthSaveAmt(int monthSaveAmt) {
|
||||
public void setMonthSaveAmt(double monthSaveAmt) {
|
||||
this.monthSaveAmt = monthSaveAmt;
|
||||
updateString("monthSaveAmt",monthSaveAmt);
|
||||
}
|
||||
|
||||
public int getSmonthSaveAmt() {
|
||||
public double getSmonthSaveAmt() {
|
||||
return smonthSaveAmt;
|
||||
}
|
||||
|
||||
public void setSmonthSaveAmt(int smonthSaveAmt) {
|
||||
public void setSmonthSaveAmt(double smonthSaveAmt) {
|
||||
this.smonthSaveAmt = smonthSaveAmt;
|
||||
updateString("smonthSaveAmt",smonthSaveAmt);
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import com.ljsd.jieling.globals.BIReason;
|
|||
import com.ljsd.jieling.globals.Global;
|
||||
import com.ljsd.jieling.handler.map.MapManager;
|
||||
import com.ljsd.jieling.handler.map.behavior.BehaviorUtil;
|
||||
import com.ljsd.jieling.jbean.ActivityMission;
|
||||
import com.ljsd.jieling.ktbeans.KTGameType;
|
||||
import com.ljsd.jieling.ktbeans.KtEventUtils;
|
||||
import com.ljsd.jieling.ktbeans.parmsBean.ParamEventBean;
|
||||
|
@ -279,6 +280,8 @@ public class CombatLogic {
|
|||
ItemUtil.combineReward(user,true,targetMainLevelConfig.getRandomReward(), 1f,randomItemMap,randomCardMap,randomEquipMap,randomRandomMap,BIReason.ADVENTURE_RANDOM_REWARDD);
|
||||
}
|
||||
randomEquipMap = equipAutoCombine(randomEquipMap);
|
||||
//清除无用活动道具
|
||||
removeNoUseItem(user,randomItemMap);
|
||||
ItemUtil.drop(user,baseBuilder,baseItemMap,baseCardMap,baseEquipMap,baseRandomMap,BIReason.ADVENTURE_BASE_REWARD);
|
||||
ItemUtil.drop(user,randomBuilder,randomItemMap,randomCardMap,randomEquipMap,randomRandomMap,BIReason.ADVENTURE_RANDOM_REWARDD);
|
||||
Map<Integer, CommonProto.Drop> result = new HashMap<>(2);
|
||||
|
@ -972,6 +975,7 @@ public class CombatLogic {
|
|||
rewardStr = ItemUtil.getReward(baseItemMap, baseCardMap, baseEquipMap, baseRandomMap);
|
||||
return this;
|
||||
}
|
||||
removeNoUseItem(user,randomItemMap);
|
||||
if(sendMail){
|
||||
if(!baseItemMap.isEmpty()){
|
||||
int vipLevel = user.getPlayerInfoManager().getVipLevel();
|
||||
|
@ -997,6 +1001,34 @@ public class CombatLogic {
|
|||
|
||||
}
|
||||
|
||||
private static void removeNoUseItem(User user,Map<Integer,Integer> itemMap){
|
||||
Map<Integer, SExchangeActivityConfig> config = STableManager.getConfig(SExchangeActivityConfig.class);
|
||||
if(config.size()<1){
|
||||
return;
|
||||
}
|
||||
Set<Integer> removeItem = new HashSet<>();
|
||||
Set<Integer> remainItem = new HashSet<>(3);
|
||||
for(Map.Entry<Integer,SExchangeActivityConfig> entry:config.entrySet()){
|
||||
Map<Integer, ActivityMission> activityMissionMap = user.getActivityManager().getActivityMissionMap();
|
||||
int activityId = entry.getValue().getActivityId();
|
||||
if(!activityMissionMap.containsKey(activityId)){
|
||||
removeItem.add(entry.getValue().getActivityItem());
|
||||
continue;
|
||||
}
|
||||
if(activityMissionMap.get(activityId).getOpenType()!=1){
|
||||
removeItem.add(entry.getValue().getActivityItem());
|
||||
continue;
|
||||
}
|
||||
remainItem.add(entry.getValue().getActivityItem());
|
||||
}
|
||||
for(int item :removeItem){
|
||||
if(remainItem.contains(item)){
|
||||
continue;
|
||||
}
|
||||
itemMap.remove(item);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将挂机和急速探索的装备合成起来
|
||||
* @param equipMap
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.ljsd.jieling.logic.fight;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class FightEvent {
|
||||
|
@ -10,6 +11,7 @@ public class FightEvent {
|
|||
private String frames;
|
||||
private GameFightType fightType;
|
||||
private Map<String, Integer> attackBloodMap;
|
||||
private List<Integer> monsterRemainHp;
|
||||
|
||||
public FightEvent(int attackUid, int teamId,int mostTime,String frams, GameFightType fightType) {
|
||||
this.attackUid = attackUid;
|
||||
|
@ -50,4 +52,12 @@ public class FightEvent {
|
|||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public List<Integer> getMonsterRemainHp() {
|
||||
return monsterRemainHp;
|
||||
}
|
||||
|
||||
public void setMonsterRemainHp(List<Integer> monsterRemainHp) {
|
||||
this.monsterRemainHp = monsterRemainHp;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,6 +58,9 @@ public class FightUtil {
|
|||
|
||||
|
||||
public static Map<Integer, List<CommonProto.FightUnitInfo>> makeMonsterGroup(int bossGroupId,Map<Integer,List<Integer>> hps){
|
||||
if(hps==null||hps.get(0)==null){
|
||||
return makeMonsterGroup(bossGroupId);
|
||||
}
|
||||
return MonsterUtil.getMonsterByGroup(bossGroupId,hps);
|
||||
}
|
||||
|
||||
|
@ -70,8 +73,8 @@ public class FightUtil {
|
|||
}
|
||||
|
||||
//防守方是怪物
|
||||
public static List<CommonProto.FightTeamInfo> makeMonsterFightData(int bossGroupId,int nums){
|
||||
Map<Integer, List<CommonProto.FightUnitInfo>> monsterByGroup = makeMonsterGroup(bossGroupId);
|
||||
public static List<CommonProto.FightTeamInfo> makeMonsterFightData(int bossGroupId,int nums,Map<Integer,List<Integer>> monsterHp){
|
||||
Map<Integer, List<CommonProto.FightUnitInfo>> monsterByGroup = makeMonsterGroup(bossGroupId,monsterHp);
|
||||
List<CommonProto.FightTeamInfo> monsterTeamList = new ArrayList<>(nums);
|
||||
for(int i=0;i<nums;i++){
|
||||
List<CommonProto.FightTeamInfo> monsterGroupList = BehaviorUtil.getFightTeamInfos(bossGroupId, monsterByGroup, i);
|
||||
|
@ -90,7 +93,11 @@ public class FightUtil {
|
|||
User userInMem = UserManager.getUserInMem(pveFightEvent.getAttackUid());
|
||||
CommonProto.FightTeamInfo fightTeamInfo = makePersonFightData(userInMem, pveFightEvent.getTeamId(),pveFightEvent.getAttackBloodMap());
|
||||
int fightSeed =getFightSeed();
|
||||
List<CommonProto.FightTeamInfo> monsterfightTeamInfos = makeMonsterFightData(pveFightEvent.getMonsterGroupId(), pveFightEvent.getNums());
|
||||
//怪物剩余血量
|
||||
List<Integer> monsterRemainHp = pveFightEvent.getMonsterRemainHp();
|
||||
Map<Integer,List<Integer>> remainHp = new HashMap<>();
|
||||
remainHp.put(0,monsterRemainHp);
|
||||
List<CommonProto.FightTeamInfo> monsterfightTeamInfos = makeMonsterFightData(pveFightEvent.getMonsterGroupId(), pveFightEvent.getNums(),remainHp);
|
||||
LuaValue getFightData = FightDataUtil.getFinalFightData(fightTeamInfo, monsterfightTeamInfos);
|
||||
LuaValue getOptionData = FightDataUtil.getOptionData(pveFightEvent.getAttackUid()+"");
|
||||
int[] fightResult = CheckFight.getInstance().checkFight(fightSeed, fightEvent.getMostTime(), getFightData, getOptionData, fightEvent.getFightType().getFightType());
|
||||
|
|
|
@ -1802,10 +1802,11 @@ public class HeroLogic{
|
|||
for(int[] item : otherAttriMap){
|
||||
int propertyId = item[0];
|
||||
int propertyValue = item[1];
|
||||
if(heroAttributeMap.containsKey(propertyId)){
|
||||
propertyValue += heroAttributeMap.get(propertyId);
|
||||
}
|
||||
heroAttributeMap.put(propertyId,propertyValue);
|
||||
// if(heroAttributeMap.containsKey(propertyId)){
|
||||
// propertyValue += heroAttributeMap.get(propertyId);
|
||||
// }
|
||||
// heroAttributeMap.put(propertyId,propertyValue);
|
||||
heroAttributeMap.put(propertyId,heroAttributeMap.getOrDefault(propertyId,0)+propertyValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -938,7 +938,7 @@ public class PlayerLogic {
|
|||
STableManager.getConfig(SMonthcardConfig.class).forEach((integer, sMonthcardConfig) -> {
|
||||
int time = playerInfoManager.getMonthCard().getOrDefault(integer,0);
|
||||
int state = playerInfoManager.getMonthCardDailyTake().contains(integer)?1:0;
|
||||
int saveAmt = integer==1?rechargeInfo.getMonthSaveAmt():rechargeInfo.getSmonthSaveAmt();
|
||||
double saveAmt = integer==1?rechargeInfo.getMonthSaveAmt():rechargeInfo.getSmonthSaveAmt();
|
||||
cardInfos.add(CommonProto.MonthCardInfo.newBuilder().setId(integer).setEndingTime(time).setState(state).setTotleAmt(saveAmt).build());
|
||||
});
|
||||
return cardInfos;
|
||||
|
|
|
@ -39,9 +39,11 @@ import config.*;
|
|||
import manager.STableManager;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import util.MathUtils;
|
||||
import util.StringUtil;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
|
@ -73,12 +75,12 @@ public class BuyGoodsLogic {
|
|||
}
|
||||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.TEST_BUY_GIGT_GOODS_RESPONSE_VALUE,null,true);
|
||||
Result result = sendGoods(uid, goodsId, "gm-test", "111111", System.currentTimeMillis(), -999);
|
||||
User user = UserManager.getUser(uid);
|
||||
int price =sRechargeCommodityConfig.getPrice();
|
||||
int isDiscount = sRechargeCommodityConfig.getIsDiscount();
|
||||
if(isDiscount!=0){
|
||||
price=(int)(sRechargeCommodityConfig.getPrice() * (10 + isDiscount)/10f);
|
||||
}
|
||||
// User user = UserManager.getUser(uid);
|
||||
// int price =sRechargeCommodityConfig.getPrice();
|
||||
// int isDiscount = sRechargeCommodityConfig.getIsDiscount();
|
||||
// if(isDiscount!=0){
|
||||
// price=(int)(sRechargeCommodityConfig.getPrice() * (10 + isDiscount)/10f);
|
||||
// }
|
||||
List<Integer> itemList = new ArrayList<>();
|
||||
for(int[] item:sRechargeCommodityConfig.getBaseReward()){
|
||||
itemList.add(item[0]);
|
||||
|
@ -108,7 +110,9 @@ public class BuyGoodsLogic {
|
|||
if(buyCount ==null){
|
||||
buyCount = 0;
|
||||
}
|
||||
int price =sRechargeCommodityConfig.getPrice();
|
||||
double priceTemp =sRechargeCommodityConfig.getPrice();
|
||||
SExchangeRate sExchangeRate = STableManager.getConfig(SExchangeRate.class).get(priceTemp);
|
||||
double price = sExchangeRate.getPrice_2();
|
||||
buyCount=buyCount+1;
|
||||
|
||||
//time check
|
||||
|
@ -171,11 +175,11 @@ public class BuyGoodsLogic {
|
|||
int monthline = STableManager.getConfig(SMonthcardConfig.class).get(Global.MONTHCARDID).getPrice();
|
||||
int lmonthline = STableManager.getConfig(SMonthcardConfig.class).get(Global.LMONTHCARDID).getPrice();
|
||||
boolean sendneed =false;
|
||||
if(rechargeInfo.getMonthSaveAmt()<monthline&&(price+rechargeInfo.getMonthSaveAmt())>=monthline){
|
||||
if(rechargeInfo.getMonthSaveAmt()<monthline&&(MathUtils.doubleAdd(price,rechargeInfo.getMonthSaveAmt()))>=monthline){
|
||||
sendneed=true;
|
||||
user.getPlayerInfoManager().getMonthCard().put(Global.MONTHCARDID, (int) (System.currentTimeMillis() / 1000));
|
||||
}
|
||||
if(rechargeInfo.getSmonthSaveAmt()<lmonthline&&(price+rechargeInfo.getSmonthSaveAmt())>=lmonthline){
|
||||
if(rechargeInfo.getSmonthSaveAmt()<lmonthline&&(MathUtils.doubleAdd(price,rechargeInfo.getSmonthSaveAmt()))>=lmonthline){
|
||||
sendneed=true;
|
||||
user.getPlayerInfoManager().getMonthCard().put(Global.LMONTHCARDID, (int) (System.currentTimeMillis() / 1000));
|
||||
Poster.getPoster().dispatchEvent(new NewWelfareEvent(user, NewWelfareTypeEnum.RECHARGE_BUY.getType(),Global.LMONTHCARDID));
|
||||
|
@ -247,30 +251,31 @@ public class BuyGoodsLogic {
|
|||
rewardStr = ItemUtil.getMailReward(baseReward);
|
||||
}
|
||||
if(sRechargeCommodityConfig.getAccumulativeRecharge() == 1){
|
||||
int saveAmt = rechargeInfo.getSaveAmt();
|
||||
if(!StringUtil.isEmpty(rewardStr)){
|
||||
int[][] costItemArr = StringUtil.parseFiledInt2(rewardStr);
|
||||
for (int i = 0; i <costItemArr.length ; i++) {
|
||||
if(costItemArr[i][0]==Global.SOULCRYSTAL){
|
||||
rechargeInfo.addSoulCrystalAmt(costItemArr[i][1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
rechargeInfo.setSaveAmt(price+saveAmt);
|
||||
double saveAmt = rechargeInfo.getSaveAmt();
|
||||
// if(!StringUtil.isEmpty(rewardStr)){
|
||||
// int[][] costItemArr = StringUtil.parseFiledInt2(rewardStr);
|
||||
// for (int i = 0; i <costItemArr.length ; i++) {
|
||||
// if(costItemArr[i][0]==Global.SOULCRYSTAL){
|
||||
// rechargeInfo.addSoulCrystalAmt(costItemArr[i][1]);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
rechargeInfo.setSaveAmt(MathUtils.doubleAdd(price,saveAmt));
|
||||
user.getPlayerInfoManager().addRechargedaily(price);
|
||||
user.getPlayerInfoManager().getMonthCard();
|
||||
rechargeInfo.setMonthSaveAmt(price+rechargeInfo.getMonthSaveAmt());
|
||||
rechargeInfo.setSmonthSaveAmt(price+rechargeInfo.getSmonthSaveAmt());
|
||||
rechargeInfo.setMonthSaveAmt(MathUtils.doubleAdd(price,rechargeInfo.getMonthSaveAmt()));
|
||||
rechargeInfo.setSmonthSaveAmt(MathUtils.doubleAdd(price,rechargeInfo.getSmonthSaveAmt()));
|
||||
|
||||
//TODO 用事件分发
|
||||
ActivityLogic.getInstance().updateActivityMissionProgress(user, ActivityType.RechargeTotal,price);
|
||||
ActivityLogic.getInstance().updateActivityMissionProgress(user, ActivityType.LUCKYCAT,price);
|
||||
ActivityLogic.getInstance().updateActivityMissionProgress(user, ActivityType.DAILY_RECHARGE,price);
|
||||
ActivityLogic.getInstance().updateActivityMissionProgress(user, ActivityType.RECHARGE_NUM,price);
|
||||
ActivityLogic.getInstance().updateActivityMissionProgress(user, ActivityType.RECHARGE_SUM_DAY, user.getPlayerInfoManager().getRechargedaily());
|
||||
ActivityLogic.getInstance().updateActivityMissionProgress(user, ActivityType.FIND_FAIRY_FESTIVAL, price);
|
||||
ActivityLogic.getInstance().updateActivityMissionProgress(user, ActivityType.RechargeTotal,(int)(price*1000));
|
||||
ActivityLogic.getInstance().updateActivityMissionProgress(user, ActivityType.LUCKYCAT,(int)(price*1000));
|
||||
ActivityLogic.getInstance().updateActivityMissionProgress(user, ActivityType.DAILY_RECHARGE,(int)(price*1000));
|
||||
ActivityLogic.getInstance().updateActivityMissionProgress(user, ActivityType.RECHARGE_NUM,(int)(price*1000));
|
||||
ActivityLogic.getInstance().updateActivityMissionProgress(user, ActivityType.RECHARGE_SUM_DAY, (int)(user.getPlayerInfoManager().getRechargedaily()*1000) );
|
||||
ActivityLogic.getInstance().updateActivityMissionProgress(user, ActivityType.FIND_FAIRY_FESTIVAL, (int)(price*1000));
|
||||
|
||||
AyyncWorker ayyncWorker = new AyyncWorker(user, true, new AynMissionWorker(GameEvent.RECHARGE_TOTAL,price)) ;
|
||||
AyyncWorker ayyncWorker = new AyyncWorker(user, true, new AynMissionWorker(GameEvent.RECHARGE_TOTAL,(int)(price*1000))) ;
|
||||
ProtocolsManager.getInstance().updateAyncWorker(ayyncWorker);
|
||||
|
||||
|
||||
|
@ -364,7 +369,7 @@ public class BuyGoodsLogic {
|
|||
return resultRes;
|
||||
|
||||
}
|
||||
private static void onChargeSuccess(int uid,int amount,int virtualAmount,String orderId){
|
||||
private static void onChargeSuccess(int uid,double amount,int virtualAmount,String orderId){
|
||||
RechargeEvent rechargeEvent = new RechargeEvent();
|
||||
rechargeEvent.setModule("GameAnalysis");
|
||||
rechargeEvent.setIp("");
|
||||
|
|
|
@ -8,7 +8,7 @@ package com.ljsd.jieling.logic.store;
|
|||
public class RechargeEventProp {
|
||||
private String order_id;
|
||||
|
||||
private int amount;
|
||||
private double amount;
|
||||
|
||||
private int virtual_currency_amount;
|
||||
|
||||
|
@ -26,7 +26,7 @@ public class RechargeEventProp {
|
|||
this.order_id = order_id;
|
||||
}
|
||||
|
||||
public int getAmount() {
|
||||
public double getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
|
@ -66,7 +66,7 @@ public class RechargeEventProp {
|
|||
this.payment = payment;
|
||||
}
|
||||
|
||||
public RechargeEventProp(String order_id, int amount, int virtual_currency_amount, String currency_type, String product, String payment) {
|
||||
public RechargeEventProp(String order_id, double amount, int virtual_currency_amount, String currency_type, String product, String payment) {
|
||||
this.order_id = order_id;
|
||||
this.amount = amount;
|
||||
this.virtual_currency_amount = virtual_currency_amount;
|
||||
|
|
|
@ -43,7 +43,7 @@ public class CBean2Proto {
|
|||
.setServerTime((int) (System.currentTimeMillis() / 1000))
|
||||
.setMaxForce(playerManager.getMaxForce())
|
||||
.setRechargeTime((int) (rechargeInfo.getCreateTime() / 1000))
|
||||
.setSaveAmt(rechargeInfo.getSaveAmt())
|
||||
.setSaveAmt((rechargeInfo.getSaveAmt()))
|
||||
.setIsFirstRecharge(rechargeInfo.getIsFirst())
|
||||
.setHeadFrame(playerManager.getHeadFrame())
|
||||
.setDesignation(playerManager.getDesignation())
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
package config;
|
||||
|
||||
import manager.STableManager;
|
||||
import manager.Table;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name ="ExchangeActivityConfig")
|
||||
public class SExchangeActivityConfig implements BaseConfig {
|
||||
|
||||
private int id;
|
||||
|
||||
private int activityId;
|
||||
|
||||
private int activityItem;
|
||||
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getActivityId() {
|
||||
return activityId;
|
||||
}
|
||||
|
||||
public int getActivityItem() {
|
||||
return activityItem;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
package config;
|
||||
|
||||
import manager.STableManager;
|
||||
import manager.Table;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name ="ExchangeRate")
|
||||
public class SExchangeRate implements BaseConfig {
|
||||
|
||||
private int id;
|
||||
|
||||
private int price_1;
|
||||
|
||||
private float price_2;
|
||||
|
||||
private float price_3;
|
||||
|
||||
private float price_4;
|
||||
|
||||
private float price_5;
|
||||
|
||||
private float price_6;
|
||||
|
||||
private float price_7;
|
||||
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getPrice_1() {
|
||||
return price_1;
|
||||
}
|
||||
|
||||
public float getPrice_2() {
|
||||
return price_2;
|
||||
}
|
||||
|
||||
public float getPrice_3() {
|
||||
return price_3;
|
||||
}
|
||||
|
||||
public float getPrice_4() {
|
||||
return price_4;
|
||||
}
|
||||
|
||||
public float getPrice_5() {
|
||||
return price_5;
|
||||
}
|
||||
|
||||
public float getPrice_6() {
|
||||
return price_6;
|
||||
}
|
||||
|
||||
public float getPrice_7() {
|
||||
return price_7;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -15,7 +15,7 @@ public class SRechargeCommodityConfig implements BaseConfig {
|
|||
|
||||
private int type;
|
||||
|
||||
private int price;
|
||||
private double price;
|
||||
|
||||
private int[][] firstMultiple;
|
||||
|
||||
|
@ -128,7 +128,7 @@ public class SRechargeCommodityConfig implements BaseConfig {
|
|||
return type;
|
||||
}
|
||||
|
||||
public int getPrice() {
|
||||
public double getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue