1
This commit is contained in:
parent
ba5fcca7ad
commit
4dc79e44dd
@ -26,7 +26,7 @@ class Bag(object):
|
|||||||
'url': 'webapp/index.php?c=Bag&a=useItem',
|
'url': 'webapp/index.php?c=Bag&a=useItem',
|
||||||
'params': [
|
'params': [
|
||||||
_common.ReqHead(),
|
_common.ReqHead(),
|
||||||
['item_id', 0, '道具id'],
|
['item_uniid', 0, '道具唯一id'],
|
||||||
['item_num', 0, '道具数量'],
|
['item_num', 0, '道具数量'],
|
||||||
['param1', '', '参数1(当使用的是改名卡时param1=新的角色名)'],
|
['param1', '', '参数1(当使用的是改名卡时param1=新的角色名)'],
|
||||||
['param2', '', '参数2(当使用的是改名卡时param2=签名)'],
|
['param2', '', '参数2(当使用的是改名卡时param2=签名)'],
|
||||||
|
22
doc/Chip.py
22
doc/Chip.py
@ -1,22 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
import _common
|
|
||||||
|
|
||||||
class Chip(object):
|
|
||||||
|
|
||||||
def __init__(self):
|
|
||||||
self.apis = [
|
|
||||||
{
|
|
||||||
'name': 'chipList',
|
|
||||||
'desc': '获取芯片列表',
|
|
||||||
'group': 'Gun',
|
|
||||||
'url': 'webapp/index.php?c=Gun&a=chipList',
|
|
||||||
'params': [
|
|
||||||
_common.ReqHead(),
|
|
||||||
],
|
|
||||||
'response': [
|
|
||||||
_common.RspHead(),
|
|
||||||
['!chip_list', [_common.Gun()], '芯片列表']
|
|
||||||
]
|
|
||||||
},
|
|
||||||
]
|
|
30
doc/Gun.py
30
doc/Gun.py
@ -59,4 +59,34 @@ class Gun(object):
|
|||||||
['!gun_list', [_common.Gun()], '枪械列表']
|
['!gun_list', [_common.Gun()], '枪械列表']
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'name': 'upgradeLevel',
|
||||||
|
'desc': '升等级',
|
||||||
|
'group': 'Gun',
|
||||||
|
'url': 'webapp/index.php?c=Gun&a=upgradeLevel',
|
||||||
|
'params': [
|
||||||
|
_common.ReqHead(),
|
||||||
|
['gun_uniid', 0, '枪械唯一id'],
|
||||||
|
['cost_item_id', 0, '支付方式'],
|
||||||
|
],
|
||||||
|
'response': [
|
||||||
|
_common.RspHead(),
|
||||||
|
['property_chg', _common.PropertyChg(), '属性变更'],
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'upgradeQuality',
|
||||||
|
'desc': '升阶',
|
||||||
|
'group': 'Gun',
|
||||||
|
'url': 'webapp/index.php?c=Gun&a=upgradeQuality',
|
||||||
|
'params': [
|
||||||
|
_common.ReqHead(),
|
||||||
|
['gun_uniid', 0, '枪械唯一id'],
|
||||||
|
['cost_item_id', 0, '支付方式'],
|
||||||
|
],
|
||||||
|
'response': [
|
||||||
|
_common.RspHead(),
|
||||||
|
['property_chg', _common.PropertyChg(), '属性变更'],
|
||||||
|
]
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
@ -155,8 +155,10 @@ class Item(object):
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.fields = [
|
self.fields = [
|
||||||
|
['item_uniid', 0, '道具唯一id'],
|
||||||
['item_id', 0, '道具id'],
|
['item_id', 0, '道具id'],
|
||||||
['item_num', 0, '道具数量'],
|
['item_num', 0, '道具数量'],
|
||||||
|
['!attr', [Attr()], '属性'],
|
||||||
]
|
]
|
||||||
|
|
||||||
class AwardItem(object):
|
class AwardItem(object):
|
||||||
@ -179,7 +181,7 @@ class PropertyChg(object):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.fields = [
|
self.fields = [
|
||||||
['user_info', UserInfo(), '用户信息变更(用来更新本地客户端字段(有则更新无则不变))'],
|
['user_info', UserInfo(), '用户信息变更(用来更新本地客户端字段(有则更新无则不变))'],
|
||||||
['!container_chg', [''], '容器类数据变更(bag、hero、heroSkin、gunSkin)']
|
['!container_chg', [''], '容器类数据变更(bag、hero、heroSkin、gunSkin, gun)']
|
||||||
]
|
]
|
||||||
|
|
||||||
class CostInfoItem(object):
|
class CostInfoItem(object):
|
||||||
@ -366,19 +368,3 @@ class TeamInfo(object):
|
|||||||
['state', 0, '0:未开始 1:准备就绪(这时客户端进入长链接走组队逻辑)'],
|
['state', 0, '0:未开始 1:准备就绪(这时客户端进入长链接走组队逻辑)'],
|
||||||
['!member_list', [TeamMember()], '队伍成员列表(包含自己)'],
|
['!member_list', [TeamMember()], '队伍成员列表(包含自己)'],
|
||||||
]
|
]
|
||||||
|
|
||||||
class Chip(object):
|
|
||||||
|
|
||||||
def __init__(self):
|
|
||||||
self.fields = [
|
|
||||||
['chip_uniid', 0, '芯片唯一id'],
|
|
||||||
['chip_id', 0, '芯片id'],
|
|
||||||
['state', 0, '0:已购买 1:体验中'],
|
|
||||||
['gun_lv', 0, '枪等级'],
|
|
||||||
['quality', 0, '品阶'],
|
|
||||||
['!attr', [Attr()], '属性'],
|
|
||||||
['try_count', 0, '剩余体验次数 当state=1时才有意义'],
|
|
||||||
['lock_type', 0, '0:无锁 1:升级 2:升阶'],
|
|
||||||
['lock_time', 0, '使用锁定时间(升级或者升阶触发),单位秒,锁定期间不可战斗和做其他操作'],
|
|
||||||
['trade_locktime', 0, '出售锁定时间(升级或者升阶完成后触发),单位秒,只锁交易,其他的操作仍可进行'],
|
|
||||||
]
|
|
||||||
|
@ -122,6 +122,7 @@ CREATE TABLE `t_bag` (
|
|||||||
`account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)',
|
`account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)',
|
||||||
`item_id` int(11) NOT NULL DEFAULT '0' COMMENT '道具id',
|
`item_id` int(11) NOT NULL DEFAULT '0' COMMENT '道具id',
|
||||||
`item_num` int(11) NOT NULL DEFAULT '0' COMMENT '数量',
|
`item_num` int(11) NOT NULL DEFAULT '0' COMMENT '数量',
|
||||||
|
`rand_attr` mediumblob COMMENT '随机属性',
|
||||||
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
||||||
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
||||||
PRIMARY KEY (`idx`),
|
PRIMARY KEY (`idx`),
|
||||||
|
@ -6,11 +6,17 @@ use phpcommon;
|
|||||||
|
|
||||||
class AttrHelper {
|
class AttrHelper {
|
||||||
|
|
||||||
public static function parseAttr($attrStr)
|
public static function parseAttrCfg($attrStr)
|
||||||
{
|
{
|
||||||
$attrs = array();
|
$attrs = array();
|
||||||
$strs = explode('|', $attrStr);
|
$strs = explode('|', $attrStr);
|
||||||
foreach ($strs as $str) {
|
foreach ($strs as $str) {
|
||||||
|
$strs1 = explode('|', $attrStr);
|
||||||
|
array_push($attrs,
|
||||||
|
array(
|
||||||
|
'attr_id' => $strs1[0],
|
||||||
|
'type' => $strs1[1],
|
||||||
|
));
|
||||||
}
|
}
|
||||||
return $attrs;
|
return $attrs;
|
||||||
}
|
}
|
||||||
@ -20,7 +26,23 @@ class AttrHelper {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function canMerge($aAttr, $bAttr)
|
public static function canMergeCfg($aAttr, $bAttr)
|
||||||
|
{
|
||||||
|
foreach ($bAttr as $attr){
|
||||||
|
if (!array_find($aAttr, function($val) use($attr) {
|
||||||
|
if ($val['attr_id'] == $attr['attr_id'] &&
|
||||||
|
$val['type'] == $attr['type']) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
})) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function randAttr($attr, $outAttr)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -21,11 +21,12 @@ class HeroLevel {
|
|||||||
|
|
||||||
public static function getRandAttr($initMeta, $nextMeta, $oldAttr, &$newAttr)
|
public static function getRandAttr($initMeta, $nextMeta, $oldAttr, &$newAttr)
|
||||||
{
|
{
|
||||||
$initAttr = mt\AttrHelper::parseAttr($initMeta['rand_attrs']);
|
$initAttr = mt\AttrHelper::parseAttrCfg($initMeta['rand_attrs']);
|
||||||
$nextAttr = mt\AttrHelper::parseAttr($next['rand_attrs']);
|
$nextAttr = mt\AttrHelper::parseAttrCfg($next['rand_attrs']);
|
||||||
if (!mt\AttrHelper::canMerge($initAttr, $nextAttr)) {
|
if (!mt\AttrHelper::canMergeCfg($initAttr, $nextAttr)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
mt\AttrHelper::randAttr($newMeta, $newAttr);
|
||||||
mt\AttrHelper::mergeAttr($oldAttr, $newAttr);
|
mt\AttrHelper::mergeAttr($oldAttr, $newAttr);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user