修改新用户赠送资源
This commit is contained in:
parent
4e3ecf8d4b
commit
c97ac41e7a
@ -6,6 +6,7 @@ require_once('models/Season.php');
|
|||||||
require_once('models/Nft.php');
|
require_once('models/Nft.php');
|
||||||
require_once('models/Gun.php');
|
require_once('models/Gun.php');
|
||||||
require_once('models/UserSeasonRing.php');
|
require_once('models/UserSeasonRing.php');
|
||||||
|
require_once('models/Chip.php');
|
||||||
|
|
||||||
require_once('mt/Parameter.php');
|
require_once('mt/Parameter.php');
|
||||||
require_once('mt/Drop.php');
|
require_once('mt/Drop.php');
|
||||||
@ -28,6 +29,7 @@ use models\Hero;
|
|||||||
use models\Gun;
|
use models\Gun;
|
||||||
use models\Season;
|
use models\Season;
|
||||||
use models\Nft;
|
use models\Nft;
|
||||||
|
use models\Chip;
|
||||||
use models\UserSeasonRing;
|
use models\UserSeasonRing;
|
||||||
|
|
||||||
class UserController extends BaseAuthedController {
|
class UserController extends BaseAuthedController {
|
||||||
@ -45,7 +47,7 @@ class UserController extends BaseAuthedController {
|
|||||||
$userInfo = $this->_safeGetOrmUserInfo();
|
$userInfo = $this->_safeGetOrmUserInfo();
|
||||||
if (!$userInfo) {
|
if (!$userInfo) {
|
||||||
$this->createNewUserV2($userName);
|
$this->createNewUserV2($userName);
|
||||||
$this->_addFreeItem(); //送 50 Test_CEG
|
$this->_addFreeItem2(); //送 50 Test_CEG
|
||||||
$userInfo = $this->_getOrmUserInfo();
|
$userInfo = $this->_getOrmUserInfo();
|
||||||
$this->_setV(TN_RANK_STATUS, 0, 1);
|
$this->_setV(TN_RANK_STATUS, 0, 1);
|
||||||
}
|
}
|
||||||
@ -62,6 +64,63 @@ class UserController extends BaseAuthedController {
|
|||||||
));
|
));
|
||||||
$this->_incDailyV(TN_DAILY_LOGINS, 0, 1);
|
$this->_incDailyV(TN_DAILY_LOGINS, 0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function _addFreeItem2(){
|
||||||
|
//添加芯片
|
||||||
|
$chipMeta = \mt\Item::getMetaListByType(\mt\Item::CHIP_TYPE);
|
||||||
|
$chip1 = array();
|
||||||
|
$chip2 = array();
|
||||||
|
$chip3 = array();
|
||||||
|
foreach ($chipMeta as $row){
|
||||||
|
if ($row['sub_type'] == 1){
|
||||||
|
array_push($chip1,$row);
|
||||||
|
}else if($row['sub_type'] == 2){
|
||||||
|
array_push($chip2,$row);
|
||||||
|
}else if($row['sub_type'] == 3){
|
||||||
|
array_push($chip3,$row);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for ($i=1;$i<=20;$i++){
|
||||||
|
$row1 = $chip1[array_rand($chip1)];
|
||||||
|
Chip::addChip($row1);
|
||||||
|
$row2 = $chip2[array_rand($chip2)];
|
||||||
|
Chip::addChip($row2);
|
||||||
|
$row3 = $chip3[array_rand($chip3)];
|
||||||
|
Chip::addChip($row3);
|
||||||
|
}
|
||||||
|
//添加枪械和Gold
|
||||||
|
$addItems =array();
|
||||||
|
foreach (mt\Parameter::getListValue('creator_present_items') as $itemsStr) {
|
||||||
|
list($itemId, $itemNum) = explode(':', $itemsStr);
|
||||||
|
if ($itemNum > 0) {
|
||||||
|
array_push($addItems,
|
||||||
|
array(
|
||||||
|
'item_id' => $itemId,
|
||||||
|
'item_num' => $itemNum
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
array_push($addItems,
|
||||||
|
array(
|
||||||
|
'item_id' => V_ITEM_GOLD,
|
||||||
|
'item_num' => 100000
|
||||||
|
));
|
||||||
|
$awardService = new services\AwardService();
|
||||||
|
$propertyChgService = new services\PropertyChgService();
|
||||||
|
$this->_addItems($addItems, $awardService, $propertyChgService);
|
||||||
|
|
||||||
|
//添加英雄和皮肤
|
||||||
|
$itemIds = array(30700,30900,31000,40701,40702,40901,40902,41001);
|
||||||
|
$addItems2 =array();
|
||||||
|
foreach ($itemIds as $row){
|
||||||
|
array_push($addItems2,
|
||||||
|
array(
|
||||||
|
'item_id' => $row,
|
||||||
|
'item_num' => 1
|
||||||
|
));
|
||||||
|
}
|
||||||
|
$this->_addItems($addItems2, $awardService, $propertyChgService);
|
||||||
|
}
|
||||||
|
|
||||||
private function addFragmentBox(){
|
private function addFragmentBox(){
|
||||||
$items = array(
|
$items = array(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user