公会副本提交

back_recharge
lvxinran 2020-08-22 15:38:31 +08:00
parent c6a0354f81
commit 146c394e7a
15 changed files with 362 additions and 42 deletions

View File

@ -223,7 +223,7 @@ function BattleMain.Execute(args, fightData, optionData)
Random.SetSeed(args.seed)
BattleLogic.Init(fightData, optionData, _maxRound)
BattleLogic.Type = _type
if _type == 9 or _type == 10 or _type == 11 then
if _type == 9 or _type == 10 or _type == 11 or _type == 14 then
AddRecord(fightData)
end
BattleLogic.StartOrder()
@ -235,16 +235,18 @@ function BattleMain.Execute(args, fightData, optionData)
isError = true
errorCache = "error:\n"..debug.traceback(err).."\n"
end) then
local resultList = {}
local resultList = {0, 0, 0, 0, 0, 0}
if BattleLogic.Result == 1 then --胜利记录我方剩余血量
local arr = RoleManager.Query(function (r) return r.camp == 0 end, true)
for i=1, #arr do
resultList[i] = arr[i]:GetRoleData(RoleDataName.Hp)
local pos = arr[i].position
resultList[pos] = arr[i]:GetRoleData(RoleDataName.Hp)
end
elseif BattleLogic.Result == 0 then --失败记录敌方剩余血量
local arr = RoleManager.Query(function (r) return r.camp == 1 end, true)
for i=1, #arr do
resultList[i] = arr[i]:GetRoleData(RoleDataName.Hp)
local pos = arr[i].position
resultList[pos] = arr[i]:GetRoleData(RoleDataName.Hp)
end
end
@ -274,7 +276,7 @@ function BattleMain.Execute(args, fightData, optionData)
resultList.result = BattleLogic.Result
end
if _type == 10 or _type == 11 then -- 公会boss和车迟斗法boss返回伤害值
if _type == 10 or _type == 11 or _type == 14 then -- 公会boss和车迟斗法boss返回伤害值
local playerDamage=0
for k,v in pairs(BattleRecord)do
if v.camp == 0 then

View File

@ -1,5 +1,6 @@
package com.ljsd.jieling.config.clazzStaticCfg;
import config.SGuildCheckpointRank;
import config.SRaceTowerRewardConfig;
import manager.AbstractClassStaticConfig;
import manager.STableManager;
@ -17,10 +18,12 @@ import java.util.Set;
public class RewardStaticConfig extends AbstractClassStaticConfig {
private static Map<Integer,SRaceTowerRewardConfig> raceRewardConfigMap;
private static Map<Integer,Map<Integer,SGuildCheckpointRank>> guildChallengeConfigMap;
@Override
public void registConfigs(Set<String> registConfigs) {
registConfigs.add(SRaceTowerRewardConfig.class.getAnnotation(Table.class).name());
registConfigs.add(SGuildCheckpointRank.class.getAnnotation(Table.class).name());
}
@ -35,9 +38,28 @@ public class RewardStaticConfig extends AbstractClassStaticConfig {
}
raceRewardConfigMap = raceRewardConfigMapTemp;
Map<Integer,Map<Integer,SGuildCheckpointRank>> guildChallengeConfigMapTemp = new HashMap<>();
for(SGuildCheckpointRank value:STableManager.getConfig(SGuildCheckpointRank.class).values()){
guildChallengeConfigMapTemp.putIfAbsent(value.getGuildCheckpoint(), new HashMap<>());
int min = value.getMinRank();
int max = value.getMaxRank();
for(int i = min;i<=max;i++){
guildChallengeConfigMapTemp.get(value.getGuildCheckpoint()).put(i,value);
}
}
guildChallengeConfigMap = guildChallengeConfigMapTemp;
}
public static Map<Integer, SRaceTowerRewardConfig> getRaceRewardConfigMap() {
return raceRewardConfigMap;
}
public static Map<Integer, Map<Integer, SGuildCheckpointRank>> getGuildChallengeConfigMap() {
return guildChallengeConfigMap;
}
}

