Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
1e8873c096
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,18 +0,0 @@
|
||||
[
|
||||
{
|
||||
"key": "star3_click",
|
||||
"value": 2
|
||||
},
|
||||
{
|
||||
"key": "star4_click",
|
||||
"value": 4
|
||||
},
|
||||
{
|
||||
"key": "star5_click",
|
||||
"value": 6
|
||||
},
|
||||
{
|
||||
"key": "progress_bar_time",
|
||||
"value": 10
|
||||
}
|
||||
]
|
@ -1,132 +0,0 @@
|
||||
[
|
||||
{
|
||||
"key": 1,
|
||||
"count": 1,
|
||||
"cost": {
|
||||
"a": "item",
|
||||
"t": "10001",
|
||||
"n": 1
|
||||
},
|
||||
"floor4": 50,
|
||||
"floor5": 100,
|
||||
"floor4cards": 2,
|
||||
"floor5cards": 11
|
||||
},
|
||||
{
|
||||
"key": 2,
|
||||
"count": 10,
|
||||
"cost": {
|
||||
"a": "item",
|
||||
"t": "10001",
|
||||
"n": 10
|
||||
},
|
||||
"floor4": 50,
|
||||
"floor5": 100,
|
||||
"floor4cards": 2,
|
||||
"floor5cards": 11
|
||||
},
|
||||
{
|
||||
"key": 3,
|
||||
"count": 1,
|
||||
"cost": {
|
||||
"a": "item",
|
||||
"t": "10002",
|
||||
"n": 1
|
||||
},
|
||||
"floor4": 50,
|
||||
"floor5": 100,
|
||||
"floor4cards": 2,
|
||||
"floor5cards": 11
|
||||
},
|
||||
{
|
||||
"key": 4,
|
||||
"count": 10,
|
||||
"cost": {
|
||||
"a": "item",
|
||||
"t": "10002",
|
||||
"n": 10
|
||||
},
|
||||
"floor4": 50,
|
||||
"floor5": 100,
|
||||
"floor4cards": 2,
|
||||
"floor5cards": 11
|
||||
},
|
||||
{
|
||||
"key": 5,
|
||||
"count": 1,
|
||||
"cost": {
|
||||
"a": "item",
|
||||
"t": "10003",
|
||||
"n": 1
|
||||
},
|
||||
"floor4": 50,
|
||||
"floor5": 100,
|
||||
"floor4cards": 2,
|
||||
"floor5cards": 11
|
||||
},
|
||||
{
|
||||
"key": 6,
|
||||
"count": 10,
|
||||
"cost": {
|
||||
"a": "item",
|
||||
"t": "10003",
|
||||
"n": 10
|
||||
},
|
||||
"floor4": 50,
|
||||
"floor5": 100,
|
||||
"floor4cards": 2,
|
||||
"floor5cards": 11
|
||||
},
|
||||
{
|
||||
"key": 7,
|
||||
"count": 1,
|
||||
"cost": {
|
||||
"a": "item",
|
||||
"t": "10004",
|
||||
"n": 1
|
||||
},
|
||||
"floor4": 50,
|
||||
"floor5": 100,
|
||||
"floor4cards": 2,
|
||||
"floor5cards": 11
|
||||
},
|
||||
{
|
||||
"key": 8,
|
||||
"count": 10,
|
||||
"cost": {
|
||||
"a": "item",
|
||||
"t": "10004",
|
||||
"n": 10
|
||||
},
|
||||
"floor4": 50,
|
||||
"floor5": 100,
|
||||
"floor4cards": 2,
|
||||
"floor5cards": 11
|
||||
},
|
||||
{
|
||||
"key": 9,
|
||||
"count": 1,
|
||||
"cost": {
|
||||
"a": "item",
|
||||
"t": "10005",
|
||||
"n": 1
|
||||
},
|
||||
"floor4": 50,
|
||||
"floor5": 100,
|
||||
"floor4cards": 2,
|
||||
"floor5cards": 11
|
||||
},
|
||||
{
|
||||
"key": 10,
|
||||
"count": 10,
|
||||
"cost": {
|
||||
"a": "item",
|
||||
"t": "10005",
|
||||
"n": 10
|
||||
},
|
||||
"floor4": 50,
|
||||
"floor5": 100,
|
||||
"floor4cards": 2,
|
||||
"floor5cards": 11
|
||||
}
|
||||
]
|
@ -1,20 +0,0 @@
|
||||
[
|
||||
{
|
||||
"key": 1,
|
||||
"time_on": 934041600,
|
||||
"time_off": 935251200,
|
||||
"up_hero": [
|
||||
"10001",
|
||||
"10002"
|
||||
],
|
||||
"up_weight": [
|
||||
5000,
|
||||
5000
|
||||
],
|
||||
"trigger_num": 50,
|
||||
"Increase_weight": [
|
||||
100,
|
||||
100
|
||||
]
|
||||
}
|
||||
]
|
@ -610,7 +610,7 @@
|
||||
{
|
||||
"id": 10051,
|
||||
"type": 1005,
|
||||
"initial": 0,
|
||||
"initial": 1,
|
||||
"level": 1,
|
||||
"levelname": {
|
||||
"key": "gourmet_ln1",
|
||||
|
21
bin/json/game_pagodaseasonloop.json
Normal file
21
bin/json/game_pagodaseasonloop.json
Normal file
@ -0,0 +1,21 @@
|
||||
[
|
||||
{
|
||||
"key": 2,
|
||||
"disposable_loop": [
|
||||
201,
|
||||
203,
|
||||
202,
|
||||
204,
|
||||
203,
|
||||
202,
|
||||
201,
|
||||
204
|
||||
],
|
||||
"fixed_loop": [
|
||||
201,
|
||||
202,
|
||||
203,
|
||||
204
|
||||
]
|
||||
}
|
||||
]
|
@ -1,66 +0,0 @@
|
||||
[
|
||||
{
|
||||
"rdtaks_id": 1001,
|
||||
"task_type": 2,
|
||||
"rdtaks_num": [
|
||||
101,
|
||||
102
|
||||
],
|
||||
"id_last": [
|
||||
0
|
||||
],
|
||||
"id_after": 1002,
|
||||
"id_tag": 1,
|
||||
"story": 3,
|
||||
"completetask": 0,
|
||||
"reword": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "diamond",
|
||||
"n": 10
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 1000
|
||||
}
|
||||
],
|
||||
"choose_id": [
|
||||
10001,
|
||||
10002,
|
||||
10003
|
||||
]
|
||||
},
|
||||
{
|
||||
"rdtaks_id": 1002,
|
||||
"task_type": 2,
|
||||
"rdtaks_num": [
|
||||
101,
|
||||
104
|
||||
],
|
||||
"id_last": [
|
||||
1001
|
||||
],
|
||||
"id_after": 0,
|
||||
"id_tag": 2,
|
||||
"story": 3,
|
||||
"completetask": 0,
|
||||
"reword": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "diamond",
|
||||
"n": 15
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 1500
|
||||
}
|
||||
],
|
||||
"choose_id": [
|
||||
10011,
|
||||
10012,
|
||||
10013
|
||||
]
|
||||
}
|
||||
]
|
@ -1,38 +0,0 @@
|
||||
[
|
||||
{
|
||||
"choose_id": 10001,
|
||||
"num": 1,
|
||||
"rdtaks_num": 104,
|
||||
"rdtaks_id": 0
|
||||
},
|
||||
{
|
||||
"choose_id": 10002,
|
||||
"num": 2,
|
||||
"rdtaks_num": 105,
|
||||
"rdtaks_id": 1002
|
||||
},
|
||||
{
|
||||
"choose_id": 10003,
|
||||
"num": 3,
|
||||
"rdtaks_num": 0,
|
||||
"rdtaks_id": 0
|
||||
},
|
||||
{
|
||||
"choose_id": 10011,
|
||||
"num": 1,
|
||||
"rdtaks_num": 106,
|
||||
"rdtaks_id": 0
|
||||
},
|
||||
{
|
||||
"choose_id": 10012,
|
||||
"num": 2,
|
||||
"rdtaks_num": 107,
|
||||
"rdtaks_id": 0
|
||||
},
|
||||
{
|
||||
"choose_id": 10013,
|
||||
"num": 3,
|
||||
"rdtaks_num": 0,
|
||||
"rdtaks_id": 0
|
||||
}
|
||||
]
|
228
bin/json/game_rdtaskall.json
Normal file
228
bin/json/game_rdtaskall.json
Normal file
@ -0,0 +1,228 @@
|
||||
[
|
||||
{
|
||||
"id": 1001,
|
||||
"type": 2,
|
||||
"lastend": 0,
|
||||
"rdtaks_num": [
|
||||
101
|
||||
],
|
||||
"aftertaks": 1002,
|
||||
"icetime": 0,
|
||||
"tag": 1,
|
||||
"story": 3,
|
||||
"completetask": 0,
|
||||
"chooseid": [
|
||||
10001,
|
||||
1002,
|
||||
1003
|
||||
],
|
||||
"reword": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "diamond",
|
||||
"n": 10
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 1000
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1002,
|
||||
"type": 2,
|
||||
"lastend": 1001,
|
||||
"rdtaks_num": [
|
||||
101,
|
||||
102
|
||||
],
|
||||
"aftertaks": 1003,
|
||||
"icetime": 0,
|
||||
"tag": 2,
|
||||
"story": 3,
|
||||
"completetask": 0,
|
||||
"chooseid": [
|
||||
10011,
|
||||
10012,
|
||||
10013
|
||||
],
|
||||
"reword": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "diamond",
|
||||
"n": 15
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 1500
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1003,
|
||||
"type": 2,
|
||||
"lastend": 1002,
|
||||
"rdtaks_num": [
|
||||
101,
|
||||
103
|
||||
],
|
||||
"aftertaks": 1004,
|
||||
"icetime": 0,
|
||||
"tag": 1,
|
||||
"story": 3,
|
||||
"completetask": 0,
|
||||
"chooseid": [],
|
||||
"reword": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "diamond",
|
||||
"n": 15
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 1500
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1004,
|
||||
"type": 2,
|
||||
"lastend": 1003,
|
||||
"rdtaks_num": [
|
||||
101,
|
||||
103
|
||||
],
|
||||
"aftertaks": 1005,
|
||||
"icetime": 0,
|
||||
"tag": 1,
|
||||
"story": 3,
|
||||
"completetask": 0,
|
||||
"chooseid": [],
|
||||
"reword": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "diamond",
|
||||
"n": 15
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 1500
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1005,
|
||||
"type": 2,
|
||||
"lastend": 1004,
|
||||
"rdtaks_num": [
|
||||
104,
|
||||
105
|
||||
],
|
||||
"aftertaks": 1006,
|
||||
"icetime": 0,
|
||||
"tag": 1,
|
||||
"story": 3,
|
||||
"completetask": 0,
|
||||
"chooseid": [],
|
||||
"reword": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "diamond",
|
||||
"n": 15
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 1500
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1006,
|
||||
"type": 2,
|
||||
"lastend": 1005,
|
||||
"rdtaks_num": [
|
||||
106
|
||||
],
|
||||
"aftertaks": 0,
|
||||
"icetime": 0,
|
||||
"tag": 1,
|
||||
"story": 3,
|
||||
"completetask": 0,
|
||||
"chooseid": [
|
||||
10021,
|
||||
10022
|
||||
],
|
||||
"reword": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "diamond",
|
||||
"n": 15
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 1500
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1007,
|
||||
"type": 1,
|
||||
"lastend": 0,
|
||||
"rdtaks_num": [
|
||||
107
|
||||
],
|
||||
"aftertaks": 1002,
|
||||
"icetime": 1,
|
||||
"tag": 1,
|
||||
"story": 3,
|
||||
"completetask": 0,
|
||||
"chooseid": [],
|
||||
"reword": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "diamond",
|
||||
"n": 15
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 1500
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1008,
|
||||
"type": 1,
|
||||
"lastend": 0,
|
||||
"rdtaks_num": [
|
||||
108
|
||||
],
|
||||
"aftertaks": 1002,
|
||||
"icetime": -1,
|
||||
"tag": 1,
|
||||
"story": 3,
|
||||
"completetask": 0,
|
||||
"chooseid": [
|
||||
10041,
|
||||
10042
|
||||
],
|
||||
"reword": [
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "diamond",
|
||||
"n": 15
|
||||
},
|
||||
{
|
||||
"a": "attr",
|
||||
"t": "gold",
|
||||
"n": 1500
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
98
bin/json/game_rdtaskchoose.json
Normal file
98
bin/json/game_rdtaskchoose.json
Normal file
@ -0,0 +1,98 @@
|
||||
[
|
||||
{
|
||||
"chooseid": 10001,
|
||||
"num": 1,
|
||||
"rdtaks_num": 101,
|
||||
"need": [
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"chooseid": 10002,
|
||||
"num": 2,
|
||||
"rdtaks_num": 107,
|
||||
"need": [
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"chooseid": 10003,
|
||||
"num": 3,
|
||||
"rdtaks_num": 101,
|
||||
"need": [
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"chooseid": 10011,
|
||||
"num": 1,
|
||||
"rdtaks_num": 101,
|
||||
"need": [
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"chooseid": 10012,
|
||||
"num": 2,
|
||||
"rdtaks_num": 101,
|
||||
"need": [
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"chooseid": 10013,
|
||||
"num": 3,
|
||||
"rdtaks_num": 101,
|
||||
"need": [
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"chooseid": 10021,
|
||||
"num": 1,
|
||||
"rdtaks_num": 101,
|
||||
"need": [
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"chooseid": 10022,
|
||||
"num": 2,
|
||||
"rdtaks_num": 101,
|
||||
"need": [
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"chooseid": 10031,
|
||||
"num": 1,
|
||||
"rdtaks_num": 0,
|
||||
"need": [
|
||||
10012
|
||||
]
|
||||
},
|
||||
{
|
||||
"chooseid": 10032,
|
||||
"num": 2,
|
||||
"rdtaks_num": 0,
|
||||
"need": [
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"chooseid": 10041,
|
||||
"num": 1,
|
||||
"rdtaks_num": 0,
|
||||
"need": [
|
||||
10010
|
||||
]
|
||||
},
|
||||
{
|
||||
"chooseid": 10042,
|
||||
"num": 2,
|
||||
"rdtaks_num": 0,
|
||||
"need": [
|
||||
0
|
||||
]
|
||||
}
|
||||
]
|
@ -13,7 +13,7 @@
|
||||
"typdes": 2,
|
||||
"datatime": 1,
|
||||
"typtask_id": 2,
|
||||
"data1": 10,
|
||||
"data1": 3,
|
||||
"data2": 0,
|
||||
"data3": 0
|
||||
},
|
||||
@ -22,7 +22,7 @@
|
||||
"typdes": 2,
|
||||
"datatime": 1,
|
||||
"typtask_id": 3,
|
||||
"data1": 3,
|
||||
"data1": 2,
|
||||
"data2": 0,
|
||||
"data3": 0
|
||||
},
|
||||
@ -31,44 +31,44 @@
|
||||
"typdes": 2,
|
||||
"datatime": 1,
|
||||
"typtask_id": 4,
|
||||
"data1": 2,
|
||||
"data2": 0,
|
||||
"data1": 90001,
|
||||
"data2": 15,
|
||||
"data3": 0
|
||||
},
|
||||
{
|
||||
"rdtaks_num": 105,
|
||||
"typdes": 2,
|
||||
"datatime": 1,
|
||||
"typtask_id": 5,
|
||||
"data1": 101,
|
||||
"data2": 0,
|
||||
"typtask_id": 4,
|
||||
"data1": 25001,
|
||||
"data2": 10,
|
||||
"data3": 0
|
||||
},
|
||||
{
|
||||
"rdtaks_num": 106,
|
||||
"typdes": 2,
|
||||
"datatime": 1,
|
||||
"typtask_id": 6,
|
||||
"data1": 3,
|
||||
"data2": 0,
|
||||
"typtask_id": 5,
|
||||
"data1": 90001,
|
||||
"data2": 2,
|
||||
"data3": 0
|
||||
},
|
||||
{
|
||||
"rdtaks_num": 107,
|
||||
"typdes": 2,
|
||||
"datatime": 1,
|
||||
"typtask_id": 7,
|
||||
"data1": 10002,
|
||||
"data2": 0,
|
||||
"typtask_id": 4,
|
||||
"data1": 25001,
|
||||
"data2": 20,
|
||||
"data3": 0
|
||||
},
|
||||
{
|
||||
"rdtaks_num": 108,
|
||||
"typdes": 2,
|
||||
"datatime": 1,
|
||||
"typtask_id": 8,
|
||||
"typtask_id": 6,
|
||||
"data1": 90001,
|
||||
"data2": 15,
|
||||
"data2": 5,
|
||||
"data3": 0
|
||||
}
|
||||
]
|
@ -1,30 +0,0 @@
|
||||
[
|
||||
{
|
||||
"id": 1,
|
||||
"ip": "10.0.1.238",
|
||||
"port": 7981,
|
||||
"groupId": 0,
|
||||
"name": "熊猫"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"ip": "10.0.1.239",
|
||||
"port": 7982,
|
||||
"groupId": 0,
|
||||
"name": "野鸡"
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"ip": "10.0.1.237",
|
||||
"port": 7983,
|
||||
"groupId": 0,
|
||||
"name": "鸭子"
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"ip": "10.0.0.9",
|
||||
"port": 7984,
|
||||
"groupId": 0,
|
||||
"name": "乌龟"
|
||||
}
|
||||
]
|
File diff suppressed because it is too large
Load Diff
@ -684,16 +684,16 @@
|
||||
"des": "装备强化"
|
||||
},
|
||||
{
|
||||
"id": "strengthenup",
|
||||
"file": "StrengthenUpWindow",
|
||||
"id": "equistrengthenup",
|
||||
"file": "EquiStrengthenUpPopup",
|
||||
"unloadpkg": 5,
|
||||
"loadtype": 1,
|
||||
"full": 0,
|
||||
"blur": 1,
|
||||
"package": "roledetails/roledetails",
|
||||
"packagename": "roledetails",
|
||||
"comname": "strengthen",
|
||||
"des": "英雄升级升星详情"
|
||||
"comname": "equistrengthenup",
|
||||
"des": "装备强化成功弹窗"
|
||||
},
|
||||
{
|
||||
"id": "croppingwindow",
|
||||
@ -746,7 +746,7 @@
|
||||
{
|
||||
"id": "examine",
|
||||
"file": "ExaminePopup",
|
||||
"unloadpkg": 5,
|
||||
"unloadpkg": 3,
|
||||
"loadtype": 1,
|
||||
"full": 0,
|
||||
"blur": 1,
|
||||
@ -806,7 +806,7 @@
|
||||
{
|
||||
"id": "resonancepopup",
|
||||
"file": "ResonancePopup",
|
||||
"unloadpkg": 5,
|
||||
"unloadpkg": 3,
|
||||
"loadtype": 1,
|
||||
"full": 0,
|
||||
"blur": 1,
|
||||
@ -818,7 +818,7 @@
|
||||
{
|
||||
"id": "materialsynthesispopup",
|
||||
"file": "MaterialSynthesisPopup",
|
||||
"unloadpkg": 5,
|
||||
"unloadpkg": 3,
|
||||
"loadtype": 1,
|
||||
"full": 0,
|
||||
"blur": 1,
|
||||
@ -850,5 +850,77 @@
|
||||
"packagename": "pagoda",
|
||||
"comname": "main",
|
||||
"des": "心魔之塔"
|
||||
},
|
||||
{
|
||||
"id": "pagodaadoptreward",
|
||||
"file": "PagodaAdoptRewardPopup",
|
||||
"unloadpkg": 3,
|
||||
"loadtype": 1,
|
||||
"full": 0,
|
||||
"blur": 0,
|
||||
"package": "pagoda/pagoda",
|
||||
"packagename": "pagoda",
|
||||
"comname": "pagodaadoptreward",
|
||||
"des": "心魔之塔奖励弹窗"
|
||||
},
|
||||
{
|
||||
"id": "pagodalineup",
|
||||
"file": "PagodaLineupPopup",
|
||||
"unloadpkg": 3,
|
||||
"loadtype": 1,
|
||||
"full": 0,
|
||||
"blur": 0,
|
||||
"package": "pagoda/pagoda",
|
||||
"packagename": "pagoda",
|
||||
"comname": "pagodalineup",
|
||||
"des": "心魔之塔推荐阵容弹窗"
|
||||
},
|
||||
{
|
||||
"id": "pagodarankingpopup",
|
||||
"file": "PagodaRankingPopup",
|
||||
"unloadpkg": 3,
|
||||
"loadtype": 1,
|
||||
"full": 0,
|
||||
"blur": 0,
|
||||
"package": "pagoda/pagoda",
|
||||
"packagename": "pagoda",
|
||||
"comname": "pagodaranking",
|
||||
"des": "心魔之塔排行弹窗"
|
||||
},
|
||||
{
|
||||
"id": "pagodaseasonpopup",
|
||||
"file": "PagodaRankingPopup",
|
||||
"unloadpkg": 3,
|
||||
"loadtype": 1,
|
||||
"full": 0,
|
||||
"blur": 0,
|
||||
"package": "pagoda/pagoda",
|
||||
"packagename": "pagoda",
|
||||
"comname": "pagodaranking",
|
||||
"des": "心魔之塔排行弹窗"
|
||||
},
|
||||
{
|
||||
"id": "friendsystemwin",
|
||||
"file": "FriendSystemWindow",
|
||||
"unloadpkg": 2,
|
||||
"loadtype": 1,
|
||||
"full": 1,
|
||||
"blur": 0,
|
||||
"package": "friendsystem/friendsystem",
|
||||
"packagename": "friendsystem",
|
||||
"comname": "main",
|
||||
"des": "好友系统"
|
||||
},
|
||||
{
|
||||
"id": "frienddetailspop",
|
||||
"file": "FriendDetailsPopup",
|
||||
"unloadpkg": 3,
|
||||
"loadtype": 1,
|
||||
"full": 0,
|
||||
"blur": 0,
|
||||
"package": "friendsystem/friendsystem",
|
||||
"packagename": "friendsystem",
|
||||
"comname": "details",
|
||||
"des": "好详细信息"
|
||||
}
|
||||
]
|
@ -88,6 +88,7 @@ const (
|
||||
// toolbar
|
||||
TOOLBAR_MONITOR = "监控"
|
||||
TOOLBAR_TESTER = "接口测试"
|
||||
TOOLBAR_GEN = "生成代码"
|
||||
|
||||
//monitor
|
||||
APP_MONITOR_TITLE_ID = "编号"
|
||||
|
@ -10,7 +10,10 @@ import (
|
||||
"io"
|
||||
"os"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/app"
|
||||
"fyne.io/fyne/v2/container"
|
||||
"fyne.io/fyne/v2/widget"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
@ -18,6 +21,7 @@ var (
|
||||
connService service.ConnService
|
||||
pttService service.PttService
|
||||
configService service.ConfigService
|
||||
dbService service.DbService
|
||||
obs = observer.NewObserver()
|
||||
logger *logrus.Logger
|
||||
)
|
||||
@ -31,6 +35,11 @@ func init() {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
if err = setupDb(); err != nil {
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
// initialize logger
|
||||
if err = setupLogger(); err != nil {
|
||||
fmt.Println(err)
|
||||
@ -53,9 +62,24 @@ func main() {
|
||||
app := app.NewWithID("protocol-test-tool")
|
||||
app.SetIcon(theme.ResourceIconPng)
|
||||
appUI := ui.NewUI(app, configService, connService, pttService, obs)
|
||||
mainWindow := ui.NewMainWindow(appUI)
|
||||
|
||||
mainWindow.CreateWindow(common.APP_NAME, 1366, 768, true)
|
||||
//创建enter
|
||||
w := fyne.CurrentApp().NewWindow("")
|
||||
w.SetContent(container.NewGridWithColumns(2,
|
||||
widget.NewButton("工具", func() {
|
||||
toolWindow := ui.NewToolWindow(appUI)
|
||||
toolWindow.CreateWindow(common.APP_NAME, 1366, 768, true)
|
||||
w.Hide()
|
||||
}),
|
||||
widget.NewButton("登服", func() {
|
||||
mainWindow := ui.NewMainWindow(appUI)
|
||||
mainWindow.CreateWindow(common.APP_NAME, 1366, 768, true)
|
||||
w.Hide()
|
||||
})))
|
||||
w.SetFixedSize(true)
|
||||
w.Resize(fyne.NewSize(300, 100))
|
||||
w.Show()
|
||||
w.CenterOnScreen()
|
||||
logrus.WithField("version", app.Metadata().Version).Info("app starting")
|
||||
appUI.Run()
|
||||
}
|
||||
@ -70,6 +94,11 @@ func setupWsConn() (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func setupDb() (err error) {
|
||||
dbService = service.NewDbService()
|
||||
return
|
||||
}
|
||||
|
||||
func setupConfig() (err error) {
|
||||
configService, err = service.NewConfigService()
|
||||
if err != nil {
|
||||
|
10
cmd/v2/model/gen.go
Normal file
10
cmd/v2/model/gen.go
Normal file
@ -0,0 +1,10 @@
|
||||
package model
|
||||
|
||||
type GenTool struct {
|
||||
ClientDir string
|
||||
InputDir string
|
||||
OutputDir string
|
||||
GenType int32
|
||||
|
||||
|
||||
}
|
61
cmd/v2/service/dbServer.go
Normal file
61
cmd/v2/service/dbServer.go
Normal file
@ -0,0 +1,61 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"go_dreamfactory/cmd/v2/model"
|
||||
"log"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/boltdb/bolt"
|
||||
)
|
||||
|
||||
type DbService interface {
|
||||
Create(conf *model.GenTool) error
|
||||
Update() error
|
||||
}
|
||||
|
||||
type DbServiceImpl struct {
|
||||
}
|
||||
|
||||
func NewDbService() DbService {
|
||||
return &DbServiceImpl{}
|
||||
}
|
||||
|
||||
func (this *DbServiceImpl) Create(conf *model.GenTool) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (this *DbServiceImpl) Update() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
var (
|
||||
boltDb *bolt.DB
|
||||
bucket *bolt.Bucket
|
||||
once sync.Once
|
||||
err error
|
||||
)
|
||||
|
||||
func GetBoltDb() *bolt.DB {
|
||||
once.Do(func() {
|
||||
boltDb, err = bolt.Open("my.db", 0600, &bolt.Options{Timeout: 1 * time.Second})
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
boltDb.Update(func(tx *bolt.Tx) error {
|
||||
b := tx.Bucket([]byte("robotBucket"))
|
||||
if b != nil {
|
||||
bucket = b
|
||||
} else {
|
||||
bucket, err = tx.CreateBucket([]byte("robotBucket"))
|
||||
if err != nil {
|
||||
return fmt.Errorf("create bucket: %s", err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
})
|
||||
})
|
||||
return boltDb
|
||||
}
|
@ -10,10 +10,11 @@ type appContainer struct {
|
||||
appStatusMap map[string]appStatus
|
||||
container.DocTabs
|
||||
obs observer.Observer
|
||||
ai []appInterface
|
||||
}
|
||||
|
||||
func newAppContainer(obs observer.Observer) *appContainer {
|
||||
at := &appContainer{obs: obs}
|
||||
func newAppContainer(ai []appInterface, obs observer.Observer) *appContainer {
|
||||
at := &appContainer{ai: ai, obs: obs}
|
||||
|
||||
at.appStatusMap = make(map[string]appStatus)
|
||||
at.CloseIntercept = at.closeHandle
|
||||
@ -30,7 +31,7 @@ type appStatus struct {
|
||||
}
|
||||
|
||||
func (at *appContainer) closeHandle(tab *container.TabItem) {
|
||||
for _, app := range appRegister {
|
||||
for _, app := range at.ai {
|
||||
if app.GetAppName() == tab.Text {
|
||||
if app.OnClose() {
|
||||
at.Remove(tab)
|
||||
@ -60,7 +61,7 @@ func (at *appContainer) openApp(app appInterface) error {
|
||||
// open default app
|
||||
func (at *appContainer) openDefaultApp() (string, error) {
|
||||
var firstTab *container.TabItem
|
||||
for _, app := range appRegister {
|
||||
for _, app := range at.ai {
|
||||
if app.OpenDefault() {
|
||||
if err := at.initApp(app); err != nil {
|
||||
return app.GetAppName(), err
|
||||
|
146
cmd/v2/ui/app_gen.go
Normal file
146
cmd/v2/ui/app_gen.go
Normal file
@ -0,0 +1,146 @@
|
||||
package ui
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"go_dreamfactory/cmd/v2/lib/common"
|
||||
"go_dreamfactory/cmd/v2/service/observer"
|
||||
"os/exec"
|
||||
"runtime"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/container"
|
||||
"fyne.io/fyne/v2/dialog"
|
||||
"fyne.io/fyne/v2/theme"
|
||||
"fyne.io/fyne/v2/widget"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
type appGen struct {
|
||||
appAdapter
|
||||
|
||||
obs observer.Observer
|
||||
}
|
||||
|
||||
func (this *appGen) LazyInit(obs observer.Observer) error {
|
||||
this.obs = obs
|
||||
|
||||
this.tabItem = container.NewTabItemWithIcon(common.TOOLBAR_GEN, theme.ContentCopyIcon(), nil)
|
||||
|
||||
content := container.NewMax()
|
||||
content.Objects = []fyne.CanvasObject{}
|
||||
|
||||
serverAddr := widget.NewEntry()
|
||||
serverAddr.PlaceHolder = "服务器地址"
|
||||
serverAddr.Text = "10.0.1.11"
|
||||
|
||||
projectDir := widget.NewEntry()
|
||||
projectDir.PlaceHolder = "项目目录"
|
||||
projectDir.Text = "E:\\projects\\workspace\\go_dreamfactory"
|
||||
|
||||
workDir := widget.NewEntry()
|
||||
workDir.PlaceHolder = "LuBan目录"
|
||||
workDir.Text = "E:\\svn\\dreamworks\\client\\dreamworks\\ExcelFile"
|
||||
|
||||
// client
|
||||
client := widget.NewEntry()
|
||||
client.PlaceHolder = "配置Luban Client.exe路径"
|
||||
client.Text = "\\Luban.Client\\Luban.Client.exe"
|
||||
|
||||
//define
|
||||
define := widget.NewEntry()
|
||||
define.PlaceHolder = "定义文件"
|
||||
define.Text = "\\Defines\\__root__.xml"
|
||||
|
||||
// output
|
||||
outputCodeDir := widget.NewEntry()
|
||||
outputCodeDir.Text = "\\sys\\configure\\structs"
|
||||
outputJsonDir := widget.NewEntry()
|
||||
outputJsonDir.Text = "\\bin\\json"
|
||||
|
||||
//input
|
||||
inputDir := widget.NewEntry()
|
||||
inputDir.Text = "\\Datas"
|
||||
|
||||
//genType
|
||||
var genTypeText string
|
||||
genType := widget.NewSelect([]string{"go", "json", "all"}, func(s string) {
|
||||
genTypeText = s
|
||||
})
|
||||
genType.PlaceHolder = "生成类型"
|
||||
|
||||
form := widget.NewForm(
|
||||
widget.NewFormItem("工作目录", workDir),
|
||||
widget.NewFormItem("Client", client),
|
||||
widget.NewFormItem("输入目录", inputDir),
|
||||
widget.NewFormItem("输出Code目录", outputCodeDir),
|
||||
widget.NewFormItem("输出JSON目录", outputJsonDir),
|
||||
widget.NewFormItem("生成类型", genType),
|
||||
)
|
||||
|
||||
getType := func() string {
|
||||
if genTypeText == "" {
|
||||
return ""
|
||||
} else {
|
||||
if genTypeText == "go" {
|
||||
return "code_go_json"
|
||||
} else if genTypeText == "json" {
|
||||
return "data_json"
|
||||
} else if genTypeText == "all" {
|
||||
return "code_go_json,data_json"
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
form.SubmitText = "确定"
|
||||
form.OnSubmit = func() {
|
||||
if runtime.GOOS != "windows" {
|
||||
dialog.ShowError(errors.New("no support "+runtime.GOOS), toolWin.w)
|
||||
return
|
||||
}
|
||||
|
||||
if genTypeText == "" {
|
||||
dialog.ShowError(errors.New("类型未选择"), toolWin.w)
|
||||
return
|
||||
}
|
||||
// service.GetBoltDb().Update(func(tx *bolt.Tx) error {
|
||||
|
||||
// return nil
|
||||
// })
|
||||
str := `%s -h %s -j cfg -- -d %s --input_data_dir %s --output_code_dir %s --output_data_dir %s --gen_types %s --go:bright_module_name bright -s server`
|
||||
|
||||
arg := fmt.Sprintf(str,
|
||||
workDir.Text+client.Text,
|
||||
serverAddr.Text,
|
||||
workDir.Text+define.Text,
|
||||
workDir.Text+inputDir.Text,
|
||||
projectDir.Text+outputCodeDir.Text,
|
||||
projectDir.Text+outputJsonDir.Text,
|
||||
getType(),
|
||||
)
|
||||
|
||||
logrus.Debug(arg)
|
||||
c := exec.Command("cmd.exe", "/c", arg)
|
||||
if err := c.Run(); err != nil {
|
||||
dialog.ShowError(err, toolWin.w)
|
||||
return
|
||||
}
|
||||
}
|
||||
content.Objects = append(content.Objects, form)
|
||||
|
||||
this.tabItem.Content = content
|
||||
return nil
|
||||
}
|
||||
|
||||
func (a *appGen) OpenDefault() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (a *appGen) GetAppName() string {
|
||||
return common.TOOLBAR_GEN
|
||||
}
|
||||
|
||||
func (a appGen) OnClose() bool {
|
||||
return false
|
||||
}
|
@ -19,6 +19,10 @@ var (
|
||||
&appMonitor{},
|
||||
&appTester{},
|
||||
}
|
||||
|
||||
toolRegister = []appInterface{
|
||||
&appGen{},
|
||||
}
|
||||
)
|
||||
|
||||
type appAdapter struct {
|
||||
|
@ -16,6 +16,7 @@ import (
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/container"
|
||||
"fyne.io/fyne/v2/dialog"
|
||||
"fyne.io/fyne/v2/theme"
|
||||
"fyne.io/fyne/v2/widget"
|
||||
"github.com/BabySid/gobase"
|
||||
"github.com/Pallinder/go-randomdata"
|
||||
@ -25,6 +26,7 @@ import (
|
||||
|
||||
var (
|
||||
globalWin *MainWindowImpl
|
||||
toolWin *ToolWindowImpl
|
||||
)
|
||||
|
||||
type MainWindow interface {
|
||||
@ -49,19 +51,6 @@ func NewMainWindow(ui *UIImpl) MainWindow {
|
||||
UIImpl: *ui,
|
||||
}
|
||||
|
||||
// main menu
|
||||
// mw.mm = newMainMenu()
|
||||
// mw.w.SetMainMenu(mw.mm.MainMenu)
|
||||
|
||||
// status bar
|
||||
mw.sb = newStatusBar()
|
||||
|
||||
// tool bar
|
||||
mw.tb = newToolBar()
|
||||
|
||||
// main app tabs
|
||||
mw.at = newAppContainer(ui.obs)
|
||||
|
||||
globalWin = mw
|
||||
|
||||
ui.obs.AddListener(observer.EVENT_PING, observer.Listener{
|
||||
@ -95,13 +84,25 @@ func (ui *MainWindowImpl) createWindowContainer() {
|
||||
ui.sb = newStatusBar()
|
||||
|
||||
// tool bar
|
||||
ui.tb = newToolBar()
|
||||
toolbar := widget.NewToolbar(
|
||||
widget.NewToolbarAction(theme.ComputerIcon(), func() {
|
||||
openApp2(common.TOOLBAR_MONITOR)
|
||||
}),
|
||||
widget.NewToolbarAction(theme.AccountIcon(), func() {
|
||||
openApp2(common.TOOLBAR_TESTER)
|
||||
}),
|
||||
widget.NewToolbarSpacer(),
|
||||
widget.NewToolbarAction(theme.HelpIcon(), func() {
|
||||
showAbout()
|
||||
}),
|
||||
)
|
||||
ui.tb = newToolBar(toolbar)
|
||||
|
||||
// Fun Toys
|
||||
ui.toys = newToys(ui.obs)
|
||||
|
||||
// main app tabs
|
||||
ui.at = newAppContainer(ui.obs)
|
||||
ui.at = newAppContainer(appRegister, ui.obs)
|
||||
content := container.NewBorder(ui.tb.toolbar, ui.sb.widget, nil, ui.toys.widget, ui.at)
|
||||
ui.w.SetContent(content)
|
||||
ui.w.SetCloseIntercept(ui.quiteHandle)
|
||||
@ -238,14 +239,11 @@ func (ui *MainWindowImpl) createChooseServerWindow(
|
||||
|
||||
// createLoginWin
|
||||
func (ui *MainWindowImpl) createLoginWin(sid, sname string) {
|
||||
//form
|
||||
account := widget.NewEntry()
|
||||
account.Text = "user8080" //default account
|
||||
// account.Validator = validation.NewRegexp(`^(\s*)$`, "account required")
|
||||
// password := widget.NewPasswordEntry()
|
||||
// account.Text = "user8080" //default account
|
||||
|
||||
items := []*widget.FormItem{
|
||||
widget.NewFormItem(common.LABEL_ACCOUNT, account),
|
||||
// widget.NewFormItem("password", password),
|
||||
}
|
||||
|
||||
dialog.ShowForm(common.FORM_TITLE_LOGIN, common.BUTTON_LOGIN, common.BUTTON_CANCEL, items, func(b bool) {
|
||||
|
@ -2,9 +2,7 @@ package ui
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"go_dreamfactory/cmd/v2/lib/common"
|
||||
|
||||
"fyne.io/fyne/v2/theme"
|
||||
"fyne.io/fyne/v2/widget"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
@ -13,26 +11,16 @@ type toolBar struct {
|
||||
toolbar *widget.Toolbar
|
||||
}
|
||||
|
||||
func newToolBar() *toolBar {
|
||||
func newToolBar(items *widget.Toolbar) *toolBar {
|
||||
var tb toolBar
|
||||
|
||||
// mainwindow toolbar
|
||||
tb.toolbar = widget.NewToolbar(
|
||||
widget.NewToolbarAction(theme.ComputerIcon(), func() {
|
||||
openApp(common.TOOLBAR_MONITOR)
|
||||
}),
|
||||
widget.NewToolbarAction(theme.AccountIcon(), func() {
|
||||
openApp(common.TOOLBAR_TESTER)
|
||||
}),
|
||||
widget.NewToolbarSpacer(),
|
||||
widget.NewToolbarAction(theme.HelpIcon(), func() {
|
||||
showAbout()
|
||||
}),
|
||||
)
|
||||
tb.toolbar = items
|
||||
return &tb
|
||||
}
|
||||
|
||||
func openApp(name string) {
|
||||
// open app2
|
||||
func openApp2(name string) {
|
||||
for _, app := range appRegister {
|
||||
if app.GetAppName() == name {
|
||||
err := globalWin.at.openApp(app)
|
||||
@ -42,3 +30,14 @@ func openApp(name string) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func openApp1(name string) {
|
||||
for _, app := range toolRegister {
|
||||
if app.GetAppName() == name {
|
||||
err := toolWin.at.openApp(app)
|
||||
if err != nil {
|
||||
logrus.Error(fmt.Errorf("%s %v", app.GetAppName(), err))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
69
cmd/v2/ui/toolwindow.go
Normal file
69
cmd/v2/ui/toolwindow.go
Normal file
@ -0,0 +1,69 @@
|
||||
package ui
|
||||
|
||||
import (
|
||||
"go_dreamfactory/cmd/v2/lib/common"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/container"
|
||||
"fyne.io/fyne/v2/theme"
|
||||
"fyne.io/fyne/v2/widget"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
type ToolWindow interface {
|
||||
WindowInterface
|
||||
}
|
||||
|
||||
type ToolWindowImpl struct {
|
||||
UIImpl
|
||||
w fyne.Window
|
||||
tb *toolBar //工具条
|
||||
sb *statusBar //状态栏
|
||||
at *appContainer //tabs
|
||||
}
|
||||
|
||||
func NewToolWindow(ui *UIImpl) ToolWindow {
|
||||
mw := &ToolWindowImpl{
|
||||
UIImpl: *ui,
|
||||
}
|
||||
|
||||
toolWin = mw
|
||||
|
||||
mw.sb = newStatusBar()
|
||||
|
||||
toolbar := widget.NewToolbar(
|
||||
widget.NewToolbarAction(theme.ContentCopyIcon(), func() {
|
||||
openApp1(common.TOOLBAR_GEN)
|
||||
}),
|
||||
|
||||
widget.NewToolbarSpacer(),
|
||||
widget.NewToolbarAction(theme.HelpIcon(), func() {
|
||||
showAbout()
|
||||
}),
|
||||
)
|
||||
|
||||
mw.tb = newToolBar(toolbar)
|
||||
|
||||
mw.at = newAppContainer(toolRegister, ui.obs)
|
||||
|
||||
return mw
|
||||
}
|
||||
|
||||
func (ui *ToolWindowImpl) CreateWindow(title string, width, height float32, _ bool) {
|
||||
w := ui.app.NewWindow(title)
|
||||
ui.AddWindow("tool", w)
|
||||
ui.w = w
|
||||
|
||||
// content
|
||||
content := container.NewBorder(ui.tb.toolbar, ui.sb.widget,
|
||||
nil, nil, ui.at)
|
||||
ui.w.SetContent(content)
|
||||
appName, err := ui.at.openDefaultApp()
|
||||
if err != nil {
|
||||
logrus.WithField("appName", appName).Error(err)
|
||||
}
|
||||
w.Resize(fyne.NewSize(width, height))
|
||||
w.SetMaster()
|
||||
w.CenterOnScreen()
|
||||
w.Show()
|
||||
}
|
@ -48,6 +48,7 @@ const (
|
||||
ModulePagoda core.M_Modules = "pagoda" //魔塔模块
|
||||
ModuleMartialhall core.M_Modules = "martialhall" //武馆模块
|
||||
ModuleGourmet core.M_Modules = "gourmet" //美食馆
|
||||
ModuleRtask core.M_Modules = "rtask" //随机任务
|
||||
)
|
||||
|
||||
//数据表名定义处
|
||||
@ -96,6 +97,8 @@ const (
|
||||
TableMartialhall = "martialhall"
|
||||
// 美食馆
|
||||
TableGourmet = "gourmet"
|
||||
// 随机任务
|
||||
TableRtask = "rtask"
|
||||
)
|
||||
|
||||
//RPC服务接口定义处
|
||||
@ -158,6 +161,7 @@ const (
|
||||
|
||||
type TaskType int32
|
||||
|
||||
// 日常任务事件类型
|
||||
const (
|
||||
TaskTypeUpEquip TaskType = 101 //任意装备升级
|
||||
TaskTypeUpHeroStar TaskType = 102 //获取星级英雄
|
||||
@ -174,6 +178,16 @@ const (
|
||||
TASK_STRATEGY TaskTag = 4 // 攻略
|
||||
)
|
||||
|
||||
// 随机任务类型
|
||||
const (
|
||||
RtaskTypeHeroTarget TaskType = 1 //英雄指定
|
||||
RtaskTypeHeroLvTarget TaskType = 2 //指定英雄的等级
|
||||
RtaskTypeEquipNum TaskType = 3 //装备数量
|
||||
RtaskTypePoltId TaskType = 4 //剧情ID
|
||||
RtaskTypeTaskDay TaskType = 5 //每日任务
|
||||
|
||||
)
|
||||
|
||||
const (
|
||||
MailLineEasy string = "mainline_data_easy" // 简单
|
||||
MailLineHard string = "mainline_data_hard" // 困难
|
||||
|
@ -102,6 +102,12 @@ type (
|
||||
CleanData(uid string)
|
||||
}
|
||||
|
||||
// 随机任务
|
||||
IRtask interface {
|
||||
//任务触发
|
||||
SendToRtask(session IUserSession, param *pb.RtaskParam) (code pb.ErrorCode)
|
||||
}
|
||||
|
||||
//好友
|
||||
IFriend interface {
|
||||
// 重置点赞列表和每日友情点
|
||||
|
14
go.mod
14
go.mod
@ -9,6 +9,7 @@ require (
|
||||
github.com/Pallinder/go-randomdata v1.2.0
|
||||
github.com/atotto/clipboard v0.1.4
|
||||
github.com/axgle/mahonia v0.0.0-20180208002826-3358181d7394
|
||||
github.com/boltdb/bolt v1.3.1
|
||||
github.com/dengsgo/math-engine v0.0.0-20220213125415-0351c3c75eca
|
||||
github.com/gin-gonic/gin v1.8.1
|
||||
github.com/go-playground/validator/v10 v10.10.1
|
||||
@ -34,7 +35,7 @@ require (
|
||||
github.com/valyala/fastrand v1.1.0
|
||||
go.mongodb.org/mongo-driver v1.5.1
|
||||
go.uber.org/multierr v1.6.0
|
||||
golang.org/x/net v0.0.0-20220407224826-aac1ed45d8e3
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b
|
||||
google.golang.org/protobuf v1.28.0
|
||||
gopkg.in/yaml.v2 v2.4.0
|
||||
)
|
||||
@ -155,7 +156,7 @@ require (
|
||||
github.com/xdg-go/stringprep v1.0.2 // indirect
|
||||
github.com/xtaci/kcp-go v5.4.20+incompatible // indirect
|
||||
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
|
||||
github.com/yuin/goldmark v1.4.1 // indirect
|
||||
github.com/yuin/goldmark v1.4.13 // indirect
|
||||
github.com/yusufpapurcu/wmi v1.2.2 // indirect
|
||||
go.opentelemetry.io/otel v1.6.3 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.6.3 // indirect
|
||||
@ -164,12 +165,11 @@ require (
|
||||
golang.org/x/crypto v0.0.0-20220408190544-5352b0902921 // indirect
|
||||
golang.org/x/image v0.0.0-20220601225756-64ec528b34cd // indirect
|
||||
golang.org/x/mobile v0.0.0-20211207041440-4e6c2922fdee // indirect
|
||||
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
|
||||
golang.org/x/sys v0.0.0-20220712014510-0a85c31ab51e // indirect
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
|
||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
|
||||
golang.org/x/text v0.3.7 // indirect
|
||||
golang.org/x/tools v0.1.10 // indirect
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
|
||||
golang.org/x/tools v0.1.12 // indirect
|
||||
gopkg.in/ini.v1 v1.62.0 // indirect
|
||||
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
|
||||
|
21
go.sum
21
go.sum
@ -92,6 +92,8 @@ github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+Ce
|
||||
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
||||
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
|
||||
github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM=
|
||||
github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4=
|
||||
github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps=
|
||||
github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g=
|
||||
github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s=
|
||||
github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=
|
||||
@ -766,8 +768,9 @@ github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||
github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||
github.com/yuin/goldmark v1.4.1 h1:/vn0k+RBvwlxEmP5E7SZMqNxPhfMVFEJiykr15/0XKM=
|
||||
github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||
github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE=
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg=
|
||||
github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
|
||||
go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs=
|
||||
@ -865,8 +868,9 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 h1:kQgndtyPBW/JIYERgdxfwMYh3AVStj88WQTlNDi2a+o=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
@ -921,8 +925,9 @@ golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qx
|
||||
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20220407224826-aac1ed45d8e3 h1:EN5+DfgmRMvRUrMGERW2gQl3Vc+Z7ZMnI/xdEpPSf0c=
|
||||
golang.org/x/net v0.0.0-20220407224826-aac1ed45d8e3/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b h1:PxfKdU9lEEDYjdIzOtC4qFWgkU2rGHdKlKowJSMN9h0=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
@ -949,8 +954,9 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ
|
||||
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
@ -1028,8 +1034,8 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc
|
||||
golang.org/x/sys v0.0.0-20220111092808-5a964db01320/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220408201424-a24fb2fb8a0f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220712014510-0a85c31ab51e h1:NHvCuwuS43lGnYhten69ZWqi2QOj/CiDNcKbVqwVoew=
|
||||
golang.org/x/sys v0.0.0-20220712014510-0a85c31ab51e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s=
|
||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
@ -1114,8 +1120,9 @@ golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
golang.org/x/tools v0.1.6-0.20210726203631-07bc1bf47fb2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
golang.org/x/tools v0.1.8-0.20211022200916-316ba0b74098/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo=
|
||||
golang.org/x/tools v0.1.8/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU=
|
||||
golang.org/x/tools v0.1.10 h1:QjFRCZxdOhBJ/UNgnBZLbNV13DlbnK0quyivTnXJM20=
|
||||
golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E=
|
||||
golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
|
@ -93,6 +93,6 @@ func (this *apiComp) Send(session comm.IUserSession, req *pb.ChatSendReq) (code
|
||||
this.module.PushToUsers(userexpand.Chatchannel, msg)
|
||||
break
|
||||
}
|
||||
session.SendMsg(string(this.module.GetType()), "send", &pb.ChatSendResp{})
|
||||
session.SendMsg(string(this.module.GetType()), "send", &pb.ChatSendResp{Issucc: true})
|
||||
return
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ func (this *apiComp) Addblack(session comm.IUserSession, req *pb.FriendBlackAddR
|
||||
}
|
||||
|
||||
// 判断是否黑名单人数已满
|
||||
if len(self.BlackIds) >= this.moduleFriend.getBlackMax() {
|
||||
if len(self.BlackIds) >= int(this.moduleFriend.configure.GetGlobalConf().FriendBlack) {
|
||||
code = pb.ErrorCode_FriendBlackMax
|
||||
return
|
||||
}
|
||||
|
@ -63,13 +63,13 @@ func (this *apiComp) Apply(session comm.IUserSession, req *pb.FriendApplyReq) (c
|
||||
}
|
||||
|
||||
//判断是否超过最大好友数量
|
||||
if len(self.FriendIds) >= this.moduleFriend.getFriendMax() {
|
||||
if len(self.FriendIds) >= int(this.moduleFriend.configure.GetGlobalConf().FriendMaxnum) {
|
||||
code = pb.ErrorCode_FriendSelfMax
|
||||
return
|
||||
}
|
||||
|
||||
//判断对方是否也超过最大好友数量
|
||||
if len(target.FriendIds) >= this.moduleFriend.getFriendMax() {
|
||||
if len(target.FriendIds) >= int(this.moduleFriend.configure.GetGlobalConf().FriendMaxnum) {
|
||||
code = pb.ErrorCode_FriendTargetMax
|
||||
return
|
||||
}
|
||||
|
@ -45,6 +45,8 @@ func (this *apiComp) ApplyList(session comm.IUserSession, req *pb.FriendApplyLis
|
||||
list = append(list, &pb.FriendBase{
|
||||
UserId: userId,
|
||||
NickName: user.Name,
|
||||
Level: user.Lv,
|
||||
Avatar: user.Avatar,
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -44,6 +44,8 @@ func (this *apiComp) List(session comm.IUserSession, req *pb.FriendListReq) (cod
|
||||
list = append(list, &pb.FriendBase{
|
||||
UserId: userId,
|
||||
NickName: user.Name,
|
||||
Level: user.Lv,
|
||||
Avatar: user.Avatar,
|
||||
})
|
||||
}
|
||||
|
||||
|
33
modules/friend/api_randlist.go
Normal file
33
modules/friend/api_randlist.go
Normal file
@ -0,0 +1,33 @@
|
||||
package friend
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/pb"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
func (this *apiComp) RandlistCheck(session comm.IUserSession, req *pb.FriendOnlineReq) (code pb.ErrorCode) {
|
||||
return
|
||||
}
|
||||
|
||||
func (this *apiComp) Randlist(session comm.IUserSession, req *pb.FriendOnlineReq) (code pb.ErrorCode, data proto.Message) {
|
||||
var (
|
||||
self *pb.DBFriend
|
||||
)
|
||||
//在线玩家
|
||||
|
||||
self = this.moduleFriend.modelFriend.GetFriend(session.GetUserId())
|
||||
if self == nil {
|
||||
code = pb.ErrorCode_FriendSelfNoData
|
||||
return
|
||||
}
|
||||
|
||||
// 好友列表
|
||||
// self.FriendIds
|
||||
|
||||
// 已申请的好友
|
||||
// self.ApplyIds
|
||||
|
||||
return
|
||||
}
|
@ -56,7 +56,7 @@ func (this *apiComp) Zan(session comm.IUserSession, req *pb.FriendZanReq) (code
|
||||
}
|
||||
|
||||
// 今日送出的友情点是否达到上限
|
||||
if ue.FriendPointOD >= int32(this.moduleFriend.getOutFriendPointMax()) {
|
||||
if ue.FriendPointOD >= this.moduleFriend.configure.GetGlobalConf().FriendMaxsendnum {
|
||||
code = pb.ErrorCode_FriendPointLimit
|
||||
return
|
||||
}
|
||||
|
@ -56,13 +56,13 @@ func (this *apiComp) Zanreceive(session comm.IUserSession, req *pb.FriendZanrece
|
||||
}
|
||||
|
||||
// 今日获赠的友情点是否达到上限
|
||||
if ue.FriendPointID >= int32(this.moduleFriend.getInFriendPointMax()) {
|
||||
if ue.FriendPointID >= int32(this.moduleFriend.configure.GetGlobalConf().FriendMaxgetnum) {
|
||||
code = pb.ErrorCode_FriendPointLimit
|
||||
return
|
||||
}
|
||||
|
||||
update := map[string]interface{}{
|
||||
"friendPoint": ue.FriendPoint + 10,
|
||||
"friendPoint": ue.FriendPoint + 10,
|
||||
"friendPointID": ue.FriendPointID + 10,
|
||||
}
|
||||
if err := this.moduleFriend.ModuleUser.ChangeUserExpand(session.GetUserId(), update); err != nil {
|
||||
|
@ -36,38 +36,6 @@ func (this *Friend) OnInstallComp() {
|
||||
this.modelFriend = this.RegisterComp(new(ModelFriend)).(*ModelFriend)
|
||||
}
|
||||
|
||||
//获取最大好友数
|
||||
func (this *Friend) getFriendMax() int {
|
||||
// if maxHy := this.configure.GetGlobalConf("friend_maxnum"); maxHy != "" {
|
||||
// return cast.ToInt(maxHy)
|
||||
// }
|
||||
return 0
|
||||
}
|
||||
|
||||
//获取最大黑名单数
|
||||
func (this *Friend) getBlackMax() int {
|
||||
// if maxHy := this.configure.GetGlobalConf("friend_black"); maxHy != "" {
|
||||
// return cast.ToInt(maxHy)
|
||||
// }
|
||||
return 0
|
||||
}
|
||||
|
||||
// 每日最大送出友情点
|
||||
func (this *Friend) getOutFriendPointMax() int {
|
||||
// if max := this.configure.GetGlobalConf("friend_maxsendnum"); max != "" {
|
||||
// return cast.ToInt(max)
|
||||
// }
|
||||
return 0
|
||||
}
|
||||
|
||||
// 每日最大获赠友情点
|
||||
func (this *Friend) getInFriendPointMax() int {
|
||||
// if max := this.configure.GetGlobalConf("friend_maxsendnum"); max != "" {
|
||||
// return cast.ToInt(max)
|
||||
// }
|
||||
return 0
|
||||
}
|
||||
|
||||
func (this *Friend) ResetFriend(uid string) {
|
||||
// 重置点赞列表
|
||||
zanUpdate := map[string]interface{}{
|
||||
|
@ -8,6 +8,7 @@ import (
|
||||
const (
|
||||
GourmetGetListResp = "getlist"
|
||||
GourmetCreateOrderResp = "createorder"
|
||||
GourmetSkillLvResp = "skilllv"
|
||||
PagodaGetRewardResp = "getreward"
|
||||
)
|
||||
|
||||
|
@ -24,6 +24,7 @@ func (this *apiComp) CreateOrder(session comm.IUserSession, req *pb.GourmetCreat
|
||||
res []*cfg.Gameatn
|
||||
costTime int32
|
||||
)
|
||||
|
||||
code = this.CreateOrderCheck(session, req)
|
||||
if code != pb.ErrorCode_Success {
|
||||
return // 参数校验失败直接返回
|
||||
@ -38,10 +39,9 @@ func (this *apiComp) CreateOrder(session comm.IUserSession, req *pb.GourmetCreat
|
||||
if order.FoodCount == 0 {
|
||||
continue
|
||||
}
|
||||
foodtype := order.FoodType //
|
||||
foodtype := order.FoodType
|
||||
// 获取技能等级
|
||||
skillLv := _gourmet.Skill[foodtype]
|
||||
|
||||
// 计算出需要的时间
|
||||
_skillCfg := this.module.configure.GetGourmetSkillConfigData(foodtype, skillLv)
|
||||
costTime += _skillCfg.Needtime * order.FoodCount
|
||||
@ -49,15 +49,21 @@ func (this *apiComp) CreateOrder(session comm.IUserSession, req *pb.GourmetCreat
|
||||
if _gourmet.Foods == nil { // 队列数据为nil 直接将订单数据给ta
|
||||
_gourmet.Foods = req.Order
|
||||
} else {
|
||||
for _, v := range _gourmet.Foods {
|
||||
for _, v1 := range req.Order {
|
||||
for _, v := range req.Order {
|
||||
bFound := false
|
||||
for _, v1 := range _gourmet.Foods {
|
||||
if v.FoodType == v1.FoodType {
|
||||
v.FoodCount += v1.FoodCount // 加对应的数量
|
||||
v1.FoodCount += v.FoodCount // 加对应的数量
|
||||
bFound = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !bFound {
|
||||
_gourmet.Foods = append(_gourmet.Foods, v)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if _gourmet.CookingFood == nil || (_gourmet.CookingFood != nil && _gourmet.CookingFood.ETime == 0) {
|
||||
for _, v := range _gourmet.Foods {
|
||||
if v.FoodCount > 0 {
|
||||
@ -71,6 +77,14 @@ func (this *apiComp) CreateOrder(session comm.IUserSession, req *pb.GourmetCreat
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// 計算耗時
|
||||
for _, v := range _gourmet.Foods {
|
||||
if v.FoodCount > 0 {
|
||||
_skillCfg := this.module.configure.GetGourmetSkillConfigData(v.FoodType, _gourmet.Skill[v.FoodType])
|
||||
v.CookTime = _skillCfg.Needtime * v.FoodCount
|
||||
}
|
||||
}
|
||||
if _gourmet.CookingFood != nil && _gourmet.CookingFood.ETime == 0 {
|
||||
_gourmet.CookingFood = nil
|
||||
|
74
modules/gourmet/api_foodskilllv.go
Normal file
74
modules/gourmet/api_foodskilllv.go
Normal file
@ -0,0 +1,74 @@
|
||||
package gourmet
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/pb"
|
||||
"math/big"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
//参数校验
|
||||
func (this *apiComp) SkillLVCheck(session comm.IUserSession, req *pb.GourmetSkillLvReq) (code pb.ErrorCode) {
|
||||
if req.SkillType == 0 {
|
||||
code = pb.ErrorCode_ReqParameterError
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
///美食城厨师技能升级
|
||||
func (this *apiComp) SkillLV(session comm.IUserSession, req *pb.GourmetSkillLvReq) (code pb.ErrorCode, dat proto.Message) {
|
||||
var (
|
||||
bSpecial bool // 是不是特殊技能
|
||||
)
|
||||
code = this.SkillLVCheck(session, req)
|
||||
if code != pb.ErrorCode_Success {
|
||||
return // 参数校验失败直接返回
|
||||
}
|
||||
_gourmet, err := this.module.modelGourmet.getGourmetList(session.GetUserId())
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_DBError
|
||||
return
|
||||
}
|
||||
|
||||
skilllv, ok := _gourmet.Skill[req.SkillType]
|
||||
if !ok { // 校验技能存不存在
|
||||
skilllv, ok = _gourmet.SpecialSkill[req.SkillType]
|
||||
if !ok {
|
||||
code = pb.ErrorCode_ReqParameterError
|
||||
return
|
||||
}
|
||||
bSpecial = true
|
||||
}
|
||||
|
||||
if this.module.configure.GetGourmetSkillConfigData(req.SkillType, skilllv+1) == nil { // 下一级是否存在
|
||||
code = pb.ErrorCode_GourmetSkillMaxLv
|
||||
return
|
||||
}
|
||||
_skillCfg := this.module.configure.GetGourmetSkillConfigData(req.SkillType, skilllv) // 获取技能配置
|
||||
|
||||
// code = this.module.CheckRes(session, _skillCfg.Consume) // 消耗检测
|
||||
// if code != pb.ErrorCode_Success {
|
||||
// return
|
||||
// }
|
||||
code = this.module.ConsumeRes(session, _skillCfg.Consume, true) // 消耗检测
|
||||
if code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
// 概率升级
|
||||
n, _ := rand.Int(rand.Reader, big.NewInt(1000))
|
||||
|
||||
if n.Int64() < int64(_skillCfg.Probability) { // 可以升级
|
||||
// 技能升级成功
|
||||
if bSpecial { // 通用技能升级
|
||||
_gourmet.SpecialSkill[req.SkillType] += 1
|
||||
this.module.modelGourmet.CalculationSpecialSkillLv(session.GetUserId(), _gourmet, req.SkillType, _gourmet.SpecialSkill[req.SkillType])
|
||||
} else { // 某一类型技能升级
|
||||
_gourmet.Skill[req.SkillType] += 1
|
||||
this.module.modelGourmet.CalculationGourmetbySkiiLv(session.GetUserId(), _gourmet, req.SkillType, _gourmet.Skill[req.SkillType])
|
||||
}
|
||||
}
|
||||
session.SendMsg(string(this.module.GetType()), GourmetSkillLvResp, &pb.GourmetSkillLvResp{Data: _gourmet})
|
||||
return
|
||||
}
|
@ -20,6 +20,6 @@ func (this *apiComp) GetReward(session comm.IUserSession, req *pb.GourmetGetRewa
|
||||
if code != pb.ErrorCode_Success {
|
||||
return // 参数校验失败直接返回
|
||||
}
|
||||
|
||||
code = pb.ErrorCode_AgentUidEmpty
|
||||
return
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.GourmetGetListRe
|
||||
return
|
||||
}
|
||||
// 计算订单信息
|
||||
this.module.modelGourmet.CalculationGourmet(_gourmet)
|
||||
this.module.modelGourmet.CalculationGourmet(session.GetUserId(), _gourmet)
|
||||
session.SendMsg(string(this.module.GetType()), GourmetGetListResp, &pb.GourmetGetListResp{Data: _gourmet})
|
||||
return
|
||||
}
|
||||
|
@ -1,25 +0,0 @@
|
||||
package gourmet
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/pb"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
//参数校验
|
||||
func (this *apiComp) SkillLvCheck(session comm.IUserSession, req *pb.GourmetSkillLvReq) (code pb.ErrorCode) {
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
///美食城领取奖励
|
||||
func (this *apiComp) SkillLv(session comm.IUserSession, req *pb.GourmetSkillLvReq) (code pb.ErrorCode, data proto.Message) {
|
||||
|
||||
code = this.SkillLvCheck(session, req)
|
||||
if code != pb.ErrorCode_Success {
|
||||
return // 参数校验失败直接返回
|
||||
}
|
||||
|
||||
return
|
||||
}
|
@ -7,6 +7,8 @@ import (
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/pb"
|
||||
"time"
|
||||
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
)
|
||||
|
||||
type modelGourmet struct {
|
||||
@ -26,13 +28,15 @@ func (this *modelGourmet) getGourmetList(uid string) (result *pb.DBGourmet, err
|
||||
result = &pb.DBGourmet{}
|
||||
if err = this.Get(uid, result); err != nil {
|
||||
if redis.RedisNil != err { // 没有数据直接创建新的数据
|
||||
result.Id = primitive.NewObjectID().Hex()
|
||||
result.Uid = uid
|
||||
result.Skill = make(map[int32]int32, 0)
|
||||
result.Skill[10011] = 1
|
||||
result.Skill[10021] = 1
|
||||
result.Skill[10031] = 1
|
||||
result.Skill[10041] = 1 // 需要后续查询初始为1 的技能id 临时push
|
||||
result.ProductionSkill = 10051 // 通用技能
|
||||
result.Skill[1001] = 1
|
||||
result.Skill[1002] = 1
|
||||
result.Skill[1003] = 1
|
||||
result.Skill[1004] = 1 // 需要后续查询初始为1 的技能id 临时push
|
||||
result.SpecialSkill = make(map[int32]int32, 0)
|
||||
result.SpecialSkill[1005] = 1 // 通用技能
|
||||
if err = this.Add(uid, result); err != nil {
|
||||
this.module.Errorf("err:%v", err)
|
||||
err = nil
|
||||
@ -54,18 +58,22 @@ func GetDropReward(count, dropId int32) (res []*pb.UserAssets) {
|
||||
}
|
||||
|
||||
// 计算订单信息
|
||||
func (this *modelGourmet) CalculationGourmet(gourmet *pb.DBGourmet) {
|
||||
func (this *modelGourmet) CalculationGourmet(uid string, gourmet *pb.DBGourmet) {
|
||||
var (
|
||||
bCooking bool
|
||||
costTime int32
|
||||
curTime int32
|
||||
)
|
||||
if gourmet.CookingFood != nil && gourmet.CookingFood.ETime == 0 {
|
||||
mapData := make(map[string]interface{}, 0)
|
||||
if gourmet.CookingFood != nil && gourmet.CookingFood.ETime > 0 {
|
||||
costTime = int32(time.Now().Unix() - gourmet.CookingFood.ETime) // 当前过去的时间
|
||||
if costTime < 0 { // 没有完成 不做处理
|
||||
return
|
||||
}
|
||||
}
|
||||
if gourmet.CookingFood == nil {
|
||||
gourmet.CookingFood = &pb.Cooking{}
|
||||
}
|
||||
for _, order := range gourmet.Foods {
|
||||
if order.FoodCount == 0 {
|
||||
continue
|
||||
@ -77,8 +85,12 @@ func (this *modelGourmet) CalculationGourmet(gourmet *pb.DBGourmet) {
|
||||
// 计算出需要的时间
|
||||
_skillCfg := this.module.configure.GetGourmetSkillConfigData(foodtype, skillLv) // 技能配置表
|
||||
_gourmetcfg := this.module.configure.GetGourmetConfigData(foodtype, skillLv) // 美食家配置表
|
||||
for i := 1; i < int(order.FoodCount+1); i++ {
|
||||
curTime += _skillCfg.Needtime //* order.FoodCount
|
||||
for i := 0; i < int(order.FoodCount); i++ {
|
||||
curTime += _skillCfg.Needtime
|
||||
order.FoodCount--
|
||||
gourmet.Items = GetDropReward(_gourmetcfg.Using, _gourmetcfg.Propsgroup)
|
||||
// 累计时间也减少
|
||||
|
||||
if curTime > costTime {
|
||||
// 转时间戳
|
||||
eTimd := time.Now().Unix() + int64(curTime-costTime)
|
||||
@ -88,15 +100,58 @@ func (this *modelGourmet) CalculationGourmet(gourmet *pb.DBGourmet) {
|
||||
|
||||
// 记录下订单时间
|
||||
gourmet.Ctime = time.Now().Unix()
|
||||
mapData["ctime"] = gourmet.Ctime
|
||||
break
|
||||
}
|
||||
order.FoodCount--
|
||||
gourmet.Items = GetDropReward(_gourmetcfg.Using, _gourmetcfg.Propsgroup)
|
||||
// 累计时间也减少
|
||||
gourmet.OrderCostTime += curTime
|
||||
}
|
||||
if bCooking { // 分配了正在製作的食物
|
||||
break
|
||||
}
|
||||
}
|
||||
if !bCooking { // 经过计算没有烹饪食物的时候
|
||||
gourmet.CookingFood = nil
|
||||
}
|
||||
|
||||
// 保存信息
|
||||
mapData["foods"] = gourmet.Foods
|
||||
mapData["orderCostTime"] = gourmet.OrderCostTime
|
||||
mapData["cookingFood"] = gourmet.CookingFood // 正在做的
|
||||
this.module.ModifyGourmetData(uid, mapData)
|
||||
}
|
||||
|
||||
// 技能等级提高了 重新计算订单时间(只对订单中数据有影响)
|
||||
func (this *modelGourmet) CalculationGourmetbySkiiLv(uid string, gourmet *pb.DBGourmet, skillType int32, skilllv int32) {
|
||||
mapData := make(map[string]interface{}, 0)
|
||||
for _, v := range gourmet.Foods {
|
||||
if v.FoodCount > 0 && v.FoodType == skillType {
|
||||
_skillCfg := this.module.configure.GetGourmetSkillConfigData(skillType, skilllv)
|
||||
if _skillCfg != nil {
|
||||
v.CookTime = _skillCfg.Needtime * v.FoodCount
|
||||
mapData["foods"] = gourmet.Foods
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
mapData["skill"] = gourmet.Skill
|
||||
this.module.ModifyGourmetData(uid, mapData)
|
||||
}
|
||||
|
||||
// 升级高效制作技能重计算时间消耗
|
||||
func (this *modelGourmet) CalculationSpecialSkillLv(uid string, gourmet *pb.DBGourmet, skillType int32, skilllv int32) {
|
||||
mapData := make(map[string]interface{}, 0)
|
||||
for _, v := range gourmet.Foods {
|
||||
if v.FoodCount > 0 {
|
||||
_skillCfg := this.module.configure.GetGourmetSkillConfigData(skillType, skilllv)
|
||||
if _skillCfg != nil {
|
||||
v.CookTime += _skillCfg.Needtime * v.FoodCount
|
||||
if v.CookTime < 0 { // 担心配置错误 为负数情况 所以这里做下判断
|
||||
v.CookTime = 0
|
||||
}
|
||||
mapData["foods"] = gourmet.Foods
|
||||
}
|
||||
}
|
||||
}
|
||||
mapData["specialSkill"] = gourmet.SpecialSkill
|
||||
this.module.ModifyGourmetData(uid, mapData)
|
||||
}
|
||||
|
@ -38,20 +38,18 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp
|
||||
|
||||
err = this.MCompConfigure.Init(service, module, comp, options)
|
||||
err = this.LoadMultiConfigure(map[string]interface{}{
|
||||
new_hero: cfg.NewGamehero,
|
||||
hero_stargrow: cfg.NewGameheroStargrow,
|
||||
hero_levelgrow: cfg.NewGameheroLevelgrow,
|
||||
hero_starup: cfg.NewGameheroStarup,
|
||||
hero_levelup: cfg.NewGameheroLevelup,
|
||||
hero_exp: cfg.NewGameheroExp,
|
||||
hero_skillup: cfg.NewGameheroSkillLevel,
|
||||
game_skillatk: cfg.NewGameskillAtk,
|
||||
hero_resonance: cfg.NewGameheroResonance,
|
||||
hero_comatn: cfg.NewGamecomAtn,
|
||||
hero_awaken: cfg.NewGameheroAwaken,
|
||||
hero_drawcard: cfg.NewGamedrawCard,
|
||||
hero_drawupdraw: cfg.NewGame_drawUpdraw,
|
||||
//hero_drawcost: cfg.NewGamedrawCost,
|
||||
new_hero: cfg.NewGamehero,
|
||||
hero_stargrow: cfg.NewGameheroStargrow,
|
||||
hero_levelgrow: cfg.NewGameheroLevelgrow,
|
||||
hero_starup: cfg.NewGameheroStarup,
|
||||
hero_levelup: cfg.NewGameheroLevelup,
|
||||
hero_exp: cfg.NewGameheroExp,
|
||||
hero_skillup: cfg.NewGameheroSkillLevel,
|
||||
game_skillatk: cfg.NewGameskillAtk,
|
||||
hero_resonance: cfg.NewGameheroResonance,
|
||||
hero_comatn: cfg.NewGamecomAtn,
|
||||
hero_awaken: cfg.NewGameheroAwaken,
|
||||
hero_drawcard: cfg.NewGamedrawCard,
|
||||
})
|
||||
this.drawCardCfg = make(map[string]map[int32][]*cfg.GamedrawCardData, 0)
|
||||
|
||||
@ -383,21 +381,3 @@ func (this *configureComp) GetHeroAwakenConfig() (configure *cfg.GameheroAwaken,
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// 抽卡概率提高
|
||||
func (this *configureComp) GetDrawUpDrawConfig() (configure *cfg.Game_drawUpdraw, err error) {
|
||||
var (
|
||||
v interface{}
|
||||
ok bool
|
||||
)
|
||||
if v, err = this.GetConfigure(hero_drawupdraw); err == nil {
|
||||
if configure, ok = v.(*cfg.Game_drawUpdraw); !ok {
|
||||
err = fmt.Errorf("%T no is *cfg.Game_drawUpdraw", v)
|
||||
return
|
||||
}
|
||||
} else {
|
||||
err = fmt.Errorf("%T no is *cfg.Game_drawUpdraw", v)
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
29
modules/rtask/api.go
Normal file
29
modules/rtask/api.go
Normal file
@ -0,0 +1,29 @@
|
||||
package rtask
|
||||
|
||||
import (
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/modules"
|
||||
)
|
||||
|
||||
const (
|
||||
RtaskSubTypeChoose = "choose" //选择
|
||||
)
|
||||
|
||||
type apiComp struct {
|
||||
modules.MCompGate
|
||||
service core.IService
|
||||
moduleRtask *ModuleRtask
|
||||
}
|
||||
|
||||
//组件初始化接口
|
||||
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.moduleRtask = module.(*ModuleRtask)
|
||||
this.service = service
|
||||
return
|
||||
}
|
||||
|
||||
func (this *apiComp) Start() (err error) {
|
||||
err = this.MCompGate.Start()
|
||||
return
|
||||
}
|
56
modules/rtask/api_choose.go
Normal file
56
modules/rtask/api_choose.go
Normal file
@ -0,0 +1,56 @@
|
||||
package rtask
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/pb"
|
||||
"go_dreamfactory/utils"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
func (this *apiComp) ChooseCheck(session comm.IUserSession, req *pb.RtaskChooseReq) (code pb.ErrorCode) {
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func (this *apiComp) Choose(session comm.IUserSession, req *pb.RtaskChooseReq) (code pb.ErrorCode, data proto.Message) {
|
||||
if code = this.ChooseCheck(session, req); code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
|
||||
rtask := &pb.DBRtask{}
|
||||
if err := this.moduleRtask.modelRtask.Get(session.GetUserId(), rtask); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
// 是否已完成
|
||||
if _, ok := utils.Findx(rtask.FrtaskIds, req.RtaskId); !ok {
|
||||
code = pb.ErrorCode_RtaskUnFinished
|
||||
return
|
||||
}
|
||||
|
||||
// 获取当前任务配置
|
||||
conf := this.moduleRtask.configure.getRtaskById(req.RtaskId)
|
||||
if conf == nil {
|
||||
code = pb.ErrorCode_ConfigNoFound
|
||||
return
|
||||
}
|
||||
|
||||
// var nextTaskId int32
|
||||
if req.ChooseId == 0 {
|
||||
//读任务配置中的next taskId
|
||||
// nextTaskId = conf.IdAfter
|
||||
} else {
|
||||
// nextTaskId =
|
||||
}
|
||||
|
||||
//发奖励
|
||||
code = this.moduleRtask.DispenseRes(session, conf.Reword, true)
|
||||
|
||||
rsp := &pb.RtaskChooseResp{}
|
||||
|
||||
if err := session.SendMsg(string(this.moduleRtask.GetType()), RtaskSubTypeChoose, rsp); err != nil {
|
||||
code = pb.ErrorCode_SystemError
|
||||
}
|
||||
return
|
||||
}
|
116
modules/rtask/config.go
Normal file
116
modules/rtask/config.go
Normal file
@ -0,0 +1,116 @@
|
||||
package rtask
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/modules"
|
||||
cfg "go_dreamfactory/sys/configure/structs"
|
||||
)
|
||||
|
||||
const (
|
||||
gameRtask = "game_rdtaskall.json"
|
||||
gameRtaskChoose = "game_rdtaskchoose.json"
|
||||
gameRtaskType = "game_rdtasktype.json"
|
||||
)
|
||||
|
||||
type configureComp struct {
|
||||
modules.MCompConfigure
|
||||
}
|
||||
|
||||
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)
|
||||
err = this.LoadMultiConfigure(map[string]interface{}{
|
||||
gameRtask: cfg.NewGameRdtaskAll,
|
||||
gameRtaskChoose: cfg.NewGameRdtaskChoose,
|
||||
gameRtaskType: cfg.NewGameRdtaskType,
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (this *configureComp) getRtaskCfg() (data *cfg.GameRdtaskAll, err error) {
|
||||
var (
|
||||
v interface{}
|
||||
ok bool
|
||||
)
|
||||
if v, err = this.GetConfigure(gameRtask); err != nil {
|
||||
return
|
||||
} else {
|
||||
if data, ok = v.(*cfg.GameRdtaskAll); !ok {
|
||||
err = fmt.Errorf("%T no is *cfg.GameRdtaskAll", v)
|
||||
return
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (this *configureComp) getRtaskTypeCfg() (data *cfg.GameRdtaskType, err error) {
|
||||
var (
|
||||
v interface{}
|
||||
ok bool
|
||||
)
|
||||
if v, err = this.GetConfigure(gameRtask); err != nil {
|
||||
return
|
||||
} else {
|
||||
if data, ok = v.(*cfg.GameRdtaskType); !ok {
|
||||
err = fmt.Errorf("%T is *cfg.GameRdtaskType", v)
|
||||
return
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// 获取随机任务配置
|
||||
func (this *configureComp) getRtaskList() (data []*cfg.GameRdtaskAllData, err error) {
|
||||
cfg, err := this.getRtaskCfg()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if cfg != nil {
|
||||
data = cfg.GetDataList()
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// 查询任务类型
|
||||
func (this *configureComp) getRtaskTypeById(typeId int32) (data *cfg.GameRdtaskTypeData, err error) {
|
||||
cfg, err := this.getRtaskTypeCfg()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if cfg != nil {
|
||||
if data, ok := cfg.GetDataMap()[typeId]; ok {
|
||||
return data, nil
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// 任务
|
||||
func (this *configureComp) getRtaskById(taskId int32) (data *cfg.GameRdtaskAllData) {
|
||||
cfg, err := this.getRtaskCfg()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if cfg != nil {
|
||||
if data, ok := cfg.GetDataMap()[taskId]; ok {
|
||||
return data
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// 首个任务
|
||||
func (this *configureComp) getFirstTask() *cfg.GameRdtaskAllData {
|
||||
cfg, err := this.getRtaskCfg()
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
if cfg != nil {
|
||||
for _, v := range cfg.GetDataList() {
|
||||
if v.Aftertaks == 0 {
|
||||
return v
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
86
modules/rtask/model_rtask.go
Normal file
86
modules/rtask/model_rtask.go
Normal file
@ -0,0 +1,86 @@
|
||||
package rtask
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/lego/sys/log"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/pb"
|
||||
cfg "go_dreamfactory/sys/configure/structs"
|
||||
)
|
||||
|
||||
type ModelRtask struct {
|
||||
modules.MCompModel
|
||||
moduleRtask *ModuleRtask
|
||||
}
|
||||
|
||||
func (this *ModelRtask) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||
this.TableName = comm.TableRtask
|
||||
err = this.MCompModel.Init(service, module, comp, options)
|
||||
this.moduleRtask = module.(*ModuleRtask)
|
||||
return
|
||||
}
|
||||
|
||||
func (this *ModelRtask) setNextTask(uid string, rtaskId int32) error {
|
||||
update := map[string]interface{}{
|
||||
"nextRtaskId": rtaskId,
|
||||
}
|
||||
|
||||
return this.Change(uid, update)
|
||||
}
|
||||
|
||||
func (this *ModelRtask) doRtaskHandle(uid string, param *pb.RtaskParam) (rtaskId int32, err error) {
|
||||
log.Debugf("do rtask params: %v %v %v ", param.Param1, param.Param2, param.Param3)
|
||||
//查询玩家的
|
||||
rtask := &pb.DBRtask{}
|
||||
if err = this.Get(uid, rtask); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
var taskId int32
|
||||
if len(rtask.FrtaskIds) == 0 {
|
||||
conf := this.moduleRtask.configure.getFirstTask()
|
||||
if conf != nil {
|
||||
taskId = conf.Aftertaks
|
||||
}
|
||||
} else {
|
||||
//TODO
|
||||
}
|
||||
|
||||
if rtask, ok := this.moduleRtask.rtaskHandleMap[taskId]; ok {
|
||||
for _, handle := range rtask.handlers {
|
||||
if ok := handle.fn(handle.cfg, param); !ok {
|
||||
log.Infof("uid: %v do rtask %v condition not", uid, taskId)
|
||||
break
|
||||
}
|
||||
}
|
||||
rtaskId = taskId
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// 1 英雄指定
|
||||
func (this *ModelRtask) HeroTarget(cfg *cfg.GameRdtaskTypeData, tp *pb.RtaskParam) (ok bool) {
|
||||
return cfg.Data1 == tp.Param1
|
||||
}
|
||||
|
||||
// 2 指定英雄的等级
|
||||
func (this *ModelRtask) HeroLvTarget(cfg *cfg.GameRdtaskTypeData, tp *pb.RtaskParam) (ok bool) {
|
||||
return cfg.Data1 == tp.Param1 && cfg.Data1 == tp.Param2
|
||||
}
|
||||
|
||||
// 3 指定英雄的指定装备的数量
|
||||
func (this *ModelRtask) EquipNum(cfg *cfg.GameRdtaskTypeData, tp *pb.RtaskParam) (ok bool) {
|
||||
return cfg.Data1 == tp.Param1 && cfg.Data2 == tp.Param2 && cfg.Data3 == tp.Param3
|
||||
}
|
||||
|
||||
// 4 剧情ID
|
||||
func (this *ModelRtask) PoltId(cfg *cfg.GameRdtaskTypeData, tp *pb.RtaskParam) (ok bool) {
|
||||
return cfg.Data1 == tp.Param1
|
||||
}
|
||||
|
||||
// 5 每日任务
|
||||
func (this *ModelRtask) TaskDay(cfg *cfg.GameRdtaskTypeData, tp *pb.RtaskParam) (ok bool) {
|
||||
return cfg.Data1 == tp.Param1
|
||||
}
|
133
modules/rtask/module.go
Normal file
133
modules/rtask/module.go
Normal file
@ -0,0 +1,133 @@
|
||||
// package 随机任务
|
||||
package rtask
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/lego/sys/log"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/pb"
|
||||
cfg "go_dreamfactory/sys/configure/structs"
|
||||
)
|
||||
|
||||
// 随机任务
|
||||
type rtask struct {
|
||||
rtaskId int32
|
||||
handlers []*rtaskCondi
|
||||
}
|
||||
|
||||
// 限定条件
|
||||
type rtaskCondi struct {
|
||||
cfg *cfg.GameRdtaskTypeData
|
||||
fn rtaskHandle
|
||||
}
|
||||
|
||||
// 设定返回值
|
||||
type rtaskHandle func(cfg *cfg.GameRdtaskTypeData, tp *pb.RtaskParam) (ok bool)
|
||||
|
||||
type ModuleRtask struct {
|
||||
modules.ModuleBase
|
||||
modelRtask *ModelRtask
|
||||
api *apiComp
|
||||
configure *configureComp
|
||||
|
||||
rtaskHandleMap map[int32]*rtask // 任务处理器
|
||||
}
|
||||
|
||||
func NewModule() core.IModule {
|
||||
return &ModuleRtask{
|
||||
rtaskHandleMap: make(map[int32]*rtask),
|
||||
}
|
||||
}
|
||||
|
||||
func (this *ModuleRtask) GetType() core.M_Modules {
|
||||
return comm.ModuleRtask
|
||||
}
|
||||
|
||||
func (this *ModuleRtask) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
|
||||
err = this.ModuleBase.Init(service, module, options)
|
||||
this.initRtaskHandle()
|
||||
return
|
||||
}
|
||||
|
||||
func (this *ModuleRtask) OnInstallComp() {
|
||||
this.ModuleBase.OnInstallComp()
|
||||
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
|
||||
this.modelRtask = this.RegisterComp(new(ModelRtask)).(*ModelRtask)
|
||||
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
|
||||
}
|
||||
|
||||
func (this *ModuleRtask) register(rtaskId int32, rtask *rtask) {
|
||||
if _, ok := this.rtaskHandleMap[rtaskId]; !ok {
|
||||
this.rtaskHandleMap[rtaskId] = rtask
|
||||
}
|
||||
}
|
||||
|
||||
func (this *ModuleRtask) initRtaskHandle() {
|
||||
if data, err := this.configure.getRtaskList(); err == nil {
|
||||
for _, v := range data {
|
||||
var handlers []*rtaskCondi
|
||||
rtask := &rtask{
|
||||
rtaskId: v.Id,
|
||||
handlers: handlers,
|
||||
}
|
||||
|
||||
//遍历任务的限定条件
|
||||
for _, rtaskTypeId := range v.RdtaksNum {
|
||||
// 获取每个限定条件配置
|
||||
if typeCfg, err2 := this.configure.getRtaskTypeById(rtaskTypeId); err2 == nil {
|
||||
if typeCfg != nil {
|
||||
switch comm.TaskType(typeCfg.GetTypeId()) {
|
||||
case comm.RtaskTypeHeroTarget:
|
||||
handlers = append(handlers, &rtaskCondi{
|
||||
cfg: typeCfg,
|
||||
fn: this.modelRtask.HeroTarget,
|
||||
})
|
||||
case comm.RtaskTypeHeroLvTarget:
|
||||
handlers = append(handlers, &rtaskCondi{
|
||||
cfg: typeCfg,
|
||||
fn: this.modelRtask.HeroLvTarget,
|
||||
})
|
||||
case comm.RtaskTypeEquipNum:
|
||||
handlers = append(handlers, &rtaskCondi{
|
||||
cfg: typeCfg,
|
||||
fn: this.modelRtask.EquipNum,
|
||||
})
|
||||
case comm.RtaskTypePoltId:
|
||||
handlers = append(handlers, &rtaskCondi{
|
||||
cfg: typeCfg,
|
||||
fn: this.modelRtask.PoltId,
|
||||
})
|
||||
case comm.RtaskTypeTaskDay:
|
||||
handlers = append(handlers, &rtaskCondi{
|
||||
cfg: typeCfg,
|
||||
fn: this.modelRtask.TaskDay,
|
||||
})
|
||||
|
||||
default:
|
||||
log.Warnf("%v rtask type not configure", typeCfg.GetTypeId())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.register(v.Id, rtask)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 通知随机任务
|
||||
func (this *ModuleRtask) SendToRtask(session comm.IUserSession, param *pb.RtaskParam) (code pb.ErrorCode) {
|
||||
if taskId, err := this.modelRtask.doRtaskHandle(session.GetUserId(), param); err != nil {
|
||||
code = pb.ErrorCode_TaskHandle
|
||||
} else {
|
||||
if err := session.SendMsg(string(comm.ModuleRtask), "", &pb.RtaskFinishPush{
|
||||
RtaskId: taskId,
|
||||
}); err != nil {
|
||||
code = pb.ErrorCode_SystemError
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
@ -80,7 +80,7 @@ func (this *apiComp) Login(session comm.IUserSession, req *pb.UserLoginReq) (cod
|
||||
}
|
||||
|
||||
//缓存user session
|
||||
err = this.module.modelSession.Change(user.Uid, map[string]interface{}{
|
||||
err = this.module.modelSession.ChangeList("online", user.Uid, map[string]interface{}{
|
||||
"uid": user.Uid,
|
||||
"sessionId": session.GetSessionId(),
|
||||
"serviceTag": session.GetServiecTag(),
|
||||
|
@ -21,10 +21,17 @@ func (this *ModelSession) Init(service core.IService, module core.IModule, comp
|
||||
|
||||
//获取用户
|
||||
func (this *ModelSession) getUserSession(uid string) (cuser *pb.CacheUser) {
|
||||
cuser = &pb.CacheUser{}
|
||||
if err := this.Get(uid, cuser); err != nil {
|
||||
var sl []*pb.CacheUser
|
||||
|
||||
if err := this.GetList("online", sl); err != nil {
|
||||
this.module.Errorf("GetUserSession err:%v", err)
|
||||
return
|
||||
}
|
||||
|
||||
for _, v := range sl {
|
||||
if v.Uid == uid {
|
||||
return v
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -75,6 +75,10 @@ func (this *User) CleanSession(session comm.IUserSession) {
|
||||
this.modelSetting.Del(session.GetUserId(), db.SetDBMgoLog(false))
|
||||
}
|
||||
|
||||
// 在线玩家列表
|
||||
func (this *User) UserOnline() {
|
||||
}
|
||||
|
||||
//查询用户属性值 例如 金币 经验
|
||||
func (this *User) QueryAttributeValue(uid string, attr string) (value int32) {
|
||||
user := this.modelUser.GetUser(uid)
|
||||
|
@ -1,14 +1,8 @@
|
||||
package web
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/modules"
|
||||
cfg "go_dreamfactory/sys/configure/structs"
|
||||
)
|
||||
|
||||
const (
|
||||
game_serverlist = "game_serverlist.json"
|
||||
)
|
||||
|
||||
type configureComp struct {
|
||||
@ -17,35 +11,6 @@ type configureComp struct {
|
||||
|
||||
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)
|
||||
err = this.LoadConfigure(game_serverlist, cfg.NewGame_serverList)
|
||||
return
|
||||
}
|
||||
|
||||
func (this *configureComp) getConfig() (data *cfg.Game_serverList, err error) {
|
||||
var (
|
||||
v interface{}
|
||||
ok bool
|
||||
)
|
||||
if v, err = this.GetConfigure(game_serverlist); err != nil {
|
||||
return
|
||||
} else {
|
||||
if data, ok = v.(*cfg.Game_serverList); !ok {
|
||||
err = fmt.Errorf("%T no is *cfg.Game_ActiveReward", v)
|
||||
return
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (this *configureComp) getServerListConf() (data []*cfg.Game_serverListData) {
|
||||
conf, err := this.getConfig()
|
||||
if err != nil {
|
||||
return data
|
||||
}
|
||||
|
||||
if conf != nil {
|
||||
return conf.GetDataList()
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
115
pb/comm.pb.go
115
pb/comm.pb.go
@ -957,6 +957,69 @@ func (x *TaskParam) GetSecond() int32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
type RtaskParam struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Param1 int32 `protobuf:"varint,1,opt,name=param1,proto3" json:"param1"`
|
||||
Param2 int32 `protobuf:"varint,2,opt,name=param2,proto3" json:"param2"`
|
||||
Param3 int32 `protobuf:"varint,3,opt,name=param3,proto3" json:"param3"`
|
||||
}
|
||||
|
||||
func (x *RtaskParam) Reset() {
|
||||
*x = RtaskParam{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_comm_proto_msgTypes[13]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *RtaskParam) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*RtaskParam) ProtoMessage() {}
|
||||
|
||||
func (x *RtaskParam) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_comm_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 RtaskParam.ProtoReflect.Descriptor instead.
|
||||
func (*RtaskParam) Descriptor() ([]byte, []int) {
|
||||
return file_comm_proto_rawDescGZIP(), []int{13}
|
||||
}
|
||||
|
||||
func (x *RtaskParam) GetParam1() int32 {
|
||||
if x != nil {
|
||||
return x.Param1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *RtaskParam) GetParam2() int32 {
|
||||
if x != nil {
|
||||
return x.Param2
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *RtaskParam) GetParam3() int32 {
|
||||
if x != nil {
|
||||
return x.Param3
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_comm_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_comm_proto_rawDesc = []byte{
|
||||
@ -1065,13 +1128,18 @@ var file_comm_proto_rawDesc = []byte{
|
||||
0x05, 0x52, 0x01, 0x4e, 0x22, 0x39, 0x0a, 0x09, 0x54, 0x61, 0x73, 0x6b, 0x50, 0x61, 0x72, 0x61,
|
||||
0x6d, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x69, 0x72, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
|
||||
0x52, 0x05, 0x66, 0x69, 0x72, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x6f, 0x6e,
|
||||
0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x2a,
|
||||
0x43, 0x0a, 0x12, 0x48, 0x65, 0x72, 0x6f, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65,
|
||||
0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x06, 0x0a, 0x02, 0x48, 0x70, 0x10, 0x00, 0x12, 0x07, 0x0a,
|
||||
0x03, 0x41, 0x74, 0x6b, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x44, 0x65, 0x66, 0x10, 0x02, 0x12,
|
||||
0x09, 0x0a, 0x05, 0x53, 0x70, 0x65, 0x65, 0x64, 0x10, 0x03, 0x12, 0x08, 0x0a, 0x04, 0x43, 0x72,
|
||||
0x69, 0x74, 0x10, 0x04, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x33,
|
||||
0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x22,
|
||||
0x54, 0x0a, 0x0a, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x12, 0x16, 0x0a,
|
||||
0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x70,
|
||||
0x61, 0x72, 0x61, 0x6d, 0x31, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x32, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x32, 0x12, 0x16, 0x0a,
|
||||
0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x33, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x70,
|
||||
0x61, 0x72, 0x61, 0x6d, 0x33, 0x2a, 0x43, 0x0a, 0x12, 0x48, 0x65, 0x72, 0x6f, 0x41, 0x74, 0x74,
|
||||
0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x06, 0x0a, 0x02, 0x48,
|
||||
0x70, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x74, 0x6b, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03,
|
||||
0x44, 0x65, 0x66, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x70, 0x65, 0x65, 0x64, 0x10, 0x03,
|
||||
0x12, 0x08, 0x0a, 0x04, 0x43, 0x72, 0x69, 0x74, 0x10, 0x04, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b,
|
||||
0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
@ -1087,7 +1155,7 @@ func file_comm_proto_rawDescGZIP() []byte {
|
||||
}
|
||||
|
||||
var file_comm_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_comm_proto_msgTypes = make([]protoimpl.MessageInfo, 13)
|
||||
var file_comm_proto_msgTypes = make([]protoimpl.MessageInfo, 14)
|
||||
var file_comm_proto_goTypes = []interface{}{
|
||||
(HeroAttributesType)(0), // 0: HeroAttributesType
|
||||
(*UserMessage)(nil), // 1: UserMessage
|
||||
@ -1103,18 +1171,19 @@ var file_comm_proto_goTypes = []interface{}{
|
||||
(*NoticeUserCloseReq)(nil), // 11: NoticeUserCloseReq
|
||||
(*UserAssets)(nil), // 12: UserAssets
|
||||
(*TaskParam)(nil), // 13: TaskParam
|
||||
(*anypb.Any)(nil), // 14: google.protobuf.Any
|
||||
(ErrorCode)(0), // 15: ErrorCode
|
||||
(*RtaskParam)(nil), // 14: RtaskParam
|
||||
(*anypb.Any)(nil), // 15: google.protobuf.Any
|
||||
(ErrorCode)(0), // 16: ErrorCode
|
||||
}
|
||||
var file_comm_proto_depIdxs = []int32{
|
||||
14, // 0: UserMessage.data:type_name -> google.protobuf.Any
|
||||
14, // 1: AgentMessage.Message:type_name -> google.protobuf.Any
|
||||
15, // 2: RPCMessageReply.Code:type_name -> ErrorCode
|
||||
14, // 3: RPCMessageReply.ErrorData:type_name -> google.protobuf.Any
|
||||
15, // 0: UserMessage.data:type_name -> google.protobuf.Any
|
||||
15, // 1: AgentMessage.Message:type_name -> google.protobuf.Any
|
||||
16, // 2: RPCMessageReply.Code:type_name -> ErrorCode
|
||||
15, // 3: RPCMessageReply.ErrorData:type_name -> google.protobuf.Any
|
||||
1, // 4: RPCMessageReply.Reply:type_name -> UserMessage
|
||||
1, // 5: AgentSendMessageReq.Reply:type_name -> UserMessage
|
||||
14, // 6: BatchMessageReq.Data:type_name -> google.protobuf.Any
|
||||
14, // 7: BroadCastMessageReq.Data:type_name -> google.protobuf.Any
|
||||
15, // 6: BatchMessageReq.Data:type_name -> google.protobuf.Any
|
||||
15, // 7: BroadCastMessageReq.Data:type_name -> google.protobuf.Any
|
||||
8, // [8:8] is the sub-list for method output_type
|
||||
8, // [8:8] is the sub-list for method input_type
|
||||
8, // [8:8] is the sub-list for extension type_name
|
||||
@ -1285,6 +1354,18 @@ func file_comm_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_comm_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*RtaskParam); 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{
|
||||
@ -1292,7 +1373,7 @@ func file_comm_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_comm_proto_rawDesc,
|
||||
NumEnums: 1,
|
||||
NumMessages: 13,
|
||||
NumMessages: 14,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
|
@ -148,6 +148,10 @@ const (
|
||||
ErrorCode_MartialhallUnlocked ErrorCode = 2002 //已解锁
|
||||
// 美食馆
|
||||
ErrorCode_GourmetMoreOrderTime ErrorCode = 2101 // 超过订单时长
|
||||
ErrorCode_GourmetSkillMaxLv ErrorCode = 2102 // 技能已经达到满级
|
||||
// rtask
|
||||
ErrorCode_RtaskFinished ErrorCode = 2201 //任务已完成
|
||||
ErrorCode_RtaskUnFinished ErrorCode = 2202 //任务未完成
|
||||
)
|
||||
|
||||
// Enum value maps for ErrorCode.
|
||||
@ -266,6 +270,9 @@ var (
|
||||
2001: "MartialhallInUse",
|
||||
2002: "MartialhallUnlocked",
|
||||
2101: "GourmetMoreOrderTime",
|
||||
2102: "GourmetSkillMaxLv",
|
||||
2201: "RtaskFinished",
|
||||
2202: "RtaskUnFinished",
|
||||
}
|
||||
ErrorCode_value = map[string]int32{
|
||||
"Success": 0,
|
||||
@ -381,6 +388,9 @@ var (
|
||||
"MartialhallInUse": 2001,
|
||||
"MartialhallUnlocked": 2002,
|
||||
"GourmetMoreOrderTime": 2101,
|
||||
"GourmetSkillMaxLv": 2102,
|
||||
"RtaskFinished": 2201,
|
||||
"RtaskUnFinished": 2202,
|
||||
}
|
||||
)
|
||||
|
||||
@ -415,7 +425,7 @@ var File_errorcode_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_errorcode_proto_rawDesc = []byte{
|
||||
0x0a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x2a, 0xf4, 0x12, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12,
|
||||
0x6f, 0x2a, 0xb6, 0x13, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12,
|
||||
0x0b, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d,
|
||||
0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x10, 0x0a, 0x12,
|
||||
0x1b, 0x0a, 0x17, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
||||
@ -566,8 +576,12 @@ var file_errorcode_proto_rawDesc = []byte{
|
||||
0x10, 0xd1, 0x0f, 0x12, 0x18, 0x0a, 0x13, 0x4d, 0x61, 0x72, 0x74, 0x69, 0x61, 0x6c, 0x68, 0x61,
|
||||
0x6c, 0x6c, 0x55, 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x10, 0xd2, 0x0f, 0x12, 0x19, 0x0a,
|
||||
0x14, 0x47, 0x6f, 0x75, 0x72, 0x6d, 0x65, 0x74, 0x4d, 0x6f, 0x72, 0x65, 0x4f, 0x72, 0x64, 0x65,
|
||||
0x72, 0x54, 0x69, 0x6d, 0x65, 0x10, 0xb5, 0x10, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62,
|
||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x72, 0x54, 0x69, 0x6d, 0x65, 0x10, 0xb5, 0x10, 0x12, 0x16, 0x0a, 0x11, 0x47, 0x6f, 0x75, 0x72,
|
||||
0x6d, 0x65, 0x74, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x4d, 0x61, 0x78, 0x4c, 0x76, 0x10, 0xb6, 0x10,
|
||||
0x12, 0x12, 0x0a, 0x0d, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65,
|
||||
0x64, 0x10, 0x99, 0x11, 0x12, 0x14, 0x0a, 0x0f, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x55, 0x6e, 0x46,
|
||||
0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x10, 0x9a, 0x11, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b,
|
||||
0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -145,15 +145,15 @@ type DBGourmet 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
|
||||
CookingFood *Cooking `protobuf:"bytes,3,opt,name=cookingFood,proto3" json:"cookingFood" bson:"cookingFood"` //正在烹饪的食品
|
||||
Foods []*OrderCook `protobuf:"bytes,4,rep,name=foods,proto3" json:"foods"` // 等待烹饪的食品
|
||||
Items []*UserAssets `protobuf:"bytes,5,rep,name=items,proto3" json:"items"` // 已经做好的食品
|
||||
Skill map[int32]int32 `protobuf:"bytes,6,rep,name=skill,proto3" json:"skill" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3" bson:"skill"` //技能ID
|
||||
ProductionSkill int32 `protobuf:"varint,7,opt,name=productionSkill,proto3" json:"productionSkill"` // 通用技能
|
||||
OrderCostTime int32 `protobuf:"varint,8,opt,name=orderCostTime,proto3" json:"orderCostTime" bson:"orderCostTime"` //订单消耗的时常
|
||||
Ctime int64 `protobuf:"varint,9,opt,name=ctime,proto3" json:"ctime"` // 订单创建时间
|
||||
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
|
||||
CookingFood *Cooking `protobuf:"bytes,3,opt,name=cookingFood,proto3" json:"cookingFood" bson:"cookingFood"` //正在烹饪的食品
|
||||
Foods []*OrderCook `protobuf:"bytes,4,rep,name=foods,proto3" json:"foods"` // 等待烹饪的食品
|
||||
Items []*UserAssets `protobuf:"bytes,5,rep,name=items,proto3" json:"items"` // 已经做好的食品
|
||||
Skill map[int32]int32 `protobuf:"bytes,6,rep,name=skill,proto3" json:"skill" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3" bson:"skill"` //技能ID
|
||||
SpecialSkill map[int32]int32 `protobuf:"bytes,7,rep,name=specialSkill,proto3" json:"specialSkill" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3" bson:"specialSkill"` //通用技能
|
||||
OrderCostTime int32 `protobuf:"varint,8,opt,name=orderCostTime,proto3" json:"orderCostTime" bson:"orderCostTime"` //订单消耗的时常
|
||||
Ctime int64 `protobuf:"varint,9,opt,name=ctime,proto3" json:"ctime"` // 订单创建时间
|
||||
}
|
||||
|
||||
func (x *DBGourmet) Reset() {
|
||||
@ -230,11 +230,11 @@ func (x *DBGourmet) GetSkill() map[int32]int32 {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *DBGourmet) GetProductionSkill() int32 {
|
||||
func (x *DBGourmet) GetSpecialSkill() map[int32]int32 {
|
||||
if x != nil {
|
||||
return x.ProductionSkill
|
||||
return x.SpecialSkill
|
||||
}
|
||||
return 0
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *DBGourmet) GetOrderCostTime() int32 {
|
||||
@ -266,7 +266,7 @@ var file_gourmet_gourmet_db_proto_rawDesc = []byte{
|
||||
0x66, 0x6f, 0x6f, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x09, 0x66, 0x6f, 0x6f, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f,
|
||||
0x6f, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x6f,
|
||||
0x6f, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xeb, 0x02, 0x0a, 0x09, 0x44, 0x42, 0x47, 0x6f, 0x75,
|
||||
0x6f, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xc4, 0x03, 0x0a, 0x09, 0x44, 0x42, 0x47, 0x6f, 0x75,
|
||||
0x72, 0x6d, 0x65, 0x74, 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, 0x2a, 0x0a, 0x0b, 0x63, 0x6f, 0x6f, 0x6b, 0x69, 0x6e,
|
||||
@ -279,18 +279,23 @@ var file_gourmet_gourmet_db_proto_rawDesc = []byte{
|
||||
0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x2b, 0x0a, 0x05, 0x73, 0x6b, 0x69, 0x6c, 0x6c,
|
||||
0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x44, 0x42, 0x47, 0x6f, 0x75, 0x72, 0x6d,
|
||||
0x65, 0x74, 0x2e, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x73,
|
||||
0x6b, 0x69, 0x6c, 0x6c, 0x12, 0x28, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x69,
|
||||
0x6f, 0x6e, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x70,
|
||||
0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x12, 0x24,
|
||||
0x0a, 0x0d, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18,
|
||||
0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x73, 0x74,
|
||||
0x54, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20,
|
||||
0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x1a, 0x38, 0x0a, 0x0a, 0x53, 0x6b,
|
||||
0x69, 0x6c, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61,
|
||||
0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
|
||||
0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x33,
|
||||
0x6b, 0x69, 0x6c, 0x6c, 0x12, 0x40, 0x0a, 0x0c, 0x73, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x53,
|
||||
0x6b, 0x69, 0x6c, 0x6c, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x44, 0x42, 0x47,
|
||||
0x6f, 0x75, 0x72, 0x6d, 0x65, 0x74, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x53, 0x6b,
|
||||
0x69, 0x6c, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x73, 0x70, 0x65, 0x63, 0x69, 0x61,
|
||||
0x6c, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x12, 0x24, 0x0a, 0x0d, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x43,
|
||||
0x6f, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x6f,
|
||||
0x72, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05,
|
||||
0x63, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x74, 0x69,
|
||||
0x6d, 0x65, 0x1a, 0x38, 0x0a, 0x0a, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79,
|
||||
0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b,
|
||||
0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3f, 0x0a, 0x11,
|
||||
0x53, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x45, 0x6e, 0x74, 0x72,
|
||||
0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03,
|
||||
0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x5a,
|
||||
0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
@ -305,24 +310,26 @@ func file_gourmet_gourmet_db_proto_rawDescGZIP() []byte {
|
||||
return file_gourmet_gourmet_db_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_gourmet_gourmet_db_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_gourmet_gourmet_db_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
|
||||
var file_gourmet_gourmet_db_proto_goTypes = []interface{}{
|
||||
(*Cooking)(nil), // 0: Cooking
|
||||
(*OrderCook)(nil), // 1: OrderCook
|
||||
(*DBGourmet)(nil), // 2: DBGourmet
|
||||
nil, // 3: DBGourmet.SkillEntry
|
||||
(*UserAssets)(nil), // 4: UserAssets
|
||||
nil, // 4: DBGourmet.SpecialSkillEntry
|
||||
(*UserAssets)(nil), // 5: UserAssets
|
||||
}
|
||||
var file_gourmet_gourmet_db_proto_depIdxs = []int32{
|
||||
0, // 0: DBGourmet.cookingFood:type_name -> Cooking
|
||||
1, // 1: DBGourmet.foods:type_name -> OrderCook
|
||||
4, // 2: DBGourmet.items:type_name -> UserAssets
|
||||
5, // 2: DBGourmet.items:type_name -> UserAssets
|
||||
3, // 3: DBGourmet.skill:type_name -> DBGourmet.SkillEntry
|
||||
4, // [4:4] is the sub-list for method output_type
|
||||
4, // [4:4] is the sub-list for method input_type
|
||||
4, // [4:4] is the sub-list for extension type_name
|
||||
4, // [4:4] is the sub-list for extension extendee
|
||||
0, // [0:4] is the sub-list for field type_name
|
||||
4, // 4: DBGourmet.specialSkill:type_name -> DBGourmet.SpecialSkillEntry
|
||||
5, // [5:5] is the sub-list for method output_type
|
||||
5, // [5:5] is the sub-list for method input_type
|
||||
5, // [5:5] is the sub-list for extension type_name
|
||||
5, // [5:5] is the sub-list for extension extendee
|
||||
0, // [0:5] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_gourmet_gourmet_db_proto_init() }
|
||||
@ -375,7 +382,7 @@ func file_gourmet_gourmet_db_proto_init() {
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_gourmet_gourmet_db_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 4,
|
||||
NumMessages: 5,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
|
@ -294,7 +294,7 @@ type GourmetSkillLvReq struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
SkillId int32 `protobuf:"varint,1,opt,name=skillId,proto3" json:"skillId"` // 技能id
|
||||
SkillType int32 `protobuf:"varint,1,opt,name=skillType,proto3" json:"skillType"` // 技能id
|
||||
}
|
||||
|
||||
func (x *GourmetSkillLvReq) Reset() {
|
||||
@ -329,9 +329,9 @@ func (*GourmetSkillLvReq) Descriptor() ([]byte, []int) {
|
||||
return file_gourmet_gourmet_msg_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
func (x *GourmetSkillLvReq) GetSkillId() int32 {
|
||||
func (x *GourmetSkillLvReq) GetSkillType() int32 {
|
||||
if x != nil {
|
||||
return x.SkillId
|
||||
return x.SkillType
|
||||
}
|
||||
return 0
|
||||
}
|
||||
@ -406,14 +406,14 @@ var file_gourmet_gourmet_msg_proto_rawDesc = []byte{
|
||||
0x47, 0x6f, 0x75, 0x72, 0x6d, 0x65, 0x74, 0x47, 0x65, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64,
|
||||
0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x44, 0x42, 0x47, 0x6f, 0x75, 0x72, 0x6d, 0x65, 0x74, 0x52, 0x04,
|
||||
0x64, 0x61, 0x74, 0x61, 0x22, 0x2d, 0x0a, 0x11, 0x47, 0x6f, 0x75, 0x72, 0x6d, 0x65, 0x74, 0x53,
|
||||
0x6b, 0x69, 0x6c, 0x6c, 0x4c, 0x76, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x6b, 0x69,
|
||||
0x6c, 0x6c, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x73, 0x6b, 0x69, 0x6c,
|
||||
0x6c, 0x49, 0x64, 0x22, 0x34, 0x0a, 0x12, 0x47, 0x6f, 0x75, 0x72, 0x6d, 0x65, 0x74, 0x53, 0x6b,
|
||||
0x69, 0x6c, 0x6c, 0x4c, 0x76, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, 0x64, 0x61, 0x74,
|
||||
0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x44, 0x42, 0x47, 0x6f, 0x75, 0x72,
|
||||
0x6d, 0x65, 0x74, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70,
|
||||
0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x64, 0x61, 0x74, 0x61, 0x22, 0x31, 0x0a, 0x11, 0x47, 0x6f, 0x75, 0x72, 0x6d, 0x65, 0x74, 0x53,
|
||||
0x6b, 0x69, 0x6c, 0x6c, 0x4c, 0x76, 0x52, 0x65, 0x71, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x6b, 0x69,
|
||||
0x6c, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x73, 0x6b,
|
||||
0x69, 0x6c, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x22, 0x34, 0x0a, 0x12, 0x47, 0x6f, 0x75, 0x72, 0x6d,
|
||||
0x65, 0x74, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x4c, 0x76, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a,
|
||||
0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x44, 0x42,
|
||||
0x47, 0x6f, 0x75, 0x72, 0x6d, 0x65, 0x74, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x42, 0x06, 0x5a,
|
||||
0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
170
pb/rtask_db.pb.go
Normal file
170
pb/rtask_db.pb.go
Normal file
@ -0,0 +1,170 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.0
|
||||
// protoc v3.20.0
|
||||
// source: rtask/rtask_db.proto
|
||||
|
||||
package pb
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type DBRtask struct {
|
||||
state protoimpl.MessageState
|
||||
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
|
||||
FrtaskIds []int32 `protobuf:"varint,3,rep,packed,name=frtaskIds,proto3" json:"frtaskIds" bson:"frtaskIds"` //已完成的任务Id
|
||||
NextRtaskId int32 `protobuf:"varint,4,opt,name=nextRtaskId,proto3" json:"nextRtaskId"` //@go_tags(`bson:"nextRtaskId"`)下个任务Id
|
||||
}
|
||||
|
||||
func (x *DBRtask) Reset() {
|
||||
*x = DBRtask{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_rtask_rtask_db_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *DBRtask) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DBRtask) ProtoMessage() {}
|
||||
|
||||
func (x *DBRtask) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_rtask_rtask_db_proto_msgTypes[0]
|
||||
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 DBRtask.ProtoReflect.Descriptor instead.
|
||||
func (*DBRtask) Descriptor() ([]byte, []int) {
|
||||
return file_rtask_rtask_db_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *DBRtask) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *DBRtask) GetUid() string {
|
||||
if x != nil {
|
||||
return x.Uid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *DBRtask) GetFrtaskIds() []int32 {
|
||||
if x != nil {
|
||||
return x.FrtaskIds
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *DBRtask) GetNextRtaskId() int32 {
|
||||
if x != nil {
|
||||
return x.NextRtaskId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_rtask_rtask_db_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_rtask_rtask_db_proto_rawDesc = []byte{
|
||||
0x0a, 0x14, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x2f, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x64, 0x62,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6b, 0x0a, 0x07, 0x44, 0x42, 0x52, 0x74, 0x61, 0x73,
|
||||
0x6b, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69,
|
||||
0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
|
||||
0x75, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x73,
|
||||
0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, 0x09, 0x66, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64,
|
||||
0x73, 0x12, 0x20, 0x0a, 0x0b, 0x6e, 0x65, 0x78, 0x74, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64,
|
||||
0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x6e, 0x65, 0x78, 0x74, 0x52, 0x74, 0x61, 0x73,
|
||||
0x6b, 0x49, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_rtask_rtask_db_proto_rawDescOnce sync.Once
|
||||
file_rtask_rtask_db_proto_rawDescData = file_rtask_rtask_db_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_rtask_rtask_db_proto_rawDescGZIP() []byte {
|
||||
file_rtask_rtask_db_proto_rawDescOnce.Do(func() {
|
||||
file_rtask_rtask_db_proto_rawDescData = protoimpl.X.CompressGZIP(file_rtask_rtask_db_proto_rawDescData)
|
||||
})
|
||||
return file_rtask_rtask_db_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_rtask_rtask_db_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_rtask_rtask_db_proto_goTypes = []interface{}{
|
||||
(*DBRtask)(nil), // 0: DBRtask
|
||||
}
|
||||
var file_rtask_rtask_db_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_rtask_rtask_db_proto_init() }
|
||||
func file_rtask_rtask_db_proto_init() {
|
||||
if File_rtask_rtask_db_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_rtask_rtask_db_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*DBRtask); 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{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_rtask_rtask_db_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_rtask_rtask_db_proto_goTypes,
|
||||
DependencyIndexes: file_rtask_rtask_db_proto_depIdxs,
|
||||
MessageInfos: file_rtask_rtask_db_proto_msgTypes,
|
||||
}.Build()
|
||||
File_rtask_rtask_db_proto = out.File
|
||||
file_rtask_rtask_db_proto_rawDesc = nil
|
||||
file_rtask_rtask_db_proto_goTypes = nil
|
||||
file_rtask_rtask_db_proto_depIdxs = nil
|
||||
}
|
268
pb/rtask_msg.pb.go
Normal file
268
pb/rtask_msg.pb.go
Normal file
@ -0,0 +1,268 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.0
|
||||
// protoc v3.20.0
|
||||
// source: rtask/rtask_msg.proto
|
||||
|
||||
package pb
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// 对话选项
|
||||
type RtaskChooseReq struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
RtaskId int32 `protobuf:"varint,1,opt,name=rtaskId,proto3" json:"rtaskId"`
|
||||
ChooseId int32 `protobuf:"varint,2,opt,name=chooseId,proto3" json:"chooseId"`
|
||||
}
|
||||
|
||||
func (x *RtaskChooseReq) Reset() {
|
||||
*x = RtaskChooseReq{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_rtask_rtask_msg_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *RtaskChooseReq) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*RtaskChooseReq) ProtoMessage() {}
|
||||
|
||||
func (x *RtaskChooseReq) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_rtask_rtask_msg_proto_msgTypes[0]
|
||||
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 RtaskChooseReq.ProtoReflect.Descriptor instead.
|
||||
func (*RtaskChooseReq) Descriptor() ([]byte, []int) {
|
||||
return file_rtask_rtask_msg_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *RtaskChooseReq) GetRtaskId() int32 {
|
||||
if x != nil {
|
||||
return x.RtaskId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *RtaskChooseReq) GetChooseId() int32 {
|
||||
if x != nil {
|
||||
return x.ChooseId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type RtaskChooseResp struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
}
|
||||
|
||||
func (x *RtaskChooseResp) Reset() {
|
||||
*x = RtaskChooseResp{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_rtask_rtask_msg_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *RtaskChooseResp) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*RtaskChooseResp) ProtoMessage() {}
|
||||
|
||||
func (x *RtaskChooseResp) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_rtask_rtask_msg_proto_msgTypes[1]
|
||||
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 RtaskChooseResp.ProtoReflect.Descriptor instead.
|
||||
func (*RtaskChooseResp) Descriptor() ([]byte, []int) {
|
||||
return file_rtask_rtask_msg_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
// 任务完成推送
|
||||
type RtaskFinishPush struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
RtaskId int32 `protobuf:"varint,1,opt,name=rtaskId,proto3" json:"rtaskId"`
|
||||
}
|
||||
|
||||
func (x *RtaskFinishPush) Reset() {
|
||||
*x = RtaskFinishPush{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_rtask_rtask_msg_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *RtaskFinishPush) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*RtaskFinishPush) ProtoMessage() {}
|
||||
|
||||
func (x *RtaskFinishPush) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_rtask_rtask_msg_proto_msgTypes[2]
|
||||
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 RtaskFinishPush.ProtoReflect.Descriptor instead.
|
||||
func (*RtaskFinishPush) Descriptor() ([]byte, []int) {
|
||||
return file_rtask_rtask_msg_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *RtaskFinishPush) GetRtaskId() int32 {
|
||||
if x != nil {
|
||||
return x.RtaskId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_rtask_rtask_msg_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_rtask_rtask_msg_proto_rawDesc = []byte{
|
||||
0x0a, 0x15, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x2f, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x6d, 0x73,
|
||||
0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x46, 0x0a, 0x0e, 0x52, 0x74, 0x61, 0x73, 0x6b,
|
||||
0x43, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61,
|
||||
0x73, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73,
|
||||
0x6b, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x49, 0x64, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x49, 0x64, 0x22,
|
||||
0x11, 0x0a, 0x0f, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x43, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x52, 0x65,
|
||||
0x73, 0x70, 0x22, 0x2b, 0x0a, 0x0f, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69, 0x73,
|
||||
0x68, 0x50, 0x75, 0x73, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x42,
|
||||
0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_rtask_rtask_msg_proto_rawDescOnce sync.Once
|
||||
file_rtask_rtask_msg_proto_rawDescData = file_rtask_rtask_msg_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_rtask_rtask_msg_proto_rawDescGZIP() []byte {
|
||||
file_rtask_rtask_msg_proto_rawDescOnce.Do(func() {
|
||||
file_rtask_rtask_msg_proto_rawDescData = protoimpl.X.CompressGZIP(file_rtask_rtask_msg_proto_rawDescData)
|
||||
})
|
||||
return file_rtask_rtask_msg_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_rtask_rtask_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||
var file_rtask_rtask_msg_proto_goTypes = []interface{}{
|
||||
(*RtaskChooseReq)(nil), // 0: RtaskChooseReq
|
||||
(*RtaskChooseResp)(nil), // 1: RtaskChooseResp
|
||||
(*RtaskFinishPush)(nil), // 2: RtaskFinishPush
|
||||
}
|
||||
var file_rtask_rtask_msg_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_rtask_rtask_msg_proto_init() }
|
||||
func file_rtask_rtask_msg_proto_init() {
|
||||
if File_rtask_rtask_msg_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_rtask_rtask_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*RtaskChooseReq); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_rtask_rtask_msg_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*RtaskChooseResp); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_rtask_rtask_msg_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*RtaskFinishPush); 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{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_rtask_rtask_msg_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 3,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_rtask_rtask_msg_proto_goTypes,
|
||||
DependencyIndexes: file_rtask_rtask_msg_proto_depIdxs,
|
||||
MessageInfos: file_rtask_rtask_msg_proto_msgTypes,
|
||||
}.Build()
|
||||
File_rtask_rtask_msg_proto = out.File
|
||||
file_rtask_rtask_msg_proto_rawDesc = nil
|
||||
file_rtask_rtask_msg_proto_goTypes = nil
|
||||
file_rtask_rtask_msg_proto_depIdxs = nil
|
||||
}
|
@ -16,6 +16,7 @@ import (
|
||||
"go_dreamfactory/modules/martialhall"
|
||||
"go_dreamfactory/modules/notify"
|
||||
"go_dreamfactory/modules/pagoda"
|
||||
"go_dreamfactory/modules/rtask"
|
||||
"go_dreamfactory/modules/shop"
|
||||
"go_dreamfactory/modules/task"
|
||||
"go_dreamfactory/modules/user"
|
||||
@ -63,6 +64,7 @@ func main() {
|
||||
pagoda.NewModule(),
|
||||
gourmet.NewModule(),
|
||||
martialhall.NewModule(),
|
||||
rtask.NewModule(),
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -1,40 +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 ALocalizeConfig struct {
|
||||
Key string
|
||||
}
|
||||
|
||||
const TypeId_ALocalizeConfig = 1703856460
|
||||
|
||||
func (*ALocalizeConfig) GetTypeId() int32 {
|
||||
return 1703856460
|
||||
}
|
||||
|
||||
func (_v *ALocalizeConfig)Deserialize(_buf map[string]interface{}) (err error) {
|
||||
{ var _ok_ bool; if _v.Key, _ok_ = _buf["key"].(string); !_ok_ { err = errors.New("key error"); return } }
|
||||
return
|
||||
}
|
||||
|
||||
func DeserializeALocalizeConfig(_buf map[string]interface{}) (interface{}, error) {
|
||||
var id string
|
||||
var _ok_ bool
|
||||
if id, _ok_ = _buf["$type"].(string) ; !_ok_ {
|
||||
return nil, errors.New("type id missing")
|
||||
}
|
||||
switch id {
|
||||
case "LocalizeConfig_CN": _v := &LocalizeConfig_CN{}; if err := _v.Deserialize(_buf); err != nil { return nil, errors.New("LocalizeConfig_CN") } else { return _v, nil }
|
||||
case "LocalizeConfig_EN": _v := &LocalizeConfig_EN{}; if err := _v.Deserialize(_buf); err != nil { return nil, errors.New("LocalizeConfig_EN") } else { return _v, nil }
|
||||
case "LocalizeConfig_TW": _v := &LocalizeConfig_TW{}; if err := _v.Deserialize(_buf); err != nil { return nil, errors.New("LocalizeConfig_TW") } else { return _v, nil }
|
||||
default: return nil, errors.New("unknown type id")
|
||||
}
|
||||
}
|
@ -1,42 +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 LocalizeLocalizeConfig_CNCategory struct {
|
||||
_dataMap map[string]*LocalizeConfig_CN
|
||||
_dataList []*LocalizeConfig_CN
|
||||
}
|
||||
|
||||
func NewLocalizeLocalizeConfig_CNCategory(_buf []map[string]interface{}) (*LocalizeLocalizeConfig_CNCategory, error) {
|
||||
_dataList := make([]*LocalizeConfig_CN, 0, len(_buf))
|
||||
dataMap := make(map[string]*LocalizeConfig_CN)
|
||||
for _, _ele_ := range _buf {
|
||||
if _v, err2 := DeserializeLocalizeConfig_CN(_ele_); err2 != nil {
|
||||
return nil, err2
|
||||
} else {
|
||||
_dataList = append(_dataList, _v)
|
||||
dataMap[_v.Key] = _v
|
||||
}
|
||||
}
|
||||
return &LocalizeLocalizeConfig_CNCategory{_dataList:_dataList, _dataMap:dataMap}, nil
|
||||
}
|
||||
|
||||
func (table *LocalizeLocalizeConfig_CNCategory) GetDataMap() map[string]*LocalizeConfig_CN {
|
||||
return table._dataMap
|
||||
}
|
||||
|
||||
func (table *LocalizeLocalizeConfig_CNCategory) GetDataList() []*LocalizeConfig_CN {
|
||||
return table._dataList
|
||||
}
|
||||
|
||||
func (table *LocalizeLocalizeConfig_CNCategory) Get(key string) *LocalizeConfig_CN {
|
||||
return table._dataMap[key]
|
||||
}
|
||||
|
||||
|
@ -1,42 +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 LocalizeLocalizeConfig_ENCategory struct {
|
||||
_dataMap map[string]*LocalizeConfig_EN
|
||||
_dataList []*LocalizeConfig_EN
|
||||
}
|
||||
|
||||
func NewLocalizeLocalizeConfig_ENCategory(_buf []map[string]interface{}) (*LocalizeLocalizeConfig_ENCategory, error) {
|
||||
_dataList := make([]*LocalizeConfig_EN, 0, len(_buf))
|
||||
dataMap := make(map[string]*LocalizeConfig_EN)
|
||||
for _, _ele_ := range _buf {
|
||||
if _v, err2 := DeserializeLocalizeConfig_EN(_ele_); err2 != nil {
|
||||
return nil, err2
|
||||
} else {
|
||||
_dataList = append(_dataList, _v)
|
||||
dataMap[_v.Key] = _v
|
||||
}
|
||||
}
|
||||
return &LocalizeLocalizeConfig_ENCategory{_dataList:_dataList, _dataMap:dataMap}, nil
|
||||
}
|
||||
|
||||
func (table *LocalizeLocalizeConfig_ENCategory) GetDataMap() map[string]*LocalizeConfig_EN {
|
||||
return table._dataMap
|
||||
}
|
||||
|
||||
func (table *LocalizeLocalizeConfig_ENCategory) GetDataList() []*LocalizeConfig_EN {
|
||||
return table._dataList
|
||||
}
|
||||
|
||||
func (table *LocalizeLocalizeConfig_ENCategory) Get(key string) *LocalizeConfig_EN {
|
||||
return table._dataMap[key]
|
||||
}
|
||||
|
||||
|
@ -1,42 +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 LocalizeLocalizeConfig_TWCategory struct {
|
||||
_dataMap map[string]*LocalizeConfig_TW
|
||||
_dataList []*LocalizeConfig_TW
|
||||
}
|
||||
|
||||
func NewLocalizeLocalizeConfig_TWCategory(_buf []map[string]interface{}) (*LocalizeLocalizeConfig_TWCategory, error) {
|
||||
_dataList := make([]*LocalizeConfig_TW, 0, len(_buf))
|
||||
dataMap := make(map[string]*LocalizeConfig_TW)
|
||||
for _, _ele_ := range _buf {
|
||||
if _v, err2 := DeserializeLocalizeConfig_TW(_ele_); err2 != nil {
|
||||
return nil, err2
|
||||
} else {
|
||||
_dataList = append(_dataList, _v)
|
||||
dataMap[_v.Key] = _v
|
||||
}
|
||||
}
|
||||
return &LocalizeLocalizeConfig_TWCategory{_dataList:_dataList, _dataMap:dataMap}, nil
|
||||
}
|
||||
|
||||
func (table *LocalizeLocalizeConfig_TWCategory) GetDataMap() map[string]*LocalizeConfig_TW {
|
||||
return table._dataMap
|
||||
}
|
||||
|
||||
func (table *LocalizeLocalizeConfig_TWCategory) GetDataList() []*LocalizeConfig_TW {
|
||||
return table._dataList
|
||||
}
|
||||
|
||||
func (table *LocalizeLocalizeConfig_TWCategory) Get(key string) *LocalizeConfig_TW {
|
||||
return table._dataMap[key]
|
||||
}
|
||||
|
||||
|
@ -1,37 +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 LocalizeConfig_CN struct {
|
||||
Key string
|
||||
TextCn string
|
||||
}
|
||||
|
||||
const TypeId_LocalizeConfig_CN = 2049582687
|
||||
|
||||
func (*LocalizeConfig_CN) GetTypeId() int32 {
|
||||
return 2049582687
|
||||
}
|
||||
|
||||
func (_v *LocalizeConfig_CN)Deserialize(_buf map[string]interface{}) (err error) {
|
||||
{ var _ok_ bool; if _v.Key, _ok_ = _buf["key"].(string); !_ok_ { err = errors.New("key error"); return } }
|
||||
{ var _ok_ bool; if _v.TextCn, _ok_ = _buf["text_cn"].(string); !_ok_ { err = errors.New("text_cn error"); return } }
|
||||
return
|
||||
}
|
||||
|
||||
func DeserializeLocalizeConfig_CN(_buf map[string]interface{}) (*LocalizeConfig_CN, error) {
|
||||
v := &LocalizeConfig_CN{}
|
||||
if err := v.Deserialize(_buf); err == nil {
|
||||
return v, nil
|
||||
} else {
|
||||
return nil, err
|
||||
}
|
||||
}
|
@ -1,37 +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 LocalizeConfig_EN struct {
|
||||
Key string
|
||||
TextEn string
|
||||
}
|
||||
|
||||
const TypeId_LocalizeConfig_EN = 2049582749
|
||||
|
||||
func (*LocalizeConfig_EN) GetTypeId() int32 {
|
||||
return 2049582749
|
||||
}
|
||||
|
||||
func (_v *LocalizeConfig_EN)Deserialize(_buf map[string]interface{}) (err error) {
|
||||
{ var _ok_ bool; if _v.Key, _ok_ = _buf["key"].(string); !_ok_ { err = errors.New("key error"); return } }
|
||||
{ var _ok_ bool; if _v.TextEn, _ok_ = _buf["text_en"].(string); !_ok_ { err = errors.New("text_en error"); return } }
|
||||
return
|
||||
}
|
||||
|
||||
func DeserializeLocalizeConfig_EN(_buf map[string]interface{}) (*LocalizeConfig_EN, error) {
|
||||
v := &LocalizeConfig_EN{}
|
||||
if err := v.Deserialize(_buf); err == nil {
|
||||
return v, nil
|
||||
} else {
|
||||
return nil, err
|
||||
}
|
||||
}
|
@ -1,37 +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 LocalizeConfig_TW struct {
|
||||
Key string
|
||||
TextTw string
|
||||
}
|
||||
|
||||
const TypeId_LocalizeConfig_TW = 2049583223
|
||||
|
||||
func (*LocalizeConfig_TW) GetTypeId() int32 {
|
||||
return 2049583223
|
||||
}
|
||||
|
||||
func (_v *LocalizeConfig_TW)Deserialize(_buf map[string]interface{}) (err error) {
|
||||
{ var _ok_ bool; if _v.Key, _ok_ = _buf["key"].(string); !_ok_ { err = errors.New("key error"); return } }
|
||||
{ var _ok_ bool; if _v.TextTw, _ok_ = _buf["text_tw"].(string); !_ok_ { err = errors.New("text_tw error"); return } }
|
||||
return
|
||||
}
|
||||
|
||||
func DeserializeLocalizeConfig_TW(_buf map[string]interface{}) (*LocalizeConfig_TW, error) {
|
||||
v := &LocalizeConfig_TW{}
|
||||
if err := v.Deserialize(_buf); err == nil {
|
||||
return v, nil
|
||||
} else {
|
||||
return nil, err
|
||||
}
|
||||
}
|
@ -11,9 +11,6 @@ package cfg
|
||||
type JsonLoader func(string) ([]map[string]interface{}, error)
|
||||
|
||||
type Tables struct {
|
||||
LocalizeConfig_CNCategory *LocalizeLocalizeConfig_CNCategory
|
||||
LocalizeConfig_ENCategory *LocalizeLocalizeConfig_ENCategory
|
||||
LocalizeConfig_TWCategory *LocalizeLocalizeConfig_TWCategory
|
||||
global *Gameglobal
|
||||
ui *Gameui
|
||||
plot *Gameplot
|
||||
@ -70,6 +67,14 @@ type Tables struct {
|
||||
pagoda *Gamepagoda
|
||||
pagodaTaskReward *GamepagodaTaskReward
|
||||
pagodaSeasonReward *GamepagodaSeasonReward
|
||||
pagodaseasonLoop *GamepagodaseasonLoop
|
||||
RdtaskAll *GameRdtaskAll
|
||||
RdtaskType *GameRdtaskType
|
||||
RdtaskChoose *GameRdtaskChoose
|
||||
kungfu_unlock *Gamekungfu_unlock
|
||||
kungfu_masterworker *Gamekungfu_masterworker
|
||||
Gourmet *GameGourmet
|
||||
GourmetSkill *GameGourmetSkill
|
||||
}
|
||||
|
||||
func NewTables(loader JsonLoader) (*Tables, error) {
|
||||
@ -77,24 +82,6 @@ func NewTables(loader JsonLoader) (*Tables, error) {
|
||||
var buf []map[string]interface{}
|
||||
|
||||
tables := &Tables{}
|
||||
if buf, err = loader("LocalizeConfig_CN") ; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if tables.LocalizeConfig_CNCategory, err = NewLocalizeLocalizeConfig_CNCategory(buf) ; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf, err = loader("LocalizeConfig_EN") ; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if tables.LocalizeConfig_ENCategory, err = NewLocalizeLocalizeConfig_ENCategory(buf) ; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf, err = loader("LocalizeConfig_TW") ; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if tables.LocalizeConfig_TWCategory, err = NewLocalizeLocalizeConfig_TWCategory(buf) ; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf, err = loader("game_global") ; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -431,5 +418,53 @@ func NewTables(loader JsonLoader) (*Tables, error) {
|
||||
if tables.pagodaSeasonReward, err = NewGamepagodaSeasonReward(buf) ; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf, err = loader("game_pagodaseasonloop") ; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if tables.pagodaseasonLoop, err = NewGamepagodaseasonLoop(buf) ; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf, err = loader("game_rdtaskall") ; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if tables.RdtaskAll, err = NewGameRdtaskAll(buf) ; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf, err = loader("game_rdtasktype") ; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if tables.RdtaskType, err = NewGameRdtaskType(buf) ; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf, err = loader("game_rdtaskchoose") ; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if tables.RdtaskChoose, err = NewGameRdtaskChoose(buf) ; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf, err = loader("game_kungfu_unlock") ; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if tables.kungfu_unlock, err = NewGamekungfu_unlock(buf) ; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf, err = loader("game_kungfu_masterworker") ; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if tables.kungfu_masterworker, err = NewGamekungfu_masterworker(buf) ; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf, err = loader("game_gourmet") ; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if tables.Gourmet, err = NewGameGourmet(buf) ; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if buf, err = loader("game_gourmetskill") ; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if tables.GourmetSkill, err = NewGameGourmetSkill(buf) ; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return tables, nil
|
||||
}
|
||||
|
@ -1,42 +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 GameRdtaksAll struct {
|
||||
_dataMap map[int32]*GameRdtaksAllData
|
||||
_dataList []*GameRdtaksAllData
|
||||
}
|
||||
|
||||
func NewGameRdtaksAll(_buf []map[string]interface{}) (*GameRdtaksAll, error) {
|
||||
_dataList := make([]*GameRdtaksAllData, 0, len(_buf))
|
||||
dataMap := make(map[int32]*GameRdtaksAllData)
|
||||
for _, _ele_ := range _buf {
|
||||
if _v, err2 := DeserializeGameRdtaksAllData(_ele_); err2 != nil {
|
||||
return nil, err2
|
||||
} else {
|
||||
_dataList = append(_dataList, _v)
|
||||
dataMap[_v.RdtaksId] = _v
|
||||
}
|
||||
}
|
||||
return &GameRdtaksAll{_dataList:_dataList, _dataMap:dataMap}, nil
|
||||
}
|
||||
|
||||
func (table *GameRdtaksAll) GetDataMap() map[int32]*GameRdtaksAllData {
|
||||
return table._dataMap
|
||||
}
|
||||
|
||||
func (table *GameRdtaksAll) GetDataList() []*GameRdtaksAllData {
|
||||
return table._dataList
|
||||
}
|
||||
|
||||
func (table *GameRdtaksAll) Get(key int32) *GameRdtaksAllData {
|
||||
return table._dataMap[key]
|
||||
}
|
||||
|
||||
|
@ -1,42 +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 GameRdtaksChoose struct {
|
||||
_dataMap map[int32]*GameRdtaksChooseData
|
||||
_dataList []*GameRdtaksChooseData
|
||||
}
|
||||
|
||||
func NewGameRdtaksChoose(_buf []map[string]interface{}) (*GameRdtaksChoose, error) {
|
||||
_dataList := make([]*GameRdtaksChooseData, 0, len(_buf))
|
||||
dataMap := make(map[int32]*GameRdtaksChooseData)
|
||||
for _, _ele_ := range _buf {
|
||||
if _v, err2 := DeserializeGameRdtaksChooseData(_ele_); err2 != nil {
|
||||
return nil, err2
|
||||
} else {
|
||||
_dataList = append(_dataList, _v)
|
||||
dataMap[_v.ChooseId] = _v
|
||||
}
|
||||
}
|
||||
return &GameRdtaksChoose{_dataList:_dataList, _dataMap:dataMap}, nil
|
||||
}
|
||||
|
||||
func (table *GameRdtaksChoose) GetDataMap() map[int32]*GameRdtaksChooseData {
|
||||
return table._dataMap
|
||||
}
|
||||
|
||||
func (table *GameRdtaksChoose) GetDataList() []*GameRdtaksChooseData {
|
||||
return table._dataList
|
||||
}
|
||||
|
||||
func (table *GameRdtaksChoose) Get(key int32) *GameRdtaksChooseData {
|
||||
return table._dataMap[key]
|
||||
}
|
||||
|
||||
|
@ -1,41 +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 GameRdtaksChooseData struct {
|
||||
ChooseId int32
|
||||
Num int32
|
||||
RdtaksNum int32
|
||||
RdtaksId int32
|
||||
}
|
||||
|
||||
const TypeId_GameRdtaksChooseData = -1888133596
|
||||
|
||||
func (*GameRdtaksChooseData) GetTypeId() int32 {
|
||||
return -1888133596
|
||||
}
|
||||
|
||||
func (_v *GameRdtaksChooseData)Deserialize(_buf map[string]interface{}) (err error) {
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["choose_id"].(float64); !_ok_ { err = errors.New("choose_id error"); return }; _v.ChooseId = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["num"].(float64); !_ok_ { err = errors.New("num error"); return }; _v.Num = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["rdtaks_num"].(float64); !_ok_ { err = errors.New("rdtaks_num error"); return }; _v.RdtaksNum = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["rdtaks_id"].(float64); !_ok_ { err = errors.New("rdtaks_id error"); return }; _v.RdtaksId = int32(_tempNum_) }
|
||||
return
|
||||
}
|
||||
|
||||
func DeserializeGameRdtaksChooseData(_buf map[string]interface{}) (*GameRdtaksChooseData, error) {
|
||||
v := &GameRdtaksChooseData{}
|
||||
if err := v.Deserialize(_buf); err == nil {
|
||||
return v, nil
|
||||
} else {
|
||||
return nil, err
|
||||
}
|
||||
}
|
@ -1,42 +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 Game_drawUpdraw struct {
|
||||
_dataMap map[int32]*Game_drawUpdrawData
|
||||
_dataList []*Game_drawUpdrawData
|
||||
}
|
||||
|
||||
func NewGame_drawUpdraw(_buf []map[string]interface{}) (*Game_drawUpdraw, error) {
|
||||
_dataList := make([]*Game_drawUpdrawData, 0, len(_buf))
|
||||
dataMap := make(map[int32]*Game_drawUpdrawData)
|
||||
for _, _ele_ := range _buf {
|
||||
if _v, err2 := NewGame_drawUpdrawData(_ele_); err2 != nil {
|
||||
return nil, err2
|
||||
} else {
|
||||
_dataList = append(_dataList, _v)
|
||||
dataMap[_v.Key] = _v
|
||||
}
|
||||
}
|
||||
return &Game_drawUpdraw{_dataList:_dataList, _dataMap:dataMap}, nil
|
||||
}
|
||||
|
||||
func (table *Game_drawUpdraw) GetDataMap() map[int32]*Game_drawUpdrawData {
|
||||
return table._dataMap
|
||||
}
|
||||
|
||||
func (table *Game_drawUpdraw) GetDataList() []*Game_drawUpdrawData {
|
||||
return table._dataList
|
||||
}
|
||||
|
||||
func (table *Game_drawUpdraw) Get(key int32) *Game_drawUpdrawData {
|
||||
return table._dataMap[key]
|
||||
}
|
||||
|
||||
|
@ -1,76 +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 Game_drawUpdrawData struct {
|
||||
Key int32
|
||||
TimeOn int32
|
||||
TimeOff int32
|
||||
UpHero []string
|
||||
UpWeight []int32
|
||||
TriggerNum int32
|
||||
IncreaseWeight []int32
|
||||
}
|
||||
|
||||
func (Game_drawUpdrawData) GetTypeId() int {
|
||||
return 297664649
|
||||
}
|
||||
|
||||
func NewGame_drawUpdrawData(_buf map[string]interface{}) (_v *Game_drawUpdrawData, err error) {
|
||||
_v = &Game_drawUpdrawData{}
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["key"].(float64); !_ok_ { err = errors.New("key error"); return }; _v.Key = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["time_on"].(float64); !_ok_ { err = errors.New("time_on error"); return }; _v.TimeOn = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["time_off"].(float64); !_ok_ { err = errors.New("time_off error"); return }; _v.TimeOff = int32(_tempNum_) }
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
if _arr_, _ok_ = _buf["up_hero"].([]interface{}); !_ok_ { err = errors.New("up_hero error"); return }
|
||||
|
||||
_v.UpHero = make([]string, 0, len(_arr_))
|
||||
|
||||
for _, _e_ := range _arr_ {
|
||||
var _list_v_ string
|
||||
{ if _list_v_, _ok_ = _e_.(string); !_ok_ { err = errors.New("_list_v_ error"); return } }
|
||||
_v.UpHero = append(_v.UpHero, _list_v_)
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
if _arr_, _ok_ = _buf["up_weight"].([]interface{}); !_ok_ { err = errors.New("up_weight error"); return }
|
||||
|
||||
_v.UpWeight = 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.UpWeight = append(_v.UpWeight, _list_v_)
|
||||
}
|
||||
}
|
||||
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["trigger_num"].(float64); !_ok_ { err = errors.New("trigger_num error"); return }; _v.TriggerNum = int32(_tempNum_) }
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
if _arr_, _ok_ = _buf["Increase_weight"].([]interface{}); !_ok_ { err = errors.New("Increase_weight error"); return }
|
||||
|
||||
_v.IncreaseWeight = 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.IncreaseWeight = append(_v.IncreaseWeight, _list_v_)
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
42
sys/configure/structs/game.pagodaseasonLoop.go
Normal file
42
sys/configure/structs/game.pagodaseasonLoop.go
Normal file
@ -0,0 +1,42 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
package cfg
|
||||
|
||||
type GamepagodaseasonLoop struct {
|
||||
_dataMap map[int32]*GamepagodaseasonLoopData
|
||||
_dataList []*GamepagodaseasonLoopData
|
||||
}
|
||||
|
||||
func NewGamepagodaseasonLoop(_buf []map[string]interface{}) (*GamepagodaseasonLoop, error) {
|
||||
_dataList := make([]*GamepagodaseasonLoopData, 0, len(_buf))
|
||||
dataMap := make(map[int32]*GamepagodaseasonLoopData)
|
||||
for _, _ele_ := range _buf {
|
||||
if _v, err2 := DeserializeGamepagodaseasonLoopData(_ele_); err2 != nil {
|
||||
return nil, err2
|
||||
} else {
|
||||
_dataList = append(_dataList, _v)
|
||||
dataMap[_v.Key] = _v
|
||||
}
|
||||
}
|
||||
return &GamepagodaseasonLoop{_dataList:_dataList, _dataMap:dataMap}, nil
|
||||
}
|
||||
|
||||
func (table *GamepagodaseasonLoop) GetDataMap() map[int32]*GamepagodaseasonLoopData {
|
||||
return table._dataMap
|
||||
}
|
||||
|
||||
func (table *GamepagodaseasonLoop) GetDataList() []*GamepagodaseasonLoopData {
|
||||
return table._dataList
|
||||
}
|
||||
|
||||
func (table *GamepagodaseasonLoop) Get(key int32) *GamepagodaseasonLoopData {
|
||||
return table._dataMap[key]
|
||||
}
|
||||
|
||||
|
65
sys/configure/structs/game.pagodaseasonLoopData.go
Normal file
65
sys/configure/structs/game.pagodaseasonLoopData.go
Normal file
@ -0,0 +1,65 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <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 GamepagodaseasonLoopData struct {
|
||||
Key int32
|
||||
DisposableLoop []int32
|
||||
FixedLoop []int32
|
||||
}
|
||||
|
||||
const TypeId_GamepagodaseasonLoopData = -1606971581
|
||||
|
||||
func (*GamepagodaseasonLoopData) GetTypeId() int32 {
|
||||
return -1606971581
|
||||
}
|
||||
|
||||
func (_v *GamepagodaseasonLoopData)Deserialize(_buf map[string]interface{}) (err error) {
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["key"].(float64); !_ok_ { err = errors.New("key error"); return }; _v.Key = int32(_tempNum_) }
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
if _arr_, _ok_ = _buf["disposable_loop"].([]interface{}); !_ok_ { err = errors.New("disposable_loop error"); return }
|
||||
|
||||
_v.DisposableLoop = 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.DisposableLoop = append(_v.DisposableLoop, _list_v_)
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
if _arr_, _ok_ = _buf["fixed_loop"].([]interface{}); !_ok_ { err = errors.New("fixed_loop error"); return }
|
||||
|
||||
_v.FixedLoop = 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.FixedLoop = append(_v.FixedLoop, _list_v_)
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func DeserializeGamepagodaseasonLoopData(_buf map[string]interface{}) (*GamepagodaseasonLoopData, error) {
|
||||
v := &GamepagodaseasonLoopData{}
|
||||
if err := v.Deserialize(_buf); err == nil {
|
||||
return v, nil
|
||||
} else {
|
||||
return nil, err
|
||||
}
|
||||
}
|
42
sys/configure/structs/game.rdtaskAll.go
Normal file
42
sys/configure/structs/game.rdtaskAll.go
Normal file
@ -0,0 +1,42 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
package cfg
|
||||
|
||||
type GameRdtaskAll struct {
|
||||
_dataMap map[int32]*GameRdtaskAllData
|
||||
_dataList []*GameRdtaskAllData
|
||||
}
|
||||
|
||||
func NewGameRdtaskAll(_buf []map[string]interface{}) (*GameRdtaskAll, error) {
|
||||
_dataList := make([]*GameRdtaskAllData, 0, len(_buf))
|
||||
dataMap := make(map[int32]*GameRdtaskAllData)
|
||||
for _, _ele_ := range _buf {
|
||||
if _v, err2 := DeserializeGameRdtaskAllData(_ele_); err2 != nil {
|
||||
return nil, err2
|
||||
} else {
|
||||
_dataList = append(_dataList, _v)
|
||||
dataMap[_v.Id] = _v
|
||||
}
|
||||
}
|
||||
return &GameRdtaskAll{_dataList:_dataList, _dataMap:dataMap}, nil
|
||||
}
|
||||
|
||||
func (table *GameRdtaskAll) GetDataMap() map[int32]*GameRdtaskAllData {
|
||||
return table._dataMap
|
||||
}
|
||||
|
||||
func (table *GameRdtaskAll) GetDataList() []*GameRdtaskAllData {
|
||||
return table._dataList
|
||||
}
|
||||
|
||||
func (table *GameRdtaskAll) Get(key int32) *GameRdtaskAllData {
|
||||
return table._dataMap[key]
|
||||
}
|
||||
|
||||
|
@ -10,28 +10,30 @@ package cfg
|
||||
|
||||
import "errors"
|
||||
|
||||
type GameRdtaksAllData struct {
|
||||
RdtaksId int32
|
||||
TaskType int32
|
||||
type GameRdtaskAllData struct {
|
||||
Id int32
|
||||
Type int32
|
||||
Lastend int32
|
||||
RdtaksNum []int32
|
||||
IdLast []int32
|
||||
IdAfter int32
|
||||
IdTag int32
|
||||
Aftertaks int32
|
||||
Icetime int32
|
||||
Tag int32
|
||||
Story int32
|
||||
Completetask int32
|
||||
Chooseid []int32
|
||||
Reword []*Gameatn
|
||||
ChooseId []int32
|
||||
}
|
||||
|
||||
const TypeId_GameRdtaksAllData = -100955128
|
||||
const TypeId_GameRdtaskAllData = 1561697560
|
||||
|
||||
func (*GameRdtaksAllData) GetTypeId() int32 {
|
||||
return -100955128
|
||||
func (*GameRdtaskAllData) GetTypeId() int32 {
|
||||
return 1561697560
|
||||
}
|
||||
|
||||
func (_v *GameRdtaksAllData)Deserialize(_buf map[string]interface{}) (err error) {
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["rdtaks_id"].(float64); !_ok_ { err = errors.New("rdtaks_id error"); return }; _v.RdtaksId = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["task_type"].(float64); !_ok_ { err = errors.New("task_type error"); return }; _v.TaskType = int32(_tempNum_) }
|
||||
func (_v *GameRdtaskAllData)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["type"].(float64); !_ok_ { err = errors.New("type error"); return }; _v.Type = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["lastend"].(float64); !_ok_ { err = errors.New("lastend error"); return }; _v.Lastend = int32(_tempNum_) }
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
@ -46,24 +48,25 @@ func (_v *GameRdtaksAllData)Deserialize(_buf map[string]interface{}) (err error)
|
||||
}
|
||||
}
|
||||
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["aftertaks"].(float64); !_ok_ { err = errors.New("aftertaks error"); return }; _v.Aftertaks = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["icetime"].(float64); !_ok_ { err = errors.New("icetime error"); return }; _v.Icetime = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["tag"].(float64); !_ok_ { err = errors.New("tag error"); return }; _v.Tag = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["story"].(float64); !_ok_ { err = errors.New("story error"); return }; _v.Story = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["completetask"].(float64); !_ok_ { err = errors.New("completetask error"); return }; _v.Completetask = int32(_tempNum_) }
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
if _arr_, _ok_ = _buf["id_last"].([]interface{}); !_ok_ { err = errors.New("id_last error"); return }
|
||||
if _arr_, _ok_ = _buf["chooseid"].([]interface{}); !_ok_ { err = errors.New("chooseid error"); return }
|
||||
|
||||
_v.IdLast = make([]int32, 0, len(_arr_))
|
||||
_v.Chooseid = 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.IdLast = append(_v.IdLast, _list_v_)
|
||||
_v.Chooseid = append(_v.Chooseid, _list_v_)
|
||||
}
|
||||
}
|
||||
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["id_after"].(float64); !_ok_ { err = errors.New("id_after error"); return }; _v.IdAfter = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["id_tag"].(float64); !_ok_ { err = errors.New("id_tag error"); return }; _v.IdTag = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["story"].(float64); !_ok_ { err = errors.New("story error"); return }; _v.Story = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["completetask"].(float64); !_ok_ { err = errors.New("completetask error"); return }; _v.Completetask = int32(_tempNum_) }
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
@ -78,25 +81,11 @@ func (_v *GameRdtaksAllData)Deserialize(_buf map[string]interface{}) (err error)
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
if _arr_, _ok_ = _buf["choose_id"].([]interface{}); !_ok_ { err = errors.New("choose_id error"); return }
|
||||
|
||||
_v.ChooseId = 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.ChooseId = append(_v.ChooseId, _list_v_)
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func DeserializeGameRdtaksAllData(_buf map[string]interface{}) (*GameRdtaksAllData, error) {
|
||||
v := &GameRdtaksAllData{}
|
||||
func DeserializeGameRdtaskAllData(_buf map[string]interface{}) (*GameRdtaskAllData, error) {
|
||||
v := &GameRdtaskAllData{}
|
||||
if err := v.Deserialize(_buf); err == nil {
|
||||
return v, nil
|
||||
} else {
|
42
sys/configure/structs/game.rdtaskChoose.go
Normal file
42
sys/configure/structs/game.rdtaskChoose.go
Normal file
@ -0,0 +1,42 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
package cfg
|
||||
|
||||
type GameRdtaskChoose struct {
|
||||
_dataMap map[int32]*GameRdtaskChooseData
|
||||
_dataList []*GameRdtaskChooseData
|
||||
}
|
||||
|
||||
func NewGameRdtaskChoose(_buf []map[string]interface{}) (*GameRdtaskChoose, error) {
|
||||
_dataList := make([]*GameRdtaskChooseData, 0, len(_buf))
|
||||
dataMap := make(map[int32]*GameRdtaskChooseData)
|
||||
for _, _ele_ := range _buf {
|
||||
if _v, err2 := DeserializeGameRdtaskChooseData(_ele_); err2 != nil {
|
||||
return nil, err2
|
||||
} else {
|
||||
_dataList = append(_dataList, _v)
|
||||
dataMap[_v.Chooseid] = _v
|
||||
}
|
||||
}
|
||||
return &GameRdtaskChoose{_dataList:_dataList, _dataMap:dataMap}, nil
|
||||
}
|
||||
|
||||
func (table *GameRdtaskChoose) GetDataMap() map[int32]*GameRdtaskChooseData {
|
||||
return table._dataMap
|
||||
}
|
||||
|
||||
func (table *GameRdtaskChoose) GetDataList() []*GameRdtaskChooseData {
|
||||
return table._dataList
|
||||
}
|
||||
|
||||
func (table *GameRdtaskChoose) Get(key int32) *GameRdtaskChooseData {
|
||||
return table._dataMap[key]
|
||||
}
|
||||
|
||||
|
54
sys/configure/structs/game.rdtaskChooseData.go
Normal file
54
sys/configure/structs/game.rdtaskChooseData.go
Normal file
@ -0,0 +1,54 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <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 GameRdtaskChooseData struct {
|
||||
Chooseid int32
|
||||
Num int32
|
||||
RdtaksNum int32
|
||||
Need []int32
|
||||
}
|
||||
|
||||
const TypeId_GameRdtaskChooseData = 635237140
|
||||
|
||||
func (*GameRdtaskChooseData) GetTypeId() int32 {
|
||||
return 635237140
|
||||
}
|
||||
|
||||
func (_v *GameRdtaskChooseData)Deserialize(_buf map[string]interface{}) (err error) {
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["chooseid"].(float64); !_ok_ { err = errors.New("chooseid error"); return }; _v.Chooseid = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["num"].(float64); !_ok_ { err = errors.New("num error"); return }; _v.Num = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["rdtaks_num"].(float64); !_ok_ { err = errors.New("rdtaks_num error"); return }; _v.RdtaksNum = int32(_tempNum_) }
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
if _arr_, _ok_ = _buf["need"].([]interface{}); !_ok_ { err = errors.New("need error"); return }
|
||||
|
||||
_v.Need = 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.Need = append(_v.Need, _list_v_)
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func DeserializeGameRdtaskChooseData(_buf map[string]interface{}) (*GameRdtaskChooseData, error) {
|
||||
v := &GameRdtaskChooseData{}
|
||||
if err := v.Deserialize(_buf); err == nil {
|
||||
return v, nil
|
||||
} else {
|
||||
return nil, err
|
||||
}
|
||||
}
|
@ -8,34 +8,34 @@
|
||||
|
||||
package cfg
|
||||
|
||||
type GameRdtaksType struct {
|
||||
_dataMap map[int32]*GameRdtaksTypeData
|
||||
_dataList []*GameRdtaksTypeData
|
||||
type GameRdtaskType struct {
|
||||
_dataMap map[int32]*GameRdtaskTypeData
|
||||
_dataList []*GameRdtaskTypeData
|
||||
}
|
||||
|
||||
func NewGameRdtaksType(_buf []map[string]interface{}) (*GameRdtaksType, error) {
|
||||
_dataList := make([]*GameRdtaksTypeData, 0, len(_buf))
|
||||
dataMap := make(map[int32]*GameRdtaksTypeData)
|
||||
func NewGameRdtaskType(_buf []map[string]interface{}) (*GameRdtaskType, error) {
|
||||
_dataList := make([]*GameRdtaskTypeData, 0, len(_buf))
|
||||
dataMap := make(map[int32]*GameRdtaskTypeData)
|
||||
for _, _ele_ := range _buf {
|
||||
if _v, err2 := DeserializeGameRdtaksTypeData(_ele_); err2 != nil {
|
||||
if _v, err2 := DeserializeGameRdtaskTypeData(_ele_); err2 != nil {
|
||||
return nil, err2
|
||||
} else {
|
||||
_dataList = append(_dataList, _v)
|
||||
dataMap[_v.RdtaksNum] = _v
|
||||
}
|
||||
}
|
||||
return &GameRdtaksType{_dataList:_dataList, _dataMap:dataMap}, nil
|
||||
return &GameRdtaskType{_dataList:_dataList, _dataMap:dataMap}, nil
|
||||
}
|
||||
|
||||
func (table *GameRdtaksType) GetDataMap() map[int32]*GameRdtaksTypeData {
|
||||
func (table *GameRdtaskType) GetDataMap() map[int32]*GameRdtaskTypeData {
|
||||
return table._dataMap
|
||||
}
|
||||
|
||||
func (table *GameRdtaksType) GetDataList() []*GameRdtaksTypeData {
|
||||
func (table *GameRdtaskType) GetDataList() []*GameRdtaskTypeData {
|
||||
return table._dataList
|
||||
}
|
||||
|
||||
func (table *GameRdtaksType) Get(key int32) *GameRdtaksTypeData {
|
||||
func (table *GameRdtaskType) Get(key int32) *GameRdtaskTypeData {
|
||||
return table._dataMap[key]
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ package cfg
|
||||
|
||||
import "errors"
|
||||
|
||||
type GameRdtaksTypeData struct {
|
||||
type GameRdtaskTypeData struct {
|
||||
RdtaksNum int32
|
||||
Typdes int32
|
||||
Datatime int32
|
||||
@ -20,13 +20,13 @@ type GameRdtaksTypeData struct {
|
||||
Data3 int32
|
||||
}
|
||||
|
||||
const TypeId_GameRdtaksTypeData = -1284226425
|
||||
const TypeId_GameRdtaskTypeData = -1281600649
|
||||
|
||||
func (*GameRdtaksTypeData) GetTypeId() int32 {
|
||||
return -1284226425
|
||||
func (*GameRdtaskTypeData) GetTypeId() int32 {
|
||||
return -1281600649
|
||||
}
|
||||
|
||||
func (_v *GameRdtaksTypeData)Deserialize(_buf map[string]interface{}) (err error) {
|
||||
func (_v *GameRdtaskTypeData)Deserialize(_buf map[string]interface{}) (err error) {
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["rdtaks_num"].(float64); !_ok_ { err = errors.New("rdtaks_num error"); return }; _v.RdtaksNum = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["typdes"].(float64); !_ok_ { err = errors.New("typdes error"); return }; _v.Typdes = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["datatime"].(float64); !_ok_ { err = errors.New("datatime error"); return }; _v.Datatime = int32(_tempNum_) }
|
||||
@ -37,8 +37,8 @@ func (_v *GameRdtaksTypeData)Deserialize(_buf map[string]interface{}) (err error
|
||||
return
|
||||
}
|
||||
|
||||
func DeserializeGameRdtaksTypeData(_buf map[string]interface{}) (*GameRdtaksTypeData, error) {
|
||||
v := &GameRdtaksTypeData{}
|
||||
func DeserializeGameRdtaskTypeData(_buf map[string]interface{}) (*GameRdtaskTypeData, error) {
|
||||
v := &GameRdtaskTypeData{}
|
||||
if err := v.Deserialize(_buf); err == nil {
|
||||
return v, nil
|
||||
} else {
|
@ -1,42 +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 Game_serverList struct {
|
||||
_dataMap map[int32]*Game_serverListData
|
||||
_dataList []*Game_serverListData
|
||||
}
|
||||
|
||||
func NewGame_serverList(_buf []map[string]interface{}) (*Game_serverList, error) {
|
||||
_dataList := make([]*Game_serverListData, 0, len(_buf))
|
||||
dataMap := make(map[int32]*Game_serverListData)
|
||||
for _, _ele_ := range _buf {
|
||||
if _v, err2 := NewGame_serverListData(_ele_); err2 != nil {
|
||||
return nil, err2
|
||||
} else {
|
||||
_dataList = append(_dataList, _v)
|
||||
dataMap[_v.Id] = _v
|
||||
}
|
||||
}
|
||||
return &Game_serverList{_dataList:_dataList, _dataMap:dataMap}, nil
|
||||
}
|
||||
|
||||
func (table *Game_serverList) GetDataMap() map[int32]*Game_serverListData {
|
||||
return table._dataMap
|
||||
}
|
||||
|
||||
func (table *Game_serverList) GetDataList() []*Game_serverListData {
|
||||
return table._dataList
|
||||
}
|
||||
|
||||
func (table *Game_serverList) Get(key int32) *Game_serverListData {
|
||||
return table._dataMap[key]
|
||||
}
|
||||
|
||||
|
@ -1,33 +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 Game_serverListData struct {
|
||||
Id int32
|
||||
Ip string
|
||||
Port int32
|
||||
GroupId int32
|
||||
Name string
|
||||
}
|
||||
|
||||
func (Game_serverListData) GetTypeId() int {
|
||||
return 292904775
|
||||
}
|
||||
|
||||
func NewGame_serverListData(_buf map[string]interface{}) (_v *Game_serverListData, err error) {
|
||||
_v = &Game_serverListData{}
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["id"].(float64); !_ok_ { err = errors.New("id error"); return }; _v.Id = int32(_tempNum_) }
|
||||
{ var _ok_ bool; if _v.Ip, _ok_ = _buf["ip"].(string); !_ok_ { err = errors.New("ip error"); return } }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["port"].(float64); !_ok_ { err = errors.New("port error"); return }; _v.Port = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["groupId"].(float64); !_ok_ { err = errors.New("groupId error"); return }; _v.GroupId = int32(_tempNum_) }
|
||||
{ var _ok_ bool; if _v.Name, _ok_ = _buf["name"].(string); !_ok_ { err = errors.New("name error"); return } }
|
||||
return
|
||||
}
|
@ -16,6 +16,7 @@ type GameskillAfteratkData struct {
|
||||
From int32
|
||||
Limit int32
|
||||
EmitPR int32
|
||||
AfteratkAct string
|
||||
Where []string
|
||||
Order []string
|
||||
Type string
|
||||
@ -42,6 +43,7 @@ func (_v *GameskillAfteratkData)Deserialize(_buf map[string]interface{}) (err er
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["From"].(float64); !_ok_ { err = errors.New("From error"); return }; _v.From = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["Limit"].(float64); !_ok_ { err = errors.New("Limit error"); return }; _v.Limit = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["EmitPR"].(float64); !_ok_ { err = errors.New("EmitPR error"); return }; _v.EmitPR = int32(_tempNum_) }
|
||||
{ var _ok_ bool; if _v.AfteratkAct, _ok_ = _buf["AfteratkAct"].(string); !_ok_ { err = errors.New("AfteratkAct error"); return } }
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
|
@ -20,6 +20,16 @@ func UIdSplit(uid string) (string, string, bool) {
|
||||
return s[0], s[1], true
|
||||
}
|
||||
|
||||
func Findx[T string | int32](slice []T, val T) (int, bool) {
|
||||
for i, item := range slice {
|
||||
if item == val {
|
||||
return i, true
|
||||
}
|
||||
}
|
||||
return -1, false
|
||||
}
|
||||
|
||||
// Deprecated: Use Findx instead
|
||||
func Find(slice []string, val string) (int, bool) {
|
||||
for i, item := range slice {
|
||||
if item == val {
|
||||
|
Loading…
Reference in New Issue
Block a user