From 9875ed8a2f65c0443ac58df375670f78da81b910 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Mon, 17 Oct 2022 14:16:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8B=B1=E9=9B=84=E5=90=88=E6=88=90=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E9=85=8D=E7=BD=AE=E7=B1=BB=E5=9E=8B=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/json/game_herofusion.json | 50 ++++++++++---------- modules/hero/api_fusion.go | 7 ++- sys/configure/structs/Game.HerofusionData.go | 12 ++--- 3 files changed, 34 insertions(+), 35 deletions(-) diff --git a/bin/json/game_herofusion.json b/bin/json/game_herofusion.json index ae1cafb7f..f1b90c776 100644 --- a/bin/json/game_herofusion.json +++ b/bin/json/game_herofusion.json @@ -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 diff --git a/modules/hero/api_fusion.go b/modules/hero/api_fusion.go index e1b36edf1..bac9e8a03 100644 --- a/modules/hero/api_fusion.go +++ b/modules/hero/api_fusion.go @@ -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) } diff --git a/sys/configure/structs/Game.HerofusionData.go b/sys/configure/structs/Game.HerofusionData.go index 74641a9e7..eb481d465 100644 --- a/sys/configure/structs/Game.HerofusionData.go +++ b/sys/configure/structs/Game.HerofusionData.go @@ -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_) } }