View File

@ -265,6 +265,7 @@ public interface BIReason {
int DAILY_SCORE_CONSUME = 1063;//删除日常任务积分
int EQUIP_WEAR_CONSUME = 1064;
int GUILD_CHALLENGE_BUFF_BUY_CONSUME = 1065;//公会副本购买buff

View File

@ -0,0 +1,27 @@
package com.ljsd.jieling.handler.family.guildChallenge;
import com.ljsd.jieling.handler.BaseHandler;
import com.ljsd.jieling.logic.family.GuildChallengeLogic;
import com.ljsd.jieling.netty.cocdex.PacketNetData;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.protocols.MessageTypeProto;
import org.springframework.stereotype.Component;
/**
* @author lvxinran
* @date 2020/8/21
* @discribe
*/
@Component
public class GuildChallengeBuyBuffHandler extends BaseHandler {
@Override
public MessageTypeProto.MessageType getMessageCode() {
return MessageTypeProto.MessageType.GUILD_CHALLENGE_BUY_BUFF_REQUEST;
}
@Override
public void process(ISession iSession, PacketNetData netData) throws Exception {
GuildChallengeLogic.getInstance().buyBuff(iSession, MessageTypeProto.MessageType.GUILD_CHALLENGE_BUY_BUFF_RESPONSE);
}
}

View File

@ -0,0 +1,26 @@
package com.ljsd.jieling.handler.family.guildChallenge;
import com.ljsd.jieling.handler.BaseHandler;
import com.ljsd.jieling.logic.family.GuildChallengeLogic;
import com.ljsd.jieling.netty.cocdex.PacketNetData;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.protocols.MessageTypeProto;
import org.springframework.stereotype.Component;
/**
* @author lvxinran
* @date 2020/8/21
* @discribe
*/
@Component
public class GuildSendChallengeMessageHandler extends BaseHandler {
@Override
public MessageTypeProto.MessageType getMessageCode() {
return MessageTypeProto.MessageType.GUILD_CHALLENGE_SEND_MESSAGE_REQUEST;
}
@Override
public void process(ISession iSession, PacketNetData netData) throws Exception {
GuildChallengeLogic.getInstance().sendChallengeMessage(iSession,MessageTypeProto.MessageType.GUILD_CHALLENGE_SEND_MESSAGE_RESPONSE);
}
}

View File

@ -48,6 +48,8 @@ public class GuildMyInfo extends MongoBase {
public void clearOfLevelGuild(){
path.clear();
curPos = STableManager.getFigureConfig(CommonStaticConfig.class).getInitPos();
guildChallengeDamage = 0;
lastMonsterId = 0;
setCurPos(curPos);
//更新的是new ArrayList<>() 再加上指令更新优化 大key的存在 原path将更新不进去
//setPath(new ArrayList<>());

View File

@ -60,6 +60,12 @@ public class GuildInfo extends MongoBase {
private int bossHpRemain;
private int buffIndex;
private int buffOverTime;
private int nextChallengeMessageTime;
public GuildInfo() {
setRootCollection(_COLLECTION_NAME);
}
@ -288,4 +294,33 @@ public class GuildInfo extends MongoBase {
this.bossHpRemain = bossHpRemain;
updateString("bossHpRemain",bossHpRemain);
}
public int getBuffIndex() {
return buffIndex;
}
public void setBuffIndex(int buffIndex) {
this.buffIndex = buffIndex;
updateString("buffIndex",buffIndex);
}
public int getBuffOverTime() {
return buffOverTime;
}
public void setBuffOverTime(int buffOverTime) {
this.buffOverTime = buffOverTime;
updateString("buffOverTime",buffOverTime);
}
public int getNextChallengeMessageTime() {
return nextChallengeMessageTime;
}
public void setNextChallengeMessageTime(int nextChallengeMessageTime) {
this.nextChallengeMessageTime = nextChallengeMessageTime;
updateString("nextChallengeMessageTime",nextChallengeMessageTime);
}
}

View File

@ -1,8 +1,12 @@
package com.ljsd.jieling.logic.family;
import com.ljsd.jieling.config.clazzStaticCfg.RewardStaticConfig;
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;
import com.ljsd.jieling.globals.Global;
import com.ljsd.jieling.logic.dao.GuildMyInfo;
import com.ljsd.jieling.logic.dao.GuilidManager;
import com.ljsd.jieling.logic.dao.UserManager;
@ -12,6 +16,7 @@ import com.ljsd.jieling.logic.fight.FightDispatcher;
import com.ljsd.jieling.logic.fight.GameFightType;
import com.ljsd.jieling.logic.fight.PVEFightEvent;
import com.ljsd.jieling.logic.fight.result.FightResult;
import com.ljsd.jieling.logic.mail.MailLogic;
import com.ljsd.jieling.logic.player.PlayerLogic;
import com.ljsd.jieling.logic.rank.RankContext;
import com.ljsd.jieling.logic.rank.RankEnum;
@ -22,13 +27,15 @@ import com.ljsd.jieling.protocols.Family;
import com.ljsd.jieling.protocols.MessageTypeProto;
import com.ljsd.jieling.util.ItemUtil;
import com.ljsd.jieling.util.MessageUtil;
import config.SErrorCodeEerverConfig;
import config.SGuildCheckpointConfig;
import config.SGuildCheckpointRank;
import config.SRaceTowerRewardConfig;
import manager.STableManager;
import org.springframework.data.redis.core.ZSetOperations;
import util.TimeUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
/**
@ -48,7 +55,7 @@ public class GuildChallengeLogic {
Map<Integer,Object> lockMap = new ConcurrentHashMap<>();
private Map<Integer,Object> lockMap = new ConcurrentHashMap<>();
@ -71,8 +78,8 @@ public class GuildChallengeLogic {
GuildMyInfo guildMyInfo = user.getGuildMyInfo();
//如果boss不同 则不刷新次数
if(currBossId!=0&&currBossId==guildMyInfo.getLastMonsterId()){
//如果boss 则不刷新次数
if(currBossId!=0&&currBossId!=guildMyInfo.getLastMonsterId()){
int[] privilege = config.getPrivilege();
for(int clearPrivilege:privilege){
user.getPlayerInfoManager().clearVipCount(clearPrivilege);
@ -85,7 +92,10 @@ public class GuildChallengeLogic {
Family.GetGuildChallengeInfoResponse response = Family.GetGuildChallengeInfoResponse.newBuilder()
.setCanSweep(canSweep)
.setCurBoss(currBossId)
.setBlood(bossHpRemain==0?10000:(int)(bossHpRemain*10000/config.getMonsterHp())).build();
.setBlood(bossHpRemain==0?10000:(int)(bossHpRemain*10000/config.getMonsterHp()))
.setBuffTime(guildInfo.getBuffOverTime()> TimeUtils.nowInt()?guildInfo.getBuffOverTime():0)
.setBuffCount(guildInfo.getBuffOverTime()> TimeUtils.nowInt()?guildInfo.getBuffIndex():0)
.build();
MessageUtil.sendMessage(session,1,messageType.getNumber(),response,true);
@ -118,15 +128,15 @@ public class GuildChallengeLogic {
SGuildCheckpointConfig config = STableManager.getConfig(SGuildCheckpointConfig.class).get(bossId);
int[] privilege = config.getPrivilege();
boolean check = PlayerLogic.getInstance().check(user, privilege[0], 1);
// if(!check){
// throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
// }
if(!check){
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}
//锁住
synchronized (lockMap.get(guildId)){
guildInfo = GuilidManager.guildInfoMap.get(guildId);
GuildMyInfo guildMyInfo = user.getGuildMyInfo();
//先清除特权
if(guildInfo.getCurrBossId()!=0&&guildInfo.getCurrBossId()== guildMyInfo.getLastMonsterId()){
if(guildInfo.getCurrBossId()!=0&&guildInfo.getCurrBossId()!= guildMyInfo.getLastMonsterId()){
for(int clearPrivilege:privilege){
user.getPlayerInfoManager().clearVipCount(clearPrivilege);
}
@ -136,6 +146,13 @@ public class GuildChallengeLogic {
}else{
if(type==0){
PVEFightEvent pveFightEvent = new PVEFightEvent(uid, 1501, 5, "", GameFightType.GuildChallenge, config.getMonsterId(), 3);
int buffIndex = guildInfo.getBuffIndex();
int buffOverTime = guildInfo.getBuffOverTime();
if(buffOverTime>TimeUtils.nowInt()&&buffIndex!=0){
List<Integer> buffList = new ArrayList<>();
buffList.add(config.getAttributePromote()[buffIndex-1]);
pveFightEvent.setBuffIds(buffList);
}
if(guildInfo.getBossHpRemain()!=0){
List<Integer> hp = new ArrayList<>();
for(int i = 0 ; i <6;i++){
@ -169,14 +186,26 @@ public class GuildChallengeLogic {
damage = damageInt;
}else{
//扫荡
guildInfo.setBossHpRemain(guildInfo.getBossHpRemain()- guildMyInfo.getGuildChallengeDamage());
int remain = guildInfo.getBossHpRemain() - guildMyInfo.getGuildChallengeDamage();
if(remain>=0){
guildInfo.setBossHpRemain(remain);
}else{
guildInfo.setCurrBossId(guildInfo.getCurrBossId() + 1);
guildInfo.setBossHpRemain(0);
}
damage = guildMyInfo.getGuildChallengeDamage();
}
drop = ItemUtil.drop(user, new int[]{config.getReward()}, 1, 0, 1);
}
}
if(!error.isEmpty()){
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}
if(kill==1){
//异步发奖
Runnable runnable = () -> sendRankReward(guildId,bossId);
runnable.run();
drop = ItemUtil.drop(user, new int[]{config.getReward(),config.getKillReward()}, 1, 0, 1);
}
double blood = guildInfo.getBossHpRemain();
@ -194,18 +223,124 @@ public class GuildChallengeLogic {
long score = Double.valueOf(rank.getScoreById(user.getId(), guildId+":"+bossId)).longValue();
rank.addRank(uid,guildId+":"+bossId,score==-1?damage:score+damage);
if(!error.isEmpty()){
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}
Family.GuildChallengeResponse.Builder response = Family.GuildChallengeResponse.newBuilder();
response.setDrop(drop);
if(fightData!=null){
response.setFightData(fightData);
}
response.setKill(kill);
response.setDamage((int)damage);
PlayerLogic.getInstance().checkAndUpdate(user,config.getPrivilege()[0],1);
MessageUtil.sendMessage(session,1,messageType.getNumber(),response.build(),true);
}
/**
* buff
*/
public void buyBuff(ISession session, MessageTypeProto.MessageType messageType) throws Exception {
int uid = session.getUid();
User user = UserManager.getUser(uid);
int guildId = user.getPlayerInfoManager().getGuildId();
if(guildId==0){
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}
if(!lockMap.containsKey(guildId)){
lockMap.put(guildId,new Object());
}
GuildInfo guildInfo = GuilidManager.guildInfoMap.get(guildId);
SGuildCheckpointConfig config = STableManager.getConfig(SGuildCheckpointConfig.class).get(guildInfo.getCurrBossId());
int[] attributePromote = config.getAttributePromote();
int maxCount = attributePromote.length;
if(guildInfo.getBuffIndex()>=maxCount){
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}
int[][] attributePromotePrice = config.getAttributePromotePrice();
boolean itemCost = ItemUtil.itemCost(user, new int[][]{{attributePromotePrice[0][0], attributePromotePrice[1][guildInfo.getBuffIndex()]}}, BIReason.GUILD_CHALLENGE_BUFF_BUY_CONSUME, 1);
if(!itemCost){
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}
synchronized (lockMap.get(guildId)){
int time;
if(guildInfo.getBuffOverTime() > TimeUtils.nowInt()){
time = guildInfo.getBuffOverTime() + 3600;
}else{
//跨过5点刷新
if(TimeUtils.isOverAppointRefreshTime(TimeUtils.now(), (guildInfo.getBuffOverTime()-1) * 1000L, 5)){
guildInfo.setBuffIndex(0);
}
time = TimeUtils.nowInt() + 3600;
}
guildInfo.setBuffIndex(guildInfo.getBuffIndex()+1);
int fiveTime = (int)(TimeUtils.getLastOrUnderHour(TimeUtils.now(), 5, 0, false)/1000);
guildInfo.setBuffOverTime(Math.min(time,fiveTime));
}
Family.GuildChallengeBuyBuffIndication indication = Family.GuildChallengeBuyBuffIndication.newBuilder()
.setBuffTime(guildInfo.getBuffOverTime()> TimeUtils.nowInt()?guildInfo.getBuffOverTime():0)
.setBuffCount(guildInfo.getBuffOverTime()> TimeUtils.nowInt()?guildInfo.getBuffIndex():0)
.build();
GuildLogic.sendIndicationToMember(guildInfo, MessageTypeProto.MessageType.GUILD_CHALLENGE_BUY_BUFF_INDICATION,indication);
MessageUtil.sendMessage(session,1,messageType.getNumber(),null,true);
}
public void sendChallengeMessage(ISession session, MessageTypeProto.MessageType messageType) throws Exception{
User user = UserManager.getUser(session.getUid());
int guildId = user.getPlayerInfoManager().getGuildId();
GuildInfo guildInfo = GuilidManager.guildInfoMap.get(guildId);
int memberType = GuildLogic.getMemberType(session.getUid(), guildInfo.getMembers());
if(memberType==3){
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}
if(guildInfo.getNextChallengeMessageTime()<TimeUtils.nowInt()){
guildInfo.setNextChallengeMessageTime(TimeUtils.nowInt()+TimeUtils.SECONDS_HOUR);
}
Family.GuildChallengeMessageResponse response = Family.GuildChallengeMessageResponse.newBuilder()
.setNextTime(guildInfo.getNextChallengeMessageTime())
.build();
MessageUtil.sendMessage(session,1,messageType.getNumber(),response,true);
}
private void sendRankReward(int guildId,int bossId){
AbstractRank rank = RankContext.getRankEnum(RankEnum.GUILD_CHALLENGE_RANK.getType());
Map<Integer, SGuildCheckpointRank> configMap = RewardStaticConfig.getGuildChallengeConfigMap().get(bossId);
if (configMap==null||configMap.isEmpty()){
return;
}
Set<ZSetOperations.TypedTuple<String>> rankInfos = rank.getRankByKey(guildId + ":" + bossId, 0, configMap.size());
if(rankInfos.size()<1){
return;
}
try{
int index = 1;
for(ZSetOperations.TypedTuple<String> rankInfo:rankInfos){
String title = SErrorCodeEerverConfig.getI18NMessage("GuildRanking_mail_gonghui_title");
String content = SErrorCodeEerverConfig.getI18NMessage("GuildRanking_mail_gonghui_txt", new Object[]{index});
SGuildCheckpointRank config = configMap.get(index);
if(config==null){
continue;
}
String mailReward = ItemUtil.getMailReward(config.getRankingReward());
MailLogic.getInstance().sendMail(Integer.parseInt(rankInfo.getValue()), title, content, mailReward, TimeUtils.nowInt(), Global.MAIL_EFFECTIVE_TIME);
index++;
}
// 排行不清除
// RedisUtil.getInstence().del(RedisKey.getKey(rank.getRedisKey(),"",false));
}catch (Exception e){
e.printStackTrace();
}
}
}

View File

@ -12,6 +12,7 @@ public class FightEvent {
private GameFightType fightType;
private Map<String, Integer> attackBloodMap;
private List<Integer> monsterRemainHp;
private List<Integer> buffIds;
public FightEvent(int attackUid, int teamId,int mostTime,String frams, GameFightType fightType) {
this.attackUid = attackUid;
@ -60,4 +61,12 @@ public class FightEvent {
public void setMonsterRemainHp(List<Integer> monsterRemainHp) {
this.monsterRemainHp = monsterRemainHp;
}
public List<Integer> getBuffIds() {
return buffIds;
}
public void setBuffIds(List<Integer> buffIds) {
this.buffIds = buffIds;
}
}

View File

@ -32,7 +32,14 @@ import java.util.Map;
public class FightUtil {
public static CommonProto.FightTeamInfo makePersonFightData(User player,int teamId,Map<String, Integer> attackBloodMap){
public static CommonProto.FightTeamInfo makePersonFightData(User player,int teamId,Map<String, Integer> attackBloodMap,List<Integer> buffIds){
if(buffIds!=null){
Map<Integer,List<Integer>> map = new HashMap<>();
for(int i = 1;i <=4;i++){
map.put(i,buffIds);
}
return getFightTeamInfoWithSomeBuff(player,teamId,attackBloodMap,map);
}
if(attackBloodMap ==null || attackBloodMap.isEmpty()){
return BehaviorUtil.getFightTeamInfo(player,teamId,true);
}
@ -91,7 +98,7 @@ public class FightUtil {
public static FightResult getFightForPVE(FightEvent fightEvent){
PVEFightEvent pveFightEvent = (PVEFightEvent)fightEvent;
User userInMem = UserManager.getUserInMem(pveFightEvent.getAttackUid());
CommonProto.FightTeamInfo fightTeamInfo = makePersonFightData(userInMem, pveFightEvent.getTeamId(),pveFightEvent.getAttackBloodMap());
CommonProto.FightTeamInfo fightTeamInfo = makePersonFightData(userInMem, pveFightEvent.getTeamId(),pveFightEvent.getAttackBloodMap(),pveFightEvent.getBuffIds());
int fightSeed =getFightSeed();
//怪物剩余血量
List<Integer> monsterRemainHp = pveFightEvent.getMonsterRemainHp();
@ -125,7 +132,7 @@ public class FightUtil {
} else{
if(fightEvent.getFightType() == GameFightType.ArenaPersonFight ||fightEvent.getFightType() == GameFightType.CarPersonChallenge ){
User defInMem = UserManager.getUserInMem(pvpFightEvent.getDefUid());
deffightTeamInfo = makePersonFightData(defInMem, pvpFightEvent.getDefTeamId(),null);
deffightTeamInfo = makePersonFightData(defInMem, pvpFightEvent.getDefTeamId(),null,null);
}else{
deffightTeamInfo = makeRobotFightData(pvpFightEvent.getDefUid());
}
@ -137,7 +144,7 @@ public class FightUtil {
fightTeamInfo = makeRobotFightData(pvpFightEvent.getAttackUid());
}else{
User userInMem = UserManager.getUserInMem(pvpFightEvent.getAttackUid());
fightTeamInfo = makePersonFightData(userInMem, pvpFightEvent.getTeamId(),pvpFightEvent.getAttackBloodMap());
fightTeamInfo = makePersonFightData(userInMem, pvpFightEvent.getTeamId(),pvpFightEvent.getAttackBloodMap(),null);
}
}else{
fightTeamInfo = makeRobotFightData(pvpFightEvent.getAttackUid());

View File

@ -298,7 +298,7 @@ public class HeroLogic{
}
try {
if(eventEnum == ReportEventEnum.SUMMON_HERO){
ReportUtil.onReportEvent(user,eventEnum.getType(),String.valueOf(resultRandom[0][0]),resultRandom[0][1]);
ReportUtil.onReportEvent(user,eventEnum.getType(),String.valueOf(resultRandom[0][0]),sLotterySetting.getPropertyType(),resultRandom[0][1]);
return;
}
List<String> result = new ArrayList<>(resultRandom.length);

View File

@ -33,7 +33,7 @@ public enum RankEnum {
EXPERT_RANK(21,RedisKey.EXPERT_RANK,GoldRank::new),//param1活动进度 param2无 param3:无
FORCE_CURR_RANK(22,RedisKey.FORCE_CURR_RANK,ForceCurrRank::new),//param1人物战力 param2无 param3:无
SITUATION_RANK(24,RedisKey.SITUATION_RANK,SituationRank::new),//param1通关次数 param2无 param3:无
GUILD_CHALLENGE_RANK(25,RedisKey.GUILD_CHALLENGE_RANK,GuildChallengeRank::new),//param1伤害 param2无 param3:无
GUILD_CHALLENGE_RANK(26,RedisKey.GUILD_CHALLENGE_RANK,GuildChallengeRank::new),//param1伤害 param2无 param3:无
;
private int type;

View File

@ -1,5 +1,11 @@
package com.ljsd.jieling.logic.rank.rankImpl;
import com.ljsd.jieling.exception.ErrorCode;
import com.ljsd.jieling.exception.ErrorCodeException;
import com.ljsd.jieling.logic.dao.UserManager;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.protocols.PlayerInfoProto;
/**
* @author lvxinran
* @date 2020/8/22
@ -19,4 +25,15 @@ public class GuildChallengeRank extends AbstractRank {
public double getScore(double... data) {
return data[0];
}
@Override
public PlayerInfoProto.RankResponse getRank(int uid, String rkey, int page, int rankEndLine) throws Exception {
User user = UserManager.getUser(uid);
int guildId = user.getPlayerInfoManager().getGuildId();
if(guildId==0){
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}
rkey = guildId+":"+rkey;
return super.getRank(uid, rkey, page, rankEndLine);
}
}

View File

@ -22,16 +22,12 @@ public class SGuildCheckpointConfig implements BaseConfig {
private int monsterId;
private int[][] attributePromote;
private int[] attributePromote;
private int[][] attributePromotePrice;
private int[] privilege;
private int[][] rankingReward;
private int[][] rewardNumber;
private int monsterHp;
@ -69,7 +65,7 @@ public class SGuildCheckpointConfig implements BaseConfig {
return monsterId;
}
public int[][] getAttributePromote() {
public int[] getAttributePromote() {
return attributePromote;
}
@ -81,14 +77,6 @@ public class SGuildCheckpointConfig implements BaseConfig {
return privilege;
}
public int[][] getRankingReward() {
return rankingReward;
}
public int[][] getRewardNumber() {
return rewardNumber;
}
public int getMonsterHp() {
return monsterHp;
}

View File

@ -0,0 +1,49 @@
package config;
import manager.STableManager;
import manager.Table;
import java.util.Map;
@Table(name ="GuildCheckpointRank")
public class SGuildCheckpointRank implements BaseConfig {
private int id;
private int guildCheckpoint;
private int maxRank;
private int minRank;
private int[][] rankingReward;
@Override
public void init() throws Exception {
}
public int getId() {
return id;
}
public int getGuildCheckpoint() {
return guildCheckpoint;
}
public int getMaxRank() {
return maxRank;
}
public int getMinRank() {
return minRank;
}
public int[][] getRankingReward() {
return rankingReward;
}
}