This commit is contained in:
hujiabin 2024-07-09 14:30:18 +08:00
parent f77494343a
commit 9af02bf8f2
6 changed files with 63 additions and 11 deletions

View File

@ -84,6 +84,24 @@ class Other(object):
], '地图模式列表'], ], '地图模式列表'],
] ]
}, },
{
'name': 'getServerSwitch',
'desc': '开关信息',
'group': 'Other',
'url': 'webapp/index.php?c=Other&a=getServerSwitch',
'params': [
_common.ReqHead(),
],
'response': [
_common.RspHead(),
['data', [
['heroChain',0,'英雄上链'],
['goldSyn',0,'金币合成'],
['pieceSyn',0,'碎片合成'],
['pieceUp',0,'碎片升阶'],
], '开关信息'],
]
},
] ]
class Tag(object): class Tag(object):

View File

@ -1,5 +1,6 @@
<?php <?php
$g_conf_server_switch_cluster = require('../config/serverSwitch.cluster.php');
$g_conf_accountdb_mysql_cluster = require('../config/accountdb.mysql.cluster.php'); $g_conf_accountdb_mysql_cluster = require('../config/accountdb.mysql.cluster.php');
$g_conf_market_mysql_cluster = require('../config/game2006market.mysql.cluster.php'); $g_conf_market_mysql_cluster = require('../config/game2006market.mysql.cluster.php');
$g_conf_mysql_cluster = require('../config/game2006api.mysql.cluster.php'); $g_conf_mysql_cluster = require('../config/game2006api.mysql.cluster.php');
@ -81,6 +82,12 @@ function getMailMysqlConfig()
return $g_conf_mail_mysql_cluster; return $g_conf_mail_mysql_cluster;
} }
function getServerSwitchConfig()
{
global $g_conf_server_switch_cluster;
return $g_conf_server_switch_cluster;
}
function getRedisConfig($hash_value) function getRedisConfig($hash_value)
{ {
if ($hash_value < 0) { if ($hash_value < 0) {

View File

@ -111,11 +111,11 @@ class BaseAuthedController extends BaseController {
} }
} }
} }
if (!(myself()->_getChannel() == IMTBL_CHANNEL || // if (!(myself()->_getChannel() == IMTBL_CHANNEL ||
myself()->_getChannel() == GUEST_CHANNEL)) { // myself()->_getChannel() == GUEST_CHANNEL)) {
phpcommon\sendError(1001, 'session expiration'); // phpcommon\sendError(1001, 'session expiration');
die(); // die();
} // }
$r = $this->_getRedis($this->_getAccountId()); $r = $this->_getRedis($this->_getAccountId());
if (!(getReqVal('c', '') == 'User' && getReqVal('a', '') == 'login')) { if (!(getReqVal('c', '') == 'User' && getReqVal('a', '') == 'login')) {
if ((getReqVal('c', '') == 'Battle')) { if ((getReqVal('c', '') == 'Battle')) {
@ -152,10 +152,10 @@ class BaseAuthedController extends BaseController {
{ {
$lastActiveTime = $r->get(LAST_ACTIVE_TIME . $this->_getAccountId()); $lastActiveTime = $r->get(LAST_ACTIVE_TIME . $this->_getAccountId());
//第一次登录或者跨天更新最后活跃时间 //第一次登录或者跨天更新最后活跃时间
if (empty($lastActiveTime) || // if (empty($lastActiveTime) ||
$lastActiveTime < $this->_getNowDaySeconds()) { // $lastActiveTime < $this->_getNowDaySeconds()) {
$r->setPx(LAST_ACTIVE_TIME . $this->_getAccountId(), $this->_getNowTime(), 1000 * 3600 * 24); // $r->setPx(LAST_ACTIVE_TIME . $this->_getAccountId(), $this->_getNowTime(), 1000 * 3600 * 24);
} // }
} }
protected function updateSession($accountId, $sessionId) protected function updateSession($accountId, $sessionId)

View File

@ -1,6 +1,7 @@
<?php <?php
require_once('services/PropertyChgService.php'); require_once('services/PropertyChgService.php');
require_once('services/ServerSwitch.php');
require_once('mt/RankSeason.php'); require_once('mt/RankSeason.php');
require_once('mt/HashRateCommon.php'); require_once('mt/HashRateCommon.php');
require_once('mt/ActivityRewards.php'); require_once('mt/ActivityRewards.php');
@ -338,5 +339,13 @@ class OtherController extends BaseAuthedController {
)); ));
} }
public function getServerSwitch(){
$switchObj = new ServerSwitch();
$con = $switchObj->getConfig();
$this->_rspData(array(
'data'=>$con
));
}
} }

View File

@ -214,7 +214,7 @@ class Hero extends BaseModel {
); );
$dto['is_avatar'] = 0; $dto['is_avatar'] = 0;
if (SERVER_ENV == _ONLINE) { if (SERVER_ENV == _ONLINE) {
if ($dto['token_id'] >= 6240619010000001 && $dto['token_id'] <= 6240619010000100){ if ($dto['token_id'] > 66240603010001668 && $dto['token_id'] <= 6240603010002168){
$dto['is_avatar'] = 1; $dto['is_avatar'] = 1;
} }
}else{ }else{
@ -315,7 +315,7 @@ class Hero extends BaseModel {
// $dto['nft_address'] = $nft_address; // $dto['nft_address'] = $nft_address;
$dto['is_avatar'] = 0; $dto['is_avatar'] = 0;
if (SERVER_ENV == _ONLINE) { if (SERVER_ENV == _ONLINE) {
if ($dto['token_id'] >= 6240619010000001 && $dto['token_id'] <= 6240619010000100){ if ($dto['token_id'] > 66240603010001668 && $dto['token_id'] <= 6240603010002168){
$dto['is_avatar'] = 1; $dto['is_avatar'] = 1;
} }
}else{ }else{

View File

@ -0,0 +1,18 @@
<?php
class ServerSwitch {
public function getConfig(){
if (!$this->switchConfig){
$this->initConfig();
}
return $this->switchConfig;
}
private $switchConfig = null;
private function initConfig(){
$this->switchConfig = getServerSwitchConfig();
}
}