1
This commit is contained in:
parent
a9ab5c3480
commit
87a6480686
@ -49,14 +49,69 @@ class UserController extends BaseAuthedController {
|
|||||||
{
|
{
|
||||||
$initRankMeta = mt\Rank::getInitRank();
|
$initRankMeta = mt\Rank::getInitRank();
|
||||||
$currSeasonMeta = mt\Season::getCurrentSeason();
|
$currSeasonMeta = mt\Season::getCurrentSeason();
|
||||||
|
$gold = 0;
|
||||||
|
$diamond = 0;
|
||||||
|
$heroList = array();
|
||||||
|
$headList = array();
|
||||||
|
$headFrameList = array();
|
||||||
|
$addItems = array();
|
||||||
{
|
{
|
||||||
foreach (mt\Parameter::getListValue('creator_hero_id') as $heroId) {
|
foreach (mt\Parameter::getListValue('creator_hero_id') as $heroId) {
|
||||||
$heroMeta = mt\Hero::get($heroId);
|
$heroMeta = mt\Hero::get($heroId);
|
||||||
if ($heroMeta) {
|
if ($heroMeta) {
|
||||||
Hero::addHero($heroMeta);
|
Hero::addHero($heroMeta);
|
||||||
|
array_push($heroList, $heroId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
foreach (mt\Parameter::getListValue('creator_present_items') as $itemsStr) {
|
||||||
|
list($itemId, $itemNum) = explode(':', $itemStr);
|
||||||
|
if ($itemNum > 0) {
|
||||||
|
switch ($itemId) {
|
||||||
|
case V_ITEM_GOLD:
|
||||||
|
{
|
||||||
|
$gold += $itemNum;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case V_ITEM_DIAMOND:
|
||||||
|
{
|
||||||
|
$diamond += $itemNum;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
$itemMeta = mt\Item::get($itemId);
|
||||||
|
switch ($itemMeta['type']) {
|
||||||
|
case mt\Item::HEAD_TYPE:
|
||||||
|
{
|
||||||
|
array_push($headList, $itemId);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case mt\Item::HEAD_FRAME_TYPE:
|
||||||
|
{
|
||||||
|
array_push($headFrameList, $itemId);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
array_push($addItems,
|
||||||
|
array(
|
||||||
|
'item_id' => $itemId,
|
||||||
|
'item_num' => $itemNum
|
||||||
|
));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$headId = 0;
|
||||||
|
$headFrame = 0;
|
||||||
|
$heroId = 0;
|
||||||
SqlHelper::upsert
|
SqlHelper::upsert
|
||||||
($this->_getSelfMysql(),
|
($this->_getSelfMysql(),
|
||||||
't_user',
|
't_user',
|
||||||
@ -70,30 +125,22 @@ class UserController extends BaseAuthedController {
|
|||||||
'name' => $userName,
|
'name' => $userName,
|
||||||
'sex' => rand() % 2,
|
'sex' => rand() % 2,
|
||||||
#'avatar_url' => $avatar_url,
|
#'avatar_url' => $avatar_url,
|
||||||
'gold' => 10000 * 10000,
|
'gold' => $gold,
|
||||||
'diamond' => 10000 * 10000,
|
'diamond' => $diamond,
|
||||||
'head_frame' => 19003,
|
'head_frame' => $headFrame,
|
||||||
'level' => 1,
|
'level' => 1,
|
||||||
'exp' => 0,
|
'exp' => 0,
|
||||||
'rank' => $initRankMeta ? $initRankMeta['rank'] : 0,
|
'rank' => $initRankMeta ? $initRankMeta['rank'] : 0,
|
||||||
'score' => $initRankMeta ? $initRankMeta['min_score'] : 0,
|
'score' => $initRankMeta ? $initRankMeta['min_score'] : 0,
|
||||||
'head_id' => 18001,
|
'head_id' => $headId,
|
||||||
'hero_id' => 30100,
|
'hero_id' => $heroId,
|
||||||
'last_season_id' => $currSeasonMeta ? $currSeasonMeta['id'] : 0,
|
'last_season_id' => $currSeasonMeta ? $currSeasonMeta['id'] : 0,
|
||||||
'head_list' => json_encode(array(18001)),
|
'head_list' => json_encode($headList),
|
||||||
'head_frame_list' => json_encode(array(19003)),
|
'head_frame_list' => json_encode($headFrameList),
|
||||||
'createtime' => $this->_getNowTime(),
|
'createtime' => $this->_getNowTime(),
|
||||||
'modifytime' => $this->_getNowTime(),
|
'modifytime' => $this->_getNowTime(),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
{
|
|
||||||
$this->_addItems(array(
|
|
||||||
array(
|
|
||||||
'item_id' => 16001,
|
|
||||||
'item_num' => 0,
|
|
||||||
)
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function active()
|
public function active()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user