Merge branch 'master' of http://60.1.1.230/backend/jieling_server
commit
73fbcf991f
|
@ -25,6 +25,7 @@ public class CoreService implements RPCRequestIFace.Iface {
|
||||||
@Override
|
@Override
|
||||||
public Result deliveryRecharge(int uid, int goodsId, String openId, String orderId, long orderTime, int amount) throws InvalidOperException, TException {
|
public Result deliveryRecharge(int uid, int goodsId, String openId, String orderId, long orderTime, int amount) throws InvalidOperException, TException {
|
||||||
try {
|
try {
|
||||||
|
LOGGER.info("deliveryRecharge start",uid );
|
||||||
return BuyGoodsLogic.sendGoods(uid, goodsId, openId, orderId, orderTime, amount);
|
return BuyGoodsLogic.sendGoods(uid, goodsId, openId, orderId, orderTime, amount);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
User user = UserManager.getUserInMem(uid);
|
User user = UserManager.getUserInMem(uid);
|
||||||
|
|
|
@ -77,7 +77,6 @@ public class ReCoverExpeditionHeroRequestHandler extends BaseHandler<Expedition.
|
||||||
});
|
});
|
||||||
|
|
||||||
Expedition.ReCoverExpeditionHeroResponse.Builder build = Expedition.ReCoverExpeditionHeroResponse.newBuilder().addAllHeroInfo(set);
|
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);
|
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.EXPEDITION_RECOVER_HERO_RESONSE_VALUE, build.build(), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,7 +122,6 @@ public class ReliveExpeditionHeroRequest extends BaseHandler<Expedition.ReliveEx
|
||||||
|
|
||||||
Expedition.ReliveExpeditionHeroResponse build = Expedition.ReliveExpeditionHeroResponse.newBuilder()
|
Expedition.ReliveExpeditionHeroResponse build = Expedition.ReliveExpeditionHeroResponse.newBuilder()
|
||||||
.setHeroInfo(CommonProto.ExpeditionSimpleHeroInfo.newBuilder().setHeroId(heroId).setRemainHp(1d).build()).build();
|
.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);
|
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.EXPEDITION_RELIVE_HERO_RESONSE_VALUE, build, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,6 @@ public class TakeHolyEquipRequest extends BaseHandler<Expedition.TakeHolyEquipRe
|
||||||
MessageUtil.sendIndicationMessage(iSession, 1, MessageTypeProto.MessageType.EXPEDITION_NOINFO_INDICATION_VALUE, builder.build(), true);
|
MessageUtil.sendIndicationMessage(iSession, 1, MessageTypeProto.MessageType.EXPEDITION_NOINFO_INDICATION_VALUE, builder.build(), true);
|
||||||
|
|
||||||
Expedition.TakeHolyEquipResponse.Builder build = Expedition.TakeHolyEquipResponse.newBuilder().setEquipId(expeditionItem.getId());
|
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);
|
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.EXPEDITION_TAKE_HOLY_EQUIP_RESONSE_VALUE, build.build(), true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,6 +54,7 @@ public class GetArenaInfoHandler extends BaseHandler {
|
||||||
.setFailNums(arenaManager.getFailNums())
|
.setFailNums(arenaManager.getFailNums())
|
||||||
.setSuccessNums(arenaManager.getSuccessNums())
|
.setSuccessNums(arenaManager.getSuccessNums())
|
||||||
.setScore(score)
|
.setScore(score)
|
||||||
|
.addAllHadTakeBox(arenaManager.getHadTakeReward())
|
||||||
.addAllArenaEnemys(ArenaLogic.getInstance().getArenaEnemyList(arenaManager.getArenaEnemies()))
|
.addAllArenaEnemys(ArenaLogic.getInstance().getArenaEnemyList(arenaManager.getArenaEnemies()))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
|
|
@ -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.GuildInfo;
|
||||||
import com.ljsd.jieling.logic.dao.root.User;
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
import com.ljsd.jieling.protocols.PlayerInfoProto;
|
import com.ljsd.jieling.protocols.PlayerInfoProto;
|
||||||
|
import com.ljsd.jieling.util.SysUtil;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -26,9 +27,9 @@ public class ReportUtil {
|
||||||
|
|
||||||
private static Map<Integer,ReportBaseBean> baseBeanMap = new HashMap<>();
|
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<>();
|
public static BlockingQueue<ReportUserEvent> queue = new BlockingUniqueQueue<>();
|
||||||
|
|
||||||
|
|
|
@ -120,6 +120,9 @@ public class CumulationData {
|
||||||
public int rechargeTotal; //累計充值
|
public int rechargeTotal; //累計充值
|
||||||
|
|
||||||
public int refreshMrTimes; //刷新迷宫寻宝次数
|
public int refreshMrTimes; //刷新迷宫寻宝次数
|
||||||
|
|
||||||
|
public int especialEquipMaxLeve; //法宝最高等级达到5
|
||||||
|
|
||||||
public Map<Integer,Integer> luckyWheelTimes = new HashMap<>(); //幸运探宝次数
|
public Map<Integer,Integer> luckyWheelTimes = new HashMap<>(); //幸运探宝次数
|
||||||
|
|
||||||
public int expeditinoTimes; // 猎妖之路次数
|
public int expeditinoTimes; // 猎妖之路次数
|
||||||
|
|
|
@ -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.HeroAttributeEnum;
|
||||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||||
import com.ljsd.jieling.logic.mail.MailLogic;
|
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.logic.store.StoreLogic;
|
||||||
import com.ljsd.jieling.network.session.ISession;
|
import com.ljsd.jieling.network.session.ISession;
|
||||||
import com.ljsd.jieling.protocols.CommonProto;
|
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 oldlay = curryLay;
|
||||||
final int newlay = oldlay + 1;
|
final int newlay = oldlay + 1;
|
||||||
|
|
||||||
|
@ -204,6 +205,7 @@ public class ExpeditionLogic {
|
||||||
});
|
});
|
||||||
//updata lay
|
//updata lay
|
||||||
user.getExpeditionManager().setLay(newlay);
|
user.getExpeditionManager().setLay(newlay);
|
||||||
|
user.getUserMissionManager().onGameEvent(user, GameEvent.EXPEDITION_TIMES);
|
||||||
return nodeInfos;
|
return nodeInfos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -763,7 +763,7 @@ public class MissionLoigc {
|
||||||
break;
|
break;
|
||||||
//todo
|
//todo
|
||||||
case SPECIAL_EQUIP_LEVEL_UP:
|
case SPECIAL_EQUIP_LEVEL_UP:
|
||||||
// count = cumulationData.friendApplyCount;
|
count = cumulationData.especialEquipMaxLeve;
|
||||||
break;
|
break;
|
||||||
case LUCKY_WHEELS_TIMES:
|
case LUCKY_WHEELS_TIMES:
|
||||||
if(missionSubType[0] == 0){
|
if(missionSubType[0] == 0){
|
||||||
|
|
|
@ -114,6 +114,7 @@ public class DataManagerDistributor {
|
||||||
judges.put(MissionType.REARGE_TOTAL,new RechargeTotalManger());
|
judges.put(MissionType.REARGE_TOTAL,new RechargeTotalManger());
|
||||||
judges.put(MissionType.FINISH_MISSING_ROOM,new FinishMissionRoomManager());
|
judges.put(MissionType.FINISH_MISSING_ROOM,new FinishMissionRoomManager());
|
||||||
judges.put(MissionType.REFRESH_MISSING_ROOM,new RefreshMissionRoomMamager());
|
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.LUCKY_WHEELS_TIMES,new LuckyWheelTimesManager());
|
||||||
judges.put(MissionType.FINISH_EXPEDITION_HERO_TIMES,new ExpeditionManager());
|
judges.put(MissionType.FINISH_EXPEDITION_HERO_TIMES,new ExpeditionManager());
|
||||||
judges.put(MissionType.LOGIN_TIMES,new LoginTimeManager());
|
judges.put(MissionType.LOGIN_TIMES,new LoginTimeManager());
|
||||||
|
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -15,6 +15,10 @@ public class EspecialStarManager implements BaseDataManager {
|
||||||
}else{
|
}else{
|
||||||
especialEquipStar.put(equipStar,1);
|
especialEquipStar.put(equipStar,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(equipStar>data.especialEquipMaxLeve){
|
||||||
|
data.especialEquipMaxLeve=equipStar;
|
||||||
|
}
|
||||||
return new CumulationData.Result(missionType);
|
return new CumulationData.Result(missionType);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -279,6 +279,7 @@ public class MissionEventDistributor {
|
||||||
typeList = new ArrayList<>();
|
typeList = new ArrayList<>();
|
||||||
typeList.add(MissionType.ESPECIAL_EQUIP);
|
typeList.add(MissionType.ESPECIAL_EQUIP);
|
||||||
typeList.add(MissionType.JEWL_ALL_LEVE);
|
typeList.add(MissionType.JEWL_ALL_LEVE);
|
||||||
|
typeList.add(MissionType.SPECIAL_EQUIP_LEVEL_UP);
|
||||||
eventEnumListMap.put(GameEvent.ESPECIAL_EQUIP,typeList);
|
eventEnumListMap.put(GameEvent.ESPECIAL_EQUIP,typeList);
|
||||||
eventProcessor.put(GameEvent.ESPECIAL_EQUIP,new CumulationDataEventProcessor());
|
eventProcessor.put(GameEvent.ESPECIAL_EQUIP,new CumulationDataEventProcessor());
|
||||||
|
|
||||||
|
|
|
@ -89,6 +89,17 @@ public class BuyGoodsLogic {
|
||||||
LOGGER.info("send to uid={},the goods={},openID={},orderId={},orderTime={},amount={}",uid,goodsId,openId,orderId,orderTime,amount);
|
LOGGER.info("send to uid={},the goods={},openID={},orderId={},orderTime={},amount={}",uid,goodsId,openId,orderId,orderTime,amount);
|
||||||
User user = UserManager.getUser(uid);
|
User user = UserManager.getUser(uid);
|
||||||
SRechargeCommodityConfig sRechargeCommodityConfig = SRechargeCommodityConfig.rechargeCommodityConfigMap.get(goodsId);
|
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();
|
RechargeInfo rechargeInfo = user.getPlayerInfoManager().getRechargeInfo();
|
||||||
Map<Integer, Integer> buyGoodsTimes = rechargeInfo.getBuyGoodsTimes();
|
Map<Integer, Integer> buyGoodsTimes = rechargeInfo.getBuyGoodsTimes();
|
||||||
Integer buyCount = buyGoodsTimes.get(goodsId);
|
Integer buyCount = buyGoodsTimes.get(goodsId);
|
||||||
|
@ -153,6 +164,8 @@ public class BuyGoodsLogic {
|
||||||
|
|
||||||
|
|
||||||
if(sRechargeCommodityConfig.getAccumulativeRecharge() == 1){
|
if(sRechargeCommodityConfig.getAccumulativeRecharge() == 1){
|
||||||
|
try {
|
||||||
|
|
||||||
int monthline = STableManager.getConfig(SMonthcardConfig.class).get(Global.MONTHCARDID).getPrice();
|
int monthline = STableManager.getConfig(SMonthcardConfig.class).get(Global.MONTHCARDID).getPrice();
|
||||||
int lmonthline = STableManager.getConfig(SMonthcardConfig.class).get(Global.LMONTHCARDID).getPrice();
|
int lmonthline = STableManager.getConfig(SMonthcardConfig.class).get(Global.LMONTHCARDID).getPrice();
|
||||||
boolean sendneed =false;
|
boolean sendneed =false;
|
||||||
|
@ -172,10 +185,19 @@ public class BuyGoodsLogic {
|
||||||
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.MONTHCARD_INDICATION_VALUE, monthCardIndication, true);
|
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.MONTHCARD_INDICATION_VALUE, monthCardIndication, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
LOGGER.error("充值异常跳过"+e.toString());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
triggerEvent(user,sRechargeCommodityConfig,nowTime);
|
triggerEvent(user,sRechargeCommodityConfig,nowTime);
|
||||||
|
|
||||||
|
}catch (Exception e){
|
||||||
|
LOGGER.error("充值异常跳过"+e.toString());
|
||||||
|
}
|
||||||
|
|
||||||
int[][] baseReward = sRechargeCommodityConfig.getBaseReward();
|
int[][] baseReward = sRechargeCommodityConfig.getBaseReward();
|
||||||
int length = baseReward.length;
|
int length = baseReward.length;
|
||||||
String rewardStr="";
|
String rewardStr="";
|
||||||
|
|
|
@ -38,8 +38,8 @@ public class MessageUtil {
|
||||||
backMessage = new byte[0];
|
backMessage = new byte[0];
|
||||||
} else {
|
} else {
|
||||||
backMessage = generatedMessage.toByteArray();
|
backMessage = generatedMessage.toByteArray();
|
||||||
//if (backMessage.length != 0)
|
if (backMessage.length != 0)
|
||||||
//LOGGER.info("\r\n" + "uid:" + uid + ":\r\n" + JsonFormat.printToString(generatedMessage));
|
LOGGER.info("\r\n" + "uid:" + uid + ":\r\n" + JsonFormat.printToString(generatedMessage));
|
||||||
}
|
}
|
||||||
|
|
||||||
int length = PackageConstant.UID_FIELD_LEN + PackageConstant.TOKEN_LEN
|
int length = PackageConstant.UID_FIELD_LEN + PackageConstant.TOKEN_LEN
|
||||||
|
|
|
@ -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();
|
StringBuilder path = new StringBuilder();
|
||||||
path.append(getRootPath()).append(prefixDir);
|
path.append(getRootPath()).append(prefixDir);
|
||||||
for (String p : filePath) {
|
for (String p : filePath) {
|
||||||
path.append(File.separator).append(p);
|
path.append(File.separator).append(p);
|
||||||
}
|
}
|
||||||
return path.toString();
|
return path.toString();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getRootPath() throws IOException {
|
public static String getRootPath() {
|
||||||
StringBuilder path = new StringBuilder();
|
StringBuilder path = new StringBuilder();
|
||||||
|
try {
|
||||||
if (SysUtil.isWindows()) {// Window 系统
|
if (SysUtil.isWindows()) {// Window 系统
|
||||||
path.append(new File(".").getCanonicalPath()).append(File.separator);
|
path.append(new File(".").getCanonicalPath()).append(File.separator);
|
||||||
}else {
|
}else {
|
||||||
path.append("../");
|
path.append("../");
|
||||||
}
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
return path.toString();
|
return path.toString();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) throws IOException {
|
public static void main(String[] args) throws IOException {
|
||||||
|
|
Loading…
Reference in New Issue