1
This commit is contained in:
parent
f77494343a
commit
9af02bf8f2
18
doc/Other.py
18
doc/Other.py
@ -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):
|
||||
|
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
$g_conf_server_switch_cluster = require('../config/serverSwitch.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_mysql_cluster = require('../config/game2006api.mysql.cluster.php');
|
||||
@ -81,6 +82,12 @@ function getMailMysqlConfig()
|
||||
return $g_conf_mail_mysql_cluster;
|
||||
}
|
||||
|
||||
function getServerSwitchConfig()
|
||||
{
|
||||
global $g_conf_server_switch_cluster;
|
||||
return $g_conf_server_switch_cluster;
|
||||
}
|
||||
|
||||
function getRedisConfig($hash_value)
|
||||
{
|
||||
if ($hash_value < 0) {
|
||||
|
@ -111,11 +111,11 @@ class BaseAuthedController extends BaseController {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!(myself()->_getChannel() == IMTBL_CHANNEL ||
|
||||
myself()->_getChannel() == GUEST_CHANNEL)) {
|
||||
phpcommon\sendError(1001, 'session expiration');
|
||||
die();
|
||||
}
|
||||
// if (!(myself()->_getChannel() == IMTBL_CHANNEL ||
|
||||
// myself()->_getChannel() == GUEST_CHANNEL)) {
|
||||
// phpcommon\sendError(1001, 'session expiration');
|
||||
// die();
|
||||
// }
|
||||
$r = $this->_getRedis($this->_getAccountId());
|
||||
if (!(getReqVal('c', '') == 'User' && getReqVal('a', '') == 'login')) {
|
||||
if ((getReqVal('c', '') == 'Battle')) {
|
||||
@ -152,10 +152,10 @@ class BaseAuthedController extends BaseController {
|
||||
{
|
||||
$lastActiveTime = $r->get(LAST_ACTIVE_TIME . $this->_getAccountId());
|
||||
//第一次登录或者跨天更新最后活跃时间
|
||||
if (empty($lastActiveTime) ||
|
||||
$lastActiveTime < $this->_getNowDaySeconds()) {
|
||||
$r->setPx(LAST_ACTIVE_TIME . $this->_getAccountId(), $this->_getNowTime(), 1000 * 3600 * 24);
|
||||
}
|
||||
// if (empty($lastActiveTime) ||
|
||||
// $lastActiveTime < $this->_getNowDaySeconds()) {
|
||||
// $r->setPx(LAST_ACTIVE_TIME . $this->_getAccountId(), $this->_getNowTime(), 1000 * 3600 * 24);
|
||||
// }
|
||||
}
|
||||
|
||||
protected function updateSession($accountId, $sessionId)
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
require_once('services/PropertyChgService.php');
|
||||
require_once('services/ServerSwitch.php');
|
||||
require_once('mt/RankSeason.php');
|
||||
require_once('mt/HashRateCommon.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
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -214,7 +214,7 @@ class Hero extends BaseModel {
|
||||
);
|
||||
$dto['is_avatar'] = 0;
|
||||
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;
|
||||
}
|
||||
}else{
|
||||
@ -315,7 +315,7 @@ class Hero extends BaseModel {
|
||||
// $dto['nft_address'] = $nft_address;
|
||||
$dto['is_avatar'] = 0;
|
||||
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;
|
||||
}
|
||||
}else{
|
||||
|
18
webapp/services/ServerSwitch.php
Normal file
18
webapp/services/ServerSwitch.php
Normal 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();
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user