移除旧模块
This commit is contained in:
parent
a0a22dbd49
commit
8f8756cc07
File diff suppressed because it is too large
Load Diff
@ -1,577 +0,0 @@
|
||||
[
|
||||
{
|
||||
"id": 1,
|
||||
"name": {
|
||||
"key": "mainline_name_10001",
|
||||
"text": "Chapter 1"
|
||||
},
|
||||
"intensity": 1,
|
||||
"map": "zx_ddt_zj01",
|
||||
"title": {
|
||||
"key": "mainline_title_10001",
|
||||
"text": "第1章:功夫世界"
|
||||
},
|
||||
"desc": {
|
||||
"key": "mainline_desc_10001",
|
||||
"text": "故事发生在很久以前的古代中国,而且要从一只喜欢滚来滚去、滚来滚去的大熊猫身上说起。话说熊猫阿宝是一家面条店的学徒,虽然笨手笨脚,也勉强算是谋到了一份职业。"
|
||||
},
|
||||
"icon": "wp_icon_0002",
|
||||
"text": {
|
||||
"key": "mainline_text_10001",
|
||||
"text": "金币40000"
|
||||
},
|
||||
"Episode": [
|
||||
101,
|
||||
102,
|
||||
103,
|
||||
104,
|
||||
105,
|
||||
106,
|
||||
107,
|
||||
108,
|
||||
109
|
||||
],
|
||||
"award": [
|
||||
{
|
||||
"a": "item",
|
||||
"t": "30001",
|
||||
"n": 10
|
||||
},
|
||||
{
|
||||
"a": "equi",
|
||||
"t": "10110",
|
||||
"n": 1
|
||||
},
|
||||
{
|
||||
"a": "equi",
|
||||
"t": "10111",
|
||||
"n": 1
|
||||
},
|
||||
{
|
||||
"a": "equi",
|
||||
"t": "10112",
|
||||
"n": 1
|
||||
},
|
||||
{
|
||||
"a": "equi",
|
||||
"t": "10113",
|
||||
"n": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"name": {
|
||||
"key": "mainline_name_10002",
|
||||
"text": "Chapter 2"
|
||||
},
|
||||
"intensity": 1,
|
||||
"map": "zx_ddt_zj02",
|
||||
"title": {
|
||||
"key": "mainline_title_10002",
|
||||
"text": "第2章:练功房"
|
||||
},
|
||||
"desc": {
|
||||
"key": "mainline_desc_10002",
|
||||
"text": "别看阿宝所在的“和平谷”一派欣欣向荣的安详景象,其实是一个卧虎藏龙的风水宝地,先不说五大功夫高手皆坐镇于此,更有一大师级别的宗师在这里隐居。"
|
||||
},
|
||||
"icon": "wp_icon_0002",
|
||||
"text": {
|
||||
"key": "mainline_text_10002",
|
||||
"text": "金币40000"
|
||||
},
|
||||
"Episode": [
|
||||
201,
|
||||
202,
|
||||
203,
|
||||
204,
|
||||
205,
|
||||
206,
|
||||
207,
|
||||
208,
|
||||
209
|
||||
],
|
||||
"award": [
|
||||
{
|
||||
"a": "hero",
|
||||
"t": "25004",
|
||||
"n": 1
|
||||
},
|
||||
{
|
||||
"a": "item",
|
||||
"t": "30001",
|
||||
"n": 10
|
||||
},
|
||||
{
|
||||
"a": "hero",
|
||||
"t": "43901",
|
||||
"n": 20
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"name": {
|
||||
"key": "mainline_name_10003",
|
||||
"text": "Chapter 3"
|
||||
},
|
||||
"intensity": 1,
|
||||
"map": "zx_ddt_zj03",
|
||||
"title": {
|
||||
"key": "mainline_title_10003",
|
||||
"text": "第3章:太狼来袭"
|
||||
},
|
||||
"desc": {
|
||||
"key": "mainline_desc_10003",
|
||||
"text": "可是在一场特殊的比武大会上胜出的人要代表“和平谷”将邪恶的大龙永久地驱除出去,啥都不会的阿宝却在经历了一系列阴差阳错之后屏雀中选,让所有人都大跌眼镜。"
|
||||
},
|
||||
"icon": "wp_icon_0002",
|
||||
"text": {
|
||||
"key": "mainline_text_10003",
|
||||
"text": "金币40000"
|
||||
},
|
||||
"Episode": [
|
||||
301,
|
||||
302,
|
||||
303,
|
||||
304,
|
||||
305,
|
||||
306,
|
||||
307,
|
||||
308,
|
||||
309
|
||||
],
|
||||
"award": [
|
||||
{
|
||||
"a": "item",
|
||||
"t": "30001",
|
||||
"n": 10
|
||||
},
|
||||
{
|
||||
"a": "equi",
|
||||
"t": "10110",
|
||||
"n": 1
|
||||
},
|
||||
{
|
||||
"a": "equi",
|
||||
"t": "10111",
|
||||
"n": 1
|
||||
},
|
||||
{
|
||||
"a": "equi",
|
||||
"t": "10112",
|
||||
"n": 1
|
||||
},
|
||||
{
|
||||
"a": "equi",
|
||||
"t": "10113",
|
||||
"n": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"name": {
|
||||
"key": "mainline_name_10004",
|
||||
"text": "Chapter 4"
|
||||
},
|
||||
"intensity": 1,
|
||||
"map": "zx_ddt_zj04",
|
||||
"title": {
|
||||
"key": "mainline_title_10004",
|
||||
"text": "第4章:乌龟大师"
|
||||
},
|
||||
"desc": {
|
||||
"key": "mainline_desc_10004",
|
||||
"text": "自负的毒蛇大师虽然给人的感觉稍显轻浮,但对这件事的态度就有如她善变的性格,不太明朗;螳螂大师算是几位高手中最聪明的一个,对阿宝的现状很是无奈,总是暗中帮忙。"
|
||||
},
|
||||
"icon": "wp_icon_0002",
|
||||
"text": {
|
||||
"key": "mainline_text_10004",
|
||||
"text": "金币40000"
|
||||
},
|
||||
"Episode": [
|
||||
401,
|
||||
402,
|
||||
403,
|
||||
404,
|
||||
405,
|
||||
406,
|
||||
407,
|
||||
408,
|
||||
409
|
||||
],
|
||||
"award": [
|
||||
{
|
||||
"a": "item",
|
||||
"t": "30001",
|
||||
"n": 10
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 40000
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"name": {
|
||||
"key": "mainline_name_10005",
|
||||
"text": "Chapter 5"
|
||||
},
|
||||
"intensity": 1,
|
||||
"map": "zx_ddt_zj01",
|
||||
"title": {
|
||||
"key": "mainline_title_10005",
|
||||
"text": "第5章:激烈战斗"
|
||||
},
|
||||
"desc": {
|
||||
"key": "mainline_desc_10005",
|
||||
"text": "最后要将阿宝调教成“功夫高手”的一代宗师“师父”华丽丽地出场了,然而有着一身好功夫并不意味着就是完美的,“师父”因为过去犯下的一个错误,一直纠结着没办法释然。"
|
||||
},
|
||||
"icon": "wp_icon_0002",
|
||||
"text": {
|
||||
"key": "mainline_text_10005",
|
||||
"text": "金币40000"
|
||||
},
|
||||
"Episode": [
|
||||
501,
|
||||
502,
|
||||
503,
|
||||
504,
|
||||
505,
|
||||
506,
|
||||
507,
|
||||
508,
|
||||
509
|
||||
],
|
||||
"award": [
|
||||
{
|
||||
"a": "item",
|
||||
"t": "30001",
|
||||
"n": 10
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 40000
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"name": {
|
||||
"key": "mainline_name_10006",
|
||||
"text": "Chapter 6"
|
||||
},
|
||||
"intensity": 1,
|
||||
"map": "zx_ddt_zj02",
|
||||
"title": {
|
||||
"key": "mainline_title_10006",
|
||||
"text": "第6章:下山"
|
||||
},
|
||||
"desc": {
|
||||
"key": "mainline_desc_10006",
|
||||
"text": "至于那个让人人都如临大敌的太郎,则是一只非常自恋的雪豹,他等待复仇的这一天,已经整整等了20年了,可是他做梦也没想到,自己等来的竟然是一只大熊猫。"
|
||||
},
|
||||
"icon": "wp_icon_0002",
|
||||
"text": {
|
||||
"key": "mainline_text_10006",
|
||||
"text": "金币40000"
|
||||
},
|
||||
"Episode": [
|
||||
601,
|
||||
602,
|
||||
603,
|
||||
604,
|
||||
605,
|
||||
606,
|
||||
607,
|
||||
608,
|
||||
609
|
||||
],
|
||||
"award": [
|
||||
{
|
||||
"a": "item",
|
||||
"t": "30001",
|
||||
"n": 10
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 40000
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"name": {
|
||||
"key": "mainline_name_10007",
|
||||
"text": "Chapter 7"
|
||||
},
|
||||
"intensity": 1,
|
||||
"map": "zx_ddt_zj03",
|
||||
"title": {
|
||||
"key": "mainline_title_10007",
|
||||
"text": "第7章:事件余波"
|
||||
},
|
||||
"desc": {
|
||||
"key": "mainline_desc_10007",
|
||||
"text": "激烈的战斗后,阿宝以自己对武功的悟性和师父传授的武术,战胜了太郎,拯救了山谷,为山谷带来了和平。"
|
||||
},
|
||||
"icon": "wp_icon_0002",
|
||||
"text": {
|
||||
"key": "mainline_text_10007",
|
||||
"text": "金币40000"
|
||||
},
|
||||
"Episode": [
|
||||
701,
|
||||
702,
|
||||
703,
|
||||
704,
|
||||
705,
|
||||
706,
|
||||
707,
|
||||
708,
|
||||
709
|
||||
],
|
||||
"award": [
|
||||
{
|
||||
"a": "item",
|
||||
"t": "30001",
|
||||
"n": 10
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 40000
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"name": {
|
||||
"key": "mainline_name_10008",
|
||||
"text": "Chapter 8"
|
||||
},
|
||||
"intensity": 1,
|
||||
"map": "zx_ddt_zj04",
|
||||
"title": {
|
||||
"key": "mainline_title_10008",
|
||||
"text": "第8章:乌龟大师"
|
||||
},
|
||||
"desc": {
|
||||
"key": "mainline_desc_10008",
|
||||
"text": "可是在一场特殊的比武大会上胜出的人要代表“和平谷”将邪恶的大龙永久地驱除出去,啥都不会的阿宝却在经历了一系列阴差阳错之后屏雀中选,让所有人都大跌眼镜。"
|
||||
},
|
||||
"icon": "wp_icon_0002",
|
||||
"text": {
|
||||
"key": "mainline_text_10008",
|
||||
"text": "金币40000"
|
||||
},
|
||||
"Episode": [
|
||||
801,
|
||||
802,
|
||||
803,
|
||||
804,
|
||||
805,
|
||||
806,
|
||||
807,
|
||||
808,
|
||||
809
|
||||
],
|
||||
"award": [
|
||||
{
|
||||
"a": "item",
|
||||
"t": "30001",
|
||||
"n": 10
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 40000
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"name": {
|
||||
"key": "mainline_name_10009",
|
||||
"text": "Chapter 9"
|
||||
},
|
||||
"intensity": 1,
|
||||
"map": "zx_ddt_zj01",
|
||||
"title": {
|
||||
"key": "mainline_title_10009",
|
||||
"text": "第9章:太狼来袭"
|
||||
},
|
||||
"desc": {
|
||||
"key": "mainline_desc_10009",
|
||||
"text": "可是在一场特殊的比武大会上胜出的人要代表“和平谷”将邪恶的大龙永久地驱除出去,啥都不会的阿宝却在经历了一系列阴差阳错之后屏雀中选,让所有人都大跌眼镜。"
|
||||
},
|
||||
"icon": "wp_icon_0002",
|
||||
"text": {
|
||||
"key": "mainline_text_10009",
|
||||
"text": "金币40000"
|
||||
},
|
||||
"Episode": [
|
||||
901,
|
||||
902,
|
||||
903,
|
||||
904,
|
||||
905,
|
||||
906,
|
||||
907,
|
||||
908,
|
||||
909
|
||||
],
|
||||
"award": [
|
||||
{
|
||||
"a": "item",
|
||||
"t": "30001",
|
||||
"n": 10
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 40000
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 10,
|
||||
"name": {
|
||||
"key": "mainline_name_10010",
|
||||
"text": "Chapter 10"
|
||||
},
|
||||
"intensity": 1,
|
||||
"map": "zx_ddt_zj02",
|
||||
"title": {
|
||||
"key": "mainline_title_10010",
|
||||
"text": "第10章:乌龟大师"
|
||||
},
|
||||
"desc": {
|
||||
"key": "mainline_desc_10010",
|
||||
"text": "可是在一场特殊的比武大会上胜出的人要代表“和平谷”将邪恶的大龙永久地驱除出去,啥都不会的阿宝却在经历了一系列阴差阳错之后屏雀中选,让所有人都大跌眼镜。"
|
||||
},
|
||||
"icon": "wp_icon_0002",
|
||||
"text": {
|
||||
"key": "mainline_text_10010",
|
||||
"text": "金币40000"
|
||||
},
|
||||
"Episode": [
|
||||
1001,
|
||||
1002,
|
||||
1003,
|
||||
1004,
|
||||
1005,
|
||||
1006,
|
||||
1007,
|
||||
1008,
|
||||
1009
|
||||
],
|
||||
"award": [
|
||||
{
|
||||
"a": "item",
|
||||
"t": "30001",
|
||||
"n": 10
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 40000
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"name": {
|
||||
"key": "mainline_name_10011",
|
||||
"text": "Chapter 11"
|
||||
},
|
||||
"intensity": 1,
|
||||
"map": "zx_ddt_zj01",
|
||||
"title": {
|
||||
"key": "mainline_title_10011",
|
||||
"text": "第11章:太狼来袭"
|
||||
},
|
||||
"desc": {
|
||||
"key": "mainline_desc_10011",
|
||||
"text": "可是在一场特殊的比武大会上胜出的人要代表“和平谷”将邪恶的大龙永久地驱除出去,啥都不会的阿宝却在经历了一系列阴差阳错之后屏雀中选,让所有人都大跌眼镜。"
|
||||
},
|
||||
"icon": "wp_icon_0002",
|
||||
"text": {
|
||||
"key": "mainline_text_10009",
|
||||
"text": "金币40000"
|
||||
},
|
||||
"Episode": [
|
||||
1101,
|
||||
1102,
|
||||
1103,
|
||||
1104,
|
||||
1105,
|
||||
1106,
|
||||
1107,
|
||||
1108,
|
||||
1109
|
||||
],
|
||||
"award": [
|
||||
{
|
||||
"a": "item",
|
||||
"t": "30001",
|
||||
"n": 10
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 40000
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 12,
|
||||
"name": {
|
||||
"key": "mainline_name_10012",
|
||||
"text": "Chapter 12"
|
||||
},
|
||||
"intensity": 1,
|
||||
"map": "zx_ddt_zj02",
|
||||
"title": {
|
||||
"key": "mainline_title_10012",
|
||||
"text": "第12章:乌龟大师"
|
||||
},
|
||||
"desc": {
|
||||
"key": "mainline_desc_10012",
|
||||
"text": "可是在一场特殊的比武大会上胜出的人要代表“和平谷”将邪恶的大龙永久地驱除出去,啥都不会的阿宝却在经历了一系列阴差阳错之后屏雀中选,让所有人都大跌眼镜。"
|
||||
},
|
||||
"icon": "wp_icon_0002",
|
||||
"text": {
|
||||
"key": "mainline_text_10010",
|
||||
"text": "金币40000"
|
||||
},
|
||||
"Episode": [
|
||||
1201,
|
||||
1202,
|
||||
1203,
|
||||
1204,
|
||||
1205,
|
||||
1206,
|
||||
1207,
|
||||
1208,
|
||||
1209
|
||||
],
|
||||
"award": [
|
||||
{
|
||||
"a": "item",
|
||||
"t": "30001",
|
||||
"n": 10
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 40000
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
@ -3,7 +3,7 @@ package robot
|
||||
import (
|
||||
"fmt"
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/modules/mainline"
|
||||
"go_dreamfactory/modules/mline"
|
||||
"go_dreamfactory/pb"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
@ -13,8 +13,8 @@ var (
|
||||
storyBuilders = []*TestCase{
|
||||
{
|
||||
desc: "主线数据",
|
||||
mainType: string(comm.ModuleMainline),
|
||||
subType: mainline.MainlineGetListResp,
|
||||
mainType: string(comm.ModuleMline),
|
||||
subType: mline.MlineGetListResp,
|
||||
req: &pb.MainlineGetListReq{},
|
||||
rsp: &pb.MainlineGetListResp{},
|
||||
print: func(rsp proto.Message) {
|
||||
@ -26,8 +26,8 @@ var (
|
||||
//enabled: true,
|
||||
}, {
|
||||
desc: "主线详情",
|
||||
mainType: string(comm.ModuleMainline),
|
||||
subType: mainline.MainlineChallengeResp,
|
||||
mainType: string(comm.ModuleMline),
|
||||
subType: mline.MlineChallengeResp,
|
||||
req: &pb.MainlineChallengeReq{
|
||||
|
||||
MainlineId: 1,
|
||||
|
@ -14,7 +14,7 @@ import (
|
||||
"go_dreamfactory/modules/hero"
|
||||
"go_dreamfactory/modules/library"
|
||||
"go_dreamfactory/modules/linestory"
|
||||
"go_dreamfactory/modules/mainline"
|
||||
"go_dreamfactory/modules/mline"
|
||||
"go_dreamfactory/modules/sociaty"
|
||||
"go_dreamfactory/modules/sys"
|
||||
"go_dreamfactory/modules/task"
|
||||
@ -95,9 +95,9 @@ var (
|
||||
ff(comm.ModuleShop, "getlist"): &formview.ShopListView{},
|
||||
ff(comm.ModuleShop, "buy"): &formview.ShopBuyView{},
|
||||
// mailine
|
||||
ff(comm.ModuleMainline, mainline.MainlineGetListResp): &formview.MainlineListView{},
|
||||
ff(comm.ModuleMainline, mainline.MainlineChallengeResp): &formview.MainlineChallengeView{},
|
||||
ff(comm.ModuleMainline, mainline.MainlineGetRewardResp): &formview.MainlineRewardView{},
|
||||
ff(comm.ModuleMline, mline.MlineGetListResp): &formview.MainlineListView{},
|
||||
ff(comm.ModuleMline, mline.MlineChallengeResp): &formview.MainlineChallengeView{},
|
||||
ff(comm.ModuleMline, mline.MlineGetRewardResp): &formview.MainlineRewardView{},
|
||||
// pagoda
|
||||
ff(comm.ModulePagoda, "getlist"): &formview.PagodaListView{},
|
||||
// rtask
|
||||
@ -141,7 +141,7 @@ var (
|
||||
string(comm.ModuleItems),
|
||||
string(comm.ModuleEquipment),
|
||||
string(comm.ModuleShop),
|
||||
string(comm.ModuleMainline),
|
||||
string(comm.ModuleMline),
|
||||
string(comm.ModulePagoda),
|
||||
string(comm.ModuleRtask),
|
||||
string(comm.ModuleLinestory),
|
||||
@ -217,9 +217,9 @@ var (
|
||||
ff(comm.ModuleShop, "buy"),
|
||||
},
|
||||
"mainline": {
|
||||
ff(comm.ModuleMainline, mainline.MainlineGetListResp),
|
||||
ff(comm.ModuleMainline, mainline.MainlineChallengeResp),
|
||||
ff(comm.ModuleMainline, mainline.MainlineGetRewardResp),
|
||||
ff(comm.ModuleMline, mline.MlineGetListResp),
|
||||
ff(comm.ModuleMline, mline.MlineChallengeResp),
|
||||
ff(comm.ModuleMline, mline.MlineGetRewardResp),
|
||||
},
|
||||
"pagoda": {
|
||||
ff(comm.ModulePagoda, "getlist"),
|
||||
@ -714,30 +714,30 @@ var (
|
||||
Enabled: true,
|
||||
},
|
||||
// mainline
|
||||
string(comm.ModuleMainline): {
|
||||
string(comm.ModuleMline): {
|
||||
NavLabel: "主线关卡",
|
||||
MainType: string(comm.ModuleShop),
|
||||
Enabled: true,
|
||||
},
|
||||
ff(comm.ModuleMainline, mainline.MainlineGetListResp): {
|
||||
ff(comm.ModuleMline, mline.MlineGetListResp): {
|
||||
NavLabel: "主线关卡",
|
||||
Desc: "主线关卡",
|
||||
MainType: string(comm.ModuleMainline),
|
||||
SubType: mainline.MainlineGetListResp,
|
||||
MainType: string(comm.ModuleMline),
|
||||
SubType: mline.MlineGetListResp,
|
||||
Enabled: true,
|
||||
},
|
||||
ff(comm.ModuleMainline, mainline.MainlineChallengeResp): {
|
||||
ff(comm.ModuleMline, mline.MlineChallengeResp): {
|
||||
NavLabel: "关卡挑战",
|
||||
Desc: "关卡挑战",
|
||||
MainType: string(comm.ModuleMainline),
|
||||
SubType: mainline.MainlineChallengeResp,
|
||||
MainType: string(comm.ModuleMline),
|
||||
SubType: mline.MlineChallengeResp,
|
||||
Enabled: true,
|
||||
},
|
||||
ff(comm.ModuleMainline, mainline.MainlineGetRewardResp): {
|
||||
ff(comm.ModuleMline, mline.MlineGetRewardResp): {
|
||||
NavLabel: "关卡奖励",
|
||||
Desc: "获取关卡奖励",
|
||||
MainType: string(comm.ModuleMainline),
|
||||
SubType: mainline.MainlineGetRewardResp,
|
||||
MainType: string(comm.ModuleMline),
|
||||
SubType: mline.MlineGetRewardResp,
|
||||
Enabled: true,
|
||||
},
|
||||
//pagoda
|
||||
|
@ -48,7 +48,7 @@ const (
|
||||
ModuleItems core.M_Modules = "items" //道具模块
|
||||
ModuleShop core.M_Modules = "shop" //商店模块
|
||||
ModuleTask core.M_Modules = "task" //任务模块
|
||||
ModuleMainline core.M_Modules = "mainline" //主线模块
|
||||
|
||||
ModuleNotify core.M_Modules = "notify" //公告模块
|
||||
ModuleChat core.M_Modules = "chat" //聊天模块
|
||||
ModuleGM core.M_Modules = "gm" //gm模块
|
||||
@ -108,8 +108,7 @@ const (
|
||||
TableShopitems = "shopitems"
|
||||
///公告信息表
|
||||
TableNotify = "notify"
|
||||
///主线数据表
|
||||
TableMainline = "mainline"
|
||||
|
||||
///邮件表
|
||||
TableMail = "mail"
|
||||
///道具背包表
|
||||
|
@ -169,13 +169,7 @@ type (
|
||||
*/
|
||||
GetForgeEquip(session IUserSession, suiteId int32, pos int32, lv int32, dyweight []int32) (eruip *pb.DB_Equipment, code pb.ErrorCode)
|
||||
}
|
||||
IMainline interface {
|
||||
ModifyMainlineDataByNanduID(uid string, nandu, id int32) (code pb.ErrorCode)
|
||||
/// 查询章节ID
|
||||
GetUsermainLineData(uid string) (mainlineId int32)
|
||||
///红点
|
||||
IReddot
|
||||
}
|
||||
|
||||
IMline interface {
|
||||
ModifyMlineDataByNanduID(session IUserSession, id int32) (code pb.ErrorCode)
|
||||
/// 查询章节ID
|
||||
|
@ -1,34 +0,0 @@
|
||||
package mainline
|
||||
|
||||
import (
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/modules"
|
||||
)
|
||||
|
||||
const (
|
||||
MainlineGetListResp = "getlist"
|
||||
MainlineChallengeResp = "challenge"
|
||||
MainlineChallengeOverResp = "challengeover"
|
||||
MainlineGetRewardResp = "getreward"
|
||||
MainlineNewChapterPush = "newchapter"
|
||||
)
|
||||
|
||||
type apiComp struct {
|
||||
modules.MCompGate
|
||||
service core.IService
|
||||
module *Mainline
|
||||
}
|
||||
|
||||
//组件初始化接口
|
||||
func (this *apiComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||
err = this.MCompGate.Init(service, module, comp, options)
|
||||
this.module = module.(*Mainline)
|
||||
this.service = service
|
||||
return
|
||||
}
|
||||
|
||||
func (this *apiComp) Start() (err error) {
|
||||
err = this.MCompGate.Start()
|
||||
|
||||
return
|
||||
}
|
@ -1,108 +0,0 @@
|
||||
package mainline
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/pb"
|
||||
cfg "go_dreamfactory/sys/configure/structs"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
//参数校验
|
||||
func (this *apiComp) ChallengeCheck(session comm.IUserSession, req *pb.MainlineChallengeReq) (code pb.ErrorCode) {
|
||||
if req.MainlineId == 0 || req.ChapterObj == "" || req.Leadpos >= 5 || len(req.Teamids) != 5 || req.Leadpos < 0 {
|
||||
code = pb.ErrorCode_ReqParameterError
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
///挑战主线关卡
|
||||
func (this *apiComp) Challenge(session comm.IUserSession, req *pb.MainlineChallengeReq) (code pb.ErrorCode, data proto.Message) {
|
||||
var (
|
||||
curChapter *pb.DBMainline // 当前章节信息
|
||||
ps int32
|
||||
psAnt *cfg.Gameatn
|
||||
)
|
||||
|
||||
code = this.ChallengeCheck(session, req)
|
||||
if code != pb.ErrorCode_Success {
|
||||
return // 参数校验失败直接返回
|
||||
}
|
||||
// 校验关卡存不存在
|
||||
curChapter = this.module.modelMainline.getOneChapterInfo(session.GetUserId(), req.ChapterObj)
|
||||
if curChapter == nil {
|
||||
code = pb.ErrorCode_MainlineNotFound
|
||||
return
|
||||
}
|
||||
|
||||
node := this.module.configure.GetMainlineConfigData(int32(req.MainlineId), curChapter.Intensity)
|
||||
if node == nil { // 配置文件校验
|
||||
code = pb.ErrorCode_MainlineNotFindChapter
|
||||
return
|
||||
}
|
||||
|
||||
for _, v := range curChapter.BranchID {
|
||||
if v == int32(req.MainlineId) { // 重复挑战
|
||||
code = pb.ErrorCode_MainlineNotFindChapter
|
||||
return
|
||||
}
|
||||
if v == int32(req.MainlineId) {
|
||||
break
|
||||
}
|
||||
}
|
||||
if curChapter.Ps != 0 {
|
||||
if code = this.module.ConsumeRes(session, node.PsMg, true); code != pb.ErrorCode_Success { // 扣1点
|
||||
return
|
||||
}
|
||||
} else {
|
||||
for _, v := range node.PsConsume {
|
||||
if v.A == "attr" && v.T == "ps" {
|
||||
ps += v.N
|
||||
}
|
||||
}
|
||||
for _, v := range node.PsMg {
|
||||
if v.A == "attr" && v.T == "ps" {
|
||||
ps += v.N
|
||||
}
|
||||
}
|
||||
psAnt = &cfg.Gameatn{
|
||||
A: "attr",
|
||||
T: "ps",
|
||||
N: ps,
|
||||
}
|
||||
if code = this.module.ConsumeRes(session, []*cfg.Gameatn{psAnt}, true); code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
|
||||
curChapter.Ps = ps
|
||||
update := map[string]interface{}{
|
||||
"ps": ps,
|
||||
}
|
||||
|
||||
err := this.module.modelMainline.modifyMainlineData(session.GetUserId(), curChapter.Id, update)
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_DBError
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
code, record := this.module.battle.CreatePveBattle(session, &pb.BattlePVEReq{
|
||||
Ptype: pb.PlayType_mainline,
|
||||
Title: "",
|
||||
Format: &pb.BattleFormation{
|
||||
Leadpos: req.Leadpos,
|
||||
Format: req.Teamids,
|
||||
},
|
||||
Mformat: node.FormatList,
|
||||
})
|
||||
if code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
session.SendMsg(string(this.module.GetType()), MainlineChallengeResp, &pb.MainlineChallengeResp{
|
||||
Info: &pb.BattleInfo{Id: record.Id, Title: record.Title, Btype: record.Btype, Ptype: record.Ptype, RedCompId: record.RedCompId, Redflist: record.Redflist, BlueCompId: record.BlueCompId, Buleflist: record.Buleflist},
|
||||
ChapterObj: req.ChapterObj,
|
||||
MainlineId: req.GetMainlineId(),
|
||||
})
|
||||
return
|
||||
}
|
@ -1,153 +0,0 @@
|
||||
package mainline
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/pb"
|
||||
|
||||
cfg "go_dreamfactory/sys/configure/structs"
|
||||
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
//参数校验
|
||||
func (this *apiComp) ChallengeOverCheck(session comm.IUserSession, req *pb.MainlineChallengeOverReq) (code pb.ErrorCode) {
|
||||
if req.MainlineId == 0 {
|
||||
code = pb.ErrorCode_ReqParameterError
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
///挑战主线关卡
|
||||
func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MainlineChallengeOverReq) (code pb.ErrorCode, data proto.Message) {
|
||||
var (
|
||||
mainline *pb.DBMainline // 当前章节信息
|
||||
res []*cfg.Gameatn // 小章节奖励
|
||||
isWin bool
|
||||
user *pb.DBUser
|
||||
hero []string //新的英雄
|
||||
newhero []string //新的英雄
|
||||
)
|
||||
res = make([]*cfg.Gameatn, 0)
|
||||
hero = make([]string, 0)
|
||||
newhero = make([]string, 0)
|
||||
code = this.ChallengeOverCheck(session, req)
|
||||
if code != pb.ErrorCode_Success {
|
||||
return // 参数校验失败直接返回
|
||||
}
|
||||
// 校验关卡存不存在
|
||||
mainline = this.module.modelMainline.getOneChapterInfo(session.GetUserId(), req.ChapterObj)
|
||||
if mainline == nil {
|
||||
code = pb.ErrorCode_MainlineNotFound
|
||||
return
|
||||
}
|
||||
|
||||
node := this.module.configure.GetMainlineConfigData(int32(req.MainlineId), mainline.Intensity)
|
||||
if node == nil { // 配置文件校验
|
||||
code = pb.ErrorCode_MainlineNotFindChapter
|
||||
return
|
||||
}
|
||||
for _, v := range mainline.BranchID {
|
||||
if v == int32(req.MainlineId) { // 重复挑战
|
||||
code = pb.ErrorCode_MainlineNotFindChapter
|
||||
return
|
||||
}
|
||||
}
|
||||
// 校验通过
|
||||
|
||||
code, isWin = this.module.battle.CheckBattleReport(session, req.Report)
|
||||
if code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
|
||||
if !isWin { // 战斗失败直接返回
|
||||
// 返还
|
||||
mainline.Ps = 0
|
||||
this.module.modelMainline.modifyMainlineData(session.GetUserId(), mainline.Id, map[string]interface{}{
|
||||
"ps": 0,
|
||||
})
|
||||
|
||||
if code = this.module.DispenseRes(session, node.PsConsume, true); code != pb.ErrorCode_Success { // 返还预扣体力
|
||||
return
|
||||
}
|
||||
code = pb.ErrorCode_BattleNoWin
|
||||
return
|
||||
}
|
||||
|
||||
res = append(res, node.Award...)
|
||||
for _, v := range node.Award {
|
||||
if v.A == comm.HeroType {
|
||||
hero = append(hero, v.T)
|
||||
}
|
||||
}
|
||||
if len(hero) > 0 {
|
||||
ishave := this.module.ModuleUser.CheckTujianHero(session, hero)
|
||||
for i, v := range ishave {
|
||||
if !v {
|
||||
newhero = append(newhero, hero[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
user = this.module.ModuleUser.GetUser(session.GetUserId())
|
||||
mainline.MainlineId = int32(req.MainlineId)
|
||||
mainline.BranchID = append(mainline.BranchID, int32(req.MainlineId))
|
||||
mainline.Ps = 0 // 重置预扣体力
|
||||
update := map[string]interface{}{
|
||||
"mainlineId": req.MainlineId,
|
||||
"chapterId": mainline.ChapterId,
|
||||
"branchID": mainline.BranchID,
|
||||
"ps": 0,
|
||||
}
|
||||
if node.Episodetype == comm.MainLineBoss { // 打完boss 设置领奖状态
|
||||
update["awaredID"] = pb.AwaredType_TypeAvailable
|
||||
mainline.AwaredID = pb.AwaredType_TypeAvailable
|
||||
}
|
||||
err := this.module.modelMainline.modifyMainlineData(session.GetUserId(), mainline.Id, update)
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_DBError
|
||||
return
|
||||
}
|
||||
|
||||
if node.Episodetype == comm.MainLineBoss { // 挑战完成 boss关
|
||||
_data := &pb.DBMainline{}
|
||||
conf := this.module.configure.GetMainlineChapter(mainline.ChapterId + 1)
|
||||
_data.Id = primitive.NewObjectID().Hex()
|
||||
_data.ChapterId = mainline.ChapterId + 1
|
||||
_data.Intensity = mainline.Intensity
|
||||
if conf == nil { // 这里就是切换下一个难度了
|
||||
if mainline.Intensity < comm.MaxMainlineIntensity {
|
||||
_data.Intensity = mainline.Intensity + 1 // 难度+1
|
||||
_data.ChapterId = 1 // 默认第一章节
|
||||
}
|
||||
}
|
||||
|
||||
_mData := make(map[string]interface{}, 0)
|
||||
_data.Uid = session.GetUserId()
|
||||
_mData[_data.Id] = _data
|
||||
|
||||
this.module.modelMainline.addNewChapter(session.GetUserId(), _mData)
|
||||
session.SendMsg(string(this.module.GetType()), MainlineNewChapterPush, &pb.MainlineNewChapterPush{Data: _data}) // 推送新的章节
|
||||
|
||||
}
|
||||
// 发奖
|
||||
if code = this.module.DispenseRes(session, res, true); code != pb.ErrorCode_Success {
|
||||
this.module.Debugf("DispenseRes err:+%v", res)
|
||||
}
|
||||
// 加经验
|
||||
if node.Episodetype != 5 && node.Episodetype != 7 {
|
||||
if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 {
|
||||
for _, v := range req.Report.Info.Redflist[0].Team {
|
||||
if node.Exp > 0 && !v.Ishelp { // 助战英雄不加经验
|
||||
this.module.ModuleHero.AddHeroExp(session, v.Oid, node.Exp)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
session.SendMsg(string(this.module.GetType()), MainlineChallengeOverResp, &pb.MainlineChallengeOverResp{Data: mainline, Newheros: newhero, Olv: user.Lv})
|
||||
// 主线任务统计 Rtype60
|
||||
this.module.ModuleRtask.SendToRtask(session, comm.Rtype60, 1)
|
||||
this.module.ModuleRtask.SendToRtask(session, comm.Rtype61, int32(req.MainlineId))
|
||||
return
|
||||
}
|
@ -1,65 +0,0 @@
|
||||
package mainline
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/pb"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
//参数校验
|
||||
func (this *apiComp) GetRewardCheck(session comm.IUserSession, req *pb.MainlineGetRewardReq) (code pb.ErrorCode) {
|
||||
if req.ChapterObj == "" {
|
||||
code = pb.ErrorCode_ReqParameterError
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
///获取主线关卡信息
|
||||
func (this *apiComp) GetReward(session comm.IUserSession, req *pb.MainlineGetRewardReq) (code pb.ErrorCode, data proto.Message) {
|
||||
rsp := &pb.MainlineGetRewardResp{}
|
||||
|
||||
code = this.GetRewardCheck(session, req)
|
||||
if code != pb.ErrorCode_Success {
|
||||
return // 参数校验失败直接返回
|
||||
}
|
||||
|
||||
_obj := this.module.modelMainline.getOneChapterInfo(session.GetUserId(), req.ChapterObj)
|
||||
if _obj == nil {
|
||||
code = pb.ErrorCode_DBError
|
||||
return
|
||||
}
|
||||
if _obj.AwaredID == pb.AwaredType_TypeReceived {
|
||||
code = pb.ErrorCode_MainlineRepeatReward // 重复领奖
|
||||
return
|
||||
}
|
||||
if _obj.AwaredID != pb.AwaredType_TypeAvailable {
|
||||
code = pb.ErrorCode_MainlineCompleteReward // 通关才能领奖
|
||||
return
|
||||
}
|
||||
// 校验是不是通关了
|
||||
chaptConfig := this.module.configure.GetMainlineChapter(int32(_obj.ChapterId)) // 根据配置文件找
|
||||
if chaptConfig == nil {
|
||||
code = pb.ErrorCode_ConfigNoFound
|
||||
return
|
||||
}
|
||||
|
||||
_obj.AwaredID = pb.AwaredType_TypeReceived // 设置领奖标记
|
||||
update := map[string]interface{}{
|
||||
"awaredID": _obj.AwaredID,
|
||||
}
|
||||
// 发奖
|
||||
code = this.module.DispenseRes(session, chaptConfig.Award, true)
|
||||
if code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
err := this.module.modelMainline.modifyMainlineData(session.GetUserId(), _obj.Id, update)
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_DBError
|
||||
return
|
||||
}
|
||||
|
||||
rsp.Data = _obj
|
||||
session.SendMsg(string(this.module.GetType()), MainlineGetRewardResp, rsp)
|
||||
return
|
||||
}
|
@ -1,47 +0,0 @@
|
||||
package mainline
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/pb"
|
||||
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
//参数校验
|
||||
func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.MainlineGetListReq) (code pb.ErrorCode) {
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
///获取主线关卡信息
|
||||
func (this *apiComp) GetList(session comm.IUserSession, req *pb.MainlineGetListReq) (code pb.ErrorCode, data proto.Message) {
|
||||
rsp := &pb.MainlineGetListResp{}
|
||||
|
||||
code = this.GetListCheck(session, req)
|
||||
if code != pb.ErrorCode_Success {
|
||||
return // 参数校验失败直接返回
|
||||
}
|
||||
|
||||
list, err := this.module.modelMainline.getMainlineList(session.GetUserId())
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_DBError
|
||||
return
|
||||
}
|
||||
if len(list) == 0 { // 如果数量为0 则默认创建一条数据
|
||||
_data := &pb.DBMainline{}
|
||||
_data.Id = primitive.NewObjectID().Hex()
|
||||
_data.ChapterId = 1 // 默认第一章节
|
||||
_mData := make(map[string]interface{}, 0)
|
||||
_data.Uid = session.GetUserId()
|
||||
_data.Intensity = 1 // 难度1
|
||||
_mData[_data.Id] = _data
|
||||
|
||||
this.module.modelMainline.addNewChapter(session.GetUserId(), _mData)
|
||||
list = append(list, _data)
|
||||
}
|
||||
rsp.Data = list
|
||||
|
||||
session.SendMsg(string(this.module.GetType()), MainlineGetListResp, &pb.MainlineGetListResp{Data: rsp.Data})
|
||||
return
|
||||
}
|
@ -1,92 +0,0 @@
|
||||
package mainline
|
||||
|
||||
import (
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/lego/sys/log"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/sys/configure"
|
||||
cfg "go_dreamfactory/sys/configure/structs"
|
||||
"sync"
|
||||
)
|
||||
|
||||
const (
|
||||
game_mainlinechapter = "game_mainlinechapter.json"
|
||||
game_mainline = "game_mainline.json"
|
||||
)
|
||||
|
||||
///配置管理基础组件
|
||||
type configureComp struct {
|
||||
modules.MCompConfigure
|
||||
module *Mainline
|
||||
hlock sync.RWMutex
|
||||
_mapMainline map[int64]*cfg.GameMainlineData
|
||||
}
|
||||
|
||||
//组件初始化接口
|
||||
func (this *configureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||
err = this.MCompConfigure.Init(service, module, comp, options)
|
||||
this.module = module.(*Mainline)
|
||||
err = this.LoadMultiConfigure(map[string]interface{}{
|
||||
game_mainlinechapter: cfg.NewGameMainlineChapter,
|
||||
})
|
||||
this._mapMainline = make(map[int64]*cfg.GameMainlineData, 0)
|
||||
configure.RegisterConfigure(game_mainline, cfg.NewGameMainline, this.GetMainline)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func (this *configureComp) GetMainline() {
|
||||
if v, err := this.GetConfigure(game_mainline); err == nil {
|
||||
if configure, ok := v.(*cfg.GameMainline); ok {
|
||||
this.hlock.Lock()
|
||||
defer this.hlock.Unlock()
|
||||
for _, value := range configure.GetDataList() {
|
||||
this._mapMainline[int64(value.Id<<16)+int64(value.Intensity)] = value
|
||||
}
|
||||
return
|
||||
}
|
||||
} else {
|
||||
log.Errorf("get game_mainline conf err:%v", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// id + intensity
|
||||
func (this *configureComp) GetMainlineConfigData(id, intensity int32) *cfg.GameMainlineData {
|
||||
return this._mapMainline[int64(id<<16)+int64(intensity)]
|
||||
}
|
||||
|
||||
//读取配置数据
|
||||
func (this *configureComp) GetConfigure(name string) (v interface{}, err error) {
|
||||
return configure.GetConfigure(name)
|
||||
|
||||
}
|
||||
|
||||
func (this *configureComp) GetMainlineChapter(id int32) (data *cfg.GameMainlineChapterData) {
|
||||
if v, err := this.GetConfigure(game_mainlinechapter); err != nil {
|
||||
this.module.Errorf("get global conf err:%v", err)
|
||||
return
|
||||
} else {
|
||||
var (
|
||||
configure *cfg.GameMainlineChapter
|
||||
ok bool
|
||||
)
|
||||
if configure, ok = v.(*cfg.GameMainlineChapter); !ok {
|
||||
this.module.Errorf("%T no is *cfg.Game_MainlineChapterData", v)
|
||||
return
|
||||
}
|
||||
|
||||
data = configure.Get(int(id - 1))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// 获取章节数量
|
||||
func (this *configureComp) GetMaxMainlineChapter() int32 {
|
||||
if v, err := this.GetConfigure(game_mainlinechapter); err == nil {
|
||||
if configure, ok := v.(*cfg.GameMainlineChapter); ok {
|
||||
return int32(len(configure.GetDataList()))
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
package mainline
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/pb"
|
||||
)
|
||||
|
||||
type ModelMainline struct {
|
||||
modules.MCompModel
|
||||
module *Mainline
|
||||
}
|
||||
|
||||
func (this *ModelMainline) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||
this.TableName = comm.TableMainline
|
||||
err = this.MCompModel.Init(service, module, comp, options)
|
||||
this.module = module.(*Mainline)
|
||||
return
|
||||
}
|
||||
|
||||
// 获取章节信息
|
||||
func (this *ModelMainline) getMainlineList(uid string) (storys []*pb.DBMainline, err error) {
|
||||
storys = make([]*pb.DBMainline, 0)
|
||||
err = this.GetList(uid, &storys)
|
||||
return
|
||||
}
|
||||
|
||||
// 修改章节信息
|
||||
func (this *ModelMainline) modifyMainlineData(uid string, objid string, data map[string]interface{}) error {
|
||||
return this.module.modelMainline.ChangeList(uid, objid, data)
|
||||
}
|
||||
|
||||
// 增加新的章节数据
|
||||
func (this *ModelMainline) addNewChapter(uId string, data map[string]interface{}) (err error) {
|
||||
|
||||
if err = this.AddLists(uId, data); err != nil {
|
||||
this.module.Errorf("err:%v", err)
|
||||
return
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// 获取指定章节数据
|
||||
func (this *ModelMainline) getOneChapterInfo(uid, obj string) *pb.DBMainline {
|
||||
data := &pb.DBMainline{}
|
||||
err := this.module.modelMainline.GetListObj(uid, obj, data)
|
||||
if err != nil {
|
||||
this.module.Errorf("%v", err)
|
||||
return nil
|
||||
}
|
||||
return data
|
||||
}
|
||||
|
||||
// 增加新的章节数据
|
||||
func (this *ModelMainline) cleanChapter(uId string) (err error) {
|
||||
|
||||
if err = this.DelByUId(uId); err != nil {
|
||||
this.module.Errorf("err:%v", err)
|
||||
return
|
||||
}
|
||||
return nil
|
||||
}
|
@ -1,165 +0,0 @@
|
||||
package mainline
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/pb"
|
||||
"sort"
|
||||
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
)
|
||||
|
||||
type Mainline struct {
|
||||
modules.ModuleBase
|
||||
modelMainline *ModelMainline
|
||||
service core.IService
|
||||
api *apiComp
|
||||
configure *configureComp
|
||||
battle comm.IBattle
|
||||
}
|
||||
|
||||
func NewModule() core.IModule {
|
||||
return &Mainline{}
|
||||
}
|
||||
|
||||
func (this *Mainline) GetType() core.M_Modules {
|
||||
return comm.ModuleMainline
|
||||
}
|
||||
|
||||
func (this *Mainline) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
|
||||
err = this.ModuleBase.Init(service, module, options)
|
||||
this.service = service
|
||||
return
|
||||
}
|
||||
|
||||
func (this *Mainline) OnInstallComp() {
|
||||
this.ModuleBase.OnInstallComp()
|
||||
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
|
||||
this.modelMainline = this.RegisterComp(new(ModelMainline)).(*ModelMainline)
|
||||
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
|
||||
}
|
||||
|
||||
func (this *Mainline) GetUsermainLineData(uid string) (mainlineId int32) {
|
||||
|
||||
_szData, err := this.modelMainline.getMainlineList(uid)
|
||||
if err == nil {
|
||||
sort.SliceStable(_szData, func(i, j int) bool { // 排序
|
||||
return _szData[i].ChapterId > _szData[j].ChapterId
|
||||
})
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func (this *Mainline) Start() (err error) {
|
||||
err = this.ModuleBase.Start()
|
||||
var module core.IModule
|
||||
if module, err = this.service.GetModule(comm.ModuleBattle); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
this.battle = module.(comm.IBattle)
|
||||
return
|
||||
}
|
||||
|
||||
//红点查询
|
||||
func (this *Mainline) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]bool) {
|
||||
reddot = make(map[comm.ReddotType]bool)
|
||||
for _, v := range rid {
|
||||
if v == comm.Reddot5 {
|
||||
reddot[comm.Reddot5] = this.CheckPoint(session.GetUserId())
|
||||
break
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// 红点检测
|
||||
func (this *Mainline) CheckPoint(uid string) bool {
|
||||
list, err := this.modelMainline.getMainlineList(uid)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
for _, v := range list {
|
||||
conf := this.configure.GetMainlineChapter(v.ChapterId)
|
||||
if conf == nil {
|
||||
continue
|
||||
}
|
||||
if len(conf.Episode) != len(v.BranchID) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// 参数 难度 + 关卡id
|
||||
func (this *Mainline) ModifyMainlineDataByNanduID(uid string, nandu, id int32) (code pb.ErrorCode) {
|
||||
|
||||
conf := this.configure.GetMainlineConfigData(id, nandu)
|
||||
if conf == nil {
|
||||
code = pb.ErrorCode_ConfigNoFound // 找不到配置
|
||||
return
|
||||
}
|
||||
// 已现在设置的为准 删除之前的所有数据
|
||||
this.modelMainline.cleanChapter(uid)
|
||||
// 获取当前的章节数据
|
||||
jumpCap := conf.Chapter
|
||||
// 先加所有难度小于1 的章节
|
||||
for ndIndex := 1; ndIndex <= int(nandu)-1; ndIndex++ {
|
||||
max := this.configure.GetMaxMainlineChapter()
|
||||
for i := 1; i <= int(max); i++ {
|
||||
confCap := this.configure.GetMainlineChapter(int32(i))
|
||||
//_conf := this.configure.GetMainlineConfigData(int32(i), int32(ndIndex))
|
||||
_data := &pb.DBMainline{}
|
||||
_data.Id = primitive.NewObjectID().Hex()
|
||||
_data.ChapterId = int32(i)
|
||||
_data.MainlineId = confCap.Id
|
||||
_mData := make(map[string]interface{}, 0)
|
||||
_data.Uid = uid
|
||||
_data.Intensity = int32(ndIndex) // 难度1
|
||||
|
||||
for _, v := range confCap.Episode {
|
||||
_data.BranchID = append(_data.BranchID, v)
|
||||
}
|
||||
|
||||
_mData[_data.Id] = _data
|
||||
|
||||
this.modelMainline.addNewChapter(uid, _mData)
|
||||
}
|
||||
}
|
||||
// 加当前难度 的章节数据
|
||||
for i := 1; i <= int(jumpCap-1); i++ {
|
||||
confCap := this.configure.GetMainlineChapter(int32(i))
|
||||
_data := &pb.DBMainline{}
|
||||
_data.Id = primitive.NewObjectID().Hex()
|
||||
_data.ChapterId = int32(i)
|
||||
_data.MainlineId = confCap.Id
|
||||
_mData := make(map[string]interface{}, 0)
|
||||
_data.Uid = uid
|
||||
_data.Intensity = int32(nandu) // 难度1
|
||||
for _, v := range confCap.Episode {
|
||||
_data.BranchID = append(_data.BranchID, v)
|
||||
}
|
||||
_mData[_data.Id] = _data
|
||||
this.modelMainline.addNewChapter(uid, _mData)
|
||||
}
|
||||
// 加当前难度 当前章节的前置关卡数据
|
||||
_data := &pb.DBMainline{}
|
||||
_data.Id = primitive.NewObjectID().Hex()
|
||||
_data.ChapterId = conf.Chapter
|
||||
_data.MainlineId = conf.Id
|
||||
_mData := make(map[string]interface{}, 0)
|
||||
_data.Uid = uid
|
||||
_data.Intensity = int32(nandu) // 难度1
|
||||
confCap := this.configure.GetMainlineChapter(int32(conf.Chapter))
|
||||
for _, v := range confCap.Episode {
|
||||
if v <= id {
|
||||
_data.BranchID = append(_data.BranchID, v)
|
||||
}
|
||||
}
|
||||
_mData[_data.Id] = _data
|
||||
this.modelMainline.addNewChapter(uid, _mData)
|
||||
|
||||
return
|
||||
}
|
@ -25,7 +25,7 @@ func (this *apiComp) GetAll(session comm.IUserSession, req *pb.ReddotGetAllReq)
|
||||
comm.Reddot28) {
|
||||
reddot[int32(k)] = v
|
||||
}
|
||||
for k, v := range this.module.mainline.Reddot(session, comm.Reddot5) {
|
||||
for k, v := range this.module.mline.Reddot(session, comm.Reddot5) {
|
||||
reddot[int32(k)] = v
|
||||
}
|
||||
for k, v := range this.module.pagoda.Reddot(session, comm.Reddot6) {
|
||||
|
@ -20,7 +20,7 @@ func NewModule() core.IModule {
|
||||
type Reddot struct {
|
||||
modules.ModuleBase
|
||||
service base.IRPCXService
|
||||
mainline comm.IMainline
|
||||
|
||||
pagoda comm.IPagoda
|
||||
martialhall comm.IMartialhall
|
||||
horoscope comm.IHoroscope
|
||||
@ -31,6 +31,7 @@ type Reddot struct {
|
||||
viking comm.IViking
|
||||
hunting comm.IHunting
|
||||
api_comp *apiComp
|
||||
mline comm.IMline
|
||||
}
|
||||
|
||||
//模块名
|
||||
@ -47,10 +48,10 @@ func (this *Reddot) Init(service core.IService, module core.IModule, options cor
|
||||
func (this *Reddot) Start() (err error) {
|
||||
err = this.ModuleBase.Start()
|
||||
var module core.IModule
|
||||
if module, err = this.service.GetModule(comm.ModuleMainline); err != nil {
|
||||
if module, err = this.service.GetModule(comm.ModuleMline); err != nil {
|
||||
return
|
||||
}
|
||||
this.mainline = module.(comm.IMainline)
|
||||
this.mline = module.(comm.IMline)
|
||||
if module, err = this.service.GetModule(comm.ModulePagoda); err != nil {
|
||||
return
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ func (this *ModelRtask) verfiyRtype1(uid string, cfg *cfg.GameRdtaskCondiData) (
|
||||
|
||||
// 剧情
|
||||
func (this *ModelRtask) verifyRtype2(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) {
|
||||
m, err := this.service.GetModule(comm.ModuleMainline)
|
||||
m, err := this.service.GetModule(comm.ModuleMline)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
@ -24,7 +24,6 @@ import (
|
||||
"go_dreamfactory/modules/library"
|
||||
"go_dreamfactory/modules/linestory"
|
||||
"go_dreamfactory/modules/mail"
|
||||
"go_dreamfactory/modules/mainline"
|
||||
"go_dreamfactory/modules/martialhall"
|
||||
"go_dreamfactory/modules/mline"
|
||||
"go_dreamfactory/modules/moonfantasy"
|
||||
@ -84,7 +83,6 @@ func main() {
|
||||
hero.NewModule(),
|
||||
equipment.NewModule(),
|
||||
task.NewModule(),
|
||||
mainline.NewModule(),
|
||||
shop.NewModule(),
|
||||
notify.NewModule(),
|
||||
chat.NewModule(),
|
||||
|
@ -1,34 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <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 GameMainline struct {
|
||||
_dataList []*GameMainlineData
|
||||
}
|
||||
|
||||
func NewGameMainline(_buf []map[string]interface{}) (*GameMainline, error) {
|
||||
_dataList := make([]*GameMainlineData, 0, len(_buf))
|
||||
for _, _ele_ := range _buf {
|
||||
if _v, err2 := DeserializeGameMainlineData(_ele_); err2 != nil {
|
||||
return nil, err2
|
||||
} else {
|
||||
_dataList = append(_dataList, _v)
|
||||
}
|
||||
}
|
||||
return &GameMainline{_dataList:_dataList}, nil
|
||||
}
|
||||
|
||||
func (table *GameMainline) GetDataList() []*GameMainlineData {
|
||||
return table._dataList
|
||||
}
|
||||
|
||||
func (table *GameMainline) Get(index int) *GameMainlineData {
|
||||
return table._dataList[index]
|
||||
}
|
||||
|
@ -1,160 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <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"
|
||||
import "bright/serialization"
|
||||
|
||||
type GameMainlineData struct {
|
||||
Id int32
|
||||
Intensity int32
|
||||
EndFlag int32
|
||||
Previoustage int32
|
||||
Order int32
|
||||
Chapter int32
|
||||
Episodetype int32
|
||||
MainlineName string
|
||||
Episodelocation serialization.Vector2
|
||||
FormatList []int32
|
||||
CaptainId string
|
||||
BattleReadyID int32
|
||||
Battlescene string
|
||||
Award []*Gameatn
|
||||
Exp int32
|
||||
Title string
|
||||
Desc string
|
||||
Stroyid []int32
|
||||
Condition []int32
|
||||
PsConsume []*Gameatn
|
||||
PsMg []*Gameatn
|
||||
}
|
||||
|
||||
const TypeId_GameMainlineData = -79093005
|
||||
|
||||
func (*GameMainlineData) GetTypeId() int32 {
|
||||
return -79093005
|
||||
}
|
||||
|
||||
func (_v *GameMainlineData)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; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["intensity"].(float64); !_ok_ { err = errors.New("intensity error"); return }; _v.Intensity = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["endFlag"].(float64); !_ok_ { err = errors.New("endFlag error"); return }; _v.EndFlag = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["previoustage"].(float64); !_ok_ { err = errors.New("previoustage error"); return }; _v.Previoustage = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["order"].(float64); !_ok_ { err = errors.New("order error"); return }; _v.Order = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["chapter"].(float64); !_ok_ { err = errors.New("chapter error"); return }; _v.Chapter = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["Episodetype"].(float64); !_ok_ { err = errors.New("Episodetype error"); return }; _v.Episodetype = int32(_tempNum_) }
|
||||
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["mainlineName"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.MainlineName error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.MainlineName, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
|
||||
{ var _ok_ bool; var _v_ map[string]interface{}; if _v_, _ok_ = _buf["Episodelocation"].(map[string]interface{}); !_ok_ { err = errors.New("Episodelocation error"); return }
|
||||
var _x_, _y_ 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_) }
|
||||
_v.Episodelocation = serialization.NewVector2(_x_, _y_)
|
||||
}
|
||||
|
||||
{
|
||||
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; if _v.CaptainId, _ok_ = _buf["captainId"].(string); !_ok_ { err = errors.New("captainId error"); return } }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["BattleReadyID"].(float64); !_ok_ { err = errors.New("BattleReadyID error"); return }; _v.BattleReadyID = int32(_tempNum_) }
|
||||
{ var _ok_ bool; if _v.Battlescene, _ok_ = _buf["battlescene"].(string); !_ok_ { err = errors.New("battlescene error"); return } }
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
if _arr_, _ok_ = _buf["award"].([]interface{}); !_ok_ { err = errors.New("award error"); return }
|
||||
|
||||
_v.Award = 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.Award = append(_v.Award, _list_v_)
|
||||
}
|
||||
}
|
||||
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["exp"].(float64); !_ok_ { err = errors.New("exp error"); return }; _v.Exp = int32(_tempNum_) }
|
||||
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["title"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Title error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Title, _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["desc"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Desc error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Desc, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
if _arr_, _ok_ = _buf["stroyid"].([]interface{}); !_ok_ { err = errors.New("stroyid error"); return }
|
||||
|
||||
_v.Stroyid = 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.Stroyid = append(_v.Stroyid, _list_v_)
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
if _arr_, _ok_ = _buf["condition"].([]interface{}); !_ok_ { err = errors.New("condition error"); return }
|
||||
|
||||
_v.Condition = 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.Condition = append(_v.Condition, _list_v_)
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
if _arr_, _ok_ = _buf["ps_consume"].([]interface{}); !_ok_ { err = errors.New("ps_consume error"); return }
|
||||
|
||||
_v.PsConsume = 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.PsConsume = append(_v.PsConsume, _list_v_)
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
if _arr_, _ok_ = _buf["ps_mg"].([]interface{}); !_ok_ { err = errors.New("ps_mg error"); return }
|
||||
|
||||
_v.PsMg = 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.PsMg = append(_v.PsMg, _list_v_)
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func DeserializeGameMainlineData(_buf map[string]interface{}) (*GameMainlineData, error) {
|
||||
v := &GameMainlineData{}
|
||||
if err := v.Deserialize(_buf); err == nil {
|
||||
return v, nil
|
||||
} else {
|
||||
return nil, err
|
||||
}
|
||||
}
|
@ -41,8 +41,7 @@ type Tables struct {
|
||||
Shopitem *GameShopitem
|
||||
ActiveReward *GameActiveReward
|
||||
Model *GameModel
|
||||
MainlineChapter *GameMainlineChapter
|
||||
Mainline *GameMainline
|
||||
|
||||
DrawCard *GameDrawCard
|
||||
ChatChannel *GameChatChannel
|
||||
ChatSystem *GameChatSystem
|
||||
@ -368,18 +367,6 @@ func NewTables(loader JsonLoader) (*Tables, error) {
|
||||
if tables.Model, err = NewGameModel(buf); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf, err = loader("game_mainlinechapter") ; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if tables.MainlineChapter, err = NewGameMainlineChapter(buf) ; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf, err = loader("game_mainline") ; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if tables.Mainline, err = NewGameMainline(buf) ; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf, err = loader("game_drawcard"); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -1,34 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <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 GameMainlineChapter struct {
|
||||
_dataList []*GameMainlineChapterData
|
||||
}
|
||||
|
||||
func NewGameMainlineChapter(_buf []map[string]interface{}) (*GameMainlineChapter, error) {
|
||||
_dataList := make([]*GameMainlineChapterData, 0, len(_buf))
|
||||
for _, _ele_ := range _buf {
|
||||
if _v, err2 := DeserializeGameMainlineChapterData(_ele_); err2 != nil {
|
||||
return nil, err2
|
||||
} else {
|
||||
_dataList = append(_dataList, _v)
|
||||
}
|
||||
}
|
||||
return &GameMainlineChapter{_dataList:_dataList}, nil
|
||||
}
|
||||
|
||||
func (table *GameMainlineChapter) GetDataList() []*GameMainlineChapterData {
|
||||
return table._dataList
|
||||
}
|
||||
|
||||
func (table *GameMainlineChapter) Get(index int) *GameMainlineChapterData {
|
||||
return table._dataList[index]
|
||||
}
|
||||
|
@ -1,79 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <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 GameMainlineChapterData struct {
|
||||
Id int32
|
||||
Name string
|
||||
Intensity int32
|
||||
Map string
|
||||
Title string
|
||||
Desc string
|
||||
Icon string
|
||||
Text string
|
||||
Episode []int32
|
||||
Award []*Gameatn
|
||||
}
|
||||
|
||||
const TypeId_GameMainlineChapterData = -862442962
|
||||
|
||||
func (*GameMainlineChapterData) GetTypeId() int32 {
|
||||
return -862442962
|
||||
}
|
||||
|
||||
func (_v *GameMainlineChapterData)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; 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["intensity"].(float64); !_ok_ { err = errors.New("intensity error"); return }; _v.Intensity = int32(_tempNum_) }
|
||||
{ var _ok_ bool; if _v.Map, _ok_ = _buf["map"].(string); !_ok_ { err = errors.New("map error"); return } }
|
||||
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["title"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Title error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Title, _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["desc"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Desc error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Desc, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
|
||||
{ var _ok_ bool; if _v.Icon, _ok_ = _buf["icon"].(string); !_ok_ { err = errors.New("icon error"); return } }
|
||||
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["text"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Text error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Text, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
if _arr_, _ok_ = _buf["Episode"].([]interface{}); !_ok_ { err = errors.New("Episode error"); return }
|
||||
|
||||
_v.Episode = 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.Episode = append(_v.Episode, _list_v_)
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
if _arr_, _ok_ = _buf["award"].([]interface{}); !_ok_ { err = errors.New("award error"); return }
|
||||
|
||||
_v.Award = 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.Award = append(_v.Award, _list_v_)
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func DeserializeGameMainlineChapterData(_buf map[string]interface{}) (*GameMainlineChapterData, error) {
|
||||
v := &GameMainlineChapterData{}
|
||||
if err := v.Deserialize(_buf); err == nil {
|
||||
return v, nil
|
||||
} else {
|
||||
return nil, err
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user