string 내의 $ 호출들 일괄 변환.

This commit is contained in:
2018-01-16 03:56:50 +09:00
parent c73a3bcf95
commit 28eaf7b0d7
119 changed files with 6485 additions and 6479 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
SAM=hwe SAM=hwe
SRC=~/svn/branches/che_devel/ SRC=~/svn/branches/che_devel/
TAR=~/www/sam/${SAM}_close/ TAR=~/www/sam/${SAM}/
ALT=~/www/sam/${SAM}/ ALT=~/www/sam/${SAM}/
if [ -e $TAR ] if [ -e $TAR ]
+1 -1
View File
@@ -1,7 +1,7 @@
<?php <?php
// 외부 파라미터 // 외부 파라미터
// $_POST['serverDir'] : 로그인할 서버 디렉토리 // $_POST['serverDir'] : 로그인할 서버 디렉토리
$serverDir = $_POST['serverDir']; //$serverDir = $_POST['serverDir']; //TODO:쓸모 없어보이는데?
require_once('_common.php'); require_once('_common.php');
require_once(ROOT.W.F_FUNC.W.'class._JSON.php'); require_once(ROOT.W.F_FUNC.W.'class._JSON.php');
+1 -1
View File
@@ -36,7 +36,7 @@ if($member['PICTURE'] == '') {
$response['donation'] = ''; $response['donation'] = '';
$rs = $DB->Select('DATE, AMOUNT, CUMUL', 'DONATION', "ID='{$member[ID]}'"); $rs = $DB->Select('DATE, AMOUNT, CUMUL', 'DONATION', "ID='{$member['ID']}'");
$count = $DB->Count($rs); $count = $DB->Count($rs);
if($count > 0) { if($count > 0) {
$response['donation'] = ' $response['donation'] = '
+5 -5
View File
@@ -4,11 +4,11 @@ include "func.php";
$connect=dbConn(); $connect=dbConn();
$query = "select userlevel from general where user_id='$_SESSION[p_id]'"; $query = "select userlevel from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
if($me[userlevel] < 5) { if($me['userlevel'] < 5) {
echo " echo "
<html> <html>
<head> <head>
@@ -44,10 +44,10 @@ $plock = MYDB_fetch_array($result);
</head> </head>
<body oncontextmenu='return false'> <body oncontextmenu='return false'>
<form action=_119_b.php method=post> <form action=_119_b.php method=post>
시간조정 : <input type=text size=3 name=minute><input type=submit name=btn value='분당김'><input type=submit name=btn value='분지연'> 최종갱신 : <?=$admin[turntime];?><br> 시간조정 : <input type=text size=3 name=minute><input type=submit name=btn value='분당김'><input type=submit name=btn value='분지연'> 최종갱신 : <?=$admin['turntime'];?><br>
시간조정 : <input type=text size=3 name=minute2><input type=submit name=btn value='토너분당김'><input type=submit name=btn value='토너분지연'> 토너먼트 : <?=$admin[tnmt_time];?><br> 시간조정 : <input type=text size=3 name=minute2><input type=submit name=btn value='토너분당김'><input type=submit name=btn value='토너분지연'> 토너먼트 : <?=$admin['tnmt_time'];?><br>
봉급지급 : <input type=submit name=btn value='금지급'><input type=submit name=btn value='쌀지급'><br> 봉급지급 : <input type=submit name=btn value='금지급'><input type=submit name=btn value='쌀지급'><br>
락 풀 기 : <input type=submit name=btn value='락걸기'><input type=submit name=btn value='락풀기'> 현재 : <?=$plock[plock]>0?"동결중":"가동중";?><br> 락 풀 기 : <input type=submit name=btn value='락걸기'><input type=submit name=btn value='락풀기'> 현재 : <?=$plock['plock']>0?"동결중":"가동중";?><br>
</form> </form>
</body> </body>
</html> </html>
+2 -2
View File
@@ -4,11 +4,11 @@ include "func.php";
$connect=dbConn(); $connect=dbConn();
$query = "select userlevel from general where user_id='$_SESSION[p_id]'"; $query = "select userlevel from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
if($me[userlevel] < 5) { if($me['userlevel'] < 5) {
echo "<script>location.replace('_119.php');</script>"; echo "<script>location.replace('_119.php');</script>";
} }
+11 -11
View File
@@ -5,11 +5,11 @@ include "func.php";
CheckLogin(); CheckLogin();
$connect = dbConn(); $connect = dbConn();
$query = "select userlevel from general where user_id='$_SESSION[p_id]'"; $query = "select userlevel from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
if($me[userlevel] < 5) { if($me['userlevel'] < 5) {
echo " echo "
<html> <html>
<head> <head>
@@ -43,7 +43,7 @@ $admin = getAdmin($connect);
<form name=form1 method=post action=_admin1_submit.php> <form name=form1 method=post action=_admin1_submit.php>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0> <table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td width=110 align=right>운영자메세지</td> <tr><td width=110 align=right>운영자메세지</td>
<td colspan=3><input type=textarea size=90 style=color:white;background-color:black; name=msg value='<?=$admin[msg];?>'><input type=submit name=btn value=변경></td></td> <td colspan=3><input type=textarea size=90 style=color:white;background-color:black; name=msg value='<?=$admin['msg'];?>'><input type=submit name=btn value=변경></td></td>
</tr> </tr>
<tr><td width=110 align=right>중원정세추가</td> <tr><td width=110 align=right>중원정세추가</td>
<td colspan=3><input type=textarea size=90 maxlength=80 style=color:white;background-color:black; name=log><input type=submit name=btn value=로그쓰기></td></td> <td colspan=3><input type=textarea size=90 maxlength=80 style=color:white;background-color:black; name=log><input type=submit name=btn value=로그쓰기></td></td>
@@ -53,27 +53,27 @@ $admin = getAdmin($connect);
</tr> </tr>
<tr> <tr>
<td width=110 align=right>시작시간변경</td> <td width=110 align=right>시작시간변경</td>
<td width=285><input type=text size=20 maxlength=20 style=color:white;background-color:black;text-align:right; name=starttime value='<?=$admin[starttime];?>'><input type=submit name=btn value=변경1></td> <td width=285><input type=text size=20 maxlength=20 style=color:white;background-color:black;text-align:right; name=starttime value='<?=$admin['starttime'];?>'><input type=submit name=btn value=변경1></td>
<td width=110 align=right>현재도시훈사</td> <td width=110 align=right>현재도시훈사</td>
<td width=285><?=$admin[city_rate];?></td> <td width=285><?=$admin['city_rate'];?></td>
</tr> </tr>
<tr> <tr>
<td width=110 align=right>최대 장수</td> <td width=110 align=right>최대 장수</td>
<td width=285><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=maxgeneral value=<?=$admin[maxgeneral];?>><input type=submit name=btn value=변경2></td> <td width=285><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=maxgeneral value=<?=$admin['maxgeneral'];?>><input type=submit name=btn value=변경2></td>
<td width=110 align=right>최대 국가</td> <td width=110 align=right>최대 국가</td>
<td width=285><input type=text size=3 maxlength=2 style=color:white;background-color:black;text-align:right; name=maxnation value=<?=$admin[maxnation];?>><input type=submit name=btn value=변경3></td> <td width=285><input type=text size=3 maxlength=2 style=color:white;background-color:black;text-align:right; name=maxnation value=<?=$admin['maxnation'];?>><input type=submit name=btn value=변경3></td>
</tr> </tr>
<tr> <tr>
<td width=110 align=right>기준 장수수</td> <td width=110 align=right>기준 장수수</td>
<td width=285><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=gen_rate value=<?=$admin[normgeneral];?>><input type=submit name=btn value=변경5></td> <td width=285><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=gen_rate value=<?=$admin['normgeneral'];?>><input type=submit name=btn value=변경5></td>
<td width=110 align=right>현재 수입률</td> <td width=110 align=right>현재 수입률</td>
<td width=285><?=$admin[gold_rate];?>%</td> <td width=285><?=$admin['gold_rate'];?>%</td>
</tr> </tr>
<tr> <tr>
<td width=110 align=right>시작 년도</td> <td width=110 align=right>시작 년도</td>
<td width=285><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=startyear value='<?=$admin[startyear];?>'><input type=submit name=btn value=변경4></td> <td width=285><input type=text size=3 maxlength=3 style=color:white;background-color:black;text-align:right; name=startyear value='<?=$admin['startyear'];?>'><input type=submit name=btn value=변경4></td>
<td width=110 align=right>최근 갱신 시간</td> <td width=110 align=right>최근 갱신 시간</td>
<td width=285>&nbsp;<?=$admin[turntime]?></td> <td width=285>&nbsp;<?=$admin['turntime']?></td>
</tr> </tr>
<tr> <tr>
<td width=110 align=right>턴시간</td> <td width=110 align=right>턴시간</td>
+10 -10
View File
@@ -7,11 +7,11 @@ $connect = dbConn();
$admin = getAdmin($connect); $admin = getAdmin($connect);
$query = "select userlevel from general where user_id='$_SESSION[p_id]'"; $query = "select userlevel from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
if($me[userlevel] < 5) { if($me['userlevel'] < 5) {
echo "<script>location.replace('_admin1.php');</script>"; echo "<script>location.replace('_admin1.php');</script>";
} }
@@ -26,7 +26,7 @@ switch($btn) {
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break; break;
case "로그쓰기": case "로그쓰기":
$lognum = $admin[historyindex] + 1; $lognum = $admin['historyindex'] + 1;
if($lognum >= 29) { $lognum = 0; } if($lognum >= 29) { $lognum = 0; }
$history[0] = "<R>★</><S>{$log}</>"; $history[0] = "<R>★</><S>{$log}</>";
pushHistory($connect, $history); pushHistory($connect, $history);
@@ -69,20 +69,20 @@ switch($btn) {
case "60분턴": $turnterm = 1; $unit = 3600; break; case "60분턴": $turnterm = 1; $unit = 3600; break;
case "120분턴": $turnterm = 0; $unit = 7200; break; case "120분턴": $turnterm = 0; $unit = 7200; break;
} }
$turn = ($admin[year] - $admin[startyear]) * 12 + $admin[month] - 1; $turn = ($admin['year'] - $admin['startyear']) * 12 + $admin['month'] - 1;
$starttime = date("Y-m-d H:i:s", strtotime($admin[turntime]) - $turn * $unit); $starttime = date("Y-m-d H:i:s", strtotime($admin['turntime']) - $turn * $unit);
$starttime = cutTurn($starttime, $turnterm); $starttime = cutTurn($starttime, $turnterm);
$query = "update game set turnterm='$turnterm',starttime='$starttime' where no='1'"; $query = "update game set turnterm='$turnterm',starttime='$starttime' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 턴시간이 길어지는 경우 랜덤턴 배정 // 턴시간이 길어지는 경우 랜덤턴 배정
if($turnterm < $admin[turnterm]) { if($turnterm < $admin['turnterm']) {
$query = "select no from general"; $query = "select no from general";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) { for($i=0; $i < $count; $i++) {
$gen = MYDB_fetch_array($result); $gen = MYDB_fetch_array($result);
$turntime = getRandTurn($turnterm); $turntime = getRandTurn($turnterm);
$query = "update general set turntime='$turntime' where no='$gen[no]'"; $query = "update general set turntime='$turntime' where no='$gen['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
// 턴시간이 너무 멀리 떨어진 선수 제대로 보정 // 턴시간이 너무 멀리 떨어진 선수 제대로 보정
@@ -92,10 +92,10 @@ switch($btn) {
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) { for($i=0; $i < $count; $i++) {
$gen = MYDB_fetch_array($result); $gen = MYDB_fetch_array($result);
$num = floor((strtotime($gen[turntime]) - strtotime($admin[turntime])) / $unit); $num = floor((strtotime($gen['turntime']) - strtotime($admin['turntime'])) / $unit);
if($num > 0) { if($num > 0) {
$gen[turntime] = date("Y-m-d H:i:s", strtotime($gen[turntime]) - $unit * $num); $gen['turntime'] = date("Y-m-d H:i:s", strtotime($gen['turntime']) - $unit * $num);
$query = "update general set turntime='$gen[turntime]' where no='$gen[no]'"; $query = "update general set turntime='$gen['turntime']' where no='$gen['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
} }
+9 -9
View File
@@ -5,11 +5,11 @@ include "func.php";
CheckLogin(); CheckLogin();
$connect = dbConn(); $connect = dbConn();
$query = "select userlevel from general where user_id='$_SESSION[p_id]'"; $query = "select userlevel from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
if($me[userlevel] < 5) { if($me['userlevel'] < 5) {
echo " echo "
<html> <html>
<head> <head>
@@ -51,7 +51,7 @@ $admin = MYDB_fetch_array($result);
<tr> <tr>
<td width=80 align=center>제한등급</td> <td width=80 align=center>제한등급</td>
<td width=713 align=center> <td width=713 align=center>
<input type=text size=3 maxlength=3 name=conweight value=<?=$admin[conweight];?> style=color:white;background-color:black;font-size:13;> <input type=text size=3 maxlength=3 name=conweight value=<?=$admin['conweight'];?> style=color:white;background-color:black;font-size:13;>
<input type=submit name=btn value='접속가중치'> <input type=submit name=btn value='접속가중치'>
</td> </td>
</tr> </tr>
@@ -72,14 +72,14 @@ $gencount = MYDB_num_rows($result);
for($i=0; $i < $gencount; $i++) { for($i=0; $i < $gencount; $i++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$style = "style=;"; $style = "style=;";
if($general[block] > 0) { $style .= "background-color:red;"; } if($general['block'] > 0) { $style .= "background-color:red;"; }
if($general[npc] >= 2) { $style .= "color:cyan;"; } if($general['npc'] >= 2) { $style .= "color:cyan;"; }
elseif($general[npc] == 1) { $style .= "color:skyblue;"; } elseif($general['npc'] == 1) { $style .= "color:skyblue;"; }
if($general[con] > $admin[conlimit]) { $style .= "color:red;"; } if($general['con'] > $admin['conlimit']) { $style .= "color:red;"; }
if($general[userlevel] > 2) { $style .= "color:blue;"; } if($general['userlevel'] > 2) { $style .= "color:blue;"; }
echo " echo "
<option value=$general[no] $style>$general[name]</option>"; <option value=$general['no'] $style>$general['name']</option>";
} }
echo " echo "
+50 -50
View File
@@ -5,11 +5,11 @@ include "func.php";
CheckLogin(); CheckLogin();
$connect = dbConn(); $connect = dbConn();
$query = "select userlevel from general where user_id='$_SESSION[p_id]'"; $query = "select userlevel from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
if($me[userlevel] < 5) { if($me['userlevel'] < 5) {
echo "<script>location.replace('_admin2.php');</script>"; echo "<script>location.replace('_admin2.php');</script>";
} }
@@ -40,7 +40,7 @@ switch($btn) {
$query = "select user_id from general where no='$genlist[$i]'"; $query = "select user_id from general where no='$genlist[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen = MYDB_fetch_array($result); $gen = MYDB_fetch_array($result);
$uid[$i] = $gen[user_id]; $uid[$i] = $gen['user_id'];
} }
$connect = dbConn("sammo"); $connect = dbConn("sammo");
$date = date('Y-m-d H:i:s'); $date = date('Y-m-d H:i:s');
@@ -58,7 +58,7 @@ switch($btn) {
$query = "select user_id from general where no='$genlist[$i]'"; $query = "select user_id from general where no='$genlist[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen = MYDB_fetch_array($result); $gen = MYDB_fetch_array($result);
$uid[$i] = $gen[user_id]; $uid[$i] = $gen['user_id'];
} }
$connect = dbConn("sammo"); $connect = dbConn("sammo");
$date = date('Y-m-d H:i:s'); $date = date('Y-m-d H:i:s');
@@ -76,7 +76,7 @@ switch($btn) {
$query = "select user_id from general where no='$genlist[$i]'"; $query = "select user_id from general where no='$genlist[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen = MYDB_fetch_array($result); $gen = MYDB_fetch_array($result);
$uid[$i] = $gen[user_id]; $uid[$i] = $gen['user_id'];
} }
$connect = dbConn("sammo"); $connect = dbConn("sammo");
$date = date('Y-m-d H:i:s'); $date = date('Y-m-d H:i:s');
@@ -110,9 +110,9 @@ switch($btn) {
$you = MYDB_fetch_array($result); $you = MYDB_fetch_array($result);
$msg = $btn." 지급!"; $msg = $btn." 지급!";
// 상대에게 발송 // 상대에게 발송
$you[msgindex]++; $you['msgindex']++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; } if($you['msgindex'] >= 10) { $you['msgindex'] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date' where no='$genlist[$i]'"; $query = "update general set msgindex='$you['msgindex']',msg{$you['msgindex']}_type=10,msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_who='$genlist[$i]'+10000,msg{$you['msgindex']}_when='$date' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
for($i=0; $i < sizeof($genlist); $i++) { for($i=0; $i < sizeof($genlist); $i++) {
@@ -120,13 +120,13 @@ switch($btn) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$special2 = getSpecial2($connect, $general[leader], $general[power], $general[intel]); $special2 = getSpecial2($connect, $general['leader'], $general['power'], $general['intel']);
$query = "update general set specage2=age,special2='$special2' where no='$general[no]'"; $query = "update general set specage2=age,special2='$special2' where no='$general['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$log[0] = "<C>●</>특기 【<b><L>".getGenSpecial($special2)."</></b>】(을)를 익혔습니다!"; $log[0] = "<C>●</>특기 【<b><L>".getGenSpecial($special2)."</></b>】(을)를 익혔습니다!";
$general = addHistory($connect, $general, "<C>●</>$admin[year]$admin[month]월:특기 【<b><C>".getGenSpecial($special2)."</></b>】(을)를 습득"); $general = addHistory($connect, $general, "<C>●</>$admin['year']$admin['month']월:특기 【<b><C>".getGenSpecial($special2)."</></b>】(을)를 습득");
pushGenLog($general, $log); pushGenLog($general, $log);
} }
break; break;
@@ -137,9 +137,9 @@ switch($btn) {
$you = MYDB_fetch_array($result); $you = MYDB_fetch_array($result);
$msg = $btn." 지급!"; $msg = $btn." 지급!";
// 상대에게 발송 // 상대에게 발송
$you[msgindex]++; $you['msgindex']++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; } if($you['msgindex'] >= 10) { $you['msgindex'] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date' where no='$genlist[$i]'"; $query = "update general set msgindex='$you['msgindex']',msg{$you['msgindex']}_type=10,msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_who='$genlist[$i]'+10000,msg{$you['msgindex']}_when='$date' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
for($i=0; $i < sizeof($genlist); $i++) { for($i=0; $i < sizeof($genlist); $i++) {
@@ -154,9 +154,9 @@ switch($btn) {
$you = MYDB_fetch_array($result); $you = MYDB_fetch_array($result);
$msg = $btn." 지급!"; $msg = $btn." 지급!";
// 상대에게 발송 // 상대에게 발송
$you[msgindex]++; $you['msgindex']++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; } if($you['msgindex'] >= 10) { $you['msgindex'] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date' where no='$genlist[$i]'"; $query = "update general set msgindex='$you['msgindex']',msg{$you['msgindex']}_type=10,msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_who='$genlist[$i]'+10000,msg{$you['msgindex']}_when='$date' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
for($i=0; $i < sizeof($genlist); $i++) { for($i=0; $i < sizeof($genlist); $i++) {
@@ -171,9 +171,9 @@ switch($btn) {
$you = MYDB_fetch_array($result); $you = MYDB_fetch_array($result);
$msg = "보병숙련도+10000 지급!"; $msg = "보병숙련도+10000 지급!";
// 상대에게 발송 // 상대에게 발송
$you[msgindex]++; $you['msgindex']++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; } if($you['msgindex'] >= 10) { $you['msgindex'] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date' where no='$genlist[$i]'"; $query = "update general set msgindex='$you['msgindex']',msg{$you['msgindex']}_type=10,msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_who='$genlist[$i]'+10000,msg{$you['msgindex']}_when='$date' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
for($i=0; $i < sizeof($genlist); $i++) { for($i=0; $i < sizeof($genlist); $i++) {
@@ -188,9 +188,9 @@ switch($btn) {
$you = MYDB_fetch_array($result); $you = MYDB_fetch_array($result);
$msg = "궁병숙련도+10000 지급!"; $msg = "궁병숙련도+10000 지급!";
// 상대에게 발송 // 상대에게 발송
$you[msgindex]++; $you['msgindex']++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; } if($you['msgindex'] >= 10) { $you['msgindex'] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date' where no='$genlist[$i]'"; $query = "update general set msgindex='$you['msgindex']',msg{$you['msgindex']}_type=10,msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_who='$genlist[$i]'+10000,msg{$you['msgindex']}_when='$date' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
for($i=0; $i < sizeof($genlist); $i++) { for($i=0; $i < sizeof($genlist); $i++) {
@@ -205,9 +205,9 @@ switch($btn) {
$you = MYDB_fetch_array($result); $you = MYDB_fetch_array($result);
$msg = "기병숙련도+10000 지급!"; $msg = "기병숙련도+10000 지급!";
// 상대에게 발송 // 상대에게 발송
$you[msgindex]++; $you['msgindex']++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; } if($you['msgindex'] >= 10) { $you['msgindex'] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date' where no='$genlist[$i]'"; $query = "update general set msgindex='$you['msgindex']',msg{$you['msgindex']}_type=10,msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_who='$genlist[$i]'+10000,msg{$you['msgindex']}_when='$date' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
for($i=0; $i < sizeof($genlist); $i++) { for($i=0; $i < sizeof($genlist); $i++) {
@@ -222,9 +222,9 @@ switch($btn) {
$you = MYDB_fetch_array($result); $you = MYDB_fetch_array($result);
$msg = "귀병숙련도+10000 지급!"; $msg = "귀병숙련도+10000 지급!";
// 상대에게 발송 // 상대에게 발송
$you[msgindex]++; $you['msgindex']++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; } if($you['msgindex'] >= 10) { $you['msgindex'] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date' where no='$genlist[$i]'"; $query = "update general set msgindex='$you['msgindex']',msg{$you['msgindex']}_type=10,msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_who='$genlist[$i]'+10000,msg{$you['msgindex']}_when='$date' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
for($i=0; $i < sizeof($genlist); $i++) { for($i=0; $i < sizeof($genlist); $i++) {
@@ -239,9 +239,9 @@ switch($btn) {
$you = MYDB_fetch_array($result); $you = MYDB_fetch_array($result);
$msg = "차병숙련도+10000 지급!"; $msg = "차병숙련도+10000 지급!";
// 상대에게 발송 // 상대에게 발송
$you[msgindex]++; $you['msgindex']++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; } if($you['msgindex'] >= 10) { $you['msgindex'] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date' where no='$genlist[$i]'"; $query = "update general set msgindex='$you['msgindex']',msg{$you['msgindex']}_type=10,msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_who='$genlist[$i]'+10000,msg{$you['msgindex']}_when='$date' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
for($i=0; $i < sizeof($genlist); $i++) { for($i=0; $i < sizeof($genlist); $i++) {
@@ -280,9 +280,9 @@ switch($btn) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result); $you = MYDB_fetch_array($result);
// 상대에게 발송 // 상대에게 발송
$you[msgindex]++; $you['msgindex']++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; } if($you['msgindex'] >= 10) { $you['msgindex'] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date',newmsg=1 where no='$genlist[$i]'"; $query = "update general set msgindex='$you['msgindex']',msg{$you['msgindex']}_type=10,msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_who='$genlist[$i]'+10000,msg{$you['msgindex']}_when='$date',newmsg=1 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
break; break;
@@ -295,9 +295,9 @@ switch($btn) {
if($weap == 0) { $msg = "무기 회수!"; } if($weap == 0) { $msg = "무기 회수!"; }
else { $msg = getWeapName($weap)." 지급!"; } else { $msg = getWeapName($weap)." 지급!"; }
// 상대에게 발송 // 상대에게 발송
$you[msgindex]++; $you['msgindex']++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; } if($you['msgindex'] >= 10) { $you['msgindex'] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date' where no='$genlist[$i]'"; $query = "update general set msgindex='$you['msgindex']',msg{$you['msgindex']}_type=10,msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_who='$genlist[$i]'+10000,msg{$you['msgindex']}_when='$date' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
for($i=0; $i < sizeof($genlist); $i++) { for($i=0; $i < sizeof($genlist); $i++) {
@@ -318,9 +318,9 @@ switch($btn) {
if($weap == 0) { $msg = "서적 회수!"; } if($weap == 0) { $msg = "서적 회수!"; }
else { $msg = getBookName($weap)." 지급!"; } else { $msg = getBookName($weap)." 지급!"; }
// 상대에게 발송 // 상대에게 발송
$you[msgindex]++; $you['msgindex']++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; } if($you['msgindex'] >= 10) { $you['msgindex'] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date' where no='$genlist[$i]'"; $query = "update general set msgindex='$you['msgindex']',msg{$you['msgindex']}_type=10,msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_who='$genlist[$i]'+10000,msg{$you['msgindex']}_when='$date' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
for($i=0; $i < sizeof($genlist); $i++) { for($i=0; $i < sizeof($genlist); $i++) {
@@ -341,9 +341,9 @@ switch($btn) {
if($weap == 0) { $msg = "말 회수!"; } if($weap == 0) { $msg = "말 회수!"; }
else { $msg = getHorseName($weap)." 지급!"; } else { $msg = getHorseName($weap)." 지급!"; }
// 상대에게 발송 // 상대에게 발송
$you[msgindex]++; $you['msgindex']++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; } if($you['msgindex'] >= 10) { $you['msgindex'] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date' where no='$genlist[$i]'"; $query = "update general set msgindex='$you['msgindex']',msg{$you['msgindex']}_type=10,msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_who='$genlist[$i]'+10000,msg{$you['msgindex']}_when='$date' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
for($i=0; $i < sizeof($genlist); $i++) { for($i=0; $i < sizeof($genlist); $i++) {
@@ -364,9 +364,9 @@ switch($btn) {
if($weap == 0) { $msg = "특수도구 회수!"; } if($weap == 0) { $msg = "특수도구 회수!"; }
else { $msg = getItemName($weap)." 지급!"; } else { $msg = getItemName($weap)." 지급!"; }
// 상대에게 발송 // 상대에게 발송
$you[msgindex]++; $you['msgindex']++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; } if($you['msgindex'] >= 10) { $you['msgindex'] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date' where no='$genlist[$i]'"; $query = "update general set msgindex='$you['msgindex']',msg{$you['msgindex']}_type=10,msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_who='$genlist[$i]'+10000,msg{$you['msgindex']}_when='$date' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
for($i=0; $i < sizeof($genlist); $i++) { for($i=0; $i < sizeof($genlist); $i++) {
@@ -408,8 +408,8 @@ switch($btn) {
$admin = MYDB_fetch_array($result); $admin = MYDB_fetch_array($result);
for($i=0; $i < sizeof($genlist); $i++) { for($i=0; $i < sizeof($genlist); $i++) {
$turntime = getRandTurn($admin[turnterm]); $turntime = getRandTurn($admin['turnterm']);
$cutTurn = cutTurn($turntime, $admin[turnterm]); $cutTurn = cutTurn($turntime, $admin['turnterm']);
$query = "update general set turntime='$cutTurn' where no='$genlist[$i]'"; $query = "update general set turntime='$cutTurn' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
@@ -420,7 +420,7 @@ switch($btn) {
$admin = MYDB_fetch_array($result); $admin = MYDB_fetch_array($result);
for($i=0; $i < sizeof($genlist); $i++) { for($i=0; $i < sizeof($genlist); $i++) {
$turntime = getRandTurn($admin[turnterm]); $turntime = getRandTurn($admin['turnterm']);
$query = "update general set turntime='$turntime' where no='$genlist[$i]'"; $query = "update general set turntime='$turntime' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
+5 -5
View File
@@ -5,11 +5,11 @@ include "func.php";
CheckLogin(); CheckLogin();
$connect = dbConn(); $connect = dbConn();
$query = "select userlevel from general where user_id='$_SESSION[p_id]'"; $query = "select userlevel from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
if($me[userlevel] < 5) { if($me['userlevel'] < 5) {
echo " echo "
<html> <html>
<head> <head>
@@ -55,12 +55,12 @@ $gencount = MYDB_num_rows($result);
for($i=0; $i < $gencount; $i++) { for($i=0; $i < $gencount; $i++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
if($general[power] >= $general[intel]) { if($general['power'] >= $general['intel']) {
echo " echo "
<option value=$general[no] style=color:orange;>$general[name]</option>"; <option value=$general['no'] style=color:orange;>$general['name']</option>";
} else { } else {
echo " echo "
<option value=$general[no] style=color:skyblue;>$general[name]</option>"; <option value=$general['no'] style=color:skyblue;>$general['name']</option>";
} }
} }
+17 -17
View File
@@ -7,11 +7,11 @@ $connect = dbConn();
$admin = getAdmin($connect); $admin = getAdmin($connect);
$query = "select userlevel from general where user_id='$_SESSION[p_id]'"; $query = "select userlevel from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
if($me[userlevel] < 4) { if($me['userlevel'] < 4) {
echo "<script>location.replace('_admin3.php');</script>"; echo "<script>location.replace('_admin3.php');</script>";
} }
@@ -25,9 +25,9 @@ switch($btn) {
if($weap == 0) { $msg = "무기 회수!"; } if($weap == 0) { $msg = "무기 회수!"; }
else { $msg = getWeapName($weap)." 지급!"; } else { $msg = getWeapName($weap)." 지급!"; }
// 상대에게 발송 // 상대에게 발송
$you[msgindex]++; $you['msgindex']++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; } if($you['msgindex'] >= 10) { $you['msgindex'] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date' where no='$genlist[$i]'"; $query = "update general set msgindex='$you['msgindex']',msg{$you['msgindex']}_type=10,msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_who='$genlist[$i]'+10000,msg{$you['msgindex']}_when='$date' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
for($i=0; $i < sizeof($genlist); $i++) { for($i=0; $i < sizeof($genlist); $i++) {
@@ -48,9 +48,9 @@ switch($btn) {
if($weap == 0) { $msg = "서적 회수!"; } if($weap == 0) { $msg = "서적 회수!"; }
else { $msg = getBookName($weap)." 지급!"; } else { $msg = getBookName($weap)." 지급!"; }
// 상대에게 발송 // 상대에게 발송
$you[msgindex]++; $you['msgindex']++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; } if($you['msgindex'] >= 10) { $you['msgindex'] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date' where no='$genlist[$i]'"; $query = "update general set msgindex='$you['msgindex']',msg{$you['msgindex']}_type=10,msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_who='$genlist[$i]'+10000,msg{$you['msgindex']}_when='$date' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
for($i=0; $i < sizeof($genlist); $i++) { for($i=0; $i < sizeof($genlist); $i++) {
@@ -71,9 +71,9 @@ switch($btn) {
if($weap == 0) { $msg = "말 회수!"; } if($weap == 0) { $msg = "말 회수!"; }
else { $msg = getHorseName($weap)." 지급!"; } else { $msg = getHorseName($weap)." 지급!"; }
// 상대에게 발송 // 상대에게 발송
$you[msgindex]++; $you['msgindex']++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; } if($you['msgindex'] >= 10) { $you['msgindex'] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date' where no='$genlist[$i]'"; $query = "update general set msgindex='$you['msgindex']',msg{$you['msgindex']}_type=10,msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_who='$genlist[$i]'+10000,msg{$you['msgindex']}_when='$date' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
for($i=0; $i < sizeof($genlist); $i++) { for($i=0; $i < sizeof($genlist); $i++) {
@@ -94,9 +94,9 @@ switch($btn) {
if($weap == 0) { $msg = "특수도구 회수!"; } if($weap == 0) { $msg = "특수도구 회수!"; }
else { $msg = getItemName($weap)." 지급!"; } else { $msg = getItemName($weap)." 지급!"; }
// 상대에게 발송 // 상대에게 발송
$you[msgindex]++; $you['msgindex']++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; } if($you['msgindex'] >= 10) { $you['msgindex'] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date' where no='$genlist[$i]'"; $query = "update general set msgindex='$you['msgindex']',msg{$you['msgindex']}_type=10,msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_who='$genlist[$i]'+10000,msg{$you['msgindex']}_when='$date' where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
for($i=0; $i < sizeof($genlist); $i++) { for($i=0; $i < sizeof($genlist); $i++) {
@@ -121,9 +121,9 @@ switch($btn) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result); $you = MYDB_fetch_array($result);
// 상대에게 발송 // 상대에게 발송
$you[msgindex]++; $you['msgindex']++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; } if($you['msgindex'] >= 10) { $you['msgindex'] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date',newmsg=1 where no='$genlist[$i]'"; $query = "update general set msgindex='$you['msgindex']',msg{$you['msgindex']}_type=10,msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_who='$genlist[$i]'+10000,msg{$you['msgindex']}_when='$date',newmsg=1 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
break; break;
+21 -21
View File
@@ -5,11 +5,11 @@ include "func.php";
CheckLogin(); CheckLogin();
$connect = dbConn(); $connect = dbConn();
$query = "select userlevel from general where user_id='$_SESSION[p_id]'"; $query = "select userlevel from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
if($me[userlevel] < 5) { if($me['userlevel'] < 5) {
echo " echo "
<html> <html>
<head> <head>
@@ -59,14 +59,14 @@ $gencount = MYDB_num_rows($result);
for($i=0; $i < $gencount; $i++) { for($i=0; $i < $gencount; $i++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$style = "style=;"; $style = "style=;";
if($general[block] > 0) { $style .= "background-color:red;"; } if($general['block'] > 0) { $style .= "background-color:red;"; }
if($general[npc] >= 2) { $style .= "color:cyan;"; } if($general['npc'] >= 2) { $style .= "color:cyan;"; }
elseif($general[npc] == 1) { $style .= "color:skyblue;"; } elseif($general['npc'] == 1) { $style .= "color:skyblue;"; }
if($general[con] > $admin[conlimit]) { $style .= "color:red;"; } if($general['con'] > $admin['conlimit']) { $style .= "color:red;"; }
if($general[userlevel] > 2) { $style .= "color:blue;"; } if($general['userlevel'] > 2) { $style .= "color:blue;"; }
echo " echo "
<option value=$general[no] $style>$general[name]</option>"; <option value=$general['no'] $style>$general['name']</option>";
} }
echo " echo "
@@ -114,12 +114,12 @@ for($i=0; $i < $ipCount; $i++) {
$genCount = MYDB_num_rows($genResult); $genCount = MYDB_num_rows($genResult);
for($k=0; $k < $genCount; $k++) { for($k=0; $k < $genCount; $k++) {
$gen = MYDB_fetch_array($genResult); $gen = MYDB_fetch_array($genResult);
if($gen[block] > 0) $genName .= "<font color=magenta>{$gen[name]}</font><br>"; if($gen['block'] > 0) $genName .= "<font color=magenta>{$gen['name']}</font><br>";
else $genName .= $gen[name]."<br>"; else $genName .= $gen['name']."<br>";
$genDate .= $gen[lastconnect]."<br>"; $genDate .= $gen['lastconnect']."<br>";
$genIP .= $gen[ip]."<br>"; $genIP .= $gen['ip']."<br>";
$genID .= $gen[user_id]."<br>"; $genID .= $gen['user_id']."<br>";
$conMsg .= $gen[conmsg]."<br>"; $conMsg .= $gen['conmsg']."<br>";
} }
$genName .= "<br>"; $genName .= "<br>";
$genDate .= "<br>"; $genDate .= "<br>";
@@ -157,17 +157,17 @@ $conMsg = "";
for($i=0; $i < $ipCount; $i++) { for($i=0; $i < $ipCount; $i++) {
$ip = MYDB_fetch_array($result); $ip = MYDB_fetch_array($result);
$query = "select name,password,lastconnect,user_id,block,conmsg from general where password='$ip[password]' and npc<2"; $query = "select name,password,lastconnect,user_id,block,conmsg from general where password='$ip['password']' and npc<2";
$genResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $genResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$genCount = MYDB_num_rows($genResult); $genCount = MYDB_num_rows($genResult);
for($k=0; $k < $genCount; $k++) { for($k=0; $k < $genCount; $k++) {
$gen = MYDB_fetch_array($genResult); $gen = MYDB_fetch_array($genResult);
if($gen[block] > 0) $genName .= "<font color=magenta>{$gen[name]}</font><br>"; if($gen['block'] > 0) $genName .= "<font color=magenta>{$gen['name']}</font><br>";
else $genName .= $gen[name]."<br>"; else $genName .= $gen['name']."<br>";
$genDate .= $gen[lastconnect]."<br>"; $genDate .= $gen['lastconnect']."<br>";
$genIP .= substr($gen[password],0,10)." ...<br>"; $genIP .= substr($gen['password'],0,10)." ...<br>";
$genID .= $gen[user_id]."<br>"; $genID .= $gen['user_id']."<br>";
$conMsg .= $gen[conmsg]."<br>"; $conMsg .= $gen['conmsg']."<br>";
} }
$genName .= "<br>"; $genName .= "<br>";
$genDate .= "<br>"; $genDate .= "<br>";
+8 -8
View File
@@ -5,11 +5,11 @@ include "func.php";
CheckLogin(); CheckLogin();
$connect = dbConn(); $connect = dbConn();
$query = "select userlevel from general where user_id='$_SESSION[p_id]'"; $query = "select userlevel from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
if($me[userlevel] < 5) { if($me['userlevel'] < 5) {
echo "<script>location.replace('_admin4.php');</script>"; echo "<script>location.replace('_admin4.php');</script>";
} }
@@ -28,7 +28,7 @@ switch($btn) {
$query = "select user_id from general where no='$genlist[$i]'"; $query = "select user_id from general where no='$genlist[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen = MYDB_fetch_array($result); $gen = MYDB_fetch_array($result);
$uid[$i] = $gen[user_id]; $uid[$i] = $gen['user_id'];
} }
$connect = dbConn("sammo"); $connect = dbConn("sammo");
$date = date('Y-m-d H:i:s'); $date = date('Y-m-d H:i:s');
@@ -46,7 +46,7 @@ switch($btn) {
$query = "select user_id from general where no='$genlist[$i]'"; $query = "select user_id from general where no='$genlist[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen = MYDB_fetch_array($result); $gen = MYDB_fetch_array($result);
$uid[$i] = $gen[user_id]; $uid[$i] = $gen['user_id'];
} }
$connect = dbConn("sammo"); $connect = dbConn("sammo");
$date = date('Y-m-d H:i:s'); $date = date('Y-m-d H:i:s');
@@ -64,7 +64,7 @@ switch($btn) {
$query = "select user_id from general where no='$genlist[$i]'"; $query = "select user_id from general where no='$genlist[$i]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen = MYDB_fetch_array($result); $gen = MYDB_fetch_array($result);
$uid[$i] = $gen[user_id]; $uid[$i] = $gen['user_id'];
} }
$connect = dbConn("sammo"); $connect = dbConn("sammo");
$date = date('Y-m-d H:i:s'); $date = date('Y-m-d H:i:s');
@@ -94,9 +94,9 @@ switch($btn) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result); $you = MYDB_fetch_array($result);
// 상대에게 발송 // 상대에게 발송
$you[msgindex]++; $you['msgindex']++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; } if($you['msgindex'] >= 10) { $you['msgindex'] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}_type=10,msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_who='$genlist[$i]'+10000,msg{$you[msgindex]}_when='$date',newmsg=1 where no='$genlist[$i]'"; $query = "update general set msgindex='$you['msgindex']',msg{$you['msgindex']}_type=10,msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_who='$genlist[$i]'+10000,msg{$you['msgindex']}_when='$date',newmsg=1 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
break; break;
+43 -43
View File
@@ -5,11 +5,11 @@ include "func.php";
CheckLogin(); CheckLogin();
$connect = dbConn(); $connect = dbConn();
$query = "select userlevel,skin from general where user_id='$_SESSION[p_id]'"; $query = "select userlevel,skin from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
if($me[userlevel] < 5) { if($me['userlevel'] < 5) {
echo " echo "
<html> <html>
<head> <head>
@@ -94,7 +94,7 @@ for($i=1; $i <= $count; $i++) {
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
echo " echo "
<option value={$nation[nation]}>{$nation[name]}</option>"; <option value={$nation['nation']}>{$nation['name']}</option>";
} }
?> ?>
</select> </select>
@@ -195,7 +195,7 @@ for($i=0; $i < $nationCount; $i++) {
ROUND(AVG(intel), 1) as avgi, ROUND(AVG(intel), 1) as avgi,
ROUND(AVG(explevel), 1) as avge, ROUND(AVG(explevel), 1) as avge,
SUM(crew) as crew SUM(crew) as crew
from general where nation='$nation[nation]'"; from general where nation='$nation['nation']'";
$genResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $genResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen = MYDB_fetch_array($genResult); $gen = MYDB_fetch_array($genResult);
@@ -207,43 +207,43 @@ for($i=0; $i < $nationCount; $i++) {
ROUND(SUM(secu)/SUM(secu2)*100, 2) as secu, ROUND(SUM(secu)/SUM(secu2)*100, 2) as secu,
ROUND(SUM(wall)/SUM(wall2)*100, 2) as wall, ROUND(SUM(wall)/SUM(wall2)*100, 2) as wall,
ROUND(SUM(def)/SUM(def2)*100, 2) as def ROUND(SUM(def)/SUM(def2)*100, 2) as def
from city where nation='$nation[nation]'"; from city where nation='$nation['nation']'";
$cityResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $cityResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$city = MYDB_fetch_array($cityResult); $city = MYDB_fetch_array($cityResult);
echo " echo "
<tr> <tr>
<td align=center style=background-color:$nation[color];color:".newColor($nation[color]).";>$nation[name]</td> <td align=center style=background-color:$nation['color'];color:".newColor($nation['color']).";>$nation['name']</td>
<td align=center>&nbsp;{$nation[connect]}&nbsp;</td> <td align=center>&nbsp;{$nation['connect']}&nbsp;</td>
<td align=center>&nbsp;{$nation[con]}&nbsp;</td> <td align=center>&nbsp;{$nation['con']}&nbsp;</td>
<td align=center>&nbsp;{$nation[power]}&nbsp;</td> <td align=center>&nbsp;{$nation['power']}&nbsp;</td>
<td align=center>&nbsp;{$nation[chemi]}&nbsp;</td> <td align=center>&nbsp;{$nation['chemi']}&nbsp;</td>
<td align=center>&nbsp;{$gen[cnt]}&nbsp;</td> <td align=center>&nbsp;{$gen['cnt']}&nbsp;</td>
<td align=center>&nbsp;{$city[cnt]}&nbsp;</td> <td align=center>&nbsp;{$city['cnt']}&nbsp;</td>
<td align=center>&nbsp;{$nation[tech]}&nbsp;</td> <td align=center>&nbsp;{$nation['tech']}&nbsp;</td>
<td align=center>&nbsp;{$nation[tricklimit]}&nbsp;</td> <td align=center>&nbsp;{$nation['tricklimit']}&nbsp;</td>
<td align=center>&nbsp;{$nation[gold]}&nbsp;</td> <td align=center>&nbsp;{$nation['gold']}&nbsp;</td>
<td align=center>&nbsp;{$nation[rice]}&nbsp;</td> <td align=center>&nbsp;{$nation['rice']}&nbsp;</td>
<td align=center>&nbsp;{$gen[avgg]}&nbsp;</td> <td align=center>&nbsp;{$gen['avgg']}&nbsp;</td>
<td align=center>&nbsp;{$gen[avgr]}&nbsp;</td> <td align=center>&nbsp;{$gen['avgr']}&nbsp;</td>
<td align=center>&nbsp;{$gen[avgl]}&nbsp;</td> <td align=center>&nbsp;{$gen['avgl']}&nbsp;</td>
<td align=center>&nbsp;{$gen[avgp]}&nbsp;</td> <td align=center>&nbsp;{$gen['avgp']}&nbsp;</td>
<td align=center>&nbsp;{$gen[avgi]}&nbsp;</td> <td align=center>&nbsp;{$gen['avgi']}&nbsp;</td>
<td align=center>&nbsp;{$gen[avge]}&nbsp;</td> <td align=center>&nbsp;{$gen['avge']}&nbsp;</td>
<td align=center>&nbsp;{$nation[dex0]}&nbsp;</td> <td align=center>&nbsp;{$nation[dex0]}&nbsp;</td>
<td align=center>&nbsp;{$nation[dex10]}&nbsp;</td> <td align=center>&nbsp;{$nation[dex10]}&nbsp;</td>
<td align=center>&nbsp;{$nation[dex20]}&nbsp;</td> <td align=center>&nbsp;{$nation[dex20]}&nbsp;</td>
<td align=center>&nbsp;{$nation[dex30]}&nbsp;</td> <td align=center>&nbsp;{$nation[dex30]}&nbsp;</td>
<td align=center>&nbsp;{$nation[dex40]}&nbsp;</td> <td align=center>&nbsp;{$nation[dex40]}&nbsp;</td>
<td align=center>&nbsp;{$gen[crew]}/{$gen[leader]}00&nbsp;</td> <td align=center>&nbsp;{$gen['crew']}/{$gen['leader']}00&nbsp;</td>
<td align=center>&nbsp;{$city[pop]}/{$city[pop2]}&nbsp;</td> <td align=center>&nbsp;{$city['pop']}/{$city[pop2]}&nbsp;</td>
<td align=center>&nbsp;{$city[rate]}%&nbsp;</td> <td align=center>&nbsp;{$city['rate']}%&nbsp;</td>
<td align=center>&nbsp;{$city[agri]}%&nbsp;</td> <td align=center>&nbsp;{$city['agri']}%&nbsp;</td>
<td align=center>&nbsp;{$city[comm]}%&nbsp;</td> <td align=center>&nbsp;{$city['comm']}%&nbsp;</td>
<td align=center>&nbsp;{$city[secu]}%&nbsp;</td> <td align=center>&nbsp;{$city['secu']}%&nbsp;</td>
<td align=center>&nbsp;{$city[wall]}%&nbsp;</td> <td align=center>&nbsp;{$city['wall']}%&nbsp;</td>
<td align=center>&nbsp;{$city[def]}%&nbsp;</td> <td align=center>&nbsp;{$city['def']}%&nbsp;</td>
<td align=center style=background-color:$nation[color];color:".newColor($nation[color]).";>$nation[name]</td> <td align=center style=background-color:$nation['color'];color:".newColor($nation['color']).";>$nation['name']</td>
</tr> </tr>
"; ";
} }
@@ -251,7 +251,7 @@ for($i=0; $i < $nationCount; $i++) {
?> ?>
</table> </table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0> <table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td><?php TrickLog(20, $me[skin]); ?></td></tr> <tr><td><?php TrickLog(20, $me['skin']); ?></td></tr>
</table> </table>
<table align=center width=1760 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13; id=bg0> <table align=center width=1760 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13; id=bg0>
@@ -282,20 +282,20 @@ for($i=0; $i < $count; $i++) {
echo " echo "
<tr> <tr>
<td align=center>{$stat[year]}</td> <td align=center>{$stat['year']}</td>
<td align=center>{$stat[month]}</td> <td align=center>{$stat['month']}</td>
<td align=center>{$stat[nation_count]}</td> <td align=center>{$stat['nation_count']}</td>
<td align=center>{$stat[gen_count]}</td> <td align=center>{$stat['gen_count']}</td>
"; ";
switch($type2) { switch($type2) {
default: default:
case 0: echo "<td>{$stat[power_hist]}</td>"; break; case 0: echo "<td>{$stat['power_hist']}</td>"; break;
case 1: echo "<td>{$stat[nation_name]}</td>"; break; case 1: echo "<td>{$stat['nation_name']}</td>"; break;
case 2: echo "<td>{$stat[nation_hist]}</td>"; break; case 2: echo "<td>{$stat['nation_hist']}</td>"; break;
case 3: echo "<td>{$stat[personal_hist]}</td>"; break; case 3: echo "<td>{$stat['personal_hist']}</td>"; break;
case 4: echo "<td>{$stat[special_hist]}</td>"; break; case 4: echo "<td>{$stat['special_hist']}</td>"; break;
case 5: echo "<td>{$stat[crewtype]}</td>"; break; case 5: echo "<td>{$stat['crewtype']}</td>"; break;
case 6: echo "<td>{$stat[etc]}</td>"; break; case 6: echo "<td>{$stat['etc']}</td>"; break;
} }
echo " echo "
+4 -4
View File
@@ -5,21 +5,21 @@ include "func.php";
CheckLogin(); CheckLogin();
$connect = dbConn(); $connect = dbConn();
$query = "select userlevel from general where user_id='$_SESSION[p_id]'"; $query = "select userlevel from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
if($me[userlevel] < 5) { if($me['userlevel'] < 5) {
echo "<script>location.replace('_admin5.php');</script>"; echo "<script>location.replace('_admin5.php');</script>";
} }
switch($btn) { switch($btn) {
case "국가변경": case "국가변경":
if($nation == 0) { if($nation == 0) {
$query = "update general set nation=0,level=0 where user_id='$_SESSION[p_id]'"; $query = "update general set nation=0,level=0 where user_id='$_SESSION['p_id']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else { } else {
$query = "update general set nation='{$nation}',level=1 where user_id='$_SESSION[p_id]'"; $query = "update general set nation='{$nation}',level=1 where user_id='$_SESSION['p_id']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
break; break;
+10 -10
View File
@@ -5,11 +5,11 @@ include "func.php";
CheckLogin(); CheckLogin();
$connect = dbConn(); $connect = dbConn();
$query = "select userlevel from general where user_id='$_SESSION[p_id]'"; $query = "select userlevel from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
if($me[userlevel] < 5) { if($me['userlevel'] < 5) {
echo " echo "
<html> <html>
<head> <head>
@@ -80,14 +80,14 @@ for($i=0; $i < $gencount; $i++) {
$gen = MYDB_fetch_array($genresult); $gen = MYDB_fetch_array($genresult);
echo " echo "
<tr> <tr>
<td align=center>$gen[name]</td> <td align=center>$gen['name']</td>
<td align=center>$gen[connect]</td> <td align=center>$gen['connect']</td>
<td align=center>$gen[startage]</td> <td align=center>$gen['startage']</td>
<td align=center>$gen[age]</td> <td align=center>$gen['age']</td>
<td align=center>".round($gen[refcnt]/2, 1)."</td> <td align=center>".round($gen['refcnt']/2, 1)."</td>
<td align=center>".round($gen[ref]/2,1)."</td> <td align=center>".round($gen['ref']/2,1)."</td>
<td align=center>$gen[logcnt]</td> <td align=center>$gen['logcnt']</td>
<td align=center>".round($gen[log]/2,1)."</td> <td align=center>".round($gen['log']/2,1)."</td>
</tr>"; </tr>";
} }
+11 -11
View File
@@ -5,11 +5,11 @@ include "func.php";
CheckLogin(); CheckLogin();
$connect = dbConn(); $connect = dbConn();
$query = "select userlevel,skin from general where user_id='$_SESSION[p_id]'"; $query = "select userlevel,skin from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
if($me[userlevel] < 5) { if($me['userlevel'] < 5) {
echo " echo "
<html> <html>
<head> <head>
@@ -72,14 +72,14 @@ for($i=0; $i < $gencount; $i++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
// 선택 없으면 맨 처음 장수 // 선택 없으면 맨 처음 장수
if($gen == 0) { if($gen == 0) {
$gen = $general[no]; $gen = $general['no'];
} }
if($gen == $general[no]) { if($gen == $general['no']) {
echo " echo "
<option selected value={$general[no]}>{$general[name]}</option>"; <option selected value={$general['no']}>{$general['name']}</option>";
} else { } else {
echo " echo "
<option value={$general[no]}>{$general[name]}</option>"; <option value={$general['no']}>{$general['name']}</option>";
} }
} }
?> ?>
@@ -95,7 +95,7 @@ for($i=0; $i < $gencount; $i++) {
</tr> </tr>
<tr> <tr>
<td valign=top> <td valign=top>
<?php generalInfo($connect, $gen, $me[skin]); generalInfo2($connect, $gen, $me[skin]); ?> <?php generalInfo($connect, $gen, $me['skin']); generalInfo2($connect, $gen, $me['skin']); ?>
</td> </td>
<td valign=top>&nbsp; <td valign=top>&nbsp;
</td> </td>
@@ -106,10 +106,10 @@ for($i=0; $i < $gencount; $i++) {
</tr> </tr>
<tr> <tr>
<td valign=top> <td valign=top>
<?php MyLog($gen, 24, $me[skin]); ?> <?php MyLog($gen, 24, $me['skin']); ?>
</td> </td>
<td valign=top> <td valign=top>
<?php MyBatLog($gen, 24, $me[skin]); ?> <?php MyBatLog($gen, 24, $me['skin']); ?>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -118,10 +118,10 @@ for($i=0; $i < $gencount; $i++) {
</tr> </tr>
<tr> <tr>
<td valign=top> <td valign=top>
<?php MyHistory($connect, $gen, $me[skin]); ?> <?php MyHistory($connect, $gen, $me['skin']); ?>
</td> </td>
<td valign=top> <td valign=top>
<?php MyBatRes($gen, 24, $me[skin]); ?> <?php MyBatRes($gen, 24, $me['skin']); ?>
</td> </td>
</tr> </tr>
</table> </table>
+23 -23
View File
@@ -5,11 +5,11 @@ include "func.php";
CheckLogin(); CheckLogin();
$connect = dbConn(); $connect = dbConn();
$query = "select userlevel,skin from general where user_id='$_SESSION[p_id]'"; $query = "select userlevel,skin from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
if($me[userlevel] < 5) { if($me['userlevel'] < 5) {
echo " echo "
<html> <html>
<head> <head>
@@ -72,8 +72,8 @@ $nationcount = MYDB_num_rows($result);
for($i=0; $i < $nationcount; $i++) { for($i=0; $i < $nationcount; $i++) {
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
$nationName[$nation[nation]] = $nation[name]; $nationName[$nation['nation']] = $nation['name'];
$nationColor[$nation[nation]] = $nation[color]; $nationColor[$nation['nation']] = $nation['color'];
} }
switch($type) { switch($type) {
@@ -84,18 +84,18 @@ $dipcount = MYDB_num_rows($result);
for($i=0; $i < $dipcount; $i++) { for($i=0; $i < $dipcount; $i++) {
$dip = MYDB_fetch_array($result); $dip = MYDB_fetch_array($result);
$me = $dip[me]; $me = $dip['me'];
$you = $dip[you]; $you = $dip['you'];
$query = "select reserved,showing from diplomacy where you='$me' and me='$you'"; $query = "select reserved,showing from diplomacy where you='$me' and me='$you'";
$result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dip2 = MYDB_fetch_array($result2); $dip2 = MYDB_fetch_array($result2);
if($dip[state] == 2 && $dip[fixed] == "" && $dip[reserved] == "" && $dip2[reserved] == "") { if($dip['state'] == 2 && $dip['fixed'] == "" && $dip['reserved'] == "" && $dip2['reserved'] == "") {
continue; continue;
} }
switch($dip[state]) { switch($dip['state']) {
case 0: $state = "<font color=red>교 전</font>"; break; case 0: $state = "<font color=red>교 전</font>"; break;
case 1: $state = "<font color=magenta>선포중</font>"; break; case 1: $state = "<font color=magenta>선포중</font>"; break;
case 2: $state = "통 상"; break; case 2: $state = "통 상"; break;
@@ -108,31 +108,31 @@ for($i=0; $i < $dipcount; $i++) {
$date = date('Y-m-d H:i:s'); $date = date('Y-m-d H:i:s');
$note = ""; $note = "";
if($dip[fixed] != "") { if($dip['fixed'] != "") {
if($dip[state] == 7) { if($dip['state'] == 7) {
$note .= $dip[fixed]; $note .= $dip['fixed'];
} else { } else {
$note .= "<font color=gray>{$dip[fixed]}</font>"; $note .= "<font color=gray>{$dip['fixed']}</font>";
} }
if($dip[reserved] != "" || $dip2[reserved] != "") { if($dip['reserved'] != "" || $dip2['reserved'] != "") {
$note .= "<br>"; $note .= "<br>";
} }
} }
if($dip[reserved] != "") { if($dip['reserved'] != "") {
if($dip[showing] >= $date) { if($dip['showing'] >= $date) {
$note .= "<font color=skyblue>아국측 제의</font>: {$dip[reserved]}"; $note .= "<font color=skyblue>아국측 제의</font>: {$dip['reserved']}";
} else { } else {
$note .= "<font color=gray>아국측 제의: {$dip[reserved]}</font>"; $note .= "<font color=gray>아국측 제의: {$dip['reserved']}</font>";
} }
if($dip2[reserved] != "") { if($dip2['reserved'] != "") {
$note .= "<br>"; $note .= "<br>";
} }
} }
if($dip2[reserved] != "") { if($dip2['reserved'] != "") {
if($dip2[showing] >= $date) { if($dip2['showing'] >= $date) {
$note .= "<font color=limegreen>상대측 제의</font>: {$dip2[reserved]}"; $note .= "<font color=limegreen>상대측 제의</font>: {$dip2['reserved']}";
} else { } else {
$note .= "<font color=gray>상대측 제의: {$dip2[reserved]}</font>"; $note .= "<font color=gray>상대측 제의: {$dip2['reserved']}</font>";
} }
} }
if($note == "") { $note = "&nbsp;"; } if($note == "") { $note = "&nbsp;"; }
@@ -142,7 +142,7 @@ for($i=0; $i < $dipcount; $i++) {
<td align=center style=color:".newColor($nationColor[$me]).";background-color:{$nationColor[$me]};>$nationName[$me]</td> <td align=center style=color:".newColor($nationColor[$me]).";background-color:{$nationColor[$me]};>$nationName[$me]</td>
<td align=center style=color:".newColor($nationColor[$you]).";background-color:{$nationColor[$you]};>$nationName[$you]</td> <td align=center style=color:".newColor($nationColor[$you]).";background-color:{$nationColor[$you]};>$nationName[$you]</td>
<td align=center>$state</td> <td align=center>$state</td>
<td align=center>$dip[term] 개월</td> <td align=center>$dip['term'] 개월</td>
<td align=left style=font-size:7px;>{$note}</td> <td align=left style=font-size:7px;>{$note}</td>
</tr>"; </tr>";
} }
+153 -153
View File
@@ -6,7 +6,7 @@ CheckLogin();
$connect = dbConn(); $connect = dbConn();
increaseRefresh($connect, "시뮬", 2); increaseRefresh($connect, "시뮬", 2);
$query = "select no,tournament,userlevel,con,turntime from general where user_id='$_SESSION[p_id]'"; $query = "select no,tournament,userlevel,con,turntime from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
@@ -14,10 +14,10 @@ $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),"");
$game = MYDB_fetch_array($result); $game = MYDB_fetch_array($result);
$con = checkLimit($me[userlevel], $me[con], $game[conlimit]); $con = checkLimit($me['userlevel'], $me['con'], $game['conlimit']);
if($con >= 2) { printLimitMsg($me[turntime]); exit(); } if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
if($me[userlevel] < 3) { if($me['userlevel'] < 3) {
echo "특별회원이 아닙니다."; echo "특별회원이 아닙니다.";
exit(); exit();
} }
@@ -38,38 +38,38 @@ if($isgen == "장수평균" || $isgen == "성벽평균") {
if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평균" || $isgen == "성벽평균") { if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평균" || $isgen == "성벽평균") {
$msg2 = ""; $msg2 = "";
for($i=0; $i < $simulCount; $i++) { for($i=0; $i < $simulCount; $i++) {
$general[leader] = $leader1; $general['leader'] = $leader1;
$general[power] = $power1; $general['power'] = $power1;
$general[intel] = $intel1; $general['intel'] = $intel1;
$general[crewtype] = $type1; $general['crewtype'] = $type1;
$general[crew] = $crew1; $general['crew'] = $crew1;
$general[train] = $train1; $general['train'] = $train1;
$general[atmos] = $atmos1; $general['atmos'] = $atmos1;
$general[level] = $level1; $general['level'] = $level1;
$general[explevel] = $explevel1; $general['explevel'] = $explevel1;
$general[dex0] = $dex10; $general[dex0] = $dex10;
$general[dex10] = $dex110; $general[dex10] = $dex110;
$general[dex20] = $dex120; $general[dex20] = $dex120;
$general[dex30] = $dex130; $general[dex30] = $dex130;
$general[dex40] = $dex140; $general[dex40] = $dex140;
$oppose[leader] = $leader2; $oppose['leader'] = $leader2;
$oppose[power] = $power2; $oppose['power'] = $power2;
$oppose[intel] = $intel2; $oppose['intel'] = $intel2;
$oppose[crewtype] = $type2; $oppose['crewtype'] = $type2;
$oppose[crew] = $crew2; $oppose['crew'] = $crew2;
$oppose[train] = $train2; $oppose['train'] = $train2;
$oppose[atmos] = $atmos2; $oppose['atmos'] = $atmos2;
$oppose[level] = $level2; $oppose['level'] = $level2;
$oppose[explevel] = $explevel2; $oppose['explevel'] = $explevel2;
$oppose[dex0] = $dex20; $oppose[dex0] = $dex20;
$oppose[dex10] = $dex210; $oppose[dex10] = $dex210;
$oppose[dex20] = $dex220; $oppose[dex20] = $dex220;
$oppose[dex30] = $dex230; $oppose[dex30] = $dex230;
$oppose[dex40] = $dex240; $oppose[dex40] = $dex240;
$city[def] = $def; $city['def'] = $def;
$city[wall] = $wall; $city['wall'] = $wall;
if($isgen == "장수공격" || $isgen == "장수평균") { if($isgen == "장수공격" || $isgen == "장수평균") {
$opposecount = 1; $opposecount = 1;
@@ -77,11 +77,11 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평
$opposecount = 0; $opposecount = 0;
} }
$warphase = getRate($game, $general[crewtype], "spd"); //병종간 페이즈 수 얻기 $warphase = getRate($game, $general['crewtype'], "spd"); //병종간 페이즈 수 얻기
// 우선 스케일링 // 우선 스케일링
$city[def] *= 10; $city['def'] *= 10;
$city[wall] *= 10; $city['wall'] *= 10;
$msg = ""; $msg = "";
$msg .= "<C>●</>1월:공격장수가 <R>공격</>합니다.<br>"; $msg .= "<C>●</>1월:공격장수가 <R>공격</>합니다.<br>";
@@ -93,7 +93,7 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평
while($phase < $warphase) { while($phase < $warphase) {
// 장수가 없어서 도시 공격 // 장수가 없어서 도시 공격
if($opposecount == 0) { if($opposecount == 0) {
$msg .= "<C>●</>".getTypename($general[crewtype])."(으)로 성을 <M>공격</>합니다.<br>"; $msg .= "<C>●</>".getTypename($general['crewtype'])."(으)로 성을 <M>공격</>합니다.<br>";
$mykillnum = 0; $mydeathnum = 0; $mykillnum = 0; $mydeathnum = 0;
while($phase < $warphase) { while($phase < $warphase) {
@@ -110,35 +110,35 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평
$myweight = $cityAtt - $myDef; $myweight = $cityAtt - $myDef;
//훈련 사기따라 //훈련 사기따라
$myCrew = getCrew($myCrew, $atmos3, $general[train]); $myCrew = getCrew($myCrew, $atmos3, $general['train']);
$cityCrew = getCrew($cityCrew, $general[atmos], $train3); $cityCrew = getCrew($cityCrew, $general['atmos'], $train3);
//숙련도 따라 //숙련도 따라
$genDexAtt = getGenDex($general, $general[crewtype]); $genDexAtt = getGenDex($general, $general['crewtype']);
$genDexDef = getGenDex($general, 40); $genDexDef = getGenDex($general, 40);
$cityCrew *= getDexLog($genDexAtt, ($train3-60)*7200); $cityCrew *= getDexLog($genDexAtt, ($train3-60)*7200);
$myCrew *= getDexLog(($atmos3-60)*7200, $genDexDef); $myCrew *= getDexLog(($atmos3-60)*7200, $genDexDef);
$avoid = 1; $avoid = 1;
// 병종간 특성 // 병종간 특성
if(floor($general[crewtype]/10) == 3) { // 귀병 if(floor($general['crewtype']/10) == 3) { // 귀병
$int = $general[intel] + getBookEff($general[book]); $int = $general['intel'] + getBookEff($general['book']);
if($general[crewtype] == 30) { if($general['crewtype'] == 30) {
$ratio2 = $int * 5; // 0~500 즉 50% $ratio2 = $int * 5; // 0~500 즉 50%
} elseif($general[crewtype] == 31) { } elseif($general['crewtype'] == 31) {
$ratio2 = $int * 6; // 0~600 즉 60% $ratio2 = $int * 6; // 0~600 즉 60%
} elseif($general[crewtype] == 32) { } elseif($general['crewtype'] == 32) {
$ratio2 = $int * 6; // 0~600 즉 60% $ratio2 = $int * 6; // 0~600 즉 60%
} elseif($general[crewtype] == 33) { } elseif($general['crewtype'] == 33) {
$ratio2 = $int * 6; // 0~600 즉 60% $ratio2 = $int * 6; // 0~600 즉 60%
} elseif($general[crewtype] == 34) { } elseif($general['crewtype'] == 34) {
$ratio2 = $int * 6; // 0~600 즉 60% $ratio2 = $int * 6; // 0~600 즉 60%
} elseif($general[crewtype] == 35) { } elseif($general['crewtype'] == 35) {
$ratio2 = $int * 8; // 0~800 즉 80% $ratio2 = $int * 8; // 0~800 즉 80%
} elseif($general[crewtype] == 36) { } elseif($general['crewtype'] == 36) {
$ratio2 = $int * 8; // 0~800 즉 80% $ratio2 = $int * 8; // 0~800 즉 80%
} elseif($general[crewtype] == 37) { } elseif($general['crewtype'] == 37) {
$ratio2 = $int * 6; // 0~600 즉 60% $ratio2 = $int * 6; // 0~600 즉 60%
} elseif($general[crewtype] == 38) { } elseif($general['crewtype'] == 38) {
$ratio2 = $int * 6; // 0~600 즉 60% $ratio2 = $int * 6; // 0~600 즉 60%
} }
$ratio = rand() % 1000; // 0~999 $ratio = rand() % 1000; // 0~999
@@ -181,23 +181,23 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평
} }
} }
} }
} elseif($general[crewtype] == 40) { // 정란 } elseif($general['crewtype'] == 40) { // 정란
$cityCrew = $cityCrew * 1.5; $cityCrew = $cityCrew * 1.5;
} elseif($general[crewtype] == 41) { // 충차 } elseif($general['crewtype'] == 41) { // 충차
$cityCrew = $cityCrew * 2.0; $cityCrew = $cityCrew * 2.0;
} elseif($general[crewtype] == 42) { // 벽력거 } elseif($general['crewtype'] == 42) { // 벽력거
$cityCrew = $cityCrew * 1.5; $cityCrew = $cityCrew * 1.5;
} }
//군주, 참모, 장군 공격 보정 5% //군주, 참모, 장군 공격 보정 5%
if($general[level] == 12 || $general[level] == 11 || $general[level] == 10 || $general[level] == 8 || $general[level] == 6) { if($general['level'] == 12 || $general['level'] == 11 || $general['level'] == 10 || $general['level'] == 8 || $general['level'] == 6) {
$cityCrew = $cityCrew * 1.05; $cityCrew = $cityCrew * 1.05;
} }
//레벨 보정 //레벨 보정
$cityCrew = $cityCrew * (100 + $general[explevel]/6)/100; $cityCrew = $cityCrew * (100 + $general['explevel']/6)/100;
//크리 //크리
$rd = rand() % 100; // 0 ~ 99 $rd = rand() % 100; // 0 ~ 99
$ratio = CriticalRatio2($general[leader], $general[power], $general[intel]); $ratio = CriticalRatio2($general['leader'], $general['power'], $general['intel']);
if($ratio >= $rd && $avoid == 1) { if($ratio >= $rd && $avoid == 1) {
$msg .= "<C>●</><C>필살</>공격!</><br>"; $msg .= "<C>●</><C>필살</>공격!</><br>";
$cityCrew = CriticalScore2($cityCrew); $cityCrew = CriticalScore2($cityCrew);
@@ -205,7 +205,7 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평
} }
//회피 //회피
$ratio = rand() % 100; // 0 ~ 99 $ratio = rand() % 100; // 0 ~ 99
$ratio2 = getRate($game, $general[crewtype], "avd"); //회피율 $ratio2 = getRate($game, $general['crewtype'], "avd"); //회피율
if($ratio < $ratio2 && $avoid == 1) { if($ratio < $ratio2 && $avoid == 1) {
$msg .= "<C>●</><C>회피</>했다!</><br>"; $msg .= "<C>●</><C>회피</>했다!</><br>";
$myCrew /= 10; // 10%만 소모 $myCrew /= 10; // 10%만 소모
@@ -216,45 +216,45 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평
$cityCrew *= (rand() % 21 + 90)/100; // 90~110% $cityCrew *= (rand() % 21 + 90)/100; // 90~110%
$myCrew *= (rand() % 21 + 90)/100; // 90~110% $myCrew *= (rand() % 21 + 90)/100; // 90~110%
$general[crew] -= round($myCrew); $general['crew'] -= round($myCrew);
$city[def] -= round($cityCrew); $city['def'] -= round($cityCrew);
$city[wall] -= round($cityCrew); $city['wall'] -= round($cityCrew);
$tempMyCrew = $myCrew; $tempCityCrew = $cityCrew; $tempMyCrew = $myCrew; $tempCityCrew = $cityCrew;
$tempGeneralCrew = $general[crew]; $tempCityDef = $city[def]; $tempGeneralCrew = $general['crew']; $tempCityDef = $city['def'];
if($city[wall] <= 0) { $city[wall] = 0; } if($city['wall'] <= 0) { $city['wall'] = 0; }
if($city[def] < 0) { if($city['def'] < 0) {
$offset = round($tempCityDef*$tempMyCrew/$tempCityCrew); $offset = round($tempCityDef*$tempMyCrew/$tempCityCrew);
$myCrew += $offset; $myCrew += $offset;
$general[crew] -= $offset; $general['crew'] -= $offset;
$cityCrew += $tempCityDef; $cityCrew += $tempCityDef;
$city[def] = 0; $city['def'] = 0;
} }
if($general[crew] < 0) { if($general['crew'] < 0) {
$offset = round($tempGeneralCrew*$tempCityCrew/$tempMyCrew); $offset = round($tempGeneralCrew*$tempCityCrew/$tempMyCrew);
$cityCrew += $offset; $cityCrew += $offset;
$city[def] -= $offset; $city['def'] -= $offset;
$myCrew += $tempGeneralCrew; $myCrew += $tempGeneralCrew;
$general[crew] = 0; $general['crew'] = 0;
} }
$exp += $cityCrew; $exp += $cityCrew;
$opexp += $myCrew; $opexp += $myCrew;
$general[crew] = round($general[crew]); $general['crew'] = round($general['crew']);
$cityCrew = round($cityCrew); $cityCrew = round($cityCrew);
$myCrew = round($myCrew); $myCrew = round($myCrew);
$myAtt = round($myAtt, 2); $myAtt = round($myAtt, 2);
$myDef = round($myDef, 2); $myDef = round($myDef, 2);
$cityAtt = round($cityAtt, 2); $cityAtt = round($cityAtt, 2);
$cityDef = round($cityDef, 2); $cityDef = round($cityDef, 2);
$msg .= "<C>●</> $phase : <Y1>【공격장수】</> <C>$general[crew] (-$myCrew)</> VS <C>$city[def] (-$cityCrew)</> <Y1>【성벽】</><br>"; $msg .= "<C>●</> $phase : <Y1>【공격장수】</> <C>$general['crew'] (-$myCrew)</> VS <C>$city['def'] (-$cityCrew)</> <Y1>【성벽】</><br>";
$mykillnum += $cityCrew; $mydeathnum += $myCrew; $mykillnum += $cityCrew; $mydeathnum += $myCrew;
if($city[def] <= 0) { break; } if($city['def'] <= 0) { break; }
if($general[crew] <= 0) { break; } if($general['crew'] <= 0) { break; }
} }
// 도시쌀 소모 계산 // 도시쌀 소모 계산
@@ -262,28 +262,28 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평
$rice = round($opexp * 4 * getCrewtypeRice($game, 0, 0) * ($train3/100 - 0.2)); $rice = round($opexp * 4 * getCrewtypeRice($game, 0, 0) * ($train3/100 - 0.2));
//원래대로 스케일링 //원래대로 스케일링
$city[def] = round($city[def] / 10); $city['def'] = round($city['def'] / 10);
$city[wall] = round($city[wall] / 10); $city['wall'] = round($city['wall'] / 10);
//내정 감소 //내정 감소
$dec = round($cityCrew / 10); $dec = round($cityCrew / 10);
$city[agri] -= $dec; $city['agri'] -= $dec;
$city[comm] -= $dec; $city['comm'] -= $dec;
$city[secu] -= $dec; $city['secu'] -= $dec;
if($city[agri] < 0) { $city[agri] = 0; } if($city['agri'] < 0) { $city['agri'] = 0; }
if($city[comm] < 0) { $city[comm] = 0; } if($city['comm'] < 0) { $city['comm'] = 0; }
if($city[secu] < 0) { $city[secu] = 0; } if($city['secu'] < 0) { $city['secu'] = 0; }
$msg .= "<S>★</>병사수 변화 : <C>-$mydeathnum</> vs <C>-$mykillnum</><br>"; $msg .= "<S>★</>병사수 변화 : <C>-$mydeathnum</> vs <C>-$mykillnum</><br>";
$msg .= "<R>★</>【성벽】내정 감소량 : $dec 【성벽】쌀 소모 : $rice<br>"; $msg .= "<R>★</>【성벽】내정 감소량 : $dec 【성벽】쌀 소모 : $rice<br>";
// $msg2 .= "<S>★</>병사수 변화 : <C>-$mydeathnum</> vs <C>-$mykillnum</>   "; // $msg2 .= "<S>★</>병사수 변화 : <C>-$mydeathnum</> vs <C>-$mykillnum</>   ";
// $msg2 .= "<R>★</>【성벽】내정 감소량 : $dec 【성벽】쌀 소모 : $rice<br>"; // $msg2 .= "<R>★</>【성벽】내정 감소량 : $dec 【성벽】쌀 소모 : $rice<br>";
if($city[def] == 0 || $general[crew] == 0) { if($city['def'] == 0 || $general['crew'] == 0) {
break; break;
} }
// 장수 대결 // 장수 대결
} else { } else {
$msg .= "<C>●</>".getTypename($general[crewtype])."(으)로 <Y>수비장수</>의 ".getTypename($oppose[crewtype])."(을)를 공격합니다.<br>"; $msg .= "<C>●</>".getTypename($general['crewtype'])."(으)로 <Y>수비장수</>의 ".getTypename($oppose['crewtype'])."(을)를 공격합니다.<br>";
$mykillnum = 0; $mydeathnum = 0; $mykillnum = 0; $mydeathnum = 0;
while($phase < $warphase) { while($phase < $warphase) {
@@ -297,38 +297,38 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평
$myCrew = $_armperphase + $opAtt - $myDef; $myCrew = $_armperphase + $opAtt - $myDef;
$opCrew = $_armperphase + $myAtt - $opDef; $opCrew = $_armperphase + $myAtt - $opDef;
//훈련 사기따라 //훈련 사기따라
$myCrew = getCrew($myCrew, $oppose[atmos], $general[train]); $myCrew = getCrew($myCrew, $oppose['atmos'], $general['train']);
$opCrew = getCrew($opCrew, $general[atmos], $oppose[train]); $opCrew = getCrew($opCrew, $general['atmos'], $oppose['train']);
//숙련도 따라 //숙련도 따라
$genDexAtt = getGenDex($general, $general[crewtype]); $genDexAtt = getGenDex($general, $general['crewtype']);
$genDexDef = getGenDex($general, $oppose[crewtype]); $genDexDef = getGenDex($general, $oppose['crewtype']);
$oppDexAtt = getGenDex($oppose, $oppose[crewtype]); $oppDexAtt = getGenDex($oppose, $oppose['crewtype']);
$oppDexDef = getGenDex($oppose, $general[crewtype]); $oppDexDef = getGenDex($oppose, $general['crewtype']);
$opCrew *= getDexLog($genDexAtt, $oppDexDef); $opCrew *= getDexLog($genDexAtt, $oppDexDef);
$myCrew *= getDexLog($oppDexAtt, $genDexDef); $myCrew *= getDexLog($oppDexAtt, $genDexDef);
$myAvoid = 1; $myAvoid = 1;
$opAvoid = 1; $opAvoid = 1;
// 병종간 특성 // 병종간 특성
if(floor($general[crewtype]/10) == 3) { // 귀병 if(floor($general['crewtype']/10) == 3) { // 귀병
$int = $general[intel] + getBookEff($general[book]); $int = $general['intel'] + getBookEff($general['book']);
if($general[crewtype] == 30) { if($general['crewtype'] == 30) {
$ratio2 = $int * 5; // 0~500 즉 50% $ratio2 = $int * 5; // 0~500 즉 50%
} elseif($general[crewtype] == 31) { } elseif($general['crewtype'] == 31) {
$ratio2 = $int * 6; // 0~600 즉 60% $ratio2 = $int * 6; // 0~600 즉 60%
} elseif($general[crewtype] == 32) { } elseif($general['crewtype'] == 32) {
$ratio2 = $int * 6; // 0~600 즉 60% $ratio2 = $int * 6; // 0~600 즉 60%
} elseif($general[crewtype] == 33) { } elseif($general['crewtype'] == 33) {
$ratio2 = $int * 6; // 0~600 즉 60% $ratio2 = $int * 6; // 0~600 즉 60%
} elseif($general[crewtype] == 34) { } elseif($general['crewtype'] == 34) {
$ratio2 = $int * 6; // 0~600 즉 60% $ratio2 = $int * 6; // 0~600 즉 60%
} elseif($general[crewtype] == 35) { } elseif($general['crewtype'] == 35) {
$ratio2 = $int * 8; // 0~800 즉 80% $ratio2 = $int * 8; // 0~800 즉 80%
} elseif($general[crewtype] == 36) { } elseif($general['crewtype'] == 36) {
$ratio2 = $int * 8; // 0~800 즉 80% $ratio2 = $int * 8; // 0~800 즉 80%
} elseif($general[crewtype] == 37) { } elseif($general['crewtype'] == 37) {
$ratio2 = $int * 6; // 0~600 즉 60% $ratio2 = $int * 6; // 0~600 즉 60%
} elseif($general[crewtype] == 38) { } elseif($general['crewtype'] == 38) {
$ratio2 = $int * 6; // 0~600 즉 60% $ratio2 = $int * 6; // 0~600 즉 60%
} }
$ratio = rand() % 1000; // 0~999 $ratio = rand() % 1000; // 0~999
@@ -392,25 +392,25 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평
} }
// 상대 장수 병종간 특성 // 상대 장수 병종간 특성
if(floor($oppose[crewtype]/10) == 3) { // 귀병 if(floor($oppose['crewtype']/10) == 3) { // 귀병
$int = $oppose[intel] + getBookEff($oppose[book]); $int = $oppose['intel'] + getBookEff($oppose['book']);
if($oppose[crewtype] == 30) { if($oppose['crewtype'] == 30) {
$ratio2 = $int * 5; // 0~500 즉 50% $ratio2 = $int * 5; // 0~500 즉 50%
} elseif($oppose[crewtype] == 31) { } elseif($oppose['crewtype'] == 31) {
$ratio2 = $int * 6; // 0~600 즉 60% $ratio2 = $int * 6; // 0~600 즉 60%
} elseif($oppose[crewtype] == 32) { } elseif($oppose['crewtype'] == 32) {
$ratio2 = $int * 6; // 0~600 즉 60% $ratio2 = $int * 6; // 0~600 즉 60%
} elseif($oppose[crewtype] == 33) { } elseif($oppose['crewtype'] == 33) {
$ratio2 = $int * 6; // 0~600 즉 60% $ratio2 = $int * 6; // 0~600 즉 60%
} elseif($oppose[crewtype] == 34) { } elseif($oppose['crewtype'] == 34) {
$ratio2 = $int * 6; // 0~600 즉 60% $ratio2 = $int * 6; // 0~600 즉 60%
} elseif($oppose[crewtype] == 35) { } elseif($oppose['crewtype'] == 35) {
$ratio2 = $int * 8; // 0~800 즉 80% $ratio2 = $int * 8; // 0~800 즉 80%
} elseif($oppose[crewtype] == 36) { } elseif($oppose['crewtype'] == 36) {
$ratio2 = $int * 8; // 0~800 즉 80% $ratio2 = $int * 8; // 0~800 즉 80%
} elseif($oppose[crewtype] == 37) { } elseif($oppose['crewtype'] == 37) {
$ratio2 = $int * 6; // 0~600 즉 60% $ratio2 = $int * 6; // 0~600 즉 60%
} elseif($oppose[crewtype] == 38) { } elseif($oppose['crewtype'] == 38) {
$ratio2 = $int * 6; // 0~600 즉 60% $ratio2 = $int * 6; // 0~600 즉 60%
} }
$ratio = rand() % 1000; // 0~999 $ratio = rand() % 1000; // 0~999
@@ -473,10 +473,10 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평
} }
} }
if($oppose[crewtype] == 43) { // 목우 if($oppose['crewtype'] == 43) { // 목우
$r = 0; $r = 0;
$r += $oppose[atmos]; $r += $oppose['atmos'];
$r += $oppose[train]; $r += $oppose['train'];
$ratio = rand() % 400; // 최대 50% 저지 $ratio = rand() % 400; // 최대 50% 저지
if($ratio < $r && $opAvoid == 1) { if($ratio < $r && $opAvoid == 1) {
$msg .= "<C>●</><R>저지</>당했다!</><br>"; $msg .= "<C>●</><R>저지</>당했다!</><br>";
@@ -487,73 +487,73 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평
// my 입장 상성 // my 입장 상성
// 보병계열 > 궁병계열 // 보병계열 > 궁병계열
if(floor($general[crewtype]/10) == 0 && floor($oppose[crewtype]/10) == 1) { if(floor($general['crewtype']/10) == 0 && floor($oppose['crewtype']/10) == 1) {
$myCrew *= 0.8; $myCrew *= 0.8;
$opCrew *= 1.2; $opCrew *= 1.2;
} }
// 궁병계열 > 기병계열 // 궁병계열 > 기병계열
if(floor($general[crewtype]/10) == 1 && floor($oppose[crewtype]/10) == 2) { if(floor($general['crewtype']/10) == 1 && floor($oppose['crewtype']/10) == 2) {
$myCrew *= 0.8; $myCrew *= 0.8;
$opCrew *= 1.2; $opCrew *= 1.2;
} }
// 기병계열 > 보병계열 // 기병계열 > 보병계열
if(floor($general[crewtype]/10) == 2 && floor($oppose[crewtype]/10) == 0) { if(floor($general['crewtype']/10) == 2 && floor($oppose['crewtype']/10) == 0) {
$myCrew *= 0.8; $myCrew *= 0.8;
$opCrew *= 1.2; $opCrew *= 1.2;
} }
// 차병계열 // 차병계열
if(floor($general[crewtype]/10) == 4) { if(floor($general['crewtype']/10) == 4) {
$myCrew *= 1.2; $myCrew *= 1.2;
$opCrew *= 0.8; $opCrew *= 0.8;
} }
// op 입장 상성 // op 입장 상성
// 보병계열 > 궁병계열 // 보병계열 > 궁병계열
if(floor($oppose[crewtype]/10) == 0 && floor($general[crewtype]/10) == 1) { if(floor($oppose['crewtype']/10) == 0 && floor($general['crewtype']/10) == 1) {
$opCrew *= 0.8; $opCrew *= 0.8;
$myCrew *= 1.2; $myCrew *= 1.2;
} }
// 궁병계열 > 기병계열 // 궁병계열 > 기병계열
if(floor($oppose[crewtype]/10) == 1 && floor($general[crewtype]/10) == 2) { if(floor($oppose['crewtype']/10) == 1 && floor($general['crewtype']/10) == 2) {
$opCrew *= 0.8; $opCrew *= 0.8;
$myCrew *= 1.2; $myCrew *= 1.2;
} }
// 기병계열 > 보병계열 // 기병계열 > 보병계열
if(floor($oppose[crewtype]/10) == 2 && floor($general[crewtype]/10) == 0) { if(floor($oppose['crewtype']/10) == 2 && floor($general['crewtype']/10) == 0) {
$opCrew *= 0.8; $opCrew *= 0.8;
$myCrew *= 1.2; $myCrew *= 1.2;
} }
// 차병계열 // 차병계열
if(floor($oppose[crewtype]/10) == 4) { if(floor($oppose['crewtype']/10) == 4) {
$opCrew *= 1.2; $opCrew *= 1.2;
$myCrew *= 0.8; $myCrew *= 0.8;
} }
//군주, 참모, 장군 공격 보정 5% //군주, 참모, 장군 공격 보정 5%
if($general[level] == 12 || $general[level] == 11 || $general[level] == 10 || $general[level] == 8 || $general[level] == 6) { if($general['level'] == 12 || $general['level'] == 11 || $general['level'] == 10 || $general['level'] == 8 || $general['level'] == 6) {
$opCrew = $opCrew * 1.05; $opCrew = $opCrew * 1.05;
} }
//상대장수 관직 보정 //상대장수 관직 보정
//군주, 참모, 모사 방어 보정 5% //군주, 참모, 모사 방어 보정 5%
if($oppose[level] == 12 || $oppose[level] == 11 || $oppose[level] == 9 || $oppose[level] == 7 || $oppose[level] == 5) { if($oppose['level'] == 12 || $oppose['level'] == 11 || $oppose['level'] == 9 || $oppose['level'] == 7 || $oppose['level'] == 5) {
$opCrew = $opCrew * 0.95; $opCrew = $opCrew * 0.95;
} elseif($oppose[level] == 4 && $oppose[no] == $city[gen1]) { // 태수 보정 } elseif($oppose['level'] == 4 && $oppose['no'] == $city[gen1]) { // 태수 보정
$opCrew = $opCrew * 0.95; $opCrew = $opCrew * 0.95;
} elseif($oppose[level] == 3 && $oppose[no] == $city[gen2]) { // 군사 보정 } elseif($oppose['level'] == 3 && $oppose['no'] == $city[gen2]) { // 군사 보정
$opCrew = $opCrew * 0.95; $opCrew = $opCrew * 0.95;
} elseif($oppose[level] == 2 && $oppose[no] == $city[gen3]) { // 시중 보정 } elseif($oppose['level'] == 2 && $oppose['no'] == $city[gen3]) { // 시중 보정
$opCrew = $opCrew * 0.95; $opCrew = $opCrew * 0.95;
} }
//레벨 보정 //레벨 보정
$myCrew = $myCrew * ((100 - $general[explevel]/3)/100); $myCrew = $myCrew * ((100 - $general['explevel']/3)/100);
$opCrew = $opCrew / ((100 - $general[explevel]/3)/100); $opCrew = $opCrew / ((100 - $general['explevel']/3)/100);
$myCrew = $myCrew / ((100 - $oppose[explevel]/3)/100); $myCrew = $myCrew / ((100 - $oppose['explevel']/3)/100);
$opCrew = $opCrew * ((100 - $oppose[explevel]/3)/100); $opCrew = $opCrew * ((100 - $oppose['explevel']/3)/100);
//크리 //크리
$rd = rand() % 100; // 0 ~ 99 $rd = rand() % 100; // 0 ~ 99
$ratio = CriticalRatio2($general[leader], $general[power], $general[intel]); $ratio = CriticalRatio2($general['leader'], $general['power'], $general['intel']);
if($ratio >= $rd && $myAvoid == 1) { if($ratio >= $rd && $myAvoid == 1) {
$msg .= "<C>●</><C>필살</>공격!</><br>"; $msg .= "<C>●</><C>필살</>공격!</><br>";
$opCrew = CriticalScore2($opCrew); $opCrew = CriticalScore2($opCrew);
@@ -561,7 +561,7 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평
} }
//크리 //크리
$rd = rand() % 100; // 0 ~ 99 $rd = rand() % 100; // 0 ~ 99
$ratio = CriticalRatio2($oppose[leader], $oppose[power], $oppose[intel]); $ratio = CriticalRatio2($oppose['leader'], $oppose['power'], $oppose['intel']);
if($ratio >= $rd && $opAvoid == 1) { if($ratio >= $rd && $opAvoid == 1) {
$msg .= "<C>●</>상대의 <R>필살</>공격!</><br>"; $msg .= "<C>●</>상대의 <R>필살</>공격!</><br>";
$myCrew = CriticalScore2($myCrew); $myCrew = CriticalScore2($myCrew);
@@ -569,7 +569,7 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평
} }
//회피 //회피
$ratio = rand() % 100; // 0 ~ 99 $ratio = rand() % 100; // 0 ~ 99
$ratio2 = getRate($game, $general[crewtype], "avd"); //회피율 $ratio2 = getRate($game, $general['crewtype'], "avd"); //회피율
if($ratio < $ratio2 && $myAvoid == 1) { if($ratio < $ratio2 && $myAvoid == 1) {
$msg .= "<C>●</><C>회피</>했다!</><br>"; $msg .= "<C>●</><C>회피</>했다!</><br>";
$myCrew /= 10; // 10%만 소모 $myCrew /= 10; // 10%만 소모
@@ -577,7 +577,7 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평
} }
//회피 //회피
$ratio = rand() % 100; // 0 ~ 99 $ratio = rand() % 100; // 0 ~ 99
$ratio2 = getRate($game, $oppose[crewtype], "avd"); //회피율 $ratio2 = getRate($game, $oppose['crewtype'], "avd"); //회피율
if($ratio < $ratio2 && $opAvoid == 1) { if($ratio < $ratio2 && $opAvoid == 1) {
$msg .= "<C>●</>상대가 <R>회피</>했다!</><br>"; $msg .= "<C>●</>상대가 <R>회피</>했다!</><br>";
$opCrew /= 10; // 10%만 소모 $opCrew /= 10; // 10%만 소모
@@ -588,60 +588,60 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평
$opCrew *= (rand() % 21 + 90)/100; // 90~110% $opCrew *= (rand() % 21 + 90)/100; // 90~110%
$myCrew *= (rand() % 21 + 90)/100; // 90~110% $myCrew *= (rand() % 21 + 90)/100; // 90~110%
$general[crew] -= round($myCrew); $general['crew'] -= round($myCrew);
$oppose[crew] -= round($opCrew); $oppose['crew'] -= round($opCrew);
$tempMyCrew = $myCrew; $tempOpCrew = $opCrew; $tempMyCrew = $myCrew; $tempOpCrew = $opCrew;
$tempGeneralCrew = $general[crew]; $tempOpposeCrew = $oppose[crew]; $tempGeneralCrew = $general['crew']; $tempOpposeCrew = $oppose['crew'];
if($general[crew] <= 0 && $oppose[crew] <= 0) { if($general['crew'] <= 0 && $oppose['crew'] <= 0) {
$r1 = $tempGeneralCrew / $tempMyCrew; $r1 = $tempGeneralCrew / $tempMyCrew;
$r2 = $tempOpposeCrew / $tempOpCrew; $r2 = $tempOpposeCrew / $tempOpCrew;
if($r1 > $r2) { if($r1 > $r2) {
$offset = round($tempOpposeCrew*$tempMyCrew/$tempOpCrew); $offset = round($tempOpposeCrew*$tempMyCrew/$tempOpCrew);
$myCrew += $offset; $myCrew += $offset;
$general[crew] -= $offset; $general['crew'] -= $offset;
$opCrew += $tempOpposeCrew; $opCrew += $tempOpposeCrew;
$oppose[crew] = 0; $oppose['crew'] = 0;
} else { } else {
$offset = round($tempGeneralCrew*$tempOpCrew/$tempMyCrew); $offset = round($tempGeneralCrew*$tempOpCrew/$tempMyCrew);
$opCrew += $offset; $opCrew += $offset;
$oppose[crew] -= $offset; $oppose['crew'] -= $offset;
$myCrew += $tempGeneralCrew; $myCrew += $tempGeneralCrew;
$general[crew] = 0; $general['crew'] = 0;
} }
} elseif($general[crew] * $oppose[crew] <= 0) { } elseif($general['crew'] * $oppose['crew'] <= 0) {
if($oppose[crew] < 0) { if($oppose['crew'] < 0) {
$offset = round($tempOpposeCrew*$tempMyCrew/$tempOpCrew); $offset = round($tempOpposeCrew*$tempMyCrew/$tempOpCrew);
$myCrew += $offset; $myCrew += $offset;
$general[crew] -= $offset; $general['crew'] -= $offset;
$opCrew += $tempOpposeCrew; $opCrew += $tempOpposeCrew;
$oppose[crew] = 0; $oppose['crew'] = 0;
} }
if($general[crew] < 0) { if($general['crew'] < 0) {
$offset = round($tempGeneralCrew*$tempOpCrew/$tempMyCrew); $offset = round($tempGeneralCrew*$tempOpCrew/$tempMyCrew);
$opCrew += $offset; $opCrew += $offset;
$oppose[crew] -= $offset; $oppose['crew'] -= $offset;
$myCrew += $tempGeneralCrew; $myCrew += $tempGeneralCrew;
$general[crew] = 0; $general['crew'] = 0;
} }
} }
$exp += $opCrew; $exp += $opCrew;
$opexp += $myCrew; $opexp += $myCrew;
$general[crew] = round($general[crew]); $general['crew'] = round($general['crew']);
$oppose[crew] = round($oppose[crew]); $oppose['crew'] = round($oppose['crew']);
$myCrew = round($myCrew); $myCrew = round($myCrew);
$opCrew = round($opCrew); $opCrew = round($opCrew);
$myAtt = round($myAtt, 2); $myAtt = round($myAtt, 2);
$myDef = round($myDef, 2); $myDef = round($myDef, 2);
$opAtt = round($opAtt, 2); $opAtt = round($opAtt, 2);
$opDef = round($opDef, 2); $opDef = round($opDef, 2);
$msg .= "<C>●</> $phase : <Y1>【공격장수】</> <C>$general[crew] (-$myCrew)</> VS <C>$oppose[crew] (-$opCrew)</> <Y1>【수비장수】</><br>"; $msg .= "<C>●</> $phase : <Y1>【공격장수】</> <C>$general['crew'] (-$myCrew)</> VS <C>$oppose['crew'] (-$opCrew)</> <Y1>【수비장수】</><br>";
$mykillnum += $opCrew; $mydeathnum += $myCrew; $mykillnum += $opCrew; $mydeathnum += $myCrew;
if($oppose[crew] <= 0) { break; } if($oppose['crew'] <= 0) { break; }
if($general[crew] <= 0) { break; } if($general['crew'] <= 0) { break; }
} }
$msg .= "<S>★</>병사수 변화 : <C>-$mydeathnum</> vs <C>-$mykillnum</><br>"; $msg .= "<S>★</>병사수 변화 : <C>-$mydeathnum</> vs <C>-$mykillnum</><br>";
@@ -651,9 +651,9 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평
// 공헌, 명성 상승 // 공헌, 명성 상승
$exp = round($exp / 50); $exp = round($exp / 50);
$ricing = ($exp * 5 * getCrewtypeRice($game, $general[crewtype], $tech1)); $ricing = ($exp * 5 * getCrewtypeRice($game, $general['crewtype'], $tech1));
$msg .= "★ 【공격장수】공헌 상승 : $exp 쌀 소비 : {$exp}x5x".getCrewtypeRice($game, $general[crewtype], $tech1)." = $ricing<br>"; $msg .= "★ 【공격장수】공헌 상승 : $exp 쌀 소비 : {$exp}x5x".getCrewtypeRice($game, $general['crewtype'], $tech1)." = $ricing<br>";
// $msg2 .= "★ 【공격장수】공헌 상승 : $exp 쌀 소비 : {$exp}x5x".getCrewtypeRice($game, $general[crewtype], $tech1)." = $ricing<br>"; // $msg2 .= "★ 【공격장수】공헌 상승 : $exp 쌀 소비 : {$exp}x5x".getCrewtypeRice($game, $general['crewtype'], $tech1)." = $ricing<br>";
$msg = ConvertLog($msg, 1); $msg = ConvertLog($msg, 1);
@@ -675,11 +675,11 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평
$msg2 .= "{$simulCount}회 평균<br>"; $msg2 .= "{$simulCount}회 평균<br>";
$msg2 .= "<S>★</>병사수 변화 : <C>-$mydeathnumSum</> vs <C>-$mykillnumSum</>   "; $msg2 .= "<S>★</>병사수 변화 : <C>-$mydeathnumSum</> vs <C>-$mykillnumSum</>   ";
$msg2 .= "<R>★</>【성벽】내정 감소량 : $expSum2 【성벽】쌀 소모 : $ricingSum2<br>"; $msg2 .= "<R>★</>【성벽】내정 감소량 : $expSum2 【성벽】쌀 소모 : $ricingSum2<br>";
$msg2 .= "★ 【공격장수】공헌 상승 : $expSum 쌀 소비 : {$expSum}x5x".getCrewtypeRice($game, $general[crewtype], $tech1)." = $ricingSum<br>"; $msg2 .= "★ 【공격장수】공헌 상승 : $expSum 쌀 소비 : {$expSum}x5x".getCrewtypeRice($game, $general['crewtype'], $tech1)." = $ricingSum<br>";
} elseif($isgen == "장수평균") { } elseif($isgen == "장수평균") {
$msg2 .= "{$simulCount}회 평균<br>"; $msg2 .= "{$simulCount}회 평균<br>";
$msg2 .= "<S>★</>병사수 변화 : <C>-$mydeathnumSum</> vs <C>-$mykillnumSum</>   "; $msg2 .= "<S>★</>병사수 변화 : <C>-$mydeathnumSum</> vs <C>-$mykillnumSum</>   ";
$msg2 .= "★ 【공격장수】공헌 상승 : $expSum 쌀 소비 : {$expSum}x5x".getCrewtypeRice($game, $general[crewtype], $tech1)." = $ricingSum<br>"; $msg2 .= "★ 【공격장수】공헌 상승 : $expSum 쌀 소비 : {$expSum}x5x".getCrewtypeRice($game, $general['crewtype'], $tech1)." = $ricingSum<br>";
} }
$msg2 = ConvertLog($msg2, 1); $msg2 = ConvertLog($msg2, 1);
@@ -706,8 +706,8 @@ if($isgen == "장수공격" || $isgen == "성벽공격" || $isgen == "장수평
$def = 7000; $def = 7000;
$wall = 7000; $wall = 7000;
$train3 = $game[city_rate]; $train3 = $game['city_rate'];
$atmos3 = $game[city_rate]; $atmos3 = $game['city_rate'];
} }
switch($level1) { switch($level1) {
+23 -23
View File
@@ -10,12 +10,12 @@ $query = "select conlimit 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);
$query = "select con,userlevel,turntime from general where user_id='$_SESSION[p_id]'"; $query = "select con,userlevel,turntime from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
$con = checkLimit($me[userlevel], $me[con], $admin[conlimit]); $con = checkLimit($me['userlevel'], $me['con'], $admin['conlimit']);
if($con >= 2) { printLimitMsg($me[turntime]); exit(); } if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
?> ?>
<html> <html>
@@ -49,8 +49,8 @@ $nationcount = MYDB_num_rows($nationresult);
for($i=0; $i < $nationcount; $i++) { for($i=0; $i < $nationcount; $i++) {
$nation = MYDB_fetch_array($nationresult); $nation = MYDB_fetch_array($nationresult);
$nationName[$nation[nation]] = $nation[name]; $nationName[$nation['nation']] = $nation['name'];
$nationColor[$nation[nation]] = $nation[color]; $nationColor[$nation['nation']] = $nation['color'];
} }
$type = array( $type = array(
@@ -110,17 +110,17 @@ for($i=0; $i < 21; $i++) {
for($k=0; $k < 10; $k++) { for($k=0; $k < 10; $k++) {
$gen = MYDB_fetch_array($result); $gen = MYDB_fetch_array($result);
if($i != 2) { if($i != 2) {
$name[$k] = $gen[name]; $name[$k] = $gen['name'];
$nation[$k] = $nationName[$gen[nation]]; $nation[$k] = $nationName[$gen['nation']];
$data[$k] = $gen[data]; $data[$k] = $gen['data'];
$color[$k] = $nationColor[$gen[nation]]; $color[$k] = $nationColor[$gen['nation']];
$pic[$k] = $gen[picture]; $pic[$k] = $gen['picture'];
} else { } else {
$name[$k] = "???"; $name[$k] = "???";
$nation[$k] = "???"; $nation[$k] = "???";
$data[$k] = $gen[data]; $data[$k] = $gen['data'];
$color[$k] = $_basecolor4; $color[$k] = $_basecolor4;
$gen[imgsvr] = 0; $gen['imgsvr'] = 0;
$pic[$k] = "9999.jpg"; $pic[$k] = "9999.jpg";
} }
if($color[$k] == "") $color[$k] = $_basecolor4; if($color[$k] == "") $color[$k] = $_basecolor4;
@@ -128,7 +128,7 @@ for($i=0; $i < 21; $i++) {
if($pic[$k] == "") { if($pic[$k] == "") {
echo "<td align=center>&nbsp;</td>"; echo "<td align=center>&nbsp;</td>";
} else { } else {
$imageTemp = GetImageURL($gen[imgsvr]); $imageTemp = GetImageURL($gen['imgsvr']);
echo "<td align=center><img src={$imageTemp}/{$pic[$k]}></img></td>"; echo "<td align=center><img src={$imageTemp}/{$pic[$k]}></img></td>";
} }
} }
@@ -197,16 +197,16 @@ for($i=0; $i < 4; $i++) {
$query = "select nation,no,name,picture,imgsvr from general where {$call[$i]}={$k}"; $query = "select nation,no,name,picture,imgsvr from general where {$call[$i]}={$k}";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen = MYDB_fetch_array($result); $gen = MYDB_fetch_array($result);
$name[$k] = $gen[name]; $name[$k] = $gen['name'];
$nation[$k] = $nationName[$gen[nation]]; $nation[$k] = $nationName[$gen['nation']];
$color[$k] = $nationColor[$gen[nation]]; $color[$k] = $nationColor[$gen['nation']];
$pic[$k] = $gen[picture]; $pic[$k] = $gen['picture'];
if($color[$k] == "") $color[$k] = $_basecolor4; if($color[$k] == "") $color[$k] = $_basecolor4;
if($nation[$k] == "") $nation[$k] = "&nbsp;"; if($nation[$k] == "") $nation[$k] = "&nbsp;";
if($pic[$k] == "") { if($pic[$k] == "") {
echo "<td align=center>&nbsp;</td>"; echo "<td align=center>&nbsp;</td>";
} else { } else {
$imageTemp = GetImageURL($gen[imgsvr]); $imageTemp = GetImageURL($gen['imgsvr']);
echo "<td align=center><img src={$imageTemp}/{$pic[$k]}></img></td>"; echo "<td align=center><img src={$imageTemp}/{$pic[$k]}></img></td>";
} }
} }
@@ -238,16 +238,16 @@ for($i=0; $i < 4; $i++) {
$query = "select nation,no,name,picture,imgsvr from general where {$call[$i]}={$k}"; $query = "select nation,no,name,picture,imgsvr from general where {$call[$i]}={$k}";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen = MYDB_fetch_array($result); $gen = MYDB_fetch_array($result);
$name[$k] = $gen[name]; $name[$k] = $gen['name'];
$nation[$k] = $nationName[$gen[nation]]; $nation[$k] = $nationName[$gen['nation']];
$color[$k] = $nationColor[$gen[nation]]; $color[$k] = $nationColor[$gen['nation']];
$pic[$k] = $gen[picture]; $pic[$k] = $gen['picture'];
if($color[$k] == "") $color[$k] = $_basecolor4; if($color[$k] == "") $color[$k] = $_basecolor4;
if($nation[$k] == "") $nation[$k] = "&nbsp;"; if($nation[$k] == "") $nation[$k] = "&nbsp;";
if($pic[$k] == "") { if($pic[$k] == "") {
echo "<td align=center>&nbsp;</td>"; echo "<td align=center>&nbsp;</td>";
} else { } else {
$imageTemp = GetImageURL($gen[imgsvr]); $imageTemp = GetImageURL($gen['imgsvr']);
echo "<td align=center><img src={$imageTemp}/{$pic[$k]}></img></td>"; echo "<td align=center><img src={$imageTemp}/{$pic[$k]}></img></td>";
} }
} }
+42 -42
View File
@@ -36,35 +36,35 @@ if($select == 0) {
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style='font-size:13;word-break:break-all;color:white;' id=bg0> <table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style='font-size:13;word-break:break-all;color:white;' id=bg0>
<tr> <tr>
<td bgcolor=skyblue align=center colspan=8> <td bgcolor=skyblue align=center colspan=8>
<font size=5>$emperior[phase]</font> <font size=5>$emperior['phase']</font>
<input type=submit value='자세히'> <input type=submit value='자세히'>
<input type=hidden name=select value='$emperior[no]'> <input type=hidden name=select value='$emperior['no']'>
</td> </td>
</tr> </tr>
<tr> <tr>
<td align=center style=color:".newColor($emperior[color])."; bgcolor={$emperior[color]} colspan=8> <td align=center style=color:".newColor($emperior['color'])."; bgcolor={$emperior['color']} colspan=8>
<font size=5>$emperior[name] ({$emperior[year]}年 {$emperior[month]}月)</font> <font size=5>$emperior['name'] ({$emperior['year']}年 {$emperior['month']}月)</font>
</td> </td>
</tr> </tr>
<tr> <tr>
<td id=bg1 align=center width=123>국 력</td> <td id=bg1 align=center width=123>국 력</td>
<td align=center width=123>$emperior[power]</td> <td align=center width=123>$emperior['power']</td>
<td id=bg1 align=center width=123>장 수</td> <td id=bg1 align=center width=123>장 수</td>
<td align=center width=123>$emperior[gennum]</td> <td align=center width=123>$emperior['gennum']</td>
<td id=bg1 align=center width=123>속 령</td> <td id=bg1 align=center width=123>속 령</td>
<td align=center width=123>$emperior[citynum]</td> <td align=center width=123>$emperior['citynum']</td>
<td id=bg1 align=center width=123>성 향</td> <td id=bg1 align=center width=123>성 향</td>
<td align=center width=123>$emperior[type]</td> <td align=center width=123>$emperior['type']</td>
</tr> </tr>
<tr> <tr>
<td id=bg1 width=123 align=center>황 제</td> <td id=bg1 width=123 align=center>황 제</td>
<td width=123 align=center>$emperior[l12name]</td> <td width=123 align=center>$emperior['l12name']</td>
<td id=bg1 width=123 align=center>승 상</td> <td id=bg1 width=123 align=center>승 상</td>
<td width=123 align=center>$emperior[l11name]</td> <td width=123 align=center>$emperior['l11name']</td>
<td id=bg1 width=123 align=center>위 장 군</td> <td id=bg1 width=123 align=center>위 장 군</td>
<td width=123 align=center>$emperior[l10name]</td> <td width=123 align=center>$emperior['l10name']</td>
<td id=bg1 width=123 align=center>사 공</td> <td id=bg1 width=123 align=center>사 공</td>
<td width=123 align=center>$emperior[l9name]</td> <td width=123 align=center>$emperior['l9name']</td>
</tr> </tr>
</table> </table>
</form>"; </form>";
@@ -74,115 +74,115 @@ if($select == 0) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$emperior = MYDB_fetch_array($result); $emperior = MYDB_fetch_array($result);
//background={$image}/{$emperior[l12pic]} //background={$image}/{$emperior['l12pic']}
echo " echo "
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style='font-size:13;word-break:break-all;color:white;' id=bg0> <table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style='font-size:13;word-break:break-all;color:white;' id=bg0>
<tr> <tr>
<td bgcolor=skyblue align=center colspan=6> <td bgcolor=skyblue align=center colspan=6>
<font size=5>$emperior[phase]</font> <font size=5>$emperior['phase']</font>
<input type=submit value='전체보기'> <input type=submit value='전체보기'>
<input type=hidden name=select value='0'> <input type=hidden name=select value='0'>
</td> </td>
</tr> </tr>
<tr> <tr>
<td id=bg1 width=98 align=center>국 가 수<br>(최종 / 최대)</td> <td id=bg1 width=98 align=center>국 가 수<br>(최종 / 최대)</td>
<td align=center width=398 colspan=2>$emperior[nation_count]</td> <td align=center width=398 colspan=2>$emperior['nation_count']</td>
<td id=bg1 width=98 align=center>장 수 수<br>(최종 / 최대)</td> <td id=bg1 width=98 align=center>장 수 수<br>(최종 / 최대)</td>
<td align=center width=398 colspan=2>$emperior[gen_count]</td> <td align=center width=398 colspan=2>$emperior['gen_count']</td>
</tr> </tr>
<tr> <tr>
<td id=bg1 align=center>등 장 국 가</td> <td id=bg1 align=center>등 장 국 가</td>
<td colspan=5>$emperior[nation_name]</td> <td colspan=5>$emperior['nation_name']</td>
</tr> </tr>
<tr> <tr>
<td id=bg1 align=center>국가별 성향</td> <td id=bg1 align=center>국가별 성향</td>
<td colspan=5>$emperior[nation_hist]</td> <td colspan=5>$emperior['nation_hist']</td>
</tr> </tr>
<tr> <tr>
<td id=bg1 align=center>장 수 성 격</td> <td id=bg1 align=center>장 수 성 격</td>
<td colspan=5>$emperior[personal_hist]</td> <td colspan=5>$emperior['personal_hist']</td>
</tr> </tr>
<tr> <tr>
<td id=bg1 align=center>장 수 특 기</td> <td id=bg1 align=center>장 수 특 기</td>
<td colspan=5>$emperior[special_hist]</td> <td colspan=5>$emperior['special_hist']</td>
</tr> </tr>
<tr> <tr>
<td align=center style=color:".newColor($emperior[color])."; bgcolor={$emperior[color]} colspan=6> <td align=center style=color:".newColor($emperior['color'])."; bgcolor={$emperior['color']} colspan=6>
<font size=5>$emperior[name] ({$emperior[year]}年 {$emperior[month]}月)</font> <font size=5>$emperior['name'] ({$emperior['year']}年 {$emperior['month']}月)</font>
</td> </td>
</tr> </tr>
<tr> <tr>
<td id=bg1 width=98 align=center>국 력</td> <td id=bg1 width=98 align=center>국 력</td>
<td align=center width=398 colspan=2>$emperior[power]</td> <td align=center width=398 colspan=2>$emperior['power']</td>
<td id=bg1 width=98 align=center>성 향</td> <td id=bg1 width=98 align=center>성 향</td>
<td align=center width=398 colspan=2>$emperior[type]</td> <td align=center width=398 colspan=2>$emperior['type']</td>
</tr> </tr>
<tr> <tr>
<td id=bg1 width=98 align=center>장 수</td> <td id=bg1 width=98 align=center>장 수</td>
<td align=center width=398 colspan=2>$emperior[gennum]</td> <td align=center width=398 colspan=2>$emperior['gennum']</td>
<td id=bg1 width=98 align=center>속 령</td> <td id=bg1 width=98 align=center>속 령</td>
<td align=center width=398 colspan=2>$emperior[citynum]</td> <td align=center width=398 colspan=2>$emperior['citynum']</td>
</tr> </tr>
<tr> <tr>
<td id=bg1 align=center>총 인 구</td> <td id=bg1 align=center>총 인 구</td>
<td align=center colspan=2>$emperior[pop]</td> <td align=center colspan=2>$emperior['pop']</td>
<td id=bg1 align=center>인 구 율</td> <td id=bg1 align=center>인 구 율</td>
<td align=center colspan=2>$emperior[poprate]</td> <td align=center colspan=2>$emperior['poprate']</td>
</tr> </tr>
<tr> <tr>
<td id=bg1 align=center>국 고</td> <td id=bg1 align=center>국 고</td>
<td align=center colspan=2>$emperior[gold]</td> <td align=center colspan=2>$emperior['gold']</td>
<td id=bg1 align=center>병 량</td> <td id=bg1 align=center>병 량</td>
<td align=center colspan=2>$emperior[rice]</td> <td align=center colspan=2>$emperior['rice']</td>
</tr> </tr>
<tr> <tr>
<td id=bg1 align=center>황 제</td> <td id=bg1 align=center>황 제</td>
<td width=64>&nbsp;</td> <td width=64>&nbsp;</td>
<td width=332>$emperior[l12name]</td> <td width=332>$emperior['l12name']</td>
<td id=bg1 align=center>승 상</td> <td id=bg1 align=center>승 상</td>
<td width=64>&nbsp;</td> <td width=64>&nbsp;</td>
<td width=332>$emperior[l11name]</td> <td width=332>$emperior['l11name']</td>
</tr> </tr>
<tr> <tr>
<td id=bg1 align=center>위 장 군</td> <td id=bg1 align=center>위 장 군</td>
<td width=64>&nbsp;</td> <td width=64>&nbsp;</td>
<td width=332>$emperior[l10name]</td> <td width=332>$emperior['l10name']</td>
<td id=bg1 align=center>사 공</td> <td id=bg1 align=center>사 공</td>
<td width=64>&nbsp;</td> <td width=64>&nbsp;</td>
<td width=332>$emperior[l9name]</td> <td width=332>$emperior['l9name']</td>
</tr> </tr>
<tr> <tr>
<td id=bg1 align=center>표 기 장 군</td> <td id=bg1 align=center>표 기 장 군</td>
<td width=64>&nbsp;</td> <td width=64>&nbsp;</td>
<td width=332>$emperior[l8name]</td> <td width=332>$emperior['l8name']</td>
<td id=bg1 align=center>태 위</td> <td id=bg1 align=center>태 위</td>
<td width=64>&nbsp;</td> <td width=64>&nbsp;</td>
<td width=332>$emperior[l7name]</td> <td width=332>$emperior['l7name']</td>
</tr> </tr>
<tr> <tr>
<td id=bg1 align=center>거 기 장 군</td> <td id=bg1 align=center>거 기 장 군</td>
<td width=64>&nbsp;</td> <td width=64>&nbsp;</td>
<td width=332>$emperior[l6name]</td> <td width=332>$emperior['l6name']</td>
<td id=bg1 align=center>사 도</td> <td id=bg1 align=center>사 도</td>
<td width=64>&nbsp;</td> <td width=64>&nbsp;</td>
<td width=332>$emperior[l5name]</td> <td width=332>$emperior['l5name']</td>
</tr> </tr>
<tr> <tr>
<td id=bg1 align=center>오 호 장 군</td> <td id=bg1 align=center>오 호 장 군</td>
<td colspan=5>$emperior[tiger]</td> <td colspan=5>$emperior['tiger']</td>
</tr> </tr>
<tr> <tr>
<td id=bg1 align=center>건 안 칠 자</td> <td id=bg1 align=center>건 안 칠 자</td>
<td colspan=5>$emperior[eagle]</td> <td colspan=5>$emperior['eagle']</td>
</tr> </tr>
<tr> <tr>
<td id=bg1 align=center>장 수 들<br>(공헌도 순서)</td> <td id=bg1 align=center>장 수 들<br>(공헌도 순서)</td>
<td colspan=5>$emperior[gen]</td> <td colspan=5>$emperior['gen']</td>
</tr> </tr>
<tr> <tr>
<td id=bg1 align=center>역 사 기 록</td> <td id=bg1 align=center>역 사 기 록</td>
<td colspan=5>".ConvertLog($emperior[history], 1)."</td> <td colspan=5>".ConvertLog($emperior['history'], 1)."</td>
</tr> </tr>
</table> </table>
"; ";
+42 -42
View File
@@ -36,35 +36,35 @@ if($select == 0) {
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0> <table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr> <tr>
<td bgcolor=skyblue align=center colspan=8> <td bgcolor=skyblue align=center colspan=8>
<font size=5>$emperior[phase]</font> <font size=5>$emperior['phase']</font>
<input type=submit value='자세히'> <input type=submit value='자세히'>
<input type=hidden name=select value='$emperior[no]'> <input type=hidden name=select value='$emperior['no']'>
</td> </td>
</tr> </tr>
<tr> <tr>
<td align=center style=color:".newColor($emperior[color])."; bgcolor={$emperior[color]} colspan=8> <td align=center style=color:".newColor($emperior['color'])."; bgcolor={$emperior['color']} colspan=8>
<font size=5>$emperior[name] ({$emperior[year]}年 {$emperior[month]}月)</font> <font size=5>$emperior['name'] ({$emperior['year']}年 {$emperior['month']}月)</font>
</td> </td>
</tr> </tr>
<tr> <tr>
<td id=bg1 align=center width=123>국 력</td> <td id=bg1 align=center width=123>국 력</td>
<td align=center width=123>$emperior[power]</td> <td align=center width=123>$emperior['power']</td>
<td id=bg1 align=center width=123>장 수</td> <td id=bg1 align=center width=123>장 수</td>
<td align=center width=123>$emperior[gennum]</td> <td align=center width=123>$emperior['gennum']</td>
<td id=bg1 align=center width=123>속 령</td> <td id=bg1 align=center width=123>속 령</td>
<td align=center width=123>$emperior[citynum]</td> <td align=center width=123>$emperior['citynum']</td>
<td id=bg1 align=center width=123>성 향</td> <td id=bg1 align=center width=123>성 향</td>
<td align=center width=123>$emperior[type]</td> <td align=center width=123>$emperior['type']</td>
</tr> </tr>
<tr> <tr>
<td id=bg1 width=123 align=center>황 제</td> <td id=bg1 width=123 align=center>황 제</td>
<td width=123 align=center>$emperior[l12name]</td> <td width=123 align=center>$emperior['l12name']</td>
<td id=bg1 width=123 align=center>승 상</td> <td id=bg1 width=123 align=center>승 상</td>
<td width=123 align=center>$emperior[l11name]</td> <td width=123 align=center>$emperior['l11name']</td>
<td id=bg1 width=123 align=center>위 장 군</td> <td id=bg1 width=123 align=center>위 장 군</td>
<td width=123 align=center>$emperior[l10name]</td> <td width=123 align=center>$emperior['l10name']</td>
<td id=bg1 width=123 align=center>사 공</td> <td id=bg1 width=123 align=center>사 공</td>
<td width=123 align=center>$emperior[l9name]</td> <td width=123 align=center>$emperior['l9name']</td>
</tr> </tr>
</table> </table>
</form>"; </form>";
@@ -74,116 +74,116 @@ if($select == 0) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$emperior = MYDB_fetch_array($result); $emperior = MYDB_fetch_array($result);
//background={$image}/{$emperior[l12pic]} //background={$image}/{$emperior['l12pic']}
echo " echo "
<form action=a_emperior2.php method=post> <form action=a_emperior2.php method=post>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0> <table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr> <tr>
<td bgcolor=skyblue align=center colspan=6> <td bgcolor=skyblue align=center colspan=6>
<font size=5>$emperior[phase]</font> <font size=5>$emperior['phase']</font>
<input type=submit value='전체보기'> <input type=submit value='전체보기'>
<input type=hidden name=select value='0'> <input type=hidden name=select value='0'>
</td> </td>
</tr> </tr>
<tr> <tr>
<td id=bg1 width=98 align=center>국 가 수<br>(최종 / 최대)</td> <td id=bg1 width=98 align=center>국 가 수<br>(최종 / 최대)</td>
<td align=center width=398 colspan=2>$emperior[nation_count]</td> <td align=center width=398 colspan=2>$emperior['nation_count']</td>
<td id=bg1 width=98 align=center>장 수 수<br>(최종 / 최대)</td> <td id=bg1 width=98 align=center>장 수 수<br>(최종 / 최대)</td>
<td align=center width=398 colspan=2>$emperior[gen_count]</td> <td align=center width=398 colspan=2>$emperior['gen_count']</td>
</tr> </tr>
<tr> <tr>
<td id=bg1 align=center>등 장 국 가</td> <td id=bg1 align=center>등 장 국 가</td>
<td colspan=5>$emperior[nation_name]</td> <td colspan=5>$emperior['nation_name']</td>
</tr> </tr>
<tr> <tr>
<td id=bg1 align=center>국가별 성향</td> <td id=bg1 align=center>국가별 성향</td>
<td colspan=5>$emperior[nation_hist]</td> <td colspan=5>$emperior['nation_hist']</td>
</tr> </tr>
<tr> <tr>
<td id=bg1 align=center>장 수 성 격</td> <td id=bg1 align=center>장 수 성 격</td>
<td colspan=5>$emperior[personal_hist]</td> <td colspan=5>$emperior['personal_hist']</td>
</tr> </tr>
<tr> <tr>
<td id=bg1 align=center>장 수 특 기</td> <td id=bg1 align=center>장 수 특 기</td>
<td colspan=5>$emperior[special_hist]</td> <td colspan=5>$emperior['special_hist']</td>
</tr> </tr>
<tr> <tr>
<td align=center style=color:".newColor($emperior[color])."; bgcolor={$emperior[color]} colspan=6> <td align=center style=color:".newColor($emperior['color'])."; bgcolor={$emperior['color']} colspan=6>
<font size=5>$emperior[name] ({$emperior[year]}年 {$emperior[month]}月)</font> <font size=5>$emperior['name'] ({$emperior['year']}年 {$emperior['month']}月)</font>
</td> </td>
</tr> </tr>
<tr> <tr>
<td id=bg1 width=98 align=center>국 력</td> <td id=bg1 width=98 align=center>국 력</td>
<td align=center width=398 colspan=2>$emperior[power]</td> <td align=center width=398 colspan=2>$emperior['power']</td>
<td id=bg1 width=98 align=center>성 향</td> <td id=bg1 width=98 align=center>성 향</td>
<td align=center width=398 colspan=2>$emperior[type]</td> <td align=center width=398 colspan=2>$emperior['type']</td>
</tr> </tr>
<tr> <tr>
<td id=bg1 width=98 align=center>장 수</td> <td id=bg1 width=98 align=center>장 수</td>
<td align=center width=398 colspan=2>$emperior[gennum]</td> <td align=center width=398 colspan=2>$emperior['gennum']</td>
<td id=bg1 width=98 align=center>속 령</td> <td id=bg1 width=98 align=center>속 령</td>
<td align=center width=398 colspan=2>$emperior[citynum]</td> <td align=center width=398 colspan=2>$emperior['citynum']</td>
</tr> </tr>
<tr> <tr>
<td id=bg1 align=center>총 인 구</td> <td id=bg1 align=center>총 인 구</td>
<td align=center colspan=2>$emperior[pop]</td> <td align=center colspan=2>$emperior['pop']</td>
<td id=bg1 align=center>인 구 율</td> <td id=bg1 align=center>인 구 율</td>
<td align=center colspan=2>$emperior[poprate]</td> <td align=center colspan=2>$emperior['poprate']</td>
</tr> </tr>
<tr> <tr>
<td id=bg1 align=center>국 고</td> <td id=bg1 align=center>국 고</td>
<td align=center colspan=2>$emperior[gold]</td> <td align=center colspan=2>$emperior['gold']</td>
<td id=bg1 align=center>병 량</td> <td id=bg1 align=center>병 량</td>
<td align=center colspan=2>$emperior[rice]</td> <td align=center colspan=2>$emperior['rice']</td>
</tr> </tr>
<tr> <tr>
<td id=bg1 align=center>황 제</td> <td id=bg1 align=center>황 제</td>
<td width=64>&nbsp;</td> <td width=64>&nbsp;</td>
<td width=332>$emperior[l12name]</td> <td width=332>$emperior['l12name']</td>
<td id=bg1 align=center>승 상</td> <td id=bg1 align=center>승 상</td>
<td width=64>&nbsp;</td> <td width=64>&nbsp;</td>
<td width=332>$emperior[l11name]</td> <td width=332>$emperior['l11name']</td>
</tr> </tr>
<tr> <tr>
<td id=bg1 align=center>위 장 군</td> <td id=bg1 align=center>위 장 군</td>
<td width=64>&nbsp;</td> <td width=64>&nbsp;</td>
<td width=332>$emperior[l10name]</td> <td width=332>$emperior['l10name']</td>
<td id=bg1 align=center>사 공</td> <td id=bg1 align=center>사 공</td>
<td width=64>&nbsp;</td> <td width=64>&nbsp;</td>
<td width=332>$emperior[l9name]</td> <td width=332>$emperior['l9name']</td>
</tr> </tr>
<tr> <tr>
<td id=bg1 align=center>표 기 장 군</td> <td id=bg1 align=center>표 기 장 군</td>
<td width=64>&nbsp;</td> <td width=64>&nbsp;</td>
<td width=332>$emperior[l8name]</td> <td width=332>$emperior['l8name']</td>
<td id=bg1 align=center>태 위</td> <td id=bg1 align=center>태 위</td>
<td width=64>&nbsp;</td> <td width=64>&nbsp;</td>
<td width=332>$emperior[l7name]</td> <td width=332>$emperior['l7name']</td>
</tr> </tr>
<tr> <tr>
<td id=bg1 align=center>거 기 장 군</td> <td id=bg1 align=center>거 기 장 군</td>
<td width=64>&nbsp;</td> <td width=64>&nbsp;</td>
<td width=332>$emperior[l6name]</td> <td width=332>$emperior['l6name']</td>
<td id=bg1 align=center>사 도</td> <td id=bg1 align=center>사 도</td>
<td width=64>&nbsp;</td> <td width=64>&nbsp;</td>
<td width=332>$emperior[l5name]</td> <td width=332>$emperior['l5name']</td>
</tr> </tr>
<tr> <tr>
<td id=bg1 align=center>오 호 장 군</td> <td id=bg1 align=center>오 호 장 군</td>
<td colspan=5>$emperior[tiger]</td> <td colspan=5>$emperior['tiger']</td>
</tr> </tr>
<tr> <tr>
<td id=bg1 align=center>건 안 칠 자</td> <td id=bg1 align=center>건 안 칠 자</td>
<td colspan=5>$emperior[eagle]</td> <td colspan=5>$emperior['eagle']</td>
</tr> </tr>
<tr> <tr>
<td id=bg1 align=center>장 수 들<br>(공헌도 순서)</td> <td id=bg1 align=center>장 수 들<br>(공헌도 순서)</td>
<td colspan=5>$emperior[gen]</td> <td colspan=5>$emperior['gen']</td>
</tr> </tr>
<tr> <tr>
<td id=bg1 align=center>역 사 기 록</td> <td id=bg1 align=center>역 사 기 록</td>
<td colspan=5>".ConvertLog($emperior[history], 1)."</td> <td colspan=5>".ConvertLog($emperior['history'], 1)."</td>
</tr> </tr>
</table> </table>
</form>"; </form>";
+32 -32
View File
@@ -10,12 +10,12 @@ $query = "select conlimit 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);
$query = "select con,userlevel,turntime from general where user_id='$_SESSION[p_id]'"; $query = "select con,userlevel,turntime from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
$con = checkLimit($me[userlevel], $me[con], $admin[conlimit]); $con = checkLimit($me['userlevel'], $me['con'], $admin['conlimit']);
if($con >= 2) { printLimitMsg($me[turntime]); exit(); } if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
if($type == 0) { if($type == 0) {
$type = 9; $type = 9;
@@ -65,8 +65,8 @@ $count = MYDB_num_rows($result);
$nationname[0] = "-"; $nationname[0] = "-";
for($i=0; $i < $count; $i++) { for($i=0; $i < $count; $i++) {
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
$nationname[$nation[nation]] = $nation[name]; $nationname[$nation['nation']] = $nation['name'];
$nationlevel[$nation[nation]] = $nation[level]; $nationlevel[$nation['nation']] = $nation['level'];
} }
switch($type) { switch($type) {
@@ -111,12 +111,12 @@ echo"
</tr>"; </tr>";
for($j=0; $j < $gencount; $j++) { for($j=0; $j < $gencount; $j++) {
$general = MYDB_fetch_array($genresult); $general = MYDB_fetch_array($genresult);
$nation = $nationname[$general[nation]]; $nation = $nationname[$general['nation']];
if($general[level] == 12) { if($general['level'] == 12) {
$lbonus = $nationlevel[$general[nation]] * 2; $lbonus = $nationlevel[$general['nation']] * 2;
} elseif($general[level] >= 5) { } elseif($general['level'] >= 5) {
$lbonus = $nationlevel[$general[nation]]; $lbonus = $nationlevel[$general['nation']];
} else { } else {
$lbonus = 0; $lbonus = 0;
} }
@@ -126,43 +126,43 @@ for($j=0; $j < $gencount; $j++) {
$lbonus = ""; $lbonus = "";
} }
if($general[injury] > 0) { if($general['injury'] > 0) {
$leader = floor($general[leader] * (100 - $general[injury])/100); $leader = floor($general['leader'] * (100 - $general['injury'])/100);
$power = floor($general[power] * (100 - $general[injury])/100); $power = floor($general['power'] * (100 - $general['injury'])/100);
$intel = floor($general[intel] * (100 - $general[injury])/100); $intel = floor($general['intel'] * (100 - $general['injury'])/100);
$leader = "<font color=red>{$leader}</font>{$lbonus}"; $leader = "<font color=red>{$leader}</font>{$lbonus}";
$power = "<font color=red>{$power}</font>"; $power = "<font color=red>{$power}</font>";
$intel = "<font color=red>{$intel}</font>"; $intel = "<font color=red>{$intel}</font>";
} else { } else {
$leader = "{$general[leader]}{$lbonus}"; $leader = "{$general['leader']}{$lbonus}";
$power = "{$general[power]}"; $power = "{$general['power']}";
$intel = "{$general[intel]}"; $intel = "{$general['intel']}";
} }
if($general[npc] >= 2) { $name = "<font color=cyan>$general[name]</font>"; } if($general['npc'] >= 2) { $name = "<font color=cyan>$general['name']</font>"; }
elseif($general[npc] == 1) { $name = "<font color=skyblue>$general[name]</font>"; } elseif($general['npc'] == 1) { $name = "<font color=skyblue>$general['name']</font>"; }
else { $name = "$general[name]"; } else { $name = "$general['name']"; }
$general[connect] = round($general[connect] / 10, 0) * 10; $general['connect'] = round($general['connect'] / 10, 0) * 10;
$imageTemp = GetImageURL($general[imgsvr]); $imageTemp = GetImageURL($general['imgsvr']);
echo " echo "
<tr> <tr>
<td align=center><img src={$imageTemp}/{$general[picture]}></img></td> <td align=center><img src={$imageTemp}/{$general['picture']}></img></td>
<td align=center>$name</td> <td align=center>$name</td>
<td align=center>$general[age]세</td> <td align=center>$general['age']세</td>
<td align=center>".getGenChar($general[personal])."</td> <td align=center>".getGenChar($general['personal'])."</td>
<td align=center>".getGenSpecial($general[special])." / ".getGenSpecial($general[special2])."</td> <td align=center>".getGenSpecial($general['special'])." / ".getGenSpecial($general[special2])."</td>
<td align=center>Lv ".getExpLevel($general[experience])."</td> <td align=center>Lv ".getExpLevel($general['experience'])."</td>
<td align=center>{$nation}</td> <td align=center>{$nation}</td>
<td align=center>".getHonor($general[experience])."</td> <td align=center>".getHonor($general['experience'])."</td>
<td align=center>".getDed($general[dedication])."</td> <td align=center>".getDed($general['dedication'])."</td>
<td align=center>"; echo getLevel($general[level]); echo "</td> <td align=center>"; echo getLevel($general['level']); echo "</td>
<td align=center>$leader</td> <td align=center>$leader</td>
<td align=center>$power</td> <td align=center>$power</td>
<td align=center>$intel</td> <td align=center>$intel</td>
<td align=center>$general[killturn]</td> <td align=center>$general['killturn']</td>
<td align=center>$general[connect]"; echo "<br>【".getConnect($general[connect])."】</td> <td align=center>$general['connect']"; echo "<br>【".getConnect($general['connect'])."】</td>
</tr>"; </tr>";
} }
echo " echo "
+6 -6
View File
@@ -53,18 +53,18 @@ for($i=0; $i < 21; $i++) {
for($k=0; $k < 10; $k++) { for($k=0; $k < 10; $k++) {
$gen = MYDB_fetch_array($result); $gen = MYDB_fetch_array($result);
$name[$k] = $gen[name]; $name[$k] = $gen['name'];
$nation[$k] = $gen[nation]; $nation[$k] = $gen['nation'];
$data[$k] = $gen[data]; $data[$k] = $gen['data'];
$color[$k] = $gen[color]; $color[$k] = $gen['color'];
$pic[$k] = $gen[picture]; $pic[$k] = $gen['picture'];
if($color[$k] == "") $color[$k] = $_basecolor4; if($color[$k] == "") $color[$k] = $_basecolor4;
if($nation[$k] == "") $nation[$k] = "&nbsp;"; if($nation[$k] == "") $nation[$k] = "&nbsp;";
/* /*
if($pic[$k] == "") { if($pic[$k] == "") {
echo "<td align=center>&nbsp;</td>"; echo "<td align=center>&nbsp;</td>";
} else { } else {
$imageTemp = GetImageURL($gen[imgsvr]); $imageTemp = GetImageURL($gen['imgsvr']);
echo "<td align=center><img src={$imageTemp}/{$pic[$k]}></img></td>"; echo "<td align=center><img src={$imageTemp}/{$pic[$k]}></img></td>";
} }
*/ */
+6 -6
View File
@@ -12,22 +12,22 @@ $query = "select startyear,year,month,conlimit 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);
$query = "select skin,map,con,userlevel,turntime from general where user_id='$_SESSION[p_id]'"; $query = "select skin,map,con,userlevel,turntime from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
$con = checkLimit($me[userlevel], $me[con], $admin[conlimit]); $con = checkLimit($me['userlevel'], $me['con'], $admin['conlimit']);
if($con >= 2) { printLimitMsg($me[turntime]); exit(); } if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
$query = "select year,month from history order by no limit 1"; $query = "select year,month from history order by no limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$history = MYDB_fetch_array($result); $history = MYDB_fetch_array($result);
$s = ($history[year]*12) + $history[month]; $s = ($history['year']*12) + $history['month'];
$query = "select year,month from history order by no desc limit 1"; $query = "select year,month from history order by no desc limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$history = MYDB_fetch_array($result); $history = MYDB_fetch_array($result);
$e = ($history[year]*12) + $history[month]; $e = ($history['year']*12) + $history['month'];
if(!$yearmonth) { if(!$yearmonth) {
$year = $admin['year']; $year = $admin['year'];
@@ -54,7 +54,7 @@ if($month <= 0) {
$month += 12; $month += 12;
} }
if($me[skin] < 1) { if($me['skin'] < 1) {
$tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4; $tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4;
$_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000"; $_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000";
} }
+70 -70
View File
@@ -10,12 +10,12 @@ $query = "select conlimit 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);
$query = "select con,userlevel,turntime from general where user_id='$_SESSION[p_id]'"; $query = "select con,userlevel,turntime from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
$con = checkLimit($me[userlevel], $me[con], $admin[conlimit]); $con = checkLimit($me['userlevel'], $me['con'], $admin['conlimit']);
if($con >= 2) { printLimitMsg($me[turntime]); exit(); } if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
?> ?>
<html> <html>
@@ -38,140 +38,140 @@ $count = MYDB_num_rows($result);
for($i=1; $i <= $count; $i++) { for($i=1; $i <= $count; $i++) {
$nation = MYDB_fetch_array($result); //국가정보 $nation = MYDB_fetch_array($result); //국가정보
$query = "select city,name from city where nation='$nation[nation]'"; // 도시 이름 목록 $query = "select city,name from city where nation='$nation['nation']'"; // 도시 이름 목록
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($cityresult); $citycount = MYDB_num_rows($cityresult);
$query = "select npc,name,city from general where nation='$nation[nation]' and level='12'"; $query = "select npc,name,city from general where nation='$nation['nation']' and level='12'";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$level12 = MYDB_fetch_array($genresult); $level12 = MYDB_fetch_array($genresult);
$query = "select npc,name from general where nation='$nation[nation]' and level='11'"; $query = "select npc,name from general where nation='$nation['nation']' and level='11'";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$level11 = MYDB_fetch_array($genresult); $level11 = MYDB_fetch_array($genresult);
$query = "select npc,name from general where nation='$nation[nation]' and level='10'"; $query = "select npc,name from general where nation='$nation['nation']' and level='10'";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$level10 = MYDB_fetch_array($genresult); $level10 = MYDB_fetch_array($genresult);
$query = "select npc,name from general where nation='$nation[nation]' and level='9'"; $query = "select npc,name from general where nation='$nation['nation']' and level='9'";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$level9 = MYDB_fetch_array($genresult); $level9 = MYDB_fetch_array($genresult);
$query = "select npc,name from general where nation='$nation[nation]' and level='8'"; $query = "select npc,name from general where nation='$nation['nation']' and level='8'";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$level8 = MYDB_fetch_array($genresult); $level8 = MYDB_fetch_array($genresult);
$query = "select npc,name from general where nation='$nation[nation]' and level='7'"; $query = "select npc,name from general where nation='$nation['nation']' and level='7'";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$level7 = MYDB_fetch_array($genresult); $level7 = MYDB_fetch_array($genresult);
$query = "select npc,name from general where nation='$nation[nation]' and level='6'"; $query = "select npc,name from general where nation='$nation['nation']' and level='6'";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$level6 = MYDB_fetch_array($genresult); $level6 = MYDB_fetch_array($genresult);
$query = "select npc,name from general where nation='$nation[nation]' and level='5'"; $query = "select npc,name from general where nation='$nation['nation']' and level='5'";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$level5 = MYDB_fetch_array($genresult); $level5 = MYDB_fetch_array($genresult);
$query = "select npc,name from general where nation='$nation[nation]' order by dedication desc"; // 장수 목록 $query = "select npc,name from general where nation='$nation['nation']' order by dedication desc"; // 장수 목록
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($genresult); $gencount = MYDB_num_rows($genresult);
if($level12[name] == "") { $l12 = "-"; } if($level12['name'] == "") { $l12 = "-"; }
elseif($level12[npc] >= 2) { $l12 = "<font color=cyan>$level12[name]</font>"; } elseif($level12['npc'] >= 2) { $l12 = "<font color=cyan>$level12['name']</font>"; }
elseif($level12[npc] == 1) { $l12 = "<font color=skyblue>$level12[name]</font>"; } elseif($level12['npc'] == 1) { $l12 = "<font color=skyblue>$level12['name']</font>"; }
else { $l12 = $level12[name]; } else { $l12 = $level12['name']; }
if($level11[name] == "") { $l11 = "-"; } if($level11['name'] == "") { $l11 = "-"; }
elseif($level11[npc] >= 2) { $l11 = "<font color=cyan>$level11[name]</font>"; } elseif($level11['npc'] >= 2) { $l11 = "<font color=cyan>$level11['name']</font>"; }
elseif($level11[npc] == 1) { $l11 = "<font color=skyblue>$level11[name]</font>"; } elseif($level11['npc'] == 1) { $l11 = "<font color=skyblue>$level11['name']</font>"; }
else { $l11 = $level11[name]; } else { $l11 = $level11['name']; }
if($level10[name] == "") { $l10 = "-"; } if($level10['name'] == "") { $l10 = "-"; }
elseif($level10[npc] >= 2) { $l10 = "<font color=cyan>$level10[name]</font>"; } elseif($level10['npc'] >= 2) { $l10 = "<font color=cyan>$level10['name']</font>"; }
elseif($level10[npc] == 1) { $l10 = "<font color=skyblue>$level10[name]</font>"; } elseif($level10['npc'] == 1) { $l10 = "<font color=skyblue>$level10['name']</font>"; }
else { $l10 = $level10[name]; } else { $l10 = $level10['name']; }
if($level9[name] == "") { $l9 = "-"; } if($level9['name'] == "") { $l9 = "-"; }
elseif($level9[npc] >= 2) { $l9 = "<font color=cyan>$level9[name]</font>"; } elseif($level9['npc'] >= 2) { $l9 = "<font color=cyan>$level9['name']</font>"; }
elseif($level9[npc] == 1) { $l9 = "<font color=skyblue>$level9[name]</font>"; } elseif($level9['npc'] == 1) { $l9 = "<font color=skyblue>$level9['name']</font>"; }
else { $l9 = $level9[name]; } else { $l9 = $level9['name']; }
if($level8[name] == "") { $l8 = "-"; } if($level8['name'] == "") { $l8 = "-"; }
elseif($level8[npc] >= 2) { $l8 = "<font color=cyan>$level8[name]</font>"; } elseif($level8['npc'] >= 2) { $l8 = "<font color=cyan>$level8['name']</font>"; }
elseif($level8[npc] == 1) { $l8 = "<font color=skyblue>$level8[name]</font>"; } elseif($level8['npc'] == 1) { $l8 = "<font color=skyblue>$level8['name']</font>"; }
else { $l8 = $level8[name]; } else { $l8 = $level8['name']; }
if($level7[name] == "") { $l7 = "-"; } if($level7['name'] == "") { $l7 = "-"; }
elseif($level7[npc] >= 2) { $l7 = "<font color=cyan>$level7[name]</font>"; } elseif($level7['npc'] >= 2) { $l7 = "<font color=cyan>$level7['name']</font>"; }
elseif($level7[npc] == 1) { $l7 = "<font color=skyblue>$level7[name]</font>"; } elseif($level7['npc'] == 1) { $l7 = "<font color=skyblue>$level7['name']</font>"; }
else { $l7 = $level7[name]; } else { $l7 = $level7['name']; }
if($level6[name] == "") { $l6 = "-"; } if($level6['name'] == "") { $l6 = "-"; }
elseif($level6[npc] >= 2) { $l6 = "<font color=cyan>$level6[name]</font>"; } elseif($level6['npc'] >= 2) { $l6 = "<font color=cyan>$level6['name']</font>"; }
elseif($level6[npc] == 1) { $l6 = "<font color=skyblue>$level6[name]</font>"; } elseif($level6['npc'] == 1) { $l6 = "<font color=skyblue>$level6['name']</font>"; }
else { $l6 = $level6[name]; } else { $l6 = $level6['name']; }
if($level5[name] == "") { $l5 = "-"; } if($level5['name'] == "") { $l5 = "-"; }
elseif($level5[npc] >= 2) { $l5 = "<font color=cyan>$level5[name]</font>"; } elseif($level5['npc'] >= 2) { $l5 = "<font color=cyan>$level5['name']</font>"; }
elseif($level5[npc] == 1) { $l5 = "<font color=skyblue>$level5[name]</font>"; } elseif($level5['npc'] == 1) { $l5 = "<font color=skyblue>$level5['name']</font>"; }
else { $l5 = $level5[name]; } else { $l5 = $level5['name']; }
echo " echo "
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg2> <table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg2>
<tr> <tr>
<td colspan=8 align=center style=color:".newColor($nation[color])."; bgcolor={$nation[color]}>【 {$nation[name]} 】</td> <td colspan=8 align=center style=color:".newColor($nation['color'])."; bgcolor={$nation['color']}>【 {$nation['name']} 】</td>
</tr> </tr>
<tr> <tr>
<td width=123 align=center id=bg1>성 향</td> <td width=123 align=center id=bg1>성 향</td>
<td width=123 align=center><font color=yellow>".getNationType($nation[type])."</font></td> <td width=123 align=center><font color=yellow>".getNationType($nation['type'])."</font></td>
<td width=123 align=center id=bg1>작 위</td> <td width=123 align=center id=bg1>작 위</td>
<td width=123 align=center>".getNationLevel($nation[level])."</td> <td width=123 align=center>".getNationLevel($nation['level'])."</td>
<td width=123 align=center id=bg1>국 력</td> <td width=123 align=center id=bg1>국 력</td>
<td width=123 align=center>{$nation[power]}</td> <td width=123 align=center>{$nation['power']}</td>
<td width=123 align=center id=bg1>장수 / 속령</td> <td width=123 align=center id=bg1>장수 / 속령</td>
<td width=123 align=center>{$gencount} / {$citycount}</td> <td width=123 align=center>{$gencount} / {$citycount}</td>
</tr> </tr>
<tr> <tr>
<td align=center id=bg1>".getLevel(12, $nation[level])."</td> <td align=center id=bg1>".getLevel(12, $nation['level'])."</td>
<td align=center>$l12</td> <td align=center>$l12</td>
<td align=center id=bg1>".getLevel(11, $nation[level])."</td> <td align=center id=bg1>".getLevel(11, $nation['level'])."</td>
<td align=center>$l11</td> <td align=center>$l11</td>
<td align=center id=bg1>".getLevel(10, $nation[level])."</td> <td align=center id=bg1>".getLevel(10, $nation['level'])."</td>
<td align=center>$l10</td> <td align=center>$l10</td>
<td align=center id=bg1>".getLevel( 9, $nation[level])."</td> <td align=center id=bg1>".getLevel( 9, $nation['level'])."</td>
<td align=center>$l9</td> <td align=center>$l9</td>
</tr> </tr>
<tr> <tr>
<td align=center id=bg1>".getLevel( 8, $nation[level])."</td> <td align=center id=bg1>".getLevel( 8, $nation['level'])."</td>
<td align=center>$l8</td> <td align=center>$l8</td>
<td align=center id=bg1>".getLevel( 7, $nation[level])."</td> <td align=center id=bg1>".getLevel( 7, $nation['level'])."</td>
<td align=center>$l7</td> <td align=center>$l7</td>
<td align=center id=bg1>".getLevel( 6, $nation[level])."</td> <td align=center id=bg1>".getLevel( 6, $nation['level'])."</td>
<td align=center>$l6</td> <td align=center>$l6</td>
<td align=center id=bg1>".getLevel( 5, $nation[level])."</td> <td align=center id=bg1>".getLevel( 5, $nation['level'])."</td>
<td align=center>$l5</td> <td align=center>$l5</td>
</tr> </tr>
<tr> <tr>
<td colspan=8>"; <td colspan=8>";
if($nation[level] > 0) { if($nation['level'] > 0) {
echo "속령 일람 : "; echo "속령 일람 : ";
for($j=0; $j < $citycount; $j++) { for($j=0; $j < $citycount; $j++) {
$city = MYDB_fetch_array($cityresult); $city = MYDB_fetch_array($cityresult);
if($city[city] == $nation[capital]) { if($city['city'] == $nation['capital']) {
echo "<font color=cyan>[{$city[name]}]</font>, "; echo "<font color=cyan>[{$city['name']}]</font>, ";
} else { } else {
echo "$city[name], "; echo "$city['name'], ";
} }
} }
} else { } else {
$query = "select name from city where city='$level12[city]'"; // 군주 위치 도시 이름 $query = "select name from city where city='$level12['city']'"; // 군주 위치 도시 이름
$cityResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $cityResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$city = MYDB_fetch_array($cityResult); $city = MYDB_fetch_array($cityResult);
echo "현재 위치 : <font color=yellow>$city[name]</font>"; echo "현재 위치 : <font color=yellow>$city['name']</font>";
} }
echo" echo"
</td> </td>
@@ -180,9 +180,9 @@ for($i=1; $i <= $count; $i++) {
<td colspan=8> 장수 일람 : "; <td colspan=8> 장수 일람 : ";
for($j=0; $j < $gencount; $j++) { for($j=0; $j < $gencount; $j++) {
$general = MYDB_fetch_array($genresult); $general = MYDB_fetch_array($genresult);
if($general[npc] >= 2) { echo "<font color=cyan>$general[name]</font>, "; } if($general['npc'] >= 2) { echo "<font color=cyan>$general['name']</font>, "; }
elseif($general[npc] == 1) { echo "<font color=skyblue>$general[name]</font>, "; } elseif($general['npc'] == 1) { echo "<font color=skyblue>$general['name']</font>, "; }
else { echo "$general[name], "; } else { echo "$general['name'], "; }
} }
echo" echo"
</td> </td>
@@ -216,7 +216,7 @@ echo "
<td colspan=5> 속령 일람 : "; <td colspan=5> 속령 일람 : ";
for($j=0; $j < $citycount; $j++) { for($j=0; $j < $citycount; $j++) {
$city = MYDB_fetch_array($cityresult); $city = MYDB_fetch_array($cityresult);
echo "$city[name], "; echo "$city['name'], ";
} }
echo" echo"
</td> </td>
@@ -225,9 +225,9 @@ echo"
<td colspan=5> 장수 일람 : "; <td colspan=5> 장수 일람 : ";
for($j=0; $j < $gencount; $j++) { for($j=0; $j < $gencount; $j++) {
$general = MYDB_fetch_array($genresult); $general = MYDB_fetch_array($genresult);
if($general[npc] >= 2) { echo "<font color=cyan>$general[name]</font>, "; } if($general['npc'] >= 2) { echo "<font color=cyan>$general['name']</font>, "; }
elseif($general[npc] == 1) { echo "<font color=skyblue>$general[name]</font>, "; } elseif($general['npc'] == 1) { echo "<font color=skyblue>$general['name']</font>, "; }
else { echo "$general[name], "; } else { echo "$general['name'], "; }
} }
echo" echo"
</td> </td>
+14 -14
View File
@@ -44,7 +44,7 @@ $count = MYDB_num_rows($result);
$nationname[0] = "-"; $nationname[0] = "-";
for($i=0; $i < $count; $i++) { for($i=0; $i < $count; $i++) {
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
$nationname[$nation[nation]] = $nation[name]; $nationname[$nation['nation']] = $nation['name'];
} }
switch($type) { switch($type) {
@@ -78,26 +78,26 @@ echo"
</tr>"; </tr>";
for($j=0; $j < $gencount; $j++) { for($j=0; $j < $gencount; $j++) {
$general = MYDB_fetch_array($genresult); $general = MYDB_fetch_array($genresult);
$nation = $nationname[$general[nation]]; $nation = $nationname[$general['nation']];
if($general[npc] >= 2) { $name = "<font color=cyan>$general[name]</font>"; } if($general['npc'] >= 2) { $name = "<font color=cyan>$general['name']</font>"; }
elseif($general[npc] == 1) { $name = "<font color=skyblue>$general[name]</font>"; } elseif($general['npc'] == 1) { $name = "<font color=skyblue>$general['name']</font>"; }
else { $name = "$general[name]"; } else { $name = "$general['name']"; }
echo " echo "
<tr> <tr>
<td align=center>{$name}</td> <td align=center>{$name}</td>
<td align=center>{$general[name2]}</td> <td align=center>{$general[name2]}</td>
<td align=center>Lv {$general[explevel]}</td> <td align=center>Lv {$general['explevel']}</td>
<td align=center>{$nation}</td> <td align=center>{$nation}</td>
<td align=center>".getGenChar($general[personal])."</td> <td align=center>".getGenChar($general['personal'])."</td>
<td align=center>".getGenSpecial($general[special])." / ".getGenSpecial($general[special2])."</td> <td align=center>".getGenSpecial($general['special'])." / ".getGenSpecial($general[special2])."</td>
<td align=center>$general[sum]</td> <td align=center>$general['sum']</td>
<td align=center>$general[leader]</td> <td align=center>$general['leader']</td>
<td align=center>$general[power]</td> <td align=center>$general['power']</td>
<td align=center>$general[intel]</td> <td align=center>$general['intel']</td>
<td align=center>{$general[experience]}</td> <td align=center>{$general['experience']}</td>
<td align=center>{$general[dedication]}</td> <td align=center>{$general['dedication']}</td>
</tr>"; </tr>";
} }
echo " echo "
+6 -6
View File
@@ -11,12 +11,12 @@ $query = "select conlimit 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);
$query = "select skin,map,con,userlevel,turntime from general where user_id='$_SESSION[p_id]'"; $query = "select skin,map,con,userlevel,turntime from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
$con = checkLimit($me[userlevel], $me[con], $admin[conlimit]); $con = checkLimit($me['userlevel'], $me['con'], $admin['conlimit']);
if($con >= 2) { printLimitMsg($me[turntime]); exit(); } if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
?> ?>
<html> <html>
@@ -34,16 +34,16 @@ if($con >= 2) { printLimitMsg($me[turntime]); exit(); }
<table align=center width=1200 height=520 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0> <table align=center width=1200 height=520 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr height=520> <tr height=520>
<td width=498 valign=top> <td width=498 valign=top>
<?php AllLog(34, $me[skin]); ?> <?php AllLog(34, $me['skin']); ?>
</td> </td>
<td width=698> <td width=698>
<iframe src='map.php?type=2&graphic=<?=$me[map];?>' width=698 height=520 frameborder=0 marginwidth=0 marginheight=0 topmargin=0 scrolling=no> <iframe src='map.php?type=2&graphic=<?=$me['map'];?>' width=698 height=520 frameborder=0 marginwidth=0 marginheight=0 topmargin=0 scrolling=no>
</iframe> </iframe>
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan=2 valign=top> <td colspan=2 valign=top>
<?php History(34, $me[skin]); ?> <?php History(34, $me['skin']); ?>
</td> </td>
</tr> </tr>
</table> </table>
+22 -22
View File
@@ -26,10 +26,10 @@ for($i=0; $i < 11; $i++) {
$refresh[$i] = trim($parse[3]); $refresh[$i] = trim($parse[3]);
$online[$i] = trim($parse[4]); $online[$i] = trim($parse[4]);
} }
if($game[maxrefresh] == 0) { $game[maxrefresh] = 1; } if($game['maxrefresh'] == 0) { $game['maxrefresh'] = 1; }
if($game[maxrefresh] < $game[refresh]) { $game[maxrefresh] = $game[refresh]; } if($game['maxrefresh'] < $game['refresh']) { $game['maxrefresh'] = $game['refresh']; }
if($game[maxonline] == 0) { $game[maxonline] = 1; } if($game['maxonline'] == 0) { $game['maxonline'] = 1; }
if($game[maxonline] < $curonline) { $game[maxonline] = $curonline; } if($game['maxonline'] < $curonline) { $game['maxonline'] = $curonline; }
?> ?>
<html> <html>
<head> <head>
@@ -49,7 +49,7 @@ if($game[maxonline] < $curonline) { $game[maxonline] = $curonline; }
<tr><td colspan=4 align=center id=bg2><font size=5>접 속 량</font></td></tr> <tr><td colspan=4 align=center id=bg2><font size=5>접 속 량</font></td></tr>
<?php <?php
for($i=0; $i < 11; $i++) { for($i=0; $i < 11; $i++) {
$w = round($refresh[$i] / $game[maxrefresh] * 100, 1); $w = round($refresh[$i] / $game['maxrefresh'] * 100, 1);
if($w >= 100) { $w -= 0.1; } if($w >= 100) { $w -= 0.1; }
if($refresh[$i] < 10 && $w < 3) { $w = 3; } if($refresh[$i] < 10 && $w < 3) { $w = 3; }
elseif($refresh[$i] < 100 && $w < 6) { $w = 6; } elseif($refresh[$i] < 100 && $w < 6) { $w = 6; }
@@ -73,23 +73,23 @@ for($i=0; $i < 11; $i++) {
</tr> </tr>
"; ";
} }
$w = round($game[refresh] / $game[maxrefresh] * 100, 1); $w = round($game['refresh'] / $game['maxrefresh'] * 100, 1);
if($w >= 100) { $w -= 0.1; } if($w >= 100) { $w -= 0.1; }
if($game[refresh] < 10 && $w < 3) { $w = 3; } if($game['refresh'] < 10 && $w < 3) { $w = 3; }
elseif($game[refresh] < 100 && $w < 6) { $w = 6; } elseif($game['refresh'] < 100 && $w < 6) { $w = 6; }
elseif($game[refresh] < 1000 && $w < 9) { $w = 9; } elseif($game['refresh'] < 1000 && $w < 9) { $w = 9; }
$w2 = round(100 - $w, 1); $w2 = round(100 - $w, 1);
$color = getColor($w); $color = getColor($w);
$dt = date('H:i'); $dt = date('H:i');
echo " echo "
<tr height=30> <tr height=30>
<td width=100 align=center>{$game[year]}년 {$game[month]}월</td> <td width=100 align=center>{$game['year']}년 {$game['month']}월</td>
<td width=60 align=center id=bg2>{$dt}</td> <td width=60 align=center id=bg2>{$dt}</td>
<td width=2 align=center id=bg1></td> <td width=2 align=center id=bg1></td>
<td width=320 align=center> <td width=320 align=center>
<table align=center width=100% height=30 border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0> <table align=center width=100% height=30 border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr> <tr>
<td width={$w}% bgcolor={$color} align=right>{$game[refresh]}&nbsp;</td> <td width={$w}% bgcolor={$color} align=right>{$game['refresh']}&nbsp;</td>
<td width={$w2}% id=bg0><font size=1>&nbsp;</font></td> <td width={$w2}% id=bg0><font size=1>&nbsp;</font></td>
</tr> </tr>
</table> </table>
@@ -97,7 +97,7 @@ echo "
</tr> </tr>
<tr><td colspan=4 height=5 align=center id=bg1></td></tr> <tr><td colspan=4 height=5 align=center id=bg1></td></tr>
<tr> <tr>
<td colspan=4 height=30 align=center id=bg0>최고기록: {$game[maxrefresh]}</td> <td colspan=4 height=30 align=center id=bg0>최고기록: {$game['maxrefresh']}</td>
</tr> </tr>
"; ";
?> ?>
@@ -108,7 +108,7 @@ echo "
<tr><td colspan=4 align=center id=bg2><font size=5>접 속 자</font></td></tr> <tr><td colspan=4 align=center id=bg2><font size=5>접 속 자</font></td></tr>
<?php <?php
for($i=0; $i < 11; $i++) { for($i=0; $i < 11; $i++) {
$w = round($online[$i] / $game[maxonline] * 100, 1); $w = round($online[$i] / $game['maxonline'] * 100, 1);
if($w >= 100) { $w -= 0.1; } if($w >= 100) { $w -= 0.1; }
if($online[$i] < 10 && $w < 3) { $w = 3; } if($online[$i] < 10 && $w < 3) { $w = 3; }
elseif($online[$i] < 100 && $w < 6) { $w = 6; } elseif($online[$i] < 100 && $w < 6) { $w = 6; }
@@ -132,7 +132,7 @@ for($i=0; $i < 11; $i++) {
</tr> </tr>
"; ";
} }
$w = round($curonline / $game[maxonline] * 100, 1); $w = round($curonline / $game['maxonline'] * 100, 1);
if($w >= 100) { $w -= 0.1; } if($w >= 100) { $w -= 0.1; }
if($curonline < 10 && $w < 3) { $w = 3; } if($curonline < 10 && $w < 3) { $w = 3; }
elseif($curonline < 100 && $w < 6) { $w = 6; } elseif($curonline < 100 && $w < 6) { $w = 6; }
@@ -142,7 +142,7 @@ $color = getColor($w);
$dt = date('H:i'); $dt = date('H:i');
echo " echo "
<tr height=30> <tr height=30>
<td width=100 align=center>{$game[year]}년 {$game[month]}월</td> <td width=100 align=center>{$game['year']}년 {$game['month']}월</td>
<td width=60 align=center id=bg2>{$dt}</td> <td width=60 align=center id=bg2>{$dt}</td>
<td width=2 align=center id=bg1></td> <td width=2 align=center id=bg1></td>
<td width=320 align=center> <td width=320 align=center>
@@ -156,7 +156,7 @@ echo "
</tr> </tr>
<tr><td colspan=4 height=5 align=center id=bg1></td></tr> <tr><td colspan=4 height=5 align=center id=bg1></td></tr>
<tr> <tr>
<td colspan=4 height=30 align=center id=bg0>최고기록: {$game[maxonline]}</td> <td colspan=4 height=30 align=center id=bg0>최고기록: {$game['maxonline']}</td>
</tr> </tr>
"; ";
?> ?>
@@ -170,8 +170,8 @@ echo "
$query = "select sum(refresh) as refresh,sum(connect) as connect from general"; $query = "select sum(refresh) as refresh,sum(connect) as connect from general";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$user = MYDB_fetch_array($result); $user = MYDB_fetch_array($result);
$user[connect] = round($user[connect], 1); $user['connect'] = round($user['connect'], 1);
$maxrefresh = $user[refresh]; $maxrefresh = $user['refresh'];
$w = round($maxrefresh / $maxrefresh * 100, 1); $w = round($maxrefresh / $maxrefresh * 100, 1);
$w2 = round(100 - $w, 1); $w2 = round(100 - $w, 1);
@@ -184,7 +184,7 @@ echo "
</tr> </tr>
<tr> <tr>
<td align=center>접속자 총합</td> <td align=center>접속자 총합</td>
<td align=center>{$user[connect]}({$maxrefresh})</td> <td align=center>{$user['connect']}({$maxrefresh})</td>
<td align=center> <td align=center>
<table align=center width=100% height=100% border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0> <table align=center width=100% height=100% border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr> <tr>
@@ -202,13 +202,13 @@ $count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) { for($i=0; $i < $count; $i++) {
$user = MYDB_fetch_array($result); $user = MYDB_fetch_array($result);
$w = round($user[refresh] / $maxrefresh * 100, 1); $w = round($user['refresh'] / $maxrefresh * 100, 1);
$w2 = round(100 - $w, 1); $w2 = round(100 - $w, 1);
$color = getColor($w); $color = getColor($w);
echo " echo "
<tr> <tr>
<td width=98 align=center>{$user[name]}</td> <td width=98 align=center>{$user['name']}</td>
<td width=98 align=center>{$user[connect]}({$user[refresh]})</td> <td width=98 align=center>{$user['connect']}({$user['refresh']})</td>
<td width=798 align=center> <td width=798 align=center>
<table align=center width=100% height=100% border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0> <table align=center width=100% height=100% border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr> <tr>
+27 -27
View File
@@ -4,7 +4,7 @@ include "func.php";
$connect = dbConn(); $connect = dbConn();
increaseRefresh($connect, "설문조사", 1); increaseRefresh($connect, "설문조사", 1);
$query = "select no,userlevel,vote from general where user_id='$_SESSION[p_id]'"; $query = "select no,userlevel,vote from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
@@ -12,7 +12,7 @@ $query = "select develcost,voteopen,vote,votecomment 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);
$vote = explode("|", $admin[vote]); $vote = explode("|", $admin['vote']);
if($vote[0] == "") { if($vote[0] == "") {
$vote[0] = "-"; $vote[0] = "-";
} }
@@ -40,10 +40,10 @@ function captureKey(e) {
</table> </table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0> <table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<form name=form1 action=c_vote.php method=post> <form name=form1 action=c_vote.php method=post>
<tr><td colspan=3 align=center id=bg2><font size=5>설 문 조 사 (<?=$admin[develcost]*5;?>금과 추첨으로 유니크템 증정!)</font></td></tr> <tr><td colspan=3 align=center id=bg2><font size=5>설 문 조 사 (<?=$admin['develcost']*5;?>금과 추첨으로 유니크템 증정!)</font></td></tr>
<?php <?php
if($me[userlevel] >= 5) { if($me['userlevel'] >= 5) {
echo " echo "
<tr> <tr>
<td width=48 align=center><input type=submit name=btn value='알림'></td> <td width=48 align=center><input type=submit name=btn value='알림'></td>
@@ -78,11 +78,11 @@ for($i=1; $i < $voteTypeCount; $i++) {
<td width=48 align=center style=color:".getNewColor($i)."; bgcolor=".getColor($i).">{$i}.</td> <td width=48 align=center style=color:".getNewColor($i)."; bgcolor=".getColor($i).">{$i}.</td>
<td width=98 align=center> <td width=98 align=center>
"; ";
if($me[vote] == 0 && $me[no] > 0) { if($me['vote'] == 0 && $me['no'] > 0) {
echo " echo "
<input type=radio name=sel value={$i}> <input type=radio name=sel value={$i}>
"; ";
} elseif($admin[voteopen] >= 1 || $me[userlevel] >= 5) { } elseif($admin['voteopen'] >= 1 || $me['userlevel'] >= 5) {
$query = "select no from general where vote='{$i}'"; $query = "select no from general where vote='{$i}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$vCount = MYDB_num_rows($result); $vCount = MYDB_num_rows($result);
@@ -103,7 +103,7 @@ for($i=1; $i < $voteTypeCount; $i++) {
echo " echo "
<tr> <tr>
"; ";
if($me[vote] == 0 && $me[no] > 0) { if($me['vote'] == 0 && $me['no'] > 0) {
echo " echo "
<td align=center>투표</td> <td align=center>투표</td>
<td align=center><input type=submit name=btn value='투표'></td> <td align=center><input type=submit name=btn value='투표'></td>
@@ -118,7 +118,7 @@ echo "
</tr> </tr>
"; ";
if($me[userlevel] >= 5) { if($me['userlevel'] >= 5) {
echo " echo "
<tr> <tr>
<td align=center><input type=submit name=btn value='리셋'></td> <td align=center><input type=submit name=btn value='리셋'></td>
@@ -128,8 +128,8 @@ if($me[userlevel] >= 5) {
"; ";
} }
if($admin[votecomment] != "") { if($admin['votecomment'] != "") {
$comment = explode("|", $admin[votecomment]); $comment = explode("|", $admin['votecomment']);
$commentCount = count($comment); $commentCount = count($comment);
} else { } else {
$commentCount = 0; $commentCount = 0;
@@ -154,7 +154,7 @@ for($i=0; $i < $commentCount; $i++) {
</tr> </tr>
"; ";
} }
if($me[no] > 0) { if($me['no'] > 0) {
echo " echo "
<tr> <tr>
<td width=108 colspan=2 align=center>-</td> <td width=108 colspan=2 align=center>-</td>
@@ -170,7 +170,7 @@ if($me[no] > 0) {
<tr><td colspan=3 align=center id=bg2><font size=5> <tr><td colspan=3 align=center id=bg2><font size=5>
전 체 통 계 전 체 통 계
<?php <?php
if($me[userlevel] >= 5) { if($me['userlevel'] >= 5) {
echo " echo "
<input type=submit name=btn value='숨김'> <input type=submit name=btn value='숨김'>
<input type=submit name=btn value='전체통계만'> <input type=submit name=btn value='전체통계만'>
@@ -179,7 +179,7 @@ if($me[userlevel] >= 5) {
echo " echo "
</font></td></tr>"; </font></td></tr>";
if($admin[voteopen] >= 1 || $me[userlevel] >= 5) { if($admin['voteopen'] >= 1 || $me['userlevel'] >= 5) {
echo " echo "
<tr> <tr>
<td width=98 align=center>전 체</td> <td width=98 align=center>전 체</td>
@@ -199,14 +199,14 @@ if($admin[voteopen] >= 1 || $me[userlevel] >= 5) {
for($i=0; $i < $count; $i++) { for($i=0; $i < $count; $i++) {
$vote = MYDB_fetch_array($result); $vote = MYDB_fetch_array($result);
$totalVote[$vote[vote]]++; $totalVote[$vote['vote']]++;
if($vote[vote] > 0) { $nationVoteCount[$vote[nation]]++; } if($vote['vote'] > 0) { $nationVoteCount[$vote['nation']]++; }
$nationVote[$vote[nation]][$vote[vote]]++; $nationVote[$vote['nation']][$vote['vote']]++;
} }
for($i=0; $i < $voteTypeCount; $i++) { for($i=0; $i < $voteTypeCount; $i++) {
$per = @round($totalVote[$i] / $memCount * 100, 1); $per = @round($totalVote[$i] / $memCount * 100, 1);
// if($per < 5) { $vote[cnt] = "&nbsp;"; } // if($per < 5) { $vote['cnt'] = "&nbsp;"; }
echo " echo "
<td width={$per}% align=center style=color:".getNewColor($i)."; bgcolor=".getColor($i).">{$totalVote[$i]}</td> <td width={$per}% align=center style=color:".getNewColor($i)."; bgcolor=".getColor($i).">{$totalVote[$i]}</td>
"; ";
@@ -220,7 +220,7 @@ if($admin[voteopen] >= 1 || $me[userlevel] >= 5) {
"; ";
} }
if($admin[voteopen] >= 2 || $me[userlevel] >= 5) { if($admin['voteopen'] >= 2 || $me['userlevel'] >= 5) {
$query = "select no from general where nation=0 and npc<2"; $query = "select no from general where nation=0 and npc<2";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$memCount = MYDB_num_rows($result); $memCount = MYDB_num_rows($result);
@@ -239,7 +239,7 @@ if($admin[voteopen] >= 2 || $me[userlevel] >= 5) {
for($i=0; $i < $voteTypeCount; $i++) { for($i=0; $i < $voteTypeCount; $i++) {
$per = @round($nationVote[0][$i] / $memCount * 100, 1); $per = @round($nationVote[0][$i] / $memCount * 100, 1);
// if($per < 5) { $vote[cnt] = "&nbsp;"; } // if($per < 5) { $vote['cnt'] = "&nbsp;"; }
echo " echo "
<td width={$per}% align=center style=color:".getNewColor($i)."; bgcolor=".getColor($i).">{$nationVote[0][$i]}</td> <td width={$per}% align=center style=color:".getNewColor($i)."; bgcolor=".getColor($i).">{$nationVote[0][$i]}</td>
"; ";
@@ -258,27 +258,27 @@ if($admin[voteopen] >= 2 || $me[userlevel] >= 5) {
for($i=0; $i < $nationcount; $i++) { for($i=0; $i < $nationcount; $i++) {
$nation = MYDB_fetch_array($nationResult); $nation = MYDB_fetch_array($nationResult);
$query = "select no from general where nation='{$nation[nation]}' and npc<2"; $query = "select no from general where nation='{$nation['nation']}' and npc<2";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$memCount = MYDB_num_rows($result); $memCount = MYDB_num_rows($result);
if(!$nationVoteCount[$nation[nation]]) { $nationVoteCount[$nation[nation]] = 0; } if(!$nationVoteCount[$nation['nation']]) { $nationVoteCount[$nation['nation']] = 0; }
$percentage = @round($nationVoteCount[$nation[nation]] / $memCount * 100, 1); $percentage = @round($nationVoteCount[$nation['nation']] / $memCount * 100, 1);
echo " echo "
<tr> <tr>
<td align=center style=color:".newColor($nation[color])."; bgcolor={$nation[color]}>{$nation[name]}</td> <td align=center style=color:".newColor($nation['color'])."; bgcolor={$nation['color']}>{$nation['name']}</td>
<td align=center>{$nationVoteCount[$nation[nation]]} / {$memCount} ({$percentage} %)</td> <td align=center>{$nationVoteCount[$nation['nation']]} / {$memCount} ({$percentage} %)</td>
<td align=center> <td align=center>
<table align=center width=100% height=100% border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0> <table align=center width=100% height=100% border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr> <tr>
"; ";
for($k=0; $k < $voteTypeCount; $k++) { for($k=0; $k < $voteTypeCount; $k++) {
$per = @round($nationVote[$nation[nation]][$k] / $memCount * 100, 1); $per = @round($nationVote[$nation['nation']][$k] / $memCount * 100, 1);
// if($per < 5) { $vote[cnt] = "&nbsp;"; } // if($per < 5) { $vote['cnt'] = "&nbsp;"; }
echo " echo "
<td width={$per}% align=center style=color:".getNewColor($k)."; bgcolor=".getColor($k).">{$nationVote[$nation[nation]][$k]}</td> <td width={$per}% align=center style=color:".getNewColor($k)."; bgcolor=".getColor($k).">{$nationVote[$nation['nation']][$k]}</td>
"; ";
} }
+34 -34
View File
@@ -6,7 +6,7 @@ CheckLogin();
$connect = dbConn(); $connect = dbConn();
increaseRefresh($connect, "거래장", 2); increaseRefresh($connect, "거래장", 2);
$query = "select no,special,skin,userlevel,con,turntime from general where user_id='$_SESSION[p_id]'"; $query = "select no,special,skin,userlevel,con,turntime from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
@@ -14,26 +14,26 @@ $query = "select conlimit 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);
$con = checkLimit($me[userlevel], $me[con], $admin[conlimit]); $con = checkLimit($me['userlevel'], $me['con'], $admin['conlimit']);
if($con >= 2) { printLimitMsg($me[turntime]); exit(); } if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
$query = "select no from auction where no1='$me[no]'"; $query = "select no from auction where no1='$me['no']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$tradeCount = MYDB_num_rows($result); $tradeCount = MYDB_num_rows($result);
$query = "select no from auction where no2='$me[no]'"; $query = "select no from auction where no2='$me['no']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$bidCount = MYDB_num_rows($result); $bidCount = MYDB_num_rows($result);
$btCount = $tradeCount + $bidCount; $btCount = $tradeCount + $bidCount;
if($me[userlevel] >= 5 || ($me[special] != 30 && $btCount < 1) || ($me[special] == 30 && $btCount < 3)) { if($me['userlevel'] >= 5 || ($me['special'] != 30 && $btCount < 1) || ($me['special'] == 30 && $btCount < 3)) {
$btn = "submit"; $btn = "submit";
} else { } else {
$btn = "hidden"; $btn = "hidden";
} }
if($me[skin] < 1) { if($me['skin'] < 1) {
$tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4; $tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4;
$_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000"; $_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000";
} }
@@ -77,28 +77,28 @@ $count = MYDB_num_rows($result);
$chk = 0; $chk = 0;
for($i=0; $i < $count; $i++) { for($i=0; $i < $count; $i++) {
$auction = MYDB_fetch_array($result); $auction = MYDB_fetch_array($result);
$itemname = GetStuffName($auction[stuff]); $itemname = GetStuffName($auction['stuff']);
$radio = ""; $alert = ""; $alert2 = ""; $radio = ""; $alert = ""; $alert2 = "";
if($auction[no1] == $me[no]) { $radio = " disabled"; } if($auction[no1] == $me['no']) { $radio = " disabled"; }
elseif($auction[no2] > 0 && $auction[amount] * 2 <= $auction[value] && $auction[stuff] == 0) { $radio = " disabled"; $alert = "<font color=red>"; $alert2 = "</font>"; } elseif($auction[no2] > 0 && $auction['amount'] * 2 <= $auction['value'] && $auction['stuff'] == 0) { $radio = " disabled"; $alert = "<font color=red>"; $alert2 = "</font>"; }
elseif($auction[no2] > 0 && $auction[topv] <= $auction[value]) { $radio = " disabled"; $alert = "<font color=red>"; $alert2 = "</font>"; } elseif($auction[no2] > 0 && $auction['topv'] <= $auction['value']) { $radio = " disabled"; $alert = "<font color=red>"; $alert2 = "</font>"; }
elseif($chk == 0) { $radio = " checked"; $chk = 1; } elseif($chk == 0) { $radio = " checked"; $chk = 1; }
$pv = round($auction[value] * 100 / $auction[amount]) / 100 + 0.001; $pv = round($auction['value'] * 100 / $auction['amount']) / 100 + 0.001;
$pv = substr($pv, 0, 4); $pv = substr($pv, 0, 4);
if($auction[stuff] != 0) { $pv = '-'; } if($auction['stuff'] != 0) { $pv = '-'; }
echo " echo "
<tr align=center> <tr align=center>
<td>{$auction[no]}</td> <td>{$auction['no']}</td>
<td><input type=radio name=sel value={$auction[no]}{$radio}></td> <td><input type=radio name=sel value={$auction['no']}{$radio}></td>
<td>{$auction[name1]}</td> <td>{$auction[name1]}</td>
<td>{$itemname}</td> <td>{$itemname}</td>
<td>{$auction[amount]}</td> <td>{$auction['amount']}</td>
<td>금 {$auction[cost]}</td> <td>금 {$auction['cost']}</td>
<td>{$alert}금 {$auction[value]}{$alert2}</td> <td>{$alert}금 {$auction['value']}{$alert2}</td>
<td>{$alert}금 {$auction[topv]}{$alert2}</td> <td>{$alert}금 {$auction['topv']}{$alert2}</td>
<td>{$alert}{$pv}{$alert2}</td> <td>{$alert}{$pv}{$alert2}</td>
<td>{$alert}{$auction[name2]}{$alert2}</td> <td>{$alert}{$auction[name2]}{$alert2}</td>
<td>{$auction[expire]}</td> <td>{$auction['expire']}</td>
</tr> </tr>
"; ";
} }
@@ -161,28 +161,28 @@ $count = MYDB_num_rows($result);
$chk = 0; $chk = 0;
for($i=0; $i < $count; $i++) { for($i=0; $i < $count; $i++) {
$auction = MYDB_fetch_array($result); $auction = MYDB_fetch_array($result);
$itemname = GetStuffName($auction[stuff]); $itemname = GetStuffName($auction['stuff']);
$radio = ""; $alert = ""; $alert2 = ""; $radio = ""; $alert = ""; $alert2 = "";
if($auction[no1] == $me[no]) { $radio = " disabled"; } if($auction[no1] == $me['no']) { $radio = " disabled"; }
elseif($auction[no2] > 0 && $auction[amount] >= $auction[value] * 2 && $auction[stuff] == 0) { $radio = " disabled"; $alert = "<font color=red>"; $alert2 = "</font>"; } elseif($auction[no2] > 0 && $auction['amount'] >= $auction['value'] * 2 && $auction['stuff'] == 0) { $radio = " disabled"; $alert = "<font color=red>"; $alert2 = "</font>"; }
elseif($auction[no2] > 0 && $auction[topv] >= $auction[value]) { $radio = " disabled"; $alert = "<font color=red>"; $alert2 = "</font>"; } elseif($auction[no2] > 0 && $auction['topv'] >= $auction['value']) { $radio = " disabled"; $alert = "<font color=red>"; $alert2 = "</font>"; }
elseif($chk == 0) { $radio = " checked"; $chk = 1; } elseif($chk == 0) { $radio = " checked"; $chk = 1; }
$pv = round($auction[value] * 100 / $auction[amount]) / 100 + 0.001; $pv = round($auction['value'] * 100 / $auction['amount']) / 100 + 0.001;
$pv = substr($pv, 0, 4); $pv = substr($pv, 0, 4);
if($auction[stuff] != 0) { $pv = '-'; } if($auction['stuff'] != 0) { $pv = '-'; }
echo " echo "
<tr align=center> <tr align=center>
<td>{$auction[no]}</td> <td>{$auction['no']}</td>
<td><input type=radio name=sel value={$auction[no]}{$radio}></td> <td><input type=radio name=sel value={$auction['no']}{$radio}></td>
<td>{$auction[name1]}</td> <td>{$auction[name1]}</td>
<td>{$itemname}</td> <td>{$itemname}</td>
<td>{$auction[amount]}</td> <td>{$auction['amount']}</td>
<td>금 {$auction[cost]}</td> <td>금 {$auction['cost']}</td>
<td>{$alert}금 {$auction[value]}{$alert2}</td> <td>{$alert}금 {$auction['value']}{$alert2}</td>
<td>{$alert}금 {$auction[topv]}{$alert2}</td> <td>{$alert}금 {$auction['topv']}{$alert2}</td>
<td>{$alert}{$pv}{$alert2}</td> <td>{$alert}{$pv}{$alert2}</td>
<td>{$alert}{$auction[name2]}{$alert2}</td> <td>{$alert}{$auction[name2]}{$alert2}</td>
<td>{$auction[expire]}</td> <td>{$auction['expire']}</td>
</tr> </tr>
"; ";
} }
@@ -224,7 +224,7 @@ for($i=0; $i < $count; $i++) {
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0> <table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr><td align=center id=bg2><font size=5>최 근 기 록</font></td></tr> <tr><td align=center id=bg2><font size=5>최 근 기 록</font></td></tr>
<tr><td> <tr><td>
<?=AuctionLog(20, $me[skin]);?> <?=AuctionLog(20, $me['skin']);?>
</td></tr> </td></tr>
<tr><td align=center id=bg2><font size=5>도 움 말</font></td></tr> <tr><td align=center id=bg2><font size=5>도 움 말</font></td></tr>
<tr><td> <tr><td>
+20 -20
View File
@@ -16,26 +16,26 @@ $query = "select nation from general where no='$gen'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$query = "select skin,no,nation,level,userlevel,con,turntime,belong from general where user_id='$_SESSION[p_id]'"; $query = "select skin,no,nation,level,userlevel,con,turntime,belong from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
$query = "select secretlimit from nation where nation='$me[nation]'"; $query = "select secretlimit from nation where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
$con = checkLimit($me[userlevel], $me[con], $admin[conlimit]); $con = checkLimit($me['userlevel'], $me['con'], $admin['conlimit']);
if($con >= 2) { printLimitMsg($me[turntime]); exit(); } if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
//재야인 경우 //재야인 경우
$meLevel = $me[level]; $meLevel = $me['level'];
if($meLevel == 0 || ($meLevel == 1 && $me[belong] < $nation[secretlimit])) { if($meLevel == 0 || ($meLevel == 1 && $me['belong'] < $nation['secretlimit'])) {
echo "수뇌부가 아니거나 사관년도가 부족합니다."; echo "수뇌부가 아니거나 사관년도가 부족합니다.";
exit(); exit();
} }
//잘못된 접근 //잘못된 접근
if($general[nation] != $me[nation]) { if($general['nation'] != $me['nation']) {
$gen = 0; $gen = 0;
} }
@@ -48,7 +48,7 @@ if($type == 0) {
} }
$sel[$type] = "selected"; $sel[$type] = "selected";
if($me[skin] < 1) { if($me['skin'] < 1) {
$tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4; $tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4;
$_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000"; $_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000";
} }
@@ -79,10 +79,10 @@ if($me[skin] < 1) {
<select name=gen size=1> <select name=gen size=1>
<?php <?php
switch($type) { switch($type) {
case 0: $query = "select no,name from general where nation='{$me[nation]}' order by turntime desc"; break; case 0: $query = "select no,name from general where nation='{$me['nation']}' order by turntime desc"; break;
case 1: $query = "select no,name from general where nation='{$me[nation]}' order by recwar desc"; break; case 1: $query = "select no,name from general where nation='{$me['nation']}' order by recwar desc"; break;
case 2: $query = "select no,name from general where nation='{$me[nation]}' order by npc,binary(name)"; break; case 2: $query = "select no,name from general where nation='{$me['nation']}' order by npc,binary(name)"; break;
case 3: $query = "select no,name from general where nation='{$me[nation]}' order by warnum desc"; break; case 3: $query = "select no,name from general where nation='{$me['nation']}' order by warnum desc"; break;
} }
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result); $gencount = MYDB_num_rows($result);
@@ -91,14 +91,14 @@ for($i=0; $i < $gencount; $i++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
// 선택 없으면 맨 처음 장수 // 선택 없으면 맨 처음 장수
if($gen == 0) { if($gen == 0) {
$gen = $general[no]; $gen = $general['no'];
} }
if($gen == $general[no]) { if($gen == $general['no']) {
echo " echo "
<option selected value={$general[no]}>{$general[name]}</option>"; <option selected value={$general['no']}>{$general['name']}</option>";
} else { } else {
echo " echo "
<option value={$general[no]}>{$general[name]}</option>"; <option value={$general['no']}>{$general['name']}</option>";
} }
} }
?> ?>
@@ -114,10 +114,10 @@ for($i=0; $i < $gencount; $i++) {
</tr> </tr>
<tr> <tr>
<td valign=top> <td valign=top>
<?php generalInfo($connect, $gen, $me[skin]); generalInfo2($connect, $gen, $me[skin]); ?> <?php generalInfo($connect, $gen, $me['skin']); generalInfo2($connect, $gen, $me['skin']); ?>
</td> </td>
<td valign=top> <td valign=top>
<?php MyHistory($connect, $gen, $me[skin]); ?> <?php MyHistory($connect, $gen, $me['skin']); ?>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -126,10 +126,10 @@ for($i=0; $i < $gencount; $i++) {
</tr> </tr>
<tr> <tr>
<td valign=top> <td valign=top>
<?php MyBatLog($gen, 24, $me[skin]); ?> <?php MyBatLog($gen, 24, $me['skin']); ?>
</td> </td>
<td valign=top> <td valign=top>
<?php MyBatRes($gen, 24, $me[skin]); ?> <?php MyBatRes($gen, 24, $me['skin']); ?>
</td> </td>
</tr> </tr>
</table> </table>
+34 -34
View File
@@ -7,7 +7,7 @@ $connect = dbConn();
increaseRefresh($connect, "베팅장", 1); increaseRefresh($connect, "베팅장", 1);
checkTurn($connect); checkTurn($connect);
$query = "select no,tournament,userlevel,con,turntime,bet0+bet1+bet2+bet3+bet4+bet5+bet6+bet7+bet8+bet9+bet10+bet11+bet12+bet13+bet14+bet15 as bet from general where user_id='$_SESSION[p_id]'"; $query = "select no,tournament,userlevel,con,turntime,bet0+bet1+bet2+bet3+bet4+bet5+bet6+bet7+bet8+bet9+bet10+bet11+bet12+bet13+bet14+bet15 as bet from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
@@ -15,17 +15,17 @@ $query = "select conlimit,tournament,phase,tnmt_type,develcost,bet0,bet1,bet2,be
$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);
$con = checkLimit($me[userlevel], $me[con], $admin[conlimit]); $con = checkLimit($me['userlevel'], $me['con'], $admin['conlimit']);
if($con >= 2) { printLimitMsg($me[turntime]); exit(); } if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
switch($admin[tnmt_type]) { switch($admin['tnmt_type']) {
case 0: $tnmt_type = "<font color=cyan>전력전</font>"; $tp = "tot"; $tp2 = "종합"; $tp3 = "total"; break; case 0: $tnmt_type = "<font color=cyan>전력전</font>"; $tp = "tot"; $tp2 = "종합"; $tp3 = "total"; break;
case 1: $tnmt_type = "<font color=cyan>통솔전</font>"; $tp = "ldr"; $tp2 = "통솔"; $tp3 = "leader"; break; case 1: $tnmt_type = "<font color=cyan>통솔전</font>"; $tp = "ldr"; $tp2 = "통솔"; $tp3 = "leader"; break;
case 2: $tnmt_type = "<font color=cyan>일기토</font>"; $tp = "pwr"; $tp2 = "무력"; $tp3 = "power"; break; case 2: $tnmt_type = "<font color=cyan>일기토</font>"; $tp = "pwr"; $tp2 = "무력"; $tp3 = "power"; break;
case 3: $tnmt_type = "<font color=cyan>설전</font>"; $tp = "itl"; $tp2 = "지력"; $tp3 = "intel"; break; case 3: $tnmt_type = "<font color=cyan>설전</font>"; $tp = "itl"; $tp2 = "지력"; $tp3 = "intel"; break;
} }
$str1 = getTournament($admin[tournament]); $str1 = getTournament($admin['tournament']);
$str2 = getTournamentTime($connect); $str2 = getTournamentTime($connect);
$str3 = getTournamentTerm($connect); $str3 = getTournamentTerm($connect);
@@ -55,7 +55,7 @@ select { font-family:'굴림'; line-height:100%; }
<table align=center width=1120 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:10;word-break:break-all; id=bg0> <table align=center width=1120 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:10;word-break:break-all; id=bg0>
<tr><td colspan=16><input type=button value='갱신' onclick='location.reload()'></td></tr> <tr><td colspan=16><input type=button value='갱신' onclick='location.reload()'></td></tr>
<tr><td colspan=16 align=center><font color=white size=6><?=$tnmt_type;?> (<?=$str1.", ".$str2.", ".$str3;?>)</font></td></tr> <tr><td colspan=16 align=center><font color=white size=6><?=$tnmt_type;?> (<?=$str1.", ".$str2.", ".$str3;?>)</font></td></tr>
<tr><td height=50 colspan=16 align=center id=bg2><font color=limegreen size=6>16강 상황</font><br><font color=orange size=3>(전체 금액 : <?=$admin[bet];?> / 내 투자 금액 : <?=$me[bet];?>)</font></td></tr> <tr><td height=50 colspan=16 align=center id=bg2><font color=limegreen size=6>16강 상황</font><br><font color=orange size=3>(전체 금액 : <?=$admin['bet'];?> / 내 투자 금액 : <?=$me['bet'];?>)</font></td></tr>
</table> </table>
<table align=center width=1120 border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:10;word-break:break-all; id=bg0> <table align=center width=1120 border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:10;word-break:break-all; id=bg0>
<tr align=center><td height=10 colspan=16></td></tr> <tr align=center><td height=10 colspan=16></td></tr>
@@ -65,10 +65,10 @@ $query = "select npc,name,win from tournament where grp>=60 order by grp, grp_no
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
for($i=0; $i < 1; $i++) { for($i=0; $i < 1; $i++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
if($general[name] == "") { $general[name] = "-"; } if($general['name'] == "") { $general['name'] = "-"; }
if($general[npc] >= 2) { $general[name] = "<font color=cyan>".$general[name]."</font>"; } if($general['npc'] >= 2) { $general['name'] = "<font color=cyan>".$general['name']."</font>"; }
elseif($general[npc] == 1) { $general[name] = "<font color=skyblue>".$general[name]."</font>"; } elseif($general['npc'] == 1) { $general['name'] = "<font color=skyblue>".$general['name']."</font>"; }
echo "<td colspan=16>{$general[name]}</td>"; echo "<td colspan=16>{$general['name']}</td>";
} }
echo " echo "
@@ -80,12 +80,12 @@ $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""
for($i=0; $i < 1; $i++) { $cent[$i] = "<font color=white>"; } for($i=0; $i < 1; $i++) { $cent[$i] = "<font color=white>"; }
for($i=0; $i < 2; $i++) { for($i=0; $i < 2; $i++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
if($general[name] == "") { $general[name] = "-"; } if($general['name'] == "") { $general['name'] = "-"; }
if($general[npc] >= 2) { $general[name] = "<font color=cyan>".$general[name]."</font>"; } if($general['npc'] >= 2) { $general['name'] = "<font color=cyan>".$general['name']."</font>"; }
elseif($general[npc] == 1) { $general[name] = "<font color=skyblue>".$general[name]."</font>"; } elseif($general['npc'] == 1) { $general['name'] = "<font color=skyblue>".$general['name']."</font>"; }
if($general[win] > 0) { $line[$i] = "<font color=red>"; $cent[floor($i/2)] = "<font color=red>"; } if($general['win'] > 0) { $line[$i] = "<font color=red>"; $cent[floor($i/2)] = "<font color=red>"; }
else { $line[$i] = "<font color=white>"; } else { $line[$i] = "<font color=white>"; }
$gen[$i] = $general[name]; $gen[$i] = $general['name'];
} }
for($i=0; $i < 1; $i++) { for($i=0; $i < 1; $i++) {
$cent[$i] = $cent[$i]."┻"."</font>"; $cent[$i] = $cent[$i]."┻"."</font>";
@@ -110,12 +110,12 @@ $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""
for($i=0; $i < 2; $i++) { $cent[$i] = "<font color=white>"; } for($i=0; $i < 2; $i++) { $cent[$i] = "<font color=white>"; }
for($i=0; $i < 4; $i++) { for($i=0; $i < 4; $i++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
if($general[name] == "") { $general[name] = "-"; } if($general['name'] == "") { $general['name'] = "-"; }
if($general[npc] >= 2) { $general[name] = "<font color=cyan>".$general[name]."</font>"; } if($general['npc'] >= 2) { $general['name'] = "<font color=cyan>".$general['name']."</font>"; }
elseif($general[npc] == 1) { $general[name] = "<font color=skyblue>".$general[name]."</font>"; } elseif($general['npc'] == 1) { $general['name'] = "<font color=skyblue>".$general['name']."</font>"; }
if($general[win] > 0) { $line[$i] = "<font color=red>"; $cent[floor($i/2)] = "<font color=red>"; } if($general['win'] > 0) { $line[$i] = "<font color=red>"; $cent[floor($i/2)] = "<font color=red>"; }
else { $line[$i] = "<font color=white>"; } else { $line[$i] = "<font color=white>"; }
$gen[$i] = $general[name]; $gen[$i] = $general['name'];
} }
for($i=0; $i < 2; $i++) { for($i=0; $i < 2; $i++) {
$cent[$i] = $cent[$i]."┻"."</font>"; $cent[$i] = $cent[$i]."┻"."</font>";
@@ -140,12 +140,12 @@ $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""
for($i=0; $i < 4; $i++) { $cent[$i] = "<font color=white>"; } for($i=0; $i < 4; $i++) { $cent[$i] = "<font color=white>"; }
for($i=0; $i < 8; $i++) { for($i=0; $i < 8; $i++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
if($general[name] == "") { $general[name] = "-"; } if($general['name'] == "") { $general['name'] = "-"; }
if($general[npc] >= 2) { $general[name] = "<font color=cyan>".$general[name]."</font>"; } if($general['npc'] >= 2) { $general['name'] = "<font color=cyan>".$general['name']."</font>"; }
elseif($general[npc] == 1) { $general[name] = "<font color=skyblue>".$general[name]."</font>"; } elseif($general['npc'] == 1) { $general['name'] = "<font color=skyblue>".$general['name']."</font>"; }
if($general[win] > 0) { $line[$i] = "<font color=red>"; $cent[floor($i/2)] = "<font color=red>"; } if($general['win'] > 0) { $line[$i] = "<font color=red>"; $cent[floor($i/2)] = "<font color=red>"; }
else { $line[$i] = "<font color=white>"; } else { $line[$i] = "<font color=white>"; }
$gen[$i] = $general[name]; $gen[$i] = $general['name'];
} }
for($i=0; $i < 4; $i++) { for($i=0; $i < 4; $i++) {
$cent[$i] = $cent[$i]."┻"."</font>"; $cent[$i] = $cent[$i]."┻"."</font>";
@@ -170,12 +170,12 @@ $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""
for($i=0; $i < 8; $i++) { $cent[$i] = "<font color=white>"; } for($i=0; $i < 8; $i++) { $cent[$i] = "<font color=white>"; }
for($i=0; $i < 16; $i++) { for($i=0; $i < 16; $i++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
if($general[name] == "") { $general[name] = "-"; } if($general['name'] == "") { $general['name'] = "-"; }
if($general[npc] >= 2) { $general[name] = "<font color=cyan>".$general[name]."</font>"; } if($general['npc'] >= 2) { $general['name'] = "<font color=cyan>".$general['name']."</font>"; }
elseif($general[npc] == 1) { $general[name] = "<font color=skyblue>".$general[name]."</font>"; } elseif($general['npc'] == 1) { $general['name'] = "<font color=skyblue>".$general['name']."</font>"; }
if($general[win] > 0) { $line[$i] = "<font color=red>"; $cent[floor($i/2)] = "<font color=red>"; } if($general['win'] > 0) { $line[$i] = "<font color=red>"; $cent[floor($i/2)] = "<font color=red>"; }
else { $line[$i] = "<font color=white>"; } else { $line[$i] = "<font color=white>"; }
$gen[$i] = $general[name]; $gen[$i] = $general['name'];
} }
for($i=0; $i < 8; $i++) { for($i=0; $i < 8; $i++) {
$cent[$i] = $cent[$i]."┻"."</font>"; $cent[$i] = $cent[$i]."┻"."</font>";
@@ -191,7 +191,7 @@ for($i=0; $i < 16; $i++) {
echo "<td width=70>{$gen[$i]}</td>"; echo "<td width=70>{$gen[$i]}</td>";
} }
$query = "select bet0,bet1,bet2,bet3,bet4,bet5,bet6,bet7,bet8,bet9,bet10,bet11,bet12,bet13,bet14,bet15 from general where user_id='$_SESSION[p_id]'"; $query = "select bet0,bet1,bet2,bet3,bet4,bet5,bet6,bet7,bet8,bet9,bet10,bet11,bet12,bet13,bet14,bet15 from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
for($i=0; $i < 16; $i++) { for($i=0; $i < 16; $i++) {
@@ -199,7 +199,7 @@ for($i=0; $i < 16; $i++) {
} }
for($i=0; $i < 16; $i++) { for($i=0; $i < 16; $i++) {
$bet[$i] = @round($admin[bet] / $admin["bet{$i}"], 2); $bet[$i] = @round($admin['bet'] / $admin["bet{$i}"], 2);
if($bet[$i] == 0) { $bet[$i] = "∞"; } if($bet[$i] == 0) { $bet[$i] = "∞"; }
} }
@@ -245,7 +245,7 @@ echo "
</tr> </tr>
<tr align=center><td height=10 colspan=16></td></tr>"; <tr align=center><td height=10 colspan=16></td></tr>";
if($admin[tournament] == 6) { if($admin['tournament'] == 6) {
echo " echo "
<form method=post action=c_betting.php> <form method=post action=c_betting.php>
<tr align=center>"; <tr align=center>";
@@ -311,7 +311,7 @@ for($i=0; $i < 4; $i++) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
for($k=1; $k <= 30; $k++) { for($k=1; $k <= 30; $k++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
printRow($k, $general[npc], $general[name], $general[$type4[$i]], $general[game], $general[win], $general[draw], $general[lose], $general[gl], $general[prize], 0); printRow($k, $general['npc'], $general['name'], $general[$type4[$i]], $general['game'], $general['win'], $general['draw'], $general['lose'], $general['gl'], $general['prize'], 0);
} }
echo " echo "
</table> </table>
+6 -6
View File
@@ -6,16 +6,16 @@ CheckLogin();
$connect = dbConn(); $connect = dbConn();
increaseRefresh($connect, "기밀실", 1); increaseRefresh($connect, "기밀실", 1);
$query = "select skin,no,nation,level from general where user_id='$_SESSION[p_id]'"; $query = "select skin,no,nation,level from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
if($me[level] < 5) { if($me['level'] < 5) {
echo "수뇌부가 아닙니다."; echo "수뇌부가 아닙니다.";
exit(); exit();
} }
if($me[skin] < 1) { if($me['skin'] < 1) {
$tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4; $tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4;
$_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000"; $_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000";
} }
@@ -45,16 +45,16 @@ if($me[skin] < 1) {
</table> </table>
<br> <br>
<?php <?php
$nation = getNation($connect, $me[nation]); $nation = getNation($connect, $me['nation']);
//20개 메세지 //20개 메세지
$index = $nation[coreindex]; $index = $nation['coreindex'];
for($i=0; $i < 20; $i++) { for($i=0; $i < 20; $i++) {
$who = "coreboard{$index}_who"; $who = "coreboard{$index}_who";
$query = "select name,picture,imgsvr from general where no='$nation[$who]'"; $query = "select name,picture,imgsvr from general where no='$nation[$who]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
if($nation["coreboard{$index}"] != '') { msgprint($connect, $nation["coreboard{$index}"], $general[name], $general[picture], $general[imgsvr], $nation["coreboard{$index}_when"], $index, 1); } if($nation["coreboard{$index}"] != '') { msgprint($connect, $nation["coreboard{$index}"], $general['name'], $general['picture'], $general['imgsvr'], $nation["coreboard{$index}_when"], $index, 1); }
$index--; $index--;
if($index < 0) { $index = 19; } if($index < 0) { $index = 19; }
} }
+20 -20
View File
@@ -10,26 +10,26 @@ $query = "select conlimit 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);
$query = "select skin,no,nation,level,userlevel,con,turntime,belong from general where user_id='$_SESSION[p_id]'"; $query = "select skin,no,nation,level,userlevel,con,turntime,belong from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
$query = "select secretlimit from nation where nation='$me[nation]'"; $query = "select secretlimit from nation where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
$con = checkLimit($me[userlevel], $me[con], $admin[conlimit]); $con = checkLimit($me['userlevel'], $me['con'], $admin['conlimit']);
if($con >= 2) { printLimitMsg($me[turntime]); exit(); } if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
if($me[level] == 0 || ($me[level] == 1 && $me[belong] < $nation[secretlimit])) { if($me['level'] == 0 || ($me['level'] == 1 && $me['belong'] < $nation['secretlimit'])) {
echo "수뇌부가 아니거나 사관년도가 부족합니다."; echo "수뇌부가 아니거나 사관년도가 부족합니다.";
exit(); exit();
} }
if($me[level] >= 5) { $btn = "submit"; $btn2 = "button"; } if($me['level'] >= 5) { $btn = "submit"; $btn2 = "button"; }
else { $btn = "hidden"; $btn2 = "hidden"; } else { $btn = "hidden"; $btn2 = "hidden"; }
if($me[skin] < 1) { if($me['skin'] < 1) {
$tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4; $tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4;
$_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000"; $_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000";
} }
@@ -51,15 +51,15 @@ $query = "
l7turn0, l7turn1, l7turn2, l7turn3, l7turn4, l7turn5, l7turn6, l7turn7, l7turn8, l7turn9, l7turn10, l7turn11, l7turn0, l7turn1, l7turn2, l7turn3, l7turn4, l7turn5, l7turn6, l7turn7, l7turn8, l7turn9, l7turn10, l7turn11,
l6turn0, l6turn1, l6turn2, l6turn3, l6turn4, l6turn5, l6turn6, l6turn7, l6turn8, l6turn9, l6turn10, l6turn11, l6turn0, l6turn1, l6turn2, l6turn3, l6turn4, l6turn5, l6turn6, l6turn7, l6turn8, l6turn9, l6turn10, l6turn11,
l5turn0, l5turn1, l5turn2, l5turn3, l5turn4, l5turn5, l5turn6, l5turn7, l5turn8, l5turn9, l5turn10, l5turn11 l5turn0, l5turn1, l5turn2, l5turn3, l5turn4, l5turn5, l5turn6, l5turn7, l5turn8, l5turn9, l5turn10, l5turn11
from nation where nation='$me[nation]'"; from nation where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
$lv = getNationChiefLevel($nation[level]); $lv = getNationChiefLevel($nation['level']);
for($i=12; $i >= $lv; $i--) { for($i=12; $i >= $lv; $i--) {
$turn[$i] = getCoreTurn($connect, $nation, $i); $turn[$i] = getCoreTurn($connect, $nation, $i);
$query = "select name,turntime,npc from general where level={$i} and nation='$me[nation]'"; $query = "select name,turntime,npc from general where level={$i} and nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen[$i] = MYDB_fetch_array($result); $gen[$i] = MYDB_fetch_array($result);
} }
@@ -87,8 +87,8 @@ function turn(type) {
<tr><td colspan=10 align=center bgcolor=skyblue>수뇌부 일정</td></tr> <tr><td colspan=10 align=center bgcolor=skyblue>수뇌부 일정</td></tr>
<tr><td colspan=10 align=center> <tr><td colspan=10 align=center>
<?php <?php
$year = $admin[year]; $year = $admin['year'];
$month = $admin[month]; $month = $admin['month'];
$date = substr(date('Y-m-d H:i:s'), 14); $date = substr(date('Y-m-d H:i:s'), 14);
for($i=12; $i >= $lv; $i--) { for($i=12; $i >= $lv; $i--) {
$totaldate[$i] = $gen[$i][turntime]; $totaldate[$i] = $gen[$i][turntime];
@@ -110,10 +110,10 @@ for($k=0; $k < 2; $k++) {
echo " echo "
<tr> <tr>
<td align=center id=bg1>.</td> <td align=center id=bg1>.</td>
<td colspan=2 align=center id=bg1><b>".getLevel($l4, $nation[level])." : {$gen[$l4][name]}</b></td> <td colspan=2 align=center id=bg1><b>".getLevel($l4, $nation['level'])." : {$gen[$l4][name]}</b></td>
<td colspan=2 align=center id=bg1><b>".getLevel($l3, $nation[level])." : {$gen[$l3][name]}</b></td> <td colspan=2 align=center id=bg1><b>".getLevel($l3, $nation['level'])." : {$gen[$l3][name]}</b></td>
<td colspan=2 align=center id=bg1><b>".getLevel($l2, $nation[level])." : {$gen[$l2][name]}</b></td> <td colspan=2 align=center id=bg1><b>".getLevel($l2, $nation['level'])." : {$gen[$l2][name]}</b></td>
<td colspan=2 align=center id=bg1><b>".getLevel($l1, $nation[level])." : {$gen[$l1][name]}</b></td> <td colspan=2 align=center id=bg1><b>".getLevel($l1, $nation['level'])." : {$gen[$l1][name]}</b></td>
<td align=center id=bg1>.</td> <td align=center id=bg1>.</td>
</tr> </tr>
"; ";
@@ -146,10 +146,10 @@ for($k=0; $k < 2; $k++) {
<td width=28 align=center id=bg0><b>$j</b></td> <td width=28 align=center id=bg0><b>$j</b></td>
</tr> </tr>
"; ";
if($totaldate[$l4] != "") { $totaldate[$l4] = addTurn($totaldate[$l4], $admin[turnterm]); } if($totaldate[$l4] != "") { $totaldate[$l4] = addTurn($totaldate[$l4], $admin['turnterm']); }
if($totaldate[$l3] != "") { $totaldate[$l3] = addTurn($totaldate[$l3], $admin[turnterm]); } if($totaldate[$l3] != "") { $totaldate[$l3] = addTurn($totaldate[$l3], $admin['turnterm']); }
if($totaldate[$l2] != "") { $totaldate[$l2] = addTurn($totaldate[$l2], $admin[turnterm]); } if($totaldate[$l2] != "") { $totaldate[$l2] = addTurn($totaldate[$l2], $admin['turnterm']); }
if($totaldate[$l1] != "") { $totaldate[$l1] = addTurn($totaldate[$l1], $admin[turnterm]); } if($totaldate[$l1] != "") { $totaldate[$l1] = addTurn($totaldate[$l1], $admin['turnterm']); }
} }
if($k == 0) { if($k == 0) {
echo "<form action=processing.php method=post><tr><td colspan=5 align=right>"; echo "<form action=processing.php method=post><tr><td colspan=5 align=right>";
+82 -82
View File
@@ -6,15 +6,15 @@ CheckLogin();
$connect = dbConn(); $connect = dbConn();
increaseRefresh($connect, "현재도시", 1); increaseRefresh($connect, "현재도시", 1);
$query = "select skin,no,nation,userlevel,level,city from general where user_id='$_SESSION[p_id]'"; $query = "select skin,no,nation,userlevel,level,city from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
$query = "select nation,level,spy from nation where nation='$me[nation]'"; $query = "select nation,level,spy from nation where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$myNation = MYDB_fetch_array($result); $myNation = MYDB_fetch_array($result);
if($me[skin] < 1) { if($me['skin'] < 1) {
$tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4; $tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4;
$_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000"; $_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000";
} }
@@ -39,62 +39,62 @@ if($me[skin] < 1) {
<form name=cityselect method=post>도시선택 : <form name=cityselect method=post>도시선택 :
<select name=citylist size=1 style=color:white;background-color:black;width:798;> <select name=citylist size=1 style=color:white;background-color:black;width:798;>
<?php <?php
if($_POST[citylist] == '') { $_POST[citylist] = $me[city]; } if($_POST['citylist'] == '') { $_POST['citylist'] = $me['city']; }
// 재야일때는 현재 도시만 // 재야일때는 현재 도시만
$valid = 0; $valid = 0;
if($me[level] == 0) { if($me['level'] == 0) {
$query = "select city,name,nation from city where city='$me[city]'"; $query = "select city,name,nation from city where city='$me['city']'";
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$city = MYDB_fetch_array($cityresult); $city = MYDB_fetch_array($cityresult);
echo " echo "
<option value=$city[city]"; <option value=$city['city']";
if($city[city] == $_POST[citylist]) { echo " selected"; $valid = 1; } if($city['city'] == $_POST['citylist']) { echo " selected"; $valid = 1; }
echo ">==================================================【"._String::Fill($city[name], 4, '_')."】"; echo ">==================================================【"._String::Fill($city['name'], 4, '_')."】";
if($city[nation] == 0) echo "공백지"; if($city['nation'] == 0) echo "공백지";
elseif($me[nation] == $city[nation]) echo "본국=="; elseif($me['nation'] == $city['nation']) echo "본국==";
else echo "타국=="; else echo "타국==";
echo "============================================</option>"; echo "============================================</option>";
} else { } else {
// 아국 도시들 선택 // 아국 도시들 선택
$query = "select city,name,nation from city where nation='$me[nation]'"; $query = "select city,name,nation from city where nation='$me['nation']'";
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($cityresult); $citycount = MYDB_num_rows($cityresult);
for($i=0; $i < $citycount; $i++) { for($i=0; $i < $citycount; $i++) {
$city = MYDB_fetch_array($cityresult); $city = MYDB_fetch_array($cityresult);
echo " echo "
<option value=$city[city]"; <option value=$city['city']";
if($city[city] == $_POST[citylist]) { echo " selected"; $valid = 1; } if($city['city'] == $_POST['citylist']) { echo " selected"; $valid = 1; }
echo ">==================================================【"._String::Fill($city[name], 4, '_')."】"; echo ">==================================================【"._String::Fill($city['name'], 4, '_')."】";
if($city[nation] == 0) echo "공백지"; if($city['nation'] == 0) echo "공백지";
elseif($me[nation] == $city[nation]) echo "본국=="; elseif($me['nation'] == $city['nation']) echo "본국==";
else echo "타국=="; else echo "타국==";
echo "============================================</option>"; echo "============================================</option>";
} }
// 아국 장수가 있는 타국 도시들 선택 // 아국 장수가 있는 타국 도시들 선택
$query = "select distinct A.city,B.name,B.nation from general A,city B where A.city=B.city and A.nation='$me[nation]' and B.nation!='$me[nation]'"; $query = "select distinct A.city,B.name,B.nation from general A,city B where A.city=B.city and A.nation='$me['nation']' and B.nation!='$me['nation']'";
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($cityresult); $citycount = MYDB_num_rows($cityresult);
for($i=0; $i < $citycount; $i++) { for($i=0; $i < $citycount; $i++) {
$city = MYDB_fetch_array($cityresult); $city = MYDB_fetch_array($cityresult);
echo " echo "
<option value=$city[city]"; <option value=$city['city']";
if($city[city] == $_POST[citylist]) { echo " selected"; $valid = 1; } if($city['city'] == $_POST['citylist']) { echo " selected"; $valid = 1; }
echo ">==================================================【"._String::Fill($city[name], 4, '_')."】"; echo ">==================================================【"._String::Fill($city['name'], 4, '_')."】";
if($city[nation] == 0) echo "공백지"; if($city['nation'] == 0) echo "공백지";
elseif($me[nation] == $city[nation]) echo "본국=="; elseif($me['nation'] == $city['nation']) echo "본국==";
else echo "타국=="; else echo "타국==";
echo "============================================</option>"; echo "============================================</option>";
} }
} }
if($myNation[level] > 0) { if($myNation['level'] > 0) {
// 첩보도시도 목록에 추가 // 첩보도시도 목록에 추가
$where = 'city=0'; $where = 'city=0';
$citys = explode("|", $myNation[spy]); $citys = explode("|", $myNation['spy']);
for($i=0; $i < count($citys); $i++) { for($i=0; $i < count($citys); $i++) {
$city = floor($citys[$i]/10); $city = floor($citys[$i]/10);
$where .= " or city='{$city}'"; $where .= " or city='{$city}'";
@@ -107,11 +107,11 @@ if($myNation[level] > 0) {
for($i=0; $i < $citycount; $i++) { for($i=0; $i < $citycount; $i++) {
$city = MYDB_fetch_array($cityresult); $city = MYDB_fetch_array($cityresult);
echo " echo "
<option value=$city[city]"; <option value=$city['city']";
if($city[city] == $_POST[citylist]) { echo " selected"; $valid = 1; } if($city['city'] == $_POST['citylist']) { echo " selected"; $valid = 1; }
echo ">==================================================【"._String::Fill($city[name], 4, '_')."】"; echo ">==================================================【"._String::Fill($city['name'], 4, '_')."】";
if($city[nation] == 0) echo "공백지"; if($city['nation'] == 0) echo "공백지";
elseif($me[nation] == $city[nation]) echo "본국=="; elseif($me['nation'] == $city['nation']) echo "본국==";
else echo "타국=="; else echo "타국==";
echo "============================================</option>"; echo "============================================</option>";
} }
@@ -129,15 +129,15 @@ echo "
<br>"; <br>";
// 첩보된 도시까지만 허용 // 첩보된 도시까지만 허용
if($valid == 0 && $me[userlevel] < 5) { if($valid == 0 && $me['userlevel'] < 5) {
$_POST[citylist] = $me[city]; $_POST['citylist'] = $me['city'];
} }
$query = "select * from city where city='$_POST[citylist]'"; // 도시 이름 목록 $query = "select * from city where city='$_POST['citylist']'"; // 도시 이름 목록
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$city = MYDB_fetch_array($cityresult); $city = MYDB_fetch_array($cityresult);
$query = "select nation,name,color from nation where nation='$city[nation]'"; $query = "select nation,name,color from nation where nation='$city['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
@@ -153,8 +153,8 @@ $query = "select name from general where no='$city[gen3]'"; // 시중 이름
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen3 = MYDB_fetch_array($genresult); $gen3 = MYDB_fetch_array($genresult);
if($city[trade] == 0) { if($city['trade'] == 0) {
$city[trade] = "- "; $city['trade'] = "- ";
} }
?> ?>
@@ -166,53 +166,53 @@ if($city[trade] == 0) {
echo " echo "
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg2> <table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg2>
<tr> <tr>
<td colspan=12 align=center style=color:".newColor($nation[color])."; bgcolor={$nation[color]}>【 ".getRegion($city[region])." | ".getCityLevel($city[level])." 】 $city[name]</td> <td colspan=12 align=center style=color:".newColor($nation['color'])."; bgcolor={$nation['color']}>【 ".getRegion($city['region'])." | ".getCityLevel($city['level'])." 】 $city['name']</td>
</tr> </tr>
<tr> <tr>
<td align=center width=48 id=bg1>주민</td> <td align=center width=48 id=bg1>주민</td>
<td align=center width=112>$city[pop]/$city[pop2]</td> <td align=center width=112>$city['pop']/$city[pop2]</td>
<td align=center width=48 id=bg1>농업</td> <td align=center width=48 id=bg1>농업</td>
<td align=center width=108>$city[agri]/$city[agri2]</td> <td align=center width=108>$city['agri']/$city[agri2]</td>
<td align=center width=48 id=bg1>상업</td> <td align=center width=48 id=bg1>상업</td>
<td align=center width=108>$city[comm]/$city[comm2]</td> <td align=center width=108>$city['comm']/$city[comm2]</td>
<td align=center width=48 id=bg1>치안</td> <td align=center width=48 id=bg1>치안</td>
<td align=center width=108>$city[secu]/$city[secu2]</td> <td align=center width=108>$city['secu']/$city[secu2]</td>
<td align=center width=48 id=bg1>수비</td> <td align=center width=48 id=bg1>수비</td>
<td align=center width=108>$city[def]/$city[def2]</td> <td align=center width=108>$city['def']/$city[def2]</td>
<td align=center width=48 id=bg1>성벽</td> <td align=center width=48 id=bg1>성벽</td>
<td align=center width=108>$city[wall]/$city[wall2]</td> <td align=center width=108>$city['wall']/$city[wall2]</td>
</tr> </tr>
<tr> <tr>
<td align=center id=bg1>민심</td> <td align=center id=bg1>민심</td>
<td align=center>$city[rate]</td> <td align=center>$city['rate']</td>
<td align=center id=bg1>시세</td> <td align=center id=bg1>시세</td>
<td align=center>{$city[trade]}%</td> <td align=center>{$city['trade']}%</td>
<td align=center id=bg1>인구</td> <td align=center id=bg1>인구</td>
<td align=center>".round($city[pop]/$city[pop2]*100, 2)." %</td> <td align=center>".round($city['pop']/$city[pop2]*100, 2)." %</td>
<td align=center id=bg1>태수</td> <td align=center id=bg1>태수</td>
<td align=center>";echo $gen1[name]==''?"-":"$gen1[name]";echo "</td> <td align=center>";echo $gen1['name']==''?"-":"$gen1['name']";echo "</td>
<td align=center id=bg1>군사</td> <td align=center id=bg1>군사</td>
<td align=center>";echo $gen2[name]==''?"-":"$gen2[name]";echo "</td> <td align=center>";echo $gen2['name']==''?"-":"$gen2['name']";echo "</td>
<td align=center id=bg1>시중</td> <td align=center id=bg1>시중</td>
<td align=center>";echo $gen3[name]==''?"-":"$gen3[name]";echo "</td> <td align=center>";echo $gen3['name']==''?"-":"$gen3['name']";echo "</td>
</tr> </tr>
<tr> <tr>
<td align=center id=bg1>장수</td> <td align=center id=bg1>장수</td>
<td colspan=11>"; <td colspan=11>";
$query = "select name from general where city='$city[city]' and nation='$city[nation]'"; // 장수 목록 $query = "select name from general where city='$city['city']' and nation='$city['nation']'"; // 장수 목록
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($genresult); $gencount = MYDB_num_rows($genresult);
if($gencount == 0) echo "-"; if($gencount == 0) echo "-";
for($i=0; $i < $gencount; $i++) { for($i=0; $i < $gencount; $i++) {
$general = MYDB_fetch_array($genresult); $general = MYDB_fetch_array($genresult);
echo "$general[name], "; echo "$general['name'], ";
} }
echo " echo "
</td> </td>
</tr> </tr>
</table>"; </table>";
$query = "select npc,mode,no,picture,imgsvr,name,injury,leader,power,intel,level,nation,crewtype,crew,train,atmos,term,turn0,turn1,turn2,turn3,turn4 from general where city='$city[city]' order by dedication desc"; // 장수 목록 $query = "select npc,mode,no,picture,imgsvr,name,injury,leader,power,intel,level,nation,crewtype,crew,train,atmos,term,turn0,turn1,turn2,turn3,turn4 from general where city='$city['city']' order by dedication desc"; // 장수 목록
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($genresult); $gencount = MYDB_num_rows($genresult);
@@ -222,8 +222,8 @@ $nationcount = MYDB_num_rows($nationresult);
for($i=0; $i < $nationcount; $i++) { for($i=0; $i < $nationcount; $i++) {
$nation = MYDB_fetch_array($nationresult); $nation = MYDB_fetch_array($nationresult);
$nationname[$nation[nation]] = $nation[name]; $nationname[$nation['nation']] = $nation['name'];
$nationlevel[$nation[nation]] = $nation[level]; $nationlevel[$nation['nation']] = $nation['level'];
} }
if($gencount != 0) { if($gencount != 0) {
@@ -249,10 +249,10 @@ if($gencount != 0) {
for($j=0; $j < $gencount; $j++) { for($j=0; $j < $gencount; $j++) {
$general = MYDB_fetch_array($genresult); $general = MYDB_fetch_array($genresult);
if($general[level] == 12) { if($general['level'] == 12) {
$lbonus = $nationlevel[$general[nation]] * 2; $lbonus = $nationlevel[$general['nation']] * 2;
} elseif($general[level] >= 5) { } elseif($general['level'] >= 5) {
$lbonus = $nationlevel[$general[nation]]; $lbonus = $nationlevel[$general['nation']];
} else { } else {
$lbonus = 0; $lbonus = 0;
} }
@@ -262,33 +262,33 @@ for($j=0; $j < $gencount; $j++) {
$lbonus = ""; $lbonus = "";
} }
if($general[injury] > 0) { if($general['injury'] > 0) {
$leader = floor($general[leader] * (100 - $general[injury])/100); $leader = floor($general['leader'] * (100 - $general['injury'])/100);
$power = floor($general[power] * (100 - $general[injury])/100); $power = floor($general['power'] * (100 - $general['injury'])/100);
$intel = floor($general[intel] * (100 - $general[injury])/100); $intel = floor($general['intel'] * (100 - $general['injury'])/100);
$leader = "<font color=red>{$leader}</font>{$lbonus}"; $leader = "<font color=red>{$leader}</font>{$lbonus}";
$power = "<font color=red>{$power}</font>"; $power = "<font color=red>{$power}</font>";
$intel = "<font color=red>{$intel}</font>"; $intel = "<font color=red>{$intel}</font>";
} else { } else {
$leader = "{$general[leader]}{$lbonus}"; $leader = "{$general['leader']}{$lbonus}";
$power = "{$general[power]}"; $power = "{$general['power']}";
$intel = "{$general[intel]}"; $intel = "{$general['intel']}";
} }
if($general[npc] >= 2) { $general[name] = "<font color=cyan>{$general[name]}</font>"; } if($general['npc'] >= 2) { $general['name'] = "<font color=cyan>{$general['name']}</font>"; }
elseif($general[npc] == 1) { $general[name] = "<font color=skyblue>{$general[name]}</font>"; } elseif($general['npc'] == 1) { $general['name'] = "<font color=skyblue>{$general['name']}</font>"; }
$imageTemp = GetImageURL($general[imgsvr]); $imageTemp = GetImageURL($general['imgsvr']);
echo " echo "
<tr> <tr>
<td align=center"; echo $me[skin]==2?" background={$imageTemp}/{$general[picture]}":""; echo " height=64></td> <td align=center"; echo $me['skin']==2?" background={$imageTemp}/{$general['picture']}":""; echo " height=64></td>
<td align=center>$general[name]</td> <td align=center>$general['name']</td>
<td align=center>$leader</td> <td align=center>$leader</td>
<td align=center>$power</td> <td align=center>$power</td>
<td align=center>$intel</td> <td align=center>$intel</td>
<td align=center>".getLevel($general[level])."</td>"; <td align=center>".getLevel($general['level'])."</td>";
//아국장수이거나 보는 사람이 운영자일때 보여줌 //아국장수이거나 보는 사람이 운영자일때 보여줌
if(($general[nation] != 0 && $general[nation] == $myNation[nation]) || $me[userlevel] >= 5) { if(($general['nation'] != 0 && $general['nation'] == $myNation['nation']) || $me['userlevel'] >= 5) {
switch($general[mode]) { switch($general['mode']) {
case 0: $mode = "×"; break; case 0: $mode = "×"; break;
case 1: $mode = "○"; break; case 1: $mode = "○"; break;
case 2: $mode = "◎"; break; case 2: $mode = "◎"; break;
@@ -296,11 +296,11 @@ for($j=0; $j < $gencount; $j++) {
echo " echo "
<td align=center>$mode</td> <td align=center>$mode</td>
<td align=center>".getTypename($general[crewtype])."</td> <td align=center>".getTypename($general['crewtype'])."</td>
<td align=center>$general[crew]</td> <td align=center>$general['crew']</td>
<td align=center>$general[train]</td> <td align=center>$general['train']</td>
<td align=center>$general[atmos]</td>"; <td align=center>$general['atmos']</td>";
if($general[npc] >= 2) { if($general['npc'] >= 2) {
echo " echo "
<td>NPC 장수"; <td>NPC 장수";
} else { } else {
@@ -317,19 +317,19 @@ for($j=0; $j < $gencount; $j++) {
echo " echo "
</font>"; </font>";
} }
} elseif($general[nation] != 0) { } elseif($general['nation'] != 0) {
echo " echo "
<td align=center>?</td> <td align=center>?</td>
<td align=center>?</td> <td align=center>?</td>
<td align=center>$general[crew]</td> <td align=center>$general['crew']</td>
<td align=center>?</td> <td align=center>?</td>
<td align=center>?</td> <td align=center>?</td>
<td>【{$nationname[$general[nation]]}】 장수"; <td>【{$nationname[$general['nation']]}】 장수";
} else { } else {
echo " echo "
<td align=center>?</td> <td align=center>?</td>
<td align=center>?</td> <td align=center>?</td>
<td align=center>$general[crew]</td> <td align=center>$general['crew']</td>
<td align=center>?</td> <td align=center>?</td>
<td align=center>?</td> <td align=center>?</td>
<td>&nbsp; 재 야"; <td>&nbsp; 재 야";
+53 -53
View File
@@ -10,26 +10,26 @@ $query = "select conlimit 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);
$query = "select skin,no,nation,level,userlevel,con,turntime,belong from general where user_id='$_SESSION[p_id]'"; $query = "select skin,no,nation,level,userlevel,con,turntime,belong from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
$query = "select secretlimit from nation where nation='$me[nation]'"; $query = "select secretlimit from nation where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
$con = checkLimit($me[userlevel], $me[con], $admin[conlimit]); $con = checkLimit($me['userlevel'], $me['con'], $admin['conlimit']);
if($con >= 2) { printLimitMsg($me[turntime]); exit(); } if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
if($me[level] == 0 || ($me[level] == 1 && $me[belong] < $nation[secretlimit])) { if($me['level'] == 0 || ($me['level'] == 1 && $me['belong'] < $nation['secretlimit'])) {
echo "수뇌부가 아니거나 사관년도가 부족합니다."; echo "수뇌부가 아니거나 사관년도가 부족합니다.";
exit(); exit();
} }
if($me[level] >= 5) { $btn = "submit"; $read = ""; } if($me['level'] >= 5) { $btn = "submit"; $read = ""; }
else { $btn = "hidden"; $read = "readonly"; } else { $btn = "hidden"; $read = "readonly"; }
if($me[skin] < 1) { if($me['skin'] < 1) {
$tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4; $tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4;
$_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000"; $_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000";
} }
@@ -70,16 +70,16 @@ for($i=0; $i < $nationcount; $i++) {
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
// 아국표시 // 아국표시
if($nation[nation] == $me[nation]) { if($nation['nation'] == $me['nation']) {
//속령수 //속령수
$query = "select city from city where nation='$nation[nation]'"; $query = "select city from city where nation='$nation['nation']'";
$result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($result2); $citycount = MYDB_num_rows($result2);
echo " echo "
<tr> <tr>
<td align=center style=color:".newColor($nation[color]).";background-color:{$nation[color]};>$nation[name]</td> <td align=center style=color:".newColor($nation['color']).";background-color:{$nation['color']};>$nation['name']</td>
<td align=center>$nation[power]</td> <td align=center>$nation['power']</td>
<td align=center>$nation[gennum]</td> <td align=center>$nation['gennum']</td>
<td align=center>$citycount</td> <td align=center>$citycount</td>
<td align=center>-</td> <td align=center>-</td>
<td align=center>-</td> <td align=center>-</td>
@@ -90,18 +90,18 @@ for($i=0; $i < $nationcount; $i++) {
continue; continue;
} }
$query = "select state,term,fixed,reserved,showing from diplomacy where me='$me[nation]' and you='$nation[nation]'"; $query = "select state,term,fixed,reserved,showing from diplomacy where me='$me['nation']' and you='$nation['nation']'";
$result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dip = MYDB_fetch_array($result2); $dip = MYDB_fetch_array($result2);
$query = "select reserved,showing from diplomacy where you='$me[nation]' and me='$nation[nation]'"; $query = "select reserved,showing from diplomacy where you='$me['nation']' and me='$nation['nation']'";
$result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dip2 = MYDB_fetch_array($result2); $dip2 = MYDB_fetch_array($result2);
//속령수 //속령수
$query = "select city from city where nation='$nation[nation]'"; $query = "select city from city where nation='$nation['nation']'";
$result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($result2); $citycount = MYDB_num_rows($result2);
switch($dip[state]) { switch($dip['state']) {
case 0: $state = "<font color=red>교 전</font>"; break; case 0: $state = "<font color=red>교 전</font>"; break;
case 1: $state = "<font color=magenta>선포중</font>"; break; case 1: $state = "<font color=magenta>선포중</font>"; break;
case 2: $state = "통 상"; break; case 2: $state = "통 상"; break;
@@ -112,7 +112,7 @@ for($i=0; $i < $nationcount; $i++) {
case 7: $state = "<font color=green>불가침</font>"; break; case 7: $state = "<font color=green>불가침</font>"; break;
} }
$term = $admin[year] * 12 + $admin[month] + $dip[term]; $term = $admin['year'] * 12 + $admin['month'] + $dip['term'];
$year = floor($term / 12); $year = floor($term / 12);
$month = $term % 12; $month = $term % 12;
@@ -123,41 +123,41 @@ for($i=0; $i < $nationcount; $i++) {
$date = date('Y-m-d H:i:s'); $date = date('Y-m-d H:i:s');
$note = ""; $note = "";
if($dip[fixed] != "") { if($dip['fixed'] != "") {
if($dip[state] == 7) { if($dip['state'] == 7) {
$note .= $dip[fixed]; $note .= $dip['fixed'];
} else { } else {
$note .= "<font color=gray>{$dip[fixed]}</font>"; $note .= "<font color=gray>{$dip['fixed']}</font>";
} }
if($dip[reserved] != "" || $dip2[reserved] != "") { if($dip['reserved'] != "" || $dip2['reserved'] != "") {
$note .= "<br>"; $note .= "<br>";
} }
} }
if($dip[showing] >= $date) { if($dip['showing'] >= $date) {
if($dip[reserved] != "") { if($dip['reserved'] != "") {
$note .= "<font color=skyblue>아국측 제의</font>: ".$dip[reserved]; $note .= "<font color=skyblue>아국측 제의</font>: ".$dip['reserved'];
if($dip2[reserved] != "") { if($dip2['reserved'] != "") {
$note .= "<br>"; $note .= "<br>";
} }
} }
} }
if($dip2[showing] >= $date) { if($dip2['showing'] >= $date) {
if($dip2[reserved] != "") { if($dip2['reserved'] != "") {
$note .= "<font color=limegreen>상대측 제의</font>: ".$dip2[reserved]; $note .= "<font color=limegreen>상대측 제의</font>: ".$dip2['reserved'];
} }
} }
if($note == "") { $note = "&nbsp;"; } if($note == "") { $note = "&nbsp;"; }
echo " echo "
<tr> <tr>
<td align=center style=color:".newColor($nation[color]).";background-color:{$nation[color]};>$nation[name]</td> <td align=center style=color:".newColor($nation['color']).";background-color:{$nation['color']};>$nation['name']</td>
<td align=center>$nation[power]</td> <td align=center>$nation['power']</td>
<td align=center>$nation[gennum]</td> <td align=center>$nation['gennum']</td>
<td align=center>$citycount</td> <td align=center>$citycount</td>
<td align=center>$state</td>"; <td align=center>$state</td>";
if($dip[term] != 0) { if($dip['term'] != 0) {
echo" echo"
<td align=center>$dip[term] 개월</td> <td align=center>$dip['term'] 개월</td>
<td align=center>{$year}年 {$month}月</td>"; <td align=center>{$year}年 {$month}月</td>";
} else { } else {
echo" echo"
@@ -172,7 +172,7 @@ echo "
</table> </table>
"; ";
$query = "select nation,name,color,type,msg,gold,rice,bill,rate,scout,war,myset,scoutmsg,secretlimit from nation where nation='$me[nation]'"; $query = "select nation,name,color,type,msg,gold,rice,bill,rate,scout,war,myset,scoutmsg,secretlimit from nation where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
@@ -180,18 +180,18 @@ $query = "select gold_rate,rice_rate 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);
// 금 수지 // 금 수지
$deadIncome = getDeadIncome($connect, $nation[nation], $nation[type], $admin[gold_rate]); $deadIncome = getDeadIncome($connect, $nation['nation'], $nation['type'], $admin['gold_rate']);
$goldincomeList = getGoldIncome($connect, $nation[nation], $nation[rate], $admin[gold_rate], $nation[type]); $goldincomeList = getGoldIncome($connect, $nation['nation'], $nation['rate'], $admin['gold_rate'], $nation['type']);
$goldincome = $goldincomeList[0] + $goldincomeList[1] + $deadIncome; $goldincome = $goldincomeList[0] + $goldincomeList[1] + $deadIncome;
$goldoutcome = getGoldOutcome($connect, $nation[nation], $nation[bill]); $goldoutcome = getGoldOutcome($connect, $nation['nation'], $nation['bill']);
$riceincomeList = getRiceIncome($connect, $nation[nation], $nation[rate], $admin[rice_rate], $nation[type]); $riceincomeList = getRiceIncome($connect, $nation['nation'], $nation['rate'], $admin['rice_rate'], $nation['type']);
$riceincome = $riceincomeList[0] + $riceincomeList[1]; $riceincome = $riceincomeList[0] + $riceincomeList[1];
$riceoutcome = getRiceOutcome($connect, $nation[nation], $nation[bill]); $riceoutcome = getRiceOutcome($connect, $nation['nation'], $nation['bill']);
$budgetgold = $nation[gold] + $goldincome - $goldoutcome + $deadIncome; $budgetgold = $nation['gold'] + $goldincome - $goldoutcome + $deadIncome;
$budgetrice = $nation[rice] + $riceincome - $riceoutcome; $budgetrice = $nation['rice'] + $riceincome - $riceoutcome;
$budgetgolddiff = $goldincome - $goldoutcome + $deadIncome; $budgetgolddiff = $goldincome - $goldoutcome + $deadIncome;
$budgetricediff = $riceincome - $riceoutcome; $budgetricediff = $riceincome - $riceoutcome;
if($budgetgolddiff > 0) { $budgetgolddiff = "+{$budgetgolddiff}"; } if($budgetgolddiff > 0) { $budgetgolddiff = "+{$budgetgolddiff}"; }
@@ -204,8 +204,8 @@ else { $budgetricediff = "$budgetricediff"; }
<form name=form1 method=post action=c_dipcenter.php> <form name=form1 method=post action=c_dipcenter.php>
<tr><td colspan=2 height=10></td></tr> <tr><td colspan=2 height=10></td></tr>
<tr><td colspan=2 align=center bgcolor=orange>국 가 방 침 & 임관 권유 메세지</td></tr> <tr><td colspan=2 align=center bgcolor=orange>국 가 방 침 & 임관 권유 메세지</td></tr>
<tr><td colspan=2 id=bg1>국가 방침 <input type=text <?=$read;?> maxlength=500 style=color:white;background-color:black;width:830; name=msg value='<?=$nation[msg];?>'><input type=<?=$btn;?> name=btn value=국가방침></td></tr> <tr><td colspan=2 id=bg1>국가 방침 <input type=text <?=$read;?> maxlength=500 style=color:white;background-color:black;width:830; name=msg value='<?=$nation['msg'];?>'><input type=<?=$btn;?> name=btn value=국가방침></td></tr>
<tr><td colspan=2 id=bg1>임관 권유 <input type=text <?=$read;?> maxlength=500 style=color:white;background-color:black;width:830; name=scoutmsg value='<?=$nation[scoutmsg];?>'><input type=<?=$btn;?> name=btn value=임관권유></td></tr> <tr><td colspan=2 id=bg1>임관 권유 <input type=text <?=$read;?> maxlength=500 style=color:white;background-color:black;width:830; name=scoutmsg value='<?=$nation['scoutmsg'];?>'><input type=<?=$btn;?> name=btn value=임관권유></td></tr>
<tr><td colspan=2>900 x 200px 넘는 크기를 점유할 시 통보없이 제한될 수 있습니다.</td></tr> <tr><td colspan=2>900 x 200px 넘는 크기를 점유할 시 통보없이 제한될 수 있습니다.</td></tr>
<tr><td colspan=2 height=10></td></tr> <tr><td colspan=2 height=10></td></tr>
<tr><td colspan=2 align=center bgcolor=green>예 산 & 정 책</td></tr> <tr><td colspan=2 align=center bgcolor=green>예 산 & 정 책</td></tr>
@@ -220,9 +220,9 @@ echo "
</tr> </tr>
<tr> <tr>
<td width=248 align=right id=bg1>현 재&nbsp;&nbsp;&nbsp;</td> <td width=248 align=right id=bg1>현 재&nbsp;&nbsp;&nbsp;</td>
<td width=248 align=center>$nation[gold]</td> <td width=248 align=center>$nation['gold']</td>
<td width=248 align=right id=bg1>현 재&nbsp;&nbsp;&nbsp;</td> <td width=248 align=right id=bg1>현 재&nbsp;&nbsp;&nbsp;</td>
<td width=248 align=center>$nation[rice]</td> <td width=248 align=center>$nation['rice']</td>
</tr> </tr>
<tr> <tr>
<td align=right id=bg1>단기수입&nbsp;&nbsp;&nbsp;</td> <td align=right id=bg1>단기수입&nbsp;&nbsp;&nbsp;</td>
@@ -251,21 +251,21 @@ echo "
?> ?>
<tr> <tr>
<td align=right id=bg1>세율 (5 ~ 30%)&nbsp;&nbsp;&nbsp;</td> <td align=right id=bg1>세율 (5 ~ 30%)&nbsp;&nbsp;&nbsp;</td>
<td align=center><input type=text <?=$read;?> name=rate style=text-align:right;color:white;background-color:black; size=3 maxlength=3 value=<?=$nation[rate]?>>% <input type=<?=$btn;?> name=btn value=세율></td> <td align=center><input type=text <?=$read;?> name=rate style=text-align:right;color:white;background-color:black; size=3 maxlength=3 value=<?=$nation['rate']?>>% <input type=<?=$btn;?> name=btn value=세율></td>
<td align=right id=bg1>봉급 지급율 (20 ~ 200%)&nbsp;&nbsp;&nbsp;</td> <td align=right id=bg1>봉급 지급율 (20 ~ 200%)&nbsp;&nbsp;&nbsp;</td>
<td align=center><input type=text <?=$read;?> name=bill style=text-align:right;color:white;background-color:black; size=3 maxlength=3 value=<?=$nation[bill]?>>% <input type=<?=$btn;?> name=btn value=지급율></td> <td align=center><input type=text <?=$read;?> name=bill style=text-align:right;color:white;background-color:black; size=3 maxlength=3 value=<?=$nation['bill']?>>% <input type=<?=$btn;?> name=btn value=지급율></td>
</tr> </tr>
<tr> <tr>
<td align=right id=bg1>기밀 권한 (1 ~ 99년)&nbsp;&nbsp;&nbsp;</td> <td align=right id=bg1>기밀 권한 (1 ~ 99년)&nbsp;&nbsp;&nbsp;</td>
<td align=center><input type=text <?=$read;?> name=secretlimit style=text-align:right;color:white;background-color:black; size=3 maxlength=3 value=<?=$nation[secretlimit]?>>년 <input type=<?=$btn;?> name=btn value=기밀권한></td> <td align=center><input type=text <?=$read;?> name=secretlimit style=text-align:right;color:white;background-color:black; size=3 maxlength=3 value=<?=$nation['secretlimit']?>>년 <input type=<?=$btn;?> name=btn value=기밀권한></td>
<td align=right id=bg1>임관&전쟁 변경 가능</td> <td align=right id=bg1>임관&전쟁 변경 가능</td>
<td align=center><?=$nation[myset];?> 회</td> <td align=center><?=$nation['myset'];?> 회</td>
</tr> </tr>
<tr> <tr>
<td colspan=4 align=center> <td colspan=4 align=center>
<?php <?php
if($nation[myset] > 0) { if($nation['myset'] > 0) {
if($nation[scout] == 0) { if($nation['scout'] == 0) {
echo " echo "
<input type=$btn name=btn value='임관 금지'>"; <input type=$btn name=btn value='임관 금지'>";
} else { } else {
@@ -273,7 +273,7 @@ if($nation[myset] > 0) {
<input type=$btn name=btn value='임관 허가'>"; <input type=$btn name=btn value='임관 허가'>";
} }
if($nation[war] == 0) { if($nation['war'] == 0) {
echo " echo "
<input type=$btn name=btn value='전쟁 금지'>"; <input type=$btn name=btn value='전쟁 금지'>";
} else { } else {
+17 -17
View File
@@ -10,7 +10,7 @@ $query = "select turnterm 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);
$query = "select no,nation,skin,map,userlevel from general where user_id='$_SESSION[p_id]'"; $query = "select no,nation,skin,map,userlevel from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
@@ -22,21 +22,21 @@ $nationStr = "";
for($i=0; $i < $nationcount; $i++) { for($i=0; $i < $nationcount; $i++) {
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
$query = "select city from city where nation='$nation[nation]'"; $query = "select city from city where nation='$nation['nation']'";
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($cityresult); $citycount = MYDB_num_rows($cityresult);
$nationnum[count($nationnum)] = $nation[nation]; $nationnum[count($nationnum)] = $nation['nation'];
$nationname[$nation[nation]] = $nation[name]; $nationname[$nation['nation']] = $nation['name'];
$nationcolor[$nation[nation]] = $nation[color]; $nationcolor[$nation['nation']] = $nation['color'];
$nationStr .= "<font color=cyan>◆</font> <font style=color:".newColor($nation[color]).";background-color:$nation[color];>$nation[name]</font><br>"; $nationStr .= "<font color=cyan>◆</font> <font style=color:".newColor($nation['color']).";background-color:$nation['color'];>$nation['name']</font><br>";
$powerStr .= "국력 $nation[power]<br>"; $powerStr .= "국력 $nation['power']<br>";
$genStr .= "장수 $nation[gennum]<br>"; $genStr .= "장수 $nation['gennum']<br>";
$cityStr .= "속령 $citycount<br>"; $cityStr .= "속령 $citycount<br>";
} }
if($me[skin] < 1) { if($me['skin'] < 1) {
$tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4; $tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4;
$_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000"; $_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000";
} }
@@ -79,7 +79,7 @@ for($i=0; $i < $nationcount; $i++) {
$nationcount2 = MYDB_num_rows($dipresult); $nationcount2 = MYDB_num_rows($dipresult);
for($k=0; $k < $nationcount2; $k++) { for($k=0; $k < $nationcount2; $k++) {
$dip = MYDB_fetch_array($dipresult); $dip = MYDB_fetch_array($dipresult);
$state[$dip[you]] = $dip[state]; $state[$dip['you']] = $dip['state'];
} }
echo " echo "
<tr> <tr>
@@ -93,7 +93,7 @@ for($i=0; $i < $nationcount; $i++) {
case 0: $str = "<font color=red>★</font>"; break; case 0: $str = "<font color=red>★</font>"; break;
case 1: $str = "<font color=magenta>▲</font>"; break; case 1: $str = "<font color=magenta>▲</font>"; break;
case 2: case 2:
if($nationnum[$i] == $me[nation] || $nationnum[$k] == $me[nation] || $me[userlevel] >= 4) { $str = "ㆍ"; } if($nationnum[$i] == $me['nation'] || $nationnum[$k] == $me['nation'] || $me['userlevel'] >= 4) { $str = "ㆍ"; }
else { $str = "?"; } else { $str = "?"; }
// $str = "ㆍ"; // $str = "ㆍ";
break; break;
@@ -102,14 +102,14 @@ for($i=0; $i < $nationcount; $i++) {
case 5: $str = "<font color=cyan>◎</font>"; break; case 5: $str = "<font color=cyan>◎</font>"; break;
case 6: $str = "<font color=cyan>◎</font>"; break; case 6: $str = "<font color=cyan>◎</font>"; break;
case 7: case 7:
if($nationnum[$i] == $me[nation] || $nationnum[$k] == $me[nation] || $me[userlevel] >= 4) { $str = "<font color=green>@</font>"; } if($nationnum[$i] == $me['nation'] || $nationnum[$k] == $me['nation'] || $me['userlevel'] >= 4) { $str = "<font color=green>@</font>"; }
else { $str = "?"; } else { $str = "?"; }
// $str = "<font color=limegreen>@</font>"; // $str = "<font color=limegreen>@</font>";
break; break;
} }
} }
if($nationnum[$i] == $me[nation] || $nationnum[$k] == $me[nation]) { $backcolor = "style=background-color:$_basecolor3;"; } if($nationnum[$i] == $me['nation'] || $nationnum[$k] == $me['nation']) { $backcolor = "style=background-color:$_basecolor3;"; }
else { $backcolor = ""; } else { $backcolor = ""; }
echo " echo "
@@ -137,8 +137,8 @@ if($citycount != 0) {
for($i=0; $i < $citycount; $i++) { for($i=0; $i < $citycount; $i++) {
$city = MYDB_fetch_array($result); $city = MYDB_fetch_array($result);
if($city[conflict] != "") { if($city['conflict'] != "") {
$nation = explode("|", $city[conflict]); $nation = explode("|", $city['conflict']);
$killnum = explode("|", $city[conflict2]); $killnum = explode("|", $city[conflict2]);
$seq = mySort($killnum); // 큰 순서대로 순서를 구한다. $seq = mySort($killnum); // 큰 순서대로 순서를 구한다.
@@ -149,7 +149,7 @@ for($i=0; $i < $citycount; $i++) {
} }
echo " echo "
<tr> <tr>
<td align=center width=48>$city[name]</td> <td align=center width=48>$city['name']</td>
<td width=948>"; <td width=948>";
for($k=0; $k < count($nation); $k++) { for($k=0; $k < count($nation); $k++) {
$per = 100*$killnum[$seq[$k]] / $sum; $per = 100*$killnum[$seq[$k]] / $sum;
@@ -201,7 +201,7 @@ echo "
</tr> </tr>
<tr> <tr>
<td width=698 height=420> <td width=698 height=420>
<iframe src='map.php?type=2&graphic={$me[map]}' width=698 height=520 frameborder=0 marginwidth=0 marginheight=0 topmargin=0 scrolling=no> <iframe src='map.php?type=2&graphic={$me['map']}' width=698 height=520 frameborder=0 marginwidth=0 marginheight=0 topmargin=0 scrolling=no>
</iframe> </iframe>
</td> </td>
<td width=98 valign=top>$nationStr</td> <td width=98 valign=top>$nationStr</td>
+43 -43
View File
@@ -10,18 +10,18 @@ $query = "select conlimit 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);
$query = "select skin,no,nation,level,userlevel,con,turntime,belong from general where user_id='$_SESSION[p_id]'"; $query = "select skin,no,nation,level,userlevel,con,turntime,belong from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
$query = "select level,secretlimit from nation where nation='$me[nation]'"; $query = "select level,secretlimit from nation where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
$con = checkLimit($me[userlevel], $me[con], $admin[conlimit]); $con = checkLimit($me['userlevel'], $me['con'], $admin['conlimit']);
if($con >= 2) { printLimitMsg($me[turntime]); exit(); } if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
if($me[level] == 0 || ($me[level] == 1 && $me[belong] < $nation[secretlimit])) { if($me['level'] == 0 || ($me['level'] == 1 && $me['belong'] < $nation['secretlimit'])) {
echo "수뇌부가 아니거나 사관년도가 부족합니다."; echo "수뇌부가 아니거나 사관년도가 부족합니다.";
exit(); exit();
} }
@@ -31,7 +31,7 @@ if($type == 0) {
} }
$sel[$type] = "selected"; $sel[$type] = "selected";
if($me[skin] < 1) { if($me['skin'] < 1) {
$tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4; $tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4;
$_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000"; $_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000";
} }
@@ -63,26 +63,26 @@ if($me[skin] < 1) {
</td></tr> </td></tr>
</table> </table>
<?php <?php
$query = "select troop,name from troop where nation='$me[nation]'"; $query = "select troop,name from troop where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$troopCount = MYDB_num_rows($result); $troopCount = MYDB_num_rows($result);
for($i=0; $i < $troopCount; $i++) { for($i=0; $i < $troopCount; $i++) {
$troop = MYDB_fetch_array($result); $troop = MYDB_fetch_array($result);
$troopName[$troop[troop]] = $troop[name]; $troopName[$troop['troop']] = $troop['name'];
} }
$cityname = CityNameArray(); $cityname = CityNameArray();
switch($type) { switch($type) {
case 1: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me[nation]' order by gold desc"; break; case 1: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me['nation']' order by gold desc"; break;
case 2: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me[nation]' order by rice desc"; break; case 2: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me['nation']' order by rice desc"; break;
case 3: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me[nation]' order by city"; break; case 3: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me['nation']' order by city"; break;
case 4: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me[nation]' order by crewtype desc"; break; case 4: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me['nation']' order by crewtype desc"; break;
case 5: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me[nation]' order by crew desc"; break; case 5: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me['nation']' order by crew desc"; break;
case 6: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me[nation]' order by killturn"; break; case 6: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me['nation']' order by killturn"; break;
case 7: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me[nation]' order by turntime"; break; case 7: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me['nation']' order by turntime"; break;
case 8: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me[nation]' order by troop desc"; break; case 8: $query = "select npc,mode,no,level,troop,city,injury,leader,power,intel,experience,name,gold,rice,crewtype,crew,train,atmos,killturn,turntime,term,turn0,turn1,turn2,turn3,turn4 from general where nation='$me['nation']' order by troop desc"; break;
} }
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($genresult); $gencount = MYDB_num_rows($genresult);
@@ -107,13 +107,13 @@ echo"
</tr>"; </tr>";
for($j=0; $j < $gencount; $j++) { for($j=0; $j < $gencount; $j++) {
$general = MYDB_fetch_array($genresult); $general = MYDB_fetch_array($genresult);
$city = $cityname[$general[city]]; $city = $cityname[$general['city']];
$troop = $troopName[$general[troop]] == "" ? "-" : $troopName[$general[troop]]; $troop = $troopName[$general['troop']] == "" ? "-" : $troopName[$general['troop']];
if($general[level] == 12) { if($general['level'] == 12) {
$lbonus = $nation[level] * 2; $lbonus = $nation['level'] * 2;
} elseif($general[level] >= 5) { } elseif($general['level'] >= 5) {
$lbonus = $nation[level]; $lbonus = $nation['level'];
} else { } else {
$lbonus = 0; $lbonus = 0;
} }
@@ -123,24 +123,24 @@ for($j=0; $j < $gencount; $j++) {
$lbonus = ""; $lbonus = "";
} }
if($general[injury] > 0) { if($general['injury'] > 0) {
$leader = floor($general[leader] * (100 - $general[injury])/100); $leader = floor($general['leader'] * (100 - $general['injury'])/100);
$power = floor($general[power] * (100 - $general[injury])/100); $power = floor($general['power'] * (100 - $general['injury'])/100);
$intel = floor($general[intel] * (100 - $general[injury])/100); $intel = floor($general['intel'] * (100 - $general['injury'])/100);
$leader = "<font color=red>{$leader}</font>{$lbonus}"; $leader = "<font color=red>{$leader}</font>{$lbonus}";
$power = "<font color=red>{$power}</font>"; $power = "<font color=red>{$power}</font>";
$intel = "<font color=red>{$intel}</font>"; $intel = "<font color=red>{$intel}</font>";
} else { } else {
$leader = "{$general[leader]}{$lbonus}"; $leader = "{$general['leader']}{$lbonus}";
$power = "{$general[power]}"; $power = "{$general['power']}";
$intel = "{$general[intel]}"; $intel = "{$general['intel']}";
} }
if($general[npc] >= 2) { $name = "<font color=cyan>$general[name]</font>"; } if($general['npc'] >= 2) { $name = "<font color=cyan>$general['name']</font>"; }
elseif($general[npc] == 1) { $name = "<font color=skyblue>$general[name]</font>"; } elseif($general['npc'] == 1) { $name = "<font color=skyblue>$general['name']</font>"; }
else { $name = "$general[name]"; } else { $name = "$general['name']"; }
switch($general[mode]) { switch($general['mode']) {
case 0: $mode = "×"; break; case 0: $mode = "×"; break;
case 1: $mode = "○"; break; case 1: $mode = "○"; break;
case 2: $mode = "◎"; break; case 2: $mode = "◎"; break;
@@ -148,18 +148,18 @@ for($j=0; $j < $gencount; $j++) {
echo " echo "
<tr> <tr>
<td align=center>$name<br>Lv ".getExpLevel($general[experience])."</td> <td align=center>$name<br>Lv ".getExpLevel($general['experience'])."</td>
<td align=center>{$leader}∥{$power}∥{$intel}</td> <td align=center>{$leader}∥{$power}∥{$intel}</td>
<td align=center>$troop</td> <td align=center>$troop</td>
<td align=center>$general[gold]</td> <td align=center>$general['gold']</td>
<td align=center>$general[rice]</td> <td align=center>$general['rice']</td>
<td align=center>$city</td> <td align=center>$city</td>
<td align=center>$mode</td> <td align=center>$mode</td>
<td align=center>".getTypename($general[crewtype])."</td> <td align=center>".getTypename($general['crewtype'])."</td>
<td align=center>$general[crew]</td> <td align=center>$general['crew']</td>
<td align=center>$general[train]</td> <td align=center>$general['train']</td>
<td align=center>$general[atmos]</td>"; <td align=center>$general['atmos']</td>";
if($general[npc] >= 2) { if($general['npc'] >= 2) {
echo " echo "
<td> <td>
<font size=3>NPC 장수"; <font size=3>NPC 장수";
@@ -179,8 +179,8 @@ for($j=0; $j < $gencount; $j++) {
echo " echo "
</font> </font>
</td> </td>
<td align=center>$general[killturn]</td> <td align=center>$general['killturn']</td>
<td align=center>".substr($general[turntime],14,5)."</td> <td align=center>".substr($general['turntime'],14,5)."</td>
</tr>"; </tr>";
} }
echo " echo "
+94 -94
View File
@@ -8,17 +8,17 @@ increaseRefresh($connect, "인사부", 1);
//훼섭 추방을 위해 갱신 //훼섭 추방을 위해 갱신
checkTurn($connect); checkTurn($connect);
$query = "select skin,no,nation,level from general where user_id='$_SESSION[p_id]'"; $query = "select skin,no,nation,level from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
$meLevel = $me[level]; $meLevel = $me['level'];
if($meLevel == 0) { if($meLevel == 0) {
echo "재야입니다."; echo "재야입니다.";
exit(); exit();
} }
if($me[skin] < 1) { if($me['skin'] < 1) {
$tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4; $tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4;
$_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000"; $_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000";
} }
@@ -46,32 +46,32 @@ function out() {
<?php <?php
$cityNames = CityNameArray(); $cityNames = CityNameArray();
$query = "select nation,name,level,color,l12set,l11set,l10set,l9set,l8set,l7set,l6set,l5set from nation where nation='$me[nation]'"; $query = "select nation,name,level,color,l12set,l11set,l10set,l9set,l8set,l7set,l6set,l5set from nation where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result); //국가정보 $nation = MYDB_fetch_array($result); //국가정보
$lv = getNationChiefLevel($nation[level]); $lv = getNationChiefLevel($nation['level']);
if($meLevel >= 5) { $btn = "submit"; } if($meLevel >= 5) { $btn = "submit"; }
else { $btn = "hidden"; } else { $btn = "hidden"; }
$query = "select name,level,picture,imgsvr,belong from general where nation='$nation[nation]' and level>={$lv} order by level desc"; $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),""); $genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
for($i=12; $i >= $lv; $i--) { for($i=12; $i >= $lv; $i--) {
$levels = MYDB_fetch_array($genresult); $levels = MYDB_fetch_array($genresult);
$level[$levels[level]] = $levels; $level[$levels['level']] = $levels;
} }
$query = "select name,picture,killnum from general where nation='$nation[nation]' order by killnum desc limit 5"; // 오호장군 $query = "select name,picture,killnum from general where nation='$nation['nation']' order by killnum desc limit 5"; // 오호장군
$tigerresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $tigerresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "select name,picture,firenum from general where nation='$nation[nation]' order by firenum desc limit 7"; // 건안칠자 $query = "select name,picture,firenum from general where nation='$nation['nation']' order by firenum desc limit 7"; // 건안칠자
$eagleresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $eagleresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
echo " echo "
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0> <table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<tr> <tr>
<td align=center style=color:".newColor($nation[color])."; bgcolor={$nation[color]} colspan=6> <td align=center style=color:".newColor($nation['color'])."; bgcolor={$nation['color']} colspan=6>
<font size=5>【 $nation[name] 】</font> <font size=5>【 $nation['name'] 】</font>
</td> </td>
</tr> </tr>
"; ";
@@ -81,10 +81,10 @@ for($i=12; $i >= $lv; $i-=2) {
$imageTemp2 = GetImageURL($level[$i2][imgsvr]); $imageTemp2 = GetImageURL($level[$i2][imgsvr]);
echo " echo "
<tr> <tr>
<td width=98 align=center id=bg1><font size=4>".getLevel($i1, $nation[level])."</font></td> <td width=98 align=center id=bg1><font size=4>".getLevel($i1, $nation['level'])."</font></td>
<td width=64 height=64 background={$imageTemp1}/{$level[$i1][picture]}>&nbsp;</td> <td width=64 height=64 background={$imageTemp1}/{$level[$i1][picture]}>&nbsp;</td>
<td width=332><font size=4>";echo $level[$i1][name]==''?"-":$level[$i1][name]; echo " ({$level[$i1][belong]}년)</font></td> <td width=332><font size=4>";echo $level[$i1][name]==''?"-":$level[$i1][name]; echo " ({$level[$i1][belong]}년)</font></td>
<td width=98 align=center id=bg1><font size=4>".getLevel($i2, $nation[level])."</font></td> <td width=98 align=center id=bg1><font size=4>".getLevel($i2, $nation['level'])."</font></td>
<td width=64 height=64 background={$imageTemp2}/{$level[$i2][picture]}>&nbsp;</td> <td width=64 height=64 background={$imageTemp2}/{$level[$i2][picture]}>&nbsp;</td>
<td width=332><font size=4>";echo $level[$i2][name]==''?"-":$level[$i2][name]; echo " ({$level[$i2][belong]}년)</font></td> <td width=332><font size=4>";echo $level[$i2][name]==''?"-":$level[$i2][name]; echo " ({$level[$i2][belong]}년)</font></td>
</tr> </tr>
@@ -101,8 +101,8 @@ $tigernum = MYDB_num_rows($tigerresult);
for($i=0; $i < $tigernum; $i++) { for($i=0; $i < $tigernum; $i++) {
$tiger = MYDB_fetch_array($tigerresult); $tiger = MYDB_fetch_array($tigerresult);
if($tiger[killnum] > 0) { if($tiger['killnum'] > 0) {
echo "{$tiger[name]}【{$tiger[killnum]}】, "; echo "{$tiger['name']}【{$tiger['killnum']}】, ";
} }
} }
@@ -118,8 +118,8 @@ $eaglenum = MYDB_num_rows($eagleresult);
for($i=0; $i < $eaglenum; $i++) { for($i=0; $i < $eaglenum; $i++) {
$eagle = MYDB_fetch_array($eagleresult); $eagle = MYDB_fetch_array($eagleresult);
if($eagle[firenum] > 0) { if($eagle['firenum'] > 0) {
echo "{$eagle[name]}【{$eagle[firenum]}】, "; echo "{$eagle['name']}【{$eagle['firenum']}】, ";
} }
} }
@@ -140,14 +140,14 @@ if($meLevel >= 5 && $nation["l{$meLevel}set"] == 0) {
echo " echo "
<select name=outlist size=1 style=color:white;background-color:black;>"; <select name=outlist size=1 style=color:white;background-color:black;>";
$query = "select no,name,level from general where nation='$me[nation]' and level!='12' and no!='$me[no]' order by npc,binary(name)"; $query = "select no,name,level from general where nation='$me['nation']' and level!='12' and no!='$me['no']' order by npc,binary(name)";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result); $gencount = MYDB_num_rows($result);
for($i=0; $i < $gencount; $i++) { for($i=0; $i < $gencount; $i++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
echo " echo "
<option value={$general[no]}>{$general[name]}</option>"; <option value={$general['no']}>{$general['name']}</option>";
} }
echo " echo "
@@ -155,7 +155,7 @@ if($meLevel >= 5 && $nation["l{$meLevel}set"] == 0) {
<input type=$btn name=btn value=추방 onclick='return out()'>"; <input type=$btn name=btn value=추방 onclick='return out()'>";
} }
$query = "select name,city from general where nation='$me[nation]' and level=12"; $query = "select name,city from general where nation='$me['nation']' and level=12";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
echo " echo "
@@ -167,29 +167,29 @@ echo "
<tr><td colspan=4 height=5></td></tr> <tr><td colspan=4 height=5></td></tr>
<tr><td colspan=4 align=center bgcolor=blue>수 뇌 부 임 명</td></tr> <tr><td colspan=4 align=center bgcolor=blue>수 뇌 부 임 명</td></tr>
<tr> <tr>
<td width=98 align=right id=bg1>".getLevel(12, $nation[level])."</td> <td width=98 align=right id=bg1>".getLevel(12, $nation['level'])."</td>
<td width=398>{$general[name]} 【{$cityNames[$general[city]]}】</td> <td width=398>{$general['name']} 【{$cityNames[$general['city']]}】</td>
<td width=98 align=right id=bg1>".getLevel(11, $nation[level])."</td> <td width=98 align=right id=bg1>".getLevel(11, $nation['level'])."</td>
<form method=post action=c_myBossInfo.php> <form method=post action=c_myBossInfo.php>
<td width=398> <td width=398>
"; ";
if($meLevel >= 5 && $nation[l11set] == 0) { if($meLevel >= 5 && $nation['l11set'] == 0) {
echo " echo "
<select name=genlist size=1 maxlength=15 style=color:white;background-color:black;> <select name=genlist size=1 maxlength=15 style=color:white;background-color:black;>
<option value=0>____공석____</option>"; <option value=0>____공석____</option>";
$query = "select no,name,level,city from general where nation='$me[nation]' and level!='12' order by npc,binary(name)"; $query = "select no,name,level,city from general where nation='$me['nation']' and level!='12' order by npc,binary(name)";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result); $gencount = MYDB_num_rows($result);
for($i=0; $i < $gencount; $i++) { for($i=0; $i < $gencount; $i++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
if($general[level] == 11) { if($general['level'] == 11) {
echo "<option style=color:red; selected value={$general[no]}>{$general[name]} 【{$cityNames[$general[city]]}】</option>"; echo "<option style=color:red; selected value={$general['no']}>{$general['name']} 【{$cityNames[$general['city']]}】</option>";
} elseif($general[level] > 1) { } elseif($general['level'] > 1) {
echo "<option style=color:orange; value={$general[no]}>{$general[name]} 【{$cityNames[$general[city]]}】</option>"; echo "<option style=color:orange; value={$general['no']}>{$general['name']} 【{$cityNames[$general['city']]}】</option>";
} else { } else {
echo "<option value={$general[no]}>{$general[name]} 【{$cityNames[$general[city]]}】</option>"; echo "<option value={$general['no']}>{$general['name']} 【{$cityNames[$general['city']]}】</option>";
} }
} }
@@ -198,10 +198,10 @@ if($meLevel >= 5 && $nation[l11set] == 0) {
<input type=hidden name=level value=11> <input type=hidden name=level value=11>
<input type=$btn name=btn value=임명>"; <input type=$btn name=btn value=임명>";
} else { } else {
$query = "select name,city from general where nation='$me[nation]' and level='11'"; $query = "select name,city from general where nation='$me['nation']' and level='11'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
echo "{$general[name]} 【{$cityNames[$general[city]]}】"; echo "{$general['name']} 【{$cityNames[$general['city']]}】";
} }
echo " echo "
</td> </td>
@@ -209,17 +209,17 @@ echo "
</tr> </tr>
"; ";
$querys[10] = "select no,name,level,city from general where nation='$me[nation]' and level!='12' and power>='$_goodgenpower' order by npc,binary(name)"; $querys[10] = "select no,name,level,city from general where nation='$me['nation']' and level!='12' and power>='$_goodgenpower' order by npc,binary(name)";
$querys[9] = "select no,name,level,city from general where nation='$me[nation]' and level!='12' and intel>='$_goodgenintel' order by npc,binary(name)"; $querys[9] = "select no,name,level,city from general where nation='$me['nation']' and level!='12' and intel>='$_goodgenintel' order by npc,binary(name)";
$querys[8] = "select no,name,level,city from general where nation='$me[nation]' and level!='12' and power>='$_goodgenpower' order by npc,binary(name)"; $querys[8] = "select no,name,level,city from general where nation='$me['nation']' and level!='12' and power>='$_goodgenpower' order by npc,binary(name)";
$querys[7] = "select no,name,level,city from general where nation='$me[nation]' and level!='12' and intel>='$_goodgenintel' order by npc,binary(name)"; $querys[7] = "select no,name,level,city from general where nation='$me['nation']' and level!='12' and intel>='$_goodgenintel' order by npc,binary(name)";
$querys[6] = "select no,name,level,city from general where nation='$me[nation]' and level!='12' and power>='$_goodgenpower' order by npc,binary(name)"; $querys[6] = "select no,name,level,city from general where nation='$me['nation']' and level!='12' and power>='$_goodgenpower' order by npc,binary(name)";
$querys[5] = "select no,name,level,city from general where nation='$me[nation]' and level!='12' and intel>='$_goodgenintel' order by npc,binary(name)"; $querys[5] = "select no,name,level,city from general where nation='$me['nation']' and level!='12' and intel>='$_goodgenintel' order by npc,binary(name)";
for($i=10; $i >= $lv; $i--) { for($i=10; $i >= $lv; $i--) {
if($i % 2 == 0) { echo "<tr>"; } if($i % 2 == 0) { echo "<tr>"; }
echo " echo "
<td width=98 align=right id=bg1>".getLevel($i, $nation[level])."</td> <td width=98 align=right id=bg1>".getLevel($i, $nation['level'])."</td>
<form method=post action=c_myBossInfo.php> <form method=post action=c_myBossInfo.php>
<td width=398> <td width=398>
"; ";
@@ -235,12 +235,12 @@ for($i=10; $i >= $lv; $i--) {
for($k=0; $k < $gencount; $k++) { for($k=0; $k < $gencount; $k++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
if($general[level] == $i) { if($general['level'] == $i) {
echo "<option style=color:red; selected value={$general[no]}>{$general[name]} 【{$cityNames[$general[city]]}】</option>"; echo "<option style=color:red; selected value={$general['no']}>{$general['name']} 【{$cityNames[$general['city']]}】</option>";
} elseif($general[level] > 1) { } elseif($general['level'] > 1) {
echo "<option style=color:orange; value={$general[no]}>{$general[name]} 【{$cityNames[$general[city]]}】</option>"; echo "<option style=color:orange; value={$general['no']}>{$general['name']} 【{$cityNames[$general['city']]}】</option>";
} else { } else {
echo "<option value={$general[no]}>{$general[name]} 【{$cityNames[$general[city]]}】</option>"; echo "<option value={$general['no']}>{$general['name']} 【{$cityNames[$general['city']]}】</option>";
} }
} }
@@ -249,10 +249,10 @@ for($i=10; $i >= $lv; $i--) {
<input type=hidden name=level value={$i}> <input type=hidden name=level value={$i}>
<input type=$btn name=btn value=임명>"; <input type=$btn name=btn value=임명>";
} else { } else {
$query = "select name,city from general where nation='$me[nation]' and level={$i}"; $query = "select name,city from general where nation='$me['nation']' and level={$i}";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
echo "{$general[name]} 【{$cityNames[$general[city]]}】"; echo "{$general['name']} 【{$cityNames[$general['city']]}】";
} }
echo "</td></form>"; echo "</td></form>";
if($i % 2 == 1) { echo "</tr>"; } if($i % 2 == 1) { echo "</tr>"; }
@@ -273,7 +273,7 @@ if($meLevel >= 5) {
<select name=citylist size=1 style=color:white;background-color:black;> <select name=citylist size=1 style=color:white;background-color:black;>
"; ";
$query = "select city,name,region from city where nation='$nation[nation]' and gen1set=0 order by region,level desc,binary(name)"; // 도시 이름 목록 $query = "select city,name,region from city where nation='$nation['nation']' and gen1set=0 order by region,level desc,binary(name)"; // 도시 이름 목록
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($result); $citycount = MYDB_num_rows($result);
@@ -281,15 +281,15 @@ if($meLevel >= 5) {
for($i=0; $i < $citycount; $i++) { for($i=0; $i < $citycount; $i++) {
$city = MYDB_fetch_array($result); $city = MYDB_fetch_array($result);
if($region != $city[region]) { if($region != $city['region']) {
if($region != 0) { if($region != 0) {
echo "</optgroup>"; echo "</optgroup>";
} }
echo "<optgroup label=' 【 ".getRegion($city[region])." 】 ' style=color:skyblue;>"; echo "<optgroup label=' 【 ".getRegion($city['region'])." 】 ' style=color:skyblue;>";
$region = $city[region]; $region = $city['region'];
} }
echo "<option value='{$city[city]}' style=color:white;>{$city[name]}</option>"; echo "<option value='{$city['city']}' style=color:white;>{$city['name']}</option>";
} }
echo "</optgroup>"; echo "</optgroup>";
@@ -299,17 +299,17 @@ if($meLevel >= 5) {
<option value=0>____공석____</option> <option value=0>____공석____</option>
"; ";
$query = "select no,name,level,city from general where nation='$me[nation]' and level!='12' and power>='$_goodgenpower' order by npc,binary(name)"; $query = "select no,name,level,city from general where nation='$me['nation']' and level!='12' and power>='$_goodgenpower' order by npc,binary(name)";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) { for($i=0; $i < $count; $i++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
if($general[level] == 4) { if($general['level'] == 4) {
echo "<option style=color:red; value={$general[no]}>{$general[name]} 【{$cityNames[$general[city]]}】</option>"; echo "<option style=color:red; value={$general['no']}>{$general['name']} 【{$cityNames[$general['city']]}】</option>";
} elseif($general[level] > 1) { } elseif($general['level'] > 1) {
echo "<option style=color:orange; value={$general[no]}>{$general[name]} 【{$cityNames[$general[city]]}】</option>"; echo "<option style=color:orange; value={$general['no']}>{$general['name']} 【{$cityNames[$general['city']]}】</option>";
} else { } else {
echo "<option value={$general[no]}>{$general[name]} 【{$cityNames[$general[city]]}】</option>"; echo "<option value={$general['no']}>{$general['name']} 【{$cityNames[$general['city']]}】</option>";
} }
} }
@@ -327,7 +327,7 @@ if($meLevel >= 5) {
<select name=citylist size=1 style=color:white;background-color:black;> <select name=citylist size=1 style=color:white;background-color:black;>
"; ";
$query = "select city,name,region from city where nation='$nation[nation]' and gen2set=0 order by region,level desc,binary(name)"; // 도시 이름 목록 $query = "select city,name,region from city where nation='$nation['nation']' and gen2set=0 order by region,level desc,binary(name)"; // 도시 이름 목록
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($result); $citycount = MYDB_num_rows($result);
@@ -335,15 +335,15 @@ if($meLevel >= 5) {
for($i=0; $i < $citycount; $i++) { for($i=0; $i < $citycount; $i++) {
$city = MYDB_fetch_array($result); $city = MYDB_fetch_array($result);
if($region != $city[region]) { if($region != $city['region']) {
if($region != 0) { if($region != 0) {
echo "</optgroup>"; echo "</optgroup>";
} }
echo "<optgroup label=' 【 ".getRegion($city[region])." 】 ' style=color:skyblue;>"; echo "<optgroup label=' 【 ".getRegion($city['region'])." 】 ' style=color:skyblue;>";
$region = $city[region]; $region = $city['region'];
} }
echo "<option value='{$city[city]}' style=color:white;>{$city[name]}</option>"; echo "<option value='{$city['city']}' style=color:white;>{$city['name']}</option>";
} }
echo "</optgroup>"; echo "</optgroup>";
@@ -353,17 +353,17 @@ if($meLevel >= 5) {
<option value=0>____공석____</option> <option value=0>____공석____</option>
"; ";
$query = "select no,name,level,city from general where nation='$me[nation]' and level!='12' and intel>='$_goodgenintel' order by npc,binary(name)"; $query = "select no,name,level,city from general where nation='$me['nation']' and level!='12' and intel>='$_goodgenintel' order by npc,binary(name)";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) { for($i=0; $i < $count; $i++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
if($general[level] == 3) { if($general['level'] == 3) {
echo "<option style=color:red; value={$general[no]}>{$general[name]} 【{$cityNames[$general[city]]}】</option>"; echo "<option style=color:red; value={$general['no']}>{$general['name']} 【{$cityNames[$general['city']]}】</option>";
} elseif($general[level] > 1) { } elseif($general['level'] > 1) {
echo "<option style=color:orange; value={$general[no]}>{$general[name]} 【{$cityNames[$general[city]]}】</option>"; echo "<option style=color:orange; value={$general['no']}>{$general['name']} 【{$cityNames[$general['city']]}】</option>";
} else { } else {
echo "<option value={$general[no]}>{$general[name]} 【{$cityNames[$general[city]]}】</option>"; echo "<option value={$general['no']}>{$general['name']} 【{$cityNames[$general['city']]}】</option>";
} }
} }
@@ -381,7 +381,7 @@ if($meLevel >= 5) {
<select name=citylist size=1 style=color:white;background-color:black;> <select name=citylist size=1 style=color:white;background-color:black;>
"; ";
$query = "select city,name,region from city where nation='$nation[nation]' and gen3set=0 order by region, level desc,binary(name)"; // 도시 이름 목록 $query = "select city,name,region from city where nation='$nation['nation']' and gen3set=0 order by region, level desc,binary(name)"; // 도시 이름 목록
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($result); $citycount = MYDB_num_rows($result);
@@ -389,15 +389,15 @@ if($meLevel >= 5) {
for($i=0; $i < $citycount; $i++) { for($i=0; $i < $citycount; $i++) {
$city = MYDB_fetch_array($result); $city = MYDB_fetch_array($result);
if($region != $city[region]) { if($region != $city['region']) {
if($region != 0) { if($region != 0) {
echo "</optgroup>"; echo "</optgroup>";
} }
echo "<optgroup label=' 【 ".getRegion($city[region])." 】 ' style=color:skyblue;>"; echo "<optgroup label=' 【 ".getRegion($city['region'])." 】 ' style=color:skyblue;>";
$region = $city[region]; $region = $city['region'];
} }
echo "<option value='{$city[city]}' style=color:white;>{$city[name]}</option>"; echo "<option value='{$city['city']}' style=color:white;>{$city['name']}</option>";
} }
echo "</optgroup>"; echo "</optgroup>";
@@ -407,17 +407,17 @@ if($meLevel >= 5) {
<option value=0>____공석____</option> <option value=0>____공석____</option>
"; ";
$query = "select no,name,level,city from general where nation='$me[nation]' and level!='12' order by npc,binary(name)"; $query = "select no,name,level,city from general where nation='$me['nation']' and level!='12' order by npc,binary(name)";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) { for($i=0; $i < $count; $i++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
if($general[level] == 2) { if($general['level'] == 2) {
echo "<option style=color:red; value={$general[no]}>{$general[name]} 【{$cityNames[$general[city]]}】</option>"; echo "<option style=color:red; value={$general['no']}>{$general['name']} 【{$cityNames[$general['city']]}】</option>";
} elseif($general[level] > 1) { } elseif($general['level'] > 1) {
echo "<option style=color:orange; value={$general[no]}>{$general[name]} 【{$cityNames[$general[city]]}】</option>"; echo "<option style=color:orange; value={$general['no']}>{$general['name']} 【{$cityNames[$general['city']]}】</option>";
} else { } else {
echo "<option value={$general[no]}>{$general[name]} 【{$cityNames[$general[city]]}】</option>"; echo "<option value={$general['no']}>{$general['name']} 【{$cityNames[$general['city']]}】</option>";
} }
} }
@@ -449,7 +449,7 @@ $citylevel[6] = "중";
$citylevel[7] = "대"; $citylevel[7] = "대";
$citylevel[8] = "특"; $citylevel[8] = "특";
$query = "select city,name,gen1,gen2,gen3,level,region,gen1set,gen2set,gen3set from city where nation='$nation[nation]' order by region,level desc,binary(name)"; // 도시 이름 목록 $query = "select city,name,gen1,gen2,gen3,level,region,gen1set,gen2set,gen3set from city where nation='$nation['nation']' order by region,level desc,binary(name)"; // 도시 이름 목록
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($cityresult); $citycount = MYDB_num_rows($cityresult);
@@ -467,26 +467,26 @@ for($j=0; $j < $citycount; $j++) {
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen3 = MYDB_fetch_array($genresult); $gen3 = MYDB_fetch_array($genresult);
if($region != $city[region]) { if($region != $city['region']) {
echo " echo "
<tr><td colspan=5 height=3 id=bg1></td></tr> <tr><td colspan=5 height=3 id=bg1></td></tr>
<tr><td colspan=5 id=bg1><font size=4 color=skyblue> 【 ".getRegion($city[region])." 】 </font></td></tr>"; <tr><td colspan=5 id=bg1><font size=4 color=skyblue> 【 ".getRegion($city['region'])." 】 </font></td></tr>";
$region = $city[region]; $region = $city['region'];
} }
$gen1[name] = $gen1[name]==""?"-":$gen1[name]." ({$gen1[belong]}년) 【{$cityNames[$gen1[city]]}】"; $gen1['name'] = $gen1['name']==""?"-":$gen1['name']." ({$gen1['belong']}년) 【{$cityNames[$gen1['city']]}】";
$gen2[name] = $gen2[name]==""?"-":$gen2[name]." ({$gen2[belong]}년) 【{$cityNames[$gen2[city]]}】"; $gen2['name'] = $gen2['name']==""?"-":$gen2['name']." ({$gen2['belong']}년) 【{$cityNames[$gen2['city']]}】";
$gen3[name] = $gen3[name]==""?"-":$gen3[name]." ({$gen3[belong]}년) 【{$cityNames[$gen3[city]]}】"; $gen3['name'] = $gen3['name']==""?"-":$gen3['name']." ({$gen3['belong']}년) 【{$cityNames[$gen3['city']]}】";
if($city[gen1set] == 1) { $gen1[name] = "<font color=orange>".$gen1[name]."</font>"; } if($city['gen1set'] == 1) { $gen1['name'] = "<font color=orange>".$gen1['name']."</font>"; }
if($city[gen2set] == 1) { $gen2[name] = "<font color=orange>".$gen2[name]."</font>"; } if($city['gen2set'] == 1) { $gen2['name'] = "<font color=orange>".$gen2['name']."</font>"; }
if($city[gen3set] == 1) { $gen3[name] = "<font color=orange>".$gen3[name]."</font>"; } if($city['gen3set'] == 1) { $gen3['name'] = "<font color=orange>".$gen3['name']."</font>"; }
echo " echo "
<tr> <tr>
<td width=78 align=center style=color:".newColor($nation[color])."; bgcolor={$nation[color]}><font size=3>【{$citylevel[$city[level]]}】</font></td> <td width=78 align=center style=color:".newColor($nation['color'])."; bgcolor={$nation['color']}><font size=3>【{$citylevel[$city['level']]}】</font></td>
<td width=78 align=right style=color:".newColor($nation[color])."; bgcolor={$nation[color]}><font size=3>$city[name]&nbsp;&nbsp;</font></td> <td width=78 align=right style=color:".newColor($nation['color'])."; bgcolor={$nation['color']}><font size=3>$city['name']&nbsp;&nbsp;</font></td>
<td align=center>$gen1[name]</td> <td align=center>$gen1['name']</td>
<td align=center>$gen2[name]</td> <td align=center>$gen2['name']</td>
<td align=center>$gen3[name]</td> <td align=center>$gen3['name']</td>
</tr> </tr>
"; ";
} }
+41 -41
View File
@@ -6,11 +6,11 @@ CheckLogin();
$connect = dbConn(); $connect = dbConn();
increaseRefresh($connect, "세력도시", 1); increaseRefresh($connect, "세력도시", 1);
$query = "select no,nation,level,skin from general where user_id='$_SESSION[p_id]'"; $query = "select no,nation,level,skin from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
if($me[level] == 0) { if($me['level'] == 0) {
echo "재야입니다."; echo "재야입니다.";
exit(); exit();
} }
@@ -20,7 +20,7 @@ if($type == 0) {
} }
$sel[$type] = "selected"; $sel[$type] = "selected";
if($me[skin] < 1) { if($me['skin'] < 1) {
$tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4; $tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4;
$_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000"; $_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000";
} }
@@ -56,34 +56,34 @@ if($me[skin] < 1) {
</td></tr> </td></tr>
</table> </table>
<?php <?php
$query = "select nation from general where user_id='$_SESSION[p_id]'"; $query = "select nation from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
$query = "select color,capital from nation where nation='$me[nation]'"; $query = "select color,capital from nation where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result); //국가정보 $nation = MYDB_fetch_array($result); //국가정보
switch($type) { switch($type) {
case 1: $query = "select *,pop/pop2 as poprate from city where nation='$me[nation]'"; break; case 1: $query = "select *,pop/pop2 as poprate from city where nation='$me['nation']'"; break;
case 2: $query = "select *,pop/pop2 as poprate from city where nation='$me[nation]' order by pop desc"; break; case 2: $query = "select *,pop/pop2 as poprate from city where nation='$me['nation']' order by pop desc"; break;
case 3: $query = "select *,pop/pop2 as poprate from city where nation='$me[nation]' order by poprate desc"; break; case 3: $query = "select *,pop/pop2 as poprate from city where nation='$me['nation']' order by poprate desc"; break;
case 4: $query = "select *,pop/pop2 as poprate from city where nation='$me[nation]' order by rate desc"; break; case 4: $query = "select *,pop/pop2 as poprate from city where nation='$me['nation']' order by rate desc"; break;
case 5: $query = "select *,pop/pop2 as poprate from city where nation='$me[nation]' order by agri desc"; break; case 5: $query = "select *,pop/pop2 as poprate from city where nation='$me['nation']' order by agri desc"; break;
case 6: $query = "select *,pop/pop2 as poprate from city where nation='$me[nation]' order by comm desc"; break; case 6: $query = "select *,pop/pop2 as poprate from city where nation='$me['nation']' order by comm desc"; break;
case 7: $query = "select *,pop/pop2 as poprate from city where nation='$me[nation]' order by secu desc"; break; case 7: $query = "select *,pop/pop2 as poprate from city where nation='$me['nation']' order by secu desc"; break;
case 8: $query = "select *,pop/pop2 as poprate from city where nation='$me[nation]' order by def desc"; break; case 8: $query = "select *,pop/pop2 as poprate from city where nation='$me['nation']' order by def desc"; break;
case 9: $query = "select *,pop/pop2 as poprate from city where nation='$me[nation]' order by wall desc"; break; case 9: $query = "select *,pop/pop2 as poprate from city where nation='$me['nation']' order by wall desc"; break;
case 10: $query = "select *,pop/pop2 as poprate from city where nation='$me[nation]' order by trade desc"; break; case 10: $query = "select *,pop/pop2 as poprate from city where nation='$me['nation']' order by trade desc"; break;
case 11: $query = "select *,pop/pop2 as poprate from city where nation='$me[nation]' order by region,level desc"; break; case 11: $query = "select *,pop/pop2 as poprate from city where nation='$me['nation']' order by region,level desc"; break;
case 12: $query = "select *,pop/pop2 as poprate from city where nation='$me[nation]' order by level desc, region"; break; case 12: $query = "select *,pop/pop2 as poprate from city where nation='$me['nation']' order by level desc, region"; break;
} }
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($cityresult); $citycount = MYDB_num_rows($cityresult);
for($j=0; $j < $citycount; $j++) { for($j=0; $j < $citycount; $j++) {
$city = MYDB_fetch_array($cityresult); $city = MYDB_fetch_array($cityresult);
if($city[city] == $nation[capital]) { $city[name] = "<font color=cyan>[{$city[name]}]</font>"; } if($city['city'] == $nation['capital']) { $city['name'] = "<font color=cyan>[{$city['name']}]</font>"; }
$query = "select name from general where no='$city[gen1]'"; // 태수 $query = "select name from general where no='$city[gen1]'"; // 태수
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen1 = MYDB_fetch_array($genresult); $gen1 = MYDB_fetch_array($genresult);
@@ -96,63 +96,63 @@ for($j=0; $j < $citycount; $j++) {
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen3 = MYDB_fetch_array($genresult); $gen3 = MYDB_fetch_array($genresult);
if($type == 10 && $city[region] != $region) { if($type == 10 && $city['region'] != $region) {
echo "<br>"; echo "<br>";
$region = $city[region]; $region = $city['region'];
} elseif($type == 11 && $city[level] != $level) { } elseif($type == 11 && $city['level'] != $level) {
echo "<br>"; echo "<br>";
$level = $city[level]; $level = $city['level'];
} }
if($city[trade] == 0) { if($city['trade'] == 0) {
$city[trade] = "- "; $city['trade'] = "- ";
} }
echo " echo "
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg2> <table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg2>
<tr> <tr>
<td colspan=12 style=color:".newColor($nation[color])."; bgcolor={$nation[color]}><font size=2>【 ".getRegion($city[region])." | ".getCityLevel($city[level])." 】 {$city[name]}</font></td> <td colspan=12 style=color:".newColor($nation['color'])."; bgcolor={$nation['color']}><font size=2>【 ".getRegion($city['region'])." | ".getCityLevel($city['level'])." 】 {$city['name']}</font></td>
</tr> </tr>
<tr> <tr>
<td align=center width=48 id=bg1>주민</td> <td align=center width=48 id=bg1>주민</td>
<td align=center width=112>$city[pop]/$city[pop2]</td> <td align=center width=112>$city['pop']/$city[pop2]</td>
<td align=center width=48 id=bg1>농업</td> <td align=center width=48 id=bg1>농업</td>
<td align=center width=108>$city[agri]/$city[agri2]</td> <td align=center width=108>$city['agri']/$city[agri2]</td>
<td align=center width=48 id=bg1>상업</td> <td align=center width=48 id=bg1>상업</td>
<td align=center width=108>$city[comm]/$city[comm2]</td> <td align=center width=108>$city['comm']/$city[comm2]</td>
<td align=center width=48 id=bg1>치안</td> <td align=center width=48 id=bg1>치안</td>
<td align=center width=108>$city[secu]/$city[secu2]</td> <td align=center width=108>$city['secu']/$city[secu2]</td>
<td align=center width=48 id=bg1>수비</td> <td align=center width=48 id=bg1>수비</td>
<td align=center width=108>$city[def]/$city[def2]</td> <td align=center width=108>$city['def']/$city[def2]</td>
<td align=center width=48 id=bg1>성벽</td> <td align=center width=48 id=bg1>성벽</td>
<td align=center width=108>$city[wall]/$city[wall2]</td> <td align=center width=108>$city['wall']/$city[wall2]</td>
</tr> </tr>
<tr> <tr>
<td align=center id=bg1>민심</td> <td align=center id=bg1>민심</td>
<td align=center>$city[rate]</td> <td align=center>$city['rate']</td>
<td align=center id=bg1>시세</td> <td align=center id=bg1>시세</td>
<td align=center>{$city[trade]}%</td> <td align=center>{$city['trade']}%</td>
<td align=center id=bg1>인구</td> <td align=center id=bg1>인구</td>
<td align=center>".round($city[pop]/$city[pop2]*100, 2)." %</td> <td align=center>".round($city['pop']/$city[pop2]*100, 2)." %</td>
<td align=center id=bg1>태수</td> <td align=center id=bg1>태수</td>
<td align=center>";echo $gen1[name]==''?"-":"$gen1[name]";echo "</td> <td align=center>";echo $gen1['name']==''?"-":"$gen1['name']";echo "</td>
<td align=center id=bg1>군사</td> <td align=center id=bg1>군사</td>
<td align=center>";echo $gen2[name]==''?"-":"$gen2[name]";echo "</td> <td align=center>";echo $gen2['name']==''?"-":"$gen2['name']";echo "</td>
<td align=center id=bg1>시중</td> <td align=center id=bg1>시중</td>
<td align=center>";echo $gen3[name]==''?"-":"$gen3[name]";echo "</td> <td align=center>";echo $gen3['name']==''?"-":"$gen3['name']";echo "</td>
</tr> </tr>
<tr> <tr>
<td align=center id=bg1>장수</td> <td align=center id=bg1>장수</td>
<td colspan=11>"; <td colspan=11>";
$query = "select npc,name from general where city='$city[city]' and nation='$me[nation]'"; // 장수 목록 $query = "select npc,name from general where city='$city['city']' and nation='$me['nation']'"; // 장수 목록
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($genresult); $gencount = MYDB_num_rows($genresult);
if($gencount == 0) echo "-"; if($gencount == 0) echo "-";
for($i=0; $i < $gencount; $i++) { for($i=0; $i < $gencount; $i++) {
$general = MYDB_fetch_array($genresult); $general = MYDB_fetch_array($genresult);
if($general[npc] >= 2) { echo "<font color=cyan>{$general[name]}, </font>"; } if($general['npc'] >= 2) { echo "<font color=cyan>{$general['name']}, </font>"; }
elseif($general[npc] == 1) { echo "<font color=skyblue>{$general[name]}, </font>"; } elseif($general['npc'] == 1) { echo "<font color=skyblue>{$general['name']}, </font>"; }
else { echo "$general[name], "; } else { echo "$general['name'], "; }
} }
echo " echo "
</td> </td>
+45 -45
View File
@@ -6,11 +6,11 @@ CheckLogin();
$connect = dbConn(); $connect = dbConn();
increaseRefresh($connect, "세력장수", 1); increaseRefresh($connect, "세력장수", 1);
$query = "select skin,no,nation,level from general where user_id='$_SESSION[p_id]'"; $query = "select skin,no,nation,level from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
if($me[level] == 0) { if($me['level'] == 0) {
echo "재야입니다."; echo "재야입니다.";
exit(); exit();
} }
@@ -21,7 +21,7 @@ if($type == 0) {
} }
$sel[$type] = "selected"; $sel[$type] = "selected";
if($me[skin] < 1) { if($me['skin'] < 1) {
$tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4; $tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4;
$_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000"; $_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000";
} }
@@ -60,26 +60,26 @@ if($me[skin] < 1) {
</td></tr> </td></tr>
</table> </table>
<?php <?php
$query = "select level from nation where nation='$me[nation]'"; $query = "select level from nation where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
switch($type) { switch($type) {
case 1: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me[nation]' order by level desc"; break; case 1: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me['nation']' order by level desc"; break;
case 2: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me[nation]' order by dedication desc"; break; case 2: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me['nation']' order by dedication desc"; break;
case 3: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me[nation]' order by experience desc"; break; case 3: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me['nation']' order by experience desc"; break;
case 4: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me[nation]' order by leader desc"; break; case 4: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me['nation']' order by leader desc"; break;
case 5: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me[nation]' order by power desc"; break; case 5: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me['nation']' order by power desc"; break;
case 6: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me[nation]' order by intel desc"; break; case 6: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me['nation']' order by intel desc"; break;
case 7: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me[nation]' order by gold desc"; break; case 7: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me['nation']' order by gold desc"; break;
case 8: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me[nation]' order by rice desc"; break; case 8: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me['nation']' order by rice desc"; break;
case 9: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me[nation]' order by crew desc"; break; case 9: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me['nation']' order by crew desc"; break;
case 10: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me[nation]' order by connect desc"; break; case 10: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me['nation']' order by connect desc"; break;
case 11: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me[nation]' order by personal"; break; case 11: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me['nation']' order by personal"; break;
case 12: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me[nation]' order by special desc"; break; case 12: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me['nation']' order by special desc"; break;
case 13: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me[nation]' order by special2 desc"; break; case 13: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me['nation']' order by special2 desc"; break;
case 14: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me[nation]' order by belong desc"; break; case 14: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me['nation']' order by belong desc"; break;
case 15: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me[nation]' order by npc desc"; break; case 15: $query = "select npc,special,special2,personal,picture,imgsvr,name,level,dedication,experience,injury,leader,power,intel,gold,rice,belong,connect,killturn from general where nation='$me['nation']' order by npc desc"; break;
} }
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($genresult); $gencount = MYDB_num_rows($genresult);
@@ -106,10 +106,10 @@ echo"
for($j=0; $j < $gencount; $j++) { for($j=0; $j < $gencount; $j++) {
$general = MYDB_fetch_array($genresult); $general = MYDB_fetch_array($genresult);
if($general[level] == 12) { if($general['level'] == 12) {
$lbonus = $nation[level] * 2; $lbonus = $nation['level'] * 2;
} elseif($general[level] >= 5) { } elseif($general['level'] >= 5) {
$lbonus = $nation[level]; $lbonus = $nation['level'];
} else { } else {
$lbonus = 0; $lbonus = 0;
} }
@@ -119,41 +119,41 @@ for($j=0; $j < $gencount; $j++) {
$lbonus = ""; $lbonus = "";
} }
if($general[injury] > 0) { if($general['injury'] > 0) {
$leader = floor($general[leader] * (100 - $general[injury])/100); $leader = floor($general['leader'] * (100 - $general['injury'])/100);
$power = floor($general[power] * (100 - $general[injury])/100); $power = floor($general['power'] * (100 - $general['injury'])/100);
$intel = floor($general[intel] * (100 - $general[injury])/100); $intel = floor($general['intel'] * (100 - $general['injury'])/100);
$leader = "<font color=red>{$leader}</font>{$lbonus}"; $leader = "<font color=red>{$leader}</font>{$lbonus}";
$power = "<font color=red>{$power}</font>"; $power = "<font color=red>{$power}</font>";
$intel = "<font color=red>{$intel}</font>"; $intel = "<font color=red>{$intel}</font>";
} else { } else {
$leader = "{$general[leader]}{$lbonus}"; $leader = "{$general['leader']}{$lbonus}";
$power = "{$general[power]}"; $power = "{$general['power']}";
$intel = "{$general[intel]}"; $intel = "{$general['intel']}";
} }
if($general[npc] >= 2) { $name = "<font color=cyan>$general[name]</font>"; } if($general['npc'] >= 2) { $name = "<font color=cyan>$general['name']</font>"; }
elseif($general[npc] == 1) { $name = "<font color=skyblue>$general[name]</font>"; } elseif($general['npc'] == 1) { $name = "<font color=skyblue>$general['name']</font>"; }
else { $name = "$general[name]"; } else { $name = "$general['name']"; }
$imageTemp = GetImageURL($general[imgsvr]); $imageTemp = GetImageURL($general['imgsvr']);
echo " echo "
<tr> <tr>
<td align=center"; echo $me[skin]>0?" background={$imageTemp}/{$general[picture]}":""; echo " height=64></td> <td align=center"; echo $me['skin']>0?" background={$imageTemp}/{$general['picture']}":""; echo " height=64></td>
<td align=center>$name</td> <td align=center>$name</td>
<td align=center>"; echo getLevel($general[level], $nation[level]); echo "</td> <td align=center>"; echo getLevel($general['level'], $nation['level']); echo "</td>
<td align=center>".getDed($general[dedication])."</td> <td align=center>".getDed($general['dedication'])."</td>
<td align=center>".getHonor($general[experience])."</td> <td align=center>".getHonor($general['experience'])."</td>
<td align=center>".getBill($general[dedication])."</td> <td align=center>".getBill($general['dedication'])."</td>
<td align=center>$leader</td> <td align=center>$leader</td>
<td align=center>$power</td> <td align=center>$power</td>
<td align=center>$intel</td> <td align=center>$intel</td>
<td align=center>$general[gold]</td> <td align=center>$general['gold']</td>
<td align=center>$general[rice]</td> <td align=center>$general['rice']</td>
<td align=center>".getGenChar($general[personal])."</td> <td align=center>".getGenChar($general['personal'])."</td>
<td align=center>".getGenSpecial($general[special])." / ".getGenSpecial($general[special2])."</td> <td align=center>".getGenSpecial($general['special'])." / ".getGenSpecial($general[special2])."</td>
<td align=center>$general[belong]</td> <td align=center>$general['belong']</td>
<td align=center>$general[connect]"; echo "<br>(".getConnect($general[connect]).")</td> <td align=center>$general['connect']"; echo "<br>(".getConnect($general['connect']).")</td>
</tr>"; </tr>";
} }
echo " echo "
+27 -27
View File
@@ -6,11 +6,11 @@ CheckLogin();
$connect = dbConn(); $connect = dbConn();
increaseRefresh($connect, "세력정보", 1); increaseRefresh($connect, "세력정보", 1);
$query = "select no,nation,level from general where user_id='$_SESSION[p_id]'"; $query = "select no,nation,level from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
if($me[level] == 0) { if($me['level'] == 0) {
echo "재야입니다."; echo "재야입니다.";
exit(); exit();
} }
@@ -30,27 +30,27 @@ if($me[level] == 0) {
</table> </table>
<br> <br>
<?php <?php
$query = "select nation,skin from general where user_id='$_SESSION[p_id]'"; $query = "select nation,skin from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
$query = "select nation,gennum,power,rate,bill,type,gold,rice,color,name,level,tech,history,capital from nation where nation='$me[nation]'"; $query = "select nation,gennum,power,rate,bill,type,gold,rice,color,name,level,tech,history,capital from nation where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result); //국가정보 $nation = MYDB_fetch_array($result); //국가정보
$query = "select city,name,pop,pop2 from city where nation='$nation[nation]'"; // 도시 이름 목록 $query = "select city,name,pop,pop2 from city where nation='$nation['nation']'"; // 도시 이름 목록
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($cityresult); $citycount = MYDB_num_rows($cityresult);
for($j=0; $j < $citycount; $j++) { for($j=0; $j < $citycount; $j++) {
$city = MYDB_fetch_array($cityresult); $city = MYDB_fetch_array($cityresult);
if($city[city] == $nation[capital]) { $cityname[$j] = "<font color=cyan>[{$city[name]}]</font>"; } if($city['city'] == $nation['capital']) { $cityname[$j] = "<font color=cyan>[{$city['name']}]</font>"; }
else { $cityname[$j] = $city[name]; } else { $cityname[$j] = $city['name']; }
$totalpop += $city[pop]; $totalpop += $city['pop'];
$maxpop += $city[pop2]; $maxpop += $city[pop2];
} }
$query = "select sum(crew) as totcrew,sum(leader)*100 as maxcrew from general where nation='$nation[nation]'"; $query = "select sum(crew) as totcrew,sum(leader)*100 as maxcrew from general where nation='$nation['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
@@ -58,18 +58,18 @@ $query = "select gold_rate,rice_rate 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);
// 금 수지 // 금 수지
$deadIncome = getDeadIncome($connect, $nation[nation], $nation[type], $admin[gold_rate]); $deadIncome = getDeadIncome($connect, $nation['nation'], $nation['type'], $admin['gold_rate']);
$goldincomeList = getGoldIncome($connect, $nation[nation], $nation[rate], $admin[gold_rate], $nation[type]); $goldincomeList = getGoldIncome($connect, $nation['nation'], $nation['rate'], $admin['gold_rate'], $nation['type']);
$goldincome = $goldincomeList[0] + $goldincomeList[1] + $deadIncome; $goldincome = $goldincomeList[0] + $goldincomeList[1] + $deadIncome;
$goldoutcome = getGoldOutcome($connect, $nation[nation], $nation[bill]); $goldoutcome = getGoldOutcome($connect, $nation['nation'], $nation['bill']);
$riceincomeList = getRiceIncome($connect, $nation[nation], $nation[rate], $admin[rice_rate], $nation[type]); $riceincomeList = getRiceIncome($connect, $nation['nation'], $nation['rate'], $admin['rice_rate'], $nation['type']);
$riceincome = $riceincomeList[0] + $riceincomeList[1]; $riceincome = $riceincomeList[0] + $riceincomeList[1];
$riceoutcome = getRiceOutcome($connect, $nation[nation], $nation[bill]); $riceoutcome = getRiceOutcome($connect, $nation['nation'], $nation['bill']);
$budgetgold = $nation[gold] + $goldincome - $goldoutcome + $deadIncome; $budgetgold = $nation['gold'] + $goldincome - $goldoutcome + $deadIncome;
$budgetrice = $nation[rice] + $riceincome - $riceoutcome; $budgetrice = $nation['rice'] + $riceincome - $riceoutcome;
$budgetgolddiff = $goldincome - $goldoutcome + $deadIncome; $budgetgolddiff = $goldincome - $goldoutcome + $deadIncome;
$budgetricediff = $riceincome - $riceoutcome; $budgetricediff = $riceincome - $riceoutcome;
if($budgetgolddiff > 0) { $budgetgolddiff = "+{$budgetgolddiff}"; } if($budgetgolddiff > 0) { $budgetgolddiff = "+{$budgetgolddiff}"; }
@@ -80,23 +80,23 @@ else { $budgetricediff = "$budgetricediff"; }
echo " echo "
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg2> <table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg2>
<tr> <tr>
<td colspan=8 align=center style=color:".newColor($nation[color])."; bgcolor={$nation[color]}>【 ";echo $me[nation]==0?"공 백 지":"$nation[name]";echo " 】</td> <td colspan=8 align=center style=color:".newColor($nation['color'])."; bgcolor={$nation['color']}>【 ";echo $me['nation']==0?"공 백 지":"$nation['name']";echo " 】</td>
</tr> </tr>
<tr> <tr>
<td width=98 align=center id=bg1>총주민</td> <td width=98 align=center id=bg1>총주민</td>
<td width=198 align=center>{$totalpop}/{$maxpop}</td> <td width=198 align=center>{$totalpop}/{$maxpop}</td>
<td width=98 align=center id=bg1>총병사</td> <td width=98 align=center id=bg1>총병사</td>
<td width=198 align=center>{$general[totcrew]}/{$general[maxcrew]}</td> <td width=198 align=center>{$general['totcrew']}/{$general['maxcrew']}</td>
<td width=98 align=center id=bg1>국 력</td> <td width=98 align=center id=bg1>국 력</td>
<td width=298 align=center colspan=3>$nation[power]</td> <td width=298 align=center colspan=3>$nation['power']</td>
</tr> </tr>
<tr> <tr>
<td align=center id=bg1>국 고</td> <td align=center id=bg1>국 고</td>
<td align=center>"; echo $nation[gold]==0?"-":"$nation[gold]"; echo "</td> <td align=center>"; echo $nation['gold']==0?"-":"$nation['gold']"; echo "</td>
<td align=center id=bg1>병 량</td> <td align=center id=bg1>병 량</td>
<td align=center>"; echo $nation[rice]==0?"-":"$nation[rice]"; echo "</td> <td align=center>"; echo $nation['rice']==0?"-":"$nation['rice']"; echo "</td>
<td align=center id=bg1>세 율</td> <td align=center id=bg1>세 율</td>
<td align=center colspan=3>"; echo $me[nation]==0?"해당 없음":"$nation[rate] %"; echo "</td> <td align=center colspan=3>"; echo $me['nation']==0?"해당 없음":"$nation['rate'] %"; echo "</td>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -105,7 +105,7 @@ echo "
<td align=center id=bg1>세곡/둔전</td> <td align=center id=bg1>세곡/둔전</td>
<td align=center>+$riceincomeList[0] / +$riceincomeList[1]</td> <td align=center>+$riceincomeList[0] / +$riceincomeList[1]</td>
<td align=center id=bg1>지급율</td> <td align=center id=bg1>지급율</td>
<td align=center colspan=3>"; echo $me[nation]==0?"해당 없음":"$nation[bill] %"; echo "</td> <td align=center colspan=3>"; echo $me['nation']==0?"해당 없음":"$nation['bill'] %"; echo "</td>
</tr> </tr>
<tr> <tr>
<td align=center id=bg1>수입/지출</td> <td align=center id=bg1>수입/지출</td>
@@ -115,7 +115,7 @@ echo "
<td align=center id=bg1>속 령</td> <td align=center id=bg1>속 령</td>
<td width=98 align=center>$citycount</td> <td width=98 align=center>$citycount</td>
<td width=98 align=center id=bg1>장 수</td> <td width=98 align=center id=bg1>장 수</td>
<td width=98 align=center>$nation[gennum]</td> <td width=98 align=center>$nation['gennum']</td>
</tr> </tr>
<tr> <tr>
<td align=center id=bg1>국고 예산</td> <td align=center id=bg1>국고 예산</td>
@@ -123,9 +123,9 @@ echo "
<td align=center id=bg1>병량 예산</td> <td align=center id=bg1>병량 예산</td>
<td align=center>{$budgetrice} ({$budgetricediff})</td> <td align=center>{$budgetrice} ({$budgetricediff})</td>
<td align=center id=bg1>기술력</td> <td align=center id=bg1>기술력</td>
<td align=center>$nation[tech]</td> <td align=center>$nation['tech']</td>
<td align=center id=bg1>작 위</td> <td align=center id=bg1>작 위</td>
<td align=center>".getNationLevel($nation[level])."</td> <td align=center>".getNationLevel($nation['level'])."</td>
</tr> </tr>
<tr> <tr>
<td align=center valign=top id=bg1> 속령일람 :</td> <td align=center valign=top id=bg1> 속령일람 :</td>
@@ -138,7 +138,7 @@ echo"
</tr> </tr>
<tr> <tr>
<td align=center valign=top id=bg1>국가열전</td> <td align=center valign=top id=bg1>국가열전</td>
<td colspan=7 id=bg0>".ConvertLog($nation[history], $me[skin])."</td> <td colspan=7 id=bg0>".ConvertLog($nation['history'], $me['skin'])."</td>
</tr> </tr>
</table> </table>
<br>"; <br>";
+35 -35
View File
@@ -6,7 +6,7 @@ CheckLogin();
$connect = dbConn(); $connect = dbConn();
increaseRefresh($connect, "내정보", 1); increaseRefresh($connect, "내정보", 1);
$query = "select myset from general where user_id='$_SESSION[p_id]'"; $query = "select myset from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
@@ -23,15 +23,15 @@ if($btn == "설정저장" && $me['myset'] > 0) {
$submit = 'hidden'; $submit = 'hidden';
} }
$query = "update general set myset=myset-1,map='$map',mode='$mode',skin='$skin',tnmt='$tnmt' where user_id='$_SESSION[p_id]'"; $query = "update general set myset=myset-1,map='$map',mode='$mode',skin='$skin',tnmt='$tnmt' where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
$query = "select no,skin,map,mode,tnmt,myset from general where user_id='$_SESSION[p_id]'"; $query = "select no,skin,map,mode,tnmt,myset from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
if($me[skin] < 1) { if($me['skin'] < 1) {
$tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4; $tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4;
$_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000"; $_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000";
} }
@@ -40,7 +40,7 @@ if($me[skin] < 1) {
<head> <head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'> <meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<title>내정보</title> <title>내정보</title>
<link rel=stylesheet href=stylesheet.php?<?=$me[skin];?> type=text/css> <link rel=stylesheet href=stylesheet.php?<?=$me['skin'];?> type=text/css>
<script type="text/javascript"> <script type="text/javascript">
function go(type) { function go(type) {
if(type == 0) location.replace('c_vacation.php'); if(type == 0) location.replace('c_vacation.php');
@@ -63,39 +63,39 @@ function go(type) {
<form name=form1 action=b_myPage.php method=post> <form name=form1 action=b_myPage.php method=post>
&nbsp;&nbsp;&nbsp;&nbsp;스킨 【 &nbsp;&nbsp;&nbsp;&nbsp;스킨 【
<select name=skin> <select name=skin>
<option value=0 <?=$me[skin]==0?"selected ":" ";?>style=color:ffffff;background-color:000000;font-size:13;>=== 간 단 ===</option> <option value=0 <?=$me['skin']==0?"selected ":" ";?>style=color:ffffff;background-color:000000;font-size:13;>=== 간 단 ===</option>
<option value=1 <?=$me[skin]==1?"selected ":" ";?>style=color:225500;background-color:330000;font-size:13;>=== 표 준 ===</option> <option value=1 <?=$me['skin']==1?"selected ":" ";?>style=color:225500;background-color:330000;font-size:13;>=== 표 준 ===</option>
<option value=2 <?=$me[skin]==2?"selected ":" ";?>style=color:ffffff;background-color:000000;font-size:13;>=== 계 절 ===</option> <option value=2 <?=$me['skin']==2?"selected ":" ";?>style=color:ffffff;background-color:000000;font-size:13;>=== 계 절 ===</option>
<option value=3 <?=$me[skin]==3?"selected ":" ";?>style=color:ff69b4;background-color:330033;font-size:13;>=== 봄&nbsp;&nbsp;&nbsp;&nbsp; ===</option> <option value=3 <?=$me['skin']==3?"selected ":" ";?>style=color:ff69b4;background-color:330033;font-size:13;>=== 봄&nbsp;&nbsp;&nbsp;&nbsp; ===</option>
<option value=4 <?=$me[skin]==4?"selected ":" ";?>style=color:225500;background-color:001717;font-size:13;>=== 여 름 ===</option> <option value=4 <?=$me['skin']==4?"selected ":" ";?>style=color:225500;background-color:001717;font-size:13;>=== 여 름 ===</option>
<option value=5 <?=$me[skin]==5?"selected ":" ";?>style=color:b8860b;background-color:220000;font-size:13;>=== 가 을 ===</option> <option value=5 <?=$me['skin']==5?"selected ":" ";?>style=color:b8860b;background-color:220000;font-size:13;>=== 가 을 ===</option>
<option value=6 <?=$me[skin]==6?"selected ":" ";?>style=color:666666;background-color:222222;font-size:13;>=== 겨 울 ===</option> <option value=6 <?=$me['skin']==6?"selected ":" ";?>style=color:666666;background-color:222222;font-size:13;>=== 겨 울 ===</option>
<option value=7 <?=$me[skin]==7?"selected ":" ";?>style=color:660000;background-color:220000;font-size:13;>=== 주 작 ===</option> <option value=7 <?=$me['skin']==7?"selected ":" ";?>style=color:660000;background-color:220000;font-size:13;>=== 주 작 ===</option>
<option value=8 <?=$me[skin]==8?"selected ":" ";?>style=color:006600;background-color:002200;font-size:13;>=== 초 태 ===</option> <option value=8 <?=$me['skin']==8?"selected ":" ";?>style=color:006600;background-color:002200;font-size:13;>=== 초 태 ===</option>
<option value=9 <?=$me[skin]==9?"selected ":" ";?>style=color:000066;background-color:000022;font-size:13;>=== 청 룡 ===</option> <option value=9 <?=$me['skin']==9?"selected ":" ";?>style=color:000066;background-color:000022;font-size:13;>=== 청 룡 ===</option>
<option value=10 <?=$me[skin]==10?"selected ":" ";?>style=color:006666;background-color:002222;font-size:13;>=== 녹 기 ===</option> <option value=10 <?=$me['skin']==10?"selected ":" ";?>style=color:006666;background-color:002222;font-size:13;>=== 녹 기 ===</option>
<option value=11 <?=$me[skin]==11?"selected ":" ";?>style=color:660066;background-color:220022;font-size:13;>=== 남 황 ===</option> <option value=11 <?=$me['skin']==11?"selected ":" ";?>style=color:660066;background-color:220022;font-size:13;>=== 남 황 ===</option>
<option value=12 <?=$me[skin]==12?"selected ":" ";?>style=color:666600;background-color:222200;font-size:13;>=== 황 봉 ===</option> <option value=12 <?=$me['skin']==12?"selected ":" ";?>style=color:666600;background-color:222200;font-size:13;>=== 황 봉 ===</option>
<option value=13 <?=$me[skin]==13?"selected ":" ";?>style=color:666666;background-color:222222;font-size:13;>=== 현 무 ===</option> <option value=13 <?=$me['skin']==13?"selected ":" ";?>style=color:666666;background-color:222222;font-size:13;>=== 현 무 ===</option>
<option value=14 <?=$me[skin]==14?"selected ":" ";?>style=color:ffffff;background-color:000000;font-size:13;>=== 랜 덤 ===</option> <option value=14 <?=$me['skin']==14?"selected ":" ";?>style=color:ffffff;background-color:000000;font-size:13;>=== 랜 덤 ===</option>
<option value=15 <?=$me[skin]==15?"selected ":" ";?>style=color:pink;background-color:000000;font-size:13;>==소녀시대===</option> <option value=15 <?=$me['skin']==15?"selected ":" ";?>style=color:pink;background-color:000000;font-size:13;>==소녀시대===</option>
<option value=16 <?=$me[skin]==16?"selected ":" ";?>style=color:pink;background-color:000000;font-size:13;>=== 태 연 ===</option> <option value=16 <?=$me['skin']==16?"selected ":" ";?>style=color:pink;background-color:000000;font-size:13;>=== 태 연 ===</option>
<option value=17 <?=$me[skin]==17?"selected ":" ";?>style=color:pink;background-color:000000;font-size:13;>=== 소 원 ===</option> <option value=17 <?=$me['skin']==17?"selected ":" ";?>style=color:pink;background-color:000000;font-size:13;>=== 소 원 ===</option>
</select> 】<br><br> </select> 】<br><br>
&nbsp;&nbsp;&nbsp;&nbsp;지도수준 【 &nbsp;&nbsp;&nbsp;&nbsp;지도수준 【
<input type=radio name=map value=0 <?=$me[map]==0?"checked":""; ?>>상세 <input type=radio name=map value=0 <?=$me['map']==0?"checked":""; ?>>상세
<input type=radio name=map value=1 <?=$me[map]==1?"checked":""; ?>>간단 <input type=radio name=map value=1 <?=$me['map']==1?"checked":""; ?>>간단
<input type=radio name=map value=2 <?=$me[map]==2?"checked":""; ?>>생략 <input type=radio name=map value=2 <?=$me['map']==2?"checked":""; ?>>생략
】<br><br> 】<br><br>
&nbsp;&nbsp;&nbsp;&nbsp;토너먼트 【 &nbsp;&nbsp;&nbsp;&nbsp;토너먼트 【
<input type=radio name=tnmt value=0 <?=$me[tnmt]==0?"checked":""; ?>>수동참여 <input type=radio name=tnmt value=0 <?=$me['tnmt']==0?"checked":""; ?>>수동참여
<input type=radio name=tnmt value=1 <?=$me[tnmt]==1?"checked":""; ?>>자동참여 <input type=radio name=tnmt value=1 <?=$me['tnmt']==1?"checked":""; ?>>자동참여
】<br> 】<br>
&nbsp;&nbsp;&nbsp;&nbsp;∞<font color=orange>개막직전 남는자리가 있을경우 랜덤하게 참여합니다.</font><br><br> &nbsp;&nbsp;&nbsp;&nbsp;∞<font color=orange>개막직전 남는자리가 있을경우 랜덤하게 참여합니다.</font><br><br>
&nbsp;&nbsp;&nbsp;&nbsp;수비 【 &nbsp;&nbsp;&nbsp;&nbsp;수비 【
<input type=radio name=mode value=2 <?=$me[mode]==2?"checked":""; ?>>◎(훈사80) <input type=radio name=mode value=2 <?=$me['mode']==2?"checked":""; ?>>◎(훈사80)
<input type=radio name=mode value=1 <?=$me[mode]==1?"checked":""; ?>>○(훈사60) <input type=radio name=mode value=1 <?=$me['mode']==1?"checked":""; ?>>○(훈사60)
<input type=radio name=mode value=0 <?=$me[mode]==0?"checked":""; ?>>× <input type=radio name=mode value=0 <?=$me['mode']==0?"checked":""; ?>>×
】<br><br> 】<br><br>
&nbsp;&nbsp;&nbsp;&nbsp;<input type=<?=$submit;?> name=btn style=background-color:<?=$_basecolor2;?>;color:white;width:160;height:30;font-size:13; value=설정저장><br> &nbsp;&nbsp;&nbsp;&nbsp;<input type=<?=$submit;?> name=btn style=background-color:<?=$_basecolor2;?>;color:white;width:160;height:30;font-size:13; value=설정저장><br>
&nbsp;&nbsp;&nbsp;&nbsp;∞<font color=orange>설정저장은 이달중 <?=$me['myset'];?>회 남았습니다.</font><br><br> &nbsp;&nbsp;&nbsp;&nbsp;∞<font color=orange>설정저장은 이달중 <?=$me['myset'];?>회 남았습니다.</font><br><br>
@@ -110,10 +110,10 @@ function go(type) {
</tr> </tr>
<tr> <tr>
<td valign=top> <td valign=top>
<?php MyLog($me[no], 24, $me[skin]); ?> <?php MyLog($me['no'], 24, $me['skin']); ?>
</td> </td>
<td valign=top> <td valign=top>
<?php MyBatLog($me[no], 24, $me[skin]); ?> <?php MyBatLog($me['no'], 24, $me['skin']); ?>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -122,10 +122,10 @@ function go(type) {
</tr> </tr>
<tr> <tr>
<td valign=top> <td valign=top>
<?php MyHistory($connect, $me[no], $me[skin]); ?> <?php MyHistory($connect, $me['no'], $me['skin']); ?>
</td> </td>
<td valign=top> <td valign=top>
<?php MyBatRes($me[no], 24, $me[skin]); ?> <?php MyBatRes($me['no'], 24, $me['skin']); ?>
</td> </td>
</tr> </tr>
</table> </table>
+5 -5
View File
@@ -6,11 +6,11 @@ CheckLogin();
$connect = dbConn(); $connect = dbConn();
increaseRefresh($connect, "회의실", 1); increaseRefresh($connect, "회의실", 1);
$query = "select skin,no,nation from general where user_id='$_SESSION[p_id]'"; $query = "select skin,no,nation from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
if($me[skin] < 1) { if($me['skin'] < 1) {
$tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4; $tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4;
$_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000"; $_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000";
} }
@@ -40,16 +40,16 @@ if($me[skin] < 1) {
</table> </table>
<br> <br>
<?php <?php
$nation = getNation($connect, $me[nation]); $nation = getNation($connect, $me['nation']);
//20개 메세지 //20개 메세지
$index = $nation[boardindex]; $index = $nation['boardindex'];
for($i=0; $i < 20; $i++) { for($i=0; $i < 20; $i++) {
$who = "board{$index}_who"; $who = "board{$index}_who";
$query = "select name,picture,imgsvr from general where no='$nation[$who]'"; $query = "select name,picture,imgsvr from general where no='$nation[$who]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
if($nation["board{$index}"] != '') { msgprint($connect, $nation["board{$index}"], $general[name], $general[picture], $general[imgsvr], $nation["board{$index}_when"], $index, 0); } if($nation["board{$index}"] != '') { msgprint($connect, $nation["board{$index}"], $general['name'], $general['picture'], $general['imgsvr'], $nation["board{$index}_when"], $index, 0); }
$index--; $index--;
if($index < 0) { $index = 19; } if($index < 0) { $index = 19; }
} }
+5 -5
View File
@@ -20,23 +20,23 @@ increaseRefresh($connect, "국법", 1);
<tr><td> <tr><td>
<?php <?php
$query = "select no,nation,level from general where user_id='$_SESSION[p_id]'"; $query = "select no,nation,level from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
$query = "select rule from nation where nation='$me[nation]'"; $query = "select rule from nation where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
if($me[level] >= 5) { if($me['level'] >= 5) {
echo " echo "
<form name=form1 method=post action=c_nationrule.php> <form name=form1 method=post action=c_nationrule.php>
<textarea name=msg style=color:white;background-color:black;width:998;height:500;>$nation[rule]</textarea><br> <textarea name=msg style=color:white;background-color:black;width:998;height:500;>$nation['rule']</textarea><br>
<input type=submit value=저장하기> <input type=submit value=저장하기>
</form>"; </form>";
} else { } else {
echo " echo "
<textarea name=msg style=color:white;background-color:black;width:998;height:500; readonly>$nation[rule]</textarea><br>"; <textarea name=msg style=color:white;background-color:black;width:998;height:500; readonly>$nation['rule']</textarea><br>";
} }
?> ?>
+47 -47
View File
@@ -7,7 +7,7 @@ $connect = dbConn();
increaseRefresh($connect, "토너먼트", 1); increaseRefresh($connect, "토너먼트", 1);
checkTurn($connect); checkTurn($connect);
$query = "select no,tournament,userlevel,con,turntime from general where user_id='$_SESSION[p_id]'"; $query = "select no,tournament,userlevel,con,turntime from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
@@ -15,10 +15,10 @@ $query = "select conlimit,tournament,phase,tnmt_msg,tnmt_type,develcost,tnmt_tri
$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);
$con = checkLimit($me[userlevel], $me[con], $admin[conlimit]); $con = checkLimit($me['userlevel'], $me['con'], $admin['conlimit']);
if($con >= 2) { printLimitMsg($me[turntime]); exit(); } if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
switch($admin[tnmt_type]) { switch($admin['tnmt_type']) {
case 0: $tnmt_type = "<font color=cyan>전력전</font>"; $tp = "tot"; $tp2 = "종합"; $tp3 = "total"; break; case 0: $tnmt_type = "<font color=cyan>전력전</font>"; $tp = "tot"; $tp2 = "종합"; $tp3 = "total"; break;
case 1: $tnmt_type = "<font color=cyan>통솔전</font>"; $tp = "ldr"; $tp2 = "통솔"; $tp3 = "leader"; break; case 1: $tnmt_type = "<font color=cyan>통솔전</font>"; $tp = "ldr"; $tp2 = "통솔"; $tp3 = "leader"; break;
case 2: $tnmt_type = "<font color=cyan>일기토</font>"; $tp = "pwr"; $tp2 = "무력"; $tp3 = "power"; break; case 2: $tnmt_type = "<font color=cyan>일기토</font>"; $tp = "pwr"; $tp2 = "무력"; $tp3 = "power"; break;
@@ -50,14 +50,14 @@ select { font-family:'굴림'; line-height:100%; }
</table> </table>
<table align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0> <table align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13;word-break:break-all; id=bg0>
<?php <?php
if($me[userlevel] >= 5) { if($me['userlevel'] >= 5) {
echo " echo "
<form method=post action=c_tournament.php> <form method=post action=c_tournament.php>
<tr><td colspan=8><input type=textarea size=150 style=color:white;background-color:black; name=msg><input type=submit name=btn value='메시지'></td></tr> <tr><td colspan=8><input type=textarea size=150 style=color:white;background-color:black; name=msg><input type=submit name=btn value='메시지'></td></tr>
<tr><td colspan=8> <tr><td colspan=8>
<input type=button value='갱신' onclick='location.reload()'>"; <input type=button value='갱신' onclick='location.reload()'>";
switch($admin[tnmt_trig]) { switch($admin['tnmt_trig']) {
case 0: $sel[0] = "selected"; break; case 0: $sel[0] = "selected"; break;
case 1: $sel[1] = "selected"; break; case 1: $sel[1] = "selected"; break;
case 2: $sel[2] = "selected"; break; case 2: $sel[2] = "selected"; break;
@@ -68,7 +68,7 @@ if($me[userlevel] >= 5) {
case 7: $sel[7] = "selected"; break; case 7: $sel[7] = "selected"; break;
} }
if($admin[tournament] == 0) { if($admin['tournament'] == 0) {
echo " echo "
<select name=auto size=1 style=color:white;background-color:black;> <select name=auto size=1 style=color:white;background-color:black;>
<option style=color:white; value=0>수동진행</option> <option style=color:white; value=0>수동진행</option>
@@ -104,21 +104,21 @@ if($me[userlevel] >= 5) {
echo "<input type=submit name=btn value='중단' onclick='return confirm(\"진짜 중단하시겠습니까?\")'>"; echo "<input type=submit name=btn value='중단' onclick='return confirm(\"진짜 중단하시겠습니까?\")'>";
} }
switch($admin[tournament]) { switch($admin['tournament']) {
case 1: case 1:
echo "<select name=gen size=1 style=color:white;background-color:black;>"; echo "<select name=gen size=1 style=color:white;background-color:black;>";
$query = "select no,name,npc,tnmt,leader,power,intel,leader+power+intel as total from general where tournament=0 and gold>='$admin[develcost]' order by {$tp3} desc"; $query = "select no,name,npc,tnmt,leader,power,intel,leader+power+intel as total from general where tournament=0 and gold>='$admin['develcost']' order by {$tp3} desc";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$genCount = MYDB_num_rows($result); $genCount = MYDB_num_rows($result);
for($i=0; $i < $genCount; $i++) { for($i=0; $i < $genCount; $i++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
if($general[npc] >= 2) { $npc = "cyan"; } if($general['npc'] >= 2) { $npc = "cyan"; }
elseif($general[npc] == 1) { $npc = "skyblue"; } elseif($general['npc'] == 1) { $npc = "skyblue"; }
elseif($general[tnmt] > 0) { $npc = "blue"; } elseif($general['tnmt'] > 0) { $npc = "blue"; }
else { $npc = "white"; } else { $npc = "white"; }
echo "<option style=color:{$npc}; value={$general[no]}>[{$general[$tp3]}]{$general[name]}</option>"; echo "<option style=color:{$npc}; value={$general['no']}>[{$general[$tp3]}]{$general['name']}</option>";
} }
echo " echo "
</select> </select>
@@ -148,17 +148,17 @@ if($me[userlevel] >= 5) {
echo " echo "
</td></tr> </td></tr>
</form>"; </form>";
} elseif($me[no] > 0 && $me[tournament] == 0 && $admin[tournament] == 1) { } elseif($me['no'] > 0 && $me['tournament'] == 0 && $admin['tournament'] == 1) {
echo "<form method=post action=c_tournament.php><tr><td colspan=8><input type=button value='갱신' onclick='location.reload()'><input type=submit name=btn value='참가' onclick='return confirm(\"참가비 금{$admin[develcost]}이 필요합니다. 참가하시겠습니까?\")'></td></tr></form>"; echo "<form method=post action=c_tournament.php><tr><td colspan=8><input type=button value='갱신' onclick='location.reload()'><input type=submit name=btn value='참가' onclick='return confirm(\"참가비 금{$admin['develcost']}이 필요합니다. 참가하시겠습니까?\")'></td></tr></form>";
} else { } else {
echo "<tr><td colspan=8><input type=button value='갱신' onclick='location.reload()'></td></tr>"; echo "<tr><td colspan=8><input type=button value='갱신' onclick='location.reload()'></td></tr>";
} }
$str1 = getTournament($admin[tournament]); $str1 = getTournament($admin['tournament']);
$str2 = getTournamentTime($connect); $str2 = getTournamentTime($connect);
$str3 = getTournamentTerm($connect); $str3 = getTournamentTerm($connect);
?> ?>
<tr><td colspan=8>운영자 메세지 : <font color=orange size=5><?=$admin[tnmt_msg];?></font></td></tr> <tr><td colspan=8>운영자 메세지 : <font color=orange size=5><?=$admin['tnmt_msg'];?></font></td></tr>
<tr><td colspan=8 align=center><font color=white size=6><?=$tnmt_type;?> (<?=$str1.", ".$str2.", ".$str3;?>)</font></td></tr> <tr><td colspan=8 align=center><font color=white size=6><?=$tnmt_type;?> (<?=$str1.", ".$str2.", ".$str3;?>)</font></td></tr>
<tr><td colspan=8 align=center id=bg2><font color=magenta size=5>16강 승자전</font></td></tr> <tr><td colspan=8 align=center id=bg2><font color=magenta size=5>16강 승자전</font></td></tr>
<tr><td height=10 colspan=8 align=center></td></tr> <tr><td height=10 colspan=8 align=center></td></tr>
@@ -174,10 +174,10 @@ $query = "select npc,name,win from tournament where grp>=60 order by grp, grp_no
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
for($i=0; $i < 1; $i++) { for($i=0; $i < 1; $i++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
if($general[name] == "") { $general[name] = "-"; } if($general['name'] == "") { $general['name'] = "-"; }
if($general[npc] >= 2) { $general[name] = "<font color=cyan>".$general[name]."</font>"; } if($general['npc'] >= 2) { $general['name'] = "<font color=cyan>".$general['name']."</font>"; }
elseif($general[npc] == 1) { $general[name] = "<font color=skyblue>".$general[name]."</font>"; } elseif($general['npc'] == 1) { $general['name'] = "<font color=skyblue>".$general['name']."</font>"; }
echo "<td colspan=16>{$general[name]}</td>"; echo "<td colspan=16>{$general['name']}</td>";
} }
echo " echo "
@@ -189,12 +189,12 @@ $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""
for($i=0; $i < 1; $i++) { $cent[$i] = "<font color=white>"; } for($i=0; $i < 1; $i++) { $cent[$i] = "<font color=white>"; }
for($i=0; $i < 2; $i++) { for($i=0; $i < 2; $i++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
if($general[name] == "") { $general[name] = "-"; } if($general['name'] == "") { $general['name'] = "-"; }
if($general[npc] >= 2) { $general[name] = "<font color=cyan>".$general[name]."</font>"; } if($general['npc'] >= 2) { $general['name'] = "<font color=cyan>".$general['name']."</font>"; }
elseif($general[npc] == 1) { $general[name] = "<font color=skyblue>".$general[name]."</font>"; } elseif($general['npc'] == 1) { $general['name'] = "<font color=skyblue>".$general['name']."</font>"; }
if($general[win] > 0) { $line[$i] = "<font color=red>"; $cent[floor($i/2)] = "<font color=red>"; } if($general['win'] > 0) { $line[$i] = "<font color=red>"; $cent[floor($i/2)] = "<font color=red>"; }
else { $line[$i] = "<font color=white>"; } else { $line[$i] = "<font color=white>"; }
$gen[$i] = $general[name]; $gen[$i] = $general['name'];
} }
for($i=0; $i < 1; $i++) { for($i=0; $i < 1; $i++) {
$cent[$i] = $cent[$i]."┻"."</font>"; $cent[$i] = $cent[$i]."┻"."</font>";
@@ -219,12 +219,12 @@ $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""
for($i=0; $i < 2; $i++) { $cent[$i] = "<font color=white>"; } for($i=0; $i < 2; $i++) { $cent[$i] = "<font color=white>"; }
for($i=0; $i < 4; $i++) { for($i=0; $i < 4; $i++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
if($general[name] == "") { $general[name] = "-"; } if($general['name'] == "") { $general['name'] = "-"; }
if($general[npc] >= 2) { $general[name] = "<font color=cyan>".$general[name]."</font>"; } if($general['npc'] >= 2) { $general['name'] = "<font color=cyan>".$general['name']."</font>"; }
elseif($general[npc] == 1) { $general[name] = "<font color=skyblue>".$general[name]."</font>"; } elseif($general['npc'] == 1) { $general['name'] = "<font color=skyblue>".$general['name']."</font>"; }
if($general[win] > 0) { $line[$i] = "<font color=red>"; $cent[floor($i/2)] = "<font color=red>"; } if($general['win'] > 0) { $line[$i] = "<font color=red>"; $cent[floor($i/2)] = "<font color=red>"; }
else { $line[$i] = "<font color=white>"; } else { $line[$i] = "<font color=white>"; }
$gen[$i] = $general[name]; $gen[$i] = $general['name'];
} }
for($i=0; $i < 2; $i++) { for($i=0; $i < 2; $i++) {
$cent[$i] = $cent[$i]."┻"."</font>"; $cent[$i] = $cent[$i]."┻"."</font>";
@@ -249,12 +249,12 @@ $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""
for($i=0; $i < 4; $i++) { $cent[$i] = "<font color=white>"; } for($i=0; $i < 4; $i++) { $cent[$i] = "<font color=white>"; }
for($i=0; $i < 8; $i++) { for($i=0; $i < 8; $i++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
if($general[name] == "") { $general[name] = "-"; } if($general['name'] == "") { $general['name'] = "-"; }
if($general[npc] >= 2) { $general[name] = "<font color=cyan>".$general[name]."</font>"; } if($general['npc'] >= 2) { $general['name'] = "<font color=cyan>".$general['name']."</font>"; }
elseif($general[npc] == 1) { $general[name] = "<font color=skyblue>".$general[name]."</font>"; } elseif($general['npc'] == 1) { $general['name'] = "<font color=skyblue>".$general['name']."</font>"; }
if($general[win] > 0) { $line[$i] = "<font color=red>"; $cent[floor($i/2)] = "<font color=red>"; } if($general['win'] > 0) { $line[$i] = "<font color=red>"; $cent[floor($i/2)] = "<font color=red>"; }
else { $line[$i] = "<font color=white>"; } else { $line[$i] = "<font color=white>"; }
$gen[$i] = $general[name]; $gen[$i] = $general['name'];
} }
for($i=0; $i < 4; $i++) { for($i=0; $i < 4; $i++) {
$cent[$i] = $cent[$i]."┻"."</font>"; $cent[$i] = $cent[$i]."┻"."</font>";
@@ -279,12 +279,12 @@ $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""
for($i=0; $i < 8; $i++) { $cent[$i] = "<font color=white>"; } for($i=0; $i < 8; $i++) { $cent[$i] = "<font color=white>"; }
for($i=0; $i < 16; $i++) { for($i=0; $i < 16; $i++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
if($general[name] == "") { $general[name] = "-"; } if($general['name'] == "") { $general['name'] = "-"; }
if($general[npc] >= 2) { $general[name] = "<font color=cyan>".$general[name]."</font>"; } if($general['npc'] >= 2) { $general['name'] = "<font color=cyan>".$general['name']."</font>"; }
elseif($general[npc] == 1) { $general[name] = "<font color=skyblue>".$general[name]."</font>"; } elseif($general['npc'] == 1) { $general['name'] = "<font color=skyblue>".$general['name']."</font>"; }
if($general[win] > 0) { $line[$i] = "<font color=red>"; $cent[floor($i/2)] = "<font color=red>"; } if($general['win'] > 0) { $line[$i] = "<font color=red>"; $cent[floor($i/2)] = "<font color=red>"; }
else { $line[$i] = "<font color=white>"; } else { $line[$i] = "<font color=white>"; }
$gen[$i] = $general[name]; $gen[$i] = $general['name'];
} }
for($i=0; $i < 8; $i++) { for($i=0; $i < 8; $i++) {
$cent[$i] = $cent[$i]."┻"."</font>"; $cent[$i] = $cent[$i]."┻"."</font>";
@@ -307,7 +307,7 @@ $query = "select tournament,bet0,bet1,bet2,bet3,bet4,bet5,bet6,bet7,bet8,bet9,be
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$betting = MYDB_fetch_array($result); $betting = MYDB_fetch_array($result);
for($i=0; $i < 16; $i++) { for($i=0; $i < 16; $i++) {
$bet[$i] = @round($betting[bet] / $betting["bet{$i}"], 2); $bet[$i] = @round($betting['bet'] / $betting["bet{$i}"], 2);
if($bet[$i] == 0) { $bet[$i] = "∞"; } if($bet[$i] == 0) { $bet[$i] = "∞"; }
} }
@@ -326,7 +326,7 @@ echo "
</td> </td>
</tr>"; </tr>";
if($admin[tournament] >= 7 || $admin[tournament] == 0) { printFighting($admin[tournament], $admin[phase]); } if($admin['tournament'] >= 7 || $admin['tournament'] == 0) { printFighting($admin['tournament'], $admin['phase']); }
echo " echo "
<tr><td height=10 colspan=8 align=center></td></tr> <tr><td height=10 colspan=8 align=center></td></tr>
<tr><td colspan=8 align=center id=bg2><font color=orange size=5>조별 본선 순위</font></td></tr> <tr><td colspan=8 align=center id=bg2><font color=orange size=5>조별 본선 순위</font></td></tr>
@@ -346,14 +346,14 @@ for($i=0; $i < 8; $i++) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
for($k=1; $k <= 4; $k++) { for($k=1; $k <= 4; $k++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
printRow($k, $general[npc], $general[name], $general[$tp], $general[game], $general[win], $general[draw], $general[lose], $general[gd], $general[gl], $general[prmt]); printRow($k, $general['npc'], $general['name'], $general[$tp], $general['game'], $general['win'], $general['draw'], $general['lose'], $general['gd'], $general['gl'], $general['prmt']);
} }
echo " echo "
</table> </table>
</td>"; </td>";
} }
echo "</tr>"; echo "</tr>";
if($admin[tournament] == 4 || $admin[tournament] == 5) { printFighting($admin[tournament], $admin[phase]); } if($admin['tournament'] == 4 || $admin['tournament'] == 5) { printFighting($admin['tournament'], $admin['phase']); }
echo " echo "
<tr><td colspan=8 align=center id=bg2><font color=yellow size=5>조별 예선 순위</font></td></tr> <tr><td colspan=8 align=center id=bg2><font color=yellow size=5>조별 예선 순위</font></td></tr>
<tr>"; <tr>";
@@ -370,14 +370,14 @@ for($i=0; $i < 8; $i++) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
for($k=1; $k <= 8; $k++) { for($k=1; $k <= 8; $k++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
printRow($k, $general[npc], $general[name], $general[$tp], $general[game], $general[win], $general[draw], $general[lose], $general[gd], $general[gl], $general[prmt]); printRow($k, $general['npc'], $general['name'], $general[$tp], $general['game'], $general['win'], $general['draw'], $general['lose'], $general['gd'], $general['gl'], $general['prmt']);
} }
echo " echo "
</table> </table>
</td>"; </td>";
} }
if($admin[tournament] == 2 || $admin[tournament] == 3) { printFighting($admin[tournament], $admin[phase]); } if($admin['tournament'] == 2 || $admin['tournament'] == 3) { printFighting($admin['tournament'], $admin['phase']); }
?> ?>
</tr> </tr>
+21 -21
View File
@@ -6,15 +6,15 @@ CheckLogin();
$connect = dbConn(); $connect = dbConn();
increaseRefresh($connect, "부대편성", 1); increaseRefresh($connect, "부대편성", 1);
$query = "select skin,no,nation,troop from general where user_id='$_SESSION[p_id]'"; $query = "select skin,no,nation,troop from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
$query = "select * from troop where nation='$me[nation]'"; $query = "select * from troop where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$troopcount = MYDB_num_rows($result); $troopcount = MYDB_num_rows($result);
if($me[skin] < 1) { if($me['skin'] < 1) {
$tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4; $tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4;
$_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000"; $_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000";
} }
@@ -45,21 +45,21 @@ for($i=0; $i < $troopcount; $i++) {
$troop = MYDB_fetch_array($result); $troop = MYDB_fetch_array($result);
$genlist = ""; $genlist = "";
$query = "select no,name,picture,imgsvr,turntime,city,turn0,turn1,turn2,turn3,turn4,turn5 from general where troop='$troop[troop]'"; $query = "select no,name,picture,imgsvr,turntime,city,turn0,turn1,turn2,turn3,turn4,turn5 from general where troop='$troop['troop']'";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($genresult); $gencount = MYDB_num_rows($genresult);
for($j=0; $j < $gencount; $j++) { for($j=0; $j < $gencount; $j++) {
$general = MYDB_fetch_array($genresult); $general = MYDB_fetch_array($genresult);
$genlist .= $general[name].", "; $genlist .= $general['name'].", ";
if($troop[no] == $general[no]) { if($troop['no'] == $general['no']) {
$picture = $general[picture]; $picture = $general['picture'];
$imageTemp = GetImageURL($general[imgsvr]); $imageTemp = GetImageURL($general['imgsvr']);
$name = $general[name]; $name = $general['name'];
$turntime = $general[turntime]; $turntime = $general['turntime'];
$query = "select name from city where city='$general[city]'"; $query = "select name from city where city='$general['city']'";
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$city = MYDB_fetch_array($cityresult); $city = MYDB_fetch_array($cityresult);
$cityname = $city[name]; $cityname = $city['name'];
$turn = ""; $turn = "";
for($k=0; $k < 5; $k++) { for($k=0; $k < 5; $k++) {
$m = $k+1; $m = $k+1;
@@ -73,11 +73,11 @@ for($i=0; $i < $troopcount; $i++) {
} }
$genlist .= "({$gencount}명)"; $genlist .= "({$gencount}명)";
if($me[troop] == 0) { if($me['troop'] == 0) {
echo " echo "
<tr> <tr>
<td align=center rowspan=2><input "; echo $i==0?"checked ":""; echo "type=radio name=troop value='{$troop[troop]}'></td> <td align=center rowspan=2><input "; echo $i==0?"checked ":""; echo "type=radio name=troop value='{$troop['troop']}'></td>
<td align=center >$troop[name]<br>【 $cityname 】</td> <td align=center >$troop['name']<br>【 $cityname 】</td>
<td height=64 background={$imageTemp}/{$picture}>&nbsp;</td> <td height=64 background={$imageTemp}/{$picture}>&nbsp;</td>
<td rowspan=2 width=662>$genlist</td> <td rowspan=2 width=662>$genlist</td>
<td rowspan=2>$turn</td> <td rowspan=2>$turn</td>
@@ -88,13 +88,13 @@ for($i=0; $i < $troopcount; $i++) {
echo " echo "
<tr> <tr>
<td align=center rowspan=2>&nbsp;</td> <td align=center rowspan=2>&nbsp;</td>
<td align=center >$troop[name]<br>【 $cityname 】</td> <td align=center >$troop['name']<br>【 $cityname 】</td>
<td height=64 background={$imageTemp}/{$picture}>&nbsp;</td> <td height=64 background={$imageTemp}/{$picture}>&nbsp;</td>
<td rowspan=2 width=662>$genlist</td> <td rowspan=2 width=662>$genlist</td>
<td rowspan=2>"; <td rowspan=2>";
if($troop[no] == $me[no]) { if($troop['no'] == $me['no']) {
$query = "select no,name from general where troop='$troop[troop]' and no!='$me[no]' order by binary(name)"; $query = "select no,name from general where troop='$troop['troop']' and no!='$me['no']' order by binary(name)";
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$genCount = MYDB_num_rows($genresult); $genCount = MYDB_num_rows($genresult);
echo " echo "
@@ -102,7 +102,7 @@ for($i=0; $i < $troopcount; $i++) {
for($k=0; $k < $genCount; $k++) { for($k=0; $k < $genCount; $k++) {
$general = MYDB_fetch_array($genresult); $general = MYDB_fetch_array($genresult);
echo " echo "
<option value=$general[no]>$general[name]</option>"; <option value=$general['no']>$general['name']</option>";
} }
echo " echo "
</select><br> </select><br>
@@ -119,7 +119,7 @@ for($i=0; $i < $troopcount; $i++) {
} }
} }
if($me[troop] == 0) { if($me['troop'] == 0) {
echo" echo"
<input type=submit name=btn value='부 대 가 입'>"; <input type=submit name=btn value='부 대 가 입'>";
} else { } else {
@@ -137,7 +137,7 @@ echo "
<tr> <tr>
<td width=80 id=bg1>부 대 명</td> <td width=80 id=bg1>부 대 명</td>
<td width=100><input type=text style=color:white;background-color:black; size=12 maxlength=6 name=name></td>"; <td width=100><input type=text style=color:white;background-color:black; size=12 maxlength=6 name=name></td>";
if($me[troop] == 0) { if($me['troop'] == 0) {
echo " echo "
<td><input type=submit name=btn value='부 대 창 설'></td>"; <td><input type=submit name=btn value='부 대 창 설'></td>";
} else { } else {
+25 -25
View File
@@ -10,21 +10,21 @@ $query = "select turnterm 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);
$query = "select no,name,gold,rice,special,userlevel from general where user_id='$_SESSION[p_id]'"; $query = "select no,name,gold,rice,special,userlevel from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
$query = "select no from auction where no1='$me[no]'"; $query = "select no from auction where no1='$me['no']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$tradeCount = MYDB_num_rows($result); $tradeCount = MYDB_num_rows($result);
$query = "select no from auction where no2='$me[no]'"; $query = "select no from auction where no2='$me['no']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$bidCount = MYDB_num_rows($result); $bidCount = MYDB_num_rows($result);
$btCount = $tradeCount + $bidCount; $btCount = $tradeCount + $bidCount;
switch($admin[turnterm]) { switch($admin['turnterm']) {
case 0: $unit = 7200; break; case 0: $unit = 7200; break;
case 1: $unit = 3600; break; case 1: $unit = 3600; break;
case 2: $unit = 1800; break; case 2: $unit = 1800; break;
@@ -42,7 +42,7 @@ $value = round($value / 10) * 10;
if($term > 24) $term = 24; if($term > 24) $term = 24;
$valid = 1; $valid = 1;
if($me[userlevel] >= 5 || ($me[special] != 30 && $btCount < 1) || ($me[special] == 30 && $btCount < 3)) { if($me['userlevel'] >= 5 || ($me['special'] != 30 && $btCount < 1) || ($me['special'] == 30 && $btCount < 3)) {
} else { } else {
$msg = "ㆍ<O>더이상 등록할 수 없습니다.</>"; $msg = "ㆍ<O>더이상 등록할 수 없습니다.</>";
$msg2 = "ㆍ<O>더이상 등록할 수 없습니다.</>"; $msg2 = "ㆍ<O>더이상 등록할 수 없습니다.</>";
@@ -75,14 +75,14 @@ if($btn == "판매") {
$msg = "ㆍ<O>즉시판매가는 시작판매가의 110% 이상이어야 합니다.</>"; $msg = "ㆍ<O>즉시판매가는 시작판매가의 110% 이상이어야 합니다.</>";
$valid = 0; $valid = 0;
} }
if($amount > $me[rice] - 1000) { if($amount > $me['rice'] - 1000) {
$msg = "ㆍ<O>기본 군량 1000은 거래할 수 없습니다.</>"; $msg = "ㆍ<O>기본 군량 1000은 거래할 수 없습니다.</>";
$valid = 0; $valid = 0;
} }
if($valid == 1) { if($valid == 1) {
$msg = "ㆍ<O>등록 성공.</>"; $msg = "ㆍ<O>등록 성공.</>";
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit * $term); $date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit * $term);
$query = "insert into auction (type, no1, name1, stuff, amount, cost, value, topv, expire) values (0, '$me[no]', '$me[name]', '$stuff', '$amount', '$cost', '$cost', '$topv', '$date')"; $query = "insert into auction (type, no1, name1, stuff, amount, cost, value, topv, expire) values (0, '$me['no']', '$me['name']', '$stuff', '$amount', '$cost', '$cost', '$topv', '$date')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
} elseif($btn == "구매시도") { } elseif($btn == "구매시도") {
@@ -90,7 +90,7 @@ if($btn == "판매") {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$auction = MYDB_fetch_array($result); $auction = MYDB_fetch_array($result);
if($value == $auction[topv]) { if($value == $auction['topv']) {
$valid = 2; $valid = 2;
} }
if(!$auction) { if(!$auction) {
@@ -103,32 +103,32 @@ if($btn == "판매") {
$valid = 0; $valid = 0;
} }
*/ */
if($auction[no2] > 0 && $value <= $auction[value]) { if($auction[no2] > 0 && $value <= $auction['value']) {
$msg = "ㆍ<O>현재판매가보다 높게 입찰해야 합니다.</>"; $msg = "ㆍ<O>현재판매가보다 높게 입찰해야 합니다.</>";
$valid = 0; $valid = 0;
} }
if($value < $auction[value]) { if($value < $auction['value']) {
$msg = "ㆍ<O>현재판매가보다 높게 입찰해야 합니다.</>"; $msg = "ㆍ<O>현재판매가보다 높게 입찰해야 합니다.</>";
$valid = 0; $valid = 0;
} }
if($value > $auction[topv]) { if($value > $auction['topv']) {
$msg = "ㆍ<O>즉시판매가보다 높을 수 없습니다.</>"; $msg = "ㆍ<O>즉시판매가보다 높을 수 없습니다.</>";
$valid = 0; $valid = 0;
} }
if($value > $me[gold] - 1000) { if($value > $me['gold'] - 1000) {
$msg = "ㆍ<O>기본 자금 1000은 거래할 수 없습니다.</>"; $msg = "ㆍ<O>기본 자금 1000은 거래할 수 없습니다.</>";
$valid = 0; $valid = 0;
} }
if($valid == 1) { if($valid == 1) {
$msg = "ㆍ<O>입찰 성공.</> 거래완료는 빨라도 현재로부터 1턴 뒤입니다."; $msg = "ㆍ<O>입찰 성공.</> 거래완료는 빨라도 현재로부터 1턴 뒤입니다.";
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit); $date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit);
if($auction[expire] > $date) $date = $auction[expire]; if($auction['expire'] > $date) $date = $auction['expire'];
$query = "update auction set value='$value',no2='$me[no]',name2='$me[name]',expire='$date' where no='$sel'"; $query = "update auction set value='$value',no2='$me['no']',name2='$me['name']',expire='$date' where no='$sel'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($valid == 2) { } elseif($valid == 2) {
$msg = "ㆍ<O>즉시판매 성공.</> 거래완료는 빨라도 현재로부터 1턴 뒤입니다."; $msg = "ㆍ<O>즉시판매 성공.</> 거래완료는 빨라도 현재로부터 1턴 뒤입니다.";
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit); $date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit);
$query = "update auction set value='$value',no2='$me[no]',name2='$me[name]',expire='$date' where no='$sel'"; $query = "update auction set value='$value',no2='$me['no']',name2='$me['name']',expire='$date' where no='$sel'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
} elseif($btn == "구매") { } elseif($btn == "구매") {
@@ -156,14 +156,14 @@ if($btn == "판매") {
$msg2 = "ㆍ<O>즉시구매가는 시작구매가의 90% 이하이어야 합니다.</>"; $msg2 = "ㆍ<O>즉시구매가는 시작구매가의 90% 이하이어야 합니다.</>";
$valid = 0; $valid = 0;
} }
if($cost > $me[gold] - 1000) { if($cost > $me['gold'] - 1000) {
$msg2 = "ㆍ<O>기본 자금 1000은 거래할 수 없습니다.</>"; $msg2 = "ㆍ<O>기본 자금 1000은 거래할 수 없습니다.</>";
$valid = 0; $valid = 0;
} }
if($valid == 1) { if($valid == 1) {
$msg2 = "ㆍ<O>등록 성공.</>"; $msg2 = "ㆍ<O>등록 성공.</>";
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit * $term); $date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit * $term);
$query = "insert into auction (type, no1, name1, stuff, amount, cost, value, topv, expire) values (1, '$me[no]', '$me[name]', '$stuff', '$amount', '$cost', '$cost', '$topv', '$date')"; $query = "insert into auction (type, no1, name1, stuff, amount, cost, value, topv, expire) values (1, '$me['no']', '$me['name']', '$stuff', '$amount', '$cost', '$cost', '$topv', '$date')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
} elseif($btn == "판매시도") { } elseif($btn == "판매시도") {
@@ -171,7 +171,7 @@ if($btn == "판매") {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$auction = MYDB_fetch_array($result); $auction = MYDB_fetch_array($result);
if($value == $auction[topv]) { if($value == $auction['topv']) {
$valid = 2; $valid = 2;
} }
if(!$auction) { if(!$auction) {
@@ -182,32 +182,32 @@ if($btn == "판매") {
$msg2 = "ㆍ<O>현재 쌀만 거래 가능합니다.</>"; $msg2 = "ㆍ<O>현재 쌀만 거래 가능합니다.</>";
$valid = 0; $valid = 0;
} }
if($auction[no2] > 0 && $value >= $auction[value]) { if($auction[no2] > 0 && $value >= $auction['value']) {
$msg2 = "ㆍ<O>현재구매가보다 낮게 입찰해야 합니다.</>"; $msg2 = "ㆍ<O>현재구매가보다 낮게 입찰해야 합니다.</>";
$valid = 0; $valid = 0;
} }
if($value > $auction[value]) { if($value > $auction['value']) {
$msg2 = "ㆍ<O>현재구매가보다 낮게 입찰해야 합니다.</>"; $msg2 = "ㆍ<O>현재구매가보다 낮게 입찰해야 합니다.</>";
$valid = 0; $valid = 0;
} }
if($value < $auction[topv]) { if($value < $auction['topv']) {
$msg2 = "ㆍ<O>즉시구매가보다 낮을 수 없습니다.</>"; $msg2 = "ㆍ<O>즉시구매가보다 낮을 수 없습니다.</>";
$valid = 0; $valid = 0;
} }
if($value > $me[rice] - 1000) { if($value > $me['rice'] - 1000) {
$msg2 = "ㆍ<O>기본 군량 1000은 거래할 수 없습니다.</>"; $msg2 = "ㆍ<O>기본 군량 1000은 거래할 수 없습니다.</>";
$valid = 0; $valid = 0;
} }
if($valid == 1) { if($valid == 1) {
$msg2 = "ㆍ<O>입찰 성공.</> 거래완료는 빨라도 현재로부터 1턴 뒤입니다."; $msg2 = "ㆍ<O>입찰 성공.</> 거래완료는 빨라도 현재로부터 1턴 뒤입니다.";
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit); $date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit);
if($auction[expire] > $date) $date = $auction[expire]; if($auction['expire'] > $date) $date = $auction['expire'];
$query = "update auction set value='$value',no2='$me[no]',name2='$me[name]',expire='$date' where no='$sel'"; $query = "update auction set value='$value',no2='$me['no']',name2='$me['name']',expire='$date' where no='$sel'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($valid == 2) { } elseif($valid == 2) {
$msg2 = "ㆍ<O>즉시구매 성공.</> 거래완료는 빨라도 현재로부터 1턴 뒤입니다."; $msg2 = "ㆍ<O>즉시구매 성공.</> 거래완료는 빨라도 현재로부터 1턴 뒤입니다.";
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit); $date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit);
$query = "update auction set value='$value',no2='$me[no]',name2='$me[name]',expire='$date' where no='$sel'"; $query = "update auction set value='$value',no2='$me['no']',name2='$me['name']',expire='$date' where no='$sel'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
} }
+4 -4
View File
@@ -12,12 +12,12 @@ $query = "select tournament,phase,tnmt_type,develcost 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);
if($admin[tournament] != 6) { if($admin['tournament'] != 6) {
echo "<script>location.replace('b_betting.php');</script>"; echo "<script>location.replace('b_betting.php');</script>";
exit(); exit();
} }
$query = "select gold,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 general where user_id='$_SESSION[p_id]'"; $query = "select gold,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 general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
@@ -26,8 +26,8 @@ for($i=0; $i < 16; $i++) {
$gold = ${"gold{$i}"}; $gold = ${"gold{$i}"};
$mebet = $me["bet{$i}"]; $mebet = $me["bet{$i}"];
if($gold >= 10 && $gold <= 1000) { if($gold >= 10 && $gold <= 1000) {
if($gold + 500 <= $me[gold] && $gold + $mebet <= 1000 && $gold + $me[bet] <= 1000) { if($gold + 500 <= $me['gold'] && $gold + $mebet <= 1000 && $gold + $me['bet'] <= 1000) {
$query = "update general set gold=gold-'$gold',bet{$i}=bet{$i}+'$gold',betgold=betgold+'$gold' where user_id='$_SESSION[p_id]'"; $query = "update general set gold=gold-'$gold',bet{$i}=bet{$i}+'$gold',betgold=betgold+'$gold' where user_id='$_SESSION['p_id']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update game set bet{$i}=bet{$i}+'$gold' where no='1'"; $query = "update game set bet{$i}=bet{$i}+'$gold' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
+7 -7
View File
@@ -8,7 +8,7 @@ CheckLogin();
$connect = dbConn(); $connect = dbConn();
if(CheckBlock($connect) != 1 && CheckBlock($connect) != 3) { if(CheckBlock($connect) != 1 && CheckBlock($connect) != 3) {
$query = "select no,nation from general where user_id='$_SESSION[p_id]'"; $query = "select no,nation from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
@@ -19,25 +19,25 @@ if(CheckBlock($connect) != 1 && CheckBlock($connect) != 3) {
$msg = trim($msg); $msg = trim($msg);
$reply = trim($reply); $reply = trim($reply);
$nation = getNation($connect, $me[nation]); $nation = getNation($connect, $me['nation']);
//새글 추가시 //새글 추가시
if($num == -1 && $title != "" && $msg != "") { if($num == -1 && $title != "" && $msg != "") {
$num = $nation[coreindex] + 1; $num = $nation['coreindex'] + 1;
if($num >= 20) { $num = 0; } if($num >= 20) { $num = 0; }
$msg = $title."|".$msg; $msg = $title."|".$msg;
$msg = addslashes(SQ2DQ($msg)); $msg = addslashes(SQ2DQ($msg));
$date = date('Y-m-d H:i:s'); $date = date('Y-m-d H:i:s');
$query = "update nation set coreboard{$num}='$msg',coreboard{$num}_who='$me[no]',coreboard{$num}_when='$date' where nation='$me[nation]'"; $query = "update nation set coreboard{$num}='$msg',coreboard{$num}_who='$me['no']',coreboard{$num}_when='$date' where nation='$me['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update nation set coreindex='$num' where nation='$me[nation]'"; $query = "update nation set coreindex='$num' where nation='$me['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//$num에 댓글시 //$num에 댓글시
} elseif($num >= 0 && $reply != "") { } elseif($num >= 0 && $reply != "") {
$newmsg = $nation["coreboard{$num}"]."|".$me[no]."|".$reply; $newmsg = $nation["coreboard{$num}"]."|".$me['no']."|".$reply;
$newmsg = addslashes(SQ2DQ($newmsg)); $newmsg = addslashes(SQ2DQ($newmsg));
$query = "update nation set coreboard{$num}='$newmsg' where nation='$me[nation]'"; $query = "update nation set coreboard{$num}='$newmsg' where nation='$me['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
} }
+12 -12
View File
@@ -7,52 +7,52 @@ include "func.php";
CheckLogin(); CheckLogin();
$connect = dbConn(); $connect = dbConn();
$query = "select no,nation,level from general where user_id='$_SESSION[p_id]'"; $query = "select no,nation,level from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
$btn = $_POST[btn]; $btn = $_POST['btn'];
//내가 수뇌부이어야함 //내가 수뇌부이어야함
if($me[level] < 5) { if($me['level'] < 5) {
echo "<script>location.replace('b_myBossInfo.php');</script>"; echo "<script>location.replace('b_myBossInfo.php');</script>";
exit(); exit();
} }
if($btn == "국가방침") { if($btn == "국가방침") {
$msg = BadTag2Code(addslashes(SQ2DQ($msg))); $msg = BadTag2Code(addslashes(SQ2DQ($msg)));
$query = "update nation set msg='$msg' where nation='$me[nation]'"; $query = "update nation set msg='$msg' where nation='$me['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "임관권유") { } elseif($btn == "임관권유") {
$scoutmsg = BadTag2Code(addslashes(SQ2DQ($scoutmsg))); $scoutmsg = BadTag2Code(addslashes(SQ2DQ($scoutmsg)));
$query = "update nation set scoutmsg='$scoutmsg' where nation='$me[nation]'"; $query = "update nation set scoutmsg='$scoutmsg' where nation='$me['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "세율") { } elseif($btn == "세율") {
if($rate < 5) { $rate = 5; } if($rate < 5) { $rate = 5; }
if($rate > 30) { $rate = 30; } if($rate > 30) { $rate = 30; }
$query = "update nation set rate='$rate' where nation='$me[nation]'"; $query = "update nation set rate='$rate' where nation='$me['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "지급율") { } elseif($btn == "지급율") {
if($bill < 20) { $bill = 20; } if($bill < 20) { $bill = 20; }
if($bill > 200) { $bill = 200; } if($bill > 200) { $bill = 200; }
$query = "update nation set bill='$bill' where nation='$me[nation]'"; $query = "update nation set bill='$bill' where nation='$me['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "기밀권한") { } elseif($btn == "기밀권한") {
if($secretlimit < 1) { $secretlimit = 1; } if($secretlimit < 1) { $secretlimit = 1; }
if($secretlimit > 99) { $secretlimit = 99; } if($secretlimit > 99) { $secretlimit = 99; }
$query = "update nation set secretlimit='$secretlimit' where nation='$me[nation]'"; $query = "update nation set secretlimit='$secretlimit' where nation='$me['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "임관 금지") { } elseif($btn == "임관 금지") {
$query = "update nation set myset=myset-1,scout='1' where nation='$me[nation]' and myset>0"; $query = "update nation set myset=myset-1,scout='1' where nation='$me['nation']' and myset>0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "임관 허가") { } elseif($btn == "임관 허가") {
$query = "update nation set myset=myset-1,scout='0' where nation='$me[nation]' and myset>0"; $query = "update nation set myset=myset-1,scout='0' where nation='$me['nation']' and myset>0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "전쟁 금지") { } elseif($btn == "전쟁 금지") {
$query = "update nation set myset=myset-1,war='1' where nation='$me[nation]' and myset>0"; $query = "update nation set myset=myset-1,war='1' where nation='$me['nation']' and myset>0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "전쟁 허가") { } elseif($btn == "전쟁 허가") {
$query = "update nation set myset=myset-1,war='0' where nation='$me[nation]' and myset>0"; $query = "update nation set myset=myset-1,war='0' where nation='$me['nation']' and myset>0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
+18 -18
View File
@@ -30,7 +30,7 @@ if($command == 46) {
if($name == "") { $name = "무명"; } if($name == "") { $name = "무명"; }
$name = _String::SubStrForWidth($name, 0, 12); $name = _String::SubStrForWidth($name, 0, 12);
$query = "update general set makenation='{$name}' where user_id='$_SESSION[p_id]'"; $query = "update general set makenation='{$name}' where user_id='$_SESSION['p_id']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = sizeof($turn); $count = sizeof($turn);
@@ -38,16 +38,16 @@ if($command == 46) {
for($i=0; $i < $count; $i++) { for($i=0; $i < $count; $i++) {
$str .= ",turn{$turn[$i]}='{$comStr}'"; $str .= ",turn{$turn[$i]}='{$comStr}'";
} }
$query = "update general set {$str} where user_id='$_SESSION[p_id]'"; $query = "update general set {$str} where user_id='$_SESSION['p_id']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
echo "<script>location.replace('main.php');</script>"; echo "<script>location.replace('main.php');</script>";
//통합제의 //통합제의
} elseif($command == 53) { } elseif($command == 53) {
$query = "select nation,level from general where user_id='$_SESSION[p_id]'"; $query = "select nation,level from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
if($me[level] >= 5) { if($me['level'] >= 5) {
$nationname = addslashes(SQ2DQ($nationname)); $nationname = addslashes(SQ2DQ($nationname));
$nationname = str_replace("|", "", $nationname); $nationname = str_replace("|", "", $nationname);
$nationname = str_replace(" ", "", $nationname); $nationname = str_replace(" ", "", $nationname);
@@ -55,40 +55,40 @@ if($command == 46) {
if($nationname == "") { $nationname = "무명"; } if($nationname == "") { $nationname = "무명"; }
$nationname = _String::SubStrForWidth($nationname, 0, 12); $nationname = _String::SubStrForWidth($nationname, 0, 12);
$query = "update general set makenation='{$nationname}' where level>=5 and nation='$me[nation]'"; $query = "update general set makenation='{$nationname}' where level>=5 and nation='$me['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = sizeof($turn); $count = sizeof($turn);
$str = "type=type"; $str = "type=type";
for($i=0; $i < $count; $i++) { for($i=0; $i < $count; $i++) {
$str .= ",l{$me[level]}turn{$turn[$i]}='{$comStr}'"; $str .= ",l{$me['level']}turn{$turn[$i]}='{$comStr}'";
} }
$query = "update nation set {$str} where nation='$me[nation]'"; $query = "update nation set {$str} where nation='$me['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
echo "<script>location.replace('b_chiefcenter.php');</script>"; echo "<script>location.replace('b_chiefcenter.php');</script>";
//불가침 //불가침
} elseif($command == 61) { } elseif($command == 61) {
$query = "select nation,level from general where user_id='$_SESSION[p_id]'"; $query = "select nation,level from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
if($me[level] >= 5) { if($me['level'] >= 5) {
$note = addslashes(SQ2DQ($note)); $note = addslashes(SQ2DQ($note));
$note = str_replace("|", "", $note); $note = str_replace("|", "", $note);
$note = str_replace(" ", "", $note); $note = str_replace(" ", "", $note);
$note = str_replace(" ", "", $note); $note = str_replace(" ", "", $note);
$note = _String::SubStrForWidth($note, 0, 90); $note = _String::SubStrForWidth($note, 0, 90);
$query = "update diplomacy set reserved='{$note}' where me='$me[nation]' and you='$double'"; $query = "update diplomacy set reserved='{$note}' where me='$me['nation']' and you='$double'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = sizeof($turn); $count = sizeof($turn);
$str = "type=type"; $str = "type=type";
for($i=0; $i < $count; $i++) { for($i=0; $i < $count; $i++) {
$str .= ",l{$me[level]}turn{$turn[$i]}='{$comStr}'"; $str .= ",l{$me['level']}turn{$turn[$i]}='{$comStr}'";
} }
$query = "update nation set {$str} where nation='$me[nation]'"; $query = "update nation set {$str} where nation='$me['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
echo "<script>location.replace('b_chiefcenter.php');</script>"; echo "<script>location.replace('b_chiefcenter.php');</script>";
@@ -97,19 +97,19 @@ if($command == 46) {
//백성동원, 수몰, 허보, 피장파장, 의병모집, 이호경식, 급습 //백성동원, 수몰, 허보, 피장파장, 의병모집, 이호경식, 급습
//국기변경 //국기변경
} elseif($command == 23 || $command == 24 || $command == 27 || $command == 51 || $command == 52 || $command > 60) { } elseif($command == 23 || $command == 24 || $command == 27 || $command == 51 || $command == 52 || $command > 60) {
$query = "select no,nation,level from general where user_id='$_SESSION[p_id]'"; $query = "select no,nation,level from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
if(($command == 23 || $command == 24 || $command == 27) && $me[no] == $third) { if(($command == 23 || $command == 24 || $command == 27) && $me['no'] == $third) {
// 자기자신에게 악용 금지 // 자기자신에게 악용 금지
} elseif($me[level] >= 5) { } elseif($me['level'] >= 5) {
$count = sizeof($turn); $count = sizeof($turn);
$str = "type=type"; $str = "type=type";
for($i=0; $i < $count; $i++) { for($i=0; $i < $count; $i++) {
$str .= ",l{$me[level]}turn{$turn[$i]}='{$comStr}'"; $str .= ",l{$me['level']}turn{$turn[$i]}='{$comStr}'";
} }
$query = "update nation set {$str} where nation='$me[nation]'"; $query = "update nation set {$str} where nation='$me['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
echo "<script>location.replace('b_chiefcenter.php');</script>"; echo "<script>location.replace('b_chiefcenter.php');</script>";
@@ -119,7 +119,7 @@ if($command == 46) {
for($i=0; $i < $count; $i++) { for($i=0; $i < $count; $i++) {
$str .= ",turn{$turn[$i]}='{$comStr}'"; $str .= ",turn{$turn[$i]}='{$comStr}'";
} }
$query = "update general set {$str} where user_id='$_SESSION[p_id]'"; $query = "update general set {$str} where user_id='$_SESSION['p_id']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
echo "<script>location.replace('main.php');</script>"; echo "<script>location.replace('main.php');</script>";
} }
+31 -31
View File
@@ -17,11 +17,11 @@ $query = "select conlimit 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);
$query = "select no,name,nation,level,msgindex,userlevel,con,picture,imgsvr from general where user_id='$_SESSION[p_id]'"; $query = "select no,name,nation,level,msgindex,userlevel,con,picture,imgsvr from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
$con = checkLimit($me[userlevel], $me[con], $admin[conlimit]); $con = checkLimit($me['userlevel'], $me['con'], $admin['conlimit']);
if($con >= 2) { echo "<script>window.top.main.location.replace('main.php');</script>"; exit(); } if($con >= 2) { echo "<script>window.top.main.location.replace('main.php');</script>"; exit(); }
$msg = str_replace("|", "", $msg); $msg = str_replace("|", "", $msg);
@@ -33,22 +33,22 @@ $date = date('Y-m-d H:i:s');
// 전체 메세지 // 전체 메세지
if($genlist == 9999 && str_replace(" ", "", $msg) != "") { if($genlist == 9999 && str_replace(" ", "", $msg) != "") {
if($me[nation] == 0) { if($me['nation'] == 0) {
$nation[name] = '재야'; $nation['name'] = '재야';
$nation[color] = 'FFFFFF'; $nation['color'] = 'FFFFFF';
} else { } else {
$query = "select nation,name,color from nation where nation='$me[nation]'"; $query = "select nation,name,color from nation where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
} }
PushMsg(1, 0, $me[picture], $me[imgsvr], "{$me[name]}:", $nation[color], $nation[name], $nation[color], $msg); PushMsg(1, 0, $me['picture'], $me['imgsvr'], "{$me['name']}:", $nation['color'], $nation['name'], $nation['color'], $msg);
// 국가 메세지 // 국가 메세지
} elseif($genlist >= 9000 && $msg != "") { } elseif($genlist >= 9000 && $msg != "") {
if($me[nation] == 0) { if($me['nation'] == 0) {
$nation[name] = '재야'; $nation['name'] = '재야';
$nation[color] = 'FFFFFF'; $nation['color'] = 'FFFFFF';
} else { } else {
$query = "select nation,name,color from nation where nation='$me[nation]'"; $query = "select nation,name,color from nation where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
} }
@@ -58,16 +58,16 @@ if($genlist == 9999 && str_replace(" ", "", $msg) != "") {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dest = MYDB_fetch_array($result); $dest = MYDB_fetch_array($result);
if($nation[nation] == $dest[nation]) { if($nation['nation'] == $dest['nation']) {
PushMsg(2, $nation[nation], $me[picture], $me[imgsvr], "{$me[name]}:", $nation[color], $dest[name], $dest[color], $msg); PushMsg(2, $nation['nation'], $me['picture'], $me['imgsvr'], "{$me['name']}:", $nation['color'], $dest['name'], $dest['color'], $msg);
} else { } else {
//타국에 보내는 경우 //타국에 보내는 경우
PushMsg(2, $nation[nation], $me[picture], $me[imgsvr], "{$me[name]}:{$nation[name]}", $nation[color], $dest[name], $dest[color], $msg); PushMsg(2, $nation['nation'], $me['picture'], $me['imgsvr'], "{$me['name']}:{$nation['name']}", $nation['color'], $dest['name'], $dest['color'], $msg);
// 수뇌이면 발송, 아니면 자국으로 돌림 // 수뇌이면 발송, 아니면 자국으로 돌림
if($me[level] >= 5) { if($me['level'] >= 5) {
PushMsg(3, $dest[nation], $me[picture], $me[imgsvr], "{$me[name]}:{$nation[name]}", $nation[color], $dest[name], $dest[color], $msg); PushMsg(3, $dest['nation'], $me['picture'], $me['imgsvr'], "{$me['name']}:{$nation['name']}", $nation['color'], $dest['name'], $dest['color'], $msg);
} else { } else {
PushMsg(2, $nation[nation], $me[picture], $me[imgsvr], "{$me[name]}:{$nation[name]}", $nation[color], $dest[name], $dest[color], "반송"); PushMsg(2, $nation['nation'], $me['picture'], $me['imgsvr'], "{$me['name']}:{$nation['name']}", $nation['color'], $dest['name'], $dest['color'], "반송");
} }
} }
// 개인 메세지 // 개인 메세지
@@ -76,40 +76,40 @@ if($genlist == 9999 && str_replace(" ", "", $msg) != "") {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result); $you = MYDB_fetch_array($result);
//발신, 수신인 코딩 //발신, 수신인 코딩
$who = $me[no] * 10000 + $genlist; $who = $me['no'] * 10000 + $genlist;
$msg = addslashes(SQ2DQ($msg)); $msg = addslashes(SQ2DQ($msg));
$query = "select msg{$me[msgindex]}_when as priv_when from general where no='$me[no]'"; $query = "select msg{$me['msgindex']}_when as priv_when from general where no='$me['no']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$prev_msg = MYDB_fetch_array($result); $prev_msg = MYDB_fetch_array($result);
$diff_second = strtotime($date) - strtotime($prev_msg[priv_when]); $diff_second = strtotime($date) - strtotime($prev_msg['priv_when']);
if($diff_second < 3) { if($diff_second < 3) {
$who = 1 * 10000 + $me[no]; // 운영자가 본인에게 $who = 1 * 10000 + $me['no']; // 운영자가 본인에게
$msg = "개인메세지는 3초당 1건만 보낼 수 있습니다!"; $msg = "개인메세지는 3초당 1건만 보낼 수 있습니다!";
//자신에게 표시 //자신에게 표시
$me[msgindex]++; $me['msgindex']++;
if($me[msgindex] >= 10) { $me[msgindex] = 0; } if($me['msgindex'] >= 10) { $me['msgindex'] = 0; }
$query = "update general set msgindex='$me[msgindex]',msg{$me[msgindex]}='$msg',msg{$me[msgindex]}_type='10',msg{$me[msgindex]}_who='$who',msg{$me[msgindex]}_when='$date',newmsg=1 where no='$me[no]'"; $query = "update general set msgindex='$me['msgindex']',msg{$me['msgindex']}='$msg',msg{$me['msgindex']}_type='10',msg{$me['msgindex']}_who='$who',msg{$me['msgindex']}_when='$date',newmsg=1 where no='$me['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else { } else {
//자신에게 표시 //자신에게 표시
$me[msgindex]++; $me['msgindex']++;
if($me[msgindex] >= 10) { $me[msgindex] = 0; } if($me['msgindex'] >= 10) { $me['msgindex'] = 0; }
$query = "update general set msgindex='$me[msgindex]',msg{$me[msgindex]}='$msg',msg{$me[msgindex]}_type='9',msg{$me[msgindex]}_who='$who',msg{$me[msgindex]}_when='$date' where no='$me[no]'"; $query = "update general set msgindex='$me['msgindex']',msg{$me['msgindex']}='$msg',msg{$me['msgindex']}_type='9',msg{$me['msgindex']}_who='$who',msg{$me['msgindex']}_when='$date' where no='$me['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 상대에게 발송 // 상대에게 발송
$you[msgindex]++; $you['msgindex']++;
if($you[msgindex] >= 10) { $you[msgindex] = 0; } if($you['msgindex'] >= 10) { $you['msgindex'] = 0; }
$query = "update general set msgindex='$you[msgindex]',msg{$you[msgindex]}='$msg',msg{$you[msgindex]}_type='10',msg{$you[msgindex]}_who='$who',msg{$you[msgindex]}_when='$date',newmsg=1 where no='$genlist'"; $query = "update general set msgindex='$you['msgindex']',msg{$you['msgindex']}='$msg',msg{$you['msgindex']}_type='10',msg{$you['msgindex']}_who='$who',msg{$you['msgindex']}_when='$date',newmsg=1 where no='$genlist'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
$fp = fopen("logs/_gen_msg.txt", "a"); $fp = fopen("logs/_gen_msg.txt", "a");
//로그 파일에 기록 //로그 파일에 기록
fwrite($fp, _String::Fill($me[name],12," ")." > "._String::Fill($you[name],12," ")." | {$msg}\r\n"); fwrite($fp, _String::Fill($me['name'],12," ")." > "._String::Fill($you['name'],12," ")." | {$msg}\r\n");
fclose($fp); fclose($fp);
} }
+57 -57
View File
@@ -11,12 +11,12 @@ $query = "select startyear,year,month 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);
$query = "select no,nation,level from general where user_id='$_SESSION[p_id]'"; $query = "select no,nation,level from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
$meLevel = $me[level]; $meLevel = $me['level'];
$query = "select no from general where nation='$me[nation]' and level=12"; $query = "select no from general where nation='$me['nation']' and level=12";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$ruler = MYDB_fetch_array($result); $ruler = MYDB_fetch_array($result);
@@ -26,7 +26,7 @@ if($btn == "임명") {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
//임명할사람이 군주이면 불가, 내가 수뇌부이어야함, 공석아닌때는 국가가 같아야함 //임명할사람이 군주이면 불가, 내가 수뇌부이어야함, 공석아닌때는 국가가 같아야함
if($general[level] == 12 || $meLevel < 5 || ($general[nation] != $me[nation] && $genlist != 0)) { if($general['level'] == 12 || $meLevel < 5 || ($general['nation'] != $me['nation'] && $genlist != 0)) {
echo "<script>location.replace('b_myBossInfo.php');</script>"; echo "<script>location.replace('b_myBossInfo.php');</script>";
exit(); exit();
} }
@@ -36,88 +36,88 @@ if($btn == "임명") {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
//추방할사람이 군주이면 불가, 내가 수뇌부이어야함, 공석아닌때는 국가가 같아야함 //추방할사람이 군주이면 불가, 내가 수뇌부이어야함, 공석아닌때는 국가가 같아야함
if($general[level] == 12 || $meLevel < 5 || ($general[nation] != $me[nation] && $outlist != 0)) { if($general['level'] == 12 || $meLevel < 5 || ($general['nation'] != $me['nation'] && $outlist != 0)) {
echo "<script>location.replace('b_myBossInfo.php');</script>"; echo "<script>location.replace('b_myBossInfo.php');</script>";
exit(); exit();
} }
} }
if($btn == "추방") { if($btn == "추방") {
$query = "select name,l{$meLevel}set,chemi from nation where nation='$me[nation]'"; $query = "select name,l{$meLevel}set,chemi from nation where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
//이미 지정했다면 무시 //이미 지정했다면 무시
if($nation["l{$meLevel}set"] == 0 && $general[level] > 0 && $general[level] < 12) { 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'"; $query = "select no from diplomacy where me='$general['nation']' and state>='3' and state<='4'";
$dipresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $dipresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dipcount1 = MYDB_num_rows($dipresult); $dipcount1 = MYDB_num_rows($dipresult);
$query = "select no from diplomacy where me='$general[nation]' and state>='5' and state<='6'"; $query = "select no from diplomacy where me='$general['nation']' and state>='5' and state<='6'";
$dipresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $dipresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dipcount2 = MYDB_num_rows($dipresult); $dipcount2 = MYDB_num_rows($dipresult);
$gold = 0; $gold = 0;
$rice = 0; $rice = 0;
// 금쌀1000이상은 남김 // 금쌀1000이상은 남김
if($general[gold] > 1000) { if($general['gold'] > 1000) {
$gold = $general[gold] - 1000; $gold = $general['gold'] - 1000;
$general[gold] = 1000; $general['gold'] = 1000;
} }
if($general[rice] > 1000) { if($general['rice'] > 1000) {
$rice = $general[rice] - 1000; $rice = $general['rice'] - 1000;
$general[rice] = 1000; $general['rice'] = 1000;
} }
if($dipcount1 > 0) { if($dipcount1 > 0) {
$alllog[count($alllog)] = "<C>●</>{$admin[month]}월:통합에 반대하던 <Y>$general[name]</>(이)가 <D><b>$nation[name]</b></>에서 <R>숙청</>당했습니다."; $alllog[count($alllog)] = "<C>●</>{$admin['month']}월:통합에 반대하던 <Y>$general['name']</>(이)가 <D><b>$nation['name']</b></>에서 <R>숙청</>당했습니다.";
$log[count($log)] = "<C>●</>통합에 반대하다가 <D><b>$nation[name]</b></>에서 <R>숙청</>당했습니다."; $log[count($log)] = "<C>●</>통합에 반대하다가 <D><b>$nation['name']</b></>에서 <R>숙청</>당했습니다.";
// 재야로, 국가 무소속으로 // 재야로, 국가 무소속으로
$query = "update general set level=0,nation=0,belong=0,makelimit='12',gold='$general[gold]',rice='$general[rice]' where no='$general[no]'"; $query = "update general set level=0,nation=0,belong=0,makelimit='12',gold='$general['gold']',rice='$general['rice']' where no='$general['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($dipcount2 > 0) { } elseif($dipcount2 > 0) {
$alllog[count($alllog)] = "<C>●</>{$admin[month]}월:합병에 반대하던 <Y>$general[name]</>(이)가 <D><b>$nation[name]</b></>에서 <R>숙청</>당했습니다."; $alllog[count($alllog)] = "<C>●</>{$admin['month']}월:합병에 반대하던 <Y>$general['name']</>(이)가 <D><b>$nation['name']</b></>에서 <R>숙청</>당했습니다.";
$log[count($log)] = "<C>●</>합병에 반대하다가 <D><b>$nation[name]</b></>에서 <R>숙청</>당했습니다."; $log[count($log)] = "<C>●</>합병에 반대하다가 <D><b>$nation['name']</b></>에서 <R>숙청</>당했습니다.";
// 재야로, 국가 무소속으로 // 재야로, 국가 무소속으로
$query = "update general set level=0,nation=0,belong=0,makelimit='12',gold='$general[gold]',rice='$general[rice]' where no='$general[no]'"; $query = "update general set level=0,nation=0,belong=0,makelimit='12',gold='$general['gold']',rice='$general['rice']' where no='$general['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else { } else {
$alllog[count($alllog)] = "<C>●</>{$admin[month]}월:<Y>$general[name]</>(이)가 <D><b>$nation[name]</b></>에서 <R>추방</>당하였습니다."; $alllog[count($alllog)] = "<C>●</>{$admin['month']}월:<Y>$general['name']</>(이)가 <D><b>$nation['name']</b></>에서 <R>추방</>당하였습니다.";
$log[count($log)] = "<C>●</><D><b>$nation[name]</b></>에서 <R>추방</>당하였습니다."; $log[count($log)] = "<C>●</><D><b>$nation['name']</b></>에서 <R>추방</>당하였습니다.";
// 재야로, 국가 무소속으로, 명성/공헌 N*10%감소 // 재야로, 국가 무소속으로, 명성/공헌 N*10%감소
$query = "update general set level=0,nation=0,belong=0,betray=betray+1,makelimit='12',gold='$general[gold]',rice='$general[rice]',dedication=dedication*(1-0.1*betray),experience=experience*(1-0.1*betray) where no='$general[no]'"; $query = "update general set level=0,nation=0,belong=0,betray=betray+1,makelimit='12',gold='$general['gold']',rice='$general['rice']',dedication=dedication*(1-0.1*betray),experience=experience*(1-0.1*betray) where no='$general['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
// 부대 처리 // 부대 처리
$query = "select no from troop where troop='$general[troop]'"; $query = "select no from troop where troop='$general['troop']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$troop = MYDB_fetch_array($result); $troop = MYDB_fetch_array($result);
//부대장일 경우 //부대장일 경우
if($troop[no] == $general[no]) { if($troop['no'] == $general['no']) {
// 모두 탈퇴 // 모두 탈퇴
$query = "update general set troop='0' where troop='$general[troop]'"; $query = "update general set troop='0' where troop='$general['troop']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 부대 삭제 // 부대 삭제
$query = "delete from troop where troop='$general[troop]'"; $query = "delete from troop where troop='$general['troop']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else { } else {
$query = "update general set troop='0' where no='$general[no]'"; $query = "update general set troop='0' where no='$general['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
// 도시관직해제 // 도시관직해제
$query = "update city set gen1='0' where gen1='$general[no]'"; $query = "update city set gen1='0' where gen1='$general['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update city set gen2='0' where gen2='$general[no]'"; $query = "update city set gen2='0' where gen2='$general['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update city set gen3='0' where gen3='$general[no]'"; $query = "update city set gen3='0' where gen3='$general['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
if($general[npc] >= 2 && ($admin[scenario] == 0 || rand()%100 == 0)) { if($general['npc'] >= 2 && ($admin['scenario'] == 0 || rand()%100 == 0)) {
switch(rand()%5) { switch(rand()%5) {
case 0: $str = "날 버리다니... 곧 전장에서 복수해주겠다..."; break; case 0: $str = "날 버리다니... 곧 전장에서 복수해주겠다..."; break;
case 1: $str = "추방이라... 내가 무얼 잘못했단 말인가..."; break; case 1: $str = "추방이라... 내가 무얼 잘못했단 말인가..."; break;
@@ -126,68 +126,68 @@ if($btn == "추방") {
case 4: $str = "날 추방했으니 그 복수로 적국에 정보를 팔아 넘겨야겠군요. 그럼 이만."; break; case 4: $str = "날 추방했으니 그 복수로 적국에 정보를 팔아 넘겨야겠군요. 그럼 이만."; break;
} }
PushMsg(1, 0, $general[picture], $general[imgsvr], "{$general[name]}:", $nation[color], $nation[name], $nation[color], $str); PushMsg(1, 0, $general['picture'], $general['imgsvr'], "{$general['name']}:", $nation['color'], $nation['name'], $nation['color'], $str);
} }
//국가 기술력 그대로 //국가 기술력 그대로
$query = "select no from general where nation='$general[nation]'"; $query = "select no from general where nation='$general['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result); $gencount = MYDB_num_rows($result);
$gennum = $gencount; $gennum = $gencount;
if($gencount < 10) $gencount = 10; if($gencount < 10) $gencount = 10;
$nation[chemi] -= 1; $nation['chemi'] -= 1;
if($nation[chemi] < 0) { $nation[chemi] = 0; } if($nation['chemi'] < 0) { $nation['chemi'] = 0; }
if($admin[year] < $admin[startyear]+3) { if($admin['year'] < $admin['startyear']+3) {
//초반엔 군주 부상 증가(엔장 임관지양) //초반엔 군주 부상 증가(엔장 임관지양)
$query = "update general set injury=injury+1 where no='$ruler[no]'"; $query = "update general set injury=injury+1 where no='$ruler['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update nation set totaltech=tech*'$gencount',gennum='$gennum',chemi='$nation[chemi]',gold=gold+'$gold',rice=rice+'$rice' where nation='$general[nation]'"; $query = "update nation set totaltech=tech*'$gencount',gennum='$gennum',chemi='$nation['chemi']',gold=gold+'$gold',rice=rice+'$rice' where nation='$general['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else { } else {
//이번분기는 추방불가(초반 제외) //이번분기는 추방불가(초반 제외)
$query = "update nation set l{$meLevel}set=1,totaltech=tech*'$gencount',gennum='$gennum',chemi='$nation[chemi]',gold=gold+'$gold',rice=rice+'$rice' where nation='$general[nation]'"; $query = "update nation set l{$meLevel}set=1,totaltech=tech*'$gencount',gennum='$gennum',chemi='$nation['chemi']',gold=gold+'$gold',rice=rice+'$rice' where nation='$general['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
$query = "select year,month from game where no='1'"; $query = "select year,month 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);
$general = addHistory($connect, $general, "<C>●</>$admin[year]$admin[month]월:<D>$nation[name]</>에서 추방됨"); $general = addHistory($connect, $general, "<C>●</>$admin['year']$admin['month']월:<D>$nation['name']</>에서 추방됨");
pushGenLog($general, $log); pushGenLog($general, $log);
pushAllLog($alllog); pushAllLog($alllog);
} }
} elseif($btn == "임명" && $level >= 5 && $level <= 11) { } elseif($btn == "임명" && $level >= 5 && $level <= 11) {
$query = "select l{$level}set,level,chemi from nation where nation='$me[nation]'"; $query = "select l{$level}set,level,chemi from nation where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
// 임명가능 레벨 // 임명가능 레벨
$lv = getNationChiefLevel($nation[level]); $lv = getNationChiefLevel($nation['level']);
//이미 지정했다면 무시 //이미 지정했다면 무시
if($nation["l{$level}set"] == 0 && $lv <= $level) { if($nation["l{$level}set"] == 0 && $lv <= $level) {
$nation[chemi] -= 1; $nation['chemi'] -= 1;
if($nation[chemi] < 0) { $nation[chemi] = 0; } if($nation['chemi'] < 0) { $nation['chemi'] = 0; }
$query = "update nation set chemi='$nation[chemi]' where nation='$general[nation]'"; $query = "update nation set chemi='$nation['chemi']' where nation='$general['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//기존 장수 일반으로 //기존 장수 일반으로
$query = "update general set level=1 where nation='$me[nation]' and level='$level'"; $query = "update general set level=1 where nation='$me['nation']' and level='$level'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
if($genlist != 0) { if($genlist != 0) {
$valid = 0; $valid = 0;
switch($level) { switch($level) {
case 10: if($general[power] >= $_goodgenpower) { $valid = 1; } break; case 10: if($general['power'] >= $_goodgenpower) { $valid = 1; } break;
case 9: if($general[intel] >= $_goodgenintel) { $valid = 1; } break; case 9: if($general['intel'] >= $_goodgenintel) { $valid = 1; } break;
case 8: if($general[power] >= $_goodgenpower) { $valid = 1; } break; case 8: if($general['power'] >= $_goodgenpower) { $valid = 1; } break;
case 7: if($general[intel] >= $_goodgenintel) { $valid = 1; } break; case 7: if($general['intel'] >= $_goodgenintel) { $valid = 1; } break;
case 6: if($general[power] >= $_goodgenpower) { $valid = 1; } break; case 6: if($general['power'] >= $_goodgenpower) { $valid = 1; } break;
case 5: if($general[intel] >= $_goodgenintel) { $valid = 1; } break; case 5: if($general['intel'] >= $_goodgenintel) { $valid = 1; } break;
default: $valid = 1; break; default: $valid = 1; break;
} }
if($valid == 1) { if($valid == 1) {
@@ -202,7 +202,7 @@ if($btn == "추방") {
$query = "update general set level='$level' where no='$genlist'"; $query = "update general set level='$level' where no='$genlist'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//이번분기는 불가 //이번분기는 불가
$query = "update nation set l{$level}set=1 where nation='$me[nation]'"; $query = "update nation set l{$level}set=1 where nation='$me['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
} }
@@ -229,8 +229,8 @@ if($btn == "추방") {
if($genlist != 0) { if($genlist != 0) {
$valid = 0; $valid = 0;
switch($level) { switch($level) {
case 4: if($general[power] >= $_goodgenpower) { $valid = 1; } break; case 4: if($general['power'] >= $_goodgenpower) { $valid = 1; } break;
case 3: if($general[intel] >= $_goodgenintel) { $valid = 1; } break; case 3: if($general['intel'] >= $_goodgenintel) { $valid = 1; } break;
default: $valid = 1; break; default: $valid = 1; break;
} }
if($valid == 1) { if($valid == 1) {
+7 -7
View File
@@ -8,7 +8,7 @@ CheckLogin();
$connect = dbConn(); $connect = dbConn();
if(CheckBlock($connect) != 1 && CheckBlock($connect) != 3) { if(CheckBlock($connect) != 1 && CheckBlock($connect) != 3) {
$query = "select no,nation from general where user_id='$_SESSION[p_id]'"; $query = "select no,nation from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
@@ -19,25 +19,25 @@ if(CheckBlock($connect) != 1 && CheckBlock($connect) != 3) {
$msg = trim($msg); $msg = trim($msg);
$reply = trim($reply); $reply = trim($reply);
$nation = getNation($connect, $me[nation]); $nation = getNation($connect, $me['nation']);
//새글 추가시 //새글 추가시
if($num == -1 && $title != "" && $msg != "") { if($num == -1 && $title != "" && $msg != "") {
$num = $nation[boardindex] + 1; $num = $nation['boardindex'] + 1;
if($num >= 20) { $num = 0; } if($num >= 20) { $num = 0; }
$msg = $title."|".$msg; $msg = $title."|".$msg;
$msg = addslashes(SQ2DQ($msg)); $msg = addslashes(SQ2DQ($msg));
$date = date('Y-m-d H:i:s'); $date = date('Y-m-d H:i:s');
$query = "update nation set board{$num}='$msg',board{$num}_who='$me[no]',board{$num}_when='$date' where nation='$me[nation]'"; $query = "update nation set board{$num}='$msg',board{$num}_who='$me['no']',board{$num}_when='$date' where nation='$me['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update nation set boardindex='$num' where nation='$me[nation]'"; $query = "update nation set boardindex='$num' where nation='$me['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//$num에 댓글시 //$num에 댓글시
} elseif($num >= 0 && $reply != "") { } elseif($num >= 0 && $reply != "") {
$newmsg = $nation["board{$num}"]."|".$me[no]."|".$reply; $newmsg = $nation["board{$num}"]."|".$me['no']."|".$reply;
$newmsg = addslashes(SQ2DQ($newmsg)); $newmsg = addslashes(SQ2DQ($newmsg));
$query = "update nation set board{$num}='$newmsg' where nation='$me[nation]'"; $query = "update nation set board{$num}='$newmsg' where nation='$me['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
} }
+2 -2
View File
@@ -7,13 +7,13 @@ include "func.php";
CheckLogin(); CheckLogin();
$connect = dbConn(); $connect = dbConn();
$query = "select no,nation from general where user_id='$_SESSION[p_id]'"; $query = "select no,nation from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
$msg = addslashes(SQ2DQ($msg)); $msg = addslashes(SQ2DQ($msg));
$query = "update nation set rule='$msg' where nation='$me[nation]'"; $query = "update nation set rule='$msg' where nation='$me['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//echo "<script>location.replace('b_nationrule.php');</script>"; //echo "<script>location.replace('b_nationrule.php');</script>";
+56 -56
View File
@@ -11,48 +11,48 @@ $query = "select tournament,phase,tnmt_type,develcost 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);
$query = "select no,name,userlevel,tournament from general where user_id='$_SESSION[p_id]'"; $query = "select no,name,userlevel,tournament from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
switch($admin[tnmt_type]) { switch($admin['tnmt_type']) {
case 0: $tp = "total"; $tp2 = "전력전"; $tp3 = "leader+power+intel"; break; case 0: $tp = "total"; $tp2 = "전력전"; $tp3 = "leader+power+intel"; break;
case 1: $tp = "leader"; $tp2 = "통솔전"; $tp3 = "leader"; break; case 1: $tp = "leader"; $tp2 = "통솔전"; $tp3 = "leader"; break;
case 2: $tp = "power"; $tp2 = "일기토"; $tp3 = "power"; break; case 2: $tp = "power"; $tp2 = "일기토"; $tp3 = "power"; break;
case 3: $tp = "intel"; $tp2 = "설전"; $tp3 = "intel"; break; case 3: $tp = "intel"; $tp2 = "설전"; $tp3 = "intel"; break;
} }
if($me[tournament] == 1 && $me[userlevel] < 5) { echo "<script>location.replace('b_tournament.php');</script>"; exit(); } if($me['tournament'] == 1 && $me['userlevel'] < 5) { echo "<script>location.replace('b_tournament.php');</script>"; exit(); }
if($btn == "자동개최설정" && $me[userlevel] >= 5) { if($btn == "자동개최설정" && $me['userlevel'] >= 5) {
$query = "update game set tnmt_trig={$trig}"; $query = "update game set tnmt_trig={$trig}";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "개최" && $me[userlevel] >= 5) { } elseif($btn == "개최" && $me['userlevel'] >= 5) {
startTournament($connect, $auto, $type); startTournament($connect, $auto, $type);
} elseif($btn == "중단" && $me[userlevel] >= 5) { } elseif($btn == "중단" && $me['userlevel'] >= 5) {
$query = "update game set tnmt_auto=0, tournament=0, phase=0"; $query = "update game set tnmt_auto=0, tournament=0, phase=0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif((($btn == "투입" || $btn == "무명투입" || $btn == "쪼렙투입" || $btn == "일반투입" || $btn == "굇수투입" || $btn == "랜덤투입") && $me[userlevel] >= 5) || $btn == "참가") { } elseif((($btn == "투입" || $btn == "무명투입" || $btn == "쪼렙투입" || $btn == "일반투입" || $btn == "굇수투입" || $btn == "랜덤투입") && $me['userlevel'] >= 5) || $btn == "참가") {
if($btn == "투입") { if($btn == "투입") {
$query = "select no,name,npc,leader,power,intel,explevel,gold,horse,weap,book from general where no='$gen'"; $query = "select no,name,npc,leader,power,intel,explevel,gold,horse,weap,book from general where no='$gen'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$general[gold] -= $admin[develcost]; $general['gold'] -= $admin['develcost'];
} elseif($btn == "무명투입") { } elseif($btn == "무명투입") {
$general[no] = 0; $general['no'] = 0;
$general[name] = "무명장수"; $general['name'] = "무명장수";
$general[npc] = 2; $general['npc'] = 2;
$general[leader] = 10; $general['leader'] = 10;
$general[power] = 10; $general['power'] = 10;
$general[intel] = 10; $general['intel'] = 10;
$general[explevel] = 10; $general['explevel'] = 10;
$general[gold] = 0; $general['gold'] = 0;
} elseif($btn == "쪼렙투입") { } elseif($btn == "쪼렙투입") {
$sel = rand() % 32; $sel = rand() % 32;
$query = "select no,name,npc,leader,power,intel,explevel,gold,leader+power+intel as total,horse,weap,book from general where tournament=0 and gold>='$admin[develcost]' and npc>=2 order by {$tp} limit {$sel},1"; $query = "select no,name,npc,leader,power,intel,explevel,gold,leader+power+intel as total,horse,weap,book from general where tournament=0 and gold>='$admin['develcost']' and npc>=2 order by {$tp} limit {$sel},1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$general[gold] -= $admin[develcost]; $general['gold'] -= $admin['develcost'];
} elseif($btn == "일반투입") { } elseif($btn == "일반투입") {
//참가한 사람 평균치 //참가한 사람 평균치
$query = "select AVG({$tp3}) as av from general where tournament=1"; $query = "select AVG({$tp3}) as av from general where tournament=1";
@@ -60,36 +60,36 @@ if($btn == "자동개최설정" && $me[userlevel] >= 5) {
$avgGen = MYDB_fetch_array($genResult); $avgGen = MYDB_fetch_array($genResult);
//그 장수보다 높은장수 수 //그 장수보다 높은장수 수
$query = "select no from general where tournament=0 and gold>='$admin[develcost]' and npc>=2 and {$tp3}>{$avgGen[av]}"; $query = "select no from general where tournament=0 and gold>='$admin['develcost']' and npc>=2 and {$tp3}>{$avgGen['av']}";
$genResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $genResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$genCount = MYDB_num_rows($genResult); $genCount = MYDB_num_rows($genResult);
$sel = rand() % 32 + $genCount - 8; $sel = rand() % 32 + $genCount - 8;
$query = "select no,name,npc,leader,power,intel,explevel,leader+power+intel as total,horse,weap,book from general where tournament=0 and gold>='$admin[develcost]' and npc>=2 order by {$tp} desc limit {$sel},1"; $query = "select no,name,npc,leader,power,intel,explevel,leader+power+intel as total,horse,weap,book from general where tournament=0 and gold>='$admin['develcost']' and npc>=2 order by {$tp} desc limit {$sel},1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$general[gold] -= $admin[develcost]; $general['gold'] -= $admin['develcost'];
} elseif($btn == "굇수투입") { } elseif($btn == "굇수투입") {
$sel = rand() % 32; $sel = rand() % 32;
$query = "select no,name,npc,leader,power,intel,explevel,gold,leader+power+intel as total,horse,weap,book from general where tournament=0 and gold>='$admin[develcost]' and npc>=2 order by {$tp} desc limit {$sel},1"; $query = "select no,name,npc,leader,power,intel,explevel,gold,leader+power+intel as total,horse,weap,book from general where tournament=0 and gold>='$admin['develcost']' and npc>=2 order by {$tp} desc limit {$sel},1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$general[gold] -= $admin[develcost]; $general['gold'] -= $admin['develcost'];
} elseif($btn == "랜덤투입") { } elseif($btn == "랜덤투입") {
$query = "select no,name,npc,leader,power,intel,explevel,gold,leader+power+intel as total,horse,weap,book from general where tournament=0 and gold>='$admin[develcost]' and npc>=2 order by rand() limit 0,1"; $query = "select no,name,npc,leader,power,intel,explevel,gold,leader+power+intel as total,horse,weap,book from general where tournament=0 and gold>='$admin['develcost']' and npc>=2 order by rand() limit 0,1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$general[gold] -= $admin[develcost]; $general['gold'] -= $admin['develcost'];
//참가 //참가
} else { } else {
$query = "select no,name,npc,leader,power,intel,explevel,gold,horse,weap,book from general where no='$me[no]'"; $query = "select no,name,npc,leader,power,intel,explevel,gold,horse,weap,book from general where no='$me['no']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
//$admin[develcost]원 참가비 //$admin['develcost']원 참가비
if($general[gold] < $admin[develcost]) { echo "<script>location.replace('b_tournament.php');</script>"; exit(1); } if($general['gold'] < $admin['develcost']) { echo "<script>location.replace('b_tournament.php');</script>"; exit(1); }
$general[gold] -= $admin[develcost]; $general['gold'] -= $admin['develcost'];
} }
$query = "select grp from tournament where grp<10 group by grp having count(*)=8"; $query = "select grp from tournament where grp<10 group by grp having count(*)=8";
@@ -97,7 +97,7 @@ if($btn == "자동개최설정" && $me[userlevel] >= 5) {
$grpCount = MYDB_num_rows($result); $grpCount = MYDB_num_rows($result);
for($i=0; $i < $grpCount; $i++) { for($i=0; $i < $grpCount; $i++) {
$grp = MYDB_fetch_array($result); $grp = MYDB_fetch_array($result);
$occupied[$grp[grp]] = 1; $occupied[$grp['grp']] = 1;
} }
for($i=0; $i < 8; $i++) { for($i=0; $i < 8; $i++) {
if($occupied[$i] == 0) { if($occupied[$i] == 0) {
@@ -110,9 +110,9 @@ if($btn == "자동개최설정" && $me[userlevel] >= 5) {
$query = "select grp from tournament where grp='$grp'"; $query = "select grp from tournament where grp='$grp'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$grpCount = MYDB_num_rows($result); $grpCount = MYDB_num_rows($result);
$query = "insert into tournament (no, npc, name, ldr, pwr, itl, lvl, grp, grp_no, h, w, b) values ('$general[no]', '$general[npc]', '$general[name]', '$general[leader]', '$general[power]', '$general[intel]', '$general[explevel]', '$grp', '$grpCount', '$general[horse]', '$general[weap]', '$general[book]')"; $query = "insert into tournament (no, npc, name, ldr, pwr, itl, lvl, grp, grp_no, h, w, b) values ('$general['no']', '$general['npc']', '$general['name']', '$general['leader']', '$general['power']', '$general['intel']', '$general['explevel']', '$grp', '$grpCount', '$general['horse']', '$general['weap']', '$general['book']')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update general set tournament=1,gold='$general[gold]' where no='$general[no]'"; $query = "update general set tournament=1,gold='$general['gold']' where no='$general['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
@@ -123,7 +123,7 @@ if($btn == "자동개최설정" && $me[userlevel] >= 5) {
$query = "update game set tournament=2, phase=0"; $query = "update game set tournament=2, phase=0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
} elseif(($btn == "쪼렙전부투입" || $btn == "일반전부투입" || $btn == "굇수전부투입" || $btn == "랜덤전부투입") && $me[userlevel] >= 5) { } elseif(($btn == "쪼렙전부투입" || $btn == "일반전부투입" || $btn == "굇수전부투입" || $btn == "랜덤전부투입") && $me['userlevel'] >= 5) {
$z = 0; $z = 0;
for($i=0; $i < 8; $i++) { for($i=0; $i < 8; $i++) {
$query = "select grp from tournament where grp='$i'"; $query = "select grp from tournament where grp='$i'";
@@ -144,7 +144,7 @@ if($btn == "자동개최설정" && $me[userlevel] >= 5) {
for($i=0; $i < $z; $i++) { for($i=0; $i < $z; $i++) {
$sel = rand() % 32; $sel = rand() % 32;
if($btn == "쪼렙전부투입") { if($btn == "쪼렙전부투입") {
$query = "select no,name,npc,leader,power,intel,explevel,leader+power+intel as total,horse,weap,book from general where tournament=0 and gold>='$admin[develcost]' and npc>=2 order by {$tp} limit {$sel},1"; $query = "select no,name,npc,leader,power,intel,explevel,leader+power+intel as total,horse,weap,book from general where tournament=0 and gold>='$admin['develcost']' and npc>=2 order by {$tp} limit {$sel},1";
} elseif($btn == "일반전부투입") { } elseif($btn == "일반전부투입") {
//참가한 사람 평균치 //참가한 사람 평균치
$query = "select AVG({$tp3}) as av from general where tournament=1"; $query = "select AVG({$tp3}) as av from general where tournament=1";
@@ -152,50 +152,50 @@ if($btn == "자동개최설정" && $me[userlevel] >= 5) {
$avgGen = MYDB_fetch_array($genResult); $avgGen = MYDB_fetch_array($genResult);
//그 장수보다 높은장수 수 //그 장수보다 높은장수 수
$query = "select no from general where tournament=0 and gold>='$admin[develcost]' and npc>=2 and {$tp3}>{$avgGen[av]}"; $query = "select no from general where tournament=0 and gold>='$admin['develcost']' and npc>=2 and {$tp3}>{$avgGen['av']}";
$genResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $genResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$genCount = MYDB_num_rows($genResult); $genCount = MYDB_num_rows($genResult);
$sel += $genCount - 8; $sel += $genCount - 8;
$query = "select no,name,npc,leader,power,intel,explevel,leader+power+intel as total,horse,weap,book from general where tournament=0 and gold>='$admin[develcost]' and npc>=2 order by {$tp} desc limit {$sel},1"; $query = "select no,name,npc,leader,power,intel,explevel,leader+power+intel as total,horse,weap,book from general where tournament=0 and gold>='$admin['develcost']' and npc>=2 order by {$tp} desc limit {$sel},1";
} elseif($btn == "굇수전부투입") { } elseif($btn == "굇수전부투입") {
$query = "select no,name,npc,leader,power,intel,explevel,leader+power+intel as total,horse,weap,book from general where tournament=0 and gold>='$admin[develcost]' and npc>=2 order by {$tp} desc limit {$sel},1"; $query = "select no,name,npc,leader,power,intel,explevel,leader+power+intel as total,horse,weap,book from general where tournament=0 and gold>='$admin['develcost']' and npc>=2 order by {$tp} desc limit {$sel},1";
} else { } else {
$query = "select no,name,npc,leader,power,intel,explevel,leader+power+intel as total,horse,weap,book from general where tournament=0 and gold>='$admin[develcost]' and npc>=2 order by rand() limit 0,1"; $query = "select no,name,npc,leader,power,intel,explevel,leader+power+intel as total,horse,weap,book from general where tournament=0 and gold>='$admin['develcost']' and npc>=2 order by rand() limit 0,1";
} }
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$grp = floor($code[$i] / 10); $grp = floor($code[$i] / 10);
$grp_no = $code[$i] % 10; $grp_no = $code[$i] % 10;
$query = "insert into tournament (no, npc, name, ldr, pwr, itl, lvl, grp, grp_no, h, w, b) values ('$general[no]', '$general[npc]', '$general[name]', '$general[leader]', '$general[power]', '$general[intel]', '$general[explevel]', '$grp', '$grp_no', '$general[horse]', '$general[weap]', '$general[book]')"; $query = "insert into tournament (no, npc, name, ldr, pwr, itl, lvl, grp, grp_no, h, w, b) values ('$general['no']', '$general['npc']', '$general['name']', '$general['leader']', '$general['power']', '$general['intel']', '$general['explevel']', '$grp', '$grp_no', '$general['horse']', '$general['weap']', '$general['book']')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update general set tournament=1,gold=gold-'$admin[develcost]' where no='$general[no]'"; $query = "update general set tournament=1,gold=gold-'$admin['develcost']' where no='$general['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
$query = "update game set tournament=2, phase=0"; $query = "update game set tournament=2, phase=0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "무명전부투입" && $me[userlevel] >= 5) { fillLowGenAll($connect); } elseif($btn == "무명전부투입" && $me['userlevel'] >= 5) { fillLowGenAll($connect);
} elseif($btn == "예선" && $me[userlevel] >= 5) { qualify($connect, $admin[tnmt_type], $admin[tournament], $admin[phase]); } elseif($btn == "예선" && $me['userlevel'] >= 5) { qualify($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase']);
} elseif($btn == "예선전부" && $me[userlevel] >= 5) { qualifyAll($connect, $admin[tnmt_type], $admin[tournament], $admin[phase]); } elseif($btn == "예선전부" && $me['userlevel'] >= 5) { qualifyAll($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase']);
} elseif($btn == "추첨" && $me[userlevel] >= 5) { selection($connect, $admin[tnmt_type], $admin[tournament], $admin[phase]); } elseif($btn == "추첨" && $me['userlevel'] >= 5) { selection($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase']);
} elseif($btn == "추첨전부" && $me[userlevel] >= 5) { selectionAll($connect, $admin[tnmt_type], $admin[tournament], $admin[phase]); } elseif($btn == "추첨전부" && $me['userlevel'] >= 5) { selectionAll($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase']);
} elseif($btn == "본선" && $me[userlevel] >= 5) { finallySingle($connect, $admin[tnmt_type], $admin[tournament], $admin[phase]); } elseif($btn == "본선" && $me['userlevel'] >= 5) { finallySingle($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase']);
} elseif($btn == "본선전부" && $me[userlevel] >= 5) { finallyAll($connect, $admin[tnmt_type], $admin[tournament], $admin[phase]); } elseif($btn == "본선전부" && $me['userlevel'] >= 5) { finallyAll($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase']);
} elseif($btn == "배정" && $me[userlevel] >= 5) { final16set($connect); } elseif($btn == "배정" && $me['userlevel'] >= 5) { final16set($connect);
} elseif($btn == "베팅마감" && $me[userlevel] >= 5) { } elseif($btn == "베팅마감" && $me['userlevel'] >= 5) {
$dt = date("Y-m-d H:i:s", time() + 60); $dt = date("Y-m-d H:i:s", time() + 60);
$query = "update game set tournament='7',phase='0',tnmt_time='$dt' where no=1"; $query = "update game set tournament='7',phase='0',tnmt_time='$dt' where no=1";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "16강" && $me[userlevel] >= 5) { finalFight($connect, $admin[tnmt_type], $admin[tournament], $admin[phase], 16); } elseif($btn == "16강" && $me['userlevel'] >= 5) { finalFight($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase'], 16);
} elseif($btn == "8강" && $me[userlevel] >= 5) { finalFight($connect, $admin[tnmt_type], $admin[tournament], $admin[phase], 8); } elseif($btn == "8강" && $me['userlevel'] >= 5) { finalFight($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase'], 8);
} elseif($btn == "4강" && $me[userlevel] >= 5) { finalFight($connect, $admin[tnmt_type], $admin[tournament], $admin[phase], 4); } elseif($btn == "4강" && $me['userlevel'] >= 5) { finalFight($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase'], 4);
} elseif($btn == "결승" && $me[userlevel] >= 5) { finalFight($connect, $admin[tnmt_type], $admin[tournament], $admin[phase], 2); } elseif($btn == "결승" && $me['userlevel'] >= 5) { finalFight($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase'], 2);
} elseif($btn == "포상" && $me[userlevel] >= 5) { setGift($connect, $admin[tnmt_type], $admin[tournament], $admin[phase]); } elseif($btn == "포상" && $me['userlevel'] >= 5) { setGift($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase']);
} elseif($btn == "회수" && $me[userlevel] >= 5) { setRefund($connect); } elseif($btn == "회수" && $me['userlevel'] >= 5) { setRefund($connect);
} elseif($btn == "메시지" && $me[userlevel] >= 5) { } elseif($btn == "메시지" && $me['userlevel'] >= 5) {
$msg = addslashes(SQ2DQ($msg)); $msg = addslashes(SQ2DQ($msg));
$query = "update game set tnmt_msg='$msg'"; $query = "update game set tnmt_msg='$msg'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
+12 -12
View File
@@ -7,46 +7,46 @@ include "func.php";
CheckLogin(); CheckLogin();
$connect = dbConn(); $connect = dbConn();
$query = "select no,nation,troop from general where user_id='$_SESSION[p_id]'"; $query = "select no,nation,troop from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
$name = trim($name); $name = trim($name);
$name = addslashes(SQ2DQ($name)); $name = addslashes(SQ2DQ($name));
if($btn == "부 대 창 설" && $name != "" && $me[troop] == 0) { if($btn == "부 대 창 설" && $name != "" && $me['troop'] == 0) {
$query = "insert into troop (name,nation,no) values ('$name','$me[nation]','$me[no]')"; $query = "insert into troop (name,nation,no) values ('$name','$me['nation']','$me['no']')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "select troop from troop where no='$me[no]'"; $query = "select troop from troop where no='$me['no']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$troop = MYDB_fetch_array($result); $troop = MYDB_fetch_array($result);
$query = "update general set troop='$troop[troop]' where no='$me[no]'"; $query = "update general set troop='$troop['troop']' where no='$me['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "부 대 변 경" && $name != "") { } elseif($btn == "부 대 변 경" && $name != "") {
$query = "update troop set name='$name' where no='$me[no]'"; $query = "update troop set name='$name' where no='$me['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "부 대 추 방" && $gen != 0) { } elseif($btn == "부 대 추 방" && $gen != 0) {
$query = "update general set troop='0' where no='$gen'"; $query = "update general set troop='0' where no='$gen'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "부 대 가 입" && $troop != 0) { } elseif($btn == "부 대 가 입" && $troop != 0) {
$query = "update general set troop='$troop' where no='$me[no]'"; $query = "update general set troop='$troop' where no='$me['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "부 대 탈 퇴") { } elseif($btn == "부 대 탈 퇴") {
$query = "select no from troop where troop='$me[troop]'"; $query = "select no from troop where troop='$me['troop']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$troop = MYDB_fetch_array($result); $troop = MYDB_fetch_array($result);
//부대장일 경우 //부대장일 경우
if($troop[no] == $me[no]) { if($troop['no'] == $me['no']) {
// 모두 탈퇴 // 모두 탈퇴
$query = "update general set troop='0' where troop='$me[troop]'"; $query = "update general set troop='0' where troop='$me['troop']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 부대 삭제 // 부대 삭제
$query = "delete from troop where troop='$me[troop]'"; $query = "delete from troop where troop='$me['troop']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else { } else {
$query = "update general set troop='0' where no='$me[no]'"; $query = "update general set troop='0' where no='$me['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
} }
+2 -2
View File
@@ -9,9 +9,9 @@ $query = "select killturn 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);
$admin[killturn] *= 3; $admin['killturn'] *= 3;
$query = "update general set killturn='$admin[killturn]' where user_id='$_SESSION[p_id]'"; $query = "update general set killturn='$admin['killturn']' where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//echo "<script>location.replace('b_myPage.php');</script>"; //echo "<script>location.replace('b_myPage.php');</script>";
+21 -21
View File
@@ -9,46 +9,46 @@ $query = "select develcost,vote,votecomment 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);
$query = "select no,userlevel,vote,name,nation,horse,weap,book,item,npc,history from general where user_id='$_SESSION[p_id]'"; $query = "select no,userlevel,vote,name,nation,horse,weap,book,item,npc,history from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
if($btn == "수정" && $me[userlevel] >= 5) { if($btn == "수정" && $me['userlevel'] >= 5) {
if($title != "") { if($title != "") {
$vote = explode("|", $admin[vote]); $vote = explode("|", $admin['vote']);
$vote[0] = addslashes(SQ2DQ($title)); $vote[0] = addslashes(SQ2DQ($title));
$admin[vote] = implode("|", $vote); $admin['vote'] = implode("|", $vote);
$query = "update game set vote='{$admin[vote]}' where no='1'"; $query = "update game set vote='{$admin['vote']}' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
} elseif($btn == "추가" && $me[userlevel] >= 5) { } elseif($btn == "추가" && $me['userlevel'] >= 5) {
if($str != "") { if($str != "") {
$str = addslashes(SQ2DQ($str)); $str = addslashes(SQ2DQ($str));
$admin[vote] .= "|{$str}"; $admin['vote'] .= "|{$str}";
$query = "update game set vote='{$admin[vote]}' where no='1'"; $query = "update game set vote='{$admin['vote']}' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
} elseif($btn == "리셋" && $me[userlevel] >= 5) { } elseif($btn == "리셋" && $me['userlevel'] >= 5) {
$query = "update game set voteopen=1,vote='',votecomment='' where no='1'"; $query = "update game set voteopen=1,vote='',votecomment='' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update general set vote='0'"; $query = "update general set vote='0'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "알림" && $me[userlevel] >= 5) { } elseif($btn == "알림" && $me['userlevel'] >= 5) {
$query = "update general set newvote='1' where vote=0"; $query = "update general set newvote='1' where vote=0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "숨김" && $me[userlevel] >= 5) { } elseif($btn == "숨김" && $me['userlevel'] >= 5) {
$query = "update game set voteopen=0 where no=1"; $query = "update game set voteopen=0 where no=1";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "전체통계만" && $me[userlevel] >= 5) { } elseif($btn == "전체통계만" && $me['userlevel'] >= 5) {
$query = "update game set voteopen=1 where no=1"; $query = "update game set voteopen=1 where no=1";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "전부" && $me[userlevel] >= 5) { } elseif($btn == "전부" && $me['userlevel'] >= 5) {
$query = "update game set voteopen=2 where no=1"; $query = "update game set voteopen=2 where no=1";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "투표" && $me[vote] == 0 && $sel > 0) { } elseif($btn == "투표" && $me['vote'] == 0 && $sel > 0) {
$develcost = $admin[develcost] * 5; $develcost = $admin['develcost'] * 5;
$query = "update general set gold=gold+{$develcost},vote='{$sel}' where user_id='$_SESSION[p_id]'"; $query = "update general set gold=gold+{$develcost},vote='{$sel}' where user_id='$_SESSION['p_id']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$log = array(); $log = array();
@@ -60,15 +60,15 @@ if($btn == "수정" && $me[userlevel] >= 5) {
$comment = trim($comment); $comment = trim($comment);
$comment = addslashes(SQ2DQ($comment)); $comment = addslashes(SQ2DQ($comment));
$query = "select name from nation where nation='$me[nation]'"; $query = "select name from nation where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
if($nation[name] == "") { $nation[name] = "재야"; } if($nation['name'] == "") { $nation['name'] = "재야"; }
if($admin[votecomment] != "") { $admin[votecomment] .= "|"; } if($admin['votecomment'] != "") { $admin['votecomment'] .= "|"; }
$admin[votecomment] .= "{$nation[name]}:{$me[name]}:{$comment}"; $admin['votecomment'] .= "{$nation['name']}:{$me['name']}:{$comment}";
$query = "update game set votecomment='{$admin[votecomment]}' where no=1"; $query = "update game set votecomment='{$admin['votecomment']}' where no=1";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
?> ?>
+6 -6
View File
@@ -65,7 +65,7 @@ function myCommandList($connect) {
$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);
$query = "select no,turntime,term,turn0,turn1,turn2,turn3,turn4,turn5,turn6,turn7,turn8,turn9,turn10,turn11,turn12,turn13,turn14,turn15,turn16,turn17,turn18,turn19,turn20,turn21,turn22,turn23 from general where user_id='$_SESSION[p_id]'"; $query = "select no,turntime,term,turn0,turn1,turn2,turn3,turn4,turn5,turn6,turn7,turn8,turn9,turn10,turn11,turn12,turn13,turn14,turn15,turn16,turn17,turn18,turn19,turn20,turn21,turn22,turn23 from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
$turn = getTurn($connect, $me, 2); $turn = getTurn($connect, $me, 2);
@@ -76,13 +76,13 @@ function myCommandList($connect) {
<td colspan=4 align=center id=bg0><b>- 명령 목록 - <input value='$date' type=text name=clock size=19 style=background-color:black;color:white;border-style:none;></b></td> <td colspan=4 align=center id=bg0><b>- 명령 목록 - <input value='$date' type=text name=clock size=19 style=background-color:black;color:white;border-style:none;></b></td>
</tr>"; </tr>";
$year = $admin[year]; $year = $admin['year'];
$month = $admin[month]; $month = $admin['month'];
// 실행된 턴시간이면 +1 // 실행된 턴시간이면 +1
$cutTurn = cutTurn($me[turntime], $admin[turnterm]); $cutTurn = cutTurn($me['turntime'], $admin['turnterm']);
if($date <= $cutTurn) { $month++; } if($date <= $cutTurn) { $month++; }
$totaldate = $me[turntime]; $totaldate = $me['turntime'];
for($i=0; $i < 24; $i++) { for($i=0; $i < 24; $i++) {
if($month == 13) { if($month == 13) {
@@ -99,7 +99,7 @@ function myCommandList($connect) {
<td width=137 align=center height=24 style=table-layout:fixed;>$turn[$i]</td> <td width=137 align=center height=24 style=table-layout:fixed;>$turn[$i]</td>
</tr>"; </tr>";
$month++; $month++;
$totaldate = addTurn($totaldate, $admin[turnterm]); $totaldate = addTurn($totaldate, $admin['turnterm']);
} }
echo " echo "
+32 -32
View File
@@ -11,7 +11,7 @@ $query = "select year,month 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);
$query = "select no,name,nation,level,history,picture,imgsvr from general where user_id='$_SESSION[p_id]'"; $query = "select no,name,nation,level,history,picture,imgsvr from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
@@ -19,93 +19,93 @@ $query = "select no,nation,history,name from general where no='$gen'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result); $you = MYDB_fetch_array($result);
$query = "select name,surlimit,history,color from nation where nation='$you[nation]'"; $query = "select name,surlimit,history,color from nation where nation='$you['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$younation = MYDB_fetch_array($result); $younation = MYDB_fetch_array($result);
$query = "select name,gold,rice,surlimit,color,dip{$num} as dipmsg from nation where nation='$me[nation]'"; $query = "select name,gold,rice,surlimit,color,dip{$num} as dipmsg from nation where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$mynation = MYDB_fetch_array($result); $mynation = MYDB_fetch_array($result);
$query = "select pop from city where nation='$me[nation]'"; $query = "select pop from city where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($result); $citycount = MYDB_num_rows($result);
$query = "select city from city where nation='$me[nation]'"; $query = "select city from city where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$losecitynum = MYDB_num_rows($result); $losecitynum = MYDB_num_rows($result);
$query = "select city from city where nation='$you[nation]'"; $query = "select city from city where nation='$you['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$wincitynum = MYDB_num_rows($result); $wincitynum = MYDB_num_rows($result);
//아국과의 관계 //아국과의 관계
$query = "select state,term from diplomacy where me='$me[nation]' and you='$you[nation]'"; $query = "select state,term from diplomacy where me='$me['nation']' and you='$you['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dip = MYDB_fetch_array($result); $dip = MYDB_fetch_array($result);
//상대국의 제의조건 //상대국의 제의조건
$query = "select reserved from diplomacy where me='$you[nation]' and you='$me[nation]'"; $query = "select reserved from diplomacy where me='$you['nation']' and you='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dip2 = MYDB_fetch_array($result); $dip2 = MYDB_fetch_array($result);
if($ok == "수락") { if($ok == "수락") {
// 서신 보낸 후 멸망,선양 등 했을때. // 서신 보낸 후 멸망,선양 등 했을때.
if($me[level] < 5) { if($me['level'] < 5) {
$mylog[count($mylog)] = "<C>●</>수뇌부가 아니므로 불가능합니다. 불가침 실패."; $mylog[count($mylog)] = "<C>●</>수뇌부가 아니므로 불가능합니다. 불가침 실패.";
} elseif($dip[term] == $when*12 && $dip[state] == 7) { } elseif($dip['term'] == $when*12 && $dip['state'] == 7) {
$mylog[count($mylog)] = "<C>●</>이미 수락했습니다. 불가침 실패."; $mylog[count($mylog)] = "<C>●</>이미 수락했습니다. 불가침 실패.";
} elseif($losecitynum == 0) { } elseif($losecitynum == 0) {
$mylog[count($mylog)] = "<C>●</>방랑군이므로 불가능합니다. 불가침 실패."; $mylog[count($mylog)] = "<C>●</>방랑군이므로 불가능합니다. 불가침 실패.";
} elseif($wincitynum == 0) { } elseif($wincitynum == 0) {
$mylog[count($mylog)] = "<C>●</>상대가 방랑군이므로 불가능합니다. 불가침 실패."; $mylog[count($mylog)] = "<C>●</>상대가 방랑군이므로 불가능합니다. 불가침 실패.";
} elseif($dip[state] == 0) { } elseif($dip['state'] == 0) {
$mylog[count($mylog)] = "<C>●</>아국과 교전중입니다. 불가침 실패."; $mylog[count($mylog)] = "<C>●</>아국과 교전중입니다. 불가침 실패.";
} elseif($dip[state] == 1) { } elseif($dip['state'] == 1) {
$mylog[count($mylog)] = "<C>●</>아국과 선포중입니다. 불가침 실패."; $mylog[count($mylog)] = "<C>●</>아국과 선포중입니다. 불가침 실패.";
} elseif($dip[state] == 3 || $dip[state] == 4) { } elseif($dip['state'] == 3 || $dip['state'] == 4) {
$mylog[count($mylog)] = "<C>●</>아국과 합병중입니다. 불가침 실패."; $mylog[count($mylog)] = "<C>●</>아국과 합병중입니다. 불가침 실패.";
} elseif($mynation[dipmsg] == "") { } elseif($mynation['dipmsg'] == "") {
$mylog[count($mylog)] = "<C>●</>이미 거절했습니다. 불가침 실패."; $mylog[count($mylog)] = "<C>●</>이미 거절했습니다. 불가침 실패.";
} else { } else {
// $alllog[count($alllog)] = "<C>●</>{$admin[month]}월:<Y>$me[name]</>(이)가 <D><b>$younation[name]</b></>(와)과 <M>불가침</>에 합의."; // $alllog[count($alllog)] = "<C>●</>{$admin['month']}월:<Y>$me['name']</>(이)가 <D><b>$younation['name']</b></>(와)과 <M>불가침</>에 합의.";
// $history[count($history)] = "<C>●</>$admin[year]년 $admin[month]월:<Y><b>【불가침】</b></><D><b>$mynation[name]</b></>(이)가 <D><b>$younation[name]</b></>(와)과 불가침 조약을 체결했습니다."; // $history[count($history)] = "<C>●</>$admin['year']년 $admin['month']월:<Y><b>【불가침】</b></><D><b>$mynation['name']</b></>(이)가 <D><b>$younation['name']</b></>(와)과 불가침 조약을 체결했습니다.";
$youlog[count($youlog)] = "<C>●</><D><b>$mynation[name]</b></>(와)과 <C>$when</>년 불가침에 성공했습니다."; $youlog[count($youlog)] = "<C>●</><D><b>$mynation['name']</b></>(와)과 <C>$when</>년 불가침에 성공했습니다.";
$mylog[count($mylog)] = "<C>●</><D><b>$younation[name]</b></>(와)과 <C>$when</>년 불가침에 합의했습니다."; $mylog[count($mylog)] = "<C>●</><D><b>$younation['name']</b></>(와)과 <C>$when</>년 불가침에 합의했습니다.";
$you = addHistory($connect, $you, "<C>●</>$admin[year]$admin[month]월:<D><b>$mynation[name]</b></>(와)과 {$when}년 불가침 성공"); $you = addHistory($connect, $you, "<C>●</>$admin['year']$admin['month']월:<D><b>$mynation['name']</b></>(와)과 {$when}년 불가침 성공");
$me = addHistory($connect, $me, "<C>●</>$admin[year]$admin[month]월:<D><b>$younation[name]</b></>(와)과 {$when}년 불가침 수락"); $me = addHistory($connect, $me, "<C>●</>$admin['year']$admin['month']월:<D><b>$younation['name']</b></>(와)과 {$when}년 불가침 수락");
//국메로 저장 //국메로 저장
$msg = "【외교】$admin[year]$admin[month]월:$younation[name](와)과 {$when}년 불가침 합의, 비고: {$dip2[reserved]}"; $msg = "【외교】$admin['year']$admin['month']월:$younation['name'](와)과 {$when}년 불가침 합의, 비고: {$dip2['reserved']}";
$youmsg = "【외교】$admin[year]$admin[month]월:$mynation[name](와)과 {$when}년 불가침 합의, 비고: {$dip2[reserved]}"; $youmsg = "【외교】$admin['year']$admin['month']월:$mynation['name'](와)과 {$when}년 불가침 합의, 비고: {$dip2['reserved']}";
PushMsg(2, $me[nation], $me[picture], $me[imgsvr], "{$me[name]}:{$mynation[name]}", $mynation[color], $younation[name], $younation[color], $msg); PushMsg(2, $me['nation'], $me['picture'], $me['imgsvr'], "{$me['name']}:{$mynation['name']}", $mynation['color'], $younation['name'], $younation['color'], $msg);
PushMsg(3, $you[nation], $me[picture], $me[imgsvr], "{$me[name]}:{$mynation[name]}", $mynation[color], $younation[name], $younation[color], $youmsg); PushMsg(3, $you['nation'], $me['picture'], $me['imgsvr'], "{$me['name']}:{$mynation['name']}", $mynation['color'], $younation['name'], $younation['color'], $youmsg);
$when = $when * 12; $when = $when * 12;
//외교 변경 //외교 변경
$query = "update diplomacy set state='7',term='$when',fixed='$dip2[reserved]' where me='$me[nation]' and you='$you[nation]'"; $query = "update diplomacy set state='7',term='$when',fixed='$dip2['reserved']' where me='$me['nation']' and you='$you['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update diplomacy set state='7',term='$when',fixed='$dip2[reserved]' where me='$you[nation]' and you='$me[nation]'"; $query = "update diplomacy set state='7',term='$when',fixed='$dip2['reserved']' where me='$you['nation']' and you='$me['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
//조건 지움 //조건 지움
$query = "update diplomacy set reserved='' where me='$you[nation]' and you='$me[nation]'"; $query = "update diplomacy set reserved='' where me='$you['nation']' and you='$me['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//현 메세지 지움 //현 메세지 지움
$query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='$me[nation]'"; $query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='$me['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else { } else {
$youlog[count($youlog)] = "<C>●</><Y>$mynation[name]</>(이)가 불가침을 거부했습니다."; $youlog[count($youlog)] = "<C>●</><Y>$mynation['name']</>(이)가 불가침을 거부했습니다.";
$mylog[count($mylog)] = "<C>●</><D>$younation[name]</>(와)과 불가침을 거부했습니다."; $mylog[count($mylog)] = "<C>●</><D>$younation['name']</>(와)과 불가침을 거부했습니다.";
//조건 지움 //조건 지움
$query = "update diplomacy set reserved='' where me='$you[nation]' and you='$me[nation]'"; $query = "update diplomacy set reserved='' where me='$you['nation']' and you='$me['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//현 메세지 지움 //현 메세지 지움
$query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='$me[nation]'"; $query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='$me['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
+26 -26
View File
@@ -9,7 +9,7 @@ $query = "select year,month 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);
$query = "select no,name,nation,level,history,picture,imgsvr from general where user_id='$_SESSION[p_id]'"; $query = "select no,name,nation,level,history,picture,imgsvr from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
@@ -17,74 +17,74 @@ $query = "select no,nation,history from general where no='$gen'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result); $you = MYDB_fetch_array($result);
$query = "select name,surlimit,history,color from nation where nation='$you[nation]'"; $query = "select name,surlimit,history,color from nation where nation='$you['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$younation = MYDB_fetch_array($result); $younation = MYDB_fetch_array($result);
$query = "select name,gold,rice,surlimit,color,dip{$num} as dipmsg from nation where nation='$me[nation]'"; $query = "select name,gold,rice,surlimit,color,dip{$num} as dipmsg from nation where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$mynation = MYDB_fetch_array($result); $mynation = MYDB_fetch_array($result);
$query = "select pop from city where nation='$me[nation]'"; $query = "select pop from city where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($result); $citycount = MYDB_num_rows($result);
$query = "select city from city where nation='$me[nation]'"; $query = "select city from city where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$losecitynum = MYDB_num_rows($result); $losecitynum = MYDB_num_rows($result);
$query = "select city from city where nation='$you[nation]'"; $query = "select city from city where nation='$you['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$wincitynum = MYDB_num_rows($result); $wincitynum = MYDB_num_rows($result);
//아국과의 관계 //아국과의 관계
$query = "select state from diplomacy where me='$me[nation]' and you='$you[nation]'"; $query = "select state from diplomacy where me='$me['nation']' and you='$you['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dip = MYDB_fetch_array($result); $dip = MYDB_fetch_array($result);
if($ok == "수락") { if($ok == "수락") {
// 서신 보낸 후 멸망,선양 등 했을때. // 서신 보낸 후 멸망,선양 등 했을때.
if($me[level] < 5) { if($me['level'] < 5) {
$mylog[count($mylog)] = "<C>●</>수뇌부가 아니므로 불가능합니다. 파기 실패."; $mylog[count($mylog)] = "<C>●</>수뇌부가 아니므로 불가능합니다. 파기 실패.";
} elseif($losecitynum == 0) { } elseif($losecitynum == 0) {
$mylog[count($mylog)] = "<C>●</>방랑군이므로 불가능합니다. 파기 실패."; $mylog[count($mylog)] = "<C>●</>방랑군이므로 불가능합니다. 파기 실패.";
} elseif($wincitynum == 0) { } elseif($wincitynum == 0) {
$mylog[count($mylog)] = "<C>●</>상대가 방랑군이므로 불가능합니다. 파기 실패."; $mylog[count($mylog)] = "<C>●</>상대가 방랑군이므로 불가능합니다. 파기 실패.";
} elseif($dip[state] != 7) { } elseif($dip['state'] != 7) {
$mylog[count($mylog)] = "<C>●</>아국과 불가침중이 아닙니다. 파기 실패."; $mylog[count($mylog)] = "<C>●</>아국과 불가침중이 아닙니다. 파기 실패.";
} elseif($mynation[dipmsg] == "") { } elseif($mynation['dipmsg'] == "") {
$mylog[count($mylog)] = "<C>●</>이미 거절했습니다. 파기 실패."; $mylog[count($mylog)] = "<C>●</>이미 거절했습니다. 파기 실패.";
} else { } else {
$alllog[count($alllog)] = "<C>●</>{$admin[month]}월:<Y>$me[name]</>(이)가 <D><b>$younation[name]</b></>(와)과 <M>조약 파기</>에 합의."; $alllog[count($alllog)] = "<C>●</>{$admin['month']}월:<Y>$me['name']</>(이)가 <D><b>$younation['name']</b></>(와)과 <M>조약 파기</>에 합의.";
$history[count($history)] = "<C>●</>$admin[year]$admin[month]월:<Y><b>【파기】</b></><D><b>$mynation[name]</b></>(이)가 <D><b>$younation[name]</b></>(와)과 불가침을 파기 하였습니다."; $history[count($history)] = "<C>●</>$admin['year']$admin['month']월:<Y><b>【파기】</b></><D><b>$mynation['name']</b></>(이)가 <D><b>$younation['name']</b></>(와)과 불가침을 파기 하였습니다.";
$youlog[count($youlog)] = "<C>●</><D><b>$mynation[name]</b></>(와)과 파기에 성공했습니다."; $youlog[count($youlog)] = "<C>●</><D><b>$mynation['name']</b></>(와)과 파기에 성공했습니다.";
$mylog[count($mylog)] = "<C>●</><D><b>$younation[name]</b></>(와)과 파기에 합의했습니다."; $mylog[count($mylog)] = "<C>●</><D><b>$younation['name']</b></>(와)과 파기에 합의했습니다.";
$you = addHistory($connect, $you, "<C>●</>$admin[year]$admin[month]월:<D><b>$mynation[name]</b></>(와)과 파기 성공"); $you = addHistory($connect, $you, "<C>●</>$admin['year']$admin['month']월:<D><b>$mynation['name']</b></>(와)과 파기 성공");
$me = addHistory($connect, $me, "<C>●</>$admin[year]$admin[month]월:<D><b>$younation[name]</b></>(와)과 파기 수락"); $me = addHistory($connect, $me, "<C>●</>$admin['year']$admin['month']월:<D><b>$younation['name']</b></>(와)과 파기 수락");
//외교 변경 //외교 변경
$query = "update diplomacy set state='2',term='0' where me='$me[nation]' and you='$you[nation]'"; $query = "update diplomacy set state='2',term='0' where me='$me['nation']' and you='$you['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update diplomacy set state='2',term='0' where me='$you[nation]' and you='$me[nation]'"; $query = "update diplomacy set state='2',term='0' where me='$you['nation']' and you='$me['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//국메로 저장 //국메로 저장
$msg = "【외교】$admin[year]$admin[month]월:$younation[name](와)과 불가침 파기 동의"; $msg = "【외교】$admin['year']$admin['month']월:$younation['name'](와)과 불가침 파기 동의";
$youmsg = "【외교】$admin[year]$admin[month]월:$mynation[name](와)과 불가침 파기 동의"; $youmsg = "【외교】$admin['year']$admin['month']월:$mynation['name'](와)과 불가침 파기 동의";
PushMsg(2, $me[nation], $me[picture], $me[imgsvr], "{$me[name]}:{$mynation[name]}", $mynation[color], $younation[name], $younation[color], $msg); PushMsg(2, $me['nation'], $me['picture'], $me['imgsvr'], "{$me['name']}:{$mynation['name']}", $mynation['color'], $younation['name'], $younation['color'], $msg);
PushMsg(3, $you[nation], $me[picture], $me[imgsvr], "{$me[name]}:{$mynation[name]}", $mynation[color], $younation[name], $younation[color], $youmsg); PushMsg(3, $you['nation'], $me['picture'], $me['imgsvr'], "{$me['name']}:{$mynation['name']}", $mynation['color'], $younation['name'], $younation['color'], $youmsg);
} }
//현 메세지 지움 //현 메세지 지움
$query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='$me[nation]'"; $query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='$me['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else { } else {
$youlog[count($youlog)] = "<C>●</><Y>$mynation[name]</>(이)가 파기를 거부했습니다."; $youlog[count($youlog)] = "<C>●</><Y>$mynation['name']</>(이)가 파기를 거부했습니다.";
$mylog[count($mylog)] = "<C>●</><D>$younation[name]</>(와)과 파기를 거부했습니다."; $mylog[count($mylog)] = "<C>●</><D>$younation['name']</>(와)과 파기를 거부했습니다.";
//현 메세지 지움 //현 메세지 지움
$query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='$me[nation]'"; $query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='$me['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
+28 -28
View File
@@ -9,7 +9,7 @@ $query = "select year,month 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);
$query = "select no,name,nation,level,history,picture,imgsvr from general where user_id='$_SESSION[p_id]'"; $query = "select no,name,nation,level,history,picture,imgsvr from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
@@ -17,79 +17,79 @@ $query = "select no,nation,history from general where no='$gen'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result); $you = MYDB_fetch_array($result);
$query = "select nation,name,surlimit,history,color from nation where nation='$you[nation]'"; $query = "select nation,name,surlimit,history,color from nation where nation='$you['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$younation = MYDB_fetch_array($result); $younation = MYDB_fetch_array($result);
$query = "select nation,name,gold,rice,surlimit,color,dip{$num} as dipmsg from nation where nation='$me[nation]'"; $query = "select nation,name,gold,rice,surlimit,color,dip{$num} as dipmsg from nation where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$mynation = MYDB_fetch_array($result); $mynation = MYDB_fetch_array($result);
$query = "select pop from city where nation='$me[nation]'"; $query = "select pop from city where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($result); $citycount = MYDB_num_rows($result);
$query = "select city from city where nation='$me[nation]'"; $query = "select city from city where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$losecitynum = MYDB_num_rows($result); $losecitynum = MYDB_num_rows($result);
$query = "select city from city where nation='$you[nation]'"; $query = "select city from city where nation='$you['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$wincitynum = MYDB_num_rows($result); $wincitynum = MYDB_num_rows($result);
//아국과의 관계 //아국과의 관계
$query = "select state from diplomacy where me='$me[nation]' and you='$you[nation]'"; $query = "select state from diplomacy where me='$me['nation']' and you='$you['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dip = MYDB_fetch_array($result); $dip = MYDB_fetch_array($result);
if($ok == "수락") { if($ok == "수락") {
// 서신 보낸 후 멸망,선양 등 했을때. // 서신 보낸 후 멸망,선양 등 했을때.
if($me[level] < 5) { if($me['level'] < 5) {
$mylog[count($mylog)] = "<C>●</>수뇌부가 아니므로 불가능합니다. 종전 실패."; $mylog[count($mylog)] = "<C>●</>수뇌부가 아니므로 불가능합니다. 종전 실패.";
} elseif($losecitynum == 0) { } elseif($losecitynum == 0) {
$mylog[count($mylog)] = "<C>●</>방랑군이므로 불가능합니다. 종전 실패."; $mylog[count($mylog)] = "<C>●</>방랑군이므로 불가능합니다. 종전 실패.";
} elseif($wincitynum == 0) { } elseif($wincitynum == 0) {
$mylog[count($mylog)] = "<C>●</>상대가 방랑군이므로 불가능합니다. 종전 실패."; $mylog[count($mylog)] = "<C>●</>상대가 방랑군이므로 불가능합니다. 종전 실패.";
} elseif($dip[state] != 0 && $dip[state] != 1) { } elseif($dip['state'] != 0 && $dip['state'] != 1) {
$mylog[count($mylog)] = "<C>●</>아국과 교전중이 아닙니다. 종전 실패."; $mylog[count($mylog)] = "<C>●</>아국과 교전중이 아닙니다. 종전 실패.";
} elseif($mynation[dipmsg] == "") { } elseif($mynation['dipmsg'] == "") {
$mylog[count($mylog)] = "<C>●</>이미 거절했습니다. 불가침 실패."; $mylog[count($mylog)] = "<C>●</>이미 거절했습니다. 불가침 실패.";
} else { } else {
$alllog[count($alllog)] = "<C>●</>{$admin[month]}월:<Y>$me[name]</>(이)가 <D><b>$younation[name]</b></>(와)과 <M>종전 합의</> 하였습니다."; $alllog[count($alllog)] = "<C>●</>{$admin['month']}월:<Y>$me['name']</>(이)가 <D><b>$younation['name']</b></>(와)과 <M>종전 합의</> 하였습니다.";
$history[count($history)] = "<C>●</>$admin[year]$admin[month]월:<Y><b>【종전】</b></><D><b>$mynation[name]</b></>(이)가 <D><b>$younation[name]</b></>(와)과 <M>종전 합의</> 하였습니다."; $history[count($history)] = "<C>●</>$admin['year']$admin['month']월:<Y><b>【종전】</b></><D><b>$mynation['name']</b></>(이)가 <D><b>$younation['name']</b></>(와)과 <M>종전 합의</> 하였습니다.";
$youlog[count($youlog)] = "<C>●</><D><b>$mynation[name]</b></>(와)과 종전에 성공했습니다."; $youlog[count($youlog)] = "<C>●</><D><b>$mynation['name']</b></>(와)과 종전에 성공했습니다.";
$mylog[count($mylog)] = "<C>●</><D><b>$younation[name]</b></>(와)과 종전에 합의했습니다."; $mylog[count($mylog)] = "<C>●</><D><b>$younation['name']</b></>(와)과 종전에 합의했습니다.";
$you = addHistory($connect, $you, "<C>●</>$admin[year]$admin[month]월:<D><b>$mynation[name]</b></>(와)과 종전 성공"); $you = addHistory($connect, $you, "<C>●</>$admin['year']$admin['month']월:<D><b>$mynation['name']</b></>(와)과 종전 성공");
$me = addHistory($connect, $me, "<C>●</>$admin[year]$admin[month]월:<D><b>$younation[name]</b></>(와)과 종전 수락"); $me = addHistory($connect, $me, "<C>●</>$admin['year']$admin['month']월:<D><b>$younation['name']</b></>(와)과 종전 수락");
//외교 변경 //외교 변경
$query = "update diplomacy set state='2',term='0' where me='$mynation[nation]' and you='$younation[nation]'"; $query = "update diplomacy set state='2',term='0' where me='$mynation['nation']' and you='$younation['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update diplomacy set state='2',term='0' where me='$younation[nation]' and you='$mynation[nation]'"; $query = "update diplomacy set state='2',term='0' where me='$younation['nation']' and you='$mynation['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//외교제한 //외교제한
$query = "update nation set surlimit=24 where nation='$mynation[nation]'"; $query = "update nation set surlimit=24 where nation='$mynation['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update nation set surlimit=24 where nation='$younation[nation]'"; $query = "update nation set surlimit=24 where nation='$younation['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//국메로 저장 //국메로 저장
$msg = "【외교】$admin[year]$admin[month]월:$younation[name](와)과 종전 동의"; $msg = "【외교】$admin['year']$admin['month']월:$younation['name'](와)과 종전 동의";
$youmsg = "【외교】$admin[year]$admin[month]월:$mynation[name](와)과 종전 동의"; $youmsg = "【외교】$admin['year']$admin['month']월:$mynation['name'](와)과 종전 동의";
PushMsg(2, $mynation[nation], $me[picture], $me[imgsvr], "{$me[name]}:{$mynation[name]}", $mynation[color], $younation[name], $younation[color], $msg); PushMsg(2, $mynation['nation'], $me['picture'], $me['imgsvr'], "{$me['name']}:{$mynation['name']}", $mynation['color'], $younation['name'], $younation['color'], $msg);
PushMsg(3, $younation[nation], $me[picture], $me[imgsvr], "{$me[name]}:{$mynation[name]}", $mynation[color], $younation[name], $younation[color], $youmsg); PushMsg(3, $younation['nation'], $me['picture'], $me['imgsvr'], "{$me['name']}:{$mynation['name']}", $mynation['color'], $younation['name'], $younation['color'], $youmsg);
} }
//현 메세지 지움 //현 메세지 지움
$query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='$me[nation]'"; $query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='$me['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else { } else {
$youlog[count($youlog)] = "<C>●</><Y>$mynation[name]</>(이)가 종전을 거부했습니다."; $youlog[count($youlog)] = "<C>●</><Y>$mynation['name']</>(이)가 종전을 거부했습니다.";
$mylog[count($mylog)] = "<C>●</><D>$younation[name]</>(와)과 종전을 거부했습니다."; $mylog[count($mylog)] = "<C>●</><D>$younation['name']</>(와)과 종전을 거부했습니다.";
//현 메세지 지움 //현 메세지 지움
$query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='$me[nation]'"; $query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='$me['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
+34 -34
View File
@@ -9,7 +9,7 @@ $query = "select year,month 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);
$query = "select no,name,nation,level,history,picture,imgsvr from general where user_id='$_SESSION[p_id]'"; $query = "select no,name,nation,level,history,picture,imgsvr from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
@@ -25,32 +25,32 @@ $query = "select round(std(power)) as power,round(std(gennum)) as gennum from na
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$stdnation = MYDB_fetch_array($result); $stdnation = MYDB_fetch_array($result);
$query = "select nation,name,gennum,power,surlimit,history,color from nation where nation='$you[nation]'"; $query = "select nation,name,gennum,power,surlimit,history,color from nation where nation='$you['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$younation = MYDB_fetch_array($result); $younation = MYDB_fetch_array($result);
$query = "select nation,name,gennum,power,gold,rice,surlimit,color,dip{$num} as dipmsg from nation where nation='$me[nation]'"; $query = "select nation,name,gennum,power,gold,rice,surlimit,color,dip{$num} as dipmsg from nation where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$mynation = MYDB_fetch_array($result); $mynation = MYDB_fetch_array($result);
$query = "select city from city where nation='$me[nation]'"; $query = "select city from city where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$losecitynum = MYDB_num_rows($result); $losecitynum = MYDB_num_rows($result);
$query = "select city from city where nation='$you[nation]'"; $query = "select city from city where nation='$you['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$wincitynum = MYDB_num_rows($result); $wincitynum = MYDB_num_rows($result);
//아국과의 관계 //아국과의 관계
$query = "select state from diplomacy where me='$me[nation]' and you='$you[nation]'"; $query = "select state from diplomacy where me='$me['nation']' and you='$you['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dip = MYDB_fetch_array($result); $dip = MYDB_fetch_array($result);
//대상국이 외교 진행중(선포중,교전중,합병수락중,통합수락중)일때 //대상국이 외교 진행중(선포중,교전중,합병수락중,통합수락중)일때
$query = "select state from diplomacy where me='$you[nation]' and (state='0' or state='1' or state='3' or state='5')"; $query = "select state from diplomacy where me='$you['nation']' and (state='0' or state='1' or state='3' or state='5')";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dipcount = MYDB_num_rows($result); $dipcount = MYDB_num_rows($result);
//대상국B이 아국C과 교전중인 국가A와 불가침중일때 불가(A=B 불가침, A=C(아국) 교전, B<-C(아국) 항복) //대상국B이 아국C과 교전중인 국가A와 불가침중일때 불가(A=B 불가침, A=C(아국) 교전, B<-C(아국) 항복)
$query = "select you,state from diplomacy where me='$me[nation]' and (state='0' or state='1')"; $query = "select you,state from diplomacy where me='$me['nation']' and (state='0' or state='1')";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$warcount = MYDB_num_rows($result); $warcount = MYDB_num_rows($result);
// 아국과 교전중인 국가 골라냄 // 아국과 교전중인 국가 골라냄
@@ -58,72 +58,72 @@ $valid = 1;
for($i=0; $i < $warcount; $i++) { for($i=0; $i < $warcount; $i++) {
$acdip = MYDB_fetch_array($result); $acdip = MYDB_fetch_array($result);
//교전중 국가A와 대상국B 외교 확인 //교전중 국가A와 대상국B 외교 확인
$query = "select state from diplomacy where me='$acdip[you]' and you='$you[nation]'"; $query = "select state from diplomacy where me='$acdip['you']' and you='$you['nation']'";
$dipresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $dipresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$abdip = MYDB_fetch_array($dipresult); $abdip = MYDB_fetch_array($dipresult);
if($abdip[state] == 7) { if($abdip['state'] == 7) {
$valid = 0; $valid = 0;
} }
} }
if($ok == "수락") { if($ok == "수락") {
// 서신 보낸 후 멸망 했을때. // 서신 보낸 후 멸망 했을때.
if($me[level] < 5) { if($me['level'] < 5) {
$mylog[count($mylog)] = "<C>●</>수뇌부가 아니므로 불가능합니다. 통합 실패."; $mylog[count($mylog)] = "<C>●</>수뇌부가 아니므로 불가능합니다. 통합 실패.";
} elseif($mynation[surlimit] > 0) { } elseif($mynation['surlimit'] > 0) {
$mylog[count($mylog)] = "<C>●</>본국이 외교제한이 지나지 않았습니다. 통합 실패."; $mylog[count($mylog)] = "<C>●</>본국이 외교제한이 지나지 않았습니다. 통합 실패.";
} elseif($younation[surlimit] > 0) { } elseif($younation['surlimit'] > 0) {
$mylog[count($mylog)] = "<C>●</>상대국이 외교제한이 지나지 않았습니다. 통합 실패."; $mylog[count($mylog)] = "<C>●</>상대국이 외교제한이 지나지 않았습니다. 통합 실패.";
} elseif($losecitynum == 0) { } elseif($losecitynum == 0) {
$mylog[count($mylog)] = "<C>●</>방랑군이므로 불가능합니다. 통합 실패."; $mylog[count($mylog)] = "<C>●</>방랑군이므로 불가능합니다. 통합 실패.";
} elseif($wincitynum == 0) { } elseif($wincitynum == 0) {
$mylog[count($mylog)] = "<C>●</>상대가 방랑군이므로 불가능합니다. 통합 실패."; $mylog[count($mylog)] = "<C>●</>상대가 방랑군이므로 불가능합니다. 통합 실패.";
} elseif($mynation[power]+$younation[power] > $avgnation[power]+$stdnation[power]) { } elseif($mynation['power']+$younation['power'] > $avgnation['power']+$stdnation['power']) {
$mylog[count($mylog)] = "<C>●</>양국 국력이 너무 높습니다. 통합 실패."; $mylog[count($mylog)] = "<C>●</>양국 국력이 너무 높습니다. 통합 실패.";
} elseif($mynation[gennum]+$younation[gennum] > $avgnation[gennum]+$stdnation[gennum]) { } elseif($mynation['gennum']+$younation['gennum'] > $avgnation['gennum']+$stdnation['gennum']) {
$mylog[count($mylog)] = "<C>●</>양국 장수가 많습니다. 통합 실패."; $mylog[count($mylog)] = "<C>●</>양국 장수가 많습니다. 통합 실패.";
} elseif(!isClose($connect, $younation[nation], $mynation[nation])) { } elseif(!isClose($connect, $younation['nation'], $mynation['nation'])) {
$mylog[count($mylog)] = "<C>●</>인접한 국가가 아니므로 불가능합니다. 통합 실패."; $mylog[count($mylog)] = "<C>●</>인접한 국가가 아니므로 불가능합니다. 통합 실패.";
} elseif($dip[state] == 0) { } elseif($dip['state'] == 0) {
$mylog[count($mylog)] = "<C>●</>아국과 교전중입니다. 통합 실패."; $mylog[count($mylog)] = "<C>●</>아국과 교전중입니다. 통합 실패.";
} elseif($dipcount != 0) { } elseif($dipcount != 0) {
$mylog[count($mylog)] = "<C>●</>상대국이 외교 진행중입니다. 통합 실패."; $mylog[count($mylog)] = "<C>●</>상대국이 외교 진행중입니다. 통합 실패.";
} elseif($valid == 0) { } elseif($valid == 0) {
$mylog[count($mylog)] = "<C>●</>상대국이 아국의 교전국과 불가침중입니다. 통합 실패."; $mylog[count($mylog)] = "<C>●</>상대국이 아국의 교전국과 불가침중입니다. 통합 실패.";
} elseif($mynation[dipmsg] == "") { } elseif($mynation['dipmsg'] == "") {
$mylog[count($mylog)] = "<C>●</>이미 거절했습니다. 불가침 실패."; $mylog[count($mylog)] = "<C>●</>이미 거절했습니다. 불가침 실패.";
} else { } else {
$youlog[count($youlog)] = "<C>●</><D><b>$mynation[name]</b></>(이)가 통합에 동의했습니다."; $youlog[count($youlog)] = "<C>●</><D><b>$mynation['name']</b></>(이)가 통합에 동의했습니다.";
$history[count($history)] = "<C>●</>$admin[year]$admin[month]월:<Y><b>【통합시도】</b></><D><b>$mynation[name]</b></>(와)과 <D><b>$younation[name]</b></>(이)가 통합을 시도합니다."; $history[count($history)] = "<C>●</>$admin['year']$admin['month']월:<Y><b>【통합시도】</b></><D><b>$mynation['name']</b></>(와)과 <D><b>$younation['name']</b></>(이)가 통합을 시도합니다.";
$mylog[count($mylog)] = "<C>●</><D><b>$younation[name]</b></>(와)과 통합에 동의했습니다."; $mylog[count($mylog)] = "<C>●</><D><b>$younation['name']</b></>(와)과 통합에 동의했습니다.";
$alllog[count($alllog)] = "<C>●</>{$admin[month]}월:<Y>$me[name]</>(이)가 <D><b>$younation[name]</b></>(와)과 <M>통합</>에 동의하였습니다."; $alllog[count($alllog)] = "<C>●</>{$admin['month']}월:<Y>$me['name']</>(이)가 <D><b>$younation['name']</b></>(와)과 <M>통합</>에 동의하였습니다.";
$you = addHistory($connect, $you, "<C>●</>$admin[year]$admin[month]월:<D><b>$mynation[name]</b></>(와)과 통합 시도"); $you = addHistory($connect, $you, "<C>●</>$admin['year']$admin['month']월:<D><b>$mynation['name']</b></>(와)과 통합 시도");
$me = addHistory($connect, $me, "<C>●</>$admin[year]$admin[month]월:<D><b>$younation[name]</b></>(와)과 통합 시도"); $me = addHistory($connect, $me, "<C>●</>$admin['year']$admin['month']월:<D><b>$younation['name']</b></>(와)과 통합 시도");
//외교 변경 //외교 변경
$query = "update diplomacy set state='3',term='24' where me='$mynation[nation]' and you='$younation[nation]'"; $query = "update diplomacy set state='3',term='24' where me='$mynation['nation']' and you='$younation['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update diplomacy set state='4',term='24' where me='$younation[nation]' and you='$mynation[nation]'"; $query = "update diplomacy set state='4',term='24' where me='$younation['nation']' and you='$mynation['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//국메로 저장 //국메로 저장
$msg = "【외교】$admin[year]$admin[month]월:$younation[name](와)과 통합에 합의"; $msg = "【외교】$admin['year']$admin['month']월:$younation['name'](와)과 통합에 합의";
$youmsg = "【외교】$admin[year]$admin[month]월:$mynation[name](와)과 통합에 합의"; $youmsg = "【외교】$admin['year']$admin['month']월:$mynation['name'](와)과 통합에 합의";
PushMsg(2, $mynation[nation], $me[picture], $me[imgsvr], "{$me[name]}:{$mynation[name]}", $mynation[color], $younation[name], $younation[color], $msg); PushMsg(2, $mynation['nation'], $me['picture'], $me['imgsvr'], "{$me['name']}:{$mynation['name']}", $mynation['color'], $younation['name'], $younation['color'], $msg);
PushMsg(3, $younation[nation], $me[picture], $me[imgsvr], "{$me[name]}:{$mynation[name]}", $mynation[color], $younation[name], $younation[color], $youmsg); PushMsg(3, $younation['nation'], $me['picture'], $me['imgsvr'], "{$me['name']}:{$mynation['name']}", $mynation['color'], $younation['name'], $younation['color'], $youmsg);
} }
//현 메세지 지움 //현 메세지 지움
$query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='$me[nation]'"; $query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='$me['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else { } else {
$youlog[count($youlog)] = "<C>●</><Y>$mynation[name]</>(이)가 항복을 거부했습니다."; $youlog[count($youlog)] = "<C>●</><Y>$mynation['name']</>(이)가 항복을 거부했습니다.";
$mylog[count($mylog)] = "<C>●</><D>$younation[name]</>(으)로 항복을 거부했습니다."; $mylog[count($mylog)] = "<C>●</><D>$younation['name']</>(으)로 항복을 거부했습니다.";
//현 메세지 지움 //현 메세지 지움
$query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='$me[nation]'"; $query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='$me['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
+44 -44
View File
@@ -9,7 +9,7 @@ $query = "select startyear,year,month,killturn 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);
$query = "select no,name,nation,nations,level,troop,history,npc,gold,rice from general where user_id='$_SESSION[p_id]'"; $query = "select no,name,nation,nations,level,troop,history,npc,gold,rice from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
@@ -17,139 +17,139 @@ $query = "select no,nation,history from general where no='$gen'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result); $you = MYDB_fetch_array($result);
$query = "select name,nation,level,capital,scout from nation where nation='$you[nation]'"; $query = "select name,nation,level,capital,scout from nation where nation='$you['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
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) { 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[count($youlog)] = "<C>●</><Y>$me[name]</> 등용에 성공했습니다."; $youlog[count($youlog)] = "<C>●</><Y>$me['name']</> 등용에 성공했습니다.";
$alllog[count($alllog)] = "<C>●</>{$admin[month]}월:<Y>$me[name]</>(이)가 <D><b>$nation[name]</b></>(으)로 <S>망명</>하였습니다."; $alllog[count($alllog)] = "<C>●</>{$admin['month']}월:<Y>$me['name']</>(이)가 <D><b>$nation['name']</b></>(으)로 <S>망명</>하였습니다.";
$mylog[count($mylog)] = "<C>●</><D>$nation[name]</>(으)로 망명하여 수도로 이동합니다."; $mylog[count($mylog)] = "<C>●</><D>$nation['name']</>(으)로 망명하여 수도로 이동합니다.";
$you = addHistory($connect, $you, "<C>●</>$admin[year]$admin[month]월:<Y>$me[name]</> 등용에 성공"); $you = addHistory($connect, $you, "<C>●</>$admin['year']$admin['month']월:<Y>$me['name']</> 등용에 성공");
$me = addHistory($connect, $me, "<C>●</>$admin[year]$admin[month]월:<D>$nation[name]</>(으)로 망명"); $me = addHistory($connect, $me, "<C>●</>$admin['year']$admin['month']월:<D>$nation['name']</>(으)로 망명");
// 임관내역 추가 // 임관내역 추가
$me['nations'] .= "{$nation['nation']},"; $me['nations'] .= "{$nation['nation']},";
// 국가 변경, 도시 변경, 일반으로, 수도로 // 국가 변경, 도시 변경, 일반으로, 수도로
$query = "update general set killturn='$admin[killturn]',belong=1,nation='$you[nation]',nations='{$me['nations']}',level=1,city='$nation[capital]' where no='$me[no]'"; $query = "update general set killturn='$admin['killturn']',belong=1,nation='$you['nation']',nations='{$me['nations']}',level=1,city='$nation['capital']' where no='$me['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 재야가 아니면 명성N*10% 공헌N*10%감소 // 재야가 아니면 명성N*10% 공헌N*10%감소
if($me[level] > 0) { if($me['level'] > 0) {
// 1000 1000 남기고 환수 // 1000 1000 남기고 환수
if($me[gold] > 1000) { $gold = $me[gold] - 1000; $me[gold] = 1000; } else { $gold = 0; } if($me['gold'] > 1000) { $gold = $me['gold'] - 1000; $me['gold'] = 1000; } else { $gold = 0; }
if($me[rice] > 1000) { $rice = $me[rice] - 1000; $me[rice] = 1000; } else { $rice = 0; } if($me['rice'] > 1000) { $rice = $me['rice'] - 1000; $me['rice'] = 1000; } else { $rice = 0; }
$query = "update general set gold='$me[gold]',rice='$me[rice]',betray=betray+1,dedication=dedication*(1-0.1*betray),experience=experience*(1-0.1*betray) where no='$me[no]'"; $query = "update general set gold='$me['gold']',rice='$me['rice']',betray=betray+1,dedication=dedication*(1-0.1*betray),experience=experience*(1-0.1*betray) where no='$me['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update nation set gold=gold+'$gold',rice=rice+'$rice' where nation='$me[nation]'"; $query = "update nation set gold=gold+'$gold',rice=rice+'$rice' where nation='$me['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else { } else {
//재야이면 100 100 증가 //재야이면 100 100 증가
$query = "update general set dedication=dedication+100,experience=experience+100 where no='$me[no]'"; $query = "update general set dedication=dedication+100,experience=experience+100 where no='$me['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
//유저이면 삭턴 리셋 //유저이면 삭턴 리셋
if($me[npc] < 2) { if($me['npc'] < 2) {
$query = "update general set killturn='$admin[killturn]' where no='$me[no]'"; $query = "update general set killturn='$admin['killturn']' where no='$me['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
//태수 군사 시중 해제 //태수 군사 시중 해제
switch($me[level]) { switch($me['level']) {
case 4: case 4:
$query = "update city set gen1=0 where gen1='$me[no]'"; $query = "update city set gen1=0 where gen1='$me['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break; break;
case 3: case 3:
$query = "update city set gen2=0 where gen2='$me[no]'"; $query = "update city set gen2=0 where gen2='$me['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break; break;
case 2: case 2:
$query = "update city set gen3=0 where gen3='$me[no]'"; $query = "update city set gen3=0 where gen3='$me['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break; break;
} }
//등용자 명성, 공헌 상승 //등용자 명성, 공헌 상승
$query = "update general set dedication=dedication+100,experience=experience+100 where no='$you[no]'"; $query = "update general set dedication=dedication+100,experience=experience+100 where no='$you['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 부대 처리 // 부대 처리
$query = "select no from troop where troop='$me[troop]'"; $query = "select no from troop where troop='$me['troop']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$troop = MYDB_fetch_array($result); $troop = MYDB_fetch_array($result);
//부대장일 경우 //부대장일 경우
if($troop[no] == $me[no]) { if($troop['no'] == $me['no']) {
// 모두 탈퇴 // 모두 탈퇴
$query = "update general set troop='0' where troop='$me[troop]'"; $query = "update general set troop='0' where troop='$me['troop']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 부대 삭제 // 부대 삭제
$query = "delete from troop where troop='$me[troop]'"; $query = "delete from troop where troop='$me['troop']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else { } else {
$query = "update general set troop='0' where no='$me[no]'"; $query = "update general set troop='0' where no='$me['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
//국가 기술력 그대로 //국가 기술력 그대로
$query = "select no from general where nation='$nation[nation]'"; $query = "select no from general where nation='$nation['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result); $gencount = MYDB_num_rows($result);
$gennum = $gencount; $gennum = $gencount;
if($gencount < 10) $gencount = 10; if($gencount < 10) $gencount = 10;
$query = "update nation set totaltech=tech*'$gencount',gennum='$gennum' where nation='$nation[nation]'"; $query = "update nation set totaltech=tech*'$gencount',gennum='$gennum' where nation='$nation['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//기존 국가 기술력 그대로 //기존 국가 기술력 그대로
$query = "select no from general where nation='$me[nation]'"; $query = "select no from general where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result); $gencount = MYDB_num_rows($result);
$gennum = $gencount; $gennum = $gencount;
if($gencount < 10) $gencount = 10; if($gencount < 10) $gencount = 10;
$query = "update nation set totaltech=tech*'$gencount',gennum='$gennum' where nation='$me[nation]'"; $query = "update nation set totaltech=tech*'$gencount',gennum='$gennum' where nation='$me['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//현 메세지 수정 //현 메세지 수정
$query = "update general set msg{$num}='$nation[name](으)로 등용 제의 수락',msg{$num}_type='10' where no='$me[no]'"; $query = "update general set msg{$num}='$nation['name'](으)로 등용 제의 수락',msg{$num}_type='10' where no='$me['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($me[level] == 12) { } elseif($me['level'] == 12) {
$mylog[count($mylog)] = "<C>●</>군주입니다. 등용 수락 불가."; $mylog[count($mylog)] = "<C>●</>군주입니다. 등용 수락 불가.";
//현 메세지 지움 //현 메세지 지움
$query = "update general set msg{$num}='$nation[name](으)로 등용 제의 수락 불가',msg{$num}_type='10' where no='$me[no]'"; $query = "update general set msg{$num}='$nation['name'](으)로 등용 제의 수락 불가',msg{$num}_type='10' where no='$me['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($nation[level] == 0) { } elseif($nation['level'] == 0) {
$mylog[count($mylog)] = "<C>●</>없는 국가이거나 방랑군입니다. 등용 수락 불가."; $mylog[count($mylog)] = "<C>●</>없는 국가이거나 방랑군입니다. 등용 수락 불가.";
//현 메세지 지움 //현 메세지 지움
$query = "update general set msg{$num}='$nation[name](으)로 등용 제의 수락 불가',msg{$num}_type='10' where no='$me[no]'"; $query = "update general set msg{$num}='$nation['name'](으)로 등용 제의 수락 불가',msg{$num}_type='10' where no='$me['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($nation[scout] != 0) { } elseif($nation['scout'] != 0) {
$mylog[count($mylog)] = "<C>●</>임관 금지중입니다. 등용 수락 불가."; $mylog[count($mylog)] = "<C>●</>임관 금지중입니다. 등용 수락 불가.";
//현 메세지 지움 //현 메세지 지움
$query = "update general set msg{$num}='$nation[name](으)로 등용 제의 수락 불가',msg{$num}_type='10' where no='$me[no]'"; $query = "update general set msg{$num}='$nation['name'](으)로 등용 제의 수락 불가',msg{$num}_type='10' where no='$me['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($admin[year] < $admin[startyear]+3) { } elseif($admin['year'] < $admin['startyear']+3) {
$mylog[count($mylog)] = "<C>●</>초반 제한중입니다. 등용 수락 불가."; $mylog[count($mylog)] = "<C>●</>초반 제한중입니다. 등용 수락 불가.";
//현 메세지 지움 //현 메세지 지움
$query = "update general set msg{$num}='$nation[name](으)로 등용 제의 수락 불가',msg{$num}_type='10' where no='$me[no]'"; $query = "update general set msg{$num}='$nation['name'](으)로 등용 제의 수락 불가',msg{$num}_type='10' where no='$me['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif(strpos($me['nations'], ",{$nation['nation']},") > 0) { } elseif(strpos($me['nations'], ",{$nation['nation']},") > 0) {
$mylog[count($mylog)] = "<C>●</>이미 임관했었던 국가입니다. 등용 수락 불가."; $mylog[count($mylog)] = "<C>●</>이미 임관했었던 국가입니다. 등용 수락 불가.";
//현 메세지 지움 //현 메세지 지움
$query = "update general set msg{$num}='$nation[name](으)로 등용 제의 수락 불가',msg{$num}_type='10' where no='$me[no]'"; $query = "update general set msg{$num}='$nation['name'](으)로 등용 제의 수락 불가',msg{$num}_type='10' where no='$me['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else { } else {
$youlog[count($youlog)] = "<C>●</><Y>$me[name]</>(이)가 등용을 거부했습니다."; $youlog[count($youlog)] = "<C>●</><Y>$me['name']</>(이)가 등용을 거부했습니다.";
$mylog[count($mylog)] = "<C>●</><D>$nation[name]</>(으)로 망명을 거부했습니다."; $mylog[count($mylog)] = "<C>●</><D>$nation['name']</>(으)로 망명을 거부했습니다.";
//현 메세지 지움 //현 메세지 지움
$query = "update general set msg{$num}='$nation[name](으)로 등용 제의 거부',msg{$num}_type='10' where no='$me[no]'"; $query = "update general set msg{$num}='$nation['name'](으)로 등용 제의 거부',msg{$num}_type='10' where no='$me['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
+33 -33
View File
@@ -9,7 +9,7 @@ $query = "select year,month 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);
$query = "select no,name,nation,level,history,picture,imgsvr from general where user_id='$_SESSION[p_id]'"; $query = "select no,name,nation,level,history,picture,imgsvr from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
@@ -17,32 +17,32 @@ $query = "select no,nation,history from general where no='$gen'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$you = MYDB_fetch_array($result); $you = MYDB_fetch_array($result);
$query = "select nation,name,power,gold,rice,surlimit,history,color from nation where nation='$you[nation]'"; $query = "select nation,name,power,gold,rice,surlimit,history,color from nation where nation='$you['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$younation = MYDB_fetch_array($result); $younation = MYDB_fetch_array($result);
$query = "select nation,name,power,surlimit,color,dip{$num} as dipmsg from nation where nation='$me[nation]'"; $query = "select nation,name,power,surlimit,color,dip{$num} as dipmsg from nation where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$mynation = MYDB_fetch_array($result); $mynation = MYDB_fetch_array($result);
$query = "select city from city where nation='$me[nation]'"; $query = "select city from city where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$losecitynum = MYDB_num_rows($result); $losecitynum = MYDB_num_rows($result);
$query = "select city from city where nation='$you[nation]'"; $query = "select city from city where nation='$you['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$wincitynum = MYDB_num_rows($result); $wincitynum = MYDB_num_rows($result);
//아국과의 관계 //아국과의 관계
$query = "select state from diplomacy where me='$me[nation]' and you='$you[nation]'"; $query = "select state from diplomacy where me='$me['nation']' and you='$you['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dip = MYDB_fetch_array($result); $dip = MYDB_fetch_array($result);
//대상국이 외교 진행중(선포중,교전중,합병수락중,통합수락중)일때 //대상국이 외교 진행중(선포중,교전중,합병수락중,통합수락중)일때
$query = "select state from diplomacy where me='$you[nation]' and (state='0' or state='1' or state='3' or state='5')"; $query = "select state from diplomacy where me='$you['nation']' and (state='0' or state='1' or state='3' or state='5')";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dipcount = MYDB_num_rows($result); $dipcount = MYDB_num_rows($result);
//대상국B이 아국C과 교전중인 국가A와 불가침중일때 불가(A=B 불가침, A=C(아국) 교전, B<-C(아국) 항복) //대상국B이 아국C과 교전중인 국가A와 불가침중일때 불가(A=B 불가침, A=C(아국) 교전, B<-C(아국) 항복)
$query = "select you,state from diplomacy where me='$me[nation]' and (state='0' or state='1')"; $query = "select you,state from diplomacy where me='$me['nation']' and (state='0' or state='1')";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$warcount = MYDB_num_rows($result); $warcount = MYDB_num_rows($result);
// 아국과 교전중인 국가 골라냄 // 아국과 교전중인 국가 골라냄
@@ -50,70 +50,70 @@ $valid = 1;
for($i=0; $i < $warcount; $i++) { for($i=0; $i < $warcount; $i++) {
$acdip = MYDB_fetch_array($result); $acdip = MYDB_fetch_array($result);
//교전중 국가A와 대상국B 외교 확인 //교전중 국가A와 대상국B 외교 확인
$query = "select state from diplomacy where me='$acdip[you]' and you='$you[nation]'"; $query = "select state from diplomacy where me='$acdip['you']' and you='$you['nation']'";
$dipresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $dipresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$abdip = MYDB_fetch_array($dipresult); $abdip = MYDB_fetch_array($dipresult);
if($abdip[state] == 7) { if($abdip['state'] == 7) {
$valid = 0; $valid = 0;
} }
} }
if($ok == "수락") { if($ok == "수락") {
// 서신 보낸 후 멸망 했을때. // 서신 보낸 후 멸망 했을때.
if($me[level] < 5) { if($me['level'] < 5) {
$mylog[count($mylog)] = "<C>●</>수뇌부가 아니므로 불가능합니다. 투항 실패."; $mylog[count($mylog)] = "<C>●</>수뇌부가 아니므로 불가능합니다. 투항 실패.";
} elseif($mynation[surlimit] > 0) { } elseif($mynation['surlimit'] > 0) {
$mylog[count($mylog)] = "<C>●</>본국이 외교제한이 지나지 않았습니다. 투항 실패."; $mylog[count($mylog)] = "<C>●</>본국이 외교제한이 지나지 않았습니다. 투항 실패.";
} elseif($younation[surlimit] > 0) { } elseif($younation['surlimit'] > 0) {
$mylog[count($mylog)] = "<C>●</>상대국이 외교제한이 지나지 않았습니다. 투항 실패."; $mylog[count($mylog)] = "<C>●</>상대국이 외교제한이 지나지 않았습니다. 투항 실패.";
// } elseif($losecitynum == 0) { // } elseif($losecitynum == 0) {
// $mylog[count($mylog)] = "<C>●</>방랑군이므로 불가능합니다. 투항 실패."; // $mylog[count($mylog)] = "<C>●</>방랑군이므로 불가능합니다. 투항 실패.";
} elseif($wincitynum == 0) { } elseif($wincitynum == 0) {
$mylog[count($mylog)] = "<C>●</>상대가 방랑군이므로 불가능합니다. 투항 실패."; $mylog[count($mylog)] = "<C>●</>상대가 방랑군이므로 불가능합니다. 투항 실패.";
} elseif($younation[power] / $mynation[power] <= 3) { } elseif($younation['power'] / $mynation['power'] <= 3) {
$mylog[count($mylog)] = "<C>●</>아국과 상대국의 국력차이가 크지 않습니다. 투항 실패."; $mylog[count($mylog)] = "<C>●</>아국과 상대국의 국력차이가 크지 않습니다. 투항 실패.";
} elseif($losecitynum != 0 && !isClose($connect, $younation[nation], $mynation[nation])) { } elseif($losecitynum != 0 && !isClose($connect, $younation['nation'], $mynation['nation'])) {
$mylog[count($mylog)] = "<C>●</>인접한 국가가 아니므로 불가능합니다. 투항 실패."; $mylog[count($mylog)] = "<C>●</>인접한 국가가 아니므로 불가능합니다. 투항 실패.";
} elseif($dip[state] == 0) { } elseif($dip['state'] == 0) {
$mylog[count($mylog)] = "<C>●</>아국과 교전중입니다. 투항 실패."; $mylog[count($mylog)] = "<C>●</>아국과 교전중입니다. 투항 실패.";
} elseif($dipcount != 0) { } elseif($dipcount != 0) {
$mylog[count($mylog)] = "<C>●</>상대국이 외교 진행중입니다. 투항 실패."; $mylog[count($mylog)] = "<C>●</>상대국이 외교 진행중입니다. 투항 실패.";
} elseif($valid == 0) { } elseif($valid == 0) {
$mylog[count($mylog)] = "<C>●</>상대국이 아국의 교전국과 불가침중입니다. 투항 실패."; $mylog[count($mylog)] = "<C>●</>상대국이 아국의 교전국과 불가침중입니다. 투항 실패.";
} elseif($mynation[dipmsg] == "") { } elseif($mynation['dipmsg'] == "") {
$mylog[count($mylog)] = "<C>●</>이미 거절했습니다. 불가침 실패."; $mylog[count($mylog)] = "<C>●</>이미 거절했습니다. 불가침 실패.";
} else { } else {
$youlog[count($youlog)] = "<C>●</><D><b>$mynation[name]</b></>(이)가 합병에 동의했습니다."; $youlog[count($youlog)] = "<C>●</><D><b>$mynation['name']</b></>(이)가 합병에 동의했습니다.";
$history[count($history)] = "<C>●</>$admin[year]$admin[month]월:<Y><b>【합병시도】</b></><D><b>$mynation[name]</b></>(와)과 <D><b>$younation[name]</b></>(이)가 합병을 시도합니다."; $history[count($history)] = "<C>●</>$admin['year']$admin['month']월:<Y><b>【합병시도】</b></><D><b>$mynation['name']</b></>(와)과 <D><b>$younation['name']</b></>(이)가 합병을 시도합니다.";
$mylog[count($mylog)] = "<C>●</><D><b>$younation[name]</b></>(와)과 합병에 동의했습니다."; $mylog[count($mylog)] = "<C>●</><D><b>$younation['name']</b></>(와)과 합병에 동의했습니다.";
$alllog[count($alllog)] = "<C>●</>{$admin[month]}월:<Y>$me[name]</>(이)가 <D><b>$younation[name]</b></>(와)과 <M>합병</>에 동의하였습니다."; $alllog[count($alllog)] = "<C>●</>{$admin['month']}월:<Y>$me['name']</>(이)가 <D><b>$younation['name']</b></>(와)과 <M>합병</>에 동의하였습니다.";
$you = addHistory($connect, $you, "<C>●</>$admin[year]$admin[month]월:<D><b>$mynation[name]</b></>(와)과 합병 시도"); $you = addHistory($connect, $you, "<C>●</>$admin['year']$admin['month']월:<D><b>$mynation['name']</b></>(와)과 합병 시도");
$me = addHistory($connect, $me, "<C>●</>$admin[year]$admin[month]월:<D><b>$younation[name]</b></>(와)과 합병 시도"); $me = addHistory($connect, $me, "<C>●</>$admin['year']$admin['month']월:<D><b>$younation['name']</b></>(와)과 합병 시도");
//외교 변경 //외교 변경
$query = "update diplomacy set state='5',term='24' where me='$mynation[nation]' and you='$younation[nation]'"; $query = "update diplomacy set state='5',term='24' where me='$mynation['nation']' and you='$younation['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update diplomacy set state='6',term='24' where me='$younation[nation]' and you='$mynation[nation]'"; $query = "update diplomacy set state='6',term='24' where me='$younation['nation']' and you='$mynation['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//국메로 저장 //국메로 저장
$msg = "【외교】$admin[year]$admin[month]월:$younation[name](와)과 합병에 동의"; $msg = "【외교】$admin['year']$admin['month']월:$younation['name'](와)과 합병에 동의";
$youmsg = "【외교】$admin[year]$admin[month]월:$mynation[name](와)과 합병에 동의"; $youmsg = "【외교】$admin['year']$admin['month']월:$mynation['name'](와)과 합병에 동의";
PushMsg(2, $mynation[nation], $me[picture], $me[imgsvr], "{$me[name]}:{$mynation[name]}", $mynation[color], $younation[name], $younation[color], $msg); PushMsg(2, $mynation['nation'], $me['picture'], $me['imgsvr'], "{$me['name']}:{$mynation['name']}", $mynation['color'], $younation['name'], $younation['color'], $msg);
PushMsg(3, $younation[nation], $me[picture], $me[imgsvr], "{$me[name]}:{$mynation[name]}", $mynation[color], $younation[name], $younation[color], $youmsg); PushMsg(3, $younation['nation'], $me['picture'], $me['imgsvr'], "{$me['name']}:{$mynation['name']}", $mynation['color'], $younation['name'], $younation['color'], $youmsg);
} }
//현 메세지 지움 //현 메세지 지움
$query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='$me[nation]'"; $query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='$me['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else { } else {
$youlog[count($youlog)] = "<C>●</><Y>$mynation[name]</>(이)가 항복을 거부했습니다."; $youlog[count($youlog)] = "<C>●</><Y>$mynation['name']</>(이)가 항복을 거부했습니다.";
$mylog[count($mylog)] = "<C>●</><D>$younation[name]</>(으)로 항복을 거부했습니다."; $mylog[count($mylog)] = "<C>●</><D>$younation['name']</>(으)로 항복을 거부했습니다.";
//현 메세지 지움 //현 메세지 지움
$query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='$me[nation]'"; $query = "update nation set dip{$num}='',dip{$num}_who='0',dip{$num}_when='' where nation='$me['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
+32 -32
View File
@@ -9,11 +9,11 @@ include "func.php";
CheckLogin(); CheckLogin();
$connect = dbConn(); $connect = dbConn();
$query = "select userlevel from general where user_id='$_SESSION[p_id]'"; $query = "select userlevel from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
if($me[userlevel] < 5) { if($me['userlevel'] < 5) {
echo " echo "
<html> <html>
<head> <head>
@@ -36,14 +36,14 @@ $query = "select year,month,turnterm,isUnited from game where no='1'";
$result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$admin = MYDB_fetch_array($result); $admin = MYDB_fetch_array($result);
if($admin[isUnited] == 0) { if($admin['isUnited'] == 0) {
$query = "select no from general where npc<2 and age>50"; $query = "select no from general where npc<2 and age>50";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) { for($i=0; $i < $count; $i++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
CheckHall($connect, $general[no]); CheckHall($connect, $general['no']);
} }
} }
@@ -55,11 +55,11 @@ $count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) { for($i=0; $i < $count; $i++) {
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
$query = "select city,nation from city where nation='$nation[nation]' order by rand() limit 0,1"; $query = "select city,nation from city where nation='$nation['nation']' order by rand() limit 0,1";
$result2 = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); $result2 = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$city = MYDB_fetch_array($result2); $city = MYDB_fetch_array($result2);
$query = "update nation set capital='$city[city]' where nation='$nation[nation]'"; $query = "update nation set capital='$city['city']' where nation='$nation['nation']'";
MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
} }
@@ -86,9 +86,9 @@ for($i=0; $i < 7; $i++) {
$result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
$nationNum[$i] = $nation[nation]; $nationNum[$i] = $nation['nation'];
$query = "update nation set scout=1,capital={$cap[$i]} where nation='$nation[nation]'"; $query = "update nation set scout=1,capital={$cap[$i]} where nation='$nation['nation']'";
MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
//태수,군사,시중 해제 //태수,군사,시중 해제
@@ -105,24 +105,24 @@ for($i=0; $i < 7; $i++) {
$query = "update general set level=1 where no='{$city[gen3]}'"; $query = "update general set level=1 where no='{$city[gen3]}'";
$result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$query = "update city set nation='$nation[nation]',pop='1000000',agri=agri2,comm=comm2,secu=secu2,def=def2,wall=wall2,supply=1,gen1=0,gen2=0,gen3=0 where city='{$cap[$i]}'"; $query = "update city set nation='$nation['nation']',pop='1000000',agri=agri2,comm=comm2,secu=secu2,def=def2,wall=wall2,supply=1,gen1=0,gen2=0,gen3=0 where city='{$cap[$i]}'";
MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$query = "select nation,level from nation where nation!='$nation[nation]'"; $query = "select nation,level from nation where nation!='$nation['nation']'";
$result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($k=0; $k < $count; $k++) { for($k=0; $k < $count; $k++) {
$your = MYDB_fetch_array($result); $your = MYDB_fetch_array($result);
if($your[level] > 0) { if($your['level'] > 0) {
$query = "insert into diplomacy (me, you, state, term) values ('$nation[nation]', '$your[nation]', '1', '1')"; $query = "insert into diplomacy (me, you, state, term) values ('$nation['nation']', '$your['nation']', '1', '1')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "insert into diplomacy (me, you, state, term) values ('$your[nation]', '$nation[nation]', '1', '1')"; $query = "insert into diplomacy (me, you, state, term) values ('$your['nation']', '$nation['nation']', '1', '1')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else { } else {
$query = "insert into diplomacy (me, you, state, term) values ('$nation[nation]', '$your[nation]', '7', '999')"; $query = "insert into diplomacy (me, you, state, term) values ('$nation['nation']', '$your['nation']', '7', '999')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "insert into diplomacy (me, you, state, term) values ('$your[nation]', '$nation[nation]', '7', '999')"; $query = "insert into diplomacy (me, you, state, term) values ('$your['nation']', '$nation['nation']', '7', '999')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
} }
@@ -137,54 +137,54 @@ for($i=0; $i < 7; $i++) {
//////////////////////////장수////////////////////////////////////////////////// //////////////////////////장수//////////////////////////////////////////////////
// 이름 통 무 지 꿈 특기 // 이름 통 무 지 꿈 특기
$gencount = 2001; $gencount = 2001;
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[0],12, "강대왕", 95, 95, 75,"패권","돌격", ""); $gencount++; RegGeneral3($connect,$admin['turnterm'],$gencount,$nationNum[0],12, "강대왕", 95, 95, 75,"패권","돌격", ""); $gencount++;
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[1],12, "저대왕", 95, 95, 75,"패권","돌격", ""); $gencount++; RegGeneral3($connect,$admin['turnterm'],$gencount,$nationNum[1],12, "저대왕", 95, 95, 75,"패권","돌격", ""); $gencount++;
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[2],12, "흉노대왕", 95, 95, 75,"패권","돌격", ""); $gencount++; RegGeneral3($connect,$admin['turnterm'],$gencount,$nationNum[2],12, "흉노대왕", 95, 95, 75,"패권","돌격", ""); $gencount++;
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[3],12, "남만대왕", 95, 95, 75,"패권","돌격", ""); $gencount++; RegGeneral3($connect,$admin['turnterm'],$gencount,$nationNum[3],12, "남만대왕", 95, 95, 75,"패권","돌격", ""); $gencount++;
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[4],12, "산월대왕", 95, 95, 75,"패권","돌격", ""); $gencount++; RegGeneral3($connect,$admin['turnterm'],$gencount,$nationNum[4],12, "산월대왕", 95, 95, 75,"패권","돌격", ""); $gencount++;
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[5],12, "오환대왕", 95, 95, 75,"패권","돌격", ""); $gencount++; RegGeneral3($connect,$admin['turnterm'],$gencount,$nationNum[5],12, "오환대왕", 95, 95, 75,"패권","돌격", ""); $gencount++;
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[6],12, "왜대왕", 95, 95, 75,"패권","돌격", ""); $gencount++; RegGeneral3($connect,$admin['turnterm'],$gencount,$nationNum[6],12, "왜대왕", 95, 95, 75,"패권","돌격", ""); $gencount++;
for($k=1; $k <= $eachCount; $k++) { for($k=1; $k <= $eachCount; $k++) {
if(rand()%2) { $l = rand()%10 + 85; $p = rand()%10 + 85; $i = rand()%10 + 10; } if(rand()%2) { $l = rand()%10 + 85; $p = rand()%10 + 85; $i = rand()%10 + 10; }
else { $l = rand()%10 + 85; $p = rand()%10 + 10; $i = rand()%10 + 85; } else { $l = rand()%10 + 85; $p = rand()%10 + 10; $i = rand()%10 + 85; }
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[0], 1, "강장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++; RegGeneral3($connect,$admin['turnterm'],$gencount,$nationNum[0], 1, "강장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++;
} }
for($k=1; $k <= $eachCount; $k++) { for($k=1; $k <= $eachCount; $k++) {
if(rand()%2) { $l = rand()%10 + 85; $p = rand()%10 + 85; $i = rand()%10 + 10; } if(rand()%2) { $l = rand()%10 + 85; $p = rand()%10 + 85; $i = rand()%10 + 10; }
else { $l = rand()%10 + 85; $p = rand()%10 + 10; $i = rand()%10 + 85; } else { $l = rand()%10 + 85; $p = rand()%10 + 10; $i = rand()%10 + 85; }
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[1], 1, "저장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++; RegGeneral3($connect,$admin['turnterm'],$gencount,$nationNum[1], 1, "저장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++;
} }
for($k=1; $k <= $eachCount; $k++) { for($k=1; $k <= $eachCount; $k++) {
if(rand()%2) { $l = rand()%10 + 85; $p = rand()%10 + 85; $i = rand()%10 + 10; } if(rand()%2) { $l = rand()%10 + 85; $p = rand()%10 + 85; $i = rand()%10 + 10; }
else { $l = rand()%10 + 85; $p = rand()%10 + 10; $i = rand()%10 + 85; } else { $l = rand()%10 + 85; $p = rand()%10 + 10; $i = rand()%10 + 85; }
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[2], 1,"흉노장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++; RegGeneral3($connect,$admin['turnterm'],$gencount,$nationNum[2], 1,"흉노장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++;
} }
for($k=1; $k <= $eachCount; $k++) { for($k=1; $k <= $eachCount; $k++) {
if(rand()%2) { $l = rand()%10 + 85; $p = rand()%10 + 85; $i = rand()%10 + 10; } if(rand()%2) { $l = rand()%10 + 85; $p = rand()%10 + 85; $i = rand()%10 + 10; }
else { $l = rand()%10 + 85; $p = rand()%10 + 10; $i = rand()%10 + 85; } else { $l = rand()%10 + 85; $p = rand()%10 + 10; $i = rand()%10 + 85; }
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[3], 1,"남만장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++; RegGeneral3($connect,$admin['turnterm'],$gencount,$nationNum[3], 1,"남만장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++;
} }
for($k=1; $k <= $eachCount; $k++) { for($k=1; $k <= $eachCount; $k++) {
if(rand()%2) { $l = rand()%10 + 85; $p = rand()%10 + 85; $i = rand()%10 + 10; } if(rand()%2) { $l = rand()%10 + 85; $p = rand()%10 + 85; $i = rand()%10 + 10; }
else { $l = rand()%10 + 85; $p = rand()%10 + 10; $i = rand()%10 + 85; } else { $l = rand()%10 + 85; $p = rand()%10 + 10; $i = rand()%10 + 85; }
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[4], 1,"산월장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++; RegGeneral3($connect,$admin['turnterm'],$gencount,$nationNum[4], 1,"산월장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++;
} }
for($k=1; $k <= $eachCount; $k++) { for($k=1; $k <= $eachCount; $k++) {
if(rand()%2) { $l = rand()%10 + 85; $p = rand()%10 + 85; $i = rand()%10 + 10; } if(rand()%2) { $l = rand()%10 + 85; $p = rand()%10 + 85; $i = rand()%10 + 10; }
else { $l = rand()%10 + 85; $p = rand()%10 + 10; $i = rand()%10 + 85; } else { $l = rand()%10 + 85; $p = rand()%10 + 10; $i = rand()%10 + 85; }
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[5], 1,"오환장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++; RegGeneral3($connect,$admin['turnterm'],$gencount,$nationNum[5], 1,"오환장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++;
} }
for($k=1; $k <= $eachCount; $k++) { for($k=1; $k <= $eachCount; $k++) {
if(rand()%2) { $l = rand()%10 + 85; $p = rand()%10 + 85; $i = rand()%10 + 10; } if(rand()%2) { $l = rand()%10 + 85; $p = rand()%10 + 85; $i = rand()%10 + 10; }
else { $l = rand()%10 + 85; $p = rand()%10 + 10; $i = rand()%10 + 85; } else { $l = rand()%10 + 85; $p = rand()%10 + 10; $i = rand()%10 + 85; }
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[6], 1, "왜장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++; RegGeneral3($connect,$admin['turnterm'],$gencount,$nationNum[6], 1, "왜장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++;
} }
//////////////////////////장수 끝/////////////////////////////////////////////// //////////////////////////장수 끝///////////////////////////////////////////////
@@ -194,9 +194,9 @@ $query = "update general set gold=999999,rice=999999";
MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
//////////////////////////이벤트/////////////////////////////////////////////// //////////////////////////이벤트///////////////////////////////////////////////
$history[count($history)] = "<C>●</>$admin[year]$admin[month]월:<L><b>【이벤트】</b></>각지의 이민족들이 <M>궐기</>합니다!"; $history[count($history)] = "<C>●</>$admin['year']$admin['month']월:<L><b>【이벤트】</b></>각지의 이민족들이 <M>궐기</>합니다!";
$history[count($history)] = "<C>●</>$admin[year]$admin[month]월:<L><b>【이벤트】</b></>중원의 전 국가에 <M>선전포고</> 합니다!"; $history[count($history)] = "<C>●</>$admin['year']$admin['month']월:<L><b>【이벤트】</b></>중원의 전 국가에 <M>선전포고</> 합니다!";
$history[count($history)] = "<C>●</>$admin[year]$admin[month]월:<L><b>【이벤트】</b></>이민족의 기세는 그 누구도 막을 수 없을듯 합니다!"; $history[count($history)] = "<C>●</>$admin['year']$admin['month']월:<L><b>【이벤트】</b></>이민족의 기세는 그 누구도 막을 수 없을듯 합니다!";
pushHistory($connect, $history); pushHistory($connect, $history);
echo "<script>location.replace('./');</script>"; echo "<script>location.replace('./');</script>";
+33 -33
View File
@@ -9,11 +9,11 @@ include "func.php";
CheckLogin(); CheckLogin();
$connect = dbConn(); $connect = dbConn();
$query = "select userlevel from general where user_id='$_SESSION[p_id]'"; $query = "select userlevel from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
if($me[userlevel] < 5) { if($me['userlevel'] < 5) {
echo " echo "
<html> <html>
<head> <head>
@@ -36,14 +36,14 @@ $query = "select year,month,turnterm,isUnited from game where no='1'";
$result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$admin = MYDB_fetch_array($result); $admin = MYDB_fetch_array($result);
if($admin[isUnited] == 0) { if($admin['isUnited'] == 0) {
$query = "select no from general where npc<2 and age>50"; $query = "select no from general where npc<2 and age>50";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) { for($i=0; $i < $count; $i++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
CheckHall($connect, $general[no]); CheckHall($connect, $general['no']);
} }
} }
@@ -55,11 +55,11 @@ $count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) { for($i=0; $i < $count; $i++) {
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
$query = "select city,nation from city where nation='$nation[nation]' order by rand() limit 0,1"; $query = "select city,nation from city where nation='$nation['nation']' order by rand() limit 0,1";
$result2 = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); $result2 = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$city = MYDB_fetch_array($result2); $city = MYDB_fetch_array($result2);
$query = "update nation set capital='$city[city]' where nation='$nation[nation]'"; $query = "update nation set capital='$city['city']' where nation='$nation['nation']'";
MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
} }
@@ -77,7 +77,7 @@ $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($con
$info = MYDB_fetch_array($result); $info = MYDB_fetch_array($result);
for($i=0; $i < 7; $i++) { for($i=0; $i < 7; $i++) {
RegNation($connect, $name[$i], "800000", 99999, 99999, "오랑캐여 일어서라! 오랑캐 궐기!", $info[tch]+500, $eachCount, "병가", 0); RegNation($connect, $name[$i], "800000", 99999, 99999, "오랑캐여 일어서라! 오랑캐 궐기!", $info['tch']+500, $eachCount, "병가", 0);
} }
//////////////////////////외교////////////////////////////////////////////////// //////////////////////////외교//////////////////////////////////////////////////
@@ -90,9 +90,9 @@ for($i=0; $i < 7; $i++) {
$result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
$nationNum[$i] = $nation[nation]; $nationNum[$i] = $nation['nation'];
$query = "update nation set scout=1,capital={$cap[$i]} where nation='$nation[nation]'"; $query = "update nation set scout=1,capital={$cap[$i]} where nation='$nation['nation']'";
MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
//태수,군사,시중 해제 //태수,군사,시중 해제
@@ -109,24 +109,24 @@ for($i=0; $i < 7; $i++) {
$query = "update general set level=1 where no='{$city[gen3]}'"; $query = "update general set level=1 where no='{$city[gen3]}'";
$result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$query = "update city set nation='$nation[nation]',pop='1000000',agri=agri2,comm=comm2,secu=secu2,def=def2,wall=wall2,supply=1,gen1=0,gen2=0,gen3=0 where city='{$cap[$i]}'"; $query = "update city set nation='$nation['nation']',pop='1000000',agri=agri2,comm=comm2,secu=secu2,def=def2,wall=wall2,supply=1,gen1=0,gen2=0,gen3=0 where city='{$cap[$i]}'";
MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$query = "select nation,level from nation where nation!='$nation[nation]'"; $query = "select nation,level from nation where nation!='$nation['nation']'";
$result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($k=0; $k < $count; $k++) { for($k=0; $k < $count; $k++) {
$your = MYDB_fetch_array($result); $your = MYDB_fetch_array($result);
if($your[level] > 0) { if($your['level'] > 0) {
$query = "insert into diplomacy (me, you, state, term) values ('$nation[nation]', '$your[nation]', '1', '1')"; $query = "insert into diplomacy (me, you, state, term) values ('$nation['nation']', '$your['nation']', '1', '1')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "insert into diplomacy (me, you, state, term) values ('$your[nation]', '$nation[nation]', '1', '1')"; $query = "insert into diplomacy (me, you, state, term) values ('$your['nation']', '$nation['nation']', '1', '1')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else { } else {
$query = "insert into diplomacy (me, you, state, term) values ('$nation[nation]', '$your[nation]', '7', '999')"; $query = "insert into diplomacy (me, you, state, term) values ('$nation['nation']', '$your['nation']', '7', '999')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "insert into diplomacy (me, you, state, term) values ('$your[nation]', '$nation[nation]', '7', '999')"; $query = "insert into diplomacy (me, you, state, term) values ('$your['nation']', '$nation['nation']', '7', '999')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
} }
@@ -141,54 +141,54 @@ for($i=0; $i < 7; $i++) {
//////////////////////////장수////////////////////////////////////////////////// //////////////////////////장수//////////////////////////////////////////////////
// 이름 통 무 지 꿈 특기 // 이름 통 무 지 꿈 특기
$gencount = 2001; $gencount = 2001;
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[0],12, "강대왕", 95, 95, 75,"패권","돌격", ""); $gencount++; RegGeneral3($connect,$admin['turnterm'],$gencount,$nationNum[0],12, "강대왕", 95, 95, 75,"패권","돌격", ""); $gencount++;
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[1],12, "저대왕", 95, 95, 75,"패권","돌격", ""); $gencount++; RegGeneral3($connect,$admin['turnterm'],$gencount,$nationNum[1],12, "저대왕", 95, 95, 75,"패권","돌격", ""); $gencount++;
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[2],12, "흉노대왕", 95, 95, 75,"패권","돌격", ""); $gencount++; RegGeneral3($connect,$admin['turnterm'],$gencount,$nationNum[2],12, "흉노대왕", 95, 95, 75,"패권","돌격", ""); $gencount++;
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[3],12, "남만대왕", 95, 95, 75,"패권","돌격", ""); $gencount++; RegGeneral3($connect,$admin['turnterm'],$gencount,$nationNum[3],12, "남만대왕", 95, 95, 75,"패권","돌격", ""); $gencount++;
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[4],12, "산월대왕", 95, 95, 75,"패권","돌격", ""); $gencount++; RegGeneral3($connect,$admin['turnterm'],$gencount,$nationNum[4],12, "산월대왕", 95, 95, 75,"패권","돌격", ""); $gencount++;
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[5],12, "오환대왕", 95, 95, 75,"패권","돌격", ""); $gencount++; RegGeneral3($connect,$admin['turnterm'],$gencount,$nationNum[5],12, "오환대왕", 95, 95, 75,"패권","돌격", ""); $gencount++;
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[6],12, "왜대왕", 95, 95, 75,"패권","돌격", ""); $gencount++; RegGeneral3($connect,$admin['turnterm'],$gencount,$nationNum[6],12, "왜대왕", 95, 95, 75,"패권","돌격", ""); $gencount++;
for($k=1; $k <= $eachCount; $k++) { for($k=1; $k <= $eachCount; $k++) {
if(rand()%2) { $l = rand()%40 + 35; $p = rand()%40 + 35; $i = rand()%10 + 10; } if(rand()%2) { $l = rand()%40 + 35; $p = rand()%40 + 35; $i = rand()%10 + 10; }
else { $l = rand()%40 + 35; $p = rand()%10 + 10; $i = rand()%40 + 35; } else { $l = rand()%40 + 35; $p = rand()%10 + 10; $i = rand()%40 + 35; }
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[0], 1, "강장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++; RegGeneral3($connect,$admin['turnterm'],$gencount,$nationNum[0], 1, "강장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++;
} }
for($k=1; $k <= $eachCount; $k++) { for($k=1; $k <= $eachCount; $k++) {
if(rand()%2) { $l = rand()%40 + 35; $p = rand()%40 + 35; $i = rand()%10 + 10; } if(rand()%2) { $l = rand()%40 + 35; $p = rand()%40 + 35; $i = rand()%10 + 10; }
else { $l = rand()%40 + 35; $p = rand()%10 + 10; $i = rand()%40 + 35; } else { $l = rand()%40 + 35; $p = rand()%10 + 10; $i = rand()%40 + 35; }
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[1], 1, "저장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++; RegGeneral3($connect,$admin['turnterm'],$gencount,$nationNum[1], 1, "저장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++;
} }
for($k=1; $k <= $eachCount; $k++) { for($k=1; $k <= $eachCount; $k++) {
if(rand()%2) { $l = rand()%40 + 35; $p = rand()%40 + 35; $i = rand()%10 + 10; } if(rand()%2) { $l = rand()%40 + 35; $p = rand()%40 + 35; $i = rand()%10 + 10; }
else { $l = rand()%40 + 35; $p = rand()%10 + 10; $i = rand()%40 + 35; } else { $l = rand()%40 + 35; $p = rand()%10 + 10; $i = rand()%40 + 35; }
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[2], 1,"흉노장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++; RegGeneral3($connect,$admin['turnterm'],$gencount,$nationNum[2], 1,"흉노장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++;
} }
for($k=1; $k <= $eachCount; $k++) { for($k=1; $k <= $eachCount; $k++) {
if(rand()%2) { $l = rand()%40 + 35; $p = rand()%40 + 35; $i = rand()%10 + 10; } if(rand()%2) { $l = rand()%40 + 35; $p = rand()%40 + 35; $i = rand()%10 + 10; }
else { $l = rand()%40 + 35; $p = rand()%10 + 10; $i = rand()%40 + 35; } else { $l = rand()%40 + 35; $p = rand()%10 + 10; $i = rand()%40 + 35; }
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[3], 1,"남만장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++; RegGeneral3($connect,$admin['turnterm'],$gencount,$nationNum[3], 1,"남만장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++;
} }
for($k=1; $k <= $eachCount; $k++) { for($k=1; $k <= $eachCount; $k++) {
if(rand()%2) { $l = rand()%40 + 35; $p = rand()%40 + 35; $i = rand()%10 + 10; } if(rand()%2) { $l = rand()%40 + 35; $p = rand()%40 + 35; $i = rand()%10 + 10; }
else { $l = rand()%40 + 35; $p = rand()%10 + 10; $i = rand()%40 + 35; } else { $l = rand()%40 + 35; $p = rand()%10 + 10; $i = rand()%40 + 35; }
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[4], 1,"산월장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++; RegGeneral3($connect,$admin['turnterm'],$gencount,$nationNum[4], 1,"산월장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++;
} }
for($k=1; $k <= $eachCount; $k++) { for($k=1; $k <= $eachCount; $k++) {
if(rand()%2) { $l = rand()%40 + 35; $p = rand()%40 + 35; $i = rand()%10 + 10; } if(rand()%2) { $l = rand()%40 + 35; $p = rand()%40 + 35; $i = rand()%10 + 10; }
else { $l = rand()%40 + 35; $p = rand()%10 + 10; $i = rand()%40 + 35; } else { $l = rand()%40 + 35; $p = rand()%10 + 10; $i = rand()%40 + 35; }
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[5], 1,"오환장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++; RegGeneral3($connect,$admin['turnterm'],$gencount,$nationNum[5], 1,"오환장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++;
} }
for($k=1; $k <= $eachCount; $k++) { for($k=1; $k <= $eachCount; $k++) {
if(rand()%2) { $l = rand()%40 + 35; $p = rand()%40 + 35; $i = rand()%10 + 10; } if(rand()%2) { $l = rand()%40 + 35; $p = rand()%40 + 35; $i = rand()%10 + 10; }
else { $l = rand()%40 + 35; $p = rand()%10 + 10; $i = rand()%40 + 35; } else { $l = rand()%40 + 35; $p = rand()%10 + 10; $i = rand()%40 + 35; }
RegGeneral3($connect,$admin[turnterm],$gencount,$nationNum[6], 1, "왜장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++; RegGeneral3($connect,$admin['turnterm'],$gencount,$nationNum[6], 1, "왜장수{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++;
} }
//////////////////////////장수 끝/////////////////////////////////////////////// //////////////////////////장수 끝///////////////////////////////////////////////
@@ -198,9 +198,9 @@ $query = "update general set gold=999999,rice=999999";
MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
//////////////////////////이벤트/////////////////////////////////////////////// //////////////////////////이벤트///////////////////////////////////////////////
$history[count($history)] = "<C>●</>$admin[year]$admin[month]월:<L><b>【이벤트】</b></>각지의 오랑캐들이 <M>궐기</>합니다!"; $history[count($history)] = "<C>●</>$admin['year']$admin['month']월:<L><b>【이벤트】</b></>각지의 오랑캐들이 <M>궐기</>합니다!";
$history[count($history)] = "<C>●</>$admin[year]$admin[month]월:<L><b>【이벤트】</b></>중원의 전 국가에 <M>선전포고</> 합니다!"; $history[count($history)] = "<C>●</>$admin['year']$admin['month']월:<L><b>【이벤트】</b></>중원의 전 국가에 <M>선전포고</> 합니다!";
$history[count($history)] = "<C>●</>$admin[year]$admin[month]월:<L><b>【이벤트】</b></>그러나 중원의 영웅들이라면 막아낼 수도 있을법 해 보입니다!"; $history[count($history)] = "<C>●</>$admin['year']$admin['month']월:<L><b>【이벤트】</b></>그러나 중원의 영웅들이라면 막아낼 수도 있을법 해 보입니다!";
pushHistory($connect, $history); pushHistory($connect, $history);
echo "<script>location.replace('./');</script>"; echo "<script>location.replace('./');</script>";
+7 -7
View File
@@ -9,11 +9,11 @@ include "func.php";
CheckLogin(); CheckLogin();
$connect = dbConn(); $connect = dbConn();
$query = "select userlevel from general where user_id='$_SESSION[p_id]'"; $query = "select userlevel from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
if($me[userlevel] < 5) { if($me['userlevel'] < 5) {
echo " echo "
<html> <html>
<head> <head>
@@ -36,14 +36,14 @@ $query = "select year,month,turnterm,isUnited from game where no='1'";
$result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$admin = MYDB_fetch_array($result); $admin = MYDB_fetch_array($result);
if($admin[isUnited] == 0) { if($admin['isUnited'] == 0) {
$query = "select no from general where npc<2 and age>50"; $query = "select no from general where npc<2 and age>50";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) { for($i=0; $i < $count; $i++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
CheckHall($connect, $general[no]); CheckHall($connect, $general['no']);
} }
} }
@@ -54,14 +54,14 @@ $gencount = 2001;
for($k=1; $k <= 200; $k++) { for($k=1; $k <= 200; $k++) {
if(rand()%2) { $l = rand()%40 + 35; $p = rand()%40 + 35; $i = rand()%10 + 10; } if(rand()%2) { $l = rand()%40 + 35; $p = rand()%40 + 35; $i = rand()%10 + 10; }
else { $l = rand()%40 + 35; $p = rand()%10 + 10; $i = rand()%40 + 35; } else { $l = rand()%40 + 35; $p = rand()%10 + 10; $i = rand()%40 + 35; }
RegGeneral3($connect,$admin[turnterm],$gencount, 0, 0, "무명장{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++; RegGeneral3($connect,$admin['turnterm'],$gencount, 0, 0, "무명장{$k}", $l, $p, $i,"패권","돌격", ""); $gencount++;
} }
//////////////////////////장수 끝/////////////////////////////////////////////// //////////////////////////장수 끝///////////////////////////////////////////////
//////////////////////////이벤트/////////////////////////////////////////////// //////////////////////////이벤트///////////////////////////////////////////////
$history[count($history)] = "<C>●</>$admin[year]$admin[month]월:<L><b>【이벤트】</b></>각지에서 인재들이 <M>등장</>합니다!"; $history[count($history)] = "<C>●</>$admin['year']$admin['month']월:<L><b>【이벤트】</b></>각지에서 인재들이 <M>등장</>합니다!";
$history[count($history)] = "<C>●</>$admin[year]$admin[month]월:<L><b>【이벤트】</b></>중원 통일에 보탬이 될듯 합니다!"; $history[count($history)] = "<C>●</>$admin['year']$admin['month']월:<L><b>【이벤트】</b></>중원 통일에 보탬이 될듯 합니다!";
pushHistory($connect, $history); pushHistory($connect, $history);
echo "<script>location.replace('./');</script>"; echo "<script>location.replace('./');</script>";
+6 -6
View File
@@ -9,11 +9,11 @@ include "func.php";
CheckLogin(); CheckLogin();
$connect = dbConn(); $connect = dbConn();
$query = "select userlevel from general where user_id='$_SESSION[p_id]'"; $query = "select userlevel from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
if($me[userlevel] < 5) { if($me['userlevel'] < 5) {
echo " echo "
<html> <html>
<head> <head>
@@ -37,7 +37,7 @@ $query = "select no from general where user_id='jwh1807'";
$result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
if($general[no] > 0) { if($general['no'] > 0) {
echo " echo "
<html> <html>
<head> <head>
@@ -81,15 +81,15 @@ if(rand()%2 == 0) {
$intel = 150 - $leader - $power; $intel = 150 - $leader - $power;
} }
RegGeneral4($connect,$admin[turnterm],$gencount, 0, 0, "유기체", $leader, $power, $intel, $personal, $general[specage], $general[specage2], "흠... 그럼 어쩔 수 없이 흉노로 가야겠군요."); $gencount++; RegGeneral4($connect,$admin['turnterm'],$gencount, 0, 0, "유기체", $leader, $power, $intel, $personal, $general['specage'], $general[specage2], "흠... 그럼 어쩔 수 없이 흉노로 가야겠군요."); $gencount++;
//////////////////////////장수 끝/////////////////////////////////////////////// //////////////////////////장수 끝///////////////////////////////////////////////
//////////////////////////이벤트/////////////////////////////////////////////// //////////////////////////이벤트///////////////////////////////////////////////
$log[0] = "<C>●</>{$admin[month]}월:<Y>ⓝ유기체</>가 천하에 이름을 알립니다."; $log[0] = "<C>●</>{$admin['month']}월:<Y>ⓝ유기체</>가 천하에 이름을 알립니다.";
pushAllLog($log); pushAllLog($log);
$history[count($history)] = "<C>●</>$admin[year]$admin[month]월:<L><b>【이벤트】</b></>NPC 유기체가 등장합니다. 의병장과 NPC들의 지능 개선을 위해 NPC 두뇌를 체험합니다. 크게 신경쓰진 마세요."; $history[count($history)] = "<C>●</>$admin['year']$admin['month']월:<L><b>【이벤트】</b></>NPC 유기체가 등장합니다. 의병장과 NPC들의 지능 개선을 위해 NPC 두뇌를 체험합니다. 크게 신경쓰진 마세요.";
pushHistory($connect, $history); pushHistory($connect, $history);
echo "<script>location.replace('./');</script>"; echo "<script>location.replace('./');</script>";
+963 -960
View File
File diff suppressed because it is too large Load Diff
+95 -95
View File
@@ -20,7 +20,7 @@ function registerAuction($connect) {
$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);
switch($admin[turnterm]) { switch($admin['turnterm']) {
case 0: $unit = 7200; break; case 0: $unit = 7200; break;
case 1: $unit = 3600; break; case 1: $unit = 3600; break;
case 2: $unit = 1800; break; case 2: $unit = 1800; break;
@@ -36,10 +36,10 @@ function registerAuction($connect) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
if($general[gold] < 1000) { $general[gold] = 1000; } if($general['gold'] < 1000) { $general['gold'] = 1000; }
if($general[gold] > 20000) { $general[gold] = 20000; } if($general['gold'] > 20000) { $general['gold'] = 20000; }
if($general[rice] < 1000) { $general[rice] = 1000; } if($general['rice'] < 1000) { $general['rice'] = 1000; }
if($general[rice] > 20000) { $general[rice] = 20000; } if($general['rice'] > 20000) { $general['rice'] = 20000; }
/* /*
// 유닉템 등록 // 유닉템 등록
@@ -75,8 +75,8 @@ function registerAuction($connect) {
//평균 금의 100% //평균 금의 100%
$amount = 1; $amount = 1;
$cost = $general[gold]; $cost = $general['gold'];
$topv = $general[maxgold] * 10; $topv = $general['maxgold'] * 10;
if($cost < 5000) { $cost = 5000; } if($cost < 5000) { $cost = 5000; }
if($topv < 10000) { $topv = 10000; } if($topv < 10000) { $topv = 10000; }
@@ -88,8 +88,8 @@ function registerAuction($connect) {
$query = "insert into auction (type, no1, name1, stuff, amount, cost, value, topv, expire) values (0, '0', 'ⓝ암시장상인', '$stuff', '$amount', '$cost', '$cost', '$topv', '$date')"; $query = "insert into auction (type, no1, name1, stuff, amount, cost, value, topv, expire) values (0, '0', 'ⓝ암시장상인', '$stuff', '$amount', '$cost', '$cost', '$topv', '$date')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$alllog[0] = "<C>●</>{$admin[month]}월:<C>".GetStuffName($stuff)."</>(이)가 거래장에 등장했습니다!"; $alllog[0] = "<C>●</>{$admin['month']}월:<C>".GetStuffName($stuff)."</>(이)가 거래장에 등장했습니다!";
$history[0] = "<C>●</>$admin[year]년 $admin[month]월:<C><b>【암시장】</b></><Y>ⓝ암시장상인</>(이)가 <C>".GetStuffName($stuff)."</>(을)를 판다는 소문이 돌고 있습니다!"; $history[0] = "<C>●</>$admin['year']년 $admin['month']월:<C><b>【암시장】</b></><Y>ⓝ암시장상인</>(이)가 <C>".GetStuffName($stuff)."</>(을)를 판다는 소문이 돌고 있습니다!";
pushAllLog($alllog); pushAllLog($alllog);
pushHistory($connect, $history); pushHistory($connect, $history);
} }
@@ -104,8 +104,8 @@ function registerAuction($connect) {
if(rand()%$count == 0) { if(rand()%$count == 0) {
//평균 쌀의 5% ~ 25% //평균 쌀의 5% ~ 25%
$mul = rand() % 5 + 1; $mul = rand() % 5 + 1;
$amount = $general[rice] / 20 * $mul; $amount = $general['rice'] / 20 * $mul;
$cost = $general[gold] / 20 * 0.9 * $mul; $cost = $general['gold'] / 20 * 0.9 * $mul;
$topv = $amount * 2; $topv = $amount * 2;
if($cost <= $amount*0.8) { $cost = $amount*0.8; } if($cost <= $amount*0.8) { $cost = $amount*0.8; }
if($cost >= $amount*1.2) { $cost = $amount*1.2; } if($cost >= $amount*1.2) { $cost = $amount*1.2; }
@@ -128,8 +128,8 @@ function registerAuction($connect) {
if(rand()%$count == 0) { if(rand()%$count == 0) {
//평균 쌀의 5% ~ 25% //평균 쌀의 5% ~ 25%
$mul = rand() % 5 + 1; $mul = rand() % 5 + 1;
$amount = $general[rice] / 20 * $mul; $amount = $general['rice'] / 20 * $mul;
$cost = $general[gold] / 20 * 1.1 * $mul; $cost = $general['gold'] / 20 * 1.1 * $mul;
$topv = $amount * 0.5; $topv = $amount * 0.5;
if($cost <= $amount*0.8) { $cost = $amount*0.8; } if($cost <= $amount*0.8) { $cost = $amount*0.8; }
if($cost >= $amount*1.2) { $cost = $amount*1.2; } if($cost >= $amount*1.2) { $cost = $amount*1.2; }
@@ -160,22 +160,22 @@ function processAuction($connect) {
$auction = MYDB_fetch_array($result2); $auction = MYDB_fetch_array($result2);
// 유닉템 처리 // 유닉템 처리
if($auction[stuff] != 0) { if($auction['stuff'] != 0) {
if($auction[no2] == 0) { if($auction[no2] == 0) {
$auctionLog[0] = "<S>◆</>$admin[year]$admin[month]월, {$auction[no]}번 <O>판매</> <M>유찰</> : <Y>{$auction[name1]}</>(이)가 <C>".GetStuffName($auction[stuff])."</>(을)를 판매, 그러나 입찰자 부재"; $auctionLog[0] = "<S>◆</>$admin['year']$admin['month']월, {$auction['no']}번 <O>판매</> <M>유찰</> : <Y>{$auction[name1]}</>(이)가 <C>".GetStuffName($auction['stuff'])."</>(을)를 판매, 그러나 입찰자 부재";
pushAuctionLog($connect, $auctionLog); pushAuctionLog($connect, $auctionLog);
} else { } else {
$trader[no] = 0; $trader['no'] = 0;
$trader[name] = 'ⓝ암시장상인'; $trader['name'] = 'ⓝ암시장상인';
$trader[gold] = 99999999; $trader['gold'] = 99999999;
$trader[rice] = 99999999; $trader['rice'] = 99999999;
$query = "select no,name,gold,rice from general where no='$auction[no2]'"; $query = "select no,name,gold,rice from general where no='$auction[no2]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$bidder = MYDB_fetch_array($result); $bidder = MYDB_fetch_array($result);
$sel1 = $auction[stuff] % 10; $sel1 = $auction['stuff'] % 10;
$sel2 = floor($auction[stuff] / 10); $sel2 = floor($auction['stuff'] / 10);
switch($sel1) { switch($sel1) {
case 1: $type = "weap"; break; case 1: $type = "weap"; break;
case 2: $type = "book"; break; case 2: $type = "book"; break;
@@ -189,30 +189,30 @@ function processAuction($connect) {
// 판매거래만 존재 // 판매거래만 존재
if($count > 0) { if($count > 0) {
$traderLog[0] = "<S>◆</>{$auction[no]}번 거래 <M>유찰</>! 이미 아이템을 누군가가 가로챘습니다!"; $traderLog[0] = "<S>◆</>{$auction['no']}번 거래 <M>유찰</>! 이미 아이템을 누군가가 가로챘습니다!";
$bidderLog[0] = "<S>◆</>{$auction[no]}번 거래 <M>유찰</>! 이미 아이템을 누군가가 가로챘습니다!"; $bidderLog[0] = "<S>◆</>{$auction['no']}번 거래 <M>유찰</>! 이미 아이템을 누군가가 가로챘습니다!";
$auctionLog[0] = "<S>◆</>$admin[year]$admin[month]월, {$auction[no]}번 <O>판매</> <M>유찰</> : <Y>{$auction[name1]}</>(이)가 <C>".GetStuffName($auction[stuff])."</>(을)를 판매, <Y>{$auction[name2]}</>(이)가 금 <C>{$auction[value]}</>(으)로 입찰, 그러나 아이템 이미 매진!"; $auctionLog[0] = "<S>◆</>$admin['year']$admin['month']월, {$auction['no']}번 <O>판매</> <M>유찰</> : <Y>{$auction[name1]}</>(이)가 <C>".GetStuffName($auction['stuff'])."</>(을)를 판매, <Y>{$auction[name2]}</>(이)가 금 <C>{$auction['value']}</>(으)로 입찰, 그러나 아이템 이미 매진!";
} elseif($auction[value] > $bidder[gold] - 1000) { } elseif($auction['value'] > $bidder['gold'] - 1000) {
$gold = round($auction[value] * 0.01); $gold = round($auction['value'] * 0.01);
$bidder[gold] -= $gold; $bidder['gold'] -= $gold;
if($bidder[gold] < 0) $bidder[gold] = 0; if($bidder['gold'] < 0) $bidder['gold'] = 0;
$query = "update general set gold='$bidder[gold]' where no='$auction[no2]'"; $query = "update general set gold='$bidder['gold']' where no='$auction[no2]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$traderLog[0] = "<S>◆</>입찰자의 자금 부족으로 {$auction[no]}번 <C>".GetStuffName($auction[stuff])."</> 거래 <M>유찰</>!"; $traderLog[0] = "<S>◆</>입찰자의 자금 부족으로 {$auction['no']}번 <C>".GetStuffName($auction['stuff'])."</> 거래 <M>유찰</>!";
$bidderLog[0] = "<S>◆</>입찰자의 자금 부족으로 {$auction[no]}번 <C>".GetStuffName($auction[stuff])."</> 거래 <M>유찰</>! 벌금 <C>{$gold}</>"; $bidderLog[0] = "<S>◆</>입찰자의 자금 부족으로 {$auction['no']}번 <C>".GetStuffName($auction['stuff'])."</> 거래 <M>유찰</>! 벌금 <C>{$gold}</>";
$auctionLog[0] = "<S>◆</>$admin[year]$admin[month]월, {$auction[no]}번 <O>판매</> <M>유찰</> : <Y>{$auction[name1]}</>(이)가 <C>".GetStuffName($auction[stuff])."</>(을)를 판매, <Y>{$auction[name2]}</>(이)가 금 <C>{$auction[value]}</>(으)로 입찰, 그러나 입찰자 자금부족, 벌금 <C>{$gold}</>"; $auctionLog[0] = "<S>◆</>$admin['year']$admin['month']월, {$auction['no']}번 <O>판매</> <M>유찰</> : <Y>{$auction[name1]}</>(이)가 <C>".GetStuffName($auction['stuff'])."</>(을)를 판매, <Y>{$auction[name2]}</>(이)가 금 <C>{$auction['value']}</>(으)로 입찰, 그러나 입찰자 자금부족, 벌금 <C>{$gold}</>";
} else { } else {
$traderLog[0] = "<S>◆</>{$auction[no]}번 거래 <C>성사</>로 <C>".GetStuffName($auction[stuff])."</>(을)를 판매, 금 <C>{$auction[value]}</>(을)를 획득!"; $traderLog[0] = "<S>◆</>{$auction['no']}번 거래 <C>성사</>로 <C>".GetStuffName($auction['stuff'])."</>(을)를 판매, 금 <C>{$auction['value']}</>(을)를 획득!";
$bidderLog[0] = "<S>◆</>{$auction[no]}번 거래 <C>성사</>로 금 <C>{$auction[value]}</>(을)를 지불, <C>".GetStuffName($auction[stuff])."</> 구입!"; $bidderLog[0] = "<S>◆</>{$auction['no']}번 거래 <C>성사</>로 금 <C>{$auction['value']}</>(을)를 지불, <C>".GetStuffName($auction['stuff'])."</> 구입!";
$auctionLog[0] = "<S>◆</>$admin[year]$admin[month]월, {$auction[no]}번 <O>판매</> <C>성사</> : <Y>{$auction[name1]}</>(이)가 <C>".GetStuffName($auction[stuff])."</>(을)를 판매, <Y>{$auction[name2]}</>(이)가 금 <C>{$auction[value]}</>(으)로 구매"; $auctionLog[0] = "<S>◆</>$admin['year']$admin['month']월, {$auction['no']}번 <O>판매</> <C>성사</> : <Y>{$auction[name1]}</>(이)가 <C>".GetStuffName($auction['stuff'])."</>(을)를 판매, <Y>{$auction[name2]}</>(이)가 금 <C>{$auction['value']}</>(으)로 구매";
$auctionLog[0] .= " <M>★ 아이템 거래 ★</>"; $auctionLog[0] .= " <M>★ 아이템 거래 ★</>";
$query = "update general set gold=gold-'$auction[value]',{$type}='$sel2' where no='$auction[no2]'"; $query = "update general set gold=gold-'$auction['value']',{$type}='$sel2' where no='$auction[no2]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$alllog[0] = "<C>●</>{$admin[month]}월:<Y>$auction[name2]</>(이)가 <C>".GetStuffName($auction[stuff])."</>(을)를 구매했습니다!"; $alllog[0] = "<C>●</>{$admin['month']}월:<Y>$auction[name2]</>(이)가 <C>".GetStuffName($auction['stuff'])."</>(을)를 구매했습니다!";
$history[0] = "<C>●</>$admin[year]$admin[month]월:<C><b>【암시장】</b></><Y>$auction[name2]</>(이)가 <C>".GetStuffName($auction[stuff])."</>(을)를 구매했습니다!"; $history[0] = "<C>●</>$admin['year']$admin['month']월:<C><b>【암시장】</b></><Y>$auction[name2]</>(이)가 <C>".GetStuffName($auction['stuff'])."</>(을)를 구매했습니다!";
pushAllLog($alllog); pushAllLog($alllog);
pushHistory($connect, $history); pushHistory($connect, $history);
} }
@@ -229,21 +229,21 @@ function processAuction($connect) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$trader = MYDB_fetch_array($result); $trader = MYDB_fetch_array($result);
$traderLog[0] = "<S>◆</>입찰자 부재로 {$auction[no]}번 거래 <M>유찰</>!"; $traderLog[0] = "<S>◆</>입찰자 부재로 {$auction['no']}번 거래 <M>유찰</>!";
if($auction[type] == 0) { if($auction['type'] == 0) {
$auctionLog[0] = "<S>◆</>$admin[year]$admin[month]월, {$auction[no]}번 <O>판매</> <M>유찰</> : <Y>{$auction[name1]}</>(이)가 쌀 <C>{$auction[amount]}</>(을)를 판매, 그러나 입찰자 부재"; $auctionLog[0] = "<S>◆</>$admin['year']$admin['month']월, {$auction['no']}번 <O>판매</> <M>유찰</> : <Y>{$auction[name1]}</>(이)가 쌀 <C>{$auction['amount']}</>(을)를 판매, 그러나 입찰자 부재";
} else { } else {
$auctionLog[0] = "<S>◆</>$admin[year]$admin[month]월, {$auction[no]}번 <S>구매</> <M>유찰</> : <Y>{$auction[name1]}</>(이)가 쌀 <C>{$auction[amount]}</>(을)를 구매, 그러나 입찰자 부재"; $auctionLog[0] = "<S>◆</>$admin['year']$admin['month']월, {$auction['no']}번 <S>구매</> <M>유찰</> : <Y>{$auction[name1]}</>(이)가 쌀 <C>{$auction['amount']}</>(을)를 구매, 그러나 입찰자 부재";
} }
pushGenLog($trader, $traderLog); pushGenLog($trader, $traderLog);
pushAuctionLog($connect, $auctionLog); pushAuctionLog($connect, $auctionLog);
} }
} else { } else {
if($auction[no1] == 0) { if($auction[no1] == 0) {
$trader[no] = 0; $trader['no'] = 0;
$trader[name] = 'ⓝ상인'; $trader['name'] = 'ⓝ상인';
$trader[gold] = 99999; $trader['gold'] = 99999;
$trader[rice] = 99999; $trader['rice'] = 99999;
} else { } else {
$query = "select no,name,gold,rice from general where no='$auction[no1]'"; $query = "select no,name,gold,rice from general where no='$auction[no1]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
@@ -254,41 +254,41 @@ function processAuction($connect) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$bidder = MYDB_fetch_array($result); $bidder = MYDB_fetch_array($result);
//판매거래 //판매거래
if($auction[type] == 0) { if($auction['type'] == 0) {
if($auction[amount] > $trader[rice] - 1000) { if($auction['amount'] > $trader['rice'] - 1000) {
$gold = round($auction[value] * 0.01); $gold = round($auction['value'] * 0.01);
$trader[gold] -= $gold; $trader['gold'] -= $gold;
if($trader[gold] < 0) $trader[gold] = 0; if($trader['gold'] < 0) $trader['gold'] = 0;
$query = "update general set gold='$trader[gold]' where no='$auction[no1]'"; $query = "update general set gold='$trader['gold']' where no='$auction[no1]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$traderLog[0] = "<S>◆</>판매자의 군량 부족으로 {$auction[no]}번 거래 <M>유찰</>! 벌금 <C>{$gold}</>"; $traderLog[0] = "<S>◆</>판매자의 군량 부족으로 {$auction['no']}번 거래 <M>유찰</>! 벌금 <C>{$gold}</>";
$bidderLog[0] = "<S>◆</>판매자의 군량 부족으로 {$auction[no]}번 거래 <M>유찰</>!"; $bidderLog[0] = "<S>◆</>판매자의 군량 부족으로 {$auction['no']}번 거래 <M>유찰</>!";
$auctionLog[0] = "<S>◆</>$admin[year]$admin[month]월, {$auction[no]}번 <O>판매</> <M>유찰</> : <Y>{$auction[name1]}</>(이)가 쌀 <C>{$auction[amount]}</>(을)를 판매, <Y>{$auction[name2]}</>(이)가 금 <C>{$auction[value]}</>(으)로 입찰, 그러나 판매자 군량부족, 벌금 <C>{$gold}</>"; $auctionLog[0] = "<S>◆</>$admin['year']$admin['month']월, {$auction['no']}번 <O>판매</> <M>유찰</> : <Y>{$auction[name1]}</>(이)가 쌀 <C>{$auction['amount']}</>(을)를 판매, <Y>{$auction[name2]}</>(이)가 금 <C>{$auction['value']}</>(으)로 입찰, 그러나 판매자 군량부족, 벌금 <C>{$gold}</>";
} elseif($auction[value] > $bidder[gold] - 1000) { } elseif($auction['value'] > $bidder['gold'] - 1000) {
$gold = round($auction[value] * 0.01); $gold = round($auction['value'] * 0.01);
$bidder[gold] -= $gold; $bidder['gold'] -= $gold;
if($bidder[gold] < 0) $bidder[gold] = 0; if($bidder['gold'] < 0) $bidder['gold'] = 0;
$query = "update general set gold='$bidder[gold]' where no='$auction[no2]'"; $query = "update general set gold='$bidder['gold']' where no='$auction[no2]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$traderLog[0] = "<S>◆</>입찰자의 자금 부족으로 {$auction[no]}번 거래 <M>유찰</>!"; $traderLog[0] = "<S>◆</>입찰자의 자금 부족으로 {$auction['no']}번 거래 <M>유찰</>!";
$bidderLog[0] = "<S>◆</>입찰자의 자금 부족으로 {$auction[no]}번 거래 <M>유찰</>! 벌금 <C>{$gold}</>"; $bidderLog[0] = "<S>◆</>입찰자의 자금 부족으로 {$auction['no']}번 거래 <M>유찰</>! 벌금 <C>{$gold}</>";
$auctionLog[0] = "<S>◆</>$admin[year]$admin[month]월, {$auction[no]}번 <O>판매</> <M>유찰</> : <Y>{$auction[name1]}</>(이)가 쌀 <C>{$auction[amount]}</>(을)를 판매, <Y>{$auction[name2]}</>(이)가 금 <C>{$auction[value]}</>(으)로 입찰, 그러나 입찰자 자금부족, 벌금 <C>{$gold}</>"; $auctionLog[0] = "<S>◆</>$admin['year']$admin['month']월, {$auction['no']}번 <O>판매</> <M>유찰</> : <Y>{$auction[name1]}</>(이)가 쌀 <C>{$auction['amount']}</>(을)를 판매, <Y>{$auction[name2]}</>(이)가 금 <C>{$auction['value']}</>(으)로 입찰, 그러나 입찰자 자금부족, 벌금 <C>{$gold}</>";
} else { } else {
$traderLog[0] = "<S>◆</>{$auction[no]}번 거래 <C>성사</>로 쌀 <C>{$auction[amount]}</>(을)를 판매, 금 <C>{$auction[value]}</>(을)를 획득!"; $traderLog[0] = "<S>◆</>{$auction['no']}번 거래 <C>성사</>로 쌀 <C>{$auction['amount']}</>(을)를 판매, 금 <C>{$auction['value']}</>(을)를 획득!";
$bidderLog[0] = "<S>◆</>{$auction[no]}번 거래 <C>성사</>로 금 <C>{$auction[value]}</>(을)를 지불, 쌀 <C>{$auction[amount]}</>(을)를 구입!"; $bidderLog[0] = "<S>◆</>{$auction['no']}번 거래 <C>성사</>로 금 <C>{$auction['value']}</>(을)를 지불, 쌀 <C>{$auction['amount']}</>(을)를 구입!";
$auctionLog[0] = "<S>◆</>$admin[year]$admin[month]월, {$auction[no]}번 <O>판매</> <C>성사</> : <Y>{$auction[name1]}</>(이)가 쌀 <C>{$auction[amount]}</>(을)를 판매, <Y>{$auction[name2]}</>(이)가 금 <C>{$auction[value]}</>(으)로 구매"; $auctionLog[0] = "<S>◆</>$admin['year']$admin['month']월, {$auction['no']}번 <O>판매</> <C>성사</> : <Y>{$auction[name1]}</>(이)가 쌀 <C>{$auction['amount']}</>(을)를 판매, <Y>{$auction[name2]}</>(이)가 금 <C>{$auction['value']}</>(으)로 구매";
if($auction[value] >= $auction[amount] * 2) { if($auction['value'] >= $auction['amount'] * 2) {
$auctionLog[0] .= " <R>★ 최고가 거래 ★</>"; $auctionLog[0] .= " <R>★ 최고가 거래 ★</>";
} elseif($auction[value] >= $auction[topv]) { } elseif($auction['value'] >= $auction['topv']) {
$auctionLog[0] .= " <M>★ 즉시구매가 거래 ★</>"; $auctionLog[0] .= " <M>★ 즉시구매가 거래 ★</>";
} elseif($auction[value] * 2 <= $auction[amount]) { } elseif($auction['value'] * 2 <= $auction['amount']) {
$auctionLog[0] .= " <R>★ 최저가 거래 ★</>"; $auctionLog[0] .= " <R>★ 최저가 거래 ★</>";
} }
$query = "update general set gold=gold+'$auction[value]',rice=rice-'$auction[amount]' where no='$auction[no1]'"; $query = "update general set gold=gold+'$auction['value']',rice=rice-'$auction['amount']' where no='$auction[no1]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update general set gold=gold-'$auction[value]',rice=rice+'$auction[amount]' where no='$auction[no2]'"; $query = "update general set gold=gold-'$auction['value']',rice=rice+'$auction['amount']' where no='$auction[no2]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
pushGenLog($trader, $traderLog); pushGenLog($trader, $traderLog);
@@ -296,41 +296,41 @@ function processAuction($connect) {
pushAuctionLog($connect, $auctionLog); pushAuctionLog($connect, $auctionLog);
//구매거래 //구매거래
} else { } else {
if($auction[amount] > $bidder[rice] - 1000) { if($auction['amount'] > $bidder['rice'] - 1000) {
$gold = round($auction[value] * 0.01); $gold = round($auction['value'] * 0.01);
$bidder[gold] -= $gold; $bidder['gold'] -= $gold;
if($bidder[gold] < 0) $bidder[gold] = 0; if($bidder['gold'] < 0) $bidder['gold'] = 0;
$query = "update general set gold='$bidder[gold]' where no='$auction[no2]'"; $query = "update general set gold='$bidder['gold']' where no='$auction[no2]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$traderLog[0] = "<S>◆</>입찰자의 군량 부족으로 {$auction[no]}번 거래 <M>유찰</>!"; $traderLog[0] = "<S>◆</>입찰자의 군량 부족으로 {$auction['no']}번 거래 <M>유찰</>!";
$bidderLog[0] = "<S>◆</>입찰자의 군량 부족으로 {$auction[no]}번 거래 <M>유찰</>! 벌금 <C>{$gold}</>"; $bidderLog[0] = "<S>◆</>입찰자의 군량 부족으로 {$auction['no']}번 거래 <M>유찰</>! 벌금 <C>{$gold}</>";
$auctionLog[0] = "<S>◆</>$admin[year]$admin[month]월, {$auction[no]}번 <S>구매</> <M>유찰</> : <Y>{$auction[name1]}</>(이)가 쌀 <C>{$auction[amount]}</>(을)를 구매, <Y>{$auction[name2]}</>(이)가 금 <C>{$auction[value]}</>(으)로 입찰, 그러나 입찰자 군량부족, 벌금 <C>{$gold}</>"; $auctionLog[0] = "<S>◆</>$admin['year']$admin['month']월, {$auction['no']}번 <S>구매</> <M>유찰</> : <Y>{$auction[name1]}</>(이)가 쌀 <C>{$auction['amount']}</>(을)를 구매, <Y>{$auction[name2]}</>(이)가 금 <C>{$auction['value']}</>(으)로 입찰, 그러나 입찰자 군량부족, 벌금 <C>{$gold}</>";
} elseif($auction[value] > $trader[gold] - 1000) { } elseif($auction['value'] > $trader['gold'] - 1000) {
$gold = round($auction[value] * 0.01); $gold = round($auction['value'] * 0.01);
$trader[gold] -= $gold; $trader['gold'] -= $gold;
if($trader[gold] < 0) $trader[gold] = 0; if($trader['gold'] < 0) $trader['gold'] = 0;
$query = "update general set gold='$trader[gold]' where no='$auction[no1]'"; $query = "update general set gold='$trader['gold']' where no='$auction[no1]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$traderLog[0] = "<S>◆</>구매자의 자금 부족으로 {$auction[no]}번 거래 <M>유찰</>! 벌금 <C>{$gold}</>"; $traderLog[0] = "<S>◆</>구매자의 자금 부족으로 {$auction['no']}번 거래 <M>유찰</>! 벌금 <C>{$gold}</>";
$bidderLog[0] = "<S>◆</>구매자의 자금 부족으로 {$auction[no]}번 거래 <M>유찰</>!"; $bidderLog[0] = "<S>◆</>구매자의 자금 부족으로 {$auction['no']}번 거래 <M>유찰</>!";
$auctionLog[0] = "<S>◆</>$admin[year]$admin[month]월, {$auction[no]}번 <S>구매</> <M>유찰</> : <Y>{$auction[name1]}</>(이)가 쌀 <C>{$auction[amount]}</>(을)를 구매, <Y>{$auction[name2]}</>(이)가 금 <C>{$auction[value]}</>(으)로 입찰, 그러나 구매자 자금부족, 벌금 <C>{$gold}</>"; $auctionLog[0] = "<S>◆</>$admin['year']$admin['month']월, {$auction['no']}번 <S>구매</> <M>유찰</> : <Y>{$auction[name1]}</>(이)가 쌀 <C>{$auction['amount']}</>(을)를 구매, <Y>{$auction[name2]}</>(이)가 금 <C>{$auction['value']}</>(으)로 입찰, 그러나 구매자 자금부족, 벌금 <C>{$gold}</>";
} else { } else {
$traderLog[0] = "<S>◆</>{$auction[no]}번 거래 <C>성사</>로 금 <C>{$auction[value]}</>(을)를 지불, 쌀 <C>{$auction[amount]}</>(을)를 구입!"; $traderLog[0] = "<S>◆</>{$auction['no']}번 거래 <C>성사</>로 금 <C>{$auction['value']}</>(을)를 지불, 쌀 <C>{$auction['amount']}</>(을)를 구입!";
$bidderLog[0] = "<S>◆</>{$auction[no]}번 거래 <C>성사</>로 쌀 <C>{$auction[amount]}</>(을)를 판매, 금 <C>{$auction[value]}</>(을)를 획득!"; $bidderLog[0] = "<S>◆</>{$auction['no']}번 거래 <C>성사</>로 쌀 <C>{$auction['amount']}</>(을)를 판매, 금 <C>{$auction['value']}</>(을)를 획득!";
$auctionLog[0] = "<S>◆</>$admin[year]$admin[month]월, {$auction[no]}번 <S>구매</> <C>성사</> : <Y>{$auction[name1]}</>(이)가 쌀 <C>{$auction[amount]}</>(을)를 구매, <Y>{$auction[name2]}</>(이)가 금 <C>{$auction[value]}</>(으)로 판매"; $auctionLog[0] = "<S>◆</>$admin['year']$admin['month']월, {$auction['no']}번 <S>구매</> <C>성사</> : <Y>{$auction[name1]}</>(이)가 쌀 <C>{$auction['amount']}</>(을)를 구매, <Y>{$auction[name2]}</>(이)가 금 <C>{$auction['value']}</>(으)로 판매";
if($auction[value] >= $auction[amount] * 2) { if($auction['value'] >= $auction['amount'] * 2) {
$auctionLog[0] .= " <R>★ 최고가 거래 ★</>"; $auctionLog[0] .= " <R>★ 최고가 거래 ★</>";
} elseif($auction[value] * 2 <= $auction[amount]) { } elseif($auction['value'] * 2 <= $auction['amount']) {
$auctionLog[0] .= " <R>★ 최저가 거래 ★</>"; $auctionLog[0] .= " <R>★ 최저가 거래 ★</>";
} elseif($auction[value] <= $auction[topv]) { } elseif($auction['value'] <= $auction['topv']) {
$auctionLog[0] .= " <M>★ 즉시구매가 거래 ★</>"; $auctionLog[0] .= " <M>★ 즉시구매가 거래 ★</>";
} }
$query = "update general set gold=gold-'$auction[value]',rice=rice+'$auction[amount]' where no='$auction[no1]'"; $query = "update general set gold=gold-'$auction['value']',rice=rice+'$auction['amount']' where no='$auction[no1]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update general set gold=gold+'$auction[value]',rice=rice-'$auction[amount]' where no='$auction[no2]'"; $query = "update general set gold=gold+'$auction['value']',rice=rice-'$auction['amount']' where no='$auction[no2]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
pushGenLog($trader, $traderLog); pushGenLog($trader, $traderLog);
+5 -5
View File
@@ -105,13 +105,13 @@ function LogHistory($connect, $isFirst=0) {
for($i=0; $i < $nationcount; $i++) { for($i=0; $i < $nationcount; $i++) {
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
$query = "select city from city where nation='$nation[nation]'"; $query = "select city from city where nation='$nation['nation']'";
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($cityresult); $citycount = MYDB_num_rows($cityresult);
$nationStr .= "<font color=cyan>◆</font> <font style=color:".newColor($nation[color]).";background-color:$nation[color];>$nation[name]</font><br>"; $nationStr .= "<font color=cyan>◆</font> <font style=color:".newColor($nation['color']).";background-color:$nation['color'];>$nation['name']</font><br>";
$powerStr .= "국력 $nation[power]<br>"; $powerStr .= "국력 $nation['power']<br>";
$genStr .= "장수 $nation[gennum]<br>"; $genStr .= "장수 $nation['gennum']<br>";
$cityStr .= "속령 $citycount<br>"; $cityStr .= "속령 $citycount<br>";
} }
@@ -121,7 +121,7 @@ function LogHistory($connect, $isFirst=0) {
insert into history ( insert into history (
year, month, map, log, genlog, nation, power, gen, city year, month, map, log, genlog, nation, power, gen, city
) values ( ) values (
'$admin[year]', '$admin[month]', '$map', '$log', '$genlog', '$nationStr', '$powerStr', '$genStr', '$cityStr' '$admin['year']', '$admin['month']', '$map', '$log', '$genlog', '$nationStr', '$powerStr', '$genStr', '$cityStr'
)", )",
$connect) or Error(__LINE__.MYDB_error($connect),""); $connect) or Error(__LINE__.MYDB_error($connect),"");
+213 -213
View File
@@ -5,8 +5,8 @@ function RegNPC($connect) {
$result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$admin = MYDB_fetch_array($result); $admin = MYDB_fetch_array($result);
$fiction = $admin[fiction]; $turnterm = $admin[turnterm]; $startyear = $admin[startyear]; $year = $admin[year]; $fiction = $admin['fiction']; $turnterm = $admin['turnterm']; $startyear = $admin['startyear']; $year = $admin['year'];
$img = $admin[img]; $img = $admin['img'];
// 상성 이름 사진 국가 도시 통 무 지 급 출생 사망 꿈 특기 // 상성 이름 사진 국가 도시 통 무 지 급 출생 사망 꿈 특기
RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1001, 1, "소제1",$img,1001, 0, "-", 20, 11, 48, 0, 168, 190, "유지", "-"); RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1001, 1, "소제1",$img,1001, 0, "-", 20, 11, 48, 0, 168, 190, "유지", "-");
RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1002, 1, "헌제",$img,1002, 0, "-", 17, 13, 61, 0, 170, 250, "안전", "-", "한 왕실을 구해줄 이는 진정 없는 것인가..."); RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1002, 1, "헌제",$img,1002, 0, "-", 17, 13, 61, 0, 170, 250, "안전", "-", "한 왕실을 구해줄 이는 진정 없는 것인가...");
@@ -500,7 +500,7 @@ function RegNPC($connect) {
RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1490, 50, "황호",$img,1490, 0, "-", 15, 17, 48, 0, 226, 263, "안전", "-"); RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1490, 50, "황호",$img,1490, 0, "-", 15, 17, 48, 0, 226, 263, "안전", "-");
RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1491, 147, "후성",$img,1491, 0, "-", 56, 62, 33, 0, 158, 199, "정복", "-"); RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1491, 147, "후성",$img,1491, 0, "-", 56, 62, 33, 0, 158, 199, "정복", "-");
if($admin[extend] > 0) { if($admin['extend'] > 0) {
RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1492, 123, "가화",$img,1492, 0, "-", 50, 66, 40, 0, 176, 224, "-", "-"); RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1492, 123, "가화",$img,1492, 0, "-", 50, 66, 40, 0, 176, 224, "-", "-");
RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1493, 999, "건석",$img,1493, 0, "-", 21, 12, 61, 0, 155, 189, "-", "-"); RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1493, 999, "건석",$img,1493, 0, "-", 21, 12, 61, 0, 155, 189, "-", "-");
RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1494, 999, "견씨",$img,1494, 0, "-", 35, 24, 58, 0, 182, 221, "-", "-"); RegGeneral($connect,0,0,$fiction,$turnterm,$startyear,$year,1494, 999, "견씨",$img,1494, 0, "-", 35, 24, 58, 0, 182, 221, "-", "-");
@@ -800,7 +800,7 @@ function SetDevelop($connect, $genType, $no, $city, $tech) {
$city = MYDB_fetch_array($result); $city = MYDB_fetch_array($result);
// 우선 선정 // 우선 선정
if($city[rate] < 95) { if($city['rate'] < 95) {
$command = EncodeCommand(0, 0, 0, 4); // 우선 선정 $command = EncodeCommand(0, 0, 0, 4); // 우선 선정
$query = "update general set turn0='$command' where no='$no'"; $query = "update general set turn0='$command' where no='$no'";
@@ -814,16 +814,16 @@ function SetDevelop($connect, $genType, $no, $city, $tech) {
case 0: //무장 case 0: //무장
case 2: //무내정장 case 2: //무내정장
if($prob < 30) { if($prob < 30) {
if($city[de] < 99) { $command = EncodeCommand(0, 0, 0, 5); } //수비 if($city['de'] < 99) { $command = EncodeCommand(0, 0, 0, 5); } //수비
elseif($city[po] < 99) { $command = EncodeCommand(0, 0, 0, 7); } //정장 elseif($city['po'] < 99) { $command = EncodeCommand(0, 0, 0, 7); } //정장
else { $command = EncodeCommand(0, 0, 0, 9); } //조달 else { $command = EncodeCommand(0, 0, 0, 9); } //조달
} elseif($prob < 60) { } elseif($prob < 60) {
if($city[wa] < 99) { $command = EncodeCommand(0, 0, 0, 6); } //성벽 if($city['wa'] < 99) { $command = EncodeCommand(0, 0, 0, 6); } //성벽
elseif($city[po] < 99) { $command = EncodeCommand(0, 0, 0, 7); } //정장 elseif($city['po'] < 99) { $command = EncodeCommand(0, 0, 0, 7); } //정장
else { $command = EncodeCommand(0, 0, 0, 9); } //조달 else { $command = EncodeCommand(0, 0, 0, 9); } //조달
} elseif($prob < 90) { } elseif($prob < 90) {
if($city[se] < 99) { $command = EncodeCommand(0, 0, 0, 8); } //치안 if($city['se'] < 99) { $command = EncodeCommand(0, 0, 0, 8); } //치안
elseif($city[po] < 99) { $command = EncodeCommand(0, 0, 0, 7); } //정장 elseif($city['po'] < 99) { $command = EncodeCommand(0, 0, 0, 7); } //정장
else { $command = EncodeCommand(0, 0, 0, 9); } //조달 else { $command = EncodeCommand(0, 0, 0, 9); } //조달
} else { } else {
$command = EncodeCommand(0, 0, 0, 29); $command = EncodeCommand(0, 0, 0, 29);
@@ -832,18 +832,18 @@ function SetDevelop($connect, $genType, $no, $city, $tech) {
case 1: //지장 case 1: //지장
case 3: //지내정장 case 3: //지내정장
if($prob < 40) { if($prob < 40) {
if($city[ag] < 99) { $command = EncodeCommand(0, 0, 0, 1); } //농업 if($city['ag'] < 99) { $command = EncodeCommand(0, 0, 0, 1); } //농업
elseif($tech < 10000) { $command = EncodeCommand(0, 0, 0, 3); } //기술 elseif($tech < 10000) { $command = EncodeCommand(0, 0, 0, 3); } //기술
elseif($city[po] < 99) { $command = EncodeCommand(0, 0, 0, 7); } //정장 elseif($city['po'] < 99) { $command = EncodeCommand(0, 0, 0, 7); } //정장
else { $command = EncodeCommand(0, 0, 0, 9); } //조달 else { $command = EncodeCommand(0, 0, 0, 9); } //조달
} elseif($prob < 80) { } elseif($prob < 80) {
if($city[co] < 99) { $command = EncodeCommand(0, 0, 0, 2); } //상업 if($city['co'] < 99) { $command = EncodeCommand(0, 0, 0, 2); } //상업
elseif($tech < 10000) { $command = EncodeCommand(0, 0, 0, 3); } //기술 elseif($tech < 10000) { $command = EncodeCommand(0, 0, 0, 3); } //기술
elseif($city[po] < 99) { $command = EncodeCommand(0, 0, 0, 7); } //정장 elseif($city['po'] < 99) { $command = EncodeCommand(0, 0, 0, 7); } //정장
else { $command = EncodeCommand(0, 0, 0, 9); } //조달 else { $command = EncodeCommand(0, 0, 0, 9); } //조달
} elseif($prob < 90) { } elseif($prob < 90) {
if($tech < 10000) { $command = EncodeCommand(0, 0, 0, 3); } //기술 if($tech < 10000) { $command = EncodeCommand(0, 0, 0, 3); } //기술
elseif($city[po] < 99) { $command = EncodeCommand(0, 0, 0, 7); } //정장 elseif($city['po'] < 99) { $command = EncodeCommand(0, 0, 0, 7); } //정장
else { $command = EncodeCommand(0, 0, 0, 9); } //조달 else { $command = EncodeCommand(0, 0, 0, 9); } //조달
} else { } else {
if($tech < 10000) { $command = EncodeCommand(0, 0, 0, 3 + (rand() % 2) * 6); } //기술, 조달 if($tech < 10000) { $command = EncodeCommand(0, 0, 0, 3 + (rand() % 2) * 6); } //기술, 조달
@@ -956,7 +956,7 @@ function processAI($connect, $no) {
$result = MYDB_query($query, $connect) or Error("processAI00 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI00 ".MYDB_error($connect),"");
$admin = MYDB_fetch_array($result); $admin = MYDB_fetch_array($result);
// 초반 여부 // 초반 여부
if($admin[startyear]+2 > $admin[year] || ($admin[startyear]+2 == $admin[year] && $admin[month] < 5)) { if($admin['startyear']+2 > $admin['year'] || ($admin['startyear']+2 == $admin['year'] && $admin['month'] < 5)) {
$isStart = 1; $isStart = 1;
} else { } else {
$isStart = 0; $isStart = 0;
@@ -971,56 +971,56 @@ function processAI($connect, $no) {
return; return;
} }
$query = "select city,region,nation,level,path,rate,gen1,gen2,gen3,pop,supply,front from city where city='$general[city]'"; $query = "select city,region,nation,level,path,rate,gen1,gen2,gen3,pop,supply,front from city where city='$general['city']'";
$result = MYDB_query($query, $connect) or Error("processAI02 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI02 ".MYDB_error($connect),"");
$city = MYDB_fetch_array($result); $city = MYDB_fetch_array($result);
$query = "select nation,level,tech,gold,rice,rate,type,color,name,war from nation where nation='$general[nation]'"; $query = "select nation,level,tech,gold,rice,rate,type,color,name,war from nation where nation='$general['nation']'";
$result = MYDB_query($query, $connect) or Error("processAI03 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI03 ".MYDB_error($connect),"");
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
if($general[level] >= 5) { if($general['level'] >= 5) {
$query = "select l{$general[level]}turn0 from nation where nation='$general[nation]'"; $query = "select l{$general['level']}turn0 from nation where nation='$general['nation']'";
$result = MYDB_query($query, $connect) or Error("processAI03 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI03 ".MYDB_error($connect),"");
$coreCommand = MYDB_fetch_array($result); $coreCommand = MYDB_fetch_array($result);
} }
$attackable = 0; $attackable = 0;
$query = "select city from city where nation='$general[nation]' and supply='1' and front=1"; $query = "select city from city where nation='$general['nation']' and supply='1' and front=1";
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
$cityCount = MYDB_num_rows($result); $cityCount = MYDB_num_rows($result);
// 공격가능도시 있으면 1 // 공격가능도시 있으면 1
if($cityCount > 0) { $attackable = 1; } if($cityCount > 0) { $attackable = 1; }
$dipState = 0; $dipState = 0;
$query = "select no from diplomacy where me='$general[nation]' and state=1 and term>8"; $query = "select no from diplomacy where me='$general['nation']' and state=1 and term>8";
$result = MYDB_query($query, $connect) or Error("processAI04 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI04 ".MYDB_error($connect),"");
$dipCount = MYDB_num_rows($result); $dipCount = MYDB_num_rows($result);
// 선포중이면 1상태 // 선포중이면 1상태
if($dipCount > 0) { $dipState = 1; } if($dipCount > 0) { $dipState = 1; }
$query = "select no from diplomacy where me='$general[nation]' and state=1 and term<=8"; $query = "select no from diplomacy where me='$general['nation']' and state=1 and term<=8";
$result = MYDB_query($query, $connect) or Error("processAI04 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI04 ".MYDB_error($connect),"");
$dipCount = MYDB_num_rows($result); $dipCount = MYDB_num_rows($result);
// 전쟁준비 선포중이면 2상태 // 전쟁준비 선포중이면 2상태
if($dipCount > 0) { $dipState = 2; } if($dipCount > 0) { $dipState = 2; }
$query = "select no from diplomacy where me='$general[nation]' and state=1 and term<=3"; $query = "select no from diplomacy where me='$general['nation']' and state=1 and term<=3";
$result = MYDB_query($query, $connect) or Error("processAI04 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI04 ".MYDB_error($connect),"");
$dipCount = MYDB_num_rows($result); $dipCount = MYDB_num_rows($result);
// 교전 직전이면 3상태 // 교전 직전이면 3상태
if($dipCount > 0) { $dipState = 3; } if($dipCount > 0) { $dipState = 3; }
$query = "select no from diplomacy where me='$general[nation]' and state=0"; $query = "select no from diplomacy where me='$general['nation']' and state=0";
$result = MYDB_query($query, $connect) or Error("processAI04 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI04 ".MYDB_error($connect),"");
$dipCount = MYDB_num_rows($result); $dipCount = MYDB_num_rows($result);
// 교전중이면 4상태 // 교전중이면 4상태
if($dipCount > 0) { $dipState = 4; } if($dipCount > 0) { $dipState = 4; }
//무장 //무장
if($general[power] >= $general[intel]) { if($general['power'] >= $general['intel']) {
$genType = 0; $genType = 0;
if($general[intel] >= $general[power] * 0.8) { //무지장 if($general['intel'] >= $general['power'] * 0.8) { //무지장
switch(rand() % 5) { switch(rand() % 5) {
case 0: case 1: case 2: case 3: $genType = 0; break; case 0: case 1: case 2: case 3: $genType = 0; break;
case 4: $genType = 1; break; case 4: $genType = 1; break;
@@ -1029,7 +1029,7 @@ function processAI($connect, $no) {
//지장 //지장
} else { } else {
$genType = 1; $genType = 1;
if($general[power] >= $general[intel] * 0.8) { //지무장 if($general['power'] >= $general['intel'] * 0.8) { //지무장
switch(rand() % 5) { switch(rand() % 5) {
case 0: $genType = 0; break; case 0: $genType = 0; break;
case 1: case 2: case 3: case 4: $genType = 1; break; case 1: case 2: case 3: case 4: $genType = 1; break;
@@ -1038,29 +1038,29 @@ function processAI($connect, $no) {
} }
//내정장 //내정장
if($general[leader] < 40) { if($general['leader'] < 40) {
$genType += 2; $genType += 2;
//$genType = 2; // 무내정장 //$genType = 2; // 무내정장
//$genType = 3; // 지내정장 //$genType = 3; // 지내정장
} }
$tech = getTechCost($nation[tech]); $tech = getTechCost($nation['tech']);
if($general[atmos] >= 90 && $general[train] >= 90) { if($general['atmos'] >= 90 && $general['train'] >= 90) {
if($general[mode] == 0) { if($general['mode'] == 0) {
$query = "update general set mode=1 where no='$general[no]'"; $query = "update general set mode=1 where no='$general['no']'";
MYDB_query($query, $connect) or Error("processAI05 ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("processAI05 ".MYDB_error($connect),"");
} }
} else { } else {
if($general[mode] == 1) { if($general['mode'] == 1) {
$query = "update general set mode=0 where no='$general[no]'"; $query = "update general set mode=0 where no='$general['no']'";
MYDB_query($query, $connect) or Error("processAI05 ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("processAI05 ".MYDB_error($connect),"");
} }
} }
//유기체메시지 출력 하루 6번 //유기체메시지 출력 하루 6번
//특별 메세지 있는 경우 출력 하루 4번 //특별 메세지 있는 경우 출력 하루 4번
switch($admin[turnterm]) { switch($admin['turnterm']) {
case 0: $term = 1; break; case 0: $term = 1; break;
case 1: $term = 1; break; case 1: $term = 1; break;
case 2: $term = 2; break; case 2: $term = 2; break;
@@ -1070,43 +1070,43 @@ function processAI($connect, $no) {
case 6: $term = 30; break; case 6: $term = 30; break;
case 7: $term = 60; break; case 7: $term = 60; break;
} }
if($general[npcid] == 2000 && rand()%(24*$term) < 6) { if($general['npcid'] == 2000 && rand()%(24*$term) < 6) {
PushMsg(1, 0, $general[picture], $general[imgsvr], "{$general[name]}:", $nation[color], $nation[name], $nation[color], $general[npcmsg]); PushMsg(1, 0, $general['picture'], $general['imgsvr'], "{$general['name']}:", $nation['color'], $nation['name'], $nation['color'], $general['npcmsg']);
} elseif($general[npcmsg] != "" && rand()%(24*$term) < 3) { } elseif($general['npcmsg'] != "" && rand()%(24*$term) < 3) {
PushMsg(1, 0, $general[picture], $general[imgsvr], "{$general[name]}:", $nation[color], $nation[name], $nation[color], $general[npcmsg]); PushMsg(1, 0, $general['picture'], $general['imgsvr'], "{$general['name']}:", $nation['color'], $nation['name'], $nation['color'], $general['npcmsg']);
} }
//재야인경우 //재야인경우
if($general[npc] == 5 && $general[level] == 0) { if($general['npc'] == 5 && $general['level'] == 0) {
// 오랑캐는 바로 임관 // 오랑캐는 바로 임관
$query = "select nation from general where level=12 and npc=5 and nation not in (0{$general['nations']}0) order by rand() limit 0,1"; $query = "select nation from general where level=12 and npc=5 and nation not in (0{$general['nations']}0) order by rand() limit 0,1";
$result = MYDB_query($query, $connect) or Error("processAI06 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI06 ".MYDB_error($connect),"");
$rulerCount = MYDB_num_rows($result); $rulerCount = MYDB_num_rows($result);
if($rulerCount > 0) { if($rulerCount > 0) {
$ruler = MYDB_fetch_array($result); $ruler = MYDB_fetch_array($result);
$command = EncodeCommand(0, 0, $ruler[nation], 25); //임관 $command = EncodeCommand(0, 0, $ruler['nation'], 25); //임관
} else { } else {
$command = EncodeCommand(0, 0, 0, 42); //견문 $command = EncodeCommand(0, 0, 0, 42); //견문
} }
$query = "update general set turn0='$command' where no='$general[no]'"; $query = "update general set turn0='$command' where no='$general['no']'";
MYDB_query($query, $connect) or Error("processAI07 ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("processAI07 ".MYDB_error($connect),"");
return; return;
} elseif($general[npc] < 5 && $general[level] == 0) { } elseif($general['npc'] < 5 && $general['level'] == 0) {
switch(rand()%5) { switch(rand()%5) {
//임관 40% //임관 40%
case 0: case 1: case 0: case 1:
if($admin[scenario] == 0 || $admin[scenario] >= 20) { if($admin['scenario'] == 0 || $admin['scenario'] >= 20) {
// 가상모드엔 랜덤임관, 초반엔 부상 적은 군주 우선 70% // 가상모드엔 랜덤임관, 초반엔 부상 적은 군주 우선 70%
if($admin[startyear]+3 > $admin[year] && rand()%100 < 70) { if($admin['startyear']+3 > $admin['year'] && rand()%100 < 70) {
$query = "select nation from general where level=12 and nation not in (0{$general['nations']}0) order by injury,rand() limit 0,1"; $query = "select nation from general where level=12 and nation not in (0{$general['nations']}0) order by injury,rand() limit 0,1";
} else { } else {
$query = "select nation from general where level=12 and nation not in (0{$general['nations']}0) order by rand() limit 0,1"; $query = "select nation from general where level=12 and nation not in (0{$general['nations']}0) order by rand() limit 0,1";
} }
$result = MYDB_query($query, $connect) or Error("processAI06 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI06 ".MYDB_error($connect),"");
$rulerCount = MYDB_num_rows($result); $rulerCount = MYDB_num_rows($result);
if($rulerCount > 0 && $general[npcmatch] != 999 && $general[makelimit] == 0) { if($rulerCount > 0 && $general['npcmatch'] != 999 && $general['makelimit'] == 0) {
$ruler = MYDB_fetch_array($result); $ruler = MYDB_fetch_array($result);
$command = EncodeCommand(0, 0, $ruler[nation], 25); //임관 $command = EncodeCommand(0, 0, $ruler['nation'], 25); //임관
} else { } else {
$command = EncodeCommand(0, 0, 0, 42); //견문 $command = EncodeCommand(0, 0, 0, 42); //견문
} }
@@ -1120,17 +1120,17 @@ function processAI($connect, $no) {
$ratio = round($npcCount / ($nonCount + $npcCount) * 100); $ratio = round($npcCount / ($nonCount + $npcCount) * 100);
$ratio = round($ratio * 1.0); $ratio = round($ratio * 1.0);
//NPC우선임관 //NPC우선임관
$query = "select nation,ABS(IF(ABS(npcmatch-'$general[npcmatch]')>75,150-ABS(npcmatch-'$general[npcmatch]'),ABS(npcmatch-'$general[npcmatch]'))) as npcmatch2 from general where level=12 and npc>0 and nation not in (0{$general['nations']}0) order by npcmatch2,rand() limit 0,1"; $query = "select nation,ABS(IF(ABS(npcmatch-'$general['npcmatch']')>75,150-ABS(npcmatch-'$general['npcmatch']'),ABS(npcmatch-'$general['npcmatch']'))) as npcmatch2 from general where level=12 and npc>0 and nation not in (0{$general['nations']}0) order by npcmatch2,rand() limit 0,1";
$result = MYDB_query($query, $connect) or Error("processAI06 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI06 ".MYDB_error($connect),"");
$rulerCount = MYDB_num_rows($result); $rulerCount = MYDB_num_rows($result);
if($rulerCount > 0 && $general[npcmatch] != 999 && rand()%100 < $ratio && $general[makelimit] == 0) { // 엔국 비율대로 임관(50% : 50%) if($rulerCount > 0 && $general['npcmatch'] != 999 && rand()%100 < $ratio && $general['makelimit'] == 0) { // 엔국 비율대로 임관(50% : 50%)
$ruler = MYDB_fetch_array($result); $ruler = MYDB_fetch_array($result);
$command = EncodeCommand(0, 0, $ruler[nation], 25); //임관 $command = EncodeCommand(0, 0, $ruler['nation'], 25); //임관
} elseif($general[npcmatch] != 999 && $general[makelimit] == 0) { // NPC국가 없으면 유저국 임관 } elseif($general['npcmatch'] != 999 && $general['makelimit'] == 0) { // NPC국가 없으면 유저국 임관
$query = "select nation from general where level=12 and npc=0 order by rand() limit 0,1"; $query = "select nation from general where level=12 and npc=0 order by rand() limit 0,1";
$result = MYDB_query($query, $connect) or Error("processAI06 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI06 ".MYDB_error($connect),"");
$ruler = MYDB_fetch_array($result); $ruler = MYDB_fetch_array($result);
$command = EncodeCommand(0, 0, $ruler[nation], 25); //임관 $command = EncodeCommand(0, 0, $ruler['nation'], 25); //임관
} else { } else {
$command = EncodeCommand(0, 0, 0, 42); //견문 $command = EncodeCommand(0, 0, 0, 42); //견문
} }
@@ -1139,8 +1139,8 @@ function processAI($connect, $no) {
case 2: case 3: //거병이나 견문 40% case 2: case 3: //거병이나 견문 40%
// 초반이면서 능력이 좋은놈 위주로 1%확률로 거병 (300명 재야시 2년간 약 10개 거병 예상) // 초반이면서 능력이 좋은놈 위주로 1%확률로 거병 (300명 재야시 2년간 약 10개 거병 예상)
$prop = rand() % 100; $prop = rand() % 100;
$ratio = round(($general[leader] + $general[power] + $general[intel]) / 3); $ratio = round(($general['leader'] + $general['power'] + $general['intel']) / 3);
if($admin[startyear]+2 > $admin[year] && $prop < $ratio && rand()%100 < 1 && $general[makelimit] == 0) { if($admin['startyear']+2 > $admin['year'] && $prop < $ratio && rand()%100 < 1 && $general['makelimit'] == 0) {
//거병 //거병
$command = EncodeCommand(0, 0, 0, 55); $command = EncodeCommand(0, 0, 0, 55);
} else { } else {
@@ -1149,80 +1149,80 @@ function processAI($connect, $no) {
} }
break; break;
case 4: //이동 20% case 4: //이동 20%
$paths = explode("|", $city[path]); $paths = explode("|", $city['path']);
$command = EncodeCommand(0, 0, $paths[rand()%count($paths)], 21); $command = EncodeCommand(0, 0, $paths[rand()%count($paths)], 21);
break; break;
} }
$query = "update general set turn0='$command' where no='$general[no]'"; $query = "update general set turn0='$command' where no='$general['no']'";
MYDB_query($query, $connect) or Error("processAI07 ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("processAI07 ".MYDB_error($connect),"");
return; return;
} }
$rulerCommand = 0; $rulerCommand = 0;
//군주가 할일 //군주가 할일
if($general[level] == 12) { if($general['level'] == 12) {
//오랑캐인데 공격 못하면 바로 방랑/해산 //오랑캐인데 공격 못하면 바로 방랑/해산
if($general[npc] == 5 && $dipState == 0 && $attackable == 0) { if($general['npc'] == 5 && $dipState == 0 && $attackable == 0) {
//방랑군이냐 아니냐 //방랑군이냐 아니냐
if($nation[level] == 0) { if($nation['level'] == 0) {
// 해산 // 해산
$command = EncodeCommand(0, 0, 0, 56); $command = EncodeCommand(0, 0, 0, 56);
$query = "update general set turn0='$command' where no='$general[no]'"; $query = "update general set turn0='$command' where no='$general['no']'";
MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),"");
return; return;
} else { } else {
// 방랑 // 방랑
$command = EncodeCommand(0, 0, 0, 47); $command = EncodeCommand(0, 0, 0, 47);
$query = "update general set turn0='$command' where no='$general[no]'"; $query = "update general set turn0='$command' where no='$general['no']'";
MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),"");
return; return;
} }
} }
//분기마다 //분기마다
if($admin[month] == 1 || $admin[month] == 4 || $admin[month] == 7 || $admin[month] == 10) { if($admin['month'] == 1 || $admin['month'] == 4 || $admin['month'] == 7 || $admin['month'] == 10) {
//관직임명 //관직임명
Promotion($connect, $general[nation], $nation[level]); Promotion($connect, $general['nation'], $nation['level']);
} elseif($admin[month] == 12) { } elseif($admin['month'] == 12) {
//세율 //세율
$nation[rate] = TaxRate($connect, $general[nation]); $nation['rate'] = TaxRate($connect, $general['nation']);
//지급율 //지급율
GoldBillRate($connect, $nation[nation], $nation[rate], $admin[gold_rate], $nation[type], $nation[gold]); GoldBillRate($connect, $nation['nation'], $nation['rate'], $admin['gold_rate'], $nation['type'], $nation['gold']);
} elseif($admin[month] == 6) { } elseif($admin['month'] == 6) {
//세율 //세율
$nation[rate] = TaxRate($connect, $general[nation]); $nation['rate'] = TaxRate($connect, $general['nation']);
//지급율 //지급율
RiceBillRate($connect, $nation[nation], $nation[rate], $admin[rice_rate], $nation[type], $nation[rice]); RiceBillRate($connect, $nation['nation'], $nation['rate'], $admin['rice_rate'], $nation['type'], $nation['rice']);
} }
//방랑군이냐 아니냐 //방랑군이냐 아니냐
if($nation[level] == 0) { if($nation['level'] == 0) {
if($admin[startyear]+2 <= $admin[year]) { if($admin['startyear']+2 <= $admin['year']) {
// 해산 // 해산
$command = EncodeCommand(0, 0, 0, 56); $command = EncodeCommand(0, 0, 0, 56);
$query = "update general set turn0='$command' where no='$general[no]'"; $query = "update general set turn0='$command' where no='$general['no']'";
MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),"");
return; return;
} elseif($city[nation] == 0 && ($city[level] == 5 || $city[level] == 6)) { } elseif($city['nation'] == 0 && ($city['level'] == 5 || $city['level'] == 6)) {
$type = rand()%9 + 1; $type = rand()%9 + 1;
$colors = GetNationColors(); $colors = GetNationColors();
$color = rand() % count($colors); $color = rand() % count($colors);
$command = EncodeCommand(0, $type, $color, 46); $command = EncodeCommand(0, $type, $color, 46);
$nationName = ""._String::SubStr($general[name], 1); $nationName = ""._String::SubStr($general['name'], 1);
//건국 //건국
$query = "update general set turn0='$command',makenation='$nationName' where no='$general[no]'"; $query = "update general set turn0='$command',makenation='$nationName' where no='$general['no']'";
MYDB_query($query, $connect) or Error("processAI08 ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("processAI08 ".MYDB_error($connect),"");
return; return;
} elseif(rand()%4 > 0) { } elseif(rand()%4 > 0) {
//이동 //이동
$paths = explode("|", $city[path]); $paths = explode("|", $city['path']);
$command = EncodeCommand(0, 0, $paths[rand()%count($paths)], 21); $command = EncodeCommand(0, 0, $paths[rand()%count($paths)], 21);
$query = "update general set turn0='$command' where no='$general[no]'"; $query = "update general set turn0='$command' where no='$general['no']'";
MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),"");
return; return;
} else { } else {
//조달 //조달
$command = EncodeCommand(0, 0, 0, 9); $command = EncodeCommand(0, 0, 0, 9);
$query = "update general set turn0='$command' where no='$general[no]'"; $query = "update general set turn0='$command' where no='$general['no']'";
MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),"");
return; return;
} }
@@ -1230,27 +1230,27 @@ function processAI($connect, $no) {
//외교 평시에 선포 //외교 평시에 선포
if($dipState == 0 && $attackable == 0) { if($dipState == 0 && $attackable == 0) {
//전방 체크 먼저 //전방 체크 먼저
SetNationFront($connect, $nation[nation]); SetNationFront($connect, $nation['nation']);
$query = "select city from city where nation='$general[nation]' and front=1 limit 0,1"; $query = "select city from city where nation='$general['nation']' and front=1 limit 0,1";
$result = MYDB_query($query, $connect) or Error("processAI02 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI02 ".MYDB_error($connect),"");
$frontCount = MYDB_num_rows($result); $frontCount = MYDB_num_rows($result);
//근접 공백지 없을때 //근접 공백지 없을때
if($frontCount == 0) { if($frontCount == 0) {
$query = "select (sum(pop/10)+sum(agri)+sum(comm)+sum(secu)+sum(def)+sum(wall))/(sum(pop2/10)+sum(agri2)+sum(comm2)+sum(secu2)+sum(def2)+sum(wall2))*100 as dev from city where nation='$general[nation]'"; $query = "select (sum(pop/10)+sum(agri)+sum(comm)+sum(secu)+sum(def)+sum(wall))/(sum(pop2/10)+sum(agri2)+sum(comm2)+sum(secu2)+sum(def2)+sum(wall2))*100 as dev from city where nation='$general['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$devRate = MYDB_fetch_array($result); $devRate = MYDB_fetch_array($result);
//내정이 80% 이상일때 //내정이 80% 이상일때
if($devRate[dev] > 80) { if($devRate['dev'] > 80) {
$query = "select nation from nation where level>0 order by rand()"; $query = "select nation from nation where level>0 order by rand()";
$result = MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),"");
$nationCount = MYDB_num_rows($result); $nationCount = MYDB_num_rows($result);
for($i=0; $i < $nationCount; $i++) { for($i=0; $i < $nationCount; $i++) {
$youNation = MYDB_fetch_array($result); $youNation = MYDB_fetch_array($result);
if(isClose($connect, $general[nation], $youNation[nation])) { if(isClose($connect, $general['nation'], $youNation['nation'])) {
$command = EncodeCommand(0, 0, $youNation[nation], 62); $command = EncodeCommand(0, 0, $youNation['nation'], 62);
$query = "update nation set l12turn0='$command' where nation='$general[nation]'"; $query = "update nation set l12turn0='$command' where nation='$general['nation']'";
MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),"");
$rulerCommand = 1; $rulerCommand = 1;
break; break;
@@ -1263,37 +1263,37 @@ function processAI($connect, $no) {
} }
// 입력된 턴이 있으면 // 입력된 턴이 있으면
if($coreCommand["l{$general[level]}turn0"] != EncodeCommand(0, 0, 0, 99)) { if($coreCommand["l{$general['level']}turn0"] != EncodeCommand(0, 0, 0, 99)) {
$rulerCommand = 1; $rulerCommand = 1;
} }
//방랑군 아니고, 입력된 턴이 없을때 수뇌부가 할일 //방랑군 아니고, 입력된 턴이 없을때 수뇌부가 할일
if($nation[level] != 0 && $general[level] >= 5 && $rulerCommand == 0) { if($nation['level'] != 0 && $general['level'] >= 5 && $rulerCommand == 0) {
$query = "select A.no,A.name,A.nation,B.nation from general A, city B where A.city=B.city and A.nation='$general[nation]' and B.nation!='$general[nation]' and A.no!='$general[no]' order by rand() limit 0,1"; $query = "select A.no,A.name,A.nation,B.nation from general A, city B where A.city=B.city and A.nation='$general['nation']' and B.nation!='$general['nation']' and A.no!='$general['no']' order by rand() limit 0,1";
$result = MYDB_query($query, $connect) or Error("processAI11 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI11 ".MYDB_error($connect),"");
$curGen = MYDB_fetch_array($result); $curGen = MYDB_fetch_array($result);
if($curGen[no] != 0) { // 타도시에 있는 경우 국내로 발령 if($curGen['no'] != 0) { // 타도시에 있는 경우 국내로 발령
if($dipState >= 3) { if($dipState >= 3) {
$query = "select city from city where nation='$general[nation]' and front=1 and supply=1 order by rand() limit 0,1"; $query = "select city from city where nation='$general['nation']' and front=1 and supply=1 order by rand() limit 0,1";
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
$selCity = MYDB_fetch_array($result); $selCity = MYDB_fetch_array($result);
if($selCity[city] > 0) { if($selCity['city'] > 0) {
// 발령 // 발령
$command = EncodeCommand(0, $curGen[no], $selCity[city], 27); $command = EncodeCommand(0, $curGen['no'], $selCity['city'], 27);
} else { } else {
// 발령 // 발령
$command = EncodeCommand(0, $curGen[no], $city[city], 27); $command = EncodeCommand(0, $curGen['no'], $city['city'], 27);
} }
} else { } else {
// 발령 // 발령
$command = EncodeCommand(0, $curGen[no], $city[city], 27); $command = EncodeCommand(0, $curGen['no'], $city['city'], 27);
} }
$query = "update nation set l{$general[level]}turn0='$command' where nation='$general[nation]'"; $query = "update nation set l{$general['level']}turn0='$command' where nation='$general['nation']'";
MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),"");
} elseif($dipState <= 1) { // 평시엔 균등 발령만 } elseif($dipState <= 1) { // 평시엔 균등 발령만
//발령, 최소장수 도시 선택, 최다장수도시의 장수 선택 //발령, 최소장수 도시 선택, 최다장수도시의 장수 선택
$query = "select B.city,count(*) as cnt,((B.agri+B.comm+B.secu+B.def+B.wall)/(B.agri2+B.comm2+B.secu2+B.def2+B.wall2)+(B.pop/B.pop2))/2*100 as dev from general A, city B where A.city=B.city and A.nation='$general[nation]' and B.nation='$general[nation]' and B.supply=1 group by A.city"; $query = "select B.city,count(*) as cnt,((B.agri+B.comm+B.secu+B.def+B.wall)/(B.agri2+B.comm2+B.secu2+B.def2+B.wall2)+(B.pop/B.pop2))/2*100 as dev from general A, city B where A.city=B.city and A.nation='$general['nation']' and B.nation='$general['nation']' and B.supply=1 group by A.city";
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
$cityCount = MYDB_num_rows($result); $cityCount = MYDB_num_rows($result);
//도시 2개 이상일때만 //도시 2개 이상일때만
@@ -1303,20 +1303,20 @@ function processAI($connect, $no) {
$devCity = 0; $devCity = 0;
for($i=0; $i < $cityCount; $i++) { for($i=0; $i < $cityCount; $i++) {
$curCity = MYDB_fetch_array($result); $curCity = MYDB_fetch_array($result);
if($curCity[cnt] >= $max) { $max = $curCity[cnt]; $maxCity = $curCity[city]; } if($curCity['cnt'] >= $max) { $max = $curCity['cnt']; $maxCity = $curCity['city']; }
if($curCity[cnt] <= $min) { $min = $curCity[cnt]; $minCity = $curCity[city]; } if($curCity['cnt'] <= $min) { $min = $curCity['cnt']; $minCity = $curCity['city']; }
if($curCity[dev] < 70) { $devCity = $curCity[city]; } // 개발이 안된 곳 우선 if($curCity['dev'] < 70) { $devCity = $curCity['city']; } // 개발이 안된 곳 우선
} }
if($devCity != 0) { $minCity = $devCity; } if($devCity != 0) { $minCity = $devCity; }
if($maxCity != $minCity) { if($maxCity != $minCity) {
$query = "select no from general where city='$maxCity' and nation='$general[nation]' and no!='$general[no]' and npc>=2 limit 0,1"; $query = "select no from general where city='$maxCity' and nation='$general['nation']' and no!='$general['no']' and npc>=2 limit 0,1";
$result = MYDB_query($query, $connect) or Error("processAI11 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI11 ".MYDB_error($connect),"");
$curGen = MYDB_fetch_array($result); $curGen = MYDB_fetch_array($result);
if($curGen[no] != 0) { if($curGen['no'] != 0) {
// 발령 // 발령
$command = EncodeCommand(0, $curGen[no], $minCity, 27); $command = EncodeCommand(0, $curGen['no'], $minCity, 27);
$query = "update nation set l{$general[level]}turn0='$command' where nation='$general[nation]'"; $query = "update nation set l{$general['level']}turn0='$command' where nation='$general['nation']'";
MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),"");
} }
//계속 진행 //계속 진행
@@ -1324,32 +1324,32 @@ function processAI($connect, $no) {
} }
} else { } else {
// 병사있고 쌀있고 후방에 있는 장수 // 병사있고 쌀있고 후방에 있는 장수
$query = "select A.no from general A, city B where A.city=B.city and A.nation='$general[nation]' and B.nation='$general[nation]' and B.front=0 and A.crew>700 and A.rice>700*{$tech} order by A.npc,A.crew desc limit 0,1"; $query = "select A.no from general A, city B where A.city=B.city and A.nation='$general['nation']' and B.nation='$general['nation']' and B.front=0 and A.crew>700 and A.rice>700*{$tech} order by A.npc,A.crew desc limit 0,1";
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
$selGen = MYDB_fetch_array($result); $selGen = MYDB_fetch_array($result);
// 전방 도시, 30% 확률로 태수 있는 전방으로 발령 // 전방 도시, 30% 확률로 태수 있는 전방으로 발령
if(rand()%100 < 30) { if(rand()%100 < 30) {
$query = "select city from city where nation='$general[nation]' and front=1 and supply=1 order by gen1 desc,rand() limit 0,1"; $query = "select city from city where nation='$general['nation']' and front=1 and supply=1 order by gen1 desc,rand() limit 0,1";
} else { } else {
$query = "select city from city where nation='$general[nation]' and front=1 and supply=1 order by rand() limit 0,1"; $query = "select city from city where nation='$general['nation']' and front=1 and supply=1 order by rand() limit 0,1";
} }
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
$selCity = MYDB_fetch_array($result); $selCity = MYDB_fetch_array($result);
if($selGen[no] > 0 && $selCity[city] > 0 && rand() % 100 < 80) { // 80% 확률 if($selGen['no'] > 0 && $selCity['city'] > 0 && rand() % 100 < 80) { // 80% 확률
// 발령 // 발령
$command = EncodeCommand(0, $selGen[no], $selCity[city], 27); $command = EncodeCommand(0, $selGen['no'], $selCity['city'], 27);
} else { } else {
//병사 없고 인구없는 전방에 있는 장수 //병사 없고 인구없는 전방에 있는 장수
$query = "select A.no from general A, city B where A.city=B.city and A.nation='$general[nation]' and B.nation='$general[nation]' and B.pop<40000 and B.front=1 and A.crew<700 order by A.npc,A.crew limit 0,1"; $query = "select A.no from general A, city B where A.city=B.city and A.nation='$general['nation']' and B.nation='$general['nation']' and B.pop<40000 and B.front=1 and A.crew<700 order by A.npc,A.crew limit 0,1";
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
$selGen = MYDB_fetch_array($result); $selGen = MYDB_fetch_array($result);
// 인구많은도시 // 인구많은도시
$query = "select city from city where nation='$general[nation]' and supply=1 order by pop desc limit 0,1"; $query = "select city from city where nation='$general['nation']' and supply=1 order by pop desc limit 0,1";
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
$selCity = MYDB_fetch_array($result); $selCity = MYDB_fetch_array($result);
if($selGen[no] > 0 && $selCity[city] > 0 && rand() % 100 < 80) { // 80% 확률 if($selGen['no'] > 0 && $selCity['city'] > 0 && rand() % 100 < 80) { // 80% 확률
// 발령 // 발령
$command = EncodeCommand(0, $selGen[no], $selCity[city], 27); $command = EncodeCommand(0, $selGen['no'], $selCity['city'], 27);
} else { } else {
// 발령할 장수 없으면 몰포 // 발령할 장수 없으면 몰포
if(rand() % 2 == 0) { $type = "gold"; $type2 = 1; } if(rand() % 2 == 0) { $type = "gold"; $type2 = 1; }
@@ -1357,50 +1357,50 @@ function processAI($connect, $no) {
if($nation[$type] < 1000) { // 몰수 if($nation[$type] < 1000) { // 몰수
// 몰수 대상 // 몰수 대상
$query = "select no,{$type} from general where nation='$general[nation]' and no!='$general[no]' and {$type}>3000 order by {$type} desc limit 0,1"; $query = "select no,{$type} from general where nation='$general['nation']' and no!='$general['no']' and {$type}>3000 order by {$type} desc limit 0,1";
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
$SelGen = MYDB_fetch_array($result); $SelGen = MYDB_fetch_array($result);
if($SelGen[no] != 0) { if($SelGen['no'] != 0) {
$amount = floor($SelGen[$type] / 5000)*10 + 10; $amount = floor($SelGen[$type] / 5000)*10 + 10;
if($amount > 100) $amount = 100; if($amount > 100) $amount = 100;
// 몰수 // 몰수
$command = EncodeCommand($type2, $SelGen[no], $amount, 24); // 금,쌀 1000단위 몰수 $command = EncodeCommand($type2, $SelGen['no'], $amount, 24); // 금,쌀 1000단위 몰수
} }
} else { // 포상 } else { // 포상
// 포상 대상 // 포상 대상
$query = "select no from general where nation='$general[nation]' and no!='$general[no]' and killturn>=5 order by {$type} limit 0,1"; $query = "select no from general where nation='$general['nation']' and no!='$general['no']' and killturn>=5 order by {$type} limit 0,1";
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
$SelGen = MYDB_fetch_array($result); $SelGen = MYDB_fetch_array($result);
if($SelGen[no] != 0) { if($SelGen['no'] != 0) {
$amount = floor(($nation[$type]-$_baserice) / 5000)*10 + 10; $amount = floor(($nation[$type]-$_baserice) / 5000)*10 + 10;
if($amount > 100) $amount = 100; if($amount > 100) $amount = 100;
// 포상 // 포상
$command = EncodeCommand($type2, $SelGen[no], $amount, 23); // 금 1000단위 포상 $command = EncodeCommand($type2, $SelGen['no'], $amount, 23); // 금 1000단위 포상
} }
} }
} }
} }
$query = "update nation set l{$general[level]}turn0='$command' where nation='$general[nation]'"; $query = "update nation set l{$general['level']}turn0='$command' where nation='$general['nation']'";
MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),"");
} }
} }
$command = EncodeCommand(0, 0, 0, 1); $command = EncodeCommand(0, 0, 0, 1);
//일반 할일 //일반 할일
if($general[killturn] < 5) { if($general['killturn'] < 5) {
if($general[gold] + $general[rice] == 0) { if($general['gold'] + $general['rice'] == 0) {
$command = EncodeCommand(0, 0, 0, 9); //조달 $command = EncodeCommand(0, 0, 0, 9); //조달
} elseif($general[gold] > $general[rice]) { } elseif($general['gold'] > $general['rice']) {
$command = EncodeCommand(0, 1, 100, 44); //헌납 $command = EncodeCommand(0, 1, 100, 44); //헌납
} else { } else {
$command = EncodeCommand(0, 2, 100, 44); //헌납 $command = EncodeCommand(0, 2, 100, 44); //헌납
} }
} elseif($general[injury] > 10) { } elseif($general['injury'] > 10) {
// 부상 2달 이상이면 요양 // 부상 2달 이상이면 요양
$command = EncodeCommand(0, 0, 0, 50); //요양 $command = EncodeCommand(0, 0, 0, 50); //요양
} elseif($nation[level] == 0) { } elseif($nation['level'] == 0) {
//방랑군일때 //방랑군일때
if($admin[startyear]+3 <= $admin[year]) { if($admin['startyear']+3 <= $admin['year']) {
$command = EncodeCommand(0, 0, 0, 45); //하야 $command = EncodeCommand(0, 0, 0, 45); //하야
} else { } else {
switch(rand()%5) { switch(rand()%5) {
@@ -1413,18 +1413,18 @@ function processAI($connect, $no) {
} else { } else {
//국가일때 //국가일때
//아국땅 아니면 귀환 //아국땅 아니면 귀환
if($general[nation] != $city[nation] || $city[supply] == 0) { if($general['nation'] != $city['nation'] || $city['supply'] == 0) {
$command = EncodeCommand(0, 0, 0, 28); //귀환 $command = EncodeCommand(0, 0, 0, 28); //귀환
$query = "update general set turn0='$command' where no='$general[no]'"; $query = "update general set turn0='$command' where no='$general['no']'";
MYDB_query($query, $connect) or Error("processAI23 ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("processAI23 ".MYDB_error($connect),"");
return; return;
} }
//국가 병량이 없을때 바로 헌납 //국가 병량이 없을때 바로 헌납
if($nation[rice] < 2000 && $general[rice] > 200) { if($nation['rice'] < 2000 && $general['rice'] > 200) {
$amount = floor(($general[rice] - 200)/100) + 1; $amount = floor(($general['rice'] - 200)/100) + 1;
if($amount > 20) { $amount = 20; } if($amount > 20) { $amount = 20; }
$command = EncodeCommand(0, 2, $amount, 44); //헌납 $command = EncodeCommand(0, 2, $amount, 44); //헌납
$query = "update general set turn0='$command' where no='$general[no]'"; $query = "update general set turn0='$command' where no='$general['no']'";
MYDB_query($query, $connect) or Error("processAI23 ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("processAI23 ".MYDB_error($connect),"");
return; return;
} }
@@ -1439,33 +1439,33 @@ function processAI($connect, $no) {
// 100 700 // 100 700
$resrc = $tech * 700; $resrc = $tech * 700;
// 평시거나 초반아니면서 공격가능 없으면서 병사 있으면 해제(25%) // 평시거나 초반아니면서 공격가능 없으면서 병사 있으면 해제(25%)
if($dipState == 0 && $isStart == 0 && $attackable == 0 && $general[crew] > 0 && rand()% 100 < 25) { if($dipState == 0 && $isStart == 0 && $attackable == 0 && $general['crew'] > 0 && rand()% 100 < 25) {
$command = EncodeCommand(0, 0, 0, 17); //소집해제 $command = EncodeCommand(0, 0, 0, 17); //소집해제
} elseif($dipState <= 1 || $isStart == 1) { } elseif($dipState <= 1 || $isStart == 1) {
//평시이거나 선포있어도 초반이면 //평시이거나 선포있어도 초반이면
if($general[gold] + $general[rice] < 200) { $command = EncodeCommand(0, 0, 0, 9); } //금쌀없으면 조달9 if($general['gold'] + $general['rice'] < 200) { $command = EncodeCommand(0, 0, 0, 9); } //금쌀없으면 조달9
elseif($general[rice] > 100 && $city[rate] < 95) { $command = EncodeCommand(0, 0, 0, 4); } //우선 선정 elseif($general['rice'] > 100 && $city['rate'] < 95) { $command = EncodeCommand(0, 0, 0, 4); } //우선 선정
elseif($general[gold] < 100) { //금없으면 쌀팜 elseif($general['gold'] < 100) { //금없으면 쌀팜
$amount = floor(($general[rice] - $general[gold]) / 100 / 2); // 100단위 $amount = floor(($general['rice'] - $general['gold']) / 100 / 2); // 100단위
$command = EncodeCommand(0, 1, $amount, 49); //팜 $command = EncodeCommand(0, 1, $amount, 49); //팜
} elseif($general[gold] < 700 && $general[rice] < 700) { $command = EncodeCommand(0, 0, 0, 1); } //금쌀되면 내정 } elseif($general['gold'] < 700 && $general['rice'] < 700) { $command = EncodeCommand(0, 0, 0, 1); } //금쌀되면 내정
elseif($general[rice] < 100) { //쌀없으면 쌀삼 elseif($general['rice'] < 100) { //쌀없으면 쌀삼
$amount = floor(($general[gold] - $general[rice]) / 100 / 2); // 100단위 $amount = floor(($general['gold'] - $general['rice']) / 100 / 2); // 100단위
$command = EncodeCommand(0, 2, $amount, 49); //삼 $command = EncodeCommand(0, 2, $amount, 49); //삼
} elseif($genType >= 2) { $command = EncodeCommand(0, 0, 0, 1); } //내정장일때 내정 } elseif($genType >= 2) { $command = EncodeCommand(0, 0, 0, 1); } //내정장일때 내정
else { else {
//현도시가 전방이면 공격 가능성 체크 //현도시가 전방이면 공격 가능성 체크
if($city[front] > 0) { if($city['front'] > 0) {
//주변도시 체크 //주변도시 체크
$paths = explode("|", $city[path]); $paths = explode("|", $city['path']);
for($i=0; $i < count($paths); $i++) { for($i=0; $i < count($paths); $i++) {
$query = "select city,nation from city where city='$paths[$i]'"; $query = "select city,nation from city where city='$paths[$i]'";
$result = MYDB_query($query, $connect) or Error("processAI20 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI20 ".MYDB_error($connect),"");
$targetCity = MYDB_fetch_array($result); $targetCity = MYDB_fetch_array($result);
//공백지이면 타겟에 포함 //공백지이면 타겟에 포함
if($targetCity[nation] == 0) { $target[count($target)] = $targetCity[city]; } if($targetCity['nation'] == 0) { $target[count($target)] = $targetCity['city']; }
} }
if(count($target) == 0 || $isStart == 1 || $nation[war] == 1) { $command = EncodeCommand(0, 0, 0, 1); } //공격 가능도시가 없으면 내정 if(count($target) == 0 || $isStart == 1 || $nation['war'] == 1) { $command = EncodeCommand(0, 0, 0, 1); } //공격 가능도시가 없으면 내정
else { $command = EncodeCommand(0, 0, $target[rand()%count($target)], 16); } //있으면 공격 else { $command = EncodeCommand(0, 0, $target[rand()%count($target)], 16); } //있으면 공격
} else { } else {
//전방 아니면 내정 //전방 아니면 내정
@@ -1473,13 +1473,13 @@ function processAI($connect, $no) {
} }
if($command == EncodeCommand(0, 0, 0, 1)) { // 공격아닌 경우 if($command == EncodeCommand(0, 0, 0, 1)) { // 공격아닌 경우
$query = "select city,(pop/10+agri+comm+secu+def+wall)/(pop2/10+agri2+comm2+secu2+def2+wall2)*100 as dev from city where city='$general[city]'"; $query = "select city,(pop/10+agri+comm+secu+def+wall)/(pop2/10+agri2+comm2+secu2+def2+wall2)*100 as dev from city where city='$general['city']'";
$result = MYDB_query($query, $connect) or Error("processAI19 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI19 ".MYDB_error($connect),"");
$selCity = MYDB_fetch_array($result); $selCity = MYDB_fetch_array($result);
$sel = rand() % 10; $sel = rand() % 10;
if($selCity[dev] > 95) { $sel = 9; } if($selCity['dev'] > 95) { $sel = 9; }
elseif($selCity[dev] < 70) { $sel = 0; } elseif($selCity['dev'] < 70) { $sel = 0; }
switch($sel) { switch($sel) {
case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: // 그대로 내정 80 % case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: // 그대로 내정 80 %
$command = EncodeCommand(0, 0, 0, 1); $command = EncodeCommand(0, 0, 0, 1);
@@ -1487,22 +1487,22 @@ function processAI($connect, $no) {
case 8: case 9: // 저개발 도시로 워프 20% case 8: case 9: // 저개발 도시로 워프 20%
//도시 선택, 30% 확률로 군사 있는 곳으로 워프 //도시 선택, 30% 확률로 군사 있는 곳으로 워프
if(rand()%100 < 30) { if(rand()%100 < 30) {
$query = "select city,(pop/10+agri+comm+secu+def+wall)/(pop2/10+agri2+comm2+secu2+def2+wall2)*100 as dev from city where nation='$general[nation]' and supply='1' order by gen2 desc,dev limit 0,1"; $query = "select city,(pop/10+agri+comm+secu+def+wall)/(pop2/10+agri2+comm2+secu2+def2+wall2)*100 as dev from city where nation='$general['nation']' and supply='1' order by gen2 desc,dev limit 0,1";
} else { } else {
$query = "select city,(pop/10+agri+comm+secu+def+wall)/(pop2/10+agri2+comm2+secu2+def2+wall2)*100 as dev from city where nation='$general[nation]' and supply='1' order by dev limit 0,1"; $query = "select city,(pop/10+agri+comm+secu+def+wall)/(pop2/10+agri2+comm2+secu2+def2+wall2)*100 as dev from city where nation='$general['nation']' and supply='1' order by dev limit 0,1";
} }
$result = MYDB_query($query, $connect) or Error("processAI16 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI16 ".MYDB_error($connect),"");
$selCity = MYDB_fetch_array($result); $selCity = MYDB_fetch_array($result);
//이미 그 도시이거나, 그 도시도 고개발이면 내정 //이미 그 도시이거나, 그 도시도 고개발이면 내정
if($selCity[city] == $general[city] || $selCity[dev] > 95) { if($selCity['city'] == $general['city'] || $selCity['dev'] > 95) {
$command = EncodeCommand(0, 0, 0, 1); $command = EncodeCommand(0, 0, 0, 1);
} else { } else {
//워프 //워프
$query = "update general set city='$selCity[city]' where no='$general[no]'"; $query = "update general set city='$selCity['city']' where no='$general['no']'";
MYDB_query($query, $connect) or Error("processAI18 ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("processAI18 ".MYDB_error($connect),"");
$command = EncodeCommand(0, 0, 0, 50); //요양 $command = EncodeCommand(0, 0, 0, 50); //요양
$query = "update general set turn0='$command' where no='$general[no]'"; $query = "update general set turn0='$command' where no='$general['no']'";
MYDB_query($query, $connect) or Error("processAI23 ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("processAI23 ".MYDB_error($connect),"");
return; return;
} }
@@ -1521,23 +1521,23 @@ function processAI($connect, $no) {
// 700t // 700t
} else { // 공격인 경우 } else { // 공격인 경우
if($general[crew] < 700 && $general[gold] >= $resrc && $general[rice] >= $resrc) { //자원되고, 병사없을때 if($general['crew'] < 700 && $general['gold'] >= $resrc && $general['rice'] >= $resrc) { //자원되고, 병사없을때
if($city[pop] > 40000) { $command = EncodeCommand(0, 0, 0, 11); } if($city['pop'] > 40000) { $command = EncodeCommand(0, 0, 0, 11); }
else { $command = EncodeCommand(0, 0, 0, 1); } else { $command = EncodeCommand(0, 0, 0, 1); }
} elseif($general[rice] < $resrc && $general[rice] <= $general[gold]) { } elseif($general['rice'] < $resrc && $general['rice'] <= $general['gold']) {
//금이 더 많으면 매매 //금이 더 많으면 매매
$amount = floor(($general[gold] - $general[rice]) / 100 / 2); // 100단위 $amount = floor(($general['gold'] - $general['rice']) / 100 / 2); // 100단위
if($amount > 0) { $command = EncodeCommand(0, 2, $amount, 49); }//삼 if($amount > 0) { $command = EncodeCommand(0, 2, $amount, 49); }//삼
else { $command = EncodeCommand(0, 0, 0, (rand()%2)*8 + 1); } // 내정, 조달 else { $command = EncodeCommand(0, 0, 0, (rand()%2)*8 + 1); } // 내정, 조달
} elseif($general[gold] < $resrc && $general[rice] > $general[gold]) { } elseif($general['gold'] < $resrc && $general['rice'] > $general['gold']) {
//쌀이 더 많으면 매매 //쌀이 더 많으면 매매
$amount = floor(($general[rice] - $general[gold]) / 100 / 2); // 100단위 $amount = floor(($general['rice'] - $general['gold']) / 100 / 2); // 100단위
if($amount > 0) { $command = EncodeCommand(0, 1, $amount, 49); }//팜 if($amount > 0) { $command = EncodeCommand(0, 1, $amount, 49); }//팜
else { $command = EncodeCommand(0, 0, 0, (rand()%2)*8 + 1); } // 내정, 조달 else { $command = EncodeCommand(0, 0, 0, (rand()%2)*8 + 1); } // 내정, 조달
//자원, 병사 모두 충족 //자원, 병사 모두 충족
} elseif($general[crew] >= 700 && $general[train] < 90) { } elseif($general['crew'] >= 700 && $general['train'] < 90) {
$command = EncodeCommand(0, 0, 0, 13); //훈련 $command = EncodeCommand(0, 0, 0, 13); //훈련
} elseif($general[crew] >= 700 && $general[atmos] < 90) { } elseif($general['crew'] >= 700 && $general['atmos'] < 90) {
$command = EncodeCommand(0, 0, 0, 14); //사기진작 $command = EncodeCommand(0, 0, 0, 14); //사기진작
} else { } else {
//공격 //공격
@@ -1556,66 +1556,66 @@ function processAI($connect, $no) {
// 700t // 700t
//전시일때 //전시일때
if($general[gold] + $general[rice] < $resrc*2) { $command = EncodeCommand(0, 0, 0, 9); } //금쌀없으면 조달 if($general['gold'] + $general['rice'] < $resrc*2) { $command = EncodeCommand(0, 0, 0, 9); } //금쌀없으면 조달
elseif($general[rice] > $resrc && $city[rate] < 95 && $city[front] == 0) { $command = EncodeCommand(0, 0, 0, 4); } // 우선 선정 elseif($general['rice'] > $resrc && $city['rate'] < 95 && $city['front'] == 0) { $command = EncodeCommand(0, 0, 0, 4); } // 우선 선정
elseif($general[rice] > $resrc && $city[rate] < 50 && $city[front] == 1) { $command = EncodeCommand(0, 0, 0, 4); } // 우선 선정 elseif($general['rice'] > $resrc && $city['rate'] < 50 && $city['front'] == 1) { $command = EncodeCommand(0, 0, 0, 4); } // 우선 선정
elseif($general[gold] < $resrc) { // 금없으면 쌀팜 elseif($general['gold'] < $resrc) { // 금없으면 쌀팜
$amount = floor(($general[rice] - $general[gold]) / 100 / 2); // 100단위 $amount = floor(($general['rice'] - $general['gold']) / 100 / 2); // 100단위
if($amount > 0) { $command = EncodeCommand(0, 1, $amount, 49); }// 팜 if($amount > 0) { $command = EncodeCommand(0, 1, $amount, 49); }// 팜
else { $command = EncodeCommand(0, 0, 0, 9); } // 조달 else { $command = EncodeCommand(0, 0, 0, 9); } // 조달
} elseif($general[rice] < $resrc) { // 쌀없으면 쌀삼 } elseif($general['rice'] < $resrc) { // 쌀없으면 쌀삼
$amount = floor(($general[gold] - $general[rice]) / 100 / 2); // 100단위 $amount = floor(($general['gold'] - $general['rice']) / 100 / 2); // 100단위
if($amount > 0) { $command = EncodeCommand(0, 2, $amount, 49); }// 팜 if($amount > 0) { $command = EncodeCommand(0, 2, $amount, 49); }// 팜
else { $command = EncodeCommand(0, 0, 0, 9); } // 조달 else { $command = EncodeCommand(0, 0, 0, 9); } // 조달
} elseif($genType >= 2) { $command = EncodeCommand(0, 0, 0, 1); } //내정장일때 내정 } elseif($genType >= 2) { $command = EncodeCommand(0, 0, 0, 1); } //내정장일때 내정
elseif($general[crew] < 700 && $general[gold] >= $resrc && $general[rice] >= $resrc) { elseif($general['crew'] < 700 && $general['gold'] >= $resrc && $general['rice'] >= $resrc) {
$query = "select no from general where nation='$general[nation]'"; $query = "select no from general where nation='$general['nation']'";
$result = MYDB_query($query, $connect) or Error("processAI16 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI16 ".MYDB_error($connect),"");
$genCount = MYDB_num_rows($result); $genCount = MYDB_num_rows($result);
$query = "select no from general where nation='$general[nation]' and city='$general[city]'"; $query = "select no from general where nation='$general['nation']' and city='$general['city']'";
$result = MYDB_query($query, $connect) or Error("processAI16 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI16 ".MYDB_error($connect),"");
$genCount2 = MYDB_num_rows($result); $genCount2 = MYDB_num_rows($result);
$query = "select sum(pop) as sum from city where nation='$general[nation]' and supply='1'"; $query = "select sum(pop) as sum from city where nation='$general['nation']' and supply='1'";
$result = MYDB_query($query, $connect) or Error("processAI16 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI16 ".MYDB_error($connect),"");
$sumCity = MYDB_fetch_array($result); $sumCity = MYDB_fetch_array($result);
// 현도시 인구 비율 // 현도시 인구 비율
$ratio = round($city[pop] / $sumCity[sum] * 100); $ratio = round($city['pop'] / $sumCity['sum'] * 100);
// 현도시 장수 비율 // 현도시 장수 비율
$ratio2 = round($genCount2 / $genCount * 100); $ratio2 = round($genCount2 / $genCount * 100);
$ratio3 = rand() % 100; $ratio3 = rand() % 100;
// 전체 인구 대비 확률로 현지에서 징병 // 전체 인구 대비 확률로 현지에서 징병
if($city[pop] > 40000 && 100 + $ratio - $ratio2 > $ratio3) { if($city['pop'] > 40000 && 100 + $ratio - $ratio2 > $ratio3) {
$command = EncodeCommand(0, 0, 0, 11); //인구 되면 징병 $command = EncodeCommand(0, 0, 0, 11); //인구 되면 징병
} else { } else {
// 인구 안되면 4만 이상인 도시로 워프 // 인구 안되면 4만 이상인 도시로 워프
$query = "select city from city where nation='$general[nation]' and pop>40000 and supply='1' order by rand() limit 0,1"; $query = "select city from city where nation='$general['nation']' and pop>40000 and supply='1' order by rand() limit 0,1";
$result = MYDB_query($query, $connect) or Error("processAI16 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI16 ".MYDB_error($connect),"");
$cityCount = MYDB_num_rows($result); $cityCount = MYDB_num_rows($result);
if($cityCount > 0) { if($cityCount > 0) {
$selCity = MYDB_fetch_array($result); $selCity = MYDB_fetch_array($result);
//워프 //워프
$query = "update general set city='$selCity[city]' where no='$general[no]'"; $query = "update general set city='$selCity['city']' where no='$general['no']'";
MYDB_query($query, $connect) or Error("processAI18 ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("processAI18 ".MYDB_error($connect),"");
$command = EncodeCommand(0, 0, 0, 50); //요양 $command = EncodeCommand(0, 0, 0, 50); //요양
$query = "update general set turn0='$command' where no='$general[no]'"; $query = "update general set turn0='$command' where no='$general['no']'";
MYDB_query($query, $connect) or Error("processAI23 ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("processAI23 ".MYDB_error($connect),"");
return; return;
} else { } else {
$command = EncodeCommand(0, 0, 0, 7); //인구 안되면 정장 $command = EncodeCommand(0, 0, 0, 7); //인구 안되면 정장
} }
} }
} elseif($general[crew] >= 700 && $general[train] < 90) { } elseif($general['crew'] >= 700 && $general['train'] < 90) {
if($general[atmos] >= 90 && $general[train] >= 60 && $general[mode] == 0) { if($general['atmos'] >= 90 && $general['train'] >= 60 && $general['mode'] == 0) {
$query = "update general set mode=1 where no='$general[no]'"; $query = "update general set mode=1 where no='$general['no']'";
MYDB_query($query, $connect) or Error("processAI05 ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("processAI05 ".MYDB_error($connect),"");
} }
$command = EncodeCommand(0, 0, 0, 13); //훈련 $command = EncodeCommand(0, 0, 0, 13); //훈련
} elseif($general[crew] >= 700 && $general[atmos] < 90) { } elseif($general['crew'] >= 700 && $general['atmos'] < 90) {
if($general[atmos] >= 60 && $general[train] >= 90 && $general[mode] == 0) { if($general['atmos'] >= 60 && $general['train'] >= 90 && $general['mode'] == 0) {
$query = "update general set mode=1 where no='$general[no]'"; $query = "update general set mode=1 where no='$general['no']'";
MYDB_query($query, $connect) or Error("processAI05 ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("processAI05 ".MYDB_error($connect),"");
} }
$command = EncodeCommand(0, 0, 0, 14); //사기진작 $command = EncodeCommand(0, 0, 0, 14); //사기진작
@@ -1623,56 +1623,56 @@ function processAI($connect, $no) {
$command = EncodeCommand(0, 0, 0, (rand()%2)*8 + 1); // 준비는 됐으나 아직 선포중이면 내정, 조달 $command = EncodeCommand(0, 0, 0, (rand()%2)*8 + 1); // 준비는 됐으나 아직 선포중이면 내정, 조달
} else { } else {
//공격 & 내정 //공격 & 내정
$paths = explode("|", $city[path]); $paths = explode("|", $city['path']);
for($i=0; $i < count($paths); $i++) { for($i=0; $i < count($paths); $i++) {
$query = "select city,nation from city where city='$paths[$i]'"; $query = "select city,nation from city where city='$paths[$i]'";
$result = MYDB_query($query, $connect) or Error("processAI21 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI21 ".MYDB_error($connect),"");
$targetCity = MYDB_fetch_array($result); $targetCity = MYDB_fetch_array($result);
//소유국이 있는 경우 //소유국이 있는 경우
if($targetCity[nation] != 0 && $targetCity[nation] != $general[nation]) { if($targetCity['nation'] != 0 && $targetCity['nation'] != $general['nation']) {
$query = "select state from diplomacy where me='$general[nation]' and you='$targetCity[nation]'"; $query = "select state from diplomacy where me='$general['nation']' and you='$targetCity['nation']'";
$dipResult = MYDB_query($query, $connect) or Error("processAI22 ".MYDB_error($connect),""); $dipResult = MYDB_query($query, $connect) or Error("processAI22 ".MYDB_error($connect),"");
$dip = MYDB_fetch_array($dipResult); $dip = MYDB_fetch_array($dipResult);
//전쟁중인 국가이면 타겟에 포함 //전쟁중인 국가이면 타겟에 포함
if($dip[state] == 0) $target[count($target)] = $targetCity[city]; if($dip['state'] == 0) $target[count($target)] = $targetCity['city'];
} }
} }
if(count($target) == 0) { if(count($target) == 0) {
//전방 도시 선택, 30% 확률로 태수 있는 전방으로 워프 //전방 도시 선택, 30% 확률로 태수 있는 전방으로 워프
if(rand()%100 < 30) { if(rand()%100 < 30) {
$query = "select city from city where nation='$general[nation]' and supply='1' and front=1 order by gen1 desc,rand() limit 0,1"; $query = "select city from city where nation='$general['nation']' and supply='1' and front=1 order by gen1 desc,rand() limit 0,1";
} else { } else {
$query = "select city from city where nation='$general[nation]' and supply='1' and front=1 order by rand() limit 0,1"; $query = "select city from city where nation='$general['nation']' and supply='1' and front=1 order by rand() limit 0,1";
} }
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
$cityCount = MYDB_num_rows($result); $cityCount = MYDB_num_rows($result);
if($cityCount == 0) { if($cityCount == 0) {
//도시 수, 랜덤(상위 20%) 선택, 저개발 도시 선택 //도시 수, 랜덤(상위 20%) 선택, 저개발 도시 선택
$query = "select city from city where nation='$general[nation]' and supply='1'"; $query = "select city from city where nation='$general['nation']' and supply='1'";
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
$cityCount = MYDB_num_rows($result); $cityCount = MYDB_num_rows($result);
$citySelect = rand() % (round($cityCount/5) + 1); $citySelect = rand() % (round($cityCount/5) + 1);
$query = "select city,(def+wall)/(def2+wall2) as dev from city where nation='$general[nation]' and supply='1' order by dev limit {$citySelect},1"; $query = "select city,(def+wall)/(def2+wall2) as dev from city where nation='$general['nation']' and supply='1' order by dev limit {$citySelect},1";
$result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI10 ".MYDB_error($connect),"");
$selCity = MYDB_fetch_array($result); $selCity = MYDB_fetch_array($result);
} else { } else {
$selCity = MYDB_fetch_array($result); $selCity = MYDB_fetch_array($result);
} }
if($general[city] != $selCity[city]) { if($general['city'] != $selCity['city']) {
//워프 //워프
$query = "update general set city='$selCity[city]' where no='$general[no]'"; $query = "update general set city='$selCity['city']' where no='$general['no']'";
MYDB_query($query, $connect) or Error("processAI18 ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("processAI18 ".MYDB_error($connect),"");
$command = EncodeCommand(0, 0, 0, 50); //요양 $command = EncodeCommand(0, 0, 0, 50); //요양
$query = "update general set turn0='$command' where no='$general[no]'"; $query = "update general set turn0='$command' where no='$general['no']'";
MYDB_query($query, $connect) or Error("processAI23 ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("processAI23 ".MYDB_error($connect),"");
return; return;
} else { } else {
$command = EncodeCommand(0, 0, 0, (rand()%2)*8 + 1); //공격 가능도시가 없고 워프도 안되면 내정, 조달 $command = EncodeCommand(0, 0, 0, (rand()%2)*8 + 1); //공격 가능도시가 없고 워프도 안되면 내정, 조달
} }
} elseif($nation[war] == 1) { } elseif($nation['war'] == 1) {
//전금이면 내정, 조달 //전금이면 내정, 조달
$command = EncodeCommand(0, 0, 0, (rand()%2)*8 + 1); //내정, 조달 $command = EncodeCommand(0, 0, 0, (rand()%2)*8 + 1); //내정, 조달
} else { $command = EncodeCommand(0, 0, $target[rand()%count($target)], 16); } //있으면 공격 } else { $command = EncodeCommand(0, 0, $target[rand()%count($target)], 16); } //있으면 공격
@@ -1682,28 +1682,28 @@ function processAI($connect, $no) {
switch($command) { switch($command) {
case "00000000000001": //내정 case "00000000000001": //내정
SetDevelop($connect, $genType, $general[no], $general[city], $nation[tech]); SetDevelop($connect, $genType, $general['no'], $general['city'], $nation['tech']);
return; return;
case "00000000000011": //징병 case "00000000000011": //징병
$query = "select region from city where nation='$general[nation]' order by rand() limit 0,1"; $query = "select region from city where nation='$general['nation']' order by rand() limit 0,1";
$result = MYDB_query($query, $connect) or Error("processAI16 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI16 ".MYDB_error($connect),"");
$selRegion = MYDB_fetch_array($result); $selRegion = MYDB_fetch_array($result);
$selCity[city] = 0; $selCity['city'] = 0;
// 90% 확률로 이민족 또는 특성병 // 90% 확률로 이민족 또는 특성병
if(rand()%100 < 90) { if(rand()%100 < 90) {
$query = "select city from city where nation='$general[nation]' and (level='4' or level='8') order by rand() limit 0,1"; $query = "select city from city where nation='$general['nation']' and (level='4' or level='8') order by rand() limit 0,1";
$result = MYDB_query($query, $connect) or Error("processAI16 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("processAI16 ".MYDB_error($connect),"");
$selCity = MYDB_fetch_array($result); $selCity = MYDB_fetch_array($result);
} }
// 특병 없으면 원래대로 // 특병 없으면 원래대로
if($selCity[city] == 0) { if($selCity['city'] == 0) {
$selCity[city] = $general[city]; $selCity['city'] = $general['city'];
} }
SetCrew($connect, $general[no], $general[personal], $general[gold], $general[leader], $genType, $nation[tech], $selRegion[region], $selCity[city], $general[dex0], $general[dex10], $general[dex20], $general[dex30], $general[dex40]); SetCrew($connect, $general['no'], $general['personal'], $general['gold'], $general['leader'], $genType, $nation['tech'], $selRegion['region'], $selCity['city'], $general[dex0], $general[dex10], $general[dex20], $general[dex30], $general[dex40]);
return; return;
default: default:
$query = "update general set turn0='$command' where no='$general[no]'"; $query = "update general set turn0='$command' where no='$general['no']'";
MYDB_query($query, $connect) or Error("processAI23 ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("processAI23 ".MYDB_error($connect),"");
return; return;
} }
@@ -1747,11 +1747,11 @@ function Promotion($connect, $nation, $level) {
MYDB_query($query, $connect) or Error("Promotion_02 ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("Promotion_02 ".MYDB_error($connect),"");
//유저 후보 선택 //유저 후보 선택
$query = "select no from general where nation='$nation' and npc<2 and level=1 and belong>=3 and killturn>='$admin[killturn]' order by rand() limit 0,1"; $query = "select no from general where nation='$nation' and npc<2 and level=1 and belong>=3 and killturn>='$admin['killturn']' order by rand() limit 0,1";
$result = MYDB_query($query, $connect) or Error("Promotion_00 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("Promotion_00 ".MYDB_error($connect),"");
$userCandidate = MYDB_fetch_array($result); $userCandidate = MYDB_fetch_array($result);
// 유저수뇌 안함 // 유저수뇌 안함
//$userCandidate[no] = 0; //$userCandidate['no'] = 0;
//NPC 후보 선택 //NPC 후보 선택
$query = "select no from general where nation='$nation' and npc>=2 and level=1 order by intel desc limit 0,1"; $query = "select no from general where nation='$nation' and npc>=2 and level=1 order by intel desc limit 0,1";
@@ -1764,29 +1764,29 @@ function Promotion($connect, $nation, $level) {
$level11 = MYDB_fetch_array($result); $level11 = MYDB_fetch_array($result);
//공석이거나 삭턴 유저 참모인 경우 //공석이거나 삭턴 유저 참모인 경우
if($level11[no] == 0 || ($level11[npc] < 2 && $level11[killturn] < $admin[killturn])) { if($level11['no'] == 0 || ($level11['npc'] < 2 && $level11['killturn'] < $admin['killturn'])) {
if($userCandidate[no] > 0) { if($userCandidate['no'] > 0) {
//기존 참모 해임 //기존 참모 해임
$query = "update general set level=1 where nation='$nation' and level=11"; $query = "update general set level=1 where nation='$nation' and level=11";
MYDB_query($query, $connect) or Error("Promotion_02 ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("Promotion_02 ".MYDB_error($connect),"");
//유저 후보 있으면 임명 //유저 후보 있으면 임명
$query = "update general set level=11 where no='$userCandidate[no]'"; $query = "update general set level=11 where no='$userCandidate['no']'";
MYDB_query($query, $connect) or Error("Promotion_02 ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("Promotion_02 ".MYDB_error($connect),"");
} elseif($npcCandidate[no] > 0) { } elseif($npcCandidate['no'] > 0) {
//기존 참모 해임 //기존 참모 해임
$query = "update general set level=1 where nation='$nation' and level=11"; $query = "update general set level=1 where nation='$nation' and level=11";
MYDB_query($query, $connect) or Error("Promotion_02 ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("Promotion_02 ".MYDB_error($connect),"");
//NPC 후보 있으면 임명 //NPC 후보 있으면 임명
$query = "update general set level=11 where no='$npcCandidate[no]'"; $query = "update general set level=11 where no='$npcCandidate['no']'";
MYDB_query($query, $connect) or Error("Promotion_02 ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("Promotion_02 ".MYDB_error($connect),"");
} }
} elseif($level11[npc] >= 2 && $userCandidate[no] > 0) { } elseif($level11['npc'] >= 2 && $userCandidate['no'] > 0) {
//NPC 참모인데 삭턴 아닌 유저장이 있는 경우 //NPC 참모인데 삭턴 아닌 유저장이 있는 경우
//기존 참모 해임 //기존 참모 해임
$query = "update general set level=1 where nation='$nation' and level=11"; $query = "update general set level=1 where nation='$nation' and level=11";
MYDB_query($query, $connect) or Error("Promotion_02 ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("Promotion_02 ".MYDB_error($connect),"");
//유저 후보 있으면 임명 //유저 후보 있으면 임명
$query = "update general set level=11 where no='$userCandidate[no]'"; $query = "update general set level=11 where no='$userCandidate['no']'";
MYDB_query($query, $connect) or Error("Promotion_02 ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("Promotion_02 ".MYDB_error($connect),"");
} }
@@ -1796,13 +1796,13 @@ function Promotion($connect, $nation, $level) {
$query = "select no from general where nation='$nation' and level=1 order by power desc limit 0,1"; $query = "select no from general where nation='$nation' and level=1 order by power desc limit 0,1";
$result = MYDB_query($query, $connect) or Error("Promotion_00 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("Promotion_00 ".MYDB_error($connect),"");
$level = MYDB_fetch_array($result); $level = MYDB_fetch_array($result);
$query = "update general set level={$i1} where no='$level[no]'"; $query = "update general set level={$i1} where no='$level['no']'";
MYDB_query($query, $connect) or Error("Promotion_02 ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("Promotion_02 ".MYDB_error($connect),"");
//문관임명 //문관임명
$query = "select no from general where nation='$nation' and level=1 order by intel desc limit 0,1"; $query = "select no from general where nation='$nation' and level=1 order by intel desc limit 0,1";
$result = MYDB_query($query, $connect) or Error("Promotion_00 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("Promotion_00 ".MYDB_error($connect),"");
$level = MYDB_fetch_array($result); $level = MYDB_fetch_array($result);
$query = "update general set level={$i2} where no='$level[no]'"; $query = "update general set level={$i2} where no='$level['no']'";
MYDB_query($query, $connect) or Error("Promotion_02 ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("Promotion_02 ".MYDB_error($connect),"");
} }
} }
@@ -1822,7 +1822,7 @@ function TaxRate($connect, $nation) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$devRate = MYDB_fetch_array($result); $devRate = MYDB_fetch_array($result);
$avg = ($devRate[rate] + $devRate[dev]) / 2; $avg = ($devRate['rate'] + $devRate['dev']) / 2;
if($avg > 95) $rate = 25; if($avg > 95) $rate = 25;
elseif($avg > 70) $rate = 20; elseif($avg > 70) $rate = 20;
+2046 -2046
View File
File diff suppressed because it is too large Load Diff
+2
View File
@@ -40,6 +40,7 @@ function BadTag2Code($str) {
function tab($str, $maxsize, $ch) { function tab($str, $maxsize, $ch) {
$size = strlen($str); $size = strlen($str);
$string = '';
$count = ($maxsize - $size) / 2; $count = ($maxsize - $size) / 2;
for($i=0; $i < $count; $i++) { for($i=0; $i < $count; $i++) {
@@ -55,6 +56,7 @@ function tab($str, $maxsize, $ch) {
function tab2($str, $maxsize, $ch) { function tab2($str, $maxsize, $ch) {
$size = strlen($str); $size = strlen($str);
$string = '';
$count = ($maxsize - $size); $count = ($maxsize - $size);
for($i=0; $i < $count; $i++) { for($i=0; $i < $count; $i++) {
+124 -124
View File
@@ -6,15 +6,15 @@ function processTournament($connect) {
$admin = MYDB_fetch_array($result); $admin = MYDB_fetch_array($result);
//수동일땐 무시 //수동일땐 무시
if($admin[tnmt_auto] == 0) { return; } if($admin['tnmt_auto'] == 0) { return; }
$type = $admin[tnmt_type]; $type = $admin['tnmt_type'];
$tnmt = $admin[tournament]; $tnmt = $admin['tournament'];
$phase = $admin[phase]; $phase = $admin['phase'];
//현시간이 스탬프 지나친경우 //현시간이 스탬프 지나친경우
if($admin[offset] >= 0) { if($admin['offset'] >= 0) {
switch($admin[tnmt_auto]) { switch($admin['tnmt_auto']) {
case 1: $unit = 720; break; case 1: $unit = 720; break;
case 2: $unit = 420; break; case 2: $unit = 420; break;
case 3: $unit = 180; break; case 3: $unit = 180; break;
@@ -25,7 +25,7 @@ function processTournament($connect) {
} }
//업데이트 횟수 //업데이트 횟수
$iter = floor($admin[offset] / $unit) + 1; $iter = floor($admin['offset'] / $unit) + 1;
for($i=0; $i < $iter; $i++) { for($i=0; $i < $iter; $i++) {
switch($tnmt) { switch($tnmt) {
@@ -77,15 +77,15 @@ function processTournament($connect) {
$betTerm = $unit * 60; $betTerm = $unit * 60;
if($betTerm > 3600) { $betTerm = 3600; } if($betTerm > 3600) { $betTerm = 3600; }
//처리 초 더한 날짜 //처리 초 더한 날짜
$dt = date("Y-m-d H:i:s", strtotime($admin[tnmt_time]) + $unit * $i + $betTerm); $dt = date("Y-m-d H:i:s", strtotime($admin['tnmt_time']) + $unit * $i + $betTerm);
$query = "update game set tournament='$tnmt',phase='$phase',tnmt_time='$dt' where no=1"; $query = "update game set tournament='$tnmt',phase='$phase',tnmt_time='$dt' where no=1";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
return; return;
} }
if($admin[tnmt_auto] == 1) { if($admin['tnmt_auto'] == 1) {
//처리 초 더한 날짜 //처리 초 더한 날짜
$dt = date("Y-m-d H:i:s", strtotime($admin[tnmt_time]) + $unit * $i); $dt = date("Y-m-d H:i:s", strtotime($admin['tnmt_time']) + $unit * $i);
$hr = substr($dt, 11, 2); $hr = substr($dt, 11, 2);
//지정시간대 넘어가면 중단 20~24시 //지정시간대 넘어가면 중단 20~24시
if($hr < 20) { if($hr < 20) {
@@ -108,7 +108,7 @@ function getTournamentTerm($connect) {
$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);
switch($admin[tnmt_auto]) { switch($admin['tnmt_auto']) {
case 1: $str = "경기당 12분"; break; case 1: $str = "경기당 12분"; break;
case 2: $str = "경기당 7분"; break; case 2: $str = "경기당 7분"; break;
case 3: $str = "경기당 3분"; break; case 3: $str = "경기당 3분"; break;
@@ -125,8 +125,8 @@ function getTournamentTime($connect) {
$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);
$tnmt = $admin[tournament]; $tnmt = $admin['tournament'];
$dt = substr($admin[tnmt_time], 11, 5); $dt = substr($admin['tnmt_time'], 11, 5);
switch($tnmt) { switch($tnmt) {
case 1: $tnmt = "개막시간 {$dt}"; break; case 1: $tnmt = "개막시간 {$dt}"; break;
case 2: $tnmt = "다음경기 {$dt}"; break; case 2: $tnmt = "다음경기 {$dt}"; break;
@@ -282,13 +282,13 @@ function fillLowGenAll($connect) {
$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);
$general[no] = 0; $general['no'] = 0;
$general[name] = "무명장수"; $general['name'] = "무명장수";
$general[npc] = 2; $general['npc'] = 2;
$general[leader] = 10; $general['leader'] = 10;
$general[power] = 10; $general['power'] = 10;
$general[intel] = 10; $general['intel'] = 10;
$general[explevel] = 10; $general['explevel'] = 10;
for($i=0; $i < 8; $i++) { for($i=0; $i < 8; $i++) {
$query = "select grp from tournament where grp='$i'"; $query = "select grp from tournament where grp='$i'";
@@ -297,7 +297,7 @@ function fillLowGenAll($connect) {
} }
//자동신청하고, 돈 있고, 아직 참가 안한 장수 //자동신청하고, 돈 있고, 아직 참가 안한 장수
$query = "select no,npc,name,leader,power,intel,explevel from general where tnmt='1' and tournament='0' and gold>='$admin[develcost]' order by rand() limit 0,64"; $query = "select no,npc,name,leader,power,intel,explevel from general where tnmt='1' and tournament='0' and gold>='$admin['develcost']' order by rand() limit 0,64";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$genCount = MYDB_num_rows($result); $genCount = MYDB_num_rows($result);
@@ -312,14 +312,14 @@ function fillLowGenAll($connect) {
if($genCount > 0) { if($genCount > 0) {
$genCount--; $genCount--;
$gen = MYDB_fetch_array($result); $gen = MYDB_fetch_array($result);
$query = "update general set gold=gold-'$admin[develcost]',tournament='1' where no='$gen[no]'"; $query = "update general set gold=gold-'$admin['develcost']',tournament='1' where no='$gen['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "insert into tournament (no, npc, name, ldr, pwr, itl, lvl, grp, grp_no) values ('$gen[no]', '$gen[npc]', '$gen[name]', '$gen[leader]', '$gen[power]', '$gen[intel]', '$gen[explevel]', '$i', '$grpCount[$i]')"; $query = "insert into tournament (no, npc, name, ldr, pwr, itl, lvl, grp, grp_no) values ('$gen['no']', '$gen['npc']', '$gen['name']', '$gen['leader']', '$gen['power']', '$gen['intel']', '$gen['explevel']', '$i', '$grpCount[$i]')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//자동신청 장수 없으면 무명장수 //자동신청 장수 없으면 무명장수
} else { } else {
$query = "insert into tournament (no, npc, name, ldr, pwr, itl, lvl, grp, grp_no) values ('$general[no]', '$general[npc]', '$general[name]', '$general[leader]', '$general[power]', '$general[intel]', '$general[explevel]', '$i', '$grpCount[$i]')"; $query = "insert into tournament (no, npc, name, ldr, pwr, itl, lvl, grp, grp_no) values ('$general['no']', '$general['npc']', '$general['name']', '$general['leader']', '$general['power']', '$general['intel']', '$general['explevel']', '$i', '$grpCount[$i]')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
$grpCount[$i]++; $grpCount[$i]++;
@@ -396,7 +396,7 @@ function qualify($connect, $tnmt_type, $tnmt, $phase) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
for($k=1; $k <= 4; $k++) { for($k=1; $k <= 4; $k++) {
$gen = MYDB_fetch_array($result); $gen = MYDB_fetch_array($result);
$query = "update tournament set prmt='$k' where grp='$gen[grp]' and grp_no='$gen[grp_no]'"; $query = "update tournament set prmt='$k' where grp='$gen['grp']' and grp_no='$gen['grp_no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
} }
@@ -431,10 +431,10 @@ function selection($connect, $tnmt_type, $tnmt, $phase) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
//본선에 추가 //본선에 추가
$query = "insert into tournament (no, npc, name, ldr, pwr, itl, lvl, grp, grp_no, h, w, b) values ('$general[no]', '$general[npc]', '$general[name]', '$general[ldr]', '$general[pwr]', '$general[itl]', '$general[lvl]', '$grp', '$grp_no', '$general[h]', '$general[w]', '$general[b]')"; $query = "insert into tournament (no, npc, name, ldr, pwr, itl, lvl, grp, grp_no, h, w, b) values ('$general['no']', '$general['npc']', '$general['name']', '$general['ldr']', '$general['pwr']', '$general['itl']', '$general['lvl']', '$grp', '$grp_no', '$general[h]', '$general[w]', '$general[b]')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//시드 삭제 //시드 삭제
$query = "update tournament set prmt=0 where grp='$general[grp]' and grp_no='$general[grp_no]'"; $query = "update tournament set prmt=0 where grp='$general['grp']' and grp_no='$general['grp_no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
if($phase < 31) { if($phase < 31) {
@@ -473,7 +473,7 @@ function finallySingle($connect, $tnmt_type, $tnmt, $phase) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
for($k=1; $k <= 2; $k++) { for($k=1; $k <= 2; $k++) {
$gen = MYDB_fetch_array($result); $gen = MYDB_fetch_array($result);
$query = "update tournament set prmt='$k' where grp='$gen[grp]' and grp_no='$gen[grp_no]'"; $query = "update tournament set prmt='$k' where grp='$gen['grp']' and grp_no='$gen['grp_no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
} }
@@ -499,7 +499,7 @@ function final16set($connect) {
//16강에 추가 //16강에 추가
$newGrp = 20 + floor($i / 2); $newGrp = 20 + floor($i / 2);
$newGrp_no = $i % 2; $newGrp_no = $i % 2;
$query = "insert into tournament (no, npc, name, ldr, pwr, itl, lvl, grp, grp_no, h, w, b) values ('$general[no]', '$general[npc]', '$general[name]', '$general[ldr]', '$general[pwr]', '$general[itl]', '$general[lvl]', '$newGrp', '$newGrp_no', '$general[h]', '$general[w]', '$general[b]')"; $query = "insert into tournament (no, npc, name, ldr, pwr, itl, lvl, grp, grp_no, h, w, b) values ('$general['no']', '$general['npc']', '$general['name']', '$general['ldr']', '$general['pwr']', '$general['itl']', '$general['lvl']', '$newGrp', '$newGrp_no', '$general[h]', '$general[w]', '$general[b]')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
$query = "update tournament set prmt=0"; $query = "update tournament set prmt=0";
@@ -529,7 +529,7 @@ function finalFight($connect, $tnmt_type, $tnmt, $phase, $type) {
//x강에 추가 //x강에 추가
$newGrp = floor($phase / 2) + $offset + 10; $newGrp = floor($phase / 2) + $offset + 10;
$newGrp_no = $phase % 2; $newGrp_no = $phase % 2;
$query = "insert into tournament (no, npc, name, ldr, pwr, itl, lvl, grp, grp_no, h, w, b) values ('$general[no]', '$general[npc]', '$general[name]', '$general[ldr]', '$general[pwr]', '$general[itl]', '$general[lvl]', '$newGrp', '$newGrp_no', '$general[h]', '$general[w]', '$general[b]')"; $query = "insert into tournament (no, npc, name, ldr, pwr, itl, lvl, grp, grp_no, h, w, b) values ('$general['no']', '$general['npc']', '$general['name']', '$general['ldr']', '$general['pwr']', '$general['itl']', '$general['lvl']', '$newGrp', '$newGrp_no', '$general[h]', '$general[w]', '$general[b]')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
if($phase >= $turn) { if($phase >= $turn) {
@@ -551,71 +551,71 @@ function setGift($connect, $tnmt_type, $tnmt, $phase) {
} }
//16강자 명성 돈 //16강자 명성 돈
$cost = $admin[develcost]; $cost = $admin['develcost'];
$query = "select no,name from tournament where grp>=20 and grp<30"; $query = "select no,name from tournament where grp>=20 and grp<30";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) { for($i=0; $i < $count; $i++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$query = "update general set experience=experience+25,gold=gold+'$cost',{$tp2}g={$tp2}g+1 where no='$general[no]'"; $query = "update general set experience=experience+25,gold=gold+'$cost',{$tp2}g={$tp2}g+1 where no='$general['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//포상 장수 이름, 금액 //포상 장수 이름, 금액
$genNo[$i] = $general[no]; $genNo[$i] = $general['no'];
$genName[$i] = $general[name]; $genName[$i] = $general['name'];
$genGold[$general[no]] = $cost; $genGold[$general['no']] = $cost;
$genCall[$general[no]] = "<O>16강 진출</>"; $genCall[$general['no']] = "<O>16강 진출</>";
} }
//8강자 명성 돈 //8강자 명성 돈
$cost = $admin[develcost] * 2; $cost = $admin['develcost'] * 2;
$query = "select no from tournament where grp>=30 and grp<40"; $query = "select no from tournament where grp>=30 and grp<40";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) { for($i=0; $i < $count; $i++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$query = "update general set experience=experience+50,gold=gold+'$cost',{$tp2}g={$tp2}g+1 where no='$general[no]'"; $query = "update general set experience=experience+50,gold=gold+'$cost',{$tp2}g={$tp2}g+1 where no='$general['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//포상 장수 이름, 금액 //포상 장수 이름, 금액
$genGold[$general[no]] += $cost; $genGold[$general['no']] += $cost;
$genCall[$general[no]] = "<O>8강 진출</>"; $genCall[$general['no']] = "<O>8강 진출</>";
} }
//4강자 명성 돈 //4강자 명성 돈
$cost = $admin[develcost] * 3; $cost = $admin['develcost'] * 3;
$query = "select no from tournament where grp>=40 and grp<50"; $query = "select no from tournament where grp>=40 and grp<50";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) { for($i=0; $i < $count; $i++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$query = "update general set experience=experience+75,gold=gold+'$cost',{$tp2}g={$tp2}g+2 where no='$general[no]'"; $query = "update general set experience=experience+75,gold=gold+'$cost',{$tp2}g={$tp2}g+2 where no='$general['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//포상 장수 이름, 금액 //포상 장수 이름, 금액
$genGold[$general[no]] += $cost; $genGold[$general['no']] += $cost;
$genCall[$general[no]] = "<O>4강 진출</>"; $genCall[$general['no']] = "<O>4강 진출</>";
} }
//결승자 명성 돈 //결승자 명성 돈
$cost = $admin[develcost] * 6; $cost = $admin['develcost'] * 6;
$query = "select no from tournament where grp>=50 and grp<60"; $query = "select no from tournament where grp>=50 and grp<60";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) { for($i=0; $i < $count; $i++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$query = "update general set experience=experience+150,gold=gold+'$cost',{$tp2}g={$tp2}g+2 where no='$general[no]'"; $query = "update general set experience=experience+150,gold=gold+'$cost',{$tp2}g={$tp2}g+2 where no='$general['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//포상 장수 이름, 금액 //포상 장수 이름, 금액
$genGold[$general[no]] += $cost; $genGold[$general['no']] += $cost;
$genCall[$general[no]] = "<O>준우승</>으"; $genCall[$general['no']] = "<O>준우승</>으";
} }
//우승자 명성 돈 //우승자 명성 돈
$cost = $admin[develcost] * 8; $cost = $admin['develcost'] * 8;
$query = "select no from tournament where grp>=60"; $query = "select no from tournament where grp>=60";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) { for($i=0; $i < $count; $i++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$query = "update general set experience=experience+200,gold=gold+'$cost',{$tp2}g={$tp2}g+3,{$tp2}p={$tp2}p+1 where no='$general[no]'"; $query = "update general set experience=experience+200,gold=gold+'$cost',{$tp2}g={$tp2}g+3,{$tp2}p={$tp2}p+1 where no='$general['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//포상 장수 이름, 금액 //포상 장수 이름, 금액
$genGold[$general[no]] += $cost; $genGold[$general['no']] += $cost;
$genCall[$general[no]] = "<O>우승</>으"; $genCall[$general['no']] = "<O>우승</>으";
} }
//우승자 이름 //우승자 이름
$query = "select no,name from tournament where grp=60"; $query = "select no,name from tournament where grp=60";
@@ -631,24 +631,24 @@ function setGift($connect, $tnmt_type, $tnmt, $phase) {
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//장수열전 기록 //장수열전 기록
$query = "select no,history from general where no={$general[no]}"; $query = "select no,history from general where no={$general['no']}";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen1 = MYDB_fetch_array($result); $gen1 = MYDB_fetch_array($result);
$query = "select no,history from general where no={$general2[no]}"; $query = "select no,history from general where no={$general2['no']}";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen2 = MYDB_fetch_array($result); $gen2 = MYDB_fetch_array($result);
$gen1 = addHistory($connect, $gen1, "<C>●</>{$admin[year]}{$admin[month]}월:<C>{$tp}</> 대회에서 우승"); $gen1 = addHistory($connect, $gen1, "<C>●</>{$admin['year']}{$admin['month']}월:<C>{$tp}</> 대회에서 우승");
$gen2 = addHistory($connect, $gen2, "<C>●</>{$admin[year]}{$admin[month]}월:<C>{$tp}</> 대회에서 준우승"); $gen2 = addHistory($connect, $gen2, "<C>●</>{$admin['year']}{$admin['month']}월:<C>{$tp}</> 대회에서 준우승");
$cost = $admin[develcost] * 20; $cost = $admin['develcost'] * 20;
$cost2 = $admin[develcost] * 12; $cost2 = $admin['develcost'] * 12;
$history[0] = "<S>◆</>{$admin['year']}{$admin['month']}월: <C>{$tp}</> 대회에서 <Y>{$general[name]}</>(이)가 <C>우승</>, <Y>{$general2[name]}</>(이)가 <C>준우승</>을 차지하여 천하에 이름을 떨칩니다!"; $history[0] = "<S>◆</>{$admin['year']}{$admin['month']}월: <C>{$tp}</> 대회에서 <Y>{$general['name']}</>(이)가 <C>우승</>, <Y>{$general2['name']}</>(이)가 <C>준우승</>을 차지하여 천하에 이름을 떨칩니다!";
$history[1] = "<S>◆</>{$admin['year']}{$admin['month']}월: <C>{$tp}</> 대회의 <S>우승자</>에게는 <C>{$cost}</>, <S>준우승자</>에겐 <C>{$cost2}</>의 <S>상금</>과 약간의 <S>명성</>이 주어집니다!"; $history[1] = "<S>◆</>{$admin['year']}{$admin['month']}월: <C>{$tp}</> 대회의 <S>우승자</>에게는 <C>{$cost}</>, <S>준우승자</>에겐 <C>{$cost2}</>의 <S>상금</>과 약간의 <S>명성</>이 주어집니다!";
pushHistory($connect, $history); pushHistory($connect, $history);
for($i=0; $i < count($genNo); $i++) { for($i=0; $i < count($genNo); $i++) {
$general[no] = $genNo[$i]; $general['no'] = $genNo[$i];
$general[name] = $genName[$i]; $general['name'] = $genName[$i];
$log[0] = "<S>◆</><C>{$tp}</> 대회의 {$genCall[$genNo[$i]]}로 <C>{$genGold[$genNo[$i]]}</>의 <S>상금</>, 약간의 <S>명성</> 획득!"; $log[0] = "<S>◆</><C>{$tp}</> 대회의 {$genCall[$genNo[$i]]}로 <C>{$genGold[$genNo[$i]]}</>의 <S>상금</>, 약간의 <S>명성</> 획득!";
pushGenLog($general, $log); pushGenLog($general, $log);
} }
@@ -658,15 +658,15 @@ function setGift($connect, $tnmt_type, $tnmt, $phase) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
//16강 목록에서 검색 //16강 목록에서 검색
$query = "select grp,grp_no from tournament where grp>=20 and grp<30 and no='$general[no]'"; $query = "select grp,grp_no from tournament where grp>=20 and grp<30 and no='$general['no']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$no = ($general[grp] - 20) * 2 + $general[grp_no]; $no = ($general['grp'] - 20) * 2 + $general['grp_no'];
$query = "select bet{$no},bet0+bet1+bet2+bet3+bet4+bet5+bet6+bet7+bet8+bet9+bet10+bet11+bet12+bet13+bet14+bet15 as bet from game where no=1"; $query = "select bet{$no},bet0+bet1+bet2+bet3+bet4+bet5+bet6+bet7+bet8+bet9+bet10+bet11+bet12+bet13+bet14+bet15 as bet 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);
$bet = @round($admin[bet] / $admin["bet{$no}"], 2); $bet = @round($admin['bet'] / $admin["bet{$no}"], 2);
//당첨칸에 베팅한 사람들만 //당첨칸에 베팅한 사람들만
$query = "select no,name,gold,bet{$no} as bet from general where bet{$no}>0"; $query = "select no,name,gold,bet{$no} as bet from general where bet{$no}>0";
@@ -674,9 +674,9 @@ function setGift($connect, $tnmt_type, $tnmt, $phase) {
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) { for($i=0; $i < $count; $i++) {
$gen = MYDB_fetch_array($result); $gen = MYDB_fetch_array($result);
$gold = round($gen[bet] * $bet); $gold = round($gen['bet'] * $bet);
//금 지급 //금 지급
$query = "update general set gold=gold+'$gold',betwingold=betwingold+'$gold',betwin=betwin+1 where no='$gen[no]'"; $query = "update general set gold=gold+'$gold',betwingold=betwingold+'$gold',betwin=betwin+1 where no='$gen['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//로그 //로그
$log[0] = "<S>◆</><C>{$tp}</> 대회의 베팅 당첨으로 <C>{$gold}</>의 <S>금</> 획득!"; $log[0] = "<S>◆</><C>{$tp}</> 대회의 베팅 당첨으로 <C>{$gold}</>의 <S>금</> 획득!";
@@ -690,13 +690,13 @@ function setRefund($connect) {
$admin = MYDB_fetch_array($result); $admin = MYDB_fetch_array($result);
//16강자 명성 돈 //16강자 명성 돈
$cost = $admin[develcost]; $cost = $admin['develcost'];
$query = "select no from tournament where grp<10"; $query = "select no from tournament where grp<10";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) { for($i=0; $i < $count; $i++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$query = "update general set gold=gold+'$cost' where no='$general[no]'"; $query = "update general set gold=gold+'$cost' where no='$general['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
@@ -736,60 +736,60 @@ function fight($connect, $tnmt_type, $tnmt, $phs, $group, $g1, $g2, $type) {
elseif($tnmt_type == 2) { $tp = "pwr"; $tp2 = "tp"; } elseif($tnmt_type == 2) { $tp = "pwr"; $tp2 = "tp"; }
elseif($tnmt_type == 3) { $tp = "itl"; $tp2 = "ti"; } elseif($tnmt_type == 3) { $tp = "itl"; $tp2 = "ti"; }
$e1 = $energy1 = round($gen1[$tp] * getLog($gen1[lvl], $gen2[lvl]) * 10); $e1 = $energy1 = round($gen1[$tp] * getLog($gen1['lvl'], $gen2['lvl']) * 10);
$e2 = $energy2 = round($gen2[$tp] * getLog($gen1[lvl], $gen2[lvl]) * 10); $e2 = $energy2 = round($gen2[$tp] * getLog($gen1['lvl'], $gen2['lvl']) * 10);
//아이템 로그 //아이템 로그
if($gen1[h] > 6 && ($tnmt_type == 0 || $tnmt_type == 1)) { if($gen1[h] > 6 && ($tnmt_type == 0 || $tnmt_type == 1)) {
switch(rand()%4) { switch(rand()%4) {
case 0: $log[count($log)] = "<S>●</> <Y>{$gen1[name]}</>의 <S>".getHorseName($gen1[h])."</>(이)가 포효합니다!"; break; case 0: $log[count($log)] = "<S>●</> <Y>{$gen1['name']}</>의 <S>".getHorseName($gen1[h])."</>(이)가 포효합니다!"; break;
case 1: $log[count($log)] = "<S>●</> <Y>{$gen1[name]}</>의 <S>".getHorseName($gen1[h])."</>(이)가 그 위용을 뽐냅니다!"; break; case 1: $log[count($log)] = "<S>●</> <Y>{$gen1['name']}</>의 <S>".getHorseName($gen1[h])."</>(이)가 그 위용을 뽐냅니다!"; break;
case 2: $log[count($log)] = "<S>●</> <Y>{$gen1[name]}</>(이)가 <S>".getHorseName($gen1[h])."</>(을)를 타고 있습니다!"; break; case 2: $log[count($log)] = "<S>●</> <Y>{$gen1['name']}</>(이)가 <S>".getHorseName($gen1[h])."</>(을)를 타고 있습니다!"; break;
case 3: $log[count($log)] = "<S>●</> <Y>{$gen1[name]}</>의 <S>".getHorseName($gen1[h])."</>(이)가 갈기를 휘날립니다!"; break; case 3: $log[count($log)] = "<S>●</> <Y>{$gen1['name']}</>의 <S>".getHorseName($gen1[h])."</>(이)가 갈기를 휘날립니다!"; break;
} }
} }
if($gen1[w] > 6 && ($tnmt_type == 0 || $tnmt_type == 2)) { if($gen1[w] > 6 && ($tnmt_type == 0 || $tnmt_type == 2)) {
switch(rand()%4) { switch(rand()%4) {
case 0: $log[count($log)] = "<S>●</> <Y>{$gen1[name]}</>의 <S>".getWeapName($gen1[w])."</>(이)가 번뜩입니다!"; break; case 0: $log[count($log)] = "<S>●</> <Y>{$gen1['name']}</>의 <S>".getWeapName($gen1[w])."</>(이)가 번뜩입니다!"; break;
case 1: $log[count($log)] = "<S>●</> <Y>{$gen1[name]}</>의 <S>".getWeapName($gen1[w])."</>(이)가 푸르게 빛납니다!"; break; case 1: $log[count($log)] = "<S>●</> <Y>{$gen1['name']}</>의 <S>".getWeapName($gen1[w])."</>(이)가 푸르게 빛납니다!"; break;
case 2: $log[count($log)] = "<S>●</> <Y>{$gen1[name]}</>의 <S>".getWeapName($gen1[w])."</>에서 살기가 느껴집니다!"; break; case 2: $log[count($log)] = "<S>●</> <Y>{$gen1['name']}</>의 <S>".getWeapName($gen1[w])."</>에서 살기가 느껴집니다!"; break;
case 3: $log[count($log)] = "<S>●</> <Y>{$gen1[name]}</>의 손에는 <S>".getWeapName($gen1[w])."</>(이)가 쥐어져 있습니다!"; break; case 3: $log[count($log)] = "<S>●</> <Y>{$gen1['name']}</>의 손에는 <S>".getWeapName($gen1[w])."</>(이)가 쥐어져 있습니다!"; break;
} }
} }
if($gen1[b] > 6 && ($tnmt_type == 0 || $tnmt_type == 3)) { if($gen1[b] > 6 && ($tnmt_type == 0 || $tnmt_type == 3)) {
switch(rand()%4) { switch(rand()%4) {
case 0: $log[count($log)] = "<S>●</> <Y>{$gen1[name]}</>(이)가 <S>".getBookName($gen1[b])."</>(을)를 펼쳐듭니다!"; break; case 0: $log[count($log)] = "<S>●</> <Y>{$gen1['name']}</>(이)가 <S>".getBookName($gen1[b])."</>(을)를 펼쳐듭니다!"; break;
case 1: $log[count($log)] = "<S>●</> <Y>{$gen1[name]}</>(이)가 <S>".getBookName($gen1[b])."</>(을)를 품에서 꺼냅니다!"; break; case 1: $log[count($log)] = "<S>●</> <Y>{$gen1['name']}</>(이)가 <S>".getBookName($gen1[b])."</>(을)를 품에서 꺼냅니다!"; break;
case 2: $log[count($log)] = "<S>●</> <Y>{$gen1[name]}</>(이)가 <S>".getBookName($gen1[b])."</>(을)를 들고 있습니다!"; break; case 2: $log[count($log)] = "<S>●</> <Y>{$gen1['name']}</>(이)가 <S>".getBookName($gen1[b])."</>(을)를 들고 있습니다!"; break;
case 3: $log[count($log)] = "<S>●</> <Y>{$gen1[name]}</>의 손에는 <S>".getBookName($gen1[b])."</>(이)가 쥐어져 있습니다!"; break; case 3: $log[count($log)] = "<S>●</> <Y>{$gen1['name']}</>의 손에는 <S>".getBookName($gen1[b])."</>(이)가 쥐어져 있습니다!"; break;
} }
} }
if($gen2[h] > 6 && ($tnmt_type == 0 || $tnmt_type == 1)) { if($gen2[h] > 6 && ($tnmt_type == 0 || $tnmt_type == 1)) {
switch(rand()%4) { switch(rand()%4) {
case 0: $log[count($log)] = "<S>●</> <Y>{$gen2[name]}</>의 <S>".getHorseName($gen2[h])."</>(이)가 포효합니다!"; break; case 0: $log[count($log)] = "<S>●</> <Y>{$gen2['name']}</>의 <S>".getHorseName($gen2[h])."</>(이)가 포효합니다!"; break;
case 1: $log[count($log)] = "<S>●</> <Y>{$gen2[name]}</>의 <S>".getHorseName($gen2[h])."</>(이)가 그 위용을 뽐냅니다!"; break; case 1: $log[count($log)] = "<S>●</> <Y>{$gen2['name']}</>의 <S>".getHorseName($gen2[h])."</>(이)가 그 위용을 뽐냅니다!"; break;
case 2: $log[count($log)] = "<S>●</> <Y>{$gen2[name]}</>(이)가 <S>".getHorseName($gen2[h])."</>(을)를 타고 있습니다!"; break; case 2: $log[count($log)] = "<S>●</> <Y>{$gen2['name']}</>(이)가 <S>".getHorseName($gen2[h])."</>(을)를 타고 있습니다!"; break;
case 3: $log[count($log)] = "<S>●</> <Y>{$gen2[name]}</>의 <S>".getHorseName($gen2[h])."</>(이)가 갈기를 휘날립니다!"; break; case 3: $log[count($log)] = "<S>●</> <Y>{$gen2['name']}</>의 <S>".getHorseName($gen2[h])."</>(이)가 갈기를 휘날립니다!"; break;
} }
} }
if($gen2[w] > 6 && ($tnmt_type == 0 || $tnmt_type == 2)) { if($gen2[w] > 6 && ($tnmt_type == 0 || $tnmt_type == 2)) {
switch(rand()%4) { switch(rand()%4) {
case 0: $log[count($log)] = "<S>●</> <Y>{$gen2[name]}</>의 <S>".getWeapName($gen2[w])."</>(이)가 번뜩입니다!"; break; case 0: $log[count($log)] = "<S>●</> <Y>{$gen2['name']}</>의 <S>".getWeapName($gen2[w])."</>(이)가 번뜩입니다!"; break;
case 1: $log[count($log)] = "<S>●</> <Y>{$gen2[name]}</>의 <S>".getWeapName($gen2[w])."</>(이)가 푸르게 빛납니다!"; break; case 1: $log[count($log)] = "<S>●</> <Y>{$gen2['name']}</>의 <S>".getWeapName($gen2[w])."</>(이)가 푸르게 빛납니다!"; break;
case 2: $log[count($log)] = "<S>●</> <Y>{$gen2[name]}</>의 <S>".getWeapName($gen2[w])."</>에서 살기가 느껴집니다!"; break; case 2: $log[count($log)] = "<S>●</> <Y>{$gen2['name']}</>의 <S>".getWeapName($gen2[w])."</>에서 살기가 느껴집니다!"; break;
case 3: $log[count($log)] = "<S>●</> <Y>{$gen2[name]}</>의 손에는 <S>".getWeapName($gen2[w])."</>(이)가 쥐어져 있습니다!"; break; case 3: $log[count($log)] = "<S>●</> <Y>{$gen2['name']}</>의 손에는 <S>".getWeapName($gen2[w])."</>(이)가 쥐어져 있습니다!"; break;
} }
} }
if($gen2[b] > 6 && ($tnmt_type == 0 || $tnmt_type == 3)) { if($gen2[b] > 6 && ($tnmt_type == 0 || $tnmt_type == 3)) {
switch(rand()%4) { switch(rand()%4) {
case 0: $log[count($log)] = "<S>●</> <Y>{$gen2[name]}</>(이)가 <S>".getBookName($gen2[b])."</>(을)를 펼쳐듭니다!"; break; case 0: $log[count($log)] = "<S>●</> <Y>{$gen2['name']}</>(이)가 <S>".getBookName($gen2[b])."</>(을)를 펼쳐듭니다!"; break;
case 1: $log[count($log)] = "<S>●</> <Y>{$gen2[name]}</>(이)가 <S>".getBookName($gen2[b])."</>(을)를 품에서 꺼냅니다!"; break; case 1: $log[count($log)] = "<S>●</> <Y>{$gen2['name']}</>(이)가 <S>".getBookName($gen2[b])."</>(을)를 품에서 꺼냅니다!"; break;
case 2: $log[count($log)] = "<S>●</> <Y>{$gen2[name]}</>(이)가 <S>".getBookName($gen2[b])."</>(을)를 들고 있습니다!"; break; case 2: $log[count($log)] = "<S>●</> <Y>{$gen2['name']}</>(이)가 <S>".getBookName($gen2[b])."</>(을)를 들고 있습니다!"; break;
case 3: $log[count($log)] = "<S>●</> <Y>{$gen2[name]}</>의 손에는 <S>".getBookName($gen2[b])."</>(이)가 쥐어져 있습니다!"; break; case 3: $log[count($log)] = "<S>●</> <Y>{$gen2['name']}</>의 손에는 <S>".getBookName($gen2[b])."</>(이)가 쥐어져 있습니다!"; break;
} }
} }
$log[count($log)] = "<S>●</> <Y>{$gen1[name]}</> <C>({$energy1})</> vs <C>({$energy2})</> <Y>{$gen2[name]}</>"; $log[count($log)] = "<S>●</> <Y>{$gen1['name']}</> <C>({$energy1})</> vs <C>({$energy2})</> <Y>{$gen2['name']}</>";
$gd1 = 0; $gd2 = 0; $gd1 = 0; $gd2 = 0;
$phase = 0; $sel = 2; $phase = 0; $sel = 2;
@@ -813,7 +813,7 @@ function fight($connect, $tnmt_type, $tnmt, $phs, $group, $g1, $g2, $type) {
elseif($tnmt_type == 1) { switch(rand()%2) { case 0: $str = "봉시진"; break; case 1: $str = "어린진"; break; } } elseif($tnmt_type == 1) { switch(rand()%2) { case 0: $str = "봉시진"; break; case 1: $str = "어린진"; break; } }
elseif($tnmt_type == 2) { switch(rand()%2) { case 0: $str = "삼단"; break; case 1: $str = "나선"; break; } } elseif($tnmt_type == 2) { switch(rand()%2) { case 0: $str = "삼단"; break; case 1: $str = "나선"; break; } }
elseif($tnmt_type == 3) { switch(rand()%2) { case 0: $str = "독설"; break; case 1: $str = "논파"; break; } } elseif($tnmt_type == 3) { switch(rand()%2) { case 0: $str = "독설"; break; case 1: $str = "논파"; break; } }
$log[count($log)] = "<S>●</> <Y>{$gen1[name]}</>의 분노의 <M>{$str}</> 공격!"; $log[count($log)] = "<S>●</> <Y>{$gen1['name']}</>의 분노의 <M>{$str}</> 공격!";
} }
$ratio = rand() % 300; $ratio = rand() % 300;
if($e2 / 5 > $energy2 && $damage2 > $damage1 && $gen2[$tp] >= $ratio) { if($e2 / 5 > $energy2 && $damage2 > $damage1 && $gen2[$tp] >= $ratio) {
@@ -823,24 +823,24 @@ function fight($connect, $tnmt_type, $tnmt, $phs, $group, $g1, $g2, $type) {
elseif($tnmt_type == 1) { switch(rand()%2) { case 0: $str = "봉시진"; break; case 1: $str = "어린진"; break; } } elseif($tnmt_type == 1) { switch(rand()%2) { case 0: $str = "봉시진"; break; case 1: $str = "어린진"; break; } }
elseif($tnmt_type == 2) { switch(rand()%2) { case 0: $str = "삼단"; break; case 1: $str = "나선"; break; } } elseif($tnmt_type == 2) { switch(rand()%2) { case 0: $str = "삼단"; break; case 1: $str = "나선"; break; } }
elseif($tnmt_type == 3) { switch(rand()%2) { case 0: $str = "독설"; break; case 1: $str = "논파"; break; } } elseif($tnmt_type == 3) { switch(rand()%2) { case 0: $str = "독설"; break; case 1: $str = "논파"; break; } }
$log[count($log)] = "<S>●</> <Y>{$gen2[name]}</>의 분노의 <M>{$str}</> 공격!"; $log[count($log)] = "<S>●</> <Y>{$gen2['name']}</>의 분노의 <M>{$str}</> 공격!";
} }
//1합 승부 //1합 승부
if($phase == 1) { if($phase == 1) {
$ratio = rand() % 400; $ratio = rand() % 400;
if($gen1[$tp]*0.9 > $gen2[$tp] && $gen1[$tp] >= $ratio) { if($gen1[$tp]*0.9 > $gen2[$tp] && $gen1[$tp] >= $ratio) {
$damage1 = 0; $damage2 = $e2; $damage1 = 0; $damage2 = $e2;
if ($tnmt_type == 0) { $log[count($log)] = "<S>●</> <Y>{$gen1[name]}</>의 <M>압도</>!"; } if ($tnmt_type == 0) { $log[count($log)] = "<S>●</> <Y>{$gen1['name']}</>의 <M>압도</>!"; }
elseif($tnmt_type == 1) { $log[count($log)] = "<S>●</> <Y>{$gen1[name]}</>의 <M>팔문금쇄진</>!"; } elseif($tnmt_type == 1) { $log[count($log)] = "<S>●</> <Y>{$gen1['name']}</>의 <M>팔문금쇄진</>!"; }
elseif($tnmt_type == 2) { $log[count($log)] = "<S>●</> <Y>{$gen1[name]}</>의 <M>일격 필살</>!"; } elseif($tnmt_type == 2) { $log[count($log)] = "<S>●</> <Y>{$gen1['name']}</>의 <M>일격 필살</>!"; }
elseif($tnmt_type == 3) { $log[count($log)] = "<S>●</> <Y>{$gen1[name]}</>의 <M>모독 욕설</>!"; } elseif($tnmt_type == 3) { $log[count($log)] = "<S>●</> <Y>{$gen1['name']}</>의 <M>모독 욕설</>!"; }
} }
if($gen2[$tp]*0.9 > $gen1[$tp] && $gen2[$tp] >= $ratio) { if($gen2[$tp]*0.9 > $gen1[$tp] && $gen2[$tp] >= $ratio) {
$damage2 = 0; $damage1 = $e1; $damage2 = 0; $damage1 = $e1;
if ($tnmt_type == 0) { $log[count($log)] = "<S>●</> <Y>{$gen2[name]}</>의 <M>압도</>!"; } if ($tnmt_type == 0) { $log[count($log)] = "<S>●</> <Y>{$gen2['name']}</>의 <M>압도</>!"; }
elseif($tnmt_type == 1) { $log[count($log)] = "<S>●</> <Y>{$gen2[name]}</>의 <M>팔문금쇄진</>!"; } elseif($tnmt_type == 1) { $log[count($log)] = "<S>●</> <Y>{$gen2['name']}</>의 <M>팔문금쇄진</>!"; }
elseif($tnmt_type == 2) { $log[count($log)] = "<S>●</> <Y>{$gen2[name]}</>의 <M>일격 필살</>!"; } elseif($tnmt_type == 2) { $log[count($log)] = "<S>●</> <Y>{$gen2['name']}</>의 <M>일격 필살</>!"; }
elseif($tnmt_type == 3) { $log[count($log)] = "<S>●</> <Y>{$gen2[name]}</>의 <M>모독 욕설</>!"; } elseif($tnmt_type == 3) { $log[count($log)] = "<S>●</> <Y>{$gen2['name']}</>의 <M>모독 욕설</>!"; }
} }
} else { } else {
$ratio = rand() % 1000; $ratio = rand() % 1000;
@@ -851,7 +851,7 @@ function fight($connect, $tnmt_type, $tnmt, $phs, $group, $g1, $g2, $type) {
elseif($tnmt_type == 1) { switch(rand()%6) { case 0: $str = "추행진"; break; case 1: $str = "학익진"; break; case 2: $str = "장사진"; break; case 3: $str = "형액진"; break; case 4: $str = "기형진"; break; case 5: $str = "구행진"; break; } } elseif($tnmt_type == 1) { switch(rand()%6) { case 0: $str = "추행진"; break; case 1: $str = "학익진"; break; case 2: $str = "장사진"; break; case 3: $str = "형액진"; break; case 4: $str = "기형진"; break; case 5: $str = "구행진"; break; } }
elseif($tnmt_type == 2) { switch(rand()%6) { case 0: $str = "기합"; break; case 1: $str = "기염"; break; case 2: $str = "반격"; break; case 3: $str = "역공"; break; case 4: $str = "삼단"; break; case 5: $str = "나선"; break; } } elseif($tnmt_type == 2) { switch(rand()%6) { case 0: $str = "기합"; break; case 1: $str = "기염"; break; case 2: $str = "반격"; break; case 3: $str = "역공"; break; case 4: $str = "삼단"; break; case 5: $str = "나선"; break; } }
elseif($tnmt_type == 3) { switch(rand()%6) { case 0: $str = "논파"; break; case 1: $str = "항변"; break; case 2: $str = "반론"; break; case 3: $str = "반박"; break; case 4: $str = "도발"; break; case 5: $str = "면박"; break; } } elseif($tnmt_type == 3) { switch(rand()%6) { case 0: $str = "논파"; break; case 1: $str = "항변"; break; case 2: $str = "반론"; break; case 3: $str = "반박"; break; case 4: $str = "도발"; break; case 5: $str = "면박"; break; } }
$log[count($log)] = "<S>●</> <Y>{$gen1[name]}</>의 <M>{$str}</>!"; $log[count($log)] = "<S>●</> <Y>{$gen1['name']}</>의 <M>{$str}</>!";
} }
$ratio = rand() % 1000; $ratio = rand() % 1000;
if($critical2 == 0 && $gen2[$tp] >= $ratio) { if($critical2 == 0 && $gen2[$tp] >= $ratio) {
@@ -861,7 +861,7 @@ function fight($connect, $tnmt_type, $tnmt, $phs, $group, $g1, $g2, $type) {
elseif($tnmt_type == 1) { switch(rand()%6) { case 0: $str = "추행진"; break; case 1: $str = "학익진"; break; case 2: $str = "장사진"; break; case 3: $str = "형액진"; break; case 4: $str = "기형진"; break; case 5: $str = "구행진"; break; } } elseif($tnmt_type == 1) { switch(rand()%6) { case 0: $str = "추행진"; break; case 1: $str = "학익진"; break; case 2: $str = "장사진"; break; case 3: $str = "형액진"; break; case 4: $str = "기형진"; break; case 5: $str = "구행진"; break; } }
elseif($tnmt_type == 2) { switch(rand()%6) { case 0: $str = "기합"; break; case 1: $str = "기염"; break; case 2: $str = "반격"; break; case 3: $str = "역공"; break; case 4: $str = "삼단"; break; case 5: $str = "나선"; break; } } elseif($tnmt_type == 2) { switch(rand()%6) { case 0: $str = "기합"; break; case 1: $str = "기염"; break; case 2: $str = "반격"; break; case 3: $str = "역공"; break; case 4: $str = "삼단"; break; case 5: $str = "나선"; break; } }
elseif($tnmt_type == 3) { switch(rand()%6) { case 0: $str = "논파"; break; case 1: $str = "항변"; break; case 2: $str = "반론"; break; case 3: $str = "반박"; break; case 4: $str = "도발"; break; case 5: $str = "면박"; break; } } elseif($tnmt_type == 3) { switch(rand()%6) { case 0: $str = "논파"; break; case 1: $str = "항변"; break; case 2: $str = "반론"; break; case 3: $str = "반박"; break; case 4: $str = "도발"; break; case 5: $str = "면박"; break; } }
$log[count($log)] = "<S>●</> <Y>{$gen2[name]}</>의 <M>{$str}</>!"; $log[count($log)] = "<S>●</> <Y>{$gen2['name']}</>의 <M>{$str}</>!";
} }
} }
@@ -911,17 +911,17 @@ function fight($connect, $tnmt_type, $tnmt, $phs, $group, $g1, $g2, $type) {
if($energy2 <= 0) { $sel = 0; break; } if($energy2 <= 0) { $sel = 0; break; }
} }
$query = "select {$tp2}g as gl from general where no='$gen1[no]'"; $query = "select {$tp2}g as gl from general where no='$gen1['no']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general1 = MYDB_fetch_array($result); $general1 = MYDB_fetch_array($result);
$query = "select {$tp2}g as gl from general where no='$gen2[no]'"; $query = "select {$tp2}g as gl from general where no='$gen2['no']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general2 = MYDB_fetch_array($result); $general2 = MYDB_fetch_array($result);
switch($sel) { switch($sel) {
case 0: case 0:
$log[count($log)] = "<S>●</> <Y>{$gen1[name]}</> <S>승리</>!"; $log[count($log)] = "<S>●</> <Y>{$gen1['name']}</> <S>승리</>!";
$gl = round(($gd2 - $gd1) / 50); $gl = round(($gd2 - $gd1) / 50);
$query = "update tournament set win=win+1,gl=gl+'$gl' where grp='$group' and grp_no='$g1'"; $query = "update tournament set win=win+1,gl=gl+'$gl' where grp='$group' and grp_no='$g1'";
@@ -929,17 +929,17 @@ function fight($connect, $tnmt_type, $tnmt, $phs, $group, $g1, $g2, $type) {
$query = "update tournament set lose=lose+1,gl=gl-'$gl' where grp='$group' and grp_no='$g2'"; $query = "update tournament set lose=lose+1,gl=gl-'$gl' where grp='$group' and grp_no='$g2'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
if($general1[gl] > $general2[gl]) { $gl1 = "+1"; $gl2 = "+0"; } if($general1['gl'] > $general2['gl']) { $gl1 = "+1"; $gl2 = "+0"; }
elseif($general1[gl] == $general2[gl]) { $gl1 = "+2"; $gl2 = "-1"; } elseif($general1['gl'] == $general2['gl']) { $gl1 = "+2"; $gl2 = "-1"; }
else { $gl1 = "+3"; $gl2 = "-2"; } else { $gl1 = "+3"; $gl2 = "-2"; }
$query = "update general set {$tp2}w={$tp2}w+1,{$tp2}g={$tp2}g{$gl1} where no='$gen1[no]'"; $query = "update general set {$tp2}w={$tp2}w+1,{$tp2}g={$tp2}g{$gl1} where no='$gen1['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update general set {$tp2}l={$tp2}l+1,{$tp2}g={$tp2}g{$gl2} where no='$gen2[no]'"; $query = "update general set {$tp2}l={$tp2}l+1,{$tp2}g={$tp2}g{$gl2} where no='$gen2['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break; break;
case 1: case 1:
$log[count($log)] = "<S>●</> <Y>{$gen2[name]}</> <S>승리</>!"; $log[count($log)] = "<S>●</> <Y>{$gen2['name']}</> <S>승리</>!";
$gl = round(($gd1 - $gd2) / 50); $gl = round(($gd1 - $gd2) / 50);
$query = "update tournament set win=win+1,gl=gl+'$gl' where grp='$group' and grp_no='$g2'"; $query = "update tournament set win=win+1,gl=gl+'$gl' where grp='$group' and grp_no='$g2'";
@@ -947,13 +947,13 @@ function fight($connect, $tnmt_type, $tnmt, $phs, $group, $g1, $g2, $type) {
$query = "update tournament set lose=lose+1,gl=gl-'$gl' where grp='$group' and grp_no='$g1'"; $query = "update tournament set lose=lose+1,gl=gl-'$gl' where grp='$group' and grp_no='$g1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
if($general2[gl] > $general1[gl]) { $gl2 = "+1"; $gl1 = "+0"; } if($general2['gl'] > $general1['gl']) { $gl2 = "+1"; $gl1 = "+0"; }
elseif($general2[gl] == $general1[gl]) { $gl2 = "+2"; $gl1 = "-1"; } elseif($general2['gl'] == $general1['gl']) { $gl2 = "+2"; $gl1 = "-1"; }
else { $gl2 = "+3"; $gl1 = "-2"; } else { $gl2 = "+3"; $gl1 = "-2"; }
$query = "update general set {$tp2}l={$tp2}l+1,{$tp2}g={$tp2}g{$gl1} where no='$gen1[no]'"; $query = "update general set {$tp2}l={$tp2}l+1,{$tp2}g={$tp2}g{$gl1} where no='$gen1['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update general set {$tp2}w={$tp2}w+1,{$tp2}g={$tp2}g{$gl2} where no='$gen2[no]'"; $query = "update general set {$tp2}w={$tp2}w+1,{$tp2}g={$tp2}g{$gl2} where no='$gen2['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break; break;
case 2: case 2:
@@ -962,13 +962,13 @@ function fight($connect, $tnmt_type, $tnmt, $phs, $group, $g1, $g2, $type) {
$query = "update tournament set draw=draw+1 where grp='$group' and (grp_no='$g1' or grp_no='$g2')"; $query = "update tournament set draw=draw+1 where grp='$group' and (grp_no='$g1' or grp_no='$g2')";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
if($general1[gl] > $general2[gl]) { $gl2 = "-1"; $gl1 = "+1"; } if($general1['gl'] > $general2['gl']) { $gl2 = "-1"; $gl1 = "+1"; }
elseif($general1[gl] == $general2[gl]) { $gl2 = "+0"; $gl1 = "+0"; } elseif($general1['gl'] == $general2['gl']) { $gl2 = "+0"; $gl1 = "+0"; }
else { $gl2 = "+1"; $gl1 = "-1"; } else { $gl2 = "+1"; $gl1 = "-1"; }
$query = "update general set {$tp2}d={$tp2}d+1,{$tp2}g={$tp2}g{$gl1} where no='$gen1[no]'"; $query = "update general set {$tp2}d={$tp2}d+1,{$tp2}g={$tp2}g{$gl1} where no='$gen1['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update general set {$tp2}d={$tp2}d+1,{$tp2}g={$tp2}g{$gl2} where no='$gen2[no]'"; $query = "update general set {$tp2}d={$tp2}d+1,{$tp2}g={$tp2}g{$gl2} where no='$gen2['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break; break;
} }
@@ -984,7 +984,7 @@ function fight($connect, $tnmt_type, $tnmt, $phs, $group, $g1, $g2, $type) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen2 = MYDB_fetch_array($result); $gen2 = MYDB_fetch_array($result);
$log[count($log)] = "--------------- 다음경기 ---------------<br><S>☞</> <Y>{$gen1[name]}</> vs <Y>{$gen2[name]}</>"; $log[count($log)] = "--------------- 다음경기 ---------------<br><S>☞</> <Y>{$gen1['name']}</> vs <Y>{$gen2['name']}</>";
} }
pushFightLog($group, $log); pushFightLog($group, $log);
+10 -10
View File
@@ -3,8 +3,8 @@ include "lib.php";
include "func.php"; include "func.php";
require("new_lib.php") require("new_lib.php")
$id = $_POST[id]; $id = $_POST['id'];
$pw = $_POST[pw]; $pw = $_POST['pw'];
$pwTemp = substr($pw, 0, 32); $pwTemp = substr($pw, 0, 32);
@@ -117,7 +117,7 @@ $query = "select no from general where npc<2";
$result = MYDB_query($query, $connect) or Error("join ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("join ".MYDB_error($connect),"");
$gencount = MYDB_num_rows($result); $gencount = MYDB_num_rows($result);
if($gencount >= $admin[maxgeneral]) { if($gencount >= $admin['maxgeneral']) {
echo "<script>alert('더 이상 등록할 수 없습니다.');</script>"; echo "<script>alert('더 이상 등록할 수 없습니다.');</script>";
echo "<script>history.go(-1);</script>"; echo "<script>history.go(-1);</script>";
exit(); exit();
@@ -133,12 +133,12 @@ $nationcount = MYDB_num_rows($nationresult);
for($i=0; $i < $nationcount; $i++) { for($i=0; $i < $nationcount; $i++) {
$nation = MYDB_fetch_array($nationresult); $nation = MYDB_fetch_array($nationresult);
if($nation[scoutmsg] == "") { if($nation['scoutmsg'] == "") {
echo " echo "
<tr><td align=center width=98 style=color:".newColor($nation[color]).";background-color:{$nation[color]}>$nation[name]</td><td width=898 style=color:{newColor($nation[color])};background-color:{$nation[color]}>-</td></tr>"; <tr><td align=center width=98 style=color:".newColor($nation['color']).";background-color:{$nation['color']}>$nation['name']</td><td width=898 style=color:{newColor($nation['color'])};background-color:{$nation['color']}>-</td></tr>";
} else { } else {
echo " echo "
<tr><td align=center width=98 style=color:".newColor($nation[color]).";background-color:{$nation[color]}>$nation[name]</td><td width=898 style=color:{newColor($nation[color])};background-color:{$nation[color]}>$nation[scoutmsg]</td></tr>"; <tr><td align=center width=98 style=color:".newColor($nation['color']).";background-color:{$nation['color']}>$nation['name']</td><td width=898 style=color:{newColor($nation['color'])};background-color:{$nation['color']}>$nation['scoutmsg']</td></tr>";
} }
} }
?> ?>
@@ -154,17 +154,17 @@ for($i=0; $i < $nationcount; $i++) {
<tr> <tr>
<td width=498 align=right id=bg1>장수명</td> <td width=498 align=right id=bg1>장수명</td>
<td colspan=2> <td colspan=2>
<input type=text name=name maxlength=6 size=12 style=color:white;background-color:black; value=<?=$member[name]?>>(6글자 이내) <input type=text name=name maxlength=6 size=12 style=color:white;background-color:black; value=<?=$member['name']?>>(6글자 이내)
</td> </td>
</tr> </tr>
<?php <?php
if($admin[img] >= 1 && $member[grade] >= 1 && $member[picture] != "") { if($admin['img'] >= 1 && $member['grade'] >= 1 && $member['picture'] != "") {
$imageTemp = GetImageURL($member[imgsvr]); $imageTemp = GetImageURL($member['imgsvr']);
echo " echo "
<tr> <tr>
<td align=right id=bg1>전콘 사용 여부</td> <td align=right id=bg1>전콘 사용 여부</td>
<td width=64 height=64> <td width=64 height=64>
<img src={$imageTemp}/{$member[picture]} border=0> <img src={$imageTemp}/{$member['picture']} border=0>
</td> </td>
<td> <td>
<input type=checkbox name=pic value=1 checked>사용 <input type=checkbox name=pic value=1 checked>사용
+28 -28
View File
@@ -2,12 +2,12 @@
include "lib.php"; include "lib.php";
include "func.php"; include "func.php";
$id = $_POST[id]; $id = $_POST['id'];
$pw = $_POST[pw]; $pw = $_POST['pw'];
$name = $_POST[name]; $name = $_POST['name'];
$name = _String::NoSpecialCharacter($name); $name = _String::NoSpecialCharacter($name);
$pic = $_POST[pic]; $pic = $_POST['pic'];
$character = $_POST[character]; $character = $_POST['character'];
$pwTemp = substr($pw, 0, 32); $pwTemp = substr($pw, 0, 32);
@@ -26,7 +26,7 @@ if(!$member) {
$date = date('Y-m-d H:i:s'); $date = date('Y-m-d H:i:s');
//등록정보 //등록정보
$query = "update MEMBER set reg_num=reg_num+1,reg_date='$date' where no='$member[no]'"; $query = "update MEMBER set reg_num=reg_num+1,reg_date='$date' where no='$member['no']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$connect = dbConn(); $connect = dbConn();
@@ -41,7 +41,7 @@ $query = "select no from general where npc<2";
$result = MYDB_query($query,$connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query,$connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result); $gencount = MYDB_num_rows($result);
$query = "select no from general where user_id='$member[id]'"; $query = "select no from general where user_id='$member['id']'";
$result = MYDB_query($query,$connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query,$connect) or Error(__LINE__.MYDB_error($connect),"");
$id_num = MYDB_num_rows($result); $id_num = MYDB_num_rows($result);
@@ -49,7 +49,7 @@ $query = "select no from general where name='$name'";
$result = MYDB_query($query,$connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query,$connect) or Error(__LINE__.MYDB_error($connect),"");
$name_num = MYDB_num_rows($result); $name_num = MYDB_num_rows($result);
$query = "select * from token where id='$member[id]'"; $query = "select * from token where id='$member['id']'";
$result = MYDB_query($query,$connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query,$connect) or Error(__LINE__.MYDB_error($connect),"");
$token_num = MYDB_num_rows($result); $token_num = MYDB_num_rows($result);
@@ -82,7 +82,7 @@ if($id_num) {
history.go(-1) history.go(-1)
</script>"); </script>");
exit; exit;
} elseif($admin[maxgeneral] <= $gencount) { } elseif($admin['maxgeneral'] <= $gencount) {
echo("<script> echo("<script>
window.alert('더이상 등록할 수 없습니다!') window.alert('더이상 등록할 수 없습니다!')
history.go(-1) history.go(-1)
@@ -133,7 +133,7 @@ if($id_num) {
} else { } else {
$ratio = rand() % 100; $ratio = rand() % 100;
// 현재 1% // 현재 1%
if($ratio == 50 && $admin[genius] > 0) { if($ratio == 50 && $admin['genius'] > 0) {
$genius = 1; $genius = 1;
$query = "update game set genius=genius-1 where no='1'"; $query = "update game set genius=genius-1 where no='1'";
@@ -157,7 +157,7 @@ if($id_num) {
$result = MYDB_query($query, $connect) or Error("join_post ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("join_post ".MYDB_error($connect),"");
$city = MYDB_fetch_array($result); $city = MYDB_fetch_array($result);
} }
$city = $city[city]; $city = $city['city'];
$total = rand() % 6; $total = rand() % 6;
$pleader = rand() % 100; $pleader = rand() % 100;
@@ -185,28 +185,28 @@ if($id_num) {
$specage = round((80 - $age)/12) + $age; $specage = round((80 - $age)/12) + $age;
$special = 0; $special = 0;
if($admin[scenario] > 0) { if($admin['scenario'] > 0) {
$specage2 = $age + 3; $specage2 = $age + 3;
$specage = $age + 3; $specage = $age + 3;
} }
$turntime = getRandTurn($admin[turnterm]); $turntime = getRandTurn($admin['turnterm']);
$lastconnect = date('Y-m-d H:i:s'); $lastconnect = date('Y-m-d H:i:s');
if($lastconnect >= $turntime) { if($lastconnect >= $turntime) {
$turntime = addTurn($turntime, $admin[turnterm]); $turntime = addTurn($turntime, $admin['turnterm']);
} }
//특회 전콘 //특회 전콘
if($admin[img] >= 1 && $member[grade] >= 1 && $member[picture] != "" && $pic == 1) { if($admin['img'] >= 1 && $member['grade'] >= 1 && $member['picture'] != "" && $pic == 1) {
$face = $member[picture]; $face = $member['picture'];
$imgsvr = $member[imgsvr]; $imgsvr = $member['imgsvr'];
} else { } else {
$face = "default.jpg"; $face = "default.jpg";
$imgsvr = 0; $imgsvr = 0;
} }
//특회 //특회
$userlevel = $member[grade]; $userlevel = $member['grade'];
//성격 랜덤시 //성격 랜덤시
if($character == 11) $character = rand()%10; if($character == 11) $character = rand()%10;
@@ -230,24 +230,24 @@ if($id_num) {
$result = MYDB_query($query, $connect) or Error("join_post ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("join_post ".MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
if($me[name] == "") { if($me['name'] == "") {
$r = rand() % 999 + 1; $r = rand() % 999 + 1;
$me[name] = '장수-'.$r; $me['name'] = '장수-'.$r;
$query = "update general set name='$me[name]' where user_id='$id'"; $query = "update general set name='$me['name']' where user_id='$id'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
$cityname = getCity($connect, $city, "name"); $cityname = getCity($connect, $city, "name");
if($genius == 1) { if($genius == 1) {
$log[0] = "<C>●</>{$admin[month]}월:<G><b>$cityname[name]</b></>에서 <Y>$me[name]</>(이)라는 기재가 천하에 이름을 알립니다."; $log[0] = "<C>●</>{$admin['month']}월:<G><b>$cityname['name']</b></>에서 <Y>$me['name']</>(이)라는 기재가 천하에 이름을 알립니다.";
$log[1] = "<C>●</>{$admin[month]}월:<C>".getGenSpecial($special2)."</> 특기를 가진 <C>천재</>의 등장으로 온 천하가 떠들썩합니다."; $log[1] = "<C>●</>{$admin['month']}월:<C>".getGenSpecial($special2)."</> 특기를 가진 <C>천재</>의 등장으로 온 천하가 떠들썩합니다.";
$history[0] = "<C>●</>$admin[year]$admin[month]월:<L><b>【천재】</b></><G><b>$cityname[name]</b></>에 천재가 등장했습니다."; $history[0] = "<C>●</>$admin['year']$admin['month']월:<L><b>【천재】</b></><G><b>$cityname['name']</b></>에 천재가 등장했습니다.";
pushHistory($connect, $history); pushHistory($connect, $history);
} else { } else {
$log[0] = "<C>●</>{$admin[month]}월:<G><b>$cityname[name]</b></>에서 <Y>$me[name]</>(이)라는 호걸이 천하에 이름을 알립니다."; $log[0] = "<C>●</>{$admin['month']}월:<G><b>$cityname['name']</b></>에서 <Y>$me['name']</>(이)라는 호걸이 천하에 이름을 알립니다.";
} }
$me = addHistory($connect, $me, "<C>●</>$admin[year]$admin[month]월:<Y>$me[name]</>, <G>$cityname[name]</>에서 큰 뜻을 품다."); $me = addHistory($connect, $me, "<C>●</>$admin['year']$admin['month']월:<Y>$me['name']</>, <G>$cityname['name']</>에서 큰 뜻을 품다.");
$mylog[count($mylog)] = "<C>●</>삼국지 모의전투 PHP의 세계에 오신 것을 환영합니다 ^o^"; $mylog[count($mylog)] = "<C>●</>삼국지 모의전투 PHP의 세계에 오신 것을 환영합니다 ^o^";
$mylog[count($mylog)] = "<C>●</>처음 하시는 경우에는 <D>도움말</>을 참고하시고,"; $mylog[count($mylog)] = "<C>●</>처음 하시는 경우에는 <D>도움말</>을 참고하시고,";
$mylog[count($mylog)] = "<C>●</>문의사항이 있으시면 게시판에 글을 남겨주시면 되겠네요~"; $mylog[count($mylog)] = "<C>●</>문의사항이 있으시면 게시판에 글을 남겨주시면 되겠네요~";
@@ -256,12 +256,12 @@ if($id_num) {
$mylog[count($mylog)] = "<C>●</>연령은 <C>$age</>세로 시작합니다."; $mylog[count($mylog)] = "<C>●</>연령은 <C>$age</>세로 시작합니다.";
if($genius == 1) { if($genius == 1) {
$mylog[count($mylog)] = "<C>●</>축하합니다! 천재로 태어나 처음부터 <C>".getGenSpecial($special2)."</> 특기를 가지게 됩니다!"; $mylog[count($mylog)] = "<C>●</>축하합니다! 천재로 태어나 처음부터 <C>".getGenSpecial($special2)."</> 특기를 가지게 됩니다!";
$me = addHistory($connect, $me, "<C>●</>$admin[year]$admin[month]월:<C>".getGenSpecial($special2)."</> 특기를 가진 천재로 탄생."); $me = addHistory($connect, $me, "<C>●</>$admin['year']$admin['month']월:<C>".getGenSpecial($special2)."</> 특기를 가진 천재로 탄생.");
} }
pushGenLog($me, $mylog); pushGenLog($me, $mylog);
pushAllLog($log); pushAllLog($log);
$adminLog[0] = "가입 : {$name} // {$me[name]} // {$id} // ".getenv("REMOTE_ADDR"); $adminLog[0] = "가입 : {$name} // {$me['name']} // {$id} // ".getenv("REMOTE_ADDR");
pushAdminLog($connect, $adminLog); pushAdminLog($connect, $adminLog);
MYDB_close($connect); MYDB_close($connect);
+3 -3
View File
@@ -2,9 +2,9 @@
include "lib.php"; include "lib.php";
include "func.php"; include "func.php";
$id = $_POST[id]; $id = $_POST['id'];
$pw = $_POST[pw]; $pw = $_POST['pw'];
$type = $_POST[type]; $type = $_POST['type'];
$pwTemp = substr($pw, 0, 32); $pwTemp = substr($pw, 0, 32);
+13 -12
View File
@@ -1,11 +1,12 @@
<?php <?php
include "lib.php"; include "lib.php";
include "func.php"; include "func.php";
require_once('../e_lib/util.php');
$connect = dbConn("sammo"); $connect = dbConn("sammo");
$id = $_POST[id]; $id = util::array_get($_POST['id'],'');
$pw = $_POST[pw]; $pw = util::array_get($_POST['pw'], '');
$conmsg = $_POST[conmsg]; $conmsg = util::array_get($_POST['conmsg'], '');
$pw = substr($pw, 0, 32); $pw = substr($pw, 0, 32);
@@ -30,25 +31,25 @@ if(!$member) {
MessageBox("캐릭터가 없습니다!!!"); MessageBox("캐릭터가 없습니다!!!");
echo "<script>location.replace('index.php');</script>"; echo "<script>location.replace('index.php');</script>";
} else { } else {
switch($me[block]) { switch($me['block']) {
case 1: case 1:
MessageBox("비매너 발언으로 인해, 발언권이 제한됩니다."); break; MessageBox("비매너 발언으로 인해, 발언권이 제한됩니다."); break;
case 2: case 2:
MessageBox("현재 블럭된 계정입니다. 턴 실행이 제한됩니다."); MessageBox("현재 블럭된 계정입니다. 턴 실행이 제한됩니다.");
MessageBox("절대 1계정만 사용하십시오! $me[killturn]시간 후 재등록 가능합니다."); break; MessageBox("절대 1계정만 사용하십시오! $me['killturn']시간 후 재등록 가능합니다."); break;
case 3: case 3:
MessageBox("현재 블럭된 계정입니다. 발언권과 턴 실행이 제한됩니다."); MessageBox("현재 블럭된 계정입니다. 발언권과 턴 실행이 제한됩니다.");
MessageBox("절대 1계정만 사용하십시오! $me[killturn]시간 후 재등록 가능합니다."); break; MessageBox("절대 1계정만 사용하십시오! $me['killturn']시간 후 재등록 가능합니다."); break;
} }
$_SESSION[p_id] = $id; $_SESSION['p_id'] = $id;
$_SESSION[p_name] = $me[name]; $_SESSION['p_name'] = $me['name'];
$_SESSION[p_nation] = $me[nation]; $_SESSION['p_nation'] = $me['nation'];
$_SESSION[p_time] = time(); $_SESSION['p_time'] = time();
$date = date('Y-m-d H:i:s'); $date = date('Y-m-d H:i:s');
$query="update general set logcnt=logcnt+1,ip='$_SESSION[p_ip]',lastconnect='$date',conmsg='$conmsg' where user_id='$_SESSION[p_id]'"; $query="update general set logcnt=logcnt+1,ip='$_SESSION['p_ip']',lastconnect='$date',conmsg='$conmsg' where user_id='$_SESSION['p_id']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
echo "<script>window.top.location.replace('./');</script>"; echo "<script>window.top.location.replace('./');</script>";
@@ -56,7 +57,7 @@ if(!$member) {
$date = date('Y_m_d H:i:s'); $date = date('Y_m_d H:i:s');
$date2 = substr($date, 0, 10); $date2 = substr($date, 0, 10);
$fp = fopen("logs/_{$date2}_login.txt", "a"); $fp = fopen("logs/_{$date2}_login.txt", "a");
$msg = _String::Fill2($date,20," ").tab2($id,13," ")._String::Fill2($me[name],13," ")._String::Fill2($_SESSION[p_ip],16," "); $msg = _String::Fill2($date,20," ").tab2($id,13," ")._String::Fill2($me['name'],13," ")._String::Fill2($_SESSION['p_ip'],16," ");
fwrite($fp, $msg."\r\n"); fwrite($fp, $msg."\r\n");
fclose($fp); fclose($fp);
} }
+7 -7
View File
@@ -4,17 +4,17 @@ include "func.php";
$connect=dbConn(); $connect=dbConn();
$query = "select no,user_id,password,name from general where user_id='$_SESSION[p_id]'"; $query = "select no,user_id,password,name from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
$_SESSION[p_id] = ""; $_SESSION['p_id'] = "";
$_SESSION[p_name] = ""; $_SESSION['p_name'] = "";
$_SESSION[p_nation] = 0; $_SESSION['p_nation'] = 0;
$id = $me[user_id]; $id = $me['user_id'];
$pw = $me[password]; $pw = $me['password'];
$conmsg = $me[conmsg]; $conmsg = $me['conmsg'];
//Ǻ //Ǻ
session_destroy(); session_destroy();
+37 -37
View File
@@ -7,25 +7,25 @@ $connect = dbConn();
increaseRefresh($connect, "메인", 2); increaseRefresh($connect, "메인", 2);
checkTurn($connect); checkTurn($connect);
$query = "select no,skin,userlevel,con,turntime,newmsg,newvote,map from general where user_id='$_SESSION[p_id]'"; $query = "select no,skin,userlevel,con,turntime,newmsg,newvote,map from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
//그새 사망이면 //그새 사망이면
if($me[no] == 0) { if($me['no'] == 0) {
echo "a"; echo "a";
echo "<script>location.replace('start.php');</script>"; echo "<script>location.replace('start.php');</script>";
exit(0); exit(0);
} }
if($me[newmsg] == 1 && $me[newvote] == 1) { if($me['newmsg'] == 1 && $me['newvote'] == 1) {
$query = "update general set newmsg=0,newvote=0 where user_id='$_SESSION[p_id]'"; $query = "update general set newmsg=0,newvote=0 where user_id='$_SESSION['p_id']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($me[newmsg] == 1) { } elseif($me['newmsg'] == 1) {
$query = "update general set newmsg=0 where user_id='$_SESSION[p_id]'"; $query = "update general set newmsg=0 where user_id='$_SESSION['p_id']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($me[newvote] == 1) { } elseif($me['newvote'] == 1) {
$query = "update general set newvote=0 where user_id='$_SESSION[p_id]'"; $query = "update general set newvote=0 where user_id='$_SESSION['p_id']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
@@ -37,10 +37,10 @@ $query = "select plock from plock 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),"");
$plock = MYDB_fetch_array($result); $plock = MYDB_fetch_array($result);
$con = checkLimit($me[userlevel], $me[con], $admin[conlimit]); $con = checkLimit($me['userlevel'], $me['con'], $admin['conlimit']);
if($con >= 2) { printLimitMsg($me[turntime]); exit(); } if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
if($me[skin] < 1) { if($me['skin'] < 1) {
$tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4; $tempColor = $_basecolor; $tempColor2 = $_basecolor2; $tempColor3 = $_basecolor3; $tempColor4 = $_basecolor4;
$_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000"; $_basecolor = "000000"; $_basecolor2 = "000000"; $_basecolor3 = "000000"; $_basecolor4 = "000000";
} }
@@ -51,7 +51,7 @@ $scenario = getScenario($connect);
<head> <head>
<title>메인</title> <title>메인</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'> <meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=stylesheet.php?<?=$me[skin];?> type=text/css> <link rel=stylesheet href=stylesheet.php?<?=$me['skin'];?> type=text/css>
<script type="text/javascript"> <script type="text/javascript">
//var term = <?=$term;?>; // 갱신 가능 텀 //var term = <?=$term;?>; // 갱신 가능 텀
@@ -123,7 +123,7 @@ function turn(type) {
<body oncontextmenu='return false'> <body oncontextmenu='return false'>
<div style="position:absolute; top:15px; left:50%; margin-left: -567px; width: 52px; height: 52px; border: 1px solid white;">심의</div> <div style="position:absolute; top:15px; left:50%; margin-left: -567px; width: 52px; height: 52px; border: 1px solid white;">심의</div>
<?php $banner_id = $_SESSION[p_id]; ?> <?php $banner_id = $_SESSION['p_id']; ?>
<div style="position:absolute; top:77px; left:50%; margin-left: -675px; width: 160px; height: 600px; border: 1px solid white;"> <div style="position:absolute; top:77px; left:50%; margin-left: -675px; width: 160px; height: 600px; border: 1px solid white;">
<?php include('../i_banner/banner.php'); ?> <?php include('../i_banner/banner.php'); ?>
</div> </div>
@@ -140,17 +140,17 @@ function turn(type) {
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 style=font-size:13;word-break:break-all; id=bg0> <table align=center width=1000 border=1 cellspacing=0 cellpadding=0 style=font-size:13;word-break:break-all; id=bg0>
<tr><td colspan=5><?php allButton($connect); ?></td></tr> <tr><td colspan=5><?php allButton($connect); ?></td></tr>
<tr height=50> <tr height=50>
<td colspan=5 align=center><font size=4>삼국지 모의전투 PHP 유기체서버 (<font color=<?=$me[skin]>0?"cyan":"white";?>><?=$scenario;?></font>)</font></td> <td colspan=5 align=center><font size=4>삼국지 모의전투 PHP 유기체서버 (<font color=<?=$me['skin']>0?"cyan":"white";?>><?=$scenario;?></font>)</font></td>
</tr> </tr>
<?php <?php
$valid = 0; $valid = 0;
if($admin[extend] == 0) { $extend = "표준"; } if($admin['extend'] == 0) { $extend = "표준"; }
else { $extend = "확장"; $valid = 1; } else { $extend = "확장"; $valid = 1; }
if($admin[fiction] == 0) { $fiction = "사실"; } if($admin['fiction'] == 0) { $fiction = "사실"; }
else { $fiction = "가상"; $valid = 1; } else { $fiction = "가상"; $valid = 1; }
if($admin[npcmode] == 0) { $npcmode = "불가능"; } if($admin['npcmode'] == 0) { $npcmode = "불가능"; }
else { $npcmode = "가능"; $valid = 1; } else { $npcmode = "가능"; $valid = 1; }
if($me[skin] > 0) { $color = "cyan"; } if($me['skin'] > 0) { $color = "cyan"; }
else { $color = "white"; } else { $color = "white"; }
if($valid == 1) { if($valid == 1) {
echo " echo "
@@ -164,10 +164,10 @@ if($valid == 1) {
?> ?>
<tr height=30> <tr height=30>
<td width=198 align=center><?php info($connect, 2, $me[skin]); ?></td> <td width=198 align=center><?php info($connect, 2, $me['skin']); ?></td>
<td width=198 align=center>전체 접속자 수 : <?=$admin[online];?> 명</td> <td width=198 align=center>전체 접속자 수 : <?=$admin['online'];?> 명</td>
<td width=198 align=center>턴당 갱신횟수 : <?=$admin[conlimit];?>회</td> <td width=198 align=center>턴당 갱신횟수 : <?=$admin['conlimit'];?>회</td>
<td width=398 colspan=2 align=center><?php info($connect, 3, $me[skin]); ?></td> <td width=398 colspan=2 align=center><?php info($connect, 3, $me['skin']); ?></td>
</tr> </tr>
<tr height=30> <tr height=30>
<td align=center> <td align=center>
@@ -176,7 +176,7 @@ if ($onlineNumber > $thr3) { $state = "(긴급모드)"; }
elseif($onlineNumber > $thr2) { $state = "(안전모드)"; } elseif($onlineNumber > $thr2) { $state = "(안전모드)"; }
elseif($onlineNumber > $thr1) { $state = "(절약모드)"; } elseif($onlineNumber > $thr1) { $state = "(절약모드)"; }
else { $state = ""; } else { $state = ""; }
if($plock[plock] == 0) { echo "<marquee scrollamount=2><font color=cyan>서버 가동중{$state}</font></marquee>"; } if($plock['plock'] == 0) { echo "<marquee scrollamount=2><font color=cyan>서버 가동중{$state}</font></marquee>"; }
else { echo "<font color=magenta>서버 동결중{$state}</font>"; } else { echo "<font color=magenta>서버 동결중{$state}</font>"; }
echo " echo "
@@ -184,15 +184,15 @@ echo "
<td align=center> <td align=center>
"; ";
switch($admin[tnmt_type]) { switch($admin['tnmt_type']) {
case 0: $str = "전력전"; break; case 0: $str = "전력전"; break;
case 1: $str = "통솔전"; break; case 1: $str = "통솔전"; break;
case 2: $str = "일기토"; break; case 2: $str = "일기토"; break;
case 3: $str = "설전"; break; case 3: $str = "설전"; break;
} }
$str2 = getTournament($admin[tournament]); $str2 = getTournament($admin['tournament']);
$str3 = getTournamentTime($connect); $str3 = getTournamentTime($connect);
if($admin[tournament] == 0) { echo "<font color=magenta>현재 토너먼트 경기 없음</font>"; } if($admin['tournament'] == 0) { echo "<font color=magenta>현재 토너먼트 경기 없음</font>"; }
else { echo "<marquee scrollamount=2>↑<font color=cyan>{$str}</font> {$str2} {$str3}↑</marquee>"; } else { echo "<marquee scrollamount=2>↑<font color=cyan>{$str}</font> {$str2} {$str3}↑</marquee>"; }
echo " echo "
@@ -211,7 +211,7 @@ echo "
<td colspan=2 align=center> <td colspan=2 align=center>
"; ";
$vote = explode("|", $admin[vote]); $vote = explode("|", $admin['vote']);
$vote[0] = Tag2Code($vote[0]); $vote[0] = Tag2Code($vote[0]);
if($vote[0] == "") { echo "<font color=magenta>진행중 설문 없음</font>"; } if($vote[0] == "") { echo "<font color=magenta>진행중 설문 없음</font>"; }
else { echo "<marquee scrollamount=3><font color=cyan>설문 진행중</font> : $vote[0]</marquee>"; } else { echo "<marquee scrollamount=3><font color=cyan>설문 진행중</font> : $vote[0]</marquee>"; }
@@ -222,11 +222,11 @@ echo "
</tr>"; </tr>";
?> ?>
<tr><td colspan=5>접속중인 국가: <?=onlinenation($connect);?></td></tr> <tr><td colspan=5>접속중인 국가: <?=onlinenation($connect);?></td></tr>
<tr><td colspan=5><?php adminMsg($connect, $me[skin]); ?></td></tr> <tr><td colspan=5><?php adminMsg($connect, $me['skin']); ?></td></tr>
<tr><td colspan=5>【 국가방침 】<?php nationMsg($connect, $me[skin]); ?></td></tr> <tr><td colspan=5>【 국가방침 】<?php nationMsg($connect, $me['skin']); ?></td></tr>
<tr><td colspan=5>【 접속자 】<?=onlinegen($connect);?></td></tr> <tr><td colspan=5>【 접속자 】<?=onlinegen($connect);?></td></tr>
<?php <?php
if($me[userlevel] >= 5) { if($me['userlevel'] >= 5) {
echo " echo "
<tr><td colspan=5> <tr><td colspan=5>
<input type=button value=게임관리 onclick=location.replace('_admin1.php')> <input type=button value=게임관리 onclick=location.replace('_admin1.php')>
@@ -248,7 +248,7 @@ if($me[userlevel] >= 5) {
</table> </table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 style=font-size:13;word-break:break-all; id=bg0> <table align=center width=1000 border=1 cellspacing=0 cellpadding=0 style=font-size:13;word-break:break-all; id=bg0>
<tr> <tr>
<td width=698 height=520 colspan=2><iframe src='map.php?type=0&graphic=<?=$me[map];?>' width=698 height=520 frameborder=0 marginwidth=0 marginheight=0 topmargin=0 scrolling=no></iframe></td> <td width=698 height=520 colspan=2><iframe src='map.php?type=0&graphic=<?=$me['map'];?>' width=698 height=520 frameborder=0 marginwidth=0 marginheight=0 topmargin=0 scrolling=no></iframe></td>
<td width=298 rowspan=4><iframe name=commandlist src='commandlist.php' width=298 height=700 frameborder=0 marginwidth=0 marginheight=0 topmargin=0 scrolling=no></iframe></td> <td width=298 rowspan=4><iframe name=commandlist src='commandlist.php' width=298 height=700 frameborder=0 marginwidth=0 marginheight=0 topmargin=0 scrolling=no></iframe></td>
</tr> </tr>
<form name=form2 action=preprocessing.php method=post target=commandlist> <form name=form2 action=preprocessing.php method=post target=commandlist>
@@ -258,7 +258,7 @@ if($me[userlevel] >= 5) {
</tr> </tr>
<tr> <tr>
<td width=646 align=right> <td width=646 align=right>
<font color=<?=$me[skin]>0?"cyan":"white";?>><b>←</b> Ctrl, Shift, 드래그로 복수선택 가능     반복&수정<b>→</b></font> <font color=<?=$me['skin']>0?"cyan":"white";?>><b>←</b> Ctrl, Shift, 드래그로 복수선택 가능     반복&수정<b>→</b></font>
<select name=sel size=1 style=color:white;background-color:black;font-size:13;> <select name=sel size=1 style=color:white;background-color:black;font-size:13;>
<option value=1>1턴</option> <option value=1>1턴</option>
<option value=2>2턴</option> <option value=2>2턴</option>
@@ -296,11 +296,11 @@ if($me[userlevel] >= 5) {
<td width=498 align=center id=bg1><b>개인 기록</b></td> <td width=498 align=center id=bg1><b>개인 기록</b></td>
</tr> </tr>
<tr> <tr>
<td width=498 ><?php AllLog(15, $me[skin]); ?></td> <td width=498 ><?php AllLog(15, $me['skin']); ?></td>
<td width=498 ><?php MyLog($me[no], 15, $me[skin]); ?></td> <td width=498 ><?php MyLog($me['no'], 15, $me['skin']); ?></td>
</tr> </tr>
<tr><td width=998 colspan=2 align=center id=bg1><b>중원 정세</b></td></tr> <tr><td width=998 colspan=2 align=center id=bg1><b>중원 정세</b></td></tr>
<tr><td width=998 colspan=2><?php History(15, $me[skin]); ?></td></tr> <tr><td width=998 colspan=2><?php History(15, $me['skin']); ?></td></tr>
</table> </table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 style=font-size:13;word-break:break-all; id=bg0> <table align=center width=1000 border=1 cellspacing=0 cellpadding=0 style=font-size:13;word-break:break-all; id=bg0>
<tr> <tr>
@@ -332,5 +332,5 @@ banner();
</html> </html>
<?php <?php
if($con == 1) { MessageBox("접속제한이 얼마 남지 않았습니다! 제한량이 모자라다면 참여를 해보세요^^"); } if($con == 1) { MessageBox("접속제한이 얼마 남지 않았습니다! 제한량이 모자라다면 참여를 해보세요^^"); }
if($me[newmsg] == 1) { MessageBox("개인 서신이 도착했습니다!"); } if($me['newmsg'] == 1) { MessageBox("개인 서신이 도착했습니다!"); }
if($me[newvote] == 1) { $develcost = $admin[develcost]*5; MessageBox("설문조사에 참여하시면 금{$develcost}과 유니크템을 드립니다! (우측 상단 설문조사 메뉴)"); } if($me['newvote'] == 1) { $develcost = $admin['develcost']*5; MessageBox("설문조사에 참여하시면 금{$develcost}과 유니크템을 드립니다! (우측 상단 설문조사 메뉴)"); }
+34 -34
View File
@@ -103,33 +103,33 @@ function showMap($connect, $type, $graphic) {
$result = MYDB_query($query, $connect) or Error("showMap ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("showMap ".MYDB_error($connect),"");
$admin = MYDB_fetch_array($result); $admin = MYDB_fetch_array($result);
$query = "select no,nation,userlevel,level,city from general where user_id='$_SESSION[p_id]'"; $query = "select no,nation,userlevel,level,city from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
$query = "select spy from nation where nation='$me[nation]'"; $query = "select spy from nation where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$myNation = MYDB_fetch_array($result); $myNation = MYDB_fetch_array($result);
//도시수 //도시수
$allcount = 94; $allcount = 94;
if($admin[year] < $admin[startyear] + 1) { if($admin['year'] < $admin['startyear'] + 1) {
$color = "magenta"; $color = "magenta";
} elseif($admin[year] < $admin[startyear] + 2) { } elseif($admin['year'] < $admin['startyear'] + 2) {
$color = "orange"; $color = "orange";
} elseif($admin[year] < $admin[startyear] + 3) { } elseif($admin['year'] < $admin['startyear'] + 3) {
$color = "yellow"; $color = "yellow";
} else { } else {
$color = "white"; $color = "white";
} }
if($admin[month] < 4) { $season = "spring"; } if($admin['month'] < 4) { $season = "spring"; }
elseif($admin[month] < 7) { $season = "summer"; } elseif($admin['month'] < 7) { $season = "summer"; }
elseif($admin[month] < 10) { $season = "fall"; } elseif($admin['month'] < 10) { $season = "fall"; }
else { $season = "winter"; } else { $season = "winter"; }
if($admin[month] < 4) { $mapType = "map1"; } if($admin['month'] < 4) { $mapType = "map1"; }
elseif($admin[month] < 7) { $mapType = "map2"; } elseif($admin['month'] < 7) { $mapType = "map2"; }
elseif($admin[month] < 10) { $mapType = "map3"; } elseif($admin['month'] < 10) { $mapType = "map3"; }
else { $mapType = "map4"; } else { $mapType = "map4"; }
if($graphic == 0) { if($graphic == 0) {
$ltitle = "<img src={$images}/ltitle.jpg></img>"; $ltitle = "<img src={$images}/ltitle.jpg></img>";
@@ -147,7 +147,7 @@ function showMap($connect, $type, $graphic) {
<tr height=20> <tr height=20>
<td width=268 align=left>{$ltitle}</td> <td width=268 align=left>{$ltitle}</td>
<td width=38 {$ad}></td> <td width=38 {$ad}></td>
<td width=98>&nbsp;<font color={$color}><b>{$admin[year]}年 {$admin[month]}月</b></font></td> <td width=98>&nbsp;<font color={$color}><b>{$admin['year']}年 {$admin['month']}月</b></font></td>
<td width=18 {$season}></td> <td width=18 {$season}></td>
<td width=268 align=right>{$rtitle}</td> <td width=268 align=right>{$rtitle}</td>
</tr> </tr>
@@ -160,42 +160,42 @@ function showMap($connect, $type, $graphic) {
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=1; $i <= $count; $i++) { for($i=1; $i <= $count; $i++) {
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
$nationcolor[$nation[nation]] = $nation[color]; $nationcolor[$nation['nation']] = $nation['color'];
$nationname[$nation[nation]] = $nation[name]; $nationname[$nation['nation']] = $nation['name'];
$nationCapital[$nation[nation]] = $nation[capital]; $nationCapital[$nation['nation']] = $nation['capital'];
} }
if($type == 0) { if($type == 0) {
// 운영자의 경우 다 볼 수 있음 // 운영자의 경우 다 볼 수 있음
if($me[userlevel] >= 5) { if($me['userlevel'] >= 5) {
for($i=1; $i <= $allcount; $i++) { for($i=1; $i <= $allcount; $i++) {
$valid[$i] = 1; $valid[$i] = 1;
} }
} elseif($me[level] == 0) { } elseif($me['level'] == 0) {
// 재야는 내 도시만 // 재야는 내 도시만
$query = "select city,name,nation from city where city='$me[city]'"; $query = "select city,name,nation from city where city='$me['city']'";
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$cityvalid = MYDB_fetch_array($cityresult); $cityvalid = MYDB_fetch_array($cityresult);
$valid[$cityvalid[city]] = 1; $valid[$cityvalid['city']] = 1;
} else { } else {
// 아국 도시 // 아국 도시
$query = "select city,name from city where nation='$me[nation]'"; $query = "select city,name from city where nation='$me['nation']'";
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($cityresult); $citycount = MYDB_num_rows($cityresult);
for($i=0; $i < $citycount; $i++) { for($i=0; $i < $citycount; $i++) {
$cityvalid = MYDB_fetch_array($cityresult); $cityvalid = MYDB_fetch_array($cityresult);
$valid[$cityvalid[city]] = 1; $valid[$cityvalid['city']] = 1;
} }
// 아국 장수가 있는 타국 도시들 선택 // 아국 장수가 있는 타국 도시들 선택
$query = "select distinct A.city,B.name,B.nation from general A,city B where A.city=B.city and A.nation='$me[nation]' and B.nation!='$me[nation]'"; $query = "select distinct A.city,B.name,B.nation from general A,city B where A.city=B.city and A.nation='$me['nation']' and B.nation!='$me['nation']'";
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($cityresult); $citycount = MYDB_num_rows($cityresult);
for($i=0; $i < $citycount; $i++) { for($i=0; $i < $citycount; $i++) {
$cityvalid = MYDB_fetch_array($cityresult); $cityvalid = MYDB_fetch_array($cityresult);
$valid[$cityvalid[city]] = 1; $valid[$cityvalid['city']] = 1;
} }
// 첩보된 도시 // 첩보된 도시
$citys = explode("|", $myNation[spy]); $citys = explode("|", $myNation['spy']);
for($i=0; $i < count($citys); $i++) { for($i=0; $i < count($citys); $i++) {
$valid[floor($citys[$i]/10)] = 1; $valid[floor($citys[$i]/10)] = 1;
} }
@@ -236,23 +236,23 @@ function showMap($connect, $type, $graphic) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
for($i=0; $i < $allcount; $i++) { for($i=0; $i < $allcount; $i++) {
$city = MYDB_fetch_array($result); $city = MYDB_fetch_array($result);
$name = $city[name]; $name = $city['name'];
$nation = $nationname[$city[nation]]; $nation = $nationname[$city['nation']];
$color = $nationcolor[$city[nation]]; $color = $nationcolor[$city['nation']];
$capital = $nationCapital[$city[nation]]; $capital = $nationCapital[$city['nation']];
$level = $city[level]; $level = $city['level'];
$state = $city[state]; $state = $city['state'];
$region = $city[region]; $region = $city['region'];
if($me[city] == $city[city]) { $myCity = 1; } if($me['city'] == $city['city']) { $myCity = 1; }
else { $myCity = 0; } else { $myCity = 0; }
if($capital == $city[city]) { $cap = 1; } if($capital == $city['city']) { $cap = 1; }
else { $cap = 0; } else { $cap = 0; }
city($graphic, $brouserIE, city($graphic, $brouserIE,
$type, $name, $nation, $color, $level, $region, $i+1, $valid[$i+1], $x[$i], $y[$i], $type, $name, $nation, $color, $level, $region, $i+1, $valid[$i+1], $x[$i], $y[$i],
$state, $myCity, $city[supply], $cap); $state, $myCity, $city['supply'], $cap);
} }
echo " echo "
+3 -3
View File
@@ -17,7 +17,7 @@ $connect = dbconn();
<body oncontextmenu='return false'> <body oncontextmenu='return false'>
<?php <?php
$query = "select no,nation,skin from general where user_id='$_SESSION[p_id]'"; $query = "select no,nation,skin from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
@@ -26,7 +26,7 @@ $me = MYDB_fetch_array($result);
<tr> <tr>
<td valign=top width=500> <td valign=top width=500>
전체 메세지(최고75자)<br> 전체 메세지(최고75자)<br>
<?php MsgFile($me[skin], 1); ?> <?php MsgFile($me['skin'], 1); ?>
<br> <br>
개인 메세지(최고75자)<br> 개인 메세지(최고75자)<br>
<?php MsgMe($connect, 2); ?> <?php MsgMe($connect, 2); ?>
@@ -34,7 +34,7 @@ $me = MYDB_fetch_array($result);
<td valign=top width=500> <td valign=top width=500>
<?php MsgDip($connect, 4); ?> <?php MsgDip($connect, 4); ?>
국가 메세지(최고75자)<br> 국가 메세지(최고75자)<br>
<?php MsgFile($me[skin], 3, $me[nation]); ?> <?php MsgFile($me['skin'], 3, $me['nation']); ?>
</td> </td>
</tr> </tr>
</table> </table>
+11 -11
View File
@@ -3,8 +3,8 @@ include "lib.php";
include "func.php"; include "func.php";
$connect = dbConn(); $connect = dbConn();
$id = $_POST[id]; $id = $_POST['id'];
$pw = $_POST[pw]; $pw = $_POST['pw'];
$pw = md5($pw.$pw); $pw = md5($pw.$pw);
DeleteSession(); DeleteSession();
@@ -26,32 +26,32 @@ if(!$me2) {
MessageBox("아이디나 암호가 올바르지 않습니다!!!"); MessageBox("아이디나 암호가 올바르지 않습니다!!!");
echo "<script>location.replace('index.php');</script>"; echo "<script>location.replace('index.php');</script>";
} else { } else {
switch($me[block]) { switch($me['block']) {
case 1: case 1:
MessageBox("비매너 발언으로 인해, 발언권이 제한됩니다."); break; MessageBox("비매너 발언으로 인해, 발언권이 제한됩니다."); break;
case 2: case 2:
MessageBox("현재 블럭된 계정입니다. 턴 실행이 제한됩니다."); MessageBox("현재 블럭된 계정입니다. 턴 실행이 제한됩니다.");
MessageBox("절대 1계정만 사용하십시오! $me[killturn]시간 후 재등록 가능합니다."); break; MessageBox("절대 1계정만 사용하십시오! $me['killturn']시간 후 재등록 가능합니다."); break;
case 3: case 3:
MessageBox("현재 블럭된 계정입니다. 발언권과 턴 실행이 제한됩니다."); MessageBox("현재 블럭된 계정입니다. 발언권과 턴 실행이 제한됩니다.");
MessageBox("절대 1계정만 사용하십시오! $me[killturn]시간 후 재등록 가능합니다."); break; MessageBox("절대 1계정만 사용하십시오! $me['killturn']시간 후 재등록 가능합니다."); break;
} }
$_SESSION[p_id] = $id; $_SESSION['p_id'] = $id;
$_SESSION[p_name] = $me[name]; $_SESSION['p_name'] = $me['name'];
$_SESSION[p_nation] = $me[nation]; $_SESSION['p_nation'] = $me['nation'];
$_SESSION[p_time] = time(); $_SESSION['p_time'] = time();
$date = date('Y-m-d H:i:s'); $date = date('Y-m-d H:i:s');
$query="update general set logcnt=logcnt+1,ip='$_SESSION[p_ip]',lastconnect='$date',conmsg='$conmsg' where user_id='$_SESSION[p_id]'"; $query="update general set logcnt=logcnt+1,ip='$_SESSION['p_ip']',lastconnect='$date',conmsg='$conmsg' where user_id='$_SESSION['p_id']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
echo "<script>window.top.location.replace('./');</script>"; echo "<script>window.top.location.replace('./');</script>";
$date2 = substr($date, 0, 10); $date2 = substr($date, 0, 10);
$fp = fopen("logs/_{$date2}-login.txt", "a"); $fp = fopen("logs/_{$date2}-login.txt", "a");
$msg = _String::Fill2($date,20," ")._String::Fill2($id,13," ")._String::Fill2($me[name],13," ")._String::Fill2($_SESSION[p_ip],16," "); $msg = _String::Fill2($date,20," ")._String::Fill2($id,13," ")._String::Fill2($me['name'],13," ")._String::Fill2($_SESSION['p_ip'],16," ");
fwrite($fp, $msg."\r\n"); fwrite($fp, $msg."\r\n");
fclose($fp); fclose($fp);
} }
+2 -2
View File
@@ -10,11 +10,11 @@ $query = "select conlimit 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);
$query = "select no,name,nation,userlevel,con from general where user_id='$_SESSION[p_id]'"; $query = "select no,name,nation,userlevel,con from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
$con = checkLimit($me[userlevel], $me[con], $admin[conlimit]); $con = checkLimit($me['userlevel'], $me['con'], $admin['conlimit']);
if($con >= 2) { echo "<script>window.top.main.location.replace('main.php');</script>"; exit(); } if($con >= 2) { echo "<script>window.top.main.location.replace('main.php');</script>"; exit(); }
$count = sizeof($turn); $count = sizeof($turn);
+474 -474
View File
@@ -2,74 +2,74 @@
function processWar($connect, $general, $city) { function processWar($connect, $general, $city) {
global $_armperphase, $_maximumatmos, $_maximumtrain, $_dexLimit, $_basegold, $_baserice; global $_armperphase, $_maximumatmos, $_maximumtrain, $_dexLimit, $_basegold, $_baserice;
$date = substr($general[turntime],11,5); $date = substr($general['turntime'],11,5);
$query = "select * 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),"");
$game = MYDB_fetch_array($result); $game = MYDB_fetch_array($result);
$deadAmount[att] = 0; $deadAmount['att'] = 0;
$deadAmount[def] = 0; $deadAmount['def'] = 0;
$warphase = getRate($game, $general[crewtype], "spd"); //병종간 페이즈 수 얻기 $warphase = getRate($game, $general['crewtype'], "spd"); //병종간 페이즈 수 얻기
// 특기보정 : 돌격 // 특기보정 : 돌격
if($general[special2] == 60) { $warphase += 1; } if($general[special2] == 60) { $warphase += 1; }
$genAtmos = 0; $genAtmos = 0;
if($general[item] == 3) { if($general['item'] == 3) {
//탁주 사용 //탁주 사용
$genAtmos += 3; $genAtmos += 3;
$query = "update general set item=0 where no='$general[no]'"; $query = "update general set item=0 where no='$general['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$log[count($log)] = "<C>●</><C>".getItemName($general[item])."</>(을)를 사용!"; $log[count($log)] = "<C>●</><C>".getItemName($general['item'])."</>(을)를 사용!";
$general[item] = 0; $general['item'] = 0;
} elseif($general[item] >= 14 && $general[item] <= 16) { } elseif($general['item'] >= 14 && $general['item'] <= 16) {
//의적주, 두강주, 보령압주 사용 //의적주, 두강주, 보령압주 사용
$genAtmos += 5; $genAtmos += 5;
} elseif($general[item] >= 19 && $general[item] <= 20) { } elseif($general['item'] >= 19 && $general['item'] <= 20) {
//춘화첩, 초선화 사용 //춘화첩, 초선화 사용
$genAtmos += 7; $genAtmos += 7;
} }
$genTrain = 0; $genTrain = 0;
if($general[item] == 4) { if($general['item'] == 4) {
//청주 사용 //청주 사용
$genTrain += 3; $genTrain += 3;
$query = "update general set item=0 where no='$general[no]'"; $query = "update general set item=0 where no='$general['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$log[count($log)] = "<C>●</><C>".getItemName($general[item])."</>(을)를 사용!"; $log[count($log)] = "<C>●</><C>".getItemName($general['item'])."</>(을)를 사용!";
$general[item] = 0; $general['item'] = 0;
} elseif($general[item] >= 12 && $general[item] <= 13) { } elseif($general['item'] >= 12 && $general['item'] <= 13) {
//과실주, 이강주 사용 //과실주, 이강주 사용
$genTrain += 5; $genTrain += 5;
} elseif($general[item] >= 17 && $general[item] <= 18) { } elseif($general['item'] >= 17 && $general['item'] <= 18) {
//철벽서, 단결도 사용 //철벽서, 단결도 사용
$genTrain += 7; $genTrain += 7;
} }
// 우선 스케일링 // 우선 스케일링
$city[def] *= 10; $city['def'] *= 10;
$city[wall] *= 10; $city['wall'] *= 10;
$query = "select level from city where city='$general[city]'"; $query = "select level from city where city='$general['city']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$originCity = MYDB_fetch_array($result); $originCity = MYDB_fetch_array($result);
$query = "select nation,level,name,history,capital,tech,type from nation where nation='$general[nation]'"; $query = "select nation,level,name,history,capital,tech,type from nation where nation='$general['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
$query = "select nation,level,name,history,rice,capital,tech,type from nation where nation='$city[nation]'"; $query = "select nation,level,name,history,rice,capital,tech,type from nation where nation='$city['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$destnation = MYDB_fetch_array($result); $destnation = MYDB_fetch_array($result);
//장수수 구함 //장수수 구함
$query = "select no from general where nation='$general[nation]'"; $query = "select no from general where nation='$general['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result); $gencount = MYDB_num_rows($result);
if($gencount < 10) $gencount = 10; if($gencount < 10) $gencount = 10;
//장수수 구함 //장수수 구함
$query = "select no from general where nation='$destnation[nation]'"; $query = "select no from general where nation='$destnation['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$destgencount = MYDB_num_rows($result); $destgencount = MYDB_num_rows($result);
if($destgencount < 10) $destgencount = 10; if($destgencount < 10) $destgencount = 10;
@@ -77,20 +77,20 @@ function processWar($connect, $general, $city) {
$genAtmosBonus = 0; $genTrainBonus = 0; $genAtmosBonus = 0; $genTrainBonus = 0;
$oppAtmosBonus = 0; $oppTrainBonus = 0; $oppAtmosBonus = 0; $oppTrainBonus = 0;
//공격자 수도보정 //공격자 수도보정
if($nation[capital] == $general[city]) { $genAtmosBonus += 5; } if($nation['capital'] == $general['city']) { $genAtmosBonus += 5; }
//방어자 수도보정 //방어자 수도보정
//if($destnation[capital] == $city[city]) { $oppTrainBonus += 5; } //if($destnation['capital'] == $city['city']) { $oppTrainBonus += 5; }
//관,진,수진 보정 //관,진,수진 보정
if($city[level] == 1) { $oppTrainBonus += 5; } // 방어도시가 수진이면 방어자 방어보정 if($city['level'] == 1) { $oppTrainBonus += 5; } // 방어도시가 수진이면 방어자 방어보정
if($originCity[level] == 2) { $genAtmosBonus += 5; } // 출병도시가 진이면 공격자 공격보정 if($originCity['level'] == 2) { $genAtmosBonus += 5; } // 출병도시가 진이면 공격자 공격보정
if($city[level] == 3) { $oppTrainBonus += 5; } // 방어도시가 관이면 방어자 방어보정 if($city['level'] == 3) { $oppTrainBonus += 5; } // 방어도시가 관이면 방어자 방어보정
$alllog[count($alllog)] = "<C>●</>{$game[month]}월:<D><b>$nation[name]</b></>의 <Y>$general[name]</>(이)가 <G><b>$city[name]</b></>(으)로 진격합니다."; $alllog[count($alllog)] = "<C>●</>{$game['month']}월:<D><b>$nation['name']</b></>의 <Y>$general['name']</>(이)가 <G><b>$city['name']</b></>(으)로 진격합니다.";
$log[count($log)] = "<C>●</>{$game[month]}월:<G><b>$city[name]</b></>(으)로 <M>진격</>합니다. <1>$date</>"; $log[count($log)] = "<C>●</>{$game['month']}월:<G><b>$city['name']</b></>(으)로 <M>진격</>합니다. <1>$date</>";
// $history[count($history)] = "<C>●</>{$game[year]}년 {$game[month]}월:<O><b>【전투】</b></><D><b>$nation[name]</b></>(이)가 <D><b>$destnation[name]</b></>의 <G><b>$city[name]</b></>(으)로 <M>진격</>합니다."; // $history[count($history)] = "<C>●</>{$game['year']}년 {$game['month']}월:<O><b>【전투】</b></><D><b>$nation['name']</b></>(이)가 <D><b>$destnation['name']</b></>의 <G><b>$city['name']</b></>(으)로 <M>진격</>합니다.";
// 목표 도시내에 목표 국가 소속 장수 중, 병사가 있는 능력치합+병사수 순으로 훈,사 60, 80 이상 // 목표 도시내에 목표 국가 소속 장수 중, 병사가 있는 능력치합+병사수 순으로 훈,사 60, 80 이상
$query = "select no,name,turntime,personal,special2,crew,crewtype,atmos,train,intel,intel2,book,power,power2,weap,injury,leader,leader2,horse,item,explevel,level,rice,leader+power+intel+weap+horse+book+crew/100 as sum,dex0,dex10,dex20,dex30,dex40 from general where city='$city[city]' and nation='$city[nation]' and nation!=0 and crew>'0' and rice>round(crew/100) and ((train>=60 and atmos>=60 and mode=1) or (train>=80 and atmos>=80 and mode=2)) order by sum desc"; $query = "select no,name,turntime,personal,special2,crew,crewtype,atmos,train,intel,intel2,book,power,power2,weap,injury,leader,leader2,horse,item,explevel,level,rice,leader+power+intel+weap+horse+book+crew/100 as sum,dex0,dex10,dex20,dex30,dex40 from general where city='$city['city']' and nation='$city['nation']' and nation!=0 and crew>'0' and rice>round(crew/100) and ((train>=60 and atmos>=60 and mode=1) or (train>=80 and atmos>=80 and mode=2)) order by sum desc";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$opposecount = MYDB_num_rows($result); $opposecount = MYDB_num_rows($result);
@@ -100,14 +100,14 @@ function processWar($connect, $general, $city) {
$phase = 0; $phase = 0;
while($phase < $warphase) { while($phase < $warphase) {
// 장수가 없어서 도시 공격하려했으나 병량없을시 // 장수가 없어서 도시 공격하려했으나 병량없을시
if($opposecount == 0 && $destnation[nation] > 0 && $destnation[rice] <= 0 && $city[supply] == 1) { if($opposecount == 0 && $destnation['nation'] > 0 && $destnation['rice'] <= 0 && $city['supply'] == 1) {
$general[train] += 1; //훈련 상승 $general['train'] += 1; //훈련 상승
if($general[train] > $_maximumtrain) { $general[train] = $_maximumtrain; } if($general['train'] > $_maximumtrain) { $general['train'] = $_maximumtrain; }
$query = "update general set recwar='$general[turntime]',train='$general[train]',warnum=warnum+1 where no='$general[no]'"; $query = "update general set recwar='$general['turntime']',train='$general['train']',warnum=warnum+1 where no='$general['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$alllog[count($alllog)] = "<C>●</>{$game[month]}월:병량 부족으로 <G><b>$city[name]</b></>의 수비병들이 <R>패퇴</>합니다."; $alllog[count($alllog)] = "<C>●</>{$game['month']}월:병량 부족으로 <G><b>$city['name']</b></>의 수비병들이 <R>패퇴</>합니다.";
$history[count($history)] = "<C>●</>{$game[year]}{$game[month]}월:<M><b>【패퇴】</b></><D><b>$destnation[name]</b></>(이)가 병량 부족으로 <G><b>$city[name]</b></>(을)를 뺏기고 말았습니다."; $history[count($history)] = "<C>●</>{$game['year']}{$game['month']}월:<M><b>【패퇴】</b></><D><b>$destnation['name']</b></>(이)가 병량 부족으로 <G><b>$city['name']</b></>(을)를 뺏기고 말았습니다.";
pushGenLog($general, $log); pushGenLog($general, $log);
pushAllLog($alllog); pushAllLog($alllog);
pushHistory($connect, $history); pushHistory($connect, $history);
@@ -116,40 +116,40 @@ function processWar($connect, $general, $city) {
unset($history); unset($history);
//패퇴시 병량보충 //패퇴시 병량보충
$destnation[rice] += 500; $destnation['rice'] += 500;
$query = "update nation set rice='$destnation[rice]' where nation='$destnation[nation]'"; $query = "update nation set rice='$destnation['rice']' where nation='$destnation['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//내정 피폐 //내정 피폐
$query = "update city set agri=agri*0.5,comm=comm*0.5,secu=secu*0.5 where city='$city[city]'"; $query = "update city set agri=agri*0.5,comm=comm*0.5,secu=secu*0.5 where city='$city['city']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$city = addConflict($connect, $city, $general[nation], 1); $city = addConflict($connect, $city, $general['nation'], 1);
ConquerCity($connect, $game, $general, $city, $nation, $destnation); ConquerCity($connect, $game, $general, $city, $nation, $destnation);
break; break;
// 장수가 없어서 도시 공격 // 장수가 없어서 도시 공격
} elseif($opposecount == 0) { } elseif($opposecount == 0) {
$alllog[count($alllog)] = "<C>●</>{$game[month]}월:<Y>$general[name]</>(이)가 ".getTypename($general[crewtype])."(으)로 성벽을 공격합니다."; $alllog[count($alllog)] = "<C>●</>{$game['month']}월:<Y>$general['name']</>(이)가 ".getTypename($general['crewtype'])."(으)로 성벽을 공격합니다.";
$log[count($log)] = "<C>●</>".getTypename($general[crewtype])."(으)로 성벽을 <M>공격</>합니다."; $log[count($log)] = "<C>●</>".getTypename($general['crewtype'])."(으)로 성벽을 <M>공격</>합니다.";
$general[train] += 1; //훈련 상승 $general['train'] += 1; //훈련 상승
if($general[train] > $_maximumtrain) { $general[train] = $_maximumtrain; } if($general['train'] > $_maximumtrain) { $general['train'] = $_maximumtrain; }
$query = "update general set recwar='$general[turntime]',train='$general[train]',warnum=warnum+1 where no='$general[no]'"; $query = "update general set recwar='$general['turntime']',train='$general['train']',warnum=warnum+1 where no='$general['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$mykillnum = 0; $mydeathnum = 0; $mykillnum = 0; $mydeathnum = 0;
while($phase < $warphase) { while($phase < $warphase) {
$phase++; $phase++;
if($general[level] == 12) { if($general['level'] == 12) {
$lbonus = $nation[level] * 2; $lbonus = $nation['level'] * 2;
} elseif($general[level] >= 5) { } elseif($general['level'] >= 5) {
$lbonus = $nation[level]; $lbonus = $nation['level'];
} else { } else {
$lbonus = 0; $lbonus = 0;
} }
$myAtt = getAtt($game, $general, $nation[tech], $lbonus); $myAtt = getAtt($game, $general, $nation['tech'], $lbonus);
$myDef = getDef($game, $general, $nation[tech]); $myDef = getDef($game, $general, $nation['tech']);
$cityAtt = getCityAtt($city); $cityAtt = getCityAtt($city);
$cityDef = getCityDef($city); $cityDef = getCityDef($city);
@@ -160,35 +160,35 @@ function processWar($connect, $general, $city) {
if($myCrew <= 0) { $myCrew = rand() % 90 + 10; } if($myCrew <= 0) { $myCrew = rand() % 90 + 10; }
//훈련 사기따라 //훈련 사기따라
$myCrew = getCrew($myCrew, $game[city_rate]+$oppAtmosBonus, CharTrain($general[train]+$genTrain+$genTrainBonus, $general[personal])); $myCrew = getCrew($myCrew, $game['city_rate']+$oppAtmosBonus, CharTrain($general['train']+$genTrain+$genTrainBonus, $general['personal']));
$cityCrew = getCrew($cityCrew, CharAtmos($general[atmos]+$genAtmos+$genAtmosBonus, $general[personal]), $game[city_rate]+$oppTrainBonus); $cityCrew = getCrew($cityCrew, CharAtmos($general['atmos']+$genAtmos+$genAtmosBonus, $general['personal']), $game['city_rate']+$oppTrainBonus);
//숙련도 따라 //숙련도 따라
$genDexAtt = getGenDex($general, $general[crewtype]); $genDexAtt = getGenDex($general, $general['crewtype']);
$genDexDef = getGenDex($general, 40); $genDexDef = getGenDex($general, 40);
$cityCrew *= getDexLog($genDexAtt, ($game[city_rate]-60)*7200); $cityCrew *= getDexLog($genDexAtt, ($game['city_rate']-60)*7200);
$myCrew *= getDexLog(($game[city_rate]-60)*7200, $genDexDef); $myCrew *= getDexLog(($game['city_rate']-60)*7200, $genDexDef);
$avoid = 1; $avoid = 1;
// 병종간 특성 // 병종간 특성
if(floor($general[crewtype]/10) == 3) { // 귀병 if(floor($general['crewtype']/10) == 3) { // 귀병
$int = round($general[intel] * (100-$general[injury])/100) + getBookEff($general[book]); $int = round($general['intel'] * (100-$general['injury'])/100) + getBookEff($general['book']);
if($general[crewtype] == 30) { if($general['crewtype'] == 30) {
$ratio2 = $int * 5; // 0~500 즉 50% $ratio2 = $int * 5; // 0~500 즉 50%
} elseif($general[crewtype] == 31) { } elseif($general['crewtype'] == 31) {
$ratio2 = $int * 6; // 0~600 즉 60% $ratio2 = $int * 6; // 0~600 즉 60%
} elseif($general[crewtype] == 32) { } elseif($general['crewtype'] == 32) {
$ratio2 = $int * 6; // 0~600 즉 60% $ratio2 = $int * 6; // 0~600 즉 60%
} elseif($general[crewtype] == 33) { } elseif($general['crewtype'] == 33) {
$ratio2 = $int * 6; // 0~600 즉 60% $ratio2 = $int * 6; // 0~600 즉 60%
} elseif($general[crewtype] == 34) { } elseif($general['crewtype'] == 34) {
$ratio2 = $int * 6; // 0~600 즉 60% $ratio2 = $int * 6; // 0~600 즉 60%
} elseif($general[crewtype] == 35) { } elseif($general['crewtype'] == 35) {
$ratio2 = $int * 8; // 0~800 즉 80% $ratio2 = $int * 8; // 0~800 즉 80%
} elseif($general[crewtype] == 36) { } elseif($general['crewtype'] == 36) {
$ratio2 = $int * 8; // 0~800 즉 80% $ratio2 = $int * 8; // 0~800 즉 80%
} elseif($general[crewtype] == 37) { } elseif($general['crewtype'] == 37) {
$ratio2 = $int * 6; // 0~600 즉 60% $ratio2 = $int * 6; // 0~600 즉 60%
} elseif($general[crewtype] == 38) { } elseif($general['crewtype'] == 38) {
$ratio2 = $int * 6; // 0~600 즉 60% $ratio2 = $int * 6; // 0~600 즉 60%
} }
@@ -240,22 +240,22 @@ function processWar($connect, $general, $city) {
} }
} }
} }
} elseif($general[crewtype] == 40) { // 정란 } elseif($general['crewtype'] == 40) { // 정란
$cityCrew = $cityCrew * 1.5; $cityCrew = $cityCrew * 1.5;
} elseif($general[crewtype] == 41) { // 충차 } elseif($general['crewtype'] == 41) { // 충차
$cityCrew = $cityCrew * 2.0; $cityCrew = $cityCrew * 2.0;
} elseif($general[crewtype] == 42) { // 벽력거 } elseif($general['crewtype'] == 42) { // 벽력거
$cityCrew = $cityCrew * 1.5; $cityCrew = $cityCrew * 1.5;
} }
//군주 공격 보정 10% //군주 공격 보정 10%
if($general[level] == 12) { if($general['level'] == 12) {
$cityCrew = $cityCrew * 1.10; $cityCrew = $cityCrew * 1.10;
//참모, 장군 공격 보정 5% //참모, 장군 공격 보정 5%
} elseif($general[level] == 11 || $general[level] == 10 || $general[level] == 8 || $general[level] == 6) { } elseif($general['level'] == 11 || $general['level'] == 10 || $general['level'] == 8 || $general['level'] == 6) {
$cityCrew = $cityCrew * 1.05; $cityCrew = $cityCrew * 1.05;
} }
//레벨 보정 //레벨 보정
$cityCrew = $cityCrew * (100 + $general[explevel]/6)/100; $cityCrew = $cityCrew * (100 + $general['explevel']/6)/100;
// 특기보정 : 공성, 기병, 돌격, 무쌍, 보병, 견고, 의술(청낭서,태평청령) // 특기보정 : 공성, 기병, 돌격, 무쌍, 보병, 견고, 의술(청낭서,태평청령)
if($general[special2] == 53) { $cityCrew *= 2.00; } if($general[special2] == 53) { $cityCrew *= 2.00; }
@@ -265,7 +265,7 @@ function processWar($connect, $general, $city) {
if($general[special2] == 50) { $myCrew *= 0.90; } if($general[special2] == 50) { $myCrew *= 0.90; }
if($general[special2] == 62) { $myCrew *= 0.90; } if($general[special2] == 62) { $myCrew *= 0.90; }
$ratio = rand() % 100; // 0 ~ 99 $ratio = rand() % 100; // 0 ~ 99
if(($general[special2] == 73 || $general[item] == 23 || $general[item] == 24) && $ratio > 80 && $avoid == 1) { if(($general[special2] == 73 || $general['item'] == 23 || $general['item'] == 24) && $ratio > 80 && $avoid == 1) {
$batlog[count($batlog)] = "<C>●</><C>치료</>했다!</>"; $batlog[count($batlog)] = "<C>●</><C>치료</>했다!</>";
$myCrew /= 1.5; // 66%만 소모 $myCrew /= 1.5; // 66%만 소모
$avoid = 0; $avoid = 0;
@@ -273,7 +273,7 @@ function processWar($connect, $general, $city) {
//크리 //크리
$rd = rand() % 100; // 0 ~ 99 $rd = rand() % 100; // 0 ~ 99
$ratio = CriticalRatio2($general[leader]+getHorseEff($general[horse])+$lbonus, $general[power]+getWeapEff($general[weap]), $general[intel]+getBookEff($general[book])); $ratio = CriticalRatio2($general['leader']+getHorseEff($general['horse'])+$lbonus, $general['power']+getWeapEff($general['weap']), $general['intel']+getBookEff($general['book']));
// 특기보정 : 무쌍, 필살 // 특기보정 : 무쌍, 필살
if($general[special2] == 61) { $ratio += 10; } if($general[special2] == 61) { $ratio += 10; }
if($general[special2] == 71) { $ratio += 20; } if($general[special2] == 71) { $ratio += 20; }
@@ -284,11 +284,11 @@ function processWar($connect, $general, $city) {
} }
//회피 //회피
$ratio = rand() % 100; // 0 ~ 99 $ratio = rand() % 100; // 0 ~ 99
$ratio2 = getRate($game, $general[crewtype], "avd"); //회피율 $ratio2 = getRate($game, $general['crewtype'], "avd"); //회피율
//특기보정 : 궁병 //특기보정 : 궁병
if($general[special2] == 51) { $ratio2 += 20; } if($general[special2] == 51) { $ratio2 += 20; }
//도구 보정 : 둔갑천서, 태평요술 //도구 보정 : 둔갑천서, 태평요술
if($general[item] == 26 || $general[item] == 25) { $ratio2 += 20; } if($general['item'] == 26 || $general['item'] == 25) { $ratio2 += 20; }
if($ratio < $ratio2 && $avoid == 1) { if($ratio < $ratio2 && $avoid == 1) {
$batlog[count($batlog)] = "<C>●</><C>회피</>했다!</>"; $batlog[count($batlog)] = "<C>●</><C>회피</>했다!</>";
$myCrew /= 10; // 10%만 소모 $myCrew /= 10; // 10%만 소모
@@ -300,153 +300,153 @@ function processWar($connect, $general, $city) {
$myCrew *= (rand() % 21 + 90)/100; // 90~110% $myCrew *= (rand() % 21 + 90)/100; // 90~110%
//특기보정 : 위압 //특기보정 : 위압
if($general[special2] == 63 && $phase == 1 && $general[crew] >= 1000 && $general[atmos] >= 90 && $general[train] >= 90) { if($general[special2] == 63 && $phase == 1 && $general['crew'] >= 1000 && $general['atmos'] >= 90 && $general['train'] >= 90) {
$batlog[count($batlog)] = "<C>●</>상대에게 <C>위압</>을 줬다!</>"; $batlog[count($batlog)] = "<C>●</>상대에게 <C>위압</>을 줬다!</>";
$myCrew = 0; $myCrew = 0;
} }
$general[crew] -= round($myCrew); $general['crew'] -= round($myCrew);
$city[def] -= round($cityCrew); $city['def'] -= round($cityCrew);
$city[wall] -= round($cityCrew); $city['wall'] -= round($cityCrew);
$tempMyCrew = $myCrew; $tempCityCrew = $cityCrew; $tempMyCrew = $myCrew; $tempCityCrew = $cityCrew;
$tempGeneralCrew = $general[crew]; $tempCityDef = $city[def]; $tempGeneralCrew = $general['crew']; $tempCityDef = $city['def'];
if($city[wall] <= 0) { $city[wall] = 0; } if($city['wall'] <= 0) { $city['wall'] = 0; }
if($general[crew] <= 0 && $city[def] <= 0) { if($general['crew'] <= 0 && $city['def'] <= 0) {
$r1 = $tempGeneralCrew / $tempMyCrew; $r1 = $tempGeneralCrew / $tempMyCrew;
$r2 = $tempCityDef / $tempCityCrew; $r2 = $tempCityDef / $tempCityCrew;
if($r1 > $r2) { if($r1 > $r2) {
$offset = round($tempCityDef*$tempMyCrew/$tempCityCrew); $offset = round($tempCityDef*$tempMyCrew/$tempCityCrew);
$myCrew += $offset; $myCrew += $offset;
$general[crew] -= $offset; $general['crew'] -= $offset;
$cityCrew += $tempCityDef; $cityCrew += $tempCityDef;
$city[def] = 0; $city['def'] = 0;
} else { } else {
$offset = round($tempGeneralCrew*$tempCityCrew/$tempMyCrew); $offset = round($tempGeneralCrew*$tempCityCrew/$tempMyCrew);
$cityCrew += $offset; $cityCrew += $offset;
$city[def] -= $offset; $city['def'] -= $offset;
$myCrew += $tempGeneralCrew; $myCrew += $tempGeneralCrew;
$general[crew] = 0; $general['crew'] = 0;
} }
} elseif($general[crew] * $city[def] <= 0) { } elseif($general['crew'] * $city['def'] <= 0) {
if($city[def] < 0) { if($city['def'] < 0) {
$offset = round($tempCityDef*$tempMyCrew/$tempCityCrew); $offset = round($tempCityDef*$tempMyCrew/$tempCityCrew);
$myCrew += $offset; $myCrew += $offset;
$general[crew] -= $offset; $general['crew'] -= $offset;
$cityCrew += $tempCityDef; $cityCrew += $tempCityDef;
$city[def] = 0; $city['def'] = 0;
} }
if($general[crew] < 0) { if($general['crew'] < 0) {
$offset = round($tempGeneralCrew*$tempCityCrew/$tempMyCrew); $offset = round($tempGeneralCrew*$tempCityCrew/$tempMyCrew);
$cityCrew += $offset; $cityCrew += $offset;
$city[def] -= $offset; $city['def'] -= $offset;
$myCrew += $tempGeneralCrew; $myCrew += $tempGeneralCrew;
$general[crew] = 0; $general['crew'] = 0;
} }
} }
$exp += $cityCrew; $exp += $cityCrew;
$opexp += $myCrew; $opexp += $myCrew;
$general[crew] = round($general[crew]); $general['crew'] = round($general['crew']);
$cityCrew = round($cityCrew); $cityCrew = round($cityCrew);
$myCrew = round($myCrew); $myCrew = round($myCrew);
$batlog[count($batlog)] = "<C>●</> $phase : <Y1>【$general[name]】</> <C>$general[crew] (-$myCrew)</> VS <C>$city[def] (-$cityCrew)</> <Y1>【$city[name]】</>"; $batlog[count($batlog)] = "<C>●</> $phase : <Y1>【$general['name']】</> <C>$general['crew'] (-$myCrew)</> VS <C>$city['def'] (-$cityCrew)</> <Y1>【$city['name']】</>";
$mykillnum += $cityCrew; $mydeathnum += $myCrew; $mykillnum += $cityCrew; $mydeathnum += $myCrew;
// 중간 쌀 체크 // 중간 쌀 체크
$myRice = round($exp / 50); $myRice = round($exp / 50);
// 성격 보정 // 성격 보정
$myRice = CharExperience($myRice, $general[personal]); $myRice = CharExperience($myRice, $general['personal']);
// 쌀 소모 // 쌀 소모
$myRice = ($myRice * 5 * getCrewtypeRice($game, $general[crewtype], $nation[tech])); $myRice = ($myRice * 5 * getCrewtypeRice($game, $general['crewtype'], $nation['tech']));
// 결과 쌀 // 결과 쌀
$myRice = $general[rice] - $myRice; $myRice = $general['rice'] - $myRice;
if($myRice <= round($general[crew]/100)) { break; } if($myRice <= round($general['crew']/100)) { break; }
if($city[def] <= 0) { break; } if($city['def'] <= 0) { break; }
if($general[crew] <= 0) { break; } if($general['crew'] <= 0) { break; }
} }
$res = "성 <1>"._String::SubStr(getTypename($general[crewtype]), 0, 2)."</><Y1>【$general[name]】</> <O>$general[crew] (-$mydeathnum)</> VS <O>$city[def] (-$mykillnum)</> <Y1>【$city[name]】</><1>성벽</>"; $res = "성 <1>"._String::SubStr(getTypename($general['crewtype']), 0, 2)."</><Y1>【$general['name']】</> <O>$general['crew'] (-$mydeathnum)</> VS <O>$city['def'] (-$mykillnum)</> <Y1>【$city['name']】</><1>성벽</>";
$log[count($log)] = "<O>◆</>".$res; $log[count($log)] = "<O>◆</>".$res;
$batlog[count($batlog)] = "<O>◆</>".$res; $batlog[count($batlog)] = "<O>◆</>".$res;
$batres[count($batres)] = "<O>◆</>{$game[year]}{$game[month]}월: ".$res; $batres[count($batres)] = "<O>◆</>{$game['year']}{$game['month']}월: ".$res;
$deadAmount[att] = $deadAmount[att] + $mydeathnum; $deadAmount['att'] = $deadAmount['att'] + $mydeathnum;
$deadAmount[def] = $deadAmount[def] + $mykillnum; $deadAmount['def'] = $deadAmount['def'] + $mykillnum;
// 도시쌀 소모 계산 // 도시쌀 소모 계산
$opexp = round($opexp / 50 * 0.8); $opexp = round($opexp / 50 * 0.8);
$rice = round($opexp * 5 * getCrewtypeRice($game, 0, 0) * ($game[city_rate]/100 - 0.2)); $rice = round($opexp * 5 * getCrewtypeRice($game, 0, 0) * ($game['city_rate']/100 - 0.2));
$destnation[rice] -= $rice; $destnation['rice'] -= $rice;
if($destnation[rice] < 0) { $destnation[rice] = 0; } if($destnation['rice'] < 0) { $destnation['rice'] = 0; }
$query = "update nation set rice='$destnation[rice]' where nation='$destnation[nation]'"; $query = "update nation set rice='$destnation['rice']' where nation='$destnation['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$adminLog[0] = "성벽 쌀 소모 : $rice"; $adminLog[0] = "성벽 쌀 소모 : $rice";
pushAdminLog($connect, $adminLog); pushAdminLog($connect, $adminLog);
//원래대로 스케일링 //원래대로 스케일링
$city[def] = round($city[def] / 10); $city['def'] = round($city['def'] / 10);
$city[wall] = round($city[wall] / 10); $city['wall'] = round($city['wall'] / 10);
//내정 감소 //내정 감소
$dec = round($cityCrew / 10); $dec = round($cityCrew / 10);
$city[agri] -= $dec; $city['agri'] -= $dec;
$city[comm] -= $dec; $city['comm'] -= $dec;
$city[secu] -= $dec; $city['secu'] -= $dec;
if($city[agri] < 0) { $city[agri] = 0; } if($city['agri'] < 0) { $city['agri'] = 0; }
if($city[comm] < 0) { $city[comm] = 0; } if($city['comm'] < 0) { $city['comm'] = 0; }
if($city[secu] < 0) { $city[secu] = 0; } if($city['secu'] < 0) { $city['secu'] = 0; }
// 병사수 변경 // 병사수 변경
$query = "update general set crew='$general[crew]',killcrew=killcrew+'$mykillnum',deathcrew=deathcrew+'$mydeathnum' where no='$general[no]'"; $query = "update general set crew='$general['crew']',killcrew=killcrew+'$mykillnum',deathcrew=deathcrew+'$mydeathnum' where no='$general['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 숙련도 증가 // 숙련도 증가
addGenDex($connect, $general[no], $general[crewtype], $mykillnum); addGenDex($connect, $general['no'], $general['crewtype'], $mykillnum);
addGenDex($connect, $general[no], 40, $mydeathnum); addGenDex($connect, $general['no'], 40, $mydeathnum);
// 죽은수 기술로 누적 // 죽은수 기술로 누적
$num = round($mydeathnum * 0.01); $num = round($mydeathnum * 0.01);
// 국가보정 // 국가보정
if($nation[type] == 3 || $nation[type] == 13) { $num *= 1.1; } if($nation['type'] == 3 || $nation['type'] == 13) { $num *= 1.1; }
if($nation[type] == 5 || $nation[type] == 6 || $nation[type] == 7 || $nation[type] == 8 || $nation[type] == 12) { $num *= 0.9; } if($nation['type'] == 5 || $nation['type'] == 6 || $nation['type'] == 7 || $nation['type'] == 8 || $nation['type'] == 12) { $num *= 0.9; }
// 부드러운 기술 제한 // 부드러운 기술 제한
if(TechLimit($game[startyear], $game[year], $nation[tech])) { $num = floor($num/4); } if(TechLimit($game['startyear'], $game['year'], $nation['tech'])) { $num = floor($num/4); }
$query = "update nation set totaltech=totaltech+'$num',tech=totaltech/'$gencount' where nation='$nation[nation]'"; $query = "update nation set totaltech=totaltech+'$num',tech=totaltech/'$gencount' where nation='$nation['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 죽은수 기술로 누적 // 죽은수 기술로 누적
$num = round($mykillnum * 0.01); $num = round($mykillnum * 0.01);
// 국가보정 // 국가보정
if($destnation[type] == 3 || $destnation[type] == 13) { $num *= 1.1; } if($destnation['type'] == 3 || $destnation['type'] == 13) { $num *= 1.1; }
if($destnation[type] == 5 || $destnation[type] == 6 || $destnation[type] == 7 || $destnation[type] == 8 || $destnation[type] == 12) { $num *= 0.9; } if($destnation['type'] == 5 || $destnation['type'] == 6 || $destnation['type'] == 7 || $destnation['type'] == 8 || $destnation['type'] == 12) { $num *= 0.9; }
// 부드러운 기술 제한 // 부드러운 기술 제한
if(TechLimit($game[startyear], $game[year], $destnation[tech])) { $num = floor($num/4); } if(TechLimit($game['startyear'], $game['year'], $destnation['tech'])) { $num = floor($num/4); }
$query = "update nation set totaltech=totaltech+'$num',tech=totaltech/'$destgencount' where nation='$destnation[nation]'"; $query = "update nation set totaltech=totaltech+'$num',tech=totaltech/'$destgencount' where nation='$destnation['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//양국 평균 기술가격 //양국 평균 기술가격
//$techRatio = (getTechCost($nation[tech]) + getTechCost($destnation[tech])) / 2; //$techRatio = (getTechCost($nation['tech']) + getTechCost($destnation['tech'])) / 2;
$techRatio = 1.0; $techRatio = 1.0;
// 죽은수 도시 재정으로 누적 60% // 죽은수 도시 재정으로 누적 60%
$num = round(($mykillnum+$mydeathnum) * 0.6 * $techRatio); $num = round(($mykillnum+$mydeathnum) * 0.6 * $techRatio);
// 국가보정 // 국가보정
if($destnation[type] == 1) { $num *= 1.1; } if($destnation['type'] == 1) { $num *= 1.1; }
if($destnation[type] == 9 || $destnation[type] == 10) { $num *= 0.9; } if($destnation['type'] == 9 || $destnation['type'] == 10) { $num *= 0.9; }
$query = "update city set dead=dead+'$num',def='$city[def]',wall='$city[wall]',agri='$city[agri]',comm='$city[comm]',secu='$city[secu]' where city='$city[city]'"; $query = "update city set dead=dead+'$num',def='$city['def']',wall='$city['wall']',agri='$city['agri']',comm='$city['comm']',secu='$city['secu']' where city='$city['city']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 죽은수 도시 재정으로 누적 40% // 죽은수 도시 재정으로 누적 40%
$num = round(($mykillnum+$mydeathnum) * 0.4 * $techRatio); $num = round(($mykillnum+$mydeathnum) * 0.4 * $techRatio);
// 국가보정 // 국가보정
if($nation[type] == 1) { $num *= 1.1; } if($nation['type'] == 1) { $num *= 1.1; }
if($nation[type] == 9 || $nation[type] == 10) { $num *= 0.9; } if($nation['type'] == 9 || $nation['type'] == 10) { $num *= 0.9; }
$query = "update city set dead=dead+'$num' where city='$general[city]'"; $query = "update city set dead=dead+'$num' where city='$general['city']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//분쟁현황에 추가 //분쟁현황에 추가
$city = addConflict($connect, $city, $general[nation], $mykillnum); $city = addConflict($connect, $city, $general['nation'], $mykillnum);
// 병사 소진시 성 함락 // 병사 소진시 성 함락
if($city[def] <= 0) { if($city['def'] <= 0) {
$exp += 1000; $exp += 1000;
$exp2++; $exp2++;
@@ -464,118 +464,118 @@ function processWar($connect, $general, $city) {
ConquerCity($connect, $game, $general, $city, $nation, $destnation); ConquerCity($connect, $game, $general, $city, $nation, $destnation);
break; break;
// 공격 장수 병사 소진시 실패 처리 // 공격 장수 병사 소진시 실패 처리
} elseif($general[crew] <= 0) { } elseif($general['crew'] <= 0) {
$alllog[count($alllog)] = "<C>●</>{$game[month]}월:<Y>$general[name]</>의 ".getTypename($general[crewtype])."(이)가 퇴각했습니다."; $alllog[count($alllog)] = "<C>●</>{$game['month']}월:<Y>$general['name']</>의 ".getTypename($general['crewtype'])."(이)가 퇴각했습니다.";
$log[count($log)] = "<C>●</>퇴각했습니다."; $log[count($log)] = "<C>●</>퇴각했습니다.";
$query = "update general set deathnum=deathnum+1 where no='$general[no]'"; $query = "update general set deathnum=deathnum+1 where no='$general['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break; break;
} elseif($myRice <= round($general[crew]/100)) { } elseif($myRice <= round($general['crew']/100)) {
$alllog[count($alllog)] = "<C>●</>{$game[month]}월:<Y>$general[name]</>의 ".getTypename($general[crewtype])."(이)가 퇴각했습니다."; $alllog[count($alllog)] = "<C>●</>{$game['month']}월:<Y>$general['name']</>의 ".getTypename($general['crewtype'])."(이)가 퇴각했습니다.";
$log[count($log)] = "<C>●</>군량 부족으로 퇴각합니다."; $log[count($log)] = "<C>●</>군량 부족으로 퇴각합니다.";
$query = "update general set deathnum=deathnum+1 where no='$general[no]'"; $query = "update general set deathnum=deathnum+1 where no='$general['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
break; break;
} }
// 장수 대결 // 장수 대결
} else { } else {
$oppose = MYDB_fetch_array($result); $oppose = MYDB_fetch_array($result);
$alllog[count($alllog)] = "<C>●</>{$game[month]}월:<Y>$general[name]</>의 ".getTypename($general[crewtype])."(와)과 <Y>$oppose[name]</>의 ".getTypename($oppose[crewtype])."(이)가 대결합니다."; $alllog[count($alllog)] = "<C>●</>{$game['month']}월:<Y>$general['name']</>의 ".getTypename($general['crewtype'])."(와)과 <Y>$oppose['name']</>의 ".getTypename($oppose['crewtype'])."(이)가 대결합니다.";
$log[count($log)] = "<C>●</>".getTypename($general[crewtype])."(으)로 <Y>$oppose[name]</>의 ".getTypename($oppose[crewtype])."(을)를 <M>공격</>합니다."; $log[count($log)] = "<C>●</>".getTypename($general['crewtype'])."(으)로 <Y>$oppose['name']</>의 ".getTypename($oppose['crewtype'])."(을)를 <M>공격</>합니다.";
$opplog[count($opplog)] = "<C>●</>".getTypename($oppose[crewtype])."(으)로 <Y>$general[name]</>의 ".getTypename($general[crewtype])."(을)를 <M>수비</>합니다."; $opplog[count($opplog)] = "<C>●</>".getTypename($oppose['crewtype'])."(으)로 <Y>$general['name']</>의 ".getTypename($general['crewtype'])."(을)를 <M>수비</>합니다.";
$oppAtmos = 0; $oppAtmos = 0;
if($oppose[item] == 3) { if($oppose['item'] == 3) {
//탁주 사용 //탁주 사용
$oppAtmos += 3; $oppAtmos += 3;
$query = "update general set item=0 where no='$oppose[no]'"; $query = "update general set item=0 where no='$oppose['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$opplog[count($opplog)] = "<C>●</><C>".getItemName($oppose[item])."</>(을)를 사용!"; $opplog[count($opplog)] = "<C>●</><C>".getItemName($oppose['item'])."</>(을)를 사용!";
$oppose[item] = 0; $oppose['item'] = 0;
} elseif($oppose[item] >= 14 && $oppose[item] <= 16) { } elseif($oppose['item'] >= 14 && $oppose['item'] <= 16) {
//의적주, 두강주, 보령압주 사용 //의적주, 두강주, 보령압주 사용
$oppAtmos += 5; $oppAtmos += 5;
} elseif($oppose[item] >= 19 && $oppose[item] <= 20) { } elseif($oppose['item'] >= 19 && $oppose['item'] <= 20) {
//춘화첩, 초선화 사용 //춘화첩, 초선화 사용
$oppAtmos += 7; $oppAtmos += 7;
} }
$oppTrain = 0; $oppTrain = 0;
if($oppose[item] == 4) { if($oppose['item'] == 4) {
//청주 사용 //청주 사용
$oppTrain += 3; $oppTrain += 3;
$query = "update general set item=0 where no='$oppose[no]'"; $query = "update general set item=0 where no='$oppose['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$opplog[count($opplog)] = "<C>●</><C>".getItemName($oppose[item])."</>(을)를 사용!"; $opplog[count($opplog)] = "<C>●</><C>".getItemName($oppose['item'])."</>(을)를 사용!";
$oppose[item] = 0; $oppose['item'] = 0;
} elseif($oppose[item] >= 12 && $oppose[item] <= 13) { } elseif($oppose['item'] >= 12 && $oppose['item'] <= 13) {
//과실주, 이강주 사용 //과실주, 이강주 사용
$oppTrain += 5; $oppTrain += 5;
} elseif($oppose[item] >= 17 && $oppose[item] <= 18) { } elseif($oppose['item'] >= 17 && $oppose['item'] <= 18) {
//철벽서, 단결도 사용 //철벽서, 단결도 사용
$oppTrain += 7; $oppTrain += 7;
} }
$general[train] += 1; //훈련 상승 $general['train'] += 1; //훈련 상승
if($general[train] > $_maximumtrain) { $general[train] = $_maximumtrain; } if($general['train'] > $_maximumtrain) { $general['train'] = $_maximumtrain; }
$oppose[train] += 1; //훈련 상승 $oppose['train'] += 1; //훈련 상승
if($oppose[train] > $_maximumtrain) { $oppose[train] = $_maximumtrain; } if($oppose['train'] > $_maximumtrain) { $oppose['train'] = $_maximumtrain; }
$query = "update general set recwar='$general[turntime]',train='$general[train]',warnum=warnum+1 where no='$general[no]'"; $query = "update general set recwar='$general['turntime']',train='$general['train']',warnum=warnum+1 where no='$general['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update general set recwar='$general[turntime]',train='$oppose[train]',warnum=warnum+1 where no='$oppose[no]'"; $query = "update general set recwar='$general['turntime']',train='$oppose['train']',warnum=warnum+1 where no='$oppose['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$ratio = rand() % 100; $ratio = rand() % 100;
//특기보정 : 저격(수극), 활무기저격 //특기보정 : 저격(수극), 활무기저격
if(($general[special2] == 70 && $ratio <= 33) || ($general[item] == 2 && $ratio <= 20) || (($general[weap] == 10 || $general[weap] == 14 || $general[weap] == 18 || $general[weap] == 22) && $ratio <= 20)) { if(($general[special2] == 70 && $ratio <= 33) || ($general['item'] == 2 && $ratio <= 20) || (($general['weap'] == 10 || $general['weap'] == 14 || $general['weap'] == 18 || $general['weap'] == 22) && $ratio <= 20)) {
//수극 사용 //수극 사용
if($general[item] == 2) { if($general['item'] == 2) {
$query = "update general set item=0 where no='$general[no]'"; $query = "update general set item=0 where no='$general['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$log[count($log)] = "<C>●</><C>".getItemName($general[item])."</>(을)를 사용!"; $log[count($log)] = "<C>●</><C>".getItemName($general['item'])."</>(을)를 사용!";
$general[item] = 0; $general['item'] = 0;
} elseif($general[weap] == 10 || $general[weap] == 14 || $general[weap] == 18 || $general[weap] == 22) { } elseif($general['weap'] == 10 || $general['weap'] == 14 || $general['weap'] == 18 || $general['weap'] == 22) {
// $log[count($log)] = "<C>●</><C>".getWeapName($general[weap])."</>(을)를 사용!"; // $log[count($log)] = "<C>●</><C>".getWeapName($general['weap'])."</>(을)를 사용!";
} }
$log[count($log)] = "<C>●</>상대를 <C>저격</>했다!"; $log[count($log)] = "<C>●</>상대를 <C>저격</>했다!";
$batlog[count($batlog)] = "<C>●</>상대를 <C>저격</>했다!"; $batlog[count($batlog)] = "<C>●</>상대를 <C>저격</>했다!";
$opplog[count($opplog)] = "<C>●</>상대에게 <R>저격</>당했다!"; $opplog[count($opplog)] = "<C>●</>상대에게 <R>저격</>당했다!";
$oppbatlog[count($oppbatlog)] = "<C>●</>상대에게 <R>저격</>당했다!"; $oppbatlog[count($oppbatlog)] = "<C>●</>상대에게 <R>저격</>당했다!";
// 부상 // 부상
$oppose[injury] += rand() % 41 + 20; // 20 ~ 60 $oppose['injury'] += rand() % 41 + 20; // 20 ~ 60
if($oppose[injury] > 80) { $oppose[injury] = 80; } if($oppose['injury'] > 80) { $oppose['injury'] = 80; }
} else if($general[item] == 2 && $ratio <= 40) { } else if($general['item'] == 2 && $ratio <= 40) {
$query = "update general set item=0 where no='$general[no]'"; $query = "update general set item=0 where no='$general['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$batlog[count($batlog)] = "<C>●</><C>".getItemName($general[item])."</>(이)가 빗나갑니다!"; $batlog[count($batlog)] = "<C>●</><C>".getItemName($general['item'])."</>(이)가 빗나갑니다!";
$general[item] = 0; $general['item'] = 0;
} }
$ratio = rand() % 100; $ratio = rand() % 100;
//특기보정 : 저격(수극), 활무기저격 //특기보정 : 저격(수극), 활무기저격
if(($oppose[special2] == 70 && $ratio <= 33) || ($oppose[item] == 2 && $ratio <= 20) || (($oppose[weap] == 10 || $oppose[weap] == 14 || $oppose[weap] == 18 || $oppose[weap] == 22) && $ratio <= 20)) { if(($oppose[special2] == 70 && $ratio <= 33) || ($oppose['item'] == 2 && $ratio <= 20) || (($oppose['weap'] == 10 || $oppose['weap'] == 14 || $oppose['weap'] == 18 || $oppose['weap'] == 22) && $ratio <= 20)) {
//수극 사용 //수극 사용
if($oppose[item] == 2) { if($oppose['item'] == 2) {
$query = "update general set item=0 where no='$oppose[no]'"; $query = "update general set item=0 where no='$oppose['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$opplog[count($opplog)] = "<C>●</><C>".getItemName($oppose[item])."</>(을)를 사용!"; $opplog[count($opplog)] = "<C>●</><C>".getItemName($oppose['item'])."</>(을)를 사용!";
$oppose[item] = 0; $oppose['item'] = 0;
} elseif($oppose[weap] == 10 || $oppose[weap] == 14 || $oppose[weap] == 18 || $oppose[weap] == 22) { } elseif($oppose['weap'] == 10 || $oppose['weap'] == 14 || $oppose['weap'] == 18 || $oppose['weap'] == 22) {
// $opplog[count($opplog)] = "<C>●</><C>".getWeapName($oppose[weap])."</>(을)를 사용!"; // $opplog[count($opplog)] = "<C>●</><C>".getWeapName($oppose['weap'])."</>(을)를 사용!";
} }
$oppbatlog[count($oppbatlog)] = "<C>●</>상대를 <C>저격</>했다!"; $oppbatlog[count($oppbatlog)] = "<C>●</>상대를 <C>저격</>했다!";
$opplog[count($opplog)] = "<C>●</>상대를 <C>저격</>했다!"; $opplog[count($opplog)] = "<C>●</>상대를 <C>저격</>했다!";
$batlog[count($batlog)] = "<C>●</>상대에게 <R>저격</>당했다!"; $batlog[count($batlog)] = "<C>●</>상대에게 <R>저격</>당했다!";
$log[count($log)] = "<C>●</>상대에게 <R>저격</>당했다!"; $log[count($log)] = "<C>●</>상대에게 <R>저격</>당했다!";
// 부상 // 부상
$general[injury] += rand() % 41 + 20; // 20 ~ 60 $general['injury'] += rand() % 41 + 20; // 20 ~ 60
if($general[injury] > 80) { $general[injury] = 80; } if($general['injury'] > 80) { $general['injury'] = 80; }
} else if($oppose[item] == 2 && $ratio <= 40) { } else if($oppose['item'] == 2 && $ratio <= 40) {
$query = "update general set item=0 where no='$oppose[no]'"; $query = "update general set item=0 where no='$oppose['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$oppbatlog[count($oppbatlog)] = "<C>●</><C>".getItemName($oppose[item])."</>(이)가 빗나갑니다!"; $oppbatlog[count($oppbatlog)] = "<C>●</><C>".getItemName($oppose['item'])."</>(이)가 빗나갑니다!";
$oppose[item] = 0; $oppose['item'] = 0;
} }
$mykillnum = 0; $mydeathnum = 0; $mykillnum = 0; $mydeathnum = 0;
@@ -583,63 +583,63 @@ function processWar($connect, $general, $city) {
while($phase < $warphase) { while($phase < $warphase) {
$phase++; $phase++;
if($general[level] == 12) { if($general['level'] == 12) {
$lbonus = $nation[level] * 2; $lbonus = $nation['level'] * 2;
} elseif($general[level] >= 5) { } elseif($general['level'] >= 5) {
$lbonus = $nation[level]; $lbonus = $nation['level'];
} else { } else {
$lbonus = 0; $lbonus = 0;
} }
$myAtt = getAtt($game, $general, $nation[tech], $lbonus); $myAtt = getAtt($game, $general, $nation['tech'], $lbonus);
$myDef = getDef($game, $general, $nation[tech]); $myDef = getDef($game, $general, $nation['tech']);
if($oppose[level] == 12) { if($oppose['level'] == 12) {
$opplbonus = $destnation[level] * 2; $opplbonus = $destnation['level'] * 2;
} elseif($oppose[level] >= 5) { } elseif($oppose['level'] >= 5) {
$opplbonus = $destnation[level]; $opplbonus = $destnation['level'];
} else { } else {
$opplbonus = 0; $opplbonus = 0;
} }
$opAtt = getAtt($game, $oppose, $destnation[tech], $opplbonus); $opAtt = getAtt($game, $oppose, $destnation['tech'], $opplbonus);
$opDef = getDef($game, $oppose, $destnation[tech]); $opDef = getDef($game, $oppose, $destnation['tech']);
// 감소할 병사 수 // 감소할 병사 수
$myCrew = $_armperphase + $opAtt - $myDef; $myCrew = $_armperphase + $opAtt - $myDef;
$opCrew = $_armperphase + $myAtt - $opDef; $opCrew = $_armperphase + $myAtt - $opDef;
if($myCrew <= 0) { $myCrew = rand() % 90 + 10; } if($myCrew <= 0) { $myCrew = rand() % 90 + 10; }
if($opCrew <= 0) { $opCrew = rand() % 90 + 10; } if($opCrew <= 0) { $opCrew = rand() % 90 + 10; }
//훈련 사기따라 //훈련 사기따라
$myCrew = getCrew($myCrew, CharAtmos($oppose[atmos]+$oppAtmos+$oppAtmosBonus, $oppose[personal]), CharTrain($general[train]+$genTrain+$genTrainBonus, $general[personal])); $myCrew = getCrew($myCrew, CharAtmos($oppose['atmos']+$oppAtmos+$oppAtmosBonus, $oppose['personal']), CharTrain($general['train']+$genTrain+$genTrainBonus, $general['personal']));
$opCrew = getCrew($opCrew, CharAtmos($general[atmos]+$genAtmos+$genAtmosBonus, $general[personal]), CharTrain($oppose[train]+$oppTrain+$oppTrainBonus, $oppose[personal])); $opCrew = getCrew($opCrew, CharAtmos($general['atmos']+$genAtmos+$genAtmosBonus, $general['personal']), CharTrain($oppose['train']+$oppTrain+$oppTrainBonus, $oppose['personal']));
//숙련도 따라 //숙련도 따라
$genDexAtt = getGenDex($general, $general[crewtype]); $genDexAtt = getGenDex($general, $general['crewtype']);
$genDexDef = getGenDex($general, $oppose[crewtype]); $genDexDef = getGenDex($general, $oppose['crewtype']);
$oppDexAtt = getGenDex($oppose, $oppose[crewtype]); $oppDexAtt = getGenDex($oppose, $oppose['crewtype']);
$oppDexDef = getGenDex($oppose, $general[crewtype]); $oppDexDef = getGenDex($oppose, $general['crewtype']);
$opCrew *= getDexLog($genDexAtt, $oppDexDef); $opCrew *= getDexLog($genDexAtt, $oppDexDef);
$myCrew *= getDexLog($oppDexAtt, $genDexDef); $myCrew *= getDexLog($oppDexAtt, $genDexDef);
$myAvoid = 1; $myAvoid = 1;
$opAvoid = 1; $opAvoid = 1;
// 병종간 특성 // 병종간 특성
if(floor($general[crewtype]/10) == 3) { // 귀병 if(floor($general['crewtype']/10) == 3) { // 귀병
$int = round($general[intel] * (100-$general[injury])/100) + getBookEff($general[book]); $int = round($general['intel'] * (100-$general['injury'])/100) + getBookEff($general['book']);
if($general[crewtype] == 30) { if($general['crewtype'] == 30) {
$ratio2 = $int * 5; // 0~500 즉 50% $ratio2 = $int * 5; // 0~500 즉 50%
} elseif($general[crewtype] == 31) { } elseif($general['crewtype'] == 31) {
$ratio2 = $int * 6; // 0~600 즉 60% $ratio2 = $int * 6; // 0~600 즉 60%
} elseif($general[crewtype] == 32) { } elseif($general['crewtype'] == 32) {
$ratio2 = $int * 6; // 0~600 즉 60% $ratio2 = $int * 6; // 0~600 즉 60%
} elseif($general[crewtype] == 33) { } elseif($general['crewtype'] == 33) {
$ratio2 = $int * 6; // 0~600 즉 60% $ratio2 = $int * 6; // 0~600 즉 60%
} elseif($general[crewtype] == 34) { } elseif($general['crewtype'] == 34) {
$ratio2 = $int * 6; // 0~600 즉 60% $ratio2 = $int * 6; // 0~600 즉 60%
} elseif($general[crewtype] == 35) { } elseif($general['crewtype'] == 35) {
$ratio2 = $int * 8; // 0~800 즉 80% $ratio2 = $int * 8; // 0~800 즉 80%
} elseif($general[crewtype] == 36) { } elseif($general['crewtype'] == 36) {
$ratio2 = $int * 8; // 0~800 즉 80% $ratio2 = $int * 8; // 0~800 즉 80%
} elseif($general[crewtype] == 37) { } elseif($general['crewtype'] == 37) {
$ratio2 = $int * 6; // 0~600 즉 60% $ratio2 = $int * 6; // 0~600 즉 60%
} elseif($general[crewtype] == 38) { } elseif($general['crewtype'] == 38) {
$ratio2 = $int * 6; // 0~600 즉 60% $ratio2 = $int * 6; // 0~600 즉 60%
} }
@@ -762,25 +762,25 @@ function processWar($connect, $general, $city) {
} }
// 상대 장수 병종간 특성 // 상대 장수 병종간 특성
if(floor($oppose[crewtype]/10) == 3) { // 귀병 if(floor($oppose['crewtype']/10) == 3) { // 귀병
$int = round($oppose[intel] * (100-$oppose[injury])/100) + getBookEff($oppose[book]); $int = round($oppose['intel'] * (100-$oppose['injury'])/100) + getBookEff($oppose['book']);
if($oppose[crewtype] == 30) { if($oppose['crewtype'] == 30) {
$ratio2 = $int * 5; // 0~500 즉 50% $ratio2 = $int * 5; // 0~500 즉 50%
} elseif($oppose[crewtype] == 31) { } elseif($oppose['crewtype'] == 31) {
$ratio2 = $int * 6; // 0~600 즉 60% $ratio2 = $int * 6; // 0~600 즉 60%
} elseif($oppose[crewtype] == 32) { } elseif($oppose['crewtype'] == 32) {
$ratio2 = $int * 6; // 0~600 즉 60% $ratio2 = $int * 6; // 0~600 즉 60%
} elseif($oppose[crewtype] == 33) { } elseif($oppose['crewtype'] == 33) {
$ratio2 = $int * 6; // 0~600 즉 60% $ratio2 = $int * 6; // 0~600 즉 60%
} elseif($oppose[crewtype] == 34) { } elseif($oppose['crewtype'] == 34) {
$ratio2 = $int * 6; // 0~600 즉 60% $ratio2 = $int * 6; // 0~600 즉 60%
} elseif($oppose[crewtype] == 35) { } elseif($oppose['crewtype'] == 35) {
$ratio2 = $int * 8; // 0~800 즉 80% $ratio2 = $int * 8; // 0~800 즉 80%
} elseif($oppose[crewtype] == 36) { } elseif($oppose['crewtype'] == 36) {
$ratio2 = $int * 8; // 0~800 즉 80% $ratio2 = $int * 8; // 0~800 즉 80%
} elseif($oppose[crewtype] == 37) { } elseif($oppose['crewtype'] == 37) {
$ratio2 = $int * 6; // 0~600 즉 60% $ratio2 = $int * 6; // 0~600 즉 60%
} elseif($oppose[crewtype] == 38) { } elseif($oppose['crewtype'] == 38) {
$ratio2 = $int * 6; // 0~600 즉 60% $ratio2 = $int * 6; // 0~600 즉 60%
} }
@@ -903,10 +903,10 @@ function processWar($connect, $general, $city) {
} }
// 특기보정: 돌격 // 특기보정: 돌격
if($oppose[crewtype] == 43 && $general[special2] != 60) { // 목우 if($oppose['crewtype'] == 43 && $general[special2] != 60) { // 목우
$r = 0; $r = 0;
$r += $oppose[atmos] + $oppAtmos + $oppAtmosBonus; $r += $oppose['atmos'] + $oppAtmos + $oppAtmosBonus;
$r += $oppose[train] + $oppTrain + $oppTrainBonus; $r += $oppose['train'] + $oppTrain + $oppTrainBonus;
$ratio = rand() % 400; // 최대 50% 저지 $ratio = rand() % 400; // 최대 50% 저지
if($ratio < $r && $opAvoid == 1) { if($ratio < $r && $opAvoid == 1) {
$batlog[count($batlog)] = "<C>●</><R>저지</>당했다!</>"; $batlog[count($batlog)] = "<C>●</><R>저지</>당했다!</>";
@@ -918,76 +918,76 @@ function processWar($connect, $general, $city) {
// my 입장 상성 // my 입장 상성
// 보병계열 > 궁병계열 // 보병계열 > 궁병계열
if(floor($general[crewtype]/10) == 0 && floor($oppose[crewtype]/10) == 1) { if(floor($general['crewtype']/10) == 0 && floor($oppose['crewtype']/10) == 1) {
$myCrew *= 0.8; $myCrew *= 0.8;
$opCrew *= 1.2; $opCrew *= 1.2;
} }
// 궁병계열 > 기병계열 // 궁병계열 > 기병계열
if(floor($general[crewtype]/10) == 1 && floor($oppose[crewtype]/10) == 2) { if(floor($general['crewtype']/10) == 1 && floor($oppose['crewtype']/10) == 2) {
$myCrew *= 0.8; $myCrew *= 0.8;
$opCrew *= 1.2; $opCrew *= 1.2;
} }
// 기병계열 > 보병계열 // 기병계열 > 보병계열
if(floor($general[crewtype]/10) == 2 && floor($oppose[crewtype]/10) == 0) { if(floor($general['crewtype']/10) == 2 && floor($oppose['crewtype']/10) == 0) {
$myCrew *= 0.8; $myCrew *= 0.8;
$opCrew *= 1.2; $opCrew *= 1.2;
} }
// 차병계열 // 차병계열
if(floor($general[crewtype]/10) == 4) { if(floor($general['crewtype']/10) == 4) {
$myCrew *= 1.2; $myCrew *= 1.2;
$opCrew *= 0.8; $opCrew *= 0.8;
} }
// op 입장 상성 // op 입장 상성
// 보병계열 > 궁병계열 // 보병계열 > 궁병계열
if(floor($oppose[crewtype]/10) == 0 && floor($general[crewtype]/10) == 1) { if(floor($oppose['crewtype']/10) == 0 && floor($general['crewtype']/10) == 1) {
$opCrew *= 0.8; $opCrew *= 0.8;
$myCrew *= 1.2; $myCrew *= 1.2;
} }
// 궁병계열 > 기병계열 // 궁병계열 > 기병계열
if(floor($oppose[crewtype]/10) == 1 && floor($general[crewtype]/10) == 2) { if(floor($oppose['crewtype']/10) == 1 && floor($general['crewtype']/10) == 2) {
$opCrew *= 0.8; $opCrew *= 0.8;
$myCrew *= 1.2; $myCrew *= 1.2;
} }
// 기병계열 > 보병계열 // 기병계열 > 보병계열
if(floor($oppose[crewtype]/10) == 2 && floor($general[crewtype]/10) == 0) { if(floor($oppose['crewtype']/10) == 2 && floor($general['crewtype']/10) == 0) {
$opCrew *= 0.8; $opCrew *= 0.8;
$myCrew *= 1.2; $myCrew *= 1.2;
} }
// 차병계열 // 차병계열
if(floor($oppose[crewtype]/10) == 4) { if(floor($oppose['crewtype']/10) == 4) {
$opCrew *= 1.2; $opCrew *= 1.2;
$myCrew *= 0.8; $myCrew *= 0.8;
} }
//군주 공격 보정 10% //군주 공격 보정 10%
if($general[level] == 12) { if($general['level'] == 12) {
$opCrew = $opCrew * 1.10; $opCrew = $opCrew * 1.10;
//참모, 장군 공격 보정 5% //참모, 장군 공격 보정 5%
} elseif($general[level] == 11 || $general[level] == 10 || $general[level] == 8 || $general[level] == 6) { } elseif($general['level'] == 11 || $general['level'] == 10 || $general['level'] == 8 || $general['level'] == 6) {
$opCrew = $opCrew * 1.05; $opCrew = $opCrew * 1.05;
} }
//상대장수 관직 보정 //상대장수 관직 보정
//군주 방어 보정 10% //군주 방어 보정 10%
if($oppose[level] == 12) { if($oppose['level'] == 12) {
$opCrew = $opCrew * 0.90; $opCrew = $opCrew * 0.90;
//참모, 모사 방어 보정 5% //참모, 모사 방어 보정 5%
} elseif($oppose[level] == 11 || $oppose[level] == 9 || $oppose[level] == 7 || $oppose[level] == 5) { } elseif($oppose['level'] == 11 || $oppose['level'] == 9 || $oppose['level'] == 7 || $oppose['level'] == 5) {
$opCrew = $opCrew * 0.95; $opCrew = $opCrew * 0.95;
} elseif($oppose[level] == 4 && $oppose[no] == $city[gen1]) { // 태수 보정 } elseif($oppose['level'] == 4 && $oppose['no'] == $city[gen1]) { // 태수 보정
$opCrew = $opCrew * 0.95; $opCrew = $opCrew * 0.95;
} elseif($oppose[level] == 3 && $oppose[no] == $city[gen2]) { // 군사 보정 } elseif($oppose['level'] == 3 && $oppose['no'] == $city[gen2]) { // 군사 보정
$opCrew = $opCrew * 0.95; $opCrew = $opCrew * 0.95;
} elseif($oppose[level] == 2 && $oppose[no] == $city[gen3]) { // 시중 보정 } elseif($oppose['level'] == 2 && $oppose['no'] == $city[gen3]) { // 시중 보정
$opCrew = $opCrew * 0.95; $opCrew = $opCrew * 0.95;
} }
//레벨 보정 //레벨 보정
$myCrew = $myCrew * ((100 - $general[explevel]/3)/100); $myCrew = $myCrew * ((100 - $general['explevel']/3)/100);
$opCrew = $opCrew / ((100 - $general[explevel]/3)/100); $opCrew = $opCrew / ((100 - $general['explevel']/3)/100);
$myCrew = $myCrew / ((100 - $oppose[explevel]/3)/100); $myCrew = $myCrew / ((100 - $oppose['explevel']/3)/100);
$opCrew = $opCrew * ((100 - $oppose[explevel]/3)/100); $opCrew = $opCrew * ((100 - $oppose['explevel']/3)/100);
// 특기보정 : 기병, 돌격, 무쌍, 보병, 견고, 척사, 의술(청낭서, 태평청령) // 특기보정 : 기병, 돌격, 무쌍, 보병, 견고, 척사, 의술(청낭서, 태평청령)
if($general[special2] == 52) { $opCrew *= 1.20; } if($general[special2] == 52) { $opCrew *= 1.20; }
@@ -996,14 +996,14 @@ function processWar($connect, $general, $city) {
if($general[special2] == 50) { $myCrew *= 0.90; } if($general[special2] == 50) { $myCrew *= 0.90; }
if($general[special2] == 62) { $myCrew *= 0.90; } if($general[special2] == 62) { $myCrew *= 0.90; }
if($general[special2] == 75) { if($general[special2] == 75) {
if($oppose[crewtype] != 0 && $oppose[crewtype] != 10 && $oppose[crewtype] != 20 && if($oppose['crewtype'] != 0 && $oppose['crewtype'] != 10 && $oppose['crewtype'] != 20 &&
$oppose[crewtype] != 30 && $oppose[crewtype] != 40 && $oppose[crewtype] != 41) $oppose['crewtype'] != 30 && $oppose['crewtype'] != 40 && $oppose['crewtype'] != 41)
{ {
$opCrew *= 1.1; $myCrew *= 0.9; $opCrew *= 1.1; $myCrew *= 0.9;
} }
} }
$ratio = rand() % 100; // 0 ~ 99 $ratio = rand() % 100; // 0 ~ 99
if(($general[special2] == 73 || $general[item] == 23 || $general[item] == 24) && $ratio > 80 && $myAvoid == 1) { if(($general[special2] == 73 || $general['item'] == 23 || $general['item'] == 24) && $ratio > 80 && $myAvoid == 1) {
$batlog[count($batlog)] = "<C>●</><C>치료</>했다!</>"; $batlog[count($batlog)] = "<C>●</><C>치료</>했다!</>";
$myCrew /= 1.5; // 66%만 소모 $myCrew /= 1.5; // 66%만 소모
$myAvoid = 0; $myAvoid = 0;
@@ -1015,14 +1015,14 @@ function processWar($connect, $general, $city) {
if($oppose[special2] == 50) { $opCrew *= 0.80; } if($oppose[special2] == 50) { $opCrew *= 0.80; }
if($oppose[special2] == 62) { $myCrew *= 1.10; } if($oppose[special2] == 62) { $myCrew *= 1.10; }
if($oppose[special2] == 75) { if($oppose[special2] == 75) {
if($general[crewtype] != 0 && $general[crewtype] != 10 && $general[crewtype] != 20 && if($general['crewtype'] != 0 && $general['crewtype'] != 10 && $general['crewtype'] != 20 &&
$general[crewtype] != 30 && $general[crewtype] != 40 && $general[crewtype] != 41) $general['crewtype'] != 30 && $general['crewtype'] != 40 && $general['crewtype'] != 41)
{ {
$myCrew *= 1.1; $opCrew *= 0.9; $myCrew *= 1.1; $opCrew *= 0.9;
} }
} }
$ratio = rand() % 100; // 0 ~ 99 $ratio = rand() % 100; // 0 ~ 99
if(($oppose[special2] == 73 || $oppose[item] == 23 || $oppose[item] == 24) && $ratio > 80 && $opAvoid == 1) { if(($oppose[special2] == 73 || $oppose['item'] == 23 || $oppose['item'] == 24) && $ratio > 80 && $opAvoid == 1) {
$oppbatlog[count($oppbatlog)] = "<C>●</><C>치료</>했다!</>"; $oppbatlog[count($oppbatlog)] = "<C>●</><C>치료</>했다!</>";
$opCrew /= 1.5; // 66%만 소모 $opCrew /= 1.5; // 66%만 소모
$opAvoid = 0; $opAvoid = 0;
@@ -1030,7 +1030,7 @@ function processWar($connect, $general, $city) {
//크리 //크리
$rd = rand() % 100; // 0 ~ 99 $rd = rand() % 100; // 0 ~ 99
$ratio = CriticalRatio2($general[leader]+getHorseEff($general[horse])+$lbonus, $general[power]+getWeapEff($general[weap]), $general[intel]+getBookEff($general[book])); $ratio = CriticalRatio2($general['leader']+getHorseEff($general['horse'])+$lbonus, $general['power']+getWeapEff($general['weap']), $general['intel']+getBookEff($general['book']));
// 특기보정 : 무쌍, 필살 // 특기보정 : 무쌍, 필살
if($general[special2] == 61) { $ratio += 10; } if($general[special2] == 61) { $ratio += 10; }
if($general[special2] == 71) { $ratio += 20; } if($general[special2] == 71) { $ratio += 20; }
@@ -1052,7 +1052,7 @@ function processWar($connect, $general, $city) {
} }
//크리 //크리
$rd = rand() % 100; // 0 ~ 99 $rd = rand() % 100; // 0 ~ 99
$ratio = CriticalRatio2($oppose[leader]+getHorseEff($oppose[horse])+$opplbonus, $oppose[power]+getWeapEff($oppose[weap]), $oppose[intel]+getBookEff($oppose[book])); $ratio = CriticalRatio2($oppose['leader']+getHorseEff($oppose['horse'])+$opplbonus, $oppose['power']+getWeapEff($oppose['weap']), $oppose['intel']+getBookEff($oppose['book']));
// 특기보정 : 필살 // 특기보정 : 필살
if($oppose[special2] == 71) { $ratio += 20; } if($oppose[special2] == 71) { $ratio += 20; }
if($ratio >= $rd && $opAvoid == 1) { if($ratio >= $rd && $opAvoid == 1) {
@@ -1080,12 +1080,12 @@ function processWar($connect, $general, $city) {
//회피 //회피
$ratio = rand() % 100; // 0 ~ 99 $ratio = rand() % 100; // 0 ~ 99
$ratio2 = getRate($game, $general[crewtype], "avd"); //회피율 $ratio2 = getRate($game, $general['crewtype'], "avd"); //회피율
//특기보정 : 돌격, 궁병 //특기보정 : 돌격, 궁병
if($oppose[special2] == 60) { $ratio2 -= 100; } if($oppose[special2] == 60) { $ratio2 -= 100; }
if($general[special2] == 51) { $ratio2 += 20; } if($general[special2] == 51) { $ratio2 += 20; }
//도구 보정 : 둔갑천서, 태평요술 //도구 보정 : 둔갑천서, 태평요술
if($general[item] == 26 || $general[item] == 25) { $ratio2 += 20; } if($general['item'] == 26 || $general['item'] == 25) { $ratio2 += 20; }
if($ratio < $ratio2 && $myAvoid == 1) { if($ratio < $ratio2 && $myAvoid == 1) {
// 특기보정 : 격노 // 특기보정 : 격노
if($oppose[special2] == 74 && rand() % 100 < 50) { if($oppose[special2] == 74 && rand() % 100 < 50) {
@@ -1102,12 +1102,12 @@ function processWar($connect, $general, $city) {
} }
//회피 //회피
$ratio = rand() % 100; // 0 ~ 99 $ratio = rand() % 100; // 0 ~ 99
$ratio2 = getRate($game, $oppose[crewtype], "avd"); //회피율 $ratio2 = getRate($game, $oppose['crewtype'], "avd"); //회피율
// 특기보정 : 돌격, 궁병 // 특기보정 : 돌격, 궁병
if($general[special2] == 60) { $ratio2 -= 100; } if($general[special2] == 60) { $ratio2 -= 100; }
if($oppose[special2] == 51) { $ratio2 += 20; } if($oppose[special2] == 51) { $ratio2 += 20; }
//도구 보정 : 둔갑천서, 태평요술 //도구 보정 : 둔갑천서, 태평요술
if($oppose[item] == 26 || $oppose[item] == 25) { $ratio2 += 20; } if($oppose['item'] == 26 || $oppose['item'] == 25) { $ratio2 += 20; }
if($ratio < $ratio2 && $opAvoid == 1) { if($ratio < $ratio2 && $opAvoid == 1) {
// 특기보정 : 격노 // 특기보정 : 격노
if($general[special2] == 74 && rand() % 100 < 33) { if($general[special2] == 74 && rand() % 100 < 33) {
@@ -1134,64 +1134,64 @@ function processWar($connect, $general, $city) {
$myCrew *= (rand() % 21 + 90)/100; // 90~110% $myCrew *= (rand() % 21 + 90)/100; // 90~110%
//특기보정 : 위압 //특기보정 : 위압
if($general[special2] == 63 && $phase == 1 && $general[crew] >= 1000 && $general[atmos] >= 90 && $general[train] >= 90) { if($general[special2] == 63 && $phase == 1 && $general['crew'] >= 1000 && $general['atmos'] >= 90 && $general['train'] >= 90) {
$batlog[count($batlog)] = "<C>●</>상대에게 <C>위압</>을 줬다!</>"; $batlog[count($batlog)] = "<C>●</>상대에게 <C>위압</>을 줬다!</>";
$oppbatlog[count($oppbatlog)] = "<C>●</>상대에게 <R>위압</>받았다!</>"; $oppbatlog[count($oppbatlog)] = "<C>●</>상대에게 <R>위압</>받았다!</>";
$myCrew = 0; $myCrew = 0;
} }
//특기보정: 위압 //특기보정: 위압
if($oppose[special2] == 63 && $phase == 1 && $oppose[crew] >= 1000 && $oppose[atmos] >= 90 && $oppose[train] >= 90) { if($oppose[special2] == 63 && $phase == 1 && $oppose['crew'] >= 1000 && $oppose['atmos'] >= 90 && $oppose['train'] >= 90) {
$batlog[count($batlog)] = "<C>●</>상대에게 <R>위압</>받았다!</>"; $batlog[count($batlog)] = "<C>●</>상대에게 <R>위압</>받았다!</>";
$oppbatlog[count($oppbatlog)] = "<C>●</>상대에게 <C>위압</>을 줬다!</>"; $oppbatlog[count($oppbatlog)] = "<C>●</>상대에게 <C>위압</>을 줬다!</>";
$opCrew = 0; $opCrew = 0;
} }
$general[crew] -= round($myCrew); $general['crew'] -= round($myCrew);
$oppose[crew] -= round($opCrew); $oppose['crew'] -= round($opCrew);
$tempMyCrew = $myCrew; $tempOpCrew = $opCrew; $tempMyCrew = $myCrew; $tempOpCrew = $opCrew;
$tempGeneralCrew = $general[crew]; $tempOpposeCrew = $oppose[crew]; $tempGeneralCrew = $general['crew']; $tempOpposeCrew = $oppose['crew'];
if($general[crew] <= 0 && $oppose[crew] <= 0) { if($general['crew'] <= 0 && $oppose['crew'] <= 0) {
$r1 = $tempGeneralCrew / $tempMyCrew; $r1 = $tempGeneralCrew / $tempMyCrew;
$r2 = $tempOpposeCrew / $tempOpCrew; $r2 = $tempOpposeCrew / $tempOpCrew;
if($r1 > $r2) { if($r1 > $r2) {
$offset = round($tempOpposeCrew*$tempMyCrew/$tempOpCrew); $offset = round($tempOpposeCrew*$tempMyCrew/$tempOpCrew);
$myCrew += $offset; $myCrew += $offset;
$general[crew] -= $offset; $general['crew'] -= $offset;
$opCrew += $tempOpposeCrew; $opCrew += $tempOpposeCrew;
$oppose[crew] = 0; $oppose['crew'] = 0;
} else { } else {
$offset = round($tempGeneralCrew*$tempOpCrew/$tempMyCrew); $offset = round($tempGeneralCrew*$tempOpCrew/$tempMyCrew);
$opCrew += $offset; $opCrew += $offset;
$oppose[crew] -= $offset; $oppose['crew'] -= $offset;
$myCrew += $tempGeneralCrew; $myCrew += $tempGeneralCrew;
$general[crew] = 0; $general['crew'] = 0;
} }
} elseif($general[crew] * $oppose[crew] <= 0) { } elseif($general['crew'] * $oppose['crew'] <= 0) {
if($oppose[crew] < 0) { if($oppose['crew'] < 0) {
$offset = round($tempOpposeCrew*$tempMyCrew/$tempOpCrew); $offset = round($tempOpposeCrew*$tempMyCrew/$tempOpCrew);
$myCrew += $offset; $myCrew += $offset;
$general[crew] -= $offset; $general['crew'] -= $offset;
$opCrew += $tempOpposeCrew; $opCrew += $tempOpposeCrew;
$oppose[crew] = 0; $oppose['crew'] = 0;
} }
if($general[crew] < 0) { if($general['crew'] < 0) {
$offset = round($tempGeneralCrew*$tempOpCrew/$tempMyCrew); $offset = round($tempGeneralCrew*$tempOpCrew/$tempMyCrew);
$opCrew += $offset; $opCrew += $offset;
$oppose[crew] -= $offset; $oppose['crew'] -= $offset;
$myCrew += $tempGeneralCrew; $myCrew += $tempGeneralCrew;
$general[crew] = 0; $general['crew'] = 0;
} }
} }
$exp += $opCrew; $exp += $opCrew;
$opexp += $myCrew; $opexp += $myCrew;
$general[crew] = round($general[crew]); $general['crew'] = round($general['crew']);
$oppose[crew] = round($oppose[crew]); $oppose['crew'] = round($oppose['crew']);
$myCrew = round($myCrew); $myCrew = round($myCrew);
$opCrew = round($opCrew); $opCrew = round($opCrew);
$batlog[count($batlog)] = "<C>●</> $phase : <Y1>【$general[name]】</> <C>$general[crew] (-$myCrew)</> VS <C>$oppose[crew] (-$opCrew)</> <Y1>【$oppose[name]】</>"; $batlog[count($batlog)] = "<C>●</> $phase : <Y1>【$general['name']】</> <C>$general['crew'] (-$myCrew)</> VS <C>$oppose['crew'] (-$opCrew)</> <Y1>【$oppose['name']】</>";
$oppbatlog[count($oppbatlog)] = "<C>●</> $phase : <Y1>【$oppose[name]】</> <C>$oppose[crew] (-$opCrew)</> VS <C>$general[crew] (-$myCrew)</> <Y1>【$general[name]】</>"; $oppbatlog[count($oppbatlog)] = "<C>●</> $phase : <Y1>【$oppose['name']】</> <C>$oppose['crew'] (-$opCrew)</> VS <C>$general['crew'] (-$myCrew)</> <Y1>【$general['name']】</>";
$mykillnum += $opCrew; $mydeathnum += $myCrew; $mykillnum += $opCrew; $mydeathnum += $myCrew;
$opkillnum += $myCrew; $opdeathnum += $opCrew; $opkillnum += $myCrew; $opdeathnum += $opCrew;
@@ -1199,131 +1199,131 @@ function processWar($connect, $general, $city) {
// 중간 쌀 체크 // 중간 쌀 체크
$myRice = round($exp / 50); $myRice = round($exp / 50);
// 성격 보정 // 성격 보정
$myRice = CharExperience($myRice, $general[personal]); $myRice = CharExperience($myRice, $general['personal']);
// 쌀 소모 // 쌀 소모
$myRice = ($myRice * 5 * getCrewtypeRice($game, $general[crewtype], $nation[tech])); $myRice = ($myRice * 5 * getCrewtypeRice($game, $general['crewtype'], $nation['tech']));
// 결과 쌀 // 결과 쌀
$myRice = $general[rice] - $myRice; $myRice = $general['rice'] - $myRice;
// 중간 쌀 체크 // 중간 쌀 체크
$opRice = round($opexp / 50 * 0.8); $opRice = round($opexp / 50 * 0.8);
// 성격 보정 // 성격 보정
$opRice = CharExperience($opRice, $oppose[personal]); $opRice = CharExperience($opRice, $oppose['personal']);
// 쌀 소모 // 쌀 소모
$opRice = ($opRice * 5 * getCrewtypeRice($game, $oppose[crewtype], $destnation[tech])); $opRice = ($opRice * 5 * getCrewtypeRice($game, $oppose['crewtype'], $destnation['tech']));
// 결과 쌀 // 결과 쌀
$opRice = $oppose[rice] - $opRice; $opRice = $oppose['rice'] - $opRice;
if($opRice <= round($oppose[crew]/100)) { break; } if($opRice <= round($oppose['crew']/100)) { break; }
if($myRice <= round($general[crew]/100)) { break; } if($myRice <= round($general['crew']/100)) { break; }
if($oppose[crew] <= 0) { break; } if($oppose['crew'] <= 0) { break; }
if($general[crew] <= 0) { break; } if($general['crew'] <= 0) { break; }
} }
$res = "<C>공</> <1>"._String::SubStr(getTypename($general[crewtype]), 0, 2)."</><Y1>【$general[name]】</> <O>$general[crew] (-$mydeathnum)</> VS <O>$oppose[crew] (-$opdeathnum)</> <Y1>【$oppose[name]】</><1>"._String::SubStr(getTypename($oppose[crewtype]), 0, 2)."</>"; $res = "<C>공</> <1>"._String::SubStr(getTypename($general['crewtype']), 0, 2)."</><Y1>【$general['name']】</> <O>$general['crew'] (-$mydeathnum)</> VS <O>$oppose['crew'] (-$opdeathnum)</> <Y1>【$oppose['name']】</><1>"._String::SubStr(getTypename($oppose['crewtype']), 0, 2)."</>";
$log[count($log)] = "<O>◆</>".$res; $log[count($log)] = "<O>◆</>".$res;
$batlog[count($batlog)] = "<O>◆</>".$res; $batlog[count($batlog)] = "<O>◆</>".$res;
$batres[count($batres)] = "<O>◆</>{$game[year]}{$game[month]}월: ".$res; $batres[count($batres)] = "<O>◆</>{$game['year']}{$game['month']}월: ".$res;
$oppres = "<M>수</> <1>"._String::SubStr(getTypename($oppose[crewtype]), 0, 2)."</><Y1>【$oppose[name]】</> <O>$oppose[crew] (-$opdeathnum)</> VS <O>$general[crew] (-$mydeathnum)</> <Y1>【$general[name]】</><1>"._String::SubStr(getTypename($general[crewtype]), 0, 2)."</>"; $oppres = "<M>수</> <1>"._String::SubStr(getTypename($oppose['crewtype']), 0, 2)."</><Y1>【$oppose['name']】</> <O>$oppose['crew'] (-$opdeathnum)</> VS <O>$general['crew'] (-$mydeathnum)</> <Y1>【$general['name']】</><1>"._String::SubStr(getTypename($general['crewtype']), 0, 2)."</>";
$opplog[count($opplog)] = "<O>◆</>".$oppres; $opplog[count($opplog)] = "<O>◆</>".$oppres;
$oppbatlog[count($oppbatlog)] = "<O>◆</>".$oppres; $oppbatlog[count($oppbatlog)] = "<O>◆</>".$oppres;
$oppbatres[count($oppbatres)] = "<O>◆</>{$game[year]}{$game[month]}월: ".$oppres; $oppbatres[count($oppbatres)] = "<O>◆</>{$game['year']}{$game['month']}월: ".$oppres;
$deadAmount[att] = $deadAmount[att] + $mydeathnum; $deadAmount['att'] = $deadAmount['att'] + $mydeathnum;
$deadAmount[def] = $deadAmount[def] + $opdeathnum; $deadAmount['def'] = $deadAmount['def'] + $opdeathnum;
// 상대장수 부상 // 상대장수 부상
$ratio = rand() % 100; $ratio = rand() % 100;
if($ratio >= 95) { if($ratio >= 95) {
$opplog[count($opplog)] = "<C>●</>전투중 <R>부상</>당했다!"; $opplog[count($opplog)] = "<C>●</>전투중 <R>부상</>당했다!";
$oppose[injury] += rand() % 71 + 10; // 10 ~ 80 $oppose['injury'] += rand() % 71 + 10; // 10 ~ 80
if($oppose[injury] > 80) { $oppose[injury] = 80; } if($oppose['injury'] > 80) { $oppose['injury'] = 80; }
} }
// 병사수 변경 // 병사수 변경
$query = "update general set injury='$oppose[injury]',crew='$oppose[crew]',killcrew=killcrew+'$opkillnum',deathcrew=deathcrew+'$opdeathnum' where no='$oppose[no]'"; $query = "update general set injury='$oppose['injury']',crew='$oppose['crew']',killcrew=killcrew+'$opkillnum',deathcrew=deathcrew+'$opdeathnum' where no='$oppose['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 숙련도 증가 // 숙련도 증가
addGenDex($connect, $oppose[no], $oppose[crewtype], $opkillnum * 0.9); addGenDex($connect, $oppose['no'], $oppose['crewtype'], $opkillnum * 0.9);
addGenDex($connect, $oppose[no], $general[crewtype], $opdeathnum * 0.9); addGenDex($connect, $oppose['no'], $general['crewtype'], $opdeathnum * 0.9);
// 죽은수 기술로 누적 // 죽은수 기술로 누적
$num = round($mydeathnum * 0.01); $num = round($mydeathnum * 0.01);
// 국가보정 // 국가보정
if($nation[type] == 3 || $nation[type] == 13) { $num *= 1.1; } if($nation['type'] == 3 || $nation['type'] == 13) { $num *= 1.1; }
if($nation[type] == 5 || $nation[type] == 6 || $nation[type] == 7 || $nation[type] == 8 || $nation[type] == 12) { $num *= 0.9; } if($nation['type'] == 5 || $nation['type'] == 6 || $nation['type'] == 7 || $nation['type'] == 8 || $nation['type'] == 12) { $num *= 0.9; }
// 부드러운 기술 제한 // 부드러운 기술 제한
if(TechLimit($game[startyear], $game[year], $nation[tech])) { $num = floor($num/4); } if(TechLimit($game['startyear'], $game['year'], $nation['tech'])) { $num = floor($num/4); }
$query = "update nation set totaltech=totaltech+'$num',tech=totaltech/'$gencount' where nation='$nation[nation]'"; $query = "update nation set totaltech=totaltech+'$num',tech=totaltech/'$gencount' where nation='$nation['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 장수 부상 // 장수 부상
$ratio = rand() % 100; $ratio = rand() % 100;
if($ratio >= 95) { if($ratio >= 95) {
$log[count($log)] = "<C>●</>전투중 <R>부상</>당했다!"; $log[count($log)] = "<C>●</>전투중 <R>부상</>당했다!";
$general[injury] += rand() % 71 + 10; // 10 ~ 80 $general['injury'] += rand() % 71 + 10; // 10 ~ 80
if($general[injury] > 80) { $general[injury] = 80; } if($general['injury'] > 80) { $general['injury'] = 80; }
} }
// 병사수 변경 // 병사수 변경
$query = "update general set injury='$general[injury]',crew='$general[crew]',killcrew=killcrew+'$mykillnum',deathcrew=deathcrew+'$mydeathnum' where no='$general[no]'"; $query = "update general set injury='$general['injury']',crew='$general['crew']',killcrew=killcrew+'$mykillnum',deathcrew=deathcrew+'$mydeathnum' where no='$general['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 숙련도 증가 // 숙련도 증가
addGenDex($connect, $general[no], $general[crewtype], $mykillnum); addGenDex($connect, $general['no'], $general['crewtype'], $mykillnum);
addGenDex($connect, $general[no], $oppose[crewtype], $mydeathnum); addGenDex($connect, $general['no'], $oppose['crewtype'], $mydeathnum);
// 죽은수 기술로 누적 // 죽은수 기술로 누적
$num = round($opdeathnum * 0.01); $num = round($opdeathnum * 0.01);
// 국가보정 // 국가보정
if($destnation[type] == 3 || $destnation[type] == 13) { $num *= 1.1; } if($destnation['type'] == 3 || $destnation['type'] == 13) { $num *= 1.1; }
if($destnation[type] == 5 || $destnation[type] == 6 || $destnation[type] == 7 || $destnation[type] == 8 || $destnation[type] == 12) { $num *= 0.9; } if($destnation['type'] == 5 || $destnation['type'] == 6 || $destnation['type'] == 7 || $destnation['type'] == 8 || $destnation['type'] == 12) { $num *= 0.9; }
// 부드러운 기술 제한 // 부드러운 기술 제한
if(TechLimit($game[startyear], $game[year], $destnation[tech])) { $num = floor($num/4); } if(TechLimit($game['startyear'], $game['year'], $destnation['tech'])) { $num = floor($num/4); }
$query = "update nation set totaltech=totaltech+'$num',tech=totaltech/'$destgencount' where nation='$destnation[nation]'"; $query = "update nation set totaltech=totaltech+'$num',tech=totaltech/'$destgencount' where nation='$destnation['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//양국 평균 기술가격 //양국 평균 기술가격
//$techRatio = (getTechCost($nation[tech]) + getTechCost($destnation[tech])) / 2; //$techRatio = (getTechCost($nation['tech']) + getTechCost($destnation['tech'])) / 2;
$techRatio = 1.0; $techRatio = 1.0;
// 죽은수 도시 재정으로 누적 60% // 죽은수 도시 재정으로 누적 60%
$num = round(($mykillnum+$mydeathnum) * 0.6 * $techRatio); $num = round(($mykillnum+$mydeathnum) * 0.6 * $techRatio);
// 국가보정 // 국가보정
if($destnation[type] == 1) { $num *= 1.1; } if($destnation['type'] == 1) { $num *= 1.1; }
if($destnation[type] == 9 || $destnation[type] == 10) { $num *= 0.9; } if($destnation['type'] == 9 || $destnation['type'] == 10) { $num *= 0.9; }
$query = "update city set dead=dead+'$num' where city='$city[city]'"; $query = "update city set dead=dead+'$num' where city='$city['city']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 죽은수 도시 재정으로 누적 40% // 죽은수 도시 재정으로 누적 40%
$num = round(($mykillnum+$mydeathnum) * 0.4 * $techRatio); $num = round(($mykillnum+$mydeathnum) * 0.4 * $techRatio);
// 국가보정 // 국가보정
if($nation[type] == 1) { $num *= 1.1; } if($nation['type'] == 1) { $num *= 1.1; }
if($nation[type] == 9 || $nation[type] == 10) { $num *= 0.9; } if($nation['type'] == 9 || $nation['type'] == 10) { $num *= 0.9; }
$query = "update city set dead=dead+'$num' where city='$general[city]'"; $query = "update city set dead=dead+'$num' where city='$general['city']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 상대 병사 소진이나 쌀 소진시 다음 장수 // 상대 병사 소진이나 쌀 소진시 다음 장수
if($oppose[crew] <= 0 || ($opRice <= round($oppose[crew]/100) && $general[crew] > 0)) { if($oppose['crew'] <= 0 || ($opRice <= round($oppose['crew']/100) && $general['crew'] > 0)) {
if($opRice <= round($oppose[crew]/100)) { if($opRice <= round($oppose['crew']/100)) {
$alllog[count($alllog)] = "<C>●</>{$game[month]}월:<Y>$oppose[name]</>의 ".getTypename($oppose[crewtype])."(이)가 패퇴했습니다."; $alllog[count($alllog)] = "<C>●</>{$game['month']}월:<Y>$oppose['name']</>의 ".getTypename($oppose['crewtype'])."(이)가 패퇴했습니다.";
$log[count($log)] = "<C>●</><Y>$oppose[name]</>의 ".getTypename($oppose[crewtype])."(이)가 패퇴했습니다."; $log[count($log)] = "<C>●</><Y>$oppose['name']</>의 ".getTypename($oppose['crewtype'])."(이)가 패퇴했습니다.";
$opplog[count($opplog)] = "<C>●</>군량 부족으로 패퇴합니다."; $opplog[count($opplog)] = "<C>●</>군량 부족으로 패퇴합니다.";
} else { } else {
$alllog[count($alllog)] = "<C>●</>{$game[month]}월:<Y>$oppose[name]</>의 ".getTypename($oppose[crewtype])."(이)가 전멸했습니다."; $alllog[count($alllog)] = "<C>●</>{$game['month']}월:<Y>$oppose['name']</>의 ".getTypename($oppose['crewtype'])."(이)가 전멸했습니다.";
$log[count($log)] = "<C>●</><Y>$oppose[name]</>의 ".getTypename($oppose[crewtype])."(이)가 전멸했습니다."; $log[count($log)] = "<C>●</><Y>$oppose['name']</>의 ".getTypename($oppose['crewtype'])."(이)가 전멸했습니다.";
$opplog[count($opplog)] = "<C>●</>전멸했습니다."; $opplog[count($opplog)] = "<C>●</>전멸했습니다.";
} }
$opposecount--; $opposecount--;
$general[atmos] *= 1.1; //사기 증가 $general['atmos'] *= 1.1; //사기 증가
if($general[atmos] > $_maximumatmos) { $general[atmos] = $_maximumatmos; } if($general['atmos'] > $_maximumatmos) { $general['atmos'] = $_maximumatmos; }
$query = "update general set atmos='$general[atmos]',killnum=killnum+1 where no='$general[no]'"; $query = "update general set atmos='$general['atmos']',killnum=killnum+1 where no='$general['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$exp2++; $exp2++;
// 상대장수 경험 등등 증가 // 상대장수 경험 등등 증가
$opexp = round($opexp / 50 * 0.8); $opexp = round($opexp / 50 * 0.8);
// 성격 보정 // 성격 보정
$opexp = CharExperience($opexp, $oppose[personal]); $opexp = CharExperience($opexp, $oppose['personal']);
// 쌀 소모 // 쌀 소모
$oppose[rice] -= ($opexp * 5 * getCrewtypeRice($game, $oppose[crewtype], $destnation[tech])); $oppose['rice'] -= ($opexp * 5 * getCrewtypeRice($game, $oppose['crewtype'], $destnation['tech']));
if($oppose[rice] < 0) { $oppose[rice] = 0; } if($oppose['rice'] < 0) { $oppose['rice'] = 0; }
$query = "update general set deathnum=deathnum+1,rice='$oppose[rice]',experience=experience+'$opexp',dedication=dedication+'$opexp' where no='$oppose[no]'"; $query = "update general set deathnum=deathnum+1,rice='$oppose['rice']',experience=experience+'$opexp',dedication=dedication+'$opexp' where no='$oppose['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$opexp = 0; $opexp = 0;
@@ -1334,40 +1334,40 @@ function processWar($connect, $general, $city) {
unset($oppbatlog); unset($oppbatlog);
unset($oppbatres); unset($oppbatres);
// 공격 장수 병사 소진이나 쌀 소진시 실패 처리 // 공격 장수 병사 소진이나 쌀 소진시 실패 처리
} elseif($general[crew] <= 0 || $myRice <= round($general[crew]/100)) { } elseif($general['crew'] <= 0 || $myRice <= round($general['crew']/100)) {
if($myRice <= round($general[crew]/100)) { if($myRice <= round($general['crew']/100)) {
$alllog[count($alllog)] = "<C>●</>{$game[month]}월:<Y>$general[name]</>의 ".getTypename($general[crewtype])."(이)가 퇴각했습니다."; $alllog[count($alllog)] = "<C>●</>{$game['month']}월:<Y>$general['name']</>의 ".getTypename($general['crewtype'])."(이)가 퇴각했습니다.";
$log[count($log)] = "<C>●</>군량 부족으로 퇴각합니다."; $log[count($log)] = "<C>●</>군량 부족으로 퇴각합니다.";
$opplog[count($opplog)] = "<C>●</><Y>$general[name]</>의 ".getTypename($general[crewtype])."(이)가 퇴각했습니다."; $opplog[count($opplog)] = "<C>●</><Y>$general['name']</>의 ".getTypename($general['crewtype'])."(이)가 퇴각했습니다.";
} else { } else {
$alllog[count($alllog)] = "<C>●</>{$game[month]}월:<Y>$general[name]</>의 ".getTypename($general[crewtype])."(이)가 퇴각했습니다."; $alllog[count($alllog)] = "<C>●</>{$game['month']}월:<Y>$general['name']</>의 ".getTypename($general['crewtype'])."(이)가 퇴각했습니다.";
$log[count($log)] = "<C>●</>퇴각했습니다."; $log[count($log)] = "<C>●</>퇴각했습니다.";
$opplog[count($opplog)] = "<C>●</><Y>$general[name]</>의 ".getTypename($general[crewtype])."(이)가 퇴각했습니다."; $opplog[count($opplog)] = "<C>●</><Y>$general['name']</>의 ".getTypename($general['crewtype'])."(이)가 퇴각했습니다.";
} }
// 경험치 상승 // 경험치 상승
if(floor($oppose[crewtype]/10) == 3) { // 귀병 if(floor($oppose['crewtype']/10) == 3) { // 귀병
$oppose[intel2]++; $oppose[intel2]++;
} elseif(floor($oppose[crewtype]/10) == 4) { // 차병 } elseif(floor($oppose['crewtype']/10) == 4) { // 차병
$oppose[leader2]++; $oppose[leader2]++;
} else { } else {
$oppose[power2]++; $oppose[power2]++;
} }
$oppose[atmos] *= 1.1; //사기 증가 $oppose['atmos'] *= 1.1; //사기 증가
if($oppose[atmos] > $_maximumatmos) { $oppose[atmos] = $_maximumatmos; } if($oppose['atmos'] > $_maximumatmos) { $oppose['atmos'] = $_maximumatmos; }
// 상대장수 경험 등등 증가 // 상대장수 경험 등등 증가
$opexp = round($opexp / 50 * 0.8); $opexp = round($opexp / 50 * 0.8);
// 성격 보정 // 성격 보정
$opexp = CharExperience($opexp, $oppose[personal]); $opexp = CharExperience($opexp, $oppose['personal']);
// 쌀 소모 // 쌀 소모
$oppose[rice] -= ($opexp * 5 * getCrewtypeRice($game, $oppose[crewtype], $destnation[tech])); $oppose['rice'] -= ($opexp * 5 * getCrewtypeRice($game, $oppose['crewtype'], $destnation['tech']));
if($oppose[rice] < 0) { $oppose[rice] = 0; } if($oppose['rice'] < 0) { $oppose['rice'] = 0; }
$query = "update general set rice='$oppose[rice]',leader2='$oppose[leader2]',power2='$oppose[power2]',intel2='$oppose[intel2]',atmos='$oppose[atmos]',experience=experience+'$opexp',dedication=dedication+'$opexp',killnum=killnum+1 where no='$oppose[no]'"; $query = "update general set rice='$oppose['rice']',leader2='$oppose[leader2]',power2='$oppose[power2]',intel2='$oppose[intel2]',atmos='$oppose['atmos']',experience=experience+'$opexp',dedication=dedication+'$opexp',killnum=killnum+1 where no='$oppose['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update general set deathnum=deathnum+1 where no='$general[no]'"; $query = "update general set deathnum=deathnum+1 where no='$general['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$opexp = 0; $opexp = 0;
@@ -1378,8 +1378,8 @@ function processWar($connect, $general, $city) {
unset($opplog); unset($opplog);
unset($oppbatlog); unset($oppbatlog);
unset($oppbatres); unset($oppbatres);
// $alllog[count($alllog)] = "<C>●</>{$game[month]}월:<Y>$general[name]</>(이)가 }<G>$city[name]</> 공략에 실패했습니다. <1>$date</>"; // $alllog[count($alllog)] = "<C>●</>{$game['month']}월:<Y>$general['name']</>(이)가 }<G>$city['name']</> 공략에 실패했습니다. <1>$date</>";
// $log[count($log)] = "<C>●</> <G>$city[name]</> 공략에 실패했습니다. <1>$date</>"; // $log[count($log)] = "<C>●</> <G>$city['name']</> 공략에 실패했습니다. <1>$date</>";
break; break;
} else { } else {
// 무승부일때 로그 남김 // 무승부일때 로그 남김
@@ -1396,34 +1396,34 @@ function processWar($connect, $general, $city) {
// 상대장수 경험 등등 증가(페이즈 초과시) // 상대장수 경험 등등 증가(페이즈 초과시)
$opexp = round($opexp / 50 * 0.8); $opexp = round($opexp / 50 * 0.8);
// 성격 보정 // 성격 보정
$opexp = CharExperience($opexp, $oppose[personal]); $opexp = CharExperience($opexp, $oppose['personal']);
// 쌀 소모 // 쌀 소모
$oppose[rice] -= ($opexp * 5 * getCrewtypeRice($game, $oppose[crewtype], $destnation[tech])); $oppose['rice'] -= ($opexp * 5 * getCrewtypeRice($game, $oppose['crewtype'], $destnation['tech']));
if($oppose[rice] < 0) { $oppose[rice] = 0; } if($oppose['rice'] < 0) { $oppose['rice'] = 0; }
$query = "update general set rice='$oppose[rice]',experience=experience+'$opexp',dedication=dedication+'$opexp' where no='$oppose[no]'"; $query = "update general set rice='$oppose['rice']',experience=experience+'$opexp',dedication=dedication+'$opexp' where no='$oppose['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 경험치 상승 // 경험치 상승
if(floor($general[crewtype]/10) == 3) { // 귀병 if(floor($general['crewtype']/10) == 3) { // 귀병
$general[intel2] += $exp2; $general[intel2] += $exp2;
} elseif(floor($general[crewtype]/10) == 4) { // 차병 } elseif(floor($general['crewtype']/10) == 4) { // 차병
$general[leader2] += $exp2; $general[leader2] += $exp2;
} else { } else {
$general[power2] += $exp2; $general[power2] += $exp2;
} }
$query = "update general set leader2='$general[leader2]',power2='$general[power2]',intel2='$general[intel2]' where no='$general[no]'"; $query = "update general set leader2='$general[leader2]',power2='$general[power2]',intel2='$general[intel2]' where no='$general['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 공헌, 명성 상승 // 공헌, 명성 상승
$exp = round($exp / 50); $exp = round($exp / 50);
// 성격 보정 // 성격 보정
$exp = CharExperience($exp, $general[personal]); $exp = CharExperience($exp, $general['personal']);
// 쌀 소모 // 쌀 소모
$general[rice] -= ($exp * 5 * getCrewtypeRice($game, $general[crewtype], $nation[tech])); $general['rice'] -= ($exp * 5 * getCrewtypeRice($game, $general['crewtype'], $nation['tech']));
if($general[rice] < 0) { $general[rice] = 0; } if($general['rice'] < 0) { $general['rice'] = 0; }
$query = "update general set rice='$general[rice]',dedication=dedication+'$exp',experience=experience+'$exp' where no='$general[no]'"; $query = "update general set rice='$general['rice']',dedication=dedication+'$exp',experience=experience+'$exp' where no='$general['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$log = checkAbility($connect, $general, $log); $log = checkAbility($connect, $general, $log);
@@ -1476,14 +1476,14 @@ function getCrewtypeRice($game, $crewtype, $tech) {
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
function getAtt($game, $general, $tech, $lbonus) { function getAtt($game, $general, $tech, $lbonus) {
$att = getRate($game, $general[crewtype], "att") + getTechAbil($tech); $att = getRate($game, $general['crewtype'], "att") + getTechAbil($tech);
if(floor($general[crewtype]/10) == 3) { // 귀병 지100% if(floor($general['crewtype']/10) == 3) { // 귀병 지100%
$ratio = (floor($general[intel]*(100-$general[injury])/100)+getBookEff($general[book]))*2 - 40; $ratio = (floor($general['intel']*(100-$general['injury'])/100)+getBookEff($general['book']))*2 - 40;
} elseif(floor($general[crewtype]/10) == 4) { // 차병 통100% } elseif(floor($general['crewtype']/10) == 4) { // 차병 통100%
$ratio = (floor($general[leader]*(100-$general[injury])/100)+getHorseEff($general[horse])+$lbonus)*2 - 40; $ratio = (floor($general['leader']*(100-$general['injury'])/100)+getHorseEff($general['horse'])+$lbonus)*2 - 40;
} else { } else {
$ratio = (floor($general[power]*(100-$general[injury])/100)+getWeapEff($general[weap]))*2 - 40; //10일때 -20, 70일때 100, 100일때 160 $ratio = (floor($general['power']*(100-$general['injury'])/100)+getWeapEff($general['weap']))*2 - 40; //10일때 -20, 70일때 100, 100일때 160
} }
if($ratio < 10) { $ratio = 10; } if($ratio < 10) { $ratio = 10; }
if($ratio > 100) { $ratio = 50 + $ratio/2; } // 100보다 큰 경우는 상승률 1/2 if($ratio > 100) { $ratio = 50 + $ratio/2; } // 100보다 큰 경우는 상승률 1/2
@@ -1493,21 +1493,21 @@ function getAtt($game, $general, $tech, $lbonus) {
} }
function getDef($game, $general, $tech) { function getDef($game, $general, $tech) {
$def = getRate($game, $general[crewtype], "def") + getTechAbil($tech); $def = getRate($game, $general['crewtype'], "def") + getTechAbil($tech);
$crew = ($general[crew] / (7000 / 30)) + 70; // 5000명일때 91점 7000명일때 100점 10000명일때 113점 $crew = ($general['crew'] / (7000 / 30)) + 70; // 5000명일때 91점 7000명일때 100점 10000명일때 113점
$def = $def * $crew / 100; $def = $def * $crew / 100;
return $def; return $def;
} }
function getCityAtt($city) { function getCityAtt($city) {
$att = ($city[def]*0.1 + $city[wall]*0.9) / 500 + 200; //50000일때 300점 100000일때 400점 $att = ($city['def']*0.1 + $city['wall']*0.9) / 500 + 200; //50000일때 300점 100000일때 400점
return $att; return $att;
} }
function getCityDef($city) { function getCityDef($city) {
$def = ($city[def]*0.1 + $city[wall]*0.9) / 500 + 200; $def = ($city['def']*0.1 + $city['wall']*0.9) / 500 + 200;
return $def; return $def;
} }
@@ -1521,11 +1521,11 @@ function addConflict($connect, $city, $nationnum, $mykillnum) {
$result = MYDB_query($query, $connect) or Error("addConflict ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("addConflict ".MYDB_error($connect),"");
$game = MYDB_fetch_array($result); $game = MYDB_fetch_array($result);
if($city[conflict] == "") { if($city['conflict'] == "") {
unset($nationlist); unset($nationlist);
unset($killnum); unset($killnum);
} else { } else {
$nationlist = explode("|", $city[conflict]); $nationlist = explode("|", $city['conflict']);
$killnum = explode("|", $city[conflict2]); $killnum = explode("|", $city[conflict2]);
} }
@@ -1537,20 +1537,20 @@ function addConflict($connect, $city, $nationnum, $mykillnum) {
$result = MYDB_query($query, $connect) or Error("addConflict ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("addConflict ".MYDB_error($connect),"");
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
$history[count($history)] = "<C>●</>{$game[year]}{$game[month]}월:<M><b>【분쟁】</b></><D><b>$nation[name]</b></>(이)가 <G><b>$city[name]</b></> 공략에 가담하여 분쟁이 발생하고 있습니다."; $history[count($history)] = "<C>●</>{$game['year']}{$game['month']}월:<M><b>【분쟁】</b></><D><b>$nation['name']</b></>(이)가 <G><b>$city['name']</b></> 공략에 가담하여 분쟁이 발생하고 있습니다.";
pushHistory($connect, $history); pushHistory($connect, $history);
} }
$nationlist[$i] = $nationnum; $nationlist[$i] = $nationnum;
if($i == 0 || $city[def] == 0) { // 선타, 막타 보너스 if($i == 0 || $city['def'] == 0) { // 선타, 막타 보너스
$killnum[$i] += round($mykillnum * 1.05); $killnum[$i] += round($mykillnum * 1.05);
} else { } else {
$killnum[$i] += $mykillnum; $killnum[$i] += $mykillnum;
} }
$city[conflict] = implode("|", $nationlist); $city['conflict'] = implode("|", $nationlist);
$city[conflict2] = implode("|", $killnum); $city[conflict2] = implode("|", $killnum);
$query = "update city set conflict='$city[conflict]',conflict2='$city[conflict2]' where city='$city[city]'"; $query = "update city set conflict='$city['conflict']',conflict2='$city[conflict2]' where city='$city['city']'";
MYDB_query($query, $connect) or Error("addConflict ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("addConflict ".MYDB_error($connect),"");
return $city; return $city;
@@ -1565,8 +1565,8 @@ function DeleteConflict($connect, $nation) {
for($k=0; $k < $cityNum; $k++) { for($k=0; $k < $cityNum; $k++) {
$city = MYDB_fetch_array($result); $city = MYDB_fetch_array($result);
if(strpos($city[conflict], $nation)) { if(strpos($city['conflict'], $nation)) {
$nationlist = explode("|", $city[conflict]); $nationlist = explode("|", $city['conflict']);
$killnum = explode("|", $city[conflict2]); $killnum = explode("|", $city[conflict2]);
$count = count($nationlist); $count = count($nationlist);
@@ -1580,14 +1580,14 @@ function DeleteConflict($connect, $nation) {
$conflict = implode("|", $nationlist); $conflict = implode("|", $nationlist);
$conflict2 = implode("|", $killnum); $conflict2 = implode("|", $killnum);
$query = "update city set conflict='$conflict',conflict2='$conflict2' where city='$city[city]'"; $query = "update city set conflict='$conflict',conflict2='$conflict2' where city='$city['city']'";
MYDB_query($query, $connect) or Error("addConflict ".MYDB_error($connect),""); MYDB_query($query, $connect) or Error("addConflict ".MYDB_error($connect),"");
} }
} }
} }
function getConquerNation($connect, $city) { function getConquerNation($connect, $city) {
$nationlist = explode("|", $city[conflict]); $nationlist = explode("|", $city['conflict']);
$killnum = explode("|", $city[conflict2]); $killnum = explode("|", $city[conflict2]);
$max = 0; $max = 0;
@@ -1603,138 +1603,138 @@ function getConquerNation($connect, $city) {
function ConquerCity($connect, $game, $general, $city, $nation, $destnation) { function ConquerCity($connect, $game, $general, $city, $nation, $destnation) {
global $_armperphase, $_maximumatmos, $_basegold, $_baserice; global $_armperphase, $_maximumatmos, $_basegold, $_baserice;
if($destnation[nation] > 0) { if($destnation['nation'] > 0) {
$destnationName = "<D><b>$destnation[name]</b></>의"; $destnationName = "<D><b>$destnation['name']</b></>의";
} else { } else {
$destnationName = "공백지인"; $destnationName = "공백지인";
} }
$alllog[count($alllog)] = "<C>●</>{$game[month]}월:<Y>$general[name]</>(이)가 <G><b>$city[name]</b></> 공략에 <S>성공</>했습니다."; $alllog[count($alllog)] = "<C>●</>{$game['month']}월:<Y>$general['name']</>(이)가 <G><b>$city['name']</b></> 공략에 <S>성공</>했습니다.";
$log[count($log)] = "<C>●</><G><b>$city[name]</b></> 공략에 <S>성공</>했습니다."; $log[count($log)] = "<C>●</><G><b>$city['name']</b></> 공략에 <S>성공</>했습니다.";
$history[count($history)] = "<C>●</>{$game[year]}{$game[month]}월:<S><b>【지배】</b></><D><b>$nation[name]</b></>(이)가 <G><b>$city[name]</b></>(을)를 지배했습니다."; $history[count($history)] = "<C>●</>{$game['year']}{$game['month']}월:<S><b>【지배】</b></><D><b>$nation['name']</b></>(이)가 <G><b>$city['name']</b></>(을)를 지배했습니다.";
$general = addHistory($connect, $general, "<C>●</>{$game[year]}{$game[month]}월:<G><b>$city[name]</b></>(을)를 <S>함락</>시킴"); $general = addHistory($connect, $general, "<C>●</>{$game['year']}{$game['month']}월:<G><b>$city['name']</b></>(을)를 <S>함락</>시킴");
$nation = addNationHistory($connect, $nation, "<C>●</>{$game[year]}{$game[month]}월:<Y>$general[name]</>(이)가 {$destnationName} <G><b>$city[name]</b></>(을)를 <S>점령</>"); $nation = addNationHistory($connect, $nation, "<C>●</>{$game['year']}{$game['month']}월:<Y>$general['name']</>(이)가 {$destnationName} <G><b>$city['name']</b></>(을)를 <S>점령</>");
$destnation = addNationHistory($connect, $destnation, "<C>●</>{$game[year]}{$game[month]}월:<D><b>$nation[name]</b></>의 <Y>$general[name]</>에 의해 <G><b>$city[name]</b></>(이)가 <O>함락</>"); $destnation = addNationHistory($connect, $destnation, "<C>●</>{$game['year']}{$game['month']}월:<D><b>$nation['name']</b></>의 <Y>$general['name']</>에 의해 <G><b>$city['name']</b></>(이)가 <O>함락</>");
$query = "select city from city where nation='$city[nation]'"; $query = "select city from city where nation='$city['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($result); $citycount = MYDB_num_rows($result);
// 국가 멸망시 // 국가 멸망시
if($citycount == 1 && $city[nation] != 0) { if($citycount == 1 && $city['nation'] != 0) {
$query = "select nation,name,history,tech,type from nation where nation='$nation[nation]'"; $query = "select nation,name,history,tech,type from nation where nation='$nation['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
$query = "select nation,name,gold,rice from nation where nation='$city[nation]'"; $query = "select nation,name,gold,rice from nation where nation='$city['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$losenation = MYDB_fetch_array($result); $losenation = MYDB_fetch_array($result);
$history[count($history)] = "<C>●</>{$game[year]}{$game[month]}월:<R><b>【멸망】</b></><D><b>$losenation[name]</b></>(이)가 멸망하였습니다."; $history[count($history)] = "<C>●</>{$game['year']}{$game['month']}월:<R><b>【멸망】</b></><D><b>$losenation['name']</b></>(이)가 멸망하였습니다.";
$nation = addNationHistory($connect, $nation, "<C>●</>{$game[year]}{$game[month]}월:<D><b>$losenation[name]</b></>(을)를 정복"); $nation = addNationHistory($connect, $nation, "<C>●</>{$game['year']}{$game['month']}월:<D><b>$losenation['name']</b></>(을)를 정복");
$query = "select no from general where nation='$general[nation]' and level='12'"; $query = "select no from general where nation='$general['nation']' and level='12'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$ruler = MYDB_fetch_array($result); $ruler = MYDB_fetch_array($result);
//다굴치는 나라들 전방설정을 위해 미리 얻어옴 //다굴치는 나라들 전방설정을 위해 미리 얻어옴
$query = "select you from diplomacy where me='$losenation[nation]' and state<2"; $query = "select you from diplomacy where me='$losenation['nation']' and state<2";
$dipResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $dipResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$dipCount = MYDB_num_rows($dipResult); $dipCount = MYDB_num_rows($dipResult);
$loseGeneralGold = 0; $loseGeneralGold = 0;
$loseGeneralRice = 0; $loseGeneralRice = 0;
//멸망국 장수들 역사 기록 및 로그 전달 //멸망국 장수들 역사 기록 및 로그 전달
$query = "select no,name,nation,npc,gold,rice,history,msgindex from general where nation='$city[nation]'"; $query = "select no,name,nation,npc,gold,rice,history,msgindex from general where nation='$city['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result); $gencount = MYDB_num_rows($result);
$genlog[0] = "<C>●</><D><b>$losenation[name]</b></>(이)가 <R>멸망</>했습니다."; $genlog[0] = "<C>●</><D><b>$losenation['name']</b></>(이)가 <R>멸망</>했습니다.";
for($i=0; $i < $gencount; $i++) { for($i=0; $i < $gencount; $i++) {
$gen = MYDB_fetch_array($result); $gen = MYDB_fetch_array($result);
$loseGold = floor($gen[gold] * (rand()%30+20)/100.0); $loseGold = floor($gen['gold'] * (rand()%30+20)/100.0);
$loseRice = floor($gen[rice] * (rand()%30+20)/100.0); $loseRice = floor($gen['rice'] * (rand()%30+20)/100.0);
$genlog[1] = "<C>●</>도주하며 금<C>$loseGold</> 쌀<C>$loseRice</>을 분실했습니다."; $genlog[1] = "<C>●</>도주하며 금<C>$loseGold</> 쌀<C>$loseRice</>을 분실했습니다.";
$query = "update general set gold=gold-{$loseGold},rice=rice-{$loseRice} where no={$gen[no]}"; $query = "update general set gold=gold-{$loseGold},rice=rice-{$loseRice} where no={$gen['no']}";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
pushGenLog($gen, $genlog); pushGenLog($gen, $genlog);
$gen = addHistory($connect, $gen, "<C>●</>{$game[year]}{$game[month]}월:<D><b>$losenation[name]</b></>(이)가 <R>멸망</>"); $gen = addHistory($connect, $gen, "<C>●</>{$game['year']}{$game['month']}월:<D><b>$losenation['name']</b></>(이)가 <R>멸망</>");
$loseGeneralGold += $loseGold; $loseGeneralGold += $loseGold;
$loseGeneralRice += $loseRice; $loseGeneralRice += $loseRice;
//모두 등용장 발부 //모두 등용장 발부
if($nation[name] == "강족" || $nation[name] == "저족" || $nation[name] == "흉노족" if($nation['name'] == "강족" || $nation['name'] == "저족" || $nation['name'] == "흉노족"
|| $nation[name] == "남만족" || $nation[name] == "산월족" || $nation[name] == "오환족" || $nation['name'] == "남만족" || $nation['name'] == "산월족" || $nation['name'] == "오환족"
|| $nation[name] == "왜족") { || $nation['name'] == "왜족") {
//등용장 미발부 //등용장 미발부
} elseif(rand() % 100 < 50) { } elseif(rand() % 100 < 50) {
ScoutMsg($connect, $ruler[no], $nation[name], $gen[no], $gen[msgindex]); ScoutMsg($connect, $ruler['no'], $nation['name'], $gen['no'], $gen['msgindex']);
} }
//NPC인 경우 10% 확률로 임관(엔장, 인재, 의병) //NPC인 경우 10% 확률로 임관(엔장, 인재, 의병)
if($gen[npc] >= 2 && $gen[npc] <= 4 && rand() % 100 < 10) { if($gen['npc'] >= 2 && $gen['npc'] <= 4 && rand() % 100 < 10) {
$commissionCommand = EncodeCommand(0, 0, $nation[nation], 25); //임관 $commissionCommand = EncodeCommand(0, 0, $nation['nation'], 25); //임관
$query = "update general set turn0='$commissionCommand' where no={$gen[no]}"; $query = "update general set turn0='$commissionCommand' where no={$gen['no']}";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
} }
unset($genlog[1]); unset($genlog[1]);
// 승전국 보상 // 승전국 보상
$losenation[gold] -= $_basegold; $losenation['gold'] -= $_basegold;
$losenation[rice] -= $_baserice; $losenation['rice'] -= $_baserice;
if($losenation[gold] < 0) { $losenation[gold] = 0; } if($losenation['gold'] < 0) { $losenation['gold'] = 0; }
if($losenation[rice] < 0) { $losenation[rice] = 0; } if($losenation['rice'] < 0) { $losenation['rice'] = 0; }
$losenation[gold] += $loseGeneralGold; $losenation['gold'] += $loseGeneralGold;
$losenation[rice] += $loseGeneralRice; $losenation['rice'] += $loseGeneralRice;
$losenation[gold] = floor($losenation[gold] / 2); $losenation['gold'] = floor($losenation['gold'] / 2);
$losenation[rice] = floor($losenation[gold] / 2); $losenation['rice'] = floor($losenation['gold'] / 2);
// 기본량 제외 금쌀50% + 장수들 분실 금쌀50% 흡수 // 기본량 제외 금쌀50% + 장수들 분실 금쌀50% 흡수
$query = "update nation set gold=gold+'$losenation[gold]',rice=rice+'$losenation[rice]' where nation='$general[nation]'"; $query = "update nation set gold=gold+'$losenation['gold']',rice=rice+'$losenation['rice']' where nation='$general['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//아국 수뇌부에게 로그 전달 //아국 수뇌부에게 로그 전달
$query = "select no,name,nation from general where nation='$general[nation]' and level>='9'"; $query = "select no,name,nation from general where nation='$general['nation']' and level>='9'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result); $gencount = MYDB_num_rows($result);
$genlog[0] = "<C>●</><D><b>$losenation[name]</b></> 정복으로 금<C>$losenation[gold]</> 쌀<C>$losenation[rice]</>을 획득했습니다."; $genlog[0] = "<C>●</><D><b>$losenation['name']</b></> 정복으로 금<C>$losenation['gold']</> 쌀<C>$losenation['rice']</>을 획득했습니다.";
for($i=0; $i < $gencount; $i++) { for($i=0; $i < $gencount; $i++) {
$gen = MYDB_fetch_array($result); $gen = MYDB_fetch_array($result);
pushGenLog($gen, $genlog); pushGenLog($gen, $genlog);
} }
//분쟁기록 모두 지움 //분쟁기록 모두 지움
DeleteConflict($connect, $city[nation]); DeleteConflict($connect, $city['nation']);
// 전 장수 공헌 명성치 깎음 // 전 장수 공헌 명성치 깎음
$query = "update general set dedication=dedication*0.5,experience=experience*0.9 where nation='$city[nation]'"; $query = "update general set dedication=dedication*0.5,experience=experience*0.9 where nation='$city['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 전 도시 공백지로 // 전 도시 공백지로
$query = "update city set nation='0',gen1='0',gen2='0',gen3='0',conflict='',conflict2='',term=0 where nation='$city[nation]'"; $query = "update city set nation='0',gen1='0',gen2='0',gen3='0',conflict='',conflict2='',term=0 where nation='$city['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 전 장수 소속 무소속으로, 재야로, 부대 탈퇴 // 전 장수 소속 무소속으로, 재야로, 부대 탈퇴
$query = "update general set nation='0',belong='0',level='0',troop='0' where nation='$city[nation]'"; $query = "update general set nation='0',belong='0',level='0',troop='0' where nation='$city['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 부대도 삭제 // 부대도 삭제
$query = "delete from troop where nation='$city[nation]'"; $query = "delete from troop where nation='$city['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 외교 삭제 // 외교 삭제
$query = "delete from diplomacy where me='$city[nation]' or you='$city[nation]'"; $query = "delete from diplomacy where me='$city['nation']' or you='$city['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 국가 삭제 // 국가 삭제
$query = "delete from nation where nation='$city[nation]'"; $query = "delete from nation where nation='$city['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
// 아까 얻어온 다굴국들 전방설정 // 아까 얻어온 다굴국들 전방설정
for($i=0; $i < $dipCount; $i++) { for($i=0; $i < $dipCount; $i++) {
$dip = MYDB_fetch_array($dipResult); $dip = MYDB_fetch_array($dipResult);
//전방설정 //전방설정
SetNationFront($connect, $dip[you]); SetNationFront($connect, $dip['you']);
} }
// 멸망이 아니면 // 멸망이 아니면
} else { } else {
@@ -1746,32 +1746,32 @@ function ConquerCity($connect, $game, $general, $city, $nation, $destnation) {
$query = "update general set level='1' where no='$city[gen3]'"; $query = "update general set level='1' where no='$city[gen3]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//수도였으면 긴급 천도 //수도였으면 긴급 천도
if($destnation[capital] == $city[city]) { if($destnation['capital'] == $city['city']) {
$dist = distance($connect, $city[city]); $dist = distance($connect, $city['city']);
$query = "select city,name,pop from city where nation='$destnation[nation]' and city!='$city[city]'"; $query = "select city,name,pop from city where nation='$destnation['nation']' and city!='$city['city']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$cityCount = MYDB_num_rows($result); $cityCount = MYDB_num_rows($result);
$minDist = 99; $minCity = 0; $minCityPop = 0; $minDist = 99; $minCity = 0; $minCityPop = 0;
for($i=0; $i < $cityCount; $i++) { for($i=0; $i < $cityCount; $i++) {
$nextCap = MYDB_fetch_array($result); $nextCap = MYDB_fetch_array($result);
if($minDist > $dist[$nextCap[city]]) { if($minDist > $dist[$nextCap['city']]) {
$minDist = $dist[$nextCap[city]]; $minDist = $dist[$nextCap['city']];
$minCity = $nextCap[city]; $minCity = $nextCap['city'];
$minCityPop = $nextCap[pop]; $minCityPop = $nextCap['pop'];
$minCityName = $nextCap[name]; $minCityName = $nextCap['name'];
} elseif($minDist == $dist[$nextCap[city]] && $minCityPop < $nextCap[pop]) { } elseif($minDist == $dist[$nextCap['city']] && $minCityPop < $nextCap['pop']) {
$minDist = $dist[$nextCap[city]]; $minDist = $dist[$nextCap['city']];
$minCity = $nextCap[city]; $minCity = $nextCap['city'];
$minCityPop = $nextCap[pop]; $minCityPop = $nextCap['pop'];
$minCityName = $nextCap[name]; $minCityName = $nextCap['name'];
} }
} }
$history[count($history)] = "<C>●</>{$game[year]}{$game[month]}월:<M><b>【긴급천도】</b></><D><b>$destnation[name]</b></>(이)가 수도가 함락되어 <G><b>$minCityName</b></>으로 긴급천도하였습니다."; $history[count($history)] = "<C>●</>{$game['year']}{$game['month']}월:<M><b>【긴급천도】</b></><D><b>$destnation['name']</b></>(이)가 수도가 함락되어 <G><b>$minCityName</b></>으로 긴급천도하였습니다.";
//아국 수뇌부에게 로그 전달 //아국 수뇌부에게 로그 전달
$query = "select no,name,nation from general where nation='$destnation[nation]' and level>='5'"; $query = "select no,name,nation from general where nation='$destnation['nation']' and level>='5'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result); $gencount = MYDB_num_rows($result);
$genlog[0] = "<C>●</>수도가 함락되어 <G><b>$minCityName</b></>으로 <M>긴급천도</>합니다."; $genlog[0] = "<C>●</>수도가 함락되어 <G><b>$minCityName</b></>으로 <M>긴급천도</>합니다.";
@@ -1780,63 +1780,63 @@ function ConquerCity($connect, $game, $general, $city, $nation, $destnation) {
pushGenLog($gen, $genlog); pushGenLog($gen, $genlog);
} }
//천도 //천도
$query = "update nation set capital='$minCity',gold=gold*0.5,rice=rice*0.5 where nation='$destnation[nation]'"; $query = "update nation set capital='$minCity',gold=gold*0.5,rice=rice*0.5 where nation='$destnation['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//보급도시로 만듬 //보급도시로 만듬
$query = "update city set supply=1 where city='$minCity'"; $query = "update city set supply=1 where city='$minCity'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//수뇌부 이동 //수뇌부 이동
$query = "update general set city='$minCity' where nation='$destnation[nation]' and level>='5'"; $query = "update general set city='$minCity' where nation='$destnation['nation']' and level>='5'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//장수 사기 감소 //장수 사기 감소
$query = "update general set atmos=atmos*0.8 where nation='$destnation[nation]'"; $query = "update general set atmos=atmos*0.8 where nation='$destnation['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
} }
$general[atmos] *= 1.1; //사기 증가 $general['atmos'] *= 1.1; //사기 증가
if($general[atmos] > $_maximumatmos) { $general[atmos] = $_maximumatmos; } if($general['atmos'] > $_maximumatmos) { $general['atmos'] = $_maximumatmos; }
$conquerNation = getConquerNation($connect, $city); $conquerNation = getConquerNation($connect, $city);
if($conquerNation == $general[nation]) { if($conquerNation == $general['nation']) {
// 이동 및 사기 변경 // 이동 및 사기 변경
$query = "update general set city='$city[city]',atmos='$general[atmos]',killnum=killnum+1 where no='$general[no]'"; $query = "update general set city='$city['city']',atmos='$general['atmos']',killnum=killnum+1 where no='$general['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
if($city[level] > 3) { if($city['level'] > 3) {
// 도시 소속 변경, 태수,군사,시중 초기화 // 도시 소속 변경, 태수,군사,시중 초기화
$query = "update city set supply=1,conflict='',term=0,conflict2='',agri=agri*0.7,comm=comm*0.7,secu=secu*0.7,def=1000,wall=1000,nation='$general[nation]',gen1=0,gen2=0,gen3=0 where city='$city[city]'"; $query = "update city set supply=1,conflict='',term=0,conflict2='',agri=agri*0.7,comm=comm*0.7,secu=secu*0.7,def=1000,wall=1000,nation='$general['nation']',gen1=0,gen2=0,gen3=0 where city='$city['city']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else { } else {
// 도시 소속 변경, 태수,군사,시중 초기화 // 도시 소속 변경, 태수,군사,시중 초기화
$query = "update city set supply=1,conflict='',term=0,conflict2='',agri=agri*0.7,comm=comm*0.7,secu=secu*0.7,def=def2/2,wall=wall2/2,nation='$general[nation]',gen1=0,gen2=0,gen3=0 where city='$city[city]'"; $query = "update city set supply=1,conflict='',term=0,conflict2='',agri=agri*0.7,comm=comm*0.7,secu=secu*0.7,def=def2/2,wall=wall2/2,nation='$general['nation']',gen1=0,gen2=0,gen3=0 where city='$city['city']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
//전방설정 //전방설정
SetNationFront($connect, $nation[nation]); SetNationFront($connect, $nation['nation']);
SetNationFront($connect, $destnation[nation]); SetNationFront($connect, $destnation['nation']);
} else { } else {
$query = "select name,nation,history from nation where nation='$conquerNation'"; $query = "select name,nation,history from nation where nation='$conquerNation'";
$conquerResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $conquerResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$conquerNationArray = MYDB_fetch_array($conquerResult); $conquerNationArray = MYDB_fetch_array($conquerResult);
$history[count($history)] = "<C>●</>{$game[year]}{$game[month]}월:<Y><b>【분쟁협상】</b></><D><b>$conquerNationArray[name]</b></>(이)가 영토분쟁에서 우위를 점하여 <G><b>$city[name]</b></>(을)를 양도받았습니다."; $history[count($history)] = "<C>●</>{$game['year']}{$game['month']}월:<Y><b>【분쟁협상】</b></><D><b>$conquerNationArray['name']</b></>(이)가 영토분쟁에서 우위를 점하여 <G><b>$city['name']</b></>(을)를 양도받았습니다.";
$nation = addNationHistory($connect, $nation, "<C>●</>{$game[year]}{$game[month]}월:<G><b>$city[name]</b></>(을)를 <D><b>$conquerNationArray[name]</b></>에 <Y>양도</>"); $nation = addNationHistory($connect, $nation, "<C>●</>{$game['year']}{$game['month']}월:<G><b>$city['name']</b></>(을)를 <D><b>$conquerNationArray['name']</b></>에 <Y>양도</>");
$conquerNationArray = addNationHistory($connect, $conquerNationArray, "<C>●</>{$game[year]}{$game[month]}월:<D><b>$nation[name]</b></>에서 <G><b>$city[name]</b></>(을)를 <S>양도</> 받음"); $conquerNationArray = addNationHistory($connect, $conquerNationArray, "<C>●</>{$game['year']}{$game['month']}월:<D><b>$nation['name']</b></>에서 <G><b>$city['name']</b></>(을)를 <S>양도</> 받음");
// 이동X 및 사기 변경 // 이동X 및 사기 변경
$query = "update general set atmos='$general[atmos]',killnum=killnum+1 where no='$general[no]'"; $query = "update general set atmos='$general['atmos']',killnum=killnum+1 where no='$general['no']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
if($city[level] > 3) { if($city['level'] > 3) {
// 도시 소속 변경, 태수,군사,시중 초기화 // 도시 소속 변경, 태수,군사,시중 초기화
$query = "update city set supply=1,conflict='',term=0,conflict2='',agri=agri*0.7,comm=comm*0.7,secu=secu*0.7,def=1000,wall=1000,nation='$conquerNation',gen1=0,gen2=0,gen3=0 where city='$city[city]'"; $query = "update city set supply=1,conflict='',term=0,conflict2='',agri=agri*0.7,comm=comm*0.7,secu=secu*0.7,def=1000,wall=1000,nation='$conquerNation',gen1=0,gen2=0,gen3=0 where city='$city['city']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else { } else {
// 도시 소속 변경, 태수,군사,시중 초기화 // 도시 소속 변경, 태수,군사,시중 초기화
$query = "update city set supply=1,conflict='',term=0,conflict2='',agri=agri*0.7,comm=comm*0.7,secu=secu*0.7,def=def2/2,wall=wall2/2,nation='$conquerNation',gen1=0,gen2=0,gen3=0 where city='$city[city]'"; $query = "update city set supply=1,conflict='',term=0,conflict2='',agri=agri*0.7,comm=comm*0.7,secu=secu*0.7,def=def2/2,wall=wall2/2,nation='$conquerNation',gen1=0,gen2=0,gen3=0 where city='$city['city']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
//전방설정 //전방설정
SetNationFront($connect, $destnation[nation]); SetNationFront($connect, $destnation['nation']);
SetNationFront($connect, $conquerNation); SetNationFront($connect, $conquerNation);
} }
+261 -261
View File
@@ -143,15 +143,15 @@ function ender($type=0) {
} }
function command_99($connect, $turn) { function command_99($connect, $turn) {
$query = "select nation,level from general where user_id='$_SESSION[p_id]'"; $query = "select nation,level from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
if($me[level] >= 5) { if($me['level'] >= 5) {
$command = EncodeCommand(0, 0, 0, 99); $command = EncodeCommand(0, 0, 0, 99);
for($i=0; $i < sizeof($turn); $i++) { for($i=0; $i < sizeof($turn); $i++) {
$query = "update nation set l{$me[level]}turn{$turn[$i]}='{$command}' where nation='$me[nation]'"; $query = "update nation set l{$me['level']}turn{$turn[$i]}='{$command}' where nation='$me['nation']'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} }
} }
@@ -206,30 +206,30 @@ function command_11($connect, $turn, $command) {
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$admin = MYDB_fetch_array($result); $admin = MYDB_fetch_array($result);
$query = "select no,nation,level,personal,special2,level,city,crew,horse,injury,leader,crewtype,gold from general where user_id='$_SESSION[p_id]'"; $query = "select no,nation,level,personal,special2,level,city,crew,horse,injury,leader,crewtype,gold from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
//현재 도시 //현재 도시
$query = "select city,region from city where city='$me[city]'"; $query = "select city,region from city where city='$me['city']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$curCity = MYDB_fetch_array($result); $curCity = MYDB_fetch_array($result);
$query = "select level,tech from nation where nation='$me[nation]'"; $query = "select level,tech from nation where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error("process53 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("process53 ".MYDB_error($connect),"");
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
if($me[level] == 12) { if($me['level'] == 12) {
$lbonus = $nation[level] * 2; $lbonus = $nation['level'] * 2;
} elseif($me[level] >= 5) { } elseif($me['level'] >= 5) {
$lbonus = $nation[level]; $lbonus = $nation['level'];
} else { } else {
$lbonus = 0; $lbonus = 0;
} }
$explain = GetExplain(); $explain = GetExplain();
if($admin[year] < $admin[startyear]+3) { if($admin['year'] < $admin['startyear']+3) {
//그 국가에서 그 병종 가능한지 //그 국가에서 그 병종 가능한지
$valid[0] = 1; $color[0] = $_basecolor2; $valid[0] = 1; $color[0] = $_basecolor2;
$valid[10] = 1; $color[10] = $_basecolor2; $valid[10] = 1; $color[10] = $_basecolor2;
@@ -239,23 +239,23 @@ function command_11($connect, $turn, $command) {
$valid[41] = 1; $color[41] = "red"; // 충차 $valid[41] = 1; $color[41] = "red"; // 충차
} else { } else {
// 아국 도시 구분 // 아국 도시 구분
$query = "select city,level,region from city where nation='$me[nation]'"; $query = "select city,level,region from city where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$citycount = MYDB_num_rows($result); $citycount = MYDB_num_rows($result);
for($i=0; $i < $citycount; $i++) { for($i=0; $i < $citycount; $i++) {
$city = MYDB_fetch_array($result); $city = MYDB_fetch_array($result);
// 기술 1000 이상부터 지역병 // 기술 1000 이상부터 지역병
if($nation[tech] >= 1000) { if($nation['tech'] >= 1000) {
$myregion[$city[region]] = 1; $myregion[$city['region']] = 1;
} }
// 기술 2000 이상부터 이민족병 // 기술 2000 이상부터 이민족병
if($city[level] == 4 && $nation[tech] >= 2000) { if($city['level'] == 4 && $nation['tech'] >= 2000) {
$mycity[$city[city]] = 1; $mycity[$city['city']] = 1;
} }
// 기술 3000 이상부터 특수병 // 기술 3000 이상부터 특수병
if($city[level] == 8 && $nation[tech] >= 3000) { if($city['level'] == 8 && $nation['tech'] >= 3000) {
$mycity[$city[city]] = 1; $mycity[$city['city']] = 1;
} }
} }
@@ -294,19 +294,19 @@ function command_11($connect, $turn, $command) {
$valid[43] = $mycity[5]; $color[43] = "limegreen"; // 목우(성도) $valid[43] = $mycity[5]; $color[43] = "limegreen"; // 목우(성도)
// 남귀병은 기술1등급부터 // 남귀병은 기술1등급부터
if($nation[tech] < 1000) { if($nation['tech'] < 1000) {
$valid[35] = 0; $valid[35] = 0;
} }
// 충차는 기술1등급부터 // 충차는 기술1등급부터
if($nation[tech] < 1000) { if($nation['tech'] < 1000) {
$valid[41] = 0; $valid[41] = 0;
} }
} }
$leader = floor($me[leader] * (100 - $me[injury])/100) + getHorseEff($me[horse]) + $lbonus; $leader = floor($me['leader'] * (100 - $me['injury'])/100) + getHorseEff($me['horse']) + $lbonus;
$crew = $leader - round($me[crew]/100); $crew = $leader - round($me['crew']/100);
$abil = getTechAbil($nation[tech]); $abil = getTechAbil($nation['tech']);
$cost = getTechCost($nation[tech]); $cost = getTechCost($nation['tech']);
echo " echo "
<font size=2>병사를 모집합니다. 훈련과 사기치는 낮지만 가격이 저렴합니다.<br> <font size=2>병사를 모집합니다. 훈련과 사기치는 낮지만 가격이 저렴합니다.<br>
가능한 수보다 많게 입력하면 가능한 최대 병사를 모집합니다.<br> 가능한 수보다 많게 입력하면 가능한 최대 병사를 모집합니다.<br>
@@ -356,11 +356,11 @@ function calc(cost, formnum) {
<table border=1 cellspacing=0 bordercolordark=gray bordercolorlight=black> <table border=1 cellspacing=0 bordercolordark=gray bordercolorlight=black>
<tr> <tr>
<td colspan=10 align=center id=bg2> <td colspan=10 align=center id=bg2>
현재 기술력 : <input type=text style=text-align:right;color:white;background-color:black size=5 readonly value=".getTechCall($nation[tech])."> 현재 기술력 : <input type=text style=text-align:right;color:white;background-color:black size=5 readonly value=".getTechCall($nation['tech']).">
현재 통솔 : <input type=text style=text-align:right;color:white;background-color:black size=3 readonly value=$leader> 현재 통솔 : <input type=text style=text-align:right;color:white;background-color:black size=3 readonly value=$leader>
현재 병종 : <input type=text size=8 style=text-align:right;color:white;background-color:black readonly value=".getTypename($me[crewtype])."> 현재 병종 : <input type=text size=8 style=text-align:right;color:white;background-color:black readonly value=".getTypename($me['crewtype']).">
현재 병사 : <input type=text size=5 style=text-align:right;color:white;background-color:black readonly value=$me[crew]> 현재 병사 : <input type=text size=5 style=text-align:right;color:white;background-color:black readonly value=$me['crew']>
현재 자금 : <input type=text size=5 style=text-align:right;color:white;background-color:black readonly value=$me[gold]> 현재 자금 : <input type=text size=5 style=text-align:right;color:white;background-color:black readonly value=$me['gold']>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -384,7 +384,7 @@ function calc(cost, formnum) {
$ric = $admin["ric{$i}"] * $cost; $ric = $admin["ric{$i}"] * $cost;
$cst = $admin["cst{$i}"] * $cost; $cst = $admin["cst{$i}"] * $cost;
//성격 보정 //성격 보정
$cst = CharCost($cst, $me[personal]); $cst = CharCost($cst, $me['personal']);
//특기 보정 : 보병, 징병 //특기 보정 : 보병, 징병
if($me[special2] == 50) { $cst *= 0.9; } if($me[special2] == 50) { $cst *= 0.9; }
if($me[special2] == 72) { $cst *= 0.5; } if($me[special2] == 72) { $cst *= 0.5; }
@@ -396,7 +396,7 @@ function calc(cost, formnum) {
$cst = round($cst); $cst = round($cst);
$l = $color[$i]; $l = $color[$i];
$weapImage = "{$images}/weap{$i}.jpg"; $weapImage = "{$images}/weap{$i}.jpg";
if($admin[img] < 2) { $weapImage = "{$image}/default.jpg"; } if($admin['img'] < 2) { $weapImage = "{$image}/default.jpg"; }
echo " echo "
<tr height=64 bgcolor=$l> <tr height=64 bgcolor=$l>
<td background={$weapImage} align=center></td> <td background={$weapImage} align=center></td>
@@ -434,7 +434,7 @@ function calc(cost, formnum) {
$ric = $admin["ric{$i}"] * $cost; $ric = $admin["ric{$i}"] * $cost;
$cst = $admin["cst{$i}"] * $cost; $cst = $admin["cst{$i}"] * $cost;
//성격 보정 //성격 보정
$cst = CharCost($cst, $me[personal]); $cst = CharCost($cst, $me['personal']);
//특기 보정 : 궁병, 징병 //특기 보정 : 궁병, 징병
if($me[special2] == 51) { $cst *= 0.9; } if($me[special2] == 51) { $cst *= 0.9; }
if($me[special2] == 72) { $cst *= 0.5; } if($me[special2] == 72) { $cst *= 0.5; }
@@ -446,7 +446,7 @@ function calc(cost, formnum) {
$cst = round($cst); $cst = round($cst);
$l = $color[$i]; $l = $color[$i];
$weapImage = "{$images}/weap{$i}.jpg"; $weapImage = "{$images}/weap{$i}.jpg";
if($admin[img] < 2) { $weapImage = "{$image}/default.jpg"; } if($admin['img'] < 2) { $weapImage = "{$image}/default.jpg"; }
echo " echo "
<tr height=64 bgcolor=$l> <tr height=64 bgcolor=$l>
<td background={$weapImage} align=center></td> <td background={$weapImage} align=center></td>
@@ -484,7 +484,7 @@ function calc(cost, formnum) {
$ric = $admin["ric{$i}"] * $cost; $ric = $admin["ric{$i}"] * $cost;
$cst = $admin["cst{$i}"] * $cost; $cst = $admin["cst{$i}"] * $cost;
//성격 보정 //성격 보정
$cst = CharCost($cst, $me[personal]); $cst = CharCost($cst, $me['personal']);
//특기 보정 : 기병, 징병 //특기 보정 : 기병, 징병
if($me[special2] == 52) { $cst *= 0.9; } if($me[special2] == 52) { $cst *= 0.9; }
if($me[special2] == 72) { $cst *= 0.5; } if($me[special2] == 72) { $cst *= 0.5; }
@@ -496,7 +496,7 @@ function calc(cost, formnum) {
$cst = round($cst); $cst = round($cst);
$l = $color[$i]; $l = $color[$i];
$weapImage = "{$images}/weap{$i}.jpg"; $weapImage = "{$images}/weap{$i}.jpg";
if($admin[img] < 2) { $weapImage = "{$image}/default.jpg"; } if($admin['img'] < 2) { $weapImage = "{$image}/default.jpg"; }
echo " echo "
<tr height=64 bgcolor=$l> <tr height=64 bgcolor=$l>
<td background={$weapImage} align=center></td> <td background={$weapImage} align=center></td>
@@ -534,7 +534,7 @@ function calc(cost, formnum) {
$ric = $admin["ric{$i}"] * $cost; $ric = $admin["ric{$i}"] * $cost;
$cst = $admin["cst{$i}"] * $cost; $cst = $admin["cst{$i}"] * $cost;
//성격 보정 //성격 보정
$cst = CharCost($cst, $me[personal]); $cst = CharCost($cst, $me['personal']);
//특기 보정 : 귀병, 징병 //특기 보정 : 귀병, 징병
if($me[special2] == 40) { $cst *= 0.9; } if($me[special2] == 40) { $cst *= 0.9; }
if($me[special2] == 72) { $cst *= 0.5; } if($me[special2] == 72) { $cst *= 0.5; }
@@ -546,7 +546,7 @@ function calc(cost, formnum) {
$cst = round($cst); $cst = round($cst);
$l = $color[$i]; $l = $color[$i];
$weapImage = "{$images}/weap{$i}.jpg"; $weapImage = "{$images}/weap{$i}.jpg";
if($admin[img] < 2) { $weapImage = "{$image}/default.jpg"; } if($admin['img'] < 2) { $weapImage = "{$image}/default.jpg"; }
echo " echo "
<tr height=64 bgcolor=$l> <tr height=64 bgcolor=$l>
<td background={$weapImage} align=center></td> <td background={$weapImage} align=center></td>
@@ -584,7 +584,7 @@ function calc(cost, formnum) {
$ric = $admin["ric{$i}"] * $cost; $ric = $admin["ric{$i}"] * $cost;
$cst = $admin["cst{$i}"] * $cost; $cst = $admin["cst{$i}"] * $cost;
//성격 보정 //성격 보정
$cst = CharCost($cst, $me[personal]); $cst = CharCost($cst, $me['personal']);
//특기 보정 : 공성, 징병 //특기 보정 : 공성, 징병
if($me[special2] == 53) { $cst *= 0.9; } if($me[special2] == 53) { $cst *= 0.9; }
if($me[special2] == 72) { $cst *= 0.5; } if($me[special2] == 72) { $cst *= 0.5; }
@@ -596,7 +596,7 @@ function calc(cost, formnum) {
$cst = round($cst); $cst = round($cst);
$l = $color[$i]; $l = $color[$i];
$weapImage = "{$images}/weap{$i}.jpg"; $weapImage = "{$images}/weap{$i}.jpg";
if($admin[img] < 2) { $weapImage = "{$image}/default.jpg"; } if($admin['img'] < 2) { $weapImage = "{$image}/default.jpg"; }
echo " echo "
<tr height=64 bgcolor=$l> <tr height=64 bgcolor=$l>
<td background={$weapImage} align=center></td> <td background={$weapImage} align=center></td>
@@ -639,30 +639,30 @@ function command_12($connect, $turn, $command) {
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$admin = MYDB_fetch_array($result); $admin = MYDB_fetch_array($result);
$query = "select no,nation,personal,special2,level,city,crew,horse,injury,leader,crewtype,gold from general where user_id='$_SESSION[p_id]'"; $query = "select no,nation,personal,special2,level,city,crew,horse,injury,leader,crewtype,gold from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error("command_12 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("command_12 ".MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
//현재 도시 //현재 도시
$query = "select city,region from city where city='$me[city]'"; $query = "select city,region from city where city='$me['city']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$curCity = MYDB_fetch_array($result); $curCity = MYDB_fetch_array($result);
$query = "select level,tech from nation where nation='$me[nation]'"; $query = "select level,tech from nation where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error("process53 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("process53 ".MYDB_error($connect),"");
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
if($me[level] == 12) { if($me['level'] == 12) {
$lbonus = $nation[level] * 2; $lbonus = $nation['level'] * 2;
} elseif($me[level] >= 5) { } elseif($me['level'] >= 5) {
$lbonus = $nation[level]; $lbonus = $nation['level'];
} else { } else {
$lbonus = 0; $lbonus = 0;
} }
$explain = GetExplain(); $explain = GetExplain();
if($admin[year] < $admin[startyear]+3) { if($admin['year'] < $admin['startyear']+3) {
//그 국가에서 그 병종 가능한지 //그 국가에서 그 병종 가능한지
$valid[0] = 1; $color[0] = $_basecolor2; $valid[0] = 1; $color[0] = $_basecolor2;
$valid[10] = 1; $color[10] = $_basecolor2; $valid[10] = 1; $color[10] = $_basecolor2;
@@ -672,23 +672,23 @@ function command_12($connect, $turn, $command) {
$valid[41] = 1; $color[41] = "red"; // 충차 $valid[41] = 1; $color[41] = "red"; // 충차
} else { } else {
// 아국 도시 구분 // 아국 도시 구분
$query = "select city,level,region from city where nation='$me[nation]'"; $query = "select city,level,region from city where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$citycount = MYDB_num_rows($result); $citycount = MYDB_num_rows($result);
for($i=0; $i < $citycount; $i++) { for($i=0; $i < $citycount; $i++) {
$city = MYDB_fetch_array($result); $city = MYDB_fetch_array($result);
// 기술 1000 이상부터 지역병 // 기술 1000 이상부터 지역병
if($nation[tech] >= 1000) { if($nation['tech'] >= 1000) {
$myregion[$city[region]] = 1; $myregion[$city['region']] = 1;
} }
// 기술 2000 이상부터 이민족병 // 기술 2000 이상부터 이민족병
if($city[level] == 4 && $nation[tech] >= 2000) { if($city['level'] == 4 && $nation['tech'] >= 2000) {
$mycity[$city[city]] = 1; $mycity[$city['city']] = 1;
} }
// 기술 3000 이상부터 특수병 // 기술 3000 이상부터 특수병
if($city[level] == 8 && $nation[tech] >= 3000) { if($city['level'] == 8 && $nation['tech'] >= 3000) {
$mycity[$city[city]] = 1; $mycity[$city['city']] = 1;
} }
} }
@@ -727,19 +727,19 @@ function command_12($connect, $turn, $command) {
$valid[43] = $mycity[5]; $color[43] = "limegreen"; // 목우(성도) $valid[43] = $mycity[5]; $color[43] = "limegreen"; // 목우(성도)
// 남귀병은 기술1등급부터 // 남귀병은 기술1등급부터
if($nation[tech] < 1000) { if($nation['tech'] < 1000) {
$valid[35] = 0; $valid[35] = 0;
} }
// 충차는 기술1등급부터 // 충차는 기술1등급부터
if($nation[tech] < 1000) { if($nation['tech'] < 1000) {
$valid[41] = 0; $valid[41] = 0;
} }
} }
$leader = floor($me[leader] * (100 - $me[injury])/100) + getHorseEff($me[horse]) + $lbonus; $leader = floor($me['leader'] * (100 - $me['injury'])/100) + getHorseEff($me['horse']) + $lbonus;
$crew = $leader - round($me[crew]/100); $crew = $leader - round($me['crew']/100);
$abil = getTechAbil($nation[tech]); $abil = getTechAbil($nation['tech']);
$cost = getTechCost($nation[tech]); $cost = getTechCost($nation['tech']);
echo " echo "
<font size=2>병사를 모집합니다. 훈련과 사기치는 높지만 자금이 많이 듭니다.<br> <font size=2>병사를 모집합니다. 훈련과 사기치는 높지만 자금이 많이 듭니다.<br>
가능한 수보다 많게 입력하면 가능한 최대 병사를 모집합니다.<br> 가능한 수보다 많게 입력하면 가능한 최대 병사를 모집합니다.<br>
@@ -790,11 +790,11 @@ function calc(cost, formnum) {
<tr><td align=center colspan=10>모병은 가격 2배의 자금이 소요됩니다.</td></tr> <tr><td align=center colspan=10>모병은 가격 2배의 자금이 소요됩니다.</td></tr>
<tr> <tr>
<td colspan=10 align=center id=bg2> <td colspan=10 align=center id=bg2>
현재 기술력 : <input type=text style=text-align:right;color:white;background-color:black size=5 readonly value=".getTechCall($nation[tech])."> 현재 기술력 : <input type=text style=text-align:right;color:white;background-color:black size=5 readonly value=".getTechCall($nation['tech']).">
현재 통솔 : <input type=text style=text-align:right;color:white;background-color:black size=3 readonly value=$leader> 현재 통솔 : <input type=text style=text-align:right;color:white;background-color:black size=3 readonly value=$leader>
현재 병종 : <input type=text size=8 style=text-align:right;color:white;background-color:black readonly value=".getTypename($me[crewtype])."> 현재 병종 : <input type=text size=8 style=text-align:right;color:white;background-color:black readonly value=".getTypename($me['crewtype']).">
현재 병사 : <input type=text size=5 style=text-align:right;color:white;background-color:black readonly value=$me[crew]> 현재 병사 : <input type=text size=5 style=text-align:right;color:white;background-color:black readonly value=$me['crew']>
현재 자금 : <input type=text size=5 style=text-align:right;color:white;background-color:black readonly value=$me[gold]> 현재 자금 : <input type=text size=5 style=text-align:right;color:white;background-color:black readonly value=$me['gold']>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -818,7 +818,7 @@ function calc(cost, formnum) {
$ric = $admin["ric{$i}"] * $cost; $ric = $admin["ric{$i}"] * $cost;
$cst = $admin["cst{$i}"] * $cost; $cst = $admin["cst{$i}"] * $cost;
//성격 보정 //성격 보정
$cst = CharCost($cst, $me[personal]); $cst = CharCost($cst, $me['personal']);
//특기 보정 : 보병, 징병 //특기 보정 : 보병, 징병
if($me[special2] == 50) { $cst *= 0.9; } if($me[special2] == 50) { $cst *= 0.9; }
if($me[special2] == 72) { $cst *= 0.5; } if($me[special2] == 72) { $cst *= 0.5; }
@@ -830,7 +830,7 @@ function calc(cost, formnum) {
$cst = round($cst); $cst = round($cst);
$l = $color[$i]; $l = $color[$i];
$weapImage = "{$images}/weap{$i}.jpg"; $weapImage = "{$images}/weap{$i}.jpg";
if($admin[img] < 2) { $weapImage = "{$image}/default.jpg"; } if($admin['img'] < 2) { $weapImage = "{$image}/default.jpg"; }
echo " echo "
<tr height=64 bgcolor=$l> <tr height=64 bgcolor=$l>
<td background={$weapImage} align=center></td> <td background={$weapImage} align=center></td>
@@ -868,7 +868,7 @@ function calc(cost, formnum) {
$ric = $admin["ric{$i}"] * $cost; $ric = $admin["ric{$i}"] * $cost;
$cst = $admin["cst{$i}"] * $cost; $cst = $admin["cst{$i}"] * $cost;
//성격 보정 //성격 보정
$cst = CharCost($cst, $me[personal]); $cst = CharCost($cst, $me['personal']);
//특기 보정 : 궁병, 징병 //특기 보정 : 궁병, 징병
if($me[special2] == 51) { $cst *= 0.9; } if($me[special2] == 51) { $cst *= 0.9; }
if($me[special2] == 72) { $cst *= 0.5; } if($me[special2] == 72) { $cst *= 0.5; }
@@ -880,7 +880,7 @@ function calc(cost, formnum) {
$cst = round($cst); $cst = round($cst);
$l = $color[$i]; $l = $color[$i];
$weapImage = "{$images}/weap{$i}.jpg"; $weapImage = "{$images}/weap{$i}.jpg";
if($admin[img] < 2) { $weapImage = "{$image}/default.jpg"; } if($admin['img'] < 2) { $weapImage = "{$image}/default.jpg"; }
echo " echo "
<tr height=64 bgcolor=$l> <tr height=64 bgcolor=$l>
<td background={$weapImage} align=center></td> <td background={$weapImage} align=center></td>
@@ -918,7 +918,7 @@ function calc(cost, formnum) {
$ric = $admin["ric{$i}"] * $cost; $ric = $admin["ric{$i}"] * $cost;
$cst = $admin["cst{$i}"] * $cost; $cst = $admin["cst{$i}"] * $cost;
//성격 보정 //성격 보정
$cst = CharCost($cst, $me[personal]); $cst = CharCost($cst, $me['personal']);
//특기 보정 : 기병, 징병 //특기 보정 : 기병, 징병
if($me[special2] == 52) { $cst *= 0.9; } if($me[special2] == 52) { $cst *= 0.9; }
if($me[special2] == 72) { $cst *= 0.5; } if($me[special2] == 72) { $cst *= 0.5; }
@@ -930,7 +930,7 @@ function calc(cost, formnum) {
$cst = round($cst); $cst = round($cst);
$l = $color[$i]; $l = $color[$i];
$weapImage = "{$images}/weap{$i}.jpg"; $weapImage = "{$images}/weap{$i}.jpg";
if($admin[img] < 2) { $weapImage = "{$image}/default.jpg"; } if($admin['img'] < 2) { $weapImage = "{$image}/default.jpg"; }
echo " echo "
<tr height=64 bgcolor=$l> <tr height=64 bgcolor=$l>
<td background={$weapImage} align=center></td> <td background={$weapImage} align=center></td>
@@ -968,7 +968,7 @@ function calc(cost, formnum) {
$ric = $admin["ric{$i}"] * $cost; $ric = $admin["ric{$i}"] * $cost;
$cst = $admin["cst{$i}"] * $cost; $cst = $admin["cst{$i}"] * $cost;
//성격 보정 //성격 보정
$cst = CharCost($cst, $me[personal]); $cst = CharCost($cst, $me['personal']);
//특기 보정 : 귀병, 징병 //특기 보정 : 귀병, 징병
if($me[special2] == 40) { $cst *= 0.9; } if($me[special2] == 40) { $cst *= 0.9; }
if($me[special2] == 72) { $cst *= 0.5; } if($me[special2] == 72) { $cst *= 0.5; }
@@ -980,7 +980,7 @@ function calc(cost, formnum) {
$cst = round($cst); $cst = round($cst);
$l = $color[$i]; $l = $color[$i];
$weapImage = "{$images}/weap{$i}.jpg"; $weapImage = "{$images}/weap{$i}.jpg";
if($admin[img] < 2) { $weapImage = "{$image}/default.jpg"; } if($admin['img'] < 2) { $weapImage = "{$image}/default.jpg"; }
echo " echo "
<tr height=64 bgcolor=$l> <tr height=64 bgcolor=$l>
<td background={$weapImage} align=center></td> <td background={$weapImage} align=center></td>
@@ -1018,7 +1018,7 @@ function calc(cost, formnum) {
$ric = $admin["ric{$i}"] * $cost; $ric = $admin["ric{$i}"] * $cost;
$cst = $admin["cst{$i}"] * $cost; $cst = $admin["cst{$i}"] * $cost;
//성격 보정 //성격 보정
$cst = CharCost($cst, $me[personal]); $cst = CharCost($cst, $me['personal']);
//특기 보정 : 공성, 징병 //특기 보정 : 공성, 징병
if($me[special2] == 53) { $cst *= 0.9; } if($me[special2] == 53) { $cst *= 0.9; }
if($me[special2] == 72) { $cst *= 0.5; } if($me[special2] == 72) { $cst *= 0.5; }
@@ -1030,7 +1030,7 @@ function calc(cost, formnum) {
$cst = round($cst); $cst = round($cst);
$l = $color[$i]; $l = $color[$i];
$weapImage = "{$images}/weap{$i}.jpg"; $weapImage = "{$images}/weap{$i}.jpg";
if($admin[img] < 2) { $weapImage = "{$image}/default.jpg"; } if($admin['img'] < 2) { $weapImage = "{$image}/default.jpg"; }
echo " echo "
<tr height=64 bgcolor=$l> <tr height=64 bgcolor=$l>
<td background={$weapImage} align=center></td> <td background={$weapImage} align=center></td>
@@ -1068,12 +1068,12 @@ function calc(cost, formnum) {
function command_15($connect, $turn, $command) { function command_15($connect, $turn, $command) {
starter("재편성"); starter("재편성");
$query = "select no,nation from general where user_id='$_SESSION[p_id]'"; $query = "select no,nation from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$me = $general[no]; $me = $general['no'];
$query = "select no,name from general where nation='$general[nation]'"; $query = "select no,name from general where nation='$general['nation']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$gencount = MYDB_num_rows($result); $gencount = MYDB_num_rows($result);
@@ -1084,9 +1084,9 @@ function command_15($connect, $turn, $command) {
for($i=0; $i < $gencount; $i++) { for($i=0; $i < $gencount; $i++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
if($me != $general[no]) { if($me != $general['no']) {
echo " echo "
<option value={$general[no]}>{$general[name]}</option>"; <option value={$general['no']}>{$general['name']}</option>";
} }
} }
@@ -1109,11 +1109,11 @@ function command_15($connect, $turn, $command) {
function command_16($connect, $turn, $command) { function command_16($connect, $turn, $command) {
starter("출병"); starter("출병");
$query = "select city from general where user_id='$_SESSION[p_id]'"; $query = "select city from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$query = "select city,name from city where city='$general[city]'"; $query = "select city,name from city where city='$general['city']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$currentcity = MYDB_fetch_array($result); $currentcity = MYDB_fetch_array($result);
@@ -1123,7 +1123,7 @@ function command_16($connect, $turn, $command) {
선택된 도시로 침공을 합니다.<br> 선택된 도시로 침공을 합니다.<br>
목록을 선택하거나 도시를 클릭하세요.<br> 목록을 선택하거나 도시를 클릭하세요.<br>
<form name=form1 action=c_double.php method=post> <form name=form1 action=c_double.php method=post>
$currentcity[name] => $currentcity['name'] =>
<select name=double size=1 style=color:white;background-color:black>"; <select name=double size=1 style=color:white;background-color:black>";
OptionsForCitys(); OptionsForCitys();
@@ -1142,18 +1142,18 @@ $currentcity[name] =>
</form> </form>
"; ";
printCitysName($connect, $currentcity[city], 1); printCitysName($connect, $currentcity['city'], 1);
ender(); ender();
} }
function command_21($connect, $turn, $command) { function command_21($connect, $turn, $command) {
starter("이동"); starter("이동");
$query = "select city from general where user_id='$_SESSION[p_id]'"; $query = "select city from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$query = "select city,name from city where city='$general[city]'"; $query = "select city,name from city where city='$general['city']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$currentcity = MYDB_fetch_array($result); $currentcity = MYDB_fetch_array($result);
@@ -1164,7 +1164,7 @@ function command_21($connect, $turn, $command) {
인접 도시로만 이동이 가능합니다.<br> 인접 도시로만 이동이 가능합니다.<br>
목록을 선택하거나 도시를 클릭하세요.<br> 목록을 선택하거나 도시를 클릭하세요.<br>
<form name=form1 action=c_double.php method=post> <form name=form1 action=c_double.php method=post>
$currentcity[name] => $currentcity['name'] =>
<select name=double size=1 style=color:white;background-color:black>"; <select name=double size=1 style=color:white;background-color:black>";
OptionsForCitys(); OptionsForCitys();
@@ -1182,7 +1182,7 @@ $currentcity[name] =>
</form> </form>
"; ";
printCitysName($connect, $currentcity[city], 1); printCitysName($connect, $currentcity['city'], 1);
ender(); ender();
} }
@@ -1190,7 +1190,7 @@ $currentcity[name] =>
function command_22($connect, $turn, $command) { function command_22($connect, $turn, $command) {
starter("등용"); starter("등용");
$query = "select nation from general where user_id='$_SESSION[p_id]'"; $query = "select nation from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
@@ -1209,33 +1209,33 @@ function command_22($connect, $turn, $command) {
for($i=0; $i < $gencount; $i++) { for($i=0; $i < $gencount; $i++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
if ($general[npc] >= 2) { $style = "style=color:cyan;"; } if ($general['npc'] >= 2) { $style = "style=color:cyan;"; }
elseif($general[npc] == 1) { $style = "style=color:skyblue;"; } elseif($general['npc'] == 1) { $style = "style=color:skyblue;"; }
else { $style = ""; } else { $style = ""; }
echo " echo "
<option value={$general[no]} {$style}>{$general[name]}</option>"; <option value={$general['no']} {$style}>{$general['name']}</option>";
} }
$query = "select nation,name,color from nation where nation!='$me[nation]'"; $query = "select nation,name,color from nation where nation!='$me['nation']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=1; $i <= $count; $i++) { for($i=1; $i <= $count; $i++) {
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
echo "<option style=color:{$nation[color]}>【 {$nation[name]} 】</option>"; echo "<option style=color:{$nation['color']}>【 {$nation['name']} 】</option>";
$query = "select no,name,npc from general where nation='$nation[nation]' and level!='12' and npc<2 order by npc,binary(name)"; $query = "select no,name,npc from general where nation='$nation['nation']' and level!='12' and npc<2 order by npc,binary(name)";
$genresult = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $genresult = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$gencount = MYDB_num_rows($genresult); $gencount = MYDB_num_rows($genresult);
for($j=0; $j < $gencount; $j++) { for($j=0; $j < $gencount; $j++) {
$general = MYDB_fetch_array($genresult); $general = MYDB_fetch_array($genresult);
if ($general[npc] >= 2) { $style = "style=color:cyan;"; } if ($general['npc'] >= 2) { $style = "style=color:cyan;"; }
elseif($general[npc] == 1) { $style = "style=color:skyblue;"; } elseif($general['npc'] == 1) { $style = "style=color:skyblue;"; }
else { $style = ""; } else { $style = ""; }
echo " echo "
<option value={$general[no]} {$style}>{$general[name]}</option>"; <option value={$general['no']} {$style}>{$general['name']}</option>";
} }
} }
echo " echo "
@@ -1255,11 +1255,11 @@ function command_22($connect, $turn, $command) {
function command_23($connect, $turn, $command) { function command_23($connect, $turn, $command) {
starter("포상", 1); starter("포상", 1);
$query = "select no,nation from general where user_id='$_SESSION[p_id]'"; $query = "select no,nation from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$query = "select no,name,level,npc from general where nation='$general[nation]' and no!='$general[no]' order by npc,binary(name)"; $query = "select no,name,level,npc from general where nation='$general['nation']' and no!='$general['no']' order by npc,binary(name)";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$gencount = MYDB_num_rows($result); $gencount = MYDB_num_rows($result);
@@ -1270,15 +1270,15 @@ function command_23($connect, $turn, $command) {
for($i=0; $i < $gencount; $i++) { for($i=0; $i < $gencount; $i++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
if ($general[npc] >= 2) { $style = "style=color:cyan;"; } if ($general['npc'] >= 2) { $style = "style=color:cyan;"; }
elseif($general[npc] == 1) { $style = "style=color:skyblue;"; } elseif($general['npc'] == 1) { $style = "style=color:skyblue;"; }
else { $style = ""; } else { $style = ""; }
if($general[level] >= 5) { if($general['level'] >= 5) {
echo " echo "
<option value={$general[no]} {$style}>*{$general[name]}*</option>"; <option value={$general['no']} {$style}>*{$general['name']}*</option>";
} else { } else {
echo " echo "
<option value={$general[no]} {$style}>{$general[name]}</option>"; <option value={$general['no']} {$style}>{$general['name']}</option>";
} }
} }
@@ -1325,11 +1325,11 @@ function command_23($connect, $turn, $command) {
function command_24($connect, $turn, $command) { function command_24($connect, $turn, $command) {
starter("몰수", 1); starter("몰수", 1);
$query = "select no,nation from general where user_id='$_SESSION[p_id]'"; $query = "select no,nation from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$query = "select no,name,level,npc from general where nation='$general[nation]' and no!='$general[no]' order by npc,binary(name)"; $query = "select no,name,level,npc from general where nation='$general['nation']' and no!='$general['no']' order by npc,binary(name)";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$gencount = MYDB_num_rows($result); $gencount = MYDB_num_rows($result);
@@ -1341,15 +1341,15 @@ function command_24($connect, $turn, $command) {
for($i=0; $i < $gencount; $i++) { for($i=0; $i < $gencount; $i++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
if ($general[npc] >= 2) { $style = "style=color:cyan;"; } if ($general['npc'] >= 2) { $style = "style=color:cyan;"; }
elseif($general[npc] == 1) { $style = "style=color:skyblue;"; } elseif($general['npc'] == 1) { $style = "style=color:skyblue;"; }
else { $style = ""; } else { $style = ""; }
if($general[level] >= 5) { if($general['level'] >= 5) {
echo " echo "
<option value={$general[no]} {$style}>*{$general[name]}*</option>"; <option value={$general['no']} {$style}>*{$general['name']}*</option>";
} else { } else {
echo " echo "
<option value={$general[no]} {$style}>{$general[name]}</option>"; <option value={$general['no']} {$style}>{$general['name']}</option>";
} }
} }
@@ -1403,7 +1403,7 @@ function command_25($connect, $turn, $command) {
$result = MYDB_query($query, $connect) or Error("command_46 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("command_46 ".MYDB_error($connect),"");
$admin = MYDB_fetch_array($result); $admin = MYDB_fetch_array($result);
$query = "select no,nations from general where user_id='$_SESSION[p_id]'"; $query = "select no,nations from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error("command_27 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("command_27 ".MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
@@ -1429,26 +1429,26 @@ function command_25($connect, $turn, $command) {
for($i=1; $i <= $count; $i++) { for($i=1; $i <= $count; $i++) {
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
if($nation[scoutmsg] == "") { if($nation['scoutmsg'] == "") {
$scoutStr .= "<tr><td align=center width=100 style=color:".newColor($nation[color]).";background-color:{$nation[color]};>$nation[name]</td><td width=900 style=color:".newColor($nation[color]).";background-color:{$nation[color]}>-</td></tr>"; $scoutStr .= "<tr><td align=center width=100 style=color:".newColor($nation['color']).";background-color:{$nation['color']};>$nation['name']</td><td width=900 style=color:".newColor($nation['color']).";background-color:{$nation['color']}>-</td></tr>";
} else { } else {
$scoutStr .= "<tr><td align=center width=100 style=color:".newColor($nation[color]).";background-color:{$nation[color]};>$nation[name]</td><td width=900 style=color:".newColor($nation[color]).";background-color:{$nation[color]}>".$nation[scoutmsg]."</td></tr>"; $scoutStr .= "<tr><td align=center width=100 style=color:".newColor($nation['color']).";background-color:{$nation['color']};>$nation['name']</td><td width=900 style=color:".newColor($nation['color']).";background-color:{$nation['color']}>".$nation['scoutmsg']."</td></tr>";
} }
if($admin[year] < $admin[startyear]+3 && $nation[gennum] >= 10) { if($admin['year'] < $admin['startyear']+3 && $nation['gennum'] >= 10) {
echo " echo "
<option value={$nation[nation]} style=color:{$nation[color]};background-color:red;>【 {$nation[name]} 】</option>"; <option value={$nation['nation']} style=color:{$nation['color']};background-color:red;>【 {$nation['name']} 】</option>";
} elseif($nation[scout] == 1) { } elseif($nation['scout'] == 1) {
echo " echo "
<option value={$nation[nation]} style=color:{$nation[color]};background-color:red;>【 {$nation[name]} 】</option>"; <option value={$nation['nation']} style=color:{$nation['color']};background-color:red;>【 {$nation['name']} 】</option>";
} elseif(strpos($me['nations'], ",{$nation['nation']},") > 0) { } elseif(strpos($me['nations'], ",{$nation['nation']},") > 0) {
/* /*
echo " echo "
<option value={$nation[nation]} style=color:{$nation[color]};background-color:red; disabled>【 {$nation[name]} 】</option>"; <option value={$nation['nation']} style=color:{$nation['color']};background-color:red; disabled>【 {$nation['name']} 】</option>";
*/ */
} else { } else {
echo " echo "
<option value={$nation[nation]} style=color:{$nation[color]};>【 {$nation[name]} 】</option>"; <option value={$nation['nation']} style=color:{$nation['color']};>【 {$nation['name']} 】</option>";
} }
} }
echo " echo "
@@ -1473,11 +1473,11 @@ function command_25($connect, $turn, $command) {
function command_27($connect, $turn, $command) { function command_27($connect, $turn, $command) {
starter("발령", 1); starter("발령", 1);
$query = "select no,nation,level from general where user_id='$_SESSION[p_id]'"; $query = "select no,nation,level from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error("command_27 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("command_27 ".MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
$query = "select no,name,level,npc from general where nation='$me[nation]' and no!='$me[no]' order by npc,binary(name)"; $query = "select no,name,level,npc from general where nation='$me['nation']' and no!='$me['no']' order by npc,binary(name)";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$gencount = MYDB_num_rows($result); $gencount = MYDB_num_rows($result);
@@ -1492,15 +1492,15 @@ function command_27($connect, $turn, $command) {
for($i=0; $i < $gencount; $i++) { for($i=0; $i < $gencount; $i++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
if ($general[npc] >= 2) { $style = "style=color:cyan;"; } if ($general['npc'] >= 2) { $style = "style=color:cyan;"; }
elseif($general[npc] == 1) { $style = "style=color:skyblue;"; } elseif($general['npc'] == 1) { $style = "style=color:skyblue;"; }
else { $style = ""; } else { $style = ""; }
if($general[level] >= 5) { if($general['level'] >= 5) {
echo " echo "
<option value={$general[no]} {$style}>*{$general[name]}*</option>"; <option value={$general['no']} {$style}>*{$general['name']}*</option>";
} else { } else {
echo " echo "
<option value={$general[no]} {$style}>{$general[name]}</option>"; <option value={$general['no']} {$style}>{$general['name']}</option>";
} }
} }
@@ -1529,11 +1529,11 @@ function command_27($connect, $turn, $command) {
function command_30($connect, $turn, $command) { function command_30($connect, $turn, $command) {
starter("강행"); starter("강행");
$query = "select city from general where user_id='$_SESSION[p_id]'"; $query = "select city from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$query = "select city,name from city where city='$general[city]'"; $query = "select city,name from city where city='$general['city']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$currentcity = MYDB_fetch_array($result); $currentcity = MYDB_fetch_array($result);
@@ -1544,7 +1544,7 @@ function command_30($connect, $turn, $command) {
최대 3칸내 도시로만 강행이 가능합니다.<br> 최대 3칸내 도시로만 강행이 가능합니다.<br>
목록을 선택하거나 도시를 클릭하세요.<br> 목록을 선택하거나 도시를 클릭하세요.<br>
<form name=form1 action=c_double.php method=post> <form name=form1 action=c_double.php method=post>
$currentcity[name] => $currentcity['name'] =>
<select name=double size=1 style=color:white;background-color:black>"; <select name=double size=1 style=color:white;background-color:black>";
OptionsForCitys(); OptionsForCitys();
@@ -1562,20 +1562,20 @@ echo "
</form> </form>
"; ";
printCitysName($connect, $currentcity[city], 1); printCitysName($connect, $currentcity['city'], 1);
printCitysName($connect, $currentcity[city], 2); printCitysName($connect, $currentcity['city'], 2);
printCitysName($connect, $currentcity[city], 3); printCitysName($connect, $currentcity['city'], 3);
ender(); ender();
} }
function command_31($connect, $turn, $command) { function command_31($connect, $turn, $command) {
starter("첩보"); starter("첩보");
$query = "select city from general where user_id='$_SESSION[p_id]'"; $query = "select city from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$query = "select city,name from city where city='$general[city]'"; $query = "select city,name from city where city='$general['city']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$currentcity = MYDB_fetch_array($result); $currentcity = MYDB_fetch_array($result);
@@ -1586,7 +1586,7 @@ function command_31($connect, $turn, $command) {
인접도시일 경우 많은 정보를 얻을 수 있습니다.<br> 인접도시일 경우 많은 정보를 얻을 수 있습니다.<br>
목록을 선택하거나 도시를 클릭하세요.<br> 목록을 선택하거나 도시를 클릭하세요.<br>
<form name=form1 action=c_double.php method=post> <form name=form1 action=c_double.php method=post>
$currentcity[name] => $currentcity['name'] =>
<select name=double size=1 style=color:white;background-color:black>"; <select name=double size=1 style=color:white;background-color:black>";
OptionsForCitys(); OptionsForCitys();
@@ -1608,19 +1608,19 @@ $currentcity[name] =>
모든 도시가 가능하지만 많은 정보를 얻을 수 있는<br> 모든 도시가 가능하지만 많은 정보를 얻을 수 있는<br>
"; ";
printCitysName($connect, $currentcity[city], 1); printCitysName($connect, $currentcity['city'], 1);
printCitysName($connect, $currentcity[city], 2); printCitysName($connect, $currentcity['city'], 2);
ender(); ender();
} }
function command_32($connect, $turn, $command) { function command_32($connect, $turn, $command) {
starter("화계"); starter("화계");
$query = "select city from general where user_id='$_SESSION[p_id]'"; $query = "select city from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$query = "select city,name from city where city='$general[city]'"; $query = "select city,name from city where city='$general['city']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$currentcity = MYDB_fetch_array($result); $currentcity = MYDB_fetch_array($result);
@@ -1630,7 +1630,7 @@ function command_32($connect, $turn, $command) {
선택된 도시에 화계를 실행합니다.<br> 선택된 도시에 화계를 실행합니다.<br>
목록을 선택하거나 도시를 클릭하세요.<br> 목록을 선택하거나 도시를 클릭하세요.<br>
<form name=form1 action=c_double.php method=post> <form name=form1 action=c_double.php method=post>
$currentcity[name] => $currentcity['name'] =>
<select name=double size=1 style=color:white;background-color:black>"; <select name=double size=1 style=color:white;background-color:black>";
OptionsForCitys(); OptionsForCitys();
@@ -1648,19 +1648,19 @@ $currentcity[name] =>
</form> </form>
"; ";
printCitysName($connect, $currentcity[city], 1); printCitysName($connect, $currentcity['city'], 1);
printCitysName($connect, $currentcity[city], 2); printCitysName($connect, $currentcity['city'], 2);
ender(); ender();
} }
function command_33($connect, $turn, $command) { function command_33($connect, $turn, $command) {
starter("탈취"); starter("탈취");
$query = "select city from general where user_id='$_SESSION[p_id]'"; $query = "select city from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$query = "select city,name from city where city='$general[city]'"; $query = "select city,name from city where city='$general['city']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$currentcity = MYDB_fetch_array($result); $currentcity = MYDB_fetch_array($result);
@@ -1670,7 +1670,7 @@ function command_33($connect, $turn, $command) {
선택된 도시에 탈취를 실행합니다.<br> 선택된 도시에 탈취를 실행합니다.<br>
목록을 선택하거나 도시를 클릭하세요.<br> 목록을 선택하거나 도시를 클릭하세요.<br>
<form name=form1 action=c_double.php method=post> <form name=form1 action=c_double.php method=post>
$currentcity[name] => $currentcity['name'] =>
<select name=double size=1 style=color:white;background-color:black>"; <select name=double size=1 style=color:white;background-color:black>";
OptionsForCitys(); OptionsForCitys();
@@ -1688,19 +1688,19 @@ $currentcity[name] =>
</form> </form>
"; ";
printCitysName($connect, $currentcity[city], 1); printCitysName($connect, $currentcity['city'], 1);
printCitysName($connect, $currentcity[city], 2); printCitysName($connect, $currentcity['city'], 2);
ender(); ender();
} }
function command_34($connect, $turn, $command) { function command_34($connect, $turn, $command) {
starter("파괴"); starter("파괴");
$query = "select city from general where user_id='$_SESSION[p_id]'"; $query = "select city from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$query = "select city,name from city where city='$general[city]'"; $query = "select city,name from city where city='$general['city']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$currentcity = MYDB_fetch_array($result); $currentcity = MYDB_fetch_array($result);
@@ -1710,7 +1710,7 @@ function command_34($connect, $turn, $command) {
선택된 도시에 파괴를 실행합니다.<br> 선택된 도시에 파괴를 실행합니다.<br>
목록을 선택하거나 도시를 클릭하세요.<br> 목록을 선택하거나 도시를 클릭하세요.<br>
<form name=form1 action=c_double.php method=post> <form name=form1 action=c_double.php method=post>
$currentcity[name] => $currentcity['name'] =>
<select name=double size=1 style=color:white;background-color:black>"; <select name=double size=1 style=color:white;background-color:black>";
OptionsForCitys(); OptionsForCitys();
@@ -1728,19 +1728,19 @@ $currentcity[name] =>
</form> </form>
"; ";
printCitysName($connect, $currentcity[city], 1); printCitysName($connect, $currentcity['city'], 1);
printCitysName($connect, $currentcity[city], 2); printCitysName($connect, $currentcity['city'], 2);
ender(); ender();
} }
function command_35($connect, $turn, $command) { function command_35($connect, $turn, $command) {
starter("선동"); starter("선동");
$query = "select city from general where user_id='$_SESSION[p_id]'"; $query = "select city from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$query = "select city,name from city where city='$general[city]'"; $query = "select city,name from city where city='$general['city']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$currentcity = MYDB_fetch_array($result); $currentcity = MYDB_fetch_array($result);
@@ -1750,7 +1750,7 @@ function command_35($connect, $turn, $command) {
선택된 도시에 선동을 실행합니다.<br> 선택된 도시에 선동을 실행합니다.<br>
목록을 선택하거나 도시를 클릭하세요.<br> 목록을 선택하거나 도시를 클릭하세요.<br>
<form name=form1 action=c_double.php method=post> <form name=form1 action=c_double.php method=post>
$currentcity[name] => $currentcity['name'] =>
<select name=double size=1 style=color:white;background-color:black>"; <select name=double size=1 style=color:white;background-color:black>";
OptionsForCitys(); OptionsForCitys();
@@ -1768,19 +1768,19 @@ $currentcity[name] =>
</form> </form>
"; ";
printCitysName($connect, $currentcity[city], 1); printCitysName($connect, $currentcity['city'], 1);
printCitysName($connect, $currentcity[city], 2); printCitysName($connect, $currentcity['city'], 2);
ender(); ender();
} }
function command_36($connect, $turn, $command) { function command_36($connect, $turn, $command) {
starter("기습"); starter("기습");
$query = "select city from general where user_id='$_SESSION[p_id]'"; $query = "select city from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$query = "select city,name from city where city='$general[city]'"; $query = "select city,name from city where city='$general['city']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$currentcity = MYDB_fetch_array($result); $currentcity = MYDB_fetch_array($result);
@@ -1790,7 +1790,7 @@ function command_36($connect, $turn, $command) {
선택된 도시에 기습을 실행합니다.<br> 선택된 도시에 기습을 실행합니다.<br>
목록을 선택하거나 도시를 클릭하세요.<br> 목록을 선택하거나 도시를 클릭하세요.<br>
<form name=form1 action=c_double.php method=post> <form name=form1 action=c_double.php method=post>
$currentcity[name] => $currentcity['name'] =>
<select name=double size=1 style=color:white;background-color:black>"; <select name=double size=1 style=color:white;background-color:black>";
OptionsForCitys(); OptionsForCitys();
@@ -1808,19 +1808,19 @@ $currentcity[name] =>
</form> </form>
"; ";
printCitysName($connect, $currentcity[city], 1); printCitysName($connect, $currentcity['city'], 1);
printCitysName($connect, $currentcity[city], 2); printCitysName($connect, $currentcity['city'], 2);
ender(); ender();
} }
function command_43($connect, $turn, $command) { function command_43($connect, $turn, $command) {
starter("증여"); starter("증여");
$query = "select no,nation from general where user_id='$_SESSION[p_id]'"; $query = "select no,nation from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$query = "select no,name,level,npc from general where nation='$general[nation]' and no!='$general[no]' order by npc,binary(name)"; $query = "select no,name,level,npc from general where nation='$general['nation']' and no!='$general['no']' order by npc,binary(name)";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$gencount = MYDB_num_rows($result); $gencount = MYDB_num_rows($result);
@@ -1832,15 +1832,15 @@ function command_43($connect, $turn, $command) {
for($i=0; $i < $gencount; $i++) { for($i=0; $i < $gencount; $i++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
if ($general[npc] >= 2) { $style = "style=color:cyan;"; } if ($general['npc'] >= 2) { $style = "style=color:cyan;"; }
elseif($general[npc] == 1) { $style = "style=color:skyblue;"; } elseif($general['npc'] == 1) { $style = "style=color:skyblue;"; }
else { $style = ""; } else { $style = ""; }
if($general[level] >= 9) { if($general['level'] >= 9) {
echo " echo "
<option value={$general[no]} {$style}>*{$general[name]}*</option>"; <option value={$general['no']} {$style}>*{$general['name']}*</option>";
} else { } else {
echo " echo "
<option value={$general[no]} {$style}>{$general[name]}</option>"; <option value={$general['no']} {$style}>{$general['name']}</option>";
} }
} }
@@ -1945,7 +1945,7 @@ function command_46($connect, $turn, $command) {
for($i=0; $i < $nationcount; $i++) { for($i=0; $i < $nationcount; $i++) {
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
$nationcolor[$i] = $nation[color]; $nationcolor[$i] = $nation['color'];
} }
$validCount = count($color); $validCount = count($color);
//등록된 색깔 가려내기 //등록된 색깔 가려내기
@@ -1965,7 +1965,7 @@ function command_46($connect, $turn, $command) {
} }
} }
if($nationcount < $admin[maxnation]) { if($nationcount < $admin['maxnation']) {
echo " echo "
현재 도시에서 나라를 세웁니다. 중, 소도시에서만 가능합니다.<br> 현재 도시에서 나라를 세웁니다. 중, 소도시에서만 가능합니다.<br>
@@ -2029,13 +2029,13 @@ function command_46($connect, $turn, $command) {
function command_48($connect, $turn, $command) { function command_48($connect, $turn, $command) {
starter("장비 매매"); starter("장비 매매");
$query = "select no,city,gold from general where user_id='$_SESSION[p_id]'"; $query = "select no,city,gold from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error("command_48 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("command_48 ".MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
$city = getCity($connect, $me[city], "secu"); $city = getCity($connect, $me['city'], "secu");
for($i=1; $i <= 6; $i++) { for($i=1; $i <= 6; $i++) {
if($city[secu] >= $i*1000) { if($city['secu'] >= $i*1000) {
$color[$i] = "white"; $color[$i] = "white";
} else { } else {
$color[$i] = "red"; $color[$i] = "red";
@@ -2045,7 +2045,7 @@ function command_48($connect, $turn, $command) {
echo " echo "
장비를 구입하거나 매각합니다.<br> 장비를 구입하거나 매각합니다.<br>
현재 구입 불가능한 것은 <font color=red>붉은색</font>으로 표시됩니다.<br> 현재 구입 불가능한 것은 <font color=red>붉은색</font>으로 표시됩니다.<br>
현재 도시 치안 : $city[secu] &nbsp;&nbsp;&nbsp;현재 자금 : $me[gold]<br> 현재 도시 치안 : $city['secu'] &nbsp;&nbsp;&nbsp;현재 자금 : $me['gold']<br>
<form name=form1 action=c_double.php method=post> <form name=form1 action=c_double.php method=post>
장비 : <select name=double size=1 style=color:white;background-color:black> 장비 : <select name=double size=1 style=color:white;background-color:black>
<option value=0 style=color:skyblue>_____무기매각(반값)____</option> <option value=0 style=color:skyblue>_____무기매각(반값)____</option>
@@ -2139,11 +2139,11 @@ function command_49($connect, $turn, $command) {
function command_51($connect, $turn, $command) { function command_51($connect, $turn, $command) {
starter("항복 권고", 1); starter("항복 권고", 1);
$query = "select nation from general where user_id='$_SESSION[p_id]'"; $query = "select nation from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
$query = "select nation,power from nation where nation='$me[nation]'"; $query = "select nation,power from nation where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$myNation = MYDB_fetch_array($result); $myNation = MYDB_fetch_array($result);
@@ -2155,17 +2155,17 @@ function command_51($connect, $turn, $command) {
<form name=form1 action=c_double.php method=post> <form name=form1 action=c_double.php method=post>
<select name=double size=1 style=color:white;background-color:black>"; <select name=double size=1 style=color:white;background-color:black>";
$query = "select nation,name,power,color from nation where nation!='$me[nation]'"; $query = "select nation,name,power,color from nation where nation!='$me['nation']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=1; $i <= $count; $i++) { for($i=1; $i <= $count; $i++) {
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
if($myNation[power] / $nation[power] <= 3 || !isClose($connect, $me[nation], $nation[nation])) { if($myNation['power'] / $nation['power'] <= 3 || !isClose($connect, $me['nation'], $nation['nation'])) {
echo "<option style=color:{$nation[color]};background-color:red; value=$nation[nation]>【 {$nation[name]} 】</option>"; echo "<option style=color:{$nation['color']};background-color:red; value=$nation['nation']>【 {$nation['name']} 】</option>";
} else { } else {
echo "<option style=color:{$nation[color]} value=$nation[nation]>【 {$nation[name]} 】</option>"; echo "<option style=color:{$nation['color']} value=$nation['nation']>【 {$nation['name']} 】</option>";
} }
} }
echo " echo "
@@ -2190,11 +2190,11 @@ function command_51($connect, $turn, $command) {
function command_52($connect, $turn, $command) { function command_52($connect, $turn, $command) {
starter("원조", 1); starter("원조", 1);
$query = "select nation from general where user_id='$_SESSION[p_id]'"; $query = "select nation from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
$query = "select nation,level from nation where nation='$me[nation]'"; $query = "select nation,level from nation where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$mynation = MYDB_fetch_array($result); $mynation = MYDB_fetch_array($result);
@@ -2212,14 +2212,14 @@ function command_52($connect, $turn, $command) {
<form name=form1 action=c_double.php method=post> <form name=form1 action=c_double.php method=post>
대상 국가 <select name=double size=1 style=color:white;background-color:black>"; 대상 국가 <select name=double size=1 style=color:white;background-color:black>";
$query = "select nation,name,color from nation where nation!='$me[nation]'"; $query = "select nation,name,color from nation where nation!='$me['nation']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=1; $i <= $count; $i++) { for($i=1; $i <= $count; $i++) {
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
echo "<option style=color:{$nation[color]} value=$nation[nation]>【 {$nation[name]} 】</option>"; echo "<option style=color:{$nation['color']} value=$nation['nation']>【 {$nation['name']} 】</option>";
} }
echo " echo "
</select> </select>
@@ -2234,7 +2234,7 @@ function command_52($connect, $turn, $command) {
<option value=7>7000</option> <option value=7>7000</option>
<option value=8>8000</option> <option value=8>8000</option>
<option value=9>9000</option>"; <option value=9>9000</option>";
for($i=1; $i <= $mynation[level]; $i++) { for($i=1; $i <= $mynation['level']; $i++) {
echo "<option value={$i}0>{$i}0000</option>"; echo "<option value={$i}0>{$i}0000</option>";
} }
echo " echo "
@@ -2250,7 +2250,7 @@ function command_52($connect, $turn, $command) {
<option value=7>7000</option> <option value=7>7000</option>
<option value=8>8000</option> <option value=8>8000</option>
<option value=9>9000</option>"; <option value=9>9000</option>";
for($i=1; $i <= $mynation[level]; $i++) { for($i=1; $i <= $mynation['level']; $i++) {
echo "<option value={$i}0>{$i}0000</option>"; echo "<option value={$i}0>{$i}0000</option>";
} }
echo " echo "
@@ -2271,7 +2271,7 @@ function command_52($connect, $turn, $command) {
function command_53($connect, $turn, $command) { function command_53($connect, $turn, $command) {
starter("통합제의", 1); starter("통합제의", 1);
$query = "select no,nation from general where user_id='$_SESSION[p_id]'"; $query = "select no,nation from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error("command_53 ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("command_53 ".MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
@@ -2283,7 +2283,7 @@ function command_53($connect, $turn, $command) {
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$stdNation = MYDB_fetch_array($result); $stdNation = MYDB_fetch_array($result);
$query = "select nation,power,gennum from nation where nation='$me[nation]'"; $query = "select nation,power,gennum from nation where nation='$me['nation']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$myNation = MYDB_fetch_array($result); $myNation = MYDB_fetch_array($result);
@@ -2295,20 +2295,20 @@ function command_53($connect, $turn, $command) {
<form name=form1 action=c_double.php method=post> <form name=form1 action=c_double.php method=post>
대상국 : <select name=double size=1 style=color:white;background-color:black>"; 대상국 : <select name=double size=1 style=color:white;background-color:black>";
$query = "select nation,name,power,gennum,color from nation where nation!='$me[nation]'"; $query = "select nation,name,power,gennum,color from nation where nation!='$me['nation']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
$cond1 = $avgNation[power]+$stdNation[power]; $cond1 = $avgNation['power']+$stdNation['power'];
$cond2 = $avgNation[gennum]+$stdNation[gennum]; $cond2 = $avgNation['gennum']+$stdNation['gennum'];
for($i=1; $i <= $count; $i++) { for($i=1; $i <= $count; $i++) {
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
if($myNation[power]+$nation[power] > $cond1 || $myNation[gennum]+$nation[gennum] > $cond2 || !isClose($connect, $me[nation], $nation[nation])) { if($myNation['power']+$nation['power'] > $cond1 || $myNation['gennum']+$nation['gennum'] > $cond2 || !isClose($connect, $me['nation'], $nation['nation'])) {
echo "<option style=color:{$nation[color]};background-color:red; value=$nation[nation]>【 {$nation[name]} 】</option>"; echo "<option style=color:{$nation['color']};background-color:red; value=$nation['nation']>【 {$nation['name']} 】</option>";
} else { } else {
echo "<option style=color:{$nation[color]} value=$nation[nation]>【 {$nation[name]} 】</option>"; echo "<option style=color:{$nation['color']} value=$nation['nation']>【 {$nation['name']} 】</option>";
} }
} }
@@ -2335,11 +2335,11 @@ function command_53($connect, $turn, $command) {
function command_54($connect, $turn, $command) { function command_54($connect, $turn, $command) {
starter("선양"); starter("선양");
$query = "select no,nation from general where user_id='$_SESSION[p_id]'"; $query = "select no,nation from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$query = "select no,name,level from general where nation='$general[nation]' and no!='$general[no]' order by npc,binary(name)"; $query = "select no,name,level from general where nation='$general['nation']' and no!='$general['no']' order by npc,binary(name)";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$gencount = MYDB_num_rows($result); $gencount = MYDB_num_rows($result);
@@ -2351,12 +2351,12 @@ function command_54($connect, $turn, $command) {
for($i=0; $i < $gencount; $i++) { for($i=0; $i < $gencount; $i++) {
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
if($general[level] >= 5) { if($general['level'] >= 5) {
echo " echo "
<option value={$general[no]}>*{$general[name]}*</option>"; <option value={$general['no']}>*{$general['name']}*</option>";
} else { } else {
echo " echo "
<option value={$general[no]}>{$general[name]}</option>"; <option value={$general['no']}>{$general['name']}</option>";
} }
} }
@@ -2379,7 +2379,7 @@ function command_54($connect, $turn, $command) {
function command_61($connect, $turn, $command) { function command_61($connect, $turn, $command) {
starter("불가침", 1); starter("불가침", 1);
$query = "select nation from general where user_id='$_SESSION[p_id]'"; $query = "select nation from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
@@ -2391,22 +2391,22 @@ function command_61($connect, $turn, $command) {
<form name=form1 action=c_double.php method=post> <form name=form1 action=c_double.php method=post>
대상 국가 <select name=double size=1 style=color:white;background-color:black>"; 대상 국가 <select name=double size=1 style=color:white;background-color:black>";
$query = "select you,state from diplomacy where me='$me[nation]'"; $query = "select you,state from diplomacy where me='$me['nation']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=1; $i <= $count; $i++) { for($i=1; $i <= $count; $i++) {
$dip = MYDB_fetch_array($result); $dip = MYDB_fetch_array($result);
$diplomacy[$dip[you]] = $dip[state]; $diplomacy[$dip['you']] = $dip['state'];
} }
$query = "select nation,name,color from nation where nation!='$me[nation]'"; $query = "select nation,name,color from nation where nation!='$me['nation']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=1; $i <= $count; $i++) { for($i=1; $i <= $count; $i++) {
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
switch($diplomacy[$nation[nation]]) { switch($diplomacy[$nation['nation']]) {
case 0: $color = "red"; break; case 0: $color = "red"; break;
case 1: $color = "red"; break; case 1: $color = "red"; break;
case 2: $color = "black"; break; case 2: $color = "black"; break;
@@ -2416,7 +2416,7 @@ function command_61($connect, $turn, $command) {
case 6: $color = "red"; break; case 6: $color = "red"; break;
case 7: $color = "blue"; break; case 7: $color = "blue"; break;
} }
echo "<option style=background-color:$color;color:$nation[color]; value=$nation[nation]>【 {$nation[name]} 】</option>"; echo "<option style=background-color:$color;color:$nation['color']; value=$nation['nation']>【 {$nation['name']} 】</option>";
} }
echo " echo "
</select> </select>
@@ -2460,7 +2460,7 @@ function command_61($connect, $turn, $command) {
function command_62($connect, $turn, $command) { function command_62($connect, $turn, $command) {
starter("선전포고", 1); starter("선전포고", 1);
$query = "select nation from general where user_id='$_SESSION[p_id]'"; $query = "select nation from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
@@ -2473,29 +2473,29 @@ function command_62($connect, $turn, $command) {
<form name=form1 action=c_double.php method=post> <form name=form1 action=c_double.php method=post>
대상 국가 <select name=double size=1 style=color:white;background-color:black>"; 대상 국가 <select name=double size=1 style=color:white;background-color:black>";
$query = "select you,state from diplomacy where me='$me[nation]'"; $query = "select you,state from diplomacy where me='$me['nation']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=1; $i <= $count; $i++) { for($i=1; $i <= $count; $i++) {
$dip = MYDB_fetch_array($result); $dip = MYDB_fetch_array($result);
$diplomacy[$dip[you]] = $dip[state]; $diplomacy[$dip['you']] = $dip['state'];
} }
$query = "select nation,name,color from nation where nation!='$me[nation]'"; $query = "select nation,name,color from nation where nation!='$me['nation']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=1; $i <= $count; $i++) { for($i=1; $i <= $count; $i++) {
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
//합병중 국가는 안됨 //합병중 국가는 안됨
$query = "select state from diplomacy where me='$nation[nation]' and (state='3' or state='5')"; $query = "select state from diplomacy where me='$nation['nation']' and (state='3' or state='5')";
$tempresult = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $tempresult = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$anycount = MYDB_num_rows($tempresult); $anycount = MYDB_num_rows($tempresult);
if($anycount != 0 && $diplomacy[$nation[nation]] != 7) { if($anycount != 0 && $diplomacy[$nation['nation']] != 7) {
$diplomacy[$nation[nation]] = 3; $diplomacy[$nation['nation']] = 3;
} }
switch($diplomacy[$nation[nation]]) { switch($diplomacy[$nation['nation']]) {
case 0: $color = "red"; break; case 0: $color = "red"; break;
case 1: $color = "red"; break; case 1: $color = "red"; break;
case 2: $color = "black"; break; case 2: $color = "black"; break;
@@ -2505,7 +2505,7 @@ function command_62($connect, $turn, $command) {
case 6: $color = "black"; break; case 6: $color = "black"; break;
case 7: $color = "blue"; break; case 7: $color = "blue"; break;
} }
echo "<option style=background-color:$color;color:$nation[color]; value=$nation[nation]>【 {$nation[name]} 】</option>"; echo "<option style=background-color:$color;color:$nation['color']; value=$nation['nation']>【 {$nation['name']} 】</option>";
} }
echo " echo "
</select> </select>
@@ -2525,7 +2525,7 @@ function command_62($connect, $turn, $command) {
function command_63($connect, $turn, $command) { function command_63($connect, $turn, $command) {
starter("종전", 1); starter("종전", 1);
$query = "select nation from general where user_id='$_SESSION[p_id]'"; $query = "select nation from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
@@ -2536,22 +2536,22 @@ function command_63($connect, $turn, $command) {
<form name=form1 action=c_double.php method=post> <form name=form1 action=c_double.php method=post>
대상 국가 <select name=double size=1 style=color:white;background-color:black>"; 대상 국가 <select name=double size=1 style=color:white;background-color:black>";
$query = "select you,state from diplomacy where me='$me[nation]'"; $query = "select you,state from diplomacy where me='$me['nation']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=1; $i <= $count; $i++) { for($i=1; $i <= $count; $i++) {
$dip = MYDB_fetch_array($result); $dip = MYDB_fetch_array($result);
$diplomacy[$dip[you]] = $dip[state]; $diplomacy[$dip['you']] = $dip['state'];
} }
$query = "select nation,name,color from nation where nation!='$me[nation]'"; $query = "select nation,name,color from nation where nation!='$me['nation']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=1; $i <= $count; $i++) { for($i=1; $i <= $count; $i++) {
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
switch($diplomacy[$nation[nation]]) { switch($diplomacy[$nation['nation']]) {
case 0: $color = "black"; break; case 0: $color = "black"; break;
case 1: $color = "black"; break; case 1: $color = "black"; break;
case 2: $color = "red"; break; case 2: $color = "red"; break;
@@ -2561,7 +2561,7 @@ function command_63($connect, $turn, $command) {
case 6: $color = "red"; break; case 6: $color = "red"; break;
case 7: $color = "red"; break; case 7: $color = "red"; break;
} }
echo "<option style=background-color:$color;color:$nation[color]; value=$nation[nation]>【 {$nation[name]} 】</option>"; echo "<option style=background-color:$color;color:$nation['color']; value=$nation['nation']>【 {$nation['name']} 】</option>";
} }
echo " echo "
</select> </select>
@@ -2581,7 +2581,7 @@ function command_63($connect, $turn, $command) {
function command_64($connect, $turn, $command) { function command_64($connect, $turn, $command) {
starter("파기", 1); starter("파기", 1);
$query = "select nation from general where user_id='$_SESSION[p_id]'"; $query = "select nation from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
@@ -2592,22 +2592,22 @@ function command_64($connect, $turn, $command) {
<form name=form1 action=c_double.php method=post> <form name=form1 action=c_double.php method=post>
대상 국가 <select name=double size=1 style=color:white;background-color:black>"; 대상 국가 <select name=double size=1 style=color:white;background-color:black>";
$query = "select you,state from diplomacy where me='$me[nation]'"; $query = "select you,state from diplomacy where me='$me['nation']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=1; $i <= $count; $i++) { for($i=1; $i <= $count; $i++) {
$dip = MYDB_fetch_array($result); $dip = MYDB_fetch_array($result);
$diplomacy[$dip[you]] = $dip[state]; $diplomacy[$dip['you']] = $dip['state'];
} }
$query = "select nation,name,color from nation where nation!='$me[nation]'"; $query = "select nation,name,color from nation where nation!='$me['nation']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=1; $i <= $count; $i++) { for($i=1; $i <= $count; $i++) {
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
switch($diplomacy[$nation[nation]]) { switch($diplomacy[$nation['nation']]) {
case 0: $color = "red"; break; case 0: $color = "red"; break;
case 1: $color = "red"; break; case 1: $color = "red"; break;
case 2: $color = "red"; break; case 2: $color = "red"; break;
@@ -2617,7 +2617,7 @@ function command_64($connect, $turn, $command) {
case 6: $color = "red"; break; case 6: $color = "red"; break;
case 7: $color = "blue"; break; case 7: $color = "blue"; break;
} }
echo "<option style=background-color:$color;color:$nation[color]; value=$nation[nation]>【 {$nation[name]} 】</option>"; echo "<option style=background-color:$color;color:$nation['color']; value=$nation['nation']>【 {$nation['name']} 】</option>";
} }
echo " echo "
</select> </select>
@@ -2636,11 +2636,11 @@ function command_64($connect, $turn, $command) {
function command_65($connect, $turn, $command) { function command_65($connect, $turn, $command) {
starter("초토화", 1); starter("초토화", 1);
$query = "select city from general where user_id='$_SESSION[p_id]'"; $query = "select city from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$query = "select name,path from city where city='$general[city]'"; $query = "select name,path from city where city='$general['city']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$currentcity = MYDB_fetch_array($result); $currentcity = MYDB_fetch_array($result);
@@ -2673,11 +2673,11 @@ echo "
function command_66($connect, $turn, $command) { function command_66($connect, $turn, $command) {
starter("천도", 1); starter("천도", 1);
$query = "select city from general where user_id='$_SESSION[p_id]'"; $query = "select city from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$query = "select name,path from city where city='$general[city]'"; $query = "select name,path from city where city='$general['city']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$currentcity = MYDB_fetch_array($result); $currentcity = MYDB_fetch_array($result);
@@ -2711,11 +2711,11 @@ echo "
function command_67($connect, $turn, $command) { function command_67($connect, $turn, $command) {
starter("증축", 1); starter("증축", 1);
$query = "select city from general where user_id='$_SESSION[p_id]'"; $query = "select city from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$query = "select name,path from city where city='$general[city]'"; $query = "select name,path from city where city='$general['city']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$currentcity = MYDB_fetch_array($result); $currentcity = MYDB_fetch_array($result);
@@ -2749,11 +2749,11 @@ echo "
function command_68($connect, $turn, $command) { function command_68($connect, $turn, $command) {
starter("감축", 1); starter("감축", 1);
$query = "select city from general where user_id='$_SESSION[p_id]'"; $query = "select city from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$query = "select name,path from city where city='$general[city]'"; $query = "select name,path from city where city='$general['city']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$currentcity = MYDB_fetch_array($result); $currentcity = MYDB_fetch_array($result);
@@ -2787,11 +2787,11 @@ echo "
function command_72($connect, $turn, $command) { function command_72($connect, $turn, $command) {
starter("백성동원", 1); starter("백성동원", 1);
$query = "select city from general where user_id='$_SESSION[p_id]'"; $query = "select city from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$query = "select name,path from city where city='$general[city]'"; $query = "select name,path from city where city='$general['city']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$currentcity = MYDB_fetch_array($result); $currentcity = MYDB_fetch_array($result);
@@ -2825,11 +2825,11 @@ echo "
function command_73($connect, $turn, $command) { function command_73($connect, $turn, $command) {
starter("수몰", 1); starter("수몰", 1);
$query = "select city from general where user_id='$_SESSION[p_id]'"; $query = "select city from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$query = "select name,path from city where city='$general[city]'"; $query = "select name,path from city where city='$general['city']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$currentcity = MYDB_fetch_array($result); $currentcity = MYDB_fetch_array($result);
@@ -2863,11 +2863,11 @@ echo "
function command_74($connect, $turn, $command) { function command_74($connect, $turn, $command) {
starter("허보", 1); starter("허보", 1);
$query = "select city from general where user_id='$_SESSION[p_id]'"; $query = "select city from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$general = MYDB_fetch_array($result); $general = MYDB_fetch_array($result);
$query = "select name,path from city where city='$general[city]'"; $query = "select name,path from city where city='$general['city']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$currentcity = MYDB_fetch_array($result); $currentcity = MYDB_fetch_array($result);
@@ -2902,7 +2902,7 @@ echo "
function command_75($connect, $turn, $command) { function command_75($connect, $turn, $command) {
starter("피장파장", 1); starter("피장파장", 1);
$query = "select nation from general where user_id='$_SESSION[p_id]'"; $query = "select nation from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
@@ -2914,22 +2914,22 @@ function command_75($connect, $turn, $command) {
<form name=form1 action=c_double.php method=post> <form name=form1 action=c_double.php method=post>
대상 국가 <select name=double size=1 style=color:white;background-color:black>"; 대상 국가 <select name=double size=1 style=color:white;background-color:black>";
$query = "select you,state from diplomacy where me='$me[nation]'"; $query = "select you,state from diplomacy where me='$me['nation']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=1; $i <= $count; $i++) { for($i=1; $i <= $count; $i++) {
$dip = MYDB_fetch_array($result); $dip = MYDB_fetch_array($result);
$diplomacy[$dip[you]] = $dip[state]; $diplomacy[$dip['you']] = $dip['state'];
} }
$query = "select nation,name,color from nation where nation!='$me[nation]'"; $query = "select nation,name,color from nation where nation!='$me['nation']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=1; $i <= $count; $i++) { for($i=1; $i <= $count; $i++) {
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
switch($diplomacy[$nation[nation]]) { switch($diplomacy[$nation['nation']]) {
case 0: $color = "black"; break; case 0: $color = "black"; break;
case 1: $color = "black"; break; case 1: $color = "black"; break;
case 2: $color = "red"; break; case 2: $color = "red"; break;
@@ -2939,7 +2939,7 @@ function command_75($connect, $turn, $command) {
case 6: $color = "red"; break; case 6: $color = "red"; break;
case 7: $color = "blue"; break; case 7: $color = "blue"; break;
} }
echo "<option style=background-color:$color;color:$nation[color]; value=$nation[nation]>【 {$nation[name]} 】</option>"; echo "<option style=background-color:$color;color:$nation['color']; value=$nation['nation']>【 {$nation['name']} 】</option>";
} }
echo " echo "
</select> </select>
@@ -2959,7 +2959,7 @@ function command_75($connect, $turn, $command) {
function command_77($connect, $turn, $command) { function command_77($connect, $turn, $command) {
starter("이호경식", 1); starter("이호경식", 1);
$query = "select nation from general where user_id='$_SESSION[p_id]'"; $query = "select nation from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
@@ -2971,22 +2971,22 @@ function command_77($connect, $turn, $command) {
<form name=form1 action=c_double.php method=post> <form name=form1 action=c_double.php method=post>
대상 국가 <select name=double size=1 style=color:white;background-color:black>"; 대상 국가 <select name=double size=1 style=color:white;background-color:black>";
$query = "select you,state from diplomacy where me='$me[nation]'"; $query = "select you,state from diplomacy where me='$me['nation']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=1; $i <= $count; $i++) { for($i=1; $i <= $count; $i++) {
$dip = MYDB_fetch_array($result); $dip = MYDB_fetch_array($result);
$diplomacy[$dip[you]] = $dip[state]; $diplomacy[$dip['you']] = $dip['state'];
} }
$query = "select nation,name,color from nation where nation!='$me[nation]'"; $query = "select nation,name,color from nation where nation!='$me['nation']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=1; $i <= $count; $i++) { for($i=1; $i <= $count; $i++) {
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
switch($diplomacy[$nation[nation]]) { switch($diplomacy[$nation['nation']]) {
case 0: $color = "black"; break; case 0: $color = "black"; break;
case 1: $color = "black"; break; case 1: $color = "black"; break;
case 2: $color = "red"; break; case 2: $color = "red"; break;
@@ -2996,7 +2996,7 @@ function command_77($connect, $turn, $command) {
case 6: $color = "red"; break; case 6: $color = "red"; break;
case 7: $color = "blue"; break; case 7: $color = "blue"; break;
} }
echo "<option style=background-color:$color;color:$nation[color]; value=$nation[nation]>【 {$nation[name]} 】</option>"; echo "<option style=background-color:$color;color:$nation['color']; value=$nation['nation']>【 {$nation['name']} 】</option>";
} }
echo " echo "
</select> </select>
@@ -3016,7 +3016,7 @@ function command_77($connect, $turn, $command) {
function command_78($connect, $turn, $command) { function command_78($connect, $turn, $command) {
starter("급습", 1); starter("급습", 1);
$query = "select nation from general where user_id='$_SESSION[p_id]'"; $query = "select nation from general where user_id='$_SESSION['p_id']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$me = MYDB_fetch_array($result); $me = MYDB_fetch_array($result);
@@ -3028,22 +3028,22 @@ function command_78($connect, $turn, $command) {
<form name=form1 action=c_double.php method=post> <form name=form1 action=c_double.php method=post>
대상 국가 <select name=double size=1 style=color:white;background-color:black>"; 대상 국가 <select name=double size=1 style=color:white;background-color:black>";
$query = "select you,state from diplomacy where me='$me[nation]'"; $query = "select you,state from diplomacy where me='$me['nation']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=1; $i <= $count; $i++) { for($i=1; $i <= $count; $i++) {
$dip = MYDB_fetch_array($result); $dip = MYDB_fetch_array($result);
$diplomacy[$dip[you]] = $dip[state]; $diplomacy[$dip['you']] = $dip['state'];
} }
$query = "select nation,name,color from nation where nation!='$me[nation]'"; $query = "select nation,name,color from nation where nation!='$me['nation']'";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=1; $i <= $count; $i++) { for($i=1; $i <= $count; $i++) {
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
switch($diplomacy[$nation[nation]]) { switch($diplomacy[$nation['nation']]) {
case 0: $color = "red"; break; case 0: $color = "red"; break;
case 1: $color = "black"; break; case 1: $color = "black"; break;
case 2: $color = "red"; break; case 2: $color = "red"; break;
@@ -3053,7 +3053,7 @@ function command_78($connect, $turn, $command) {
case 6: $color = "red"; break; case 6: $color = "red"; break;
case 7: $color = "blue"; break; case 7: $color = "blue"; break;
} }
echo "<option style=background-color:$color;color:$nation[color]; value=$nation[nation]>【 {$nation[name]} 】</option>"; echo "<option style=background-color:$color;color:$nation['color']; value=$nation['nation']>【 {$nation['name']} 】</option>";
} }
echo " echo "
</select> </select>
@@ -3081,7 +3081,7 @@ function command_81($connect, $turn, $command) {
for($i=0; $i < $nationcount; $i++) { for($i=0; $i < $nationcount; $i++) {
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
$nationcolor[$i] = $nation[color]; $nationcolor[$i] = $nation['color'];
} }
$validCount = count($color); $validCount = count($color);
//등록된 색깔 가려내기 //등록된 색깔 가려내기
+3 -3
View File
@@ -43,8 +43,8 @@ $connect=dbConn();
$query = "select startyear,year,month,turnterm,scenario,extend,fiction,img from game where no='1'"; $query = "select startyear,year,month,turnterm,scenario,extend,fiction,img 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);
$fiction = $admin[fiction]; $turnterm = $admin[turnterm]; $startyear = $admin[startyear]; $year = $admin[year]; $extend = $admin[extend]; $fiction = $admin['fiction']; $turnterm = $admin['turnterm']; $startyear = $admin['startyear']; $year = $admin['year']; $extend = $admin['extend'];
$img = $admin[img]; $img = $admin['img'];
//역사모드1 : 184년 황건적의 난 //역사모드1 : 184년 황건적의 난
//////////////////////////국가1///////////////////////////////////////////////// //////////////////////////국가1/////////////////////////////////////////////////
@@ -780,7 +780,7 @@ $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($con
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) { for($i=0; $i < $count; $i++) {
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
SetNationFront($connect, $nation[nation]); SetNationFront($connect, $nation['nation']);
} }
//////////////////////////도시 끝/////////////////////////////////////////////// //////////////////////////도시 끝///////////////////////////////////////////////
+3 -3
View File
@@ -43,8 +43,8 @@ $connect=dbConn();
$query = "select startyear,year,month,turnterm,scenario,extend,fiction,img from game where no='1'"; $query = "select startyear,year,month,turnterm,scenario,extend,fiction,img from game where no='1'";
$result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$admin = MYDB_fetch_array($result); $admin = MYDB_fetch_array($result);
$fiction = $admin[fiction]; $turnterm = $admin[turnterm]; $startyear = $admin[startyear]; $year = $admin[year]; $extend = $admin[extend]; $fiction = $admin['fiction']; $turnterm = $admin['turnterm']; $startyear = $admin['startyear']; $year = $admin['year']; $extend = $admin['extend'];
$img = $admin[img]; $img = $admin['img'];
//역사모드10 : 225년 칠종칠금 //역사모드10 : 225년 칠종칠금
//////////////////////////국가1///////////////////////////////////////////////// //////////////////////////국가1/////////////////////////////////////////////////
@@ -883,7 +883,7 @@ $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($con
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) { for($i=0; $i < $count; $i++) {
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
SetNationFront($connect, $nation[nation]); SetNationFront($connect, $nation['nation']);
} }
//////////////////////////도시 끝/////////////////////////////////////////////// //////////////////////////도시 끝///////////////////////////////////////////////
+3 -3
View File
@@ -43,8 +43,8 @@ $connect=dbConn();
$query = "select startyear,year,month,turnterm,scenario,extend,fiction,img from game where no='1'"; $query = "select startyear,year,month,turnterm,scenario,extend,fiction,img from game where no='1'";
$result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$admin = MYDB_fetch_array($result); $admin = MYDB_fetch_array($result);
$fiction = $admin[fiction]; $turnterm = $admin[turnterm]; $startyear = $admin[startyear]; $year = $admin[year]; $extend = $admin[extend]; $fiction = $admin['fiction']; $turnterm = $admin['turnterm']; $startyear = $admin['startyear']; $year = $admin['year']; $extend = $admin['extend'];
$img = $admin[img]; $img = $admin['img'];
//역사모드11 : 228년 출사표 //역사모드11 : 228년 출사표
//////////////////////////국가1///////////////////////////////////////////////// //////////////////////////국가1/////////////////////////////////////////////////
@@ -883,7 +883,7 @@ $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($con
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) { for($i=0; $i < $count; $i++) {
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
SetNationFront($connect, $nation[nation]); SetNationFront($connect, $nation['nation']);
} }
//////////////////////////도시 끝/////////////////////////////////////////////// //////////////////////////도시 끝///////////////////////////////////////////////
+3 -3
View File
@@ -43,8 +43,8 @@ $connect=dbConn();
$query = "select startyear,year,month,turnterm,scenario,extend,fiction,img from game where no='1'"; $query = "select startyear,year,month,turnterm,scenario,extend,fiction,img 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);
$fiction = $admin[fiction]; $turnterm = $admin[turnterm]; $startyear = $admin[startyear]; $year = $admin[year]; $extend = $admin[extend]; $fiction = $admin['fiction']; $turnterm = $admin['turnterm']; $startyear = $admin['startyear']; $year = $admin['year']; $extend = $admin['extend'];
$img = $admin[img]; $img = $admin['img'];
//IF모드1 : 191년 백마장군의 위세 //IF모드1 : 191년 백마장군의 위세
//국가1 원소 국가2 공손찬 국가3 동탁 국가4 원술 국가5 유언 국가6 마등 국가7 유표 //국가1 원소 국가2 공손찬 국가3 동탁 국가4 원술 국가5 유언 국가6 마등 국가7 유표
@@ -1166,7 +1166,7 @@ $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($con
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) { for($i=0; $i < $count; $i++) {
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
SetNationFront($connect, $nation[nation]); SetNationFront($connect, $nation['nation']);
} }
//////////////////////////도시 끝/////////////////////////////////////////////// //////////////////////////도시 끝///////////////////////////////////////////////
+3 -3
View File
@@ -43,8 +43,8 @@ $connect=dbConn();
$query = "select startyear,year,month,turnterm,scenario,extend,fiction,img from game where no='1'"; $query = "select startyear,year,month,turnterm,scenario,extend,fiction,img from game where no='1'";
$result = MYDB_query($query, $connect) or Error("scenario_190A ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("scenario_190A ".MYDB_error($connect),"");
$admin = MYDB_fetch_array($result); $admin = MYDB_fetch_array($result);
$fiction = $admin[fiction]; $turnterm = $admin[turnterm]; $startyear = $admin[startyear]; $year = $admin[year]; $extend = $admin[extend]; $fiction = $admin['fiction']; $turnterm = $admin['turnterm']; $startyear = $admin['startyear']; $year = $admin['year']; $extend = $admin['extend'];
$img = $admin[img]; $img = $admin['img'];
//역사모드2 : 190년 반동탁연합 //역사모드2 : 190년 반동탁연합
//국가1 동탁 국가2 원소 국가3 유표 국가4 조조 국가5 유언 국가6 원술 국가7 손견 //국가1 동탁 국가2 원소 국가3 유표 국가4 조조 국가5 유언 국가6 원술 국가7 손견
@@ -1686,7 +1686,7 @@ $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($con
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) { for($i=0; $i < $count; $i++) {
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
SetNationFront($connect, $nation[nation]); SetNationFront($connect, $nation['nation']);
} }
//////////////////////////도시 끝/////////////////////////////////////////////// //////////////////////////도시 끝///////////////////////////////////////////////
+2 -2
View File
@@ -43,8 +43,8 @@ $connect=dbConn();
$query = "select startyear,year,month,turnterm,scenario,extend,fiction,img from game where no='1'"; $query = "select startyear,year,month,turnterm,scenario,extend,fiction,img from game where no='1'";
$result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$admin = MYDB_fetch_array($result); $admin = MYDB_fetch_array($result);
$fiction = 1; $turnterm = $admin[turnterm]; $startyear = $admin[startyear]; $year = $admin[year]; $extend = $admin[extend]; $fiction = 1; $turnterm = $admin['turnterm']; $startyear = $admin['startyear']; $year = $admin['year']; $extend = $admin['extend'];
$img = $admin[img]; $img = $admin['img'];
//가상모드1 : 180년 영웅 난무 //가상모드1 : 180년 영웅 난무
//////////////////////////외교////////////////////////////////////////////////// //////////////////////////외교//////////////////////////////////////////////////
+2 -2
View File
@@ -43,8 +43,8 @@ $connect=dbConn();
$query = "select startyear,year,month,turnterm,scenario,extend,fiction,img from game where no='1'"; $query = "select startyear,year,month,turnterm,scenario,extend,fiction,img from game where no='1'";
$result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$admin = MYDB_fetch_array($result); $admin = MYDB_fetch_array($result);
$fiction = 1; $turnterm = $admin[turnterm]; $startyear = $admin[startyear]; $year = $admin[year]; $extend = $admin[extend]; $fiction = 1; $turnterm = $admin['turnterm']; $startyear = $admin['startyear']; $year = $admin['year']; $extend = $admin['extend'];
$img = $admin[img]; $img = $admin['img'];
//가상모드1 : 180년 영웅 집결 //가상모드1 : 180년 영웅 집결
//////////////////////////국가1///////////////////////////////////////////////// //////////////////////////국가1/////////////////////////////////////////////////
+92 -92
View File
@@ -17,94 +17,94 @@ $admin = MYDB_fetch_array($result);
//////////////////////////장수////////////////////////////////////////////////// //////////////////////////장수//////////////////////////////////////////////////
// 이름 통 무 지 꿈 특기 // 이름 통 무 지 꿈 특기
$gencount = 1679; $gencount = 1679;
RegGeneral2($connect,$admin[turnterm],$gencount,"6글자 이내", 63, 46, 62,"안전","징병", "장수명에 6글자 이내로 입력하라고 해서 6글자 이내를 입력했습니다."); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount,"6글자 이내", 63, 46, 62,"안전","징병", "장수명에 6글자 이내로 입력하라고 해서 6글자 이내를 입력했습니다."); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "Cato", 44, 41, 67,"재간","저격", "★☆ 승리의 카토 ★☆"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "Cato", 44, 41, 67,"재간","저격", "★☆ 승리의 카토 ★☆"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "hui", 42, 61, 53,"재간","저격", "모반으로 천통군주된 먹튀 후이에요~"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "hui", 42, 61, 53,"재간","저격", "모반으로 천통군주된 먹튀 후이에요~"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "Misty", 63, 71, 25,"패권","격노", ""); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "Misty", 63, 71, 25,"패권","격노", ""); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "yhp", 34, 53, 75,"재간","신산", ""); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "yhp", 34, 53, 75,"재간","신산", ""); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "갈매기", 46, 32, 70,"재간","귀병", "끼룩 끼룩 끼끼룩~"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "갈매기", 46, 32, 70,"재간","귀병", "끼룩 끼룩 끼끼룩~"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "강유", 75, 18, 74,"왕좌","무쌍", "제대할때까지 NPC가 대신 활동함..."); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "강유", 75, 18, 74,"왕좌","무쌍", "제대할때까지 NPC가 대신 활동함..."); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "개수작", 74, 72, 19,"출세","돌격", ""); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "개수작", 74, 72, 19,"출세","돌격", ""); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "견희", 62, 76, 13,"정복","무쌍", "피리로 다 쓸어버리겠다!"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "견희", 62, 76, 13,"정복","무쌍", "피리로 다 쓸어버리겠다!"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "계백의난", 82, 65, 18,"패권","공성", "이거 이름 잘못됐네요. 훼백의난이에요."); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "계백의난", 82, 65, 18,"패권","공성", "이거 이름 잘못됐네요. 훼백의난이에요."); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "김동팔", 52, 40, 64,"왕좌","상재", "띠용~"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "김동팔", 52, 40, 64,"왕좌","상재", "띠용~"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "낭군", 66, 25, 73,"대의","보병", ""); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "낭군", 66, 25, 73,"대의","보병", ""); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount,"내동생고기", 55, 75, 31,"유지","신중", ""); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount,"내동생고기", 55, 75, 31,"유지","신중", ""); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "네시", 75, 85, 11,"의협","무쌍", "내가 군대에 있어도 분신이 움직임. ㄳ"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "네시", 75, 85, 11,"의협","무쌍", "내가 군대에 있어도 분신이 움직임. ㄳ"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "독우", 32, 60, 65,"출세","경작", "장비한테 쳐맞은 독우올시다."); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "독우", 32, 60, 65,"출세","경작", "장비한테 쳐맞은 독우올시다."); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount,"뒷집할머니", 63, 60, 31,"의협","축성", "꺄훌~"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount,"뒷집할머니", 63, 60, 31,"의협","축성", "꺄훌~"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "듀라한", 74, 75, 10,"패권","격노", "그거 나 안해! 삭턴탈꺼야!"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "듀라한", 74, 75, 10,"패권","격노", "그거 나 안해! 삭턴탈꺼야!"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "땅꾼", 64, 85, 10,"왕좌","위압", "숨은 굇수인 나를 모름?"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "땅꾼", 64, 85, 10,"왕좌","위압", "숨은 굇수인 나를 모름?"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "라디에르", 76, 65, 14,"대의","수비", "안냐셍. 훼디에요."); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "라디에르", 76, 65, 14,"대의","수비", "안냐셍. 훼디에요."); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "람슈타인", 74, 66, 20,"출세","견고", "&#48561;.."); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "람슈타인", 74, 66, 20,"출세","견고", "&#48561;.."); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "러블리", 50, 72, 63,"재간","발명", ""); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "러블리", 50, 72, 63,"재간","발명", ""); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "레스텐", 52, 36, 73,"패권","신산", ""); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "레스텐", 52, 36, 73,"패권","신산", ""); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "류비연", 70, 10, 62,"대의","인덕", "쌀풀러 왔어요^ㅇ^"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "류비연", 70, 10, 62,"대의","인덕", "쌀풀러 왔어요^ㅇ^"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "리칼", 64, 68, 22,"유지","의술", "난 훼신이 아님. 그냥 오덕일뿐..."); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "리칼", 64, 68, 22,"유지","의술", "난 훼신이 아님. 그냥 오덕일뿐..."); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "마법사", 31, 59, 88,"출세","발명", ""); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "마법사", 31, 59, 88,"출세","발명", ""); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "명예회장", 54, 73, 18,"정복","필살", "양민학살 명훼훼장임."); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "명예회장", 54, 73, 18,"정복","필살", "양민학살 명훼훼장임."); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "모모리", 75, 20, 70,"패권","통찰", "몹몰러 왔다능~"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "모모리", 75, 20, 70,"패권","통찰", "몹몰러 왔다능~"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "묵왕", 70, 70, 10,"정복","궁병", "훼신의 귀환."); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "묵왕", 70, 70, 10,"정복","궁병", "훼신의 귀환."); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "반사대선", 70, 15, 70,"재간","신중", "자소유님 샤릉해요 ㅎ_ㅎ"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "반사대선", 70, 15, 70,"재간","신중", "자소유님 샤릉해요 ㅎ_ㅎ"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "불곰", 69, 71, 10,"유지","징병", ""); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "불곰", 69, 71, 10,"유지","징병", ""); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "블래싱", 59, 61, 30,"유지","수비", "유... 유리야!"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "블래싱", 59, 61, 30,"유지","수비", "유... 유리야!"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "사나에♡", 69, 13, 63,"안전","귀모", "러브호텔에 어서오세요 >ㅁ< ♡"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "사나에♡", 69, 13, 63,"안전","귀모", "러브호텔에 어서오세요 >ㅁ< ♡"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "사푸", 59, 33, 63,"안전","상재", "이게 다 사푸때문이다."); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "사푸", 59, 33, 63,"안전","상재", "이게 다 사푸때문이다."); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "살수묵랑", 69, 85, 13,"정복","무쌍", "남자라믄 고저 근성 열혈이라요!!!"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "살수묵랑", 69, 85, 13,"정복","무쌍", "남자라믄 고저 근성 열혈이라요!!!"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "성야", 77, 62, 19,"출세","집중", "훼야 훼야"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "성야", 77, 62, 19,"출세","집중", "훼야 훼야"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "소마", 73, 22, 69,"대의","신중", "오늘 항가해요 (.. *)"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "소마", 73, 22, 69,"대의","신중", "오늘 항가해요 (.. *)"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "소용녀", 64, 22, 84,"대의","신중", ""); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "소용녀", 64, 22, 84,"대의","신중", ""); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "소지로", 70, 71, 20,"의협","무쌍", ""); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "소지로", 70, 71, 20,"의협","무쌍", ""); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "", 41, 16, 68,"안전","견고", "흠... 그럼 어쩔수 없이 흉노로 가야겠군요..."); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "", 41, 16, 68,"안전","견고", "흠... 그럼 어쩔수 없이 흉노로 가야겠군요..."); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "슈이쯔", 75, 76, 18,"패권","격노", ""); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "슈이쯔", 75, 76, 18,"패권","격노", ""); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "스노곰", 70, 75, 10,"안전","궁병", ""); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "스노곰", 70, 75, 10,"안전","궁병", ""); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "시그리", 81, 63, 14,"왕좌","징병", "어이쿠야 월척이다. 보람 있구나~"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "시그리", 81, 63, 14,"왕좌","징병", "어이쿠야 월척이다. 보람 있구나~"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "심심해", 60, 85, 11,"의협","무쌍", ""); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "심심해", 60, 85, 11,"의협","무쌍", ""); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "실바누스", 83, 61, 15,"대의","신산", "살려주셍쇼ㅠ"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "실바누스", 83, 61, 15,"대의","신산", "살려주셍쇼ㅠ"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "아시루스", 56, 27, 75,"패권","집중", "왼손은 거들뿐..."); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "아시루스", 56, 27, 75,"패권","집중", "왼손은 거들뿐..."); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "얀웬리", 66, 17, 82,"재간","반계", ""); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "얀웬리", 66, 17, 82,"재간","반계", ""); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "여휘", 67, 20, 70,"재간","공성", ""); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "여휘", 67, 20, 70,"재간","공성", ""); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "에드워드", 68, 70, 12,"안전","인덕", "훼드훼드에염"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "에드워드", 68, 70, 12,"안전","인덕", "훼드훼드에염"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "에레니아", 70, 19, 63,"정복","척사", "에레냐에염 ㅇㅅㅇ"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "에레니아", 70, 19, 63,"정복","척사", "에레냐에염 ㅇㅅㅇ"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount,"온몸이근육", 58, 81, 10,"패권","징병", "불끈!"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount,"온몸이근육", 58, 81, 10,"패권","징병", "불끈!"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "유기체", 70, 21, 75,"출세","환술", "5분 후에 리셋합니다. ㄳ ㅇ_ㅇ"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "유기체", 70, 21, 75,"출세","환술", "5분 후에 리셋합니다. ㄳ ㅇ_ㅇ"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "윤석민", 73, 20, 66,"패권","집중", ""); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "윤석민", 73, 20, 66,"패권","집중", ""); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "", 68, 10, 78,"패권","반계", "율!"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "", 68, 10, 78,"패권","반계", "율!"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount,"이노베이션", 83, 65, 14,"패권","돌격", ""); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount,"이노베이션", 83, 65, 14,"패권","돌격", ""); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "임사영", 75, 75, 18,"출세","필살", "평민왔셈 ㅇㅇ"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "임사영", 75, 75, 18,"출세","필살", "평민왔셈 ㅇㅇ"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "자소유", 77, 70, 19,"대의","기병", "ㅇ_ㅇ"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "자소유", 77, 70, 19,"대의","기병", "ㅇ_ㅇ"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "장군보", 67, 82, 21,"의협","견고", ""); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "장군보", 67, 82, 21,"의협","견고", ""); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "장수명", 66, 62, 18,"유지","견고", "장수명에 장수명을 입력한 장수명입니다."); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "장수명", 66, 62, 18,"유지","견고", "장수명에 장수명을 입력한 장수명입니다."); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "장수왕", 77, 34, 43,"왕좌","위압", "장수왕섭 다음주 오픈해요. 기대해주셍."); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "장수왕", 77, 34, 43,"왕좌","위압", "장수왕섭 다음주 오픈해요. 기대해주셍."); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "장임", 50, 70, 75,"출세","저격", "훼력짱임."); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "장임", 50, 70, 75,"출세","저격", "훼력짱임."); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "장자", 66, 27, 80,"할거","신산", ""); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "장자", 66, 27, 80,"할거","신산", ""); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "제로스", 71, 79, 24,"패권","필살", ""); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "제로스", 71, 79, 24,"패권","필살", ""); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "제이토", 76, 72, 14,"정복","보병", "훼이토 ㅇㅇ"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "제이토", 76, 72, 14,"정복","보병", "훼이토 ㅇㅇ"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "조용", 58, 62, 45,"할거","궁병", "조용..."); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "조용", 58, 62, 45,"할거","궁병", "조용..."); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "중달", 70, 73, 15,"대의","귀모", "내가 바로 그 훼달임."); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "중달", 70, 73, 15,"대의","귀모", "내가 바로 그 훼달임."); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "지장", 58, 84, 21,"정복","무쌍", "췌퉤훼섭 모두 가리지 않는 훼력 ㅇㅇ"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "지장", 58, 84, 21,"정복","무쌍", "췌퉤훼섭 모두 가리지 않는 훼력 ㅇㅇ"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "지천영", 65, 84, 11,"왕좌","위압", ""); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "지천영", 65, 84, 11,"왕좌","위압", ""); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "카이사르", 74, 75, 16,"정복","돌격", ""); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "카이사르", 74, 75, 16,"정복","돌격", ""); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "카이토", 63, 15, 78,"유지","집중", ""); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "카이토", 63, 15, 78,"유지","집중", ""); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "캐양민", 67, 18, 71,"패권","반계", "캐양민임...ㅠㅠ"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "캐양민", 67, 18, 71,"패권","반계", "캐양민임...ㅠㅠ"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "쿄타로", 75, 21, 66,"정복","신산", ""); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "쿄타로", 75, 21, 66,"정복","신산", ""); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount,"크리스티앙", 60, 83, 16,"유지","견고", "끌턍 꿀사턍 꾸린스탈 ㅇㅇ"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount,"크리스티앙", 60, 83, 16,"유지","견고", "끌턍 꿀사턍 꾸린스탈 ㅇㅇ"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "통키", 79, 68, 14,"대의","통찰", "불꽃슛~"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "통키", 79, 68, 14,"대의","통찰", "불꽃슛~"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "철혈대신", 72, 14, 85,"안전","견고", ""); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "철혈대신", 72, 14, 85,"안전","견고", ""); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount,"초절정미녀", 68, 19, 81,"출세","환술", "<- 초미녀임 ㅇㅇ;"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount,"초절정미녀", 68, 19, 81,"출세","환술", "<- 초미녀임 ㅇㅇ;"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "페르난도", 68, 69, 21,"대의","징병", ""); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "페르난도", 68, 69, 21,"대의","징병", ""); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "펠퍼틴", 58, 29, 61,"안전","의술", "짝퉁 화타가 바로 나!"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "펠퍼틴", 58, 29, 61,"안전","의술", "짝퉁 화타가 바로 나!"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "하누리", 55, 22, 85,"패권","귀병", "하루 종일 누르리!"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "하누리", 55, 22, 85,"패권","귀병", "하루 종일 누르리!"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "하리", 80, 63, 12,"왕좌","위압", "열전 쓰고 있는중..."); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "하리", 80, 63, 12,"왕좌","위압", "열전 쓰고 있는중..."); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "하오마루", 65, 85, 12,"정복","위압", "사무라이 쇼다운 막판왕 깨고 왔음."); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "하오마루", 65, 85, 12,"정복","위압", "사무라이 쇼다운 막판왕 깨고 왔음."); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount,"하후연묘재", 65, 15, 67,"유지","반계", "묘섭 베타서버 운영중입니다. 많이 찾아주세욤~"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount,"하후연묘재", 65, 15, 67,"유지","반계", "묘섭 베타서버 운영중입니다. 많이 찾아주세욤~"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "환선", 60, 76, 24,"패권","돌격", ""); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "환선", 60, 76, 24,"패권","돌격", ""); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "황월영", 72, 10, 68,"대의","인덕", ""); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "황월영", 72, 10, 68,"대의","인덕", ""); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "허기", 64, 12, 77,"출세","거상", ""); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "허기", 64, 12, 77,"출세","거상", ""); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "형왔다", 64, 72, 27,"의협","기병", "형왔다~"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "형왔다", 64, 72, 27,"의협","기병", "형왔다~"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "헹이", 75, 16, 73,"의협","환술", "다 헹궈버리겠다~ ㅇ<-<"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "헹이", 75, 16, 73,"의협","환술", "다 헹궈버리겠다~ ㅇ<-<"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "효주곰", 54, 32, 77,"유지","경작", "순수한 효주곰이에여 >_<"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "효주곰", 54, 32, 77,"유지","경작", "순수한 효주곰이에여 >_<"); $gencount++;
RegGeneral2($connect,$admin[turnterm],$gencount, "후랴", 56, 79, 20,"의협","기병", "후랴 후랴~"); $gencount++; RegGeneral2($connect,$admin['turnterm'],$gencount, "후랴", 56, 79, 20,"의협","기병", "후랴 후랴~"); $gencount++;
//////////////////////////장수 끝/////////////////////////////////////////////// //////////////////////////장수 끝///////////////////////////////////////////////
@@ -168,10 +168,10 @@ function RegGeneral2($connect,$turnterm,$gencount,$name,$leader,$power,$intel,$p
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result); $nation = MYDB_fetch_array($result);
// 군주로 // 현 국가 소속으로 // 군주로 // 현 국가 소속으로
$query = "update general set belong=1,level=12,nation='$nation[nation]' where user_id='$genid'"; $query = "update general set belong=1,level=12,nation='$nation['nation']' where user_id='$genid'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
//외교 추가 //외교 추가
$query = "select nation from nation where nation!='$nation[nation]'"; $query = "select nation from nation where nation!='$nation['nation']'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result); $count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) { for($i=0; $i < $count; $i++) {
@@ -180,14 +180,14 @@ function RegGeneral2($connect,$turnterm,$gencount,$name,$leader,$power,$intel,$p
insert into diplomacy ( insert into diplomacy (
me, you, state, term me, you, state, term
) values ( ) values (
'$nation[nation]', '$you[nation]', '2', '0' '$nation['nation']', '$you['nation']', '2', '0'
)", $connect )", $connect
) or Error(__LINE__.MYDB_error($connect),""); ) or Error(__LINE__.MYDB_error($connect),"");
@MYDB_query(" @MYDB_query("
insert into diplomacy ( insert into diplomacy (
me, you, state, term me, you, state, term
) values ( ) values (
'$you[nation]', '$nation[nation]', '2', '0' '$you['nation']', '$nation['nation']', '2', '0'
)", $connect )", $connect
) or Error(__LINE__.MYDB_error($connect),""); ) or Error(__LINE__.MYDB_error($connect),"");
} }
+2 -2
View File
@@ -43,8 +43,8 @@ $connect=dbConn();
$query = "select startyear,year,month,turnterm,scenario,extend,fiction,img from game where no='1'"; $query = "select startyear,year,month,turnterm,scenario,extend,fiction,img from game where no='1'";
$result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),""); $result = MYDB_query($query, $connect) or Error("scenario_194A ".MYDB_error($connect),"");
$admin = MYDB_fetch_array($result); $admin = MYDB_fetch_array($result);
$fiction = 1; $turnterm = $admin[turnterm]; $startyear = $admin[startyear]; $year = $admin[year]; $extend = $admin[extend]; $fiction = 1; $turnterm = $admin['turnterm']; $startyear = $admin['startyear']; $year = $admin['year']; $extend = $admin['extend'];
$img = $admin[img]; $img = $admin['img'];
//가상모드3 : 180년 영웅 시대 //가상모드3 : 180년 영웅 시대
//////////////////////////국가1///////////////////////////////////////////////// //////////////////////////국가1/////////////////////////////////////////////////

Some files were not shown because too many files have changed in this diff Show More