上传竞技场代码

This commit is contained in:
liwei 2023-07-12 11:31:33 +08:00
parent 86f04723b0
commit d663458880
14 changed files with 605 additions and 508 deletions

View File

@ -199,5 +199,37 @@
"n": 10
}
]
},
{
"key": 7,
"recruitment_type": [],
"star3w": 940,
"star4w": 52,
"star5w": 8,
"protect": 100,
"p3pool": "pro_pool70003",
"p4pool": "pro_pool70004",
"p5pool": "pro_pool70005",
"n3pool": "base_pool70003",
"n4pool": "base_pool70004",
"n5pool": "base_pool70005",
"baodi4": 10,
"baidi5": 100,
"etime": -1,
"permission": 1,
"consumeA": [
{
"a": "item",
"t": "10000024",
"n": 1
}
],
"consumeB": [
{
"a": "item",
"t": "10000024",
"n": 10
}
]
}
]

View File

@ -54,6 +54,17 @@
"t": "10000001",
"n": 1
},
"replace_pro": 1000,
"reward_star4": {
"a": "item",
"t": "10000101",
"n": 1
},
"reward_star5": {
"a": "item",
"t": "10000101",
"n": 10
},
"camp1_pool_cost": {
"a": "item",
"t": "10000001",
@ -220,48 +231,7 @@
"t": "18000004",
"n": 1
},
"Arena_buy": [
{
"a": "attr",
"t": "diamond",
"n": 100
},
{
"a": "attr",
"t": "diamond",
"n": 200
},
{
"a": "attr",
"t": "diamond",
"n": 400
},
{
"a": "attr",
"t": "diamond",
"n": 600
},
{
"a": "attr",
"t": "diamond",
"n": 800
},
{
"a": "attr",
"t": "diamond",
"n": 1000
},
{
"a": "attr",
"t": "diamond",
"n": 1200
},
{
"a": "attr",
"t": "diamond",
"n": 1400
}
],
"Arena_buy": 1001,
"VikingExpedition_RecoveryTime": 144,
"cops_RecoveryTime": 300,
"cops_InitialNum": 60,

File diff suppressed because it is too large Load Diff

View File

@ -19,7 +19,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -38,7 +38,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -57,7 +57,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -76,7 +76,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -95,7 +95,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -114,7 +114,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -133,7 +133,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -152,7 +152,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -171,7 +171,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -190,7 +190,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -209,7 +209,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -228,7 +228,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -247,7 +247,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -266,7 +266,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -285,7 +285,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -304,7 +304,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -323,7 +323,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -342,7 +342,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -361,7 +361,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -380,7 +380,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -399,7 +399,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -418,7 +418,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -437,7 +437,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -456,7 +456,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -475,7 +475,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -494,7 +494,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -513,7 +513,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -532,7 +532,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -551,7 +551,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -570,7 +570,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -589,7 +589,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -608,7 +608,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -627,7 +627,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -646,7 +646,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -665,7 +665,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -684,7 +684,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -703,7 +703,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -722,7 +722,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -741,7 +741,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -760,7 +760,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -779,7 +779,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -798,7 +798,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -817,7 +817,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -836,7 +836,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -855,7 +855,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -874,7 +874,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -893,7 +893,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -912,7 +912,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -931,7 +931,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -950,7 +950,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -969,7 +969,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -988,7 +988,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -1007,7 +1007,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -1026,7 +1026,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -1045,7 +1045,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -1064,7 +1064,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -1083,7 +1083,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -1102,7 +1102,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,
@ -1121,7 +1121,7 @@
{
"a": "attr",
"t": "starcoin",
"n": 40
"n": 400
}
],
"ps_ceiling": 180,

View File

@ -89,5 +89,18 @@
"n": 250
}
]
},
{
"id": 8,
"pricegroupId": 1001,
"purchasemin": 11,
"purchasemax": -1,
"cost": [
{
"a": "attr",
"t": "diamond",
"n": 250
}
]
}
]

View File

