Merge branch 'master_prb_gn' into master_test_gn

back_recharge
jiahuiwen 2022-01-18 16:32:14 +08:00
commit 64fc286053
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) {
result.setResultMsg("Cmd Illegal");
LOGGER.error("e={}",ex.getMessage());
ex.getMessage();
return result;
}
result.setResultCode(0);

View File

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

View File

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

View File

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

View File

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

View File

@ -23,7 +23,7 @@ public class MongoPropertyConverter implements Converter<BasicDBObject, Property
return null;
}
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){
target = Jewel.class;
}else {

View File

@ -52,7 +52,7 @@ public class MongoUtiltest {
}
}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);
boolean enoughCost = false;
for (int[] cost:sLotterySetting.getCostItem()){
int [][] costItems = new int[][]{cost};
Map<Integer, Integer> cost1 = new HashMap<>(1);
cost1.put(cost[0], cost[1]);
enoughCost = ItemUtil.checkCost(user, cost1);

View File

@ -34,8 +34,8 @@ public class CrossLingmaiSecretAreaRecordHandler extends BaseHandler<ArenaInfoPr
ArenaInfoProto.CrossLingmaiSecretAreaRecordResponse.Builder builder = ArenaInfoProto.CrossLingmaiSecretAreaRecordResponse.newBuilder();
RedisUtil redisUtil = RedisUtil.getInstence();
List<String> list = redisUtil.lGet(RedisKey.CROSS_LINGMAISECRET_RECORD, String.valueOf(uid), 0, -1);
Collections.reverse(list);
if (list != null) {
Collections.reverse(list);
for (String s : list) {
ArenaRecord arenaRecord = new Gson().fromJson(s, ArenaRecord.class);
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());
if (myQuery != null) {
CrossServiceLogic.update(myQuery);
}
CrossServiceLogic.update(myQuery);
if (defQuery != null) {
CrossServiceLogic.update(defQuery);
}

View File

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

View File

@ -3336,7 +3336,9 @@ public class MapLogic {
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) {
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}

View File

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

View File

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

View File

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

View File

@ -58,7 +58,7 @@ public class ArenaWorldLogic {
public static boolean checkOpen(String uid) throws Exception{
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, "");
Object result = RedisUtil.getInstence().get(key);
if (result != null) {
schedule = Integer.valueOf((String) result);
schedule = Integer.parseInt((String) result);
}
}catch (Exception e){
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);
Map<Integer, SArenaRobotConfig> robotConfigMap = STableManager.getConfig(SArenaRobotConfig.class);
int nowTime = (int) (TimeUtils.now() / 1000);
Set<Integer> joinUids = new HashSet<>(128);
// Set<Integer> joinUids = new HashSet<>(128);
try {
for (ZSetOperations.TypedTuple<String> item : arenaRankInfo) {
String uidStr = item.getValue();
@ -407,7 +407,7 @@ public class ChampionshipLogic {
rank++;
continue;
}
joinUids.add(uid);
// joinUids.add(uid);
User user = UserManager.getUser(uid);
SChampionshipReward sChampionshipReward = rewardsMap.get(rank);
if (user.getArenaManager().getTopMaxRank() == 0 || user.getArenaManager().getTopMaxRank() > rank) {

View File

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

View File

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

View File

@ -1206,7 +1206,7 @@ public class HeroLogic {
if (teamId == TeamEnum.ENDLESS_TEAM.getTeamId()) {
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId);
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());
List<MapInfoProto.HeroInfo> indiHeros = new ArrayList<>();
for (TeamPosHeroInfo heroInfo : teamPosHeroInfos) {
@ -1232,7 +1232,7 @@ public class HeroLogic {
heroAllAttribute.put(HeroAttributeEnum.CurHP.getPropertyId(), 10000L);
}
heroAllAttributeMap.put(hero.getId(), heroAllAttribute);
heroes.add(heroInfo.getHeroId());
// heroes.add(heroInfo.getHeroId());
MapInfoProto.HeroInfo indiInfo = MapInfoProto.HeroInfo.newBuilder().setHeroId(heroInfo.getHeroId())
.setHeroHp(heroAllAttribute.get(HeroAttributeEnum.CurHP.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 {
int uid = session.getUid();
User user = UserManager.getUser(uid);
SWorkShopFoundationConfig sWorkShopFoundationConfig = SWorkShopFoundationConfig.getShopFoundationConfigMap().get(materialId);
if(!checkIsUnlock(GlobalsDef.WORK_BASE_TYPE,sWorkShopFoundationConfig.getType(),user.getWorkShopController(),sWorkShopFoundationConfig.getOpenRules(),sWorkShopFoundationConfig.getId())){
throw new ErrorCodeException(ErrorCode.newDefineCode("未开"));
}
int[][] cost = sWorkShopFoundationConfig.getCost();
int[][] reallyCost = times2Array(cost, nums);
if( !ItemUtil.itemCost(user, reallyCost,BIReason.WORKSHOP_CREATEMATERIAL_CONSUME,materialId)){
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
}
Map<Integer,Long> finalMaterial = new HashMap<>();
finalMaterial.put(materialId, (long) (nums*sWorkShopFoundationConfig.getNum()));
ItemUtil.addItem(user,finalMaterial,null, BIReason.WORKSHOP_CREATEMATERIAL);
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.WORKSHOP_FOUNDATION_RESPONSE_VALUE,null,true);
}
// public void createMaterialByUser(ISession session, int materialId, int nums) throws Exception {
// int uid = session.getUid();
// User user = UserManager.getUser(uid);
// SWorkShopFoundationConfig sWorkShopFoundationConfig = SWorkShopFoundationConfig.getShopFoundationConfigMap().get(materialId);
// if(!checkIsUnlock(GlobalsDef.WORK_BASE_TYPE,sWorkShopFoundationConfig.getType(),user.getWorkShopController(),sWorkShopFoundationConfig.getOpenRules(),sWorkShopFoundationConfig.getId())){
// throw new ErrorCodeException(ErrorCode.newDefineCode("未开"));
// }
// int[][] cost = sWorkShopFoundationConfig.getCost();
// int[][] reallyCost = times2Array(cost, nums);
// if( !ItemUtil.itemCost(user, reallyCost,BIReason.WORKSHOP_CREATEMATERIAL_CONSUME,materialId)){
// throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
// }
// Map<Integer,Long> finalMaterial = new HashMap<>();
// finalMaterial.put(materialId, (long) (nums*sWorkShopFoundationConfig.getNum()));
// ItemUtil.addItem(user,finalMaterial,null, BIReason.WORKSHOP_CREATEMATERIAL);
//
// MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.WORKSHOP_FOUNDATION_RESPONSE_VALUE,null,true);
// }
//装备打造 TODO
//装备重铸

View File

@ -60,24 +60,4 @@ public class MailCache {
public void setValidTime(int 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);
return oneInfo.build();
if (oneInfo != null) {
return oneInfo.build();
}
return null;
}
//玉虚论道
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);
builder.addRanks(everyRank);
}else{
CSPlayer query = CrossServiceLogic.getPlayerByRedis(Integer.valueOf(data.getValue()));
CSPlayer query = CrossServiceLogic.getPlayerByRedis(Integer.parseInt(data.getValue()));
if (query == null){
return;
}

View File

@ -35,7 +35,7 @@ public class CrossYuXuLunDaoPersonRank extends CrossYuXuLunDaoRank{
@Override
protected void getCrossOptional(int index, ZSetOperations.TypedTuple<String> data, PlayerInfoProto.RankResponse.Builder builder) throws Exception {
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){
return;
}

View File

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

View File

@ -60,7 +60,7 @@ public class DeathPathTotalGuildRank extends CrossGuildForceRank{
@Override
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()));
CommonProto.RankInfo.Builder everyRankInfo = CommonProto.RankInfo.newBuilder()
.setRank(index)

View File

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

View File

@ -123,7 +123,7 @@ public class BuyGoodsNewLogic {
*
*/
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();
if(sRechargeCommodityConfig == 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);
//挂机探索
try{
ExplorerMapLogic.getInstance().calOfflineReward(userInMem);
if (userInMem != null) {
ExplorerMapLogic.getInstance().calOfflineReward(userInMem);
}
}
catch (Exception 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][];
for(int i = 0 ; i <rewardArr.length;i++){
int[] tempArray = new int[2];
tempArray[0] =Integer.valueOf(rewardArr[i]);
tempArray[1] =Integer.valueOf(weightArr[i]);
tempArray[0] =Integer.parseInt(rewardArr[i]);
tempArray[1] =Integer.parseInt(weightArr[i]);
randomArray[i] = tempArray;
}