数数免费礼包不上报 社稷大典排行进度 月礼包

back_recharge
zhangshanxue 2020-10-26 19:27:16 +08:00
parent 40f12ac7b6
commit 76c082bccc
4 changed files with 38 additions and 14 deletions

View File

@ -57,9 +57,7 @@ public class GMRequestHandler extends BaseHandler{
} }
@Override @Override
public void process(ISession iSession, PacketNetData netData) throws Exception { public void process(ISession iSession, PacketNetData netData) throws Exception {
if(!GameApplication.serverProperties.isDebug()){
throw new ErrorCodeException("In a formal setting");
}
byte[] message = netData.parseClientProtoNetData(); byte[] message = netData.parseClientProtoNetData();
CommonProto.GMCommand gmCommand = CommonProto.GMCommand.parseFrom(message); CommonProto.GMCommand gmCommand = CommonProto.GMCommand.parseFrom(message);
String command = gmCommand.getCommand(); String command = gmCommand.getCommand();
@ -77,6 +75,10 @@ public class GMRequestHandler extends BaseHandler{
if(!GameApplication.serverProperties.isDebug()){ if(!GameApplication.serverProperties.isDebug()){
CommonProto.GmResponse.Builder gmBuilder = CommonProto.GmResponse.newBuilder(); CommonProto.GmResponse.Builder gmBuilder = CommonProto.GmResponse.newBuilder();
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.GM_RESPONSE_VALUE, gmBuilder.build(), true); MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.GM_RESPONSE_VALUE, gmBuilder.build(), true);
return;
}
if(!GameApplication.serverProperties.isDebug()){
throw new ErrorCodeException("In a formal setting");
} }
if (!command.contains("#") || command.split("#").length < 3) { if (!command.contains("#") || command.split("#").length < 3) {
LOGGER.error("wrong command :" + command); LOGGER.error("wrong command :" + command);

View File

@ -5,12 +5,16 @@ import com.ljsd.jieling.db.mongo.MongoUtil;
import com.ljsd.jieling.db.redis.RedisKey; import com.ljsd.jieling.db.redis.RedisKey;
import com.ljsd.jieling.db.redis.RedisUtil; import com.ljsd.jieling.db.redis.RedisUtil;
import com.ljsd.jieling.globals.BIReason; import com.ljsd.jieling.globals.BIReason;
import com.ljsd.jieling.globals.Global;
import com.ljsd.jieling.handler.map.MapLogic; import com.ljsd.jieling.handler.map.MapLogic;
import com.ljsd.jieling.handler.map.MapManager; import com.ljsd.jieling.handler.map.MapManager;
import com.ljsd.jieling.ktbeans.ReportEventEnum; import com.ljsd.jieling.ktbeans.ReportEventEnum;
import com.ljsd.jieling.ktbeans.ReportUtil; import com.ljsd.jieling.ktbeans.ReportUtil;
import com.ljsd.jieling.logic.GlobalDataManaager; import com.ljsd.jieling.logic.GlobalDataManaager;
import com.ljsd.jieling.logic.OnlineUserManager;
import com.ljsd.jieling.logic.activity.ActivityLogic; import com.ljsd.jieling.logic.activity.ActivityLogic;
import com.ljsd.jieling.logic.activity.event.NewWelfareEvent;
import com.ljsd.jieling.logic.activity.event.NewWelfareTypeEnum;
import com.ljsd.jieling.logic.activity.event.Poster; import com.ljsd.jieling.logic.activity.event.Poster;
import com.ljsd.jieling.logic.activity.event.UserOnlineEvent; import com.ljsd.jieling.logic.activity.event.UserOnlineEvent;
import com.ljsd.jieling.logic.dao.*; import com.ljsd.jieling.logic.dao.*;
@ -30,14 +34,12 @@ import com.ljsd.jieling.thread.task.RPCServerTask;
import com.ljsd.jieling.util.CBean2Proto; import com.ljsd.jieling.util.CBean2Proto;
import com.ljsd.jieling.util.ItemUtil; import com.ljsd.jieling.util.ItemUtil;
import com.ljsd.jieling.util.MessageUtil; import com.ljsd.jieling.util.MessageUtil;
import config.SChallengeConfig; import config.*;
import config.SGameSetting;
import config.SMazeTreasureSetting;
import config.SRechargeCommodityConfig;
import manager.STableManager; import manager.STableManager;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import util.MathUtils;
import util.TimeUtils; import util.TimeUtils;
import java.util.*; import java.util.*;
@ -168,6 +170,21 @@ public class GetPlayerInfoHandler extends BaseHandler{
} }
}); });
} }
//hotfix 月卡
int monthline = STableManager.getConfig(SMonthcardConfig.class).get(Global.MONTHCARDID).getPrice();
int lmonthline = STableManager.getConfig(SMonthcardConfig.class).get(Global.LMONTHCARDID).getPrice();
if(rechargeInfo.getMonthSaveAmt()>=monthline&&playerInfoManager.getMonthCard().getOrDefault(1,0)==0){
user.getPlayerInfoManager().getMonthCard().put(Global.MONTHCARDID, (int) (System.currentTimeMillis() / 1000));
}
if(rechargeInfo.getSmonthSaveAmt()>=lmonthline&&playerInfoManager.getMonthCard().getOrDefault(2,0)==0){
user.getPlayerInfoManager().getMonthCard().put(Global.LMONTHCARDID, (int) (System.currentTimeMillis() / 1000));
Poster.getPoster().dispatchEvent(new NewWelfareEvent(user, NewWelfareTypeEnum.RECHARGE_BUY.getType(),Global.LMONTHCARDID));
}
StoreLogic.reloadStoreInfo(user,7);//重载功能商店 StoreLogic.reloadStoreInfo(user,7);//重载功能商店
PlayerInfoProto.GetPlayerInfoResponse getPlayerInfoResponse PlayerInfoProto.GetPlayerInfoResponse getPlayerInfoResponse
= PlayerInfoProto.GetPlayerInfoResponse.newBuilder() = PlayerInfoProto.GetPlayerInfoResponse.newBuilder()

