上传配置代码
This commit is contained in:
parent
686ca844aa
commit
4c8d8e2bb4
@ -2,6 +2,7 @@
|
||||
{
|
||||
"id": 1,
|
||||
"model": "34006",
|
||||
"weight": 1000,
|
||||
"startstory": 3007,
|
||||
"rejectstory": 3001,
|
||||
"endstory": 3002,
|
||||
@ -13,9 +14,6 @@
|
||||
"key": "story_80",
|
||||
"text": "踢馆1号的文本"
|
||||
},
|
||||
"FormatList": [
|
||||
700011
|
||||
],
|
||||
"BattleReadyID": 100,
|
||||
"EventList": [],
|
||||
"award": [
|
||||
@ -30,10 +28,80 @@
|
||||
"n": 1
|
||||
}
|
||||
],
|
||||
"story_award": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 2640
|
||||
},
|
||||
{
|
||||
"a": "item",
|
||||
"t": "30001",
|
||||
"n": 1
|
||||
}
|
||||
],
|
||||
"onlookers": [
|
||||
"45003",
|
||||
"25001"
|
||||
],
|
||||
"challenge_onlookers": [
|
||||
"45003",
|
||||
"25001"
|
||||
],
|
||||
"onlookersstory": [
|
||||
30001,
|
||||
30001
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"model": "35002",
|
||||
"weight": 1000,
|
||||
"startstory": 3007,
|
||||
"rejectstory": 3001,
|
||||
"endstory": 3002,
|
||||
"battlename": {
|
||||
"key": "story_81",
|
||||
"text": "踢馆2号"
|
||||
},
|
||||
"battletxt": {
|
||||
"key": "story_81",
|
||||
"text": "踢馆2号的文本"
|
||||
},
|
||||
"BattleReadyID": 100,
|
||||
"EventList": [],
|
||||
"award": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 6480
|
||||
},
|
||||
{
|
||||
"a": "item",
|
||||
"t": "30001",
|
||||
"n": 2
|
||||
}
|
||||
],
|
||||
"story_award": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 6480
|
||||
},
|
||||
{
|
||||
"a": "item",
|
||||
"t": "30001",
|
||||
"n": 2
|
||||
}
|
||||
],
|
||||
"onlookers": [
|
||||
"45003",
|
||||
"25001"
|
||||
],
|
||||
"challenge_onlookers": [
|
||||
"45003",
|
||||
"25001"
|
||||
],
|
||||
"onlookersstory": [
|
||||
30001,
|
||||
30001
|
||||
|
@ -385,6 +385,8 @@ type (
|
||||
IReddot
|
||||
//设置用户积分
|
||||
SetUserIntegral(session IUserSession, Integral int32) (err error)
|
||||
//获取匹配战斗角色列表
|
||||
GetMatcheBattleRoles(uid string) (captain int32, rules []*pb.BattleRole, err error)
|
||||
}
|
||||
IGourmet interface {
|
||||
///红点
|
||||
|
@ -117,3 +117,9 @@ func (this *Arena) SetUserIntegral(session comm.IUserSession, Integral int32) (e
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
///获取竞技场匹配目标战斗阵型数据
|
||||
func (this *Arena) GetMatcheBattleRoles(uid string) (captain int32, rules []*pb.BattleRole, err error) {
|
||||
|
||||
return
|
||||
}
|
||||
|
@ -11,12 +11,13 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
game_pandamasmz = "game_pandamasmz.json"
|
||||
game_pandamasjs = "game_pandamasjs.json"
|
||||
game_pandamasjx = "game_pandamasjx.json"
|
||||
game_pandamasyxjx = "game_pandamasyxjx.json"
|
||||
game_pandamasmryl = "game_pandamasmryl.json"
|
||||
game_pandamasbuff = "game_pandamasbuff.json"
|
||||
game_pandamasmz = "game_pandamasmz.json"
|
||||
game_pandamasjs = "game_pandamasjs.json"
|
||||
game_pandamasjx = "game_pandamasjx.json"
|
||||
game_pandamasyxjx = "game_pandamasyxjx.json"
|
||||
game_pandamasmryl = "game_pandamasmryl.json"
|
||||
game_pandamasbuff = "game_pandamasbuff.json"
|
||||
game_dispatch_battle = "game_dispatch_battle.json"
|
||||
)
|
||||
|
||||
///背包配置管理组件
|
||||
@ -36,6 +37,7 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp
|
||||
this.LoadConfigure(game_pandamasjx, cfg.NewGamePandamasJx)
|
||||
this.LoadConfigure(game_pandamasyxjx, cfg.NewGamePandamasYxjx)
|
||||
this.LoadConfigure(game_pandamasmryl, cfg.NewGamePandamasMryl)
|
||||
this.LoadConfigure(game_dispatch_battle, cfg.NewGameDispatch_Battle)
|
||||
configure.RegisterConfigure(game_pandamasbuff, cfg.NewGamePandamasBuff, func() {
|
||||
this.lock.Lock()
|
||||
if v, err := this.GetConfigure(game_pandamasbuff); err != nil {
|
||||
@ -178,3 +180,36 @@ func (this *configureComp) getGamePandamasBuff(groupid int32) (configure *cfg.Ga
|
||||
configure = group[index]
|
||||
return
|
||||
}
|
||||
|
||||
//获取踢馆npc配置
|
||||
func (this *configureComp) getDispatchBattle() (configure []*cfg.GameDispatch_BattleData, err error) {
|
||||
var (
|
||||
v interface{}
|
||||
)
|
||||
if v, err = this.GetConfigure(game_dispatch_battle); err != nil {
|
||||
this.module.Errorln(err)
|
||||
return
|
||||
} else {
|
||||
configure = v.(*cfg.GameDispatch_Battle).GetDataList()
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
//获取踢馆npc配置
|
||||
func (this *configureComp) getDispatchBattleData(id int32) (configure *cfg.GameDispatch_BattleData, err error) {
|
||||
var (
|
||||
v interface{}
|
||||
ok bool
|
||||
)
|
||||
if v, err = this.GetConfigure(game_dispatch_battle); err != nil {
|
||||
this.module.Errorln(err)
|
||||
return
|
||||
} else {
|
||||
if configure, ok = v.(*cfg.GameDispatch_Battle).GetDataMap()[id]; !ok {
|
||||
err = fmt.Errorf("not found:%d ", id)
|
||||
this.module.Errorln(err)
|
||||
return
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import (
|
||||
"go_dreamfactory/lego/sys/mgo"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/pb"
|
||||
cfg "go_dreamfactory/sys/configure/structs"
|
||||
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
@ -49,6 +50,9 @@ func (this *modelPandata) queryUserMartialhall(uid string) (result *pb.DBPractic
|
||||
Pillarf: &pb.DBPracticePillar{Index: 4, Lv: 1},
|
||||
Statuers: make([]*pb.DBPracticeStatuer, 0),
|
||||
}
|
||||
if err = this.refreshnpc(result); err != nil {
|
||||
return
|
||||
}
|
||||
if err = this.Add(uid, result); err != nil {
|
||||
this.module.Errorln(err)
|
||||
return
|
||||
@ -57,3 +61,29 @@ func (this *modelPandata) queryUserMartialhall(uid string) (result *pb.DBPractic
|
||||
err = nil
|
||||
return
|
||||
}
|
||||
|
||||
//刷新npc
|
||||
func (this *modelPandata) refreshnpc(room *pb.DBPracticeRoom) (err error) {
|
||||
var (
|
||||
npcs []*cfg.GameDispatch_BattleData
|
||||
wigets []int32
|
||||
index int32
|
||||
)
|
||||
|
||||
if npcs, err = this.module.configure.getDispatchBattle(); err != nil {
|
||||
return
|
||||
}
|
||||
wigets = make([]int32, len(npcs))
|
||||
for i, v := range npcs {
|
||||
wigets[i] = v.Weight
|
||||
}
|
||||
|
||||
index = comm.GetRandW(wigets)
|
||||
room.Currnpc = npcs[index].Id
|
||||
room.Npcstate = 0
|
||||
room.Battlenum = 0
|
||||
if room.Captain, room.Formation, err = this.module.arena.GetMatcheBattleRoles(room.Uid); err != nil {
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -32,6 +32,7 @@ type Practice struct {
|
||||
pvp comm.IPvp
|
||||
mail comm.Imail
|
||||
atlas comm.IPandaAtlas
|
||||
arena comm.IArena
|
||||
api *apiComp
|
||||
configure *configureComp
|
||||
modelPandata *modelPandata
|
||||
@ -64,6 +65,10 @@ func (this *Practice) Start() (err error) {
|
||||
return
|
||||
}
|
||||
this.atlas = module.(comm.IPandaAtlas)
|
||||
if module, err = this.service.GetModule(comm.ModuleArena); err != nil {
|
||||
return
|
||||
}
|
||||
this.arena = module.(comm.IArena)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -100,17 +100,31 @@ func (this *apiComp) Getlist(session comm.IUserSession, req *pb.ShopGetListReq)
|
||||
}
|
||||
|
||||
if req.IsManualRefresh && shopconf.Rtype == 1 { //可以手动刷新
|
||||
//剩余刷新次数为零
|
||||
if leftrefnum == 0 {
|
||||
code = pb.ErrorCode_ShopNoSurplusRefreshNum
|
||||
return
|
||||
} else if leftrefnum > 0 {
|
||||
leftrefnum--
|
||||
isrefresh := false
|
||||
refresh := int(this.module.privilege.GetCountByPrivilegeId(session.GetUserId(), comm.PrivilegeType2))
|
||||
if refresh > 0 { //
|
||||
if time.Unix(shopData.RefreshtimegoldShop, 0).Day() < configure.Now().Day() {
|
||||
shopData.RefreshtimegoldShop = configure.Now().Unix()
|
||||
shopData.RefreshnumgoldShop = 0
|
||||
}
|
||||
if int(shopData.RefreshnumgoldShop) < refresh {
|
||||
isrefresh = true
|
||||
}
|
||||
}
|
||||
if !isrefresh {
|
||||
//剩余刷新次数为零
|
||||
if leftrefnum == 0 {
|
||||
code = pb.ErrorCode_ShopNoSurplusRefreshNum
|
||||
return
|
||||
} else if leftrefnum > 0 {
|
||||
leftrefnum--
|
||||
}
|
||||
|
||||
if code = this.module.ConsumeRes(session, shopconf.Rneed, true); code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if code = this.module.ConsumeRes(session, shopconf.Rneed, true); code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
var _items []*cfg.GameShopitemData
|
||||
for _, v := range shopconf.Shopitem {
|
||||
if _items, err = this.module.configure.GetShopItemsConfigureByGroups(v, udata); err != nil || len(_items) == 0 {
|
||||
@ -134,23 +148,23 @@ func (this *apiComp) Getlist(session comm.IUserSession, req *pb.ShopGetListReq)
|
||||
}
|
||||
}
|
||||
this.module.ModuleRtask.SendToRtask(session, comm.Rtype105, 1)
|
||||
this.module.modelShop.Change(session.GetUserId(), map[string]interface{}{filed: sdata})
|
||||
this.module.modelShop.Change(session.GetUserId(), map[string]interface{}{"refreshnumgoldShop": shopData.RefreshnumgoldShop, "refreshtimegoldShop": shopData.RefreshtimegoldShop, filed: sdata})
|
||||
} else if !req.IsManualRefresh {
|
||||
refresh := int(this.module.privilege.GetCountByPrivilegeId(session.GetUserId(), comm.PrivilegeType2))
|
||||
// refresh := int(this.module.privilege.GetCountByPrivilegeId(session.GetUserId(), comm.PrivilegeType2))
|
||||
isrefresh := false
|
||||
if refresh > 0 { //
|
||||
if time.Unix(shopData.RefreshtimegoldShop, 0).Day() < configure.Now().Day() {
|
||||
shopData.RefreshtimegoldShop = configure.Now().Unix()
|
||||
shopData.RefreshnumgoldShop = 0
|
||||
}
|
||||
if int(shopData.RefreshnumgoldShop) < refresh {
|
||||
isrefresh = true
|
||||
}
|
||||
} else {
|
||||
if tdata > ltime { //达到刷新时间 可以刷新商品列表
|
||||
isrefresh = true
|
||||
}
|
||||
// if refresh > 0 { //
|
||||
// if time.Unix(shopData.RefreshtimegoldShop, 0).Day() < configure.Now().Day() {
|
||||
// shopData.RefreshtimegoldShop = configure.Now().Unix()
|
||||
// shopData.RefreshnumgoldShop = 0
|
||||
// }
|
||||
// if int(shopData.RefreshnumgoldShop) < refresh {
|
||||
// isrefresh = true
|
||||
// }
|
||||
// } else {
|
||||
if tdata > ltime { //达到刷新时间 可以刷新商品列表
|
||||
isrefresh = true
|
||||
}
|
||||
// }
|
||||
if isrefresh {
|
||||
var _items []*cfg.GameShopitemData
|
||||
for _, v := range shopconf.Shopitem {
|
||||
@ -174,7 +188,7 @@ func (this *apiComp) Getlist(session comm.IUserSession, req *pb.ShopGetListReq)
|
||||
}
|
||||
}
|
||||
goods = transGoods(items, sdata)
|
||||
this.module.modelShop.Change(session.GetUserId(), map[string]interface{}{"refreshnumgoldShop": shopData.RefreshnumgoldShop, "refreshtimegoldShop": shopData.RefreshtimegoldShop, filed: sdata})
|
||||
this.module.modelShop.Change(session.GetUserId(), map[string]interface{}{filed: sdata})
|
||||
this.module.ModuleRtask.SendToRtask(session, comm.Rtype105, 1)
|
||||
} else { //返回以前的商品列表
|
||||
if items, err = this.module.configure.GetShopItemsConfigureByIds(sdata.Items...); err != nil {
|
||||
|
@ -287,10 +287,11 @@ type DBPracticeRoom struct {
|
||||
Pillarf *DBPracticePillar `protobuf:"bytes,11,opt,name=pillarf,proto3" json:"pillarf"` //好友柱子
|
||||
Statuers []*DBPracticeStatuer `protobuf:"bytes,12,rep,name=statuers,proto3" json:"statuers"` //武馆雕像
|
||||
Currnpc int32 `protobuf:"varint,13,opt,name=currnpc,proto3" json:"currnpc"` //当前npc
|
||||
Refresh int64 `protobuf:"varint,14,opt,name=refresh,proto3" json:"refresh"` //刷新时间
|
||||
Battlenum int32 `protobuf:"varint,15,opt,name=battlenum,proto3" json:"battlenum"` //战斗次数
|
||||
Captain int32 `protobuf:"varint,16,opt,name=captain,proto3" json:"captain"` //战斗征信队长位
|
||||
Formation []*BattleRole `protobuf:"bytes,17,rep,name=formation,proto3" json:"formation"` //战斗阵型
|
||||
Npcstate int32 `protobuf:"varint,14,opt,name=npcstate,proto3" json:"npcstate"` //npc状态 0 未挑战 1 挑战失败 2挑战成功
|
||||
Refresh int64 `protobuf:"varint,15,opt,name=refresh,proto3" json:"refresh"` //刷新时间
|
||||
Battlenum int32 `protobuf:"varint,16,opt,name=battlenum,proto3" json:"battlenum"` //战斗次数
|
||||
Captain int32 `protobuf:"varint,17,opt,name=captain,proto3" json:"captain"` //战斗征信队长位
|
||||
Formation []*BattleRole `protobuf:"bytes,18,rep,name=formation,proto3" json:"formation"` //战斗阵型
|
||||
}
|
||||
|
||||
func (x *DBPracticeRoom) Reset() {
|
||||
@ -416,6 +417,13 @@ func (x *DBPracticeRoom) GetCurrnpc() int32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *DBPracticeRoom) GetNpcstate() int32 {
|
||||
if x != nil {
|
||||
return x.Npcstate
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *DBPracticeRoom) GetRefresh() int64 {
|
||||
if x != nil {
|
||||
return x.Refresh
|
||||
@ -618,7 +626,7 @@ var file_practice_practice_db_proto_rawDesc = []byte{
|
||||
0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x67, 0x75, 0x72,
|
||||
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x12,
|
||||
0x16, 0x0a, 0x06, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52,
|
||||
0x06, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x22, 0xed, 0x05, 0x0a, 0x0e, 0x44, 0x42, 0x50, 0x72,
|
||||
0x06, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x22, 0x89, 0x06, 0x0a, 0x0e, 0x44, 0x42, 0x50, 0x72,
|
||||
0x61, 0x63, 0x74, 0x69, 0x63, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69,
|
||||
0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09,
|
||||
@ -650,39 +658,41 @@ var file_practice_practice_db_proto_rawDesc = []byte{
|
||||
0x42, 0x50, 0x72, 0x61, 0x63, 0x74, 0x69, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x65, 0x72,
|
||||
0x52, 0x08, 0x73, 0x74, 0x61, 0x74, 0x75, 0x65, 0x72, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x75,
|
||||
0x72, 0x72, 0x6e, 0x70, 0x63, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x63, 0x75, 0x72,
|
||||
0x72, 0x6e, 0x70, 0x63, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x18,
|
||||
0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x12, 0x1c,
|
||||
0x0a, 0x09, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x0f, 0x20, 0x01, 0x28,
|
||||
0x05, 0x52, 0x09, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x6e, 0x75, 0x6d, 0x12, 0x18, 0x0a, 0x07,
|
||||
0x63, 0x61, 0x70, 0x74, 0x61, 0x69, 0x6e, 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x63,
|
||||
0x61, 0x70, 0x74, 0x61, 0x69, 0x6e, 0x12, 0x29, 0x0a, 0x09, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x18, 0x11, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74,
|
||||
0x6c, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x09, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x1a, 0x37, 0x0a, 0x09, 0x46, 0x75, 0x6c, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10,
|
||||
0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79,
|
||||
0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3b, 0x0a, 0x0d, 0x4b, 0x6e,
|
||||
0x61, 0x70, 0x73, 0x61, 0x63, 0x6b, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b,
|
||||
0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a,
|
||||
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61,
|
||||
0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x48, 0x0a, 0x16, 0x44, 0x42, 0x50, 0x72, 0x61,
|
||||
0x63, 0x74, 0x69, 0x63, 0x65, 0x51, 0x69, 0x65, 0x63, 0x75, 0x6f, 0x49, 0x6e, 0x76, 0x69, 0x74,
|
||||
0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
|
||||
0x75, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70,
|
||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,
|
||||
0x70, 0x22, 0xb5, 0x01, 0x0a, 0x16, 0x44, 0x42, 0x50, 0x72, 0x61, 0x63, 0x74, 0x69, 0x63, 0x65,
|
||||
0x51, 0x69, 0x65, 0x63, 0x75, 0x6f, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02,
|
||||
0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03,
|
||||
0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x31,
|
||||
0x0a, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32,
|
||||
0x17, 0x2e, 0x44, 0x42, 0x50, 0x72, 0x61, 0x63, 0x74, 0x69, 0x63, 0x65, 0x51, 0x69, 0x65, 0x63,
|
||||
0x75, 0x6f, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x52, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74,
|
||||
0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28,
|
||||
0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x61, 0x74,
|
||||
0x74, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x61, 0x74, 0x74, 0x69,
|
||||
0x64, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x06, 0x20, 0x03, 0x28,
|
||||
0x09, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70,
|
||||
0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x72, 0x6e, 0x70, 0x63, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x70, 0x63, 0x73, 0x74, 0x61, 0x74, 0x65,
|
||||
0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6e, 0x70, 0x63, 0x73, 0x74, 0x61, 0x74, 0x65,
|
||||
0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x18, 0x0f, 0x20, 0x01, 0x28,
|
||||
0x03, 0x52, 0x07, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x62, 0x61,
|
||||
0x74, 0x74, 0x6c, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x62,
|
||||
0x61, 0x74, 0x74, 0x6c, 0x65, 0x6e, 0x75, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x61, 0x70, 0x74,
|
||||
0x61, 0x69, 0x6e, 0x18, 0x11, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x63, 0x61, 0x70, 0x74, 0x61,
|
||||
0x69, 0x6e, 0x12, 0x29, 0x0a, 0x09, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18,
|
||||
0x12, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x52, 0x6f,
|
||||
0x6c, 0x65, 0x52, 0x09, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x37, 0x0a,
|
||||
0x09, 0x46, 0x75, 0x6c, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65,
|
||||
0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05,
|
||||
0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c,
|
||||
0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3b, 0x0a, 0x0d, 0x4b, 0x6e, 0x61, 0x70, 0x73, 0x61,
|
||||
0x63, 0x6b, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c,
|
||||
0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a,
|
||||
0x02, 0x38, 0x01, 0x22, 0x48, 0x0a, 0x16, 0x44, 0x42, 0x50, 0x72, 0x61, 0x63, 0x74, 0x69, 0x63,
|
||||
0x65, 0x51, 0x69, 0x65, 0x63, 0x75, 0x6f, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x12, 0x10, 0x0a,
|
||||
0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12,
|
||||
0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0xb5, 0x01,
|
||||
0x0a, 0x16, 0x44, 0x42, 0x50, 0x72, 0x61, 0x63, 0x74, 0x69, 0x63, 0x65, 0x51, 0x69, 0x65, 0x63,
|
||||
0x75, 0x6f, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x31, 0x0a, 0x07, 0x74, 0x61,
|
||||
0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x44, 0x42,
|
||||
0x50, 0x72, 0x61, 0x63, 0x74, 0x69, 0x63, 0x65, 0x51, 0x69, 0x65, 0x63, 0x75, 0x6f, 0x49, 0x6e,
|
||||
0x76, 0x69, 0x74, 0x65, 0x52, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x16, 0x0a,
|
||||
0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73,
|
||||
0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x61, 0x74, 0x74, 0x69, 0x64, 0x18,
|
||||
0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x61, 0x74, 0x74, 0x69, 0x64, 0x12, 0x16, 0x0a,
|
||||
0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x6d,
|
||||
0x65, 0x6d, 0x62, 0x65, 0x72, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
@ -13,16 +13,18 @@ import "errors"
|
||||
type GameDispatch_BattleData struct {
|
||||
Id int32
|
||||
Model string
|
||||
Weight int32
|
||||
Startstory int32
|
||||
Rejectstory int32
|
||||
Endstory int32
|
||||
Battlename string
|
||||
Battletxt string
|
||||
FormatList []int32
|
||||
BattleReadyID int32
|
||||
EventList []int32
|
||||
Award []*Gameatn
|
||||
StoryAward []*Gameatn
|
||||
Onlookers []string
|
||||
ChallengeOnlookers []string
|
||||
Onlookersstory []int32
|
||||
}
|
||||
|
||||
@ -35,25 +37,12 @@ func (*GameDispatch_BattleData) GetTypeId() int32 {
|
||||
func (_v *GameDispatch_BattleData)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; if _v.Model, _ok_ = _buf["model"].(string); !_ok_ { err = errors.New("model error"); return } }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["weight"].(float64); !_ok_ { err = errors.New("weight error"); return }; _v.Weight = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["startstory"].(float64); !_ok_ { err = errors.New("startstory error"); return }; _v.Startstory = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["rejectstory"].(float64); !_ok_ { err = errors.New("rejectstory error"); return }; _v.Rejectstory = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["endstory"].(float64); !_ok_ { err = errors.New("endstory error"); return }; _v.Endstory = int32(_tempNum_) }
|
||||
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["battlename"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Battlename error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Battlename, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
|
||||
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["battletxt"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Battletxt error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Battletxt, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
if _arr_, _ok_ = _buf["FormatList"].([]interface{}); !_ok_ { err = errors.New("FormatList error"); return }
|
||||
|
||||
_v.FormatList = make([]int32, 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_) }
|
||||
_v.FormatList = append(_v.FormatList, _list_v_)
|
||||
}
|
||||
}
|
||||
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["BattleReadyID"].(float64); !_ok_ { err = errors.New("BattleReadyID error"); return }; _v.BattleReadyID = int32(_tempNum_) }
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
@ -83,6 +72,20 @@ func (_v *GameDispatch_BattleData)Deserialize(_buf map[string]interface{}) (err
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
if _arr_, _ok_ = _buf["story_award"].([]interface{}); !_ok_ { err = errors.New("story_award error"); return }
|
||||
|
||||
_v.StoryAward = 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.StoryAward = append(_v.StoryAward, _list_v_)
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
@ -97,6 +100,20 @@ func (_v *GameDispatch_BattleData)Deserialize(_buf map[string]interface{}) (err
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
if _arr_, _ok_ = _buf["challenge_onlookers"].([]interface{}); !_ok_ { err = errors.New("challenge_onlookers error"); return }
|
||||
|
||||
_v.ChallengeOnlookers = make([]string, 0, len(_arr_))
|
||||
|
||||
for _, _e_ := range _arr_ {
|
||||
var _list_v_ string
|
||||
{ if _list_v_, _ok_ = _e_.(string); !_ok_ { err = errors.New("_list_v_ error"); return } }
|
||||
_v.ChallengeOnlookers = append(_v.ChallengeOnlookers, _list_v_)
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
|
Loading…
Reference in New Issue
Block a user