$connect를 $db=DB::db();$connect=$db->get(); 으로 변경하고 함수의 $connect를 모두 제거
This commit is contained in:
@@ -1,17 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
|
||||
function MYDB_connect($host, $id, $pw) {
|
||||
$conn = mysqli_connect($host, $id, $pw);
|
||||
mysqli_query($conn, 'set names utf8mb4');
|
||||
return $conn;
|
||||
}
|
||||
|
||||
function MYDB_select_db($db, $connect) {
|
||||
return mysqli_select_db($connect, $db);
|
||||
}
|
||||
|
||||
function MYDB_query($query, $connect) {
|
||||
return mysqli_query($connect, $query);
|
||||
}
|
||||
|
||||
+2
-2
@@ -40,10 +40,10 @@ case "토너분지연":
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
break;
|
||||
case "금지급":
|
||||
processGoldIncome($connect);
|
||||
processGoldIncome();
|
||||
break;
|
||||
case "쌀지급":
|
||||
processRiceIncome($connect);
|
||||
processRiceIncome();
|
||||
break;
|
||||
case "락걸기":
|
||||
$query = "update plock set plock=1";
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ if(Session::getUserGrade() < 5) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$admin = getAdmin($connect);
|
||||
$admin = getAdmin();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
@@ -6,7 +6,7 @@ include "func.php";
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
|
||||
$admin = getAdmin($connect);
|
||||
$admin = getAdmin();
|
||||
|
||||
if(Session::getUserGrade() < 5) {
|
||||
//echo "<script>location.replace('_admin1.php');</script>";
|
||||
|
||||
+1
-1
@@ -96,7 +96,7 @@ for($i=0; $i < $gencount; $i++) {
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign=top>
|
||||
<?php generalInfo($connect, $gen); generalInfo2($connect, $gen); ?>
|
||||
<?php generalInfo($gen); generalInfo2($gen); ?>
|
||||
</td>
|
||||
<td valign=top>
|
||||
</td>
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ $db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("세력도", 2);
|
||||
checkTurn($connect);
|
||||
checkTurn();
|
||||
|
||||
$query = "select conlimit from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
@@ -11,7 +11,7 @@ $connect=$db->get();
|
||||
|
||||
increaseRefresh("감찰부", 2);
|
||||
//전투 추진을 위해 갱신
|
||||
checkTurn($connect);
|
||||
checkTurn();
|
||||
|
||||
$query = "select conlimit from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -116,7 +116,7 @@ for($i=0; $i < $gencount; $i++) {
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign=top>
|
||||
<?php generalInfo($connect, $gen); generalInfo2($connect, $gen); ?>
|
||||
<?php generalInfo($gen); generalInfo2($gen); ?>
|
||||
</td>
|
||||
<td valign=top>
|
||||
<?=getGeneralHistoryAll($gen)?>
|
||||
|
||||
+3
-3
@@ -10,7 +10,7 @@ $db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("베팅장", 1);
|
||||
checkTurn($connect);
|
||||
checkTurn();
|
||||
|
||||
$query = "select no,tournament,con,turntime,bet0+bet1+bet2+bet3+bet4+bet5+bet6+bet7+bet8+bet9+bet10+bet11+bet12+bet13+bet14+bet15 as bet from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -31,8 +31,8 @@ case 3: $tnmt_type = "<font color=cyan>설전</font>"; $tp = "itl"; $tp2 = "
|
||||
}
|
||||
|
||||
$str1 = getTournament($admin['tournament']);
|
||||
$str2 = getTournamentTime($connect);
|
||||
$str3 = getTournamentTerm($connect);
|
||||
$str2 = getTournamentTime();
|
||||
$str3 = getTournamentTerm();
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
|
||||
@@ -47,7 +47,7 @@ if($me['level'] < 5) {
|
||||
</table>
|
||||
<br>
|
||||
<?php
|
||||
$nation = getNation($connect, $me['nation']);
|
||||
$nation = getNation($me['nation']);
|
||||
|
||||
//20개 메세지
|
||||
$index = $nation['coreindex'];
|
||||
@@ -56,7 +56,7 @@ for($i=0; $i < 20; $i++) {
|
||||
$query = "select name,picture,imgsvr from general where no='$nation[$who]'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$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($nation["coreboard{$index}"], $general['name'], $general['picture'], $general['imgsvr'], $nation["coreboard{$index}_when"], $index, 1); }
|
||||
$index--;
|
||||
if($index < 0) { $index = 19; }
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ $nation = MYDB_fetch_array($result);
|
||||
|
||||
$lv = getNationChiefLevel($nation['level']);
|
||||
for($i=12; $i >= $lv; $i--) {
|
||||
$turn[$i] = getCoreTurn($connect, $nation, $i);
|
||||
$turn[$i] = getCoreTurn($nation, $i);
|
||||
|
||||
$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),"");
|
||||
@@ -159,7 +159,7 @@ for($k=0; $k < 2; $k++) {
|
||||
<input type={$btn2} style=background-color:$_basecolor2;color:white;width:58;font-size:13px; value='미루기▼' onclick='turn(0)'>
|
||||
<input type={$btn2} style=background-color:$_basecolor2;color:white;width:58;font-size:13px; value='▲당기기' onclick='turn(1)'>
|
||||
<br>";
|
||||
CoreCommandTable($connect);
|
||||
CoreCommandTable();
|
||||
echo "<input type={$btn} style=background-color:$_basecolor2;color:white;width:55;font-size:13px; value='실 행'></td></tr></form>";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -302,7 +302,7 @@ for($j=0; $j < $gencount; $j++) {
|
||||
echo "
|
||||
<td>
|
||||
<font size=1>";
|
||||
$turn = getTurn($connect, $general, 1);
|
||||
$turn = getTurn($general, 1);
|
||||
|
||||
for($i=0; $i < 4; $i++) {
|
||||
$k = $i+1;
|
||||
|
||||
+5
-5
@@ -182,14 +182,14 @@ $query = "select gold_rate,rice_rate from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
// 금 수지
|
||||
$deadIncome = getDeadIncome($connect, $nation['nation'], $nation['type'], $admin['gold_rate']);
|
||||
$deadIncome = getDeadIncome($nation['nation'], $nation['type'], $admin['gold_rate']);
|
||||
|
||||
$goldincomeList = getGoldIncome($connect, $nation['nation'], $nation['rate'], $admin['gold_rate'], $nation['type']);
|
||||
$goldincomeList = getGoldIncome($nation['nation'], $nation['rate'], $admin['gold_rate'], $nation['type']);
|
||||
$goldincome = $goldincomeList[0] + $goldincomeList[1] + $deadIncome;
|
||||
$goldoutcome = getGoldOutcome($connect, $nation['nation'], $nation['bill']);
|
||||
$riceincomeList = getRiceIncome($connect, $nation['nation'], $nation['rate'], $admin['rice_rate'], $nation['type']);
|
||||
$goldoutcome = getGoldOutcome($nation['nation'], $nation['bill']);
|
||||
$riceincomeList = getRiceIncome($nation['nation'], $nation['rate'], $admin['rice_rate'], $nation['type']);
|
||||
$riceincome = $riceincomeList[0] + $riceincomeList[1];
|
||||
$riceoutcome = getRiceOutcome($connect, $nation['nation'], $nation['bill']);
|
||||
$riceoutcome = getRiceOutcome($nation['nation'], $nation['bill']);
|
||||
|
||||
|
||||
$budgetgold = $nation['gold'] + $goldincome - $goldoutcome + $deadIncome;
|
||||
|
||||
+1
-1
@@ -167,7 +167,7 @@ for($j=0; $j < $gencount; $j++) {
|
||||
echo "
|
||||
<td>
|
||||
<font size=1>";
|
||||
$turn = getTurn($connect, $general, 1, 0);
|
||||
$turn = getTurn($general, 1, 0);
|
||||
|
||||
for($i=0; $i < 5; $i++) {
|
||||
$turn[$i] = StringUtil::SubStrForWidth($turn[$i], 0, 20);
|
||||
|
||||
@@ -11,7 +11,7 @@ $connect=$db->get();
|
||||
|
||||
increaseRefresh("인사부", 1);
|
||||
//훼섭 추방을 위해 갱신
|
||||
checkTurn($connect);
|
||||
checkTurn();
|
||||
|
||||
$query = "select no,nation,level from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
@@ -64,14 +64,14 @@ $query = "select gold_rate,rice_rate from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
// 금 수지
|
||||
$deadIncome = getDeadIncome($connect, $nation['nation'], $nation['type'], $admin['gold_rate']);
|
||||
$deadIncome = getDeadIncome($nation['nation'], $nation['type'], $admin['gold_rate']);
|
||||
|
||||
$goldincomeList = getGoldIncome($connect, $nation['nation'], $nation['rate'], $admin['gold_rate'], $nation['type']);
|
||||
$goldincomeList = getGoldIncome($nation['nation'], $nation['rate'], $admin['gold_rate'], $nation['type']);
|
||||
$goldincome = $goldincomeList[0] + $goldincomeList[1] + $deadIncome;
|
||||
$goldoutcome = getGoldOutcome($connect, $nation['nation'], $nation['bill']);
|
||||
$riceincomeList = getRiceIncome($connect, $nation['nation'], $nation['rate'], $admin['rice_rate'], $nation['type']);
|
||||
$goldoutcome = getGoldOutcome($nation['nation'], $nation['bill']);
|
||||
$riceincomeList = getRiceIncome($nation['nation'], $nation['rate'], $admin['rice_rate'], $nation['type']);
|
||||
$riceincome = $riceincomeList[0] + $riceincomeList[1];
|
||||
$riceoutcome = getRiceOutcome($connect, $nation['nation'], $nation['bill']);
|
||||
$riceoutcome = getRiceOutcome($nation['nation'], $nation['bill']);
|
||||
|
||||
|
||||
$budgetgold = $nation['gold'] + $goldincome - $goldoutcome + $deadIncome;
|
||||
|
||||
+2
-2
@@ -61,8 +61,8 @@ function go(type) {
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<tr>
|
||||
<td width=50%>
|
||||
<?php myInfo($connect); ?>
|
||||
<?php myInfo2($connect); ?>
|
||||
<?php myInfo(); ?>
|
||||
<?php myInfo2(); ?>
|
||||
</td>
|
||||
<td width=50% valign=top>
|
||||
<form name=form1 action=b_myPage.php method=post>
|
||||
|
||||
@@ -42,7 +42,7 @@ $me = MYDB_fetch_array($result);
|
||||
</table>
|
||||
<br>
|
||||
<?php
|
||||
$nation = getNation($connect, $me['nation']);
|
||||
$nation = getNation($me['nation']);
|
||||
|
||||
//20개 메세지
|
||||
$index = $nation['boardindex'];
|
||||
@@ -51,7 +51,7 @@ for($i=0; $i < 20; $i++) {
|
||||
$query = "select name,picture,imgsvr from general where no='$nation[$who]'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$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($nation["board{$index}"], $general['name'], $general['picture'], $general['imgsvr'], $nation["board{$index}_when"], $index, 0); }
|
||||
$index--;
|
||||
if($index < 0) { $index = 19; }
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ $db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("토너먼트", 1);
|
||||
checkTurn($connect);
|
||||
checkTurn();
|
||||
|
||||
$query = "select no,tournament,con,turntime from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -161,8 +161,8 @@ if(Session::getUserGrade() >= 5) {
|
||||
}
|
||||
|
||||
$str1 = getTournament($admin['tournament']);
|
||||
$str2 = getTournamentTime($connect);
|
||||
$str3 = getTournamentTerm($connect);
|
||||
$str2 = getTournamentTime();
|
||||
$str3 = getTournamentTerm();
|
||||
?>
|
||||
<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>
|
||||
|
||||
+11
-2
@@ -78,8 +78,17 @@ if($btn == "판매") {
|
||||
if($valid == 1) {
|
||||
$msg = "ㆍ<span class='ev_success'>등록 성공.</span>";
|
||||
$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')";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$db->insert('auction', [
|
||||
'type'=>0,
|
||||
'no1'=>$me['no'],
|
||||
'name1'=>$me['name'],
|
||||
'stuff'=>$stuff,
|
||||
'amount'=>$amount,
|
||||
'cost'=>$cost,
|
||||
'value'=>$cost,
|
||||
'topv'=>$topv,
|
||||
'expire'=>$date
|
||||
]);
|
||||
}
|
||||
} elseif($btn == "구매시도") {
|
||||
$query = "select no2,value,topv,expire,amount from auction where no='$sel'";
|
||||
|
||||
@@ -23,7 +23,7 @@ if(getBlockLevel() != 1 && getBlockLevel() != 3) {
|
||||
$msg = trim($msg);
|
||||
$reply = trim($reply);
|
||||
|
||||
$nation = getNation($connect, $me['nation']);
|
||||
$nation = getNation($me['nation']);
|
||||
|
||||
//새글 추가시
|
||||
if($num == -1 && $title != "" && $msg != "") {
|
||||
|
||||
@@ -23,7 +23,7 @@ if(getBlockLevel() != 1 && getBlockLevel() != 3) {
|
||||
$msg = trim($msg);
|
||||
$reply = trim($reply);
|
||||
|
||||
$nation = getNation($connect, $me['nation']);
|
||||
$nation = getNation($me['nation']);
|
||||
|
||||
//새글 추가시
|
||||
if($num == -1 && $title != "" && $msg != "") {
|
||||
|
||||
+15
-15
@@ -32,7 +32,7 @@ if($btn == "자동개최설정" && Session::getUserGrade() >= 5) {
|
||||
$query = "update game set tnmt_trig={$trig}";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
} elseif($btn == "개최" && Session::getUserGrade() >= 5) {
|
||||
startTournament($connect, $auto, $type);
|
||||
startTournament($auto, $type);
|
||||
} elseif($btn == "중단" && Session::getUserGrade() >= 5) {
|
||||
$query = "update game set tnmt_auto=0, tournament=0, phase=0";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -181,24 +181,24 @@ if($btn == "자동개최설정" && Session::getUserGrade() >= 5) {
|
||||
|
||||
$query = "update game set tournament=2, phase=0";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
} elseif($btn == "무명전부투입" && Session::getUserGrade() >= 5) { fillLowGenAll($connect);
|
||||
} elseif($btn == "예선" && Session::getUserGrade() >= 5) { qualify($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase']);
|
||||
} elseif($btn == "예선전부" && Session::getUserGrade() >= 5) { qualifyAll($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase']);
|
||||
} elseif($btn == "추첨" && Session::getUserGrade() >= 5) { selection($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase']);
|
||||
} elseif($btn == "추첨전부" && Session::getUserGrade() >= 5) { selectionAll($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase']);
|
||||
} elseif($btn == "본선" && Session::getUserGrade() >= 5) { finallySingle($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase']);
|
||||
} elseif($btn == "본선전부" && Session::getUserGrade() >= 5) { finallyAll($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase']);
|
||||
} elseif($btn == "배정" && Session::getUserGrade() >= 5) { final16set($connect);
|
||||
} elseif($btn == "무명전부투입" && Session::getUserGrade() >= 5) { fillLowGenAll();
|
||||
} elseif($btn == "예선" && Session::getUserGrade() >= 5) { qualify($admin['tnmt_type'], $admin['tournament'], $admin['phase']);
|
||||
} elseif($btn == "예선전부" && Session::getUserGrade() >= 5) { qualifyAll($admin['tnmt_type'], $admin['tournament'], $admin['phase']);
|
||||
} elseif($btn == "추첨" && Session::getUserGrade() >= 5) { selection($admin['tnmt_type'], $admin['tournament'], $admin['phase']);
|
||||
} elseif($btn == "추첨전부" && Session::getUserGrade() >= 5) { selectionAll($admin['tnmt_type'], $admin['tournament'], $admin['phase']);
|
||||
} elseif($btn == "본선" && Session::getUserGrade() >= 5) { finallySingle($admin['tnmt_type'], $admin['tournament'], $admin['phase']);
|
||||
} elseif($btn == "본선전부" && Session::getUserGrade() >= 5) { finallyAll($admin['tnmt_type'], $admin['tournament'], $admin['phase']);
|
||||
} elseif($btn == "배정" && Session::getUserGrade() >= 5) { final16set();
|
||||
} elseif($btn == "베팅마감" && Session::getUserGrade() >= 5) {
|
||||
$dt = date("Y-m-d H:i:s", time() + 60);
|
||||
$query = "update game set tournament='7',phase='0',tnmt_time='$dt'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
} elseif($btn == "16강" && Session::getUserGrade() >= 5) { finalFight($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase'], 16);
|
||||
} elseif($btn == "8강" && Session::getUserGrade() >= 5) { finalFight($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase'], 8);
|
||||
} elseif($btn == "4강" && Session::getUserGrade() >= 5) { finalFight($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase'], 4);
|
||||
} elseif($btn == "결승" && Session::getUserGrade() >= 5) { finalFight($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase'], 2);
|
||||
} elseif($btn == "포상" && Session::getUserGrade() >= 5) { setGift($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase']);
|
||||
} elseif($btn == "회수" && Session::getUserGrade() >= 5) { setRefund($connect);
|
||||
} elseif($btn == "16강" && Session::getUserGrade() >= 5) { finalFight($admin['tnmt_type'], $admin['tournament'], $admin['phase'], 16);
|
||||
} elseif($btn == "8강" && Session::getUserGrade() >= 5) { finalFight($admin['tnmt_type'], $admin['tournament'], $admin['phase'], 8);
|
||||
} elseif($btn == "4강" && Session::getUserGrade() >= 5) { finalFight($admin['tnmt_type'], $admin['tournament'], $admin['phase'], 4);
|
||||
} elseif($btn == "결승" && Session::getUserGrade() >= 5) { finalFight($admin['tnmt_type'], $admin['tournament'], $admin['phase'], 2);
|
||||
} elseif($btn == "포상" && Session::getUserGrade() >= 5) { setGift($admin['tnmt_type'], $admin['tournament'], $admin['phase']);
|
||||
} elseif($btn == "회수" && Session::getUserGrade() >= 5) { setRefund();
|
||||
} elseif($btn == "메시지" && Session::getUserGrade() >= 5) {
|
||||
$msg = addslashes(SQ2DQ($msg));
|
||||
$query = "update game set tnmt_msg='$msg'";
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ if($btn == "투표" && $me['vote'] == 0 && $sel > 0) {
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$log = [];
|
||||
$log = uniqueItem($connect, $me, $log, 1);
|
||||
$log = uniqueItem($me, $log, 1);
|
||||
pushGenLog($me, $log);
|
||||
}
|
||||
else if($btn == "댓글" && $comment != "") {
|
||||
|
||||
+7
-3
@@ -62,11 +62,15 @@ function myclock() {
|
||||
</head>
|
||||
<body OnLoad='myclock()'>
|
||||
<?php
|
||||
myCommandList($connect);
|
||||
myCommandList();
|
||||
|
||||
function myCommandList($connect) {
|
||||
function myCommandList() {
|
||||
global $_basecolor, $_basecolor2, $_basecolor3;
|
||||
global $images;
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$date = date('Y-m-d H:i:s');
|
||||
|
||||
// 명령 목록
|
||||
@@ -77,7 +81,7 @@ function myCommandList($connect) {
|
||||
$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 owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
$turn = getTurn($connect, $me, 2);
|
||||
$turn = getTurn($me, 2);
|
||||
|
||||
echo "<table width=300 height=700 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg2>
|
||||
<form name=clock>
|
||||
|
||||
+183
-82
@@ -115,15 +115,18 @@ function getRandGenName() {
|
||||
|
||||
|
||||
|
||||
function cityInfo($connect) {
|
||||
function cityInfo() {
|
||||
global $_basecolor, $_basecolor2, $images;
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select no,city from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
// 도시 정보
|
||||
$city = getCity($connect, $me['city']);
|
||||
$city = getCity($me['city']);
|
||||
|
||||
$nation = getNationStaticInfo($city['nation']);
|
||||
|
||||
@@ -226,9 +229,12 @@ function cityInfo($connect) {
|
||||
";
|
||||
}
|
||||
|
||||
function myNationInfo($connect) {
|
||||
function myNationInfo() {
|
||||
global $_basecolor, $_basecolor2, $images;
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select startyear,year from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
@@ -401,7 +407,10 @@ function commandGroup($typename, $type=0) {
|
||||
}
|
||||
}
|
||||
|
||||
function commandTable($connect) {
|
||||
function commandTable() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select startyear,year,develcost,scenario from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
@@ -410,8 +419,8 @@ function commandTable($connect) {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
$troop = getTroop($connect, $me['troop']);
|
||||
$city = getCity($connect, $me['city']);
|
||||
$troop = getTroop($me['troop']);
|
||||
$city = getCity($me['city']);
|
||||
|
||||
$nationcount = count(getAllNationStaticInfo());
|
||||
|
||||
@@ -635,7 +644,10 @@ function commandTable($connect) {
|
||||
";
|
||||
}
|
||||
|
||||
function CoreCommandTable($connect) {
|
||||
function CoreCommandTable() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select develcost from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
@@ -729,17 +741,23 @@ function CoreCommandTable($connect) {
|
||||
";
|
||||
}
|
||||
|
||||
function myInfo($connect) {
|
||||
function myInfo() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select no from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
generalInfo($connect, $me['no']);
|
||||
generalInfo($me['no']);
|
||||
}
|
||||
|
||||
function generalInfo($connect, $no) {
|
||||
function generalInfo($no) {
|
||||
global $_basecolor, $_basecolor2, $image, $images;
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select show_img_level from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
@@ -763,7 +781,7 @@ function generalInfo($connect, $no) {
|
||||
$lbonus = "";
|
||||
}
|
||||
|
||||
$troop = getTroop($connect, $general['troop']);
|
||||
$troop = getTroop($general['troop']);
|
||||
|
||||
$level = getLevel($general['level'], $nation['level']);
|
||||
if($general['level'] == 2) {
|
||||
@@ -913,17 +931,23 @@ function generalInfo($connect, $no) {
|
||||
</table>";
|
||||
}
|
||||
|
||||
function myInfo2($connect) {
|
||||
function myInfo2() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select no from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
generalInfo2($connect, $me['no']);
|
||||
generalInfo2($me['no']);
|
||||
}
|
||||
|
||||
function generalInfo2($connect, $no) {
|
||||
function generalInfo2($no) {
|
||||
global $_basecolor, $_basecolor2, $image, $images, $_dexLimit;
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select personal,experience,dedication,firenum,warnum,killnum,deathnum,killcrew,deathcrew,belong,killnum*100/warnum as winrate,killcrew/deathcrew*100 as killrate,dex0,dex10,dex20,dex30,dex40 from general where no='$no'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
@@ -1027,7 +1051,10 @@ function generalInfo2($connect, $no) {
|
||||
</table>";
|
||||
}
|
||||
|
||||
function adminMsg($connect) {
|
||||
function adminMsg() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select msg from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
@@ -1040,7 +1067,10 @@ function getOnlineNum() {
|
||||
return DB::db()->queryFirstField('select `online` from `game` where `no`=1');
|
||||
}
|
||||
|
||||
function onlinegen($connect) {
|
||||
function onlinegen() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$onlinegen = "";
|
||||
$generalID = Session::Instance()->generalID;
|
||||
$nationID = DB::db()->queryFirstField('select `nation` from `general` where `no` = %i', $generalID);
|
||||
@@ -1056,14 +1086,20 @@ function onlinegen($connect) {
|
||||
return $onlinegen;
|
||||
}
|
||||
|
||||
function onlineNation($connect) {
|
||||
function onlineNation() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select onlinenation from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$game = MYDB_fetch_array($result);
|
||||
return $game['onlinenation'];
|
||||
}
|
||||
|
||||
function nationMsg($connect) {
|
||||
function nationMsg() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select no,nation from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
@@ -1092,9 +1128,12 @@ function PushMsg($type, $nation, $picture, $imgsvr, $from, $fromcolor, $to, $toc
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
function msgprint($connect, $msg, $name, $picture, $imgsvr, $when, $num, $type) {
|
||||
function msgprint($msg, $name, $picture, $imgsvr, $when, $num, $type) {
|
||||
global $_basecolor2, $_basecolor4, $images;
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$message = explode("|", $msg);
|
||||
$count = (count($message) - 2)/2;
|
||||
$message[0] = Tag2Code($message[0]);
|
||||
@@ -1373,7 +1412,10 @@ function timeover() {
|
||||
else { return 0; }
|
||||
}
|
||||
|
||||
function checkDelay($connect) {
|
||||
function checkDelay() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
//서버정보
|
||||
$query = "select turnterm,now() as now,TIMESTAMPDIFF(MINUTE,turntime,now()) as offset from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -1402,7 +1444,10 @@ function checkDelay($connect) {
|
||||
}
|
||||
}
|
||||
|
||||
function updateOnline($connect) {
|
||||
function updateOnline() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
//국가별 이름 매핑
|
||||
foreach(getAllNationStaticInfo() as $nation) {
|
||||
$nationname[$nation['nation']] = $nation['name'];
|
||||
@@ -1447,7 +1492,10 @@ function updateOnline($connect) {
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
|
||||
function checkTurn($connect) {
|
||||
function checkTurn() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
// 잦은 갱신 금지 현재 5초당 1회
|
||||
if(!timeover()) { return; }
|
||||
// 현재 처리중이면 접근 불가
|
||||
@@ -1490,10 +1538,10 @@ function checkTurn($connect) {
|
||||
}
|
||||
// 1턴이상 갱신 없었으면 서버 지연
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', checkDelay');
|
||||
checkDelay($connect);
|
||||
checkDelay();
|
||||
// 접속자수, 접속국가, 국가별 접속장수 갱신
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', checkDelay');
|
||||
updateOnline($connect);
|
||||
updateOnline();
|
||||
//접속자 수 따라서 갱신제한 변경
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', CheckOverhead');
|
||||
CheckOverhead();
|
||||
@@ -1520,15 +1568,15 @@ function checkTurn($connect) {
|
||||
//if(PROCESS_LOG) pushProcessLog($processlog);
|
||||
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', processAI');
|
||||
if($general['npc'] >= 2) { processAI($connect, $general['no']); } // npc AI 처리
|
||||
if($general['npc'] >= 2) { processAI($general['no']); } // npc AI 처리
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', PreprocessCommand');
|
||||
PreprocessCommand($connect, $general['no']);
|
||||
PreprocessCommand($general['no']);
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', processCommand');
|
||||
processCommand($connect, $general['no']);
|
||||
processCommand($general['no']);
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', updateCommand');
|
||||
updateCommand($connect, $general['no']);
|
||||
updateCommand($general['no']);
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', updateTurntime');
|
||||
updateTurntime($connect, $general['no']);
|
||||
updateTurntime($general['no']);
|
||||
|
||||
}
|
||||
|
||||
@@ -1537,7 +1585,7 @@ function checkTurn($connect) {
|
||||
updateTraffic();
|
||||
// 1달마다 처리하는 것들, 벌점 감소 및 건국,전턴,합병 -1, 군량 소모
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', preUpdateMonthly');
|
||||
$result = preUpdateMonthly($connect);
|
||||
$result = preUpdateMonthly();
|
||||
if($result == false) {
|
||||
$locklog[0] = "-- checkTurn() 오류출 : ".date('Y-m-d H:i:s')." : ".$session->userName;
|
||||
pushLockLog($locklog);
|
||||
@@ -1549,7 +1597,7 @@ function checkTurn($connect) {
|
||||
}
|
||||
|
||||
// 그 시각 년도,월 저장
|
||||
$dt = turnDate($connect, $nextTurn);
|
||||
$dt = turnDate($nextTurn);
|
||||
$admin['year'] = $dt[0]; $admin['month'] = $dt[1];
|
||||
|
||||
$locklog[0] = "-- checkTurn() ".$admin['month']."월 : ".date('Y-m-d H:i:s')." : ".$session->userName;
|
||||
@@ -1570,48 +1618,48 @@ function checkTurn($connect) {
|
||||
// 분기계산. 장수들 턴보다 먼저 있다면 먼저처리
|
||||
if($admin['month'] == 1) {
|
||||
// NPC 등장
|
||||
//if($admin['scenario'] > 0 && $admin['scenario'] < 20) { RegNPC($connect); }
|
||||
//if($admin['scenario'] > 0 && $admin['scenario'] < 20) { RegNPC(); }
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', processGoldIncome');
|
||||
processGoldIncome($connect);
|
||||
processGoldIncome();
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', processSpring');
|
||||
processSpring($connect);
|
||||
processSpring();
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', updateYearly');
|
||||
updateYearly($connect);
|
||||
updateYearly();
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', updateQuaterly');
|
||||
updateQuaterly($connect);
|
||||
updateQuaterly();
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', disaster');
|
||||
disaster($connect);
|
||||
disaster();
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', tradeRate');
|
||||
tradeRate($connect);
|
||||
tradeRate();
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', addAge');
|
||||
addAge($connect);
|
||||
addAge();
|
||||
// 새해 알림
|
||||
$alllog[] = "<C>◆</>{$admin['month']}월:<C>{$admin['year']}</>년이 되었습니다.";
|
||||
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
|
||||
} elseif($admin['month'] == 4) {
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', updateQuaterly');
|
||||
updateQuaterly($connect);
|
||||
updateQuaterly();
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', disaster');
|
||||
disaster($connect);
|
||||
disaster();
|
||||
} elseif($admin['month'] == 7) {
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', processRiceIncome');
|
||||
processRiceIncome($connect);
|
||||
processRiceIncome();
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', processFall');
|
||||
processFall($connect);
|
||||
processFall();
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', updateQuaterly');
|
||||
updateQuaterly($connect);
|
||||
updateQuaterly();
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', disaster');
|
||||
disaster($connect);
|
||||
disaster();
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', tradeRate');
|
||||
tradeRate($connect);
|
||||
tradeRate();
|
||||
} elseif($admin['month'] == 10) {
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', updateQuaterly');
|
||||
updateQuaterly($connect);
|
||||
updateQuaterly();
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', disaster');
|
||||
disaster($connect);
|
||||
disaster();
|
||||
}
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', postUpdateMonthly');
|
||||
postUpdateMonthly($connect);
|
||||
postUpdateMonthly();
|
||||
|
||||
// 다음달로 넘김
|
||||
$prevTurn = $nextTurn;
|
||||
@@ -1625,7 +1673,7 @@ function checkTurn($connect) {
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
// 그 시각 년도,월 저장
|
||||
$dt = turnDate($connect, $prevTurn);
|
||||
$dt = turnDate($prevTurn);
|
||||
$admin['year'] = $dt[0]; $admin['month'] = $dt[1];
|
||||
// 현재시간의 월턴시간 이후 분단위 장수 처리
|
||||
do {
|
||||
@@ -1640,15 +1688,15 @@ function checkTurn($connect) {
|
||||
//if(PROCESS_LOG) pushProcessLog($processlog);
|
||||
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', processAI');
|
||||
if($general['npc'] >= 2) { processAI($connect, $general['no']); } // npc AI 처리
|
||||
if($general['npc'] >= 2) { processAI($general['no']); } // npc AI 처리
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', PreprocessCommand');
|
||||
PreprocessCommand($connect, $general['no']);
|
||||
PreprocessCommand($general['no']);
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', processCommand');
|
||||
processCommand($connect, $general['no']);
|
||||
processCommand($general['no']);
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', updateCommand');
|
||||
updateCommand($connect, $general['no']);
|
||||
updateCommand($general['no']);
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', updateTurntime');
|
||||
updateTurntime($connect, $general['no']);
|
||||
updateTurntime($general['no']);
|
||||
}
|
||||
} while($gencount > 0);
|
||||
|
||||
@@ -1670,10 +1718,10 @@ function checkTurn($connect) {
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
//토너먼트 처리
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', processTournament');
|
||||
processTournament($connect);
|
||||
processTournament();
|
||||
//거래 처리
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', processAuction');
|
||||
processAuction($connect);
|
||||
processAuction();
|
||||
// 잡금 해제
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', unlock');
|
||||
unlock();
|
||||
@@ -1686,7 +1734,10 @@ function checkTurn($connect) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function addAge($connect) {
|
||||
function addAge() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
//나이와 호봉 증가
|
||||
$query = "update general set age=age+1,belong=belong+1";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -1702,7 +1753,7 @@ function addAge($connect) {
|
||||
|
||||
for($i=0; $i < $gencount; $i++) {
|
||||
$general = MYDB_fetch_array($result);
|
||||
$special = getSpecial($connect, $general['leader'], $general['power'], $general['intel']);
|
||||
$special = getSpecial($general['leader'], $general['power'], $general['intel']);
|
||||
$query = "update general set special='$special' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
@@ -1729,7 +1780,10 @@ function addAge($connect) {
|
||||
}
|
||||
}
|
||||
|
||||
function turnDate($connect, $curtime) {
|
||||
function turnDate($curtime) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select startyear,starttime,turnterm,year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
@@ -1754,7 +1808,10 @@ function turnDate($connect, $curtime) {
|
||||
}
|
||||
|
||||
|
||||
function triggerTournament($connect) {
|
||||
function triggerTournament() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select tournament,tnmt_trig from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
@@ -1764,11 +1821,14 @@ function triggerTournament($connect) {
|
||||
$type = rand() % 6; // 0 : 전력전, 1 : 통솔전, 2 : 일기토, 3 : 설전
|
||||
//전력전 50%, 통, 일, 설 각 17%
|
||||
if($type > 3) { $type = 0; }
|
||||
startTournament($connect, $admin['tnmt_trig'], $type);
|
||||
startTournament($admin['tnmt_trig'], $type);
|
||||
}
|
||||
}
|
||||
|
||||
function PreprocessCommand($connect, $no) {
|
||||
function PreprocessCommand($no) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select no,name,city,injury,special2,item,turn0 from general where no='$no'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
@@ -1847,7 +1907,10 @@ function PreprocessCommand($connect, $no) {
|
||||
}
|
||||
|
||||
|
||||
function updateTurntime($connect, $no) {
|
||||
function updateTurntime($no) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select year,month,isUnited,turnterm from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
@@ -1869,12 +1932,12 @@ function updateTurntime($connect, $no) {
|
||||
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
|
||||
|
||||
if($admin['isUnited'] == 0) {
|
||||
CheckHall($connect, $no);
|
||||
CheckHall($no);
|
||||
}
|
||||
} else {
|
||||
// 군주였으면 유지 이음
|
||||
if($general['level'] == 12) {
|
||||
nextRuler($connect, $general);
|
||||
nextRuler($general);
|
||||
}
|
||||
|
||||
//도시의 태수, 군사, 시중직도 초기화
|
||||
@@ -1987,7 +2050,7 @@ function updateTurntime($connect, $no) {
|
||||
|
||||
if($general['age'] >= 80 && $general['npc'] == 0) {
|
||||
if($admin['isUnited'] == 0) {
|
||||
CheckHall($connect, $no);
|
||||
CheckHall($no);
|
||||
}
|
||||
|
||||
$query = "update general set leader=leader*0.85,power=power*0.85,intel=intel*0.85,injury=0,experience=experience*0.5,dedication=dedication*0.5,firenum=0,warnum=0,killnum=0,deathnum=0,killcrew=0,deathcrew=0,age=20,specage=0,specage2=0,crew=crew*0.85,dex0=dex0*0.5,dex10=dex10*0.5,dex20=dex20*0.5,dex30=dex30*0.5,dex40=dex40*0.5 where no='$no'";
|
||||
@@ -2007,7 +2070,10 @@ function updateTurntime($connect, $no) {
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
|
||||
function CheckHall($connect, $no) {
|
||||
function CheckHall($no) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$type = array(
|
||||
"experience",
|
||||
"dedication",
|
||||
@@ -2089,7 +2155,10 @@ function CheckHall($connect, $no) {
|
||||
}
|
||||
|
||||
|
||||
function uniqueItem($connect, $general, $log, $vote=0) {
|
||||
function uniqueItem($general, $log, $vote=0) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
if($general['npc'] >= 2 || $general['betray'] > 1) { return $log; }
|
||||
if($general['weap'] > 6 || $general['book'] > 6 || $general['horse'] > 6 || $general['item'] > 6) { return $log; }
|
||||
|
||||
@@ -2208,7 +2277,9 @@ function uniqueItem($connect, $general, $log, $vote=0) {
|
||||
return $log;
|
||||
}
|
||||
|
||||
function checkAbility($connect, $general, $log) {
|
||||
function checkAbility($general, $log) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$limit = GameConst::$upgradeLimit;
|
||||
|
||||
@@ -2255,7 +2326,10 @@ function checkAbility($connect, $general, $log) {
|
||||
return $log;
|
||||
}
|
||||
|
||||
function checkDedication($connect, $general, $log) {
|
||||
function checkDedication($general, $log) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$dedlevel = getDedLevel($general['dedication']);
|
||||
|
||||
$query = "update general set dedlevel='$dedlevel' where no='{$general['no']}'";
|
||||
@@ -2272,7 +2346,10 @@ function checkDedication($connect, $general, $log) {
|
||||
return $log;
|
||||
}
|
||||
|
||||
function checkExperience($connect, $general, $log) {
|
||||
function checkExperience($general, $log) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$explevel = getExpLevel($general['experience']);
|
||||
|
||||
$query = "update general set explevel='$explevel' where no='{$general['no']}'";
|
||||
@@ -2289,7 +2366,10 @@ function checkExperience($connect, $general, $log) {
|
||||
return $log;
|
||||
}
|
||||
|
||||
function getAdmin($connect) {
|
||||
function getAdmin() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select * from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
@@ -2297,7 +2377,10 @@ function getAdmin($connect) {
|
||||
return $admin;
|
||||
}
|
||||
|
||||
function getMe($connect) {
|
||||
function getMe() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select * from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("접속자가 많아 접속을 중단합니다. 잠시후 갱신해주세요.<br>getMe : ".MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
@@ -2305,7 +2388,10 @@ function getMe($connect) {
|
||||
return $me;
|
||||
}
|
||||
|
||||
function getTroop($connect, $troop) {
|
||||
function getTroop($troop) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select * from troop where troop='$troop'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$troop = MYDB_fetch_array($result);
|
||||
@@ -2313,7 +2399,10 @@ function getTroop($connect, $troop) {
|
||||
return $troop;
|
||||
}
|
||||
|
||||
function getCity($connect, $city, $sel="*") {
|
||||
function getCity($city, $sel="*") {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select {$sel} from city where city='$city'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$city = MYDB_fetch_array($result);
|
||||
@@ -2321,7 +2410,10 @@ function getCity($connect, $city, $sel="*") {
|
||||
return $city;
|
||||
}
|
||||
|
||||
function getNation($connect, $nation) {
|
||||
function getNation($nation) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select * from nation where nation='$nation'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
@@ -2329,7 +2421,10 @@ function getNation($connect, $nation) {
|
||||
return $nation;
|
||||
}
|
||||
|
||||
function deleteNation($connect, $general) {
|
||||
function deleteNation($general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
@@ -2360,7 +2455,10 @@ function deleteNation($connect, $general) {
|
||||
refreshNationStaticInfo();
|
||||
}
|
||||
|
||||
function nextRuler($connect, $general) {
|
||||
function nextRuler($general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
@@ -2396,8 +2494,8 @@ function nextRuler($connect, $general) {
|
||||
// 아무도 없으면 국가 삭제
|
||||
if($corecount == 0) {
|
||||
//분쟁기록 모두 지움
|
||||
DeleteConflict($connect, $general['nation']);
|
||||
deleteNation($connect, $general);
|
||||
DeleteConflict($general['nation']);
|
||||
deleteNation($general);
|
||||
return;
|
||||
} else {
|
||||
$nextruler = MYDB_fetch_array($result);
|
||||
@@ -2553,7 +2651,10 @@ function CharCritical($rate, $personal) {
|
||||
return $rate;
|
||||
}
|
||||
|
||||
function TrickInjury($connect, $city, $type=0) {
|
||||
function TrickInjury($city, $type=0) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
@@ -16,7 +16,10 @@ function GetStuffName($stuff) {
|
||||
return $str;
|
||||
}
|
||||
|
||||
function registerAuction($connect) {
|
||||
function registerAuction() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select startyear,year,month,turnterm from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
@@ -137,7 +140,10 @@ function registerAuction($connect) {
|
||||
}
|
||||
}
|
||||
|
||||
function processAuction($connect) {
|
||||
function processAuction() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$date = date("Y-m-d H:i:s");
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
|
||||
+115
-91
@@ -1,7 +1,10 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
function getTurn($connect, $general, $type, $font=1) {
|
||||
function getTurn($general, $type, $font=1) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$turn[0] = $general["turn0"];
|
||||
|
||||
if($type >= 1) {
|
||||
@@ -72,7 +75,7 @@ function getTurn($connect, $general, $type, $font=1) {
|
||||
break;
|
||||
case 16: //전쟁
|
||||
$double = $command[1];
|
||||
$city = getCity($connect, $double, "name");
|
||||
$city = getCity($double, "name");
|
||||
$str[$i] = "【{$city['name']}】(으)로 출병";
|
||||
break;
|
||||
case 17: //소집해제
|
||||
@@ -81,7 +84,7 @@ function getTurn($connect, $general, $type, $font=1) {
|
||||
|
||||
case 21: //이동
|
||||
$double = $command[1];
|
||||
$city = getCity($connect, $double, "name");
|
||||
$city = getCity($double, "name");
|
||||
$str[$i] = "【{$city['name']}】(으)로 이동";
|
||||
break;
|
||||
case 22: //등용
|
||||
@@ -113,38 +116,38 @@ function getTurn($connect, $general, $type, $font=1) {
|
||||
break;
|
||||
case 30: //강행
|
||||
$double = $command[1];
|
||||
$city = getCity($connect, $double, "name");
|
||||
$city = getCity($double, "name");
|
||||
$str[$i] = "【{$city['name']}】(으)로 강행";
|
||||
break;
|
||||
|
||||
case 31: //첩보
|
||||
$double = $command[1];
|
||||
$city= getCity($connect, $double, "name");
|
||||
$city= getCity($double, "name");
|
||||
$str[$i] = "【{$city['name']}】에 첩보 실행";
|
||||
break;
|
||||
case 32: //화계
|
||||
$double = $command[1];
|
||||
$city= getCity($connect, $double, "name");
|
||||
$city= getCity($double, "name");
|
||||
$str[$i] = "【{$city['name']}】에 화계 실행";
|
||||
break;
|
||||
case 33: //탈취
|
||||
$double = $command[1];
|
||||
$city= getCity($connect, $double, "name");
|
||||
$city= getCity($double, "name");
|
||||
$str[$i] = "【{$city['name']}】에 탈취 실행";
|
||||
break;
|
||||
case 34: //파괴
|
||||
$double = $command[1];
|
||||
$city= getCity($connect, $double, "name");
|
||||
$city= getCity($double, "name");
|
||||
$str[$i] = "【{$city['name']}】에 파괴 실행";
|
||||
break;
|
||||
case 35: //선동
|
||||
$double = $command[1];
|
||||
$city= getCity($connect, $double, "name");
|
||||
$city= getCity($double, "name");
|
||||
$str[$i] = "【{$city['name']}】에 선동 실행";
|
||||
break;
|
||||
case 36: //기습
|
||||
$double = $command[1];
|
||||
$city= getCity($connect, $double, "name");
|
||||
$city= getCity($double, "name");
|
||||
$str[$i] = "【{$city['name']}】에 기습 실행";
|
||||
break;
|
||||
|
||||
@@ -250,7 +253,10 @@ function getTurn($connect, $general, $type, $font=1) {
|
||||
return $str;
|
||||
}
|
||||
|
||||
function getCoreTurn($connect, $nation, $level) {
|
||||
function getCoreTurn($nation, $level) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$turn[0] = $nation["l{$level}turn0"];
|
||||
$turn[1] = $nation["l{$level}turn1"];
|
||||
$turn[2] = $nation["l{$level}turn2"];
|
||||
@@ -303,7 +309,7 @@ function getCoreTurn($connect, $nation, $level) {
|
||||
$query = "select name from general where no='$third'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
$city = getCity($connect, $double, "name");
|
||||
$city = getCity($double, "name");
|
||||
|
||||
$str[$i] = "【{$general['name']}】【{$city['name']}】(으)로 발령";
|
||||
break;
|
||||
@@ -367,22 +373,22 @@ function getCoreTurn($connect, $nation, $level) {
|
||||
break;
|
||||
case 65: //초토
|
||||
$double = $command[1];
|
||||
$city = getCity($connect, $double, "name");
|
||||
$city = getCity($double, "name");
|
||||
$str[$i] = "【{$city['name']}】(을)를 초토화";
|
||||
break;
|
||||
case 66: //천도
|
||||
$double = $command[1];
|
||||
$city = getCity($connect, $double, "name");
|
||||
$city = getCity($double, "name");
|
||||
$str[$i] = "【{$city['name']}】(으)로 천도";
|
||||
break;
|
||||
case 67: //증축
|
||||
$double = $command[1];
|
||||
$city = getCity($connect, $double, "name");
|
||||
$city = getCity($double, "name");
|
||||
$str[$i] = "【{$city['name']}】(을)를 증축";
|
||||
break;
|
||||
case 68: //감축
|
||||
$double = $command[1];
|
||||
$city = getCity($connect, $double, "name");
|
||||
$city = getCity($double, "name");
|
||||
$str[$i] = "【{$city['name']}】(을)를 감축";
|
||||
break;
|
||||
case 71: //필사즉생
|
||||
@@ -390,17 +396,17 @@ function getCoreTurn($connect, $nation, $level) {
|
||||
break;
|
||||
case 72: //백성동원
|
||||
$double = $command[1];
|
||||
$city = getCity($connect, $double, "name");
|
||||
$city = getCity($double, "name");
|
||||
$str[$i] = "【{$city['name']}】에 백성동원";
|
||||
break;
|
||||
case 73: //수몰
|
||||
$double = $command[1];
|
||||
$city = getCity($connect, $double, "name");
|
||||
$city = getCity($double, "name");
|
||||
$str[$i] = "【{$city['name']}】(을)를 수몰";
|
||||
break;
|
||||
case 74: //허보
|
||||
$double = $command[1];
|
||||
$city = getCity($connect, $double, "name");
|
||||
$city = getCity($double, "name");
|
||||
$str[$i] = "【{$city['name']}】에 허보";
|
||||
break;
|
||||
case 75: //피장파장
|
||||
@@ -448,7 +454,10 @@ function getCoreTurn($connect, $nation, $level) {
|
||||
}
|
||||
|
||||
|
||||
function processCommand($connect, $no) {
|
||||
function processCommand($no) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select npc,no,name,picture,imgsvr,nation,nations,city,troop,injury,leader,leader2,power,power2,intel,intel2,experience,dedication,level,gold,rice,crew,crewtype,train,atmos,weap,book,horse,item,turntime,makenation,makelimit,killturn,block,dedlevel,explevel,age,belong,personal,special,special2,term,turn0,dex0,dex10,dex20,dex30,dex40 from general where no='$no'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
@@ -486,29 +495,29 @@ function processCommand($connect, $no) {
|
||||
}
|
||||
|
||||
switch($corecommand[0]) {
|
||||
case 23: process_23($connect, $general); break; //포상
|
||||
case 24: process_24($connect, $general); break; //몰수
|
||||
case 27: process_27($connect, $general); break; //발령
|
||||
case 51: process_51($connect, $general); break; //항복권고
|
||||
case 52: process_52($connect, $general); break; //원조
|
||||
case 53: process_53($connect, $general); break; //통합제의
|
||||
case 61: process_61($connect, $general); break; //불가침제의
|
||||
case 62: process_62($connect, $general); break; //선전 포고
|
||||
case 63: process_63($connect, $general); break; //종전 제의
|
||||
case 64: process_64($connect, $general); break; //파기 제의
|
||||
case 65: process_65($connect, $general); break; //초토화
|
||||
case 66: process_66($connect, $general); break; //천도
|
||||
case 67: process_67($connect, $general); break; //증축
|
||||
case 68: process_68($connect, $general); break; //감축
|
||||
case 71: process_71($connect, $general); break; //필사즉생
|
||||
case 72: process_72($connect, $general); break; //백성동원
|
||||
case 73: process_73($connect, $general); break; //수몰
|
||||
case 74: process_74($connect, $general); break; //허보
|
||||
case 75: process_75($connect, $general); break; //피장파장
|
||||
case 76: process_76($connect, $general); break; //의병모집
|
||||
case 77: process_77($connect, $general); break; //이호경식
|
||||
case 78: process_78($connect, $general); break; //급습
|
||||
case 81: process_81($connect, $general); break; //국기변경
|
||||
case 23: process_23($general); break; //포상
|
||||
case 24: process_24($general); break; //몰수
|
||||
case 27: process_27($general); break; //발령
|
||||
case 51: process_51($general); break; //항복권고
|
||||
case 52: process_52($general); break; //원조
|
||||
case 53: process_53($general); break; //통합제의
|
||||
case 61: process_61($general); break; //불가침제의
|
||||
case 62: process_62($general); break; //선전 포고
|
||||
case 63: process_63($general); break; //종전 제의
|
||||
case 64: process_64($general); break; //파기 제의
|
||||
case 65: process_65($general); break; //초토화
|
||||
case 66: process_66($general); break; //천도
|
||||
case 67: process_67($general); break; //증축
|
||||
case 68: process_68($general); break; //감축
|
||||
case 71: process_71($general); break; //필사즉생
|
||||
case 72: process_72($general); break; //백성동원
|
||||
case 73: process_73($general); break; //수몰
|
||||
case 74: process_74($general); break; //허보
|
||||
case 75: process_75($general); break; //피장파장
|
||||
case 76: process_76($general); break; //의병모집
|
||||
case 77: process_77($general); break; //이호경식
|
||||
case 78: process_78($general); break; //급습
|
||||
case 81: process_81($general); break; //국기변경
|
||||
case 99: break; //수뇌부휴식
|
||||
}
|
||||
|
||||
@@ -542,59 +551,62 @@ function processCommand($connect, $no) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:아무것도 실행하지 않았습니다. <1>$date</>";
|
||||
pushGenLog($general, $log);
|
||||
break;
|
||||
case 1: process_1($connect, $general, 1); break; //농업
|
||||
case 2: process_1($connect, $general, 2); break; //상업
|
||||
case 3: process_3($connect, $general); break; //기술
|
||||
case 4: process_4($connect, $general); break; //선정
|
||||
case 5: process_5($connect, $general, 1); break; //수비
|
||||
case 6: process_5($connect, $general, 2); break; //성벽
|
||||
case 7: process_7($connect, $general); break; //정착 장려
|
||||
case 8: process_8($connect, $general); break; //치안
|
||||
case 9: process_9($connect, $general); break; //조달
|
||||
case 1: process_1($general, 1); break; //농업
|
||||
case 2: process_1($general, 2); break; //상업
|
||||
case 3: process_3($general); break; //기술
|
||||
case 4: process_4($general); break; //선정
|
||||
case 5: process_5($general, 1); break; //수비
|
||||
case 6: process_5($general, 2); break; //성벽
|
||||
case 7: process_7($general); break; //정착 장려
|
||||
case 8: process_8($general); break; //치안
|
||||
case 9: process_9($general); break; //조달
|
||||
|
||||
case 11: process_11($connect, $general, 1); break; //징병
|
||||
case 12: process_11($connect, $general, 2); break; //모병
|
||||
case 13: process_13($connect, $general); break; //훈련
|
||||
case 14: process_14($connect, $general); break; //사기진작
|
||||
case 15: process_15($connect, $general); break; //전투태세
|
||||
case 16: process_16($connect, $general); break; //전쟁
|
||||
case 17: process_17($connect, $general); break; //소집해제
|
||||
case 11: process_11($general, 1); break; //징병
|
||||
case 12: process_11($general, 2); break; //모병
|
||||
case 13: process_13($general); break; //훈련
|
||||
case 14: process_14($general); break; //사기진작
|
||||
case 15: process_15($general); break; //전투태세
|
||||
case 16: process_16($general); break; //전쟁
|
||||
case 17: process_17($general); break; //소집해제
|
||||
|
||||
case 21: process_21($connect, $general); break; //이동
|
||||
//case 22: process_22($connect, $general); break; //등용 //TODO:등용장 재 디자인
|
||||
case 25: process_25($connect, $general); break; //임관
|
||||
case 26: process_26($connect, $general); break; //집합
|
||||
case 28: process_28($connect, $general); break; //귀환
|
||||
case 29: process_29($connect, $general); break; //인재탐색
|
||||
case 30: process_30($connect, $general); break; //강행
|
||||
case 21: process_21($general); break; //이동
|
||||
//case 22: process_22($general); break; //등용 //TODO:등용장 재 디자인
|
||||
case 25: process_25($general); break; //임관
|
||||
case 26: process_26($general); break; //집합
|
||||
case 28: process_28($general); break; //귀환
|
||||
case 29: process_29($general); break; //인재탐색
|
||||
case 30: process_30($general); break; //강행
|
||||
|
||||
case 31: process_31($connect, $general); break; //첩보
|
||||
case 32: process_32($connect, $general); break; //화계
|
||||
case 33: process_33($connect, $general); break; //탈취
|
||||
case 34: process_34($connect, $general); break; //파괴
|
||||
case 35: process_35($connect, $general); break; //선동
|
||||
case 36: process_36($connect, $general); break; //기습
|
||||
case 31: process_31($general); break; //첩보
|
||||
case 32: process_32($general); break; //화계
|
||||
case 33: process_33($general); break; //탈취
|
||||
case 34: process_34($general); break; //파괴
|
||||
case 35: process_35($general); break; //선동
|
||||
case 36: process_36($general); break; //기습
|
||||
|
||||
case 41: process_41($connect, $general); break; //단련
|
||||
case 42: process_42($connect, $general); break; //견문
|
||||
case 43: process_43($connect, $general); break; //증여
|
||||
case 44: process_44($connect, $general); break; //헌납
|
||||
case 45: process_45($connect, $general); break; //하야
|
||||
case 46: process_46($connect, $general); break; //건국
|
||||
case 47: process_47($connect, $general); break; //방랑
|
||||
case 48: process_48($connect, $general); break; //장비매매
|
||||
case 49: process_49($connect, $general); break; //군량매매
|
||||
case 50: process_50($connect, $general); break; //요양
|
||||
case 41: process_41($general); break; //단련
|
||||
case 42: process_42($general); break; //견문
|
||||
case 43: process_43($general); break; //증여
|
||||
case 44: process_44($general); break; //헌납
|
||||
case 45: process_45($general); break; //하야
|
||||
case 46: process_46($general); break; //건국
|
||||
case 47: process_47($general); break; //방랑
|
||||
case 48: process_48($general); break; //장비매매
|
||||
case 49: process_49($general); break; //군량매매
|
||||
case 50: process_50($general); break; //요양
|
||||
|
||||
case 54: process_54($connect, $general); break; //선양
|
||||
case 55: process_55($connect, $general); break; //거병
|
||||
case 56: process_56($connect, $general); break; //해산
|
||||
case 57: process_57($connect, $general); break; //모반 시도
|
||||
case 54: process_54($general); break; //선양
|
||||
case 55: process_55($general); break; //거병
|
||||
case 56: process_56($general); break; //해산
|
||||
case 57: process_57($general); break; //모반 시도
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function updateCommand($connect, $no, $type=0) {
|
||||
function updateCommand($no, $type=0) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select no,nation,level from general where no='$no'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
@@ -626,7 +638,10 @@ where nation='{$general['nation']}'
|
||||
}
|
||||
|
||||
|
||||
function backupdateCommand($connect, $no, $type=0) {
|
||||
function backupdateCommand($no, $type=0) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select no,nation,level from general where no='$no'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
@@ -666,7 +681,10 @@ where nation='{$general['nation']}'
|
||||
}
|
||||
|
||||
|
||||
function command_Single($connect, $turn, $command) {
|
||||
function command_Single($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$command = EncodeCommand(0, 0, 0, $command);
|
||||
|
||||
$count = sizeof($turn);
|
||||
@@ -681,7 +699,10 @@ function command_Single($connect, $turn, $command) {
|
||||
|
||||
}
|
||||
|
||||
function command_Chief($connect, $turn, $command) {
|
||||
function command_Chief($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$command = EncodeCommand(0, 0, 0, $command);
|
||||
|
||||
$query = "select nation,level from general where owner='{$session->userID}'";
|
||||
@@ -701,7 +722,10 @@ function command_Chief($connect, $turn, $command) {
|
||||
echo 'b_chiefcenter.php';//TODO:debug all and replace
|
||||
}
|
||||
|
||||
function command_Other($connect, $turn, $commandtype) {
|
||||
function command_Other($turn, $commandtype) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
echo "<form name=form1 action=processing.php method=post target=_parent>";
|
||||
$count = sizeof($turn);
|
||||
for($i=0; $i < $count; $i++) {
|
||||
|
||||
+59
-27
@@ -86,7 +86,7 @@ function abilityPowint() {
|
||||
// 20 인덕 = 1 통솔내정
|
||||
// 30 거상, 귀모 = 2 공통내정
|
||||
|
||||
function getSpecial($connect, $leader, $power, $intel) {
|
||||
function getSpecial($leader, $power, $intel) {
|
||||
//통장
|
||||
if($leader*0.9 > $power && $leader*0.9 > $intel) {
|
||||
$type = array(20, 31);
|
||||
@@ -188,7 +188,10 @@ function getGenDex($general, $type) {
|
||||
return $general["dex{$type}"];
|
||||
}
|
||||
|
||||
function addGenDex($connect, $no, $type, $exp) {
|
||||
function addGenDex($no, $type, $exp) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$type = floor($type / 10) * 10;
|
||||
$dexType = "dex{$type}";
|
||||
if($type == 30) { $exp = round($exp * 0.90); } //귀병은 90%효율
|
||||
@@ -235,8 +238,9 @@ function SetNationFront($nationNo) {
|
||||
}
|
||||
}
|
||||
|
||||
function checkSupply($connect) {
|
||||
function checkSupply() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$cities = [];
|
||||
foreach($db->query('SELECT city, nation FROM city WHERE nation != 0') as $city){
|
||||
@@ -308,13 +312,16 @@ function checkSupply($connect) {
|
||||
}
|
||||
|
||||
|
||||
function updateYearly($connect) {
|
||||
function updateYearly() {
|
||||
//통계
|
||||
checkStatistic($connect);
|
||||
checkStatistic();
|
||||
}
|
||||
|
||||
//관직 변경 해제
|
||||
function updateQuaterly($connect) {
|
||||
function updateQuaterly() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
//천도 제한 해제, 관직 변경 제한 해제
|
||||
$query = "update nation set capset='0',l12set='0',l11set='0',l10set='0',l9set='0',l8set='0',l7set='0',l6set='0',l5set='0'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -324,7 +331,10 @@ function updateQuaterly($connect) {
|
||||
}
|
||||
|
||||
// 벌점 감소와 건국제한-1 전턴제한-1 외교제한-1, 1달마다 실행, 병사 있는 장수의 군량 감소, 수입비율 조정
|
||||
function preUpdateMonthly($connect) {
|
||||
function preUpdateMonthly() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
//연감 월결산
|
||||
$result = LogHistory();
|
||||
$history = array();
|
||||
@@ -340,7 +350,7 @@ function preUpdateMonthly($connect) {
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
//보급선 체크
|
||||
checkSupply($connect);
|
||||
checkSupply();
|
||||
//미보급도시 10% 감소
|
||||
$query = "update city set pop=pop*0.9,rate=rate*0.9,agri=agri*0.9,comm=comm*0.9,secu=secu*0.9,def=def*0.9,wall=wall*0.9 where supply='0'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -423,7 +433,7 @@ function preUpdateMonthly($connect) {
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
//매달 사망자 수입 결산
|
||||
processDeadIncome($connect, $ratio);
|
||||
processDeadIncome($ratio);
|
||||
|
||||
//계략, 전쟁표시 해제
|
||||
$query = "update city set state=0 where state=31 or state=33";
|
||||
@@ -451,8 +461,8 @@ function preUpdateMonthly($connect) {
|
||||
|
||||
unset($log);
|
||||
$log = [];
|
||||
$log = checkDedication($connect, $general, $log);
|
||||
$log = checkExperience($connect, $general, $log);
|
||||
$log = checkDedication($general, $log);
|
||||
$log = checkExperience($general, $log);
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
@@ -479,7 +489,10 @@ function preUpdateMonthly($connect) {
|
||||
}
|
||||
|
||||
// 외교 로그처리, 외교 상태 처리
|
||||
function postUpdateMonthly($connect) {
|
||||
function postUpdateMonthly() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select startyear,year,month,scenario from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
@@ -602,21 +615,21 @@ group by A.nation
|
||||
$query = "update diplomacy set state='0',term='6' where state='1' and term='0'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
//3,4 기간 끝나면 통합
|
||||
checkMerge($connect);
|
||||
checkMerge();
|
||||
//5,6 기간 끝나면 합병
|
||||
checkSurrender($connect);
|
||||
checkSurrender();
|
||||
//초반이후 방랑군 자동 해체
|
||||
if($admin['year'] >= $admin['startyear']+3) {
|
||||
checkWander($connect);
|
||||
checkWander();
|
||||
}
|
||||
// 작위 업데이트
|
||||
updateNationState($connect);
|
||||
updateNationState();
|
||||
// 천통여부 검사
|
||||
checkEmperior($connect);
|
||||
checkEmperior();
|
||||
//토너먼트 개시
|
||||
triggerTournament($connect);
|
||||
triggerTournament();
|
||||
// 시스템 거래건 등록
|
||||
registerAuction($connect);
|
||||
registerAuction();
|
||||
//전방설정
|
||||
foreach(getAllNationStaticInfo() as $nation){
|
||||
if($nation['level'] <= 0){
|
||||
@@ -627,7 +640,10 @@ group by A.nation
|
||||
}
|
||||
|
||||
|
||||
function checkWander($connect) {
|
||||
function checkWander() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
@@ -648,7 +664,7 @@ function checkWander($connect) {
|
||||
|
||||
$log[0] = "<C>●</>초반 제한후 방랑군은 자동 해산됩니다.";
|
||||
pushGenLog($king, $log);
|
||||
process_56($connect, $king);
|
||||
process_56($king);
|
||||
}
|
||||
|
||||
if($needRefresh){
|
||||
@@ -656,7 +672,10 @@ function checkWander($connect) {
|
||||
}
|
||||
}
|
||||
|
||||
function checkMerge($connect) {
|
||||
function checkMerge() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
@@ -770,7 +789,10 @@ function checkMerge($connect) {
|
||||
}
|
||||
}
|
||||
|
||||
function checkSurrender($connect) {
|
||||
function checkSurrender() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
@@ -890,7 +912,10 @@ function checkSurrender($connect) {
|
||||
}
|
||||
}
|
||||
|
||||
function updateNationState($connect) {
|
||||
function updateNationState() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$history = array();
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -968,7 +993,10 @@ function updateNationState($connect) {
|
||||
pushWorldHistory($history, $admin['year'], $admin['month']);
|
||||
}
|
||||
|
||||
function checkStatistic($connect) {
|
||||
function checkStatistic() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
@@ -1084,6 +1112,7 @@ function checkStatistic($connect) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
$query = "
|
||||
insert into statistic (
|
||||
year, month,
|
||||
@@ -1099,7 +1128,10 @@ function checkStatistic($connect) {
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
|
||||
function checkEmperior($connect) {
|
||||
function checkEmperior() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select year,month,isUnited from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
@@ -1131,7 +1163,7 @@ function checkEmperior($connect) {
|
||||
|
||||
for($i=0; $i < $count; $i++) {
|
||||
$general = MYDB_fetch_array($result);
|
||||
CheckHall($connect, $general['no']);
|
||||
CheckHall($general['no']);
|
||||
}
|
||||
|
||||
$query = "select nation,name,type,color,gold,rice,power,gennum from nation where nation='{$nation['nation']}'";
|
||||
|
||||
+4
-1
@@ -109,7 +109,10 @@ function printCitysName(int $cityNo, int $maxDistance=1) {
|
||||
}
|
||||
|
||||
|
||||
function info($connect, $type=0) {
|
||||
function info($type=0) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select year,month,turnterm,maxgeneral from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
+17
-8
@@ -277,7 +277,10 @@ function getMailboxList(){
|
||||
|
||||
// type : xx,xx(불가침기간,타입)
|
||||
// who : xxxx,xxxx(발신인, 수신인)
|
||||
function DecodeMsg($connect, $msg, $type, $who, $date, $bg, $num=0) {
|
||||
function DecodeMsg($msg, $type, $who, $date, $bg, $num=0) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
//FIXME: 폐기
|
||||
$query = "select no,nation,name,picture,level from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -333,13 +336,19 @@ function DecodeMsg($connect, $msg, $type, $who, $date, $bg, $num=0) {
|
||||
}
|
||||
|
||||
|
||||
function moveMsg($connect, $table, $msgtype, $msgnum, $msg, $type, $who, $when, $column, $value) {
|
||||
function moveMsg($table, $msgtype, $msgnum, $msg, $type, $who, $when, $column, $value) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
//TODO: moveMsg 쓰는 곳 모두 고쳐!!!
|
||||
$query = "update {$table} set {$msgtype}{$msgnum}='$msg',{$msgtype}{$msgnum}_type='$type',{$msgtype}{$msgnum}_who='$who',{$msgtype}{$msgnum}_when='$when' where {$column}='$value'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
|
||||
function MsgDip($connect, $bg) {
|
||||
function MsgDip($bg) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select no,nation from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
@@ -348,11 +357,11 @@ function MsgDip($connect, $bg) {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
|
||||
if($nation['dip0']) { echo "\n"; DecodeMsg($connect, $nation['dip0'], $nation['dip0_type'], $nation['dip0_who'], $nation['dip0_when'], $bg, 0); }
|
||||
if($nation['dip1']) { echo "\n"; DecodeMsg($connect, $nation['dip1'], $nation['dip1_type'], $nation['dip1_who'], $nation['dip1_when'], $bg, 1); }
|
||||
if($nation['dip2']) { echo "\n"; DecodeMsg($connect, $nation['dip2'], $nation['dip2_type'], $nation['dip2_who'], $nation['dip2_when'], $bg, 2); }
|
||||
if($nation['dip3']) { echo "\n"; DecodeMsg($connect, $nation['dip3'], $nation['dip3_type'], $nation['dip3_who'], $nation['dip3_when'], $bg, 3); }
|
||||
if($nation['dip4']) { echo "\n"; DecodeMsg($connect, $nation['dip4'], $nation['dip4_type'], $nation['dip4_who'], $nation['dip4_when'], $bg, 4); }
|
||||
if($nation['dip0']) { echo "\n"; DecodeMsg($nation['dip0'], $nation['dip0_type'], $nation['dip0_who'], $nation['dip0_when'], $bg, 0); }
|
||||
if($nation['dip1']) { echo "\n"; DecodeMsg($nation['dip1'], $nation['dip1_type'], $nation['dip1_who'], $nation['dip1_when'], $bg, 1); }
|
||||
if($nation['dip2']) { echo "\n"; DecodeMsg($nation['dip2'], $nation['dip2_type'], $nation['dip2_who'], $nation['dip2_when'], $bg, 2); }
|
||||
if($nation['dip3']) { echo "\n"; DecodeMsg($nation['dip3'], $nation['dip3_type'], $nation['dip3_who'], $nation['dip3_when'], $bg, 3); }
|
||||
if($nation['dip4']) { echo "\n"; DecodeMsg($nation['dip4'], $nation['dip4_type'], $nation['dip4_who'], $nation['dip4_when'], $bg, 4); }
|
||||
}
|
||||
|
||||
function ShowMsg($bgcolor, $type, $picture, $imgsvr, $me, $mycolor, $you, $youcolor, $msg, $date, $num=0, $who=0, $when=0, $level=0, $note="") {
|
||||
|
||||
+39
-18
@@ -1,7 +1,10 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
function SetDevelop($connect, $genType, $no, $city, $tech) {
|
||||
function SetDevelop($genType, $no, $city, $tech) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select rate,pop/pop2*100 as po,comm/comm2*100 as co,def/def2*100 as de,wall/wall2*100 as wa,secu/secu2*100 as se,agri/agri2*100 as ag from city where city='$city'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$city = MYDB_fetch_array($result);
|
||||
@@ -77,7 +80,10 @@ function SetDevelop($connect, $genType, $no, $city, $tech) {
|
||||
return;
|
||||
}
|
||||
|
||||
function SetCrew($connect, $no, $personal, $gold, $leader, $genType, $tech, $region, $city, $dex0, $dex10, $dex20, $dex30, $dex40) {
|
||||
function SetCrew($no, $personal, $gold, $leader, $genType, $tech, $region, $city, $dex0, $dex10, $dex20, $dex30, $dex40) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
switch($genType) {
|
||||
case 0: //무장
|
||||
case 2: //무내정장
|
||||
@@ -156,7 +162,10 @@ function SetCrew($connect, $no, $personal, $gold, $leader, $genType, $tech, $reg
|
||||
return;
|
||||
}
|
||||
|
||||
function processAI($connect, $no) {
|
||||
function processAI($no) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select startyear,year,month,turnterm,scenario,gold_rate,rice_rate from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error("processAI00 ".MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
@@ -387,17 +396,17 @@ function processAI($connect, $no) {
|
||||
//분기마다
|
||||
if($admin['month'] == 1 || $admin['month'] == 4 || $admin['month'] == 7 || $admin['month'] == 10) {
|
||||
//관직임명
|
||||
Promotion($connect, $general['nation'], $nation['level']);
|
||||
Promotion($general['nation'], $nation['level']);
|
||||
} elseif($admin['month'] == 12) {
|
||||
//세율
|
||||
$nation['rate'] = TaxRate($connect, $general['nation']);
|
||||
$nation['rate'] = TaxRate($general['nation']);
|
||||
//지급율
|
||||
GoldBillRate($connect, $nation['nation'], $nation['rate'], $admin['gold_rate'], $nation['type'], $nation['gold']);
|
||||
GoldBillRate($nation['nation'], $nation['rate'], $admin['gold_rate'], $nation['type'], $nation['gold']);
|
||||
} elseif($admin['month'] == 6) {
|
||||
//세율
|
||||
$nation['rate'] = TaxRate($connect, $general['nation']);
|
||||
$nation['rate'] = TaxRate($general['nation']);
|
||||
//지급율
|
||||
RiceBillRate($connect, $nation['nation'], $nation['rate'], $admin['rice_rate'], $nation['type'], $nation['rice']);
|
||||
RiceBillRate($nation['nation'], $nation['rate'], $admin['rice_rate'], $nation['type'], $nation['rice']);
|
||||
}
|
||||
|
||||
//방랑군이냐 아니냐
|
||||
@@ -889,7 +898,7 @@ function processAI($connect, $no) {
|
||||
|
||||
switch($command) {
|
||||
case "00000000000001": //내정
|
||||
SetDevelop($connect, $genType, $general['no'], $general['city'], $nation['tech']);
|
||||
SetDevelop($genType, $general['no'], $general['city'], $nation['tech']);
|
||||
return;
|
||||
case "00000000000011": //징병
|
||||
$query = "select region from city where nation='{$general['nation']}' order by rand() limit 0,1";
|
||||
@@ -907,7 +916,7 @@ function processAI($connect, $no) {
|
||||
if($selCity['city'] == 0) {
|
||||
$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($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;
|
||||
default:
|
||||
$query = "update general set turn0='$command' where no='{$general['no']}'";
|
||||
@@ -918,7 +927,10 @@ function processAI($connect, $no) {
|
||||
//종전하기, 지급율
|
||||
//$command = $fourth * 100000000 + $type * 100000 + $crew * 100 + 11;
|
||||
|
||||
function Promotion($connect, $nation, $level) {
|
||||
function Promotion($nation, $level) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$lv = getNationChiefLevel($level);
|
||||
|
||||
$query = "select scenario,killturn from game limit 1";
|
||||
@@ -990,7 +1002,10 @@ function Promotion($connect, $nation, $level) {
|
||||
}
|
||||
}
|
||||
|
||||
function TaxRate($connect, $nation) {
|
||||
function TaxRate($nation) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
//도시
|
||||
$query = "select city from city where nation='$nation'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -1018,10 +1033,13 @@ function TaxRate($connect, $nation) {
|
||||
}
|
||||
}
|
||||
|
||||
function GoldBillRate($connect, $nation, $rate, $gold_rate, $type, $gold) {
|
||||
$incomeList = getGoldIncome($connect, $nation, $rate, $gold_rate, $type);
|
||||
function GoldBillRate($nation, $rate, $gold_rate, $type, $gold) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$incomeList = getGoldIncome($nation, $rate, $gold_rate, $type);
|
||||
$income = $gold + $incomeList[0] + $incomeList[1];
|
||||
$outcome = getGoldOutcome($connect, $nation, 100); // 100%의 지급량
|
||||
$outcome = getGoldOutcome($nation, 100); // 100%의 지급량
|
||||
$bill = floor($income / $outcome * 90); // 수입의 90% 만 지급
|
||||
|
||||
if($bill < 20) { $bill = 20; }
|
||||
@@ -1031,10 +1049,13 @@ function GoldBillRate($connect, $nation, $rate, $gold_rate, $type, $gold) {
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
|
||||
function RiceBillRate($connect, $nation, $rate, $rice_rate, $type, $rice) {
|
||||
$incomeList = getRiceIncome($connect, $nation, $rate, $rice_rate, $type);
|
||||
function RiceBillRate($nation, $rate, $rice_rate, $type, $rice) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$incomeList = getRiceIncome($nation, $rate, $rice_rate, $type);
|
||||
$income = $rice + $incomeList[0] + $incomeList[1];
|
||||
$outcome = getRiceOutcome($connect, $nation, 100); // 100%의 지급량
|
||||
$outcome = getRiceOutcome($nation, 100); // 100%의 지급량
|
||||
$bill = floor($income / $outcome * 90); // 수입의 90% 만 지급
|
||||
|
||||
if($bill < 20) { $bill = 20; }
|
||||
|
||||
+148
-72
@@ -162,7 +162,10 @@ function CriticalScore($score, $type) {
|
||||
return round($score * $ratio);
|
||||
}
|
||||
|
||||
function process_1($connect, &$general, $type) {
|
||||
function process_1(&$general, $type) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -252,14 +255,17 @@ function process_1($connect, &$general, $type) {
|
||||
$query = "update general set resturn='SUCCESS',gold='{$general['gold']}',intel2='{$general['intel2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$log = checkAbility($connect, $general, $log);
|
||||
$log = uniqueItem($connect, $general, $log);
|
||||
$log = checkAbility($general, $log);
|
||||
$log = uniqueItem($general, $log);
|
||||
}
|
||||
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_3($connect, &$general) {
|
||||
function process_3(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -347,14 +353,17 @@ function process_3($connect, &$general) {
|
||||
$query = "update general set resturn='SUCCESS',gold='{$general['gold']}',intel2='{$general['intel2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$log = checkAbility($connect, $general, $log);
|
||||
$log = uniqueItem($connect, $general, $log);
|
||||
$log = checkAbility($general, $log);
|
||||
$log = uniqueItem($general, $log);
|
||||
}
|
||||
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_4($connect, &$general) {
|
||||
function process_4(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -435,14 +444,17 @@ function process_4($connect, &$general) {
|
||||
$query = "update general set resturn='SUCCESS',rice='{$general['rice']}',leader2='{$general['leader2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$log = checkAbility($connect, $general, $log);
|
||||
$log = uniqueItem($connect, $general, $log);
|
||||
$log = checkAbility($general, $log);
|
||||
$log = uniqueItem($general, $log);
|
||||
}
|
||||
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_5($connect, &$general, $type) {
|
||||
function process_5(&$general, $type) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -531,14 +543,17 @@ function process_5($connect, &$general, $type) {
|
||||
$query = "update general set resturn='SUCCESS',gold='{$general['gold']}',power2='{$general['power2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$log = checkAbility($connect, $general, $log);
|
||||
$log = uniqueItem($connect, $general, $log);
|
||||
$log = checkAbility($general, $log);
|
||||
$log = uniqueItem($general, $log);
|
||||
}
|
||||
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_7($connect, &$general) {
|
||||
function process_7(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -619,14 +634,17 @@ function process_7($connect, &$general) {
|
||||
$query = "update general set resturn='SUCCESS',rice='{$general['rice']}',leader2='{$general['leader2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$log = checkAbility($connect, $general, $log);
|
||||
$log = uniqueItem($connect, $general, $log);
|
||||
$log = checkAbility($general, $log);
|
||||
$log = uniqueItem($general, $log);
|
||||
}
|
||||
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_8($connect, &$general) {
|
||||
function process_8(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -713,14 +731,16 @@ function process_8($connect, &$general) {
|
||||
$query = "update general set resturn='SUCCESS',gold='{$general['gold']}',power2='{$general['power2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$log = checkAbility($connect, $general, $log);
|
||||
$log = uniqueItem($connect, $general, $log);
|
||||
$log = checkAbility($general, $log);
|
||||
$log = uniqueItem($general, $log);
|
||||
}
|
||||
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_9($connect, &$general) {
|
||||
function process_9(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
@@ -803,12 +823,14 @@ function process_9($connect, &$general) {
|
||||
}
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$log = checkAbility($connect, $general, $log);
|
||||
$log = checkAbility($general, $log);
|
||||
}
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_11($connect, &$general, $type) {
|
||||
function process_11(&$general, $type) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
@@ -965,7 +987,7 @@ function process_11($connect, &$general, $type) {
|
||||
$exp = $crew;
|
||||
$ded = $crew;
|
||||
// 숙련도 증가
|
||||
addGenDex($connect, $general['no'], $armtype, $crew);
|
||||
addGenDex($general['no'], $armtype, $crew);
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
@@ -986,14 +1008,17 @@ function process_11($connect, &$general, $type) {
|
||||
$query = "update general set resturn='SUCCESS',leader2='{$general['leader2']}',crewtype='$armtype',crew='{$general['crew']}',train='$train',atmos='$atmos',gold='{$general['gold']}',rice=rice-'$crew',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$log = checkAbility($connect, $general, $log);
|
||||
$log = uniqueItem($connect, $general, $log);
|
||||
$log = checkAbility($general, $log);
|
||||
$log = uniqueItem($general, $log);
|
||||
}
|
||||
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_13($connect, &$general) {
|
||||
function process_13(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -1032,7 +1057,7 @@ function process_13($connect, &$general) {
|
||||
$exp = 100;
|
||||
$ded = 70;
|
||||
// 숙련도 증가
|
||||
addGenDex($connect, $general['no'], $general['crewtype'], round($general['crew']/100));
|
||||
addGenDex($general['no'], $general['crewtype'], round($general['crew']/100));
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
@@ -1053,14 +1078,17 @@ function process_13($connect, &$general) {
|
||||
$query = "update general set resturn='SUCCESS',leader2='{$general['leader2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$log = checkAbility($connect, $general, $log);
|
||||
$log = uniqueItem($connect, $general, $log);
|
||||
$log = checkAbility($general, $log);
|
||||
$log = uniqueItem($general, $log);
|
||||
}
|
||||
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_14($connect, &$general) {
|
||||
function process_14(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
global $_maxatmos, $_training;
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
@@ -1101,7 +1129,7 @@ function process_14($connect, &$general) {
|
||||
$exp = 100;
|
||||
$ded = 70;
|
||||
// 숙련도 증가
|
||||
addGenDex($connect, $general['no'], $general['crewtype'], round($general['crew']/100));
|
||||
addGenDex($general['no'], $general['crewtype'], round($general['crew']/100));
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
@@ -1113,14 +1141,17 @@ function process_14($connect, &$general) {
|
||||
$query = "update general set resturn='SUCCESS',atmos='$score',gold='$gold',leader2='{$general['leader2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$log = checkAbility($connect, $general, $log);
|
||||
$log = uniqueItem($connect, $general, $log);
|
||||
$log = checkAbility($general, $log);
|
||||
$log = uniqueItem($general, $log);
|
||||
}
|
||||
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_15($connect, &$general) {
|
||||
function process_15(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
global $_maxatmos, $_maxtrain;
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
@@ -1174,7 +1205,7 @@ function process_15($connect, &$general) {
|
||||
$exp = 100 * 3;
|
||||
$ded = 70 * 3;
|
||||
// 숙련도 증가
|
||||
addGenDex($connect, $general['no'], $general['crewtype'], round($general['crew']/100 * 3));
|
||||
addGenDex($general['no'], $general['crewtype'], round($general['crew']/100 * 3));
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
$ded = CharDedication($ded, $general['personal']);
|
||||
@@ -1184,14 +1215,17 @@ function process_15($connect, &$general) {
|
||||
$query = "update general set resturn='SUCCESS',term='0',atmos='95',train='95',gold='$gold',leader2='{$general['leader2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$log = checkAbility($connect, $general, $log);
|
||||
$log = uniqueItem($connect, $general, $log);
|
||||
$log = checkAbility($general, $log);
|
||||
$log = uniqueItem($general, $log);
|
||||
}
|
||||
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_16($connect, &$general) {
|
||||
function process_16(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -1250,16 +1284,16 @@ function process_16($connect, &$general) {
|
||||
} elseif($general['nation'] == $destcity['nation']) {
|
||||
$log[] = "<C>●</>{$admin['month']}월:본국입니다. <G><b>{$destcity['name']}</b></>(으)로 출병 실패. <1>$date</>";
|
||||
pushGenLog($general, $log);
|
||||
process_21($connect, $general);
|
||||
process_21($general);
|
||||
return;
|
||||
} else {
|
||||
// 전쟁 표시
|
||||
$query = "update city set state=43,term=3 where city='{$destcity['city']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
// 숙련도 증가
|
||||
addGenDex($connect, $general['no'], $general['crewtype'], round($general['crew']/100));
|
||||
addGenDex($general['no'], $general['crewtype'], round($general['crew']/100));
|
||||
// 전투 처리
|
||||
$dead = processWar($connect, $general, $destcity);
|
||||
$dead = processWar($general, $destcity);
|
||||
|
||||
// 기술력 따라서 보정
|
||||
$dead['att'] = round($dead['att'] * getTechCost($nation['tech']));
|
||||
@@ -1273,13 +1307,16 @@ function process_16($connect, &$general) {
|
||||
$query = "update diplomacy set dead=dead+'{$dead['def']}' where you='{$nation['nation']}' and me='{$dnation['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
$log = uniqueItem($connect, $general, $log);
|
||||
$log = uniqueItem($general, $log);
|
||||
}
|
||||
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_17($connect, &$general) {
|
||||
function process_17(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -1312,12 +1349,15 @@ function process_17($connect, &$general) {
|
||||
$query = "update general set resturn='SUCCESS',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$log = checkAbility($connect, $general, $log);
|
||||
$log = checkAbility($general, $log);
|
||||
}
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_21($connect, &$general) {
|
||||
function process_21(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -1370,18 +1410,21 @@ function process_21($connect, &$general) {
|
||||
}
|
||||
}
|
||||
|
||||
$log = checkAbility($connect, $general, $log);
|
||||
$log = checkAbility($general, $log);
|
||||
}
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_26($connect, &$general) {
|
||||
function process_26(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
$date = substr($general['turntime'],11,5);
|
||||
|
||||
$troop = getTroop($connect, $general['troop']);
|
||||
$troop = getTroop($general['troop']);
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -1430,15 +1473,18 @@ function process_26($connect, &$general) {
|
||||
$query = "update general set resturn='SUCCESS',leader2='{$general['leader2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$log = checkAbility($connect, $general, $log);
|
||||
$log = uniqueItem($connect, $general, $log);
|
||||
$log = checkAbility($general, $log);
|
||||
$log = uniqueItem($general, $log);
|
||||
}
|
||||
|
||||
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_28($connect, &$general) {
|
||||
function process_28(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -1494,14 +1540,17 @@ function process_28($connect, &$general) {
|
||||
$query = "update general set resturn='SUCCESS',leader2='{$general['leader2']}',experience=experience+'$exp',dedication=dedication+'$ded' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$log = checkAbility($connect, $general, $log);
|
||||
$log = checkAbility($general, $log);
|
||||
}
|
||||
|
||||
pushGenLog($general, $log);
|
||||
//pushGenLog($you, $youlog);
|
||||
}
|
||||
|
||||
function process_30($connect, &$general) {
|
||||
function process_30(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -1561,12 +1610,15 @@ function process_30($connect, &$general) {
|
||||
}
|
||||
}
|
||||
|
||||
$log = checkAbility($connect, $general, $log);
|
||||
$log = checkAbility($general, $log);
|
||||
}
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_31($connect, &$general) {
|
||||
function process_31(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -1685,13 +1737,16 @@ function process_31($connect, &$general) {
|
||||
$query = "update nation set spy='$spy' where nation='{$general['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$log = checkAbility($connect, $general, $log);
|
||||
$log = checkAbility($general, $log);
|
||||
}
|
||||
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_41($connect, &$general) {
|
||||
function process_41(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -1736,17 +1791,17 @@ function process_41($connect, &$general) {
|
||||
|
||||
if($ratio < 33) {
|
||||
// 숙련도 증가
|
||||
addGenDex($connect, $general['no'], $general['crewtype'], $crewexp);
|
||||
addGenDex($general['no'], $general['crewtype'], $crewexp);
|
||||
$log[] = "<C>●</>{$admin['month']}월:$crewstr 숙련도 향상이 <span class='ev_failed'>지지부진</span>했습니다. <1>$date</>";
|
||||
} elseif($ratio < 66) {
|
||||
$exp = $exp * 2;
|
||||
// 숙련도 증가
|
||||
addGenDex($connect, $general['no'], $general['crewtype'], $crewexp * 2);
|
||||
addGenDex($general['no'], $general['crewtype'], $crewexp * 2);
|
||||
$log[] = "<C>●</>{$admin['month']}월:$crewstr 숙련도가 향상되었습니다. <1>$date</>";
|
||||
} else {
|
||||
$exp = $exp * 3;
|
||||
// 숙련도 증가
|
||||
addGenDex($connect, $general['no'], $general['crewtype'], $crewexp * 3);
|
||||
addGenDex($general['no'], $general['crewtype'], $crewexp * 3);
|
||||
$log[] = "<C>●</>{$admin['month']}월:$crewstr 숙련도가 <S>일취월장</>했습니다. <1>$date</>";
|
||||
}
|
||||
|
||||
@@ -1757,7 +1812,10 @@ function process_41($connect, &$general) {
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_42($connect, &$general) {
|
||||
function process_42(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -1971,11 +2029,14 @@ function process_42($connect, &$general) {
|
||||
break;
|
||||
}
|
||||
|
||||
$log = checkAbility($connect, $general, $log);
|
||||
$log = checkAbility($general, $log);
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_43($connect, &$general) {
|
||||
function process_43(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -2056,13 +2117,16 @@ function process_43($connect, &$general) {
|
||||
$query = "update general set resturn='SUCCESS',leader2='{$general['leader2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$log = checkAbility($connect, $general, $log);
|
||||
$log = checkAbility($general, $log);
|
||||
}
|
||||
pushGenLog($general, $log);
|
||||
pushGenLog($gen, $genlog);
|
||||
}
|
||||
|
||||
function process_44($connect, &$general) {
|
||||
function process_44(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -2143,14 +2207,17 @@ function process_44($connect, &$general) {
|
||||
$query = "update general set resturn='SUCCESS',leader2='{$general['leader2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$log = checkAbility($connect, $general, $log);
|
||||
$log = checkAbility($general, $log);
|
||||
}
|
||||
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
|
||||
function process_48($connect, &$general) {
|
||||
function process_48(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -2160,7 +2227,7 @@ function process_48($connect, &$general) {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$city = getCity($connect, $general['city']);
|
||||
$city = getCity($general['city']);
|
||||
|
||||
$command = DecodeCommand($general['turn0']);
|
||||
$type = $command[1];
|
||||
@@ -2255,7 +2322,10 @@ function process_48($connect, &$general) {
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_49($connect, &$general) {
|
||||
function process_49(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -2269,7 +2339,7 @@ function process_49($connect, &$general) {
|
||||
|
||||
$nation = getNationStaticInfo($general['nation']);
|
||||
|
||||
$city = getCity($connect, $general['city']);
|
||||
$city = getCity($general['city']);
|
||||
|
||||
$command = DecodeCommand($general['turn0']);
|
||||
$type = $command[2];
|
||||
@@ -2384,13 +2454,16 @@ function process_49($connect, &$general) {
|
||||
break;
|
||||
}
|
||||
|
||||
$log = checkAbility($connect, $general, $log);
|
||||
$log = checkAbility($general, $log);
|
||||
}
|
||||
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_50($connect, &$general) {
|
||||
function process_50(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -2414,7 +2487,10 @@ function process_50($connect, &$general) {
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_99($connect, &$general) {
|
||||
function process_99(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
|
||||
+106
-37
@@ -1,7 +1,10 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
function process_23($connect, &$general) {
|
||||
function process_23(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -92,14 +95,17 @@ function process_23($connect, &$general) {
|
||||
$query = "update general set resturn='SUCCESS',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
// $log = checkAbility($connect, $general, $log);
|
||||
// $log = checkAbility($general, $log);
|
||||
}
|
||||
pushGenLog($general, $log);
|
||||
pushGenLog($gen, $genlog);
|
||||
}
|
||||
|
||||
|
||||
function process_24($connect, &$general) {
|
||||
function process_24(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -199,14 +205,17 @@ function process_24($connect, &$general) {
|
||||
$query = "update general set resturn='SUCCESS',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
// $log = checkAbility($connect, $general, $log);
|
||||
// $log = checkAbility($general, $log);
|
||||
}
|
||||
pushGenLog($general, $log);
|
||||
pushGenLog($gen, $genlog);
|
||||
}
|
||||
|
||||
|
||||
function process_27($connect, &$general) {
|
||||
function process_27(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -271,7 +280,7 @@ function process_27($connect, &$general) {
|
||||
$query = "update general set resturn='SUCCESS',experience=experience+'$exp',dedication=dedication+'$ded' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
// $log = checkAbility($connect, $general, $log);
|
||||
// $log = checkAbility($general, $log);
|
||||
}
|
||||
|
||||
pushGenLog($general, $log);
|
||||
@@ -279,7 +288,10 @@ function process_27($connect, &$general) {
|
||||
}
|
||||
|
||||
|
||||
function process_51($connect, &$general) {
|
||||
function process_51(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -329,7 +341,7 @@ function process_51($connect, &$general) {
|
||||
}
|
||||
//기존 메세지 한칸씩 뒤로 미룸
|
||||
for($i=$deleted-1; $i >=0; $i--) {
|
||||
moveMsg($connect, "nation", "dip", $i+1, $younatin["dip{$i}"], $younation["dip{$i}_type"], $younation["dip{$i}_who"], $younation["dip{$i}_when"], "nation", $younation['nation']);
|
||||
moveMsg("nation", "dip", $i+1, $younatin["dip{$i}"], $younation["dip{$i}_type"], $younation["dip{$i}_who"], $younation["dip{$i}_when"], "nation", $younation['nation']);
|
||||
}
|
||||
//권고 서신시 장수번호/상대국 번호
|
||||
$me = $general['no'] * 10000 + $younation['nation'];
|
||||
@@ -339,13 +351,16 @@ function process_51($connect, &$general) {
|
||||
|
||||
$query = "update general set dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
// $log = checkAbility($connect, $general, $log);
|
||||
// $log = checkAbility($general, $log);
|
||||
}
|
||||
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_52($connect, &$general) {
|
||||
function process_52(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -448,13 +463,16 @@ function process_52($connect, &$general) {
|
||||
$query = "update general set dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
// $log = checkAbility($connect, $general, $log);
|
||||
// $log = checkAbility($general, $log);
|
||||
}
|
||||
pushWorldHistory($history, $admin['year'], $admin['month']);
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_53($connect, &$general) {
|
||||
function process_53(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -504,7 +522,7 @@ function process_53($connect, &$general) {
|
||||
}
|
||||
//기존 메세지 한칸씩 뒤로 미룸
|
||||
for($i=$deleted-1; $i >=0; $i--) {
|
||||
moveMsg($connect, "nation", "dip", $i+1, $younatin["dip{$i}"], $younation["dip{$i}_type"], $younation["dip{$i}_who"], $younation["dip{$i}_when"], "nation", $younation['nation']);
|
||||
moveMsg("nation", "dip", $i+1, $younatin["dip{$i}"], $younation["dip{$i}_type"], $younation["dip{$i}_who"], $younation["dip{$i}_when"], "nation", $younation['nation']);
|
||||
}
|
||||
//권고 서신시 장수번호/상대국 번호
|
||||
$me = $general['no'] * 10000 + $younation['nation'];
|
||||
@@ -514,13 +532,16 @@ function process_53($connect, &$general) {
|
||||
|
||||
$query = "update general set dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
// $log = checkAbility($connect, $general, $log);
|
||||
// $log = checkAbility($general, $log);
|
||||
}
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
|
||||
function process_61($connect, &$general) {
|
||||
function process_61(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -574,7 +595,7 @@ function process_61($connect, &$general) {
|
||||
}
|
||||
//기존 메세지 한칸씩 뒤로 미룸
|
||||
for($i=$deleted-1; $i >=0; $i--) {
|
||||
moveMsg($connect, "nation", "dip", $i+1, $younatin["dip{$i}"], $younation["dip{$i}_type"], $younation["dip{$i}_who"], $younation["dip{$i}_when"], "nation", $younation['nation']);
|
||||
moveMsg("nation", "dip", $i+1, $younatin["dip{$i}"], $younation["dip{$i}_type"], $younation["dip{$i}_who"], $younation["dip{$i}_when"], "nation", $younation['nation']);
|
||||
}
|
||||
//권고 서신시 장수번호/상대국 번호
|
||||
$me = $general['no'] * 10000 + $younation['nation'];
|
||||
@@ -596,12 +617,15 @@ function process_61($connect, &$general) {
|
||||
|
||||
$query = "update general set dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
// $log = checkAbility($connect, $general, $log);
|
||||
// $log = checkAbility($general, $log);
|
||||
}
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_62($connect, &$general) {
|
||||
function process_62(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -696,7 +720,10 @@ function process_62($connect, &$general) {
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_63($connect, &$general) {
|
||||
function process_63(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -746,7 +773,7 @@ function process_63($connect, &$general) {
|
||||
}
|
||||
//기존 메세지 한칸씩 뒤로 미룸
|
||||
for($i=$deleted-1; $i >=0; $i--) {
|
||||
moveMsg($connect, "nation", "dip", $i+1, $younatin["dip{$i}"], $younation["dip{$i}_type"], $younation["dip{$i}_who"], $younation["dip{$i}_when"], "nation", $younation['nation']);
|
||||
moveMsg("nation", "dip", $i+1, $younatin["dip{$i}"], $younation["dip{$i}_type"], $younation["dip{$i}_who"], $younation["dip{$i}_when"], "nation", $younation['nation']);
|
||||
}
|
||||
//권고 서신시 장수번호/상대국 번호
|
||||
$me = $general['no'] * 10000 + $younation['nation'];
|
||||
@@ -756,12 +783,15 @@ function process_63($connect, &$general) {
|
||||
|
||||
$query = "update general set dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
// $log = checkAbility($connect, $general, $log);
|
||||
// $log = checkAbility($general, $log);
|
||||
}
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_64($connect, &$general) {
|
||||
function process_64(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -811,7 +841,7 @@ function process_64($connect, &$general) {
|
||||
}
|
||||
//기존 메세지 한칸씩 뒤로 미룸
|
||||
for($i=$deleted-1; $i >=0; $i--) {
|
||||
moveMsg($connect, "nation", "dip", $i+1, $younatin["dip{$i}"], $younation["dip{$i}_type"], $younation["dip{$i}_who"], $younation["dip{$i}_when"], "nation", $younation['nation']);
|
||||
moveMsg("nation", "dip", $i+1, $younatin["dip{$i}"], $younation["dip{$i}_type"], $younation["dip{$i}_who"], $younation["dip{$i}_when"], "nation", $younation['nation']);
|
||||
}
|
||||
//권고 서신시 장수번호/상대국 번호
|
||||
$me = $general['no'] * 10000 + $younation['nation'];
|
||||
@@ -821,12 +851,15 @@ function process_64($connect, &$general) {
|
||||
|
||||
$query = "update general set dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
// $log = checkAbility($connect, $general, $log);
|
||||
// $log = checkAbility($general, $log);
|
||||
}
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_65($connect, &$general) {
|
||||
function process_65(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -917,7 +950,10 @@ function process_65($connect, &$general) {
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_66($connect, &$general) {
|
||||
function process_66(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -1004,7 +1040,10 @@ function process_66($connect, &$general) {
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_67($connect, &$general) {
|
||||
function process_67(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -1092,7 +1131,10 @@ function process_67($connect, &$general) {
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_68($connect, &$general) {
|
||||
function process_68(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -1192,7 +1234,10 @@ function process_68($connect, &$general) {
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_71($connect, &$general) {
|
||||
function process_71(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -1294,7 +1339,10 @@ function process_71($connect, &$general) {
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_72($connect, &$general) {
|
||||
function process_72(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -1405,7 +1453,10 @@ function process_72($connect, &$general) {
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_73($connect, &$general) {
|
||||
function process_73(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -1532,7 +1583,10 @@ function process_73($connect, &$general) {
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_74($connect, &$general) {
|
||||
function process_74(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -1671,7 +1725,10 @@ function process_74($connect, &$general) {
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_75($connect, &$general) {
|
||||
function process_75(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -1793,7 +1850,10 @@ function process_75($connect, &$general) {
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_76($connect, &$general) {
|
||||
function process_76(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -2008,7 +2068,10 @@ function process_76($connect, &$general) {
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_77($connect, &$general) {
|
||||
function process_77(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -2132,7 +2195,10 @@ function process_77($connect, &$general) {
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_78($connect, &$general) {
|
||||
function process_78(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -2253,7 +2319,10 @@ function process_78($connect, &$general) {
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_81($connect, &$general) {
|
||||
function process_81(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
function process_22($connect, &$general) {
|
||||
function process_22(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -55,12 +58,15 @@ function process_22($connect, &$general) {
|
||||
$query = "update general set resturn='SUCCESS',gold=gold-'$cost',intel2='{$general['intel2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$log = checkAbility($connect, $general, $log);
|
||||
$log = checkAbility($general, $log);
|
||||
}
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_25($connect, &$general) {
|
||||
function process_25(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -164,9 +170,9 @@ function process_25($connect, &$general) {
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
if($where < 99) {
|
||||
$log = uniqueItem($connect, $general, $log);
|
||||
$log = uniqueItem($general, $log);
|
||||
} else {
|
||||
$log = uniqueItem($connect, $general, $log, 2);
|
||||
$log = uniqueItem($general, $log, 2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,7 +180,10 @@ function process_25($connect, &$general) {
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_29($connect, &$general) {
|
||||
function process_29(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -421,15 +430,18 @@ function process_29($connect, &$general) {
|
||||
$query = "update general set resturn='SUCCESS',term='0',gold='$gold',leader2='{$general['leader2']}',power2='{$general['power2']}',intel2='{$general['intel2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$log = checkAbility($connect, $general, $log);
|
||||
$log = uniqueItem($connect, $general, $log);
|
||||
$log = checkAbility($general, $log);
|
||||
$log = uniqueItem($general, $log);
|
||||
}
|
||||
|
||||
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_45($connect, &$general) {
|
||||
function process_45(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -543,7 +555,10 @@ function process_45($connect, &$general) {
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_46($connect, &$general) {
|
||||
function process_46(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -620,7 +635,7 @@ function process_46($connect, &$general) {
|
||||
$query = "update general set resturn='SUCCESS',dedication=dedication+'$ded', experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$log = uniqueItem($connect, $general, $log, 3);
|
||||
$log = uniqueItem($general, $log, 3);
|
||||
}
|
||||
|
||||
pushWorldHistory($history, $admin['year'], $admin['month']);
|
||||
@@ -628,7 +643,10 @@ function process_46($connect, &$general) {
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_47($connect, &$general) {
|
||||
function process_47(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -662,7 +680,7 @@ function process_47($connect, &$general) {
|
||||
$history[] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<R><b>【방랑】</b></><D><b>{$general['name']}</b></>은(는) <R>방랑</>의 길을 떠납니다.";
|
||||
|
||||
//분쟁기록 모두 지움
|
||||
DeleteConflict($connect, $general['nation']);
|
||||
DeleteConflict($general['nation']);
|
||||
// 국명, 색깔 바꿈 국가 레벨 0, 성향리셋, 기술0
|
||||
$query = "update nation set name='{$general['name']}',color='330000',level='0',type='0',tech='0',totaltech='0',capital='0' where nation='{$general['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -690,7 +708,10 @@ function process_47($connect, &$general) {
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_54($connect, &$general) {
|
||||
function process_54(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -752,7 +773,10 @@ function process_54($connect, &$general) {
|
||||
pushWorldHistory($history, $admin['year'], $admin['month']);
|
||||
}
|
||||
|
||||
function process_55($connect, &$general) {
|
||||
function process_55(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -838,7 +862,10 @@ function process_55($connect, &$general) {
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_56($connect, &$general) {
|
||||
function process_56(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -878,8 +905,8 @@ function process_56($connect, &$general) {
|
||||
}
|
||||
|
||||
//분쟁기록 모두 지움
|
||||
DeleteConflict($connect, $general['nation']);
|
||||
deleteNation($connect, $general);
|
||||
DeleteConflict($general['nation']);
|
||||
deleteNation($general);
|
||||
|
||||
refreshNationStaticInfo();
|
||||
}
|
||||
@@ -888,7 +915,10 @@ function process_56($connect, &$general) {
|
||||
}
|
||||
|
||||
|
||||
function process_57($connect, &$general) {
|
||||
function process_57(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
|
||||
+32
-16
@@ -1,7 +1,10 @@
|
||||
<?php
|
||||
|
||||
|
||||
function process_32($connect, &$general) {
|
||||
function process_32(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -98,7 +101,7 @@ function process_32($connect, &$general) {
|
||||
$query = "update general set firenum=firenum+1 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
TrickInjury($connect, $destination);
|
||||
TrickInjury($destination);
|
||||
$exp = rand() % 100 + 201;
|
||||
$ded = rand() % 70 + 141;
|
||||
} else {
|
||||
@@ -117,13 +120,16 @@ function process_32($connect, &$general) {
|
||||
$query = "update general set resturn='SUCCESS',gold='{$general['gold']}',rice='{$general['rice']}',intel2='{$general['intel2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$log = checkAbility($connect, $general, $log);
|
||||
$log = checkAbility($general, $log);
|
||||
}
|
||||
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_33($connect, &$general) {
|
||||
function process_33(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -247,7 +253,7 @@ function process_33($connect, &$general) {
|
||||
}
|
||||
$log[] = "<C>●</>금<C>$gold</> 쌀<C>$rice</>을 획득했습니다.";
|
||||
|
||||
// TrickInjury($connect, $destination);
|
||||
// TrickInjury($destination);
|
||||
$exp = rand() % 100 + 201;
|
||||
$ded = rand() % 70 + 141;
|
||||
} else {
|
||||
@@ -266,13 +272,16 @@ function process_33($connect, &$general) {
|
||||
$query = "update general set resturn='SUCCESS',gold='{$general['gold']}',rice='{$general['rice']}',power2='{$general['power2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$log = checkAbility($connect, $general, $log);
|
||||
$log = checkAbility($general, $log);
|
||||
}
|
||||
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_34($connect, &$general) {
|
||||
function process_34(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -370,7 +379,7 @@ function process_34($connect, &$general) {
|
||||
$query = "update general set firenum=firenum+1 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
TrickInjury($connect, $destination);
|
||||
TrickInjury($destination);
|
||||
$exp = rand() % 100 + 201;
|
||||
$ded = rand() % 70 + 141;
|
||||
} else {
|
||||
@@ -389,13 +398,16 @@ function process_34($connect, &$general) {
|
||||
$query = "update general set resturn='SUCCESS',gold='{$general['gold']}',rice='{$general['rice']}',power2='{$general['power2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$log = checkAbility($connect, $general, $log);
|
||||
$log = checkAbility($general, $log);
|
||||
}
|
||||
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_35($connect, &$general) {
|
||||
function process_35(&$general) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -495,7 +507,7 @@ function process_35($connect, &$general) {
|
||||
$query = "update general set firenum=firenum+1 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
TrickInjury($connect, $destination);
|
||||
TrickInjury($destination);
|
||||
$exp = rand() % 100 + 201;
|
||||
$ded = rand() % 70 + 141;
|
||||
} else {
|
||||
@@ -514,14 +526,18 @@ function process_35($connect, &$general) {
|
||||
$query = "update general set resturn='SUCCESS',gold='{$general['gold']}',rice='{$general['rice']}',leader2='{$general['leader2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$log = checkAbility($connect, $general, $log);
|
||||
$log = checkAbility($general, $log);
|
||||
}
|
||||
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
|
||||
pushGenLog($general, $log);
|
||||
}
|
||||
|
||||
function process_36($connect, &$general) {
|
||||
return process_99($connect, $general);
|
||||
function process_36(&$general) {
|
||||
return process_99($general);
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$log = [];
|
||||
$alllog = [];
|
||||
$history = [];
|
||||
@@ -632,7 +648,7 @@ function process_36($connect, &$general) {
|
||||
$query = "update general set firenum=firenum+1 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
TrickInjury($connect, $destination);
|
||||
TrickInjury($destination);
|
||||
$exp = rand() % 100 + 201;
|
||||
$ded = rand() % 70 + 141;
|
||||
} else {
|
||||
@@ -653,7 +669,7 @@ function process_36($connect, &$general) {
|
||||
$query = "update general set resturn='SUCCESS',gold='{$general['gold']}',rice='{$general['rice']}',leader2='{$general['leader2']}',intel2='{$general['intel2']}',power2='{$general['power2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$log = checkAbility($connect, $general, $log);
|
||||
$log = checkAbility($general, $log);
|
||||
}
|
||||
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
|
||||
pushGenLog($general, $log);
|
||||
|
||||
+60
-22
@@ -6,9 +6,12 @@ namespace sammo;
|
||||
|
||||
|
||||
//1월마다 실행
|
||||
function processSpring($connect) {
|
||||
function processSpring() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
//인구 증가
|
||||
popIncrease($connect);
|
||||
popIncrease();
|
||||
// 1월엔 무조건 내정 1% 감소
|
||||
$query = "update city set dead=0,agri=agri*0.99,comm=comm*0.99,secu=secu*0.99,def=def*0.99,wall=wall*0.99";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -41,7 +44,10 @@ function processSpring($connect) {
|
||||
pushWorldHistory($history, $admin['year'], $admin['month']);
|
||||
}
|
||||
|
||||
function processGoldIncome($connect) {
|
||||
function processGoldIncome() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select year,month,gold_rate from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
@@ -54,9 +60,9 @@ function processGoldIncome($connect) {
|
||||
for($i=0; $i < $nationcount; $i++) {
|
||||
$nation = MYDB_fetch_array($nationresult);
|
||||
|
||||
$incomeList = getGoldIncome($connect, $nation['nation'], $nation['rate_tmp'], $admin['gold_rate'], $nation['type']);
|
||||
$incomeList = getGoldIncome($nation['nation'], $nation['rate_tmp'], $admin['gold_rate'], $nation['type']);
|
||||
$income = $incomeList[0] + $incomeList[1];
|
||||
$originoutcome = getGoldOutcome($connect, $nation['nation'], 100); // 100%의 지급량
|
||||
$originoutcome = getGoldOutcome($nation['nation'], 100); // 100%의 지급량
|
||||
$outcome = round($originoutcome * $nation['bill'] / 100); // 지급량에 따른 요구량
|
||||
// 실제 지급량 계산
|
||||
$nation['gold'] += $income;
|
||||
@@ -114,7 +120,10 @@ function processGoldIncome($connect) {
|
||||
pushAdminLog($adminLog);
|
||||
}
|
||||
|
||||
function popIncrease($connect) {
|
||||
function popIncrease() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select nation,rate_tmp,type from nation";
|
||||
$nationresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nationcount = MYDB_num_rows($nationresult);
|
||||
@@ -186,7 +195,10 @@ function popIncrease($connect) {
|
||||
}
|
||||
}
|
||||
|
||||
function getGoldIncome($connect, $nationNo, $rate, $admin_rate, $type) {
|
||||
function getGoldIncome($nationNo, $rate, $admin_rate, $type) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$level2 = [];
|
||||
$level3 = [];
|
||||
$level4 = [];
|
||||
@@ -250,13 +262,15 @@ function getGoldIncome($connect, $nationNo, $rate, $admin_rate, $type) {
|
||||
return $income;
|
||||
}
|
||||
|
||||
function processDeadIncome($connect, $admin_rate) {
|
||||
function processDeadIncome($admin_rate) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
foreach(getAllNationStaticInfo() as $nation){
|
||||
if($nation['level'] <= 0){
|
||||
continue;
|
||||
}
|
||||
$income = getDeadIncome($connect, $nation['nation'], $nation['type'], $admin_rate);
|
||||
$income = getDeadIncome($nation['nation'], $nation['type'], $admin_rate);
|
||||
|
||||
// 단기수입 금만적용
|
||||
// $query = "update nation set gold=gold+'$income',rice=rice+'$income' where nation='{$nation['nation']}'";
|
||||
@@ -268,7 +282,10 @@ function processDeadIncome($connect, $admin_rate) {
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
|
||||
function getDeadIncome($connect, $nation, $type, $admin_rate) {
|
||||
function getDeadIncome($nation, $type, $admin_rate) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select dead from city where nation='$nation' and dead>'0' and supply='1'"; // 도시 목록
|
||||
$cityResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$cityCount = MYDB_num_rows($cityResult);
|
||||
@@ -291,7 +308,10 @@ function getDeadIncome($connect, $nation, $type, $admin_rate) {
|
||||
return $income;
|
||||
}
|
||||
|
||||
function getGoldOutcome($connect, $nation, $bill) {
|
||||
function getGoldOutcome($nation, $bill) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select dedication from general where nation='$nation'"; // 장수 목록
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_num_rows($genresult);
|
||||
@@ -309,9 +329,12 @@ function getGoldOutcome($connect, $nation, $bill) {
|
||||
}
|
||||
|
||||
//7월마다 실행
|
||||
function processFall($connect) {
|
||||
function processFall() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
//인구 증가
|
||||
popIncrease($connect);
|
||||
popIncrease();
|
||||
// 7월엔 무조건 내정 1% 감소
|
||||
$query = "update city set dead=0,agri=agri*0.99,comm=comm*0.99,secu=secu*0.99,def=def*0.99,wall=wall*0.99";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -337,7 +360,10 @@ function processFall($connect) {
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
|
||||
function processRiceIncome($connect) {
|
||||
function processRiceIncome() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select year,month,rice_rate from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
@@ -350,9 +376,9 @@ function processRiceIncome($connect) {
|
||||
for($i=0; $i < $nationcount; $i++) {
|
||||
$nation = MYDB_fetch_array($nationresult);
|
||||
|
||||
$incomeList = getRiceIncome($connect, $nation['nation'], $nation['rate_tmp'], $admin['rice_rate'], $nation['type']);
|
||||
$incomeList = getRiceIncome($nation['nation'], $nation['rate_tmp'], $admin['rice_rate'], $nation['type']);
|
||||
$income = $incomeList[0] + $incomeList[1];
|
||||
$originoutcome = getRiceOutcome($connect, $nation['nation'], 100); // 100%의 지급량
|
||||
$originoutcome = getRiceOutcome($nation['nation'], 100); // 100%의 지급량
|
||||
$outcome = round($originoutcome * $nation['bill'] / 100); // 지급량에 따른 요구량
|
||||
|
||||
// 실제 지급량 계산
|
||||
@@ -411,7 +437,10 @@ function processRiceIncome($connect) {
|
||||
pushAdminLog($adminLog);
|
||||
}
|
||||
|
||||
function getRiceIncome($connect, $nationNo, $rate, $admin_rate, $type) {
|
||||
function getRiceIncome($nationNo, $rate, $admin_rate, $type) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$level2 = [];
|
||||
$level3 = [];
|
||||
$level4 = [];
|
||||
@@ -476,7 +505,10 @@ function getRiceIncome($connect, $nationNo, $rate, $admin_rate, $type) {
|
||||
return $income;
|
||||
}
|
||||
|
||||
function getRiceOutcome($connect, $nation, $bill) {
|
||||
function getRiceOutcome($nation, $bill) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select dedication from general where nation='$nation'"; // 장수 목록
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gencount = MYDB_num_rows($genresult);
|
||||
@@ -493,7 +525,10 @@ function getRiceOutcome($connect, $nation, $bill) {
|
||||
return $outcome;
|
||||
}
|
||||
|
||||
function tradeRate($connect) {
|
||||
function tradeRate() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select city,level,trade from city"; // 도시 목록
|
||||
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$citycount = MYDB_num_rows($cityresult);
|
||||
@@ -522,7 +557,10 @@ function tradeRate($connect) {
|
||||
}
|
||||
}
|
||||
|
||||
function disaster($connect) {
|
||||
function disaster() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select startyear,year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
@@ -660,14 +698,14 @@ function disaster($connect) {
|
||||
$query = "update city set state='$state',pop=pop*{$ratio},rate=rate*{$ratio},agri=agri*{$ratio},comm=comm*{$ratio},secu=secu*{$ratio},def=def*{$ratio},wall=wall*{$ratio} where city='$disastercity[$i]'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
TrickInjury($connect, $disastercity[$i], 1);
|
||||
TrickInjury($disastercity[$i], 1);
|
||||
}
|
||||
} else {
|
||||
for($i=0; $i < count($disastercity); $i++) {
|
||||
$ratio = 4 * $disasterratio[$i];
|
||||
$ratio = (101 + $ratio) / 100.0; // 치안률 따라서 101~105%
|
||||
|
||||
$city = getCity($connect, $disastercity[$i]);
|
||||
$city = getCity($disastercity[$i]);
|
||||
$city['pop'] *= $ratio; $city['rate'] *= $ratio; $city['agri'] *= $ratio;
|
||||
$city['comm'] *= $ratio; $city['secu'] *= $ratio; $city['def'] *= $ratio;
|
||||
$city['wall'] *= $ratio;
|
||||
|
||||
+80
-32
@@ -2,7 +2,10 @@
|
||||
namespace sammo;
|
||||
|
||||
|
||||
function processTournament($connect) {
|
||||
function processTournament() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select tournament,phase,tnmt_type,tnmt_auto,tnmt_time,now() as now,TIMESTAMPDIFF(SECOND,tnmt_time,now()) as offset from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
@@ -32,44 +35,44 @@ function processTournament($connect) {
|
||||
for($i=0; $i < $iter; $i++) {
|
||||
switch($tnmt) {
|
||||
case 1: //신청 마감
|
||||
fillLowGenAll($connect);
|
||||
fillLowGenAll();
|
||||
$tnmt = 2; $phase = 0;
|
||||
break;
|
||||
case 2: //예선중
|
||||
qualify($connect, $type, $tnmt, $phase); $phase++;
|
||||
qualify($type, $tnmt, $phase); $phase++;
|
||||
if($phase >= 56) { $tnmt = 3; $phase = 0; }
|
||||
break;
|
||||
case 3: //추첨중
|
||||
selectionAll($connect, $type, $tnmt, $phase); $phase+=8;
|
||||
selectionAll($type, $tnmt, $phase); $phase+=8;
|
||||
if($phase >= 32) { $tnmt = 4; $phase = 0; }
|
||||
break;
|
||||
case 4: //본선중
|
||||
finallySingle($connect, $type, $tnmt, $phase); $phase++;
|
||||
finallySingle($type, $tnmt, $phase); $phase++;
|
||||
if($phase >= 6) { $tnmt = 5; $phase = 0; }
|
||||
break;
|
||||
case 5: //배정중
|
||||
final16set($connect);
|
||||
final16set();
|
||||
$tnmt = 6; $phase = 0;
|
||||
break;
|
||||
case 6: //베팅중
|
||||
$tnmt = 7; $phase = 0;
|
||||
break;
|
||||
case 7: //16강중
|
||||
finalFight($connect, $type, $tnmt, $phase, 16); $phase++;
|
||||
finalFight($type, $tnmt, $phase, 16); $phase++;
|
||||
if($phase >= 8) { $tnmt = 8; $phase = 0; }
|
||||
break;
|
||||
case 8: //8강중
|
||||
finalFight($connect, $type, $tnmt, $phase, 8); $phase++;
|
||||
finalFight($type, $tnmt, $phase, 8); $phase++;
|
||||
if($phase >= 4) { $tnmt = 9; $phase = 0; }
|
||||
break;
|
||||
case 9: //4강중
|
||||
finalFight($connect, $type, $tnmt, $phase, 4); $phase++;
|
||||
finalFight($type, $tnmt, $phase, 4); $phase++;
|
||||
if($phase >= 2) { $tnmt = 10; $phase = 0; }
|
||||
break;
|
||||
case 10: //결승중
|
||||
finalFight($connect, $type, $tnmt, $phase, 2);
|
||||
finalFight($type, $tnmt, $phase, 2);
|
||||
$tnmt = 0; $phase = 0;
|
||||
setGift($connect, $type, $tnmt, $phase);
|
||||
setGift($type, $tnmt, $phase);
|
||||
$i = $iter;
|
||||
break;
|
||||
}
|
||||
@@ -105,7 +108,10 @@ function processTournament($connect) {
|
||||
}
|
||||
}
|
||||
|
||||
function getTournamentTerm($connect) {
|
||||
function getTournamentTerm() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select tnmt_auto from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
@@ -122,7 +128,10 @@ function getTournamentTerm($connect) {
|
||||
return $str;
|
||||
}
|
||||
|
||||
function getTournamentTime($connect) {
|
||||
function getTournamentTime() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select tournament,tnmt_time from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
@@ -219,7 +228,10 @@ function printFighting($tournament, $phase) {
|
||||
}
|
||||
}
|
||||
|
||||
function startTournament($connect, $auto, $type) {
|
||||
function startTournament($auto, $type) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
for($i=0; $i<50; $i++){
|
||||
$filepath = "logs/fight{$i}.txt";
|
||||
if(file_exists($filepath)){
|
||||
@@ -258,7 +270,10 @@ function startTournament($connect, $auto, $type) {
|
||||
pushWorldHistory($history, $admin['year'], $admin['month']);
|
||||
}
|
||||
|
||||
function fillLowGenAll($connect) {
|
||||
function fillLowGenAll() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select develcost from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
@@ -358,12 +373,15 @@ function getTwo($tournament, $phase) {
|
||||
return $cand;
|
||||
}
|
||||
|
||||
function qualify($connect, $tnmt_type, $tnmt, $phase) {
|
||||
function qualify($tnmt_type, $tnmt, $phase) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$cand = getTwo($tnmt, $phase);
|
||||
|
||||
//각 그룹 페이즈 실행
|
||||
for($i=0; $i < 8; $i++) {
|
||||
fight($connect, $tnmt_type, $tnmt, $phase, $i, $cand[0], $cand[1], 0);
|
||||
fight($tnmt_type, $tnmt, $phase, $i, $cand[0], $cand[1], 0);
|
||||
}
|
||||
if($phase < 55) {
|
||||
$query = "update game set phase=phase+1";
|
||||
@@ -384,15 +402,21 @@ function qualify($connect, $tnmt_type, $tnmt, $phase) {
|
||||
}
|
||||
}
|
||||
|
||||
function qualifyAll($connect, $tnmt_type, $tnmt, $phase) {
|
||||
function qualifyAll($tnmt_type, $tnmt, $phase) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$start = $phase;
|
||||
$end = $phase - ($phase % 4) + 4;
|
||||
for($i=$start; $i < $end; $i++) {
|
||||
qualify($connect, $tnmt_type, $tnmt, $i);
|
||||
qualify($tnmt_type, $tnmt, $i);
|
||||
}
|
||||
}
|
||||
|
||||
function selection($connect, $tnmt_type, $tnmt, $phase) {
|
||||
function selection($tnmt_type, $tnmt, $phase) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
//시드1 배정
|
||||
if($phase < 8) {
|
||||
$grp = $phase + 10; $grp_no = 0;
|
||||
@@ -427,20 +451,26 @@ function selection($connect, $tnmt_type, $tnmt, $phase) {
|
||||
}
|
||||
}
|
||||
|
||||
function selectionAll($connect, $tnmt_type, $tnmt, $phase) {
|
||||
function selectionAll($tnmt_type, $tnmt, $phase) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$start = $phase;
|
||||
$end = $phase - ($phase % 8) + 8;
|
||||
for($i=$start; $i < $end; $i++) {
|
||||
selection($connect, $tnmt_type, $tnmt, $i);
|
||||
selection($tnmt_type, $tnmt, $i);
|
||||
}
|
||||
}
|
||||
|
||||
function finallySingle($connect, $tnmt_type, $tnmt, $phase) {
|
||||
function finallySingle($tnmt_type, $tnmt, $phase) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$cand = getTwo($tnmt, $phase);
|
||||
|
||||
//각 그룹 페이즈 실행
|
||||
for($i=10; $i < 18; $i++) {
|
||||
fight($connect, $tnmt_type, $tnmt, $phase, $i, $cand[0], $cand[1], 0);
|
||||
fight($tnmt_type, $tnmt, $phase, $i, $cand[0], $cand[1], 0);
|
||||
}
|
||||
if($phase < 5) {
|
||||
$query = "update game set phase=phase+1";
|
||||
@@ -461,15 +491,21 @@ function finallySingle($connect, $tnmt_type, $tnmt, $phase) {
|
||||
}
|
||||
}
|
||||
|
||||
function finallyAll($connect, $tnmt_type, $tnmt, $phase) {
|
||||
function finallyAll($tnmt_type, $tnmt, $phase) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$start = $phase;
|
||||
$end = $phase - ($phase % 2) + 2;
|
||||
for($i=$start; $i < $end; $i++) {
|
||||
finallySingle($connect, $tnmt_type, $tnmt, $i);
|
||||
finallySingle($tnmt_type, $tnmt, $i);
|
||||
}
|
||||
}
|
||||
|
||||
function final16set($connect) {
|
||||
function final16set() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
//1조1-5조2, 2조1-6조2, 3조1-7조2, 4조1-8조2, 5조1-1조2, 6조1-2조2, 7조1-3조2, 8조1-4조2
|
||||
$grp = Array(10, 14, 11, 15, 12, 16, 13, 17, 14, 10, 15, 11, 16, 12, 17, 13);
|
||||
$prmt = Array( 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2);
|
||||
@@ -490,7 +526,10 @@ function final16set($connect) {
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
|
||||
function finalFight($connect, $tnmt_type, $tnmt, $phase, $type) {
|
||||
function finalFight($tnmt_type, $tnmt, $phase, $type) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
switch($type) {
|
||||
case 16: $offset = 20; $turn = 7; $next = 7; break;
|
||||
case 8: $offset = 30; $turn = 3; $next = 8; break;
|
||||
@@ -499,7 +538,7 @@ function finalFight($connect, $tnmt_type, $tnmt, $phase, $type) {
|
||||
}
|
||||
|
||||
$grp = $phase + $offset;
|
||||
fight($connect, $tnmt_type, $tnmt, $phase, $grp, 0, 1, 1);
|
||||
fight($tnmt_type, $tnmt, $phase, $grp, 0, 1, 1);
|
||||
|
||||
$query = "update game set phase=phase+1";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
@@ -519,7 +558,10 @@ function finalFight($connect, $tnmt_type, $tnmt, $phase, $type) {
|
||||
}
|
||||
}
|
||||
|
||||
function setGift($connect, $tnmt_type, $tnmt, $phase) {
|
||||
function setGift($tnmt_type, $tnmt, $phase) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select year,month,develcost from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
@@ -665,7 +707,10 @@ function setGift($connect, $tnmt_type, $tnmt, $phase) {
|
||||
}
|
||||
}
|
||||
|
||||
function setRefund($connect) {
|
||||
function setRefund() {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select develcost from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
@@ -700,7 +745,10 @@ function getLog($lvl1, $lvl2) {
|
||||
}
|
||||
|
||||
//0 : 승무패, 1 : 승패
|
||||
function fight($connect, $tnmt_type, $tnmt, $phs, $group, $g1, $g2, $type) {
|
||||
function fight($tnmt_type, $tnmt, $phs, $group, $g1, $g2, $type) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select *,(ldr+pwr+itl)*7/15 as tot,h,w,b from tournament where grp='$group' and grp_no='$g1'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$gen1 = MYDB_fetch_array($result);
|
||||
|
||||
+12
-12
@@ -22,7 +22,7 @@ $me = $db->queryFirstRow(
|
||||
);
|
||||
|
||||
//턴 실행.
|
||||
checkTurn($connect);
|
||||
checkTurn();
|
||||
|
||||
//그새 사망이면
|
||||
if($me === null) {
|
||||
@@ -112,10 +112,10 @@ if($valid == 1) {
|
||||
?>
|
||||
|
||||
<tr height=30>
|
||||
<td width=198 align=center><?php info($connect, 2); ?></td>
|
||||
<td width=198 align=center><?php info(2); ?></td>
|
||||
<td width=198 align=center>전체 접속자 수 : <?=$admin['online'];?> 명</td>
|
||||
<td width=198 align=center>턴당 갱신횟수 : <?=$admin['conlimit'];?>회</td>
|
||||
<td width=398 colspan=2 align=center><?php info($connect, 3); ?></td>
|
||||
<td width=398 colspan=2 align=center><?php info(3); ?></td>
|
||||
</tr>
|
||||
<tr height=30>
|
||||
<td align=center>
|
||||
@@ -135,7 +135,7 @@ case 2: $str = "일기토"; break;
|
||||
case 3: $str = "설전"; break;
|
||||
}
|
||||
$str2 = getTournament($admin['tournament']);
|
||||
$str3 = getTournamentTime($connect);
|
||||
$str3 = getTournamentTime();
|
||||
if($admin['tournament'] == 0) { echo "<font color=magenta>현재 토너먼트 경기 없음</font>"; }
|
||||
else { echo "<marquee scrollamount=2>↑<font color=cyan>{$str}</font> {$str2} {$str3}↑</marquee>"; }
|
||||
|
||||
@@ -165,10 +165,10 @@ echo "
|
||||
</td>
|
||||
</tr>";
|
||||
?>
|
||||
<tr><td colspan=5>접속중인 국가: <?=onlinenation($connect);?></td></tr>
|
||||
<tr><td colspan=5><?php adminMsg($connect); ?></td></tr>
|
||||
<tr><td colspan=5>【 국가방침 】<?php nationMsg($connect); ?></td></tr>
|
||||
<tr><td colspan=5>【 접속자 】<?=onlinegen($connect);?></td></tr>
|
||||
<tr><td colspan=5>접속중인 국가: <?=onlinenation();?></td></tr>
|
||||
<tr><td colspan=5><?php adminMsg(); ?></td></tr>
|
||||
<tr><td colspan=5>【 국가방침 】<?php nationMsg(); ?></td></tr>
|
||||
<tr><td colspan=5>【 접속자 】<?=onlinegen();?></td></tr>
|
||||
<?php
|
||||
if(Session::getUserGrade() >= 5) {
|
||||
echo "
|
||||
@@ -199,7 +199,7 @@ if(Session::getUserGrade() >= 5) {
|
||||
<form name=form2 action=preprocessing.php method=post target=commandlist>
|
||||
<tr>
|
||||
<td rowspan=3 width=50 valign=top><?=turnTable()?></td>
|
||||
<td width=646><?php cityInfo($connect); ?></td>
|
||||
<td width=646><?php cityInfo(); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=646 align=right>
|
||||
@@ -222,7 +222,7 @@ if(Session::getUserGrade() >= 5) {
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=646 align=right>
|
||||
<?php commandTable($connect); ?>
|
||||
<?php commandTable(); ?>
|
||||
<input type=button style=background-color:<?=$_basecolor2;?>;color:white;width:110;font-size:13px; value='실 행' onclick='refreshing(3,form2)'><input type=button style=background-color:<?=$_basecolor2;?>;color:white;width:110;font-size:13px; value='갱 신' onclick='refreshing(0,0)'><input type=button style=background-color:<?=$_basecolor2;?>;color:white;width:160;font-size:13px; value='로그아웃' onclick=location.replace('logout_process.php')><br>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -230,8 +230,8 @@ if(Session::getUserGrade() >= 5) {
|
||||
</table>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<tr>
|
||||
<td width=498><?php myNationInfo($connect); ?></td>
|
||||
<td width=498><?php myInfo($connect); ?></td>
|
||||
<td width=498><?php myNationInfo(); ?></td>
|
||||
<td width=498><?php myInfo(); ?></td>
|
||||
</tr>
|
||||
<tr><td colspan=2><?=commandButton()?></td></tr>
|
||||
</table>
|
||||
|
||||
+1
-1
@@ -183,7 +183,7 @@ window.abilityPowint = abilityPowint;
|
||||
<tr><td>장 수 생 성<br><?=backButton()?></td></tr>
|
||||
</table>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<tr><td align=center><?php info($connect, 0, 1); ?></td></tr>
|
||||
<tr><td align=center><?php info(0, 1); ?></td></tr>
|
||||
</table>
|
||||
<?php
|
||||
$query = "select show_img_level,maxgeneral from game limit 1";
|
||||
|
||||
+69
-69
@@ -49,83 +49,83 @@ if($turn[0] == 100) {
|
||||
}
|
||||
|
||||
switch($commandtype) {
|
||||
case 0: command_Single($connect, $turn, 0); break; //휴식
|
||||
case 1: command_Single($connect, $turn, 1); break; //농업
|
||||
case 2: command_Single($connect, $turn, 2); break; //상업
|
||||
case 3: command_Single($connect, $turn, 3); break; //기술
|
||||
case 4: command_Single($connect, $turn, 4); break; //선정
|
||||
case 5: command_Single($connect, $turn, 5); break; //수비
|
||||
case 6: command_Single($connect, $turn, 6); break; //성벽
|
||||
case 7: command_Single($connect, $turn, 7); break; //정착 장려
|
||||
case 8: command_Single($connect, $turn, 8); break; //치안 강화
|
||||
case 9: command_Single($connect, $turn, 9); break; //자금 조달
|
||||
case 0: command_Single($turn, 0); break; //휴식
|
||||
case 1: command_Single($turn, 1); break; //농업
|
||||
case 2: command_Single($turn, 2); break; //상업
|
||||
case 3: command_Single($turn, 3); break; //기술
|
||||
case 4: command_Single($turn, 4); break; //선정
|
||||
case 5: command_Single($turn, 5); break; //수비
|
||||
case 6: command_Single($turn, 6); break; //성벽
|
||||
case 7: command_Single($turn, 7); break; //정착 장려
|
||||
case 8: command_Single($turn, 8); break; //치안 강화
|
||||
case 9: command_Single($turn, 9); break; //자금 조달
|
||||
|
||||
// case 11: command_11($connect, $turn, 11); break; //징병
|
||||
// case 12: command_12($connect, $turn, 12); break; //모병
|
||||
case 13: command_Single($connect, $turn, 13); break; //훈련
|
||||
case 14: command_Single($connect, $turn, 14); break; //사기진작
|
||||
case 15: command_Single($connect, $turn, 0); break; //전투태세
|
||||
// case 16: command_16($connect, $turn, 16); break; //전쟁
|
||||
case 17: command_Single($connect, $turn, 17); break; //소집해제
|
||||
// case 11: command_11( $turn, 11); break; //징병
|
||||
// case 12: command_12( $turn, 12); break; //모병
|
||||
case 13: command_Single($turn, 13); break; //훈련
|
||||
case 14: command_Single($turn, 14); break; //사기진작
|
||||
case 15: command_Single($turn, 0); break; //전투태세
|
||||
// case 16: command_16( $turn, 16); break; //전쟁
|
||||
case 17: command_Single($turn, 17); break; //소집해제
|
||||
|
||||
// case 21: command_21($connect, $turn, 21); break; //이동
|
||||
// case 22: command_22($connect, $turn, 22); break; //등용
|
||||
// case 23: command_23($connect, $turn, 23); break; //포상
|
||||
// case 24: command_24($connect, $turn, 24); break; //몰수
|
||||
// case 25: command_25($connect, $turn, 25); break; //임관
|
||||
case 26: command_Single($connect, $turn, 26); break; //집합
|
||||
// case 27: command_27($connect, $turn, 27); break; //발령
|
||||
case 28: command_Single($connect, $turn, 28); break; //귀환
|
||||
case 29: command_Single($connect, $turn, 29); break; //인재탐색
|
||||
// case 30: command_30($connect, $turn, 30); break; //강행
|
||||
// case 21: command_21( $turn, 21); break; //이동
|
||||
// case 22: command_22( $turn, 22); break; //등용
|
||||
// case 23: command_23( $turn, 23); break; //포상
|
||||
// case 24: command_24( $turn, 24); break; //몰수
|
||||
// case 25: command_25( $turn, 25); break; //임관
|
||||
case 26: command_Single($turn, 26); break; //집합
|
||||
// case 27: command_27( $turn, 27); break; //발령
|
||||
case 28: command_Single($turn, 28); break; //귀환
|
||||
case 29: command_Single($turn, 29); break; //인재탐색
|
||||
// case 30: command_30( $turn, 30); break; //강행
|
||||
|
||||
// case 31: command_31($connect, $turn, 31); break; //첩보
|
||||
// case 32: command_32($connect, $turn, 32); break; //화계
|
||||
// case 33: command_33($connect, $turn, 33); break; //탈취
|
||||
// case 34: command_34($connect, $turn, 34); break; //파괴
|
||||
// case 35: command_35($connect, $turn, 35); break; //선동
|
||||
// case 36: command_36($connect, $turn, 36); break; //기습
|
||||
// case 31: command_31($turn, 31); break; //첩보
|
||||
// case 32: command_32($turn, 32); break; //화계
|
||||
// case 33: command_33($turn, 33); break; //탈취
|
||||
// case 34: command_34($turn, 34); break; //파괴
|
||||
// case 35: command_35($turn, 35); break; //선동
|
||||
// case 36: command_36($turn, 36); break; //기습
|
||||
|
||||
case 41: command_Single($connect, $turn, 41); break; //단련
|
||||
case 42: command_Single($connect, $turn, 42); break; //견문
|
||||
// case 43: command_43($connect, $turn, 43); break; //증여
|
||||
// case 44: command_44($connect, $turn, 44); break; //헌납
|
||||
case 45: command_Single($connect, $turn, 45); break; //하야
|
||||
// case 46: command_46($connect, $turn, 46); break; //건국
|
||||
case 47: command_Single($connect, $turn, 47); break; //방랑
|
||||
// case 48: command_48($connect, $turn, 48); break; //장비구입
|
||||
// case 49: command_49($connect, $turn, 49); break; //군량매매
|
||||
case 50: command_Single($connect, $turn, 50); break; //요양
|
||||
case 41: command_Single($turn, 41); break; //단련
|
||||
case 42: command_Single($turn, 42); break; //견문
|
||||
// case 43: command_43( $turn, 43); break; //증여
|
||||
// case 44: command_44( $turn, 44); break; //헌납
|
||||
case 45: command_Single($turn, 45); break; //하야
|
||||
// case 46: command_46( $turn, 46); break; //건국
|
||||
case 47: command_Single($turn, 47); break; //방랑
|
||||
// case 48: command_48( $turn, 48); break; //장비구입
|
||||
// case 49: command_49( $turn, 49); break; //군량매매
|
||||
case 50: command_Single($turn, 50); break; //요양
|
||||
|
||||
// case 51: command_51($connect, $turn, 51); break; //항복권고
|
||||
// case 52: command_52($connect, $turn, 52); break; //원조
|
||||
// case 53: command_53($connect, $turn, 53); break; //통합제의
|
||||
// case 54: command_54($connect, $turn, 54); break; //선양
|
||||
case 55: command_Single($connect, $turn, 55); break; //거병
|
||||
case 56: command_Single($connect, $turn, 56); break; //해산
|
||||
case 57: command_Single($connect, $turn, 57); break; //모반 시도
|
||||
// case 51: command_51($turn, 51); break; //항복권고
|
||||
// case 52: command_52($turn, 52); break; //원조
|
||||
// case 53: command_53($turn, 53); break; //통합제의
|
||||
// case 54: command_54($turn, 54); break; //선양
|
||||
case 55: command_Single($turn, 55); break; //거병
|
||||
case 56: command_Single($turn, 56); break; //해산
|
||||
case 57: command_Single($turn, 57); break; //모반 시도
|
||||
|
||||
// case 61: command_61($connect, $turn, 61); break; //불가침
|
||||
// case 62: command_62($connect, $turn, 62); break; //선포
|
||||
// case 63: command_63($connect, $turn, 63); break; //종전
|
||||
// case 64: command_64($connect, $turn, 64); break; //파기
|
||||
// case 65: command_65($connect, $turn, 65); break; //초토화
|
||||
// case 66: command_66($connect, $turn, 66); break; //천도
|
||||
// case 67: command_67($connect, $turn, 67); break; //증축
|
||||
// case 68: command_68($connect, $turn, 68); break; //감축
|
||||
// case 61: command_61($turn, 61); break; //불가침
|
||||
// case 62: command_62($turn, 62); break; //선포
|
||||
// case 63: command_63($turn, 63); break; //종전
|
||||
// case 64: command_64($turn, 64); break; //파기
|
||||
// case 65: command_65($turn, 65); break; //초토화
|
||||
// case 66: command_66($turn, 66); break; //천도
|
||||
// case 67: command_67($turn, 67); break; //증축
|
||||
// case 68: command_68($turn, 68); break; //감축
|
||||
|
||||
case 71: command_Chief($connect, $turn, 71); break; //필사즉생
|
||||
// case 72: command_72($connect, $turn, 72); break; //백성동원
|
||||
// case 73: command_73($connect, $turn, 73); break; //수몰
|
||||
// case 74: command_74($connect, $turn, 74); break; //허보
|
||||
// case 75: command_75($connect, $turn, 75); break; //피장파장
|
||||
case 76: command_Chief($connect, $turn, 76); break; //의병모집
|
||||
// case 77: command_77($connect, $turn, 77); break; //이호경식
|
||||
// case 78: command_78($connect, $turn, 78); break; //급습
|
||||
case 71: command_Chief($turn, 71); break; //필사즉생
|
||||
// case 72: command_72($turn, 72); break; //백성동원
|
||||
// case 73: command_73($turn, 73); break; //수몰
|
||||
// case 74: command_74($turn, 74); break; //허보
|
||||
// case 75: command_75($turn, 75); break; //피장파장
|
||||
case 76: command_Chief($turn, 76); break; //의병모집
|
||||
// case 77: command_77($turn, 77); break; //이호경식
|
||||
// case 78: command_78($turn, 78); break; //급습
|
||||
|
||||
// case 81: command_81($connect, $turn, 81); break; //국기변경
|
||||
// case 81: command_81($turn, 81); break; //국기변경
|
||||
|
||||
// case 99: command_99($connect, $turn); break; //수뇌부 후식
|
||||
default: command_Other($connect, $turn, $commandtype); break;
|
||||
// case 99: command_99($turn); break; //수뇌부 후식
|
||||
default: command_Other($turn, $commandtype); break;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -8,4 +8,4 @@ $db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("자동", 2);
|
||||
checkTurn($connect);
|
||||
checkTurn();
|
||||
|
||||
+33
-19
@@ -2,7 +2,9 @@
|
||||
namespace sammo;
|
||||
|
||||
|
||||
function processWar($connect, $general, $city) {
|
||||
function processWar($general, $city) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$templates = new \League\Plates\Engine('templates');
|
||||
|
||||
@@ -127,9 +129,9 @@ function processWar($connect, $general, $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),"");
|
||||
|
||||
$city = addConflict($connect, $city, $general['nation'], 1);
|
||||
$city = addConflict($city, $general['nation'], 1);
|
||||
|
||||
ConquerCity($connect, $game, $general, $city, $nation, $destnation);
|
||||
ConquerCity($game, $general, $city, $nation, $destnation);
|
||||
break;
|
||||
// 장수가 없어서 도시 공격
|
||||
} elseif($opposecount == 0) {
|
||||
@@ -433,8 +435,8 @@ function processWar($connect, $general, $city) {
|
||||
$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),"");
|
||||
// 숙련도 증가
|
||||
addGenDex($connect, $general['no'], $general['crewtype'], $mykillnum);
|
||||
addGenDex($connect, $general['no'], 40, $mydeathnum);
|
||||
addGenDex($general['no'], $general['crewtype'], $mykillnum);
|
||||
addGenDex($general['no'], 40, $mydeathnum);
|
||||
// 죽은수 기술로 누적
|
||||
$num = round($mydeathnum * 0.01);
|
||||
// 국가보정
|
||||
@@ -472,7 +474,7 @@ function processWar($connect, $general, $city) {
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
//분쟁현황에 추가
|
||||
$city = addConflict($connect, $city, $general['nation'], $mykillnum);
|
||||
$city = addConflict($city, $general['nation'], $mykillnum);
|
||||
|
||||
// 병사 소진시 성 함락
|
||||
if($city['def'] <= 0) {
|
||||
@@ -490,7 +492,7 @@ function processWar($connect, $general, $city) {
|
||||
unset($alllog);
|
||||
unset($history);
|
||||
|
||||
ConquerCity($connect, $game, $general, $city, $nation, $destnation);
|
||||
ConquerCity($game, $general, $city, $nation, $destnation);
|
||||
break;
|
||||
// 공격 장수 병사 소진시 실패 처리
|
||||
} elseif($general['crew'] <= 0) {
|
||||
@@ -1308,8 +1310,8 @@ function processWar($connect, $general, $city) {
|
||||
$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),"");
|
||||
// 숙련도 증가
|
||||
addGenDex($connect, $oppose['no'], $oppose['crewtype'], $opkillnum * 0.9);
|
||||
addGenDex($connect, $oppose['no'], $general['crewtype'], $opdeathnum * 0.9);
|
||||
addGenDex($oppose['no'], $oppose['crewtype'], $opkillnum * 0.9);
|
||||
addGenDex($oppose['no'], $general['crewtype'], $opdeathnum * 0.9);
|
||||
// 죽은수 기술로 누적
|
||||
$num = round($mydeathnum * 0.01);
|
||||
// 국가보정
|
||||
@@ -1331,8 +1333,8 @@ function processWar($connect, $general, $city) {
|
||||
$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),"");
|
||||
// 숙련도 증가
|
||||
addGenDex($connect, $general['no'], $general['crewtype'], $mykillnum);
|
||||
addGenDex($connect, $general['no'], $oppose['crewtype'], $mydeathnum);
|
||||
addGenDex($general['no'], $general['crewtype'], $mykillnum);
|
||||
addGenDex($general['no'], $oppose['crewtype'], $mydeathnum);
|
||||
// 죽은수 기술로 누적
|
||||
$num = round($opdeathnum * 0.01);
|
||||
// 국가보정
|
||||
@@ -1436,7 +1438,7 @@ function processWar($connect, $general, $city) {
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$opexp = 0;
|
||||
|
||||
$opplog = checkAbility($connect, $oppose, $opplog);
|
||||
$opplog = checkAbility($oppose, $opplog);
|
||||
pushGenLog($oppose, $opplog);
|
||||
pushBatLog($oppose, $oppbatlog);
|
||||
pushBatRes($oppose, $oppbatres);
|
||||
@@ -1491,7 +1493,7 @@ function processWar($connect, $general, $city) {
|
||||
$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),"");
|
||||
|
||||
$log = checkAbility($connect, $general, $log);
|
||||
$log = checkAbility($general, $log);
|
||||
pushGenLog($general, $log);
|
||||
pushBatLog($general, $batlog);
|
||||
pushBatRes($general, $batres);
|
||||
@@ -1587,7 +1589,10 @@ function getRate($game, $type, $dtype) {
|
||||
return $game[$t];
|
||||
}
|
||||
|
||||
function addConflict($connect, $city, $nationnum, $mykillnum) {
|
||||
function addConflict($city, $nationnum, $mykillnum) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error("addConflict ".MYDB_error($connect),"");
|
||||
$game = MYDB_fetch_array($result);
|
||||
@@ -1625,7 +1630,10 @@ function addConflict($connect, $city, $nationnum, $mykillnum) {
|
||||
return $city;
|
||||
}
|
||||
|
||||
function DeleteConflict($connect, $nation) {
|
||||
function DeleteConflict($nation) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select city,conflict,conflict2 from city where conflict!=''";
|
||||
$result = MYDB_query($query, $connect) or Error("addConflict ".MYDB_error($connect),"");
|
||||
$cityNum = MYDB_num_rows($result);
|
||||
@@ -1655,7 +1663,10 @@ function DeleteConflict($connect, $nation) {
|
||||
}
|
||||
}
|
||||
|
||||
function getConquerNation($connect, $city) {
|
||||
function getConquerNation($city) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$nationlist = explode("|", $city['conflict']);
|
||||
$killnum = explode("|", $city['conflict2']);
|
||||
|
||||
@@ -1669,7 +1680,10 @@ function getConquerNation($connect, $city) {
|
||||
return $nationlist[$index];
|
||||
}
|
||||
|
||||
function ConquerCity($connect, $game, $general, $city, $nation, $destnation) {
|
||||
function ConquerCity($game, $general, $city, $nation, $destnation) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
global $_maximumatmos;
|
||||
|
||||
if($destnation['nation'] > 0) {
|
||||
@@ -1783,7 +1797,7 @@ function ConquerCity($connect, $game, $general, $city, $nation, $destnation) {
|
||||
}
|
||||
|
||||
//분쟁기록 모두 지움
|
||||
DeleteConflict($connect, $city['nation']);
|
||||
DeleteConflict($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),"");
|
||||
@@ -1894,7 +1908,7 @@ function ConquerCity($connect, $game, $general, $city, $nation, $destnation) {
|
||||
$general['atmos'] *= 1.1; //사기 증가
|
||||
if($general['atmos'] > $_maximumatmos) { $general['atmos'] = $_maximumatmos; }
|
||||
|
||||
$conquerNation = getConquerNation($connect, $city);
|
||||
$conquerNation = getConquerNation($city);
|
||||
|
||||
if($conquerNation == $general['nation']) {
|
||||
// 이동 및 사기 변경
|
||||
|
||||
+238
-112
@@ -32,82 +32,82 @@ if($turn[0] == 100) {
|
||||
}
|
||||
|
||||
switch($commandtype) {
|
||||
case 0: command_Single($connect, $turn, 0); break; //휴식
|
||||
case 1: command_Single($connect, $turn, 1); break; //농업
|
||||
case 2: command_Single($connect, $turn, 2); break; //상업
|
||||
case 3: command_Single($connect, $turn, 3); break; //기술
|
||||
case 4: command_Single($connect, $turn, 4); break; //선정
|
||||
case 5: command_Single($connect, $turn, 5); break; //수비
|
||||
case 6: command_Single($connect, $turn, 6); break; //성벽
|
||||
case 7: command_Single($connect, $turn, 7); break; //정착 장려
|
||||
case 8: command_Single($connect, $turn, 8); break; //치안 강화
|
||||
case 9: command_Single($connect, $turn, 9); break; //자금 조달
|
||||
case 0: command_Single($turn, 0); break; //휴식
|
||||
case 1: command_Single($turn, 1); break; //농업
|
||||
case 2: command_Single($turn, 2); break; //상업
|
||||
case 3: command_Single($turn, 3); break; //기술
|
||||
case 4: command_Single($turn, 4); break; //선정
|
||||
case 5: command_Single($turn, 5); break; //수비
|
||||
case 6: command_Single($turn, 6); break; //성벽
|
||||
case 7: command_Single($turn, 7); break; //정착 장려
|
||||
case 8: command_Single($turn, 8); break; //치안 강화
|
||||
case 9: command_Single($turn, 9); break; //자금 조달
|
||||
|
||||
case 11: command_11($connect, $turn, 11); break; //징병
|
||||
case 12: command_12($connect, $turn, 12); break; //모병
|
||||
case 13: command_Single($connect, $turn, 13); break; //훈련
|
||||
case 14: command_Single($connect, $turn, 14); break; //사기진작
|
||||
//case 15: command_Single($connect, $turn, 0); break; //전투태세
|
||||
case 16: command_16($connect, $turn, 16); break; //전쟁
|
||||
case 17: command_Single($connect, $turn, 17); break; //소집해제
|
||||
case 11: command_11( $turn, 11); break; //징병
|
||||
case 12: command_12( $turn, 12); break; //모병
|
||||
case 13: command_Single($turn, 13); break; //훈련
|
||||
case 14: command_Single($turn, 14); break; //사기진작
|
||||
//case 15: command_Single($turn, 0); break; //전투태세
|
||||
case 16: command_16( $turn, 16); break; //전쟁
|
||||
case 17: command_Single($turn, 17); break; //소집해제
|
||||
|
||||
case 21: command_21($connect, $turn, 21); break; //이동
|
||||
//case 22: command_22($connect, $turn, 22); break; //등용 //TODO:등용장 재 디자인
|
||||
case 23: command_23($connect, $turn, 23); break; //포상
|
||||
case 24: command_24($connect, $turn, 24); break; //몰수
|
||||
case 25: command_25($connect, $turn, 25); break; //임관
|
||||
case 26: command_Single($connect, $turn, 26); break; //집합
|
||||
case 27: command_27($connect, $turn, 27); break; //발령
|
||||
case 28: command_Single($connect, $turn, 28); break; //귀환
|
||||
case 29: command_Single($connect, $turn, 29); break; //인재탐색
|
||||
case 30: command_30($connect, $turn, 30); break; //강행
|
||||
case 21: command_21( $turn, 21); break; //이동
|
||||
//case 22: command_22( $turn, 22); break; //등용 //TODO:등용장 재 디자인
|
||||
case 23: command_23( $turn, 23); break; //포상
|
||||
case 24: command_24( $turn, 24); break; //몰수
|
||||
case 25: command_25( $turn, 25); break; //임관
|
||||
case 26: command_Single($turn, 26); break; //집합
|
||||
case 27: command_27( $turn, 27); break; //발령
|
||||
case 28: command_Single($turn, 28); break; //귀환
|
||||
case 29: command_Single($turn, 29); break; //인재탐색
|
||||
case 30: command_30( $turn, 30); break; //강행
|
||||
|
||||
case 31: command_31($connect, $turn, 31); break; //첩보
|
||||
case 32: command_32($connect, $turn, 32); break; //화계
|
||||
case 33: command_33($connect, $turn, 33); break; //탈취
|
||||
case 34: command_34($connect, $turn, 34); break; //파괴
|
||||
case 35: command_35($connect, $turn, 35); break; //선동
|
||||
case 36: command_36($connect, $turn, 36); break; //기습
|
||||
case 31: command_31($turn, 31); break; //첩보
|
||||
case 32: command_32($turn, 32); break; //화계
|
||||
case 33: command_33($turn, 33); break; //탈취
|
||||
case 34: command_34($turn, 34); break; //파괴
|
||||
case 35: command_35($turn, 35); break; //선동
|
||||
case 36: command_36($turn, 36); break; //기습
|
||||
|
||||
case 41: command_Single($connect, $turn, 41); break; //단련
|
||||
case 42: command_Single($connect, $turn, 42); break; //견문
|
||||
case 43: command_43($connect, $turn, 43); break; //증여
|
||||
case 44: command_44($connect, $turn, 44); break; //헌납
|
||||
case 45: command_Single($connect, $turn, 45); break; //하야
|
||||
case 46: command_46($connect, $turn, 46); break; //건국
|
||||
case 47: command_Single($connect, $turn, 47); break; //방랑
|
||||
case 48: command_48($connect, $turn, 48); break; //장비구입
|
||||
case 49: command_49($connect, $turn, 49); break; //군량매매
|
||||
case 50: command_Single($connect, $turn, 50); break; //요양
|
||||
case 41: command_Single($turn, 41); break; //단련
|
||||
case 42: command_Single($turn, 42); break; //견문
|
||||
case 43: command_43( $turn, 43); break; //증여
|
||||
case 44: command_44( $turn, 44); break; //헌납
|
||||
case 45: command_Single($turn, 45); break; //하야
|
||||
case 46: command_46( $turn, 46); break; //건국
|
||||
case 47: command_Single($turn, 47); break; //방랑
|
||||
case 48: command_48( $turn, 48); break; //장비구입
|
||||
case 49: command_49( $turn, 49); break; //군량매매
|
||||
case 50: command_Single($turn, 50); break; //요양
|
||||
|
||||
case 51: command_51($connect, $turn, 51); break; //항복권고
|
||||
case 52: command_52($connect, $turn, 52); break; //원조
|
||||
case 53: command_53($connect, $turn, 53); break; //통합제의
|
||||
case 54: command_54($connect, $turn, 54); break; //선양
|
||||
case 55: command_Single($connect, $turn, 55); break; //거병
|
||||
case 56: command_Single($connect, $turn, 56); break; //해산
|
||||
case 57: command_Single($connect, $turn, 57); break; //모반 시도
|
||||
case 51: command_51($turn, 51); break; //항복권고
|
||||
case 52: command_52($turn, 52); break; //원조
|
||||
case 53: command_53($turn, 53); break; //통합제의
|
||||
case 54: command_54($turn, 54); break; //선양
|
||||
case 55: command_Single($turn, 55); break; //거병
|
||||
case 56: command_Single($turn, 56); break; //해산
|
||||
case 57: command_Single($turn, 57); break; //모반 시도
|
||||
|
||||
case 61: command_61($connect, $turn, 61); break; //불가침
|
||||
case 62: command_62($connect, $turn, 62); break; //선포
|
||||
case 63: command_63($connect, $turn, 63); break; //종전
|
||||
case 64: command_64($connect, $turn, 64); break; //파기
|
||||
case 65: command_65($connect, $turn, 65); break; //초토화
|
||||
case 66: command_66($connect, $turn, 66); break; //천도
|
||||
case 67: command_67($connect, $turn, 67); break; //증축
|
||||
case 68: command_68($connect, $turn, 68); break; //감축
|
||||
case 71: command_Chief($connect, $turn, 71); break; //필사즉생
|
||||
case 72: command_72($connect, $turn, 72); break; //백성동원
|
||||
case 73: command_73($connect, $turn, 73); break; //수몰
|
||||
case 74: command_74($connect, $turn, 74); break; //허보
|
||||
case 75: command_75($connect, $turn, 75); break; //피장파장
|
||||
case 76: command_Chief($connect, $turn, 76); break; //의병모집
|
||||
case 77: command_77($connect, $turn, 77); break; //이호경식
|
||||
case 78: command_78($connect, $turn, 78); break; //급습
|
||||
case 81: command_81($connect, $turn, 81); break; //국기변경
|
||||
case 99: command_99($connect, $turn); break; //수뇌부 휴식
|
||||
case 61: command_61($turn, 61); break; //불가침
|
||||
case 62: command_62($turn, 62); break; //선포
|
||||
case 63: command_63($turn, 63); break; //종전
|
||||
case 64: command_64($turn, 64); break; //파기
|
||||
case 65: command_65($turn, 65); break; //초토화
|
||||
case 66: command_66($turn, 66); break; //천도
|
||||
case 67: command_67($turn, 67); break; //증축
|
||||
case 68: command_68($turn, 68); break; //감축
|
||||
case 71: command_Chief($turn, 71); break; //필사즉생
|
||||
case 72: command_72($turn, 72); break; //백성동원
|
||||
case 73: command_73($turn, 73); break; //수몰
|
||||
case 74: command_74($turn, 74); break; //허보
|
||||
case 75: command_75($turn, 75); break; //피장파장
|
||||
case 76: command_Chief($turn, 76); break; //의병모집
|
||||
case 77: command_77($turn, 77); break; //이호경식
|
||||
case 78: command_78($turn, 78); break; //급습
|
||||
case 81: command_81($turn, 81); break; //국기변경
|
||||
case 99: command_99($turn); break; //수뇌부 휴식
|
||||
|
||||
default:command_Single($connect, $turn, 0); break; //휴식
|
||||
default:command_Single($turn, 0); break; //휴식
|
||||
}
|
||||
|
||||
function starter($name, $type=0) {
|
||||
@@ -173,7 +173,10 @@ function ender($type=0) {
|
||||
";
|
||||
}
|
||||
|
||||
function command_99($connect, $turn) {
|
||||
function command_99($turn) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select nation,level from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
@@ -231,7 +234,10 @@ function GetExplain() {
|
||||
return $explain;
|
||||
}
|
||||
|
||||
function command_11($connect, $turn, $command) {
|
||||
function command_11($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
global $_basecolor, $_basecolor2, $images, $image;
|
||||
starter("징병");
|
||||
$query = "select * from game limit 1";
|
||||
@@ -436,7 +442,10 @@ function calc(cost, formnum) {
|
||||
ender();
|
||||
}
|
||||
|
||||
function command_12($connect, $turn, $command) {
|
||||
function command_12($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
global $_basecolor, $_basecolor2, $images, $image;
|
||||
starter("모병");
|
||||
$query = "select * from game limit 1";
|
||||
@@ -643,7 +652,10 @@ function calc(cost, formnum) {
|
||||
ender();
|
||||
}
|
||||
|
||||
function command_15($connect, $turn, $command) {
|
||||
function command_15($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("재편성");
|
||||
$query = "select no,nation from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
@@ -684,7 +696,10 @@ function command_15($connect, $turn, $command) {
|
||||
ender();
|
||||
}
|
||||
|
||||
function command_16($connect, $turn, $command) {
|
||||
function command_16($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("출병");
|
||||
$query = "select city from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
@@ -723,7 +738,10 @@ function command_16($connect, $turn, $command) {
|
||||
ender();
|
||||
}
|
||||
|
||||
function command_21($connect, $turn, $command) {
|
||||
function command_21($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("이동");
|
||||
$query = "select city from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
@@ -762,7 +780,10 @@ function command_21($connect, $turn, $command) {
|
||||
ender();
|
||||
}
|
||||
|
||||
function command_22($connect, $turn, $command) {
|
||||
function command_22($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
die('비활성화됨');//TODO:등용장 대 디자인
|
||||
starter("등용");
|
||||
|
||||
@@ -823,7 +844,10 @@ function command_22($connect, $turn, $command) {
|
||||
ender();
|
||||
}
|
||||
|
||||
function command_23($connect, $turn, $command) {
|
||||
function command_23($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("포상", 1);
|
||||
$query = "select no,nation from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
@@ -893,7 +917,10 @@ function command_23($connect, $turn, $command) {
|
||||
ender(1);
|
||||
}
|
||||
|
||||
function command_24($connect, $turn, $command) {
|
||||
function command_24($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("몰수", 1);
|
||||
$query = "select no,nation from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
@@ -964,9 +991,12 @@ function command_24($connect, $turn, $command) {
|
||||
ender(1);
|
||||
}
|
||||
|
||||
function command_25($connect, $turn, $command) {
|
||||
function command_25($turn, $command) {
|
||||
global $_basecolor2, $_basecolor4, $images;
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("임관");
|
||||
|
||||
$query = "select startyear,year from game limit 1";
|
||||
@@ -1040,7 +1070,10 @@ function command_25($connect, $turn, $command) {
|
||||
ender();
|
||||
}
|
||||
|
||||
function command_27($connect, $turn, $command) {
|
||||
function command_27($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("발령", 1);
|
||||
|
||||
$query = "select no,nation,level from general where owner='{$session->userID}'";
|
||||
@@ -1096,7 +1129,10 @@ function command_27($connect, $turn, $command) {
|
||||
ender(1);
|
||||
}
|
||||
|
||||
function command_30($connect, $turn, $command) {
|
||||
function command_30($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("강행");
|
||||
$query = "select city from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
@@ -1135,7 +1171,10 @@ printCitysName($currentcity['city'], 3);
|
||||
ender();
|
||||
}
|
||||
|
||||
function command_31($connect, $turn, $command) {
|
||||
function command_31($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("첩보");
|
||||
$query = "select city from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
@@ -1178,7 +1217,10 @@ function command_31($connect, $turn, $command) {
|
||||
ender();
|
||||
}
|
||||
|
||||
function command_32($connect, $turn, $command) {
|
||||
function command_32($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("화계");
|
||||
$query = "select city from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
@@ -1216,7 +1258,10 @@ function command_32($connect, $turn, $command) {
|
||||
ender();
|
||||
}
|
||||
|
||||
function command_33($connect, $turn, $command) {
|
||||
function command_33($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("탈취");
|
||||
$query = "select city from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
@@ -1254,7 +1299,10 @@ function command_33($connect, $turn, $command) {
|
||||
ender();
|
||||
}
|
||||
|
||||
function command_34($connect, $turn, $command) {
|
||||
function command_34($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("파괴");
|
||||
$query = "select city from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
@@ -1292,7 +1340,10 @@ function command_34($connect, $turn, $command) {
|
||||
ender();
|
||||
}
|
||||
|
||||
function command_35($connect, $turn, $command) {
|
||||
function command_35($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("선동");
|
||||
$query = "select city from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
@@ -1330,7 +1381,10 @@ function command_35($connect, $turn, $command) {
|
||||
ender();
|
||||
}
|
||||
|
||||
function command_36($connect, $turn, $command) {
|
||||
function command_36($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("기습");
|
||||
$query = "select city from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
@@ -1368,7 +1422,10 @@ function command_36($connect, $turn, $command) {
|
||||
ender();
|
||||
}
|
||||
|
||||
function command_43($connect, $turn, $command) {
|
||||
function command_43($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("증여");
|
||||
$query = "select no,nation from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
@@ -1439,7 +1496,10 @@ function command_43($connect, $turn, $command) {
|
||||
ender();
|
||||
}
|
||||
|
||||
function command_44($connect, $turn, $command) {
|
||||
function command_44($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("헌납");
|
||||
|
||||
echo "
|
||||
@@ -1484,7 +1544,10 @@ function command_44($connect, $turn, $command) {
|
||||
ender();
|
||||
}
|
||||
|
||||
function command_46($connect, $turn, $command) {
|
||||
function command_46($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("건국");
|
||||
|
||||
$query = "select maxnation from game limit 1";
|
||||
@@ -1578,13 +1641,16 @@ function command_46($connect, $turn, $command) {
|
||||
ender();
|
||||
}
|
||||
|
||||
function command_48($connect, $turn, $command) {
|
||||
function command_48($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("장비 매매");
|
||||
|
||||
$query = "select no,city,gold from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("command_48 ".MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
$city = getCity($connect, $me['city'], "secu");
|
||||
$city = getCity($me['city'], "secu");
|
||||
|
||||
for($i=1; $i <= 6; $i++) {
|
||||
if($city['secu'] >= $i*1000) {
|
||||
@@ -1643,7 +1709,10 @@ function command_48($connect, $turn, $command) {
|
||||
ender();
|
||||
}
|
||||
|
||||
function command_49($connect, $turn, $command) {
|
||||
function command_49($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("군량매매");
|
||||
|
||||
echo "
|
||||
@@ -1688,7 +1757,10 @@ function command_49($connect, $turn, $command) {
|
||||
ender();
|
||||
}
|
||||
|
||||
function command_51($connect, $turn, $command) {
|
||||
function command_51($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("항복 권고", 1);
|
||||
|
||||
$query = "select nation from general where owner='{$session->userID}'";
|
||||
@@ -1739,7 +1811,10 @@ function command_51($connect, $turn, $command) {
|
||||
ender(1);
|
||||
}
|
||||
|
||||
function command_52($connect, $turn, $command) {
|
||||
function command_52($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("원조", 1);
|
||||
|
||||
$query = "select nation from general where owner='{$session->userID}'";
|
||||
@@ -1813,7 +1888,10 @@ function command_52($connect, $turn, $command) {
|
||||
ender(1);
|
||||
}
|
||||
|
||||
function command_53($connect, $turn, $command) {
|
||||
function command_53($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("통합제의", 1);
|
||||
|
||||
$query = "select no,nation from general where owner='{$session->userID}'";
|
||||
@@ -1878,7 +1956,10 @@ function command_53($connect, $turn, $command) {
|
||||
ender(1);
|
||||
}
|
||||
|
||||
function command_54($connect, $turn, $command) {
|
||||
function command_54($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("선양");
|
||||
$query = "select no,nation from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
@@ -1921,7 +2002,10 @@ function command_54($connect, $turn, $command) {
|
||||
ender();
|
||||
}
|
||||
|
||||
function command_61($connect, $turn, $command) {
|
||||
function command_61($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("불가침", 1);
|
||||
|
||||
$query = "select nation from general where owner='{$session->userID}'";
|
||||
@@ -2001,7 +2085,10 @@ function command_61($connect, $turn, $command) {
|
||||
ender(1);
|
||||
}
|
||||
|
||||
function command_62($connect, $turn, $command) {
|
||||
function command_62($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("선전포고", 1);
|
||||
|
||||
$query = "select nation from general where owner='{$session->userID}'";
|
||||
@@ -2064,7 +2151,10 @@ function command_62($connect, $turn, $command) {
|
||||
ender(1);
|
||||
}
|
||||
|
||||
function command_63($connect, $turn, $command) {
|
||||
function command_63($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("종전", 1);
|
||||
|
||||
$query = "select nation from general where owner='{$session->userID}'";
|
||||
@@ -2119,7 +2209,10 @@ function command_63($connect, $turn, $command) {
|
||||
ender(1);
|
||||
}
|
||||
|
||||
function command_64($connect, $turn, $command) {
|
||||
function command_64($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("파기", 1);
|
||||
|
||||
$query = "select nation from general where owner='{$session->userID}'";
|
||||
@@ -2174,7 +2267,10 @@ function command_64($connect, $turn, $command) {
|
||||
ender(1);
|
||||
}
|
||||
|
||||
function command_65($connect, $turn, $command) {
|
||||
function command_65($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("초토화", 1);
|
||||
$query = "select city from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
@@ -2210,7 +2306,10 @@ echo "<br>
|
||||
ender();
|
||||
}
|
||||
|
||||
function command_66($connect, $turn, $command) {
|
||||
function command_66($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("천도", 1);
|
||||
$query = "select city from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
@@ -2247,7 +2346,10 @@ echo "<br>
|
||||
ender();
|
||||
}
|
||||
|
||||
function command_67($connect, $turn, $command) {
|
||||
function command_67($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("증축", 1);
|
||||
$query = "select city from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
@@ -2284,7 +2386,10 @@ echo "<br>
|
||||
ender();
|
||||
}
|
||||
|
||||
function command_68($connect, $turn, $command) {
|
||||
function command_68($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("감축", 1);
|
||||
$query = "select city from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
@@ -2321,7 +2426,10 @@ echo "<br>
|
||||
ender();
|
||||
}
|
||||
|
||||
function command_72($connect, $turn, $command) {
|
||||
function command_72($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("백성동원", 1);
|
||||
$query = "select city from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
@@ -2358,7 +2466,10 @@ echo "<br>
|
||||
ender();
|
||||
}
|
||||
|
||||
function command_73($connect, $turn, $command) {
|
||||
function command_73($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("수몰", 1);
|
||||
$query = "select city from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
@@ -2395,7 +2506,10 @@ echo "<br>
|
||||
ender();
|
||||
}
|
||||
|
||||
function command_74($connect, $turn, $command) {
|
||||
function command_74($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("허보", 1);
|
||||
$query = "select city from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
@@ -2432,7 +2546,10 @@ echo "<br>
|
||||
ender();
|
||||
}
|
||||
|
||||
function command_75($connect, $turn, $command) {
|
||||
function command_75($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("피장파장", 1);
|
||||
|
||||
$query = "select nation from general where owner='{$session->userID}'";
|
||||
@@ -2488,7 +2605,10 @@ function command_75($connect, $turn, $command) {
|
||||
ender(1);
|
||||
}
|
||||
|
||||
function command_77($connect, $turn, $command) {
|
||||
function command_77($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("이호경식", 1);
|
||||
|
||||
$query = "select nation from general where owner='{$session->userID}'";
|
||||
@@ -2544,7 +2664,10 @@ function command_77($connect, $turn, $command) {
|
||||
ender(1);
|
||||
}
|
||||
|
||||
function command_78($connect, $turn, $command) {
|
||||
function command_78($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("급습", 1);
|
||||
|
||||
$query = "select nation from general where owner='{$session->userID}'";
|
||||
@@ -2600,7 +2723,10 @@ function command_78($connect, $turn, $command) {
|
||||
ender(1);
|
||||
}
|
||||
|
||||
function command_81($connect, $turn, $command) {
|
||||
function command_81($turn, $command) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
starter("국기변경", 1);
|
||||
|
||||
$color = GetNationColors();
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ $connect=$db->get();
|
||||
<tr><td>장 수 선 택<br><?=backButton()?></td></tr>
|
||||
</table>
|
||||
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
|
||||
<tr><td align=center><?php info($connect, 0, 1); ?></td></tr>
|
||||
<tr><td align=center><?php info(0, 1); ?></td></tr>
|
||||
</table>
|
||||
<?php
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ $query = "select no from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
updateCommand($connect, $me['no'], 2);
|
||||
updateCommand($me['no'], 2);
|
||||
|
||||
//echo "<script>location.replace('b_chiefcenter.php');</script>";
|
||||
echo 'b_chiefcenter.php';//TODO:debug all and replace
|
||||
|
||||
@@ -13,7 +13,7 @@ $query = "select no from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
backupdateCommand($connect, $me['no'], 2);
|
||||
backupdateCommand($me['no'], 2);
|
||||
|
||||
//echo "<script>location.replace('b_chiefcenter.php');</script>";
|
||||
echo 'b_chiefcenter.php';//TODO:debug all and replace
|
||||
|
||||
Reference in New Issue
Block a user