跑商修改
This commit is contained in:
parent
275ee9e1b1
commit
e586f872f1
33
bin/json/game_caravanevent.json
Normal file
33
bin/json/game_caravanevent.json
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"id": 1001,
|
||||||
|
"eventtype": 1,
|
||||||
|
"mustdo": 1,
|
||||||
|
"citystory": 101,
|
||||||
|
"citynormal": 102,
|
||||||
|
"cityabnormal": 103,
|
||||||
|
"worldtask": 210,
|
||||||
|
"traintips": {
|
||||||
|
"key": "caravan_caravan_event_traintips_1",
|
||||||
|
"text": "列车上来了外人,这个人看上去有很急切的事情,我们必须先解决这个再离开这里。"
|
||||||
|
},
|
||||||
|
"trainstory": 888,
|
||||||
|
"trainstorybad": 777,
|
||||||
|
"trainstorygood": 888,
|
||||||
|
"reword": [
|
||||||
|
{
|
||||||
|
"a": "item",
|
||||||
|
"t": "141001",
|
||||||
|
"n": 10
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"exreword": [
|
||||||
|
10001
|
||||||
|
],
|
||||||
|
"unreword": [
|
||||||
|
1,
|
||||||
|
40
|
||||||
|
],
|
||||||
|
"eventtime": 500
|
||||||
|
}
|
||||||
|
]
|
@ -8541,9 +8541,40 @@
|
|||||||
"decompose_deplete": []
|
"decompose_deplete": []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "151001",
|
"id": "141002",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_234",
|
"key": "item_item_name_234",
|
||||||
|
"text": "车票"
|
||||||
|
},
|
||||||
|
"usetype": 14,
|
||||||
|
"color": 4,
|
||||||
|
"bagtype": 0,
|
||||||
|
"index": 99,
|
||||||
|
"special_type": 200,
|
||||||
|
"time": 0,
|
||||||
|
"reddottype": 0,
|
||||||
|
"effects": "",
|
||||||
|
"modelName": "",
|
||||||
|
"box_id": 0,
|
||||||
|
"synthetize_num": 0,
|
||||||
|
"access": [
|
||||||
|
107
|
||||||
|
],
|
||||||
|
"use_skip": 166,
|
||||||
|
"upper_limit": -1,
|
||||||
|
"img": "icon_mcs",
|
||||||
|
"intr": {
|
||||||
|
"key": "item_item_intr_233",
|
||||||
|
"text": "缺少流通货币"
|
||||||
|
},
|
||||||
|
"sale": [],
|
||||||
|
"synthetize_deplete": [],
|
||||||
|
"decompose_deplete": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "151001",
|
||||||
|
"name": {
|
||||||
|
"key": "item_item_name_235",
|
||||||
"text": "提示道具"
|
"text": "提示道具"
|
||||||
},
|
},
|
||||||
"usetype": 15,
|
"usetype": 15,
|
||||||
@ -8580,7 +8611,7 @@
|
|||||||
{
|
{
|
||||||
"id": "14010101",
|
"id": "14010101",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_235",
|
"key": "item_item_name_236",
|
||||||
"text": "豪猪刺"
|
"text": "豪猪刺"
|
||||||
},
|
},
|
||||||
"usetype": 8,
|
"usetype": 8,
|
||||||
@ -8617,7 +8648,7 @@
|
|||||||
{
|
{
|
||||||
"id": "14010102",
|
"id": "14010102",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_236",
|
"key": "item_item_name_237",
|
||||||
"text": "火鸡胃"
|
"text": "火鸡胃"
|
||||||
},
|
},
|
||||||
"usetype": 8,
|
"usetype": 8,
|
||||||
@ -8654,7 +8685,7 @@
|
|||||||
{
|
{
|
||||||
"id": "14010203",
|
"id": "14010203",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_237",
|
"key": "item_item_name_238",
|
||||||
"text": "蟾蜍卵"
|
"text": "蟾蜍卵"
|
||||||
},
|
},
|
||||||
"usetype": 8,
|
"usetype": 8,
|
||||||
@ -8691,7 +8722,7 @@
|
|||||||
{
|
{
|
||||||
"id": "14010204",
|
"id": "14010204",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_238",
|
"key": "item_item_name_239",
|
||||||
"text": "蚂蟥汁"
|
"text": "蚂蟥汁"
|
||||||
},
|
},
|
||||||
"usetype": 8,
|
"usetype": 8,
|
||||||
@ -8728,7 +8759,7 @@
|
|||||||
{
|
{
|
||||||
"id": "14010305",
|
"id": "14010305",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_239",
|
"key": "item_item_name_240",
|
||||||
"text": "白鲜"
|
"text": "白鲜"
|
||||||
},
|
},
|
||||||
"usetype": 8,
|
"usetype": 8,
|
||||||
@ -8765,7 +8796,7 @@
|
|||||||
{
|
{
|
||||||
"id": "14010306",
|
"id": "14010306",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_240",
|
"key": "item_item_name_241",
|
||||||
"text": "荨麻"
|
"text": "荨麻"
|
||||||
},
|
},
|
||||||
"usetype": 8,
|
"usetype": 8,
|
||||||
@ -8802,7 +8833,7 @@
|
|||||||
{
|
{
|
||||||
"id": "14010407",
|
"id": "14010407",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_241",
|
"key": "item_item_name_242",
|
||||||
"text": "粪石"
|
"text": "粪石"
|
||||||
},
|
},
|
||||||
"usetype": 8,
|
"usetype": 8,
|
||||||
@ -8839,7 +8870,7 @@
|
|||||||
{
|
{
|
||||||
"id": "14010408",
|
"id": "14010408",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_242",
|
"key": "item_item_name_243",
|
||||||
"text": "屎壳郎粉"
|
"text": "屎壳郎粉"
|
||||||
},
|
},
|
||||||
"usetype": 8,
|
"usetype": 8,
|
||||||
@ -8876,7 +8907,7 @@
|
|||||||
{
|
{
|
||||||
"id": "14020101",
|
"id": "14020101",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_243",
|
"key": "item_item_name_244",
|
||||||
"text": "火蜥蜴皮"
|
"text": "火蜥蜴皮"
|
||||||
},
|
},
|
||||||
"usetype": 8,
|
"usetype": 8,
|
||||||
@ -8913,7 +8944,7 @@
|
|||||||
{
|
{
|
||||||
"id": "14020102",
|
"id": "14020102",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_244",
|
"key": "item_item_name_245",
|
||||||
"text": "奇美拉牙"
|
"text": "奇美拉牙"
|
||||||
},
|
},
|
||||||
"usetype": 8,
|
"usetype": 8,
|
||||||
@ -8950,7 +8981,7 @@
|
|||||||
{
|
{
|
||||||
"id": "14020203",
|
"id": "14020203",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_245",
|
"key": "item_item_name_246",
|
||||||
"text": "河豚眼"
|
"text": "河豚眼"
|
||||||
},
|
},
|
||||||
"usetype": 8,
|
"usetype": 8,
|
||||||
@ -8987,7 +9018,7 @@
|
|||||||
{
|
{
|
||||||
"id": "14020204",
|
"id": "14020204",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_246",
|
"key": "item_item_name_247",
|
||||||
"text": "章鱼水"
|
"text": "章鱼水"
|
||||||
},
|
},
|
||||||
"usetype": 8,
|
"usetype": 8,
|
||||||
@ -9024,7 +9055,7 @@
|
|||||||
{
|
{
|
||||||
"id": "14020305",
|
"id": "14020305",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_247",
|
"key": "item_item_name_248",
|
||||||
"text": "曼德拉草"
|
"text": "曼德拉草"
|
||||||
},
|
},
|
||||||
"usetype": 8,
|
"usetype": 8,
|
||||||
@ -9061,7 +9092,7 @@
|
|||||||
{
|
{
|
||||||
"id": "14020306",
|
"id": "14020306",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_248",
|
"key": "item_item_name_249",
|
||||||
"text": "乌头"
|
"text": "乌头"
|
||||||
},
|
},
|
||||||
"usetype": 8,
|
"usetype": 8,
|
||||||
@ -9098,7 +9129,7 @@
|
|||||||
{
|
{
|
||||||
"id": "14020407",
|
"id": "14020407",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_249",
|
"key": "item_item_name_250",
|
||||||
"text": "月长石"
|
"text": "月长石"
|
||||||
},
|
},
|
||||||
"usetype": 8,
|
"usetype": 8,
|
||||||
@ -9135,7 +9166,7 @@
|
|||||||
{
|
{
|
||||||
"id": "14020408",
|
"id": "14020408",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_250",
|
"key": "item_item_name_251",
|
||||||
"text": "蛇王蛋"
|
"text": "蛇王蛋"
|
||||||
},
|
},
|
||||||
"usetype": 8,
|
"usetype": 8,
|
||||||
@ -9172,7 +9203,7 @@
|
|||||||
{
|
{
|
||||||
"id": "14030101",
|
"id": "14030101",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_251",
|
"key": "item_item_name_252",
|
||||||
"text": "火龙血"
|
"text": "火龙血"
|
||||||
},
|
},
|
||||||
"usetype": 8,
|
"usetype": 8,
|
||||||
@ -9209,7 +9240,7 @@
|
|||||||
{
|
{
|
||||||
"id": "14030102",
|
"id": "14030102",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_252",
|
"key": "item_item_name_253",
|
||||||
"text": "凤凰胆"
|
"text": "凤凰胆"
|
||||||
},
|
},
|
||||||
"usetype": 8,
|
"usetype": 8,
|
||||||
@ -9246,7 +9277,7 @@
|
|||||||
{
|
{
|
||||||
"id": "14030203",
|
"id": "14030203",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_253",
|
"key": "item_item_name_254",
|
||||||
"text": "独角兽血"
|
"text": "独角兽血"
|
||||||
},
|
},
|
||||||
"usetype": 8,
|
"usetype": 8,
|
||||||
@ -9283,7 +9314,7 @@
|
|||||||
{
|
{
|
||||||
"id": "14030204",
|
"id": "14030204",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_254",
|
"key": "item_item_name_255",
|
||||||
"text": "美人鱼泪"
|
"text": "美人鱼泪"
|
||||||
},
|
},
|
||||||
"usetype": 8,
|
"usetype": 8,
|
||||||
@ -9320,7 +9351,7 @@
|
|||||||
{
|
{
|
||||||
"id": "14030305",
|
"id": "14030305",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_255",
|
"key": "item_item_name_256",
|
||||||
"text": "接骨木"
|
"text": "接骨木"
|
||||||
},
|
},
|
||||||
"usetype": 8,
|
"usetype": 8,
|
||||||
@ -9357,7 +9388,7 @@
|
|||||||
{
|
{
|
||||||
"id": "14030306",
|
"id": "14030306",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_256",
|
"key": "item_item_name_257",
|
||||||
"text": "复活草"
|
"text": "复活草"
|
||||||
},
|
},
|
||||||
"usetype": 8,
|
"usetype": 8,
|
||||||
@ -9394,7 +9425,7 @@
|
|||||||
{
|
{
|
||||||
"id": "14030407",
|
"id": "14030407",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_257",
|
"key": "item_item_name_258",
|
||||||
"text": "贤者之石"
|
"text": "贤者之石"
|
||||||
},
|
},
|
||||||
"usetype": 8,
|
"usetype": 8,
|
||||||
@ -9431,7 +9462,7 @@
|
|||||||
{
|
{
|
||||||
"id": "14030408",
|
"id": "14030408",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_258",
|
"key": "item_item_name_259",
|
||||||
"text": "大还丹"
|
"text": "大还丹"
|
||||||
},
|
},
|
||||||
"usetype": 8,
|
"usetype": 8,
|
||||||
@ -9468,7 +9499,7 @@
|
|||||||
{
|
{
|
||||||
"id": "14010111",
|
"id": "14010111",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_259",
|
"key": "item_item_name_260",
|
||||||
"text": "热火药剂"
|
"text": "热火药剂"
|
||||||
},
|
},
|
||||||
"usetype": 8,
|
"usetype": 8,
|
||||||
@ -9505,7 +9536,7 @@
|
|||||||
{
|
{
|
||||||
"id": "14010212",
|
"id": "14010212",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_260",
|
"key": "item_item_name_261",
|
||||||
"text": "冷水药剂"
|
"text": "冷水药剂"
|
||||||
},
|
},
|
||||||
"usetype": 8,
|
"usetype": 8,
|
||||||
@ -9542,7 +9573,7 @@
|
|||||||
{
|
{
|
||||||
"id": "14010313",
|
"id": "14010313",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_261",
|
"key": "item_item_name_262",
|
||||||
"text": "古木药剂"
|
"text": "古木药剂"
|
||||||
},
|
},
|
||||||
"usetype": 8,
|
"usetype": 8,
|
||||||
@ -9579,7 +9610,7 @@
|
|||||||
{
|
{
|
||||||
"id": "14010414",
|
"id": "14010414",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_262",
|
"key": "item_item_name_263",
|
||||||
"text": "微尘药剂"
|
"text": "微尘药剂"
|
||||||
},
|
},
|
||||||
"usetype": 8,
|
"usetype": 8,
|
||||||
@ -9616,7 +9647,7 @@
|
|||||||
{
|
{
|
||||||
"id": "14020111",
|
"id": "14020111",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_263",
|
"key": "item_item_name_264",
|
||||||
"text": "烈焰精华"
|
"text": "烈焰精华"
|
||||||
},
|
},
|
||||||
"usetype": 8,
|
"usetype": 8,
|
||||||
@ -9653,7 +9684,7 @@
|
|||||||
{
|
{
|
||||||
"id": "14020212",
|
"id": "14020212",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_264",
|
"key": "item_item_name_265",
|
||||||
"text": "凝露精华"
|
"text": "凝露精华"
|
||||||
},
|
},
|
||||||
"usetype": 8,
|
"usetype": 8,
|
||||||
@ -9690,7 +9721,7 @@
|
|||||||
{
|
{
|
||||||
"id": "14020313",
|
"id": "14020313",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_265",
|
"key": "item_item_name_266",
|
||||||
"text": "荆棘精华"
|
"text": "荆棘精华"
|
||||||
},
|
},
|
||||||
"usetype": 8,
|
"usetype": 8,
|
||||||
@ -9727,7 +9758,7 @@
|
|||||||
{
|
{
|
||||||
"id": "14020414",
|
"id": "14020414",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_266",
|
"key": "item_item_name_267",
|
||||||
"text": "曙光精华"
|
"text": "曙光精华"
|
||||||
},
|
},
|
||||||
"usetype": 8,
|
"usetype": 8,
|
||||||
@ -9764,7 +9795,7 @@
|
|||||||
{
|
{
|
||||||
"id": "14030111",
|
"id": "14030111",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_267",
|
"key": "item_item_name_268",
|
||||||
"text": "爆炸神水"
|
"text": "爆炸神水"
|
||||||
},
|
},
|
||||||
"usetype": 8,
|
"usetype": 8,
|
||||||
@ -9801,7 +9832,7 @@
|
|||||||
{
|
{
|
||||||
"id": "14030212",
|
"id": "14030212",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_268",
|
"key": "item_item_name_269",
|
||||||
"text": "深渊神水"
|
"text": "深渊神水"
|
||||||
},
|
},
|
||||||
"usetype": 8,
|
"usetype": 8,
|
||||||
@ -9838,7 +9869,7 @@
|
|||||||
{
|
{
|
||||||
"id": "14030313",
|
"id": "14030313",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_269",
|
"key": "item_item_name_270",
|
||||||
"text": "魔森神水"
|
"text": "魔森神水"
|
||||||
},
|
},
|
||||||
"usetype": 8,
|
"usetype": 8,
|
||||||
@ -9875,7 +9906,7 @@
|
|||||||
{
|
{
|
||||||
"id": "14030414",
|
"id": "14030414",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_270",
|
"key": "item_item_name_271",
|
||||||
"text": "秘境神水"
|
"text": "秘境神水"
|
||||||
},
|
},
|
||||||
"usetype": 8,
|
"usetype": 8,
|
||||||
@ -9912,7 +9943,7 @@
|
|||||||
{
|
{
|
||||||
"id": "15010101",
|
"id": "15010101",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_271",
|
"key": "item_item_name_272",
|
||||||
"text": "活跃度"
|
"text": "活跃度"
|
||||||
},
|
},
|
||||||
"usetype": 15,
|
"usetype": 15,
|
||||||
@ -9943,7 +9974,7 @@
|
|||||||
{
|
{
|
||||||
"id": "9999999",
|
"id": "9999999",
|
||||||
"name": {
|
"name": {
|
||||||
"key": "item_item_name_272",
|
"key": "item_item_name_273",
|
||||||
"text": "时限道具(测试)"
|
"text": "时限道具(测试)"
|
||||||
},
|
},
|
||||||
"usetype": 3,
|
"usetype": 3,
|
||||||
|
@ -259,7 +259,7 @@ const (
|
|||||||
//旧时光
|
//旧时光
|
||||||
TableOldtimes = "oldtimes"
|
TableOldtimes = "oldtimes"
|
||||||
// 巨怪商队
|
// 巨怪商队
|
||||||
TableCaravan = "varavan"
|
TableCaravan = "caravan"
|
||||||
)
|
)
|
||||||
|
|
||||||
// RPC服务接口定义处
|
// RPC服务接口定义处
|
||||||
|
@ -50,7 +50,7 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.CaravanBuyOrSe
|
|||||||
this.module.Errorf("背包道具数量不足%s,道具ID:%d,背包数量:%d", session.GetUserId(), k, v)
|
this.module.Errorf("背包道具数量不足%s,道具ID:%d,背包数量:%d", session.GetUserId(), k, v)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
for _, k1 := range cityInfo.Like {
|
for _, k1 := range cityInfo.Special {
|
||||||
if k == k1 {
|
if k == k1 {
|
||||||
if v <= caravan.Items[k].Count {
|
if v <= caravan.Items[k].Count {
|
||||||
caravan.Items[k].Count -= v
|
caravan.Items[k].Count -= v
|
||||||
@ -63,7 +63,7 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.CaravanBuyOrSe
|
|||||||
// 找到城市想要收购的物品
|
// 找到城市想要收购的物品
|
||||||
var price int32
|
var price int32
|
||||||
price = items.Price
|
price = items.Price
|
||||||
for _, v := range cityInfo.Unlike {
|
for _, v := range cityInfo.Exspecial {
|
||||||
if v == k {
|
if v == k {
|
||||||
if cityConf := this.module.configure.GetCaravanCity(req.City); cityConf != nil {
|
if cityConf := this.module.configure.GetCaravanCity(req.City); cityConf != nil {
|
||||||
price = cityConf.Exspecialnum * items.Price / 1000
|
price = cityConf.Exspecialnum * items.Price / 1000
|
||||||
@ -111,7 +111,7 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.CaravanBuyOrSe
|
|||||||
|
|
||||||
var price int32
|
var price int32
|
||||||
price = items.Price
|
price = items.Price
|
||||||
for _, v := range cityInfo.Like {
|
for _, v := range cityInfo.Special {
|
||||||
if v == k {
|
if v == k {
|
||||||
if cityConf := this.module.configure.GetCaravanCity(req.City); cityConf != nil {
|
if cityConf := this.module.configure.GetCaravanCity(req.City); cityConf != nil {
|
||||||
price = cityConf.Specialnum * items.Price / 1000
|
price = cityConf.Specialnum * items.Price / 1000
|
||||||
|
@ -15,6 +15,7 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.CaravanGetListRe
|
|||||||
var (
|
var (
|
||||||
resp *pb.CaravanGetListResp
|
resp *pb.CaravanGetListResp
|
||||||
)
|
)
|
||||||
|
resp = &pb.CaravanGetListResp{}
|
||||||
if code = this.GetListCheck(session, req); code != pb.ErrorCode_Success {
|
if code = this.GetListCheck(session, req); code != pb.ErrorCode_Success {
|
||||||
return // 参数校验失败直接返回
|
return // 参数校验失败直接返回
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ func (this *apiComp) GotoCity(session comm.IUserSession, req *pb.CaravanGotoCity
|
|||||||
res *cfg.Gameatn
|
res *cfg.Gameatn
|
||||||
bNewTask bool
|
bNewTask bool
|
||||||
)
|
)
|
||||||
bNewTask = true
|
bNewTask = false
|
||||||
if code = this.GotoCityCheck(session, req); code != pb.ErrorCode_Success {
|
if code = this.GotoCityCheck(session, req); code != pb.ErrorCode_Success {
|
||||||
return // 参数校验失败直接返回
|
return // 参数校验失败直接返回
|
||||||
}
|
}
|
||||||
|
@ -9,11 +9,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
game_caravan = "game_caravan_city.json"
|
game_caravan = "game_caravancity.json"
|
||||||
game_caravan_lv = "game_caravan_lv.json"
|
game_caravan_lv = "game_caravanlv.json"
|
||||||
game_caravan_reward = "game_caravan_reward.json"
|
game_caravan_reward = "game_caravanreward.json"
|
||||||
game_caravan_thing = "game_caravan_thing.json"
|
game_caravan_thing = "game_caravanthing.json"
|
||||||
game_caravan_event = "game_caravan_event.json"
|
game_caravan_event = "game_caravanevent.json"
|
||||||
)
|
)
|
||||||
|
|
||||||
///配置管理基础组件
|
///配置管理基础组件
|
||||||
@ -128,3 +128,18 @@ func (this *configureComp) GetCaravanEventById(id int32) (data *cfg.GameCaravanR
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 初始城市取配置表第一条数据
|
||||||
|
func (this *configureComp) GetCaravanInitCity() (initcity int32) {
|
||||||
|
if v, err := this.GetConfigure(game_caravan); err == nil {
|
||||||
|
if configure, ok := v.(*cfg.GameCaravanCity); ok {
|
||||||
|
for _, v := range configure.GetDataList() {
|
||||||
|
return v.Id
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
log.Errorf("get GetCaravanInitCity conf err:%v", err)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
@ -43,7 +43,7 @@ func (this *modelCaravan) getCaravanList(uid string) (result *pb.DBCaravan, err
|
|||||||
result.Id = primitive.NewObjectID().Hex()
|
result.Id = primitive.NewObjectID().Hex()
|
||||||
result.Resettime = configure.Now().Unix() // 设置起始刷新时间
|
result.Resettime = configure.Now().Unix() // 设置起始刷新时间
|
||||||
result.Lv = 1
|
result.Lv = 1
|
||||||
|
result.Curcity = this.module.configure.GetCaravanInitCity() // 获取默认城市
|
||||||
if conf := this.module.configure.GetCaravanLv(1); conf != nil {
|
if conf := this.module.configure.GetCaravanLv(1); conf != nil {
|
||||||
result.Baglimit = conf.Bagtop
|
result.Baglimit = conf.Bagtop
|
||||||
}
|
}
|
||||||
|
@ -56,8 +56,8 @@ func (this *Caravan) InitCaravanCityData(uid string, data *pb.DBCaravan) {
|
|||||||
data.City = make(map[int32]*pb.CityInfo, 0)
|
data.City = make(map[int32]*pb.CityInfo, 0)
|
||||||
for _, v := range list {
|
for _, v := range list {
|
||||||
city := &pb.CityInfo{
|
city := &pb.CityInfo{
|
||||||
Like: []int32{}, // 城市卖给玩家的商品 (注意 这里有库存 必须初始化 Count 字段数据)
|
Special: []int32{}, // 城市卖给玩家的商品 (注意 这里有库存 必须初始化 Count 字段数据)
|
||||||
Unlike: []int32{}, // 城市想要玩家卖给他的商品库
|
Exspecial: []int32{}, // 城市想要玩家卖给他的商品库
|
||||||
Count: map[int32]int32{}, // key 货物ID
|
Count: map[int32]int32{}, // key 货物ID
|
||||||
Rtime: configure.Now().Unix(), // 初始化城市货物刷新时间
|
Rtime: configure.Now().Unix(), // 初始化城市货物刷新时间
|
||||||
}
|
}
|
||||||
@ -65,16 +65,16 @@ func (this *Caravan) InitCaravanCityData(uid string, data *pb.DBCaravan) {
|
|||||||
if len(v.Special) > int(v.Citytypenum) {
|
if len(v.Special) > int(v.Citytypenum) {
|
||||||
ids := utils.RandomNumbers(0, len(v.Special), int(v.Citytypenum))
|
ids := utils.RandomNumbers(0, len(v.Special), int(v.Citytypenum))
|
||||||
for _, id := range ids {
|
for _, id := range ids {
|
||||||
city.Like = append(city.Like, v.Special[id])
|
city.Special = append(city.Special, v.Special[id])
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
city.Like = append(city.Like, v.Special...)
|
city.Special = append(city.Special, v.Special...)
|
||||||
}
|
}
|
||||||
for _, v := range city.Like {
|
for _, v := range city.Special {
|
||||||
city.Count[v] = 40 // 配置暂无 后面走配置
|
city.Count[v] = 40 // 配置暂无 后面走配置
|
||||||
}
|
}
|
||||||
city.Unlike = append(city.Like, v.Exspecial...)
|
city.Exspecial = append(city.Special, v.Exspecial...)
|
||||||
|
|
||||||
data.City[v.Id] = city
|
data.City[v.Id] = city
|
||||||
}
|
}
|
||||||
@ -123,23 +123,23 @@ func (this *Caravan) refreshCaravanCityInfo(uid string, data *pb.DBCaravan) {
|
|||||||
if configure.Now().Unix()-v.Rtime >= int64(c.Checktime) {
|
if configure.Now().Unix()-v.Rtime >= int64(c.Checktime) {
|
||||||
v.Rtime = configure.Now().Unix() - (configure.Now().Unix()-v.Rtime)%int64(c.Checktime)
|
v.Rtime = configure.Now().Unix() - (configure.Now().Unix()-v.Rtime)%int64(c.Checktime)
|
||||||
v.Count = make(map[int32]int32) // 初始化城市信息
|
v.Count = make(map[int32]int32) // 初始化城市信息
|
||||||
v.Like = []int32{}
|
v.Special = []int32{}
|
||||||
v.Unlike = []int32{}
|
v.Exspecial = []int32{}
|
||||||
if len(c.Special) > int(c.Citytypenum) {
|
if len(c.Special) > int(c.Citytypenum) {
|
||||||
ids := utils.RandomNumbers(0, len(c.Special), int(c.Citytypenum))
|
ids := utils.RandomNumbers(0, len(c.Special), int(c.Citytypenum))
|
||||||
for _, id := range ids {
|
for _, id := range ids {
|
||||||
v.Like = append(v.Like, c.Special[id])
|
v.Special = append(v.Special, c.Special[id])
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
v.Like = append(v.Like, c.Special...)
|
v.Special = append(v.Special, c.Special...)
|
||||||
}
|
}
|
||||||
for _, v1 := range v.Like {
|
for _, v1 := range v.Special {
|
||||||
if itemConf := this.configure.GetCaravanGoods(v1); itemConf != nil { // 更新商店库存
|
if itemConf := this.configure.GetCaravanGoods(v1); itemConf != nil { // 更新商店库存
|
||||||
v.Count[v1] = itemConf.Goodsnum
|
v.Count[v1] = itemConf.Goodsnum
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
v.Unlike = append(v.Like, c.Exspecial...)
|
v.Exspecial = append(v.Special, c.Exspecial...)
|
||||||
bChange = true
|
bChange = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -376,10 +376,10 @@ func (this *ModuleRtask) TriggerTask(uid string, taskParams ...*comm.TaskParam)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, tp := range taskParams {
|
for _, tp := range taskParams {
|
||||||
this.Debug("任务触发",
|
// this.Debug("任务触发",
|
||||||
log.Field{Key: "uid", Value: uid},
|
// log.Field{Key: "uid", Value: uid},
|
||||||
log.Field{Key: "type", Value: tp.TT},
|
// log.Field{Key: "type", Value: tp.TT},
|
||||||
log.Field{Key: "params", Value: tp.Params})
|
// log.Field{Key: "params", Value: tp.Params})
|
||||||
|
|
||||||
code := this.processOneTask(session, tp.TT, tp.Params...)
|
code := this.processOneTask(session, tp.TT, tp.Params...)
|
||||||
if code != pb.ErrorCode_Success {
|
if code != pb.ErrorCode_Success {
|
||||||
|
@ -96,8 +96,8 @@ type CityInfo struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
Like []int32 `protobuf:"varint,1,rep,packed,name=like,proto3" json:"like"` // 喜欢的货物ID
|
Special []int32 `protobuf:"varint,1,rep,packed,name=special,proto3" json:"special"` // 城市卖给玩家的商品
|
||||||
Unlike []int32 `protobuf:"varint,2,rep,packed,name=unlike,proto3" json:"unlike"` // 不喜欢的货物ID
|
Exspecial []int32 `protobuf:"varint,2,rep,packed,name=exspecial,proto3" json:"exspecial"` // 城市想要玩家卖给他的商品库
|
||||||
Count map[int32]int32 `protobuf:"bytes,3,rep,name=count,proto3" json:"count" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // 货物对应的数量
|
Count map[int32]int32 `protobuf:"bytes,3,rep,name=count,proto3" json:"count" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // 货物对应的数量
|
||||||
Rtime int64 `protobuf:"varint,4,opt,name=rtime,proto3" json:"rtime"` // 商店刷新时间
|
Rtime int64 `protobuf:"varint,4,opt,name=rtime,proto3" json:"rtime"` // 商店刷新时间
|
||||||
}
|
}
|
||||||
@ -134,16 +134,16 @@ func (*CityInfo) Descriptor() ([]byte, []int) {
|
|||||||
return file_caravan_caravan_db_proto_rawDescGZIP(), []int{1}
|
return file_caravan_caravan_db_proto_rawDescGZIP(), []int{1}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *CityInfo) GetLike() []int32 {
|
func (x *CityInfo) GetSpecial() []int32 {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.Like
|
return x.Special
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *CityInfo) GetUnlike() []int32 {
|
func (x *CityInfo) GetExspecial() []int32 {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.Unlike
|
return x.Exspecial
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -379,61 +379,61 @@ var file_caravan_caravan_db_proto_rawDesc = []byte{
|
|||||||
0x63, 0x75, 0x72, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69,
|
0x63, 0x75, 0x72, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69,
|
||||||
0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12,
|
0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12,
|
||||||
0x12, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74,
|
0x12, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74,
|
||||||
0x69, 0x6d, 0x65, 0x22, 0xb2, 0x01, 0x0a, 0x08, 0x43, 0x69, 0x74, 0x79, 0x49, 0x6e, 0x66, 0x6f,
|
0x69, 0x6d, 0x65, 0x22, 0xbe, 0x01, 0x0a, 0x08, 0x43, 0x69, 0x74, 0x79, 0x49, 0x6e, 0x66, 0x6f,
|
||||||
0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6b, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x04,
|
0x12, 0x18, 0x0a, 0x07, 0x73, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x03, 0x28,
|
||||||
0x6c, 0x69, 0x6b, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x6e, 0x6c, 0x69, 0x6b, 0x65, 0x18, 0x02,
|
0x05, 0x52, 0x07, 0x73, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x78,
|
||||||
0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x75, 0x6e, 0x6c, 0x69, 0x6b, 0x65, 0x12, 0x2a, 0x0a, 0x05,
|
0x73, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x09, 0x65,
|
||||||
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x43, 0x69,
|
0x78, 0x73, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x12, 0x2a, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e,
|
||||||
0x74, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x45, 0x6e, 0x74, 0x72,
|
0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x43, 0x69, 0x74, 0x79, 0x49, 0x6e,
|
||||||
0x79, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x74, 0x69, 0x6d,
|
0x66, 0x6f, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x63,
|
||||||
0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x1a, 0x38,
|
0x6f, 0x75, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20,
|
||||||
0x0a, 0x0a, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03,
|
0x01, 0x28, 0x03, 0x52, 0x05, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x1a, 0x38, 0x0a, 0x0a, 0x43, 0x6f,
|
||||||
0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14,
|
0x75, 0x6e, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18,
|
||||||
0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76,
|
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61,
|
||||||
0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x35, 0x0a, 0x07, 0x42, 0x61, 0x67, 0x49,
|
0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
|
||||||
0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01,
|
0x3a, 0x02, 0x38, 0x01, 0x22, 0x35, 0x0a, 0x07, 0x42, 0x61, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x12,
|
||||||
0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69,
|
0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05,
|
||||||
0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x22,
|
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x02,
|
||||||
0xe1, 0x04, 0x0a, 0x09, 0x44, 0x42, 0x43, 0x61, 0x72, 0x61, 0x76, 0x61, 0x6e, 0x12, 0x0e, 0x0a,
|
0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x22, 0xe1, 0x04, 0x0a, 0x09,
|
||||||
0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a,
|
0x44, 0x42, 0x43, 0x61, 0x72, 0x61, 0x76, 0x61, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18,
|
||||||
0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12,
|
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64,
|
||||||
0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28,
|
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75,
|
||||||
0x05, 0x52, 0x08, 0x75, 0x73, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2b, 0x0a, 0x05, 0x69,
|
0x73, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x75,
|
||||||
0x74, 0x65, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x44, 0x42, 0x43,
|
0x73, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2b, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73,
|
||||||
0x61, 0x72, 0x61, 0x76, 0x61, 0x6e, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72,
|
0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x44, 0x42, 0x43, 0x61, 0x72, 0x61, 0x76,
|
||||||
0x79, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x2b, 0x0a, 0x05, 0x67, 0x6f, 0x6f, 0x64,
|
0x61, 0x6e, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x69,
|
||||||
0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x44, 0x42, 0x43, 0x61, 0x72, 0x61,
|
0x74, 0x65, 0x6d, 0x73, 0x12, 0x2b, 0x0a, 0x05, 0x67, 0x6f, 0x6f, 0x64, 0x73, 0x18, 0x05, 0x20,
|
||||||
0x76, 0x61, 0x6e, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05,
|
0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x44, 0x42, 0x43, 0x61, 0x72, 0x61, 0x76, 0x61, 0x6e, 0x2e,
|
||||||
0x67, 0x6f, 0x6f, 0x64, 0x73, 0x12, 0x28, 0x0a, 0x04, 0x63, 0x69, 0x74, 0x79, 0x18, 0x06, 0x20,
|
0x47, 0x6f, 0x6f, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x67, 0x6f, 0x6f, 0x64,
|
||||||
0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x44, 0x42, 0x43, 0x61, 0x72, 0x61, 0x76, 0x61, 0x6e, 0x2e,
|
0x73, 0x12, 0x28, 0x0a, 0x04, 0x63, 0x69, 0x74, 0x79, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32,
|
||||||
0x43, 0x69, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x63, 0x69, 0x74, 0x79, 0x12,
|
0x14, 0x2e, 0x44, 0x42, 0x43, 0x61, 0x72, 0x61, 0x76, 0x61, 0x6e, 0x2e, 0x43, 0x69, 0x74, 0x79,
|
||||||
0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x6c, 0x76, 0x12,
|
0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x63, 0x69, 0x74, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x6c,
|
||||||
0x16, 0x0a, 0x06, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52,
|
0x76, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x6c, 0x76, 0x12, 0x16, 0x0a, 0x06, 0x70,
|
||||||
0x06, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x65, 0x74,
|
0x72, 0x6f, 0x66, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x70, 0x72, 0x6f,
|
||||||
0x74, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x72, 0x65, 0x73, 0x65,
|
0x66, 0x69, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6d, 0x65,
|
||||||
0x74, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x75, 0x72, 0x63, 0x69, 0x74, 0x79,
|
0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x72, 0x65, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6d,
|
||||||
0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x63, 0x75, 0x72, 0x63, 0x69, 0x74, 0x79, 0x12,
|
0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x75, 0x72, 0x63, 0x69, 0x74, 0x79, 0x18, 0x0a, 0x20, 0x01,
|
||||||
0x16, 0x0a, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x69, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52,
|
0x28, 0x05, 0x52, 0x07, 0x63, 0x75, 0x72, 0x63, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x74,
|
||||||
0x06, 0x74, 0x61, 0x73, 0x6b, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x76, 0x65, 0x6e, 0x74,
|
0x61, 0x73, 0x6b, 0x69, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x73,
|
||||||
0x69, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x69,
|
0x6b, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x69, 0x64, 0x18, 0x0c,
|
||||||
0x64, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x61, 0x73, 0x6b, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0d, 0x20,
|
0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x69, 0x64, 0x12, 0x1a, 0x0a,
|
||||||
0x01, 0x28, 0x03, 0x52, 0x08, 0x74, 0x61, 0x73, 0x6b, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a,
|
0x08, 0x74, 0x61, 0x73, 0x6b, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52,
|
||||||
0x08, 0x62, 0x61, 0x67, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52,
|
0x08, 0x74, 0x61, 0x73, 0x6b, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x61, 0x67,
|
||||||
0x08, 0x62, 0x61, 0x67, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x1a, 0x42, 0x0a, 0x0a, 0x49, 0x74, 0x65,
|
0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x62, 0x61, 0x67,
|
||||||
0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01,
|
0x6c, 0x69, 0x6d, 0x69, 0x74, 0x1a, 0x42, 0x0a, 0x0a, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x45, 0x6e,
|
||||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1e, 0x0a, 0x05, 0x76, 0x61, 0x6c,
|
0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
|
||||||
0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x42, 0x61, 0x67, 0x49, 0x6e,
|
0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1e, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02,
|
||||||
0x66, 0x6f, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x40, 0x0a,
|
0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x42, 0x61, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05,
|
||||||
0x0a, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b,
|
0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x40, 0x0a, 0x0a, 0x47, 0x6f, 0x6f,
|
||||||
0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1c, 0x0a,
|
0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01,
|
||||||
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x47,
|
0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x05, 0x76, 0x61, 0x6c,
|
||||||
0x6f, 0x6f, 0x64, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a,
|
0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x47, 0x6f, 0x6f, 0x64, 0x73,
|
||||||
0x42, 0x0a, 0x09, 0x43, 0x69, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03,
|
0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x42, 0x0a, 0x09, 0x43,
|
||||||
0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1f,
|
0x69, 0x74, 0x79, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18,
|
||||||
0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e,
|
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1f, 0x0a, 0x05, 0x76, 0x61,
|
||||||
0x43, 0x69, 0x74, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a,
|
0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x43, 0x69, 0x74, 0x79,
|
||||||
0x02, 0x38, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42,
|
||||||
0x74, 0x6f, 0x33,
|
0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -7,6 +7,7 @@ import (
|
|||||||
"go_dreamfactory/modules/arena"
|
"go_dreamfactory/modules/arena"
|
||||||
"go_dreamfactory/modules/atlas"
|
"go_dreamfactory/modules/atlas"
|
||||||
"go_dreamfactory/modules/battle"
|
"go_dreamfactory/modules/battle"
|
||||||
|
"go_dreamfactory/modules/caravan"
|
||||||
"go_dreamfactory/modules/chat"
|
"go_dreamfactory/modules/chat"
|
||||||
"go_dreamfactory/modules/combat"
|
"go_dreamfactory/modules/combat"
|
||||||
"go_dreamfactory/modules/dispatch"
|
"go_dreamfactory/modules/dispatch"
|
||||||
@ -122,6 +123,7 @@ func main() {
|
|||||||
tools.NewModule(),
|
tools.NewModule(),
|
||||||
reputation.NewModule(),
|
reputation.NewModule(),
|
||||||
oldtimes.NewModule(),
|
oldtimes.NewModule(),
|
||||||
|
caravan.NewModule(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
42
sys/configure/structs/Game.CaravanEvent.go
Normal file
42
sys/configure/structs/Game.CaravanEvent.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 GameCaravanEvent struct {
|
||||||
|
_dataMap map[int32]*GameCaravanEventData
|
||||||
|
_dataList []*GameCaravanEventData
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewGameCaravanEvent(_buf []map[string]interface{}) (*GameCaravanEvent, error) {
|
||||||
|
_dataList := make([]*GameCaravanEventData, 0, len(_buf))
|
||||||
|
dataMap := make(map[int32]*GameCaravanEventData)
|
||||||
|
for _, _ele_ := range _buf {
|
||||||
|
if _v, err2 := DeserializeGameCaravanEventData(_ele_); err2 != nil {
|
||||||
|
return nil, err2
|
||||||
|
} else {
|
||||||
|
_dataList = append(_dataList, _v)
|
||||||
|
dataMap[_v.Id] = _v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return &GameCaravanEvent{_dataList:_dataList, _dataMap:dataMap}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (table *GameCaravanEvent) GetDataMap() map[int32]*GameCaravanEventData {
|
||||||
|
return table._dataMap
|
||||||
|
}
|
||||||
|
|
||||||
|
func (table *GameCaravanEvent) GetDataList() []*GameCaravanEventData {
|
||||||
|
return table._dataList
|
||||||
|
}
|
||||||
|
|
||||||
|
func (table *GameCaravanEvent) Get(key int32) *GameCaravanEventData {
|
||||||
|
return table._dataMap[key]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
102
sys/configure/structs/Game.CaravanEventData.go
Normal file
102
sys/configure/structs/Game.CaravanEventData.go
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <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 GameCaravanEventData struct {
|
||||||
|
Id int32
|
||||||
|
Eventtype int32
|
||||||
|
Mustdo int32
|
||||||
|
Citystory int32
|
||||||
|
Citynormal int32
|
||||||
|
Cityabnormal int32
|
||||||
|
Worldtask int32
|
||||||
|
Traintips string
|
||||||
|
Trainstory int32
|
||||||
|
Trainstorybad int32
|
||||||
|
Trainstorygood int32
|
||||||
|
Reword []*Gameatn
|
||||||
|
Exreword []int32
|
||||||
|
Unreword []int32
|
||||||
|
Eventtime int32
|
||||||
|
}
|
||||||
|
|
||||||
|
const TypeId_GameCaravanEventData = 1366968202
|
||||||
|
|
||||||
|
func (*GameCaravanEventData) GetTypeId() int32 {
|
||||||
|
return 1366968202
|
||||||
|
}
|
||||||
|
|
||||||
|
func (_v *GameCaravanEventData)Deserialize(_buf map[string]interface{}) (err error) {
|
||||||
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["id"].(float64); !_ok_ { err = errors.New("id error"); return }; _v.Id = int32(_tempNum_) }
|
||||||
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["eventtype"].(float64); !_ok_ { err = errors.New("eventtype error"); return }; _v.Eventtype = int32(_tempNum_) }
|
||||||
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["mustdo"].(float64); !_ok_ { err = errors.New("mustdo error"); return }; _v.Mustdo = int32(_tempNum_) }
|
||||||
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["citystory"].(float64); !_ok_ { err = errors.New("citystory error"); return }; _v.Citystory = int32(_tempNum_) }
|
||||||
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["citynormal"].(float64); !_ok_ { err = errors.New("citynormal error"); return }; _v.Citynormal = int32(_tempNum_) }
|
||||||
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["cityabnormal"].(float64); !_ok_ { err = errors.New("cityabnormal error"); return }; _v.Cityabnormal = int32(_tempNum_) }
|
||||||
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["worldtask"].(float64); !_ok_ { err = errors.New("worldtask error"); return }; _v.Worldtask = int32(_tempNum_) }
|
||||||
|
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["traintips"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Traintips error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Traintips, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
|
||||||
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["trainstory"].(float64); !_ok_ { err = errors.New("trainstory error"); return }; _v.Trainstory = int32(_tempNum_) }
|
||||||
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["trainstorybad"].(float64); !_ok_ { err = errors.New("trainstorybad error"); return }; _v.Trainstorybad = int32(_tempNum_) }
|
||||||
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["trainstorygood"].(float64); !_ok_ { err = errors.New("trainstorygood error"); return }; _v.Trainstorygood = 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["exreword"].([]interface{}); !_ok_ { err = errors.New("exreword error"); return }
|
||||||
|
|
||||||
|
_v.Exreword = 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.Exreword = append(_v.Exreword, _list_v_)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
var _arr_ []interface{}
|
||||||
|
var _ok_ bool
|
||||||
|
if _arr_, _ok_ = _buf["unreword"].([]interface{}); !_ok_ { err = errors.New("unreword error"); return }
|
||||||
|
|
||||||
|
_v.Unreword = 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.Unreword = append(_v.Unreword, _list_v_)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["eventtime"].(float64); !_ok_ { err = errors.New("eventtime error"); return }; _v.Eventtime = int32(_tempNum_) }
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func DeserializeGameCaravanEventData(_buf map[string]interface{}) (*GameCaravanEventData, error) {
|
||||||
|
v := &GameCaravanEventData{}
|
||||||
|
if err := v.Deserialize(_buf); err == nil {
|
||||||
|
return v, nil
|
||||||
|
} else {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
@ -177,7 +177,7 @@ type Tables struct {
|
|||||||
CaravanReward *GameCaravanReward
|
CaravanReward *GameCaravanReward
|
||||||
CaravanRank *GameCaravanRank
|
CaravanRank *GameCaravanRank
|
||||||
CaravanBattle *GameCaravanBattle
|
CaravanBattle *GameCaravanBattle
|
||||||
CaravanRvent *GameCaravanRvent
|
CaravanEvent *GameCaravanEvent
|
||||||
NewRedDot *GameNewRedDot
|
NewRedDot *GameNewRedDot
|
||||||
Talent *GameTalent
|
Talent *GameTalent
|
||||||
Favorability *GameFavorability
|
Favorability *GameFavorability
|
||||||
@ -1200,10 +1200,10 @@ func NewTables(loader JsonLoader) (*Tables, error) {
|
|||||||
if tables.CaravanBattle, err = NewGameCaravanBattle(buf) ; err != nil {
|
if tables.CaravanBattle, err = NewGameCaravanBattle(buf) ; err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if buf, err = loader("game_caravanrvent") ; err != nil {
|
if buf, err = loader("game_caravanevent") ; err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if tables.CaravanRvent, err = NewGameCaravanRvent(buf) ; err != nil {
|
if tables.CaravanEvent, err = NewGameCaravanEvent(buf) ; err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if buf, err = loader("game_newreddot") ; err != nil {
|
if buf, err = loader("game_newreddot") ; err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user