Example #1
0
 public void setTargetName(String targetName) {
   if (StringUtils.isEmpty(targetName)) {
     throw new TemplateConfigException(
         this.getSheetName(), this.getId(), 6, "[任务名称]targetName不可以为空");
   }
   this.targetName = targetName;
 }
 public void setVipTrainingTypeName(String VipTrainingTypeName) {
   if (StringUtils.isEmpty(VipTrainingTypeName)) {
     throw new TemplateConfigException(
         this.getSheetName(), this.getId(), 2, "[训练模式名称]VipTrainingTypeName不可以为空");
   }
   this.VipTrainingTypeName = VipTrainingTypeName;
 }
 @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();
 }
Example #4
0
 public void setName(String name) {
   if (StringUtils.isEmpty(name)) {
     throw new TemplateConfigException(this.getSheetName(), this.getId(), 4, "[名称]name不可以为空");
   }
   this.name = name;
 }