抽卡配置表解析, 推送协议大写改小写

This commit is contained in:
meixiongfeng 2022-07-19 14:32:38 +08:00
parent 23ea4597bc
commit 989cc98065
10 changed files with 255 additions and 5 deletions

View File

@ -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
}
]

View File

@ -0,0 +1,9 @@
[
{
"key": 1,
"time": 20220715,
"duration": 14,
"up_hero": 10001,
"up_weight": 10000
}
]

View File

@ -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!")

View File

@ -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!")

View File

@ -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

View File

@ -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
}

View File

@ -0,0 +1,42 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
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]
}

View File

@ -0,0 +1,31 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
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
}

View File

@ -0,0 +1,42 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
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]
}

View File

@ -0,0 +1,33 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
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
}