From 6856da52a3bfc30b99b4865fbdc03926f9d44469 Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Mon, 3 Jul 2023 13:14:29 +0800 Subject: [PATCH] 1 --- webapp/controller/UserController.class.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/webapp/controller/UserController.class.php b/webapp/controller/UserController.class.php index 06adf91b..7a0100e5 100644 --- a/webapp/controller/UserController.class.php +++ b/webapp/controller/UserController.class.php @@ -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();