@ -29,7 +29,7 @@
},
"content": {
"key": "ruledesc_ruledesc_content_3",
"text": "这里可以查看与各个守护者们的好感度。"
"text": "这里可以查看与各个守护者们的好感度。<br>点击守护者可以进入守护者送礼界面。"
}
},
{
@ -40,7 +40,7 @@
},
"content": {
"key": "ruledesc_ruledesc_content_4",
"text": "这里可以给守护者送礼,提升与守护者的好感度。"
"text": "这里可以给守护者送礼,提升与守护者的好感度。<br>每个守护者每日最多送礼9次且每次赠送会随着饱腹度的增加而减少好感度的增加。<br>每日赠送1-3次为100%的食物好感度。<br>每日赠送4-6次为80%的食物好感度。<br>每日赠送7-9次为50%的好感度。<br>每个守护者有喜欢的食物与讨厌的食物赠送喜欢的食物增加的好感度为1.5倍,且对话也有所不同。"
}
},
{
@ -51,7 +51,7 @@
},
"content": {
"key": "ruledesc_ruledesc_content_5",
"text": "这里可以查看各种功夫陪练,完成陪练可以获得高额奖励,完成一定数量的陪练还有格外奖励。"
"text": "这里可以查看各种功夫陪练,完成陪练可以获得高额奖励。<br>完成3/6/9次的陪练还有格外奖励可以领取。"
}
},
{
@ -84,7 +84,7 @@
},
"content": {
"key": "ruledesc_ruledesc_content_8",
"text": "这里可以与其他玩家的阵容进行对决,也可以挑战电脑阵容来获取奖励。<br>挑战电脑阵容难度随等级解锁,挑战需要消耗竞技场挑战卷。<br>挑战玩家也需消耗竞技场挑战卷,战胜玩家获得积分,在每周结算时根据积分排名来获得奖励。"
"text": "这里可以与其他玩家的阵容进行对决,也可以挑战电脑阵容来获取奖励。<br>挑战电脑阵容难度随等级解锁,挑战需要消耗竞技场挑战卷。<br>竞技场挑战卷随时间恢复每144分钟回复一张。<br>可以使用钻石直接购买竞技场挑战卷。购买上限最多为8张。每次购买消耗的钻石逐级递增。<br>挑战玩家也需消耗竞技场挑战卷,战胜玩家获得积分,在每周结算时根据积分排名来获得奖励。<br>积分排名逻辑:<br>黑铁0—799竞技胜利获胜奖励为竞技币10个。<br>青铜800-1299竞技胜利获胜奖励为竞技币12个。<br>白银1300-1599竞技胜利获胜奖励为竞技币14个。<br>黄金1600-2199竞技胜利获胜奖励为竞技币16个。<br>铂金2200-2799竞技胜利获胜奖励为竞技币18个。<br>钻石:2800-3699,竞技胜利获胜奖励为竞技币20个。<br>大师3700-4599竞技胜利获胜奖励为竞技币22个。<br>王者4600以上竞技胜利获胜奖励为竞技币22个。<br>积分排名奖励具体查看排名中的奖励预览。"
}
},
{
@ -161,7 +161,7 @@
},
"content": {
"key": "ruledesc_ruledesc_content_15",
"text": "这里可以查看你获得的所有守护者们,选择守护者点击右侧按钮可以查看详细界面并且强化他们。<br>在强化界面,可以有各种方式强化守护者。<br>守护者等级强化:<br>点击守护者经验条下方的加号按钮可以进入守护者升级界面,使用护身符可以快速提升守护者等级。<br>守护者升星:<br>当守护者等级达到当前星级最大值三星最大等级为30级四星为40级5星为50级可以使用荣耀徽章提升守护者星级并解锁最高等级上限。守护者最高为6星<br>守护者技能等级强化:<br>点击技能图标上方的按钮,可以进入守护者技能升级界面,使用不同等级的功夫卷轴可以强化不同稀有度的守护者的技能等级。<br>守护者觉醒:<br>可以在觉醒界面使用守护之心强化你的守护者。觉醒道具守护之心主要为招募重复守护者获得。<br>守护者回响:<br>可以在回响界面使用回响强化道具强化你的守护者。回响强化道具可以再狩猎与宝箱中获得。"
"text": "这里可以查看你获得的所有守护者们,选择守护者点击右侧按钮可以查看详细界面并且强化他们。<br>在强化界面,可以有各种方式强化守护者。<br>守护者等级强化:<br>点击守护者经验条下方的加号按钮可以进入守护者升级界面,使用护身符可以快速提升守护者等级。<br>守护者升星:<br>当守护者等级达到当前星级最大值三星最大等级为30级四星为40级5星为50级6星60级可以使用荣耀徽章提升守护者星级并解锁最高等级上限。守护者最高为6星。荣耀徽章可以通过合成或分解操作,进行不同星级之间的转换。<br>守护者技能等级强化:<br>点击技能图标上方的按钮,可以进入守护者技能升级界面,使用不同等级的功夫卷轴可以强化不同稀有度的守护者的技能等级。技能等级提升为随机提升该守护者未满级的技能等级。<br>守护者觉醒:<br>可以在觉醒界面使用守护之心强化你的守护者。觉醒道具守护之心主要为招募重复守护者获得。<br>守护者回响:<br>可以在回响界面使用回响强化道具强化你的守护者。回响强化道具可以再狩猎与宝箱中获得。"
}
},
{
@ -172,7 +172,7 @@
},
"content": {
"key": "ruledesc_ruledesc_content_16",
"text": "这里可以查看你拥有的所有装备,并且可以给守护者们装备上,一件穿戴会默认选择你最好的装备穿戴给当前守护者(已穿戴装备除外)。"
"text": "这里可以查看你拥有的所有装备,并且可以给守护者们装备上,一件穿戴会默认选择你最好的装备穿戴给当前守护者(已穿戴装备除外)。<br>点击装备可以打开装备强化界面,"
}
},
{
@ -205,7 +205,7 @@
},
"content": {
"key": "ruledesc_ruledesc_content_19",
"text": "这里可以挑战泰坦们获得打造材料。"
"text": "这里可以挑战泰坦们获得打造材料。<br>泰坦共有三种,挑战不同的泰坦都会有不同类别的装备打造材料。<br>挑战高难度泰坦获得的材料奖励越多。"
}
},
{
@ -216,7 +216,7 @@
},
"content": {
"key": "ruledesc_ruledesc_content_20",
"text": "这里可以狩猎各种敌人获得珍惜材料。"
"text": "这里可以狩猎各种敌人获得回响材料。<br>狩猎挑战随时间开放不同的狩猎头目,掉落的回响材料可用于阵容也会有所不同。<br>挑战难度越高的狩猎头目,获得的材料数量与稀有度越高。"
}
},
{
@ -260,7 +260,7 @@
},
"content": {
"key": "ruledesc_ruledesc_content_24",
"text": "这里可以查看关卡星完成条件与获胜可获得奖励。"
"text": "这里可以查看关卡星完成条件,积累一定的关卡星可以获得格外的道具奖励。"
}
},
{
@ -326,7 +326,7 @@
},
"content": {
"key": "ruledesc_ruledesc_content_30",
"text": "这里可以使用装备手册的各个技能强化锻造炉。<br>技能包括:<br>销售精英:<br>可以提升装备的售价。<br>节能环保:<br>可以减少打造所消耗的炉温。<br>推广引流:<br>可以提升顾客数量。<br>倾销货物:<br>可以提升顾客购买装备数量的上限。<br>制作大师:<br>打造高品质装备时满星的概率提升1%。<br>每当前一个技能提升至5级时解锁下一个技能强化选项。"
"text": "这里可以使用装备手册的各个技能强化锻造炉。<br>技能包括:<br>销售精英:<br>可以提升装备的售价。<br>节能环保:<br>可以减少打造所消耗的炉温。<br>推广引流:<br>可以提升顾客数量。<br>倾销货物:<br>可以提升顾客购买装备数量的上限。<br>制作大师:<br>打造高品质装备时满星的概率提升1%。"
}
},
{
@ -337,7 +337,7 @@
},
"content": {
"key": "ruledesc_ruledesc_content_31",
"text": "这里可以挑战功夫塔每次挑战胜利都可以获得奖励每挑战胜利10层会有特殊奖励(功夫塔挑战不需要消耗物品)。"
"text": "这里可以挑战功夫塔每次挑战胜利都可以获得奖励每挑战胜利10层可以获得相应教习。(功夫塔挑战不需要消耗物品)。"
}
},
{
@ -458,7 +458,7 @@
},
"content": {
"key": "ruledesc_ruledesc_content_42",
"text": "这里可以可以使用星图币强化这个属性的全部守护者们。"
"text": "这里可以可以使用星图币强化某个属性的全部守护者们。<br>强化属性会在战斗中生效,不会在属性中显示。<br>星图币在玩家升级时获得。"
}
},
{
@ -480,7 +480,7 @@
},
"content": {
"key": "ruledesc_ruledesc_content_44",
"text": "这里可以查看玩家游戏进度。<br>可以修改名称与个性签名(名称最多20字符汉字算2字符。<br>更改角色装扮,还能修改并查看自己的阵容展示。"
"text": "这里可以查看玩家游戏进度。<br>可以修改名称与个性签名(名称最多12字符汉字算2字符。<br>更改角色装扮,还能修改并查看自己的阵容展示。"
}
}
]

