游戏系统-礼包码设计与实现

参考主流游戏做一个礼包码发码的系统

 

 

 

 

 

 

 

 

数据库定义

 

 

 

 

 

 

 

 

返回异常的几个枚举状态

 

 

//礼包码无效
public static final String GIFT_CODE_NOT_VALIDATE = "GIFT_CODE_NOT_VALIDATE";

//礼包码已使用
public static final String GIFT_CODE_USED = "GIFT_CODE_USED";

//礼包码使用异常
public static final String GIFT_CODE_REWARD_ERROR = "GIFT_CODE_REWARD_ERROR";

 

奖励字段的配置定义

类型-tid-数量

eg.   0-1000-100|0-1002-10|3-3004-1|2-2604-2|1-11001-1

 

返回结果

  • GiftCodeRewardBack(succ:true,
  • rewardObj:RewardRespon(
  • currencys:[
  • CurrencyChanged(type:1000, currVaule:9828570, changedValue:100),
  • CurrencyChanged(type:1002, currVaule:350, changedValue:10)
  • ],
  • items:[
  • Item(dbId:1708, tid:3004, type:3, amount:1),
  • Item(dbId:1709, tid:2604, type:2, amount:2)
  • ],
  • equipments:[
  • Equipment(dbId:6985, tid:11001, quality:0, lv:1, attribute:{}, affixGroup:[], affixType:[], affix:[], hole:0, holeArray:[], linkArray:[])]),
  • rewardStr:0-1000-100|0-1002-10|3-3004-1|2-2604-2|1-11001-1
  • )

 

类型枚举定义

public static final int Currency =0;
public static final int Equipment =1;
public static final int Material =2;
public static final int Consumable =3;

货币tid定义

public static final int SacredCrystal =1000;//钻石
public static final int Gold =1001;//金币
public static final int Crystal =1002;//水晶
public static final int BookExp =1003;//灵魂经验
public static final int ReExp =1004;//潜能经验
public static final int MagicStone =1005;//魔法石
public static final int InnerFire =1006;//心灵之火
public static final int LuckyCoin =1007;//幸运币


买一送一 日常扫盲

mysql的常用类型

Date  2020-05-21

Datetime  2020-05-21 15:59:41  

遇到了数据库的时区问题.最终在mybatis的url参数中 &serverTimezone=GMT%2B8

 

posted @ 2020-05-21 16:12  虚空中的天行者  阅读(1278)  评论(0)    收藏  举报