1
This commit is contained in:
commit
c430f2962a
19
doc/Chip.py
19
doc/Chip.py
@ -72,7 +72,8 @@ class Chip(object):
|
|||||||
],
|
],
|
||||||
'response': [
|
'response': [
|
||||||
_common.RspHead(),
|
_common.RspHead(),
|
||||||
['!data', [_common.Hero()], '英雄或枪械加成信息,用英雄举例']
|
['!data', [_common.Hero()], '英雄或枪械加成信息,用英雄举例'],
|
||||||
|
['property_chg', _common.PropertyChg(), '属性变更'],
|
||||||
]
|
]
|
||||||
},{
|
},{
|
||||||
'name': 'demountChip',
|
'name': 'demountChip',
|
||||||
@ -87,7 +88,8 @@ class Chip(object):
|
|||||||
],
|
],
|
||||||
'response': [
|
'response': [
|
||||||
_common.RspHead(),
|
_common.RspHead(),
|
||||||
['!data', [_common.Hero()], '英雄或枪械加成信息,用英雄举例']
|
['!data', [_common.Hero()], '英雄或枪械加成信息,用英雄举例'],
|
||||||
|
['property_chg', _common.PropertyChg(), '属性变更'],
|
||||||
]
|
]
|
||||||
},{
|
},{
|
||||||
'name': 'replaceChip',
|
'name': 'replaceChip',
|
||||||
@ -103,7 +105,8 @@ class Chip(object):
|
|||||||
],
|
],
|
||||||
'response': [
|
'response': [
|
||||||
_common.RspHead(),
|
_common.RspHead(),
|
||||||
['!data', [_common.Hero()], '英雄或枪械加成信息,用英雄举例']
|
['!data', [_common.Hero()], '英雄或枪械加成信息,用英雄举例'],
|
||||||
|
['property_chg', _common.PropertyChg(), '属性变更'],
|
||||||
]
|
]
|
||||||
},{
|
},{
|
||||||
'name': 'aKeyInlayChip',
|
'name': 'aKeyInlayChip',
|
||||||
@ -157,7 +160,9 @@ class Chip(object):
|
|||||||
],
|
],
|
||||||
'response': [
|
'response': [
|
||||||
_common.RspHead(),
|
_common.RspHead(),
|
||||||
['!data', [_common.Chip()], '芯片信息']
|
['!data', [_common.Chip()], '芯片信息'],
|
||||||
|
['state', 0, '1 成功,0 失败'],
|
||||||
|
['property_chg', _common.PropertyChg(), '属性变更'],
|
||||||
]
|
]
|
||||||
},{
|
},{
|
||||||
'name': 'isNeedLucky',
|
'name': 'isNeedLucky',
|
||||||
@ -170,6 +175,7 @@ class Chip(object):
|
|||||||
],
|
],
|
||||||
'response': [
|
'response': [
|
||||||
_common.RspHead(),
|
_common.RspHead(),
|
||||||
|
['property_chg', _common.PropertyChg(), '属性变更'],
|
||||||
]
|
]
|
||||||
},{
|
},{
|
||||||
'name': 'isNotNeedLucky',
|
'name': 'isNotNeedLucky',
|
||||||
@ -182,6 +188,7 @@ class Chip(object):
|
|||||||
],
|
],
|
||||||
'response': [
|
'response': [
|
||||||
_common.RspHead(),
|
_common.RspHead(),
|
||||||
|
['property_chg', _common.PropertyChg(), '属性变更'],
|
||||||
]
|
]
|
||||||
},{
|
},{
|
||||||
'name': 'waitingLucky',
|
'name': 'waitingLucky',
|
||||||
@ -194,6 +201,7 @@ class Chip(object):
|
|||||||
],
|
],
|
||||||
'response': [
|
'response': [
|
||||||
_common.RspHead(),
|
_common.RspHead(),
|
||||||
|
['property_chg', _common.PropertyChg(), '属性变更'],
|
||||||
]
|
]
|
||||||
},{
|
},{
|
||||||
'name': 'aKeySynthetic',
|
'name': 'aKeySynthetic',
|
||||||
@ -222,7 +230,8 @@ class Chip(object):
|
|||||||
['state', '', '1 加锁 ;0 释放锁'],
|
['state', '', '1 加锁 ;0 释放锁'],
|
||||||
],
|
],
|
||||||
'response': [
|
'response': [
|
||||||
_common.RspHead()
|
_common.RspHead(),
|
||||||
|
['property_chg', _common.PropertyChg(), '属性变更'],
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -311,7 +311,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, gun)']
|
['!container_chg', [''], '容器类数据变更(bag、hero、heroSkin、gunSkin, gun,chip,fragment)']
|
||||||
]
|
]
|
||||||
|
|
||||||
class CostInfoItem(object):
|
class CostInfoItem(object):
|
||||||
|
@ -6,9 +6,11 @@ require_once('models/Gun.php');
|
|||||||
require_once('models/User.php');
|
require_once('models/User.php');
|
||||||
require_once('mt/ChipAttr.php');
|
require_once('mt/ChipAttr.php');
|
||||||
require_once('services/FormulaService.php');
|
require_once('services/FormulaService.php');
|
||||||
|
require_once('services/PropertyChgService.php');
|
||||||
require_once('phpcommon/tglog.php');
|
require_once('phpcommon/tglog.php');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
use models\Chip;
|
use models\Chip;
|
||||||
use models\Hero;
|
use models\Hero;
|
||||||
use models\Gun;
|
use models\Gun;
|
||||||
@ -102,18 +104,28 @@ class ChipController extends BaseAuthedController
|
|||||||
$this->_rspErr(1, 'Please enter instructions');
|
$this->_rspErr(1, 'Please enter instructions');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
$propertyChgService = new services\PropertyChgService();
|
||||||
|
$propertyChgService->addChip();
|
||||||
if ($type == 1){
|
if ($type == 1){
|
||||||
if (! $this->_doInlayHero($unique_id,$token_id)){
|
if (! $this->_doInlayHero($unique_id,$token_id)){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$hero = Hero::toDto(Hero::find($unique_id));
|
$hero = Hero::toDto(Hero::find($unique_id));
|
||||||
$this->_rspData(['data'=>$hero]);
|
$propertyChgService->addHeroChg();
|
||||||
|
$this->_rspData([
|
||||||
|
'data'=>$hero,
|
||||||
|
'property_chg' => $propertyChgService->toDto(),
|
||||||
|
]);
|
||||||
}else{
|
}else{
|
||||||
if (! $this->_doInlayGun($unique_id,$token_id)){
|
if (! $this->_doInlayGun($unique_id,$token_id)){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$gun = Gun::toDto(Gun::find($unique_id));
|
$gun = Gun::toDto(Gun::find($unique_id));
|
||||||
$this->_rspData(['data'=>$gun]);
|
$propertyChgService->addGunChg();
|
||||||
|
$this->_rspData([
|
||||||
|
'data'=>$gun,
|
||||||
|
'property_chg' => $propertyChgService->toDto(),
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -126,18 +138,28 @@ class ChipController extends BaseAuthedController
|
|||||||
$this->_rspErr(1, 'Please enter instructions');
|
$this->_rspErr(1, 'Please enter instructions');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
$propertyChgService = new services\PropertyChgService();
|
||||||
|
$propertyChgService->addChip();
|
||||||
if ($type == 1){
|
if ($type == 1){
|
||||||
if (!$this->_doDemount($unique_id,$token_id)){
|
if (!$this->_doDemount($unique_id,$token_id)){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$hero = Hero::toDto(Hero::find($unique_id));
|
$hero = Hero::toDto(Hero::find($unique_id));
|
||||||
$this->_rspData(['data'=>$hero]);
|
$propertyChgService->addHeroChg();
|
||||||
|
$this->_rspData([
|
||||||
|
'data'=>$hero,
|
||||||
|
'property_chg' => $propertyChgService->toDto(),
|
||||||
|
]);
|
||||||
}else{
|
}else{
|
||||||
if (! $this->_doDemountGun($unique_id,$token_id)){
|
if (! $this->_doDemountGun($unique_id,$token_id)){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$gun = Gun::toDto(Gun::find($unique_id));
|
$gun = Gun::toDto(Gun::find($unique_id));
|
||||||
$this->_rspData(['data'=>$gun]);
|
$propertyChgService->addGunChg();
|
||||||
|
$this->_rspData([
|
||||||
|
'data'=>$gun,
|
||||||
|
'property_chg' => $propertyChgService->toDto(),
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -151,6 +173,8 @@ class ChipController extends BaseAuthedController
|
|||||||
$this->_rspErr(1, 'Please enter instructions');
|
$this->_rspErr(1, 'Please enter instructions');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
$propertyChgService = new services\PropertyChgService();
|
||||||
|
$propertyChgService->addChip();
|
||||||
if ($type == 1){
|
if ($type == 1){
|
||||||
if (! $this->_doDemount($unique_id,$token_id_old)){
|
if (! $this->_doDemount($unique_id,$token_id_old)){
|
||||||
return;
|
return;
|
||||||
@ -159,7 +183,11 @@ class ChipController extends BaseAuthedController
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$hero = Hero::toDto(Hero::find($unique_id));
|
$hero = Hero::toDto(Hero::find($unique_id));
|
||||||
$this->_rspData(['data'=>$hero]);
|
$propertyChgService->addHeroChg();
|
||||||
|
$this->_rspData([
|
||||||
|
'data'=>$hero,
|
||||||
|
'property_chg' => $propertyChgService->toDto(),
|
||||||
|
]);
|
||||||
}else{
|
}else{
|
||||||
if (! $this->_doDemountGun($unique_id,$token_id_old)){
|
if (! $this->_doDemountGun($unique_id,$token_id_old)){
|
||||||
return;
|
return;
|
||||||
@ -168,7 +196,11 @@ class ChipController extends BaseAuthedController
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$gun = Gun::toDto(Gun::find($unique_id));
|
$gun = Gun::toDto(Gun::find($unique_id));
|
||||||
$this->_rspData(['data'=>$gun]);
|
$propertyChgService->addGunChg();
|
||||||
|
$this->_rspData([
|
||||||
|
'data'=>$gun,
|
||||||
|
'property_chg' => $propertyChgService->toDto(),
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -219,18 +251,28 @@ class ChipController extends BaseAuthedController
|
|||||||
$this->_rspErr(1, 'The chip slot is full');
|
$this->_rspErr(1, 'The chip slot is full');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
$propertyChgService = new services\PropertyChgService();
|
||||||
|
$propertyChgService->addChip();
|
||||||
if ($type == 1){
|
if ($type == 1){
|
||||||
foreach ($res as $val){
|
foreach ($res as $val){
|
||||||
$this->_doInlayHero($unique_id,$val['token_id']);
|
$this->_doInlayHero($unique_id,$val['token_id']);
|
||||||
}
|
}
|
||||||
$hero_new = Hero::toDto(Hero::find($unique_id));
|
$hero_new = Hero::toDto(Hero::find($unique_id));
|
||||||
$this->_rspData(['data'=>$hero_new]);
|
$propertyChgService->addHeroChg();
|
||||||
|
$this->_rspData([
|
||||||
|
'data'=>$hero_new,
|
||||||
|
'property_chg' => $propertyChgService->toDto(),
|
||||||
|
]);
|
||||||
}else{
|
}else{
|
||||||
foreach ($res as $val){
|
foreach ($res as $val){
|
||||||
$this->_doInlayGun($unique_id,$val['token_id']);
|
$this->_doInlayGun($unique_id,$val['token_id']);
|
||||||
}
|
}
|
||||||
$gun_new = Gun::toDto(Gun::find($unique_id));
|
$gun_new = Gun::toDto(Gun::find($unique_id));
|
||||||
$this->_rspData(['data'=>$gun_new]);
|
$propertyChgService->addGunChg();
|
||||||
|
$this->_rspData([
|
||||||
|
'data'=>$gun_new,
|
||||||
|
'property_chg' => $propertyChgService->toDto(),
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -304,9 +346,14 @@ class ChipController extends BaseAuthedController
|
|||||||
Chip::deleteChip(['token_id'=>$val]);
|
Chip::deleteChip(['token_id'=>$val]);
|
||||||
}
|
}
|
||||||
$num = round(round(($cumulative_cost/$upgrade_cost),5)*10000);
|
$num = round(round(($cumulative_cost/$upgrade_cost),5)*10000);
|
||||||
|
$propertyChgService = new services\PropertyChgService();
|
||||||
|
$propertyChgService->addChip();
|
||||||
if ($num<rand(1,10000)){
|
if ($num<rand(1,10000)){
|
||||||
//合成失败
|
//合成失败
|
||||||
$this->_rspOk();
|
$this->_rspData([
|
||||||
|
'state' => 0,
|
||||||
|
'property_chg' => $propertyChgService->toDto(),
|
||||||
|
]);
|
||||||
return;
|
return;
|
||||||
}else{
|
}else{
|
||||||
//合成成功
|
//合成成功
|
||||||
@ -314,7 +361,11 @@ class ChipController extends BaseAuthedController
|
|||||||
$chip_new = Chip::toDto(Chip::getChipByTokenId($token_id_main));
|
$chip_new = Chip::toDto(Chip::getChipByTokenId($token_id_main));
|
||||||
$chip_new['strength_temporary'] = \services\FormulaService::Hero_Chip_NFT_Maximum_Physical_Strength($chip_new['chip_grade'],$chip_new['lucky_temporary']);
|
$chip_new['strength_temporary'] = \services\FormulaService::Hero_Chip_NFT_Maximum_Physical_Strength($chip_new['chip_grade'],$chip_new['lucky_temporary']);
|
||||||
$chip_new['mint'] = \services\FormulaService::Chip_Need_Mint_Cost($chip_new['chip_grade']);
|
$chip_new['mint'] = \services\FormulaService::Chip_Need_Mint_Cost($chip_new['chip_grade']);
|
||||||
$this->_rspData(['data'=>$chip_new]);
|
$this->_rspData([
|
||||||
|
'data'=>$chip_new,
|
||||||
|
'state' => 1,
|
||||||
|
'property_chg' => $propertyChgService->toDto(),
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -342,7 +393,12 @@ class ChipController extends BaseAuthedController
|
|||||||
}
|
}
|
||||||
User::update(['gold'=>$user['gold']-$mint_cost]);
|
User::update(['gold'=>$user['gold']-$mint_cost]);
|
||||||
Chip::update($chip['token_id'],$fieldsKv);
|
Chip::update($chip['token_id'],$fieldsKv);
|
||||||
$this->_rspOk();
|
$propertyChgService = new services\PropertyChgService();
|
||||||
|
$propertyChgService->addUserChg();
|
||||||
|
$propertyChgService->addChip();
|
||||||
|
$this->_rspData(array(
|
||||||
|
'property_chg' => $propertyChgService->toDto(),
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isNotNeedLucky(){
|
public function isNotNeedLucky(){
|
||||||
@ -357,7 +413,11 @@ class ChipController extends BaseAuthedController
|
|||||||
'lucky_temporary'=>0,
|
'lucky_temporary'=>0,
|
||||||
];
|
];
|
||||||
Chip::update($chip['token_id'],$fieldsKv);
|
Chip::update($chip['token_id'],$fieldsKv);
|
||||||
$this->_rspOk();
|
$propertyChgService = new services\PropertyChgService();
|
||||||
|
$propertyChgService->addChip();
|
||||||
|
$this->_rspData(array(
|
||||||
|
'property_chg' => $propertyChgService->toDto(),
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function waitingLucky(){
|
public function waitingLucky(){
|
||||||
@ -371,7 +431,11 @@ class ChipController extends BaseAuthedController
|
|||||||
'supper_state'=>1,
|
'supper_state'=>1,
|
||||||
];
|
];
|
||||||
Chip::update($chip['token_id'],$fieldsKv);
|
Chip::update($chip['token_id'],$fieldsKv);
|
||||||
$this->_rspOk();
|
$propertyChgService = new services\PropertyChgService();
|
||||||
|
$propertyChgService->addChip();
|
||||||
|
$this->_rspData([
|
||||||
|
'property_chg' => $propertyChgService->toDto(),
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function aKeySynthetic(){
|
public function aKeySynthetic(){
|
||||||
@ -454,7 +518,11 @@ class ChipController extends BaseAuthedController
|
|||||||
}else{
|
}else{
|
||||||
Chip::update($token_id,['state'=>0]);
|
Chip::update($token_id,['state'=>0]);
|
||||||
}
|
}
|
||||||
$this->_rspOk();
|
$propertyChgService = new services\PropertyChgService();
|
||||||
|
$propertyChgService->addChip();
|
||||||
|
$this->_rspData([
|
||||||
|
'property_chg' => $propertyChgService->toDto(),
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test(){
|
public function test(){
|
||||||
@ -479,13 +547,6 @@ class ChipController extends BaseAuthedController
|
|||||||
// }
|
// }
|
||||||
// $this->_rspOk();
|
// $this->_rspOk();
|
||||||
|
|
||||||
// $lucky = FormulaService::getChipLuckyValue(6);
|
|
||||||
// echo FormulaService::Hero_Chip_NFT_Maximum_Physical_Strength(6,$lucky);
|
|
||||||
// echo FormulaService::Hero_Chip_PSA_Value(6);
|
|
||||||
// $lucky = FormulaService::Hero_Advanced_Lucky_Value(3);
|
|
||||||
// echo FormulaService::Hero_NFT_Maximum_Physical_Strength(3,$lucky);
|
|
||||||
echo FormulaService::Weapon_Advanced_Lucky_Value(1);
|
|
||||||
// echo FormulaService::Hero_NFT_Maximum_Physical_Strength(1,$lucky);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -491,19 +491,37 @@ class GunController extends BaseAuthedController {
|
|||||||
$this->_setV(TN_GUN_QUALITY_UP, $idx, 0);
|
$this->_setV(TN_GUN_QUALITY_UP, $idx, 0);
|
||||||
$this->_setV(TN_GUN_QUALITY_UP, (int)$idx + 1000, 0);
|
$this->_setV(TN_GUN_QUALITY_UP, (int)$idx + 1000, 0);
|
||||||
$propertyChgService = new services\PropertyChgService();
|
$propertyChgService = new services\PropertyChgService();
|
||||||
$propertyChgService->addHeroChg();
|
$propertyChgService->addGunChg();
|
||||||
$propertyChgService->addUserChg();
|
$propertyChgService->addUserChg();
|
||||||
$nextQualityMeta = mt\GunQuality::getByQuality($gunDb['quality'] + 1);
|
$nextQualityMeta = mt\GunQuality::getByQuality($gunDb['quality'] + 1);
|
||||||
if ($nextQualityMeta) {
|
if ($nextQualityMeta) {
|
||||||
$rnd = rand(1, 100);
|
|
||||||
$probability = \services\FormulaService::Weapon_Advanced_Probability($gunDb['quality'] + 1)*100;
|
$costGunDb = Gun::find($costGunUniId);
|
||||||
if ($rnd > $probability) {
|
if ($costGunDb['token_id']){
|
||||||
|
SqlHelper::update(
|
||||||
|
myself()->_getMarketMysql(),
|
||||||
|
't_nft',
|
||||||
|
['token_id'=>$costGunDb['token_id']],
|
||||||
|
['deleted'=>1]
|
||||||
|
);
|
||||||
|
}else{
|
||||||
|
Gun::update($costGunUniId,
|
||||||
|
array(
|
||||||
|
'account_id' => myself()->_getAccountId() . '!!!',
|
||||||
|
'lock_type' => 0,
|
||||||
|
'unlock_time' => 0,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
Gun::update($costGunUniId,
|
Gun::update($costGunUniId,
|
||||||
array(
|
array(
|
||||||
'lock_type' => 0,
|
'lock_type' => 0,
|
||||||
'unlock_time' => 0,
|
'unlock_time' => 0,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
$rnd = rand(1, 100);
|
||||||
|
$probability = \services\FormulaService::Weapon_Advanced_Probability($gunDb['quality'] + 1)*100;
|
||||||
|
if ($rnd > $probability) {
|
||||||
Gun::update($gunUniId,
|
Gun::update($gunUniId,
|
||||||
array(
|
array(
|
||||||
'lock_type' => 0,
|
'lock_type' => 0,
|
||||||
@ -537,13 +555,6 @@ class GunController extends BaseAuthedController {
|
|||||||
if ($gunDb['quality'] + 1 > myself()->_getV(TN_GUN_MAX_QUALITY, 0)) {
|
if ($gunDb['quality'] + 1 > myself()->_getV(TN_GUN_MAX_QUALITY, 0)) {
|
||||||
myself()->_setV(TN_GUN_MAX_QUALITY, 0, $gunDb['quality'] + 1);
|
myself()->_setV(TN_GUN_MAX_QUALITY, 0, $gunDb['quality'] + 1);
|
||||||
}
|
}
|
||||||
Gun::update($costGunUniId,
|
|
||||||
array(
|
|
||||||
'account_id' => myself()->_getAccountId() . '!!!',
|
|
||||||
'lock_type' => 0,
|
|
||||||
'unlock_time' => 0,
|
|
||||||
)
|
|
||||||
);
|
|
||||||
$newGunDb = Gun::find($gunUniId);
|
$newGunDb = Gun::find($gunUniId);
|
||||||
$newGun = Gun::toDto($newGunDb);
|
$newGun = Gun::toDto($newGunDb);
|
||||||
error_log(json_encode(array(
|
error_log(json_encode(array(
|
||||||
|
@ -331,15 +331,30 @@ class HeroController extends BaseAuthedController {
|
|||||||
$propertyChgService->addUserChg();
|
$propertyChgService->addUserChg();
|
||||||
$nextQualityMeta = mt\HeroQuality::getByQuality($heroDb['quality'] + 1);
|
$nextQualityMeta = mt\HeroQuality::getByQuality($heroDb['quality'] + 1);
|
||||||
if ($nextQualityMeta) {
|
if ($nextQualityMeta) {
|
||||||
$rnd = rand(1, 100);
|
$costHeroDb = Hero::find($costHeroUniId);
|
||||||
$probability = \services\FormulaService::Hero_Advanced_Probability($heroDb['quality'] + 1)*100;
|
if ($costHeroDb['token_id']){
|
||||||
if ($rnd > $probability) {
|
SqlHelper::update(
|
||||||
|
myself()->_getMarketMysql(),
|
||||||
|
't_nft',
|
||||||
|
['token_id'=>$costHeroDb['token_id']],
|
||||||
|
['deleted'=>1]
|
||||||
|
);
|
||||||
|
}else{
|
||||||
|
Hero::update($costHeroUniId,
|
||||||
|
array(
|
||||||
|
'account_id' => myself()->_getAccountId() . '!!!',
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
Hero::update($costHeroUniId,
|
Hero::update($costHeroUniId,
|
||||||
array(
|
array(
|
||||||
'lock_type' => 0,
|
'lock_type' => 0,
|
||||||
'unlock_time' => 0,
|
'unlock_time' => 0,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
$rnd = rand(1, 100);
|
||||||
|
$probability = \services\FormulaService::Hero_Advanced_Probability($heroDb['quality'] + 1)*100;
|
||||||
|
if ($rnd > $probability) {
|
||||||
Hero::update($heroUniId,
|
Hero::update($heroUniId,
|
||||||
array(
|
array(
|
||||||
'advanced_count' => $heroDb['advanced_count'] + 1,
|
'advanced_count' => $heroDb['advanced_count'] + 1,
|
||||||
@ -377,13 +392,6 @@ class HeroController extends BaseAuthedController {
|
|||||||
if ($heroDb['quality'] + 1 > myself()->_getV(TN_HERO_MAX_QUALITY, 0)) {
|
if ($heroDb['quality'] + 1 > myself()->_getV(TN_HERO_MAX_QUALITY, 0)) {
|
||||||
myself()->_setV(TN_HERO_MAX_QUALITY, 0, $heroDb['quality'] + 1);
|
myself()->_setV(TN_HERO_MAX_QUALITY, 0, $heroDb['quality'] + 1);
|
||||||
}
|
}
|
||||||
Hero::update($costHeroUniId,
|
|
||||||
array(
|
|
||||||
'account_id' => myself()->_getAccountId() . '!!!',
|
|
||||||
'lock_type' => 0,
|
|
||||||
'unlock_time' => 0,
|
|
||||||
)
|
|
||||||
);
|
|
||||||
$newHeroDb = Hero::find($heroUniId);
|
$newHeroDb = Hero::find($heroUniId);
|
||||||
$newHero = Hero::toDto($newHeroDb);
|
$newHero = Hero::toDto($newHeroDb);
|
||||||
error_log(json_encode(array(
|
error_log(json_encode(array(
|
||||||
|
@ -33,8 +33,23 @@ class TeamController extends BaseAuthedController {
|
|||||||
return;
|
return;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
$userDb = $this->_getOrmUserInfo();
|
// $userDb = $this->_getOrmUserInfo();
|
||||||
|
$userDb = User::find('6513_2006_HaABddcrIdHDoj0qg73FFwvyrYkqOsQd');
|
||||||
|
|
||||||
|
//验证pve_instance_id合法性
|
||||||
|
if ($pveInstanceId){
|
||||||
|
$pveGame = \mt\PveGemini::get($pveInstanceId);
|
||||||
|
if (!$pveGame){
|
||||||
|
$this->_rspErr(1, 'pve_instance_id error');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!in_array($pveInstanceId,\mt\PveGemini::getAbleCombatMeta($userDb['pve_instance_id']))){
|
||||||
|
$this->_rspErr(1, 'pve_instance_id error');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
$userDto = User::info($userDb);
|
$userDto = User::info($userDb);
|
||||||
|
$userDto['is_leader'] =1;
|
||||||
$userDto['createtime'] = $userDb['createtime'];
|
$userDto['createtime'] = $userDb['createtime'];
|
||||||
$teamDb = array(
|
$teamDb = array(
|
||||||
'team_uuid' => $teamUuid,
|
'team_uuid' => $teamUuid,
|
||||||
@ -56,7 +71,6 @@ class TeamController extends BaseAuthedController {
|
|||||||
{
|
{
|
||||||
$teamUuid = getReqVal('team_uuid', '');
|
$teamUuid = getReqVal('team_uuid', '');
|
||||||
$r = $this->_getRedis($teamUuid);
|
$r = $this->_getRedis($teamUuid);
|
||||||
|
|
||||||
$teamDb = $this->readTeamDb($r, $teamUuid);
|
$teamDb = $this->readTeamDb($r, $teamUuid);
|
||||||
if (empty($teamDb)) {
|
if (empty($teamDb)) {
|
||||||
$this->_rspErr(1, 'The team has been disbanded');
|
$this->_rspErr(1, 'The team has been disbanded');
|
||||||
@ -77,7 +91,7 @@ class TeamController extends BaseAuthedController {
|
|||||||
$this->_rspErr(1, 'The team has been disbanded');
|
$this->_rspErr(1, 'The team has been disbanded');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (count($teamDb['member_list']) >= 4) {
|
if (count($teamDb['member_list']) >= $teamDb['slot_num']) {
|
||||||
$this->_rspErr(2, 'The team is full');
|
$this->_rspErr(2, 'The team is full');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -90,6 +104,14 @@ class TeamController extends BaseAuthedController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$userDb = User::find($this->_getAccountId());
|
$userDb = User::find($this->_getAccountId());
|
||||||
|
//验证pve_instance_id合法性
|
||||||
|
if ($teamDb['pve_instance_id']>0){
|
||||||
|
if (!in_array($teamDb['pve_instance_id'],\mt\PveGemini::getAbleCombatMeta($userDb['pve_instance_id']))) {
|
||||||
|
$this->_rspErr(1, 'No challenge');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$userDto = User::info($userDb);
|
$userDto = User::info($userDb);
|
||||||
$userDto['createtime'] = $userDb['createtime'];
|
$userDto['createtime'] = $userDb['createtime'];
|
||||||
array_push($teamDb['member_list'], $userDto);
|
array_push($teamDb['member_list'], $userDto);
|
||||||
|
@ -107,6 +107,7 @@ class Gun extends BaseModel {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
foreach (NftService::getEquips(myself()->_getOpenId()) as $nftDb) {
|
foreach (NftService::getEquips(myself()->_getOpenId()) as $nftDb) {
|
||||||
|
if (! $nftDb['deleted']){
|
||||||
$row = SqlHelper::ormSelectOne(
|
$row = SqlHelper::ormSelectOne(
|
||||||
myself()->_getSelfMysql(),
|
myself()->_getSelfMysql(),
|
||||||
't_gun',
|
't_gun',
|
||||||
@ -132,6 +133,7 @@ class Gun extends BaseModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static function toDto($row)
|
public static function toDto($row)
|
||||||
{
|
{
|
||||||
|
@ -97,6 +97,7 @@ class Hero extends BaseModel {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
foreach (NftService::getHeros(myself()->_getOpenId()) as $nftDb) {
|
foreach (NftService::getHeros(myself()->_getOpenId()) as $nftDb) {
|
||||||
|
if (! $nftDb['deleted']){
|
||||||
$row = SqlHelper::ormSelectOne(
|
$row = SqlHelper::ormSelectOne(
|
||||||
myself()->_getSelfMysql(),
|
myself()->_getSelfMysql(),
|
||||||
't_hero',
|
't_hero',
|
||||||
@ -122,6 +123,7 @@ class Hero extends BaseModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static function toDto($row)
|
public static function toDto($row)
|
||||||
{
|
{
|
||||||
|
@ -10,7 +10,7 @@ use phpcommon\SqlHelper;
|
|||||||
|
|
||||||
class User extends BaseModel {
|
class User extends BaseModel {
|
||||||
|
|
||||||
public function find($targetId)
|
public static function find($targetId)
|
||||||
{
|
{
|
||||||
$row = SqlHelper::ormSelectOne
|
$row = SqlHelper::ormSelectOne
|
||||||
(myself()->_getMysql($targetId),
|
(myself()->_getMysql($targetId),
|
||||||
@ -75,6 +75,7 @@ class User extends BaseModel {
|
|||||||
'pve_instance_id' => $row['pve_instance_id'],
|
'pve_instance_id' => $row['pve_instance_id'],
|
||||||
'like_count' => $row['like_count'],
|
'like_count' => $row['like_count'],
|
||||||
'head_frame_list' => emptyReplace(json_decode($row['head_frame_list'], true), array()),
|
'head_frame_list' => emptyReplace(json_decode($row['head_frame_list'], true), array()),
|
||||||
|
'is_leader' => 0
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,6 +13,23 @@ class PveGemini {
|
|||||||
return array_key_exists($id, self::getMetaList()) ? self::getMetaList()[$id] : null;
|
return array_key_exists($id, self::getMetaList()) ? self::getMetaList()[$id] : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getAbleCombatMeta($id){
|
||||||
|
$arr = array();
|
||||||
|
if (!$id){
|
||||||
|
array_push($arr,self::FIRST_INSTANCE_ID);
|
||||||
|
}else{
|
||||||
|
foreach (self::getMetaList() as $value){
|
||||||
|
if ($value['gemini_id']<=$id){
|
||||||
|
array_push($arr,$value['gemini_id']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (self::get($id+1)){
|
||||||
|
array_push($arr,$id+1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $arr;
|
||||||
|
}
|
||||||
|
|
||||||
protected static function getMetaList()
|
protected static function getMetaList()
|
||||||
{
|
{
|
||||||
if (!self::$metaList) {
|
if (!self::$metaList) {
|
||||||
|
@ -40,6 +40,10 @@ class PropertyChgService extends BaseService {
|
|||||||
{
|
{
|
||||||
$this->internalAddChg('gun');
|
$this->internalAddChg('gun');
|
||||||
}
|
}
|
||||||
|
public function addChip()
|
||||||
|
{
|
||||||
|
$this->internalAddChg('chip');
|
||||||
|
}
|
||||||
|
|
||||||
public function addFragment()
|
public function addFragment()
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user