View File

@ -904,7 +904,3 @@ const (
SmithyToolsSkill4 = 4 // 每日顾客数量提升至{0}人
SmithyToolsSkill5 = 5 // 顾客购买装备数量上限提高至{0}件
)
const (
ArenaBuyType = 1001 // 价格组ID
)

View File

@ -7,7 +7,7 @@ import (
cfg "go_dreamfactory/sys/configure/structs"
)
//参数校验
// 参数校验
func (this *apiComp) BuyCheck(session comm.IUserSession, req *pb.ArenaBuyReq) (errdata *pb.ErrorData) {
if req.BuyNum == 0 {
errdata = &pb.ErrorData{
@ -18,7 +18,7 @@ func (this *apiComp) BuyCheck(session comm.IUserSession, req *pb.ArenaBuyReq) (e
return
}
///获取自己的排行榜信息
// /获取自己的排行榜信息
func (this *apiComp) Buy(session comm.IUserSession, req *pb.ArenaBuyReq) (errdata *pb.ErrorData) {
var (
// global *cfg.GameGlobalData
@ -49,8 +49,8 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.ArenaBuyReq) (errdat
return
}
this.module.modelArena.recoverTicket(session, info)
if maxbuy, err = this.module.ModuleTools.GetPriceGroupLen(comm.ArenaBuyType); err != nil {
pricekey := this.module.ModuleTools.GetGlobalConf().ArenaBuy
if maxbuy, err = this.module.ModuleTools.GetPriceGroupLen(pricekey); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ConfigNoFound,
Title: pb.ErrorCode_CacheReadError.ToString(),
@ -68,7 +68,7 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.ArenaBuyReq) (errdat
}
return
}
if res, err := this.module.ModuleTools.GetPriceGroupCost(comm.ArenaBuyType, info.Buynum+i+1); len(res) > 0 {
if res, err := this.module.ModuleTools.GetPriceGroupCost(pricekey, info.Buynum+i+1); len(res) > 0 {
need = append(need, res...)
} else {
errdata = &pb.ErrorData{

View File

@ -33,7 +33,7 @@ func (this *apiComp) Info(session comm.IUserSession, req *pb.PayInfoReq) (errdat
}
return
}
if goods, err = this.module.configure.getPayPackageDatas(); err != nil {
if goods, err = this.module.configure.getPayPackageDatas(1); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ConfigNoFound,
Title: pb.ErrorCode_ConfigNoFound.ToString(),

View File

@ -12,13 +12,13 @@ const (
game_paypackage = "game_paypackage.json"
)
///背包配置管理组件
// /背包配置管理组件
type configureComp struct {
modules.MCompConfigure
module *Pay
}
//组件初始化接口
// 组件初始化接口
func (this *configureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
this.MCompConfigure.Init(service, module, comp, options)
this.module = module.(*Pay)
@ -27,7 +27,7 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp
return
}
//获取手动加入频道 任务限制
// 获取手动加入频道 任务限制
func (this *configureComp) getGameRecharge(id string) (result *cfg.GameRechargeData, err error) {
var (
v interface{}
@ -46,8 +46,8 @@ func (this *configureComp) getGameRecharge(id string) (result *cfg.GameRechargeD
return
}
//获取手动加入频道 任务限制
func (this *configureComp) getPayPackageDatas() (result []*cfg.GamePayPackageData, err error) {
// 获取手动加入频道 任务限制
func (this *configureComp) getPayPackageDatas(ptype int32) (result []*cfg.GamePayPackageData, err error) {
var (
v interface{}
)
@ -55,12 +55,17 @@ func (this *configureComp) getPayPackageDatas() (result []*cfg.GamePayPackageDat
this.module.Errorf("err:%v", err)
return
} else {
result = v.(*cfg.GamePayPackage).GetDataList()
result = make([]*cfg.GamePayPackageData, 0)
for _, v := range v.(*cfg.GamePayPackage).GetDataList() {
if v.Type == ptype {
result = append(result, v)
}
}
}
return
}
//获取手动加入频道 任务限制
// 获取手动加入频道 任务限制
func (this *configureComp) getPayPackageData(id int32) (result *cfg.GamePayPackageData, err error) {
var (
v interface{}
@ -79,7 +84,7 @@ func (this *configureComp) getPayPackageData(id int32) (result *cfg.GamePayPacka
return
}
//获取手动加入频道 任务限制
// 获取手动加入频道 任务限制
func (this *configureComp) getPayPackageDataByPid(pid string) (result *cfg.GamePayPackageData, err error) {
var (
v interface{}

View File

@ -616,7 +616,7 @@ func (this *MCompConfigure) GetPriceGroupCost(pricegroupId int32, purchase int32
return
}
for _, v := range this._price[pricegroupId] {
if v.Purchasemin <= purchase && purchase <= v.Purchasemax {
if v.Purchasemin <= purchase && (purchase <= v.Purchasemax || v.Purchasemax == -1) {
res = v.Cost
return
}
@ -628,8 +628,12 @@ func (this *MCompConfigure) GetPriceGroupLen(pricegroupId int32) (count int32, e
if _, ok := this._price[pricegroupId]; !ok {
err = comm.NewNotFoundConfErr("tools", game_price, pricegroupId)
}
count = int32(len(this._price[pricegroupId]))
count = 0
for _, v := range this._price[pricegroupId] {
if count < v.Purchasemax {
count = v.Purchasemax
}
}
return
}

View File

@ -15,9 +15,10 @@ const (
type configureComp struct {
modules.MCompConfigure
module *Warorder
lock sync.RWMutex
order map[int32][]*cfg.GamePassCheckData //战令
module *Warorder
lock sync.RWMutex
product map[string]int32 //商品id
order map[int32][]*cfg.GamePassCheckData //战令
}
func (this *configureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
@ -27,6 +28,12 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp
return
}
func (this *configureComp) getproduct() map[string]int32 {
this.lock.RLock()
defer this.lock.RUnlock()
return this.product
}
// 读取任务配置表
func (this *configureComp) getPassCheckCfg() (data *cfg.GamePassCheck, err error) {
var (
@ -51,8 +58,12 @@ func (this *configureComp) updateconfigure() {
this.module.Error("世界任务配置表异常!")
return
}
productConf := make(map[string]int32)
orderConf := make(map[int32][]*cfg.GamePassCheckData)
for _, v := range gwt.GetDataList() {
if _, ok := productConf[v.PayId]; !ok {
productConf[v.PayId] = v.PasscheckType
}
if _, ok := orderConf[v.PasscheckType]; !ok {
orderConf[v.PasscheckType] = make([]*cfg.GamePassCheckData, 0)
}
@ -60,6 +71,7 @@ func (this *configureComp) updateconfigure() {
}
this.lock.Lock()
this.product = productConf
this.order = orderConf
this.lock.Unlock()
}

View File

@ -1,6 +1,7 @@
package warorder
import (
"fmt"
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
@ -46,6 +47,44 @@ func (this *Warorder) OnInstallComp() {
// 发货
func (this *Warorder) Delivery(session comm.IUserSession, pid string) (errdata *pb.ErrorData, items []*pb.UserAssets) {
var (
product map[string]int32 //商品id
warorders *pb.DBWarorders
info *pb.Warorder
wtype int32
err error
ok bool
)
product = this.configure.getproduct()
if _, ok = product[pid]; !ok {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ConfigNoFound,
Title: pb.ErrorCode_ConfigNoFound.String(),
Message: fmt.Sprintf("no found pid:%s", pid),
}
return
}
wtype = product[pid]
if warorders, err = this.modelWarorder.getUserWarorders(session.GetUserId()); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),
Message: err.Error(),
}
return
}
if info, ok = warorders.Items[wtype]; !ok {
info = &pb.Warorder{
Vip: false,
Free: make([]int32, 0),
Pay: make([]int32, 0),
Progress: 0,
}
warorders.Items[wtype] = info
}
info.Vip = true
this.modelWarorder.updateUserWarorders(session.GetUserId(), warorders)
return
}

View File

@ -43,6 +43,9 @@ type GameGlobalData struct {
DrawFloorStar5 int32
DuplicateRemoval int32
BasePoolCost *Gameatn
ReplacePro int32
RewardStar4 *Gameatn
RewardStar5 *Gameatn
Camp1PoolCost *Gameatn
Camp2PoolCost *Gameatn
Camp3PoolCost *Gameatn
@ -114,7 +117,7 @@ type GameGlobalData struct {
ArenaTicketMax int32
ArenaTicketRecoveryTime int32
ArenaTicketCos *Gameatn
ArenaBuy []*Gameatn
ArenaBuy int32
VikingExpeditionRecoveryTime int32
CopsRecoveryTime int32
CopsInitialNum int32
@ -335,6 +338,9 @@ func (_v *GameGlobalData)Deserialize(_buf map[string]interface{}) (err error) {
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["draw_floor_star5"].(float64); !_ok_ { err = errors.New("draw_floor_star5 error"); return }; _v.DrawFloorStar5 = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["duplicate_removal"].(float64); !_ok_ { err = errors.New("duplicate_removal error"); return }; _v.DuplicateRemoval = int32(_tempNum_) }
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["base_pool_cost"].(map[string]interface{}); !_ok_ { err = errors.New("base_pool_cost error"); return }; if _v.BasePoolCost, err = DeserializeGameatn(_x_); err != nil { return } }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["replace_pro"].(float64); !_ok_ { err = errors.New("replace_pro error"); return }; _v.ReplacePro = int32(_tempNum_) }
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["reward_star4"].(map[string]interface{}); !_ok_ { err = errors.New("reward_star4 error"); return }; if _v.RewardStar4, err = DeserializeGameatn(_x_); err != nil { return } }
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["reward_star5"].(map[string]interface{}); !_ok_ { err = errors.New("reward_star5 error"); return }; if _v.RewardStar5, err = DeserializeGameatn(_x_); err != nil { return } }
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["camp1_pool_cost"].(map[string]interface{}); !_ok_ { err = errors.New("camp1_pool_cost error"); return }; if _v.Camp1PoolCost, err = DeserializeGameatn(_x_); err != nil { return } }
{ 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 } }
@ -497,20 +503,7 @@ func (_v *GameGlobalData)Deserialize(_buf map[string]interface{}) (err error) {
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["ArenaTicket_max"].(float64); !_ok_ { err = errors.New("ArenaTicket_max error"); return }; _v.ArenaTicketMax = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["ArenaTicket_RecoveryTime"].(float64); !_ok_ { err = errors.New("ArenaTicket_RecoveryTime error"); return }; _v.ArenaTicketRecoveryTime = int32(_tempNum_) }
{ var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["ArenaTicket_cos"].(map[string]interface{}); !_ok_ { err = errors.New("ArenaTicket_cos error"); return }; if _v.ArenaTicketCos, err = DeserializeGameatn(_x_); err != nil { return } }
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["Arena_buy"].([]interface{}); !_ok_ { err = errors.New("Arena_buy error"); return }
_v.ArenaBuy = 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.ArenaBuy = append(_v.ArenaBuy, _list_v_)
}
}
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["Arena_buy"].(float64); !_ok_ { err = errors.New("Arena_buy error"); return }; _v.ArenaBuy = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["VikingExpedition_RecoveryTime"].(float64); !_ok_ { err = errors.New("VikingExpedition_RecoveryTime error"); return }; _v.VikingExpeditionRecoveryTime = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["cops_RecoveryTime"].(float64); !_ok_ { err = errors.New("cops_RecoveryTime error"); return }; _v.CopsRecoveryTime = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["cops_InitialNum"].(float64); !_ok_ { err = errors.New("cops_InitialNum error"); return }; _v.CopsInitialNum = int32(_tempNum_) }