Merge branch 'master_online_hw' into master_test_hw
# Conflicts: # serverlogic/src/main/java/com/ljsd/jieling/handler/arena/ArenaChallengeHandler.javaback_recharge
commit
3cf66b94fe
|
@ -102,7 +102,7 @@ public class ArenaChallengeHandler extends BaseHandler<ArenaInfoProto.ArenaChall
|
|||
arenaRecord.setId(KeyGenUtils.produceIdByModule(UUIDEnum.ARENARECORD,uid));
|
||||
arenaRecord.setFightResult(fightResult^1);
|
||||
RedisUtil.getInstence().putMapEntry(RedisKey.ARENA_RRECORD,Integer.toString(challengeUid),arenaRecord.getId(),arenaRecord);
|
||||
rank.addRank(challengeUid,Integer.toString(curSeason),rank.getScoreById(challengeUid,Integer.toString(curSeason))+defScoreChange);
|
||||
rank.addRank(challengeUid,Integer.toString(curSeason),(int)(rank.getScoreById(challengeUid,Integer.toString(curSeason)))+defScoreChange);
|
||||
// RedisUtil.getInstence().incrementZsetScore(RedisKey.ARENA_RANK,Integer.toString(curSeason),Integer.toString(challengeUid),defScoreChange);
|
||||
MessageUtil.sendRedIndication(challengeUid,GlobalsDef.ARENA_CHALLENGE_TYPE);
|
||||
}
|
||||
|
@ -124,7 +124,6 @@ public class ArenaChallengeHandler extends BaseHandler<ArenaInfoProto.ArenaChall
|
|||
// RedisUtil.getInstence().incrementZsetScore(RedisKey.ARENA_RANK,Integer.toString(curSeason),Integer.toString(uid),myscoreChange + myscore);
|
||||
}else{
|
||||
rank.addRank(uid,Integer.toString(curSeason),(int)(rank.getScoreById(uid,Integer.toString(curSeason)))+myscoreChange);
|
||||
|
||||
// RedisUtil.getInstence().incrementZsetScore(RedisKey.ARENA_RANK,Integer.toString(curSeason),Integer.toString(uid),myscoreChange);
|
||||
}
|
||||
ArenaLogic.getInstance().setMyArenaEnemys(uid,user);
|
||||
|
|
|
@ -65,10 +65,14 @@ public class ChampionGetMyAllBetHandler extends BaseHandler {
|
|||
Map<String, Integer> states = RedisUtil.getInstence().getMapValues(RedisKey.CHAMPION_ARENA_RECORD_THREE, "", String.class, Integer.class);
|
||||
String key = String.valueOf(arenaRecord.getAttackId() * 2222 + String.valueOf(arenaRecord.getDefUid()));
|
||||
Integer state = states.get(key);
|
||||
if (null != state && state == 0) {
|
||||
fightResult = 0;
|
||||
if (null != state ){
|
||||
if (state == 0) {
|
||||
fightResult = 0;
|
||||
}else {
|
||||
fightResult =1;
|
||||
}
|
||||
}else {
|
||||
fightResult =1;
|
||||
fightResult = arenaRecord.getFightResult();
|
||||
}
|
||||
|
||||
if ((ChampionshipLogic.getRealTimes() + 7) == arenaRecord.getRoundTims()) {
|
||||
|
@ -84,6 +88,8 @@ public class ChampionGetMyAllBetHandler extends BaseHandler {
|
|||
if (fightResult == -2) {
|
||||
fightResult = -1;
|
||||
}
|
||||
|
||||
|
||||
ArenaInfoProto.ChampionMyBetDetail.Builder betDetailBuilder = ArenaInfoProto.ChampionMyBetDetail.newBuilder();
|
||||
String guessUid = betHistorys.get(arenaRecord.getId());
|
||||
Integer mineBetCoins = RedisUtil.getInstence().getMapEntry(RedisKey.CHAMPION_BET_DETAIL, arenaRecord.getId() + ":" + guessUid, Integer.toString(uid), Integer.class);
|
||||
|
|
|
@ -0,0 +1,128 @@
|
|||
package com.ljsd.jieling.kefu;
|
||||
|
||||
|
||||
import com.ljsd.jieling.core.Lockeys;
|
||||
import com.ljsd.jieling.core.SimpleTransaction;
|
||||
import com.ljsd.jieling.db.mongo.AreaManager;
|
||||
import com.ljsd.jieling.db.mongo.MongoUtil;
|
||||
import com.ljsd.jieling.db.redis.RedisKey;
|
||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||
import com.ljsd.jieling.logic.activity.AbstractActivity;
|
||||
import com.ljsd.jieling.logic.activity.ActivityLogic;
|
||||
import com.ljsd.jieling.logic.activity.ActivityTypeEnum;
|
||||
import com.ljsd.jieling.logic.activity.event.CommitSheJiEvent;
|
||||
import com.ljsd.jieling.logic.dao.GuilidManager;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.GuildInfo;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.rank.RankContext;
|
||||
import com.ljsd.jieling.logic.rank.RankEnum;
|
||||
import com.ljsd.jieling.logic.rank.rankImpl.AbstractRank;
|
||||
import config.SGodSacrificeSetting;
|
||||
import manager.STableManager;
|
||||
import org.springframework.data.redis.core.ZSetOperations;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Description: 热修复全局信息 gm线程执行
|
||||
* Author: zsx
|
||||
* CreateDate: 2019/9/26 11:48
|
||||
* <p>
|
||||
* //fixsj
|
||||
*/
|
||||
public class Cmd_fixsj extends GmAbstract {
|
||||
@Override
|
||||
public boolean exec(String[] args) throws Exception {
|
||||
|
||||
// for (int i = 0; i <150 ; i++) {
|
||||
// String key = RedisKey.getKey(RedisKey.FORCE_RANK, "", false);
|
||||
// RedisUtil.getInstence().zsetAddOne(key, String.valueOf(10000+i), 10000+i);
|
||||
// }
|
||||
try {
|
||||
|
||||
|
||||
Map<Integer, GuildInfo> guildInfoMap = GuilidManager.guildInfoMap;
|
||||
AbstractRank guildRank = RankContext.getRankEnum(RankEnum.GUILD_SHEJI_SCORE_RANK.getType());
|
||||
|
||||
for(Map.Entry<Integer,GuildInfo> guildInfoEntry:guildInfoMap.entrySet()){
|
||||
try {
|
||||
|
||||
GuildInfo guildInfo = guildInfoEntry.getValue();
|
||||
Double zSetScore = RedisUtil.getInstence().getZSetScore(RankEnum.GUILD_SHEJI_SCORE_RANK.getRedisKey(), "50002", Integer.toString(guildInfo.getId()));
|
||||
|
||||
// if(zSetScore<0){
|
||||
// continue;
|
||||
// }
|
||||
Double sumValue =0d;
|
||||
|
||||
Set<Integer> sendUids = new HashSet<>();
|
||||
for (Set<Integer> items : guildInfo.getMembers().values()) {
|
||||
sendUids.addAll(items);
|
||||
}
|
||||
|
||||
for (Integer uid : sendUids) {
|
||||
|
||||
Double zSetScore1 = RedisUtil.getInstence().getZSetScore(RankEnum.EXPERT_RANK.getRedisKey(), "50002", Integer.toString(uid));
|
||||
if(zSetScore1<0){
|
||||
zSetScore1=0d;
|
||||
}
|
||||
sumValue+=zSetScore1;
|
||||
}
|
||||
if(sumValue<0){
|
||||
sumValue=0d;
|
||||
}
|
||||
|
||||
System.out.println(guildInfo.getName()+"guildInfo.get = " + guildInfo.getGuildSheJiScore());
|
||||
System.out.println(guildInfo.getName()+"zSetScore = " + zSetScore);
|
||||
System.out.println(guildInfo.getName()+"sumValue = " + sumValue);
|
||||
|
||||
SGodSacrificeSetting sGodSacrificeSetting = STableManager.getConfig(SGodSacrificeSetting.class).get(1);
|
||||
if(sumValue>=sGodSacrificeSetting.getL1Score()){
|
||||
guildRank.addRank(guildInfo.getId(),"50002",sumValue);
|
||||
}else {
|
||||
String key= RedisUtil.getInstence().getKey(RankEnum.GUILD_SHEJI_SCORE_RANK.getRedisKey(), "50002");
|
||||
RedisUtil.getInstence().zsetRemoveOne(key,Integer.toString(guildInfo.getId()));
|
||||
}
|
||||
|
||||
guildInfo.setGuildSheJiScore(sumValue.intValue());
|
||||
|
||||
|
||||
for (Integer uid : sendUids) {
|
||||
|
||||
User user = UserManager.getUser(uid);
|
||||
if (null == user) {
|
||||
LOGGER.error("Exception::user==null,uid=>{}", uid);
|
||||
continue;
|
||||
}
|
||||
|
||||
AbstractActivity abstractActivity = ActivityTypeEnum.getActicityType(50002);
|
||||
if (abstractActivity == null) {
|
||||
continue;
|
||||
}
|
||||
abstractActivity.update(user, sumValue.intValue());
|
||||
// Double zSetScore1 = RedisUtil.getInstence().getZSetScore(RankEnum.EXPERT_RANK.getRedisKey(), "50002", Integer.toString(uid));
|
||||
// sumValue+=zSetScore1;
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
LOGGER.error("Exception resetGuildInfo err");
|
||||
}finally {
|
||||
}
|
||||
//
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
LOGGER.info("修复排行榜异常" + e.toString());
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue