Merge branch 'master_test_gn' into dh_dev_rediskey

duhui 2021-09-14 00:07:34 +08:00
commit 7af7724b0c
10 changed files with 61 additions and 28 deletions

View File

@ -10,10 +10,7 @@ import com.ljsd.jieling.ktbeans.ReportUtil;
import com.ljsd.jieling.logic.GlobalDataManaager;
import com.ljsd.jieling.logic.GlobleSystemLogic;
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.SuperBoxEvent;
import com.ljsd.jieling.logic.activity.event.*;
import com.ljsd.jieling.logic.activity.fourChallenge.FourChallengeLogic;
import com.ljsd.jieling.logic.dao.*;
import com.ljsd.jieling.logic.dao.root.GlobalSystemControl;
@ -232,6 +229,8 @@ public class GetPlayerInfoHandler extends BaseHandler{
Poster.getPoster().dispatchEvent(new SuperBoxEvent(user.getId(),SuperBoxEvent.default_id));
// 超值基金,老玩家兼容
Poster.getPoster().dispatchEvent(new SuperBoxEvent(user.getId(),SuperBoxEvent.fund_old_user));
// 登峰造极孙悟空
Poster.getPoster().dispatchEvent(new HeroUpStarEvent(user.getId(),10023,0));
user.getUserMissionManager().onGameEvent(user,GameEvent.DAILY_TASK_TYPE,0,user);
MessageUtil.sendIndicationMessage(iSession, 1, MessageTypeProto.MessageType.WorldLevelIndication_VALUE, PlayerInfoProto.WorldLevelIndication.newBuilder().setWorldLeve(GlobleSystemLogic.getGlobalWorldLevelCache()).build(), true);
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.GET_PLAYERINFO_RESPONSE_VALUE, getPlayerInfoResponse, true);

View File

@ -279,6 +279,7 @@ public class SituationLogic {
int score = Double.valueOf(rankEnum.getScoreById(user.getId(), "")).intValue();
rankEnum.addRank(user.getId(),"",score==-1?1:score+1);
consumeCount = true;
BuyGoodsNewLogic.openPush(session, user, PushRechargeType.XIANYUAN_BAOJING.getType(), sRaceTowerConfig.getQuality(), 1);
}
}else{
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
@ -292,7 +293,6 @@ public class SituationLogic {
}
// 埋点报送
ReportUtil.onReportEvent(user, ReportEventEnum.START_SKY_REALM.getType(), sRaceTowerConfig.getType(),id,combat_results,dropResult);
BuyGoodsNewLogic.openPush(session, user, PushRechargeType.XIANYUAN_BAOJING.getType(), sRaceTowerConfig.getQuality(), 1);
// user.getUserMissionManager().onGameEvent(user, GameEvent.DAILY_CHALLENGE,sDailyChallengeConfig.getType());
MessageUtil.sendMessage(session,1,messageType.getNumber(),builder.build());
}

View File

