Merge branch 'master_test_gn_zf' into master_test_gn

back_recharge
lvxinran 2021-07-15 04:34:40 +08:00
commit 07fe5c89ed
15 changed files with 115 additions and 39 deletions

View File

@ -110,10 +110,12 @@ public class HandlerLogicThread extends Thread{
try {
AyyncWorker ayyncWorker =null;
boolean hasAsyncWorker =false;
//这里检查是否有需要执行的其他线程给过来的任务
while ( (ayyncWorker = ayyncWorkerConcurrentLinkedQueue.poll())!=null){
hasAsyncWorker=true;
ayyncWorker.work(ayyncWorker.getUser());
}
//这里判断是否有新的请求进来
PacketNetData packetNetData = handlerLinkedQueue.poll();
if(packetNetData == null){
if(hasAsyncWorker){

View File

@ -2833,10 +2833,14 @@ public class MapLogic {
// 获取玩家背包道具并消耗
Item item1 = user.getItemManager().getItem(item.getId());
if(item1!=null){
if(item1.getItemId()==0){
user.getItemManager().removeItem(0);
continue;
}
System.out.println("======================清理无尽副本道具,玩家:{ " + uid + " }道具id{ " + item1.getItemId() + " }");
int[][] cost= new int[1][];
cost[0] = new int[]{item1.getItemId(),(int)item1.getItemNum()};
ItemUtil.itemCost(user,cost,BIReason.ENDLESS_REASON_CHANGE,0);
System.out.println("======================清理无尽副本道具,玩家:{ " + uid + " }道具id{ " + item1.getItemId() + " }");
}
}
}

View File

@ -340,6 +340,30 @@ public class ActivityLogic implements IEventHandler{
}
ActivityMission activityMission = activityManager.getActivityMissionMap().get(openActivityId);
if (activityMission != null) {
if(openActivityId == ActivityType.RechargeTotal){
//首冲3天 -> 7天 容错
int chargeMoneyCount = 0;
List<SActivityRewardConfig> sActivityRewardConfigs = SActivityRewardConfig.getsActivityRewardConfigByActivityId(openActivityId);
if(sActivityRewardConfigs.size() != activityMission.getActivityMissionMap().size()){
for(ActivityProgressInfo progressInfo:activityMission.getActivityMissionMap().values()){
if(chargeMoneyCount != progressInfo.getProgrss()){
chargeMoneyCount = progressInfo.getProgrss();
}
}
}
for (SActivityRewardConfig Config:sActivityRewardConfigs) {
if(!activityMission.getActivityMissionMap().containsKey(Config.getId())){
if(activityMission.getActivityState()==2){
activityMission.setActivityState(1);
}
ActivityProgressInfo activityProgressInfo = new ActivityProgressInfo();
activityProgressInfo.setProgrss(ActivityLogic.getInstance().getInitActivityMissionProgress(openActivityId));
activityProgressInfo.setState(0);
activityProgressInfo.setProgrss(chargeMoneyCount);
activityMission.getActivityMissionMap().put(Config.getId(), activityProgressInfo);
}
}
}
continue;
}

View File

@ -311,7 +311,8 @@ public class ChampionshipLogic {
//获取竞技场排行榜
Set<ZSetOperations.TypedTuple<String>> arenaRankInfo = new HashSet<>(championshipPlayer);
Set<ZSetOperations.TypedTuple<String>> arenaRankInfoOne = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.ARENA_RANK, Integer.toString(curSeason), 0, championshipPlayer);
//start-end为0 127 才能拿到第128 不然会多拿到129
Set<ZSetOperations.TypedTuple<String>> arenaRankInfoOne = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.ARENA_RANK, Integer.toString(curSeason), 0, championshipPlayer-1);
if (arenaRankInfoOne != null && !arenaRankInfoOne.isEmpty()) {
arenaRankInfo.addAll(arenaRankInfoOne);
}

View File

@ -429,6 +429,7 @@ public class GuildLogic {
Integer position = memberEntry.getKey();
Set<Integer> value = memberEntry.getValue();
for(Integer uidTmp : value){
LOGGER.info("family有问题的uid:{}",uidTmp);
User userTmp = UserManager.getUser(uidTmp);
builder.addFamilyUserInfo(CBean2Proto.getFamilyUserInfo(userTmp,position));
}

View File

@ -76,6 +76,7 @@ public class FriendLogic {
List<Integer> friends = friendManager.getFriends();
List<CommonProto.Friend> friendList = new CopyOnWriteArrayList<>();
for (Integer friendId :friends){
LOGGER.info("有问题的Uid:{}",friendId);
CommonProto.Friend friend = CBean2Proto.getFriendInfo(friendId,friendManager);
friendList.add(friend);
}

View File

@ -103,6 +103,7 @@ public abstract class AbstractRank implements IRank {
return builder;
}
ZSetOperations.TypedTuple<String> data = rankByKey.iterator().next();
LOGGER.info("有问题的ArenaId{}",Integer.parseInt(data.getValue()));
User everyUser = UserManager.getUser(Integer.parseInt(data.getValue()), true);
if (everyUser == null){
return builder;
@ -128,6 +129,7 @@ public abstract class AbstractRank implements IRank {
}
protected void getOptional(int index,ZSetOperations.TypedTuple<String> data,PlayerInfoProto.RankResponse.Builder builder) throws Exception {
LOGGER.info("获取排行榜信息===================玩家id:{}"+data.getValue());
User everyUser = UserManager.getUser(Integer.parseInt(data.getValue()), true);
if (everyUser == null){
return;

View File

@ -238,9 +238,9 @@ public class BuyGoodsNewLogic {
}
notifyPaySuccessFul(uid,goodsId,amount != -999);
MongoUtil.getLjsdMongoTemplate().lastUpdate();
sendGiftGoodsWithoutJudge(uid);
openPush(session,user, PushRechargeType.point_recharge.getType(),goodsId,1);
MongoUtil.getLjsdMongoTemplate().lastUpdate();
// 扶持订单不需要上报
if(price>0 && !orderId.equals("support-order")){
// 以下为充值上报
@ -460,6 +460,10 @@ public class BuyGoodsNewLogic {
result = true;
}
}else{
if(bag.getType() == RechargeType.push.getType() && !bag.isOpen()){
user.getPlayerInfoManager().getNewRechargeInfo().removePush((PushWelfareBag) bag);
return true;
}
if(bag.getType() == RechargeType.timeLimit.getType()){
//活动类型特殊处理
for(String[] s : configById.getCondition()){
@ -539,15 +543,6 @@ public class BuyGoodsNewLogic {
return bag;
}
/**
* setPush
*/
public static void setInitPushInfo(PushWelfareBag bag,SRechargeCommodityNewConfig config){
bag.setStartTime(System.currentTimeMillis());
bag.setEndTime(System.currentTimeMillis() + bag.getTime() * TimeUtils.HOUR);
bag.setOpen(true);
}
/**
*
*/
@ -556,7 +551,7 @@ public class BuyGoodsNewLogic {
bag.setLastBuyTime(0);
bag.setBuyTimes(0);
if(bag.getType() == RechargeType.push.getType()){
clearPushBag((PushWelfareBag) bag);
user.getPlayerInfoManager().getNewRechargeInfo().removePush((PushWelfareBag) bag);
}
}
@ -704,7 +699,9 @@ public class BuyGoodsNewLogic {
int popup = 0;
boolean push = false;
for(SPackPushConfig con : list){
LOGGER.info("判断的id:{}",con.getId());
int bagId = judgePushCondition(user,con);
LOGGER.info("判断结果为:{}",bagId);
//条件成功
if(bagId > 0 && info.getNextPushTime() < System.currentTimeMillis()){
popup = bagId;
@ -737,21 +734,25 @@ public class BuyGoodsNewLogic {
if(scope[0] == 1){//主线关卡
int mainLevel = user.getMainLevelManager().getFightId();
if(mainLevel < scope[1]){
LOGGER.info("aaaa");
return -1;
}
}else if(scope[0] == 2){//爬塔
int towerLevel = con.getConditionId()[1];
if(towerLevel < scope[1]){
LOGGER.info("bbbb");
return -1;
}
}else if(scope[0] == 3){//玩家等级
int level = user.getPlayerInfoManager().getLevel();
if(level < scope[1]){
LOGGER.info("cccc");
return -1;
}
}else if(scope[0] == 7){
double mxr = user.getPlayerInfoManager().getNewRechargeInfo().getMaxSingleR();
if(mxr < scope[1]){
LOGGER.info("dddd");
return -1;
}
}
@ -764,6 +765,7 @@ public class BuyGoodsNewLogic {
}
}
if(con.getPersonas()[index] > rr){
LOGGER.info("eeee");
return -1;
}
return con.getPacks()[index];
@ -886,26 +888,36 @@ public class BuyGoodsNewLogic {
}else{
info.getTempLimitMap().put(bagId,num);
}
SRechargeCommodityNewConfig config = SRechargeCommodityNewConfig.getConfigById(bagId);
if(info.getPushMap().get(bagId) != null){
if(isFiveStarBag(bagId) && info.getPushMap().get(bagId) != null){
AbstractWelfareBag bag = info.getPushMap().get(bagId);
setInitPushInfo((PushWelfareBag) bag,config);
if(isFiveStarBag(bagId)){
bag.setLimit((bag.getLimit()+num)>info.FIVESTARLIMIT?info.FIVESTARLIMIT:(bag.getLimit()+num));
}
bag.setLimit((bag.getLimit()+num)>info.FIVESTARLIMIT?info.FIVESTARLIMIT:(bag.getLimit()+num));
bag.setStartTime(System.currentTimeMillis());
bag.setEndTime(bag.getStartTime() + getTime(bag) * TimeUtils.HOUR);
}else{
SRechargeCommodityNewConfig config = SRechargeCommodityNewConfig.getConfigById(bagId);
AbstractWelfareBag bag = initUnitWF(user,config);
if(isFiveStarBag(bagId)){
bag.setLimit(num>info.FIVESTARLIMIT?info.FIVESTARLIMIT:num);
if(num != 0 && num+hasOpen > info.FIVESTARLIMIT){
bag.setLimit(info.FIVESTARLIMIT-hasOpen);
}else{
bag.setLimit(num);
}
}
return true;
}
/**
*
*
* @param bag
* @return
*/
private static void clearPushBag(PushWelfareBag bag){
bag.clear();
private static int getTime(AbstractWelfareBag bag){
int i = 2;
for(String[] s : bag.getCondition()){
if(s[0].equals("6")){
i = Integer.parseInt(s[1]);
break;
}
}
return i;
}
}

View File

@ -184,6 +184,11 @@ public class NewRechargeInfo extends MongoBase {
updateString("pushMap."+bag.getModId(),bag);
}
public void removePush(PushWelfareBag bag){
pushMap.remove(bag.getModId());
removeString(getMongoKey() + ".pushMap."+bag.getModId());
}
public int getMainLineLost() {
return mainLineLost;
}

View File

@ -35,9 +35,6 @@ public class AbstractWelfareBag extends MongoBase{
setModId(config.getId());
setType(config.getOtype());
setLimit(config.getLimit());
if(config.getOtype() == 4){
setLimit(1);
}
setTimeType(config.getTime());
setDailyUpdate(config.getDailyUpdate());
setContinueDays(config.getContiueDays());

View File

@ -27,20 +27,12 @@ public class PushWelfareBag extends AbstractWelfareBag {
public boolean buy() {
setBuyTimes(getBuyTimes()+1);
if(getLimit()<=getBuyTimes()){
clear();
setOpen(false);
}
return true;
}
public void clear(){
setOpen(false);
setLimit(1);
setBuyTimes(0);
setStartTime(0);
setEndTime(0);
}
public int getTime(){
private int getTime(){
int i = 2;
for(String[] s : getCondition()){
if(s[0].equals("6")){

View File

@ -157,4 +157,7 @@ public class ThreadManager implements IManager {
executor.execute(task);
}
public static ThreadPoolExecutor getExecutor() {
return executor;
}
}

View File

@ -36,6 +36,8 @@ import com.ljsd.jieling.network.server.ProtocolsManager;
import com.ljsd.jieling.thread.ThreadManager;
import com.ljsd.jieling.util.AyyncWorker;
import com.ljsd.jieling.util.MessageUtil;
import config.SChallengeMapConfig;
import config.SRechargeCommodityNewConfig;
import manager.STableManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -141,6 +143,33 @@ public class MinuteTask extends Thread {
try {
ArenaLogic.getInstance().worldSendReward();
if(STableManager.getConfig(SRechargeCommodityNewConfig.class).size()!= SRechargeCommodityNewConfig.configMap.size()){
Map<Integer, SRechargeCommodityNewConfig> config = STableManager.getConfig(SRechargeCommodityNewConfig.class);
Map<Integer,SRechargeCommodityNewConfig> tempConfigMap = new HashMap<>();
Map<String,SRechargeCommodityNewConfig> tempSdkConfigMap = new HashMap<>();
Map<Integer, List<Integer>> tempConfigTypeMap = new HashMap<>();
for(SRechargeCommodityNewConfig newConfig : config.values()){
newConfig.setCondition(newConfig.initConditon(newConfig));
tempConfigMap.put(newConfig.getId(),newConfig);
tempSdkConfigMap.put(newConfig.getRechargeId(),newConfig);
tempSdkConfigMap.put(newConfig.getRechargeId2(),newConfig);
tempSdkConfigMap.put(newConfig.getRechargeId3(),newConfig);
if(tempConfigTypeMap.containsKey(newConfig.getType())){
tempConfigTypeMap.get(newConfig.getType()).add(newConfig.getId());
}else{
List<Integer> list = new ArrayList<>();
list.add(newConfig.getId());
tempConfigTypeMap.put(newConfig.getType(),list);
}
}
// if(configMap == null){
SRechargeCommodityNewConfig.configMap = tempConfigMap;
LOGGER.info("修复重新加载Recharge");
SRechargeCommodityNewConfig.sdkconfigMap = tempSdkConfigMap;
SRechargeCommodityNewConfig.configTypeMap = tempConfigTypeMap;
}
}catch (Exception e){
e.printStackTrace();
LOGGER.error("Exception::=>{}",e.toString());

View File

@ -4,6 +4,7 @@ import com.google.gson.Gson;
import com.ljsd.CoreService;
import com.ljsd.GameApplication;
import com.ljsd.jieling.config.json.CoreSettings;
import com.ljsd.jieling.thread.ThreadManager;
import com.ljsd.jieling.thrift.idl.RPCRequestIFace;
import com.ljsd.jieling.util.ConfigurableApplicationContextManager;
import org.apache.thrift.TProcessor;
@ -43,6 +44,7 @@ public class RPCServerTask extends Thread{
TBinaryProtocol.Factory proFactory = new TBinaryProtocol.Factory(true, true);
trArgs.protocolFactory(proFactory);
trArgs.maxWorkerThreads(16);
trArgs.executorService(ThreadManager.getExecutor());
LOGGER.info("run->RPC services is starting.");
final TServer server = new TThreadPoolServer(trArgs);
while (true) {

View File

@ -87,11 +87,12 @@ public class SRechargeCommodityNewConfig implements BaseConfig {
tempConfigTypeMap.put(newConfig.getType(),list);
}
}
if(configMap == null){
// if(configMap == null){
configMap = tempConfigMap;
System.out.println("重新加载Recharge");
sdkconfigMap = tempSdkConfigMap;
configTypeMap = tempConfigTypeMap;
}
// }
}
public static String[][] getConditon(int id){