기본 커맨드를 새 turn 테이블 기준으로 변경
This commit is contained in:
@@ -707,84 +707,6 @@ function pullNationCommand(int $nationID, int $level, int $turnCnt=1){
|
||||
], 'nation_id=%i AND level=%i', $nationID, $level);
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
if($type == 0 || $type == 1) { // 턴처리후, 당기기
|
||||
$query = "
|
||||
update general set
|
||||
turn0=turn1,turn1=turn2,turn2=turn3,turn3=turn4,turn4=turn5,turn5=turn6,turn6=turn7,turn7=turn8,turn8=turn9,
|
||||
turn9=turn10,turn10=turn11,turn11=turn12,turn12=turn13,turn13=turn14,turn14=turn15,turn15=turn16,turn16=turn17,
|
||||
turn17=turn18,turn18=turn19,turn19=turn20,turn20=turn21,turn21=turn22,turn22=turn23,turn23='".EncodeCommand(0, 0, 0, 0)."'
|
||||
where no='{$general['no']}'
|
||||
";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
if($type == 2 || ($general['level'] >= 5 && $general['level'] <= 12 && $type == 0)) { // 턴 처리후 수뇌부, 수뇌부 당기기
|
||||
$turn = "l{$general['level']}turn";
|
||||
$query = "
|
||||
update nation set
|
||||
{$turn}0={$turn}1,{$turn}1={$turn}2,
|
||||
{$turn}2={$turn}3,{$turn}3={$turn}4,
|
||||
{$turn}4={$turn}5,{$turn}5={$turn}6,
|
||||
{$turn}6={$turn}7,{$turn}7={$turn}8,
|
||||
{$turn}8={$turn}9,{$turn}9={$turn}10,
|
||||
{$turn}10={$turn}11,{$turn}11='".EncodeCommand(0, 0, 0, 99)."'
|
||||
where nation='{$general['nation']}'
|
||||
";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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);
|
||||
|
||||
if($type == 1) { // 미루기
|
||||
$query = "
|
||||
update general set
|
||||
turn23=turn22,turn22=turn21,
|
||||
turn21=turn20,turn20=turn19,
|
||||
turn19=turn18,turn18=turn17,
|
||||
turn17=turn16,turn16=turn15,
|
||||
turn15=turn14,turn14=turn13,
|
||||
turn13=turn12,turn12=turn11,
|
||||
turn11=turn10,turn10=turn9,
|
||||
turn9=turn8,turn8=turn7,
|
||||
turn7=turn6,turn6=turn5,
|
||||
turn5=turn4,turn4=turn3,
|
||||
turn3=turn2,turn2=turn1,
|
||||
turn1=turn0,turn0='".EncodeCommand(0, 0, 0, 0)."'
|
||||
where no='$no'
|
||||
";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
} elseif($type == 2) { // 수뇌부 미루기
|
||||
$turn = "l{$general['level']}turn";
|
||||
$query = "
|
||||
update nation set
|
||||
{$turn}11={$turn}10,{$turn}10={$turn}9,
|
||||
{$turn}9={$turn}8,{$turn}8={$turn}7,
|
||||
{$turn}7={$turn}6,{$turn}6={$turn}5,
|
||||
{$turn}5={$turn}4,{$turn}4={$turn}3,
|
||||
{$turn}3={$turn}2,{$turn}2={$turn}1,
|
||||
{$turn}1={$turn}0,{$turn}0='".EncodeCommand(0, 0, 0, 99)."'
|
||||
where nation='{$general['nation']}'
|
||||
";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function command_Single($turn, $command) {
|
||||
if(!$turn){
|
||||
header('location:commandlist.php');
|
||||
|
||||
Reference in New Issue
Block a user