需求变更 增加多个随机剧情奖励。新增好感度奖励
This commit is contained in:
parent
e3066d4b19
commit
85409bd46a
@ -3,54 +3,117 @@
|
||||
"id": 1,
|
||||
"star": 3,
|
||||
"favorlv": 1,
|
||||
"expneed": 0
|
||||
"expneed": 0,
|
||||
"prize": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 1000
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"star": 3,
|
||||
"favorlv": 2,
|
||||
"expneed": 100
|
||||
"expneed": 100,
|
||||
"prize": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 1200
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"star": 3,
|
||||
"favorlv": 3,
|
||||
"expneed": 200
|
||||
"expneed": 200,
|
||||
"prize": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 1500
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"star": 4,
|
||||
"favorlv": 1,
|
||||
"expneed": 0
|
||||
"expneed": 0,
|
||||
"prize": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 1200
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"star": 4,
|
||||
"favorlv": 2,
|
||||
"expneed": 200
|
||||
"expneed": 200,
|
||||
"prize": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 1500
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"star": 4,
|
||||
"favorlv": 3,
|
||||
"expneed": 400
|
||||
"expneed": 400,
|
||||
"prize": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 1800
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"star": 5,
|
||||
"favorlv": 1,
|
||||
"expneed": 0
|
||||
"expneed": 0,
|
||||
"prize": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 1500
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"star": 5,
|
||||
"favorlv": 2,
|
||||
"expneed": 250
|
||||
"expneed": 250,
|
||||
"prize": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 1800
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"star": 5,
|
||||
"favorlv": 3,
|
||||
"expneed": 400
|
||||
"expneed": 400,
|
||||
"prize": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 2100
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
@ -25,8 +25,16 @@
|
||||
"n": 1000
|
||||
}
|
||||
],
|
||||
"special_stroyprize": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 2000
|
||||
}
|
||||
],
|
||||
"endid1": 10009,
|
||||
"endid2": 10010,
|
||||
"endid3": 10011,
|
||||
"fid": [
|
||||
102
|
||||
]
|
||||
@ -57,8 +65,16 @@
|
||||
"n": 1000
|
||||
}
|
||||
],
|
||||
"special_stroyprize": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 2000
|
||||
}
|
||||
],
|
||||
"endid1": 10009,
|
||||
"endid2": 10010,
|
||||
"endid3": 10011,
|
||||
"fid": [
|
||||
101
|
||||
]
|
||||
@ -89,8 +105,16 @@
|
||||
"n": 1000
|
||||
}
|
||||
],
|
||||
"special_stroyprize": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 2000
|
||||
}
|
||||
],
|
||||
"endid1": 10009,
|
||||
"endid2": 10010,
|
||||
"endid3": 10011,
|
||||
"fid": [
|
||||
101
|
||||
]
|
||||
@ -121,8 +145,16 @@
|
||||
"n": 1000
|
||||
}
|
||||
],
|
||||
"special_stroyprize": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 2000
|
||||
}
|
||||
],
|
||||
"endid1": 10009,
|
||||
"endid2": 10010,
|
||||
"endid3": 10011,
|
||||
"fid": [
|
||||
102
|
||||
]
|
||||
|
@ -37,7 +37,7 @@
|
||||
},
|
||||
{
|
||||
"msgid": "moonfantasy",
|
||||
"open": false,
|
||||
"open": true,
|
||||
"routrules": "~/worker",
|
||||
"describe": "月之秘境"
|
||||
},
|
||||
|
@ -28,557 +28,6 @@
|
||||
},
|
||||
"model_display": 250015
|
||||
},
|
||||
{
|
||||
"key": 2,
|
||||
"pagoda_type": 101,
|
||||
"Level_type": 1,
|
||||
"layer_num": 2,
|
||||
"monster_id": [
|
||||
501004,
|
||||
501005
|
||||
],
|
||||
"reward": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "diamond",
|
||||
"n": 50
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 660
|
||||
}
|
||||
],
|
||||
"exp": 840,
|
||||
"fight_scene": "",
|
||||
"name_display": {
|
||||
"key": "pagoda_layer2",
|
||||
"text": "第2层"
|
||||
},
|
||||
"model_display": 340065
|
||||
},
|
||||
{
|
||||
"key": 3,
|
||||
"pagoda_type": 101,
|
||||
"Level_type": 1,
|
||||
"layer_num": 3,
|
||||
"monster_id": [
|
||||
501007,
|
||||
501008
|
||||
],
|
||||
"reward": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "diamond",
|
||||
"n": 50
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 897
|
||||
}
|
||||
],
|
||||
"exp": 760,
|
||||
"fight_scene": "",
|
||||
"name_display": {
|
||||
"key": "pagoda_layer3",
|
||||
"text": "第3层"
|
||||
},
|
||||
"model_display": 250015
|
||||
},
|
||||
{
|
||||
"key": 4,
|
||||
"pagoda_type": 101,
|
||||
"Level_type": 1,
|
||||
"layer_num": 4,
|
||||
"monster_id": [
|
||||
501010,
|
||||
501011
|
||||
],
|
||||
"reward": [
|
||||
{
|
||||
"a": "item",
|
||||
"t": "30001",
|
||||
"n": 2
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 3446
|
||||
}
|
||||
],
|
||||
"exp": 2315,
|
||||
"fight_scene": "",
|
||||
"name_display": {
|
||||
"key": "pagoda_layer4",
|
||||
"text": "第4层"
|
||||
},
|
||||
"model_display": 340065
|
||||
},
|
||||
{
|
||||
"key": 5,
|
||||
"pagoda_type": 101,
|
||||
"Level_type": 1,
|
||||
"layer_num": 5,
|
||||
"monster_id": [
|
||||
501013,
|
||||
501014
|
||||
],
|
||||
"reward": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "diamond",
|
||||
"n": 50
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 4535
|
||||
}
|
||||
],
|
||||
"exp": 3375,
|
||||
"fight_scene": "",
|
||||
"name_display": {
|
||||
"key": "pagoda_layer5",
|
||||
"text": "第5层"
|
||||
},
|
||||
"model_display": 250015
|
||||
},
|
||||
{
|
||||
"key": 6,
|
||||
"pagoda_type": 101,
|
||||
"Level_type": 1,
|
||||
"layer_num": 6,
|
||||
"monster_id": [
|
||||
501016,
|
||||
501017
|
||||
],
|
||||
"reward": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "diamond",
|
||||
"n": 50
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 5624
|
||||
}
|
||||
],
|
||||
"exp": 4050,
|
||||
"fight_scene": "",
|
||||
"name_display": {
|
||||
"key": "pagoda_layer6",
|
||||
"text": "第6层"
|
||||
},
|
||||
"model_display": 340065
|
||||
},
|
||||
{
|
||||
"key": 7,
|
||||
"pagoda_type": 101,
|
||||
"Level_type": 1,
|
||||
"layer_num": 7,
|
||||
"monster_id": [
|
||||
501019,
|
||||
501020
|
||||
],
|
||||
"reward": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "diamond",
|
||||
"n": 50
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 7502
|
||||
}
|
||||
],
|
||||
"exp": 5860,
|
||||
"fight_scene": "",
|
||||
"name_display": {
|
||||
"key": "pagoda_layer7",
|
||||
"text": "第7层"
|
||||
},
|
||||
"model_display": 250015
|
||||
},
|
||||
{
|
||||
"key": 8,
|
||||
"pagoda_type": 101,
|
||||
"Level_type": 1,
|
||||
"layer_num": 8,
|
||||
"monster_id": [
|
||||
501022,
|
||||
501023
|
||||
],
|
||||
"reward": [
|
||||
{
|
||||
"a": "item",
|
||||
"t": "60002",
|
||||
"n": 1
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 10453
|
||||
}
|
||||
],
|
||||
"exp": 7580,
|
||||
"fight_scene": "",
|
||||
"name_display": {
|
||||
"key": "pagoda_layer8",
|
||||
"text": "第8层"
|
||||
},
|
||||
"model_display": 340065
|
||||
},
|
||||
{
|
||||
"key": 9,
|
||||
"pagoda_type": 101,
|
||||
"Level_type": 1,
|
||||
"layer_num": 9,
|
||||
"monster_id": [
|
||||
501025,
|
||||
501026
|
||||
],
|
||||
"reward": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "diamond",
|
||||
"n": 50
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 13306
|
||||
}
|
||||
],
|
||||
"exp": 9060,
|
||||
"fight_scene": "",
|
||||
"name_display": {
|
||||
"key": "pagoda_layer9",
|
||||
"text": "第9层"
|
||||
},
|
||||
"model_display": 250015
|
||||
},
|
||||
{
|
||||
"key": 10,
|
||||
"pagoda_type": 101,
|
||||
"Level_type": 1,
|
||||
"layer_num": 10,
|
||||
"monster_id": [
|
||||
501028,
|
||||
501029
|
||||
],
|
||||
"reward": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "diamond",
|
||||
"n": 50
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 18206
|
||||
}
|
||||
],
|
||||
"exp": 12700,
|
||||
"fight_scene": "",
|
||||
"name_display": {
|
||||
"key": "pagoda_layer10",
|
||||
"text": "第10层"
|
||||
},
|
||||
"model_display": 340065
|
||||
},
|
||||
{
|
||||
"key": 11,
|
||||
"pagoda_type": 101,
|
||||
"Level_type": 1,
|
||||
"layer_num": 11,
|
||||
"monster_id": [
|
||||
501031,
|
||||
501032
|
||||
],
|
||||
"reward": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "diamond",
|
||||
"n": 50
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 22254
|
||||
}
|
||||
],
|
||||
"exp": 18990,
|
||||
"fight_scene": "",
|
||||
"name_display": {
|
||||
"key": "pagoda_layer11",
|
||||
"text": "第11层"
|
||||
},
|
||||
"model_display": 250015
|
||||
},
|
||||
{
|
||||
"key": 12,
|
||||
"pagoda_type": 101,
|
||||
"Level_type": 1,
|
||||
"layer_num": 12,
|
||||
"monster_id": [
|
||||
501034,
|
||||
501035
|
||||
],
|
||||
"reward": [
|
||||
{
|
||||
"a": "item",
|
||||
"t": "30001",
|
||||
"n": 2
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 25593
|
||||
}
|
||||
],
|
||||
"exp": 22170,
|
||||
"fight_scene": "",
|
||||
"name_display": {
|
||||
"key": "pagoda_layer12",
|
||||
"text": "第12层"
|
||||
},
|
||||
"model_display": 340065
|
||||
},
|
||||
{
|
||||
"key": 13,
|
||||
"pagoda_type": 101,
|
||||
"Level_type": 1,
|
||||
"layer_num": 13,
|
||||
"monster_id": [
|
||||
501037,
|
||||
501038
|
||||
],
|
||||
"reward": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "diamond",
|
||||
"n": 50
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 30601
|
||||
}
|
||||
],
|
||||
"exp": 25740,
|
||||
"fight_scene": "",
|
||||
"name_display": {
|
||||
"key": "pagoda_layer13",
|
||||
"text": "第13层"
|
||||
},
|
||||
"model_display": 250015
|
||||
},
|
||||
{
|
||||
"key": 14,
|
||||
"pagoda_type": 101,
|
||||
"Level_type": 1,
|
||||
"layer_num": 14,
|
||||
"monster_id": [
|
||||
501040,
|
||||
501041
|
||||
],
|
||||
"reward": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "diamond",
|
||||
"n": 50
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 39286
|
||||
}
|
||||
],
|
||||
"exp": 30600,
|
||||
"fight_scene": "",
|
||||
"name_display": {
|
||||
"key": "pagoda_layer14",
|
||||
"text": "第14层"
|
||||
},
|
||||
"model_display": 340065
|
||||
},
|
||||
{
|
||||
"key": 15,
|
||||
"pagoda_type": 101,
|
||||
"Level_type": 1,
|
||||
"layer_num": 15,
|
||||
"monster_id": [
|
||||
501043,
|
||||
501044
|
||||
],
|
||||
"reward": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "diamond",
|
||||
"n": 50
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 43349
|
||||
}
|
||||
],
|
||||
"exp": 36300,
|
||||
"fight_scene": "",
|
||||
"name_display": {
|
||||
"key": "pagoda_layer15",
|
||||
"text": "第15层"
|
||||
},
|
||||
"model_display": 250015
|
||||
},
|
||||
{
|
||||
"key": 16,
|
||||
"pagoda_type": 101,
|
||||
"Level_type": 1,
|
||||
"layer_num": 16,
|
||||
"monster_id": [
|
||||
501046,
|
||||
501047
|
||||
],
|
||||
"reward": [
|
||||
{
|
||||
"a": "item",
|
||||
"t": "60002",
|
||||
"n": 1
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 47415
|
||||
}
|
||||
],
|
||||
"exp": 44100,
|
||||
"fight_scene": "",
|
||||
"name_display": {
|
||||
"key": "pagoda_layer16",
|
||||
"text": "第16层"
|
||||
},
|
||||
"model_display": 340065
|
||||
},
|
||||
{
|
||||
"key": 17,
|
||||
"pagoda_type": 101,
|
||||
"Level_type": 1,
|
||||
"layer_num": 17,
|
||||
"monster_id": [
|
||||
501049,
|
||||
501050
|
||||
],
|
||||
"reward": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "diamond",
|
||||
"n": 50
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 63694
|
||||
}
|
||||
],
|
||||
"exp": 65300,
|
||||
"fight_scene": "",
|
||||
"name_display": {
|
||||
"key": "pagoda_layer17",
|
||||
"text": "第17层"
|
||||
},
|
||||
"model_display": 250015
|
||||
},
|
||||
{
|
||||
"key": 18,
|
||||
"pagoda_type": 101,
|
||||
"Level_type": 1,
|
||||
"layer_num": 18,
|
||||
"monster_id": [
|
||||
501052,
|
||||
501053
|
||||
],
|
||||
"reward": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "diamond",
|
||||
"n": 50
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 74187
|
||||
}
|
||||
],
|
||||
"exp": 85200,
|
||||
"fight_scene": "",
|
||||
"name_display": {
|
||||
"key": "pagoda_layer18",
|
||||
"text": "第18层"
|
||||
},
|
||||
"model_display": 340065
|
||||
},
|
||||
{
|
||||
"key": 19,
|
||||
"pagoda_type": 101,
|
||||
"Level_type": 1,
|
||||
"layer_num": 19,
|
||||
"monster_id": [
|
||||
501055,
|
||||
501056
|
||||
],
|
||||
"reward": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "diamond",
|
||||
"n": 50
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 85026
|
||||
}
|
||||
],
|
||||
"exp": 102000,
|
||||
"fight_scene": "",
|
||||
"name_display": {
|
||||
"key": "pagoda_layer19",
|
||||
"text": "第19层"
|
||||
},
|
||||
"model_display": 250015
|
||||
},
|
||||
{
|
||||
"key": 20,
|
||||
"pagoda_type": 101,
|
||||
"Level_type": 1,
|
||||
"layer_num": 20,
|
||||
"monster_id": [
|
||||
501058,
|
||||
501059
|
||||
],
|
||||
"reward": [
|
||||
{
|
||||
"a": "item",
|
||||
"t": "30001",
|
||||
"n": 2
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 102031
|
||||
}
|
||||
],
|
||||
"exp": 122400,
|
||||
"fight_scene": "",
|
||||
"name_display": {
|
||||
"key": "pagoda_layer20",
|
||||
"text": "第20层"
|
||||
},
|
||||
"model_display": 340065
|
||||
},
|
||||
{
|
||||
"key": 101,
|
||||
"pagoda_type": 201,
|
||||
|
@ -17,6 +17,7 @@ const (
|
||||
LibraryActivationFetterResp = "activationfetter"
|
||||
LibraryChangePush = "change"
|
||||
LibraryGetStoryRewardResp = "getstoryreward"
|
||||
LibraryLvRewardResp = "lvreward"
|
||||
)
|
||||
|
||||
type apiComp struct {
|
||||
|
@ -7,6 +7,7 @@ package library
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/pb"
|
||||
cfg "go_dreamfactory/sys/configure/structs"
|
||||
"go_dreamfactory/utils"
|
||||
"strconv"
|
||||
|
||||
@ -58,12 +59,31 @@ func (this *apiComp) GetStoryReward(session comm.IUserSession, req *pb.LibraryGe
|
||||
break
|
||||
}
|
||||
} else if req.Rightend != 0 { // 剧情奖励
|
||||
if req.Rightend == conf.Rightend && _heroFetter.Stroyprize != conf.Rightend {
|
||||
_heroFetter.Stroyprize = conf.Rightend
|
||||
bRepeadGetReawrd := false
|
||||
if req.Rightend == conf.Rightend || req.Rightend == conf.Endid1 ||
|
||||
req.Rightend == conf.Endid2 || req.Rightend == conf.Endid3 {
|
||||
for _, v := range _heroFetter.Stroyprize {
|
||||
if v == req.Rightend {
|
||||
bRepeadGetReawrd = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if bRepeadGetReawrd { // 重复领奖
|
||||
code = pb.ErrorCode_LibraryReward
|
||||
return
|
||||
}
|
||||
var res []*cfg.Gameatn //
|
||||
if req.Rightend == conf.Rightend {
|
||||
res = conf.Stroyprize
|
||||
} else {
|
||||
res = conf.SpecialStroyprize
|
||||
}
|
||||
|
||||
_heroFetter.Stroyprize = append(_heroFetter.Stroyprize, req.Rightend)
|
||||
// 发奖
|
||||
code = this.module.DispenseRes(session, conf.Stroyprize, true)
|
||||
code = this.module.DispenseRes(session, res, true)
|
||||
if code != pb.ErrorCode_Success {
|
||||
this.module.Errorf("GetStoryReward err:add item : %v", conf.Stroyprize)
|
||||
this.module.Errorf("GetStoryReward err:add item : %v", res)
|
||||
}
|
||||
mapData := make(map[string]interface{}, 0)
|
||||
mapData["stroyprize"] = _heroFetter.Stroyprize
|
||||
|
64
modules/library/api_lvreward.go
Normal file
64
modules/library/api_lvreward.go
Normal file
@ -0,0 +1,64 @@
|
||||
package library
|
||||
|
||||
/*
|
||||
* 单个英雄剧情id 奖励
|
||||
*/
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/pb"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
//参数校验
|
||||
func (this *apiComp) LvRewardCheck(session comm.IUserSession, req *pb.LibraryLvRewardReq) (code pb.ErrorCode) {
|
||||
if req.Oid == "" || req.Lv <= 0 {
|
||||
code = pb.ErrorCode_ReqParameterError
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (this *apiComp) LvReward(session comm.IUserSession, req *pb.LibraryLvRewardReq) (code pb.ErrorCode, data proto.Message) {
|
||||
|
||||
resp := &pb.LibraryLvRewardResp{}
|
||||
code = this.LvRewardCheck(session, req)
|
||||
if code != pb.ErrorCode_Success {
|
||||
return // 参数校验失败直接返回
|
||||
}
|
||||
_heroFetter := this.module.modelFetter.getOneHeroFetter(session.GetUserId(), req.Oid)
|
||||
if _heroFetter == nil {
|
||||
code = pb.ErrorCode_ReqParameterError
|
||||
return
|
||||
}
|
||||
curStar := this.module.configure.GetHeroConfigStar(_heroFetter.Heroid) // 查询原始星级
|
||||
if curStar == 0 {
|
||||
code = pb.ErrorCode_ConfigNoFound
|
||||
return
|
||||
}
|
||||
confData := this.module.configure.GetLibraryFavorData(curStar, req.Lv)
|
||||
if len(confData.Prize) == 0 {
|
||||
code = pb.ErrorCode_ReqParameterError
|
||||
return
|
||||
}
|
||||
|
||||
for _, v := range _heroFetter.Lvprize {
|
||||
if v == req.Lv {
|
||||
code = pb.ErrorCode_LibraryReward // 重复领奖
|
||||
break
|
||||
}
|
||||
}
|
||||
_heroFetter.Lvprize = append(_heroFetter.Lvprize, req.Lv)
|
||||
// 发奖
|
||||
code = this.module.DispenseRes(session, confData.Prize, true)
|
||||
if code != pb.ErrorCode_Success {
|
||||
this.module.Errorf("GetStoryReward err:add item : %v", confData.Prize)
|
||||
}
|
||||
mapData := make(map[string]interface{}, 0)
|
||||
mapData["lvprize"] = _heroFetter.Lvprize
|
||||
this.module.modelFetter.modifyHeroFetterDataByObjId(session.GetUserId(), _heroFetter.Id, mapData)
|
||||
resp.Data = _heroFetter
|
||||
|
||||
session.SendMsg(string(this.module.GetType()), LibraryLvRewardResp, resp)
|
||||
return
|
||||
}
|
@ -22,6 +22,7 @@ const (
|
||||
type configureComp struct {
|
||||
modules.MCompConfigure
|
||||
fetter map[int64]*cfg.GameLibraryFetterData
|
||||
favor map[int64]*cfg.GameLibraryFavorData
|
||||
}
|
||||
|
||||
//组件初始化接口
|
||||
@ -37,10 +38,27 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp
|
||||
|
||||
this.fetter = make(map[int64]*cfg.GameLibraryFetterData, 0)
|
||||
configure.RegisterConfigure(game_libraryfetter, cfg.NewGameLibraryFetter, this.SetLibraryFetter)
|
||||
|
||||
this.favor = make(map[int64]*cfg.GameLibraryFavorData, 0)
|
||||
configure.RegisterConfigure(game_libraryfetter, cfg.NewGameLibraryFetter, this.SetLibraryFavor)
|
||||
return
|
||||
}
|
||||
|
||||
func (this *configureComp) SetLibraryFavor() {
|
||||
if v, err := this.GetConfigure(game_favornum); err == nil {
|
||||
if _configure, ok := v.(*cfg.GameLibraryFavor); ok {
|
||||
for _, v1 := range _configure.GetDataList() {
|
||||
this.favor[int64(v1.Star<<8)+int64(v1.Favorlv)] = v1
|
||||
}
|
||||
return
|
||||
}
|
||||
} else {
|
||||
err = fmt.Errorf("%T no is *cfg.GameLibraryFavor", v)
|
||||
}
|
||||
}
|
||||
func (this *configureComp) GetLibraryFavorData(star, favorlv int32) (data *cfg.GameLibraryFavorData) {
|
||||
return this.favor[int64(star<<8)+int64(favorlv)]
|
||||
}
|
||||
|
||||
func (this *configureComp) SetLibraryFetter() {
|
||||
if v, err := this.GetConfigure(game_libraryfetter); err == nil {
|
||||
if _configure, ok := v.(*cfg.GameLibraryFetter); ok {
|
||||
@ -53,6 +71,7 @@ func (this *configureComp) SetLibraryFetter() {
|
||||
err = fmt.Errorf("%T no is *cfg.GameLibraryFetter", v)
|
||||
}
|
||||
}
|
||||
|
||||
func (this *configureComp) GetLibraryFetter(fid, favorlv int32) (data *cfg.GameLibraryFetterData) {
|
||||
return this.fetter[int64(fid<<8)+int64(favorlv)]
|
||||
}
|
||||
|
@ -111,7 +111,8 @@ func (this *Library) createHeroFetter(uid string, heroConfId string) (obj *pb.DB
|
||||
Heroid: heroConfId,
|
||||
History: make([]int32, 0),
|
||||
Favorlv: 1,
|
||||
Stroyprize: 0,
|
||||
Stroyprize: make([]int32, 0),
|
||||
Lvprize: make([]int32, 0),
|
||||
}
|
||||
if err := this.modelFetter.createHeroFetter(uid, obj); err != nil {
|
||||
code = pb.ErrorCode_DBError
|
||||
|
@ -129,13 +129,14 @@ type DBHeroFetter 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
|
||||
Heroid string `protobuf:"bytes,3,opt,name=heroid,proto3" json:"heroid"` // 英雄配置表id
|
||||
History []int32 `protobuf:"varint,4,rep,packed,name=history,proto3" json:"history"` // 传记往事ID
|
||||
Favorlv int32 `protobuf:"varint,5,opt,name=favorlv,proto3" json:"favorlv"` // 好感度等级
|
||||
Favorexp int32 `protobuf:"varint,6,opt,name=favorexp,proto3" json:"favorexp"` // 好感度经验
|
||||
Stroyprize int32 `protobuf:"varint,7,opt,name=stroyprize,proto3" json:"stroyprize"` // 剧情奖励
|
||||
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
|
||||
Heroid string `protobuf:"bytes,3,opt,name=heroid,proto3" json:"heroid"` // 英雄配置表id
|
||||
History []int32 `protobuf:"varint,4,rep,packed,name=history,proto3" json:"history"` // 传记往事ID
|
||||
Favorlv int32 `protobuf:"varint,5,opt,name=favorlv,proto3" json:"favorlv"` // 好感度等级
|
||||
Favorexp int32 `protobuf:"varint,6,opt,name=favorexp,proto3" json:"favorexp"` // 好感度经验
|
||||
Stroyprize []int32 `protobuf:"varint,7,rep,packed,name=stroyprize,proto3" json:"stroyprize"` // 剧情奖励
|
||||
Lvprize []int32 `protobuf:"varint,8,rep,packed,name=lvprize,proto3" json:"lvprize"` // 等级奖励
|
||||
}
|
||||
|
||||
func (x *DBHeroFetter) Reset() {
|
||||
@ -212,11 +213,18 @@ func (x *DBHeroFetter) GetFavorexp() int32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *DBHeroFetter) GetStroyprize() int32 {
|
||||
func (x *DBHeroFetter) GetStroyprize() []int32 {
|
||||
if x != nil {
|
||||
return x.Stroyprize
|
||||
}
|
||||
return 0
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *DBHeroFetter) GetLvprize() []int32 {
|
||||
if x != nil {
|
||||
return x.Lvprize
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_library_library_db_proto protoreflect.FileDescriptor
|
||||
@ -245,7 +253,7 @@ var file_library_library_db_proto_rawDesc = []byte{
|
||||
0x38, 0x01, 0x1a, 0x38, 0x0a, 0x0a, 0x50, 0x72, 0x69, 0x7a, 0x65, 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, 0x22, 0xb8, 0x01, 0x0a,
|
||||
0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xd2, 0x01, 0x0a,
|
||||
0x0c, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x46, 0x65, 0x74, 0x74, 0x65, 0x72, 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,
|
||||
@ -256,9 +264,11 @@ var file_library_library_db_proto_rawDesc = []byte{
|
||||
0x28, 0x05, 0x52, 0x07, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x6c, 0x76, 0x12, 0x1a, 0x0a, 0x08, 0x66,
|
||||
0x61, 0x76, 0x6f, 0x72, 0x65, 0x78, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x66,
|
||||
0x61, 0x76, 0x6f, 0x72, 0x65, 0x78, 0x70, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x6f, 0x79,
|
||||
0x70, 0x72, 0x69, 0x7a, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, 0x74, 0x72,
|
||||
0x6f, 0x79, 0x70, 0x72, 0x69, 0x7a, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62,
|
||||
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x70, 0x72, 0x69, 0x7a, 0x65, 0x18, 0x07, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0a, 0x73, 0x74, 0x72,
|
||||
0x6f, 0x79, 0x70, 0x72, 0x69, 0x7a, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x76, 0x70, 0x72, 0x69,
|
||||
0x7a, 0x65, 0x18, 0x08, 0x20, 0x03, 0x28, 0x05, 0x52, 0x07, 0x6c, 0x76, 0x70, 0x72, 0x69, 0x7a,
|
||||
0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
@ -660,6 +660,109 @@ func (x *LibraryChangePush) GetFetter() []*DBHeroFetter {
|
||||
return nil
|
||||
}
|
||||
|
||||
// 领取等级奖励
|
||||
type LibraryLvRewardReq struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Oid string `protobuf:"bytes,1,opt,name=oid,proto3" json:"oid"` // 对象唯一id
|
||||
Lv int32 `protobuf:"varint,2,opt,name=lv,proto3" json:"lv"` // 好感度等级
|
||||
}
|
||||
|
||||
func (x *LibraryLvRewardReq) Reset() {
|
||||
*x = LibraryLvRewardReq{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_library_library_msg_proto_msgTypes[13]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *LibraryLvRewardReq) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*LibraryLvRewardReq) ProtoMessage() {}
|
||||
|
||||
func (x *LibraryLvRewardReq) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_library_library_msg_proto_msgTypes[13]
|
||||
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 LibraryLvRewardReq.ProtoReflect.Descriptor instead.
|
||||
func (*LibraryLvRewardReq) Descriptor() ([]byte, []int) {
|
||||
return file_library_library_msg_proto_rawDescGZIP(), []int{13}
|
||||
}
|
||||
|
||||
func (x *LibraryLvRewardReq) GetOid() string {
|
||||
if x != nil {
|
||||
return x.Oid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *LibraryLvRewardReq) GetLv() int32 {
|
||||
if x != nil {
|
||||
return x.Lv
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type LibraryLvRewardResp struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Data *DBHeroFetter `protobuf:"bytes,1,opt,name=data,proto3" json:"data"`
|
||||
}
|
||||
|
||||
func (x *LibraryLvRewardResp) Reset() {
|
||||
*x = LibraryLvRewardResp{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_library_library_msg_proto_msgTypes[14]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *LibraryLvRewardResp) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*LibraryLvRewardResp) ProtoMessage() {}
|
||||
|
||||
func (x *LibraryLvRewardResp) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_library_library_msg_proto_msgTypes[14]
|
||||
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 LibraryLvRewardResp.ProtoReflect.Descriptor instead.
|
||||
func (*LibraryLvRewardResp) Descriptor() ([]byte, []int) {
|
||||
return file_library_library_msg_proto_rawDescGZIP(), []int{14}
|
||||
}
|
||||
|
||||
func (x *LibraryLvRewardResp) GetData() *DBHeroFetter {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_library_library_msg_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_library_library_msg_proto_rawDesc = []byte{
|
||||
@ -721,7 +824,15 @@ var file_library_library_msg_proto_rawDesc = []byte{
|
||||
0x61, 0x72, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x25, 0x0a, 0x06, 0x66, 0x65, 0x74,
|
||||
0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44, 0x42, 0x48, 0x65,
|
||||
0x72, 0x6f, 0x46, 0x65, 0x74, 0x74, 0x65, 0x72, 0x52, 0x06, 0x66, 0x65, 0x74, 0x74, 0x65, 0x72,
|
||||
0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x22, 0x36, 0x0a, 0x12, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x4c, 0x76, 0x52, 0x65, 0x77,
|
||||
0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x6f, 0x69, 0x64, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x03, 0x6f, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x6c, 0x76, 0x22, 0x38, 0x0a, 0x13, 0x4c, 0x69, 0x62, 0x72,
|
||||
0x61, 0x72, 0x79, 0x4c, 0x76, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12,
|
||||
0x21, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e,
|
||||
0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x46, 0x65, 0x74, 0x74, 0x65, 0x72, 0x52, 0x04, 0x64, 0x61,
|
||||
0x74, 0x61, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
@ -736,7 +847,7 @@ 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, 14)
|
||||
var file_library_library_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 16)
|
||||
var file_library_library_msg_proto_goTypes = []interface{}{
|
||||
(*LibraryGetListReq)(nil), // 0: LibraryGetListReq
|
||||
(*LibraryGetListResp)(nil), // 1: LibraryGetListResp
|
||||
@ -751,25 +862,28 @@ var file_library_library_msg_proto_goTypes = []interface{}{
|
||||
(*LibraryActivationFetterReq)(nil), // 10: LibraryActivationFetterReq
|
||||
(*LibraryActivationFetterResp)(nil), // 11: LibraryActivationFetterResp
|
||||
(*LibraryChangePush)(nil), // 12: LibraryChangePush
|
||||
nil, // 13: LibraryUseGiftReq.ItemsEntry
|
||||
(*DBLibrary)(nil), // 14: DBLibrary
|
||||
(*DBHeroFetter)(nil), // 15: DBHeroFetter
|
||||
(*LibraryLvRewardReq)(nil), // 13: LibraryLvRewardReq
|
||||
(*LibraryLvRewardResp)(nil), // 14: LibraryLvRewardResp
|
||||
nil, // 15: LibraryUseGiftReq.ItemsEntry
|
||||
(*DBLibrary)(nil), // 16: DBLibrary
|
||||
(*DBHeroFetter)(nil), // 17: DBHeroFetter
|
||||
}
|
||||
var file_library_library_msg_proto_depIdxs = []int32{
|
||||
14, // 0: LibraryGetListResp.data:type_name -> DBLibrary
|
||||
15, // 1: LibraryGetFetterListResp.data:type_name -> DBHeroFetter
|
||||
14, // 2: LibraryGetRewardResp.data:type_name -> DBLibrary
|
||||
15, // 3: LibraryGetStoryRewardResp.data:type_name -> DBHeroFetter
|
||||
13, // 4: LibraryUseGiftReq.items:type_name -> LibraryUseGiftReq.ItemsEntry
|
||||
15, // 5: LibraryUseGiftResp.data:type_name -> DBHeroFetter
|
||||
14, // 6: LibraryActivationFetterResp.data:type_name -> DBLibrary
|
||||
14, // 7: LibraryChangePush.data:type_name -> DBLibrary
|
||||
15, // 8: LibraryChangePush.fetter:type_name -> DBHeroFetter
|
||||
9, // [9:9] is the sub-list for method output_type
|
||||
9, // [9:9] is the sub-list for method input_type
|
||||
9, // [9:9] is the sub-list for extension type_name
|
||||
9, // [9:9] is the sub-list for extension extendee
|
||||
0, // [0:9] is the sub-list for field type_name
|
||||
16, // 0: LibraryGetListResp.data:type_name -> DBLibrary
|
||||
17, // 1: LibraryGetFetterListResp.data:type_name -> DBHeroFetter
|
||||
16, // 2: LibraryGetRewardResp.data:type_name -> DBLibrary
|
||||
17, // 3: LibraryGetStoryRewardResp.data:type_name -> DBHeroFetter
|
||||
15, // 4: LibraryUseGiftReq.items:type_name -> LibraryUseGiftReq.ItemsEntry
|
||||
17, // 5: LibraryUseGiftResp.data:type_name -> DBHeroFetter
|
||||
16, // 6: LibraryActivationFetterResp.data:type_name -> DBLibrary
|
||||
16, // 7: LibraryChangePush.data:type_name -> DBLibrary
|
||||
17, // 8: LibraryChangePush.fetter:type_name -> DBHeroFetter
|
||||
17, // 9: LibraryLvRewardResp.data:type_name -> DBHeroFetter
|
||||
10, // [10:10] is the sub-list for method output_type
|
||||
10, // [10:10] is the sub-list for method input_type
|
||||
10, // [10:10] is the sub-list for extension type_name
|
||||
10, // [10:10] is the sub-list for extension extendee
|
||||
0, // [0:10] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_library_library_msg_proto_init() }
|
||||
@ -935,6 +1049,30 @@ func file_library_library_msg_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_library_library_msg_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*LibraryLvRewardReq); 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[14].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*LibraryLvRewardResp); 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{
|
||||
@ -942,7 +1080,7 @@ func file_library_library_msg_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_library_library_msg_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 14,
|
||||
NumMessages: 16,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
|
@ -9,34 +9,26 @@
|
||||
package cfg
|
||||
|
||||
type GameLibraryFavor struct {
|
||||
_dataMap map[int32]*GameLibraryFavorData
|
||||
_dataList []*GameLibraryFavorData
|
||||
}
|
||||
|
||||
func NewGameLibraryFavor(_buf []map[string]interface{}) (*GameLibraryFavor, error) {
|
||||
_dataList := make([]*GameLibraryFavorData, 0, len(_buf))
|
||||
dataMap := make(map[int32]*GameLibraryFavorData)
|
||||
for _, _ele_ := range _buf {
|
||||
if _v, err2 := DeserializeGameLibraryFavorData(_ele_); err2 != nil {
|
||||
return nil, err2
|
||||
} else {
|
||||
_dataList = append(_dataList, _v)
|
||||
dataMap[_v.Id] = _v
|
||||
}
|
||||
}
|
||||
return &GameLibraryFavor{_dataList:_dataList, _dataMap:dataMap}, nil
|
||||
}
|
||||
|
||||
func (table *GameLibraryFavor) GetDataMap() map[int32]*GameLibraryFavorData {
|
||||
return table._dataMap
|
||||
return &GameLibraryFavor{_dataList:_dataList}, nil
|
||||
}
|
||||
|
||||
func (table *GameLibraryFavor) GetDataList() []*GameLibraryFavorData {
|
||||
return table._dataList
|
||||
}
|
||||
|
||||
func (table *GameLibraryFavor) Get(key int32) *GameLibraryFavorData {
|
||||
return table._dataMap[key]
|
||||
func (table *GameLibraryFavor) Get(index int) *GameLibraryFavorData {
|
||||
return table._dataList[index]
|
||||
}
|
||||
|
||||
|
||||
|
@ -15,6 +15,7 @@ type GameLibraryFavorData struct {
|
||||
Star int32
|
||||
Favorlv int32
|
||||
Expneed int32
|
||||
Prize []*Gameatn
|
||||
}
|
||||
|
||||
const TypeId_GameLibraryFavorData = 465616649
|
||||
@ -28,6 +29,20 @@ func (_v *GameLibraryFavorData)Deserialize(_buf map[string]interface{}) (err err
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["star"].(float64); !_ok_ { err = errors.New("star error"); return }; _v.Star = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["favorlv"].(float64); !_ok_ { err = errors.New("favorlv error"); return }; _v.Favorlv = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["expneed"].(float64); !_ok_ { err = errors.New("expneed error"); return }; _v.Expneed = int32(_tempNum_) }
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
if _arr_, _ok_ = _buf["prize"].([]interface{}); !_ok_ { err = errors.New("prize error"); return }
|
||||
|
||||
_v.Prize = 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.Prize = append(_v.Prize, _list_v_)
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -19,8 +19,10 @@ type GameLibraryHeroData struct {
|
||||
Startid int32
|
||||
Rightend int32
|
||||
Stroyprize []*Gameatn
|
||||
SpecialStroyprize []*Gameatn
|
||||
Endid1 int32
|
||||
Endid2 int32
|
||||
Endid3 int32
|
||||
Fid []int32
|
||||
}
|
||||
|
||||
@ -78,8 +80,23 @@ func (_v *GameLibraryHeroData)Deserialize(_buf map[string]interface{}) (err erro
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
if _arr_, _ok_ = _buf["special_stroyprize"].([]interface{}); !_ok_ { err = errors.New("special_stroyprize error"); return }
|
||||
|
||||
_v.SpecialStroyprize = 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.SpecialStroyprize = append(_v.SpecialStroyprize, _list_v_)
|
||||
}
|
||||
}
|
||||
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["endid1"].(float64); !_ok_ { err = errors.New("endid1 error"); return }; _v.Endid1 = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["endid2"].(float64); !_ok_ { err = errors.New("endid2 error"); return }; _v.Endid2 = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["endid3"].(float64); !_ok_ { err = errors.New("endid3 error"); return }; _v.Endid3 = int32(_tempNum_) }
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
|
Loading…
Reference in New Issue
Block a user