Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
09f0342558
@ -79,6 +79,31 @@
|
||||
"t": "10005",
|
||||
"n": 1
|
||||
},
|
||||
"base_pool_10cost": {
|
||||
"a": "item",
|
||||
"t": "10001",
|
||||
"n": 10
|
||||
},
|
||||
"camp1_pool_10cost": {
|
||||
"a": "item",
|
||||
"t": "10002",
|
||||
"n": 10
|
||||
},
|
||||
"camp2_pool_10cost": {
|
||||
"a": "item",
|
||||
"t": "10003",
|
||||
"n": 10
|
||||
},
|
||||
"camp3_pool_10cost": {
|
||||
"a": "item",
|
||||
"t": "10004",
|
||||
"n": 10
|
||||
},
|
||||
"camp4_pool_10cost": {
|
||||
"a": "item",
|
||||
"t": "10005",
|
||||
"n": 10
|
||||
},
|
||||
"camp1_pool1": "camp1_pool",
|
||||
"camp2_pool1": "camp2_pool",
|
||||
"camp3_pool1": "camp3_pool",
|
||||
@ -109,6 +134,8 @@
|
||||
"camp_pool_star3": 9000,
|
||||
"camp_pool_star4": 900,
|
||||
"camp_pool_star5": 100,
|
||||
"gourmet": 500
|
||||
"gourmet": 500,
|
||||
"smithy_maxplayer": 20,
|
||||
"smithy_maxtime": 36000
|
||||
}
|
||||
]
|
@ -11,16 +11,6 @@
|
||||
},
|
||||
{
|
||||
"index": 2,
|
||||
"name": {
|
||||
"key": "server_10003",
|
||||
"text": "和平谷"
|
||||
},
|
||||
"ips": "119.3.89.14:7891",
|
||||
"debug": false,
|
||||
"sid": ""
|
||||
},
|
||||
{
|
||||
"index": 3,
|
||||
"name": {
|
||||
"key": "debug_server_01",
|
||||
"text": "lw"
|
||||
@ -30,7 +20,7 @@
|
||||
"sid": "dfli01"
|
||||
},
|
||||
{
|
||||
"index": 4,
|
||||
"index": 3,
|
||||
"name": {
|
||||
"key": "debug_server_02",
|
||||
"text": "mxf"
|
||||
@ -40,33 +30,43 @@
|
||||
"sid": "dfmxf"
|
||||
},
|
||||
{
|
||||
"index": 5,
|
||||
"index": 4,
|
||||
"name": {
|
||||
"key": "server_10004",
|
||||
"text": "凤凰城"
|
||||
},
|
||||
"ips": "119.3.89.14:7891",
|
||||
"ips": "119.3.89.14:9891",
|
||||
"debug": false,
|
||||
"sid": ""
|
||||
"sid": "df01"
|
||||
},
|
||||
{
|
||||
"index": 6,
|
||||
"index": 5,
|
||||
"name": {
|
||||
"key": "server_10005",
|
||||
"text": "翡翠宫"
|
||||
},
|
||||
"ips": "119.3.89.14:7891",
|
||||
"ips": "119.3.89.14:9891",
|
||||
"debug": false,
|
||||
"sid": ""
|
||||
"sid": "df01"
|
||||
},
|
||||
{
|
||||
"index": 7,
|
||||
"index": 6,
|
||||
"name": {
|
||||
"key": "server_10006",
|
||||
"text": "乌鸦岭"
|
||||
},
|
||||
"ips": "119.3.89.14:7891",
|
||||
"ips": "119.3.89.14:9891",
|
||||
"debug": false,
|
||||
"sid": ""
|
||||
"sid": "df01"
|
||||
},
|
||||
{
|
||||
"index": 7,
|
||||
"name": {
|
||||
"key": "server_10003",
|
||||
"text": "和平谷"
|
||||
},
|
||||
"ips": "119.3.89.14:9891",
|
||||
"debug": false,
|
||||
"sid": "df01"
|
||||
}
|
||||
]
|
@ -79,6 +79,31 @@
|
||||
"t": "10005",
|
||||
"n": 1
|
||||
},
|
||||
"base_pool_10cost": {
|
||||
"a": "item",
|
||||
"t": "10001",
|
||||
"n": 10
|
||||
},
|
||||
"camp1_pool_10cost": {
|
||||
"a": "item",
|
||||
"t": "10002",
|
||||
"n": 10
|
||||
},
|
||||
"camp2_pool_10cost": {
|
||||
"a": "item",
|
||||
"t": "10003",
|
||||
"n": 10
|
||||
},
|
||||
"camp3_pool_10cost": {
|
||||
"a": "item",
|
||||
"t": "10004",
|
||||
"n": 10
|
||||
},
|
||||
"camp4_pool_10cost": {
|
||||
"a": "item",
|
||||
"t": "10005",
|
||||
"n": 10
|
||||
},
|
||||
"camp1_pool1": "camp1_pool",
|
||||
"camp2_pool1": "camp2_pool",
|
||||
"camp3_pool1": "camp3_pool",
|
||||
@ -109,6 +134,8 @@
|
||||
"camp_pool_star3": 9000,
|
||||
"camp_pool_star4": 900,
|
||||
"camp_pool_star5": 100,
|
||||
"gourmet": 500
|
||||
"gourmet": 500,
|
||||
"smithy_maxplayer": 20,
|
||||
"smithy_maxtime": 36000
|
||||
}
|
||||
]
|
66
bin/json/game_rdtaksall.json
Normal file
66
bin/json/game_rdtaksall.json
Normal file
@ -0,0 +1,66 @@
|
||||
[
|
||||
{
|
||||
"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
|
||||
]
|
||||
}
|
||||
]
|
38
bin/json/game_rdtakschoose.json
Normal file
38
bin/json/game_rdtakschoose.json
Normal file
@ -0,0 +1,38 @@
|
||||
[
|
||||
{
|
||||
"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
|
||||
}
|
||||
]
|
74
bin/json/game_rdtakstype.json
Normal file
74
bin/json/game_rdtakstype.json
Normal file
@ -0,0 +1,74 @@
|
||||
[
|
||||
{
|
||||
"rdtaks_num": 101,
|
||||
"typdes": 2,
|
||||
"datatime": 1,
|
||||
"typtask_id": 1,
|
||||
"data1": 90001,
|
||||
"data2": 0,
|
||||
"data3": 0
|
||||
},
|
||||
{
|
||||
"rdtaks_num": 102,
|
||||
"typdes": 2,
|
||||
"datatime": 1,
|
||||
"typtask_id": 2,
|
||||
"data1": 10,
|
||||
"data2": 0,
|
||||
"data3": 0
|
||||
},
|
||||
{
|
||||
"rdtaks_num": 103,
|
||||
"typdes": 2,
|
||||
"datatime": 1,
|
||||
"typtask_id": 3,
|
||||
"data1": 3,
|
||||
"data2": 0,
|
||||
"data3": 0
|
||||
},
|
||||
{
|
||||
"rdtaks_num": 104,
|
||||
"typdes": 2,
|
||||
"datatime": 1,
|
||||
"typtask_id": 4,
|
||||
"data1": 2,
|
||||
"data2": 0,
|
||||
"data3": 0
|
||||
},
|
||||
{
|
||||
"rdtaks_num": 105,
|
||||
"typdes": 2,
|
||||
"datatime": 1,
|
||||
"typtask_id": 5,
|
||||
"data1": 101,
|
||||
"data2": 0,
|
||||
"data3": 0
|
||||
},
|
||||
{
|
||||
"rdtaks_num": 106,
|
||||
"typdes": 2,
|
||||
"datatime": 1,
|
||||
"typtask_id": 6,
|
||||
"data1": 3,
|
||||
"data2": 0,
|
||||
"data3": 0
|
||||
},
|
||||
{
|
||||
"rdtaks_num": 107,
|
||||
"typdes": 2,
|
||||
"datatime": 1,
|
||||
"typtask_id": 7,
|
||||
"data1": 10002,
|
||||
"data2": 0,
|
||||
"data3": 0
|
||||
},
|
||||
{
|
||||
"rdtaks_num": 108,
|
||||
"typdes": 2,
|
||||
"datatime": 1,
|
||||
"typtask_id": 8,
|
||||
"data1": 90001,
|
||||
"data2": 15,
|
||||
"data3": 0
|
||||
}
|
||||
]
|
@ -6733,21 +6733,10 @@
|
||||
"Type": 3,
|
||||
"MaxLV": 1,
|
||||
"CD": [
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
-1
|
||||
],
|
||||
"Target": 1,
|
||||
"ChildSkill": [
|
||||
{
|
||||
"Id": [
|
||||
225004011
|
||||
]
|
||||
}
|
||||
],
|
||||
"ChildSkill": [],
|
||||
"Desc": [
|
||||
"skill_1250040111"
|
||||
],
|
||||
@ -6759,7 +6748,7 @@
|
||||
"key": "skillname_125004111",
|
||||
"text": "波比1技能"
|
||||
},
|
||||
"ico": "skillicon_004",
|
||||
"ico": "jn_icon_001",
|
||||
"act": "Skill_1",
|
||||
"Type": 1,
|
||||
"MaxLV": 6,
|
||||
@ -6772,44 +6761,7 @@
|
||||
0
|
||||
],
|
||||
"Target": 4,
|
||||
"ChildSkill": [
|
||||
{
|
||||
"Id": [
|
||||
225004111,
|
||||
225004112
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
225004121,
|
||||
225004122
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
225004131,
|
||||
225004132
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
225004141,
|
||||
225004142
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
225004151,
|
||||
225004152
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
225004161,
|
||||
225004162
|
||||
]
|
||||
}
|
||||
],
|
||||
"ChildSkill": [],
|
||||
"Desc": [
|
||||
"skill_1250041111",
|
||||
"skill_1250041112",
|
||||
@ -6826,42 +6778,17 @@
|
||||
"key": "skillname_125004211",
|
||||
"text": "波比2技能"
|
||||
},
|
||||
"ico": "skillicon_005",
|
||||
"ico": "jn_icon_002",
|
||||
"act": "Skill_2",
|
||||
"Type": 2,
|
||||
"MaxLV": 3,
|
||||
"CD": [
|
||||
5,
|
||||
4,
|
||||
3,
|
||||
3,
|
||||
3,
|
||||
3
|
||||
],
|
||||
"Target": 1,
|
||||
"ChildSkill": [
|
||||
{
|
||||
"Id": [
|
||||
225004211,
|
||||
225004212,
|
||||
225004213
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
225004211,
|
||||
225004212,
|
||||
225004213
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
225004211,
|
||||
225004212,
|
||||
225004213
|
||||
]
|
||||
}
|
||||
],
|
||||
"ChildSkill": [],
|
||||
"Desc": [
|
||||
"skill_1250042111",
|
||||
"skill_1250042112",
|
||||
@ -6875,7 +6802,7 @@
|
||||
"key": "skillname_125004311",
|
||||
"text": "波比3技能"
|
||||
},
|
||||
"ico": "skillicon_006",
|
||||
"ico": "jn_icon_003",
|
||||
"act": "Skill_3",
|
||||
"Type": 1,
|
||||
"MaxLV": 5,
|
||||
@ -6884,37 +6811,10 @@
|
||||
5,
|
||||
5,
|
||||
5,
|
||||
4,
|
||||
4
|
||||
],
|
||||
"Target": 1,
|
||||
"ChildSkill": [
|
||||
{
|
||||
"Id": [
|
||||
225004311
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
225004312
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
225004313
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
225004314
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
225004315
|
||||
]
|
||||
}
|
||||
],
|
||||
"ChildSkill": [],
|
||||
"Desc": [
|
||||
"skill_1250043111",
|
||||
"skill_1250043112",
|
||||
@ -6935,21 +6835,10 @@
|
||||
"Type": 3,
|
||||
"MaxLV": 1,
|
||||
"CD": [
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
-1
|
||||
],
|
||||
"Target": 1,
|
||||
"ChildSkill": [
|
||||
{
|
||||
"Id": [
|
||||
235002011
|
||||
]
|
||||
}
|
||||
],
|
||||
"ChildSkill": [],
|
||||
"Desc": [
|
||||
"skill_1350020111"
|
||||
],
|
||||
@ -6961,7 +6850,7 @@
|
||||
"key": "skillname_135002111",
|
||||
"text": "希卡普1技能"
|
||||
},
|
||||
"ico": "skillicon_007",
|
||||
"ico": "jn_icon_001",
|
||||
"act": "Skill_1",
|
||||
"Type": 1,
|
||||
"MaxLV": 6,
|
||||
@ -6974,47 +6863,7 @@
|
||||
0
|
||||
],
|
||||
"Target": 4,
|
||||
"ChildSkill": [
|
||||
{
|
||||
"Id": [
|
||||
235002011,
|
||||
235002111,
|
||||
235002112,
|
||||
235002113,
|
||||
235002114
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
235002122,
|
||||
235002124
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
235002132,
|
||||
235002134
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
235002142,
|
||||
235002144
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
235002152,
|
||||
235002154
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
235002162,
|
||||
235002164
|
||||
]
|
||||
}
|
||||
],
|
||||
"ChildSkill": [],
|
||||
"Desc": [
|
||||
"skill_1350021111",
|
||||
"skill_1350021112",
|
||||
@ -7031,7 +6880,7 @@
|
||||
"key": "skillname_135002211",
|
||||
"text": "希卡普2技能"
|
||||
},
|
||||
"ico": "skillicon_008",
|
||||
"ico": "jn_icon_002",
|
||||
"act": "Skill_2",
|
||||
"Type": 2,
|
||||
"MaxLV": 1,
|
||||
@ -7039,17 +6888,7 @@
|
||||
-1
|
||||
],
|
||||
"Target": 1,
|
||||
"ChildSkill": [
|
||||
{
|
||||
"Id": [
|
||||
235002211,
|
||||
235002212,
|
||||
235002213,
|
||||
235002214,
|
||||
235002215
|
||||
]
|
||||
}
|
||||
],
|
||||
"ChildSkill": [],
|
||||
"Desc": [
|
||||
"skill_1350022111"
|
||||
],
|
||||
@ -7061,7 +6900,7 @@
|
||||
"key": "skillname_135002311",
|
||||
"text": "希卡普3技能"
|
||||
},
|
||||
"ico": "skillicon_009",
|
||||
"ico": "jn_icon_003",
|
||||
"act": "Skill_3",
|
||||
"Type": 1,
|
||||
"MaxLV": 6,
|
||||
@ -7074,45 +6913,7 @@
|
||||
4
|
||||
],
|
||||
"Target": 2,
|
||||
"ChildSkill": [
|
||||
{
|
||||
"Id": [
|
||||
235002311,
|
||||
235002312,
|
||||
235002313
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
235002321,
|
||||
235002322
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
235002331,
|
||||
235002332
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
235002341,
|
||||
235002342
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
235002351,
|
||||
235002352
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
235002361,
|
||||
235002362
|
||||
]
|
||||
}
|
||||
],
|
||||
"ChildSkill": [],
|
||||
"Desc": [
|
||||
"skill_1350023111",
|
||||
"skill_1350023112",
|
||||
@ -7126,7 +6927,7 @@
|
||||
{
|
||||
"Id": 935002411,
|
||||
"Name": {
|
||||
"key": "skillname_935002321",
|
||||
"key": "skillname_935002411",
|
||||
"text": "希卡普3技能"
|
||||
},
|
||||
"ico": "jn_icon_003",
|
||||
@ -7142,46 +6943,7 @@
|
||||
4
|
||||
],
|
||||
"Target": 2,
|
||||
"ChildSkill": [
|
||||
{
|
||||
"Id": [
|
||||
935002311,
|
||||
935002312,
|
||||
935002313,
|
||||
935002314
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
935002321,
|
||||
935002322
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
935002331,
|
||||
935002332
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
935002341,
|
||||
935002342
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
935002351,
|
||||
935002352
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
935002361,
|
||||
935002362
|
||||
]
|
||||
}
|
||||
],
|
||||
"ChildSkill": [],
|
||||
"Desc": [
|
||||
"skill_9350023211",
|
||||
"skill_9350023212",
|
||||
@ -7206,13 +6968,7 @@
|
||||
-1
|
||||
],
|
||||
"Target": 1,
|
||||
"ChildSkill": [
|
||||
{
|
||||
"Id": [
|
||||
224003011
|
||||
]
|
||||
}
|
||||
],
|
||||
"ChildSkill": [],
|
||||
"Desc": [
|
||||
"skill_1240030111"
|
||||
],
|
||||
@ -7236,44 +6992,7 @@
|
||||
0
|
||||
],
|
||||
"Target": 4,
|
||||
"ChildSkill": [
|
||||
{
|
||||
"Id": [
|
||||
224003111,
|
||||
224003112
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
224003121,
|
||||
224003122
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
224003131,
|
||||
224003132
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
224003141,
|
||||
224003142
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
224003151,
|
||||
224003152
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
224003161,
|
||||
224003162
|
||||
]
|
||||
}
|
||||
],
|
||||
"ChildSkill": [],
|
||||
"Desc": [
|
||||
"skill_1240031111",
|
||||
"skill_1240031112",
|
||||
@ -7298,20 +7017,7 @@
|
||||
3
|
||||
],
|
||||
"Target": 1,
|
||||
"ChildSkill": [
|
||||
{
|
||||
"Id": [
|
||||
224003211,
|
||||
224003212
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
224003211,
|
||||
224003212
|
||||
]
|
||||
}
|
||||
],
|
||||
"ChildSkill": [],
|
||||
"Desc": [
|
||||
"skill_1240032111",
|
||||
"skill_1240032112"
|
||||
@ -7337,50 +7043,7 @@
|
||||
3
|
||||
],
|
||||
"Target": 2,
|
||||
"ChildSkill": [
|
||||
{
|
||||
"Id": [
|
||||
224003311,
|
||||
224003312,
|
||||
224003313
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
224003311,
|
||||
224003322,
|
||||
224003323
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
224003311,
|
||||
224003332,
|
||||
224003333
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
224003311,
|
||||
224003342,
|
||||
224003343
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
224003311,
|
||||
224003352,
|
||||
224003353
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
224003311,
|
||||
224003362,
|
||||
224003363
|
||||
]
|
||||
}
|
||||
],
|
||||
"ChildSkill": [],
|
||||
"Desc": [
|
||||
"skill_1240033111",
|
||||
"skill_1240033112",
|
||||
@ -7406,26 +7069,117 @@
|
||||
3
|
||||
],
|
||||
"Target": 1,
|
||||
"ChildSkill": [
|
||||
{
|
||||
"Id": [
|
||||
924003411,
|
||||
924003412,
|
||||
924003413
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
924003411,
|
||||
924003412,
|
||||
924003413
|
||||
]
|
||||
}
|
||||
],
|
||||
"ChildSkill": [],
|
||||
"Desc": [
|
||||
"skill_9240034111",
|
||||
"skill_9240034112"
|
||||
],
|
||||
"buffid": []
|
||||
},
|
||||
{
|
||||
"Id": 134006011,
|
||||
"Name": {
|
||||
"key": "skillname_134006011",
|
||||
"text": "杰克队长技"
|
||||
},
|
||||
"ico": "jn_dzj_01",
|
||||
"act": "Skill_1",
|
||||
"Type": 3,
|
||||
"MaxLV": 1,
|
||||
"CD": [
|
||||
-1
|
||||
],
|
||||
"Target": 1,
|
||||
"ChildSkill": [],
|
||||
"Desc": [],
|
||||
"buffid": []
|
||||
},
|
||||
{
|
||||
"Id": 134006111,
|
||||
"Name": {
|
||||
"key": "skillname_134006111",
|
||||
"text": "杰克1技能"
|
||||
},
|
||||
"ico": "jn_icon_001",
|
||||
"act": "Skill_2",
|
||||
"Type": 1,
|
||||
"MaxLV": 5,
|
||||
"CD": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"Target": 4,
|
||||
"ChildSkill": [],
|
||||
"Desc": [],
|
||||
"buffid": []
|
||||
},
|
||||
{
|
||||
"Id": 134006211,
|
||||
"Name": {
|
||||
"key": "skillname_134006211",
|
||||
"text": "杰克2技能"
|
||||
},
|
||||
"ico": "jn_icon_002",
|
||||
"act": "Skill_3",
|
||||
"Type": 1,
|
||||
"MaxLV": 5,
|
||||
"CD": [
|
||||
5,
|
||||
5,
|
||||
5,
|
||||
5,
|
||||
4
|
||||
],
|
||||
"Target": 2,
|
||||
"ChildSkill": [],
|
||||
"Desc": [],
|
||||
"buffid": []
|
||||
},
|
||||
{
|
||||
"Id": 134006311,
|
||||
"Name": {
|
||||
"key": "skillname_134006311",
|
||||
"text": "杰克3技能"
|
||||
},
|
||||
"ico": "jn_icon_003",
|
||||
"act": "Skill_2",
|
||||
"Type": 1,
|
||||
"MaxLV": 5,
|
||||
"CD": [
|
||||
4,
|
||||
4,
|
||||
4,
|
||||
4,
|
||||
3
|
||||
],
|
||||
"Target": 2,
|
||||
"ChildSkill": [],
|
||||
"Desc": [],
|
||||
"buffid": []
|
||||
},
|
||||
{
|
||||
"Id": 934006411,
|
||||
"Name": {
|
||||
"key": "skillname_934006411",
|
||||
"text": "杰克2技能"
|
||||
},
|
||||
"ico": "jn_icon_002",
|
||||
"act": "Skill_3",
|
||||
"Type": 4,
|
||||
"MaxLV": 5,
|
||||
"CD": [
|
||||
5,
|
||||
5,
|
||||
5,
|
||||
5,
|
||||
4
|
||||
],
|
||||
"Target": 2,
|
||||
"ChildSkill": [],
|
||||
"Desc": [],
|
||||
"buffid": []
|
||||
}
|
||||
]
|
File diff suppressed because it is too large
Load Diff
@ -6733,21 +6733,10 @@
|
||||
"Type": 3,
|
||||
"MaxLV": 1,
|
||||
"CD": [
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
-1
|
||||
],
|
||||
"Target": 1,
|
||||
"ChildSkill": [
|
||||
{
|
||||
"Id": [
|
||||
225004011
|
||||
]
|
||||
}
|
||||
],
|
||||
"ChildSkill": [],
|
||||
"Desc": [
|
||||
"skill_1250040111"
|
||||
],
|
||||
@ -6759,7 +6748,7 @@
|
||||
"key": "skillname_125004111",
|
||||
"text": "波比1技能"
|
||||
},
|
||||
"ico": "skillicon_004",
|
||||
"ico": "jn_icon_001",
|
||||
"act": "Skill_1",
|
||||
"Type": 1,
|
||||
"MaxLV": 6,
|
||||
@ -6772,44 +6761,7 @@
|
||||
0
|
||||
],
|
||||
"Target": 4,
|
||||
"ChildSkill": [
|
||||
{
|
||||
"Id": [
|
||||
225004111,
|
||||
225004112
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
225004121,
|
||||
225004122
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
225004131,
|
||||
225004132
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
225004141,
|
||||
225004142
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
225004151,
|
||||
225004152
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
225004161,
|
||||
225004162
|
||||
]
|
||||
}
|
||||
],
|
||||
"ChildSkill": [],
|
||||
"Desc": [
|
||||
"skill_1250041111",
|
||||
"skill_1250041112",
|
||||
@ -6826,42 +6778,17 @@
|
||||
"key": "skillname_125004211",
|
||||
"text": "波比2技能"
|
||||
},
|
||||
"ico": "skillicon_005",
|
||||
"ico": "jn_icon_002",
|
||||
"act": "Skill_2",
|
||||
"Type": 2,
|
||||
"MaxLV": 3,
|
||||
"CD": [
|
||||
5,
|
||||
4,
|
||||
3,
|
||||
3,
|
||||
3,
|
||||
3
|
||||
],
|
||||
"Target": 1,
|
||||
"ChildSkill": [
|
||||
{
|
||||
"Id": [
|
||||
225004211,
|
||||
225004212,
|
||||
225004213
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
225004211,
|
||||
225004212,
|
||||
225004213
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
225004211,
|
||||
225004212,
|
||||
225004213
|
||||
]
|
||||
}
|
||||
],
|
||||
"ChildSkill": [],
|
||||
"Desc": [
|
||||
"skill_1250042111",
|
||||
"skill_1250042112",
|
||||
@ -6875,7 +6802,7 @@
|
||||
"key": "skillname_125004311",
|
||||
"text": "波比3技能"
|
||||
},
|
||||
"ico": "skillicon_006",
|
||||
"ico": "jn_icon_003",
|
||||
"act": "Skill_3",
|
||||
"Type": 1,
|
||||
"MaxLV": 5,
|
||||
@ -6884,37 +6811,10 @@
|
||||
5,
|
||||
5,
|
||||
5,
|
||||
4,
|
||||
4
|
||||
],
|
||||
"Target": 1,
|
||||
"ChildSkill": [
|
||||
{
|
||||
"Id": [
|
||||
225004311
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
225004312
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
225004313
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
225004314
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
225004315
|
||||
]
|
||||
}
|
||||
],
|
||||
"ChildSkill": [],
|
||||
"Desc": [
|
||||
"skill_1250043111",
|
||||
"skill_1250043112",
|
||||
@ -6935,21 +6835,10 @@
|
||||
"Type": 3,
|
||||
"MaxLV": 1,
|
||||
"CD": [
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
-1
|
||||
],
|
||||
"Target": 1,
|
||||
"ChildSkill": [
|
||||
{
|
||||
"Id": [
|
||||
235002011
|
||||
]
|
||||
}
|
||||
],
|
||||
"ChildSkill": [],
|
||||
"Desc": [
|
||||
"skill_1350020111"
|
||||
],
|
||||
@ -6961,7 +6850,7 @@
|
||||
"key": "skillname_135002111",
|
||||
"text": "希卡普1技能"
|
||||
},
|
||||
"ico": "skillicon_007",
|
||||
"ico": "jn_icon_001",
|
||||
"act": "Skill_1",
|
||||
"Type": 1,
|
||||
"MaxLV": 6,
|
||||
@ -6974,47 +6863,7 @@
|
||||
0
|
||||
],
|
||||
"Target": 4,
|
||||
"ChildSkill": [
|
||||
{
|
||||
"Id": [
|
||||
235002011,
|
||||
235002111,
|
||||
235002112,
|
||||
235002113,
|
||||
235002114
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
235002122,
|
||||
235002124
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
235002132,
|
||||
235002134
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
235002142,
|
||||
235002144
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
235002152,
|
||||
235002154
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
235002162,
|
||||
235002164
|
||||
]
|
||||
}
|
||||
],
|
||||
"ChildSkill": [],
|
||||
"Desc": [
|
||||
"skill_1350021111",
|
||||
"skill_1350021112",
|
||||
@ -7031,7 +6880,7 @@
|
||||
"key": "skillname_135002211",
|
||||
"text": "希卡普2技能"
|
||||
},
|
||||
"ico": "skillicon_008",
|
||||
"ico": "jn_icon_002",
|
||||
"act": "Skill_2",
|
||||
"Type": 2,
|
||||
"MaxLV": 1,
|
||||
@ -7039,17 +6888,7 @@
|
||||
-1
|
||||
],
|
||||
"Target": 1,
|
||||
"ChildSkill": [
|
||||
{
|
||||
"Id": [
|
||||
235002211,
|
||||
235002212,
|
||||
235002213,
|
||||
235002214,
|
||||
235002215
|
||||
]
|
||||
}
|
||||
],
|
||||
"ChildSkill": [],
|
||||
"Desc": [
|
||||
"skill_1350022111"
|
||||
],
|
||||
@ -7061,7 +6900,7 @@
|
||||
"key": "skillname_135002311",
|
||||
"text": "希卡普3技能"
|
||||
},
|
||||
"ico": "skillicon_009",
|
||||
"ico": "jn_icon_003",
|
||||
"act": "Skill_3",
|
||||
"Type": 1,
|
||||
"MaxLV": 6,
|
||||
@ -7074,45 +6913,7 @@
|
||||
4
|
||||
],
|
||||
"Target": 2,
|
||||
"ChildSkill": [
|
||||
{
|
||||
"Id": [
|
||||
235002311,
|
||||
235002312,
|
||||
235002313
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
235002321,
|
||||
235002322
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
235002331,
|
||||
235002332
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
235002341,
|
||||
235002342
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
235002351,
|
||||
235002352
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
235002361,
|
||||
235002362
|
||||
]
|
||||
}
|
||||
],
|
||||
"ChildSkill": [],
|
||||
"Desc": [
|
||||
"skill_1350023111",
|
||||
"skill_1350023112",
|
||||
@ -7126,7 +6927,7 @@
|
||||
{
|
||||
"Id": 935002411,
|
||||
"Name": {
|
||||
"key": "skillname_935002321",
|
||||
"key": "skillname_935002411",
|
||||
"text": "希卡普3技能"
|
||||
},
|
||||
"ico": "jn_icon_003",
|
||||
@ -7142,46 +6943,7 @@
|
||||
4
|
||||
],
|
||||
"Target": 2,
|
||||
"ChildSkill": [
|
||||
{
|
||||
"Id": [
|
||||
935002311,
|
||||
935002312,
|
||||
935002313,
|
||||
935002314
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
935002321,
|
||||
935002322
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
935002331,
|
||||
935002332
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
935002341,
|
||||
935002342
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
935002351,
|
||||
935002352
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
935002361,
|
||||
935002362
|
||||
]
|
||||
}
|
||||
],
|
||||
"ChildSkill": [],
|
||||
"Desc": [
|
||||
"skill_9350023211",
|
||||
"skill_9350023212",
|
||||
@ -7206,13 +6968,7 @@
|
||||
-1
|
||||
],
|
||||
"Target": 1,
|
||||
"ChildSkill": [
|
||||
{
|
||||
"Id": [
|
||||
224003011
|
||||
]
|
||||
}
|
||||
],
|
||||
"ChildSkill": [],
|
||||
"Desc": [
|
||||
"skill_1240030111"
|
||||
],
|
||||
@ -7236,44 +6992,7 @@
|
||||
0
|
||||
],
|
||||
"Target": 4,
|
||||
"ChildSkill": [
|
||||
{
|
||||
"Id": [
|
||||
224003111,
|
||||
224003112
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
224003121,
|
||||
224003122
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
224003131,
|
||||
224003132
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
224003141,
|
||||
224003142
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
224003151,
|
||||
224003152
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
224003161,
|
||||
224003162
|
||||
]
|
||||
}
|
||||
],
|
||||
"ChildSkill": [],
|
||||
"Desc": [
|
||||
"skill_1240031111",
|
||||
"skill_1240031112",
|
||||
@ -7298,20 +7017,7 @@
|
||||
3
|
||||
],
|
||||
"Target": 1,
|
||||
"ChildSkill": [
|
||||
{
|
||||
"Id": [
|
||||
224003211,
|
||||
224003212
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
224003211,
|
||||
224003212
|
||||
]
|
||||
}
|
||||
],
|
||||
"ChildSkill": [],
|
||||
"Desc": [
|
||||
"skill_1240032111",
|
||||
"skill_1240032112"
|
||||
@ -7337,50 +7043,7 @@
|
||||
3
|
||||
],
|
||||
"Target": 2,
|
||||
"ChildSkill": [
|
||||
{
|
||||
"Id": [
|
||||
224003311,
|
||||
224003312,
|
||||
224003313
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
224003311,
|
||||
224003322,
|
||||
224003323
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
224003311,
|
||||
224003332,
|
||||
224003333
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
224003311,
|
||||
224003342,
|
||||
224003343
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
224003311,
|
||||
224003352,
|
||||
224003353
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
224003311,
|
||||
224003362,
|
||||
224003363
|
||||
]
|
||||
}
|
||||
],
|
||||
"ChildSkill": [],
|
||||
"Desc": [
|
||||
"skill_1240033111",
|
||||
"skill_1240033112",
|
||||
@ -7406,26 +7069,117 @@
|
||||
3
|
||||
],
|
||||
"Target": 1,
|
||||
"ChildSkill": [
|
||||
{
|
||||
"Id": [
|
||||
924003411,
|
||||
924003412,
|
||||
924003413
|
||||
]
|
||||
},
|
||||
{
|
||||
"Id": [
|
||||
924003411,
|
||||
924003412,
|
||||
924003413
|
||||
]
|
||||
}
|
||||
],
|
||||
"ChildSkill": [],
|
||||
"Desc": [
|
||||
"skill_9240034111",
|
||||
"skill_9240034112"
|
||||
],
|
||||
"buffid": []
|
||||
},
|
||||
{
|
||||
"Id": 134006011,
|
||||
"Name": {
|
||||
"key": "skillname_134006011",
|
||||
"text": "杰克队长技"
|
||||
},
|
||||
"ico": "jn_dzj_01",
|
||||
"act": "Skill_1",
|
||||
"Type": 3,
|
||||
"MaxLV": 1,
|
||||
"CD": [
|
||||
-1
|
||||
],
|
||||
"Target": 1,
|
||||
"ChildSkill": [],
|
||||
"Desc": [],
|
||||
"buffid": []
|
||||
},
|
||||
{
|
||||
"Id": 134006111,
|
||||
"Name": {
|
||||
"key": "skillname_134006111",
|
||||
"text": "杰克1技能"
|
||||
},
|
||||
"ico": "jn_icon_001",
|
||||
"act": "Skill_2",
|
||||
"Type": 1,
|
||||
"MaxLV": 5,
|
||||
"CD": [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"Target": 4,
|
||||
"ChildSkill": [],
|
||||
"Desc": [],
|
||||
"buffid": []
|
||||
},
|
||||
{
|
||||
"Id": 134006211,
|
||||
"Name": {
|
||||
"key": "skillname_134006211",
|
||||
"text": "杰克2技能"
|
||||
},
|
||||
"ico": "jn_icon_002",
|
||||
"act": "Skill_3",
|
||||
"Type": 1,
|
||||
"MaxLV": 5,
|
||||
"CD": [
|
||||
5,
|
||||
5,
|
||||
5,
|
||||
5,
|
||||
4
|
||||
],
|
||||
"Target": 2,
|
||||
"ChildSkill": [],
|
||||
"Desc": [],
|
||||
"buffid": []
|
||||
},
|
||||
{
|
||||
"Id": 134006311,
|
||||
"Name": {
|
||||
"key": "skillname_134006311",
|
||||
"text": "杰克3技能"
|
||||
},
|
||||
"ico": "jn_icon_003",
|
||||
"act": "Skill_2",
|
||||
"Type": 1,
|
||||
"MaxLV": 5,
|
||||
"CD": [
|
||||
4,
|
||||
4,
|
||||
4,
|
||||
4,
|
||||
3
|
||||
],
|
||||
"Target": 2,
|
||||
"ChildSkill": [],
|
||||
"Desc": [],
|
||||
"buffid": []
|
||||
},
|
||||
{
|
||||
"Id": 934006411,
|
||||
"Name": {
|
||||
"key": "skillname_934006411",
|
||||
"text": "杰克2技能"
|
||||
},
|
||||
"ico": "jn_icon_002",
|
||||
"act": "Skill_3",
|
||||
"Type": 4,
|
||||
"MaxLV": 5,
|
||||
"CD": [
|
||||
5,
|
||||
5,
|
||||
5,
|
||||
5,
|
||||
4
|
||||
],
|
||||
"Target": 2,
|
||||
"ChildSkill": [],
|
||||
"Desc": [],
|
||||
"buffid": []
|
||||
}
|
||||
]
|
@ -710,5 +710,21 @@
|
||||
"Tags": [],
|
||||
"RelyTags": [],
|
||||
"NoRelyTags": []
|
||||
},
|
||||
{
|
||||
"Id": 434006201,
|
||||
"Desc": "施加效果",
|
||||
"When": "ImpEff",
|
||||
"Where": "Target=2,EffType=0,EffID=390002003,EffTakeRel=1,TesLim=1,TriLim=1",
|
||||
"AddCon": [
|
||||
"CallSkillPas"
|
||||
],
|
||||
"Type": "",
|
||||
"MaxEmitTimes": 0,
|
||||
"OverlayTimes": 0,
|
||||
"SameID": false,
|
||||
"Tags": [],
|
||||
"RelyTags": [],
|
||||
"NoRelyTags": []
|
||||
}
|
||||
]
|
@ -760,7 +760,7 @@
|
||||
"file": "PlotWindow",
|
||||
"unloadpkg": 2,
|
||||
"loadtype": 1,
|
||||
"full": 2,
|
||||
"full": 1,
|
||||
"blur": 0,
|
||||
"package": "plotsystem/plotsystem",
|
||||
"packagename": "plotsystem",
|
||||
@ -779,6 +779,30 @@
|
||||
"comname": "main",
|
||||
"des": "招募"
|
||||
},
|
||||
{
|
||||
"id": "recruittendraw",
|
||||
"file": "RecruitTenDrawWindow",
|
||||
"unloadpkg": 2,
|
||||
"loadtype": 1,
|
||||
"full": 1,
|
||||
"blur": 0,
|
||||
"package": "recruit/recruit",
|
||||
"packagename": "recruit",
|
||||
"comname": "tendraw",
|
||||
"des": "招募十连抽"
|
||||
},
|
||||
{
|
||||
"id": "recruitonedraw",
|
||||
"file": "RecruitOneDrawWindow",
|
||||
"unloadpkg": 2,
|
||||
"loadtype": 1,
|
||||
"full": 1,
|
||||
"blur": 0,
|
||||
"package": "recruit/recruit",
|
||||
"packagename": "recruit",
|
||||
"comname": "onedraw",
|
||||
"des": "招募单抽"
|
||||
},
|
||||
{
|
||||
"id": "resonancepopup",
|
||||
"file": "ResonancePopup",
|
||||
@ -802,5 +826,29 @@
|
||||
"packagename": "roledetails",
|
||||
"comname": "com_synthesis",
|
||||
"des": "材料合成弹窗"
|
||||
},
|
||||
{
|
||||
"id": "chatsystem",
|
||||
"file": "ChatSystemWindow",
|
||||
"unloadpkg": 3,
|
||||
"loadtype": 1,
|
||||
"full": 2,
|
||||
"blur": 0,
|
||||
"package": "chatsystem/chatsystem",
|
||||
"packagename": "chatsystem",
|
||||
"comname": "main",
|
||||
"des": "聊天"
|
||||
},
|
||||
{
|
||||
"id": "pagoda",
|
||||
"file": "PagodaWindow",
|
||||
"unloadpkg": 2,
|
||||
"loadtype": 1,
|
||||
"full": 1,
|
||||
"blur": 0,
|
||||
"package": "pagoda/pagoda",
|
||||
"packagename": "pagoda",
|
||||
"comname": "main",
|
||||
"des": "心魔之塔"
|
||||
}
|
||||
]
|
0
cmd/upgrade/build.sh
Normal file
0
cmd/upgrade/build.sh
Normal file
5
cmd/upgrade/build_linux.bat
Normal file
5
cmd/upgrade/build_linux.bat
Normal file
@ -0,0 +1,5 @@
|
||||
SET CGO_ENABLED=0
|
||||
SET GOOS=linux
|
||||
SET GOARCH=amd64
|
||||
|
||||
go build -o update main.go
|
167
cmd/upgrade/main.go
Normal file
167
cmd/upgrade/main.go
Normal file
@ -0,0 +1,167 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"flag"
|
||||
"fmt"
|
||||
"go_dreamfactory/cmd/upgrade/tools"
|
||||
"html/template"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"path"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// func main() {
|
||||
// http.HandleFunc("/download", FileDownload)
|
||||
// http.HandleFunc("/upload", FileUpload)
|
||||
|
||||
// log.Print("http server start")
|
||||
// if err := http.ListenAndServe(":8910", nil); err != nil {
|
||||
// log.Fatal(err)
|
||||
// }
|
||||
// }
|
||||
|
||||
func FileUpload(w http.ResponseWriter, r *http.Request) {
|
||||
//获取文件流,第三个返回值是错误对象
|
||||
file, header, _ := r.FormFile("file")
|
||||
//读取文件流为[]byte
|
||||
b, _ := ioutil.ReadAll(file)
|
||||
//把文件保存到指定位置
|
||||
ioutil.WriteFile("/opt/upgrade", b, 0777)
|
||||
//输出上传时文件名
|
||||
fmt.Println("上传文件名:", header.Filename)
|
||||
}
|
||||
|
||||
func FileDownload(w http.ResponseWriter, r *http.Request) {
|
||||
filename := "E:\\projects\\workspace\\go_dreamfactory\\cmd\\v2\\RobotGUI.exe"
|
||||
|
||||
file, _ := os.Open(filename)
|
||||
defer file.Close()
|
||||
|
||||
fileHeader := make([]byte, 512)
|
||||
file.Read(fileHeader)
|
||||
|
||||
fileStat, _ := file.Stat()
|
||||
|
||||
w.Header().Set("Content-Disposition", "attachment; filename="+filename)
|
||||
w.Header().Set("Content-Type", http.DetectContentType(fileHeader))
|
||||
w.Header().Set("Content-Length", strconv.FormatInt(fileStat.Size(), 10))
|
||||
|
||||
file.Seek(0, 0)
|
||||
io.Copy(w, file)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
//go:embed views/*
|
||||
var f embed.FS
|
||||
|
||||
var version = "0.0.1"
|
||||
|
||||
func main() {
|
||||
|
||||
host := flag.String("host", "10.0.0.9", "Host")
|
||||
port := flag.String("port", "8080", "Port")
|
||||
uploadsDir := flag.String("uploadsDir", "./uploads", "上传文件存储地址")
|
||||
wwwDir := flag.String("wwwDir", "./www", "www服务地址,即解压地址")
|
||||
|
||||
flag.Parse()
|
||||
|
||||
gin.SetMode(gin.ReleaseMode)
|
||||
r := gin.Default()
|
||||
r.Static("/prd", "./www")
|
||||
tmpl := template.Must(template.New("").ParseFS(f, "views/*"))
|
||||
r.SetHTMLTemplate(tmpl)
|
||||
|
||||
r.GET("/version", func(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"version": version,
|
||||
})
|
||||
})
|
||||
|
||||
r.GET("/", func(c *gin.Context) {
|
||||
fmt.Println(tmpl.DefinedTemplates())
|
||||
c.HTML(http.StatusOK, "index.html", nil)
|
||||
})
|
||||
|
||||
r.POST("/upload", func(c *gin.Context) {
|
||||
f, err := c.FormFile("file")
|
||||
if err != nil {
|
||||
c.JSON(http.StatusBadRequest, gin.H{
|
||||
"error": err.Error(),
|
||||
})
|
||||
}
|
||||
|
||||
//从上传的文件名获取到版本号
|
||||
s := strings.SplitN(f.Filename, "-", 2)
|
||||
if len(s) != 2 {
|
||||
c.JSON(http.StatusBadRequest, gin.H{
|
||||
"error": "上传的文件名中没有包含版本号 eg. update.zip-0.0.1",
|
||||
})
|
||||
return
|
||||
}
|
||||
version = s[1] //设置版本号
|
||||
|
||||
dst := path.Join(*uploadsDir, f.Filename)
|
||||
err = c.SaveUploadedFile(f, dst)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{
|
||||
"error": err.Error(),
|
||||
})
|
||||
}
|
||||
_, err = tools.Unzip(dst, *wwwDir)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{
|
||||
"error": err.Error(),
|
||||
})
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"msg": "upload success",
|
||||
"url": strings.Join([]string{"http://" + *host + ":" + *port, "/prd/", strings.Split(f.Filename, ".")[0], "/index.html"}, ""),
|
||||
})
|
||||
})
|
||||
|
||||
r.GET("/dirs", func(c *gin.Context) {
|
||||
dir, err := ioutil.ReadDir(*wwwDir)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{
|
||||
"error": err.Error(),
|
||||
})
|
||||
}
|
||||
|
||||
type Item struct {
|
||||
Name string `json:"name"`
|
||||
Url string `json:"url"`
|
||||
DateTime string `json:"dateTime"`
|
||||
}
|
||||
|
||||
var dirs []Item
|
||||
for _, f := range dir {
|
||||
// if f.IsDir() && len(f.Name()) > 0 && f.Name() != "__MACOSX" {
|
||||
dirs = append(dirs, Item{
|
||||
Name: f.Name(),
|
||||
Url: strings.Join([]string{"http://" + *host + ":" + *port, "/prd/", f.Name()}, ""),
|
||||
DateTime: f.ModTime().Format(time.RFC3339),
|
||||
})
|
||||
// }
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"dirs": dirs,
|
||||
})
|
||||
})
|
||||
|
||||
err := r.Run("0.0.0.0:" + *port)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
0
cmd/upgrade/readme.md
Normal file
0
cmd/upgrade/readme.md
Normal file
125
cmd/upgrade/tools/gz.go
Normal file
125
cmd/upgrade/tools/gz.go
Normal file
@ -0,0 +1,125 @@
|
||||
package tools
|
||||
|
||||
import (
|
||||
"archive/tar"
|
||||
"compress/gzip"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func UnGz(tarFile, dest string) error {
|
||||
srcFile, err := os.Open(tarFile)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer srcFile.Close()
|
||||
gr, err := gzip.NewReader(srcFile)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer gr.Close()
|
||||
tr := tar.NewReader(gr)
|
||||
for {
|
||||
hdr, err := tr.Next()
|
||||
if err != nil {
|
||||
if err == io.EOF {
|
||||
break
|
||||
} else {
|
||||
return err
|
||||
}
|
||||
}
|
||||
filename := dest + hdr.Name
|
||||
file, err := createFile(filename)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
io.Copy(file, tr)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func createFile(name string) (*os.File, error) {
|
||||
err := os.MkdirAll(string([]rune(name)[0:strings.LastIndex(name, "/")]), 0755)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return os.Create(name)
|
||||
}
|
||||
|
||||
func UnGzip(tarName, xpath string) (err error) {
|
||||
tarFile, err := os.Open(tarName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
err = tarFile.Close()
|
||||
}()
|
||||
|
||||
os.Mkdir(xpath, 0755)
|
||||
|
||||
absPath, err := filepath.Abs(xpath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
tr := tar.NewReader(tarFile)
|
||||
if strings.HasSuffix(tarName, ".gz") || strings.HasSuffix(tarName, ".gzip") {
|
||||
gz, err := gzip.NewReader(tarFile)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer gz.Close()
|
||||
tr = tar.NewReader(gz)
|
||||
}
|
||||
|
||||
// untar each segment
|
||||
for {
|
||||
hdr, err := tr.Next()
|
||||
if err == io.EOF {
|
||||
break
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// determine proper file path info
|
||||
finfo := hdr.FileInfo()
|
||||
fileName := hdr.Name
|
||||
if filepath.IsAbs(fileName) {
|
||||
fmt.Printf("removing / prefix from %s\n", fileName)
|
||||
fileName, err = filepath.Rel("/", fileName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
absFileName := filepath.Join(absPath, fileName)
|
||||
|
||||
if finfo.Mode().IsDir() {
|
||||
if err := os.MkdirAll(absFileName, 0755); err != nil {
|
||||
return err
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
// create new file with original file mode
|
||||
file, err := os.OpenFile(absFileName, os.O_RDWR|os.O_CREATE|os.O_TRUNC, finfo.Mode().Perm())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Printf("x %s\n", absFileName)
|
||||
n, cpErr := io.Copy(file, tr)
|
||||
if closeErr := file.Close(); closeErr != nil { // close file immediately
|
||||
return err
|
||||
}
|
||||
if cpErr != nil {
|
||||
return cpErr
|
||||
}
|
||||
if n != finfo.Size() {
|
||||
return fmt.Errorf("unexpected bytes written: wrote %d, want %d", n, finfo.Size())
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
54
cmd/upgrade/tools/zip.go
Normal file
54
cmd/upgrade/tools/zip.go
Normal file
@ -0,0 +1,54 @@
|
||||
package tools
|
||||
|
||||
import (
|
||||
"archive/zip"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func Unzip(src string, dest string) ([]string, error) {
|
||||
var filenames []string
|
||||
r, err := zip.OpenReader(src)
|
||||
if err != nil {
|
||||
return filenames, err
|
||||
}
|
||||
defer r.Close()
|
||||
|
||||
for _, f := range r.File {
|
||||
// Store filename/path for returning and using later on
|
||||
fpath := filepath.Join(dest, f.Name)
|
||||
// Check for ZipSlip. More Info: http://bit.ly/2MsjAWE
|
||||
if !strings.HasPrefix(fpath, filepath.Clean(dest)+string(os.PathSeparator)) {
|
||||
return filenames, fmt.Errorf("%s: illegal file path", fpath)
|
||||
}
|
||||
filenames = append(filenames, fpath)
|
||||
if f.FileInfo().IsDir() {
|
||||
// Make Folder
|
||||
os.MkdirAll(fpath, os.ModePerm)
|
||||
continue
|
||||
}
|
||||
// Make File
|
||||
if err = os.MkdirAll(filepath.Dir(fpath), os.ModePerm); err != nil {
|
||||
return filenames, err
|
||||
}
|
||||
outFile, err := os.OpenFile(fpath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, f.Mode())
|
||||
if err != nil {
|
||||
return filenames, err
|
||||
}
|
||||
rc, err := f.Open()
|
||||
if err != nil {
|
||||
return filenames, err
|
||||
}
|
||||
_, err = io.Copy(outFile, rc)
|
||||
// Close the file without defer to close before next iteration of loop
|
||||
outFile.Close()
|
||||
rc.Close()
|
||||
if err != nil {
|
||||
return filenames, err
|
||||
}
|
||||
}
|
||||
return filenames, nil
|
||||
}
|
69
cmd/upgrade/views/index.html
Normal file
69
cmd/upgrade/views/index.html
Normal file
@ -0,0 +1,69 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>上传</title>
|
||||
<!-- import Vue.js -->
|
||||
<script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.6/vue.min.js"></script>
|
||||
<!-- import stylesheet -->
|
||||
<link href="https://cdn.bootcdn.net/ajax/libs/iview/3.5.5-rc.1/styles/iview.min.css" rel="stylesheet">
|
||||
<!-- import iView -->
|
||||
<script src="https://cdn.bootcdn.net/ajax/libs/iview/3.5.5-rc.1/iview.min.js"></script>
|
||||
<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js"></script>
|
||||
<style>
|
||||
#app {
|
||||
margin: 20px 40px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app">
|
||||
|
||||
<h1>上传原型,获取永久在线浏览地址</h1>
|
||||
|
||||
<upload type="drag" action="/upload" paste="true" accept=".zip" :on-success="handleSuccess">
|
||||
<div style="padding: 20px 0">
|
||||
<icon type="ios-cloud-upload" size="52" style="color: #3399ff"></icon>
|
||||
<p>点击或者拖拽上传</p>
|
||||
</div>
|
||||
</upload>
|
||||
|
||||
<alert type="success" v-for="url in zips">
|
||||
浏览地址:${ url }
|
||||
</alert>
|
||||
|
||||
|
||||
|
||||
<strong>历史prd:</strong>
|
||||
<br><br>
|
||||
<list border>
|
||||
<list-item v-for="dir in dirs">
|
||||
<a :href="dir.url" target="_blank">${ dir.name }</a> <span>${ dir.dateTime}</span>
|
||||
</list-item>
|
||||
</list>
|
||||
</div>
|
||||
<script>
|
||||
new Vue({
|
||||
el: "#app",
|
||||
delimiters: ['${', '}'],
|
||||
data: {
|
||||
zips: [],
|
||||
dirs: [],
|
||||
},
|
||||
methods: {
|
||||
handleSuccess(response, file, fileList) {
|
||||
this.zips.push(response.url)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
axios.get("/dirs").then((res) => {
|
||||
this.dirs = res.data.dirs
|
||||
})
|
||||
},
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
8
cmd/v2/FyneApp.toml
Normal file
8
cmd/v2/FyneApp.toml
Normal file
@ -0,0 +1,8 @@
|
||||
Website = "https://legu.com"
|
||||
|
||||
[Details]
|
||||
Icon = "Icon.png"
|
||||
Name = "RobotGUI"
|
||||
ID = "com.legu.app"
|
||||
Version = "1.0.1"
|
||||
Build = 7
|
@ -70,8 +70,9 @@ package common
|
||||
|
||||
// zh
|
||||
const (
|
||||
// app
|
||||
APP_NAME = "机器人"
|
||||
// app 子标题 [0.0.1 build-1] 应用名称
|
||||
APP_WIN_TITLE = "%s [%s build-%d] %s"
|
||||
|
||||
//about
|
||||
APP_ABOUT_TITLE = "关于"
|
||||
|
@ -3,6 +3,10 @@ package common
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"strings"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cast"
|
||||
)
|
||||
|
||||
func FormatJson(data string) (string, error) {
|
||||
@ -41,3 +45,26 @@ func SubStr(str string, start int, length int) (result string) {
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// 是否升级
|
||||
func IsUpgrade(newVersion, oldVersion string) bool {
|
||||
nvArr := strings.SplitN(newVersion, ".", 3)
|
||||
if len(nvArr) != 3 {
|
||||
logrus.Error("new version format err")
|
||||
return false
|
||||
}
|
||||
|
||||
ovArr := strings.SplitN(oldVersion, ".", 3)
|
||||
if len(ovArr) != 3 {
|
||||
logrus.Error("old version format err")
|
||||
return false
|
||||
}
|
||||
|
||||
nvNum := cast.ToInt(nvArr[0])*100 + cast.ToInt(nvArr[1])*10 + cast.ToInt(nvArr[2])
|
||||
ovNum := cast.ToInt(ovArr[0])*100 + cast.ToInt(ovArr[1])*10 + cast.ToInt(ovArr[2])
|
||||
|
||||
if nvNum > ovNum {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
@ -49,8 +49,6 @@ func init() {
|
||||
}
|
||||
|
||||
func main() {
|
||||
logrus.Info("Starting...")
|
||||
|
||||
// create a new ui
|
||||
app := app.NewWithID("protocol-test-tool")
|
||||
app.SetIcon(theme.ResourceIconPng)
|
||||
@ -58,7 +56,7 @@ func main() {
|
||||
mainWindow := ui.NewMainWindow(appUI)
|
||||
|
||||
mainWindow.CreateWindow(common.APP_NAME, 1366, 768, true)
|
||||
|
||||
logrus.WithField("version", app.Metadata().Version).Info("app starting")
|
||||
appUI.Run()
|
||||
}
|
||||
|
||||
|
@ -1,24 +0,0 @@
|
||||
package model
|
||||
|
||||
type FriendModel struct {
|
||||
Uid string
|
||||
Name string
|
||||
}
|
||||
|
||||
type FriendModelList struct {
|
||||
DataList []*FriendModel
|
||||
}
|
||||
|
||||
func NewFriendModelList() *FriendModelList {
|
||||
return &FriendModelList{
|
||||
DataList: make([]*FriendModel, 0),
|
||||
}
|
||||
}
|
||||
|
||||
func (s *FriendModelList) AsInterfaceArray() []interface{} {
|
||||
rs := make([]interface{}, len(s.DataList), len(s.DataList))
|
||||
for i := range s.DataList {
|
||||
rs[i] = s.DataList[i]
|
||||
}
|
||||
return rs
|
||||
}
|
27
cmd/v2/model/item.go
Normal file
27
cmd/v2/model/item.go
Normal file
@ -0,0 +1,27 @@
|
||||
package model
|
||||
|
||||
import "github.com/sirupsen/logrus"
|
||||
|
||||
type ItemModel struct {
|
||||
Id string
|
||||
Label string
|
||||
}
|
||||
|
||||
type ItemModelList struct {
|
||||
DataList []*ItemModel
|
||||
}
|
||||
|
||||
func NewItemModelList() *ItemModelList {
|
||||
return &ItemModelList{
|
||||
DataList: make([]*ItemModel, 0),
|
||||
}
|
||||
}
|
||||
|
||||
func (s *ItemModelList) AsInterfaceArray() []interface{} {
|
||||
logrus.Debug(len(s.DataList))
|
||||
rs := make([]interface{}, len(s.DataList))
|
||||
for i := range s.DataList {
|
||||
rs[i] = s.DataList[i]
|
||||
}
|
||||
return rs
|
||||
}
|
@ -11,7 +11,6 @@ fyne bundle msyh.ttc >> bundled.go
|
||||
fyne bundle -append msyhbd.ttc >> bundled.go
|
||||
(不要使用powershell 或vscode自带终端)
|
||||
|
||||
|
||||
## icon
|
||||
|
||||
1.
|
||||
@ -26,7 +25,7 @@ a.SetIcon(resourceFavPng)
|
||||
|
||||
## package
|
||||
|
||||
fyne package -os windows -icon icon.png
|
||||
fyne package --name robotGUI-1.0.1 -os windows -icon Icon.png
|
||||
|
||||
## 开发协议参数表单
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
upgradeUrl: http://10.0.0.9:8080/
|
||||
services:
|
||||
- service:
|
||||
sid: 1
|
||||
|
@ -31,6 +31,7 @@ type Services struct {
|
||||
|
||||
type Config struct {
|
||||
Services []*Services `yaml:"services"`
|
||||
UpgradeUrl string `yaml:"upgradeUrl"`
|
||||
}
|
||||
|
||||
func NewConfigService() (ConfigService, error) {
|
||||
|
@ -6,6 +6,8 @@ import (
|
||||
"go_dreamfactory/cmd/v2/service/observer"
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/pb"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@ -19,7 +21,8 @@ var (
|
||||
)
|
||||
|
||||
type ConnService interface {
|
||||
Connect(wsUrl string) error
|
||||
WsConnect(wsUrl string) error
|
||||
HttpConnect(url string) ([]byte, error)
|
||||
SendMsg(msg *pb.UserMessage, rsp proto.Message) (err error)
|
||||
ReceiveMsg() (code pb.ErrorCode, msg *pb.UserMessage)
|
||||
ListenerPush()
|
||||
@ -40,7 +43,7 @@ func GetConnService() *ConnServiceImpl {
|
||||
}
|
||||
|
||||
// connect ...
|
||||
func (c *ConnServiceImpl) Connect(wsUrl string) error {
|
||||
func (c *ConnServiceImpl) WsConnect(wsUrl string) error {
|
||||
dialer := &websocket.Dialer{
|
||||
HandshakeTimeout: 5 * time.Second,
|
||||
}
|
||||
@ -64,6 +67,15 @@ func (c *ConnServiceImpl) Connect(wsUrl string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *ConnServiceImpl) HttpConnect(url string) ([]byte, error) {
|
||||
res, err := http.Get(url)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer res.Body.Close()
|
||||
return ioutil.ReadAll(res.Body)
|
||||
}
|
||||
|
||||
// listener push
|
||||
func (c *ConnServiceImpl) ListenerPush() {
|
||||
go func() {
|
||||
|
@ -1,75 +0,0 @@
|
||||
package formview
|
||||
|
||||
import (
|
||||
"go_dreamfactory/cmd/v2/model"
|
||||
"go_dreamfactory/cmd/v2/service"
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/modules/friend"
|
||||
"go_dreamfactory/pb"
|
||||
"go_dreamfactory/utils"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/container"
|
||||
"fyne.io/fyne/v2/data/binding"
|
||||
"fyne.io/fyne/v2/widget"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
type FriendListBaseView struct {
|
||||
BaseformView
|
||||
dataList *widget.List
|
||||
friendBinding binding.UntypedList
|
||||
selFriendIds []string //选择的UID
|
||||
friendData *model.FriendModelList
|
||||
}
|
||||
|
||||
// init data
|
||||
func (this *FriendListBaseView) initFriendList() {
|
||||
this.friendBinding = binding.NewUntypedList()
|
||||
this.friendData = model.NewFriendModelList()
|
||||
}
|
||||
|
||||
// create list view
|
||||
func (this *FriendListBaseView) createList() *widget.List {
|
||||
this.dataList = widget.NewListWithData(this.friendBinding,
|
||||
func() fyne.CanvasObject {
|
||||
return container.NewHBox(
|
||||
widget.NewCheck("", func(b bool) {}),
|
||||
widget.NewLabelWithStyle("", fyne.TextAlignCenter, fyne.TextStyle{}),
|
||||
)
|
||||
},
|
||||
func(data binding.DataItem, item fyne.CanvasObject) {
|
||||
o, _ := data.(binding.Untyped).Get()
|
||||
pd := o.(*model.FriendModel)
|
||||
item.(*fyne.Container).Objects[0].(*widget.Check).OnChanged = func(b bool) {
|
||||
if b {
|
||||
this.selFriendIds = append(this.selFriendIds, pd.Uid)
|
||||
} else {
|
||||
utils.DeleteString(this.selFriendIds, pd.Uid)
|
||||
}
|
||||
}
|
||||
item.(*fyne.Container).Objects[1].(*widget.Label).SetText(pd.Name)
|
||||
},
|
||||
)
|
||||
return this.dataList
|
||||
}
|
||||
|
||||
func (this *FriendListBaseView) applyListBtnFun() func() {
|
||||
return func() {
|
||||
if err := service.GetPttService().SendToClient(
|
||||
string(comm.ModuleFriend),
|
||||
friend.FriendSubTypeApplyList,
|
||||
&pb.FriendApplyListReq{}); err != nil {
|
||||
logrus.Error(err)
|
||||
}
|
||||
this.friendData = model.NewFriendModelList()
|
||||
}
|
||||
}
|
||||
|
||||
// set data
|
||||
func (this *FriendListBaseView) reloadFriendData() {
|
||||
if this.friendData != nil {
|
||||
d := this.friendData.AsInterfaceArray()
|
||||
this.friendBinding.Set(d)
|
||||
}
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
package formview
|
||||
|
||||
import (
|
||||
"go_dreamfactory/cmd/v2/model"
|
||||
"go_dreamfactory/cmd/v2/service"
|
||||
"go_dreamfactory/pb"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
type HeroListView struct {
|
||||
BaseformView
|
||||
}
|
||||
|
||||
func (this *HeroListView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
||||
this.form.OnSubmit = func() {
|
||||
if err := service.GetPttService().SendToClient(t.MainType, t.SubType, &pb.HeroListReq{}); err != nil {
|
||||
logrus.Error(err)
|
||||
}
|
||||
|
||||
}
|
||||
return this.form
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
package formview
|
||||
|
||||
import (
|
||||
"go_dreamfactory/cmd/v2/lib/common"
|
||||
"go_dreamfactory/cmd/v2/model"
|
||||
"go_dreamfactory/cmd/v2/service"
|
||||
"go_dreamfactory/pb"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/widget"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cast"
|
||||
)
|
||||
|
||||
type TaskActiveListView struct {
|
||||
BaseformView
|
||||
}
|
||||
|
||||
func (this *TaskActiveListView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
||||
tagSelect := getTaskTagSelect()
|
||||
this.form.AppendItem(widget.NewFormItem(common.APP_TESTCASE_FORM_TASKTAG, tagSelect))
|
||||
|
||||
this.form.OnSubmit = func() {
|
||||
if err := service.GetPttService().SendToClient(t.MainType, t.SubType, &pb.TaskActiveListReq{
|
||||
|
||||
TaskTag: cast.ToInt32(tagSelect.Selected),
|
||||
}); err != nil {
|
||||
logrus.Error(err)
|
||||
}
|
||||
}
|
||||
return this.form
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
package formview
|
||||
|
||||
import (
|
||||
"go_dreamfactory/cmd/v2/lib/common"
|
||||
"go_dreamfactory/cmd/v2/model"
|
||||
"go_dreamfactory/cmd/v2/service"
|
||||
"go_dreamfactory/pb"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/widget"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cast"
|
||||
)
|
||||
|
||||
type TaskListView struct {
|
||||
BaseformView
|
||||
}
|
||||
|
||||
func (this *TaskListView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
||||
tagSelect := getTaskTagSelect()
|
||||
this.form.AppendItem(widget.NewFormItem(common.APP_TESTCASE_FORM_TASKTAG, tagSelect))
|
||||
|
||||
this.form.OnSubmit = func() {
|
||||
if err := service.GetPttService().SendToClient(t.MainType, t.SubType, &pb.TaskListReq{
|
||||
TaskTag: cast.ToInt32(tagSelect.Selected),
|
||||
}); err != nil {
|
||||
logrus.Error(err)
|
||||
}
|
||||
}
|
||||
return this.form
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
package formview
|
||||
|
||||
import (
|
||||
"go_dreamfactory/cmd/v2/lib/common"
|
||||
"go_dreamfactory/cmd/v2/model"
|
||||
"go_dreamfactory/cmd/v2/service"
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/modules/task"
|
||||
"go_dreamfactory/pb"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/widget"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cast"
|
||||
)
|
||||
|
||||
type TaskReceiveView struct {
|
||||
BaseformView
|
||||
}
|
||||
|
||||
func (this *TaskReceiveView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
||||
|
||||
if t.MainType == string(comm.ModuleTask) && t.SubType == task.TaskSubTypeReceive {
|
||||
id := widget.NewEntry()
|
||||
tagSelect := getTaskTagSelect()
|
||||
this.form.AppendItem(widget.NewFormItem(common.APP_TESTCASE_FORM_TASK_OID, id))
|
||||
this.form.AppendItem(widget.NewFormItem(common.APP_TESTCASE_FORM_TASKTAG, tagSelect))
|
||||
|
||||
this.form.OnSubmit = func() {
|
||||
if err := service.GetPttService().SendToClient(t.MainType, t.SubType,
|
||||
&pb.TaskReceiveReq{Id: id.Text, TaskTag: cast.ToInt32(tagSelect.Selected)}); err != nil {
|
||||
logrus.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return this.form
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
package ui
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"go_dreamfactory/cmd/v2/lib/common"
|
||||
"go_dreamfactory/cmd/v2/service"
|
||||
@ -8,6 +9,8 @@ import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/modules/user"
|
||||
"go_dreamfactory/pb"
|
||||
"os/exec"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
@ -17,6 +20,7 @@ import (
|
||||
"github.com/BabySid/gobase"
|
||||
"github.com/Pallinder/go-randomdata"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/tidwall/gjson"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -114,6 +118,7 @@ func (ui *MainWindowImpl) quiteHandle() {
|
||||
// CreateWindow ....
|
||||
func (ui *MainWindowImpl) CreateWindow(title string, width, height float32, _ bool) {
|
||||
// init window
|
||||
title = fmt.Sprintf(common.APP_WIN_TITLE, "登录", ui.app.Metadata().Version, ui.app.Metadata().Build, common.APP_NAME)
|
||||
w := ui.app.NewWindow(title)
|
||||
ui.AddWindow("main", w)
|
||||
ui.w = w
|
||||
@ -128,21 +133,60 @@ func (ui *MainWindowImpl) CreateWindow(title string, width, height float32, _ bo
|
||||
// ui.mm = newMainMenu()
|
||||
// w.SetMainMenu(ui.mm.MainMenu)
|
||||
|
||||
// create window container
|
||||
// mainLayout := ui.createWindowContainer()
|
||||
|
||||
w.SetMaster()
|
||||
// w.Show()
|
||||
// w.SetContent(mainLayout)
|
||||
w.CenterOnScreen()
|
||||
_ = ui.createChooseServerPopUp(w)
|
||||
}
|
||||
|
||||
// check version
|
||||
func (ui *MainWindowImpl) checkVersion(parent fyne.Window) {
|
||||
logrus.Debug("check version")
|
||||
b, err := ui.connService.HttpConnect(ui.configService.GetConfig().UpgradeUrl + "version")
|
||||
if err != nil {
|
||||
dialog.ShowError(errors.New("版本检查:"+err.Error()), parent)
|
||||
return
|
||||
}
|
||||
|
||||
ver := gjson.Get(string(b), "version").String()
|
||||
if strings.HasSuffix(ver, ".zip") {
|
||||
ver = strings.TrimSuffix(ver, ".zip")
|
||||
}
|
||||
logrus.WithField("version", ver).Debug("server version")
|
||||
if common.IsUpgrade(ver, ui.app.Metadata().Version) {
|
||||
chkDialog := dialog.NewConfirm("版本检查", "检查到新版本:"+ver+" 请升级后使用", func(b bool) {
|
||||
var commands = map[string]string{
|
||||
"windows": "explorer",
|
||||
"darwin": "open",
|
||||
"linux": "xdg-open",
|
||||
}
|
||||
//open browser
|
||||
open := func(uri string) error {
|
||||
// runtime.GOOS获取当前平台
|
||||
run, ok := commands[runtime.GOOS]
|
||||
if !ok {
|
||||
logrus.Errorf("don't know how to open things on %s platform", runtime.GOOS)
|
||||
}
|
||||
|
||||
cmd := exec.Command(run, uri)
|
||||
return cmd.Run()
|
||||
}
|
||||
_ = open(ui.configService.GetConfig().UpgradeUrl)
|
||||
defer parent.Close()
|
||||
}, parent)
|
||||
chkDialog.SetConfirmText(common.BUTTON_OK)
|
||||
chkDialog.Show()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// createChooseServerPopUp
|
||||
func (ui *MainWindowImpl) createChooseServerPopUp(w fyne.Window) error {
|
||||
ch := make(chan string)
|
||||
|
||||
selServerWin := ui.createChooseServerWindow("选服", ch)
|
||||
title := fmt.Sprintf(common.APP_WIN_TITLE, "选服", ui.app.Metadata().Version, ui.app.Metadata().Build, common.APP_NAME)
|
||||
selServerWin := ui.createChooseServerWindow(title, ch)
|
||||
ui.checkVersion(selServerWin)
|
||||
|
||||
go func() {
|
||||
data := <-ch
|
||||
selServerWin.Hide()
|
||||
@ -156,16 +200,16 @@ func (ui *MainWindowImpl) createChooseServerPopUp(w fyne.Window) error {
|
||||
func (ui *MainWindowImpl) createChooseServerWindow(
|
||||
title string,
|
||||
ch chan string) fyne.Window {
|
||||
|
||||
// choose server button func
|
||||
makeButton := func(s *service.ServiceConf, parent fyne.Window) *widget.Button {
|
||||
btn := widget.NewButton(s.Name, func() {
|
||||
d := dialog.NewInformation("", common.INFO_WAIT, parent)
|
||||
d.SetDismissText(common.BUTTON_CANCEL)
|
||||
d.Show()
|
||||
|
||||
logrus.WithField("server", s.Name).Debug("choose server")
|
||||
logrus.WithFields(logrus.Fields{"server": s.Name, "sid": s.SId}).Debug("choose server")
|
||||
//conn server
|
||||
if err := ui.connService.Connect(s.Url); err != nil {
|
||||
if err := ui.connService.WsConnect(s.Url); err != nil {
|
||||
d.Hide()
|
||||
dialog.ShowError(err, parent)
|
||||
} else {
|
||||
@ -217,7 +261,7 @@ func (ui *MainWindowImpl) createLoginWin(sid, sname string) {
|
||||
}
|
||||
// hide toolbar
|
||||
ui.tb.toolbar.Hide()
|
||||
// 必须在创建窗口之后调用
|
||||
// call after ui.createWindowContainer
|
||||
ui.connService.ListenerPush()
|
||||
if code := ui.pttService.Login(sid, account.Text); code != pb.ErrorCode_Success {
|
||||
err := fmt.Errorf("login err: %v[%d]", code, int32(code))
|
||||
@ -237,7 +281,9 @@ func (ui *MainWindowImpl) createLoginWin(sid, sname string) {
|
||||
return
|
||||
}
|
||||
|
||||
ui.w.SetTitle(fmt.Sprintf("%s[%s]", sname, sid))
|
||||
// reset main window title
|
||||
subTitle := fmt.Sprintf("%s[%s]", sname, sid)
|
||||
ui.w.SetTitle(fmt.Sprintf(common.APP_WIN_TITLE, subTitle, ui.app.Metadata().Version, ui.app.Metadata().Build, common.APP_NAME))
|
||||
ui.pttService.SetUser(rsp.Data, rsp.Ex)
|
||||
// isCreateRole
|
||||
if rsp.Data.Created {
|
||||
|
@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"go_dreamfactory/cmd/v2/model"
|
||||
"go_dreamfactory/cmd/v2/service/observer"
|
||||
"go_dreamfactory/cmd/v2/ui/formview"
|
||||
formview "go_dreamfactory/cmd/v2/ui/views"
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/modules/friend"
|
||||
@ -44,7 +44,6 @@ var (
|
||||
ff(comm.ModuleMail, "getallmailattachment"): &formview.MailAttachmentAllView{},
|
||||
//task
|
||||
ff(comm.ModuleTask, task.TaskSubTypeList): &formview.TaskListView{},
|
||||
ff(comm.ModuleTask, task.TaskSubTypeReceive): &formview.TaskReceiveView{},
|
||||
ff(comm.ModuleTask, task.TaskSubTypeActiveList): &formview.TaskActiveListView{},
|
||||
ff(comm.ModuleTask, task.TaskSubTypeActiveReceive): &formview.TaskActiveReceiveView{},
|
||||
// hero
|
||||
@ -121,7 +120,6 @@ var (
|
||||
},
|
||||
"task": {
|
||||
ff(comm.ModuleTask, task.TaskSubTypeList),
|
||||
ff(comm.ModuleTask, task.TaskSubTypeReceive),
|
||||
ff(comm.ModuleTask, task.TaskSubTypeActiveList),
|
||||
ff(comm.ModuleTask, task.TaskSubTypeActiveReceive),
|
||||
},
|
||||
@ -277,15 +275,8 @@ var (
|
||||
Rsp: &pb.TaskListResp{},
|
||||
Enabled: true,
|
||||
},
|
||||
"task.receive": {
|
||||
NavLabel: "任务领取",
|
||||
Desc: "用户任务领取",
|
||||
MainType: "task",
|
||||
SubType: "receive",
|
||||
Enabled: true,
|
||||
},
|
||||
ff(comm.ModuleTask, task.TaskSubTypeActiveList): {
|
||||
NavLabel: "活跃度",
|
||||
NavLabel: "活跃度列表",
|
||||
Desc: "用户活跃度列表",
|
||||
MainType: string(comm.ModuleTask),
|
||||
SubType: task.TaskSubTypeActiveList,
|
||||
|
99
cmd/v2/ui/views/baselistview.go
Normal file
99
cmd/v2/ui/views/baselistview.go
Normal file
@ -0,0 +1,99 @@
|
||||
package formview
|
||||
|
||||
import (
|
||||
"go_dreamfactory/cmd/v2/model"
|
||||
"go_dreamfactory/cmd/v2/service"
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/modules/friend"
|
||||
"go_dreamfactory/pb"
|
||||
"go_dreamfactory/utils"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/container"
|
||||
"fyne.io/fyne/v2/data/binding"
|
||||
"fyne.io/fyne/v2/widget"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
type ListBaseView struct {
|
||||
BaseformView
|
||||
dataListWidget *widget.List
|
||||
dataBinding binding.UntypedList
|
||||
selItemIds []string //选择的ID
|
||||
itemListData *model.ItemModelList
|
||||
}
|
||||
|
||||
// init data
|
||||
func (this *ListBaseView) initItemList() {
|
||||
this.dataBinding = binding.NewUntypedList()
|
||||
this.itemListData = model.NewItemModelList()
|
||||
}
|
||||
|
||||
// create list view with check widget
|
||||
func (this *ListBaseView) createItemListWithCheck() *widget.List {
|
||||
this.dataListWidget = widget.NewListWithData(this.dataBinding,
|
||||
func() fyne.CanvasObject {
|
||||
return container.NewHBox(
|
||||
widget.NewCheck("", func(b bool) {}),
|
||||
widget.NewLabelWithStyle("", fyne.TextAlignCenter, fyne.TextStyle{}),
|
||||
)
|
||||
},
|
||||
func(data binding.DataItem, item fyne.CanvasObject) {
|
||||
o, _ := data.(binding.Untyped).Get()
|
||||
pd := o.(*model.ItemModel)
|
||||
item.(*fyne.Container).Objects[0].(*widget.Check).OnChanged = func(b bool) {
|
||||
if b {
|
||||
this.selItemIds = append(this.selItemIds, pd.Id)
|
||||
} else {
|
||||
utils.DeleteString(this.selItemIds, pd.Id)
|
||||
}
|
||||
}
|
||||
item.(*fyne.Container).Objects[1].(*widget.Label).SetText(pd.Label)
|
||||
},
|
||||
)
|
||||
return this.dataListWidget
|
||||
}
|
||||
|
||||
// create list , single select
|
||||
func (this *ListBaseView) createItemList() *widget.List {
|
||||
this.dataListWidget = widget.NewListWithData(this.dataBinding,
|
||||
func() fyne.CanvasObject {
|
||||
return container.NewHBox(
|
||||
widget.NewLabelWithStyle("", fyne.TextAlignCenter, fyne.TextStyle{}),
|
||||
)
|
||||
},
|
||||
func(data binding.DataItem, item fyne.CanvasObject) {
|
||||
o, _ := data.(binding.Untyped).Get()
|
||||
pd := o.(*model.ItemModel)
|
||||
item.(*fyne.Container).Objects[0].(*widget.Label).SetText(pd.Label)
|
||||
},
|
||||
)
|
||||
|
||||
// single select
|
||||
this.dataListWidget.OnSelected = func(id widget.ListItemID) {
|
||||
sel := this.itemListData.DataList[id]
|
||||
this.selItemIds = []string{sel.Id}
|
||||
}
|
||||
|
||||
return this.dataListWidget
|
||||
}
|
||||
|
||||
func (this *ListBaseView) listBtnFun() func() {
|
||||
return func() {
|
||||
if err := service.GetPttService().SendToClient(
|
||||
string(comm.ModuleFriend),
|
||||
friend.FriendSubTypeApplyList,
|
||||
&pb.FriendApplyListReq{}); err != nil {
|
||||
logrus.Error(err)
|
||||
}
|
||||
this.itemListData = model.NewItemModelList()
|
||||
}
|
||||
}
|
||||
|
||||
// set data
|
||||
func (this *ListBaseView) reloadListData() {
|
||||
if this.itemListData != nil {
|
||||
d := this.itemListData.AsInterfaceArray()
|
||||
this.dataBinding.Set(d)
|
||||
}
|
||||
}
|
@ -16,12 +16,12 @@ import (
|
||||
)
|
||||
|
||||
type FriendAgreeView struct {
|
||||
FriendListBaseView
|
||||
ListBaseView
|
||||
}
|
||||
|
||||
func (this *FriendAgreeView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
||||
//init required
|
||||
this.initFriendList()
|
||||
this.initItemList()
|
||||
|
||||
//同意提交
|
||||
agreeBtn := widget.NewButtonWithIcon("同意", theme.ConfirmIcon(), func() {
|
||||
@ -29,13 +29,13 @@ func (this *FriendAgreeView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
||||
t.MainType,
|
||||
t.SubType,
|
||||
&pb.FriendAgreeReq{
|
||||
FriendIds: this.selFriendIds,
|
||||
FriendIds: this.selItemIds,
|
||||
},
|
||||
); err != nil {
|
||||
logrus.Error(err)
|
||||
return
|
||||
}
|
||||
this.applyListBtnFun()
|
||||
this.listBtnFun()
|
||||
})
|
||||
|
||||
//拒绝
|
||||
@ -44,19 +44,19 @@ func (this *FriendAgreeView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
||||
string(comm.ModuleFriend),
|
||||
friend.FriendSubTypeRefuse,
|
||||
&pb.FriendRefuseReq{
|
||||
FriendIds: this.selFriendIds,
|
||||
FriendIds: this.selItemIds,
|
||||
}); err != nil {
|
||||
logrus.Error(err)
|
||||
return
|
||||
}
|
||||
this.applyListBtnFun()
|
||||
this.listBtnFun()
|
||||
})
|
||||
|
||||
this.createList()
|
||||
this.createItemListWithCheck()
|
||||
|
||||
applyListBtn := widget.NewButton("申请列表", this.applyListBtnFun())
|
||||
applyListBtn := widget.NewButton("申请列表", this.listBtnFun())
|
||||
|
||||
split := container.NewHSplit(this.dataList, container.NewVBox(applyListBtn, agreeBtn, refuseBtn))
|
||||
split := container.NewHSplit(this.dataListWidget, container.NewVBox(applyListBtn, agreeBtn, refuseBtn))
|
||||
split.Offset = 1
|
||||
|
||||
this.dataListener()
|
||||
@ -79,13 +79,13 @@ func (this *FriendAgreeView) dataListener() {
|
||||
}
|
||||
|
||||
for _, v := range rsp.List {
|
||||
fm := &model.FriendModel{
|
||||
Uid: v.UserId,
|
||||
Name: v.NickName,
|
||||
fm := &model.ItemModel{
|
||||
Id: v.UserId,
|
||||
Label: v.NickName,
|
||||
}
|
||||
this.friendData.DataList = append(this.friendData.DataList, fm)
|
||||
this.itemListData.DataList = append(this.itemListData.DataList, fm)
|
||||
}
|
||||
this.reloadFriendData()
|
||||
this.reloadListData()
|
||||
},
|
||||
})
|
||||
}
|
@ -15,14 +15,14 @@ import (
|
||||
)
|
||||
|
||||
type FriendBlacklistView struct {
|
||||
FriendListBaseView
|
||||
ListBaseView
|
||||
}
|
||||
|
||||
func (this *FriendBlacklistView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
||||
// init required
|
||||
this.initFriendList()
|
||||
this.initItemList()
|
||||
// create friend list view
|
||||
this.createList()
|
||||
this.createItemListWithCheck()
|
||||
|
||||
friendList := func() {
|
||||
if err := service.GetPttService().SendToClient(
|
||||
@ -31,12 +31,12 @@ func (this *FriendBlacklistView) CreateView(t *model.TestCase) fyne.CanvasObject
|
||||
&pb.FriendBlackListReq{}); err != nil {
|
||||
logrus.Error(err)
|
||||
}
|
||||
this.friendData = model.NewFriendModelList()
|
||||
this.itemListData = model.NewItemModelList()
|
||||
}
|
||||
friendListBtn := widget.NewButton("黑名单列表", friendList)
|
||||
|
||||
// layout
|
||||
split := container.NewHSplit(this.dataList, container.NewVBox(friendListBtn))
|
||||
split := container.NewHSplit(this.dataListWidget, container.NewVBox(friendListBtn))
|
||||
split.Offset = 1
|
||||
|
||||
//data listener for
|
||||
@ -60,13 +60,13 @@ func (this *FriendBlacklistView) dataListener() {
|
||||
}
|
||||
|
||||
for _, v := range rsp.Friends {
|
||||
fm := &model.FriendModel{
|
||||
Uid: v.UserId,
|
||||
Name: v.NickName,
|
||||
fm := &model.ItemModel{
|
||||
Id: v.UserId,
|
||||
Label: v.NickName,
|
||||
}
|
||||
this.friendData.DataList = append(this.friendData.DataList, fm)
|
||||
this.itemListData.DataList = append(this.itemListData.DataList, fm)
|
||||
}
|
||||
this.reloadFriendData()
|
||||
this.reloadListData()
|
||||
},
|
||||
})
|
||||
}
|
@ -17,16 +17,16 @@ import (
|
||||
|
||||
//好友列表
|
||||
type FriendListView struct {
|
||||
FriendListBaseView //继承支持好友列表的基类
|
||||
ListBaseView //继承支持好友列表的基类
|
||||
friendList func()
|
||||
}
|
||||
|
||||
func (this *FriendListView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
||||
// init required
|
||||
this.initFriendList()
|
||||
this.initItemList()
|
||||
|
||||
// create friend list view
|
||||
this.createList()
|
||||
this.createItemListWithCheck()
|
||||
|
||||
// new friendlist btn
|
||||
this.friendList = func() {
|
||||
@ -36,7 +36,7 @@ func (this *FriendListView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
||||
&pb.FriendListReq{}); err != nil {
|
||||
logrus.Error(err)
|
||||
}
|
||||
this.friendData = model.NewFriendModelList()
|
||||
this.itemListData = model.NewItemModelList()
|
||||
}
|
||||
friendListBtn := widget.NewButton("好友列表", this.friendList)
|
||||
|
||||
@ -47,17 +47,17 @@ func (this *FriendListView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
||||
t.MainType,
|
||||
friend.FriendSubTypeZan,
|
||||
&pb.FriendZanReq{
|
||||
FriendId: this.selFriendIds[0],
|
||||
FriendId: this.selItemIds[0],
|
||||
},
|
||||
); err != nil {
|
||||
logrus.Error(err)
|
||||
return
|
||||
}
|
||||
this.applyListBtnFun()
|
||||
this.listBtnFun()
|
||||
})
|
||||
|
||||
// layout
|
||||
split := container.NewHSplit(this.dataList, container.NewVBox(friendListBtn, zanBtn))
|
||||
split := container.NewHSplit(this.dataListWidget, container.NewVBox(friendListBtn, zanBtn))
|
||||
split.Offset = 1
|
||||
|
||||
//data listener for
|
||||
@ -83,15 +83,15 @@ func (this *FriendListView) dataListener() {
|
||||
logrus.Error("unmarshal err")
|
||||
}
|
||||
|
||||
this.friendData = model.NewFriendModelList()
|
||||
this.itemListData = model.NewItemModelList()
|
||||
for _, v := range rsp.List {
|
||||
fm := &model.FriendModel{
|
||||
Uid: v.UserId,
|
||||
Name: v.NickName,
|
||||
fm := &model.ItemModel{
|
||||
Id: v.UserId,
|
||||
Label: v.NickName,
|
||||
}
|
||||
this.friendData.DataList = append(this.friendData.DataList, fm)
|
||||
this.itemListData.DataList = append(this.itemListData.DataList, fm)
|
||||
}
|
||||
this.reloadFriendData()
|
||||
this.reloadListData()
|
||||
},
|
||||
})
|
||||
}
|
@ -16,12 +16,12 @@ import (
|
||||
)
|
||||
|
||||
type FriendZanView struct {
|
||||
FriendListBaseView
|
||||
ListBaseView
|
||||
}
|
||||
|
||||
func (this *FriendZanView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
||||
//init required
|
||||
this.initFriendList()
|
||||
this.initItemList()
|
||||
|
||||
receiveBtn := widget.NewButtonWithIcon("获赞", theme.ConfirmIcon(), func() {
|
||||
|
||||
@ -29,13 +29,13 @@ func (this *FriendZanView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
||||
t.MainType,
|
||||
"zanreceive",
|
||||
&pb.FriendZanreceiveReq{
|
||||
FriendId: this.selFriendIds[0],
|
||||
FriendId: this.selItemIds[0],
|
||||
},
|
||||
); err != nil {
|
||||
logrus.Error(err)
|
||||
return
|
||||
}
|
||||
this.applyListBtnFun()
|
||||
this.listBtnFun()
|
||||
})
|
||||
|
||||
// new zanlist btn
|
||||
@ -46,15 +46,15 @@ func (this *FriendZanView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
||||
&pb.FriendZanlistReq{}); err != nil {
|
||||
logrus.Error(err)
|
||||
}
|
||||
this.friendData = model.NewFriendModelList()
|
||||
this.itemListData = model.NewItemModelList()
|
||||
}
|
||||
zanListBtn := widget.NewButton("点赞列表", zanList)
|
||||
|
||||
// create friend list view
|
||||
this.createList()
|
||||
this.createItemListWithCheck()
|
||||
|
||||
// layout
|
||||
split := container.NewHSplit(this.dataList, container.NewVBox(zanListBtn, receiveBtn))
|
||||
split := container.NewHSplit(this.dataListWidget, container.NewVBox(zanListBtn, receiveBtn))
|
||||
split.Offset = 1
|
||||
|
||||
this.dataListener()
|
||||
@ -75,15 +75,15 @@ func (this *FriendZanView) dataListener() {
|
||||
logrus.Error("unmarshal err")
|
||||
}
|
||||
|
||||
this.friendData = model.NewFriendModelList()
|
||||
this.itemListData = model.NewItemModelList()
|
||||
for _, v := range rsp.List {
|
||||
fm := &model.FriendModel{
|
||||
Uid: v.UserId,
|
||||
Name: v.NickName,
|
||||
fm := &model.ItemModel{
|
||||
Id: v.UserId,
|
||||
Label: v.NickName,
|
||||
}
|
||||
this.friendData.DataList = append(this.friendData.DataList, fm)
|
||||
this.itemListData.DataList = append(this.itemListData.DataList, fm)
|
||||
}
|
||||
this.reloadFriendData()
|
||||
this.reloadListData()
|
||||
},
|
||||
})
|
||||
}
|
138
cmd/v2/ui/views/hero_list.go
Normal file
138
cmd/v2/ui/views/hero_list.go
Normal file
@ -0,0 +1,138 @@
|
||||
package formview
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"go_dreamfactory/cmd/v2/model"
|
||||
"go_dreamfactory/cmd/v2/service"
|
||||
"go_dreamfactory/cmd/v2/service/observer"
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/modules/hero"
|
||||
"go_dreamfactory/pb"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/container"
|
||||
"fyne.io/fyne/v2/theme"
|
||||
"fyne.io/fyne/v2/widget"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cast"
|
||||
)
|
||||
|
||||
type HeroListView struct {
|
||||
ListBaseView
|
||||
subWindows *SubWindowListView
|
||||
heroList []*pb.DBHero
|
||||
}
|
||||
|
||||
func (this *HeroListView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
||||
// init required
|
||||
this.initItemList()
|
||||
|
||||
// create friend list view
|
||||
l := this.createItemList()
|
||||
l.OnSelected = func(id widget.ListItemID) {
|
||||
//创建window
|
||||
m := this.itemListData.DataList[id]
|
||||
// if this.subWindows == nil {
|
||||
this.subWindows = NewSubWindowView(m.Id, m.Label, this.obs)
|
||||
this.subWindows.initItemList()
|
||||
this.subWindows.createItemListWithCheck()
|
||||
this.subWindows.createWindows()
|
||||
// }
|
||||
|
||||
// TODO 升星
|
||||
starBtn := widget.NewButtonWithIcon("升星", theme.ConfirmIcon(), func() {
|
||||
if err := service.GetPttService().SendToClient(t.MainType, hero.StrengthenUpStar,
|
||||
&pb.HeroStrengthenUpStarReq{
|
||||
HeroObjID: m.Id,
|
||||
// HeroRace: heroRace,
|
||||
// Hero: hero,
|
||||
}); err != nil {
|
||||
logrus.Error(err)
|
||||
return
|
||||
}
|
||||
})
|
||||
|
||||
lvBtn := widget.NewButtonWithIcon("升级", theme.ConfirmIcon(), func() {
|
||||
var cards []*pb.MapStringInt32
|
||||
for _, v := range this.subWindows.selItemIds {
|
||||
cards = append(cards, &pb.MapStringInt32{
|
||||
Key: v,
|
||||
Value: 1,
|
||||
})
|
||||
}
|
||||
if err := service.GetPttService().SendToClient(t.MainType, hero.StrengthenUplv,
|
||||
&pb.HeroStrengthenUplvReq{
|
||||
HeroObjID: m.Id,
|
||||
ExpCards: cards,
|
||||
}); err != nil {
|
||||
logrus.Error(err)
|
||||
return
|
||||
}
|
||||
})
|
||||
|
||||
this.subWindows.itemListData = model.NewItemModelList()
|
||||
for _, v := range this.heroList {
|
||||
if v.CardType == 3 { //不显示类型是3的
|
||||
fm := &model.ItemModel{
|
||||
Id: cast.ToString(v.Id),
|
||||
Label: fmt.Sprintf("%s Lv:%d S:%d T:%d", cast.ToString(v.HeroID), v.Lv, v.Star, v.CardType),
|
||||
}
|
||||
this.subWindows.itemListData.DataList = append(this.subWindows.itemListData.DataList, fm)
|
||||
}
|
||||
}
|
||||
this.subWindows.reloadListData()
|
||||
|
||||
split := container.NewHSplit(this.subWindows.dataListWidget, container.NewVBox(starBtn, lvBtn))
|
||||
split.Offset = 1
|
||||
|
||||
this.subWindows.w.SetContent(split)
|
||||
|
||||
this.subWindows.w.Show()
|
||||
}
|
||||
|
||||
// hero list button
|
||||
heroListBtn := widget.NewButtonWithIcon("英雄列表", theme.ConfirmIcon(), func() {
|
||||
if err := service.GetPttService().SendToClient(t.MainType, t.SubType, &pb.HeroListReq{}); err != nil {
|
||||
logrus.Error(err)
|
||||
}
|
||||
})
|
||||
|
||||
// layout
|
||||
split := container.NewHSplit(this.dataListWidget, container.NewVBox(heroListBtn))
|
||||
split.Offset = 1
|
||||
|
||||
//data listener for
|
||||
this.dataListener()
|
||||
|
||||
return split
|
||||
}
|
||||
|
||||
func (this *HeroListView) dataListener() {
|
||||
this.obs.AddListener(observer.EVENT_REQ_RSP, observer.Listener{
|
||||
OnNotify: func(d interface{}, args ...interface{}) {
|
||||
data := d.(*pb.UserMessage)
|
||||
if !(data.MainType == string(comm.ModuleHero) &&
|
||||
data.SubType == hero.HeroSubTypeList) {
|
||||
return
|
||||
}
|
||||
|
||||
rsp := &pb.HeroListResp{}
|
||||
if !comm.ProtoUnmarshal(data, rsp) {
|
||||
logrus.Error("unmarshal err")
|
||||
}
|
||||
this.heroList = rsp.List
|
||||
|
||||
this.itemListData = model.NewItemModelList()
|
||||
for _, v := range rsp.List {
|
||||
if v.CardType != 3 { //不显示类型是3的
|
||||
fm := &model.ItemModel{
|
||||
Id: cast.ToString(v.Id),
|
||||
Label: fmt.Sprintf("%s Lv:%d S:%d T:%d", cast.ToString(v.HeroID), v.Lv, v.Star, v.CardType),
|
||||
}
|
||||
this.itemListData.DataList = append(this.itemListData.DataList, fm)
|
||||
}
|
||||
}
|
||||
this.reloadListData()
|
||||
},
|
||||
})
|
||||
}
|
69
cmd/v2/ui/views/subwindowbase.go
Normal file
69
cmd/v2/ui/views/subwindowbase.go
Normal file
@ -0,0 +1,69 @@
|
||||
package formview
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"go_dreamfactory/cmd/v2/model"
|
||||
"go_dreamfactory/cmd/v2/service/observer"
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/modules/hero"
|
||||
"go_dreamfactory/pb"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cast"
|
||||
)
|
||||
|
||||
type SubWindowListView struct {
|
||||
ListBaseView
|
||||
title string
|
||||
winId string
|
||||
obs observer.Observer
|
||||
w fyne.Window
|
||||
}
|
||||
|
||||
func NewSubWindowView(winId, title string, obs observer.Observer) *SubWindowListView {
|
||||
return &SubWindowListView{
|
||||
title: title,
|
||||
winId: winId,
|
||||
obs: obs,
|
||||
}
|
||||
}
|
||||
|
||||
func (this *SubWindowListView) createWindows() fyne.Window {
|
||||
this.w = fyne.CurrentApp().NewWindow(this.title)
|
||||
|
||||
this.w.CenterOnScreen()
|
||||
this.w.SetFixedSize(true)
|
||||
this.w.Resize(fyne.Size{Width: 800, Height: 650})
|
||||
this.dataListener()
|
||||
return this.w
|
||||
}
|
||||
|
||||
func (this *SubWindowListView) dataListener() {
|
||||
this.obs.AddListener(observer.EVENT_REQ_RSP, observer.Listener{
|
||||
OnNotify: func(d interface{}, args ...interface{}) {
|
||||
data := d.(*pb.UserMessage)
|
||||
if !(data.MainType == string(comm.ModuleHero) &&
|
||||
data.SubType == hero.HeroSubTypeList) {
|
||||
return
|
||||
}
|
||||
|
||||
rsp := &pb.HeroListResp{}
|
||||
if !comm.ProtoUnmarshal(data, rsp) {
|
||||
logrus.Error("unmarshal err")
|
||||
}
|
||||
|
||||
this.itemListData = model.NewItemModelList()
|
||||
for _, v := range rsp.List {
|
||||
if v.CardType == 3 { //只显示类型是3的
|
||||
fm := &model.ItemModel{
|
||||
Id: cast.ToString(v.Id),
|
||||
Label: fmt.Sprintf("%s Lv:%d S:%d T:%d", cast.ToString(v.HeroID), v.Lv, v.Star, v.CardType),
|
||||
}
|
||||
this.itemListData.DataList = append(this.itemListData.DataList, fm)
|
||||
}
|
||||
}
|
||||
this.reloadListData()
|
||||
},
|
||||
})
|
||||
}
|
103
cmd/v2/ui/views/task_activelist.go
Normal file
103
cmd/v2/ui/views/task_activelist.go
Normal file
@ -0,0 +1,103 @@
|
||||
package formview
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"go_dreamfactory/cmd/v2/lib/common"
|
||||
"go_dreamfactory/cmd/v2/model"
|
||||
"go_dreamfactory/cmd/v2/service"
|
||||
"go_dreamfactory/cmd/v2/service/observer"
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/modules/task"
|
||||
"go_dreamfactory/pb"
|
||||
|
||||
"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"
|
||||
"github.com/spf13/cast"
|
||||
)
|
||||
|
||||
type TaskActiveListView struct {
|
||||
ListBaseView
|
||||
activeVal int32
|
||||
}
|
||||
|
||||
func (this *TaskActiveListView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
||||
// init required
|
||||
this.initItemList()
|
||||
|
||||
// create friend list view
|
||||
this.createItemList()
|
||||
|
||||
// select widget
|
||||
tagSelect := getTaskTagSelect()
|
||||
this.form.AppendItem(widget.NewFormItem(common.APP_TESTCASE_FORM_TASKTAG, tagSelect))
|
||||
|
||||
// task active list button
|
||||
taskListBtn := widget.NewButtonWithIcon("活跃度", theme.ConfirmIcon(), func() {
|
||||
if err := service.GetPttService().SendToClient(t.MainType, t.SubType, &pb.TaskActiveListReq{
|
||||
TaskTag: cast.ToInt32(tagSelect.Selected),
|
||||
}); err != nil {
|
||||
logrus.Error(err)
|
||||
}
|
||||
})
|
||||
|
||||
//label
|
||||
activeLabel := widget.NewLabel(fmt.Sprintf("当前活跃度:%d", this.activeVal))
|
||||
|
||||
//receive button
|
||||
receiveBtn := widget.NewButtonWithIcon("领取", theme.ConfirmIcon(), func() {
|
||||
if len(this.selItemIds) != 1 {
|
||||
dialog.ShowError(errors.New("请选择一项"), this.w)
|
||||
return
|
||||
}
|
||||
if err := service.GetPttService().SendToClient(
|
||||
t.MainType, "activereceive",
|
||||
&pb.TaskReceiveReq{Id: this.selItemIds[0], TaskTag: cast.ToInt32(tagSelect.Selected)}); err != nil {
|
||||
logrus.Error(err)
|
||||
return
|
||||
}
|
||||
})
|
||||
|
||||
// layout
|
||||
split := container.NewHSplit(this.dataListWidget, container.NewVBox(activeLabel, this.form, taskListBtn, receiveBtn))
|
||||
split.Offset = 1
|
||||
|
||||
//data listener for
|
||||
this.dataListener()
|
||||
|
||||
return split
|
||||
}
|
||||
|
||||
func (this *TaskActiveListView) dataListener() {
|
||||
this.obs.AddListener(observer.EVENT_REQ_RSP, observer.Listener{
|
||||
OnNotify: func(d interface{}, args ...interface{}) {
|
||||
data := d.(*pb.UserMessage)
|
||||
if !(data.MainType == string(comm.ModuleTask) &&
|
||||
data.SubType == task.TaskSubTypeActiveList) {
|
||||
return
|
||||
}
|
||||
|
||||
rsp := &pb.TaskActiveListResp{}
|
||||
if !comm.ProtoUnmarshal(data, rsp) {
|
||||
logrus.Error("unmarshal err")
|
||||
}
|
||||
|
||||
this.activeVal = rsp.Active
|
||||
|
||||
this.itemListData = model.NewItemModelList()
|
||||
for _, v := range rsp.List {
|
||||
fm := &model.ItemModel{
|
||||
Id: cast.ToString(v.Id),
|
||||
Label: fmt.Sprintf("%s R:%d", cast.ToString(v.RId), v.Received),
|
||||
}
|
||||
this.itemListData.DataList = append(this.itemListData.DataList, fm)
|
||||
}
|
||||
this.reloadListData()
|
||||
|
||||
},
|
||||
})
|
||||
}
|
96
cmd/v2/ui/views/task_list.go
Normal file
96
cmd/v2/ui/views/task_list.go
Normal file
@ -0,0 +1,96 @@
|
||||
package formview
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"go_dreamfactory/cmd/v2/lib/common"
|
||||
"go_dreamfactory/cmd/v2/model"
|
||||
"go_dreamfactory/cmd/v2/service"
|
||||
"go_dreamfactory/cmd/v2/service/observer"
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/modules/task"
|
||||
"go_dreamfactory/pb"
|
||||
|
||||
"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"
|
||||
"github.com/spf13/cast"
|
||||
)
|
||||
|
||||
type TaskListView struct {
|
||||
ListBaseView
|
||||
}
|
||||
|
||||
func (this *TaskListView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
||||
// init required
|
||||
this.initItemList()
|
||||
|
||||
// create friend list view
|
||||
this.createItemList()
|
||||
|
||||
// select widget
|
||||
tagSelect := getTaskTagSelect()
|
||||
this.form.AppendItem(widget.NewFormItem(common.APP_TESTCASE_FORM_TASKTAG, tagSelect))
|
||||
|
||||
// task list button
|
||||
taskListBtn := widget.NewButtonWithIcon("任务列表", theme.ConfirmIcon(), func() {
|
||||
if err := service.GetPttService().SendToClient(t.MainType, t.SubType, &pb.TaskListReq{
|
||||
TaskTag: cast.ToInt32(tagSelect.Selected),
|
||||
}); err != nil {
|
||||
logrus.Error(err)
|
||||
}
|
||||
})
|
||||
|
||||
// task receive button
|
||||
receiveBtn := widget.NewButtonWithIcon("任务领取", theme.ConfirmIcon(), func() {
|
||||
if len(this.selItemIds) != 1 {
|
||||
dialog.ShowError(errors.New("请选择一项"), this.w)
|
||||
return
|
||||
}
|
||||
if err := service.GetPttService().SendToClient(
|
||||
t.MainType, "receive",
|
||||
&pb.TaskReceiveReq{Id: this.selItemIds[0], TaskTag: cast.ToInt32(tagSelect.Selected)}); err != nil {
|
||||
logrus.Error(err)
|
||||
return
|
||||
}
|
||||
})
|
||||
|
||||
// layout
|
||||
split := container.NewHSplit(this.dataListWidget, container.NewVBox(this.form, taskListBtn, receiveBtn))
|
||||
split.Offset = 1
|
||||
|
||||
//data listener for
|
||||
this.dataListener()
|
||||
|
||||
return split
|
||||
}
|
||||
|
||||
func (this *TaskListView) dataListener() {
|
||||
this.obs.AddListener(observer.EVENT_REQ_RSP, observer.Listener{
|
||||
OnNotify: func(d interface{}, args ...interface{}) {
|
||||
data := d.(*pb.UserMessage)
|
||||
if !(data.MainType == string(comm.ModuleTask) &&
|
||||
data.SubType == task.TaskSubTypeList) {
|
||||
return
|
||||
}
|
||||
|
||||
rsp := &pb.TaskListResp{}
|
||||
if !comm.ProtoUnmarshal(data, rsp) {
|
||||
logrus.Error("unmarshal err")
|
||||
}
|
||||
|
||||
this.itemListData = model.NewItemModelList()
|
||||
for _, v := range rsp.List {
|
||||
fm := &model.ItemModel{
|
||||
Id: cast.ToString(v.Id),
|
||||
Label: fmt.Sprintf("%s S:%d R:%d", cast.ToString(v.TaskId), v.Status, v.Received),
|
||||
}
|
||||
this.itemListData.DataList = append(this.itemListData.DataList, fm)
|
||||
}
|
||||
this.reloadListData()
|
||||
},
|
||||
})
|
||||
}
|
4
go.mod
4
go.mod
@ -10,6 +10,7 @@ require (
|
||||
github.com/atotto/clipboard v0.1.4
|
||||
github.com/axgle/mahonia v0.0.0-20180208002826-3358181d7394
|
||||
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
|
||||
github.com/go-redis/redis/v8 v8.11.5
|
||||
github.com/golang-jwt/jwt v3.2.2+incompatible
|
||||
@ -61,6 +62,7 @@ require (
|
||||
github.com/fyne-io/gl-js v0.0.0-20220119005834-d2da28d9ccfe // indirect
|
||||
github.com/fyne-io/glfw-js v0.0.0-20220120001248-ee7290d23504 // indirect
|
||||
github.com/fyne-io/image v0.0.0-20220602074514-4956b0afb3d2 // indirect
|
||||
github.com/gin-contrib/sse v0.1.0 // indirect
|
||||
github.com/go-cmd/cmd v1.4.0 // indirect
|
||||
github.com/go-gl/gl v0.0.0-20211210172815-726fda9656d6 // indirect
|
||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20211213063430-748e38ca8aec // indirect
|
||||
@ -73,6 +75,7 @@ require (
|
||||
github.com/go-redis/redis_rate/v9 v9.1.2 // indirect
|
||||
github.com/go-stack/stack v1.8.0 // indirect
|
||||
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect
|
||||
github.com/goccy/go-json v0.9.7 // indirect
|
||||
github.com/godbus/dbus/v5 v5.1.0 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/goki/freetype v0.0.0-20181231101311-fa8a33aabaff // indirect
|
||||
@ -117,6 +120,7 @@ require (
|
||||
github.com/nxadm/tail v1.4.8 // indirect
|
||||
github.com/onsi/ginkgo v1.16.5 // indirect
|
||||
github.com/pelletier/go-toml v1.9.3 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.0.1 // indirect
|
||||
github.com/philhofer/fwd v1.1.1 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
|
8
go.sum
8
go.sum
@ -163,6 +163,10 @@ github.com/fyne-io/glfw-js v0.0.0-20220120001248-ee7290d23504/go.mod h1:gLRWYfYn
|
||||
github.com/fyne-io/image v0.0.0-20220602074514-4956b0afb3d2 h1:hnLq+55b7Zh7/2IRzWCpiTcAvjv/P8ERF+N7+xXbZhk=
|
||||
github.com/fyne-io/image v0.0.0-20220602074514-4956b0afb3d2/go.mod h1:eO7W361vmlPOrykIg+Rsh1SZ3tQBaOsfzZhsIOb/Lm0=
|
||||
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
||||
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
|
||||
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
|
||||
github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8=
|
||||
github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk=
|
||||
github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
|
||||
github.com/go-cmd/cmd v1.4.0 h1:dF+1JtZMlgCKAcsvstp2VNmVA/jXRjlRYFOF4/w7Bbo=
|
||||
github.com/go-cmd/cmd v1.4.0/go.mod h1:tbBenttXtZU4c5djS1o7PWL5pd2xAr5sIqH1kGdNiRc=
|
||||
@ -231,6 +235,8 @@ github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWe
|
||||
github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ=
|
||||
github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0=
|
||||
github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw=
|
||||
github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM=
|
||||
github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
|
||||
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||
github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk=
|
||||
github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||
@ -561,6 +567,8 @@ github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144T
|
||||
github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE=
|
||||
github.com/pelletier/go-toml v1.9.3 h1:zeC5b1GviRUyKYd6OJPvBU/mcVDVoL1OhT17FCt5dSQ=
|
||||
github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
|
||||
github.com/pelletier/go-toml/v2 v2.0.1 h1:8e3L2cCQzLFi2CR4g7vGFuFxX7Jl1kKX8gW+iV0GUKU=
|
||||
github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo=
|
||||
github.com/peterbourgon/g2s v0.0.0-20140925154142-ec76db4c1ac1 h1:5Dl+ADmsGerAqHwWzyLqkNaUBQ+48DQwfDCaW1gHAQM=
|
||||
github.com/peterbourgon/g2s v0.0.0-20140925154142-ec76db4c1ac1/go.mod h1:1VcHEd3ro4QMoHfiNl/j7Jkln9+KQuorp0PItHMJYNg=
|
||||
github.com/philhofer/fwd v1.1.1 h1:GdGcTjf5RNAxwS4QLsiMzJYj5KEvPJD3Abr261yRQXQ=
|
||||
|
@ -9,7 +9,7 @@ import (
|
||||
)
|
||||
|
||||
func (this *apiComp) DrawCardCheck(session comm.IUserSession, req *pb.HeroDrawCardReq) (code pb.ErrorCode) {
|
||||
if req.DrawType <= 0 { // 只能是单抽或10抽
|
||||
if req.DrawType < 0 && (req.DrawCount == 1 || req.DrawCount == 10) { // 只能是单抽或10抽
|
||||
code = pb.ErrorCode_ReqParameterError
|
||||
}
|
||||
return
|
||||
@ -27,35 +27,39 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
|
||||
cfgDraw *cfg.GameglobalData
|
||||
costAtn *cfg.Gameatn
|
||||
heroRecord *pb.DBHeroRecord
|
||||
|
||||
pool string
|
||||
//heroRecord *pb.DBHeroRecord // 英雄扩展属性
|
||||
)
|
||||
|
||||
req.DrawCount = 10 // test
|
||||
cfgDraw = this.module.configure.GetGlobalConf() // 读取抽卡配置文件
|
||||
|
||||
if cfgDraw == nil {
|
||||
return
|
||||
}
|
||||
code = this.DrawCardCheck(session, req)
|
||||
if code != pb.ErrorCode_Success {
|
||||
return
|
||||
}
|
||||
szCards = make([]string, 0)
|
||||
rsp := &pb.HeroDrawCardResp{}
|
||||
cfg := cfgDraw
|
||||
|
||||
heroRecord, _ = this.module.modelRecord.GetHeroRecord(session.GetUserId())
|
||||
drawCount = heroRecord.Drawcount
|
||||
pool = this.module.modelHero.CheckPool(drawCount, cfg)
|
||||
if req.DrawType == 0 { // 普通卡池抽卡
|
||||
// 获取普通抽卡池
|
||||
pool := this.module.modelHero.CheckPool(drawCount, cfg)
|
||||
_data := this.module.configure.GetPollByType(pool)
|
||||
if _data == nil {
|
||||
code = pb.ErrorCode_ConfigNoFound
|
||||
return
|
||||
}
|
||||
if req.DrawCount == 1 {
|
||||
costAtn = cfgDraw.BasePoolCost
|
||||
costAtn.N *= req.DrawCount // 重新计算消耗数量
|
||||
} else {
|
||||
costAtn = cfgDraw.BasePool10cost
|
||||
}
|
||||
costRes = append(costRes, costAtn)
|
||||
code = this.module.CheckRes(session, costRes)
|
||||
if code != pb.ErrorCode_Success { // 消耗数量不足直接返回
|
||||
return
|
||||
}
|
||||
|
||||
for {
|
||||
for i := 0; i < int(req.DrawCount); i++ {
|
||||
sz := make([]int32, 0)
|
||||
if cfgDraw.BasePoolStar3 != 0 {
|
||||
sz = append(sz, cfgDraw.BasePoolStar3)
|
||||
@ -74,30 +78,16 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
|
||||
} else if starIndex == 2 {
|
||||
star5Max++
|
||||
}
|
||||
if star4Max >= cfgDraw.Draw10Star4Max {
|
||||
starIndex = 0
|
||||
} else if star5Max >= cfgDraw.Draw10Star5Max {
|
||||
if star4Max >= cfgDraw.Draw10Star4Max || star5Max >= cfgDraw.Draw10Star5Max {
|
||||
starIndex = 0
|
||||
}
|
||||
szStar = append(szStar, starIndex)
|
||||
szStar = append(szStar, starIndex+3)
|
||||
if len(szStar) >= int(req.DrawCount) {
|
||||
break
|
||||
}
|
||||
}
|
||||
for star := range szCards { // szStar 转 szHeroId
|
||||
|
||||
sz := make([]int32, 0)
|
||||
for _, v := range _data[int32(star)] {
|
||||
sz = append(sz, v.Weight)
|
||||
}
|
||||
randomIndex := this.module.modelHero.GetRandW(sz)
|
||||
|
||||
szCards = append(szCards, _data[int32(star)][randomIndex].Id)
|
||||
}
|
||||
|
||||
} else { // 所有阵营抽卡都走这里
|
||||
pool := ""
|
||||
|
||||
if req.DrawCount == 1 {
|
||||
switch req.DrawType {
|
||||
case 1:
|
||||
pool = cfg.Camp1Pool1
|
||||
@ -113,13 +103,28 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
|
||||
pool = cfg.Camp4Pool1
|
||||
costAtn = cfgDraw.Camp4PoolCost
|
||||
}
|
||||
} else {
|
||||
costAtn = cfgDraw.Camp1PoolCost
|
||||
switch req.DrawType {
|
||||
case 1:
|
||||
pool = cfg.Camp1Pool1
|
||||
costAtn = cfgDraw.Camp1Pool10cost
|
||||
|
||||
case 2:
|
||||
pool = cfg.Camp2Pool1
|
||||
costAtn = cfgDraw.Camp2Pool10cost
|
||||
case 3:
|
||||
pool = cfg.Camp3Pool1
|
||||
costAtn = cfgDraw.Camp3Pool10cost
|
||||
case 4:
|
||||
pool = cfg.Camp4Pool1
|
||||
costAtn = cfgDraw.Camp4Pool10cost
|
||||
}
|
||||
}
|
||||
|
||||
costAtn.N *= req.DrawCount
|
||||
costRes = append(costRes, costAtn)
|
||||
_data := this.module.configure.GetPollByType(pool)
|
||||
if _data == nil {
|
||||
code = pb.ErrorCode_ConfigNoFound
|
||||
return
|
||||
}
|
||||
|
||||
//阵营消耗
|
||||
code = this.module.CheckRes(session, costRes)
|
||||
if code != pb.ErrorCode_Success { // 消耗数量不足直接返回
|
||||
@ -128,11 +133,10 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
|
||||
for {
|
||||
sz := make([]int32, 0)
|
||||
if cfgDraw.CampPoolStar3 != 0 {
|
||||
sz = append(sz, cfgDraw.CampPoolStar3)
|
||||
sz = append(sz, cfgDraw.CampPoolStar3) // 3 4 5 性权重
|
||||
}
|
||||
if cfgDraw.CampPoolStar4 != 0 {
|
||||
sz = append(sz, cfgDraw.CampPoolStar4)
|
||||
|
||||
}
|
||||
if cfgDraw.CampPoolStar5 != 0 {
|
||||
sz = append(sz, cfgDraw.CampPoolStar5)
|
||||
@ -144,17 +148,21 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
|
||||
} else if starIndex == 2 {
|
||||
star5Max++
|
||||
}
|
||||
if star4Max >= cfgDraw.Draw10Star4Max {
|
||||
starIndex = 0
|
||||
} else if star5Max >= cfgDraw.Draw10Star5Max {
|
||||
if star4Max >= cfgDraw.Draw10Star4Max || star5Max >= cfgDraw.Draw10Star5Max {
|
||||
starIndex = 0
|
||||
}
|
||||
szStar = append(szStar, starIndex)
|
||||
szStar = append(szStar, starIndex+3)
|
||||
if len(szStar) >= int(req.DrawCount) {
|
||||
break
|
||||
}
|
||||
}
|
||||
for star := range szCards { // szStar 转 szHeroId
|
||||
}
|
||||
_data := this.module.configure.GetPollByType(pool)
|
||||
if _data == nil {
|
||||
code = pb.ErrorCode_ConfigNoFound
|
||||
return
|
||||
}
|
||||
for _, star := range szStar { // szStar 转 szHeroId
|
||||
|
||||
sz := make([]int32, 0)
|
||||
for _, v := range _data[int32(star)] {
|
||||
@ -164,15 +172,12 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
|
||||
|
||||
szCards = append(szCards, _data[int32(star)][randomIndex].Id)
|
||||
}
|
||||
}
|
||||
|
||||
// 更新record 配置信息
|
||||
update := map[string]interface{}{}
|
||||
if drawCount != -1 {
|
||||
drawCount += req.DrawCount
|
||||
update["drawcount"] = drawCount
|
||||
}
|
||||
//update["race"+strconv.Itoa(int(race)-1)] = raceData
|
||||
this.module.modelRecord.ChangeHeroRecord(session.GetUserId(), update)
|
||||
// 消耗道具
|
||||
code = this.module.ConsumeRes(session, costRes, true)
|
||||
|
@ -61,7 +61,7 @@ func (this *Items) EventUserOffline(session comm.IUserSession) {
|
||||
//IItems-------------------------------------------------------------------------------------------------------------------------------
|
||||
///查询用户背包物品数量
|
||||
func (this *Items) QueryItemAmount(source *comm.ModuleCallSource, uId string, itemid string) (amount uint32) {
|
||||
defer this.Debugf("获取物品 uId:%s itemid:%d addnum:%d ", uId, itemid, amount)
|
||||
defer this.Debugf("获取物品 uId:%s itemid:%s addnum:%d ", uId, itemid, amount)
|
||||
amount = 0
|
||||
if result := this.modelItems.QueryUserPackItemsAmount(uId, itemid); result != nil && len(result) > 0 {
|
||||
return result[itemid]
|
||||
|
@ -76,14 +76,17 @@ func (this *configureComp) getTaskById(taskId int32) (data *cfg.GametaskRoundDat
|
||||
}
|
||||
|
||||
//是否第一个成就任务
|
||||
func (this *configureComp) isFirstTask(taskId int32) bool {
|
||||
func (this *configureComp) isFirstTask(taskId int32) (ok bool) {
|
||||
data := this.getTaskByTag(int32(comm.TASK_ACHIEVE))
|
||||
for _, v := range data {
|
||||
if v.IdAfter == taskId {
|
||||
return false
|
||||
ok = false
|
||||
} else {
|
||||
ok = true
|
||||
}
|
||||
break
|
||||
}
|
||||
return true
|
||||
return
|
||||
}
|
||||
|
||||
// 上一个任务
|
||||
|
@ -82,7 +82,7 @@ func (this *ModelTask) getTaskListByTag(uid string, taskTag comm.TaskTag) (newli
|
||||
newlist = append(newlist, v)
|
||||
}
|
||||
}
|
||||
|
||||
break
|
||||
}
|
||||
|
||||
}
|
||||
|
42
sys/configure/structs/game.RdtaksAll.go
Normal file
42
sys/configure/structs/game.RdtaksAll.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 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]
|
||||
}
|
||||
|
||||
|
105
sys/configure/structs/game.RdtaksAllData.go
Normal file
105
sys/configure/structs/game.RdtaksAllData.go
Normal file
@ -0,0 +1,105 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <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 GameRdtaksAllData struct {
|
||||
RdtaksId int32
|
||||
TaskType int32
|
||||
RdtaksNum []int32
|
||||
IdLast []int32
|
||||
IdAfter int32
|
||||
IdTag int32
|
||||
Story int32
|
||||
Completetask int32
|
||||
Reword []*Gameatn
|
||||
ChooseId []int32
|
||||
}
|
||||
|
||||
const TypeId_GameRdtaksAllData = -100955128
|
||||
|
||||
func (*GameRdtaksAllData) GetTypeId() int32 {
|
||||
return -100955128
|
||||
}
|
||||
|
||||
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_) }
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
if _arr_, _ok_ = _buf["rdtaks_num"].([]interface{}); !_ok_ { err = errors.New("rdtaks_num error"); return }
|
||||
|
||||
_v.RdtaksNum = 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.RdtaksNum = append(_v.RdtaksNum, _list_v_)
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
var _arr_ []interface{}
|
||||
var _ok_ bool
|
||||
if _arr_, _ok_ = _buf["id_last"].([]interface{}); !_ok_ { err = errors.New("id_last error"); return }
|
||||
|
||||
_v.IdLast = 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_)
|
||||
}
|
||||
}
|
||||
|
||||
{ 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
|
||||
if _arr_, _ok_ = _buf["reword"].([]interface{}); !_ok_ { err = errors.New("reword error"); return }
|
||||
|
||||
_v.Reword = make([]*Gameatn, 0, len(_arr_))
|
||||
|
||||
for _, _e_ := range _arr_ {
|
||||
var _list_v_ *Gameatn
|
||||
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ { err = errors.New("_list_v_ error"); return }; if _list_v_, err = DeserializeGameatn(_x_); err != nil { return } }
|
||||
_v.Reword = append(_v.Reword, _list_v_)
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
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{}
|
||||
if err := v.Deserialize(_buf); err == nil {
|
||||
return v, nil
|
||||
} else {
|
||||
return nil, err
|
||||
}
|
||||
}
|
42
sys/configure/structs/game.RdtaksChoose.go
Normal file
42
sys/configure/structs/game.RdtaksChoose.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 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]
|
||||
}
|
||||
|
||||
|
41
sys/configure/structs/game.RdtaksChooseData.go
Normal file
41
sys/configure/structs/game.RdtaksChooseData.go
Normal file
@ -0,0 +1,41 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <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
|
||||
}
|
||||
}
|
42
sys/configure/structs/game.RdtaksType.go
Normal file
42
sys/configure/structs/game.RdtaksType.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 GameRdtaksType struct {
|
||||
_dataMap map[int32]*GameRdtaksTypeData
|
||||
_dataList []*GameRdtaksTypeData
|
||||
}
|
||||
|
||||
func NewGameRdtaksType(_buf []map[string]interface{}) (*GameRdtaksType, error) {
|
||||
_dataList := make([]*GameRdtaksTypeData, 0, len(_buf))
|
||||
dataMap := make(map[int32]*GameRdtaksTypeData)
|
||||
for _, _ele_ := range _buf {
|
||||
if _v, err2 := DeserializeGameRdtaksTypeData(_ele_); err2 != nil {
|
||||
return nil, err2
|
||||
} else {
|
||||
_dataList = append(_dataList, _v)
|
||||
dataMap[_v.RdtaksNum] = _v
|
||||
}
|
||||
}
|
||||
return &GameRdtaksType{_dataList:_dataList, _dataMap:dataMap}, nil
|
||||
}
|
||||
|
||||
func (table *GameRdtaksType) GetDataMap() map[int32]*GameRdtaksTypeData {
|
||||
return table._dataMap
|
||||
}
|
||||
|
||||
func (table *GameRdtaksType) GetDataList() []*GameRdtaksTypeData {
|
||||
return table._dataList
|
||||
}
|
||||
|
||||
func (table *GameRdtaksType) Get(key int32) *GameRdtaksTypeData {
|
||||
return table._dataMap[key]
|
||||
}
|
||||
|
||||
|
47
sys/configure/structs/game.RdtaksTypeData.go
Normal file
47
sys/configure/structs/game.RdtaksTypeData.go
Normal file
@ -0,0 +1,47 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <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 GameRdtaksTypeData struct {
|
||||
RdtaksNum int32
|
||||
Typdes int32
|
||||
Datatime int32
|
||||
TyptaskId int32
|
||||
Data1 int32
|
||||
Data2 int32
|
||||
Data3 int32
|
||||
}
|
||||
|
||||
const TypeId_GameRdtaksTypeData = -1284226425
|
||||
|
||||
func (*GameRdtaksTypeData) GetTypeId() int32 {
|
||||
return -1284226425
|
||||
}
|
||||
|
||||
func (_v *GameRdtaksTypeData)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_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["typtask_id"].(float64); !_ok_ { err = errors.New("typtask_id error"); return }; _v.TyptaskId = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["data1"].(float64); !_ok_ { err = errors.New("data1 error"); return }; _v.Data1 = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["data2"].(float64); !_ok_ { err = errors.New("data2 error"); return }; _v.Data2 = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["data3"].(float64); !_ok_ { err = errors.New("data3 error"); return }; _v.Data3 = int32(_tempNum_) }
|
||||
return
|
||||
}
|
||||
|
||||
func DeserializeGameRdtaksTypeData(_buf map[string]interface{}) (*GameRdtaksTypeData, error) {
|
||||
v := &GameRdtaksTypeData{}
|
||||
if err := v.Deserialize(_buf); err == nil {
|
||||
return v, nil
|
||||
} else {
|
||||
return nil, err
|
||||
}
|
||||
}
|
@ -49,6 +49,11 @@ type GamecomData struct {
|
||||
Camp2PoolCost *Gameatn
|
||||
Camp3PoolCost *Gameatn
|
||||
Camp4PoolCost *Gameatn
|
||||
BasePool10cost *Gameatn
|
||||
Camp1Pool10cost *Gameatn
|
||||
Camp2Pool10cost *Gameatn
|
||||
Camp3Pool10cost *Gameatn
|
||||
Camp4Pool10cost *Gameatn
|
||||
Camp1Pool1 string
|
||||
Camp2Pool1 string
|
||||
Camp3Pool1 string
|
||||
@ -64,6 +69,8 @@ type GamecomData struct {
|
||||
CampPoolStar4 int32
|
||||
CampPoolStar5 int32
|
||||
Gourmet int32
|
||||
SmithyMaxplayer int32
|
||||
SmithyMaxtime int32
|
||||
}
|
||||
|
||||
const TypeId_GamecomData = -395344177
|
||||
@ -176,6 +183,11 @@ func (_v *GamecomData)Deserialize(_buf map[string]interface{}) (err error) {
|
||||
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["camp2_pool_cost"].(map[string]interface{}); !_ok_ { err = errors.New("camp2_pool_cost error"); return }; if _v.Camp2PoolCost, err = DeserializeGameatn(_x_); err != nil { return } }
|
||||
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["camp3_pool_cost"].(map[string]interface{}); !_ok_ { err = errors.New("camp3_pool_cost error"); return }; if _v.Camp3PoolCost, err = DeserializeGameatn(_x_); err != nil { return } }
|
||||
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["camp4_pool_cost"].(map[string]interface{}); !_ok_ { err = errors.New("camp4_pool_cost error"); return }; if _v.Camp4PoolCost, err = DeserializeGameatn(_x_); err != nil { return } }
|
||||
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["base_pool_10cost"].(map[string]interface{}); !_ok_ { err = errors.New("base_pool_10cost error"); return }; if _v.BasePool10cost, err = DeserializeGameatn(_x_); err != nil { return } }
|
||||
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["camp1_pool_10cost"].(map[string]interface{}); !_ok_ { err = errors.New("camp1_pool_10cost error"); return }; if _v.Camp1Pool10cost, err = DeserializeGameatn(_x_); err != nil { return } }
|
||||
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["camp2_pool_10cost"].(map[string]interface{}); !_ok_ { err = errors.New("camp2_pool_10cost error"); return }; if _v.Camp2Pool10cost, err = DeserializeGameatn(_x_); err != nil { return } }
|
||||
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["camp3_pool_10cost"].(map[string]interface{}); !_ok_ { err = errors.New("camp3_pool_10cost error"); return }; if _v.Camp3Pool10cost, err = DeserializeGameatn(_x_); err != nil { return } }
|
||||
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["camp4_pool_10cost"].(map[string]interface{}); !_ok_ { err = errors.New("camp4_pool_10cost error"); return }; if _v.Camp4Pool10cost, err = DeserializeGameatn(_x_); err != nil { return } }
|
||||
{ var _ok_ bool; if _v.Camp1Pool1, _ok_ = _buf["camp1_pool1"].(string); !_ok_ { err = errors.New("camp1_pool1 error"); return } }
|
||||
{ var _ok_ bool; if _v.Camp2Pool1, _ok_ = _buf["camp2_pool1"].(string); !_ok_ { err = errors.New("camp2_pool1 error"); return } }
|
||||
{ var _ok_ bool; if _v.Camp3Pool1, _ok_ = _buf["camp3_pool1"].(string); !_ok_ { err = errors.New("camp3_pool1 error"); return } }
|
||||
@ -191,6 +203,8 @@ func (_v *GamecomData)Deserialize(_buf map[string]interface{}) (err error) {
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["camp_pool_star4"].(float64); !_ok_ { err = errors.New("camp_pool_star4 error"); return }; _v.CampPoolStar4 = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["camp_pool_star5"].(float64); !_ok_ { err = errors.New("camp_pool_star5 error"); return }; _v.CampPoolStar5 = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["gourmet"].(float64); !_ok_ { err = errors.New("gourmet error"); return }; _v.Gourmet = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["smithy_maxplayer"].(float64); !_ok_ { err = errors.New("smithy_maxplayer error"); return }; _v.SmithyMaxplayer = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["smithy_maxtime"].(float64); !_ok_ { err = errors.New("smithy_maxtime error"); return }; _v.SmithyMaxtime = int32(_tempNum_) }
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -49,6 +49,11 @@ type GameglobalData struct {
|
||||
Camp2PoolCost *Gameatn
|
||||
Camp3PoolCost *Gameatn
|
||||
Camp4PoolCost *Gameatn
|
||||
BasePool10cost *Gameatn
|
||||
Camp1Pool10cost *Gameatn
|
||||
Camp2Pool10cost *Gameatn
|
||||
Camp3Pool10cost *Gameatn
|
||||
Camp4Pool10cost *Gameatn
|
||||
Camp1Pool1 string
|
||||
Camp2Pool1 string
|
||||
Camp3Pool1 string
|
||||
@ -64,6 +69,8 @@ type GameglobalData struct {
|
||||
CampPoolStar4 int32
|
||||
CampPoolStar5 int32
|
||||
Gourmet int32
|
||||
SmithyMaxplayer int32
|
||||
SmithyMaxtime int32
|
||||
}
|
||||
|
||||
const TypeId_GameglobalData = -518904471
|
||||
@ -176,6 +183,11 @@ func (_v *GameglobalData)Deserialize(_buf map[string]interface{}) (err error) {
|
||||
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["camp2_pool_cost"].(map[string]interface{}); !_ok_ { err = errors.New("camp2_pool_cost error"); return }; if _v.Camp2PoolCost, err = DeserializeGameatn(_x_); err != nil { return } }
|
||||
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["camp3_pool_cost"].(map[string]interface{}); !_ok_ { err = errors.New("camp3_pool_cost error"); return }; if _v.Camp3PoolCost, err = DeserializeGameatn(_x_); err != nil { return } }
|
||||
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["camp4_pool_cost"].(map[string]interface{}); !_ok_ { err = errors.New("camp4_pool_cost error"); return }; if _v.Camp4PoolCost, err = DeserializeGameatn(_x_); err != nil { return } }
|
||||
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["base_pool_10cost"].(map[string]interface{}); !_ok_ { err = errors.New("base_pool_10cost error"); return }; if _v.BasePool10cost, err = DeserializeGameatn(_x_); err != nil { return } }
|
||||
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["camp1_pool_10cost"].(map[string]interface{}); !_ok_ { err = errors.New("camp1_pool_10cost error"); return }; if _v.Camp1Pool10cost, err = DeserializeGameatn(_x_); err != nil { return } }
|
||||
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["camp2_pool_10cost"].(map[string]interface{}); !_ok_ { err = errors.New("camp2_pool_10cost error"); return }; if _v.Camp2Pool10cost, err = DeserializeGameatn(_x_); err != nil { return } }
|
||||
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["camp3_pool_10cost"].(map[string]interface{}); !_ok_ { err = errors.New("camp3_pool_10cost error"); return }; if _v.Camp3Pool10cost, err = DeserializeGameatn(_x_); err != nil { return } }
|
||||
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["camp4_pool_10cost"].(map[string]interface{}); !_ok_ { err = errors.New("camp4_pool_10cost error"); return }; if _v.Camp4Pool10cost, err = DeserializeGameatn(_x_); err != nil { return } }
|
||||
{ var _ok_ bool; if _v.Camp1Pool1, _ok_ = _buf["camp1_pool1"].(string); !_ok_ { err = errors.New("camp1_pool1 error"); return } }
|
||||
{ var _ok_ bool; if _v.Camp2Pool1, _ok_ = _buf["camp2_pool1"].(string); !_ok_ { err = errors.New("camp2_pool1 error"); return } }
|
||||
{ var _ok_ bool; if _v.Camp3Pool1, _ok_ = _buf["camp3_pool1"].(string); !_ok_ { err = errors.New("camp3_pool1 error"); return } }
|
||||
@ -191,6 +203,8 @@ func (_v *GameglobalData)Deserialize(_buf map[string]interface{}) (err error) {
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["camp_pool_star4"].(float64); !_ok_ { err = errors.New("camp_pool_star4 error"); return }; _v.CampPoolStar4 = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["camp_pool_star5"].(float64); !_ok_ { err = errors.New("camp_pool_star5 error"); return }; _v.CampPoolStar5 = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["gourmet"].(float64); !_ok_ { err = errors.New("gourmet error"); return }; _v.Gourmet = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["smithy_maxplayer"].(float64); !_ok_ { err = errors.New("smithy_maxplayer error"); return }; _v.SmithyMaxplayer = int32(_tempNum_) }
|
||||
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["smithy_maxtime"].(float64); !_ok_ { err = errors.New("smithy_maxtime error"); return }; _v.SmithyMaxtime = int32(_tempNum_) }
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user