diff --git a/.phan/config.php b/.phan/config.php index e9a06956..649b51d7 100644 --- a/.phan/config.php +++ b/.phan/config.php @@ -14,7 +14,7 @@ return [ "target_php_version" => '7.0', 'backward_compatibility_checks ' => false, 'ignore_undeclared_variables_in_global_scope' => false, - 'minimum_severity'=>\Phan\Issue::SEVERITY_NORMAL, + 'minimum_severity'=>\Phan\Issue::SEVERITY_LOW, 'file_list' => [ 'f_config/config.php', diff --git a/f_install/templates/ServConfig.orig.php b/f_install/templates/ServConfig.orig.php index 8a88be54..c24d8501 100644 --- a/f_install/templates/ServConfig.orig.php +++ b/f_install/templates/ServConfig.orig.php @@ -13,20 +13,7 @@ class ServConfig public static function getSharedIconPath() : string { - static $path = ''; - if($path){ - $path; - } - - if (Util::starts_with('http', self::$sharedIconPath) - || Util::starts_with('//', self::$sharedIconPath)) - { - $path = self::$sharedIconPath; - } - else{ - $path = self::$serverWebPath.'/'.self::$sharedIconPath; - } - return $path; + return static::$sharedIconPath; } public static function getUserIconPath() : string @@ -36,20 +23,7 @@ class ServConfig public static function getGameImagePath() : string { - static $path = ''; - if($path){ - $path; - } - - if (Util::starts_with('http', self::$gameImagePath) - || Util::starts_with('//', self::$gameImagePath)) - { - $path = self::$gameImagePath; - } - else{ - $path = self::$serverWebPath.'/'.self::$gameImagePath; - } - return $path; + return static::$gameImagePath; } diff --git a/hwe/_admin1_submit.php b/hwe/_admin1_submit.php index ff24e6eb..eef09be8 100644 --- a/hwe/_admin1_submit.php +++ b/hwe/_admin1_submit.php @@ -44,8 +44,7 @@ switch ($btn) { if ($lognum >= 29) { $lognum = 0; } - $history[0] = "{$log}"; - pushWorldHistory($history); + pushWorldHistory(["{$log}"]); break; case "변경1": $query = "update game set starttime='$starttime'"; @@ -113,8 +112,8 @@ switch ($btn) { } } } - $history[] = "★턴시간이 $btn으로 변경됩니다."; - pushWorldHistory($history); + + pushWorldHistory(["★턴시간이 $btn으로 변경됩니다."]); break; } diff --git a/hwe/_admin4_submit.php b/hwe/_admin4_submit.php index a8380f8c..09ea4402 100644 --- a/hwe/_admin4_submit.php +++ b/hwe/_admin4_submit.php @@ -52,7 +52,6 @@ switch($btn) { case "메세지 전달": //TODO:새 갠메 시스템으로 변경 $date = date('Y-m-d H:i:s'); - $msg; for($i=0; $i < count($genlist); $i++) { } break; diff --git a/hwe/_admin5.php b/hwe/_admin5.php index bb81025e..e22c0b2f 100644 --- a/hwe/_admin5.php +++ b/hwe/_admin5.php @@ -39,6 +39,8 @@ if($type == 0) { if($type2 == 0) { $type2 = 0; } +$sel = []; +$sel2 = []; $sel[$type] = "selected"; $sel2[$type2] = "selected"; @@ -60,33 +62,33 @@ $admin = MYDB_fetch_array($result);
정렬순서 :
diff --git a/hwe/_admin5_submit.php b/hwe/_admin5_submit.php index d3bd5a26..fdd9ca2d 100644 --- a/hwe/_admin5_submit.php +++ b/hwe/_admin5_submit.php @@ -3,6 +3,9 @@ namespace sammo; include "lib.php"; include "func.php"; + +$nation = Util::getReq('nation', 'int'); + //로그인 검사 $session = Session::requireGameLogin()->setReadOnly(); $userID = Session::getUserID(); @@ -18,11 +21,15 @@ $connect=$db->get(); switch($btn) { case "국가변경": if($nation == 0) { - $query = "update general set nation=0,level=0 where owner='{$userID}'"; - MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); + $db->update('general', [ + 'nation'=>0, + 'level'=>0, + ], 'owner=%i', $userID); } else { - $query = "update general set nation='{$nation}',level=1 where owner='{$userID}'"; - MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); + $db->update('general', [ + 'nation'=>$nation, + 'level'=>1, + ], 'owner=%i', $userID); } break; } diff --git a/hwe/_admin8.php b/hwe/_admin8.php index 6ba93902..4876fd8a 100644 --- a/hwe/_admin8.php +++ b/hwe/_admin8.php @@ -70,6 +70,8 @@ $sel[$type] = "selected"; $type[$i] "; diff --git a/hwe/d_ally.php b/hwe/d_ally.php index 54cdc82b..dcb2e17b 100644 --- a/hwe/d_ally.php +++ b/hwe/d_ally.php @@ -60,6 +60,9 @@ $query = "select reserved from diplomacy where me='{$you['nation']}' and you='{$ $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $dip2 = MYDB_fetch_array($result); +$mylog = []; +$youlog = []; + if($ok == "수락") { // 서신 보낸 후 멸망,선양 등 했을때. if($me['level'] < 5) { diff --git a/hwe/d_cancel.php b/hwe/d_cancel.php index 39c17aba..173e77fc 100644 --- a/hwe/d_cancel.php +++ b/hwe/d_cancel.php @@ -53,6 +53,11 @@ $query = "select state from diplomacy where me='{$me['nation']}' and you='{$you[ $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $dip = MYDB_fetch_array($result); +$mylog = []; +$youlog = []; +$allog = []; +$history = []; + if($ok == "수락") { // 서신 보낸 후 멸망,선양 등 했을때. if($me['level'] < 5) { diff --git a/hwe/d_cease.php b/hwe/d_cease.php index dec79fe8..d849f30d 100644 --- a/hwe/d_cease.php +++ b/hwe/d_cease.php @@ -53,6 +53,11 @@ $query = "select state from diplomacy where me='{$me['nation']}' and you='{$you[ $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $dip = MYDB_fetch_array($result); +$mylog = []; +$youlog = []; +$allog = []; +$history = []; + if($ok == "수락") { // 서신 보낸 후 멸망,선양 등 했을때. if($me['level'] < 5) { diff --git a/hwe/d_merge.php b/hwe/d_merge.php index 00476553..132cbc42 100644 --- a/hwe/d_merge.php +++ b/hwe/d_merge.php @@ -78,6 +78,11 @@ for($i=0; $i < $warcount; $i++) { } } +$mylog = []; +$youlog = []; +$allog = []; +$history = []; + if($ok == "수락") { // 서신 보낸 후 멸망 했을때. if($me['level'] < 5) { diff --git a/hwe/d_scout.php b/hwe/d_scout.php index c5f4f845..9f0ecfc7 100644 --- a/hwe/d_scout.php +++ b/hwe/d_scout.php @@ -33,6 +33,10 @@ $query = "select name,nation,level,capital,scout from nation where nation='{$you $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $nation = MYDB_fetch_array($result); +$mylog = []; +$youlog = []; +$allog = []; + if($ok == "수락" && $me['level'] < 12 && $nation['level'] > 0 && $nation['scout'] == 0 && $me['nation'] != $nation['nation'] && $admin['year'] >= $admin['startyear']+3 && strpos($me['nations'], ",{$nation['nation']},") === false) { $youlog[] = "{$me['name']} 등용에 성공했습니다."; $alllog[] = "●{$admin['month']}월:{$me['name']}(이)가 {$nation['name']}(으)로 망명하였습니다."; diff --git a/hwe/d_surrender.php b/hwe/d_surrender.php index 786815ef..30f1a5df 100644 --- a/hwe/d_surrender.php +++ b/hwe/d_surrender.php @@ -70,6 +70,9 @@ for($i=0; $i < $warcount; $i++) { } $mylog = []; +$youlog = []; +$allog = []; +$history = []; if($ok == "수락") { // 서신 보낸 후 멸망 했을때. diff --git a/hwe/func_legacy.php b/hwe/func_legacy.php index 61dfbe6b..b4aeceb5 100644 --- a/hwe/func_legacy.php +++ b/hwe/func_legacy.php @@ -129,17 +129,13 @@ function info($type=0) { switch($type) { case 0: - echo "현재 : {$admin['year']}年 {$admin['month']}月 ($termtype 서버)
등록 장수 : 유저 {$gencount} / {$admin['maxgeneral']} 명 + NPC {$npccount} 명"; - break; + return "현재 : {$admin['year']}年 {$admin['month']}月 ($termtype 서버)
등록 장수 : 유저 {$gencount} / {$admin['maxgeneral']} 명 + NPC {$npccount} 명"; case 1: - echo "현재 : {$admin['year']}年 {$admin['month']}月 ($termtype 서버)          등록 장수 : 유저 {$gencount} / {$admin['maxgeneral']} 명 + NPC {$npccount} 명"; - break; + return "현재 : {$admin['year']}年 {$admin['month']}月 ($termtype 서버)          등록 장수 : 유저 {$gencount} / {$admin['maxgeneral']} 명 + NPC {$npccount} 명"; case 2: - echo "현재 : {$admin['year']}年 {$admin['month']}月 ($termtype 서버)"; - break; + return "현재 : {$admin['year']}年 {$admin['month']}月 ($termtype 서버)"; case 3: - echo "등록 장수 : 유저 {$gencount} / {$admin['maxgeneral']} 명 + NPC {$npccount} 명"; - break; + return "등록 장수 : 유저 {$gencount} / {$admin['maxgeneral']} 명 + NPC {$npccount} 명"; } } diff --git a/hwe/index.php b/hwe/index.php index bdb0842e..7e1db26d 100644 --- a/hwe/index.php +++ b/hwe/index.php @@ -129,10 +129,10 @@ if ($valid == 1) { ?> - + 전체 접속자 수 : 명 턴당 갱신횟수 : 회 - + diff --git a/hwe/join.php b/hwe/join.php index 7ed98eac..997b68a7 100644 --- a/hwe/join.php +++ b/hwe/join.php @@ -42,7 +42,7 @@ $connect=$db->get(); 장 수 생 성
- +
보병은 방어특화입니다."; - $explain[1] = "저렴하고 튼튼합니다.
중원지역 소유시 가능."; - $explain[2] = "저렴하고 강력합니다.
오월지역 소유시 가능."; - $explain[3] = "은밀하고 날쌥니다.
저 소유시 가능."; - $explain[4] = "최강의 보병입니다.
낙양 소유시 가능."; - $explain[5] = "등갑을 두른 보병입니다.
남중지역 소유시 가능."; - - $explain[10] = "표준적인 궁병입니다.
궁병은 회피특화입니다."; - $explain[11] = "말을 타고 잘 피합니다.
동이지역 소유시 가능."; - $explain[12] = "화살을 연사합니다.
서촉지역 소유시 가능."; - $explain[13] = "강건한 궁병입니다.
양양 소유시 가능."; - $explain[14] = "강력한 화살을 쏩니다.
건업 소유시 가능."; - - $explain[20] = "표준적인 기병입니다.
기병은 공격특화입니다."; - $explain[21] = "백마의 위용을 보여줍니다.
하북지역 소유시 가능."; - $explain[22] = "갑주를 두른 기병입니다.
서북지역 소유시 가능."; - $explain[23] = "저돌적으로 공격합니다.
흉노 소유시 가능."; - $explain[24] = "철갑을 두른 기병입니다.
강 소유시 가능."; - $explain[25] = "날쎄고 빠른 기병입니다.
산월 소유시 가능."; - $explain[26] = "어느 누구보다 강력합니다.
남만 소유시 가능."; - $explain[27] = "정예 기병입니다.
허창 소유시 가능."; - - $explain[30] = "계략을 사용하는 병종입니다.
귀병은 계략특화입니다."; - $explain[31] = "신출귀몰한 귀병입니다.
초지역 소유시 가능."; - $explain[32] = "저렴하고 튼튼합니다.
오환 소유시 가능."; - $explain[33] = "저렴하고 강력합니다.
왜 소유시 가능."; - $explain[34] = "백병전에도 능숙합니다.
장안 소유시 가능."; - $explain[35] = "전투를 포기하고 계략에 몰두합니다.
귀병은 계략특화입니다."; - $explain[36] = "고도로 훈련된 귀병입니다.
낙양 소유시 가능."; - $explain[37] = "갑주를 두른 귀병입니다.
성도 소유시 가능."; - $explain[38] = "날카로운 무기를 가진 귀병입니다.
업 소유시 가능."; - - $explain[40] = "높은 구조물 위에서 공격합니다.
차병은 공성특화입니다."; - $explain[41] = "엄청난 위력으로 성벽을 부수어버립니다.
차병은 공성특화입니다."; - $explain[42] = "상대에게 돌덩이를 날립니다.
업 소유시 가능."; - $explain[43] = "상대를 저지하는 특수병기입니다.
성도 소유시 가능."; - - return $explain; -} - function command_11($turn, $command) { $db = DB::db(); $connect=$db->get(); diff --git a/hwe/select_npc.php b/hwe/select_npc.php index 47937a86..be20ead0 100644 --- a/hwe/select_npc.php +++ b/hwe/select_npc.php @@ -43,7 +43,7 @@ $connect=$db->get(); 장 수 선 택
- +
'FAIL']; if($action == 'notice') { RootDB::db()->update('SYSTEM', ['NOTICE'=>$notice], true); diff --git a/oauth_kakao/j_change_pw.php b/oauth_kakao/j_change_pw.php index eb0db4b6..8d7c5155 100644 --- a/oauth_kakao/j_change_pw.php +++ b/oauth_kakao/j_change_pw.php @@ -47,10 +47,10 @@ if($expires < $nowDate){ } $access_token = $result['access_token']; - $expires = TimeUtil::DatetimeFromNowSecond($nowDate, $result['expires_in']); + $expires = TimeUtil::DatetimeFromNowSecond($result['expires_in']); if(isset($result['refresh_token'])){ $refresh_token = Util::array_get($result['refresh_token']); - $refresh_token_expires = TimeUtil::DatetimeFromNowSecond($nowDate, $result['refresh_token_expires_in']); + $refresh_token_expires = TimeUtil::DatetimeFromNowSecond($result['refresh_token_expires_in']); } } diff --git a/oauth_kakao/j_join_process.php b/oauth_kakao/j_join_process.php index 96992214..4e168497 100644 --- a/oauth_kakao/j_join_process.php +++ b/oauth_kakao/j_join_process.php @@ -96,10 +96,10 @@ if($expires < $nowDate){ } $access_token = $result['access_token']; - $expires = TimeUtil::DatetimeFromNowSecond($nowDate, $result['expires_in']); + $expires = TimeUtil::DatetimeFromNowSecond($result['expires_in']); if(isset($result['refresh_token'])){ $refresh_token = Util::array_get($result['refresh_token']); - $refresh_token_expires = TimeUtil::DatetimeFromNowSecond($nowDate, $result['refresh_token_expires_in']); + $refresh_token_expires = TimeUtil::DatetimeFromNowSecond($result['refresh_token_expires_in']); } } diff --git a/oauth_kakao/j_login_oauth.php b/oauth_kakao/j_login_oauth.php index f1e05874..91cfe645 100644 --- a/oauth_kakao/j_login_oauth.php +++ b/oauth_kakao/j_login_oauth.php @@ -59,10 +59,10 @@ if($expires < $nowDate){ } $access_token = $result['access_token']; - $expires = TimeUtil::DatetimeFromNowSecond($nowDate, $result['expires_in']); + $expires = TimeUtil::DatetimeFromNowSecond($result['expires_in']); if(isset($result['refresh_token'])){ $refresh_token = Util::array_get($result['refresh_token']); - $refresh_token_expires = TimeUtil::DatetimeFromNowSecond($nowDate, $result['refresh_token_expires_in']); + $refresh_token_expires = TimeUtil::DatetimeFromNowSecond($result['refresh_token_expires_in']); } }