十绝阵修改
parent
233d52d1c8
commit
44d7fbbc52
|
@ -16,7 +16,7 @@ public class DeathChallengeCount {
|
|||
return userReward;
|
||||
}
|
||||
|
||||
public void setUserReward(int uid,DeathReward reward) {
|
||||
public void putUserReward(int uid,DeathReward reward) {
|
||||
userReward.put(uid,reward);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -231,14 +231,14 @@ public class DeathPathLogic {
|
|||
}
|
||||
private void taskDoExecute(DeathPathTask task){
|
||||
|
||||
//公会总进攻次数
|
||||
//公会总进攻人数
|
||||
DeathChallengeCount countInfo = RedisUtil.getInstence().get(RedisKey.DEATH_PAHT_TOTAL_CHALLENGE_COUNT, String.valueOf(task.getGuildId()), DeathChallengeCount.class);
|
||||
if (countInfo==null){
|
||||
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);
|
||||
}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);
|
||||
}
|
||||
//操作每个关的公会数据
|
||||
|
@ -328,13 +328,13 @@ public class DeathPathLogic {
|
|||
//您所在的公会或您没有达到领奖条件
|
||||
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);
|
||||
}
|
||||
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);
|
||||
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();
|
||||
|
|
|
@ -35,6 +35,9 @@ public class DeathReward {
|
|||
this.position = position;
|
||||
}
|
||||
|
||||
public DeathReward() {
|
||||
}
|
||||
|
||||
public DeathReward(int itemId, int itemCount, int position) {
|
||||
this.itemId = itemId;
|
||||
this.itemCount = itemCount;
|
||||
|
|
Loading…
Reference in New Issue