This commit is contained in:
hujiabin 2023-04-03 15:18:50 +08:00
parent 2b3e740dc9
commit edb4db10ca
2 changed files with 41 additions and 6 deletions

View File

@ -82,7 +82,7 @@ class BaseAuthedController extends BaseController {
die();
}
}
$this->_userLvRestriction();
/*if (SERVER_ENV == _ONLINE) {
if (phpcommon\cmpVersion(getReqVal('_version', ''), '0.2.0') > 0) {
if (!$this->isWhiteList() || myself()->_getChannel() != BC_CHANNEL) {
@ -93,6 +93,40 @@ class BaseAuthedController extends BaseController {
}*/
}
private function _userLvRestriction(){
$userDb = $this->_getOrmUserInfo();
$controller = getReqVal('c', '');
switch ($controller){
case "Chip" : {
if ($userDb['level'] < \mt\LevelUp::USER_LEVEL_CHIP_LIMIT){
$this->_rspErr(1,'Not agreed terms. Level of need ' .\mt\LevelUp::USER_LEVEL_CHIP_LIMIT);
die();
}
}
break;
case "ChipPage" : {
if ($userDb['level'] < \mt\LevelUp::USER_LEVEL_CHIP_LIMIT){
$this->_rspErr(1,'Not agreed terms Level of need ' .\mt\LevelUp::USER_LEVEL_CHIP_LIMIT);
die();
}
}
break;
case "Emoji" : {
if ($userDb['level'] < \mt\LevelUp::USER_LEVEL_EMOJI_LIMIT){
$this->_rspErr(1,'Not agreed terms Level of need ' .\mt\LevelUp::USER_LEVEL_EMOJI_LIMIT);
die();
}
}
break;
case "Fragment" : {
if (getReqVal('a', '') == 'syntheticFragment' && $userDb['level'] < \mt\LevelUp::USER_LEVEL_PIECE_LIMIT){
$this->_rspErr(1,'Not agreed terms Level of need ' .\mt\LevelUp::USER_LEVEL_PIECE_LIMIT);
die();
}
}
}
}
protected function updateSession($accountId, $sessionId)
{
$r = $this->_getRedis($this->_getAccountId());

View File

@ -8,11 +8,12 @@ class LevelUp
{
const USER_LEVEL_CHIP_LIMIT = 2;
const USER_LEVEL_EMOJI_LIMIT = 3;
const USER_LEVEL_PVE_MATCH_LIMIT = 4;
const USER_LEVEL_RANK_MATCH_LIMIT = 6;
const USER_LEVEL_PARACHUTE_MATCH_LIMIT = 8;
const USER_LEVEL_CHIP_PAGE1_MATCH_LIMIT = 9;
const USER_LEVEL_CHIP_PAGE2_MATCH_LIMIT = 10;
const USER_LEVEL_PIECE_LIMIT = 4;
const USER_LEVEL_PVE_MATCH_LIMIT = 5;
const USER_LEVEL_RANK_MATCH_LIMIT = 7;
const USER_LEVEL_PARACHUTE_MATCH_LIMIT = 9;
const USER_LEVEL_CHIP_PAGE1_MATCH_LIMIT = 10;
const USER_LEVEL_CHIP_PAGE2_MATCH_LIMIT = 11;
public static function getExpByLv(&$lv,&$exp){
$meta = self::getMetaList();