View File

@ -59,17 +59,22 @@ class SheJiActivity extends AbstractActivity {
} }
} }
@Override
boolean takeRewardsProcess(ISession session, SActivityRewardConfig sActivityRewardConfig, ActivityProgressInfo activityProgressInfo) throws Exception {
int[][] values = sActivityRewardConfig.getValues();
int missionProgress = activityProgressInfo.getProgrss();
return missionProgress >= values[0][1];
}
@Override @Override
void updateProgressWithUser(User user, ActivityMission activityMission, int count) { void updateProgressWithUser(User user, ActivityMission activityMission, int count) {
Map<Integer, ActivityProgressInfo> activityProgressInfoMap = activityMission.getActivityMissionMap(); Map<Integer, ActivityProgressInfo> activityProgressInfoMap = activityMission.getActivityMissionMap();
int progress; int progress;
for (Map.Entry<Integer, ActivityProgressInfo> item : activityProgressInfoMap.entrySet()) { for (Map.Entry<Integer, ActivityProgressInfo> item : activityProgressInfoMap.entrySet()) {
ActivityProgressInfo activityProgressInfo = item.getValue(); ActivityProgressInfo activityProgressInfo = item.getValue();
//考虑退公会的情况 // //考虑退公会的情况
if (activityProgressInfo.getProgrss() > count) { // if (activityProgressInfo.getProgrss() > count) {
break; // break;
} // }
progress = count; progress = count;
activityProgressInfo.setProgrss(progress); activityProgressInfo.setProgrss(progress);
activityMission.getActivityMissionMap().put(item.getKey(), activityProgressInfo); activityMission.getActivityMissionMap().put(item.getKey(), activityProgressInfo);

View File

@ -235,7 +235,7 @@ public class BuyGoodsLogic {
if(sRechargeCommodityConfig.getAccumulativeRecharge() == 1){ if(sRechargeCommodityConfig.getAccumulativeRecharge() == 1){
try { try {
user.getPlayerInfoManager().getMonthCard();
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;