게임 내부에 이벤트 핸들러 통합
This commit is contained in:
+15
-2
@@ -2036,7 +2036,7 @@ function checkTurn($connect) {
|
|||||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', CheckOverhead');
|
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', CheckOverhead');
|
||||||
CheckOverhead($connect);
|
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),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$admin = MYDB_fetch_array($result);
|
$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'];
|
$locklog[0] = "-- checkTurn() ".$admin['month']."월 : ".date('Y-m-d H:i:s')." : ".$_SESSION['userName'];
|
||||||
pushLockLog($locklog);
|
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) {
|
if($admin['month'] == 1) {
|
||||||
// NPC 등장
|
// 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');
|
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', processGoldIncome');
|
||||||
processGoldIncome($connect);
|
processGoldIncome($connect);
|
||||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', processSpring');
|
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', processSpring');
|
||||||
|
|||||||
@@ -296,6 +296,8 @@ class Scenario{
|
|||||||
게임 변수 : year, month
|
게임 변수 : year, month
|
||||||
game 테이블 변수 : startyear, year, month, genius, turnterm, show_img_level, extend, fiction, npcmode
|
game 테이블 변수 : startyear, year, month, genius, turnterm, show_img_level, extend, fiction, npcmode
|
||||||
install 변수 : npcmode, show_img_level, extend, scenario, fiction
|
install 변수 : npcmode, show_img_level, extend, scenario, fiction
|
||||||
|
|
||||||
|
event변수 : currentEventID
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
|
|||||||
Reference in New Issue
Block a user