上传装备回收接口业务逻辑代码
This commit is contained in:
parent
f4dd29bf2c
commit
5ccab5bc12
File diff suppressed because it is too large
Load Diff
@ -254,16 +254,16 @@ func (this *Equipment) RecycleEquipments(session comm.IUserSession, equs []strin
|
||||
code = pb.ErrorCode_EquipmentOnFoundEquipment
|
||||
return
|
||||
}
|
||||
if confs[i].Sale == nil || len(confs[i].Sale) == 0 {
|
||||
if confs[i].SmithySale == nil || len(confs[i].SmithySale) == 0 {
|
||||
code = pb.ErrorCode_EquipmentNoCanSell
|
||||
return
|
||||
}
|
||||
sale[i] = make([]*cfg.Gameatn, len(confs[i].Sale))
|
||||
for n, s := range confs[i].Sale {
|
||||
for n, s := range confs[i].SmithySale {
|
||||
_s := &cfg.Gameatn{
|
||||
A: s.A,
|
||||
T: s.T,
|
||||
N: s.N + int32(math.Floor(float64(s.N*(v.Lv-1))*float64(confs[i].Salecoef))),
|
||||
N: int32(math.Floor(float64(s.N) * float64(discount) / float64(100))),
|
||||
}
|
||||
sale[i][n] = _s
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ type GameEquipData struct {
|
||||
Ico string
|
||||
UseSkip int32
|
||||
Sale []*Gameatn
|
||||
SmithySale []*Gameatn
|
||||
Salecoef float32
|
||||
}
|
||||
|
||||
@ -92,6 +93,20 @@ func (_v *GameEquipData)Deserialize(_buf map[string]interface{}) (err error) {
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
if _arr_, _ok_ = _buf["smithy_sale"].([]interface{}); !_ok_ { err = errors.New("smithy_sale error"); return }
|
||||
|
||||
_v.SmithySale = 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.SmithySale = append(_v.SmithySale, _list_v_)
|
||||
}
|
||||
}
|
||||
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["salecoef"].(float64); !_ok_ { err = errors.New("salecoef error"); return }; _v.Salecoef = float32(_tempNum_) }
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user