公会副本次数修改
parent
d56aa73460
commit
c98aa7f20d
|
@ -372,6 +372,7 @@ public class PlayerManager extends MongoBase {
|
||||||
if(config.getCondition().length==1&&config.getCondition()[0][0]==0){
|
if(config.getCondition().length==1&&config.getCondition()[0][0]==0){
|
||||||
return;
|
return;
|
||||||
}else{
|
}else{
|
||||||
|
newVipInfo.setCount(vipInfo.get(privilageId).getCount()-config.getCondition()[0][1]);
|
||||||
newVipInfo.setEffectTime(vipInfo.get(privilageId).getEffectTime());
|
newVipInfo.setEffectTime(vipInfo.get(privilageId).getEffectTime());
|
||||||
vipInfo.put(privilageId,newVipInfo);
|
vipInfo.put(privilageId,newVipInfo);
|
||||||
updateString("vipInfo", this.vipInfo);
|
updateString("vipInfo", this.vipInfo);
|
||||||
|
|
|
@ -7,6 +7,7 @@ import com.ljsd.jieling.exception.ErrorCode;
|
||||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||||
import com.ljsd.jieling.globals.BIReason;
|
import com.ljsd.jieling.globals.BIReason;
|
||||||
import com.ljsd.jieling.globals.Global;
|
import com.ljsd.jieling.globals.Global;
|
||||||
|
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||||
import com.ljsd.jieling.logic.dao.GuildMyInfo;
|
import com.ljsd.jieling.logic.dao.GuildMyInfo;
|
||||||
import com.ljsd.jieling.logic.dao.GuilidManager;
|
import com.ljsd.jieling.logic.dao.GuilidManager;
|
||||||
import com.ljsd.jieling.logic.dao.UserManager;
|
import com.ljsd.jieling.logic.dao.UserManager;
|
||||||
|
@ -21,10 +22,12 @@ import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||||
import com.ljsd.jieling.logic.rank.RankContext;
|
import com.ljsd.jieling.logic.rank.RankContext;
|
||||||
import com.ljsd.jieling.logic.rank.RankEnum;
|
import com.ljsd.jieling.logic.rank.RankEnum;
|
||||||
import com.ljsd.jieling.logic.rank.rankImpl.AbstractRank;
|
import com.ljsd.jieling.logic.rank.rankImpl.AbstractRank;
|
||||||
|
import com.ljsd.jieling.network.server.ProtocolsManager;
|
||||||
import com.ljsd.jieling.network.session.ISession;
|
import com.ljsd.jieling.network.session.ISession;
|
||||||
import com.ljsd.jieling.protocols.CommonProto;
|
import com.ljsd.jieling.protocols.CommonProto;
|
||||||
import com.ljsd.jieling.protocols.Family;
|
import com.ljsd.jieling.protocols.Family;
|
||||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||||
|
import com.ljsd.jieling.util.AyyncWorker;
|
||||||
import com.ljsd.jieling.util.ItemUtil;
|
import com.ljsd.jieling.util.ItemUtil;
|
||||||
import com.ljsd.jieling.util.MessageUtil;
|
import com.ljsd.jieling.util.MessageUtil;
|
||||||
import config.SErrorCodeEerverConfig;
|
import config.SErrorCodeEerverConfig;
|
||||||
|
@ -77,11 +80,9 @@ public class GuildChallengeLogic {
|
||||||
double bossHpRemain = guildInfo.getBossHpRemain();
|
double bossHpRemain = guildInfo.getBossHpRemain();
|
||||||
GuildMyInfo guildMyInfo = user.getGuildMyInfo();
|
GuildMyInfo guildMyInfo = user.getGuildMyInfo();
|
||||||
|
|
||||||
|
//先清除特权
|
||||||
//如果boss 则不刷新次数
|
if(guildInfo.getCurrBossId()!=0&&guildInfo.getCurrBossId()!= guildMyInfo.getLastMonsterId()&& guildMyInfo.getLastMonsterId()!=0){
|
||||||
if(currBossId!=0&&currBossId!=guildMyInfo.getLastMonsterId()){
|
for(int clearPrivilege:config.getPrivilege()){
|
||||||
int[] privilege = config.getPrivilege();
|
|
||||||
for(int clearPrivilege:privilege){
|
|
||||||
user.getPlayerInfoManager().clearVipCount(clearPrivilege);
|
user.getPlayerInfoManager().clearVipCount(clearPrivilege);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -135,12 +136,7 @@ public class GuildChallengeLogic {
|
||||||
synchronized (lockMap.get(guildId)){
|
synchronized (lockMap.get(guildId)){
|
||||||
guildInfo = GuilidManager.guildInfoMap.get(guildId);
|
guildInfo = GuilidManager.guildInfoMap.get(guildId);
|
||||||
GuildMyInfo guildMyInfo = user.getGuildMyInfo();
|
GuildMyInfo guildMyInfo = user.getGuildMyInfo();
|
||||||
//先清除特权
|
|
||||||
if(guildInfo.getCurrBossId()!=0&&guildInfo.getCurrBossId()!= guildMyInfo.getLastMonsterId()){
|
|
||||||
for(int clearPrivilege:privilege){
|
|
||||||
user.getPlayerInfoManager().clearVipCount(clearPrivilege);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(guildInfo.getCurrBossId()!=bossId){
|
if(guildInfo.getCurrBossId()!=bossId){
|
||||||
error = "已被击杀";
|
error = "已被击杀";
|
||||||
}else{
|
}else{
|
||||||
|
@ -203,10 +199,23 @@ public class GuildChallengeLogic {
|
||||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||||
}
|
}
|
||||||
if(kill==1){
|
if(kill==1){
|
||||||
|
Map<Integer, Set<Integer>> members = guildInfo.getMembers();
|
||||||
|
for(Set<Integer> items : members.values()){
|
||||||
|
for(Integer sendUid : items){
|
||||||
|
AyyncWorker worker = new AyyncWorker(UserManager.getUser(sendUid),false,(user1)->{
|
||||||
|
int[] refreshPrivilege = config.getPrivilege();
|
||||||
|
for(int clearPrivilege:refreshPrivilege){
|
||||||
|
user.getPlayerInfoManager().clearVipCount(clearPrivilege);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
ProtocolsManager.getInstance().updateAyncWorker(worker);
|
||||||
|
}
|
||||||
|
}
|
||||||
//异步发奖
|
//异步发奖
|
||||||
Runnable runnable = () -> sendRankReward(guildId,bossId);
|
Runnable runnable = () -> sendRankReward(guildId,bossId);
|
||||||
runnable.run();
|
runnable.run();
|
||||||
drop = ItemUtil.drop(user, new int[]{config.getReward(),config.getKillReward()}, 1, 0, 1);
|
drop = ItemUtil.drop(user, new int[]{config.getReward(),config.getKillReward()}, 1, 0, 1);
|
||||||
|
|
||||||
}
|
}
|
||||||
double blood = guildInfo.getBossHpRemain();
|
double blood = guildInfo.getBossHpRemain();
|
||||||
Family.GuildChallengeIndication.Builder indication = Family.GuildChallengeIndication.newBuilder()
|
Family.GuildChallengeIndication.Builder indication = Family.GuildChallengeIndication.newBuilder()
|
||||||
|
@ -299,14 +308,14 @@ public class GuildChallengeLogic {
|
||||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
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()
|
Family.GuildChallengeMessageResponse response = Family.GuildChallengeMessageResponse.newBuilder()
|
||||||
.setNextTime(guildInfo.getNextChallengeMessageTime())
|
.setNextTime(guildInfo.getNextChallengeMessageTime())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
if(guildInfo.getNextChallengeMessageTime()<TimeUtils.nowInt()){
|
||||||
|
guildInfo.setNextChallengeMessageTime(TimeUtils.nowInt()+TimeUtils.SECONDS_HOUR);
|
||||||
|
}
|
||||||
|
|
||||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),response,true);
|
MessageUtil.sendMessage(session,1,messageType.getNumber(),response,true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,7 @@ public enum RankEnum {
|
||||||
DEATH_PATH_TOTAL_PERSON_RANK(17,RedisKey.DEATH_PATH_TOTAL_PERSON_RANK,DeathPathTotalPersonRank::new),//param1:玩家总伤害 param2:无 param3:无
|
DEATH_PATH_TOTAL_PERSON_RANK(17,RedisKey.DEATH_PATH_TOTAL_PERSON_RANK,DeathPathTotalPersonRank::new),//param1:玩家总伤害 param2:无 param3:无
|
||||||
DEATH_PATH_TOTAL_GUILD_RANK(18,RedisKey.DEATH_PATH_TOTAL_GUILD_RANK,DeathPathTotalGuildRank::new),//param1:工会总伤害 param2:无 param3:无
|
DEATH_PATH_TOTAL_GUILD_RANK(18,RedisKey.DEATH_PATH_TOTAL_GUILD_RANK,DeathPathTotalGuildRank::new),//param1:工会总伤害 param2:无 param3:无
|
||||||
GUILD_FORCE_RANK(20,RedisKey.GUILD_FORCE_RANK,GuildForceRank::new),//param1:公会总战力 param2:无 param3:无
|
GUILD_FORCE_RANK(20,RedisKey.GUILD_FORCE_RANK,GuildForceRank::new),//param1:公会总战力 param2:无 param3:无
|
||||||
|
//达人排行榜
|
||||||
EXPERT_RANK(21,RedisKey.EXPERT_RANK,GoldRank::new),//param1:活动进度 param2:无 param3:无
|
EXPERT_RANK(21,RedisKey.EXPERT_RANK,GoldRank::new),//param1:活动进度 param2:无 param3:无
|
||||||
FORCE_CURR_RANK(22,RedisKey.FORCE_CURR_RANK,ForceCurrRank::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:无
|
SITUATION_RANK(24,RedisKey.SITUATION_RANK,SituationRank::new),//param1:通关次数 param2:无 param3:无
|
||||||
|
|
Loading…
Reference in New Issue