Merge branch 'master' of http://60.1.1.230/backend/jieling_server
commit
5380c3cc23
|
@ -41,6 +41,7 @@ public class GameLogicService implements IService {
|
|||
public static GameLogicService getInstance() {
|
||||
return instance;
|
||||
}
|
||||
private static volatile boolean isShutdown = false;
|
||||
|
||||
|
||||
@Override
|
||||
|
@ -107,8 +108,10 @@ public class GameLogicService implements IService {
|
|||
LOGGER.info(resource.getFile());
|
||||
}
|
||||
|
||||
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
|
||||
LOGGER.info("ShutdownHook start");
|
||||
isShutdown= true;
|
||||
Thread.currentThread().setName("addShutdownHook");
|
||||
try {
|
||||
GameApplication.close();
|
||||
|
@ -116,4 +119,8 @@ public class GameLogicService implements IService {
|
|||
|
||||
}));
|
||||
}
|
||||
|
||||
public static boolean isServiceShutdown() {
|
||||
return isShutdown;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.google.gson.FieldAttributes;
|
|||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.ljsd.GameApplication;
|
||||
import com.ljsd.GameLogicService;
|
||||
import com.ljsd.common.mogodb.util.BlockingUniqueQueue;
|
||||
import com.ljsd.jieling.config.json.SDK37Constans;
|
||||
import com.ljsd.jieling.dataReport.reportBeans_37.*;
|
||||
|
@ -37,10 +38,12 @@ public class DataMessageUtils {
|
|||
private static final String sendChatContent37 = "http://cm3.api.37.com.cn/Content/_checkContent/";
|
||||
//入队列
|
||||
public static void addLogQueue(Object info) {
|
||||
if (info instanceof KTParam) {
|
||||
logQueue.offer(info);
|
||||
} else if (info instanceof Report37Param && GameApplication.serverProperties.isSendlog37()) {
|
||||
logQueue_37.offer(info);
|
||||
if(!GameLogicService.isServiceShutdown()){
|
||||
if (info instanceof KTParam) {
|
||||
logQueue.offer(info);
|
||||
} else if (info instanceof Report37Param && GameApplication.serverProperties.isSendlog37()) {
|
||||
logQueue_37.offer(info);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,11 @@ package com.ljsd.jieling.hotfix;
|
|||
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.ljsd.jieling.logic.activity.IEventHandler;
|
||||
import com.ljsd.jieling.logic.activity.event.IEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.MinuteTaskEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.util.SysUtil;
|
||||
import com.sun.tools.attach.AgentInitializationException;
|
||||
import com.sun.tools.attach.AgentLoadException;
|
||||
import com.sun.tools.attach.AttachNotSupportedException;
|
||||
|
@ -16,12 +21,14 @@ import java.io.InputStream;
|
|||
import java.lang.management.ManagementFactory;
|
||||
import java.util.List;
|
||||
|
||||
public class HotfixUtil{
|
||||
public class HotfixUtil implements IEventHandler {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(HotfixUtil.class);
|
||||
|
||||
private String currVerion = "0";
|
||||
|
||||
private HotfixUtil(){}
|
||||
private HotfixUtil(){
|
||||
Poster.getPoster().listenEvent(this, MinuteTaskEvent.class);
|
||||
}
|
||||
|
||||
public static class Instance {
|
||||
public final static HotfixUtil instance = new HotfixUtil();
|
||||
|
@ -31,7 +38,13 @@ public class HotfixUtil{
|
|||
return HotfixUtil.Instance.instance;
|
||||
}
|
||||
|
||||
public void doWork(String pathName){
|
||||
@Override
|
||||
public void onEvent(IEvent event) throws Exception {
|
||||
doWork(SysUtil.getPath("../conf/hotfix.json"));
|
||||
|
||||
}
|
||||
|
||||
private void doWork(String pathName){
|
||||
try{
|
||||
File file = new File(pathName);
|
||||
if(!file.exists()){
|
||||
|
|
|
@ -1,28 +1,223 @@
|
|||
package com.ljsd.jieling.kefu;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.ljsd.common.mogodb.LjsdMongoTemplate;
|
||||
import com.ljsd.jieling.db.mongo.MongoUtil;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.item.ItemLog;
|
||||
import config.SMainLevelConfig;
|
||||
import manager.STableManager;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.data.mongodb.core.query.Criteria;
|
||||
import org.springframework.data.mongodb.core.query.Query;
|
||||
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
public class Cmd_out_cfg extends GmAbstract {
|
||||
@Override
|
||||
public boolean exec(String[] args) throws Exception {
|
||||
|
||||
try {
|
||||
if(args.length!=2){
|
||||
return false;
|
||||
}
|
||||
String name = args[0];
|
||||
int id = Integer.valueOf(args[1]);
|
||||
if(!STableManager.getConfig(Class.forName(name)).containsKey(id)){
|
||||
System.out.print("--systemConfig-id not found");
|
||||
return false;
|
||||
}
|
||||
Gson gson = new Gson();
|
||||
System.out.print("--Config-"+name+"::"+gson.toJson(STableManager.getConfig(Class.forName(name)).get(id)));
|
||||
return true;
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
return false;
|
||||
// try {
|
||||
// if(args.length!=2){
|
||||
// return false;
|
||||
// }
|
||||
// String name = args[0];
|
||||
// int id = Integer.valueOf(args[1]);
|
||||
// if(!STableManager.getConfig(Class.forName(name)).containsKey(id)){
|
||||
// System.out.print("--systemConfig-id not found");
|
||||
// return false;
|
||||
// }
|
||||
// Gson gson = new Gson();
|
||||
// System.out.print("--Config-"+name+"::"+gson.toJson(STableManager.getConfig(Class.forName(name)).get(id)));
|
||||
// return true;
|
||||
// }catch (Exception e){
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// Gson gson = new Gson();
|
||||
// TreeMap<Integer, AtomicInteger> map = new TreeMap<>();
|
||||
// FileWriter fileWriter = null;
|
||||
// FileWriter fileWriter1 = null;
|
||||
// FileWriter fileWriter2 = null;
|
||||
// FileWriter fileWriter3 = null;
|
||||
// int i = 0;
|
||||
// try {
|
||||
// fileWriter = new FileWriter("D:/sumitem16.txt");
|
||||
// fileWriter1 = new FileWriter("D:/day1.txt");
|
||||
// fileWriter2 = new FileWriter("D:/day2.txt");
|
||||
// fileWriter3 = new FileWriter("D:/day3.txt");
|
||||
//
|
||||
//
|
||||
// int allUser=0;
|
||||
// for (User user : Cmd_global_gm.usersInDB) {
|
||||
////
|
||||
// if (user.getId() > 10003789) {
|
||||
// continue;
|
||||
// }
|
||||
// if (!get(user, fileWriter, fileWriter1, fileWriter2, fileWriter3)) {
|
||||
// continue;
|
||||
// }
|
||||
//// if (!get(user, fileWriter)) {
|
||||
//// continue;
|
||||
//// }
|
||||
// allUser++;
|
||||
// System.out.print("alluser::"+allUser);
|
||||
// }
|
||||
// } catch (IOException e) {
|
||||
// // TODO Auto-generated catch block
|
||||
// e.printStackTrace();
|
||||
// } finally {
|
||||
// fileWriter.write("共" + i + "条");
|
||||
// fileWriter.flush();
|
||||
// fileWriter.close();
|
||||
// fileWriter1.write("共" + i + "条");
|
||||
// fileWriter1.flush();
|
||||
// fileWriter1.close();
|
||||
// fileWriter2.write("共" + i + "条");
|
||||
// fileWriter2.flush();
|
||||
// fileWriter2.close();
|
||||
// fileWriter3.write("共" + i + "条");
|
||||
// fileWriter3.flush();
|
||||
// fileWriter3.close();
|
||||
// }
|
||||
System.exit(0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
private boolean get(User user, FileWriter fileWriter, FileWriter fileWriter1, FileWriter fileWriter2, FileWriter fileWriter3) throws Exception {
|
||||
//
|
||||
// long time1 = 1575388744000L;
|
||||
// long time2 = 1575475198000L;
|
||||
// long time3 = 1575561598000L;
|
||||
// Criteria criteria = new Criteria().andOperator(
|
||||
// Criteria.where("uid").is(user.getId()),
|
||||
// Criteria.where("itemId").is(16),
|
||||
// Criteria.where("type").is(-1)
|
||||
// );
|
||||
//
|
||||
// if (user.getPlayerInfoManager().getRechargeInfo().getSaveAmt() == 0) {
|
||||
// return false;
|
||||
// }
|
||||
// Query query = new Query(criteria);
|
||||
// query.with(new Sort(new Sort.Order(Sort.Direction.DESC, "time")));
|
||||
// LjsdMongoTemplate ljsdMongoTemplate = MongoUtil.getLjsdMongoTemplate();
|
||||
// List<ItemLog> itemLogs = ljsdMongoTemplate.findAllByCondition(query, ItemLog.class);
|
||||
// if (itemLogs.size() == 0) {
|
||||
// return false;
|
||||
// }
|
||||
// boolean one1 = false;
|
||||
// boolean one2 = false;
|
||||
// boolean one3 = false;
|
||||
// int daynum1 = -1;
|
||||
// int daynum2 = -1;
|
||||
// int daynum3 = -1;
|
||||
//
|
||||
// for (ItemLog itemLog : itemLogs) {
|
||||
//
|
||||
// if (!one3 && Long.valueOf(itemLog.getTime()) < time3) {
|
||||
// fileWriter3.write("uid:" + user.getId() + " totalnum: " + itemLog.getItemTotalNum() + "\r\n");//写入 \r\n换行
|
||||
// daynum3 = itemLog.getItemTotalNum();
|
||||
// one3 = true;
|
||||
// }
|
||||
//
|
||||
// if (!one2 && Long.valueOf(itemLog.getTime()) < time2 && Long.valueOf(itemLog.getTime()) > time1) {
|
||||
// fileWriter2.write("uid:" + user.getId() + " totalnum: " + itemLog.getItemTotalNum() + "\r\n");//写入 \r\n换行
|
||||
// daynum2 = itemLog.getItemTotalNum();
|
||||
// one2 = true;
|
||||
// }
|
||||
//
|
||||
// if (Long.valueOf(itemLog.getTime()) < time1) {
|
||||
// fileWriter1.write("uid:" + user.getId() + " totalnum: " + itemLog.getItemTotalNum() + "\r\n");//写入 \r\n换行
|
||||
// daynum1 = itemLog.getItemTotalNum();
|
||||
// break;
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// if (daynum1 != -1 && daynum2 == -1) {
|
||||
// fileWriter2.write("uid:" + user.getId() + " totalnum: " + daynum1 + "\r\n");//写入 \r\n换行
|
||||
// daynum2 = daynum1;
|
||||
// }
|
||||
// if (daynum2 != -1 && daynum3 == -1) {
|
||||
// fileWriter3.write("uid:" + user.getId() + " totalnum: " + daynum1 + "\r\n");//写入 \r\n换行
|
||||
// }
|
||||
//
|
||||
// fileWriter.write("uid:" + user.getId() + " " + daynum1 + " " + daynum2 + " " + daynum3 + " " + itemLogs.get(0).getItemTotalNum() + " \r\n");//写入 \r\n换行
|
||||
//
|
||||
// // fileWriter.write("uid:"+user.getId()+" totalnum: "+itemLogs.get(0).getItemTotalNum()+"\r\n");//写入 \r\n换行
|
||||
// fileWriter.flush();
|
||||
// fileWriter1.flush();
|
||||
// fileWriter2.flush();
|
||||
// fileWriter3.flush();
|
||||
// throw new Exception("1111");
|
||||
|
||||
if (user.getUserMissionManager().getCumulationData().takeSenvenLoinRewardTimes >=2) {
|
||||
return false;
|
||||
}
|
||||
Criteria criteria = new Criteria().andOperator(
|
||||
Criteria.where("uid").is(user.getId()),
|
||||
Criteria.where("itemId").is(16),
|
||||
Criteria.where("type").is(1)
|
||||
);
|
||||
|
||||
Query query = new Query(criteria);
|
||||
// query.with(new Sort(new Sort.Order(Sort.Direction.DESC, "time")));
|
||||
LjsdMongoTemplate ljsdMongoTemplate = MongoUtil.getLjsdMongoTemplate();
|
||||
List<ItemLog> itemLogs = ljsdMongoTemplate.findAllByCondition(query, ItemLog.class);
|
||||
if (itemLogs.size() == 0) {
|
||||
return false;
|
||||
}
|
||||
int sum =0;
|
||||
for (ItemLog itemLog : itemLogs) {
|
||||
sum=+itemLog.getItemNum();
|
||||
}
|
||||
|
||||
if(sum==0){
|
||||
// System.out.print("\r\n");//写入 \r\n换行
|
||||
// Gson gson = new Gson();
|
||||
// System.out.print("uid:" + user.getId()+" " + gson.toJson(itemLogs)+ " " + "\r\n");//写入 \r\n换行
|
||||
}
|
||||
long off = user.getPlayerInfoManager().getOffLineTime()-user.getPlayerInfoManager().getLoginTime();
|
||||
System.out.print("uid:" + user.getId()+" " + sum+ " " + off/60000 + "\r\n");//写入 \r\n换行
|
||||
fileWriter.write("uid:" + user.getId() + " " + sum+ " " + off/60000+" \r\n");//写入 \r\n换行
|
||||
fileWriter.flush();
|
||||
return true;
|
||||
// throw new Exception("1111");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// private boolean get(User user, FileWriter fileWriter) throws Exception {
|
||||
//
|
||||
// Criteria criteria = new Criteria().andOperator(
|
||||
// Criteria.where("uid").is(user.getId()),
|
||||
// Criteria.where("itemId").is(16),
|
||||
// Criteria.where("type").is(1)
|
||||
// );
|
||||
//
|
||||
// if (user.getUserMissionManager().getCumulationData().takeSenvenLoinRewardTimes >2) {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// Query query = new Query(criteria);
|
||||
// // query.with(new Sort(new Sort.Order(Sort.Direction.DESC, "time")));
|
||||
// LjsdMongoTemplate ljsdMongoTemplate = MongoUtil.getLjsdMongoTemplate();
|
||||
// List<ItemLog> itemLogs = ljsdMongoTemplate.findAllByCondition(query, ItemLog.class);
|
||||
// if (itemLogs.size() == 0) {
|
||||
// return false;
|
||||
// }
|
||||
// int sum =0;
|
||||
// for (ItemLog itemLog : itemLogs) {
|
||||
// sum=+itemLog.getItemNum();
|
||||
// }
|
||||
// fileWriter.write("uid:" + user.getId() + " " + sum+ " \r\n");//写入 \r\n换行
|
||||
// fileWriter.flush();
|
||||
// return true;
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -10,9 +10,7 @@ import com.ljsd.jieling.exception.ErrorCodeException;
|
|||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.handler.activity.BlessInfoConfig;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
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.*;
|
||||
import com.ljsd.jieling.logic.dao.*;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||
|
@ -41,16 +39,25 @@ import java.util.stream.Stream;
|
|||
/**
|
||||
*
|
||||
*/
|
||||
public class ActivityLogic {
|
||||
public class ActivityLogic implements IEventHandler{
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(ActivityLogic.class);
|
||||
|
||||
private ActivityLogic() {
|
||||
Poster.getPoster().listenEvent(this,MinuteTaskEvent.class);
|
||||
}
|
||||
|
||||
private Set<Integer> openActivityIds = new HashSet<>();
|
||||
|
||||
private int secretBoxSeasonTimes = 0; //秘盒赛季
|
||||
|
||||
@Override
|
||||
public void onEvent(IEvent event) throws Exception {
|
||||
|
||||
if(event instanceof MinuteTaskEvent){
|
||||
checkActiviyStatus();
|
||||
}
|
||||
}
|
||||
|
||||
public void flushEveryDay(User user, PlayerInfoProto.FivePlayerUpdateIndication.Builder fBuilder) throws Exception {
|
||||
|
||||
//跟新签到天数
|
||||
|
|
|
@ -7,6 +7,16 @@ package com.ljsd.jieling.logic.activity.event;
|
|||
*/
|
||||
public class HeroFiveStarGetEvent implements IEvent {
|
||||
private int uid;
|
||||
private int star;
|
||||
|
||||
public HeroFiveStarGetEvent(int uid, int star) {
|
||||
this.uid = uid;
|
||||
this.star = star;
|
||||
}
|
||||
|
||||
public int getStar() {
|
||||
return star;
|
||||
}
|
||||
|
||||
public HeroFiveStarGetEvent(int uid) {
|
||||
this.uid = uid;
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
package com.ljsd.jieling.logic.activity.event;
|
||||
|
||||
public class MinuteTaskEvent implements IEvent {
|
||||
|
||||
}
|
|
@ -2,6 +2,8 @@ package com.ljsd.jieling.logic.activity.eventhandler;
|
|||
|
||||
import com.ljsd.jieling.core.HandlerLogicThread;
|
||||
import com.ljsd.jieling.core.SimpleTransaction;
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.activity.IEventHandler;
|
||||
import com.ljsd.jieling.logic.activity.event.HeroFiveStarGetEvent;
|
||||
|
@ -19,6 +21,7 @@ import config.SRechargeCommodityConfig;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Description: des
|
||||
|
@ -34,10 +37,33 @@ public class HeroFiveStarGetEventHandler implements IEventHandler {
|
|||
|
||||
User user = UserManager.getUser(((HeroFiveStarGetEvent) event).getUid());
|
||||
RechargeInfo rechargeInfo = user.getPlayerInfoManager().getRechargeInfo();
|
||||
rechargeInfo.addTypeBagMap(5,System.currentTimeMillis());
|
||||
long now = System.currentTimeMillis();
|
||||
|
||||
Map<Integer, Long> typeBagMap = rechargeInfo.getTypeBagMap();
|
||||
|
||||
int goodsId =SRechargeCommodityConfig.getRecharegeHeroTime().getOrDefault(((HeroFiveStarGetEvent) event).getStar(),0);
|
||||
if(goodsId!=0){
|
||||
if(typeBagMap.containsKey(((HeroFiveStarGetEvent) event).getStar())){
|
||||
long lasttime = rechargeInfo.getTypeBagMap().get(((HeroFiveStarGetEvent) event).getStar());
|
||||
|
||||
long diffHourTemp =(now - lasttime) / 60 ;
|
||||
if (diffHourTemp < 1000) {
|
||||
rechargeInfo.addDyGoodsCanBuyTimes(goodsId);
|
||||
}else {
|
||||
rechargeInfo.putDyGoodsCanBuyTimes(goodsId,1);
|
||||
}
|
||||
}else {
|
||||
rechargeInfo.putDyGoodsCanBuyTimes(goodsId,1);
|
||||
}
|
||||
}else {
|
||||
throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
||||
}
|
||||
|
||||
rechargeInfo.addTypeBagMap(((HeroFiveStarGetEvent) event).getStar(),System.currentTimeMillis());
|
||||
|
||||
List<CommonProto.GiftGoodsInfo> goodsBagInfo = new ArrayList<>(SRechargeCommodityConfig.rechargeCommodityConfigMap.size());
|
||||
BuyGoodsLogic.getGoodsBagInfo(user.getId(), goodsBagInfo,false);
|
||||
System.out.print(goodsBagInfo.toString());
|
||||
ISession session = OnlineUserManager.getSessionByUid(user.getId());
|
||||
if(session!=null){
|
||||
if(null!= HandlerLogicThread.current()){
|
||||
|
|
|
@ -361,8 +361,9 @@ public class ChampionshipLogic {
|
|||
if(user.getArenaManager().getTopMaxRank()==0 || user.getArenaManager().getTopMaxRank()>rank){
|
||||
user.getArenaManager().setTopMaxRank(rank);
|
||||
}
|
||||
rank++;
|
||||
String title = SErrorCodeEerverConfig.getI18NMessage("champion_reward_title");
|
||||
String content = SErrorCodeEerverConfig.getI18NMessage("champion_reward_txt",new Object[]{rank++});
|
||||
String content = SErrorCodeEerverConfig.getI18NMessage("champion_reward_txt",new Object[]{sChampionshipReward.getTitleDesc()});
|
||||
MailLogic.getInstance().sendMail(user.getId(),title,content,ItemUtil.getMailReward(sChampionshipReward.getSeasonReward()),nowTime, Global.MAIL_EFFECTIVE_TIME);
|
||||
}
|
||||
MongoUtil.getLjsdMongoTemplate().lastUpdate();
|
||||
|
|
|
@ -29,11 +29,12 @@ public class RechargeInfo extends MongoBase{
|
|||
|
||||
//特殊类型控制触发开启的商品表 如五星妖灵师类型5
|
||||
private Map<Integer,Long> typeBagMap = new HashMap<>();
|
||||
//动态商品可买数量
|
||||
private Map<Integer,Integer> dyGoodsCanBuyTimes = new HashMap<>();
|
||||
|
||||
@Transient
|
||||
private Map<Integer,Long> cacheSendedTypes = new HashMap<>();
|
||||
|
||||
|
||||
public RechargeInfo(){
|
||||
|
||||
}
|
||||
|
@ -201,4 +202,27 @@ public class RechargeInfo extends MongoBase{
|
|||
public void setCacheSendedTypes(Map<Integer, Long> cacheSendedTypes) {
|
||||
this.cacheSendedTypes = cacheSendedTypes;
|
||||
}
|
||||
|
||||
|
||||
public Map<Integer, Integer> getDyGoodsCanBuyTimes() {
|
||||
return dyGoodsCanBuyTimes;
|
||||
}
|
||||
|
||||
public void addDyGoodsCanBuyTimes(Integer type) {
|
||||
this.dyGoodsCanBuyTimes.put(type,this.dyGoodsCanBuyTimes.get(type)+1 );
|
||||
updateString("dyGoodsCanBuyTimes",dyGoodsCanBuyTimes);
|
||||
}
|
||||
|
||||
public void putDyGoodsCanBuyTimes(Integer type,Integer value) {
|
||||
this.dyGoodsCanBuyTimes.put(type,value );
|
||||
updateString("dyGoodsCanBuyTimes",dyGoodsCanBuyTimes);
|
||||
}
|
||||
public void removeDyGoodsCanBuyTimes(Integer type) {
|
||||
this.dyGoodsCanBuyTimes.remove(type);
|
||||
updateString("dyGoodsCanBuyTimes",dyGoodsCanBuyTimes);
|
||||
}
|
||||
public void setDyGoodsCanBuyTimes(Map<Integer, Integer> dyGoodsCanBuyTimes) {
|
||||
updateString("dyGoodsCanBuyTimes",dyGoodsCanBuyTimes);
|
||||
this.dyGoodsCanBuyTimes = dyGoodsCanBuyTimes;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -798,6 +798,11 @@ public class HeroLogic{
|
|||
// recyleHeroBySystem(user,removeHeroIds);
|
||||
targetHero.upStar( 1 );
|
||||
Poster.getPoster().dispatchEvent(new HeroUpStarEvent(user.getId(),targetHero.getStar()));
|
||||
if(targetHero.getStar()>=5&&targetHero.getStar()!=15){
|
||||
if(SItem.getsItemMap().get(scHero.getId()).getQuantity()>=5)
|
||||
Poster.getPoster().dispatchEvent(new HeroFiveStarGetEvent(user.getId(),targetHero.getStar()));
|
||||
}
|
||||
|
||||
// if(targetHero.getStar()==5){
|
||||
// Poster.getPoster().dispatchEvent(new HeroFiveStarGetEvent(user.getId()));
|
||||
// }
|
||||
|
@ -1890,10 +1895,10 @@ public class HeroLogic{
|
|||
MessageUtil.sendMessage(session,1,MessageTypeProto.MessageType.POKEMON_ADVANCED_RESPONSE_VALUE,null,true);
|
||||
String message=null;
|
||||
if(pokemon.getAllStage()==1){
|
||||
message = SErrorCodeEerverConfig.getI18NMessage("lamp_activate_differ_content", new Object[]{user.getPlayerInfoManager().getNickName(),sDifferDemonsConfig.getName() });
|
||||
message = SErrorCodeEerverConfig.getI18NMessage("lamp_activate_differ_content_"+sDifferDemonsConfig.getQuality(), new Object[]{user.getPlayerInfoManager().getNickName(),sDifferDemonsConfig.getName() });
|
||||
|
||||
}else if(pokemon.getAllStage()>=SSpecialConfig.getIntegerValue(SSpecialConfig.lamp_rankup_differ_content_parm)){
|
||||
message = SErrorCodeEerverConfig.getI18NMessage("lamp_rankup_differ_content", new Object[]{user.getPlayerInfoManager().getNickName(), sDifferDemonsConfig.getName(),pokemon.getAllStage()});
|
||||
message = SErrorCodeEerverConfig.getI18NMessage("lamp_rankup_differ_content_"+sDifferDemonsConfig.getQuality(), new Object[]{user.getPlayerInfoManager().getNickName(), sDifferDemonsConfig.getName(),pokemon.getAllStage()});
|
||||
}
|
||||
if(message!=null){
|
||||
ChatLogic.getInstance().sendSysChatMessage(message,Global.DILIGENT,sDifferDemonsConfig.getId(),0,0,0,0,0);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.ljsd.jieling.logic.item;
|
||||
|
||||
import com.ljsd.GameLogicService;
|
||||
import com.ljsd.common.mogodb.util.BlockingUniqueQueue;
|
||||
import com.ljsd.jieling.db.mongo.MongoUtil;
|
||||
|
||||
|
@ -11,7 +12,9 @@ public class ItemLogUtil {
|
|||
public static BlockingQueue<ItemLog> logQueue = new BlockingUniqueQueue<>();
|
||||
|
||||
public static void addLogQueue(ItemLog itemLog) {
|
||||
logQueue.offer(itemLog);
|
||||
if(!GameLogicService.isServiceShutdown()){
|
||||
logQueue.offer(itemLog);
|
||||
}
|
||||
}
|
||||
public static void record () {
|
||||
List<ItemLog> sendDataList = new ArrayList<>(10);
|
||||
|
|
|
@ -114,7 +114,7 @@ public class BuyGoodsLogic {
|
|||
Map<Integer, Integer> goodsDurationMap = rechargeInfo.getGoodsDurationMap();
|
||||
boolean needSendMail = false;
|
||||
for(Map.Entry<Integer,Integer> goodsDurationItem : goodsDurationMap.entrySet()){
|
||||
if(sRechargeCommodityConfig.getType() == type){
|
||||
if( SRechargeCommodityConfig.rechargeCommodityConfigMap.get(goodsDurationItem.getKey()).getType() == type){
|
||||
endTime = goodsDurationItem.getValue();
|
||||
}
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ public class BuyGoodsLogic {
|
|||
needSendMail = true;
|
||||
}
|
||||
|
||||
if(nowTime<endTime-STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting().getNextAvailableTime()*3600){
|
||||
if( (type == GiftGoodsType.MONTHCARD || type == GiftGoodsType.LUXURYMONTHCARD ) && nowTime<endTime-STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting().getNextAvailableTime()*3600){
|
||||
resultRes.setResultCode(0);
|
||||
resultRes.setResultMsg("不可以过早购买");
|
||||
return resultRes;
|
||||
|
@ -228,12 +228,18 @@ public class BuyGoodsLogic {
|
|||
int[] discountType = sRechargeCommodityConfig.getDiscountType();
|
||||
int temptype = discountType[0];
|
||||
int tempvalue = discountType[1];
|
||||
if(temptype == 4&&tempvalue==5){
|
||||
if (rechargeInfo.getTypeBagMap().containsKey(tempvalue)){
|
||||
rechargeInfo.removeTypeBagMap(tempvalue);
|
||||
}
|
||||
if (rechargeInfo.getCacheSendedTypes().containsKey(tempvalue)){
|
||||
rechargeInfo.getCacheSendedTypes().remove(tempvalue);
|
||||
if(temptype == 4){
|
||||
|
||||
int dytime = rechargeInfo.getDyGoodsCanBuyTimes().getOrDefault(goodsId,0)-1;
|
||||
if(dytime <=0){
|
||||
if (rechargeInfo.getTypeBagMap().containsKey(tempvalue)){
|
||||
rechargeInfo.removeTypeBagMap(tempvalue);
|
||||
}
|
||||
if (rechargeInfo.getCacheSendedTypes().containsKey(tempvalue)){
|
||||
rechargeInfo.getCacheSendedTypes().remove(tempvalue);
|
||||
}
|
||||
}else {
|
||||
rechargeInfo.putDyGoodsCanBuyTimes(goodsId,dytime);
|
||||
}
|
||||
|
||||
List<CommonProto.GiftGoodsInfo> goodsBagInfo = new ArrayList<>(SRechargeCommodityConfig.rechargeCommodityConfigMap.size());
|
||||
|
@ -362,6 +368,7 @@ public class BuyGoodsLogic {
|
|||
int time = sRechargeCommodityConfig.getTime();
|
||||
long startTime=0;
|
||||
long endTime=0;
|
||||
int dybuytime = 0;
|
||||
if(time == 4){
|
||||
int type = discountType[0];
|
||||
int value = discountType[1];
|
||||
|
@ -383,19 +390,20 @@ public class BuyGoodsLogic {
|
|||
}
|
||||
startTime = typeBagMap.get(value);
|
||||
|
||||
int addtime = discountType[2];
|
||||
int diffHour = (int) ((now - startTime) / 3600 / 1000);
|
||||
int addtime = 1000;
|
||||
int diffHour = (int) ((now - startTime) / 60 );
|
||||
if (diffHour >= addtime) {
|
||||
rechargeInfo.removeDyGoodsCanBuyTimes(goodsId);
|
||||
continue;
|
||||
}
|
||||
endTime = startTime + addtime * 3600 * 1000;
|
||||
endTime = startTime + addtime * 60;
|
||||
|
||||
if (rechargeInfo.getCacheSendedTypes().containsKey(value)) {
|
||||
long lasttime = rechargeInfo.getCacheSendedTypes().get(value);
|
||||
if(lasttime != startTime){
|
||||
needChange = true;
|
||||
rechargeInfo.getCacheSendedTypes().put(value, startTime);
|
||||
int diffHourTemp = (int) ((now - lasttime) / 3600 / 1000);
|
||||
int diffHourTemp = (int) ((now - lasttime) / 60 );
|
||||
if (diffHourTemp < addtime) {
|
||||
startTime =0;
|
||||
}
|
||||
|
@ -403,7 +411,7 @@ public class BuyGoodsLogic {
|
|||
}else {
|
||||
rechargeInfo.getCacheSendedTypes().put(value, startTime);
|
||||
}
|
||||
|
||||
dybuytime = rechargeInfo.getDyGoodsCanBuyTimes().getOrDefault(goodsId,0);
|
||||
}
|
||||
|
||||
}else{
|
||||
|
@ -440,7 +448,12 @@ public class BuyGoodsLogic {
|
|||
if(isNew){
|
||||
needChange = true;
|
||||
}
|
||||
giftGoodsInfoList.add(CommonProto.GiftGoodsInfo.newBuilder().setGoodsId(goodsId).setBuyTimes(buyTimes).setStartTime((int)(startTime/1000)).setEndTime((int)(endTime/1000)).build());
|
||||
CommonProto.GiftGoodsInfo.Builder builder = CommonProto.GiftGoodsInfo.newBuilder();
|
||||
builder.setGoodsId(goodsId).setStartTime((int)(startTime/1000)).setBuyTimes(buyTimes).setEndTime((int)(endTime/1000));
|
||||
if(dybuytime!=-1){
|
||||
builder.setDynamicBuyTimes(dybuytime);
|
||||
}
|
||||
giftGoodsInfoList.add(builder.build());
|
||||
}
|
||||
giftGoodsInfoList.addAll(giftGoodsInfoMap.values());
|
||||
return needChange;
|
||||
|
|
|
@ -17,6 +17,8 @@ import com.ljsd.jieling.ktbeans.sendbeans.KTAppOnline;
|
|||
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.event.MinuteTaskEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.arena.ArenaLogic;
|
||||
import com.ljsd.jieling.logic.championship.ChampionshipLogic;
|
||||
import com.ljsd.jieling.logic.family.GuildFightLogic;
|
||||
|
@ -47,8 +49,9 @@ public class MinuteTask extends Thread {
|
|||
try {
|
||||
LOGGER.info("MinuteTask start...");
|
||||
LOGGER.info("online use num::"+ OnlineUserManager.sessionMap.entrySet().size());
|
||||
HotfixUtil.getInstance().doWork("../conf/hotfix.json");
|
||||
ActivityLogic.getInstance().checkActiviyStatus();
|
||||
//TODO 每分钟逻辑通过监听事件处理 已经迁移活动和热更新
|
||||
Poster.getPoster().dispatchEvent(new MinuteTaskEvent());
|
||||
|
||||
MessageUtil.checkAndSendMsg();
|
||||
STableManager.updateTablesWithTableNames(true);
|
||||
ActivityLogic.getInstance().checkSecretBoxSeason();
|
||||
|
|
|
@ -1205,8 +1205,9 @@ public class ItemUtil {
|
|||
}
|
||||
}
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.GET_HERO,heroStar[0],heroStar[1]);
|
||||
if(scHero.getStar()==5){
|
||||
Poster.getPoster().dispatchEvent(new HeroFiveStarGetEvent(user.getId()));
|
||||
if(scHero.getStar()>=5){
|
||||
if(SItem.getsItemMap().get(scHero.getId()).getQuantity()>=5)
|
||||
Poster.getPoster().dispatchEvent(new HeroFiveStarGetEvent(user.getId(),scHero.getStar()));
|
||||
}
|
||||
KtEventUtils.onKtEvent(user, ParamEventBean.UserItemEvent,reason,GlobalsDef.addReason,cardId,1,heroStar[1]);
|
||||
}
|
||||
|
|
|
@ -16,6 +16,8 @@ public class SChampionshipReward implements BaseConfig {
|
|||
|
||||
private int[][] seasonReward;
|
||||
|
||||
private String titleDesc;
|
||||
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
@ -39,5 +41,7 @@ public class SChampionshipReward implements BaseConfig {
|
|||
return seasonReward;
|
||||
}
|
||||
|
||||
|
||||
public String getTitleDesc() {
|
||||
return titleDesc;
|
||||
}
|
||||
}
|
|
@ -17,6 +17,8 @@ public class SDifferDemonsConfig implements BaseConfig {
|
|||
|
||||
private String name;
|
||||
|
||||
private int quality;
|
||||
|
||||
public static Map<Integer,SDifferDemonsConfig> sDifferDemonsConfigMap;
|
||||
|
||||
public static Map<Integer,SDifferDemonsConfig> sDifferDemonsConfigMapByComId;
|
||||
|
@ -56,4 +58,8 @@ public class SDifferDemonsConfig implements BaseConfig {
|
|||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public int getQuality() {
|
||||
return quality;
|
||||
}
|
||||
}
|
|
@ -5,10 +5,7 @@ import manager.Table;
|
|||
import util.TimeUtils;
|
||||
import util.StringUtil;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
@Table(name ="RechargeCommodityConfig")
|
||||
public class SRechargeCommodityConfig implements BaseConfig {
|
||||
|
@ -59,21 +56,24 @@ public class SRechargeCommodityConfig implements BaseConfig {
|
|||
public static Map<Integer, SRechargeCommodityConfig> rechargeCommodityConfigMap;
|
||||
public static Map<Integer, SRechargeCommodityConfig> rechargeLevelMap;
|
||||
private static Set<Integer> rchargeHeroGet;
|
||||
|
||||
private static Map<Integer,Integer> recharegeHeroTime;
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
Map<Integer, SRechargeCommodityConfig> config = STableManager.getConfig(SRechargeCommodityConfig.class);
|
||||
Map<Integer, SRechargeCommodityConfig> rechargeLevelMapTmp = new HashMap<>();
|
||||
Set<Integer> rchargeHeroGetTemp = new HashSet<>();
|
||||
|
||||
Map<Integer, Integer> recharegeHeroTimeTmp = new HashMap<>();
|
||||
for(SRechargeCommodityConfig sRechargeCommodityConfig : config.values()){
|
||||
int[] discountType = sRechargeCommodityConfig.getDiscountType();
|
||||
if(discountType!=null && discountType.length>0 &&discountType[0] == 2){
|
||||
int level = discountType[1];
|
||||
rechargeLevelMapTmp.put(level,sRechargeCommodityConfig);
|
||||
}
|
||||
if(discountType!=null && discountType.length>0 &&discountType[0] == 4){
|
||||
if(discountType!=null && discountType.length>0 &&discountType[0] == 4&&sRechargeCommodityConfig.getTime()==4&&sRechargeCommodityConfig.getDiscountType().length==3){
|
||||
rchargeHeroGetTemp.add(sRechargeCommodityConfig.getId());
|
||||
recharegeHeroTimeTmp.put(discountType[1],sRechargeCommodityConfig.getId());
|
||||
}
|
||||
|
||||
int time = sRechargeCommodityConfig.getTime();
|
||||
|
@ -99,6 +99,7 @@ public class SRechargeCommodityConfig implements BaseConfig {
|
|||
rechargeCommodityConfigMap = config;
|
||||
rechargeLevelMap = rechargeLevelMapTmp;
|
||||
rchargeHeroGet = rchargeHeroGetTemp;
|
||||
recharegeHeroTime = recharegeHeroTimeTmp;
|
||||
|
||||
}
|
||||
|
||||
|
@ -202,4 +203,12 @@ public class SRechargeCommodityConfig implements BaseConfig {
|
|||
public static Set<Integer> getRchargeHeroGet() {
|
||||
return rchargeHeroGet;
|
||||
}
|
||||
|
||||
public static Map<Integer, Integer> getRecharegeHeroTime() {
|
||||
return recharegeHeroTime;
|
||||
}
|
||||
|
||||
public static void setRecharegeHeroTime(Map<Integer, Integer> recharegeHeroTime) {
|
||||
SRechargeCommodityConfig.recharegeHeroTime = recharegeHeroTime;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue