Merge branch 'master' of 60.1.1.230:backend/jieling_server
commit
dfb50edaa0
|
@ -43,7 +43,7 @@ public class CheckFight {
|
|||
public void luaHotFix(){
|
||||
LuaHotFixBean luaHotFixBean = STableManager.getJsonFilePathInJsonConf("lua-hotfix.json", LuaHotFixBean.class);
|
||||
if(luaHotFixBean!=null && hotFixVersion < luaHotFixBean.getVersion()){
|
||||
LOGGER.info("the curhotFixVersion={},the new hotFixVersion={} will hotifx ",hotFixVersion,luaHotFixBean.getVersion());
|
||||
LOGGER.info("the curhotFixVersion={},the new hotFixVersion={} will hotfix ",hotFixVersion,luaHotFixBean.getVersion());
|
||||
init();
|
||||
LOGGER.info("the luahotfix done");
|
||||
hotFixVersion = luaHotFixBean.getVersion();
|
||||
|
|
|
@ -138,9 +138,8 @@ public class TimeUtils {
|
|||
public static final String Stand_CeHua_Data_format = "yyyyMMdd HHmmss";
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(Integer.MAX_VALUE);
|
||||
System.out.println((Integer.MAX_VALUE-now()/1000)/Math.pow(10,9));
|
||||
|
||||
// long lastHour = getLastHour(5);
|
||||
// System.out.println(lastHour);
|
||||
}
|
||||
/**
|
||||
* 判断是否合法的时间格式(HH:mm:ss)
|
||||
|
@ -1319,6 +1318,27 @@ public class TimeUtils {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*获取传入时间的上个几时
|
||||
* @param hour
|
||||
* @return
|
||||
*/
|
||||
public static long getLastHour(long time,int hour){
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTimeInMillis(time);
|
||||
int i = cal.get(Calendar.HOUR_OF_DAY);
|
||||
cal.set(Calendar.HOUR_OF_DAY,hour);
|
||||
cal.set(Calendar.MINUTE,0);
|
||||
cal.set(Calendar.SECOND,0);
|
||||
cal.set(Calendar.MILLISECOND,0);
|
||||
long result = cal.getTimeInMillis();
|
||||
if(i<5){
|
||||
result = result -TimeUtils.DAY;
|
||||
}
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回Integer最大值-now()之后变成小于一的小数;
|
||||
* @return
|
||||
|
|
|
@ -133,6 +133,8 @@ public class RedisKey {
|
|||
|
||||
public static final String GUILD_BOSS_RANK = "GUILD_BOSS_RANK";
|
||||
|
||||
public static final String GUILD_RED_PACKAGE_RANK = "GUILD_RED_PACKAGE_RANK";
|
||||
|
||||
public static final String FAMILY_ID = "FAMILY_ID";
|
||||
|
||||
public static final String FAMILY_JOIN = "FAMILY_JOIN";
|
||||
|
|
|
@ -144,6 +144,7 @@ public enum ErrorCode implements IErrorCode {
|
|||
NAME_LENGTH_ERROR(110,"公会名长度不符"),
|
||||
EXIST_NAME(111,"此名已存在"),
|
||||
ANNOUNCE_SIZE(112,"公会宣言长度不符"),
|
||||
ALREADY_LIKE(113,"今天已经给他点过赞了"),
|
||||
|
||||
|
||||
;
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
package com.ljsd.jieling.handler.family;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.family.GuildLogic;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author lvxinran
|
||||
* @date 2020/1/9
|
||||
* @discribe
|
||||
*/
|
||||
@Component
|
||||
public class GetTodayLikeHandler extends BaseHandler {
|
||||
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.J_GET_ALL_SEND_LIKE_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
||||
GuildLogic.getAllTodayLike(iSession, MessageTypeProto.MessageType.J_GET_ALL_SEND_LIKE_RESPONSE);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package com.ljsd.jieling.handler.family;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.family.GuildLogic;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.Family;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author lvxinran
|
||||
* @date 2020/1/9
|
||||
* @discribe
|
||||
*/
|
||||
|
||||
@Component
|
||||
public class RedPackageRankSendLikeHandler extends BaseHandler<Family.RedPackageLikeRequest> {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.J_REDPACKAGE_SEND_LIKE_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processWithProto(ISession iSession, Family.RedPackageLikeRequest proto) throws Exception {
|
||||
GuildLogic.redPackageSendLike(iSession,proto.getUid(), MessageTypeProto.MessageType.J_REDPACKAGE_SEND_LIKE_RESPONSE);
|
||||
}
|
||||
}
|
|
@ -2,6 +2,7 @@ package com.ljsd.jieling.logic.dao;
|
|||
|
||||
import com.ljsd.common.mogodb.MongoBase;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
@ -19,6 +20,10 @@ public class FriendManager extends MongoBase {
|
|||
//key: friendId value 状态 0: 不可领取 1:可以领取 2: 已领取
|
||||
private Map<Integer,Integer> haveRewardMap = new ConcurrentHashMap<>();
|
||||
|
||||
private int beLikedCount;
|
||||
|
||||
private List<Integer> todayLike = new ArrayList<>();
|
||||
|
||||
public void delFriends(Integer friendId) {
|
||||
this.friends.remove(friendId);
|
||||
setFriends(this.friends);
|
||||
|
@ -125,4 +130,31 @@ public class FriendManager extends MongoBase {
|
|||
this.myApplyFriends.add(friendId);
|
||||
setMyApplyFriends(this.myApplyFriends);
|
||||
}
|
||||
|
||||
public int getBeLikedCount() {
|
||||
return beLikedCount;
|
||||
}
|
||||
|
||||
public void addBeLikedCount(int count){
|
||||
setBeLikedCount(getBeLikedCount()+count);
|
||||
}
|
||||
public void setBeLikedCount(int beLikedCount) {
|
||||
this.beLikedCount = beLikedCount;
|
||||
updateString("beLikedCount", beLikedCount);
|
||||
}
|
||||
|
||||
public List<Integer> getTodayLike() {
|
||||
return todayLike;
|
||||
}
|
||||
|
||||
public void setTodayLike(List<Integer> todayLike) {
|
||||
this.todayLike = todayLike;
|
||||
updateString("todayLike", todayLike);
|
||||
}
|
||||
public void addTodayLike(int uid){
|
||||
this.todayLike.add(uid);
|
||||
updateString("todayLike", todayLike);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -350,6 +350,7 @@ public class PlayerManager extends MongoBase {
|
|||
maxTime = (int)(TimeUtils.now()/1000+config.getContinueTime());
|
||||
}
|
||||
}
|
||||
maxTime = (int)(TimeUtils.getLastHour(maxTime*1000,5)/1000);
|
||||
vipInfo.put(privilageId,new VipInfo(0,maxTime));
|
||||
updateString("vipInfo", vipInfo);
|
||||
}
|
||||
|
|
|
@ -19,16 +19,17 @@ import com.ljsd.jieling.logic.dao.root.*;
|
|||
import com.ljsd.jieling.logic.mail.MailLogic;
|
||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||
import com.ljsd.jieling.logic.rank.RankContext;
|
||||
import com.ljsd.jieling.logic.rank.RankEnum;
|
||||
import com.ljsd.jieling.logic.rank.RankLogic;
|
||||
import com.ljsd.jieling.logic.rank.rankImpl.AbstractRank;
|
||||
import com.ljsd.jieling.network.server.ProtocolsManager;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.CommonProto;
|
||||
import com.ljsd.jieling.protocols.Family;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.util.*;
|
||||
import config.SErrorCodeEerverConfig;
|
||||
import config.SGuildLevelConfig;
|
||||
import config.SGuildRedPackConfig;
|
||||
import config.SGuildSetting;
|
||||
import config.*;
|
||||
import manager.STableManager;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -993,17 +994,27 @@ public class GuildLogic {
|
|||
if(config==null){
|
||||
return;
|
||||
}
|
||||
long[] generate = HongBaoAlgorithm.generate(config.getTotalMoney()[1], config.getNum(), config.getMaxPercent(), config.getMinPercent());
|
||||
int maxCount = config.getTotalMoney()[1];
|
||||
long[] generate = HongBaoAlgorithm.generate(maxCount, config.getNum(), maxCount*config.getMaxPercent()/10000, maxCount*config.getMinPercent()/10000);
|
||||
if(generate==null){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
long increment = RedisUtil.getInstence().increment(RedisKey.getKey(RedisKey.FAMILY_RED_PACKAGE_INCRE_ID, "", false));
|
||||
RedisUtil.getInstence().putMapEntry(RedisKey.FAMILY_RED_PACKAGE,String.valueOf(user.getPlayerInfoManager().getGuildId()),String.valueOf(increment),new RedPackage(redId,uid));
|
||||
RedisUtil.getInstence().putMapEntry(RedisKey.FAMILY_RED_PACKAGE,String.valueOf(user.getPlayerInfoManager().getGuildId()),String.valueOf(increment),new RedPackage(redId,uid,(int)(TimeUtils.now()/1000),config.getLastTime()));
|
||||
List<String> reward = new ArrayList<>();
|
||||
for(Long count:generate){
|
||||
reward.add(String.valueOf(count));
|
||||
}
|
||||
RedisUtil.getInstence().lSet(RedisKey.getKey("red_remain_list",String.valueOf(increment),false),reward,200000);
|
||||
AbstractRank rank = RankContext.getRankEnum(RankEnum.GUILD_RED_PACKAGE_RANK.getType());
|
||||
double scoreById = rank.getScoreById(uid, String.valueOf(user.getPlayerInfoManager().getGuildId()));
|
||||
double price = SRechargeCommodityConfig.rechargeCommodityConfigMap.get(config.getTradeId()).getPrice();
|
||||
if(scoreById==-1||scoreById==0){
|
||||
price+=TimeUtils.getDoubleTime();
|
||||
}else{
|
||||
price+=scoreById;
|
||||
}
|
||||
rank.addRank(uid,String.valueOf(user.getPlayerInfoManager().getGuildId()),price);
|
||||
RedisUtil.getInstence().lSet(RedisKey.getKey("red_remain_list",String.valueOf(increment),false),reward,config.getLastTime());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1016,7 +1027,12 @@ public class GuildLogic {
|
|||
int guildId = user.getPlayerInfoManager().getGuildId();
|
||||
Map<String, RedPackage> redPackageMap = RedisUtil.getInstence().getMapValues(RedisKey.FAMILY_RED_PACKAGE, String.valueOf(guildId), String.class, RedPackage.class);
|
||||
Family.GetAllRedPackageResponse.Builder builder = Family.GetAllRedPackageResponse.newBuilder();
|
||||
List<String> removeId = new ArrayList<>();
|
||||
for(Map.Entry<String, RedPackage> entry:redPackageMap.entrySet()){
|
||||
if(TimeUtils.now()/1000>entry.getValue().getEffectTime()+entry.getValue().getSendTime()){
|
||||
removeId.add(entry.getKey());
|
||||
continue;
|
||||
}
|
||||
CommonProto.RedPackage.Builder redPackage = CommonProto.RedPackage.newBuilder();
|
||||
redPackage.setGetCount(RedisUtil.getInstence().getMapValues("red_already_list", entry.getKey(),int.class,AcceptRedInfo.class).size());
|
||||
AcceptRedInfo already = RedisUtil.getInstence().getMapEntry("red_already_list", entry.getKey(), String.valueOf(session.getUid()), AcceptRedInfo.class);
|
||||
|
@ -1026,6 +1042,10 @@ public class GuildLogic {
|
|||
redPackage.setRedType(entry.getValue().getTypeId());
|
||||
builder.addInfo(redPackage);
|
||||
}
|
||||
for(String id:removeId){
|
||||
RedisUtil.getInstence().removeMapEntrys(RedisKey.FAMILY_RED_PACKAGE, String.valueOf(guildId),id);
|
||||
}
|
||||
|
||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),builder.build(),true);
|
||||
}
|
||||
|
||||
|
@ -1072,7 +1092,42 @@ public class GuildLogic {
|
|||
PlayerManager playerInfoManager = UserManager.getUser(packInfo.getUid()).getPlayerInfoManager();
|
||||
builder.setSendName(playerInfoManager.getNickName())
|
||||
.setHead(playerInfoManager.getHead())
|
||||
.setHeadFrame(playerInfoManager.getHeadFrame());
|
||||
.setHeadFrame(playerInfoManager.getHeadFrame())
|
||||
.setRemainTime(packInfo.getSendTime()+packInfo.getEffectTime()-(int)(TimeUtils.now()/1000));
|
||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),builder.build(),true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 点赞!
|
||||
* @param session
|
||||
* @param targetUid
|
||||
* @param messageType
|
||||
*/
|
||||
public static void redPackageSendLike(ISession session, int targetUid, MessageTypeProto.MessageType messageType) throws Exception {
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
int guildId = user.getPlayerInfoManager().getGuildId();
|
||||
Double price = RedisUtil.getInstence().getZSetScore(RedisKey.GUILD_RED_PACKAGE_RANK, String.valueOf(guildId), String.valueOf(targetUid));
|
||||
if(price<=0){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
if(user.getFriendManager().getTodayLike().contains(targetUid)){
|
||||
throw new ErrorCodeException(ErrorCode.ALREADY_LIKE);
|
||||
}
|
||||
User targetUser = UserManager.getUser(targetUid);
|
||||
AyyncWorker ayyncWorker = new AyyncWorker(targetUser, true, n->targetUser.getFriendManager().addBeLikedCount(1));
|
||||
user.getFriendManager().addTodayLike(targetUid);
|
||||
ProtocolsManager.getInstance().updateAyncWorker(ayyncWorker);
|
||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),null,true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取今天给谁点过赞
|
||||
* @param session
|
||||
* @param messageType
|
||||
*/
|
||||
public static void getAllTodayLike(ISession session, MessageTypeProto.MessageType messageType) throws Exception {
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
Family.GetAllSendLikeResponse response = Family.GetAllSendLikeResponse.newBuilder().addAllUid(user.getFriendManager().getTodayLike()).build();
|
||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),response,true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,10 @@ public class RedPackage {
|
|||
|
||||
private int uid;
|
||||
|
||||
private int sendTime;
|
||||
|
||||
private int effectTime;
|
||||
|
||||
|
||||
|
||||
public int getTypeId() {
|
||||
|
@ -29,9 +33,27 @@ public class RedPackage {
|
|||
this.uid = uid;
|
||||
}
|
||||
|
||||
public RedPackage(int typeId, int uid) {
|
||||
public int getSendTime() {
|
||||
return sendTime;
|
||||
}
|
||||
|
||||
public void setSendTime(int sendTime) {
|
||||
this.sendTime = sendTime;
|
||||
}
|
||||
|
||||
public int getEffectTime() {
|
||||
return effectTime;
|
||||
}
|
||||
|
||||
public void setEffectTime(int effectTime) {
|
||||
this.effectTime = effectTime;
|
||||
}
|
||||
|
||||
public RedPackage(int typeId, int uid, int sendTime, int effectTime) {
|
||||
this.typeId = typeId;
|
||||
this.uid = uid;
|
||||
this.sendTime = sendTime;
|
||||
this.effectTime = effectTime;
|
||||
}
|
||||
|
||||
public RedPackage() {
|
||||
|
|
|
@ -673,7 +673,7 @@ public class FriendLogic {
|
|||
}
|
||||
|
||||
/**
|
||||
* 刷新赠送体力状态
|
||||
* 刷新赠送体力状态和点赞状态
|
||||
* @param iSession
|
||||
* @throws Exception
|
||||
*/
|
||||
|
@ -693,5 +693,6 @@ public class FriendLogic {
|
|||
}
|
||||
friendManager.updateGiveMap(friendId,0);
|
||||
}
|
||||
friendManager.setTodayLike(new ArrayList<>());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,10 +13,10 @@ public interface IRank {
|
|||
|
||||
void addRank(int uid,String rkey,double... data);
|
||||
|
||||
int getParam1(double data);
|
||||
int getParam1(Double data);
|
||||
|
||||
int getParam2(double data);
|
||||
int getParam2(Double data);
|
||||
|
||||
int getParam3(double data);
|
||||
int getParam3(Double data);
|
||||
|
||||
}
|
||||
|
|
|
@ -21,6 +21,8 @@ public enum RankEnum {
|
|||
RANDOM_CARD_RANK(10,RedisKey.RANDOM_CARD_RANK, RandomCardRank::new),//param1:抽取积分 param2:无 param3:无
|
||||
RANDOM_CARD_PERFECT_RANK(11,RedisKey.RANDOM_CARD_PERFECT_RANK,RandomCardPerfectRank::new),//param1:时间 param2:英雄tempId param3:uid
|
||||
GUILD_BOSS_RANK(12,RedisKey.GUILD_BOSS_RANK,GuildBossRank::new),//param1:时间 param2:英雄tempId param3:uid
|
||||
GUILD_RED_PACKAGE_RANK(13,RedisKey.GUILD_RED_PACKAGE_RANK,GuildRedPackageRank::new),//param1:红包总价格 param2:无 param3:无
|
||||
|
||||
;
|
||||
private int type;
|
||||
private String redisKey;
|
||||
|
|
|
@ -123,7 +123,7 @@ public abstract class AbstractRank implements IRank {
|
|||
* @param score
|
||||
* @return
|
||||
*/
|
||||
public abstract int[] getDataByScore(double score);
|
||||
public abstract int[] getDataByScore(Double score);
|
||||
|
||||
/**
|
||||
* 子类需重写此方法来获得向Redis里添加的数据,根据需要的参数进行组合
|
||||
|
@ -149,18 +149,18 @@ public abstract class AbstractRank implements IRank {
|
|||
}
|
||||
}
|
||||
@Override
|
||||
public int getParam1(double data) {
|
||||
public int getParam1(Double data) {
|
||||
|
||||
return getDataByScore(data).length>0?getDataByScore(data)[0]:0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getParam2(double data) {
|
||||
public int getParam2(Double data) {
|
||||
return getDataByScore(data).length>1?getDataByScore(data)[1]:0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getParam3(double data) {
|
||||
public int getParam3(Double data) {
|
||||
return getDataByScore(data).length>2?getDataByScore(data)[2]:0;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,8 +13,8 @@ public class ForceRank extends AbstractRank {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int[] getDataByScore(double score) {
|
||||
return new int[]{Double.valueOf(score).intValue()};
|
||||
public int[] getDataByScore(Double score) {
|
||||
return new int[]{score.intValue()};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -10,8 +10,8 @@ public class GuildBossRank extends AbstractRank{
|
|||
}
|
||||
|
||||
@Override
|
||||
public int[] getDataByScore(double score) {
|
||||
return new int[]{(int)score};
|
||||
public int[] getDataByScore(Double score) {
|
||||
return new int[]{score.intValue()};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
package com.ljsd.jieling.logic.rank.rankImpl;
|
||||
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.protocols.PlayerInfoProto;
|
||||
|
||||
/**
|
||||
* @author lvxinran
|
||||
* @date 2020/1/9
|
||||
* @discribe
|
||||
*/
|
||||
public class GuildRedPackageRank extends AbstractRank {
|
||||
|
||||
|
||||
@Override
|
||||
public PlayerInfoProto.RankResponse getRank(int uid, String rkey, int page, int rankEndLine) throws Exception {
|
||||
rkey = String.valueOf(UserManager.getUser(uid).getPlayerInfoManager().getGuildId());
|
||||
return super.getRank(uid, rkey, page, rankEndLine);
|
||||
}
|
||||
|
||||
public GuildRedPackageRank(int type, String redisKey) {
|
||||
super(type, redisKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDataByScore(Double score) {
|
||||
return new int[]{score.intValue()};
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getScore(double... data) {
|
||||
return data[0];
|
||||
}
|
||||
}
|
|
@ -21,8 +21,8 @@ public class MainLevelRank extends AbstractRank {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int[] getDataByScore(double score) {
|
||||
int i = Double.valueOf(score).intValue();
|
||||
public int[] getDataByScore(Double score) {
|
||||
int i = score.intValue();
|
||||
return new int[]{i%10_000_000};
|
||||
}
|
||||
|
||||
|
|
|
@ -13,8 +13,8 @@ public class MonsterAttackRank extends AbstractRank{
|
|||
}
|
||||
|
||||
@Override
|
||||
public int[] getDataByScore(double score) {
|
||||
return new int[]{Double.valueOf(score).intValue()};
|
||||
public int[] getDataByScore(Double score) {
|
||||
return new int[]{score.intValue()};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -70,8 +70,8 @@ public class RandomCardPerfectRank extends AbstractRank {
|
|||
builder.addRanks(everyRank);
|
||||
}
|
||||
@Override
|
||||
public int[] getDataByScore(double score) {
|
||||
return new int[]{Double.valueOf(score).intValue()};
|
||||
public int[] getDataByScore(Double score) {
|
||||
return new int[]{score.intValue()};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -13,8 +13,8 @@ public class RandomCardRank extends AbstractRank {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int[] getDataByScore(double score) {
|
||||
return new int[]{Double.valueOf(score).intValue()};
|
||||
public int[] getDataByScore(Double score) {
|
||||
return new int[]{score.intValue()};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -21,9 +21,9 @@ public class TowerRank extends AbstractRank {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int[] getDataByScore(double score) {
|
||||
public int[] getDataByScore(Double score) {
|
||||
int[] array = new int [2];
|
||||
int scoreInt = Double.valueOf(score).intValue();
|
||||
int scoreInt = score.intValue();
|
||||
array[0] = scoreInt/3601;
|
||||
array[1] =3600-scoreInt%3601;
|
||||
return array;
|
||||
|
|
|
@ -21,6 +21,8 @@ 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.dao.GuilidManager;
|
||||
import com.ljsd.jieling.logic.dao.root.GuildInfo;
|
||||
import com.ljsd.jieling.logic.family.GuildFightLogic;
|
||||
import com.ljsd.jieling.logic.fight.CombatLogic;
|
||||
import com.ljsd.jieling.logic.mail.MailLogic;
|
||||
|
@ -34,6 +36,7 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Map;
|
||||
|
||||
public class MinuteTask extends Thread {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(MinuteTask.class);
|
||||
|
@ -118,6 +121,10 @@ public class MinuteTask extends Thread {
|
|||
if(hour == 5 && minute ==0){
|
||||
LOGGER.info("DailyOfFiveTask start ...");
|
||||
GlobalDataManaager.everTask(5);
|
||||
Map<Integer, GuildInfo> guildInfoMap = GuilidManager.guildInfoMap;
|
||||
for(int guild:guildInfoMap.keySet()){
|
||||
RedisUtil.getInstence().del(RedisKey.getKey(RedisKey.GUILD_RED_PACKAGE_RANK,String.valueOf(guild),false));
|
||||
}
|
||||
LOGGER.info("DailyOfFiveTask end ...");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue