back_recharge
lvxinran 2020-07-16 16:31:58 +08:00
commit 73fbcf991f
16 changed files with 87 additions and 33 deletions

View File

@ -25,6 +25,7 @@ public class CoreService implements RPCRequestIFace.Iface {
@Override
public Result deliveryRecharge(int uid, int goodsId, String openId, String orderId, long orderTime, int amount) throws InvalidOperException, TException {
try {
LOGGER.info("deliveryRecharge start",uid );
return BuyGoodsLogic.sendGoods(uid, goodsId, openId, orderId, orderTime, amount);
} catch (Exception e) {
User user = UserManager.getUserInMem(uid);

View File

@ -77,7 +77,6 @@ public class ReCoverExpeditionHeroRequestHandler extends BaseHandler<Expedition.
});
Expedition.ReCoverExpeditionHeroResponse.Builder build = Expedition.ReCoverExpeditionHeroResponse.newBuilder().addAllHeroInfo(set);
user.getUserMissionManager().onGameEvent(user, GameEvent.EXPEDITION_TIMES);
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.EXPEDITION_RECOVER_HERO_RESONSE_VALUE, build.build(), true);
}
}

View File

@ -122,7 +122,6 @@ public class ReliveExpeditionHeroRequest extends BaseHandler<Expedition.ReliveEx
Expedition.ReliveExpeditionHeroResponse build = Expedition.ReliveExpeditionHeroResponse.newBuilder()
.setHeroInfo(CommonProto.ExpeditionSimpleHeroInfo.newBuilder().setHeroId(heroId).setRemainHp(1d).build()).build();
user.getUserMissionManager().onGameEvent(user, GameEvent.EXPEDITION_TIMES);
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.EXPEDITION_RELIVE_HERO_RESONSE_VALUE, build, true);
}

View File

@ -98,7 +98,6 @@ public class TakeHolyEquipRequest extends BaseHandler<Expedition.TakeHolyEquipRe
MessageUtil.sendIndicationMessage(iSession, 1, MessageTypeProto.MessageType.EXPEDITION_NOINFO_INDICATION_VALUE, builder.build(), true);
Expedition.TakeHolyEquipResponse.Builder build = Expedition.TakeHolyEquipResponse.newBuilder().setEquipId(expeditionItem.getId());
user.getUserMissionManager().onGameEvent(user, GameEvent.EXPEDITION_TIMES);
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.EXPEDITION_TAKE_HOLY_EQUIP_RESONSE_VALUE, build.build(), true);
}

View File

