优化代码

back_recharge
jiahuiwen 2022-01-18 16:31:48 +08:00
parent a682067c20
commit 2203e54375
31 changed files with 80 additions and 111 deletions

View File

@ -120,7 +120,6 @@ public class GmService implements RPCRequestGMIFace.Iface {
} catch (final Exception ex) { } catch (final Exception ex) {
result.setResultMsg("Cmd Illegal"); result.setResultMsg("Cmd Illegal");
LOGGER.error("e={}",ex.getMessage()); LOGGER.error("e={}",ex.getMessage());
ex.getMessage();
return result; return result;
} }
result.setResultCode(0); result.setResultCode(0);

View File

@ -161,7 +161,7 @@ public class CommonStaticConfig extends AbstractClassStaticConfig {
sGlobalSystemConfigMapByTypeAndConditionMap = sGlobalSystemConfigMapByTypeAndConditionMapTmp; sGlobalSystemConfigMapByTypeAndConditionMap = sGlobalSystemConfigMapByTypeAndConditionMapTmp;
} catch (Exception e) { } catch (Exception e) {
LOGGER.error("SGlobalSystemConfig init fail",e); LOGGER.error("SGlobalSystemConfig init fail {}",e);
} }
try { try {

View File

@ -79,7 +79,7 @@ public class HeroStaticConfig extends AbstractClassStaticConfig {
sHeroSacrificeMap = sHeroSacrificeMapTemp; sHeroSacrificeMap = sHeroSacrificeMapTemp;
} catch (Exception e) { } catch (Exception e) {
LOGGER.error("SCHeroRankUpConfig init fail"); LOGGER.error("SCHeroRankUpConfig init fail={}", e.toString());
} }
try { try {
Set<Integer> randomHeroIdTmp = new HashSet<>(); Set<Integer> randomHeroIdTmp = new HashSet<>();

View File

@ -35,8 +35,8 @@ public class EndlessFunction implements FunctionManager {
@Override @Override
public void startAction(TimeControllerOfFunction timeControllerOfFunction) throws Exception { public void startAction(TimeControllerOfFunction timeControllerOfFunction) throws Exception {
int times = timeControllerOfFunction.getTimes(); // int times = timeControllerOfFunction.getTimes();
int[] maps = new int[]{4001,4002}; // int[] maps = new int[]{4001,4002};
// maps[times % maps.length]; // maps[times % maps.length];
int mapId = 4001; int mapId = 4001;

View File

@ -246,7 +246,7 @@ public class LjsdMongoTemplate implements MongoUpdateImp {
dbobj.append("$unset", removedbobj); dbobj.append("$unset", removedbobj);
flag = true; flag = true;
} }
if (flag&&null!=otherMonogTemplate) { if (flag) {
DBCollection coll = otherMonogTemplate.getCollection(collection); DBCollection coll = otherMonogTemplate.getCollection(collection);
coll.update(searchQuery, dbobj); coll.update(searchQuery, dbobj);
} }

View File

@ -23,7 +23,7 @@ public class MongoPropertyConverter implements Converter<BasicDBObject, Property
return null; return null;
} }
SItem equipId = STableManager.getConfig(SItem.class).get(source.getInt("equipId")); SItem equipId = STableManager.getConfig(SItem.class).get(source.getInt("equipId"));
Class<? extends PropertyItem> target = PropertyItem.class; Class<? extends PropertyItem> target;
if(equipId.getItemType() == GlobalItemType.JEWEL){ if(equipId.getItemType() == GlobalItemType.JEWEL){
target = Jewel.class; target = Jewel.class;
}else { }else {

View File

@ -52,7 +52,7 @@ public class MongoUtiltest {
} }
}catch (Exception e){ }catch (Exception e){
LOGGER.info("MongoUtiltest e={}", e.toString());
} }
} }

View File

