Merge branch 'meixiongfeng' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev

This commit is contained in:
meixiongfeng 2022-10-17 14:16:16 +08:00
commit 6d81926859
3 changed files with 34 additions and 35 deletions

View File

@ -2,12 +2,12 @@
{
"id": 1,
"switch": 1,
"hero": 14007,
"hero": "14007",
"pointhero": [
35001,
35001,
35001,
35001
"35001",
"35001",
"35001",
"35001"
],
"awaken": -1,
"start": -1
@ -15,12 +15,12 @@
{
"id": 2,
"switch": 1,
"hero": 35001,
"hero": "35001",
"pointhero": [
25001,
25001,
25001,
25001
"25001",
"25001",
"25001",
"25001"
],
"awaken": -1,
"start": -1
@ -28,12 +28,12 @@
{
"id": 3,
"switch": 1,
"hero": 25001,
"hero": "25001",
"pointhero": [
25004,
25004,
25004,
25004
"25004",
"25004",
"25004",
"25004"
],
"awaken": -1,
"start": -1
@ -41,12 +41,12 @@
{
"id": 4,
"switch": 1,
"hero": 25004,
"hero": "25004",
"pointhero": [
44005,
44005,
44005,
44005
"44005",
"44005",
"44005",
"44005"
],
"awaken": -1,
"start": -1
@ -54,12 +54,12 @@
{
"id": 5,
"switch": 1,
"hero": 45003,
"hero": "45003",
"pointhero": [
44005,
44005,
44005,
44005
"44005",
"44005",
"44005",
"44005"
],
"awaken": -1,
"start": -1

View File

@ -3,7 +3,6 @@ package hero
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"strconv"
"google.golang.org/protobuf/proto"
)
@ -51,8 +50,8 @@ func (this *apiComp) Fusion(session comm.IUserSession, req *pb.HeroFusionReq) (c
_costMaphero[k] = _obj
}
for _, v := range conf.Pointhero {
if v1, ok := mapHero[strconv.Itoa(int(v))]; !ok {
v1 -= v
if _, ok := mapHero[v]; !ok {
mapHero[v] -= 1
} else {
code = pb.ErrorCode_ReqParameterError
return
@ -72,7 +71,7 @@ func (this *apiComp) Fusion(session comm.IUserSession, req *pb.HeroFusionReq) (c
ChangeList = append(ChangeList, _costMaphero[k])
}
// 获得新卡
newHero, err := this.module.modelHero.createHeroOverlying(session.GetUserId(), strconv.Itoa(int(conf.Hero)), 1)
newHero, err := this.module.modelHero.createHeroOverlying(session.GetUserId(), conf.Hero, 1)
if err != nil {
ChangeList = append(ChangeList, newHero)
}

View File

@ -13,8 +13,8 @@ import "errors"
type GameHerofusionData struct {
Id int32
Switch int32
Hero int32
Pointhero []int32
Hero string
Pointhero []string
Awaken int32
Start int32
}
@ -28,17 +28,17 @@ func (*GameHerofusionData) GetTypeId() int32 {
func (_v *GameHerofusionData)Deserialize(_buf map[string]interface{}) (err error) {
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["id"].(float64); !_ok_ { err = errors.New("id error"); return }; _v.Id = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["switch"].(float64); !_ok_ { err = errors.New("switch error"); return }; _v.Switch = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["hero"].(float64); !_ok_ { err = errors.New("hero error"); return }; _v.Hero = int32(_tempNum_) }
{ var _ok_ bool; if _v.Hero, _ok_ = _buf["hero"].(string); !_ok_ { err = errors.New("hero error"); return } }
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["pointhero"].([]interface{}); !_ok_ { err = errors.New("pointhero error"); return }
_v.Pointhero = make([]int32, 0, len(_arr_))
_v.Pointhero = make([]string, 0, len(_arr_))
for _, _e_ := range _arr_ {
var _list_v_ int32
{ var _ok_ bool; var _x_ float64; if _x_, _ok_ = _e_.(float64); !_ok_ { err = errors.New("_list_v_ error"); return }; _list_v_ = int32(_x_) }
var _list_v_ string
{ if _list_v_, _ok_ = _e_.(string); !_ok_ { err = errors.New("_list_v_ error"); return } }
_v.Pointhero = append(_v.Pointhero, _list_v_)
}
}