特权时间修改,点赞物品添加

back_recharge
lvxinran 2020-01-09 17:01:53 +08:00
parent c72b28d1de
commit 50093c8c58
4 changed files with 17 additions and 8 deletions

View File

@ -103,7 +103,9 @@ public interface BIReason {
int GUILD_BOSS_FIGHT_REWARD = 61;//工会boss奖励
int CHAMPIONM_EXCHANGE_REWARD = 1050;//巅峰赛兑换奖励
int CHAMPIONM_EXCHANGE_REWARD = 62;//巅峰赛兑换奖励
int SEND_LIKE_REWARD = 63;//红包榜点赞奖励
int ADVENTURE_UPLEVEL_CONSUME = 1000;//秘境升级

View File

@ -339,19 +339,19 @@ public class PlayerManager extends MongoBase {
if (config==null){
return;
}
int maxTime;
long maxTime;
if(config.getContinueTime()==0){
maxTime = 0;
}else{
if(vipInfo.containsKey(privilageId)){
maxTime = (int)(TimeUtils.now()/1000>vipInfo.get(privilageId).getEffectTime()?(TimeUtils.now()/1000):vipInfo.get(privilageId).getEffectTime());
maxTime = TimeUtils.now()/1000>vipInfo.get(privilageId).getEffectTime()?(TimeUtils.now()/1000):vipInfo.get(privilageId).getEffectTime();
maxTime = maxTime+config.getContinueTime();
}else {
maxTime = (int)(TimeUtils.now()/1000+config.getContinueTime());
maxTime = TimeUtils.now()/1000+config.getContinueTime();
}
}
maxTime = (int)(TimeUtils.getLastHour(maxTime*1000,5)/1000);
vipInfo.put(privilageId,new VipInfo(0,maxTime));
vipInfo.put(privilageId,new VipInfo(0,(int)maxTime));
updateString("vipInfo", vipInfo);
}

View File

@ -1113,6 +1113,7 @@ public class GuildLogic {
if(user.getFriendManager().getTodayLike().contains(targetUid)){
throw new ErrorCodeException(ErrorCode.ALREADY_LIKE);
}
ItemUtil.drop(user,new int[][]{SGuildSetting.sGuildSetting.getGiveLikeReward()},BIReason.SEND_LIKE_REWARD);
User targetUser = UserManager.getUser(targetUid);
AyyncWorker ayyncWorker = new AyyncWorker(targetUser, true, n->targetUser.getFriendManager().addBeLikedCount(1));
user.getFriendManager().addTodayLike(targetUid);

View File

@ -68,12 +68,14 @@ public class SGuildSetting implements BaseConfig {
private int[][] renameCost;
public static SGuildSetting sGuildSetting;
private int bossTime;
private float[][] bossReward;
private int[] giveLikeReward;
public static SGuildSetting sGuildSetting;
@Override
public void init() throws Exception {
@ -213,4 +215,8 @@ public class SGuildSetting implements BaseConfig {
public float[][] getBossReward() {
return bossReward;
}
public int[] getGiveLikeReward() {
return giveLikeReward;
}
}