Merge branch 'master_test_gn' into master_prb_gn
commit
f4c37edd1c
|
@ -166,12 +166,12 @@ public enum ErrorCode implements IErrorCode {
|
|||
|
||||
BAG_FULL(135,"背包内存储空间不足,无法领取附件"),
|
||||
|
||||
HONGMENG_ING(139,"英雄在鸿蒙阵中,操作失败"),
|
||||
|
||||
LOCK_FILL(140,"锁定数量已满,无法刷新"),
|
||||
LOCK_FILL(138,"锁定数量已满,无法刷新"),
|
||||
TOWER_NO_SIMPLE_MONSTER(139,"没有小怪,无需使用炸弹"),
|
||||
CHAMPION_BET_GUESS_OVER_TIME(140,"巅峰赛竞猜超时,请重新进入页面"),
|
||||
REDPACKET_DAILY_LIMIT(141,"今日福利红包已达领取上限"),
|
||||
CHAMPION_BET_GUESS_OVER_TIME(142,"巅峰赛竞猜超时,请重新进入页面"),
|
||||
CHAT_NOT_CROSS(143,"聊天检查 没有跨服分组"),
|
||||
HONGMENG_ING(142,"英雄在鸿蒙阵中,操作失败"),
|
||||
CHAT_NOT_CROSS(143,"聊天检查,没有跨服分组"),
|
||||
;
|
||||
private static final Set<Integer> CodeSet = new HashSet<>();
|
||||
|
||||
|
|
|
@ -2834,7 +2834,7 @@ public class MapLogic {
|
|||
Item item1 = user.getItemManager().getItem(item.getId());
|
||||
if(item1!=null){
|
||||
if(item1.getItemId()==0){
|
||||
user.getItemManager().removeItem(0);
|
||||
user.getItemManager().removeItem(item.getId());
|
||||
continue;
|
||||
}
|
||||
System.out.println("======================清理无尽副本道具,玩家:{ " + uid + " },道具id:{ " + item1.getItemId() + " }");
|
||||
|
|
|
@ -627,10 +627,6 @@ public class TowerMap extends AbstractMap {
|
|||
if(mapManager.getTrialInfo().getEnergy()==-1){
|
||||
throw new ErrorCodeException(ErrorCode.USE_BOMB_BOSS);
|
||||
}
|
||||
boolean isUse = ItemUtil.itemCost(user,bomb,BIReason.BOMB_CONSUME,mapManager.getCurMapId());
|
||||
if(!isUse){
|
||||
throw new ErrorCodeException(ErrorCode.USE_BOMB_NO_BOSS);
|
||||
}
|
||||
Map<Integer,SEventPointConfig> sEventPointConfig = STableManager.getConfig(SEventPointConfig.class);
|
||||
Set<Integer> destoryCell = new HashSet<>();
|
||||
Map<Integer, MapPointConfig> configMap = MapPointConfig.scMapEventMap;
|
||||
|
@ -656,6 +652,14 @@ public class TowerMap extends AbstractMap {
|
|||
destoryCell.add(entry.getValue().getPointId());
|
||||
}
|
||||
}
|
||||
if(monsterAmount==0){
|
||||
//没有小怪,无需使用炸弹
|
||||
throw new ErrorCodeException(ErrorCode.TOWER_NO_SIMPLE_MONSTER);
|
||||
}
|
||||
boolean isUse = ItemUtil.itemCost(user,bomb,BIReason.BOMB_CONSUME,mapManager.getCurMapId());
|
||||
if(!isUse){
|
||||
throw new ErrorCodeException(ErrorCode.USE_BOMB_NO_BOSS);
|
||||
}
|
||||
LOGGER.info("几种:{}",mapInfo.size());
|
||||
int[] x = Arrays.stream(destoryCell.toArray(new Integer[destoryCell.size()])).mapToInt(Integer::valueOf).toArray();
|
||||
BehaviorUtil.destoryPoints(user,x);
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
package com.ljsd.jieling.handler.store;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.store.BuyGoodsNewLogic;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import org.springframework.stereotype.Component;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
import rpc.protocols.PlayerInfoProto;
|
||||
|
||||
/**
|
||||
* @author lvxinran
|
||||
* @date 2021/5/10
|
||||
* @discribe
|
||||
*/
|
||||
@Component
|
||||
public class CheckBuyGoodsHandler extends BaseHandler<PlayerInfoProto.CheckBuyGoodsRequest> {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.CHECK_BUY_GOODS_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processWithProto(ISession iSession, PlayerInfoProto.CheckBuyGoodsRequest proto) throws Exception {
|
||||
BuyGoodsNewLogic.checkBuyGoods(iSession,proto.getGoodsId());
|
||||
}
|
||||
}
|
|
@ -208,12 +208,15 @@ public class GlobleSystemLogic implements IEventHandler {
|
|||
|
||||
}
|
||||
public void doSplit(){
|
||||
LOGGER.info("跨服分组验证处理");
|
||||
if(!GameApplication.serverProperties.isArenaCross()){
|
||||
LOGGER.error("跨服分组,测试服不做分组");
|
||||
return;
|
||||
}
|
||||
RedisUtil redisUtil = RedisUtil.getInstence();
|
||||
Object matched = redisUtil.get(RedisKey.MATCHED_SPLIT_KEY);
|
||||
if(matched!=null){
|
||||
LOGGER.error("跨服分组,获取key:【MATCHED_SPLIT_KEY】失败, info:{}",matched.toString());
|
||||
return;
|
||||
}
|
||||
SMServerArenaSetting setting = STableManager.getConfig(SMServerArenaSetting.class).get(1);
|
||||
|
@ -221,8 +224,12 @@ public class GlobleSystemLogic implements IEventHandler {
|
|||
boolean lock = redisUtil.lock("SERVER_SPLIT_REDIS_LOCK", TimeUtils.ONE_MINUTE * 2);
|
||||
if(!lock){
|
||||
//没有拿到锁直接返回
|
||||
LOGGER.error("跨服分组,未获取到锁");
|
||||
return;
|
||||
}
|
||||
// 跨服排行榜处理
|
||||
CrossRankManager.getInstance().cleanCrossRank();
|
||||
|
||||
//这里为所有服务器的世界等级
|
||||
Map<String,Integer> worldLevelMap = redisUtil.getMapValues(RedisKey.SERVER_WORLDLEVE_INFO,"",String.class,Integer.class);
|
||||
LOGGER.info("跨服开始分组");
|
||||
|
@ -252,9 +259,6 @@ public class GlobleSystemLogic implements IEventHandler {
|
|||
|
||||
index++;
|
||||
}
|
||||
// 跨服排行榜处理
|
||||
CrossRankManager.getInstance().cleanCrossRank();
|
||||
CrossRankManager.getInstance().crossRankHandle(true);
|
||||
|
||||
redisUtil.putMapEntrys(RedisKey.SERVER_SPLIT_INFO,"",split);
|
||||
//发分组邮件
|
||||
|
|
|
@ -226,6 +226,9 @@ public class TreasureActivity extends AbstractActivity {
|
|||
private void dropByState(List<int[][]> dropList,int curState,int targetState,int missionId){
|
||||
STreasureSunlongConfig rewardConfig = STreasureSunlongConfig.levelTreasureConfigMap.get(id).get(missionId);
|
||||
if(curState==ActivityType.WILL_TAKE){
|
||||
if(rewardConfig.getReward()==null||rewardConfig.getReward().length<1){
|
||||
return;
|
||||
}
|
||||
dropList.add(rewardConfig.getReward());
|
||||
if(targetState == ActivityType.FINISH_TAKED){
|
||||
dropList.add(rewardConfig.getTreasureReward());
|
||||
|
|
|
@ -214,7 +214,7 @@ public class CrossServiceLogic {
|
|||
if (collect.isEmpty()){
|
||||
continue;
|
||||
}
|
||||
Map<Integer, Long> attribute = HeroLogic.getInstance().calHeroNotBufferAttribute(user, hero, false, teamId);
|
||||
Map<Integer, Long> attribute = HeroLogic.getInstance().calHeroNotBufferAttribute(user, hero, true, teamId);
|
||||
arenaOfHero.putAttributeMapByTeam(teamId,attribute);
|
||||
}
|
||||
return arenaOfHero;
|
||||
|
|
|
@ -23,6 +23,7 @@ import com.ljsd.jieling.logic.activity.event.Poster;
|
|||
import com.ljsd.jieling.logic.dao.*;
|
||||
import com.ljsd.jieling.logic.dao.gm.ArenaOfUser;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.family.CrossDeathPathLogic;
|
||||
import com.ljsd.jieling.logic.fight.*;
|
||||
import com.ljsd.jieling.logic.fight.result.FightResult;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
|
@ -860,7 +861,7 @@ public class ArenaLogic {
|
|||
int server = random.nextInt(groupList.size());
|
||||
rank.addRank(robotIndex,String.valueOf(crossGroup),robotNum-robotIndex);
|
||||
SArenaRobotConfig config = SArenaRobotConfig.getsArenaRobotConfigById(robotIds.get(robotIndex));
|
||||
robotInfo.put(String.valueOf(robotIndex),new CrossArenaEnemy(robotIds.get(robotIndex),robotIndex,groupList.get(server),0,0,random.nextBoolean(),PlayerLogic.getInstance().getRandomName2WithOutVerify(),config.getTotalForce()));
|
||||
robotInfo.put(String.valueOf(robotIndex),new CrossArenaEnemy(robotIds.get(robotIndex),robotIndex,groupList.get(server),0,0,random.nextBoolean(),PlayerLogic.getInstance().getRandomName2WithOutVerify(),config.getTotalForce(),config.getRoleLv()));
|
||||
|
||||
}
|
||||
LOGGER.info("跨服信息初始化结束");
|
||||
|
@ -969,11 +970,12 @@ public class ArenaLogic {
|
|||
Object get = RedisUtil.getInstence().hget(RedisKey.ARENA_PROUD_COUNT, String.valueOf(enemy.getId()));
|
||||
int proudTime = get==null?1:Integer.parseInt((String)get);
|
||||
int enemyId = enemy.getId();
|
||||
String serverName = CrossDeathPathLogic.getInstance().getServerNameByDeathPath(enemy.getPlayerManager().getServerId());
|
||||
CommonProto.ArenaPersonInfo personInfoBuild = CommonProto.ArenaPersonInfo.newBuilder()
|
||||
.setUid(enemyId)
|
||||
.setLevel(enemy.getPlayerManager().getLevel())
|
||||
.setName(enemy.getPlayerManager().getName())
|
||||
.setServername(enemy.getPlayerManager().getServerName())
|
||||
.setServername(serverName)
|
||||
.setTotalForce(enemy.getHeroManager().getTotalForce())
|
||||
.setUserTitle(enemy.getPlayerManager().getUserTitle())
|
||||
.setUserMount(enemy.getPlayerManager().getUserMount())
|
||||
|
@ -993,13 +995,14 @@ public class ArenaLogic {
|
|||
int enemyId = enemy.getEnemyId();
|
||||
SArenaRobotConfig sArenaRobotConfig = SArenaRobotConfig.getsArenaRobotConfigById(enemyId);
|
||||
CommonProto.Team teamBuild = CommonProto.Team.newBuilder().addAllHeroTid(sArenaRobotConfig.getHeroList()).build();
|
||||
String serverName = CrossDeathPathLogic.getInstance().getServerNameByDeathPath(enemy.getServerID());
|
||||
CommonProto.ArenaPersonInfo personInfoBuild = CommonProto.ArenaPersonInfo.newBuilder()
|
||||
.setUid(enemy.getEnemyId_UUid())
|
||||
.setLevel(sArenaRobotConfig.getRobotLevel())
|
||||
.setName(enemy.getRandomName()==null?"":enemy.getRandomName())
|
||||
.setScore(sArenaRobotConfig.getRobotScore())
|
||||
.setTotalForce(sArenaRobotConfig.getTotalForce())
|
||||
.setServername(CrossServiceLogic.getInstance().findServerName(enemy.getServerID()))
|
||||
.setServername(serverName)
|
||||
.setUserSkin(80012)
|
||||
.setGender(enemy.isGender()?1:0)
|
||||
.setRank(rank)
|
||||
|
|
|
@ -17,6 +17,7 @@ public class CrossArenaEnemy {
|
|||
private boolean gender;
|
||||
private String randomName;
|
||||
private int totalForce;
|
||||
private int level;
|
||||
|
||||
public CrossArenaEnemy(int enemyId, int enemyId_UUid, int serverID, int enemyType, int enemyStatus, int rank) {
|
||||
this.enemyId = enemyId;
|
||||
|
@ -27,12 +28,13 @@ public class CrossArenaEnemy {
|
|||
this.rank = rank;
|
||||
}
|
||||
|
||||
public CrossArenaEnemy(int enemyId,int enemyId_UUid, int serverID, int enemyType, int enemyStatus,boolean gender,String randomName,int totalForce) {
|
||||
public CrossArenaEnemy(int enemyId,int enemyId_UUid, int serverID, int enemyType, int enemyStatus,boolean gender,String randomName,int totalForce,int level) {
|
||||
|
||||
this(enemyId,enemyId_UUid,serverID,enemyType,enemyStatus);
|
||||
this.gender=gender;
|
||||
this.randomName = randomName;
|
||||
this.totalForce = totalForce;
|
||||
this.level = level;
|
||||
}
|
||||
public CrossArenaEnemy(int enemyId,int enemyId_UUid, int serverID, int enemyType, int enemyStatus) {
|
||||
this.enemyId = enemyId;
|
||||
|
@ -91,4 +93,8 @@ public class CrossArenaEnemy {
|
|||
public int getTotalForce() {
|
||||
return totalForce;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -823,7 +823,7 @@ public class GuildLogic {
|
|||
throw new ErrorCodeException(ErrorCode.FAMILY_IN_SENSITIVE);
|
||||
}else{
|
||||
if(type==1){
|
||||
if(content.length()<0||content.length()>32){
|
||||
if(content.length() > 32){
|
||||
throw new ErrorCodeException(ErrorCode.ANNOUNCE_SIZE);
|
||||
}
|
||||
guildInfo.setAnnounce(content);
|
||||
|
@ -835,6 +835,8 @@ public class GuildLogic {
|
|||
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
||||
}
|
||||
guildInfo.setName(content);
|
||||
// 缓存同步
|
||||
RedisUtil.getInstence().putMapEntry(RedisKey.FAMILY_INFO,"",String.valueOf(guildInfo.getId()),GuildCache.create(guildInfo));
|
||||
}
|
||||
MessageUtil.sendMessage(session,resultCode,msgId,response,true);
|
||||
}
|
||||
|
|
|
@ -434,9 +434,10 @@ public class MailLogic {
|
|||
public void sendCrossServerIndication(){
|
||||
int crossGroup = GlobleSystemLogic.getInstence().getCrossGroup();
|
||||
int result = crossGroup == -1 ? 0 : 1;
|
||||
PlayerInfoProto.IsCrossResponse build = PlayerInfoProto.IsCrossResponse.newBuilder().setIsCross(result).build();
|
||||
PlayerInfoProto.IsCrossIndication build = PlayerInfoProto.IsCrossIndication.newBuilder().setIsCross(result).build();
|
||||
for(ISession session:OnlineUserManager.sessionMap.values()){
|
||||
MessageUtil.sendIndicationMessage(session.getUid(),build);
|
||||
LOGGER.info("=====================开始跨服,推送数据到玩家信息:{},分组id:{}",session.getUid(),crossGroup);
|
||||
MessageUtil.sendIndicationMessage(session,1,MessageTypeProto.MessageType.IsCrossIndication_VALUE,build,true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -771,6 +771,7 @@ public class PlayerLogic {
|
|||
}
|
||||
CommonProto.Hero.Builder heroBuilder = CommonProto.Hero.newBuilder().setLevel(hero.getLevel()).setEspecialEquipLevel(hero.getEspecialEquipLevel()).setStar(hero.getStar()).setId(hero.getId()).setHeroId(hero.getTemplateId()).setBreakId(hero.getBreakId()).setStarBreakId(hero.getStarBreakId());
|
||||
PlayerInfoProto.ViewHeroInfoResponse.Builder builder = PlayerInfoProto.ViewHeroInfoResponse.newBuilder();
|
||||
|
||||
Map<Integer, Long> heroNotBufferAttribute = hero.getAttributeMapByTeam().getOrDefault(teamId,new HashMap<>());
|
||||
for(Map.Entry<Integer,Long> item : heroNotBufferAttribute.entrySet()){
|
||||
builder.addSpecialEffects(CommonProto.SpecialEffects.newBuilder().setPropertyId(item.getKey()).setPropertyValue(item.getValue().intValue()).build());
|
||||
|
|
|
@ -47,16 +47,13 @@ public class CrossRankManager {
|
|||
* 跨服排行处理
|
||||
*/
|
||||
public void crossRankHandle(boolean choice){
|
||||
if (choice || !isTime()){
|
||||
// 不是处理数据的服务器
|
||||
return;
|
||||
}
|
||||
for (RankEnum value : RankEnum.values()) {
|
||||
int type = value.getType();
|
||||
boolean rank2 = RankContext.isCrossRank2(type);
|
||||
if (rank2){
|
||||
// 时间验证
|
||||
if (isTime()){
|
||||
// 全部排行遍历
|
||||
for (RankEnum value : RankEnum.values()) {
|
||||
int type = value.getType();
|
||||
//跨服
|
||||
if(RankContext.isCrossRank(type)){
|
||||
if(RankContext.isCrossRank2(type) && RankContext.isCrossRank(type)){
|
||||
// 获取分组id,是否跨服
|
||||
int crossGroup = GlobleSystemLogic.getInstence().getCrossGroup();
|
||||
if(crossGroup != -1){
|
||||
|
@ -69,7 +66,7 @@ public class CrossRankManager {
|
|||
rank.crossUserCache(Integer.parseInt(tuple.getValue()));
|
||||
}else {
|
||||
GuildCache cache = cacheMap.get(Integer.valueOf(tuple.getValue()));
|
||||
if (cache != null){
|
||||
if (cache != null && cache.getLeaderUId() != 0){
|
||||
rank.crossUserCache(cache.getLeaderUId());
|
||||
}
|
||||
}
|
||||
|
@ -114,17 +111,16 @@ public class CrossRankManager {
|
|||
public void cleanCrossRank(){
|
||||
for (RankEnum value : RankEnum.values()) {
|
||||
int type = value.getType();
|
||||
if (RankContext.isCrossRank2(type)) {
|
||||
//跨服
|
||||
if (RankContext.isCrossRank(type)) {
|
||||
// 获取分组id,是否跨服
|
||||
int crossGroup = GlobleSystemLogic.getInstence().getCrossGroup();
|
||||
if (crossGroup != -1) {
|
||||
AbstractRank rank = RankContext.getRankEnum(type);
|
||||
String key = RedisUtil.getInstence().getKey(rank.getCrossRedisKey(),"",false);
|
||||
RedisUtil.getInstence().del(key);
|
||||
LOGGER.info("=====================跨服排行榜清理========,key:{}", key);
|
||||
}
|
||||
//跨服
|
||||
if (RankContext.isCrossRank2(type) && RankContext.isCrossRank(type)) {
|
||||
// 获取分组id,是否跨服
|
||||
int crossGroup = GlobleSystemLogic.getInstence().getCrossGroup();
|
||||
if (crossGroup != -1) {
|
||||
AbstractRank rank = RankContext.getRankEnum(type);
|
||||
String key = RedisUtil.getInstence().getKey(rank.getCrossRedisKey(),"",false);
|
||||
RedisUtil.getInstence().del(key);
|
||||
time = 0L;
|
||||
LOGGER.info("=====================跨服排行榜清理========,key:{},time:{}",key,time);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -252,7 +252,6 @@ public abstract class AbstractRank implements IRank {
|
|||
}
|
||||
|
||||
private CommonProto.UserRank.Builder getOneUserRank(User everyUser,CommonProto.RankInfo.Builder everyRankInfo){
|
||||
String serverName = CrossServiceLogic.getInstance().getServerNameByUId(everyUser.getId());
|
||||
return CommonProto.UserRank.newBuilder()
|
||||
.setUid(everyUser.getId())
|
||||
.setUserName(everyUser.getPlayerInfoManager().getNickName())
|
||||
|
@ -265,8 +264,7 @@ public abstract class AbstractRank implements IRank {
|
|||
.setUserSkin(everyUser.getPlayerInfoManager().getUserSkin())
|
||||
.setUserTitle(everyUser.getPlayerInfoManager().getUserTitle())
|
||||
.setUserMount(everyUser.getPlayerInfoManager().getUserMount())
|
||||
.setPracticeLevel(everyUser.getHeroManager().getPracticeLevel())
|
||||
.setServerName(serverName);
|
||||
.setPracticeLevel(everyUser.getHeroManager().getPracticeLevel());
|
||||
}
|
||||
|
||||
public CommonProto.UserRank.Builder getCrossOneUserRank(ArenaOfUser query, CommonProto.RankInfo.Builder everyRankInfo){
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.ljsd.jieling.db.redis.RedisUtil;
|
|||
import com.ljsd.jieling.logic.GlobleSystemLogic;
|
||||
import com.ljsd.jieling.logic.activity.crossService.CrossServiceLogic;
|
||||
import com.ljsd.jieling.logic.dao.CrossArenaEnemy;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.gm.ArenaOfUser;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import config.SArenaRobotConfig;
|
||||
|
@ -13,6 +14,7 @@ import rpc.protocols.CommonProto;
|
|||
import rpc.protocols.PlayerInfoProto;
|
||||
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author lvxinran
|
||||
|
@ -62,7 +64,7 @@ public class CrossArenaRank extends AbstractRank {
|
|||
CommonProto.UserRank.Builder everyRank = CommonProto.UserRank.newBuilder()
|
||||
.setUid(mapEntry.getEnemyId_UUid())
|
||||
.setUserName(mapEntry.getRandomName())
|
||||
.setLevel(100)
|
||||
.setLevel(mapEntry.getLevel()==0?100:mapEntry.getLevel())
|
||||
.setUserSkin(80012)
|
||||
.setRankInfo(everyRankInfo)
|
||||
.setServerName(CrossServiceLogic.getInstance().findServerName(mapEntry.getServerID()))
|
||||
|
@ -88,9 +90,10 @@ public class CrossArenaRank extends AbstractRank {
|
|||
.setServerName(query.getPlayerManager().getServerName())
|
||||
.setSex(0);
|
||||
builder.addRanks(everyRank);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void getMyInfo(User user, String rkey, PlayerInfoProto.RankResponse.Builder allUserResponse){
|
||||
int myRank= RedisUtil.getInstence().getZSetreverseRank(redisKey,rkey,Integer.toString(user.getId())).intValue();
|
||||
Double zSetScore = RedisUtil.getInstence().getZSetScore(redisKey, rkey, Integer.toString(user.getId()));
|
||||
|
@ -108,6 +111,23 @@ public class CrossArenaRank extends AbstractRank {
|
|||
|
||||
@Override
|
||||
public PlayerInfoProto.RankResponse getCrossRank(int uid, String rkey, int page, int rankEndLine) throws Exception {
|
||||
return getRank(uid,rkey,page,rankEndLine);
|
||||
if(rankEndLine==-1){
|
||||
rankEndLine = 100;
|
||||
}
|
||||
User user = UserManager.getUser(uid);
|
||||
if (page == 0) {
|
||||
page = 1;
|
||||
}
|
||||
int start = (page - 1) * rankEndLine, end = page * rankEndLine - 1;
|
||||
int crossGroup = GlobleSystemLogic.getInstence().getCrossGroup();
|
||||
Set<ZSetOperations.TypedTuple<String>> scores =
|
||||
RedisUtil.getInstence().getZsetreverseRangeWithScores(redisKey, String.valueOf(crossGroup), start, end, false);
|
||||
if(start % rankEndLine == 0){
|
||||
start++;
|
||||
}
|
||||
PlayerInfoProto.RankResponse.Builder allUserResponse = getCrossAllUserResponse(scores,start);
|
||||
//当前用户信息
|
||||
getCrossMyInfo(user,rkey,allUserResponse);
|
||||
return allUserResponse.build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.ljsd.jieling.logic.rank.rankImpl;
|
|||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.PlayerInfoProto;
|
||||
import org.springframework.data.redis.core.ZSetOperations;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
@ -60,6 +61,6 @@ public class MainLevelRank extends AbstractRank {
|
|||
|
||||
@Override
|
||||
public double getScore(double... data) {
|
||||
return data[0]+ data[1]/Math.pow(10,8);
|
||||
return data[0]+ TimeUtils.getDoubleTime();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.ljsd.jieling.logic.rank.rankImpl;
|
||||
|
||||
import util.TimeUtils;
|
||||
|
||||
public class ShanHeSheJiTuChapterRank extends AbstractRank{
|
||||
|
||||
public ShanHeSheJiTuChapterRank(int type, String redisKey) {
|
||||
|
@ -12,7 +14,7 @@ public class ShanHeSheJiTuChapterRank extends AbstractRank{
|
|||
|
||||
@Override
|
||||
public double getScore(double... data) {
|
||||
return data[0];
|
||||
return data[0]+ TimeUtils.getDoubleTime();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.ljsd.jieling.logic.rank.rankImpl;
|
||||
|
||||
import util.TimeUtils;
|
||||
|
||||
public class ShanHeSheJiTuStarRank extends AbstractRank{
|
||||
|
||||
public ShanHeSheJiTuStarRank(int type, String redisKey) {
|
||||
|
@ -12,7 +14,7 @@ public class ShanHeSheJiTuStarRank extends AbstractRank{
|
|||
|
||||
@Override
|
||||
public double getScore(double... data) {
|
||||
return data[0];
|
||||
return data[0]+ TimeUtils.getDoubleTime();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,6 +4,8 @@ import com.ljsd.GameApplication;
|
|||
import com.ljsd.jieling.config.reportData.DataMessageUtils;
|
||||
import com.ljsd.jieling.core.VipPrivilegeType;
|
||||
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.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
|
@ -723,7 +725,7 @@ public class BuyGoodsNewLogic {
|
|||
}
|
||||
}
|
||||
|
||||
private static int judgePushCondition(User user,SPackPushConfig con){
|
||||
private static int judgePushCondition(User user,SPackPushConfig con){
|
||||
int[] scope = con.getScopeId();
|
||||
if(scope[0] == 1){//主线关卡
|
||||
int mainLevel = user.getMainLevelManager().getFightId();
|
||||
|
@ -850,4 +852,31 @@ public class BuyGoodsNewLogic {
|
|||
}
|
||||
return i;
|
||||
}
|
||||
public static void checkBuyGoods(ISession session,int goodsId) throws Exception {
|
||||
int uid = session.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
SRechargeCommodityNewConfig sRechargeCommodityConfig =SRechargeCommodityNewConfig.getConfigById(goodsId);
|
||||
if(null ==sRechargeCommodityConfig) {
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
//todo 这里要加购买礼包的校验,然后把发货时的校验删掉
|
||||
String order ;
|
||||
if(sRechargeCommodityConfig.getPrice()==0){
|
||||
order = "0";//免费礼包不需要订单号
|
||||
}else {
|
||||
//生成cp订单号
|
||||
order = createOrder(user);
|
||||
// CPOrder cpOrder = new CPOrder(order, String.valueOf(TimeUtils.now()), String.valueOf(goodsId));
|
||||
// RedisUtil.getInstence().set(RedisKey.CP_ORDER,order,cpOrder);
|
||||
}
|
||||
PlayerInfoProto.CheckBuyGoodsResponse response = PlayerInfoProto.CheckBuyGoodsResponse.newBuilder().setOrderId(order).build();
|
||||
|
||||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.CHECK_BUY_GOODS_RESPONSE_VALUE,response);
|
||||
|
||||
|
||||
}
|
||||
private static String createOrder(User user){
|
||||
return KeyGenUtils.produceIdByModule(UUIDEnum.ORDER, user.getId());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,13 +1,8 @@
|
|||
package com.ljsd.jieling.thread.task;
|
||||
|
||||
import com.ljsd.GameApplication;
|
||||
import com.ljsd.jieling.config.reportData.DataMessageUtils;
|
||||
import com.ljsd.jieling.ktbeans.ReportUserEvent;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
@Component
|
||||
public class DataReportTask extends Thread {
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ import com.ljsd.jieling.logic.dao.*;
|
|||
import com.ljsd.jieling.logic.dao.gm.ArenaOfHero;
|
||||
import com.ljsd.jieling.logic.dao.root.GuildInfo;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.family.CrossDeathPathLogic;
|
||||
import com.ljsd.jieling.logic.fight.CombatLogic;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.logic.store.newRechargeInfo.NewRechargeInfo;
|
||||
|
@ -550,7 +551,8 @@ public class CBean2Proto {
|
|||
chatInfo.setMessageId(messageId);
|
||||
chatInfo.setUserTitle(playerInfoManager.getUserTitle());
|
||||
chatInfo.setPracticeLevel(user.getHeroManager().getPracticeLevel());
|
||||
chatInfo.setServerName(CrossServiceLogic.getInstance().findServerName(GameApplication.serverId));
|
||||
String serverName = CrossDeathPathLogic.getInstance().getServerNameByDeathPath(GameApplication.serverId);
|
||||
chatInfo.setServerName(serverName);
|
||||
return chatInfo.build();
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ public enum UUIDEnum {
|
|||
JEWEL(10),
|
||||
SpecialMonster(11),
|
||||
ROBOT_UUID(12),
|
||||
ORDER(13),
|
||||
HardStage(15),
|
||||
;
|
||||
|
||||
|
|
Loading…
Reference in New Issue