社稷大典公会排行
parent
f1d7511218
commit
ecc95a79a4
|
@ -45,7 +45,7 @@ public class CoreLogic {
|
|||
sCdkInfosCacheMap = sCdkInfosMap;
|
||||
}
|
||||
}catch (Exception e){
|
||||
LOGGER.error("cdkErr:"+e.toString());
|
||||
LOGGER.error("Exception::cdkErr:"+e.toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.ljsd.common.mogodb.MongoUpdateCache;
|
|||
import com.ljsd.common.mogodb.MongoUpdateCacheThreadLocal;
|
||||
import com.ljsd.common.mogodb.MongoUpdateImp;
|
||||
import com.ljsd.jieling.db.mongo.core.ServerAreaInfoManager;
|
||||
import com.ljsd.jieling.logic.dao.ServerConfig;
|
||||
import com.ljsd.jieling.logic.dao.root.GlobalSystemControl;
|
||||
import com.mongodb.*;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -124,8 +125,8 @@ public class LjsdMongoTemplate implements MongoUpdateImp {
|
|||
|
||||
public <T> T findById(int id, Class<T> clazz) throws Exception {
|
||||
int serverIdByUid ;
|
||||
if(clazz.equals(GlobalSystemControl.class)){
|
||||
serverIdByUid = id;
|
||||
if(clazz.equals(GlobalSystemControl.class)||clazz.equals(ServerConfig.class)){
|
||||
serverIdByUid = GameApplication.serverId;
|
||||
}else {
|
||||
serverIdByUid = AreaManager.getInstance().getServerIdByUid(id, GameApplication.serverId);
|
||||
}
|
||||
|
|
|
@ -53,9 +53,12 @@ public class CommitShejiActivityItemRequestHandler extends BaseHandler<ActivityP
|
|||
if (guildId == 0) {
|
||||
throw new ErrorCodeException(ErrorCode.FAMILY_NO);
|
||||
}
|
||||
|
||||
SGodSacrificeSetting sGodSacrificeSetting = STableManager.getConfig(SGodSacrificeSetting.class).get(1);
|
||||
if(null==sGodSacrificeSetting){
|
||||
throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
||||
}
|
||||
int level = user.getPlayerInfoManager().getLevel();
|
||||
if (level<50) {
|
||||
if (level<sGodSacrificeSetting.getLevelLimit()) {
|
||||
throw new ErrorCodeException(ErrorCode.USER_LEVE_DOWN);
|
||||
}
|
||||
|
||||
|
@ -91,10 +94,7 @@ public class CommitShejiActivityItemRequestHandler extends BaseHandler<ActivityP
|
|||
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
||||
}
|
||||
|
||||
SGodSacrificeSetting sGodSacrificeSetting = STableManager.getConfig(SGodSacrificeSetting.class).get(1);
|
||||
if(null==sGodSacrificeSetting){
|
||||
throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
||||
}
|
||||
|
||||
int index = SGodSacrificeSetting.exchangeRate.getOrDefault(proto.getItemId(),-1);
|
||||
if(index == -1){
|
||||
throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
||||
|
@ -106,11 +106,6 @@ public class CommitShejiActivityItemRequestHandler extends BaseHandler<ActivityP
|
|||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, _result, BIReason.SHEJI_ACTIVITY);
|
||||
guildInfo.setGuildSheJiScore(score+guildInfo.getGuildSheJiScore());
|
||||
Poster.getPoster().dispatchEvent(new CommitSheJiEvent(guildId,uid,score));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return ActivityProto.CommitShejiActivityItemResponse.newBuilder().setDrop(drop).build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ public class GlobleSystemLogic implements IEventHandler {
|
|||
calendar.set(Calendar.SECOND, 0);
|
||||
calendar.set(Calendar.MILLISECOND, 0);
|
||||
GlobalSystemControl globalSystemControl = MongoUtil.getInstence().getMyMongoTemplate().findById(GameApplication.serverId, GlobalSystemControl.class);
|
||||
globalSystemControl.getActivityOpenValue().putIfAbsent(openID,(int)(calendar.getTimeInMillis()/1000L));
|
||||
globalSystemControl.getActivityOpenValue().put(openID,(int)(calendar.getTimeInMillis()/1000L));
|
||||
GlobalSystemControl.save(globalSystemControl);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -105,10 +105,13 @@ class SheJiActivity extends AbstractActivity {
|
|||
}
|
||||
update(user, guildInfo.getGuildSheJiScore());
|
||||
}
|
||||
SGodSacrificeSetting sGodSacrificeSetting = STableManager.getConfig(SGodSacrificeSetting.class).get(1);
|
||||
AbstractRank guildRank = RankContext.getRankEnum(RankEnum.GUILD_SHEJI_SCORE_RANK.getType());
|
||||
guildRank.addRank(guildId,String.valueOf(id),guildInfo.getGuildSheJiScore());
|
||||
if(guildInfo.getGuildSheJiScore()>=sGodSacrificeSetting.getL1Score()){
|
||||
guildRank.addRank(guildId,String.valueOf(id),guildInfo.getGuildSheJiScore());
|
||||
}
|
||||
if( ((CommitSheJiEvent) event).getScore()!=0){
|
||||
RankContext.getRankEnum(RankEnum.EXPERT_RANK.getType()).incrementRankScore(((CommitSheJiEvent) event).getCommitUid(), String.valueOf(id), ((CommitSheJiEvent) event).getScore());
|
||||
RankContext.getRankEnum(RankEnum.EXPERT_RANK.getType()).incrementRankScoreOnly(((CommitSheJiEvent) event).getCommitUid(), String.valueOf(id), ((CommitSheJiEvent) event).getScore());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -77,6 +77,9 @@ public abstract class AbstractRank implements IRank {
|
|||
public void incrementRankScore(int uid,String rkey,double... data){
|
||||
RedisUtil.getInstence().incrementZsetScore(redisKey,rkey,String.valueOf(uid), getScore(data));
|
||||
}
|
||||
public void incrementRankScoreOnly(int uid,String rkey,double... data){
|
||||
RedisUtil.getInstence().incrementZsetScore(redisKey,rkey,String.valueOf(uid), data[0]);
|
||||
}
|
||||
|
||||
public AbstractRank(int type,String redisKey){
|
||||
this.type = type;
|
||||
|
|
|
@ -34,16 +34,20 @@ public class GuildSheJiScoreRank extends AbstractRank {
|
|||
return data[0];
|
||||
}
|
||||
|
||||
protected void getOptional(int index, ZSetOperations.TypedTuple<String> data, PlayerInfoProto.RankResponse.Builder builder) {
|
||||
protected void getOptional(int index, ZSetOperations.TypedTuple<String> data, PlayerInfoProto.RankResponse.Builder builder) throws Exception{
|
||||
GuildInfo guildInfo = GuilidManager.guildInfoMap.get(Integer.parseInt(data.getValue()));
|
||||
CommonProto.RankInfo.Builder everyRankInfo = CommonProto.RankInfo.newBuilder()
|
||||
.setRank(index)
|
||||
.setParam1(getParam1(data.getScore()))
|
||||
.setParam2(getParam2(data.getScore()))
|
||||
.setParam3(getParam3(data.getScore()));
|
||||
Set<Integer> chairMan = guildInfo.getMembers().get(GlobalsDef.CHAIRMAN);
|
||||
int chairManId = chairMan.iterator().next();
|
||||
User user = UserManager.getUser(chairManId);
|
||||
CommonProto.UserRank.Builder everyRank = CommonProto.UserRank.newBuilder()
|
||||
.setUid(guildInfo.getId())
|
||||
.setUserName(guildInfo.getName())
|
||||
.setUid(user.getId())
|
||||
.setLevel(user.getPlayerInfoManager().getLevel())
|
||||
.setGuildName(guildInfo.getName())
|
||||
.setRankInfo(everyRankInfo);
|
||||
builder.addRanks(everyRank);
|
||||
}
|
||||
|
|
|
@ -155,18 +155,21 @@ public class ProtocolsManager implements ProtocolsAbstract {
|
|||
|
||||
|
||||
public void minuteCheckForbidUser(){
|
||||
RedisUtil redisUtil = RedisUtil.getInstence();
|
||||
String key = RedisKey.getKey(RedisKey.FORBID_LOGIN, "", false);
|
||||
if(!redisUtil.hasKey(key)){
|
||||
Blocker.getForbidLogin().clear();
|
||||
return;
|
||||
try {
|
||||
RedisUtil redisUtil = RedisUtil.getInstence();
|
||||
String key = RedisKey.getKey(RedisKey.FORBID_LOGIN, "", false);
|
||||
if(!redisUtil.hasKey(key)){
|
||||
Blocker.getForbidLogin().clear();
|
||||
return;
|
||||
}
|
||||
Map<Integer, Integer> forbidMap = redisUtil.getMapValues(RedisKey.FORBID_LOGIN, "", Integer.class, Integer.class);
|
||||
if(forbidMap==null||forbidMap.size()<1){
|
||||
return;
|
||||
}
|
||||
Blocker.setForbidLogin(forbidMap.keySet());
|
||||
}catch (Exception e){
|
||||
LOGGER.error("Exception::=>{}",e.toString());
|
||||
}
|
||||
Map<Integer, Integer> forbidMap = redisUtil.getMapValues(RedisKey.FORBID_LOGIN, "", Integer.class, Integer.class);
|
||||
if(forbidMap==null||forbidMap.size()<1){
|
||||
return;
|
||||
}
|
||||
Blocker.setForbidLogin(forbidMap.keySet());
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -68,27 +68,89 @@ public class MinuteTask extends Thread {
|
|||
STableManager.updateTablesWithTableNames(true);
|
||||
ActivityLogic.getInstance().checkSecretBoxSeason();
|
||||
StoreLogic.checkGlobalStore(false);
|
||||
MapLogic.getInstance().minuteCheckAndRemoveMapRank();
|
||||
SituationLogic.getInstance().createCheckStatusTask();
|
||||
everyZeroTask();
|
||||
everyFiveTask();
|
||||
everyMondyFiveClockTask();
|
||||
everyHourTask();
|
||||
fiveMinuteOnlineSend();
|
||||
CheckFight.getInstance().luaHotFix();
|
||||
MongoUtil.getInstence().lastUpdate();
|
||||
GuildFightLogic.familyFightStatus();
|
||||
QuestionLogic.getInstence().checkQuestion();
|
||||
MailLogic.getInstance().checkReadyToMail();
|
||||
ProtocolsManager.getInstance().minuteCheckForbidUser();
|
||||
ProtocolsManager.getInstance().minuteCheckFlowUser();
|
||||
CoreLogic.getInstance().checkCoreCdk();
|
||||
BuyGoodsLogic.minuteCheckReharge();
|
||||
RedisUtil.getInstence().set(RedisKey.ONLINE_NUM+RedisKey.Delimiter_colon+GameApplication.serverId, String.valueOf(OnlineUserManager.sessionMap.entrySet().size()));
|
||||
DeathPathLogic.getInstance().statusCheck();
|
||||
GuildFightLogic.minuteCheckForCarFight();
|
||||
reportUserOnline();
|
||||
OnlineUserManager.checkOnline();
|
||||
try {
|
||||
MapLogic.getInstance().minuteCheckAndRemoveMapRank();
|
||||
}catch (Exception e){
|
||||
LOGGER.error("Exception::=>{}",e.toString());
|
||||
}
|
||||
try {
|
||||
|
||||
SituationLogic.getInstance().createCheckStatusTask();
|
||||
}catch (Exception e){
|
||||
LOGGER.error("Exception::=>{}",e.toString());
|
||||
}
|
||||
try {
|
||||
|
||||
everyZeroTask();
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
LOGGER.error("Exception::=>{}",e.toString());
|
||||
}
|
||||
try {
|
||||
everyFiveTask();
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
LOGGER.error("Exception::=>{}",e.toString());
|
||||
}
|
||||
try {
|
||||
everyMondyFiveClockTask();
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
LOGGER.error("Exception::=>{}",e.toString());
|
||||
}
|
||||
try {
|
||||
everyHourTask();
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
LOGGER.error("Exception::=>{}",e.toString());
|
||||
}
|
||||
try {
|
||||
fiveMinuteOnlineSend();
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
LOGGER.error("Exception::=>{}",e.toString());
|
||||
}
|
||||
try {
|
||||
CheckFight.getInstance().luaHotFix();
|
||||
MongoUtil.getInstence().lastUpdate();
|
||||
GuildFightLogic.familyFightStatus();
|
||||
QuestionLogic.getInstence().checkQuestion();
|
||||
MailLogic.getInstance().checkReadyToMail();
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
LOGGER.error("Exception::=>{}",e.toString());
|
||||
}
|
||||
|
||||
try {
|
||||
ProtocolsManager.getInstance().minuteCheckForbidUser();
|
||||
ProtocolsManager.getInstance().minuteCheckFlowUser();
|
||||
CoreLogic.getInstance().checkCoreCdk();
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
LOGGER.error("Exception::=>{}",e.toString());
|
||||
}
|
||||
try {
|
||||
BuyGoodsLogic.minuteCheckReharge();
|
||||
RedisUtil.getInstence().set(RedisKey.ONLINE_NUM+RedisKey.Delimiter_colon+GameApplication.serverId, String.valueOf(OnlineUserManager.sessionMap.entrySet().size()));
|
||||
DeathPathLogic.getInstance().statusCheck();
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
LOGGER.error("Exception::=>{}",e.toString());
|
||||
}
|
||||
|
||||
try {
|
||||
GuildFightLogic.minuteCheckForCarFight();
|
||||
reportUserOnline();
|
||||
OnlineUserManager.checkOnline();
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
LOGGER.error("Exception::=>{}",e.toString());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
LOGGER.info("MinuteTask end...");
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("e",e);
|
||||
|
|
|
@ -34,7 +34,7 @@ public class SGodSacrificeSetting implements BaseConfig {
|
|||
private int lastTime;
|
||||
|
||||
public static HashMap<Integer,Integer> exchangeRate= new HashMap<>();
|
||||
|
||||
private int levelLimit;
|
||||
private int lifeLimit;
|
||||
|
||||
private int joinLimit;
|
||||
|
@ -107,6 +107,9 @@ public class SGodSacrificeSetting implements BaseConfig {
|
|||
return lastTime;
|
||||
}
|
||||
|
||||
public int getLevelLimit() {
|
||||
return levelLimit;
|
||||
}
|
||||
|
||||
public int getLifeLimit() {
|
||||
return lifeLimit;
|
||||
|
|
Loading…
Reference in New Issue