/** * 获取年费黄钻每日礼包领取状态 * * @return */ public int getYearYellowVipRewardState() { IntPropertyCacheSet propertySet = human.getPropertyManager().getIntPropertySet(PropertyType.HUMAN_INT_PROPERTY); int yellowVipLevel = propertySet.getPropertyValue(HumanIntProperty.YELLOW_VIP_LEVEL); int isYearYellowVip = propertySet.getPropertyValue(HumanIntProperty.IS_YEAR_YELLOW_VIP); if (yearVipDailyRewardState == YellowVipRewardState.HAS_GOT.getIndex()) { return yearVipDailyRewardState; } else if (isYearYellowVip > 0 && yellowVipLevel > 0) { return YellowVipRewardState.CAN_GET.getIndex(); } else { return YellowVipRewardState.CANNOT_GET.getIndex(); } }
public void resetDailyData() { IntPropertyCacheSet propertySet = human.getPropertyManager().getIntPropertySet(PropertyType.HUMAN_INT_PROPERTY); int yellowVipLevel = propertySet.getPropertyValue(HumanIntProperty.YELLOW_VIP_LEVEL); int isYearYellowVip = propertySet.getPropertyValue(HumanIntProperty.IS_YEAR_YELLOW_VIP); if (yellowVipLevel > 0) { dailyRewardState = YellowVipRewardState.CAN_GET.getIndex(); } else { dailyRewardState = YellowVipRewardState.CANNOT_GET.getIndex(); } if (isYearYellowVip > 0 && yellowVipLevel > 0) { yearVipDailyRewardState = YellowVipRewardState.CAN_GET.getIndex(); } else { yearVipDailyRewardState = YellowVipRewardState.CANNOT_GET.getIndex(); } }
@Override public void onLogin() { int yellowVipLevel = 0; int isYearYellowVip = 0; int isYellowHighVip = 0; String openId = ""; IntPropertyCacheSet propertySet = human.getPropertyManager().getIntPropertySet(PropertyType.HUMAN_INT_PROPERTY); if (human.getPlayer().getLocalProperties() != null) { Object objYellowVipLevel = human.getPlayer().getLocalProperties().get(SharedConstants.YELLOW_VIP_LEVEL); yellowVipLevel = objYellowVipLevel != null && !StringUtils.isEmpty(objYellowVipLevel.toString()) ? Integer.parseInt(objYellowVipLevel.toString()) : 0; Object objIsYearVip = human.getPlayer().getLocalProperties().get(SharedConstants.IS_YELLOW_YEAR_VIP); isYearYellowVip = objIsYearVip != null && !StringUtils.isEmpty(objIsYearVip.toString()) ? Integer.parseInt(objIsYearVip.toString()) : 0; Object objIsYellowHighVip = human.getPlayer().getLocalProperties().get(SharedConstants.IS_YELLOW_HIGH_VIP); isYellowHighVip = objIsYellowHighVip != null && !StringUtils.isEmpty(objIsYellowHighVip.toString()) ? Integer.parseInt(objIsYellowHighVip.toString()) : 0; Object objOpenId = human.getPlayer().getLocalProperties().get(SharedConstants.OPEN_ID); openId = objOpenId != null ? objOpenId.toString() : ""; if (yellowVipLevel <= 0) { isYearYellowVip = 0; isYellowHighVip = 0; } } propertySet.setPropertyValue(HumanIntProperty.YELLOW_VIP_LEVEL, yellowVipLevel); propertySet.setPropertyValue(HumanIntProperty.IS_YEAR_YELLOW_VIP, isYearYellowVip); propertySet.setPropertyValue(HumanIntProperty.IS_YELLOW_HIGH_VIP, isYellowHighVip); TencentUserInfo txUserInfo = new TencentUserInfo(); txUserInfo.setId(human.getHumanGuid()); txUserInfo.setPassportId(human.getPlayer().getPassportId()); txUserInfo.setOpenId(openId); txUserInfo.setYellowVipLevel(yellowVipLevel); txUserInfo.setIsYearYellowVip(isYearYellowVip == 1); txUserInfo.setIsYellowHighVip(isYellowHighVip == 1); GameServerAssist.getTencentUserInfoManager().updateTencentUserInfo(txUserInfo); updateLevelUpRewardState(); }