@ -37,7 +37,6 @@ public class XunBaoMiZongHandler extends BaseHandler<PlayerInfoProto.XunBaoMiZo
SLotterySetting sLotterySetting = STableManager.getConfig(SLotterySetting.class).get(166); SLotterySetting sLotterySetting = STableManager.getConfig(SLotterySetting.class).get(166);
boolean enoughCost = false; boolean enoughCost = false;
for (int[] cost:sLotterySetting.getCostItem()){ for (int[] cost:sLotterySetting.getCostItem()){
int [][] costItems = new int[][]{cost};
Map<Integer, Integer> cost1 = new HashMap<>(1); Map<Integer, Integer> cost1 = new HashMap<>(1);
cost1.put(cost[0], cost[1]); cost1.put(cost[0], cost[1]);
enoughCost = ItemUtil.checkCost(user, cost1); enoughCost = ItemUtil.checkCost(user, cost1);

View File

@ -34,8 +34,8 @@ public class CrossLingmaiSecretAreaRecordHandler extends BaseHandler<ArenaInfoPr
ArenaInfoProto.CrossLingmaiSecretAreaRecordResponse.Builder builder = ArenaInfoProto.CrossLingmaiSecretAreaRecordResponse.newBuilder(); ArenaInfoProto.CrossLingmaiSecretAreaRecordResponse.Builder builder = ArenaInfoProto.CrossLingmaiSecretAreaRecordResponse.newBuilder();
RedisUtil redisUtil = RedisUtil.getInstence(); RedisUtil redisUtil = RedisUtil.getInstence();
List<String> list = redisUtil.lGet(RedisKey.CROSS_LINGMAISECRET_RECORD, String.valueOf(uid), 0, -1); List<String> list = redisUtil.lGet(RedisKey.CROSS_LINGMAISECRET_RECORD, String.valueOf(uid), 0, -1);
Collections.reverse(list);
if (list != null) { if (list != null) {
Collections.reverse(list);
for (String s : list) { for (String s : list) {
ArenaRecord arenaRecord = new Gson().fromJson(s, ArenaRecord.class); ArenaRecord arenaRecord = new Gson().fromJson(s, ArenaRecord.class);
CommonProto.LingMaiSecretRecord record = CommonProto.LingMaiSecretRecord.newBuilder().setType(arenaRecord.getType()) CommonProto.LingMaiSecretRecord record = CommonProto.LingMaiSecretRecord.newBuilder().setType(arenaRecord.getType())

View File

@ -326,9 +326,7 @@ public class CrossYuxulundaoChallengeHandler extends BaseHandler<ArenaInfoProto.
} }
} }
res.setMyNewScore(myQuery.getCrossYuxulundaoNewScore()); res.setMyNewScore(myQuery.getCrossYuxulundaoNewScore());
if (myQuery != null) { CrossServiceLogic.update(myQuery);
CrossServiceLogic.update(myQuery);
}
if (defQuery != null) { if (defQuery != null) {
CrossServiceLogic.update(defQuery); CrossServiceLogic.update(defQuery);
} }

View File

@ -152,39 +152,37 @@ public class CrossYuxulundaoGetInfoHandler extends BaseHandler<ArenaInfoProto.Cr
if (enemyList != null && enemyList.size() > 0) { if (enemyList != null && enemyList.size() > 0) {
enemyList.forEach(n -> builder.addArenaEnemys(CrossYuxulundaoLogic.getInstance().getMatchRivalInfo(n.getEnemyId(), 0))); enemyList.forEach(n -> builder.addArenaEnemys(CrossYuxulundaoLogic.getInstance().getMatchRivalInfo(n.getEnemyId(), 0)));
} }
if (csPlayer != null) { int oldScore = csPlayer.getCrossYuxulundaoOldScore();
int oldScore = csPlayer.getCrossYuxulundaoOldScore(); int newScore = csPlayer.getCrossYuxulundaoNewScore();
int newScore = csPlayer.getCrossYuxulundaoNewScore(); //被打后是否加分了
//被打后是否加分了 if (oldScore < newScore) {
if(oldScore < newScore){ //被打后打赢加分
//被打后打赢加分 int id = SMServerRankConfig.getIdByScore(newScore);
int id = SMServerRankConfig.getIdByScore(newScore); if (csPlayer.getCrossYxldMaxLevel() < id) {
if (csPlayer.getCrossYxldMaxLevel() < id) { //首次爬升到该位置发奖励
//首次爬升到该位置发奖励 int oldLevel = SMServerRankConfig.getIdByScore(oldScore);
int oldLevel = SMServerRankConfig.getIdByScore(oldScore); for (int i = oldLevel + 1; i <= id; i++) {
for (int i = oldLevel + 1; i <= id; i++) { if (SMServerRankConfig.serverRankConfig.containsKey(i)) {
if (SMServerRankConfig.serverRankConfig.containsKey(i)) { SMServerRankConfig serverRankConfig = SMServerRankConfig.serverRankConfig.get(i);
SMServerRankConfig serverRankConfig = SMServerRankConfig.serverRankConfig.get(i); CommonProto.Drop.Builder drop = ItemUtil.dropPer(user, serverRankConfig.getFirstReward(), BIReason.CROSS_YUXULUNDAO_DAILYREWARD);
CommonProto.Drop.Builder drop = ItemUtil.dropPer(user, serverRankConfig.getFirstReward(), BIReason.CROSS_YUXULUNDAO_DAILYREWARD); builder.addUpdrop(drop);
builder.addUpdrop(drop);
}
} }
csPlayer.setCrossYxldMaxLevel(id);
isNeedUpdate = true;
} }
} csPlayer.setCrossYxldMaxLevel(id);
if(newSeason){
builder.setOldMyscore(newSeasonBefore);
}else{
builder.setOldMyscore(oldScore);
}
builder.setNewMyscore(newScore);
if (oldScore != newScore) {
csPlayer.setCrossYuxulundaoOldScore(newScore);
isNeedUpdate = true; isNeedUpdate = true;
} }
} }
if (newSeason) {
builder.setOldMyscore(newSeasonBefore);
} else {
builder.setOldMyscore(oldScore);
}
builder.setNewMyscore(newScore);
if (oldScore != newScore) {
csPlayer.setCrossYuxulundaoOldScore(newScore);
isNeedUpdate = true;
}
if (isNeedUpdate) { if (isNeedUpdate) {
//CrossServiceLogic.getInstance().update(myQuery); //CrossServiceLogic.getInstance().update(myQuery);
//CrossServiceLogic.getInstance().saveBasicPlayerToRedis(user); //CrossServiceLogic.getInstance().saveBasicPlayerToRedis(user);

View File

@ -3336,7 +3336,9 @@ public class MapLogic {
response = getBoxReward(sTrialConfig.getBoxPosition(), sTrialConfig.getBoxReward(), user, curXY, type); response = getBoxReward(sTrialConfig.getBoxPosition(), sTrialConfig.getBoxReward(), user, curXY, type);
} }
//森罗幻境自动挂机奖励展示 //森罗幻境自动挂机奖励展示
PlayerLogic.TowerGetRewardInfoShow(response.getBoxDrop(),user); if (response != null) {
PlayerLogic.TowerGetRewardInfoShow(response.getBoxDrop(),user);
}
if (response == null) { if (response == null) {
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE); throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
} }

View File

@ -33,7 +33,7 @@ public class Cmd_skyeye extends GmRoleAbstract {
PlayerManager playerManager = user.getPlayerInfoManager(); PlayerManager playerManager = user.getPlayerInfoManager();
// 默认封禁 // 默认封禁
int time = Integer.valueOf(args[1]); int time = Integer.parseInt(args[1]);
playerManager.setSkyEyeBanTime(System.currentTimeMillis() + time * TimeUtils.ONE_MINUTE); playerManager.setSkyEyeBanTime(System.currentTimeMillis() + time * TimeUtils.ONE_MINUTE);
int type = Integer.parseInt(args[0]); int type = Integer.parseInt(args[0]);

View File

@ -25,16 +25,10 @@ public class XunBaoMiZongActivity extends AbstractActivity {
return; return;
} }
if (activityMission.getV() == 1 && xunBaoMiZongEvent.getType() == 0) { if (activityMission.getV() == 1 && xunBaoMiZongEvent.getType() == 0) {
if (null == activityMission) {
return;
}
activityMission.setV(0); activityMission.setV(0);
ActivityLogic.getInstance().sendActivityInfo(user, id); ActivityLogic.getInstance().sendActivityInfo(user, id);
} }
if (activityMission.getV() == 0 && xunBaoMiZongEvent.getType() == 1) { if (activityMission.getV() == 0 && xunBaoMiZongEvent.getType() == 1) {
if (null == activityMission) {
return;
}
//最大伤害更新 //最大伤害更新
activityMission.setV(1); activityMission.setV(1);
ActivityLogic.getInstance().sendActivityInfo(user, id); ActivityLogic.getInstance().sendActivityInfo(user, id);

View File

@ -777,7 +777,7 @@ public class ArenaLogic {
while (iterator.hasNext()){ while (iterator.hasNext()){
index++; index++;
ZSetOperations.TypedTuple<String> next = iterator.next(); ZSetOperations.TypedTuple<String> next = iterator.next();
int uid = Integer.valueOf(next.getValue()); int uid = Integer.parseInt(next.getValue());
if (uid<1000) { if (uid<1000) {
continue; continue;
} }

View File

@ -58,7 +58,7 @@ public class ArenaWorldLogic {
public static boolean checkOpen(String uid) throws Exception{ public static boolean checkOpen(String uid) throws Exception{
SGlobalSystemConfig sGlobalSystemConfig = STableManager.getConfig(SGlobalSystemConfig.class).get(FunctionIdEnum.World_Arena.getFunctionType()); SGlobalSystemConfig sGlobalSystemConfig = STableManager.getConfig(SGlobalSystemConfig.class).get(FunctionIdEnum.World_Arena.getFunctionType());
return HandlerLogicThread.checkOpen(UserManager.getUser(Integer.valueOf(uid)),sGlobalSystemConfig); return HandlerLogicThread.checkOpen(UserManager.getUser(Integer.parseInt(uid)),sGlobalSystemConfig);
} }

View File

@ -85,7 +85,7 @@ public class ChampionshipLogic {
String key = RedisUtil.getInstence().getKey(RedisKey.CHAMPION_SCHEDULE, ""); String key = RedisUtil.getInstence().getKey(RedisKey.CHAMPION_SCHEDULE, "");
Object result = RedisUtil.getInstence().get(key); Object result = RedisUtil.getInstence().get(key);
if (result != null) { if (result != null) {
schedule = Integer.valueOf((String) result); schedule = Integer.parseInt((String) result);
} }
}catch (Exception e){ }catch (Exception e){
LOGGER.info("Exception the init={}"); LOGGER.info("Exception the init={}");
@ -398,7 +398,7 @@ public class ChampionshipLogic {
Set<ZSetOperations.TypedTuple<String>> arenaRankInfo = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.CHAMPION_RANK, "", 0, -1); Set<ZSetOperations.TypedTuple<String>> arenaRankInfo = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.CHAMPION_RANK, "", 0, -1);
Map<Integer, SArenaRobotConfig> robotConfigMap = STableManager.getConfig(SArenaRobotConfig.class); Map<Integer, SArenaRobotConfig> robotConfigMap = STableManager.getConfig(SArenaRobotConfig.class);
int nowTime = (int) (TimeUtils.now() / 1000); int nowTime = (int) (TimeUtils.now() / 1000);
Set<Integer> joinUids = new HashSet<>(128); // Set<Integer> joinUids = new HashSet<>(128);
try { try {
for (ZSetOperations.TypedTuple<String> item : arenaRankInfo) { for (ZSetOperations.TypedTuple<String> item : arenaRankInfo) {
String uidStr = item.getValue(); String uidStr = item.getValue();
@ -407,7 +407,7 @@ public class ChampionshipLogic {
rank++; rank++;
continue; continue;
} }
joinUids.add(uid); // joinUids.add(uid);
User user = UserManager.getUser(uid); User user = UserManager.getUser(uid);
SChampionshipReward sChampionshipReward = rewardsMap.get(rank); SChampionshipReward sChampionshipReward = rewardsMap.get(rank);
if (user.getArenaManager().getTopMaxRank() == 0 || user.getArenaManager().getTopMaxRank() > rank) { if (user.getArenaManager().getTopMaxRank() == 0 || user.getArenaManager().getTopMaxRank() > rank) {

View File

@ -1327,7 +1327,7 @@ public class PlayerManager extends MongoBase {
int count = 0; int count = 0;
for (Integer value : getSevenWorldOpenTier().values()) { for (Integer value : getSevenWorldOpenTier().values()) {
SQijieStage stage = STableManager.getConfig(SQijieStage.class).get(value); SQijieStage stage = STableManager.getConfig(SQijieStage.class).get(value);
if (value == null){ if (stage == null){
System.out.printf("SQijieStage配置表读取不到关卡id:{%d}\n",value); System.out.printf("SQijieStage配置表读取不到关卡id:{%d}\n",value);
continue; continue;
} }

View File

@ -149,7 +149,7 @@ public class CrossDeathPathLogic {
int rank =0; int rank =0;
for(ZSetOperations.TypedTuple<String> value:values){ for(ZSetOperations.TypedTuple<String> value:values){
rank++; rank++;
int guildId = Integer.valueOf(value.getValue()); int guildId = Integer.parseInt(value.getValue());
GuildCache guild = getCrossGuild(guildId); GuildCache guild = getCrossGuild(guildId);
if(guild==null||guild.getServerId()!=serverId){ if(guild==null||guild.getServerId()!=serverId){
continue; continue;

View File

@ -1206,7 +1206,7 @@ public class HeroLogic {
if (teamId == TeamEnum.ENDLESS_TEAM.getTeamId()) { if (teamId == TeamEnum.ENDLESS_TEAM.getTeamId()) {
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId); List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId);
if (teamPosHeroInfos != null) { if (teamPosHeroInfos != null) {
List<String> heroes = new ArrayList<>(teamPosHeroInfos.size()); // List<String> heroes = new ArrayList<>(teamPosHeroInfos.size());
Map<String, Map<Integer, Long>> heroAllAttributeMap = new HashMap<>(teamPosHeroInfos.size()); Map<String, Map<Integer, Long>> heroAllAttributeMap = new HashMap<>(teamPosHeroInfos.size());
List<MapInfoProto.HeroInfo> indiHeros = new ArrayList<>(); List<MapInfoProto.HeroInfo> indiHeros = new ArrayList<>();
for (TeamPosHeroInfo heroInfo : teamPosHeroInfos) { for (TeamPosHeroInfo heroInfo : teamPosHeroInfos) {
@ -1232,7 +1232,7 @@ public class HeroLogic {
heroAllAttribute.put(HeroAttributeEnum.CurHP.getPropertyId(), 10000L); heroAllAttribute.put(HeroAttributeEnum.CurHP.getPropertyId(), 10000L);
} }
heroAllAttributeMap.put(hero.getId(), heroAllAttribute); heroAllAttributeMap.put(hero.getId(), heroAllAttribute);
heroes.add(heroInfo.getHeroId()); // heroes.add(heroInfo.getHeroId());
MapInfoProto.HeroInfo indiInfo = MapInfoProto.HeroInfo.newBuilder().setHeroId(heroInfo.getHeroId()) MapInfoProto.HeroInfo indiInfo = MapInfoProto.HeroInfo.newBuilder().setHeroId(heroInfo.getHeroId())
.setHeroHp(heroAllAttribute.get(HeroAttributeEnum.CurHP.getPropertyId())) .setHeroHp(heroAllAttribute.get(HeroAttributeEnum.CurHP.getPropertyId()))
.setHeroMaxHp(heroAllAttribute.get(HeroAttributeEnum.Hp.getPropertyId())) .setHeroMaxHp(heroAllAttribute.get(HeroAttributeEnum.Hp.getPropertyId()))

View File

@ -132,24 +132,24 @@ public class WorkShopLogic {
//基础打造 //基础打造
public void createMaterialByUser(ISession session, int materialId, int nums) throws Exception { // public void createMaterialByUser(ISession session, int materialId, int nums) throws Exception {
int uid = session.getUid(); // int uid = session.getUid();
User user = UserManager.getUser(uid); // User user = UserManager.getUser(uid);
SWorkShopFoundationConfig sWorkShopFoundationConfig = SWorkShopFoundationConfig.getShopFoundationConfigMap().get(materialId); // SWorkShopFoundationConfig sWorkShopFoundationConfig = SWorkShopFoundationConfig.getShopFoundationConfigMap().get(materialId);
if(!checkIsUnlock(GlobalsDef.WORK_BASE_TYPE,sWorkShopFoundationConfig.getType(),user.getWorkShopController(),sWorkShopFoundationConfig.getOpenRules(),sWorkShopFoundationConfig.getId())){ // if(!checkIsUnlock(GlobalsDef.WORK_BASE_TYPE,sWorkShopFoundationConfig.getType(),user.getWorkShopController(),sWorkShopFoundationConfig.getOpenRules(),sWorkShopFoundationConfig.getId())){
throw new ErrorCodeException(ErrorCode.newDefineCode("未开")); // throw new ErrorCodeException(ErrorCode.newDefineCode("未开"));
} // }
int[][] cost = sWorkShopFoundationConfig.getCost(); // int[][] cost = sWorkShopFoundationConfig.getCost();
int[][] reallyCost = times2Array(cost, nums); // int[][] reallyCost = times2Array(cost, nums);
if( !ItemUtil.itemCost(user, reallyCost,BIReason.WORKSHOP_CREATEMATERIAL_CONSUME,materialId)){ // if( !ItemUtil.itemCost(user, reallyCost,BIReason.WORKSHOP_CREATEMATERIAL_CONSUME,materialId)){
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH); // throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
} // }
Map<Integer,Long> finalMaterial = new HashMap<>(); // Map<Integer,Long> finalMaterial = new HashMap<>();
finalMaterial.put(materialId, (long) (nums*sWorkShopFoundationConfig.getNum())); // finalMaterial.put(materialId, (long) (nums*sWorkShopFoundationConfig.getNum()));
ItemUtil.addItem(user,finalMaterial,null, BIReason.WORKSHOP_CREATEMATERIAL); // ItemUtil.addItem(user,finalMaterial,null, BIReason.WORKSHOP_CREATEMATERIAL);
//
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.WORKSHOP_FOUNDATION_RESPONSE_VALUE,null,true); // MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.WORKSHOP_FOUNDATION_RESPONSE_VALUE,null,true);
} // }
//装备打造 TODO //装备打造 TODO
//装备重铸 //装备重铸

View File

@ -60,24 +60,4 @@ public class MailCache {
public void setValidTime(int validTime) { public void setValidTime(int validTime) {
this.validTime = validTime; this.validTime = validTime;
} }
public static void main(String[] args) {
Gson gson = new Gson();
Map<Integer,String> uidReward = new HashMap<>();
//todo uid 奖励
uidReward.put(1,"2#3");
MailCache mailCache = new MailCache();
mailCache.setTime((int)(System.currentTimeMillis()/1000));
mailCache.setContent("充值返利");
mailCache.setTitle("充值返利");
mailCache.setFrom("system");
uidReward.forEach((k,v)->{
mailCache.setReward(v);
System.out.println("HSET 10001:READY_TO_USER_MAIL: " + k + " "+ gson.toJson(gson.toJson(mailCache)));
});
System.out.println(gson.toJson(mailCache));
String s = gson.toJson(mailCache);
System.out.println(gson.toJson(s));
}
} }

View File

@ -710,7 +710,10 @@ public class PlayerLogic {
}*/ }*/
} }
//PlayerInfoProto.GetPlayerCrossYxldOneTeamInfoResponse.Builder playerTeamInfo = PlayerInfoProto.GetPlayerCrossYxldOneTeamInfoResponse.newBuilder().setTeamInfo(oneInfo); //PlayerInfoProto.GetPlayerCrossYxldOneTeamInfoResponse.Builder playerTeamInfo = PlayerInfoProto.GetPlayerCrossYxldOneTeamInfoResponse.newBuilder().setTeamInfo(oneInfo);
return oneInfo.build(); if (oneInfo != null) {
return oneInfo.build();
}
return null;
} }
//玉虚论道 //玉虚论道
private CommonProto.TeamOneInfo.Builder getYuxuRobotOneInfo(SArenaRobotConfig sArenaRobotConfig,CrossArenaEnemy info,List<Integer> crossTeamId){ private CommonProto.TeamOneInfo.Builder getYuxuRobotOneInfo(SArenaRobotConfig sArenaRobotConfig,CrossArenaEnemy info,List<Integer> crossTeamId){

View File

@ -72,7 +72,7 @@ public class CrossArenaRank extends AbstractRank {
.setSex(0); .setSex(0);
builder.addRanks(everyRank); builder.addRanks(everyRank);
}else{ }else{
CSPlayer query = CrossServiceLogic.getPlayerByRedis(Integer.valueOf(data.getValue())); CSPlayer query = CrossServiceLogic.getPlayerByRedis(Integer.parseInt(data.getValue()));
if (query == null){ if (query == null){
return; return;
} }

View File

@ -35,7 +35,7 @@ public class CrossYuXuLunDaoPersonRank extends CrossYuXuLunDaoRank{
@Override @Override
protected void getCrossOptional(int index, ZSetOperations.TypedTuple<String> data, PlayerInfoProto.RankResponse.Builder builder) throws Exception { protected void getCrossOptional(int index, ZSetOperations.TypedTuple<String> data, PlayerInfoProto.RankResponse.Builder builder) throws Exception {
if(Integer.parseInt(data.getValue()) >= 1000){ if(Integer.parseInt(data.getValue()) >= 1000){
CSPlayer cPlayer = CrossServiceLogic.getPlayerByRedis(Integer.valueOf(data.getValue())); CSPlayer cPlayer = CrossServiceLogic.getPlayerByRedis(Integer.parseInt(data.getValue()));
if (cPlayer == null){ if (cPlayer == null){
return; return;
} }

View File

@ -77,7 +77,7 @@ public class CrossYuXuLunDaoRank extends AbstractRank{
.setSex(0).setCrossScore(mapEntry.getEnemyStatus()); .setSex(0).setCrossScore(mapEntry.getEnemyStatus());
builder.addRanks(everyRank); builder.addRanks(everyRank);
}else{ }else{
CSPlayer cPlayer = CrossServiceLogic.getPlayerByRedis(Integer.valueOf(data.getValue())); CSPlayer cPlayer = CrossServiceLogic.getPlayerByRedis(Integer.parseInt(data.getValue()));
if (cPlayer == null){ if (cPlayer == null){
return; return;
} }

View File

@ -60,7 +60,7 @@ public class DeathPathTotalGuildRank extends CrossGuildForceRank{
@Override @Override
protected void getCrossOptional(int index, ZSetOperations.TypedTuple<String> data, PlayerInfoProto.RankResponse.Builder builder) throws Exception { protected void getCrossOptional(int index, ZSetOperations.TypedTuple<String> data, PlayerInfoProto.RankResponse.Builder builder) throws Exception {
GuildCache mapEntry = CrossDeathPathLogic.getCrossGuild(Integer.valueOf(data.getValue())); GuildCache mapEntry = CrossDeathPathLogic.getCrossGuild(Integer.parseInt(data.getValue()));
DeathChallengeCount countInfo = DeathPathLogic.getInstance().getDeathChallengeCount(Integer.valueOf(data.getValue())); DeathChallengeCount countInfo = DeathPathLogic.getInstance().getDeathChallengeCount(Integer.valueOf(data.getValue()));
CommonProto.RankInfo.Builder everyRankInfo = CommonProto.RankInfo.newBuilder() CommonProto.RankInfo.Builder everyRankInfo = CommonProto.RankInfo.newBuilder()
.setRank(index) .setRank(index)

View File

@ -536,9 +536,6 @@ public class RidingSwardLogic{
public static Map<Integer, RidingSwardRank> getRankMap(String subKey){ public static Map<Integer, RidingSwardRank> getRankMap(String subKey){
Map<Integer, RidingSwardRank> map = Map<Integer, RidingSwardRank> map =
RedisUtil.getInstence().getMapValues(RedisKey.RIDING_SWARD_RANK, subKey, Integer.class, RidingSwardRank.class); RedisUtil.getInstence().getMapValues(RedisKey.RIDING_SWARD_RANK, subKey, Integer.class, RidingSwardRank.class);
if (map == null){
return new HashMap<>();
}
return map; return map;
} }
@ -569,9 +566,6 @@ public class RidingSwardLogic{
public static Map<Integer, List<RidingSwardRecord>> getRecordList(int uid){ public static Map<Integer, List<RidingSwardRecord>> getRecordList(int uid){
Type valueType = new TypeToken<List<RidingSwardRecord>>(){}.getType(); Type valueType = new TypeToken<List<RidingSwardRecord>>(){}.getType();
Map<Integer, List<RidingSwardRecord>> map = RedisUtil.getInstence().getMapValues(RedisKey.RIDING_SWARD_RECORD, String.valueOf(uid), int.class, valueType); Map<Integer, List<RidingSwardRecord>> map = RedisUtil.getInstence().getMapValues(RedisKey.RIDING_SWARD_RECORD, String.valueOf(uid), int.class, valueType);
if (map == null){
map = new HashMap<>();
}
return map; return map;
} }

View File

@ -123,7 +123,7 @@ public class BuyGoodsNewLogic {
* *
*/ */
public static void testBuyGoods(ISession session,String goodsId) throws Exception { public static void testBuyGoods(ISession session,String goodsId) throws Exception {
SRechargeCommodityNewConfig sRechargeCommodityConfig = SRechargeCommodityNewConfig.getConfigById(Integer.valueOf(goodsId)); SRechargeCommodityNewConfig sRechargeCommodityConfig = SRechargeCommodityNewConfig.getConfigById(Integer.parseInt(goodsId));
int uid = session.getUid(); int uid = session.getUid();
if(sRechargeCommodityConfig == null){ if(sRechargeCommodityConfig == null){
throw new ErrorCodeException(ErrorCode.CFG_NULL); throw new ErrorCodeException(ErrorCode.CFG_NULL);

View File

@ -272,7 +272,9 @@ public class SessionManager implements INetSession<ISession>, INetReceived<ISess
MessageUtil.sendMessageWithoutBack(session, 1, MessageTypeProto.MessageType.RECONNECT_RESPONSE_VALUE, null, true); MessageUtil.sendMessageWithoutBack(session, 1, MessageTypeProto.MessageType.RECONNECT_RESPONSE_VALUE, null, true);
//挂机探索 //挂机探索
try{ try{
ExplorerMapLogic.getInstance().calOfflineReward(userInMem); if (userInMem != null) {
ExplorerMapLogic.getInstance().calOfflineReward(userInMem);
}
} }
catch (Exception e) { catch (Exception e) {
LOGGER.error("the uid={} ExplorerMapLogic wrong ,e={}",session.getUid(),e); LOGGER.error("the uid={} ExplorerMapLogic wrong ,e={}",session.getUid(),e);

View File

@ -520,8 +520,8 @@ public class ItemUtil {
int[][] randomArray = new int[rewardArr.length][]; int[][] randomArray = new int[rewardArr.length][];
for(int i = 0 ; i <rewardArr.length;i++){ for(int i = 0 ; i <rewardArr.length;i++){
int[] tempArray = new int[2]; int[] tempArray = new int[2];
tempArray[0] =Integer.valueOf(rewardArr[i]); tempArray[0] =Integer.parseInt(rewardArr[i]);
tempArray[1] =Integer.valueOf(weightArr[i]); tempArray[1] =Integer.parseInt(weightArr[i]);
randomArray[i] = tempArray; randomArray[i] = tempArray;
} }