公会副本次数修改
parent
d56aa73460
commit
c98aa7f20d
|
@ -372,6 +372,7 @@ public class PlayerManager extends MongoBase {
|
|||
if(config.getCondition().length==1&&config.getCondition()[0][0]==0){
|
||||
return;
|
||||
}else{
|
||||
newVipInfo.setCount(vipInfo.get(privilageId).getCount()-config.getCondition()[0][1]);
|
||||
newVipInfo.setEffectTime(vipInfo.get(privilageId).getEffectTime());
|
||||
vipInfo.put(privilageId,newVipInfo);
|
||||
updateString("vipInfo", this.vipInfo);
|
||||
|
|
|
@ -7,6 +7,7 @@ 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.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.dao.GuildMyInfo;
|
||||
import com.ljsd.jieling.logic.dao.GuilidManager;
|
||||
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.RankEnum;
|
||||
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.protocols.CommonProto;
|
||||
import com.ljsd.jieling.protocols.Family;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.util.AyyncWorker;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.SErrorCodeEerverConfig;
|
||||
|
@ -77,11 +80,9 @@ public class GuildChallengeLogic {
|
|||
double bossHpRemain = guildInfo.getBossHpRemain();
|
||||
GuildMyInfo guildMyInfo = user.getGuildMyInfo();
|
||||
|
||||
|
||||
//如果boss 则不刷新次数
|
||||
if(currBossId!=0&&currBossId!=guildMyInfo.getLastMonsterId()){
|
||||
int[] privilege = config.getPrivilege();
|
||||
for(int clearPrivilege:privilege){
|
||||
//先清除特权
|
||||
if(guildInfo.getCurrBossId()!=0&&guildInfo.getCurrBossId()!= guildMyInfo.getLastMonsterId()&& guildMyInfo.getLastMonsterId()!=0){
|
||||
for(int clearPrivilege:config.getPrivilege()){
|
||||
user.getPlayerInfoManager().clearVipCount(clearPrivilege);
|
||||
}
|
||||
}
|
||||
|
@ -135,12 +136,7 @@ public class GuildChallengeLogic {
|
|||
synchronized (lockMap.get(guildId)){
|
||||
guildInfo = GuilidManager.guildInfoMap.get(guildId);
|
||||
GuildMyInfo guildMyInfo = user.getGuildMyInfo();
|
||||
//先清除特权
|
||||
if(guildInfo.getCurrBossId()!=0&&guildInfo.getCurrBossId()!= guildMyInfo.getLastMonsterId()){
|
||||
for(int clearPrivilege:privilege){
|
||||
user.getPlayerInfoManager().clearVipCount(clearPrivilege);
|
||||
}
|
||||
}
|
||||
|
||||
if(guildInfo.getCurrBossId()!=bossId){
|
||||
error = "已被击杀";
|
||||
}else{
|
||||
|
@ -203,10 +199,23 @@ public class GuildChallengeLogic {
|
|||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
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.run();
|
||||
drop = ItemUtil.drop(user, new int[]{config.getReward(),config.getKillReward()}, 1, 0, 1);
|
||||
|
||||
}
|
||||
double blood = guildInfo.getBossHpRemain();
|
||||
Family.GuildChallengeIndication.Builder indication = Family.GuildChallengeIndication.newBuilder()
|
||||
|
@ -299,14 +308,14 @@ public class GuildChallengeLogic {
|
|||
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();
|
||||
|
||||
if(guildInfo.getNextChallengeMessageTime()<TimeUtils.nowInt()){
|
||||
guildInfo.setNextChallengeMessageTime(TimeUtils.nowInt()+TimeUtils.SECONDS_HOUR);
|
||||
}
|
||||
|
||||
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_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:无
|
||||
//达人排行榜
|
||||
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:无
|
||||
|
|
Loading…
Reference in New Issue