diff --git a/hwe/_admin1.php b/hwe/_admin1.php index 6416cace..102cd2a3 100644 --- a/hwe/_admin1.php +++ b/hwe/_admin1.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); if(Session::getUserGrade() < 5) { diff --git a/hwe/_admin1_submit.php b/hwe/_admin1_submit.php index ee4441a2..deb573e9 100644 --- a/hwe/_admin1_submit.php +++ b/hwe/_admin1_submit.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); $admin = getAdmin($connect); diff --git a/hwe/_admin2.php b/hwe/_admin2.php index 266e7fa4..fb10ca39 100644 --- a/hwe/_admin2.php +++ b/hwe/_admin2.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); if(Session::getUserGrade() < 5) { diff --git a/hwe/_admin4.php b/hwe/_admin4.php index 1d8e596b..2237f86f 100644 --- a/hwe/_admin4.php +++ b/hwe/_admin4.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); if(Session::getUserGrade() < 5) { diff --git a/hwe/_admin4_submit.php b/hwe/_admin4_submit.php index 7805bf37..ad859299 100644 --- a/hwe/_admin4_submit.php +++ b/hwe/_admin4_submit.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); if(Session::getUserGrade() < 5) { diff --git a/hwe/_admin5.php b/hwe/_admin5.php index 386d74b2..d3583c36 100644 --- a/hwe/_admin5.php +++ b/hwe/_admin5.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); if(Session::getUserGrade() < 5) { diff --git a/hwe/_admin5_submit.php b/hwe/_admin5_submit.php index 53b6b0a0..e89f90a6 100644 --- a/hwe/_admin5_submit.php +++ b/hwe/_admin5_submit.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); if(Session::getUserGrade() < 5) { diff --git a/hwe/_admin6.php b/hwe/_admin6.php index ab88f139..961d9da8 100644 --- a/hwe/_admin6.php +++ b/hwe/_admin6.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); if(Session::getUserGrade() < 5) { diff --git a/hwe/_admin7.php b/hwe/_admin7.php index 2d269108..5016bc70 100644 --- a/hwe/_admin7.php +++ b/hwe/_admin7.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); if(Session::getUserGrade() < 5) { diff --git a/hwe/_admin8.php b/hwe/_admin8.php index cfba5ce0..67d1dda4 100644 --- a/hwe/_admin8.php +++ b/hwe/_admin8.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); if(Session::getUserGrade() < 5) { diff --git a/hwe/_simul.php b/hwe/_simul.php index 09bbcd9d..ca9563dd 100644 --- a/hwe/_simul.php +++ b/hwe/_simul.php @@ -46,7 +46,7 @@ $tch2 = array_fill(0,11, ''); $dec = 0; $rice = 0; -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); increaseRefresh("시뮬", 2); diff --git a/hwe/a_bestGeneral.php b/hwe/a_bestGeneral.php index c355868c..e3b0c312 100644 --- a/hwe/a_bestGeneral.php +++ b/hwe/a_bestGeneral.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); increaseRefresh("명장일람", 2); diff --git a/hwe/a_genList.php b/hwe/a_genList.php index 6b9eeb87..52d7ecbe 100644 --- a/hwe/a_genList.php +++ b/hwe/a_genList.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); increaseRefresh("장수일람", 2); diff --git a/hwe/a_history.php b/hwe/a_history.php index 6e4c39af..82f1bc2f 100644 --- a/hwe/a_history.php +++ b/hwe/a_history.php @@ -5,7 +5,7 @@ include "lib.php"; include "func.php"; $yearmonth = $_POST['yearmonth']; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); increaseRefresh("연감", 5); diff --git a/hwe/a_kingdomList.php b/hwe/a_kingdomList.php index 36339280..ef1f24b3 100644 --- a/hwe/a_kingdomList.php +++ b/hwe/a_kingdomList.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); increaseRefresh("세력일람", 2); diff --git a/hwe/a_status.php b/hwe/a_status.php index 52fe1872..52a89bab 100644 --- a/hwe/a_status.php +++ b/hwe/a_status.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); increaseRefresh("세력도", 2); checkTurn($connect); diff --git a/hwe/b_auction.php b/hwe/b_auction.php index 74b87779..b10ab8b5 100644 --- a/hwe/b_auction.php +++ b/hwe/b_auction.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); increaseRefresh("거래장", 2); diff --git a/hwe/b_battleCenter.php b/hwe/b_battleCenter.php index 151da885..50d5ac28 100644 --- a/hwe/b_battleCenter.php +++ b/hwe/b_battleCenter.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); increaseRefresh("감찰부", 2); //전투 추진을 위해 갱신 diff --git a/hwe/b_betting.php b/hwe/b_betting.php index 5109048b..0109d7bc 100644 --- a/hwe/b_betting.php +++ b/hwe/b_betting.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); increaseRefresh("베팅장", 1); checkTurn($connect); diff --git a/hwe/b_chiefboard.php b/hwe/b_chiefboard.php index 23e0cef7..76b8cd9e 100644 --- a/hwe/b_chiefboard.php +++ b/hwe/b_chiefboard.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); increaseRefresh("기밀실", 1); diff --git a/hwe/b_chiefcenter.php b/hwe/b_chiefcenter.php index a437616f..aa0eb10f 100644 --- a/hwe/b_chiefcenter.php +++ b/hwe/b_chiefcenter.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); increaseRefresh("사령부", 1); diff --git a/hwe/b_currentCity.php b/hwe/b_currentCity.php index cb07f9fe..6c5c639f 100644 --- a/hwe/b_currentCity.php +++ b/hwe/b_currentCity.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); increaseRefresh("현재도시", 1); diff --git a/hwe/b_dipcenter.php b/hwe/b_dipcenter.php index 23b2162f..6c5cb796 100644 --- a/hwe/b_dipcenter.php +++ b/hwe/b_dipcenter.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); increaseRefresh("내무부", 1); diff --git a/hwe/b_diplomacy.php b/hwe/b_diplomacy.php index fcbac195..e3725c64 100644 --- a/hwe/b_diplomacy.php +++ b/hwe/b_diplomacy.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); increaseRefresh("중원정보", 1); diff --git a/hwe/b_genList.php b/hwe/b_genList.php index e81d98b8..af8451da 100644 --- a/hwe/b_genList.php +++ b/hwe/b_genList.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); increaseRefresh("암행부", 2); diff --git a/hwe/b_myBossInfo.php b/hwe/b_myBossInfo.php index 819aa453..9e9f4e9a 100644 --- a/hwe/b_myBossInfo.php +++ b/hwe/b_myBossInfo.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); increaseRefresh("인사부", 1); //훼섭 추방을 위해 갱신 diff --git a/hwe/b_myCityInfo.php b/hwe/b_myCityInfo.php index 6157906f..4a5cab03 100644 --- a/hwe/b_myCityInfo.php +++ b/hwe/b_myCityInfo.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); increaseRefresh("세력도시", 1); diff --git a/hwe/b_myGenInfo.php b/hwe/b_myGenInfo.php index 433eb081..5c19cb7b 100644 --- a/hwe/b_myGenInfo.php +++ b/hwe/b_myGenInfo.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); increaseRefresh("세력장수", 1); diff --git a/hwe/b_myKingdomInfo.php b/hwe/b_myKingdomInfo.php index fe5a85d0..e3d08293 100644 --- a/hwe/b_myKingdomInfo.php +++ b/hwe/b_myKingdomInfo.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); increaseRefresh("세력정보", 1); diff --git a/hwe/b_myPage.php b/hwe/b_myPage.php index 8c2fbad2..e3546aa7 100644 --- a/hwe/b_myPage.php +++ b/hwe/b_myPage.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); increaseRefresh("내정보", 1); diff --git a/hwe/b_nationboard.php b/hwe/b_nationboard.php index 6b78b1e6..80f0a7e0 100644 --- a/hwe/b_nationboard.php +++ b/hwe/b_nationboard.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); increaseRefresh("회의실", 1); diff --git a/hwe/b_nationrule.php b/hwe/b_nationrule.php index 5ce89c6f..99fb83e5 100644 --- a/hwe/b_nationrule.php +++ b/hwe/b_nationrule.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); increaseRefresh("국법", 1); ?> diff --git a/hwe/b_tournament.php b/hwe/b_tournament.php index bc9b9d97..50407f85 100644 --- a/hwe/b_tournament.php +++ b/hwe/b_tournament.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); increaseRefresh("토너먼트", 1); checkTurn($connect); diff --git a/hwe/b_troop.php b/hwe/b_troop.php index eb6636e7..5985f18a 100644 --- a/hwe/b_troop.php +++ b/hwe/b_troop.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); increaseRefresh("부대편성", 1); diff --git a/hwe/c_auction.php b/hwe/c_auction.php index 64aeebd4..8592da3f 100644 --- a/hwe/c_auction.php +++ b/hwe/c_auction.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); increaseRefresh("입찰", 1); diff --git a/hwe/c_betting.php b/hwe/c_betting.php index d5a49658..401eacb7 100644 --- a/hwe/c_betting.php +++ b/hwe/c_betting.php @@ -8,7 +8,7 @@ include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); increaseRefresh("베팅", 1); diff --git a/hwe/c_chiefboard.php b/hwe/c_chiefboard.php index a7df2564..515f5a6c 100644 --- a/hwe/c_chiefboard.php +++ b/hwe/c_chiefboard.php @@ -6,7 +6,7 @@ include "func.php"; // $title, $msg, $num //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); if(getBlockLevel() != 1 && getBlockLevel() != 3) { diff --git a/hwe/c_dipcenter.php b/hwe/c_dipcenter.php index f216c1d0..5ca329b1 100644 --- a/hwe/c_dipcenter.php +++ b/hwe/c_dipcenter.php @@ -6,7 +6,7 @@ include "func.php"; // $btn, $msg, $scoutmsg, $rate, $bill, $secretlimit //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); $query = "select no,nation,level from general where owner='{$_SESSION['userID']}'"; diff --git a/hwe/c_double.php b/hwe/c_double.php index 4a6ee106..e06b815b 100644 --- a/hwe/c_double.php +++ b/hwe/c_double.php @@ -6,7 +6,7 @@ include "func.php"; // $turn, $command, $cost, $name, $nationname, $note, $double, $third, $fourth //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); if($command < 0) { $command = 0; } diff --git a/hwe/c_myBossInfo.php b/hwe/c_myBossInfo.php index a18adcb6..0b52fe27 100644 --- a/hwe/c_myBossInfo.php +++ b/hwe/c_myBossInfo.php @@ -6,7 +6,7 @@ include "func.php"; // $btn, $level, $genlist, $outlist //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); $query = "select startyear,year,month from game limit 1"; diff --git a/hwe/c_nationboard.php b/hwe/c_nationboard.php index 81072196..1dd33486 100644 --- a/hwe/c_nationboard.php +++ b/hwe/c_nationboard.php @@ -6,7 +6,7 @@ include "func.php"; // $title, $msg, $num //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); if(getBlockLevel() != 1 && getBlockLevel() != 3) { diff --git a/hwe/c_nationrule.php b/hwe/c_nationrule.php index 516184b6..467a2e70 100644 --- a/hwe/c_nationrule.php +++ b/hwe/c_nationrule.php @@ -6,7 +6,7 @@ include "func.php"; // $msg //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); $query = "select no,nation from general where owner='{$_SESSION['userID']}'"; diff --git a/hwe/c_tournament.php b/hwe/c_tournament.php index 0c14daf7..9bdf425f 100644 --- a/hwe/c_tournament.php +++ b/hwe/c_tournament.php @@ -6,7 +6,7 @@ include "func.php"; // $btn, $msg //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); $query = "select tournament,phase,tnmt_type,develcost from game limit 1"; diff --git a/hwe/c_troop.php b/hwe/c_troop.php index 3a6deca2..052e90b9 100644 --- a/hwe/c_troop.php +++ b/hwe/c_troop.php @@ -6,12 +6,8 @@ include "func.php"; // $btn, $name, $troop //로그인 검사 -$session = Session::requireLogin()->loginGame()->setReadOnly(); +$session = Session::requireGameLogin()->setReadOnly(); $generalID = $session->$generalID; -if(!$generalID){ - header('Location:..'); - die(); -} $db = DB::db(); diff --git a/hwe/c_vacation.php b/hwe/c_vacation.php index 4c545b7d..d2e6e998 100644 --- a/hwe/c_vacation.php +++ b/hwe/c_vacation.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); $query = "select killturn from game limit 1"; diff --git a/hwe/c_vote.php b/hwe/c_vote.php index 57ea6de9..71c44fa2 100644 --- a/hwe/c_vote.php +++ b/hwe/c_vote.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); $query = "select develcost,vote,votecomment from game limit 1"; diff --git a/hwe/commandlist.php b/hwe/commandlist.php index aad8bd0b..934b1951 100644 --- a/hwe/commandlist.php +++ b/hwe/commandlist.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -$session = Session::Instance()->loginGame()->setReadOnly(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); diff --git a/hwe/d_ally.php b/hwe/d_ally.php index 51e4f184..b9887c08 100644 --- a/hwe/d_ally.php +++ b/hwe/d_ally.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); //$when = ($when + 1) * 2; diff --git a/hwe/d_cancel.php b/hwe/d_cancel.php index 3db235c5..2da8c2b8 100644 --- a/hwe/d_cancel.php +++ b/hwe/d_cancel.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); $query = "select year,month from game limit 1"; diff --git a/hwe/d_cease.php b/hwe/d_cease.php index cb58e8f8..0acfff42 100644 --- a/hwe/d_cease.php +++ b/hwe/d_cease.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); $query = "select year,month from game limit 1"; diff --git a/hwe/d_merge.php b/hwe/d_merge.php index 7af5b389..9b14695c 100644 --- a/hwe/d_merge.php +++ b/hwe/d_merge.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); $query = "select year,month from game limit 1"; diff --git a/hwe/d_scout.php b/hwe/d_scout.php index e7e1fd82..a44a4f2a 100644 --- a/hwe/d_scout.php +++ b/hwe/d_scout.php @@ -10,7 +10,7 @@ include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); $query = "select startyear,year,month,killturn from game limit 1"; diff --git a/hwe/d_surrender.php b/hwe/d_surrender.php index 7670c963..2610b316 100644 --- a/hwe/d_surrender.php +++ b/hwe/d_surrender.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); $query = "select year,month from game limit 1"; diff --git a/hwe/func.php b/hwe/func.php index d55df440..fbba4d57 100644 --- a/hwe/func.php +++ b/hwe/func.php @@ -1208,12 +1208,9 @@ function cutDay($date, int $turnterm) { } function increaseRefresh($type="", $cnt=1) { - $session = Session::Instance(); - $generalID = $session->generalID; - if(!$generalID){ - $session->loginGame(); - } + $session = Session::requireGameLogin(); $generalID = $session->generalID; + $date = date('Y-m-d H:i:s'); DB::db()->query('UPDATE game set refresh=refresh+%i where `no`=1', $cnt); @@ -1222,7 +1219,7 @@ function increaseRefresh($type="", $cnt=1) { DB::db()->query('UPDATE general set `lastrefresh`=%s_date, `con`=`con`+%i_cnt, `connect`=`connect`+%i_cnt, refcnt=refcnt+%i_cnt, refresh=refresh+%i_cnt where `no`=%i_no',[ 'date'=>$date, 'cnt'=>$cnt, - 'owner'->Session::Instance()->generalID + 'owner'->$session->generalID ]); } @@ -1266,7 +1263,6 @@ function increaseRefresh($type="", $cnt=1) { if(isset($_SERVER[$x])) $str .= "//{$x}:{$_SERVER[$x]}"; } if($str != "") { - $session = Session::Instance(); file_put_contents( "logs/_{$date2}_ipcheck.txt", sprintf( diff --git a/hwe/func_legacy.php b/hwe/func_legacy.php index bbba9bd5..56438396 100644 --- a/hwe/func_legacy.php +++ b/hwe/func_legacy.php @@ -1,18 +1,6 @@ loginGame()->setReadOnly(); - $generalID = $session->generalID; - if($generalID){ - return $generalID; - } - header('Locatoin:..'); - die(); -} - - function printLimitMsg($turntime) { echo " diff --git a/hwe/map_history.php b/hwe/map_history.php index 2cfb5630..edcb555c 100644 --- a/hwe/map_history.php +++ b/hwe/map_history.php @@ -17,7 +17,7 @@ if(!$year || !$month) { include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); $query = "select map from history where year='$year' and month='$month'"; diff --git a/hwe/preprocessing.php b/hwe/preprocessing.php index cefedf47..989ec556 100644 --- a/hwe/preprocessing.php +++ b/hwe/preprocessing.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); increaseRefresh("턴입력", 1); diff --git a/hwe/processing.php b/hwe/processing.php index d4e1c92b..ecb476d2 100644 --- a/hwe/processing.php +++ b/hwe/processing.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); $count = sizeof($turn); diff --git a/hwe/turn.php b/hwe/turn.php index ccee693b..1b04519a 100644 --- a/hwe/turn.php +++ b/hwe/turn.php @@ -6,7 +6,7 @@ include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); increaseRefresh("턴반복", 1); diff --git a/hwe/turn_pop_core.php b/hwe/turn_pop_core.php index 30af6fd5..4b7aeb13 100644 --- a/hwe/turn_pop_core.php +++ b/hwe/turn_pop_core.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); $query = "select no from general where owner='{$_SESSION['userID']}'"; diff --git a/hwe/turn_push_core.php b/hwe/turn_push_core.php index 9804b6dc..04e4708c 100644 --- a/hwe/turn_push_core.php +++ b/hwe/turn_push_core.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; //로그인 검사 -CheckLoginWithGeneralID(); +$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); $query = "select no from general where owner='{$_SESSION['userID']}'"; diff --git a/src/sammo/Session.php b/src/sammo/Session.php index f3d66b52..15bf5c84 100644 --- a/src/sammo/Session.php +++ b/src/sammo/Session.php @@ -187,7 +187,6 @@ class Session { } $serverID = UniqueConst::$serverID; - $db = DB::db(); $loginDate = $this->get($serverID.static::GAME_KEY_DATE); $generalID = $this->get($serverID.static::GAME_KEY_GENERAL_ID); @@ -197,9 +196,9 @@ class Session { $now = time(); if( $generalID && $generalName && $loginDate && $deadTime - && $loginDate + 600 > $now && $deadTime > $now + && $loginDate + 1800 > $now && $deadTime > $now ){ - //로그인 정보는 10분간 유지한다. + //로그인 정보는 30분간 유지한다. if($result !== null){ $result = true; } @@ -210,6 +209,8 @@ class Session { $this->logoutGame(); } + $db = DB::db(); + $general = $db->queryFirstRow( 'SELECT `no`, `name`, `killturn`, `turntime` from general where `owner` = %i', $userID