@ -34,13 +34,19 @@ public class HeroStarActivity extends AbstractActivity {
@Override
public void onEvent(IEvent event) throws Exception {
HeroUpStarEvent heroUpStarEvent = (HeroUpStarEvent) event;
if (!(event instanceof HeroUpStarEvent)) {
int uid = 0;
int heroTid = 0;
if (event instanceof HeroUpStarEvent) {
heroTid = ((HeroUpStarEvent) event).getHeroTid();
uid = ((HeroUpStarEvent) event).getUid();
}
else if (event instanceof FiveStarGetEvent){
heroTid = ((FiveStarGetEvent) event).getHeroid();
uid = ((FiveStarGetEvent) event).getUid();
}else {
return;
}
User user = UserManager.getUser(heroUpStarEvent.getUid());
int heroTid = ((HeroUpStarEvent) event).getHeroTid();
User user = UserManager.getUser(uid);
ActivityMission activityMission = user.getActivityManager().getActivityMissionMap().get(id);
if( null == activityMission){

View File

@ -93,6 +93,7 @@ public enum TeamEnum {
this.teamId = teamId;
this.isCross = isCross;
this.remarks = remarks;
this.isPvp = isPvp;
}
public int getTeamId() {

View File

@ -10,15 +10,16 @@ import com.ljsd.jieling.logic.dao.root.GuildCache;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.logic.family.CrossDeathPathLogic;
import com.ljsd.jieling.logic.rank.IRank;
import config.SGuildCheckpointConfig;
import manager.STableManager;
import org.luaj.vm2.ast.Str;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.redis.core.ZSetOperations;
import rpc.protocols.CommonProto;
import rpc.protocols.PlayerInfoProto;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.*;
import java.util.function.BiConsumer;
/**
@ -368,9 +369,18 @@ public abstract class AbstractRank implements IRank {
RedisUtil.getInstence().zsetRemoveOne(RedisKey.getKey(redisKey,rkey,false),value);
}
public void removeAllRank(String rkey){
Map<Integer, SGuildCheckpointConfig> configMap = STableManager.getConfig(SGuildCheckpointConfig.class);
if (configMap == null || configMap.isEmpty()) {
return;
}
try {
Set<String> dimKey = RedisUtil.getInstence().getDimKey(RedisKey.getKey(redisKey, rkey, false) + "*", 200);
dimKey.forEach(item->RedisUtil.getInstence().del(item));
// Set<String> dimKey = RedisUtil.getInstence().getDimKey(RedisKey.getKey(redisKey, rkey, false) + "*", 200);
String[] dimKey = new String[configMap.size()];
int index = 0;
for (Integer integer : configMap.keySet()) {
dimKey[index] = RedisKey.getKey(redisKey, rkey, false) + integer;
}
RedisUtil.getInstence().del(dimKey);
} catch (Exception e) {
e.printStackTrace();
}

View File

@ -644,7 +644,6 @@ public class BuyGoodsNewLogic {
ArrayList<AbstractWelfareBag> welfareBags = new ArrayList<>(rechargeInfo.getPerpetualMap().values());
welfareBags.addAll(rechargeInfo.getTimeLimitMap().values());
welfareBags.addAll(rechargeInfo.getReceiveMap().values());
welfareBags.addAll(rechargeInfo.getPushMap().values());
for (AbstractWelfareBag bag : welfareBags) {
if(bag.isOpen()){
if (bag.getLimit() == 0 || bag.getLimit() > bag.getBuyTimes()){
@ -653,6 +652,15 @@ public class BuyGoodsNewLogic {
}
}
for (AbstractWelfareBag bag : rechargeInfo.getPushMap().values()) {
PushWelfareBag bag1 = (PushWelfareBag)bag;
if(bag1.isOpen()){
if (bag1.getLimit() == 0 || bag1.getLimit() > bag1.getBuyTimes()){
list.add(bag1.getModId());
}
}
}
// 走表判断开启的礼包
Map<Integer, SGlobalActivity> activityMap = SGlobalActivity.getsGlobalActivityMap();
Map<Integer, ActivityMission> missionMap = user.getActivityManager().getActivityMissionMap();
@ -870,18 +878,15 @@ public class BuyGoodsNewLogic {
if(id >= 7300 && id <= 7304){
return true;
}
if(id >= 1100 && id <= 1104){
return true;
}
return false;
return id >= 1100 && id <= 1104;
}
public static boolean createPushBag(int bagId,User user,int num){
private static boolean createPushBag(int bagId, User user, int num){
NewRechargeInfo info = user.getPlayerInfoManager().getNewRechargeInfo();
int hasOpen = 0;
if(info.getTempLimitMap().containsKey(bagId)){
hasOpen = info.getTempLimitMap().get(bagId);
if(hasOpen >= info.FIVESTARLIMIT){
if(hasOpen >= NewRechargeInfo.FIVESTARLIMIT){
return false;
}else{
info.getTempLimitMap().put(bagId,hasOpen+num);
@ -891,14 +896,14 @@ public class BuyGoodsNewLogic {
}
if(isFiveStarBag(bagId) && info.getPushMap().get(bagId) != null){
AbstractWelfareBag bag = info.getPushMap().get(bagId);
bag.setLimit((bag.getLimit()+num)>info.FIVESTARLIMIT?info.FIVESTARLIMIT:(bag.getLimit()+num));
bag.setLimit((bag.getLimit()+num)> NewRechargeInfo.FIVESTARLIMIT ? NewRechargeInfo.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(num != 0 && num+hasOpen > info.FIVESTARLIMIT){
bag.setLimit(info.FIVESTARLIMIT-hasOpen);
if(num != 0 && num+hasOpen > NewRechargeInfo.FIVESTARLIMIT){
bag.setLimit(NewRechargeInfo.FIVESTARLIMIT -hasOpen);
}else{
bag.setLimit(num);
}

View File

@ -194,7 +194,13 @@ public class AbstractWelfareBag extends MongoBase{
updateString("dailyUpdate",dailyUpdate);
}
public int getLimit() { return limit; }
public int getLimit() {
SRechargeCommodityNewConfig config = SRechargeCommodityNewConfig.getConfigById(modId);
if (this instanceof PushWelfareBag){
return limit;
}
return config.getLimit();
}
public void setLimit(int limit) {
this.limit = limit;

View File

@ -1,8 +1,6 @@
package com.ljsd.jieling.logic.store.newRechargeInfo.bean;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.util.KeyGenUtils;
import com.ljsd.jieling.util.UUIDEnum;
import config.SRechargeCommodityNewConfig;
import util.TimeUtils;

View File

@ -8,6 +8,7 @@ public class DataReportTask extends Thread {
public DataReportTask(){
setName("DataReportTask");
setPriority(2);//优先级设置低点
}
@Override
public void run() {
@ -15,9 +16,15 @@ public class DataReportTask extends Thread {
// return;
// }
try {
int i = 0;
while(true){
ReportUserEvent event = ReportUtil.queue.take();
ReportUtil.doReport(event);
i++;
if (i >= 1000) {
i = 0;
Thread.sleep(100);
}
}
} catch (InterruptedException e) {
e.printStackTrace();

View File

@ -205,6 +205,7 @@ public class MinuteTask extends Thread {
Calendar calendar = Calendar.getInstance();
int hour = calendar.get(Calendar.HOUR_OF_DAY);
int minute = calendar.get(Calendar.MINUTE);
LOGGER.info("********竞技场每日邮件和公会零点刷新时间*******:{}",TimeUtils.getTimeStamp2(TimeUtils.now()));
if(hour == 0 && minute ==0){
//保证每分钟线程
try {