From b3e621fbfd11b0c879d2e00188d1c4bb1a9eefb3 Mon Sep 17 00:00:00 2001 From: hide_d Date: Thu, 5 Apr 2018 01:34:56 +0900 Subject: [PATCH] =?UTF-8?q?increaseRefresh=20=EC=88=98=EC=A0=95=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=EB=A7=88=EB=8B=A4=20Session=20=EB=B0=9B?= =?UTF-8?q?=EC=95=84=EC=98=A4=EB=8A=94=20=EC=BD=94=EB=93=9C=EA=B0=80=20?= =?UTF-8?q?=EC=9E=98=EB=AA=BB=20=EB=90=9C=20=EA=B2=BD=EC=9A=B0=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/_119.php | 14 +- hwe/_119_b.php | 2 +- hwe/_simul.php | 2 +- hwe/a_bestGeneral.php | 1 + hwe/func.php | 22 +- hwe/func_legacy.php | 9 +- hwe/func_npc.php | 188 ---------- hwe/func_regnpc.php | 694 ------------------------------------ hwe/index.php | 8 +- hwe/install.php | 4 +- hwe/install_db.php | 8 +- hwe/j_basic_info.php | 2 +- hwe/j_build_conf.php | 19 - hwe/j_get_new_msg.php | 6 +- hwe/j_init_scenario.php | 42 --- hwe/j_init_settings.php | 51 --- hwe/j_install.php | 2 +- hwe/j_install_db.php | 2 +- hwe/j_load_scenarios.php | 2 +- hwe/j_map.php | 10 +- hwe/j_msg_contact_list.php | 2 +- hwe/j_msg_decide_opt.php | 2 +- hwe/j_server_basic_info.php | 11 +- hwe/j_turn.php | 2 +- hwe/select_npc.php | 20 +- hwe/selection.php | 2 +- 26 files changed, 71 insertions(+), 1056 deletions(-) delete mode 100644 hwe/func_regnpc.php delete mode 100644 hwe/j_build_conf.php delete mode 100644 hwe/j_init_scenario.php delete mode 100644 hwe/j_init_settings.php diff --git a/hwe/_119.php b/hwe/_119.php index 44d592ba..ba0dd858 100644 --- a/hwe/_119.php +++ b/hwe/_119.php @@ -5,9 +5,9 @@ include "lib.php"; include "func.php"; $connect=dbConn(); - -if(Session::getUserGrade() < 5) { - echo " +$session = Session::requireGameLogin()->setReadOnly(); +if($session->userGrade < 5) { + ?> @@ -17,12 +17,10 @@ if(Session::getUserGrade() < 5) { 관리자가 아닙니다.
-"; - echo banner(); - echo " + -"; - + +setReadOnly(); if(Session::getUserGrade() < 5){ //echo ""; echo '_119.php';//TODO:debug all and replace diff --git a/hwe/_simul.php b/hwe/_simul.php index ca9563dd..0a51ab75 100644 --- a/hwe/_simul.php +++ b/hwe/_simul.php @@ -4,6 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; +$session = Session::requireGameLogin()->setReadOnly(); //로그인 검사 @@ -46,7 +47,6 @@ $tch2 = array_fill(0,11, ''); $dec = 0; $rice = 0; -$session = Session::requireGameLogin()->setReadOnly(); $connect = dbConn(); increaseRefresh("시뮬", 2); diff --git a/hwe/a_bestGeneral.php b/hwe/a_bestGeneral.php index e3b0c312..52ecb5b2 100644 --- a/hwe/a_bestGeneral.php +++ b/hwe/a_bestGeneral.php @@ -5,6 +5,7 @@ include "lib.php"; include "func.php"; //로그인 검사 $session = Session::requireGameLogin()->setReadOnly(); + $connect = dbConn(); increaseRefresh("명장일람", 2); diff --git a/hwe/func.php b/hwe/func.php index fbba4d57..af17606c 100644 --- a/hwe/func.php +++ b/hwe/func.php @@ -1208,19 +1208,25 @@ function cutDay($date, int $turnterm) { } function increaseRefresh($type="", $cnt=1) { - $session = Session::requireGameLogin(); + //FIXME: 로그인, 비로그인 시 처리가 명확하지 않음 + $session = Session::Instance(); $generalID = $session->generalID; $date = date('Y-m-d H:i:s'); - DB::db()->query('UPDATE game set refresh=refresh+%i where `no`=1', $cnt); + $db = DB::db(); + $db->update('game', [ + 'refresh'=>$db->sqleval('refresh+%i', $cnt) + ], true); - if(!Util::array_get($_SESSION['userID'], null)) { - 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->generalID - ]); + if($generalID) { + $db->update('general', [ + 'lastrefresh'=>$date, + 'con'=>$db->sqleval('con + %i', $cnt), + 'connect'=>$db->sqleval('connect + %i', $cnt), + 'refcnt'=>$db->sqleval('refcnt + %i', $cnt), + 'refresh'=>$db->sqleval('refresh + %i', $cnt) + ], 'no=%i', $generalID); } $date = date('Y_m_d H:i:s'); diff --git a/hwe/func_legacy.php b/hwe/func_legacy.php index 56438396..dd933ae9 100644 --- a/hwe/func_legacy.php +++ b/hwe/func_legacy.php @@ -2,24 +2,23 @@ namespace sammo; function printLimitMsg($turntime) { - echo " + //FIXME: template로 이동. +?> 접속제한 -"; -echo " -접속 제한중입니다. 1턴 이내에 너무 많은 갱신을 하셨습니다. (다음 접속 가능 시각 : {$turntime})
+접속 제한중입니다. 1턴 이내에 너무 많은 갱신을 하셨습니다. (다음 접속 가능 시각 : )
(자신의 턴이 되면 다시 접속 가능합니다. 당신의 건강을 위해 잠시 쉬어보시는 것은 어떨까요? ^^)
-"; +id; - } - if($affinity == 0 || $fiction == 1) { $affinity = rand() % 150 + 1; } - if($life == 1) { $bornyear = 160; $deadyear = 300; } - if($init != 0 && $startyear > $bornyear+14 && $startyear <= $deadyear) { - if($deadyear <= $startyear+3) $deadyear += 5; - - $turntime = getRandTurn($turnterm); - if($personal != "-") { $personal = CharCall($personal); } - else { $personal = rand() % 10; } - if($fiction == 1) { $special = SpecCall("-"); } - else { $special = SpecCall($special); } - if($special >= 40) { $special2 = $special; $special = 0; } - else { $special2 = 0; } - if($picture == 0) { $picture = 1001 + rand() % 400; } - if($picture == -1) { $picture = 'default'; } - $picture = "{$picture}.jpg"; - if($img < 3) { $picture = 'default.jpg'; } - $age = $startyear - $bornyear; - $specage = $age + 1; - $specage2 = $age + 1; - $killturn = ($deadyear - $startyear) * 12 + (rand() % 12); - $experience = $age * 100; - $dedication = $age * 100; - if($nation != 0 && $level == 0) $level = 1; - - } elseif($year == $bornyear+14 && $year < $deadyear) { - $count = DB::db()->queryFirstField('SELECT count(`no`) from `general` where `name` = %s' , $name); - if ($count == 0) { - $turntime = getRandTurn($turnterm); - if ($personal != "-") { - $personal = CharCall($personal); - } else { - $personal = rand() % 10; - } - if ($fiction == 1) { - $special = SpecCall("-"); - } else { - $special = SpecCall($special); - } - if ($special >= 40) { - $special2 = $special; - $special = 0; - } else { - $special2 = 0; - } - if ($picture == 0) { - $picture = 1001 + rand() % 400; - } - $picture = "{$picture}.jpg"; - if ($img < 3) { - $picture = 'default.jpg'; - } - $age = $year - $bornyear; - $specage = $age + 1; - $specage2 = $age + 1; - $killturn = ($deadyear - $year) * 12 + (rand() % 12); - $experience = $age * 100; - $dedication = $age * 100; - $nation = 0; - $level = 0; - - $alllog[0] = "●1월:$name(이)가 성인이 되어 등장했습니다."; - } - else{ - return; - } - } - else{ - return; - } - - //장수 - DB::db()->insert('general',[ - 'npcid'=>$gencount, - 'npc'=>$npc, - 'npc_org'=>$npc, - 'affinity'=>$affinity, - 'name'=>$name, - 'picture'=>$picture, - 'nation'=>$nation, - 'city'=>$city, - 'leader'=>$leader, - 'power'=>$power, - 'intel'=>$intel, - 'experience'=>$experience, - 'dedication'=>$dedication, - 'level'=>$level, - 'gold'=>1000, - 'rice'=>1000, - 'crew'=>0, - 'crewtype'=>0, - 'train'=>0, - 'atmos'=>0, - 'weap'=>0, - 'book'=>0, - 'horse'=>0, - 'turntime'=>$turntime, - 'killturn'=>$killturn, - 'age'=>$age, - 'belong'=>1, - 'personal'=>$personal, - 'special'=>$special, - 'specage'=>$specage, - 'special2'=>$special2, - 'specage2'=>$specage2, - 'npcmsg'=>$msg, - 'makelimit'=>0, - 'bornyear'=>$bornyear, - 'deadyear'=>$deadyear - ]); - pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']); -} - function SetDevelop($connect, $genType, $no, $city, $tech) { $query = "select rate,pop/pop2*100 as po,comm/comm2*100 as co,def/def2*100 as de,wall/wall2*100 as wa,secu/secu2*100 as se,agri/agri2*100 as ag from city where city='$city'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); @@ -1068,44 +918,6 @@ function processAI($connect, $no) { //종전하기, 지급율 //$command = $fourth * 100000000 + $type * 100000 + $crew * 100 + 11; -function RegNation($name, $color, $gold, $rice, $scoutmsg, $tech, $gencount, $type, $level) { - //TODO: 삭제 - $type = NationCharCall($type); - $totaltech = $tech * $gencount; - - DB::db()->insert('nation', [ - 'name'=>$name, - 'color'=>$color, - 'gold'=>$gold, - 'rice'=>$rice, - 'bill'=>100, - 'rate'=>15, - 'scout'=>0, - 'war'=>0, - 'tricklimit'=>24, - 'surlimit'=>72, - 'scoutmsg'=>$scoutmsg, - 'tech'=>$tech, - 'totaltech'=>$totaltech, - 'type'=>$type, - 'level'=>$level, - 'gennum'=>$gencount - ]); -} - -function RegCity($nation, $name, $cap=0) { - //TODO: 삭제 - $city = CityConst::byName($name)->id; - DB::db()->update('city', [ - 'nation'=>$nation, - ], 'city=%i',$city); - - if($cap > 0){ - DB::db()->update('nation', ['capital'=>city], 'nation = %i', $nation); - } - refreshNationStaticInfo(); -} - function Promotion($connect, $nation, $level) { $lv = getNationChiefLevel($level); diff --git a/hwe/func_regnpc.php b/hwe/func_regnpc.php deleted file mode 100644 index 06a39515..00000000 --- a/hwe/func_regnpc.php +++ /dev/null @@ -1,694 +0,0 @@ - 0) { - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1492, 123, "가화",$img,1492, 0, "-", 50, 66, 40, 0, 176, 224, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1493, 999, "건석",$img,1493, 0, "-", 21, 12, 61, 0, 155, 189, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1494, 999, "견씨",$img,1494, 0, "-", 35, 24, 58, 0, 182, 221, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1495, 40, "견홍",$img,1495, 0, "-", 76, 72, 66, 0, 224, 272, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1496, 120, "고담",$img,1496, 0, "-", 33, 21, 69, 0, 203, 244, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1497, 101, "고유",$img,1497, 0, "-", 56, 44, 73, 0, 174, 263, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1498, 132, "곽마",$img,1498, 0, "-", 68, 71, 49, 0, 239, 280, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1499, 39, "관구수",$img,1499, 0, "-", 58, 63, 35, 0, 206, 265, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1500, 39, "관구전",$img,1500, 0, "-", 63, 58, 68, 0, 224, 255, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1501, 999, "관로",$img,1501, 0, "-", 62, 21, 75, 0, 191, 256, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1502, 65, "관정",$img,1502, 0, "-", 35, 50, 73, 0, 158, 199, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1503, 137, "교수",$img,1503, 0, "-", 67, 69, 39, 0, 143, 195, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1504, 33, "구건",$img,1504, 0, "-", 43, 56, 69, 0, 239, 272, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1505, 41, "구본",$img,1505, 0, "-", 52, 41, 70, 0, 232, 269, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1506, 12, "구성",$img,1506, 0, "-", 56, 71, 31, 0, 157, 187, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1507, 21, "국연",$img,1507, 0, "-", 52, 21, 71, 0, 160, 219, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1508, 99, "국의",$img,1508, 0, "-", 83, 79, 50, 0, 146, 191, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1509, 34, "금의",$img,1509, 0, "-", 18, 40, 63, 0, 177, 218, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1510, 76, "나헌",$img,1510, 0, "-", 86, 67, 75, 0, 218, 270, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1511, 999, "남두",$img,1511, 0, "-", 35, 25, 54, 0, 130, 200, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1512, 54, "냉포",$img,1512, 0, "-", 70, 82, 69, 0, 176, 214, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1513, 124, "노숙2",$img,1513, 0, "-", 70, 55, 76, 0, 208, 274, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1514, 42, "누규",$img,1514, 0, "-", 54, 19, 88, 0, 143, 212, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1515, 6, "누반",$img,1515, 0, "-", 65, 76, 39, 0, 178, 207, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1516, 130, "누현",$img,1516, 0, "-", 23, 20, 68, 0, 223, 275, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1517, 40, "당균",$img,1517, 0, "-", 33, 19, 81, 0, 229, 264, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1518, 32, "당빈",$img,1518, 0, "-", 70, 74, 62, 0, 235, 294, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1519, 999, "대교",$img,1519, 0, "-", 42, 10, 54, 0, 177, 235, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1520, 28, "대릉",$img,1520, 0, "-", 64, 75, 45, 0, 199, 258, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1521, 129, "동조",$img,1521, 0, "-", 16, 15, 51, 0, 221, 281, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1522, 114, "등수",$img,1522, 0, "-", 35, 20, 44, 0, 228, 288, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1523, 50, "마막",$img,1523, 0, "-", 22, 17, 5, 0, 221, 265, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1524, 116, "만욱",$img,1524, 0, "-", 20, 18, 66, 0, 240, 272, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1525, 120, "맹종",$img,1525, 0, "-", 48, 48, 67, 0, 216, 271, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1526, 38, "문호",$img,1526, 0, "-", 65, 74, 45, 0, 227, 279, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1527, 999, "미씨",$img,1527, 0, "-", 59, 15, 68, 0, 176, 208, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1528, 39, "반림",$img,1528, 0, "-", 66, 79, 8, 0, 168, 225, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1529, 129, "반장",$img,1529, 0, "-", 77, 78, 69, 0, 177, 222, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1530, 94, "방열",$img,1530, 0, "-", 58, 82, 28, 0, 153, 190, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1531, 55, "방희",$img,1531, 0, "-", 59, 38, 69, 0, 153, 218, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1532, 30, "배수",$img,1532, 0, "-", 10, 11, 77, 0, 223, 271, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1533, 8, "번능",$img,1533, 0, "-", 70, 61, 47, 0, 158, 194, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1534, 999, "번씨",$img,1534, 0, "-", 32, 17, 45, 0, 176, 220, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1535, 49, "보도근",$img,1535, 0, "-", 64, 73, 50, 0, 170, 233, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1536, 129, "보천",$img,1536, 0, "-", 68, 60, 72, 0, 222, 272, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1537, 121, "보협",$img,1537, 0, "-", 73, 53, 75, 0, 216, 264, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1538, 28, "부하",$img,1538, 0, "-", 44, 36, 85, 0, 209, 255, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1539, 26, "비요",$img,1539, 0, "-", 70, 65, 73, 0, 192, 228, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1540, 31, "사마주",$img,1540, 0, "-", 63, 53, 62, 0, 227, 283, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1541, 41, "사찬",$img,1541, 0, "-", 61, 71, 54, 0, 215, 264, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1542, 128, "설후",$img,1542, 0, "-", 16, 14, 71, 0, 221, 271, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1543, 36, "성공영",$img,1543, 0, "-", 73, 58, 80, 0, 172, 220, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1544, 126, "성만",$img,1544, 0, "-", 61, 69, 66, 0, 225, 276, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1545, 999, "소교",$img,1545, 0, "-", 57, 23, 66, 0, 178, 218, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1546, 46, "소유",$img,1546, 0, "-", 51, 61, 48, 0, 164, 210, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1547, 31, "소제2",$img,1547, 0, "-", 22, 16, 78, 0, 224, 268, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1548, 126, "손교",$img,1548, 0, "-", 77, 60, 69, 0, 181, 219, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1549, 116, "손기",$img,1549, 0, "-", 62, 65, 52, 0, 227, 276, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1550, 999, "손상향",$img,1550, 0, "-", 72, 62, 42, 0, 193, 244, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1551, 125, "손익",$img,1551, 0, "-", 69, 75, 26, 0, 184, 204, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1552, 125, "손진",$img,1552, 0, "-", 64, 71, 48, 0, 234, 280, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1553, 123, "송겸",$img,1553, 0, "-", 61, 48, 44, 0, 175, 215, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1554, 85, "순심",$img,1554, 0, "-", 20, 21, 79, 0, 164, 208, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1555, 31, "순욱2",$img,1555, 0, "-", 10, 16, 77, 0, 225, 289, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1556, 31, "순의",$img,1556, 0, "-", 16, 11, 73, 0, 207, 281, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1557, 129, "시삭",$img,1557, 0, "-", 36, 66, 44, 0, 226, 268, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1558, 29, "신창",$img,1558, 0, "-", 51, 29, 46, 0, 210, 272, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1559, 999, "악신",$img,1559, 0, "-", 53, 12, 46, 0, 175, 228, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1560, 138, "악취",$img,1560, 0, "-", 56, 68, 58, 0, 157, 195, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1561, 138, "양강",$img,1561, 0, "-", 62, 70, 42, 0, 160, 199, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1562, 21, "양부",$img,1562, 0, "-", 68, 55, 85, 0, 178, 239, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1563, 72, "양서",$img,1563, 0, "-", 56, 62, 66, 0, 198, 260, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1564, 34, "양습",$img,1564, 0, "-", 67, 49, 73, 0, 168, 230, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1565, 16, "양앙",$img,1565, 0, "-", 65, 70, 39, 0, 172, 215, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1566, 17, "양임",$img,1566, 0, "-", 71, 78, 56, 0, 170, 215, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1567, 32, "양제",$img,1567, 0, "-", 69, 63, 71, 0, 226, 291, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1568, 33, "양조2",$img,1568, 0, "-", 65, 61, 67, 0, 223, 286, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1569, 48, "양추2",$img,1569, 0, "-", 66, 67, 61, 0, 172, 238, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1570, 140, "양홍",$img,1570, 0, "-", 19, 17, 76, 0, 152, 199, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1571, 31, "양혼",$img,1571, 0, "-", 60, 67, 63, 0, 220, 278, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1572, 123, "여거",$img,1572, 0, "-", 71, 58, 69, 0, 196, 256, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1573, 130, "여대",$img,1573, 0, "-", 83, 72, 70, 0, 161, 256, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1574, 136, "염상",$img,1574, 0, "-", 29, 27, 69, 0, 158, 199, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1575, 36, "염행",$img,1575, 0, "-", 70, 86, 38, 0, 159, 222, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1576, 73, "영수",$img,1576, 0, "-", 69, 70, 74, 0, 234, 264, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1577, 39, "오거",$img,1577, 0, "-", 49, 63, 32, 0, 151, 211, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1578, 126, "오경",$img,1578, 0, "-", 73, 60, 57, 0, 159, 203, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1579, 999, "오국태",$img,1579, 0, "-", 31, 11, 60, 0, 161, 222, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1580, 126, "오찬",$img,1580, 0, "-", 69, 41, 78, 0, 181, 245, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1581, 23, "온회",$img,1581, 0, "-", 42, 40, 78, 0, 178, 222, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1582, 21, "왕기2",$img,1582, 0, "-", 70, 66, 63, 0, 217, 281, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1583, 32, "왕도",$img,1583, 0, "-", 48, 44, 70, 0, 210, 269, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1584, 123, "왕돈",$img,1584, 0, "-", 60, 65, 41, 0, 198, 256, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1585, 34, "왕릉",$img,1585, 0, "-", 73, 60, 71, 0, 172, 251, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1586, 63, "왕문",$img,1586, 0, "-", 64, 67, 32, 0, 162, 205, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1587, 32, "왕상",$img,1587, 0, "-", 25, 19, 65, 0, 180, 268, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1588, 34, "왕숙",$img,1588, 0, "-", 35, 21, 80, 0, 195, 256, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1589, 33, "왕업",$img,1589, 0, "-", 32, 6, 46, 0, 220, 280, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1590, 35, "왕충",$img,1590, 0, "-", 42, 58, 21, 0, 152, 214, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1591, 1, "우보",$img,1591, 0, "-", 43, 63, 12, 0, 159, 192, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1592, 122, "우사",$img,1592, 0, "-", 70, 33, 79, 0, 217, 273, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1593, 138, "원요",$img,1593, 0, "-", 44, 42, 45, 0, 177, 206, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1594, 95, "원유",$img,1594, 0, "-", 57, 38, 73, 0, 150, 193, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1595, 31, "위관",$img,1595, 0, "-", 69, 45, 81, 0, 220, 291, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1596, 129, "위막",$img,1596, 0, "-", 58, 62, 60, 0, 221, 268, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1597, 55, "유괴",$img,1597, 0, "-", 75, 72, 66, 0, 165, 214, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1598, 129, "유략",$img,1598, 0, "-", 72, 68, 59, 0, 206, 260, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1599, 45, "유반",$img,1599, 0, "-", 74, 79, 48, 0, 168, 210, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1600, 29, "유복",$img,1600, 0, "-", 54, 50, 73, 0, 164, 208, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1601, 78, "유선2",$img,1601, 0, "-", 9, 21, 39, 0, 224, 264, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1602, 139, "유섭",$img,1602, 0, "-", 62, 79, 26, 0, 158, 190, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1603, 28, "유소",$img,1603, 0, "-", 66, 51, 73, 0, 195, 264, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1604, 128, "유승",$img,1604, 0, "-", 46, 69, 29, 0, 215, 258, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1605, 129, "유찬",$img,1605, 0, "-", 74, 75, 66, 0, 172, 255, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1606, 129, "유평",$img,1606, 0, "-", 65, 70, 67, 0, 218, 272, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1607, 138, "유훈",$img,1607, 0, "-", 51, 64, 50, 0, 163, 216, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1608, 48, "이감",$img,1608, 0, "-", 59, 67, 33, 0, 176, 211, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1609, 19, "이승",$img,1609, 0, "-", 13, 26, 32, 0, 201, 249, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1610, 22, "이통",$img,1610, 0, "-", 75, 84, 52, 0, 168, 211, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1611, 138, "이풍2",$img,1611, 0, "-", 72, 77, 50, 0, 158, 199, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1612, 20, "이풍3",$img,1612, 0, "-", 23, 25, 71, 0, 204, 254, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1613, 29, "장구",$img,1613, 0, "-", 69, 71, 47, 0, 201, 263, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1614, 21, "장기",$img,1614, 0, "-", 77, 35, 79, 0, 170, 223, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1615, 74, "장남",$img,1615, 0, "-", 71, 64, 38, 0, 187, 222, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1616, 100, "장막",$img,1616, 0, "-", 53, 52, 70, 0, 155, 195, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1617, 7, "장만성",$img,1617, 0, "-", 73, 83, 47, 0, 143, 184, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1618, 135, "장반",$img,1618, 0, "-", 56, 73, 66, 0, 227, 282, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1619, 78, "장빈",$img,1619, 0, "-", 30, 28, 67, 0, 216, 263, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1620, 124, "장승",$img,1620, 0, "-", 75, 68, 75, 0, 178, 244, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1621, 999, "장양2",$img,1621, 0, "-", 58, 50, 47, 0, 130, 184, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1622, 68, "장억",$img,1622, 0, "-", 82, 80, 54, 0, 190, 254, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1623, 75, "장준",$img,1623, 0, "-", 65, 67, 66, 0, 224, 263, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1624, 20, "장집",$img,1624, 0, "-", 31, 27, 74, 0, 196, 254, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1625, 39, "장특",$img,1625, 0, "-", 71, 53, 74, 0, 209, 265, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1626, 96, "저곡",$img,1626, 0, "-", 57, 53, 67, 0, 184, 204, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1627, 128, "전기",$img,1627, 0, "-", 51, 69, 55, 0, 231, 258, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1628, 23, "전만",$img,1628, 0, "-", 52, 74, 38, 0, 181, 235, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1629, 128, "전상",$img,1629, 0, "-", 5, 6, 11, 0, 208, 258, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1630, 130, "전역",$img,1630, 0, "-", 60, 62, 37, 0, 212, 265, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1631, 75, "전예",$img,1631, 0, "-", 80, 62, 83, 0, 171, 252, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1632, 64, "전해",$img,1632, 0, "-", 71, 63, 57, 0, 154, 199, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1633, 123, "정봉2",$img,1633, 0, "-", 67, 68, 52, 0, 198, 266, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1634, 22, "정의",$img,1634, 0, "-", 17, 3, 66, 0, 184, 220, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1635, 81, "제갈교",$img,1635, 0, "-", 55, 17, 77, 0, 204, 228, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1636, 40, "제갈서",$img,1636, 0, "-", 45, 43, 27, 0, 218, 286, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1637, 25, "조충",$img,1637, 0, "-", 14, 7, 80, 0, 196, 208, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1638, 121, "종리목",$img,1638, 0, "-", 84, 68, 75, 0, 214, 269, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1639, 22, "종육",$img,1639, 0, "-", 27, 11, 71, 0, 223, 263, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1640, 122, "좌혁",$img,1640, 0, "-", 60, 66, 51, 0, 232, 280, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1641, 36, "주령",$img,1641, 0, "-", 77, 70, 69, 0, 170, 236, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1642, 115, "주앙",$img,1642, 0, "-", 75, 64, 64, 0, 162, 195, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1643, 52, "주포",$img,1643, 0, "-", 59, 72, 12, 0, 191, 225, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1644, 11, "주흔",$img,1644, 0, "-", 67, 53, 77, 0, 159, 196, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1645, 140, "진기",$img,1645, 0, "-", 58, 67, 46, 0, 165, 198, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1646, 142, "진란",$img,1646, 0, "-", 65, 70, 43, 0, 157, 204, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1647, 25, "진랑",$img,1647, 0, "-", 57, 70, 38, 0, 192, 234, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1648, 12, "진응",$img,1648, 0, "-", 62, 69, 49, 0, 172, 208, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1649, 124, "진표",$img,1649, 0, "-", 62, 49, 74, 0, 204, 237, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1650, 999, "채염",$img,1650, 0, "-", 40, 22, 64, 0, 168, 237, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1651, 999, "초선",$img,1651, 0, "-", 66, 15, 72, 0, 176, 211, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1652, 135, "초이",$img,1652, 0, "-", 54, 65, 55, 0, 219, 266, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1653, 65, "추단",$img,1653, 0, "-", 63, 71, 36, 0, 148, 193, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1654, 999, "추씨",$img,1654, 0, "-", 36, 13, 54, 0, 165, 225, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1655, 71, "추정",$img,1655, 0, "-", 67, 65, 66, 0, 144, 193, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1656, 145, "파재",$img,1656, 0, "-", 69, 75, 52, 0, 145, 184, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1657, 22, "포신",$img,1657, 0, "-", 78, 60, 83, 0, 152, 192, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1658, 114, "하식",$img,1658, 0, "-", 18, 38, 29, 0, 230, 284, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1659, 36, "하안",$img,1659, 0, "-", 6, 27, 72, 0, 190, 249, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1660, 999, "하후씨",$img,1660, 0, "-", 29, 16, 47, 0, 186, 249, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1661, 5, "학맹",$img,1661, 0, "-", 57, 66, 41, 0, 156, 197, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1662, 98, "한거자",$img,1662, 0, "-", 53, 59, 30, 0, 158, 200, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1663, 19, "한덕",$img,1663, 0, "-", 62, 79, 24, 0, 171, 228, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1664, 140, "한윤",$img,1664, 0, "-", 27, 24, 68, 0, 155, 197, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1665, 999, "허소",$img,1665, 0, "-", 53, 27, 60, 0, 150, 195, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1666, 30, "호열",$img,1666, 0, "-", 77, 69, 76, 0, 225, 272, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1667, 76, "호제",$img,1667, 0, "-", 58, 42, 68, 0, 207, 264, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1668, 149, "호진",$img,1668, 0, "-", 65, 77, 13, 0, 146, 190, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1669, 29, "호질",$img,1669, 0, "-", 73, 50, 75, 0, 192, 250, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1670, 7, "환계",$img,1670, 0, "-", 12, 25, 67, 0, 156, 221, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1671, 56, "황숭",$img,1671, 0, "-", 68, 64, 74, 0, 208, 263, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1672, 999, "황승언",$img,1672, 0, "-", 68, 17, 81, 0, 165, 222, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1673, 999, "황월영",$img,1673, 0, "-", 58, 14, 75, 0, 186, 235, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1674, 45, "황조",$img,1674, 0, "-", 74, 65, 57, 0, 148, 208, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1675, 48, "후선",$img,1675, 0, "-", 56, 66, 35, 0, 175, 228, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1676, 8, "휴고",$img,1676, 0, "-", 61, 72, 40, 0, 151, 199, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1677, 98, "휴원진",$img,1677, 0, "-", 53, 63, 38, 0, 155, 200, "-", "-"); - RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1678, 22, "희지재",$img,1678, 0, "-", 24, 5, 86, 0, 157, 194, "-", "-"); - } -} diff --git a/hwe/index.php b/hwe/index.php index 7b608db0..a8234939 100644 --- a/hwe/index.php +++ b/hwe/index.php @@ -20,6 +20,10 @@ $me = $db->queryFirstRow( $session->userID ); +//턴 실행. +$connect = dbConn(); +checkTurn($connect); + //그새 사망이면 if($me === null) { $session->logoutGame(); @@ -28,9 +32,7 @@ if($me === null) { } $session->setReadOnly(); -//턴 실행. -$connect = dbConn(); -checkTurn($connect); + if($me['newmsg'] == 1 && $me['newvote'] == 1) { $query = "update general set newmsg=0,newvote=0 where owner='{$_SESSION['userID']}'"; diff --git a/hwe/install.php b/hwe/install.php index 2e1f749c..bd06e213 100644 --- a/hwe/install.php +++ b/hwe/install.php @@ -7,7 +7,9 @@ include "func.php"; if(!class_exists('\sammo\DB')){ header('Location:install_db.php'); } -if(Session::getUserGrade(true) < 5){ + +$session = Session::requireLogin(); +if($session->userGrade < 5){ die('관리자 아님'); } diff --git a/hwe/install_db.php b/hwe/install_db.php index 5fab35f3..aec64d53 100644 --- a/hwe/install_db.php +++ b/hwe/install_db.php @@ -4,10 +4,12 @@ namespace sammo; include "lib.php"; include "func.php"; -if(Session::getUserGrade(true) < 5){ +$session = Session::requireLogin(); + +if($session->userGrade < 5){ die('관리자 아님'); } -if(Session::getUserGrade(true) == 5){ +if($session->userGrade == 5){ die('DB 리셋 권한을 가지고 있지 않습니다.'); } @@ -39,7 +41,7 @@ if(Session::getUserGrade(true) == 5){
- +
diff --git a/hwe/j_basic_info.php b/hwe/j_basic_info.php index b2d8fd8e..b5b64a9b 100644 --- a/hwe/j_basic_info.php +++ b/hwe/j_basic_info.php @@ -8,7 +8,7 @@ $result = [ "myNationID"=>null, "isChief"=>false ]; -$session = Session::Instance()->loginGame()->setReadOnly(); +$session = Session::requireGameLogin([])->setReadOnly(); $generalID = $session->generalID; diff --git a/hwe/j_build_conf.php b/hwe/j_build_conf.php deleted file mode 100644 index 6a7751f7..00000000 --- a/hwe/j_build_conf.php +++ /dev/null @@ -1,19 +0,0 @@ -false, - 'reason'=>'이미 설정 파일이 존재합니다.' - ]); -} - diff --git a/hwe/j_get_new_msg.php b/hwe/j_get_new_msg.php index ec96698f..cb93913c 100644 --- a/hwe/j_get_new_msg.php +++ b/hwe/j_get_new_msg.php @@ -4,11 +4,9 @@ namespace sammo; include('lib.php'); include('func.php'); +$session = Session::requireGameLogin([])->setReadOnly(); - -$generalID = Session::Instance()->generalID; - -session_write_close(); // 이제 세션 안 쓴다 +$generalID = $session->generalID; $jsonPost = WebUtil::parseJsonPost(); diff --git a/hwe/j_init_scenario.php b/hwe/j_init_scenario.php deleted file mode 100644 index 7c21455e..00000000 --- a/hwe/j_init_scenario.php +++ /dev/null @@ -1,42 +0,0 @@ -
디렉토리의 퍼미션을 707로 주십시요",""); -//@fwrite($file,"
디렉토리의 퍼미션을 707로 주십시요",""); -@fclose($file); -@mkdir("data",0707); -@chmod("data",0707); -//@chmod("d_setting/DB.php",0707); - -$temp=MYDB_fetch_array(MYDB_query("select count(*) from general where level = '1'", $connect)); - -MYDB_close($connect); - -//echo ""; -echo 'install2.php';//TODO:debug all and replace - -// 관리자 테이블 생성 -$db->query($game_schema); -// 장수 테이블 생성 -$db->query($general_schema); -// 국가 테이블 생성 -$db->query($nation_schema); -// 도시 테이블 생성 -$db->query($city_schema); -// 부대 테이블 생성 -$db->query($troop_schema); -// 토큰 테이블 생성 -$db->query($token_schema); -// 외교 테이블 생성 -$db->query($diplomacy_schema); -// 전당 테이블 생성 -$db->query($hall_schema); -// 토너먼트 테이블 생성 -$db->query($tournament_schema); -// 거래 테이블 생성 -$db->query($auction_schema); -// 통계 테이블 생성 -$db->query($statistic_schema); -// 연감 테이블 생성 -$db->query($history_schema); \ No newline at end of file diff --git a/hwe/j_install.php b/hwe/j_install.php index f81642fd..32576edb 100644 --- a/hwe/j_install.php +++ b/hwe/j_install.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; -$session = Session::Instance()->setReadOnly(); +$session = Session::requireLogin([])->setReadOnly(); if($session->userGrade < 5){ Json::die([ 'result'=>false, diff --git a/hwe/j_install_db.php b/hwe/j_install_db.php index 1c9b443a..140a008c 100644 --- a/hwe/j_install_db.php +++ b/hwe/j_install_db.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; -$session = Session::Instance()->setReadOnly(); +$session = Session::requireLogin([])->setReadOnly(); if($session->userGrade < 6){ Json::die([ 'result'=>false, diff --git a/hwe/j_load_scenarios.php b/hwe/j_load_scenarios.php index 8e680235..5aacc776 100644 --- a/hwe/j_load_scenarios.php +++ b/hwe/j_load_scenarios.php @@ -3,7 +3,7 @@ namespace sammo; require "lib.php"; require "func.php"; -$session = Session::Instance()->setReadOnly(); +$session = Session::requireLogin([])->setReadOnly(); if($session->userGrade < 5){ Json::die([ 'result'=>false, diff --git a/hwe/j_map.php b/hwe/j_map.php index d1bfb90d..c2e9630b 100644 --- a/hwe/j_map.php +++ b/hwe/j_map.php @@ -4,10 +4,7 @@ namespace sammo; include 'lib.php'; include 'func.php'; -$session = Session::Instance()->loginGame()->setReadOnly(); - -//읽기 전용이다. 빠르게 세션 끝내자 -session_write_close(); +$session = Session::Instance()->setReadOnly(); $defaultPost = [ 'year' => null, @@ -18,6 +15,11 @@ $defaultPost = [ ]; $post = array_merge($defaultPost, WebUtil::parseJsonPost()); +if(!$session->isLoggedIn() || !$session->generalID){ + $post['neutralView'] = true; + $post['showMe'] = false; +} + if($post['year']){ if($post['month'] < 1 || $post['month'] > 12){ diff --git a/hwe/j_msg_contact_list.php b/hwe/j_msg_contact_list.php index 39a5171d..cacbfffd 100644 --- a/hwe/j_msg_contact_list.php +++ b/hwe/j_msg_contact_list.php @@ -4,7 +4,7 @@ namespace sammo; include('lib.php'); include('func.php'); - +$session = Session::requireGameLogin([])->setReadOnly(); if(!Session::Instance()->generalID){ Json::die([ diff --git a/hwe/j_msg_decide_opt.php b/hwe/j_msg_decide_opt.php index 25b3d18e..cf2f5a37 100644 --- a/hwe/j_msg_decide_opt.php +++ b/hwe/j_msg_decide_opt.php @@ -5,7 +5,7 @@ include 'lib.php'; include 'func.php'; //{msgID: 1206, response: true} - +$session = Session::requireGameLogin([])->setReadOnly(); $generalID = Session::Instance()->generalID; diff --git a/hwe/j_server_basic_info.php b/hwe/j_server_basic_info.php index 46b5e266..ff946d79 100644 --- a/hwe/j_server_basic_info.php +++ b/hwe/j_server_basic_info.php @@ -3,13 +3,10 @@ namespace sammo; include "lib.php"; -$session = Session::Instance()->setReadOnly(); -if(!$session->userID){ - Json::die([ - 'game'=>'x', - 'me'=>'no' - ]); -} +$session = Session::requireLogin([ + 'game'=>'x', + 'me'=>null +])->setReadOnly(); $db = DB::db(); diff --git a/hwe/j_turn.php b/hwe/j_turn.php index 5f5e5788..4a72aa63 100644 --- a/hwe/j_turn.php +++ b/hwe/j_turn.php @@ -6,4 +6,4 @@ include "func.php"; -$session = Session::requireGameLogin(null)->setReadOnly(); \ No newline at end of file +$session = Session::requireGameLogin([])->setReadOnly(); \ No newline at end of file diff --git a/hwe/select_npc.php b/hwe/select_npc.php index 3869b7c2..32ab2286 100644 --- a/hwe/select_npc.php +++ b/hwe/select_npc.php @@ -4,8 +4,9 @@ namespace sammo; include "lib.php"; include "func.php"; +$session = Session::requireLogin()->setReadOnly(); $connect = dbConn(true); -$userID = Session::getUserID(); +$userID = $session->userID; //회원 테이블에서 정보확인 $query = "select no,name,picture,grade from MEMBER where no='$userID'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); @@ -17,6 +18,15 @@ if(!$member) { exit(1); } +$query = "select npcmode,maxgeneral,img from game limit 1"; +$result = MYDB_query($query, $connect) or Error("join ".MYDB_error($connect),""); +$admin = MYDB_fetch_array($result); + +if($admin['npcmode'] != 1) { + header('Location:join.php'); + die(); +} + $connect = dbConn(); ?> @@ -36,15 +46,7 @@ $connect = dbConn(); alert('잘못된 접근입니다!');"; - echo ""; - exit(); -} $query = "select no from general where npc<2"; $result = MYDB_query($query, $connect) or Error("join ".MYDB_error($connect),""); diff --git a/hwe/selection.php b/hwe/selection.php index b3bff91c..5b478170 100644 --- a/hwe/selection.php +++ b/hwe/selection.php @@ -7,7 +7,7 @@ include "func.php"; //TODO: 이게 뭔지 분석 $btn = $_POST['btn']; -$userID = Session::getUserID(); +$session = Session::requireLogin()->setReadOnly(); $connect = dbConn(true); //회원 테이블에서 정보확인