From e56a2fa6fae5f54f776aff88e5b81bff1e03a010 Mon Sep 17 00:00:00 2001 From: hide_d Date: Thu, 29 Mar 2018 00:36:50 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B2=8C=EC=9E=84=20=EB=82=B4=EB=B6=80?= =?UTF-8?q?=EC=97=90=20=EC=9D=B4=EB=B2=A4=ED=8A=B8=20=ED=95=B8=EB=93=A4?= =?UTF-8?q?=EB=9F=AC=20=ED=86=B5=ED=95=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- twe/func.php | 17 +++++++++++++++-- twe/sammo/Scenario.php | 2 ++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/twe/func.php b/twe/func.php index 318cdd56..92717143 100644 --- a/twe/func.php +++ b/twe/func.php @@ -2036,7 +2036,7 @@ function checkTurn($connect) { //if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', CheckOverhead'); CheckOverhead($connect); //서버정보 - $query = "select startyear,year,month,turntime,turnterm,scenario from game where no='1'"; + $query = "select * from game where no='1'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $admin = MYDB_fetch_array($result); @@ -2092,10 +2092,23 @@ function checkTurn($connect) { $locklog[0] = "-- checkTurn() ".$admin['month']."월 : ".date('Y-m-d H:i:s')." : ".$_SESSION['userName']; pushLockLog($locklog); + + // 이벤트 핸들러 동작 + foreach (DB::db()->query('SELECT * from event') as $rawEvent) { + $eventID = $rawEvent['id']; + $cond = Json::decode($rawEvent['cond']); + $action = Json::decode($rawEvent['action']); + $event = new Event\EventHandler($cond, $action); + + $event->tryRunEvent(array_merge([ + 'currentEventID'=>$eventID + ], $admin)); + } + // 분기계산. 장수들 턴보다 먼저 있다면 먼저처리 if($admin['month'] == 1) { // NPC 등장 - if($admin['scenario'] > 0 && $admin['scenario'] < 20) { RegNPC($connect); } + //if($admin['scenario'] > 0 && $admin['scenario'] < 20) { RegNPC($connect); } //if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', processGoldIncome'); processGoldIncome($connect); //if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', processSpring'); diff --git a/twe/sammo/Scenario.php b/twe/sammo/Scenario.php index ba5d9faf..a93bf5aa 100644 --- a/twe/sammo/Scenario.php +++ b/twe/sammo/Scenario.php @@ -296,6 +296,8 @@ class Scenario{ 게임 변수 : year, month game 테이블 변수 : startyear, year, month, genius, turnterm, show_img_level, extend, fiction, npcmode install 변수 : npcmode, show_img_level, extend, scenario, fiction + + event변수 : currentEventID */ $db = DB::db();