diff --git a/hwe/c_vote.php b/hwe/c_vote.php index 396d95bc..9e1cb567 100644 --- a/hwe/c_vote.php +++ b/hwe/c_vote.php @@ -20,7 +20,7 @@ if($btn == "투표" && $me['vote'] == 0 && $sel > 0) { $query = "update general set gold=gold+{$develcost},vote='{$sel}' where owner='{$_SESSION['userID']}'"; MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); - $log = array(); + $log = []; $log = uniqueItem($connect, $me, $log, 1); pushGenLog($me, $log); } diff --git a/hwe/func_command.php b/hwe/func_command.php index b34c5cc4..01b5711a 100644 --- a/hwe/func_command.php +++ b/hwe/func_command.php @@ -456,7 +456,7 @@ function processCommand($connect, $no) { $query = "select month,killturn from game limit 1"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $admin = MYDB_fetch_array($result); - $log = array(); + $log = []; // 블럭자는 미실행. 삭턴 감소 if($general['block'] == 2) { diff --git a/hwe/func_gamerule.php b/hwe/func_gamerule.php index 98fc309c..66c149a0 100644 --- a/hwe/func_gamerule.php +++ b/hwe/func_gamerule.php @@ -241,7 +241,6 @@ function checkSupply($connect) { $cities = []; foreach($db->query('SELECT city, nation FROM city WHERE nation != 0') as $city){ $cities[$city['city']] = [ - 'id'=>$city['city'], 'nation'=>$city['nation'], 'supply'=>false @@ -250,15 +249,20 @@ function checkSupply($connect) { $queue = new \SplQueue(); foreach(getAllNationStaticInfo() as $nation){ - $city = $cities[$nation['capital']]; + $capitalID = $nation['capital']; + if(!$capitalID){ + continue; + } + $city = &$cities[$capitalID]; $city['supply'] = true; - $queue->enqueue($city); + $queue->enqueue($city['id']); } while(!$queue->isEmpty()){ - $city = $queue->dequeue(); + $cityID = $queue->dequeue(); + $city = &$cities[$cityID]; - foreach(array_keys(CityConst::byID($city['id'])->path) as $connCityID){ + foreach(array_keys(CityConst::byID($cityID)->path) as $connCityID){ if(!key_exists($connCityID, $cities)){ continue; } @@ -270,7 +274,7 @@ function checkSupply($connect) { continue; } $connCity['supply'] = true; - $queue->enqueue($connCity); + $queue->enqueue($connCity['id']); } } @@ -446,7 +450,7 @@ function preUpdateMonthly($connect) { $general = MYDB_fetch_array($result); unset($log); - $log = array(); + $log = []; $log = checkDedication($connect, $general, $log); $log = checkExperience($connect, $general, $log); pushGenLog($general, $log); diff --git a/hwe/func_process.php b/hwe/func_process.php index 9073feeb..bd73221d 100644 --- a/hwe/func_process.php +++ b/hwe/func_process.php @@ -163,8 +163,9 @@ function CriticalScore($score, $type) { } function process_1($connect, &$general, $type) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $query = "select startyear,year,month,develcost from game limit 1"; @@ -259,8 +260,9 @@ function process_1($connect, &$general, $type) { } function process_3($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $query = "select startyear,year,month,develcost from game limit 1"; @@ -353,8 +355,9 @@ function process_3($connect, &$general) { } function process_4($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $query = "select startyear,year,month,develcost from game limit 1"; @@ -440,8 +443,9 @@ function process_4($connect, &$general) { } function process_5($connect, &$general, $type) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $query = "select startyear,year,month,develcost from game limit 1"; @@ -535,8 +539,9 @@ function process_5($connect, &$general, $type) { } function process_7($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $query = "select startyear,year,month,develcost from game limit 1"; @@ -622,8 +627,9 @@ function process_7($connect, &$general) { } function process_8($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $query = "select startyear,year,month,develcost from game limit 1"; @@ -716,8 +722,9 @@ function process_8($connect, &$general) { function process_9($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $query = "select year,month,develcost from game limit 1"; @@ -803,8 +810,9 @@ function process_9($connect, &$general) { function process_11($connect, &$general, $type) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; global $_defaultatmos, $_defaulttrain, $_defaultatmos2, $_defaulttrain2; $date = substr($general['turntime'],11,5); @@ -986,8 +994,9 @@ function process_11($connect, &$general, $type) { } function process_13($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; global $_maxtrain, $_training, $_atmosing; $date = substr($general['turntime'],11,5); @@ -1053,8 +1062,9 @@ function process_13($connect, &$general) { function process_14($connect, &$general) { global $_maxatmos, $_training; - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $query = "select year,month from game limit 1"; @@ -1112,8 +1122,9 @@ function process_14($connect, &$general) { function process_15($connect, &$general) { global $_maxatmos, $_maxtrain; - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $query = "select year,month from game limit 1"; @@ -1181,8 +1192,9 @@ function process_15($connect, &$general) { } function process_16($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $query = "select startyear,year,month from game limit 1"; @@ -1268,8 +1280,9 @@ function process_16($connect, &$general) { } function process_17($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $query = "select year,month from game limit 1"; @@ -1305,8 +1318,9 @@ function process_17($connect, &$general) { } function process_21($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $query = "select year,month,develcost from game limit 1"; @@ -1369,8 +1383,9 @@ function process_21($connect, &$general) { } function process_26($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $troop = getTroop($connect, $general['troop']); @@ -1431,9 +1446,10 @@ function process_26($connect, &$general) { } function process_28($connect, &$general) { - $log = array(); - $alllog = array(); - $youlog = array(); + $log = []; + $alllog = []; + $history = []; + $youlog = []; $date = substr($general['turntime'],11,5); @@ -1493,8 +1509,9 @@ function process_28($connect, &$general) { } function process_30($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $query = "select year,month,develcost from game limit 1"; @@ -1557,8 +1574,9 @@ function process_30($connect, &$general) { } function process_31($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $msg = []; @@ -1681,8 +1699,9 @@ function process_31($connect, &$general) { } function process_41($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $query = "select year,month,develcost from game limit 1"; @@ -1746,8 +1765,9 @@ function process_41($connect, &$general) { } function process_42($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $query = "select year,month from game limit 1"; @@ -1963,8 +1983,9 @@ function process_42($connect, &$general) { } function process_43($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $query = "select year,month from game limit 1"; @@ -2049,8 +2070,9 @@ function process_43($connect, &$general) { } function process_44($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $query = "select year,month from game limit 1"; @@ -2136,8 +2158,9 @@ function process_44($connect, &$general) { function process_48($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $query = "select year,month from game limit 1"; @@ -2240,8 +2263,9 @@ function process_48($connect, &$general) { } function process_49($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; global $_taxrate; $date = substr($general['turntime'],11,5); @@ -2374,8 +2398,9 @@ function process_49($connect, &$general) { } function process_50($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $query = "select month from game limit 1"; @@ -2397,8 +2422,9 @@ function process_50($connect, &$general) { } function process_99($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $query = "select year,month from game limit 1"; diff --git a/hwe/func_process_chief.php b/hwe/func_process_chief.php index e5f36461..476b048e 100644 --- a/hwe/func_process_chief.php +++ b/hwe/func_process_chief.php @@ -2,8 +2,9 @@ namespace sammo; function process_23($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); @@ -99,8 +100,9 @@ function process_23($connect, &$general) { function process_24($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $query = "select year,month,scenario,startyear from game limit 1"; @@ -205,9 +207,10 @@ function process_24($connect, &$general) { function process_27($connect, &$general) { - $log = array(); - $alllog = array(); - $youlog = array(); + $log = []; + $alllog = []; + $history = []; + $youlog = []; $date = substr($general['turntime'],11,5); $query = "select gold,rice,l{$general['level']}turn0 from nation where nation='{$general['nation']}'"; @@ -277,8 +280,9 @@ function process_27($connect, &$general) { function process_51($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $query = "select year,month from game limit 1"; @@ -342,8 +346,10 @@ function process_51($connect, &$general) { } function process_52($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; + $date = substr($general['turntime'],11,5); $query = "select year,month from game limit 1"; @@ -449,8 +455,9 @@ function process_52($connect, &$general) { } function process_53($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $query = "select year,month from game limit 1"; @@ -514,8 +521,9 @@ function process_53($connect, &$general) { function process_61($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $query = "select year,month,develcost,turnterm from game limit 1"; @@ -594,8 +602,9 @@ function process_61($connect, &$general) { } function process_62($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $query = "select startyear,year,month from game limit 1"; @@ -688,8 +697,9 @@ function process_62($connect, &$general) { } function process_63($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $query = "select year,month from game limit 1"; @@ -752,8 +762,9 @@ function process_63($connect, &$general) { } function process_64($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $query = "select year,month from game limit 1"; @@ -816,8 +827,9 @@ function process_64($connect, &$general) { } function process_65($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $query = "select year,month from game limit 1"; @@ -906,8 +918,9 @@ function process_65($connect, &$general) { } function process_66($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); @@ -992,8 +1005,9 @@ function process_66($connect, &$general) { } function process_67($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); @@ -1079,8 +1093,9 @@ function process_67($connect, &$general) { } function process_68($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); @@ -1178,8 +1193,9 @@ function process_68($connect, &$general) { } function process_71($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); @@ -1279,8 +1295,9 @@ function process_71($connect, &$general) { } function process_72($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); @@ -1389,8 +1406,9 @@ function process_72($connect, &$general) { } function process_73($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); @@ -1515,8 +1533,9 @@ function process_73($connect, &$general) { } function process_74($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); @@ -1653,8 +1672,9 @@ function process_74($connect, &$general) { } function process_75($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); @@ -1774,8 +1794,9 @@ function process_75($connect, &$general) { } function process_76($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); @@ -1988,8 +2009,9 @@ function process_76($connect, &$general) { } function process_77($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); @@ -2111,8 +2133,9 @@ function process_77($connect, &$general) { } function process_78($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); @@ -2231,8 +2254,10 @@ function process_78($connect, &$general) { } function process_81($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; + $date = substr($general['turntime'],11,5); $query = "select year,month from game limit 1"; diff --git a/hwe/func_process_personnel.php b/hwe/func_process_personnel.php index 2d239092..197c10e8 100644 --- a/hwe/func_process_personnel.php +++ b/hwe/func_process_personnel.php @@ -2,8 +2,9 @@ namespace sammo; function process_22($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $query = "select startyear,year,month,develcost from game limit 1"; @@ -60,8 +61,9 @@ function process_22($connect, &$general) { } function process_25($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $query = "select startyear,year,month from game limit 1"; @@ -173,8 +175,9 @@ function process_25($connect, &$general) { } function process_29($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $query = "select startyear,year,month,develcost,npccount,turnterm,scenario from game limit 1"; @@ -427,8 +430,9 @@ function process_29($connect, &$general) { } function process_45($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $query = "select startyear,year,month from game limit 1"; @@ -540,8 +544,9 @@ function process_45($connect, &$general) { } function process_46($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $query = "select startyear,year,month from game limit 1"; @@ -624,8 +629,9 @@ function process_46($connect, &$general) { } function process_47($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $query = "select startyear,year,month from game limit 1"; @@ -685,8 +691,9 @@ function process_47($connect, &$general) { } function process_54($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $query = "select year,month from game limit 1"; @@ -746,9 +753,9 @@ function process_54($connect, &$general) { } function process_55($connect, &$general) { - $log = array(); - $alllog = array(); - $history = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); @@ -815,7 +822,7 @@ function process_55($connect, &$general) { foreach(getAllNationStaticInfo() as $younation){ - if($nation['nation'] == $you['nation']){ + if($nation['nation'] == $younation['nation']){ continue; } @@ -832,8 +839,9 @@ function process_55($connect, &$general) { } function process_56($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $query = "select year,month from game limit 1"; @@ -881,8 +889,9 @@ function process_56($connect, &$general) { function process_57($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; $date = substr($general['turntime'],11,5); $query = "select year,month,killturn from game limit 1"; diff --git a/hwe/func_process_trick.php b/hwe/func_process_trick.php index 926b496e..a1b6dba5 100644 --- a/hwe/func_process_trick.php +++ b/hwe/func_process_trick.php @@ -2,8 +2,9 @@ function process_32($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; global $_firing, $_basefiring, $_firingpower; $date = substr($general['turntime'],11,5); @@ -123,8 +124,9 @@ function process_32($connect, &$general) { } function process_33($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; global $_firing, $_basefiring, $_firingpower; //탈취는 0까지 무제한 $date = substr($general['turntime'],11,5); @@ -271,8 +273,9 @@ function process_33($connect, &$general) { } function process_34($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; global $_firing, $_basefiring, $_firingpower; $date = substr($general['turntime'],11,5); @@ -393,8 +396,9 @@ function process_34($connect, &$general) { } function process_35($connect, &$general) { - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; global $_firing, $_basefiring, $_firingpower; $date = substr($general['turntime'],11,5); @@ -518,8 +522,9 @@ function process_35($connect, &$general) { function process_36($connect, &$general) { return process_99($connect, $general); - $log = array(); - $alllog = array(); + $log = []; + $alllog = []; + $history = []; global $_firing, $_basefiring, $_firingpower; $date = substr($general['turntime'],11,5); diff --git a/hwe/index.php b/hwe/index.php index d82b40aa..5da8e2ce 100644 --- a/hwe/index.php +++ b/hwe/index.php @@ -4,7 +4,7 @@ namespace sammo; include "lib.php"; include "func.php"; -$session = Session::Instance()->loginGame(); +$session = Session::Instance()->loginGame()->setReadOnly(); $connect = dbConn(); increaseRefresh("메인", 1); @@ -24,11 +24,10 @@ $me = $db->queryFirstRow( //그새 사망이면 if($me === null) { - $session->loginGame(); + $session->logoutGame(); header('Location: ../'); die(); } -$session->setReadOnly(); if($me['newmsg'] == 1 && $me['newvote'] == 1) { $query = "update general set newmsg=0,newvote=0 where owner='{$_SESSION['userID']}'";