1
This commit is contained in:
parent
c17699e9c1
commit
3d1d9f4441
28
doc/Chip.py
28
doc/Chip.py
@ -31,34 +31,6 @@ class Chip(object):
|
|||||||
_common.RspHead(),
|
_common.RspHead(),
|
||||||
['!data', [_common.Chip()], '芯片信息']
|
['!data', [_common.Chip()], '芯片信息']
|
||||||
]
|
]
|
||||||
},{
|
|
||||||
'name': 'upgradeLevelPreview',
|
|
||||||
'desc': '芯片升级前置操作',
|
|
||||||
'group': 'Chip',
|
|
||||||
'url': 'webapp/index.php?c=Chip&a=upgradeLevelPreview',
|
|
||||||
'params': [
|
|
||||||
_common.ReqHead(),
|
|
||||||
['unique_id', '', 'unique_id'],
|
|
||||||
],
|
|
||||||
'response': [
|
|
||||||
_common.RspHead(),
|
|
||||||
['!data', [_common.ChipPro()], '芯片信息']
|
|
||||||
]
|
|
||||||
},{
|
|
||||||
'name': 'upgradeLevel',
|
|
||||||
'desc': '芯片升级',
|
|
||||||
'group': 'Chip',
|
|
||||||
'url': 'webapp/index.php?c=Chip&a=upgradeLevel',
|
|
||||||
'params': [
|
|
||||||
_common.ReqHead(),
|
|
||||||
['unique_id_main', '', '源芯片token id'],
|
|
||||||
['unique_id_param', '', '材料芯片token id 例:参数1 参数2 参数3'],
|
|
||||||
],
|
|
||||||
'response': [
|
|
||||||
_common.RspHead(),
|
|
||||||
['!data', [_common.Chip()], '芯片信息'],
|
|
||||||
['property_chg', _common.PropertyChg(), '属性变更'],
|
|
||||||
]
|
|
||||||
},{
|
},{
|
||||||
'name': 'upgradeQuality',
|
'name': 'upgradeQuality',
|
||||||
'desc': '芯片升阶',
|
'desc': '芯片升阶',
|
||||||
|
@ -20,23 +20,6 @@ class Fragment(object):
|
|||||||
['property_chg', _common.PropertyChg(), '属性变更'],
|
['property_chg', _common.PropertyChg(), '属性变更'],
|
||||||
['item_id', 0, '道具id']
|
['item_id', 0, '道具id']
|
||||||
]
|
]
|
||||||
},{
|
|
||||||
'name': 'syntheticFragmentOld',
|
|
||||||
'desc': '碎片合成',
|
|
||||||
'group': 'Fragment',
|
|
||||||
'url': 'webapp/index.php?c=Fragment&a=syntheticFragment',
|
|
||||||
'params': [
|
|
||||||
_common.ReqHead(),
|
|
||||||
['type', '', '类型:1 英雄;2 枪械'],
|
|
||||||
['params', '', '普通碎片 item id,用“|”分开;例:item id1|item id2|item id3...'],
|
|
||||||
['param', '', '特殊碎片 item id'],
|
|
||||||
['item_id', '', '英雄或枪械 item id'],
|
|
||||||
],
|
|
||||||
'response': [
|
|
||||||
_common.RspHead(),
|
|
||||||
['property_chg', _common.PropertyChg(), '属性变更'],
|
|
||||||
['item_id', 0, '道具id']
|
|
||||||
]
|
|
||||||
},{
|
},{
|
||||||
'name': 'showBaseByItemId',
|
'name': 'showBaseByItemId',
|
||||||
'desc': '查看item的基本信息',
|
'desc': '查看item的基本信息',
|
||||||
|
31
doc/Hero.py
31
doc/Hero.py
@ -47,22 +47,6 @@ class Hero(object):
|
|||||||
_common.RspHead(),
|
_common.RspHead(),
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
'name': 'upgradeLevelPreview',
|
|
||||||
'desc': '升等级',
|
|
||||||
'group': 'Hero',
|
|
||||||
'url': 'webapp/index.php?c=Hero&a=upgradeLevelPreview',
|
|
||||||
'params': [
|
|
||||||
_common.ReqHead(),
|
|
||||||
['hero_uniid', 0, '英雄唯一id'],
|
|
||||||
],
|
|
||||||
'response': [
|
|
||||||
_common.RspHead(),
|
|
||||||
['old_hero', _common.Hero(), '英雄-老'],
|
|
||||||
['new_hero', _common.Hero(), '英雄-新'],
|
|
||||||
['cost', _common.Cost(), '所需费用'],
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
'name': 'heroDetails',
|
'name': 'heroDetails',
|
||||||
'desc': '英雄详情',
|
'desc': '英雄详情',
|
||||||
@ -78,21 +62,6 @@ class Hero(object):
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': 'upgradeLv',
|
|
||||||
'desc': '升级',
|
|
||||||
'group': 'Hero',
|
|
||||||
'url': 'webapp/index.php?c=Hero&a=upgradeLv',
|
|
||||||
'params': [
|
|
||||||
_common.ReqHead(),
|
|
||||||
['hero_uniid', 0, '英雄唯一id'],
|
|
||||||
],
|
|
||||||
'response': [
|
|
||||||
_common.RspHead(),
|
|
||||||
['property_chg', _common.PropertyChg(), '属性变更'],
|
|
||||||
['old_hero', _common.Hero(), '英雄-老'],
|
|
||||||
['new_hero', _common.Hero(), '英雄-新'],
|
|
||||||
]
|
|
||||||
},{
|
|
||||||
'name': 'setHeroSkill',
|
'name': 'setHeroSkill',
|
||||||
'desc': '设置通用技能',
|
'desc': '设置通用技能',
|
||||||
'group': 'Hero',
|
'group': 'Hero',
|
||||||
|
@ -58,185 +58,6 @@ class ChipController extends BaseAuthedController
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function upgradeLevelPreview(){
|
|
||||||
$unique_id = trim(getReqVal('unique_id', 0));
|
|
||||||
if (! $unique_id) {
|
|
||||||
$this->_rspErr(1, 'Please enter parameter unique_id');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$chipDb = Chip::find($unique_id);
|
|
||||||
if (!$chipDb){
|
|
||||||
$this->_rspErr(1,'unique_id parameter error');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if ($chipDb['chip_grade'] == Chip::CHIP_LV_MAX){
|
|
||||||
$this->_rspErr(1,' Level upper limit');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$paramMeta = mt\Parameter::getByName('chip_upgrade_cost');
|
|
||||||
if (!$paramMeta){
|
|
||||||
$this->_rspErr(1, ' parameter null');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$chip = Chip::toDto($chipDb);
|
|
||||||
$rand_attr = emptyReplace(json_decode($chipDb['rand_attr'], true), array());
|
|
||||||
$chipMeta = mt\ChipAttr::getAttrByItemId($chipDb['item_id']);
|
|
||||||
if ($chipMeta){
|
|
||||||
array_unshift($rand_attr,array(
|
|
||||||
'attr_id'=>$chipMeta['attr_id'],
|
|
||||||
'val' => $chipMeta['lv'.($chipDb['chip_grade']+1)]
|
|
||||||
));
|
|
||||||
}
|
|
||||||
$chip['rand_attr_after'] = $rand_attr;
|
|
||||||
|
|
||||||
$paramValue = explode('|',$paramMeta['param_value']);
|
|
||||||
$gold = 0;
|
|
||||||
$stone = 0;
|
|
||||||
switch ($chipDb['chip_grade']){
|
|
||||||
case 1: {
|
|
||||||
$lv2 = explode(':',$paramValue[0]);
|
|
||||||
$gold = $lv2[0];
|
|
||||||
$stone = $lv2[1];
|
|
||||||
};break;
|
|
||||||
case 2: {
|
|
||||||
$lv3 = explode(':',$paramValue[1]);
|
|
||||||
$gold = $lv3[0];
|
|
||||||
$stone = $lv3[1];
|
|
||||||
};break;
|
|
||||||
}
|
|
||||||
|
|
||||||
$chip['cost'] = array(
|
|
||||||
array(
|
|
||||||
'item_id' => V_ITEM_GOLD,
|
|
||||||
'item_num' => $gold
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'item_id' => V_ITEM_CHIP_META,
|
|
||||||
'item_num' => $stone
|
|
||||||
)
|
|
||||||
);
|
|
||||||
$this->_rspData(array(
|
|
||||||
'data' => $chip
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
public function selectChip(){
|
|
||||||
$unique_id = trim(getReqVal('unique_id', 0));
|
|
||||||
$idxArr = explode(' ',$unique_id);
|
|
||||||
if (count($idxArr)<0){
|
|
||||||
$this->_rspErr(1, 'Please enter instructions');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$chipDbMain = Chip::find($idxArr[0]);
|
|
||||||
$chipDbParam = Chip::find($idxArr[1]);
|
|
||||||
if (!$chipDbMain || !$chipDbParam){
|
|
||||||
$this->_rspErr(1,'unique_id parameter error');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if ($chipDbParam['token_id']) {
|
|
||||||
$this->_rspErr(1, "Unable to use nft chip");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!$chipDbParam['state']) {
|
|
||||||
$this->_rspErr(1, "Unable to use free chip");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if ($chipDbParam['chip_grade']>$chipDbMain['chip_grade']){
|
|
||||||
$this->_rspErr(1, "The selected material is too high grade");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$cost = \services\FormulaService::getChipCumulativeCost($chipDbParam['chip_grade']);
|
|
||||||
$this->_rspData(['cost'=>$cost]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function upgradeLevel(){
|
|
||||||
$chipUniId = trim(getReqVal('chip_uniid', 0));
|
|
||||||
if (!$chipUniId) {
|
|
||||||
$this->_rspErr(1, 'Please enter parameter');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$chipDb = Chip::find($chipUniId);
|
|
||||||
if (!$chipDb){
|
|
||||||
$this->_rspErr(1,'unique_id_main parameter error');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if ($chipDb['chip_grade'] == Chip::CHIP_LV_MAX){
|
|
||||||
$this->_rspErr(1,' Level upper limit');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$paramMeta = mt\Parameter::getByName('chip_upgrade_cost');
|
|
||||||
if (!$paramMeta){
|
|
||||||
$this->_rspErr(1, ' parameter null');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$paramValue = explode('|',$paramMeta['param_value']);
|
|
||||||
$gold = 0;
|
|
||||||
$stone = 0;
|
|
||||||
switch ($chipDb['chip_grade']){
|
|
||||||
case 1: {
|
|
||||||
$lv2 = explode(':',$paramValue[0]);
|
|
||||||
$gold = $lv2[0];
|
|
||||||
$stone = $lv2[1];
|
|
||||||
};break;
|
|
||||||
case 2: {
|
|
||||||
$lv3 = explode(':',$paramValue[1]);
|
|
||||||
$gold = $lv3[0];
|
|
||||||
$stone = $lv3[1];
|
|
||||||
};break;
|
|
||||||
}
|
|
||||||
|
|
||||||
$costItems = array(
|
|
||||||
array(
|
|
||||||
'item_id' => V_ITEM_GOLD,
|
|
||||||
'item_num' => $gold
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'item_id' => V_ITEM_CHIP_META,
|
|
||||||
'item_num' => $stone
|
|
||||||
),
|
|
||||||
);
|
|
||||||
$lackItem = null;
|
|
||||||
if (!$this->_hasEnoughItems($costItems, $lackItem)) {
|
|
||||||
$this->_rspErr(3, $this->_getLackItemErrMsg($lackItem));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$this->_decItems($costItems);
|
|
||||||
// Bag::decItem(V_ITEM_CHIP_META,$stone);
|
|
||||||
|
|
||||||
{
|
|
||||||
//埋点
|
|
||||||
$event = [
|
|
||||||
'name' => LogService::CHIP_LEVEL_UP,
|
|
||||||
'val' => $gold
|
|
||||||
];
|
|
||||||
LogService::consumeGold($event);
|
|
||||||
}
|
|
||||||
|
|
||||||
$propertyChgService = new services\PropertyChgService();
|
|
||||||
$propertyChgService->addChip();
|
|
||||||
$propertyChgService->addBagChg();
|
|
||||||
$propertyChgService->addUserChg();
|
|
||||||
$rand_attr = emptyReplace(json_decode($chipDb['rand_attr'], true), array());
|
|
||||||
$attrProMeta = \mt\ChipAttr::getAttrPool($chipDb);
|
|
||||||
array_push($rand_attr,array(
|
|
||||||
'attr_id'=>$attrProMeta['attr_id'],
|
|
||||||
'val'=>$attrProMeta['val'],
|
|
||||||
));
|
|
||||||
Chip::update2($chipUniId,
|
|
||||||
array(
|
|
||||||
'chip_grade' => $chipDb['chip_grade']+1,
|
|
||||||
//'state' => Chip::GETED_STATE,
|
|
||||||
'rand_attr' => json_encode($rand_attr),
|
|
||||||
)
|
|
||||||
);
|
|
||||||
$chipDbNew = Chip::toDto(Chip::find($chipUniId));
|
|
||||||
$this->_rspData([
|
|
||||||
'data'=>$chipDbNew,
|
|
||||||
'property_chg' => $propertyChgService->toDto(),
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function upgradeQuality(){
|
public function upgradeQuality(){
|
||||||
$chipUniId = trim(getReqVal('chip_uniid', 0));
|
$chipUniId = trim(getReqVal('chip_uniid', 0));
|
||||||
if (!$chipUniId) {
|
if (!$chipUniId) {
|
||||||
|
@ -27,6 +27,12 @@ use mt\Parameter;
|
|||||||
use phpcommon\SqlHelper;
|
use phpcommon\SqlHelper;
|
||||||
class ComputingPowerController extends BaseAuthedController
|
class ComputingPowerController extends BaseAuthedController
|
||||||
{
|
{
|
||||||
|
public function _handlePre()
|
||||||
|
{
|
||||||
|
parent::_handlePre();
|
||||||
|
die;
|
||||||
|
}
|
||||||
|
|
||||||
public function info(){
|
public function info(){
|
||||||
$period_state = -1 ; //-1:算力周期未开始 0:正常周期 1:等待周期 2:维护周期
|
$period_state = -1 ; //-1:算力周期未开始 0:正常周期 1:等待周期 2:维护周期
|
||||||
$curr_period = array(
|
$curr_period = array(
|
||||||
|
@ -1268,12 +1268,13 @@ class TameBattleDataService extends BaseService {
|
|||||||
|
|
||||||
switch (getXVal($this->allInfo,'room_mode', 0)){
|
switch (getXVal($this->allInfo,'room_mode', 0)){
|
||||||
case self::MATCH_MODE_PVP :{
|
case self::MATCH_MODE_PVP :{
|
||||||
if (myself()->_getNowTime() > strtotime($currentHashRate['obtain_start_time']) &&
|
if ($currentHashRate &&
|
||||||
|
myself()->_getNowTime() > strtotime($currentHashRate['obtain_start_time']) &&
|
||||||
strtotime($currentHashRate['obtain_end_time']) > myself()->_getNowTime()){
|
strtotime($currentHashRate['obtain_end_time']) > myself()->_getNowTime()){
|
||||||
$this->applyEx($hisBattleData['hash_rate_data']['pvpData']);
|
$this->applyEx($hisBattleData['hash_rate_data']['pvpData']);
|
||||||
$hisBattleData['hash_rate_data']['modifytime'] = myself()->_getNowTime();
|
$hisBattleData['hash_rate_data']['modifytime'] = myself()->_getNowTime();
|
||||||
}
|
}
|
||||||
if (! $server_task_state &&
|
if (! $server_task_state && $currentServerTask &&
|
||||||
myself()->_getNowTime() > strtotime($currentServerTask['obtain_start_time']) &&
|
myself()->_getNowTime() > strtotime($currentServerTask['obtain_start_time']) &&
|
||||||
myself()->_getNowTime() < strtotime($currentServerTask['obtain_end_time'])) {
|
myself()->_getNowTime() < strtotime($currentServerTask['obtain_end_time'])) {
|
||||||
$this->applyEx($serverTaskData['data']['pvpData']);
|
$this->applyEx($serverTaskData['data']['pvpData']);
|
||||||
@ -1283,11 +1284,13 @@ class TameBattleDataService extends BaseService {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case self::ROOM_MODE_MOBA :{
|
case self::ROOM_MODE_MOBA :{
|
||||||
if (myself()->_getNowTime() > strtotime($currentHashRate['obtain_start_time']) && strtotime($currentHashRate['obtain_end_time']) > myself()->_getNowTime()){
|
if ($currentHashRate &&
|
||||||
|
myself()->_getNowTime() > strtotime($currentHashRate['obtain_start_time']) &&
|
||||||
|
strtotime($currentHashRate['obtain_end_time']) > myself()->_getNowTime()){
|
||||||
$this->applyEx($hisBattleData['hash_rate_data']['mobaData']);
|
$this->applyEx($hisBattleData['hash_rate_data']['mobaData']);
|
||||||
$hisBattleData['hash_rate_data']['modifytime'] = myself()->_getNowTime();
|
$hisBattleData['hash_rate_data']['modifytime'] = myself()->_getNowTime();
|
||||||
}
|
}
|
||||||
if (! $server_task_state &&
|
if (! $server_task_state && $currentServerTask &&
|
||||||
myself()->_getNowTime() > strtotime($currentServerTask['obtain_start_time']) &&
|
myself()->_getNowTime() > strtotime($currentServerTask['obtain_start_time']) &&
|
||||||
myself()->_getNowTime() < strtotime($currentServerTask['obtain_end_time'])) {
|
myself()->_getNowTime() < strtotime($currentServerTask['obtain_end_time'])) {
|
||||||
$this->applyEx($serverTaskData['data']['mobaData']);
|
$this->applyEx($serverTaskData['data']['mobaData']);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user