@ -54,6 +54,7 @@ public class GetArenaInfoHandler extends BaseHandler {
.setFailNums(arenaManager.getFailNums())
.setSuccessNums(arenaManager.getSuccessNums())
.setScore(score)
.addAllHadTakeBox(arenaManager.getHadTakeReward())
.addAllArenaEnemys(ArenaLogic.getInstance().getArenaEnemyList(arenaManager.getArenaEnemies()))
.build();

View File

@ -11,6 +11,7 @@ import com.ljsd.jieling.logic.dao.Item;
import com.ljsd.jieling.logic.dao.root.GuildInfo;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.protocols.PlayerInfoProto;
import com.ljsd.jieling.util.SysUtil;
import java.util.HashMap;
import java.util.Map;
@ -26,9 +27,9 @@ public class ReportUtil {
private static Map<Integer,ReportBaseBean> baseBeanMap = new HashMap<>();
private static ThinkingDataAnalytics ta = new ThinkingDataAnalytics(new ThinkingDataAnalytics.LoggerConsumer(LOG_PATH));
private static ThinkingDataAnalytics ta = new ThinkingDataAnalytics(new ThinkingDataAnalytics.LoggerConsumer(SysUtil.getPath(LOG_PATH)));
private static ThinkingDataAnalytics serverTa = new ThinkingDataAnalytics(new ThinkingDataAnalytics.LoggerConsumer(LOG_PATH));
private static ThinkingDataAnalytics serverTa = new ThinkingDataAnalytics(new ThinkingDataAnalytics.LoggerConsumer(SysUtil.getPath(LOG_PATH)));
public static BlockingQueue<ReportUserEvent> queue = new BlockingUniqueQueue<>();

View File

@ -120,6 +120,9 @@ public class CumulationData {
public int rechargeTotal; //累計充值
public int refreshMrTimes; //刷新迷宫寻宝次数
public int especialEquipMaxLeve; //法宝最高等级达到5
public Map<Integer,Integer> luckyWheelTimes = new HashMap<>(); //幸运探宝次数
public int expeditinoTimes; // 猎妖之路次数

View File

@ -20,6 +20,7 @@ import com.ljsd.jieling.logic.fight.specialparm.SpecialForTeamBuildEnum;
import com.ljsd.jieling.logic.hero.HeroAttributeEnum;
import com.ljsd.jieling.logic.hero.HeroLogic;
import com.ljsd.jieling.logic.mail.MailLogic;
import com.ljsd.jieling.logic.mission.GameEvent;
import com.ljsd.jieling.logic.store.StoreLogic;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.protocols.CommonProto;
@ -162,7 +163,7 @@ public class ExpeditionLogic {
/**
*
*/
public static Set<CommonProto.ExpeditionNodeInfo> openLay(User user, int curryLay, int passNode) {
public static Set<CommonProto.ExpeditionNodeInfo> openLay(User user, int curryLay, int passNode)throws Exception {
final int oldlay = curryLay;
final int newlay = oldlay + 1;
@ -204,6 +205,7 @@ public class ExpeditionLogic {
});
//updata lay
user.getExpeditionManager().setLay(newlay);
user.getUserMissionManager().onGameEvent(user, GameEvent.EXPEDITION_TIMES);
return nodeInfos;
}

View File

@ -763,7 +763,7 @@ public class MissionLoigc {
break;
//todo
case SPECIAL_EQUIP_LEVEL_UP:
// count = cumulationData.friendApplyCount;
count = cumulationData.especialEquipMaxLeve;
break;
case LUCKY_WHEELS_TIMES:
if(missionSubType[0] == 0){

View File

@ -114,6 +114,7 @@ public class DataManagerDistributor {
judges.put(MissionType.REARGE_TOTAL,new RechargeTotalManger());
judges.put(MissionType.FINISH_MISSING_ROOM,new FinishMissionRoomManager());
judges.put(MissionType.REFRESH_MISSING_ROOM,new RefreshMissionRoomMamager());
judges.put(MissionType.SPECIAL_EQUIP_LEVEL_UP,new EspecialEquipLeveMamager());
judges.put(MissionType.LUCKY_WHEELS_TIMES,new LuckyWheelTimesManager());
judges.put(MissionType.FINISH_EXPEDITION_HERO_TIMES,new ExpeditionManager());
judges.put(MissionType.LOGIN_TIMES,new LoginTimeManager());

View File

@ -0,0 +1,14 @@
package com.ljsd.jieling.logic.mission.data;
import com.ljsd.jieling.logic.dao.CumulationData;
import com.ljsd.jieling.logic.mission.MissionType;
public class EspecialEquipLeveMamager implements BaseDataManager{
@Override
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
if((int)parm[0]>data.especialEquipMaxLeve){
data.especialEquipMaxLeve=(int)parm[0];
}
return new CumulationData.Result(missionType);
}
}

View File

@ -15,6 +15,10 @@ public class EspecialStarManager implements BaseDataManager {
}else{
especialEquipStar.put(equipStar,1);
}
if(equipStar>data.especialEquipMaxLeve){
data.especialEquipMaxLeve=equipStar;
}
return new CumulationData.Result(missionType);
}

View File

@ -279,6 +279,7 @@ public class MissionEventDistributor {
typeList = new ArrayList<>();
typeList.add(MissionType.ESPECIAL_EQUIP);
typeList.add(MissionType.JEWL_ALL_LEVE);
typeList.add(MissionType.SPECIAL_EQUIP_LEVEL_UP);
eventEnumListMap.put(GameEvent.ESPECIAL_EQUIP,typeList);
eventProcessor.put(GameEvent.ESPECIAL_EQUIP,new CumulationDataEventProcessor());

View File

@ -89,6 +89,17 @@ public class BuyGoodsLogic {
LOGGER.info("send to uid={},the goods={},openID={},orderId={},orderTime={},amount={}",uid,goodsId,openId,orderId,orderTime,amount);
User user = UserManager.getUser(uid);
SRechargeCommodityConfig sRechargeCommodityConfig = SRechargeCommodityConfig.rechargeCommodityConfigMap.get(goodsId);
//check money
int realMoney =sRechargeCommodityConfig.getPrice();
if(amount!=-999&&amount!=realMoney){
LOGGER.error("the uid={},the goodId={}, amount={},real={}", uid, goodsId, amount,realMoney);
resultRes.setResultCode(0);
resultRes.setResultMsg("前后端金额不对"+amount+"realMoney = " + realMoney);
return resultRes;
}
RechargeInfo rechargeInfo = user.getPlayerInfoManager().getRechargeInfo();
Map<Integer, Integer> buyGoodsTimes = rechargeInfo.getBuyGoodsTimes();
Integer buyCount = buyGoodsTimes.get(goodsId);
@ -153,29 +164,40 @@ public class BuyGoodsLogic {
if(sRechargeCommodityConfig.getAccumulativeRecharge() == 1){
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){
sendneed=true;
user.getPlayerInfoManager().getMonthCard().put(Global.MONTHCARDID, (int) (System.currentTimeMillis() / 1000));
}
if(rechargeInfo.getSmonthSaveAmt()<lmonthline&&(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));
}
if(sendneed){
ISession session = OnlineUserManager.sessionMap.get(uid);
if(session!=null){
PlayerInfoProto.MonthCardIndication monthCardIndication = PlayerInfoProto.MonthCardIndication.newBuilder().addAllMonthinfos(PlayerLogic.getInstance().getMonthCardInfo(user)).build();
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.MONTHCARD_INDICATION_VALUE, monthCardIndication, true);
try {
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){
sendneed=true;
user.getPlayerInfoManager().getMonthCard().put(Global.MONTHCARDID, (int) (System.currentTimeMillis() / 1000));
}
if(rechargeInfo.getSmonthSaveAmt()<lmonthline&&(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));
}
if(sendneed){
ISession session = OnlineUserManager.sessionMap.get(uid);
if(session!=null){
PlayerInfoProto.MonthCardIndication monthCardIndication = PlayerInfoProto.MonthCardIndication.newBuilder().addAllMonthinfos(PlayerLogic.getInstance().getMonthCardInfo(user)).build();
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.MONTHCARD_INDICATION_VALUE, monthCardIndication, true);
}
}
}catch (Exception e){
LOGGER.error("充值异常跳过"+e.toString());
}
}
triggerEvent(user,sRechargeCommodityConfig,nowTime);
try {
triggerEvent(user,sRechargeCommodityConfig,nowTime);
}catch (Exception e){
LOGGER.error("充值异常跳过"+e.toString());
}
int[][] baseReward = sRechargeCommodityConfig.getBaseReward();
int length = baseReward.length;
String rewardStr="";

View File

@ -38,8 +38,8 @@ public class MessageUtil {
backMessage = new byte[0];
} else {
backMessage = generatedMessage.toByteArray();
//if (backMessage.length != 0)
//LOGGER.info("\r\n" + "uid:" + uid + ":\r\n" + JsonFormat.printToString(generatedMessage));
if (backMessage.length != 0)
LOGGER.info("\r\n" + "uid:" + uid + ":\r\n" + JsonFormat.printToString(generatedMessage));
}
int length = PackageConstant.UID_FIELD_LEN + PackageConstant.TOKEN_LEN

View File

@ -20,23 +20,30 @@ public class SysUtil {
}
public static String getPath(String prefixDir, String... filePath) throws IOException {
public static String getPath(String prefixDir, String... filePath) {
StringBuilder path = new StringBuilder();
path.append(getRootPath()).append(prefixDir);
for (String p : filePath) {
path.append(File.separator).append(p);
}
return path.toString();
}
public static String getRootPath() throws IOException {
public static String getRootPath() {
StringBuilder path = new StringBuilder();
if (SysUtil.isWindows()) {// Window 系统
path.append(new File(".").getCanonicalPath()).append(File.separator);
}else {
path.append("../");
try {
if (SysUtil.isWindows()) {// Window 系统
path.append(new File(".").getCanonicalPath()).append(File.separator);
}else {
path.append("../");
}
}catch (Exception e){
e.printStackTrace();
}
return path.toString();
}
public static void main(String[] args) throws IOException {