十绝阵修改
parent
233d52d1c8
commit
44d7fbbc52
|
@ -16,7 +16,7 @@ public class DeathChallengeCount {
|
||||||
return userReward;
|
return userReward;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUserReward(int uid,DeathReward reward) {
|
public void putUserReward(int uid,DeathReward reward) {
|
||||||
userReward.put(uid,reward);
|
userReward.put(uid,reward);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -231,14 +231,14 @@ public class DeathPathLogic {
|
||||||
}
|
}
|
||||||
private void taskDoExecute(DeathPathTask task){
|
private void taskDoExecute(DeathPathTask task){
|
||||||
|
|
||||||
//公会总进攻次数
|
//公会总进攻人数
|
||||||
DeathChallengeCount countInfo = RedisUtil.getInstence().get(RedisKey.DEATH_PAHT_TOTAL_CHALLENGE_COUNT, String.valueOf(task.getGuildId()), DeathChallengeCount.class);
|
DeathChallengeCount countInfo = RedisUtil.getInstence().get(RedisKey.DEATH_PAHT_TOTAL_CHALLENGE_COUNT, String.valueOf(task.getGuildId()), DeathChallengeCount.class);
|
||||||
if (countInfo==null){
|
if (countInfo==null){
|
||||||
countInfo = new DeathChallengeCount();
|
countInfo = new DeathChallengeCount();
|
||||||
countInfo.setUserReward(task.getUid(),null);
|
countInfo.putUserReward(task.getUid(),new DeathReward());
|
||||||
RedisUtil.getInstence().set(RedisKey.DEATH_PAHT_TOTAL_CHALLENGE_COUNT, String.valueOf(task.getGuildId()),countInfo);
|
RedisUtil.getInstence().set(RedisKey.DEATH_PAHT_TOTAL_CHALLENGE_COUNT, String.valueOf(task.getGuildId()),countInfo);
|
||||||
}else if(!countInfo.getUserReward().containsKey(task.getUid())) {
|
}else if(!countInfo.getUserReward().containsKey(task.getUid())) {
|
||||||
countInfo.setUserReward(task.getUid(),null);
|
countInfo.putUserReward(task.getUid(),new DeathReward());
|
||||||
RedisUtil.getInstence().set(RedisKey.DEATH_PAHT_TOTAL_CHALLENGE_COUNT, String.valueOf(task.getGuildId()), countInfo);
|
RedisUtil.getInstence().set(RedisKey.DEATH_PAHT_TOTAL_CHALLENGE_COUNT, String.valueOf(task.getGuildId()), countInfo);
|
||||||
}
|
}
|
||||||
//操作每个关的公会数据
|
//操作每个关的公会数据
|
||||||
|
@ -328,13 +328,13 @@ public class DeathPathLogic {
|
||||||
//您所在的公会或您没有达到领奖条件
|
//您所在的公会或您没有达到领奖条件
|
||||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||||
}
|
}
|
||||||
if(countInfo.getUserReward().get(uid)!=null){
|
if(countInfo.getUserReward().get(uid).getPosition()!=0){
|
||||||
//您已领取过奖励
|
//您已领取过奖励
|
||||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||||
}
|
}
|
||||||
countInfo = new DeathChallengeCount();
|
countInfo = new DeathChallengeCount();
|
||||||
|
|
||||||
countInfo.setUserReward(uid,new DeathReward(reward[0],reward[1],position));
|
countInfo.putUserReward(uid,new DeathReward(reward[0],reward[1],position));
|
||||||
RedisUtil.getInstence().set(RedisKey.DEATH_PAHT_TOTAL_CHALLENGE_COUNT, String.valueOf(guildId),countInfo);
|
RedisUtil.getInstence().set(RedisKey.DEATH_PAHT_TOTAL_CHALLENGE_COUNT, String.valueOf(guildId),countInfo);
|
||||||
ItemUtil.drop(user,new int[][]{reward},BIReason.DEATH_PAHT_RANDOM_REWARD);
|
ItemUtil.drop(user,new int[][]{reward},BIReason.DEATH_PAHT_RANDOM_REWARD);
|
||||||
Family.RewardInfo info = Family.RewardInfo.newBuilder().setUid(uid).setItemCount(reward[1]).setItemId(reward[0]).setPosition(position).build();
|
Family.RewardInfo info = Family.RewardInfo.newBuilder().setUid(uid).setItemCount(reward[1]).setItemId(reward[0]).setPosition(position).build();
|
||||||
|
|
|
@ -35,6 +35,9 @@ public class DeathReward {
|
||||||
this.position = position;
|
this.position = position;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DeathReward() {
|
||||||
|
}
|
||||||
|
|
||||||
public DeathReward(int itemId, int itemCount, int position) {
|
public DeathReward(int itemId, int itemCount, int position) {
|
||||||
this.itemId = itemId;
|
this.itemId = itemId;
|
||||||
this.itemCount = itemCount;
|
this.itemCount = itemCount;
|
||||||
|
|
Loading…
Reference in New Issue