diff --git a/bin/json/game_drawcard.json b/bin/json/game_drawcard.json new file mode 100644 index 000000000..b8017bd01 --- /dev/null +++ b/bin/json/game_drawcard.json @@ -0,0 +1,92 @@ +[ + { + "key": 1, + "id": 10001, + "type_id": 1, + "weight": 1000 + }, + { + "key": 2, + "id": 10002, + "type_id": 1, + "weight": 1000 + }, + { + "key": 3, + "id": 10003, + "type_id": 1, + "weight": 1000 + }, + { + "key": 4, + "id": 10004, + "type_id": 1, + "weight": 1000 + }, + { + "key": 5, + "id": 10005, + "type_id": 1, + "weight": 1000 + }, + { + "key": 6, + "id": 10006, + "type_id": 1, + "weight": 1000 + }, + { + "key": 7, + "id": 10007, + "type_id": 1, + "weight": 1000 + }, + { + "key": 8, + "id": 10008, + "type_id": 1, + "weight": 1000 + }, + { + "key": 9, + "id": 10009, + "type_id": 1, + "weight": 1000 + }, + { + "key": 10, + "id": 10010, + "type_id": 1, + "weight": 1000 + }, + { + "key": 11, + "id": 10011, + "type_id": 1, + "weight": 1000 + }, + { + "key": 12, + "id": 10012, + "type_id": 1, + "weight": 1000 + }, + { + "key": 13, + "id": 10013, + "type_id": 1, + "weight": 1000 + }, + { + "key": 14, + "id": 10014, + "type_id": 1, + "weight": 1000 + }, + { + "key": 15, + "id": 10015, + "type_id": 1, + "weight": 1000 + } +] \ No newline at end of file diff --git a/bin/json/game_drawupdraw.json b/bin/json/game_drawupdraw.json new file mode 100644 index 000000000..1c3836489 --- /dev/null +++ b/bin/json/game_drawupdraw.json @@ -0,0 +1,9 @@ +[ + { + "key": 1, + "time": 20220715, + "duration": 14, + "up_hero": 10001, + "up_weight": 10000 + } +] \ No newline at end of file diff --git a/modules/hero/api_resonance.go b/modules/hero/api_resonance.go index 8f1f3e30e..9f26ce4c0 100644 --- a/modules/hero/api_resonance.go +++ b/modules/hero/api_resonance.go @@ -123,7 +123,7 @@ func (this *apiComp) Resonance(session comm.IUserSession, req *pb.HeroResonanceR } } - session.SendMsg(string(this.module.GetType()), "delHero", &pb.HeroDelHeroPush{Heros: szCostHero}) // 推送删除的英雄 + session.SendMsg(string(this.module.GetType()), "delhero", &pb.HeroDelHeroPush{Heros: szCostHero}) // 推送删除的英雄 err1 = this.module.modelHero.PushHeroProperty(session, _hero.Id) // 推送属性变化 if err1 != nil { this.module.Errorf("PushHeroProperty err!") diff --git a/modules/hero/api_skillUp.go b/modules/hero/api_skillUp.go index 0d58ea631..7131cf199 100644 --- a/modules/hero/api_skillUp.go +++ b/modules/hero/api_skillUp.go @@ -131,7 +131,7 @@ func (this *apiComp) StrengthenUpSkill(session comm.IUserSession, req *pb.HeroSt return } - session.SendMsg(string(this.module.GetType()), "delHero", &pb.HeroDelHeroPush{Heros: map[string]int32{req.CostCardObj: 1}}) // 推送删除的英雄 + session.SendMsg(string(this.module.GetType()), "delhero", &pb.HeroDelHeroPush{Heros: map[string]int32{req.CostCardObj: 1}}) // 推送删除的英雄 err1 = this.module.modelHero.PushHeroProperty(session, _hero.Id) // 推送属性变化 if err1 != nil { this.module.Errorf("PushHeroProperty err!") diff --git a/modules/hero/api_starUp.go b/modules/hero/api_starUp.go index a4e60e6cc..3dba0db0a 100644 --- a/modules/hero/api_starUp.go +++ b/modules/hero/api_starUp.go @@ -138,7 +138,7 @@ func (this *apiComp) StrengthenUpStar(session comm.IUserSession, req *pb.HeroStr return } } - session.SendMsg(string(this.module.GetType()), "delHero", &pb.HeroDelHeroPush{Heros: mapCostHero}) + session.SendMsg(string(this.module.GetType()), "delhero", &pb.HeroDelHeroPush{Heros: mapCostHero}) code = this.module.modelHero.HeroStarUp(session, _hero) // 执行升星操作 if code != pb.ErrorCode_Success { return diff --git a/modules/hero/api_strengthen.go b/modules/hero/api_strengthen.go index 08205b548..c4be1d1dc 100644 --- a/modules/hero/api_strengthen.go +++ b/modules/hero/api_strengthen.go @@ -168,12 +168,13 @@ func (this *apiComp) StrengthenUplv(session comm.IUserSession, req *pb.HeroStren } } - session.SendMsg(string(this.module.GetType()), "delHero", &pb.HeroDelHeroPush{Heros: req.ExpCards}) // 推送删除的英雄 + session.SendMsg(string(this.module.GetType()), "delhero", &pb.HeroDelHeroPush{Heros: req.ExpCards}) // 推送删除的英雄 err1 := this.module.modelHero.PushHeroProperty(session, _hero.Id) // 推送属性变化 if err1 != nil { this.module.Errorf("PushHeroProperty err!") } - + _hero.Lv = curLv + _hero.Exp = curExp session.SendMsg(string(this.module.GetType()), StrengthenUplv, &pb.HeroStrengthenUplvResp{Hero: _hero}) return } diff --git a/sys/configure/structs/game.drawCard.go b/sys/configure/structs/game.drawCard.go new file mode 100644 index 000000000..5d2bf1d12 --- /dev/null +++ b/sys/configure/structs/game.drawCard.go @@ -0,0 +1,42 @@ + +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ +package cfg + +type Game_drawCard struct { + _dataMap map[int32]*Game_drawCardData + _dataList []*Game_drawCardData +} + +func NewGame_drawCard(_buf []map[string]interface{}) (*Game_drawCard, error) { + _dataList := make([]*Game_drawCardData, 0, len(_buf)) + dataMap := make(map[int32]*Game_drawCardData) + for _, _ele_ := range _buf { + if _v, err2 := NewGame_drawCardData(_ele_); err2 != nil { + return nil, err2 + } else { + _dataList = append(_dataList, _v) + dataMap[_v.Key] = _v + } + } + return &Game_drawCard{_dataList:_dataList, _dataMap:dataMap}, nil +} + +func (table *Game_drawCard) GetDataMap() map[int32]*Game_drawCardData { + return table._dataMap +} + +func (table *Game_drawCard) GetDataList() []*Game_drawCardData { + return table._dataList +} + +func (table *Game_drawCard) Get(key int32) *Game_drawCardData { + return table._dataMap[key] +} + + diff --git a/sys/configure/structs/game.drawCardData.go b/sys/configure/structs/game.drawCardData.go new file mode 100644 index 000000000..7be6fdd3e --- /dev/null +++ b/sys/configure/structs/game.drawCardData.go @@ -0,0 +1,31 @@ + +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ +package cfg + +import "errors" + +type Game_drawCardData struct { + Key int32 + Id int32 + TypeId int32 + Weight int32 +} + +func (Game_drawCardData) GetTypeId() int { + return -179684166 +} + +func NewGame_drawCardData(_buf map[string]interface{}) (_v *Game_drawCardData, err error) { + _v = &Game_drawCardData{} + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["key"].(float64); !_ok_ { err = errors.New("key error"); return }; _v.Key = int32(_tempNum_) } + { 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["type_id"].(float64); !_ok_ { err = errors.New("type_id error"); return }; _v.TypeId = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["weight"].(float64); !_ok_ { err = errors.New("weight error"); return }; _v.Weight = int32(_tempNum_) } + return +} diff --git a/sys/configure/structs/game.drawUpdraw.go b/sys/configure/structs/game.drawUpdraw.go new file mode 100644 index 000000000..0cea3ae06 --- /dev/null +++ b/sys/configure/structs/game.drawUpdraw.go @@ -0,0 +1,42 @@ + +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ +package cfg + +type Game_drawUpdraw struct { + _dataMap map[int32]*Game_drawUpdrawData + _dataList []*Game_drawUpdrawData +} + +func NewGame_drawUpdraw(_buf []map[string]interface{}) (*Game_drawUpdraw, error) { + _dataList := make([]*Game_drawUpdrawData, 0, len(_buf)) + dataMap := make(map[int32]*Game_drawUpdrawData) + for _, _ele_ := range _buf { + if _v, err2 := NewGame_drawUpdrawData(_ele_); err2 != nil { + return nil, err2 + } else { + _dataList = append(_dataList, _v) + dataMap[_v.Key] = _v + } + } + return &Game_drawUpdraw{_dataList:_dataList, _dataMap:dataMap}, nil +} + +func (table *Game_drawUpdraw) GetDataMap() map[int32]*Game_drawUpdrawData { + return table._dataMap +} + +func (table *Game_drawUpdraw) GetDataList() []*Game_drawUpdrawData { + return table._dataList +} + +func (table *Game_drawUpdraw) Get(key int32) *Game_drawUpdrawData { + return table._dataMap[key] +} + + diff --git a/sys/configure/structs/game.drawUpdrawData.go b/sys/configure/structs/game.drawUpdrawData.go new file mode 100644 index 000000000..74870f8b1 --- /dev/null +++ b/sys/configure/structs/game.drawUpdrawData.go @@ -0,0 +1,33 @@ + +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ +package cfg + +import "errors" + +type Game_drawUpdrawData struct { + Key int32 + Time int32 + Duration int32 + UpHero int32 + UpWeight int32 +} + +func (Game_drawUpdrawData) GetTypeId() int { + return 297664649 +} + +func NewGame_drawUpdrawData(_buf map[string]interface{}) (_v *Game_drawUpdrawData, err error) { + _v = &Game_drawUpdrawData{} + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["key"].(float64); !_ok_ { err = errors.New("key error"); return }; _v.Key = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["time"].(float64); !_ok_ { err = errors.New("time error"); return }; _v.Time = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["duration"].(float64); !_ok_ { err = errors.New("duration error"); return }; _v.Duration = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["up_hero"].(float64); !_ok_ { err = errors.New("up_hero error"); return }; _v.UpHero = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["up_weight"].(float64); !_ok_ { err = errors.New("up_weight error"); return }; _v.UpWeight = int32(_tempNum_) } + return +}