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

This commit is contained in:
meixiongfeng 2022-09-19 18:50:22 +08:00
commit 730973c39c
18 changed files with 2103 additions and 489 deletions

File diff suppressed because it is too large Load Diff

View File

@ -6,8 +6,8 @@
"name": "师徒二人",
"lv": 1,
"hid": [
25001,
35001
"25001",
"35001"
],
"favorlv": 1,
"prize": []
@ -19,8 +19,8 @@
"name": "师徒二人",
"lv": 2,
"hid": [
25001,
35001
"25001",
"35001"
],
"favorlv": 2,
"prize": [
@ -43,8 +43,8 @@
"name": "师徒二人",
"lv": 3,
"hid": [
25001,
35001
"25001",
"35001"
],
"favorlv": 3,
"prize": [
@ -67,9 +67,9 @@
"name": "毫不相干",
"lv": 1,
"hid": [
11003,
11009,
15004
"11003",
"11009",
"15004"
],
"favorlv": 1,
"prize": []
@ -81,9 +81,9 @@
"name": "毫不相干",
"lv": 2,
"hid": [
11003,
11009,
15004
"11003",
"11009",
"15004"
],
"favorlv": 2,
"prize": [
@ -106,9 +106,9 @@
"name": "毫不相干",
"lv": 3,
"hid": [
11003,
11009,
15004
"11003",
"11009",
"15004"
],
"favorlv": 3,
"prize": [

View File

@ -1,15 +1,15 @@
[
{
"hid": 15004,
"hid": "15004",
"name": {
"key": "hero_15004",
"text": "小欧"
},
"star": 5,
"history": [
150041,
150042,
150043
"150041",
"150042",
"150043"
],
"favorlv": [
1,
@ -32,16 +32,16 @@
]
},
{
"hid": 25001,
"hid": "25001",
"name": {
"key": "hero_25001",
"text": "阿宝"
},
"star": 5,
"history": [
250011,
250012,
250013
"250011",
"250012",
"250013"
],
"favorlv": [
1,
@ -64,16 +64,16 @@
]
},
{
"hid": 35001,
"hid": "35001",
"name": {
"key": "hero_35001",
"text": "师父"
},
"star": 4,
"history": [
350011,
350012,
350013
"350011",
"350012",
"350013"
],
"favorlv": [
1,
@ -96,16 +96,16 @@
]
},
{
"hid": 11009,
"hid": "11009",
"name": {
"key": "hero_35002",
"text": "希卡普"
},
"star": 4,
"history": [
110091,
110092,
110093
"110091",
"110092",
"110093"
],
"favorlv": [
1,

View File

@ -1,6 +1,6 @@
[
{
"histroy": 150041,
"histroy": "150041",
"txt": "小欧是个很乖巧的姑娘",
"prize": [
{
@ -11,7 +11,7 @@
]
},
{
"histroy": 150042,
"histroy": "150042",
"txt": "小欧是个很潇洒的姑娘",
"prize": [
{
@ -22,7 +22,7 @@
]
},
{
"histroy": 150043,
"histroy": "150043",
"txt": "小欧是个深情的姑娘",
"prize": [
{
@ -33,7 +33,7 @@
]
},
{
"histroy": 250011,
"histroy": "250011",
"txt": "阿宝长得贼胖",
"prize": [
{
@ -44,7 +44,7 @@
]
},
{
"histroy": 250012,
"histroy": "250012",
"txt": "阿宝长得贼圆",
"prize": [
{
@ -55,7 +55,7 @@
]
},
{
"histroy": 250013,
"histroy": "250013",
"txt": "阿宝长得贼可爱",
"prize": [
{
@ -66,7 +66,7 @@
]
},
{
"histroy": 350011,
"histroy": "350011",
"txt": "师父武功高强",
"prize": [
{
@ -77,7 +77,7 @@
]
},
{
"histroy": 350012,
"histroy": "350012",
"txt": "师父很傲娇",
"prize": [
{
@ -88,7 +88,7 @@
]
},
{
"histroy": 350013,
"histroy": "350013",
"txt": "师父的武功来自于乌龟大师",
"prize": [
{
@ -99,7 +99,7 @@
]
},
{
"histroy": 110091,
"histroy": "110091",
"txt": "希卡普很勇敢",
"prize": [
{
@ -110,7 +110,7 @@
]
},
{
"histroy": 110092,
"histroy": "110092",
"txt": "希卡普很善良",
"prize": [
{
@ -121,7 +121,7 @@
]
},
{
"histroy": 110093,
"histroy": "110093",
"txt": "希卡普很帅气",
"prize": [
{

File diff suppressed because it is too large Load Diff

View File

@ -63,11 +63,11 @@ func (this *Hero) CreateRepeatHero(session comm.IUserSession, heroCfgId string,
initUpdate := map[string]interface{}{}
sz := result.GetTujian()
if len(sz) == 0 {
sz = make(map[string]bool, 0)
sz = make(map[string]int32, 0)
}
if _, ok := result.GetTujian()[heroCfgId]; !ok {
sz[heroCfgId] = true
sz[heroCfgId] = 0
initUpdate["tujian"] = sz
}
@ -253,11 +253,11 @@ func (this *Hero) CreateRepeatHeros(session comm.IUserSession, heros map[string]
initUpdate := map[string]interface{}{}
sz := result.GetTujian()
if len(sz) == 0 {
sz = make(map[string]bool, 0)
sz = make(map[string]int32, 0)
}
for k := range heros {
if _, ok := result.GetTujian()[k]; !ok {
sz[k] = true
sz[k] = 0
initUpdate["tujian"] = sz
}
}

View File

@ -0,0 +1,48 @@
package library
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"google.golang.org/protobuf/proto"
)
//参数校验
func (this *apiComp) GetStoryRewardCheck(session comm.IUserSession, req *pb.LibraryGetStoryRewardReq) (code pb.ErrorCode) {
if req.Hid == "" || req.StoryId == 0 {
code = pb.ErrorCode_ReqParameterError
}
return
}
func (this *apiComp) GetStoryReward(session comm.IUserSession, req *pb.LibraryGetStoryRewardReq) (code pb.ErrorCode, data proto.Message) {
code = this.GetStoryRewardCheck(session, req)
if code != pb.ErrorCode_Success {
return // 参数校验失败直接返回
}
expand, err := this.module.ModuleUser.GetUserExpand(session.GetUserId())
if err != nil {
code = pb.ErrorCode_DBError
return
}
conf := this.module.configure.GetLibraryHero(req.Hid)
for k, v := range expand.Tujian {
if k == req.Hid && conf.Rightend == v {
code = this.module.DispenseRes(session, conf.Stroyprize, true)
// 修改storyID
sz := make(map[string]interface{}, 0)
for k, v := range expand.Tujian {
sz[k] = v
}
sz[req.Hid] = conf.Rightend
this.module.ModuleUser.ChangeUserExpand(session.GetUserId(), sz)
break
}
}
return
}

View File

@ -43,7 +43,7 @@ func (this *configureComp) GetConfigure(name string) (v interface{}, err error)
return configure.GetConfigure(name)
}
func (this *configureComp) GetLibraryHero(hid int32) (data *cfg.GameLibraryHeroData) {
func (this *configureComp) GetLibraryHero(hid string) (data *cfg.GameLibraryHeroData) {
if v, err := this.GetConfigure(game_libraryhero); err == nil {
if configure, ok := v.(*cfg.GameLibraryHero); ok {
data = configure.Get(hid)

View File

@ -80,9 +80,9 @@ type DBLibrary struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID
Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid" bson:"uid"` //用户ID
Fid int32 `protobuf:"varint,3,opt,name=fid,proto3" json:"fid"`
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID
Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid" bson:"uid"` //用户ID
Fid int32 `protobuf:"varint,3,opt,name=fid,proto3" json:"fid"` // 配置表id 羁绊id
Hero map[int32]int32 `protobuf:"bytes,4,rep,name=hero,proto3" json:"hero" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // key: hid value: favorlv
Prize bool `protobuf:"varint,5,opt,name=prize,proto3" json:"prize"` //是否领奖
Fetterlv int32 `protobuf:"varint,6,opt,name=fetterlv,proto3" json:"fetterlv"` // 当前羁绊等级

View File

@ -201,6 +201,109 @@ func (x *LibraryGetRewardResp) GetData() *DBLibrary {
return nil
}
// 领取剧情奖励
type LibraryGetStoryRewardReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Hid string `protobuf:"bytes,1,opt,name=hid,proto3" json:"hid"` // 英雄ID
StoryId int32 `protobuf:"varint,2,opt,name=storyId,proto3" json:"storyId"` // 故事剧情id
}
func (x *LibraryGetStoryRewardReq) Reset() {
*x = LibraryGetStoryRewardReq{}
if protoimpl.UnsafeEnabled {
mi := &file_library_library_msg_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *LibraryGetStoryRewardReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*LibraryGetStoryRewardReq) ProtoMessage() {}
func (x *LibraryGetStoryRewardReq) ProtoReflect() protoreflect.Message {
mi := &file_library_library_msg_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use LibraryGetStoryRewardReq.ProtoReflect.Descriptor instead.
func (*LibraryGetStoryRewardReq) Descriptor() ([]byte, []int) {
return file_library_library_msg_proto_rawDescGZIP(), []int{4}
}
func (x *LibraryGetStoryRewardReq) GetHid() string {
if x != nil {
return x.Hid
}
return ""
}
func (x *LibraryGetStoryRewardReq) GetStoryId() int32 {
if x != nil {
return x.StoryId
}
return 0
}
type LibraryGetStoryRewardResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Data *DBLibrary `protobuf:"bytes,1,opt,name=data,proto3" json:"data"`
}
func (x *LibraryGetStoryRewardResp) Reset() {
*x = LibraryGetStoryRewardResp{}
if protoimpl.UnsafeEnabled {
mi := &file_library_library_msg_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *LibraryGetStoryRewardResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*LibraryGetStoryRewardResp) ProtoMessage() {}
func (x *LibraryGetStoryRewardResp) ProtoReflect() protoreflect.Message {
mi := &file_library_library_msg_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use LibraryGetStoryRewardResp.ProtoReflect.Descriptor instead.
func (*LibraryGetStoryRewardResp) Descriptor() ([]byte, []int) {
return file_library_library_msg_proto_rawDescGZIP(), []int{5}
}
func (x *LibraryGetStoryRewardResp) GetData() *DBLibrary {
if x != nil {
return x.Data
}
return nil
}
var File_library_library_msg_proto protoreflect.FileDescriptor
var file_library_library_msg_proto_rawDesc = []byte{
@ -218,8 +321,16 @@ var file_library_library_msg_proto_rawDesc = []byte{
0x14, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x47, 0x65, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72,
0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x44, 0x42, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x52,
0x04, 0x64, 0x61, 0x74, 0x61, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x46, 0x0a, 0x18, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79,
0x47, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65,
0x71, 0x12, 0x10, 0x0a, 0x03, 0x68, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
0x68, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x18, 0x02,
0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x22, 0x3b, 0x0a,
0x19, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x47, 0x65, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x79,
0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x64, 0x61,
0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x44, 0x42, 0x4c, 0x69, 0x62,
0x72, 0x61, 0x72, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b,
0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -234,22 +345,25 @@ func file_library_library_msg_proto_rawDescGZIP() []byte {
return file_library_library_msg_proto_rawDescData
}
var file_library_library_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_library_library_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_library_library_msg_proto_goTypes = []interface{}{
(*LibraryGetListReq)(nil), // 0: LibraryGetListReq
(*LibraryGetListResp)(nil), // 1: LibraryGetListResp
(*LibraryGetRewardReq)(nil), // 2: LibraryGetRewardReq
(*LibraryGetRewardResp)(nil), // 3: LibraryGetRewardResp
(*DBLibrary)(nil), // 4: DBLibrary
(*LibraryGetListReq)(nil), // 0: LibraryGetListReq
(*LibraryGetListResp)(nil), // 1: LibraryGetListResp
(*LibraryGetRewardReq)(nil), // 2: LibraryGetRewardReq
(*LibraryGetRewardResp)(nil), // 3: LibraryGetRewardResp
(*LibraryGetStoryRewardReq)(nil), // 4: LibraryGetStoryRewardReq
(*LibraryGetStoryRewardResp)(nil), // 5: LibraryGetStoryRewardResp
(*DBLibrary)(nil), // 6: DBLibrary
}
var file_library_library_msg_proto_depIdxs = []int32{
4, // 0: LibraryGetListResp.data:type_name -> DBLibrary
4, // 1: LibraryGetRewardResp.data:type_name -> DBLibrary
2, // [2:2] is the sub-list for method output_type
2, // [2:2] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
6, // 0: LibraryGetListResp.data:type_name -> DBLibrary
6, // 1: LibraryGetRewardResp.data:type_name -> DBLibrary
6, // 2: LibraryGetStoryRewardResp.data:type_name -> DBLibrary
3, // [3:3] is the sub-list for method output_type
3, // [3:3] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension type_name
3, // [3:3] is the sub-list for extension extendee
0, // [0:3] is the sub-list for field type_name
}
func init() { file_library_library_msg_proto_init() }
@ -307,6 +421,30 @@ func file_library_library_msg_proto_init() {
return nil
}
}
file_library_library_msg_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*LibraryGetStoryRewardReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_library_library_msg_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*LibraryGetStoryRewardResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
@ -314,7 +452,7 @@ func file_library_library_msg_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_library_library_msg_proto_rawDesc,
NumEnums: 0,
NumMessages: 4,
NumMessages: 6,
NumExtensions: 0,
NumServices: 0,
},

View File

@ -377,7 +377,7 @@ type DBUserExpand struct {
InitdataCount uint32 `protobuf:"varint,5,opt,name=initdataCount,proto3" json:"initdataCount"` //今日初始累计次数
Chatchannel int32 `protobuf:"varint,6,opt,name=chatchannel,proto3" json:"chatchannel"` //跨服聊天频道
ModifynameCount int32 `protobuf:"varint,7,opt,name=modifynameCount,proto3" json:"modifynameCount"` //修改昵称次数
Tujian map[string]bool `protobuf:"bytes,8,rep,name=tujian,proto3" json:"tujian" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` //图鉴
Tujian map[string]int32 `protobuf:"bytes,8,rep,name=tujian,proto3" json:"tujian" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` //图鉴
CurFigure int32 `protobuf:"varint,9,opt,name=curFigure,proto3" json:"curFigure"` //当前形象
Preinstall map[int32]*Figure `protobuf:"bytes,10,rep,name=preinstall,proto3" json:"preinstall" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` //形象预设
Activeday int32 `protobuf:"varint,11,opt,name=activeday,proto3" json:"activeday"` //日活跃度
@ -474,7 +474,7 @@ func (x *DBUserExpand) GetModifynameCount() int32 {
return 0
}
func (x *DBUserExpand) GetTujian() map[string]bool {
func (x *DBUserExpand) GetTujian() map[string]int32 {
if x != nil {
return x.Tujian
}
@ -655,7 +655,7 @@ var file_userexpand_proto_rawDesc = []byte{
0x61, 0x1a, 0x39, 0x0a, 0x0b, 0x54, 0x75, 0x6a, 0x69, 0x61, 0x6e, 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,
0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x46, 0x0a, 0x0f,
0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x46, 0x0a, 0x0f,
0x50, 0x72, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, 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, 0x1d, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b,

View File

@ -16,7 +16,7 @@ type GameLibraryFetterData struct {
Ftype int32
Name string
Lv int32
Hid []int32
Hid []string
Favorlv int32
Prize []*Gameatn
}
@ -38,11 +38,11 @@ func (_v *GameLibraryFetterData)Deserialize(_buf map[string]interface{}) (err er
var _ok_ bool
if _arr_, _ok_ = _buf["hid"].([]interface{}); !_ok_ { err = errors.New("hid error"); return }
_v.Hid = make([]int32, 0, len(_arr_))
_v.Hid = 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.Hid = append(_v.Hid, _list_v_)
}
}

View File

@ -9,13 +9,13 @@
package cfg
type GameLibraryHero struct {
_dataMap map[int32]*GameLibraryHeroData
_dataMap map[string]*GameLibraryHeroData
_dataList []*GameLibraryHeroData
}
func NewGameLibraryHero(_buf []map[string]interface{}) (*GameLibraryHero, error) {
_dataList := make([]*GameLibraryHeroData, 0, len(_buf))
dataMap := make(map[int32]*GameLibraryHeroData)
dataMap := make(map[string]*GameLibraryHeroData)
for _, _ele_ := range _buf {
if _v, err2 := DeserializeGameLibraryHeroData(_ele_); err2 != nil {
return nil, err2
@ -27,7 +27,7 @@ func NewGameLibraryHero(_buf []map[string]interface{}) (*GameLibraryHero, error)
return &GameLibraryHero{_dataList:_dataList, _dataMap:dataMap}, nil
}
func (table *GameLibraryHero) GetDataMap() map[int32]*GameLibraryHeroData {
func (table *GameLibraryHero) GetDataMap() map[string]*GameLibraryHeroData {
return table._dataMap
}
@ -35,7 +35,7 @@ func (table *GameLibraryHero) GetDataList() []*GameLibraryHeroData {
return table._dataList
}
func (table *GameLibraryHero) Get(key int32) *GameLibraryHeroData {
func (table *GameLibraryHero) Get(key string) *GameLibraryHeroData {
return table._dataMap[key]
}

View File

@ -11,10 +11,10 @@ package cfg
import "errors"
type GameLibraryHeroData struct {
Hid int32
Hid string
Name string
Star int32
History []int32
History []string
Favorlv []int32
Startid int32
Rightend int32
@ -31,7 +31,7 @@ func (*GameLibraryHeroData) GetTypeId() int32 {
}
func (_v *GameLibraryHeroData)Deserialize(_buf map[string]interface{}) (err error) {
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["hid"].(float64); !_ok_ { err = errors.New("hid error"); return }; _v.Hid = int32(_tempNum_) }
{ var _ok_ bool; if _v.Hid, _ok_ = _buf["hid"].(string); !_ok_ { err = errors.New("hid error"); return } }
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["name"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Name error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Name, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["star"].(float64); !_ok_ { err = errors.New("star error"); return }; _v.Star = int32(_tempNum_) }
{
@ -39,11 +39,11 @@ func (_v *GameLibraryHeroData)Deserialize(_buf map[string]interface{}) (err erro
var _ok_ bool
if _arr_, _ok_ = _buf["history"].([]interface{}); !_ok_ { err = errors.New("history error"); return }
_v.History = make([]int32, 0, len(_arr_))
_v.History = 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.History = append(_v.History, _list_v_)
}
}

View File

@ -9,13 +9,13 @@
package cfg
type GameLibraryHistory struct {
_dataMap map[int32]*GameLibraryHistoryData
_dataMap map[string]*GameLibraryHistoryData
_dataList []*GameLibraryHistoryData
}
func NewGameLibraryHistory(_buf []map[string]interface{}) (*GameLibraryHistory, error) {
_dataList := make([]*GameLibraryHistoryData, 0, len(_buf))
dataMap := make(map[int32]*GameLibraryHistoryData)
dataMap := make(map[string]*GameLibraryHistoryData)
for _, _ele_ := range _buf {
if _v, err2 := DeserializeGameLibraryHistoryData(_ele_); err2 != nil {
return nil, err2
@ -27,7 +27,7 @@ func NewGameLibraryHistory(_buf []map[string]interface{}) (*GameLibraryHistory,
return &GameLibraryHistory{_dataList:_dataList, _dataMap:dataMap}, nil
}
func (table *GameLibraryHistory) GetDataMap() map[int32]*GameLibraryHistoryData {
func (table *GameLibraryHistory) GetDataMap() map[string]*GameLibraryHistoryData {
return table._dataMap
}
@ -35,7 +35,7 @@ func (table *GameLibraryHistory) GetDataList() []*GameLibraryHistoryData {
return table._dataList
}
func (table *GameLibraryHistory) Get(key int32) *GameLibraryHistoryData {
func (table *GameLibraryHistory) Get(key string) *GameLibraryHistoryData {
return table._dataMap[key]
}

View File

@ -11,7 +11,7 @@ package cfg
import "errors"
type GameLibraryHistoryData struct {
Histroy int32
Histroy string
Txt string
Prize []*Gameatn
}
@ -23,7 +23,7 @@ func (*GameLibraryHistoryData) GetTypeId() int32 {
}
func (_v *GameLibraryHistoryData)Deserialize(_buf map[string]interface{}) (err error) {
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["histroy"].(float64); !_ok_ { err = errors.New("histroy error"); return }; _v.Histroy = int32(_tempNum_) }
{ var _ok_ bool; if _v.Histroy, _ok_ = _buf["histroy"].(string); !_ok_ { err = errors.New("histroy error"); return } }
{ var _ok_ bool; if _v.Txt, _ok_ = _buf["txt"].(string); !_ok_ { err = errors.New("txt error"); return } }
{
var _arr_ []interface{}

View File

@ -33,9 +33,12 @@ type GameStroyData struct {
Move string
Action string
Sound string
Position serialization.Vector3
Revolve serialization.Vector3
Size serialization.Vector3
PositionR serialization.Vector3
PositionL serialization.Vector3
RevolveR serialization.Vector3
RevolveL serialization.Vector3
SizeR serialization.Vector3
SizeL serialization.Vector3
Perf string
Cg string
Skip bool
@ -82,28 +85,52 @@ func (_v *GameStroyData)Deserialize(_buf map[string]interface{}) (err error) {
{ var _ok_ bool; if _v.Move, _ok_ = _buf["move"].(string); !_ok_ { err = errors.New("move error"); return } }
{ var _ok_ bool; if _v.Action, _ok_ = _buf["action"].(string); !_ok_ { err = errors.New("action error"); return } }
{ var _ok_ bool; if _v.Sound, _ok_ = _buf["sound"].(string); !_ok_ { err = errors.New("sound error"); return } }
{ var _ok_ bool; var _v_ map[string]interface{}; if _v_, _ok_ = _buf["position"].(map[string]interface{}); !_ok_ { err = errors.New("position error"); return }
{ var _ok_ bool; var _v_ map[string]interface{}; if _v_, _ok_ = _buf["positionR"].(map[string]interface{}); !_ok_ { err = errors.New("positionR error"); return }
var _x_, _y_, _z_ float32;
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _v_["x"].(float64); !_ok_ { err = errors.New("x error"); return }; _x_ = float32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _v_["y"].(float64); !_ok_ { err = errors.New("y error"); return }; _y_ = float32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _v_["z"].(float64); !_ok_ { err = errors.New("z error"); return }; _z_ = float32(_tempNum_) }
_v.Position = serialization.NewVector3(_x_, _y_, _z_)
_v.PositionR = serialization.NewVector3(_x_, _y_, _z_)
}
{ var _ok_ bool; var _v_ map[string]interface{}; if _v_, _ok_ = _buf["revolve"].(map[string]interface{}); !_ok_ { err = errors.New("revolve error"); return }
{ var _ok_ bool; var _v_ map[string]interface{}; if _v_, _ok_ = _buf["positionL"].(map[string]interface{}); !_ok_ { err = errors.New("positionL error"); return }
var _x_, _y_, _z_ float32;
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _v_["x"].(float64); !_ok_ { err = errors.New("x error"); return }; _x_ = float32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _v_["y"].(float64); !_ok_ { err = errors.New("y error"); return }; _y_ = float32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _v_["z"].(float64); !_ok_ { err = errors.New("z error"); return }; _z_ = float32(_tempNum_) }
_v.Revolve = serialization.NewVector3(_x_, _y_, _z_)
_v.PositionL = serialization.NewVector3(_x_, _y_, _z_)
}
{ var _ok_ bool; var _v_ map[string]interface{}; if _v_, _ok_ = _buf["size"].(map[string]interface{}); !_ok_ { err = errors.New("size error"); return }
{ var _ok_ bool; var _v_ map[string]interface{}; if _v_, _ok_ = _buf["revolveR"].(map[string]interface{}); !_ok_ { err = errors.New("revolveR error"); return }
var _x_, _y_, _z_ float32;
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _v_["x"].(float64); !_ok_ { err = errors.New("x error"); return }; _x_ = float32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _v_["y"].(float64); !_ok_ { err = errors.New("y error"); return }; _y_ = float32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _v_["z"].(float64); !_ok_ { err = errors.New("z error"); return }; _z_ = float32(_tempNum_) }
_v.Size = serialization.NewVector3(_x_, _y_, _z_)
_v.RevolveR = serialization.NewVector3(_x_, _y_, _z_)
}
{ var _ok_ bool; var _v_ map[string]interface{}; if _v_, _ok_ = _buf["revolveL"].(map[string]interface{}); !_ok_ { err = errors.New("revolveL error"); return }
var _x_, _y_, _z_ float32;
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _v_["x"].(float64); !_ok_ { err = errors.New("x error"); return }; _x_ = float32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _v_["y"].(float64); !_ok_ { err = errors.New("y error"); return }; _y_ = float32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _v_["z"].(float64); !_ok_ { err = errors.New("z error"); return }; _z_ = float32(_tempNum_) }
_v.RevolveL = serialization.NewVector3(_x_, _y_, _z_)
}
{ var _ok_ bool; var _v_ map[string]interface{}; if _v_, _ok_ = _buf["sizeR"].(map[string]interface{}); !_ok_ { err = errors.New("sizeR error"); return }
var _x_, _y_, _z_ float32;
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _v_["x"].(float64); !_ok_ { err = errors.New("x error"); return }; _x_ = float32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _v_["y"].(float64); !_ok_ { err = errors.New("y error"); return }; _y_ = float32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _v_["z"].(float64); !_ok_ { err = errors.New("z error"); return }; _z_ = float32(_tempNum_) }
_v.SizeR = serialization.NewVector3(_x_, _y_, _z_)
}
{ var _ok_ bool; var _v_ map[string]interface{}; if _v_, _ok_ = _buf["sizeL"].(map[string]interface{}); !_ok_ { err = errors.New("sizeL error"); return }
var _x_, _y_, _z_ float32;
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _v_["x"].(float64); !_ok_ { err = errors.New("x error"); return }; _x_ = float32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _v_["y"].(float64); !_ok_ { err = errors.New("y error"); return }; _y_ = float32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _v_["z"].(float64); !_ok_ { err = errors.New("z error"); return }; _z_ = float32(_tempNum_) }
_v.SizeL = serialization.NewVector3(_x_, _y_, _z_)
}
{ var _ok_ bool; if _v.Perf, _ok_ = _buf["perf"].(string); !_ok_ { err = errors.New("perf error"); return } }

View File

@ -40,6 +40,7 @@ type GameHeroData struct {
Enteranivalue int32
Camerainterval float32
Equiprcom []string
Angle int32
}
const TypeId_GameHeroData = 1513828672
@ -123,6 +124,7 @@ func (_v *GameHeroData)Deserialize(_buf map[string]interface{}) (err error) {
}
}
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["angle"].(float64); !_ok_ { err = errors.New("angle error"); return }; _v.Angle = int32(_tempNum_) }
return
}