diff --git a/hwe/_simul.php b/hwe/_simul.php index b04bb26f..a32ac7aa 100644 --- a/hwe/_simul.php +++ b/hwe/_simul.php @@ -106,6 +106,18 @@ if($isgen == "장수평균" || $isgen == "성벽평균") { $simulCount = 1; } +$general = [ + 'no'=>1 +]; +$oppose = [ + 'no'=>2 +]; +$city = [ + 'gen1'=>0, + 'gen2'=>0, + 'gen3'=>0, +]; + if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평균" || $isgen == "성벽평균") { $msg2 = ""; for($i=0; $i < $simulCount; $i++) { diff --git a/hwe/a_genList.php b/hwe/a_genList.php index 8b6e79a5..4bcec301 100644 --- a/hwe/a_genList.php +++ b/hwe/a_genList.php @@ -65,6 +65,8 @@ if(!isset($type) || $type == 0) { get(); @@ -12,6 +14,7 @@ increaseRefresh("빙의일람", 2); if($type == 0) { $type = 1; } +$sel = []; $sel[$type] = "selected"; ?> @@ -44,6 +47,7 @@ $sel[$type] = "selected"; diff --git a/hwe/b_betting.php b/hwe/b_betting.php index 4109864a..a88304d5 100644 --- a/hwe/b_betting.php +++ b/hwe/b_betting.php @@ -94,6 +94,8 @@ echo " $query = "select npc,name,win from tournament where grp>=50 order by grp, grp_no"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), ""); +$cent = []; +$line = []; for ($i=0; $i < 1; $i++) { $cent[$i] = ""; } @@ -255,6 +257,10 @@ for ($i=0; $i < 16; $i++) { $query = "select bet0,bet1,bet2,bet3,bet4,bet5,bet6,bet7,bet8,bet9,bet10,bet11,bet12,bet13,bet14,bet15 from general where owner='{$userID}'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), ""); $me = MYDB_fetch_array($result); +$myBet = []; +$bet = []; +$gold = []; + for ($i=0; $i < 16; $i++) { $myBet[$i] = $me["bet{$i}"]; } diff --git a/hwe/b_chiefcenter.php b/hwe/b_chiefcenter.php index ed1427c1..facc80c9 100644 --- a/hwe/b_chiefcenter.php +++ b/hwe/b_chiefcenter.php @@ -57,6 +57,8 @@ $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"" $nation = MYDB_fetch_array($result); $lv = getNationChiefLevel($nation['level']); +$turn = []; +$gen = []; for($i=12; $i >= $lv; $i--) { $turn[$i] = getCoreTurn($nation, $i); @@ -93,6 +95,11 @@ function turn(type) { $year = $admin['year']; $month = $admin['month']; $date = substr(date('Y-m-d H:i:s'), 14); + +$totaldate = []; +$turntime = []; +$turndate = []; + for($i=12; $i >= $lv; $i--) { $totaldate[$i] = $gen[$i]['turntime']; $turntime[$i] = substr($gen[$i]['turntime'], 14); diff --git a/hwe/b_currentCity.php b/hwe/b_currentCity.php index b9248710..f3837237 100644 --- a/hwe/b_currentCity.php +++ b/hwe/b_currentCity.php @@ -217,6 +217,8 @@ $query = "select npc,mode,no,picture,imgsvr,name,injury,leader,power,intel,level $genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $gencount = MYDB_num_rows($genresult); +$nationname = []; +$nationlevel = []; foreach(getAllNationStaticInfo() as $nation){ $nationname[$nation['nation']] = $nation['name']; $nationlevel[$nation['nation']] = $nation['level']; diff --git a/hwe/b_diplomacy.php b/hwe/b_diplomacy.php index 3570f95d..1ba79f3e 100644 --- a/hwe/b_diplomacy.php +++ b/hwe/b_diplomacy.php @@ -23,7 +23,9 @@ $me = MYDB_fetch_array($result); $query = "select nation,color,name,power,gennum from nation where level>0 order by power desc"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $nationcount = MYDB_num_rows($result); -$nationnum = array(); +$nationnum = []; +$nationname = []; +$nationcolor = []; $nationStr = ""; $powerStr = ""; @@ -99,6 +101,8 @@ for($i=0; $i < $nationcount; $i++) { echo " "; +$state = []; + for($i=0; $i < $nationcount; $i++) { $query = "select you,state from diplomacy where me='$nationnum[$i]'"; $dipresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); @@ -199,6 +203,7 @@ for($i=0; $i < $citycount; $i++) { } function mySort($killnum) { + $seq = []; for($i=0; $i < count($killnum); $i++) { $seq[$i] = $i; } diff --git a/hwe/b_genList.php b/hwe/b_genList.php index 1431a9c7..23b87d85 100644 --- a/hwe/b_genList.php +++ b/hwe/b_genList.php @@ -38,6 +38,7 @@ if ($me['level'] == 0 || ($me['level'] == 1 && $me['belong'] < $nation['secretli if ($type == 0) { $type = 7; } +$sel = []; $sel[$type] = "selected"; ?> @@ -75,7 +76,7 @@ $sel[$type] = "selected"; $query = "select troop,name from troop where nation='{$me['nation']}'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), ""); $troopCount = MYDB_num_rows($result); - +$troopName = []; for ($i=0; $i < $troopCount; $i++) { $troop = MYDB_fetch_array($result); $troopName[$troop['troop']] = $troop['name']; diff --git a/hwe/b_myBossInfo.php b/hwe/b_myBossInfo.php index 942c6adc..5c681115 100644 --- a/hwe/b_myBossInfo.php +++ b/hwe/b_myBossInfo.php @@ -59,6 +59,7 @@ else { $btn = "hidden"; } $query = "select name,level,picture,imgsvr,belong from general where nation='{$nation['nation']}' and level>={$lv} order by level desc"; $genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); +$level = []; for($i=12; $i >= $lv; $i--) { $levels = MYDB_fetch_array($genresult); $level[$levels['level']] = $levels; @@ -212,12 +213,13 @@ echo " "; -$querys[10] = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and power>='".GameConst::$goodgenpower."' order by npc,binary(name)"; -$querys[9] = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and intel>='".GameConst::$goodgenintel."' order by npc,binary(name)"; -$querys[8] = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and power>='".GameConst::$goodgenpower."' order by npc,binary(name)"; -$querys[7] = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and intel>='".GameConst::$goodgenintel."' order by npc,binary(name)"; -$querys[6] = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and power>='".GameConst::$goodgenpower."' order by npc,binary(name)"; -$querys[5] = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and intel>='".GameConst::$goodgenintel."' order by npc,binary(name)"; +$queries = []; +$queries[10] = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and power>='".GameConst::$goodgenpower."' order by npc,binary(name)"; +$queries[9] = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and intel>='".GameConst::$goodgenintel."' order by npc,binary(name)"; +$queries[8] = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and power>='".GameConst::$goodgenpower."' order by npc,binary(name)"; +$queries[7] = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and intel>='".GameConst::$goodgenintel."' order by npc,binary(name)"; +$queries[6] = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and power>='".GameConst::$goodgenpower."' order by npc,binary(name)"; +$queries[5] = "select no,name,level,city from general where nation='{$me['nation']}' and level!='12' and intel>='".GameConst::$goodgenintel."' order by npc,binary(name)"; for($i=10; $i >= $lv; $i--) { if($i % 2 == 0) { echo ""; } @@ -232,7 +234,7 @@ for($i=10; $i >= $lv; $i--) { @@ -208,9 +209,11 @@ echo " $query = "select npc,name,win from tournament where grp>=50 order by grp, grp_no"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), ""); +$cent = []; for ($i=0; $i < 1; $i++) { $cent[$i] = ""; } +$line = []; for ($i=0; $i < 2; $i++) { $general = MYDB_fetch_array($result); if ($general['name'] == "") { @@ -372,6 +375,7 @@ echo" $query = "select tournament,bet0,bet1,bet2,bet3,bet4,bet5,bet6,bet7,bet8,bet9,bet10,bet11,bet12,bet13,bet14,bet15,bet0+bet1+bet2+bet3+bet4+bet5+bet6+bet7+bet8+bet9+bet10+bet11+bet12+bet13+bet14+bet15 as bet from game limit 1"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), ""); $betting = MYDB_fetch_array($result); +$bet = []; for ($i=0; $i < 16; $i++) { $bet[$i] = @round($betting['bet'] / $betting["bet{$i}"], 2); if ($bet[$i] == 0) { diff --git a/hwe/c_myBossInfo.php b/hwe/c_myBossInfo.php index e2658c0d..bcfb1bbd 100644 --- a/hwe/c_myBossInfo.php +++ b/hwe/c_myBossInfo.php @@ -73,6 +73,8 @@ if($btn == "추방") { $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $nation = MYDB_fetch_array($result); + $alllog = []; + //이미 지정했다면 무시 if($nation["l{$meLevel}set"] == 0 && $general['level'] > 0 && $general['level'] < 12) { $query = "select no from diplomacy where me='{$general['nation']}' and state>='3' and state<='4'"; diff --git a/hwe/c_tournament.php b/hwe/c_tournament.php index af69bc96..5c6d72a7 100644 --- a/hwe/c_tournament.php +++ b/hwe/c_tournament.php @@ -108,10 +108,12 @@ if($btn == "자동개최설정" && $session->userGrade >= 5) { $query = "select grp from tournament where grp<10 group by grp having count(*)=8"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $grpCount = MYDB_num_rows($result); + $occupied = []; for($i=0; $i < $grpCount; $i++) { $grp = MYDB_fetch_array($result); $occupied[$grp['grp']] = 1; } + $map = []; for($i=0; $i < 8; $i++) { if($occupied[$i] == 0) { $map[] = $i; @@ -138,6 +140,7 @@ if($btn == "자동개최설정" && $session->userGrade >= 5) { } } elseif(($btn == "쪼렙전부투입" || $btn == "일반전부투입" || $btn == "굇수전부투입" || $btn == "랜덤전부투입") && $session->userGrade >= 5) { $z = 0; + $code = []; for($i=0; $i < 8; $i++) { $query = "select grp from tournament where grp='$i'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); diff --git a/hwe/d_cancel.php b/hwe/d_cancel.php index 173e77fc..16e039eb 100644 --- a/hwe/d_cancel.php +++ b/hwe/d_cancel.php @@ -55,7 +55,7 @@ $dip = MYDB_fetch_array($result); $mylog = []; $youlog = []; -$allog = []; +$alllog = []; $history = []; if($ok == "수락") { diff --git a/hwe/d_cease.php b/hwe/d_cease.php index d849f30d..94f70ab9 100644 --- a/hwe/d_cease.php +++ b/hwe/d_cease.php @@ -55,7 +55,7 @@ $dip = MYDB_fetch_array($result); $mylog = []; $youlog = []; -$allog = []; +$alllog = []; $history = []; if($ok == "수락") { diff --git a/hwe/d_merge.php b/hwe/d_merge.php index 132cbc42..9a822cf0 100644 --- a/hwe/d_merge.php +++ b/hwe/d_merge.php @@ -80,7 +80,7 @@ for($i=0; $i < $warcount; $i++) { $mylog = []; $youlog = []; -$allog = []; +$alllog = []; $history = []; if($ok == "수락") { diff --git a/hwe/d_surrender.php b/hwe/d_surrender.php index 30f1a5df..f565b191 100644 --- a/hwe/d_surrender.php +++ b/hwe/d_surrender.php @@ -71,7 +71,7 @@ for($i=0; $i < $warcount; $i++) { $mylog = []; $youlog = []; -$allog = []; +$alllog = []; $history = []; if($ok == "수락") { diff --git a/hwe/func_diplomacy.php b/hwe/func_diplomacy.php index 4e5ac8ac..700e8951 100644 --- a/hwe/func_diplomacy.php +++ b/hwe/func_diplomacy.php @@ -181,44 +181,44 @@ function declineScout($messageInfo, $reason=null){ return [true, 'success']; } -function acceptAlly($messageInfo, $general){ +function acceptAlly($messageInfo, $general, $msgResponse){ + return [false, 'NYI']; +} + +function declineAlly($messageInfo, $general, $msgResponse){ } -function declineAlly($messageInfo, $general){ +function acceptBreakAlly($messageInfo, $general, $msgResponse){ } -function acceptBreakAlly($messageInfo, $general){ +function declineBreakAlly($messageInfo, $general, $msgResponse){ } -function declineBreakAlly($messageInfo, $general){ +function acceptStopWar($messageInfo, $general, $msgResponse){ } -function acceptStopWar($messageInfo, $general){ - -} - -function declineStopWar($messageInfo, $general){ +function declineStopWar($messageInfo, $general, $msgResponse){ } -function acceptMergeNations($messageInfo, $general){ +function acceptMergeNations($messageInfo, $general, $msgResponse){ } -function declineMergeNations($messageInfo, $general){ +function declineMergeNations($messageInfo, $general, $msgResponse){ } -function acceptSurrender($messageInfo, $general){ +function acceptSurrender($messageInfo, $general, $msgResponse){ } -function declineSurrender($messageInfo, $general){ +function declineSurrender($messageInfo, $general, $msgResponse){ } \ No newline at end of file diff --git a/hwe/func_gamerule.php b/hwe/func_gamerule.php index 2b9567e0..12820c90 100644 --- a/hwe/func_gamerule.php +++ b/hwe/func_gamerule.php @@ -663,8 +663,7 @@ function checkWander() { $kingResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $king = MYDB_fetch_array($kingResult); - $log[0] = "●초반 제한후 방랑군은 자동 해산됩니다."; - pushGenLog($king, $log); + pushGenLog($king, ["●초반 제한후 방랑군은 자동 해산됩니다."]); process_56($king); } @@ -722,7 +721,7 @@ function checkMerge() { $query = "select no,name,nation from general where nation='{$you['nation']}'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $gencount = MYDB_num_rows($result); - $genlog[0] = "{$mynation['name']}(와)과 통합에 성공했습니다."; + $genlog = ["{$mynation['name']}(와)과 통합에 성공했습니다."]; for($i=0; $i < $gencount; $i++) { $gen = MYDB_fetch_array($result); pushGenLog($gen, $genlog); @@ -843,7 +842,7 @@ function checkSurrender() { $query = "select no,name,nation from general where nation='{$you['nation']}'"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $gencount = MYDB_num_rows($result); - $genlog[0] = "{$mynation['name']} 합병에 성공했습니다."; + $genlog = ["{$mynation['name']} 합병에 성공했습니다."]; for($i=0; $i < $gencount; $i++) { $gen = MYDB_fetch_array($result); pushGenLog($gen, $genlog); @@ -1243,7 +1242,7 @@ function checkEmperior() { } } - $log[0] = "●{$admin['year']}년 {$admin['month']}월: {$nation['name']}(이)가 전토를 통일하였습니다."; + $log = ["●{$admin['year']}년 {$admin['month']}월: {$nation['name']}(이)가 전토를 통일하였습니다."]; $query = "select no,name from general where nation='{$nation['nation']}' order by dedication desc"; $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); diff --git a/hwe/j_msg_decide_opt.php b/hwe/j_msg_decide_opt.php index 14fd9826..50b98c88 100644 --- a/hwe/j_msg_decide_opt.php +++ b/hwe/j_msg_decide_opt.php @@ -40,7 +40,7 @@ if(!$general){ ]); } -list($result, $messageInfo) = getSingleMessage($msgID, $general); +list($result, $messageInfo) = getSingleMessage($msgID); if (!$result) { Json::die([ diff --git a/hwe/join_post.php b/hwe/join_post.php index 1402b366..492750df 100644 --- a/hwe/join_post.php +++ b/hwe/join_post.php @@ -258,8 +258,7 @@ if ($genius) { pushGenLog($me, $mylog); pushGeneralPublicRecord($log, $admin['year'], $admin['month']); -$adminLog[0] = "가입 : {$userID} // {$name} // {$generalID}".getenv("REMOTE_ADDR"); -pushAdminLog($adminLog); +pushAdminLog(["가입 : {$userID} // {$name} // {$generalID}".getenv("REMOTE_ADDR")]); $rootDB->insert('member_log', [ 'member_no' => $userID, diff --git a/hwe/processing.php b/hwe/processing.php index 47713cb2..0f05e468 100644 --- a/hwe/processing.php +++ b/hwe/processing.php @@ -1632,6 +1632,8 @@ function command_48($turn, $command) { $me = MYDB_fetch_array($result); $city = getCity($me['city'], "secu"); + $color = []; + for($i=1; $i <= 6; $i++) { if($city['secu'] >= $i*1000) { $color[$i] = "white"; @@ -2009,6 +2011,8 @@ function command_61($turn, $command) { $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $count = MYDB_num_rows($result); + $diplomacy = []; + for($i=1; $i <= $count; $i++) { $dip = MYDB_fetch_array($result); $diplomacy[$dip['you']] = $dip['state']; @@ -2094,6 +2098,8 @@ function command_62($turn, $command) { $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $count = MYDB_num_rows($result); + $diplomacy = []; + for($i=1; $i <= $count; $i++) { $dip = MYDB_fetch_array($result); $diplomacy[$dip['you']] = $dip['state']; @@ -2159,6 +2165,8 @@ function command_63($turn, $command) { $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $count = MYDB_num_rows($result); + $diplomacy = []; + for($i=1; $i <= $count; $i++) { $dip = MYDB_fetch_array($result); $diplomacy[$dip['you']] = $dip['state']; @@ -2218,6 +2226,8 @@ function command_64($turn, $command) { $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $count = MYDB_num_rows($result); + $diplomacy = []; + for($i=1; $i <= $count; $i++) { $dip = MYDB_fetch_array($result); $diplomacy[$dip['you']] = $dip['state']; @@ -2564,6 +2574,8 @@ function command_75($turn, $command) { $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $count = MYDB_num_rows($result); + $diplomacy = []; + for($i=1; $i <= $count; $i++) { $dip = MYDB_fetch_array($result); $diplomacy[$dip['you']] = $dip['state']; @@ -2624,6 +2636,8 @@ function command_77($turn, $command) { $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $count = MYDB_num_rows($result); + $diplomacy = []; + for($i=1; $i <= $count; $i++) { $dip = MYDB_fetch_array($result); $diplomacy[$dip['you']] = $dip['state']; @@ -2684,6 +2698,8 @@ function command_78($turn, $command) { $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $count = MYDB_num_rows($result); + $diplomacy = []; + for($i=1; $i <= $count; $i++) { $dip = MYDB_fetch_array($result); $diplomacy[$dip['you']] = $dip['state']; diff --git a/i_entrance/j_change_password.php b/i_entrance/j_change_password.php index 91aebd16..c95622df 100644 --- a/i_entrance/j_change_password.php +++ b/i_entrance/j_change_password.php @@ -12,7 +12,7 @@ $userID = Session::getUserID(); $pw = $_POST['old_pw']; $newPw = $_POST['new_pw']; -$response['result'] = false; +$response = ['result' => false]; $db = RootDB::db();