Session::requireGameLogin 버그 수정
This commit is contained in:
+1
-1
@@ -6,7 +6,6 @@ include "func.php";
|
|||||||
|
|
||||||
$session = Session::requireGameLogin();
|
$session = Session::requireGameLogin();
|
||||||
|
|
||||||
$connect = dbConn();
|
|
||||||
increaseRefresh("메인", 1);
|
increaseRefresh("메인", 1);
|
||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
@@ -30,6 +29,7 @@ if($me === null) {
|
|||||||
$session->setReadOnly();
|
$session->setReadOnly();
|
||||||
|
|
||||||
//턴 실행.
|
//턴 실행.
|
||||||
|
$connect = dbConn();
|
||||||
checkTurn($connect);
|
checkTurn($connect);
|
||||||
|
|
||||||
if($me['newmsg'] == 1 && $me['newvote'] == 1) {
|
if($me['newmsg'] == 1 && $me['newvote'] == 1) {
|
||||||
|
|||||||
+1
-1
@@ -51,7 +51,7 @@ $conlimit = $db->queryFirstField('select conlimit from game limit 1');
|
|||||||
$me = $db->queryFirstRow('select `no`,`name`,`nation`,`level`,`con`,`picture`,`imgsvr` from `general` where `owner` = %i', Session::getUserID());
|
$me = $db->queryFirstRow('select `no`,`name`,`nation`,`level`,`con`,`picture`,`imgsvr` from `general` where `owner` = %i', Session::getUserID());
|
||||||
|
|
||||||
if(!$me){
|
if(!$me){
|
||||||
resetSessionGeneralValues();
|
$session->logoutGame();
|
||||||
Json::die([
|
Json::die([
|
||||||
'result' => false,
|
'result' => false,
|
||||||
'reason' => '로그인되지 않았습니다.',
|
'reason' => '로그인되지 않았습니다.',
|
||||||
|
|||||||
+4
-9
@@ -76,14 +76,7 @@ $image = "/image";
|
|||||||
session_cache_limiter('nocache');//NOTE: 캐시가 가능하도록 설정해야 할 수도 있음. 주의!
|
session_cache_limiter('nocache');//NOTE: 캐시가 가능하도록 설정해야 할 수도 있음. 주의!
|
||||||
//FIXME: 이곳에서 설정하면 안될 듯 하다. 옮기자.
|
//FIXME: 이곳에서 설정하면 안될 듯 하다. 옮기자.
|
||||||
|
|
||||||
/**
|
ob_start();
|
||||||
* Session에 보관된 장수 정보를 제거함.
|
|
||||||
* _prefix_p_no, _prefix_p_name 두 값임
|
|
||||||
*/
|
|
||||||
function resetSessionGeneralValues()
|
|
||||||
{
|
|
||||||
Session::Instance()->logoutGame();
|
|
||||||
}
|
|
||||||
|
|
||||||
// MySQL 데이타 베이스에 접근
|
// MySQL 데이타 베이스에 접근
|
||||||
function dbConn($isRoot=false)
|
function dbConn($isRoot=false)
|
||||||
@@ -101,10 +94,12 @@ function Error($message, $url="")
|
|||||||
$url = $_SERVER['REQUEST_URI'];
|
$url = $_SERVER['REQUEST_URI'];
|
||||||
}
|
}
|
||||||
WebUtil::setHeaderNoCache();
|
WebUtil::setHeaderNoCache();
|
||||||
file_put_contents(__dir__."/logs/_db_bug.txt", "{\"url\":$url,\"msg\":\"$message\"}\n", FILE_APPEND);
|
file_put_contents(__dir__."/logs/_db_bug.txt", "{\"url\":\"$url\",\"msg\":\"$message\"}\n", FILE_APPEND);
|
||||||
|
|
||||||
$templates = new \League\Plates\Engine('templates');
|
$templates = new \League\Plates\Engine('templates');
|
||||||
|
|
||||||
|
ob_get_flush();
|
||||||
|
|
||||||
die($templates->render('error', [
|
die($templates->render('error', [
|
||||||
'message' => $msg
|
'message' => $msg
|
||||||
]));
|
]));
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ class Session {
|
|||||||
static::die($result);
|
static::die($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function requireGameLogin($movePath = ROOT): Session{
|
public static function requireGameLogin($result = ROOT): Session{
|
||||||
$session = Session::requireLogin()->loginGame();
|
$session = Session::requireLogin()->loginGame();
|
||||||
|
|
||||||
if($session->generalID){
|
if($session->generalID){
|
||||||
|
|||||||
Reference in New Issue
Block a user