back_recharge
duhui 2023-02-09 20:50:26 +08:00
parent 187b429661
commit 067af5d9f4
8 changed files with 31 additions and 78 deletions

View File

@ -49,11 +49,15 @@ public class Cmd_general extends GmAbstract {
try {
int uid = Integer.parseInt(args[1]);
User user = UserManager.getUser(uid);
int itemId = Integer.parseInt(args[2]);
long itemNum = Long.parseLong(args[3]);
String[] items = args[2].split("\\|");
HashMap<Integer, Long> map = new HashMap<>();
map.put(itemId,itemNum);
ItemUtil.itemCostLong(user,map, BIReason.GM_ROOT_REMOVE_ITEM,-999);
for (String item : items) {
String[] split = item.split("#");
map.put(Integer.parseInt(split[0]),Long.parseLong(split[1]));
}
ItemUtil.useItemLong(user,map, BIReason.GM_ROOT_REMOVE_ITEM,-999);
LOGGER.info("通过gm后台删除玩家道具uid{}item{}",uid, map);
} catch (Exception e) {
e.printStackTrace();
}

View File

@ -192,18 +192,19 @@ public class GmActivityLogic implements IEventHandler {
int num = gmActivity.getValue() + (int) price;
// do-while循环重置奖励后再次验证
boolean verify;
LOGGER.info("单日累充第一步userid{}, 活动id{} 金额:{}", user.getId(),gmActivity.getId(),num);
do {
verify = false;
for (ARBMission arbMission : gmMissionList) {
GmMission gmMission = gmActivity.getMissionMap().getOrDefault(arbMission.getId(), new GmMission());
// 已领取
if (gmMission.getState() == 1){
LOGGER.error("单日累充档位已领取userid{}, 活动id{} 档位id{}", user.getId(),gmActivity.getId(),gmMission.getId());
LOGGER.info("单日累充档位已领取userid{}, 活动id{} 档位id{}", user.getId(),gmActivity.getId(),gmMission.getId());
continue;
}
// 不能领
if (num < arbMission.getRechargeNum()){
LOGGER.error("单日累充金额不足userid{}, 活动id{} 金额:{}-{}", user.getId(),gmActivity.getId(),num,arbMission.getRechargeNum());
LOGGER.info("单日累充金额不足userid{}, 活动id{} 金额:{}-{}", user.getId(),gmActivity.getId(),num,arbMission.getRechargeNum());
continue;
}
// 发邮件
@ -219,12 +220,14 @@ public class GmActivityLogic implements IEventHandler {
// 领取完全部奖励后重置活动
long count = gmActivity.getMissionMap().values().stream().filter(v -> v.getState() == 1).count();
LOGGER.info("单日累充第二步userid{}, 活动id{} 完成度对比:{}-{}", user.getId(),gmActivity.getId(),gmMissionList.size(),count);
if (gmMissionList.size() == count){
// 重置活动对象
gmActivity.setMissionMap(new HashMap<>());
// 减去满级金额
num-=gmMissionList.get(gmMissionList.size()-1).getRechargeNum();
verify = true;
LOGGER.info("单日累充自动重置userid{}, 活动id{} 剩余金额:{}", user.getId(),gmActivity.getId(),num);
}
}
while (verify);
@ -242,12 +245,12 @@ public class GmActivityLogic implements IEventHandler {
GmMission gmMission = gmActivity.getMissionMap().getOrDefault(arbMission.getId(), new GmMission());
// 已领取
if (gmMission.getState() == 1){
LOGGER.error("单笔充值奖励档位已领取userid{}, 活动id{} 档位id{}", user.getId(),gmActivity.getId(),gmMission.getId());
LOGGER.info("单笔充值奖励档位已领取userid{}, 活动id{} 档位id{}", user.getId(),gmActivity.getId(),gmMission.getId());
continue;
}
// 不能领
if (price != arbMission.getRechargeNum()){
LOGGER.error("单笔充值奖励金额对比失败userid{}, 活动id{} 金额:{}-{}", user.getId(),gmActivity.getId(),price,arbMission.getRechargeNum());
LOGGER.info("单笔充值奖励金额对比失败userid{}, 活动id{} 金额:{}-{}", user.getId(),gmActivity.getId(),price,arbMission.getRechargeNum());
continue;
}
// 发邮件
@ -270,7 +273,7 @@ public class GmActivityLogic implements IEventHandler {
private void getRewardToMonsterCurrencyBack(User user, GmActivity gmActivity, double price) throws Exception {
Map<String, ARBMission> missionMap = findAllGmMissionMap(gmActivity.getId());
if (missionMap == null || missionMap.isEmpty()) {
LOGGER.error("妖晶返利活动详细档位信息未配置userid{}, 活动id{}", user.getId(), gmActivity.getId());
LOGGER.info("妖晶返利活动详细档位信息未配置userid{}, 活动id{}", user.getId(), gmActivity.getId());
return;
}
// 档位排序
@ -284,7 +287,7 @@ public class GmActivityLogic implements IEventHandler {
// 最低要求
int limit = arbMissions.get(0).getBeforeNum();
if (sumMoney < limit || sumMoney <= 0) {
LOGGER.error("妖晶返利活动充值金额不足最低领取调解userid{},活动id{},当前累充金额:{},最低条件:{}", user.getId(), gmActivity.getId(), sumMoney, limit);
LOGGER.info("妖晶返利活动充值金额不足最低领取调解userid{},活动id{},当前累充金额:{},最低条件:{}", user.getId(), gmActivity.getId(), sumMoney, limit);
return;
}
// 首次计算标记

View File

@ -63,14 +63,16 @@ public class EquipManager extends MongoBase {
return equipMap;
}
// public Equip getUnDetermined() {
// return unDetermined;
// }
//
// public void setUnDetermined(Equip unDetermined) {
// updateString("unDetermined", unDetermined);
// this.unDetermined = unDetermined;
// }
public Map<String, Jewel> getJewelMap() {
HashMap<String, Jewel> map = new HashMap<>();
for (Map.Entry<String, PropertyItem> entry : equipMap.entrySet()) {
if (entry.getValue() instanceof Jewel){
map.put(entry.getKey(), (Jewel) entry.getValue());
}
}
return map;
}
public void addEquipHandBook(int equipId){
if(equipHandBook.containsKey(equipId)){
return;

View File

@ -6,7 +6,6 @@ import com.ljsd.jieling.core.GlobalsDef;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.logic.hero.HeroLogic;
import com.ljsd.jieling.logic.hero.HongMengAttributeEnum;
import com.ljsd.jieling.logic.mission.GameEvent;
import com.ljsd.jieling.util.KeyGenUtils;
import com.ljsd.jieling.util.UUIDEnum;
import config.*;
@ -56,6 +55,8 @@ public class Hero extends MongoBase implements Comparable<Hero>,Cloneable {
private int changeId;
private Set<String> jewelInfo = new HashSet<>();
private Set<String> faXiangInfo = new HashSet<>(2);
private int skin;
///神魂绑定英雄 神魂等级:<hero动态id>

View File

@ -758,8 +758,7 @@ public class FightUtil {
* @param attackBloodMap
* @return
*/
public static CommonProto.FightTeamInfo getYuxuTeam(User user, int teamId, Map<String, Integer> attackBloodMap
,ArenaRecord arenaRecord) {
public static CommonProto.FightTeamInfo getYuxuTeam(User user, int teamId, Map<String, Integer> attackBloodMap,ArenaRecord arenaRecord) {
List<CommonProto.FightUnitInfo> heroFightInfos = new ArrayList<>();
if(arenaRecord != null){
int addforce = HeroLogic.getInstance().calTeamTotalForce(user, teamId, false);
@ -852,7 +851,6 @@ public class FightUtil {
heroAttributeMap.put(HeroAttributeEnum.CurHP.getPropertyId(), heroAttributeMap.get(HeroAttributeEnum.Hp.getPropertyId()) - attackBloodMap.get(teamPosHeroInfo.getHeroId()) * heroAttributeMap.get(HeroAttributeEnum.Hp.getPropertyId()) / 100);
}
heroAttributeMap.put(HeroAttributeEnum.CurHP.getPropertyId(), heroAttributeMap.get(GlobalsDef.HP_TYPE));
StringBuilder skillSb = new StringBuilder();
StringBuilder propertySb = new StringBuilder();
String heroSkill = HeroLogic.getInstance().getCrossYuxuHeroSkills(crossArenaManager,hero,yuxuHero).toString();
String property = HeroLogic.getInstance().getHeroPropertyBuilder(propertySb, hero.getPropertyId(), yuxuHero.getYuXuLevel(), heroAttributeMap).toString();

View File

@ -4026,36 +4026,6 @@ public class HeroLogic {
return 0;
}
private void combinePokemonAttribute(Map<Integer, Integer> pokemonAttributeMap, Pokemon pokemon, boolean needExtra) {
//todo 灵兽
// Map<Integer, Integer> comonpentsLevelMap = pokemon.getComonpentsLevelMap();
// for (Map.Entry<Integer, Integer> comonpentsLevelItem : comonpentsLevelMap.entrySet()) {
// Integer comonpentId = comonpentsLevelItem.getKey();
// Integer comonpentLevel = comonpentsLevelItem.getValue();
// Map<Integer, SDifferDemonsComonpentsConfig> sDifferDemonsComonpentsConfigMap = SDifferDemonsComonpentsConfig.getsDifferDemonsComonpentsConfigMap(comonpentId);
// SDifferDemonsComonpentsConfig sDifferDemonsComonpentsConfig = sDifferDemonsComonpentsConfigMap.get(comonpentLevel);
// Map<Integer, Map<Integer, Integer>> extraAddMap = sDifferDemonsComonpentsConfig.getExtraAddMap();
// combinedAttribute(sDifferDemonsComonpentsConfig.getBaseAttribute(), pokemonAttributeMap);
//
// if (needExtra && extraAddMap != null) {
// for (Map<Integer, Integer> item : extraAddMap.values()) {
// combinedAttribute(item, pokemonAttributeMap);
// }
// }
// }
}
// public int calEquipForce(Equip equip) {
// Map<Integer, Long> equipAttributeMap = new HashMap<>();
// SEquipConfig sEquipConfig = STableManager.getConfig(SEquipConfig.class).get(equip.getEquipId());
// Map<Integer, Long> propertyValueByIdMap = equip.getPropertyValueByIdMap();
// Map<Integer, Long> secondValueByIdMap = equip.getSecondValueByIdMap();
// combinedAttribute(propertyValueByIdMap, equipAttributeMap);
// combinedAttribute(secondValueByIdMap, equipAttributeMap);
// return calForce(equipAttributeMap) + sEquipConfig.getScore();
// }
//获取天赋异妖信息
public void getAllRingFire(ISession session) throws Exception {
//todo 灵兽

View File

@ -14,7 +14,6 @@ import com.ljsd.jieling.jbean.ActivityMission;
import com.ljsd.jieling.jbean.ActivityProgressInfo;
import com.ljsd.jieling.ktbeans.ReportEventEnum;
import com.ljsd.jieling.ktbeans.ReportUtil;
import com.ljsd.jieling.logic.OnlineUserManager;
import com.ljsd.jieling.logic.activity.AbstractActivity;
import com.ljsd.jieling.logic.activity.ActivityTypeEnum;
import com.ljsd.jieling.logic.activity.event.EspecialEquipUpEvent;
@ -740,29 +739,6 @@ public class ItemLogic {
MessageUtil.sendMessage(iSession, 1, msgId, builder.build(), true);
}
// public void equipLock(ISession session, int type, List<String> equips, MessageTypeProto.MessageType messageType) throws Exception {
// EquipManager equipManager = UserManager.getUser(session.getUid()).getEquipManager();
// //锁定
// if (type == 1) {
// for (String equipId : equips) {
// if (equipManager.getEquipMap().get(equipId).getIsLocked() != 0) {
// throw new ErrorCodeException(ErrorCode.newDefineCode("所选装备有的已上锁"));
// }
// equipManager.getEquipMap().get(equipId).updateIsLocked(1);
// }
// }
// //解锁
// if (type == 2) {
// for (String equipId : equips) {
// if (equipManager.getEquipMap().get(equipId).getIsLocked() != 1) {
// throw new ErrorCodeException(ErrorCode.newDefineCode("所选装备有的未上锁"));
// }
// equipManager.getEquipMap().get(equipId).updateIsLocked(0);
// }
// }
// MessageUtil.sendMessage(session, 1, messageType.getNumber(), null, true);
// }
/**
*
*
@ -991,7 +967,6 @@ public class ItemLogic {
HeroLogic.getInstance().addOrUpdateHongmeng(iSession);
MessageUtil.sendMessage(iSession,1, MessageTypeProto.MessageType.JEWEL_BUILD_RESPONSE_VALUE,null,true);
}
/**

View File

@ -1072,7 +1072,7 @@ public class ItemUtil {
useItemLong(user,longMap,reason,subReason);
}
private static void useItemLong(User user,Map<Integer,Long> useItemMap,int reason,int subReason) throws Exception{
public static void useItemLong(User user,Map<Integer,Long> useItemMap,int reason,int subReason) throws Exception{
if(useItemMap.isEmpty()){
return;
}