上传装备属性

This commit is contained in:
liwei1dao 2022-11-04 17:37:46 +08:00
parent 5a4830abd3
commit 6c70287868
3 changed files with 138 additions and 54 deletions

View File

@ -129,15 +129,15 @@ func (this *apiComp) Upgrade(session comm.IUserSession, req *pb.EquipmentUpgrade
return
}
}
equipments = make([]*pb.DB_Equipment, 6)
confs = make([]*cfg.GameEquipData, 6)
equipments = make([]*pb.DB_Equipment, 8)
confs = make([]*cfg.GameEquipData, 8)
//已装备 重新计算属性
if equipment.HeroId != "" {
if hero, code = this.module.ModuleHero.GetHeroByObjID(session.GetUserId(), equipment.HeroId); code != pb.ErrorCode_Success {
this.module.Errorf("Upgrade code:%d", code)
return
}
if conf.Pos >= 6 {
if conf.Pos >= 8 {
code = pb.ErrorCode_ConfigurationException
this.module.Errorf("Upgrade equipment Pos:%d", conf.Pos)
return

View File

@ -98,5 +98,13 @@ func (this *Pay) Rpc_ModulePayDelivery(ctx context.Context, args *pb.PayDelivery
return
}
}
switch conf.RechargeType {
case 1:
break
case 2:
break
}
return
}

View File

@ -11,69 +11,145 @@ package cfg
import "errors"
type GameRechargeData struct {
Id string
Editionid string
RechargeType int32
Monetaryunit string
Amount string
Vipexp []*Gameatn
DiamondNumDouble []*Gameatn
Channel string
Text string
Image string
Id string
Editionid string
RechargeType int32
Monetaryunit string
Amount string
Vipexp []*Gameatn
DiamondNumDouble []*Gameatn
Channel string
Text string
Image string
}
const TypeId_GameRechargeData = -1686494355
func (*GameRechargeData) GetTypeId() int32 {
return -1686494355
return -1686494355
}
func (_v *GameRechargeData)Deserialize(_buf map[string]interface{}) (err error) {
{ var _ok_ bool; if _v.Id, _ok_ = _buf["id"].(string); !_ok_ { err = errors.New("id error"); return } }
{ var _ok_ bool; if _v.Editionid, _ok_ = _buf["editionid"].(string); !_ok_ { err = errors.New("editionid error"); return } }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["recharge_type"].(float64); !_ok_ { err = errors.New("recharge_type error"); return }; _v.RechargeType = int32(_tempNum_) }
{ var _ok_ bool; if _v.Monetaryunit, _ok_ = _buf["monetaryunit"].(string); !_ok_ { err = errors.New("monetaryunit error"); return } }
{ var _ok_ bool; if _v.Amount, _ok_ = _buf["amount"].(string); !_ok_ { err = errors.New("amount error"); return } }
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["vipexp"].([]interface{}); !_ok_ { err = errors.New("vipexp error"); return }
func (_v *GameRechargeData) Deserialize(_buf map[string]interface{}) (err error) {
{
var _ok_ bool
if _v.Id, _ok_ = _buf["id"].(string); !_ok_ {
err = errors.New("id error")
return
}
}
{
var _ok_ bool
if _v.Editionid, _ok_ = _buf["editionid"].(string); !_ok_ {
err = errors.New("editionid error")
return
}
}
{
var _ok_ bool
var _tempNum_ float64
if _tempNum_, _ok_ = _buf["recharge_type"].(float64); !_ok_ {
err = errors.New("recharge_type error")
return
}
_v.RechargeType = int32(_tempNum_)
}
{
var _ok_ bool
if _v.Monetaryunit, _ok_ = _buf["monetaryunit"].(string); !_ok_ {
err = errors.New("monetaryunit error")
return
}
}
{
var _ok_ bool
if _v.Amount, _ok_ = _buf["amount"].(string); !_ok_ {
err = errors.New("amount error")
return
}
}
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["vipexp"].([]interface{}); !_ok_ {
err = errors.New("vipexp error")
return
}
_v.Vipexp = make([]*Gameatn, 0, len(_arr_))
for _, _e_ := range _arr_ {
var _list_v_ *Gameatn
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ { err = errors.New("_list_v_ error"); return }; if _list_v_, err = DeserializeGameatn(_x_); err != nil { return } }
_v.Vipexp = append(_v.Vipexp, _list_v_)
}
}
_v.Vipexp = make([]*Gameatn, 0, len(_arr_))
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["diamond_num_double"].([]interface{}); !_ok_ { err = errors.New("diamond_num_double error"); return }
for _, _e_ := range _arr_ {
var _list_v_ *Gameatn
{
var _ok_ bool
var _x_ map[string]interface{}
if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ {
err = errors.New("_list_v_ error")
return
}
if _list_v_, err = DeserializeGameatn(_x_); err != nil {
return
}
}
_v.Vipexp = append(_v.Vipexp, _list_v_)
}
}
_v.DiamondNumDouble = make([]*Gameatn, 0, len(_arr_))
for _, _e_ := range _arr_ {
var _list_v_ *Gameatn
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ { err = errors.New("_list_v_ error"); return }; if _list_v_, err = DeserializeGameatn(_x_); err != nil { return } }
_v.DiamondNumDouble = append(_v.DiamondNumDouble, _list_v_)
}
}
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["diamond_num_double"].([]interface{}); !_ok_ {
err = errors.New("diamond_num_double error")
return
}
{ var _ok_ bool; if _v.Channel, _ok_ = _buf["channel"].(string); !_ok_ { err = errors.New("channel error"); return } }
{ var _ok_ bool; if _v.Text, _ok_ = _buf["text"].(string); !_ok_ { err = errors.New("text error"); return } }
{ var _ok_ bool; if _v.Image, _ok_ = _buf["image"].(string); !_ok_ { err = errors.New("image error"); return } }
return
_v.DiamondNumDouble = make([]*Gameatn, 0, len(_arr_))
for _, _e_ := range _arr_ {
var _list_v_ *Gameatn
{
var _ok_ bool
var _x_ map[string]interface{}
if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ {
err = errors.New("_list_v_ error")
return
}
if _list_v_, err = DeserializeGameatn(_x_); err != nil {
return
}
}
_v.DiamondNumDouble = append(_v.DiamondNumDouble, _list_v_)
}
}
{
var _ok_ bool
if _v.Channel, _ok_ = _buf["channel"].(string); !_ok_ {
err = errors.New("channel error")
return
}
}
{
var _ok_ bool
if _v.Text, _ok_ = _buf["text"].(string); !_ok_ {
err = errors.New("text error")
return
}
}
{
var _ok_ bool
if _v.Image, _ok_ = _buf["image"].(string); !_ok_ {
err = errors.New("image error")
return
}
}
return
}
func DeserializeGameRechargeData(_buf map[string]interface{}) (*GameRechargeData, error) {
v := &GameRechargeData{}
if err := v.Deserialize(_buf); err == nil {
return v, nil
} else {
return nil, err
}
v := &GameRechargeData{}
if err := v.Deserialize(_buf); err == nil {
return v, nil
} else {
return nil, err
}
}