This commit is contained in:
hujiabin 2023-07-03 13:14:29 +08:00
parent 74cc92853f
commit 6856da52a3

View File

@ -52,7 +52,7 @@ class UserController extends BaseAuthedController {
$userInfo = $this->_safeGetOrmUserInfo();
if (!$userInfo) {
$this->createNewUserV2($userName);
$this->_addFreeItem(); //送 50 Test_CEG
$this->_addFreeItem();
$userInfo = $this->_getOrmUserInfo();
$this->_setBattleHero($userInfo);
$this->_setV(TN_RANK_STATUS, 0, 1);
@ -840,6 +840,9 @@ class UserController extends BaseAuthedController {
private function createNewUserV2($userName){
$currSeasonMeta = mt\RankSeason::getCurrentSeason();
$initRank = \mt\Parameter::getVal($this->init_rank,1);
$RankMeta = mt\Rank::getRankById($initRank);
$initElo = \mt\Parameter::getVal($this->init_elo,1200);
$fields = array(
'account_id' => $this->_getAccountId(),
'channel' => $this->_getChannel(),
@ -848,8 +851,6 @@ class UserController extends BaseAuthedController {
'gold' => 0,
'diamond' => 0,
'level' => 1,
'rank' => 0,
'score' => 0,
'exp' => 0,
'last_season_id' => $currSeasonMeta ? $currSeasonMeta['id'] : 0,
'score_modifytime' => $this->_getNowTime(),
@ -857,6 +858,11 @@ class UserController extends BaseAuthedController {
'createtime' => $this->_getNowTime(),
'modifytime' => $this->_getNowTime(),
'last_login_time' => $this->_getNowTime(),
'rank' => $initRank,
'history_best_rank' => $initRank,
'score' => $RankMeta ? $RankMeta['rank_score'] : 300,
'history_best_score' => $RankMeta ? $RankMeta['rank_score'] : 300,
'elo' => $initElo,
);
if ($this->_getChannel() == BC_CHANNEL) {
$fields['address'] = $this->_getOpenId();