forked from devsam/core
Compare commits
35
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7586243a95 | ||
|
|
1e1c7801e1 | ||
|
|
a363f6ef5f | ||
|
|
334e1fd2da | ||
|
|
2e8e29e93c | ||
|
|
5e5a1a3668 | ||
|
|
b93b464ebf | ||
|
|
842ba46a95 | ||
|
|
03b27d8e8f | ||
|
|
c11b41c6ba | ||
|
|
018cc526ee | ||
|
|
edf4508e6b | ||
|
|
d26a1f0312 | ||
|
|
2984f6a453 | ||
|
|
a00058d959 | ||
|
|
8e56a457f1 | ||
|
|
74d5f021cd | ||
|
|
a37715315d | ||
|
|
d9c9977610 | ||
|
|
c2f0cbb10a | ||
|
|
a34d00d822 | ||
|
|
9924ec6963 | ||
|
|
9036201887 | ||
|
|
b2435d2430 | ||
|
|
afd6148770 | ||
|
|
b70b58a35a | ||
|
|
df963c2780 | ||
|
|
1b732c76e6 | ||
|
|
f9489b0173 | ||
|
|
18942c55ae | ||
|
|
bf34b2f1ca | ||
|
|
a717a021c2 | ||
|
|
dcf718d592 | ||
|
|
f5eeb2b839 | ||
|
|
bc435adc11 |
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
+13
File diff suppressed because one or more lines are too long
+13
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Vendored
+1
File diff suppressed because one or more lines are too long
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
@@ -32,6 +32,7 @@ CREATE TABLE `member` (
|
||||
`PICTURE` VARCHAR(64) NULL DEFAULT 'default.jpg',
|
||||
`IMGSVR` INT(1) NULL DEFAULT '0',
|
||||
`acl` TEXT NOT NULL DEFAULT '{}' COMMENT 'json',
|
||||
`penalty` TEXT NOT NULL DEFAULT '{}' COMMENT 'json',
|
||||
`GRADE` INT(1) NULL DEFAULT '1',
|
||||
`REG_NUM` INT(3) NULL DEFAULT '0',
|
||||
`REG_DATE` DATETIME NOT NULL,
|
||||
|
||||
+1
-38
@@ -73,7 +73,6 @@ $sel[$type] = "selected";
|
||||
<td width=130 align=center id=bg1>국 가 명</td>
|
||||
<td width=80 align=center id=bg1>상 태</td>
|
||||
<td width=60 align=center id=bg1>기 간</td>
|
||||
<td align=center id=bg1>비 고</td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
@@ -95,11 +94,7 @@ for ($i=0; $i < $dipcount; $i++) {
|
||||
$me = $dip['me'];
|
||||
$you = $dip['you'];
|
||||
|
||||
$query = "select reserved,showing from diplomacy where you='$me' and me='$you'";
|
||||
$result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$dip2 = MYDB_fetch_array($result2);
|
||||
|
||||
if ($dip['state'] == 2 && $dip['fixed'] == "" && $dip['reserved'] == "" && $dip2['reserved'] == "") {
|
||||
if ($dip['state'] == 2) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -115,37 +110,6 @@ for ($i=0; $i < $dipcount; $i++) {
|
||||
}
|
||||
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$note = "";
|
||||
if ($dip['fixed'] != "") {
|
||||
if ($dip['state'] == 7) {
|
||||
$note .= $dip['fixed'];
|
||||
} else {
|
||||
$note .= "<font color=gray>{$dip['fixed']}</font>";
|
||||
}
|
||||
if ($dip['reserved'] != "" || $dip2['reserved'] != "") {
|
||||
$note .= "<br>";
|
||||
}
|
||||
}
|
||||
if ($dip['reserved'] != "") {
|
||||
if ($dip['showing'] >= $date) {
|
||||
$note .= "<font color=skyblue>아국측 제의</font>: {$dip['reserved']}";
|
||||
} else {
|
||||
$note .= "<font color=gray>아국측 제의: {$dip['reserved']}</font>";
|
||||
}
|
||||
if ($dip2['reserved'] != "") {
|
||||
$note .= "<br>";
|
||||
}
|
||||
}
|
||||
if ($dip2['reserved'] != "") {
|
||||
if ($dip2['showing'] >= $date) {
|
||||
$note .= "<font color=limegreen>상대측 제의</font>: {$dip2['reserved']}";
|
||||
} else {
|
||||
$note .= "<font color=gray>상대측 제의: {$dip2['reserved']}</font>";
|
||||
}
|
||||
}
|
||||
if ($note == "") {
|
||||
$note = " ";
|
||||
}
|
||||
|
||||
echo "
|
||||
<tr>
|
||||
@@ -153,7 +117,6 @@ for ($i=0; $i < $dipcount; $i++) {
|
||||
<td align=center style=color:".newColor($nationColor[$you]).";background-color:{$nationColor[$you]};>$nationName[$you]</td>
|
||||
<td align=center>$state</td>
|
||||
<td align=center>{$dip['term']} 개월</td>
|
||||
<td align=left style=font-size:7px;>{$note}</td>
|
||||
</tr>";
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -47,11 +47,14 @@ if ($con >= 2) {
|
||||
exit();
|
||||
}
|
||||
|
||||
//재야인 경우
|
||||
$meLevel = $me['level'];
|
||||
if ($meLevel == 0 || ($meLevel == 1 && $me['belong'] < $nation['secretlimit'])) {
|
||||
echo "수뇌부가 아니거나 사관년도가 부족합니다.";
|
||||
exit();
|
||||
$permission = checkSecretPermission($me);
|
||||
if($permission < 0){
|
||||
echo '국가에 소속되어있지 않습니다.';
|
||||
die();
|
||||
}
|
||||
else if ($permission < 1) {
|
||||
echo "권한이 부족합니다. 수뇌부가 아니거나 사관년도가 부족합니다.";
|
||||
die();
|
||||
}
|
||||
|
||||
//잘못된 접근
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("기밀실", 1);
|
||||
|
||||
$query = "select no,nation,level from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
if($me['level'] < 5) {
|
||||
echo "수뇌부가 아닙니다.";
|
||||
exit();
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title><?=UniqueConst::$serverName?>: 기밀실</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div style='width:1000px;margin:auto'>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td>기 밀 실<br><?=backButton()?></td></tr>
|
||||
<form name=form1 method=post action=c_chiefboard.php>
|
||||
<tr><td align=center>
|
||||
제목 <input type=textarea maxlength=50 name=title style=color:white;background-color:black;width:830px;>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td>
|
||||
<textarea name=msg style=color:white;background-color:black;width:998px;height:200px;></textarea><br>
|
||||
<input type=submit value=저장하기>
|
||||
<input type=hidden name=num value=-1>
|
||||
</td></tr>
|
||||
</form>
|
||||
</table>
|
||||
<br>
|
||||
<?php
|
||||
$nation = getNation($me['nation']);
|
||||
|
||||
//20개 메세지
|
||||
$index = $nation['coreindex'];
|
||||
for($i=0; $i < 20; $i++) {
|
||||
$who = "coreboard{$index}_who";
|
||||
$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($nation["coreboard{$index}"], $general['name'], $general['picture'], $general['imgsvr'], $nation["coreboard{$index}_when"], $index, 1); }
|
||||
$index--;
|
||||
if($index < 0) { $index = 19; }
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<table width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?></td></tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -17,16 +17,17 @@ $query = "select no,nation,level,con,turntime,belong from general where owner='{
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select secretlimit from nation where nation='{$me['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
|
||||
$con = checkLimit($me['con']);
|
||||
if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
|
||||
|
||||
if($me['level'] == 0 || ($me['level'] == 1 && $me['belong'] < $nation['secretlimit'])) {
|
||||
echo "수뇌부가 아니거나 사관년도가 부족합니다.";
|
||||
exit();
|
||||
$permission = checkSecretPermission($me);
|
||||
if($permission < 0){
|
||||
echo '국가에 소속되어있지 않습니다.';
|
||||
die();
|
||||
}
|
||||
else if ($permission < 1) {
|
||||
echo "권한이 부족합니다. 수뇌부가 아니거나 사관년도가 부족합니다.";
|
||||
die();
|
||||
}
|
||||
|
||||
if($me['level'] >= 5) { $btn = "submit"; $btn2 = "button"; }
|
||||
|
||||
@@ -179,7 +179,7 @@ if($valid == 0 && $userGrade < 5) {
|
||||
$city = $db->queryFirstRow('SELECT * FROM city WHERE city=%i', $citylist);
|
||||
$cityNation = getNationStaticInfo($city['nation']);
|
||||
|
||||
//태수, 군사, 시중
|
||||
//태수, 군사, 종사
|
||||
$gen1 = $db->queryFirstRow('SELECT `name`, npc FROM general WHERE `no`=%i', $city['gen1']);
|
||||
$gen2 = $db->queryFirstRow('SELECT `name`, npc FROM general WHERE `no`=%i', $city['gen2']);
|
||||
$gen3 = $db->queryFirstRow('SELECT `name`, npc FROM general WHERE `no`=%i', $city['gen3']);
|
||||
@@ -415,7 +415,7 @@ foreach($generalsFormat as $general){
|
||||
<td align=center><?=$gen1['name']??'-'?></td>
|
||||
<td align=center class=bg1>군사</td>
|
||||
<td align=center><?=$gen2['name']??'-'?></td>
|
||||
<td align=center class=bg1>시중</td>
|
||||
<td align=center class=bg1>종사</td>
|
||||
<td align=center><?=$gen3['name']??'-'?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
+14
-42
@@ -15,7 +15,7 @@ increaseRefresh("내무부", 1);
|
||||
|
||||
$me = $db->queryFirstRow('SELECT no, nation, level, con, turntime, belong FROM general WHERE owner=%i', $userID);
|
||||
|
||||
$nation = $db->queryFirstRow('SELECT secretlimit, msg, scoutmsg FROM nation WHERE nation = %i', $me['nation']);
|
||||
$nation = $db->queryFirstRow('SELECT msg, scoutmsg FROM nation WHERE nation = %i', $me['nation']);
|
||||
|
||||
$con = checkLimit($me['con']);
|
||||
if ($con >= 2) {
|
||||
@@ -23,9 +23,14 @@ if ($con >= 2) {
|
||||
exit();
|
||||
}
|
||||
|
||||
if ($me['level'] == 0 || ($me['level'] == 1 && $me['belong'] < $nation['secretlimit'])) {
|
||||
echo "수뇌부가 아니거나 사관년도가 부족합니다.";
|
||||
exit();
|
||||
$permission = checkSecretPermission($me);
|
||||
if($permission < 0){
|
||||
echo '국가에 소속되어있지 않습니다.';
|
||||
die();
|
||||
}
|
||||
else if ($permission < 1) {
|
||||
echo "권한이 부족합니다. 수뇌부가 아니거나 사관년도가 부족합니다.";
|
||||
die();
|
||||
}
|
||||
|
||||
if ($me['level'] >= 5) {
|
||||
@@ -45,7 +50,7 @@ if ($me['level'] >= 5) {
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?=UniqueConst::$serverName?>: 내무부</title>
|
||||
<script>
|
||||
var editable = <?=($me['level']>=5?'true':'false')?>;
|
||||
var editable = <?=(($me['level']>=5||$permission==4)?'true':'false')?>;
|
||||
var nationMsg = <?=Json::encode($nation['msg']??'')?>;
|
||||
var scoutmsg = <?=Json::encode($nation['scoutmsg']??'')?>;
|
||||
</script>
|
||||
@@ -106,19 +111,15 @@ for ($i=0; $i < $nationcount; $i++) {
|
||||
<td align=center>-</td>
|
||||
<td align=center>-</td>
|
||||
<td align=center>-</td>
|
||||
<td align=left style=font-size:7px;>-</td>
|
||||
</tr>";
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
$query = "select state,term,fixed,reserved,showing from diplomacy where me='{$me['nation']}' and you='{$nation['nation']}'";
|
||||
$query = "select state,term from diplomacy where me='{$me['nation']}' and you='{$nation['nation']}'";
|
||||
$result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$dip = MYDB_fetch_array($result2);
|
||||
|
||||
$query = "select reserved,showing from diplomacy where you='{$me['nation']}' and me='{$nation['nation']}'";
|
||||
$result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$dip2 = MYDB_fetch_array($result2);
|
||||
//속령수
|
||||
$query = "select city from city where nation='{$nation['nation']}'";
|
||||
$result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
@@ -144,33 +145,6 @@ for ($i=0; $i < $nationcount; $i++) {
|
||||
}
|
||||
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$note = "";
|
||||
if ($dip['fixed'] != "") {
|
||||
if ($dip['state'] == 7) {
|
||||
$note .= $dip['fixed'];
|
||||
} else {
|
||||
$note .= "<font color=gray>{$dip['fixed']}</font>";
|
||||
}
|
||||
if ($dip['reserved'] != "" || $dip2['reserved'] != "") {
|
||||
$note .= "<br>";
|
||||
}
|
||||
}
|
||||
if ($dip['showing'] >= $date) {
|
||||
if ($dip['reserved'] != "") {
|
||||
$note .= "<font color=skyblue>아국측 제의</font>: ".$dip['reserved'];
|
||||
if ($dip2['reserved'] != "") {
|
||||
$note .= "<br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($dip2['showing'] >= $date) {
|
||||
if ($dip2['reserved'] != "") {
|
||||
$note .= "<font color=limegreen>상대측 제의</font>: ".$dip2['reserved'];
|
||||
}
|
||||
}
|
||||
if ($note == "") {
|
||||
$note = " ";
|
||||
}
|
||||
|
||||
echo "
|
||||
<tr>
|
||||
@@ -188,9 +162,7 @@ for ($i=0; $i < $nationcount; $i++) {
|
||||
<td align=center>-</td>
|
||||
<td align=center>-</td>";
|
||||
}
|
||||
echo "
|
||||
<td align=left style=font-size:7px;>{$note}</td>
|
||||
</tr>";
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "
|
||||
</table>
|
||||
@@ -302,8 +274,8 @@ if ($budgetricediff > 0) {
|
||||
<tr>
|
||||
<td align=right class=bg1>세율 (5 ~ 30%) </td>
|
||||
<td align=center><input type=text <?=$read?> name=rate style=text-align:right;color:white;background-color:black; size=3 maxlength=3 value=<?=$nation['rate']?>>% <input type=<?=$btn?> name=btn value=세율></td>
|
||||
<td align=right class=bg1>봉급 지급율 (20 ~ 200%) </td>
|
||||
<td align=center><input type=text <?=$read?> name=bill style=text-align:right;color:white;background-color:black; size=3 maxlength=3 value=<?=$nation['bill']?>>% <input type=<?=$btn?> name=btn value=지급율></td>
|
||||
<td align=right class=bg1>봉급 지급률 (20 ~ 200%) </td>
|
||||
<td align=center><input type=text <?=$read?> name=bill style=text-align:right;color:white;background-color:black; size=3 maxlength=3 value=<?=$nation['bill']?>>% <input type=<?=$btn?> name=btn value=지급률></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=right class=bg1>기밀 권한 (1 ~ 99년) </td>
|
||||
|
||||
+9
-4
@@ -23,7 +23,7 @@ $query = "select no,nation,level,con,turntime,belong from general where owner='{
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select level,secretlimit from nation where nation='{$me['nation']}'";
|
||||
$query = "select level from nation where nation='{$me['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
|
||||
@@ -33,9 +33,14 @@ if ($con >= 2) {
|
||||
exit();
|
||||
}
|
||||
|
||||
if ($me['level'] == 0 || ($me['level'] == 1 && $me['belong'] < $nation['secretlimit'])) {
|
||||
echo "수뇌부가 아니거나 사관년도가 부족합니다.";
|
||||
exit();
|
||||
$permission = checkSecretPermission($me);
|
||||
if($permission < 0){
|
||||
echo '국가에 소속되어있지 않습니다.';
|
||||
die();
|
||||
}
|
||||
else if ($permission < 1) {
|
||||
echo "권한이 부족합니다. 수뇌부가 아니거나 사관년도가 부족합니다.";
|
||||
die();
|
||||
}
|
||||
|
||||
$sel = [];
|
||||
|
||||
@@ -113,7 +113,7 @@ for ($j=0; $j < $citycount; $j++) {
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$gen2 = MYDB_fetch_array($genresult);
|
||||
|
||||
$query = "select name from general where no='{$city['gen3']}'"; // 시중
|
||||
$query = "select name from general where no='{$city['gen3']}'"; // 종사
|
||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||
$gen3 = MYDB_fetch_array($genresult);
|
||||
|
||||
@@ -163,7 +163,7 @@ for ($j=0; $j < $citycount; $j++) {
|
||||
<td align=center>";
|
||||
echo $gen2['name']==''?"-":"{$gen2['name']}";
|
||||
echo "</td>
|
||||
<td align=center id=bg1>시중</td>
|
||||
<td align=center id=bg1>종사</td>
|
||||
<td align=center>";
|
||||
echo $gen3['name']==''?"-":"{$gen3['name']}";
|
||||
echo "</td>
|
||||
|
||||
@@ -120,7 +120,7 @@ echo "
|
||||
<td align=center>+$goldincomeList[0] / +$deadIncome</td>
|
||||
<td align=center id=bg1>세곡/둔전</td>
|
||||
<td align=center>+$riceincomeList[0] / +$riceincomeList[1]</td>
|
||||
<td align=center id=bg1>지급율</td>
|
||||
<td align=center id=bg1>지급률</td>
|
||||
<td align=center colspan=3>"; echo $me['nation']==0?"해당 없음":"{$nation['bill']} %"; echo "</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("회의실", 1);
|
||||
|
||||
$query = "select no,nation from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title><?=UniqueConst::$serverName?>: 회의실</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div style='width:1000px;margin:auto'>
|
||||
<table width=1000 class='tb_layout bg0'>
|
||||
<tr><td>회 의 실<br><?=backButton()?></td></tr>
|
||||
<form name=form1 method=post action=c_nationboard.php>
|
||||
<tr><td align=center>
|
||||
제목 <input type=textarea maxlength=50 name=title style=color:white;background-color:black;width:830px;>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td>
|
||||
<textarea name=msg style=color:white;background-color:black;width:998px;height:200px;></textarea><br>
|
||||
<input type=submit value=저장하기>
|
||||
<input type=hidden name=num value=-1>
|
||||
</td></tr>
|
||||
</form>
|
||||
</table>
|
||||
<br>
|
||||
<?php
|
||||
$nation = getNation($me['nation']);
|
||||
|
||||
//20개 메세지
|
||||
$index = $nation['boardindex'];
|
||||
for($i=0; $i < 20; $i++) {
|
||||
$who = "board{$index}_who";
|
||||
$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($nation["board{$index}"], $general['name'], $general['picture'], $general['imgsvr'], $nation["board{$index}_when"], $index, 0); }
|
||||
$index--;
|
||||
if($index < 0) { $index = 19; }
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<table width=1000 class='tb_layout bg0'>
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
increaseRefresh("국법", 1);
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title><?=UniqueConst::$serverName?>: 국법</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table align=center width=1000 class='tb_layout bg0'>
|
||||
<tr><td>국 법<br><?=backButton()?></td></tr>
|
||||
<tr><td>
|
||||
|
||||
<?php
|
||||
$query = "select no,nation,level from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select rule from nation where nation='{$me['nation']}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nation = MYDB_fetch_array($result);
|
||||
|
||||
if($me['level'] >= 5) {
|
||||
echo "
|
||||
<form name=form1 method=post action=c_nationrule.php>
|
||||
<textarea name=msg style=color:white;background-color:black;width:998px;height:500px;>{$nation['rule']}</textarea><br>
|
||||
<input type=submit value=저장하기>
|
||||
</form>";
|
||||
} else {
|
||||
echo "
|
||||
<textarea name=msg style=color:white;background-color:black;width:998px;height:500px; readonly>{$nation['rule']}</textarea><br>";
|
||||
}
|
||||
|
||||
?>
|
||||
</td></tr>
|
||||
<tr><td><?=backButton()?></td></tr>
|
||||
<tr><td><?=banner()?> </td></tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -255,7 +255,7 @@ $startYear = $gameStor->getValue('startyear');
|
||||
<option value="1">일반</option>
|
||||
<option value="4">태수</option>
|
||||
<option value="3">군사</option>
|
||||
<option value="2">시중</option>
|
||||
<option value="2">종사</option>
|
||||
<option value="10">무장 수뇌</option>
|
||||
<option value="9">지장 수뇌</option>
|
||||
<option value="11">참모</option>
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
$title = Util::getReq('title');
|
||||
$msg = Util::getReq('msg');
|
||||
$num = Util::getReq('num', 'int');
|
||||
$reply = Util::getReq('reply');
|
||||
// $title, $msg, $num
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
if (getBlockLevel() == 1 || getBlockLevel() == 3) {
|
||||
header('location:b_chiefboard.php');
|
||||
die();
|
||||
}
|
||||
|
||||
$query = "select no,nation from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
$title = str_replace("|", " ", $title);
|
||||
$msg = str_replace("|", " ", $msg);
|
||||
$reply = str_replace("|", " ", $reply);
|
||||
$title = trim($title);
|
||||
$msg = trim($msg);
|
||||
$reply = trim($reply);
|
||||
|
||||
$nation = getNation($me['nation']);
|
||||
|
||||
//새글 추가시
|
||||
if($num == -1 && $title != "" && $msg != "") {
|
||||
$num = $nation['coreindex'] + 1;
|
||||
if($num >= 20) { $num = 0; }
|
||||
$msg = $title."|".$msg;
|
||||
$msg = addslashes(SQ2DQ($msg));
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$query = "update nation set coreboard{$num}='$msg',coreboard{$num}_who='{$me['no']}',coreboard{$num}_when='$date' where nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$query = "update nation set coreindex='$num' where nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
//$num에 댓글시
|
||||
} elseif($num >= 0 && $reply != "") {
|
||||
$newmsg = $nation["coreboard{$num}"]."|".$me['no']."|".$reply;
|
||||
$newmsg = addslashes(SQ2DQ($newmsg));
|
||||
|
||||
$query = "update nation set coreboard{$num}='$newmsg' where nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
|
||||
header('location:b_chiefboard.php');
|
||||
+7
-2
@@ -21,7 +21,12 @@ $db = DB::db();
|
||||
$me = $db->queryFirstRow('SELECT `no`,nation,`level` FROM general WHERE `owner`=%i', $userID);
|
||||
|
||||
//내가 수뇌부이어야함
|
||||
if($me['level'] < 5) {
|
||||
$permission = checkSecretPermission($me);
|
||||
if($permission < 0){
|
||||
header('location:b_myBossInfo.php');
|
||||
exit();
|
||||
}
|
||||
else if ($me['level'] < 5 && $permission != 4) {
|
||||
header('location:b_myBossInfo.php');
|
||||
exit();
|
||||
}
|
||||
@@ -42,7 +47,7 @@ if($btn == "국가방침 수정") {
|
||||
$db->update('nation', [
|
||||
'rate'=>$rate,
|
||||
], 'nation=%i', $me['nation']);
|
||||
} elseif($btn == "지급율") {
|
||||
} elseif($btn == "지급률") {
|
||||
$bill = Util::valueFit($bill, 20, 200);
|
||||
$db->update('nation', [
|
||||
'bill'=>$bill
|
||||
|
||||
@@ -93,11 +93,6 @@ if($command == 61) {
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
if($me['level'] >= 5) {
|
||||
$note = StringUtil::neutralize($note, 90);
|
||||
|
||||
$query = "update diplomacy set reserved='{$note}' where me='{$me['nation']}' and you='$double'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$count = count($turn);
|
||||
$str = "type=type";
|
||||
for($i=0; $i < $count; $i++) {
|
||||
|
||||
@@ -59,7 +59,7 @@ if($btn == "임명") {
|
||||
header('location:b_myBossInfo.php');
|
||||
exit();
|
||||
}
|
||||
$query = "select no,name,gold,rice,nation,troop,level,npc,picture,imgsvr from general where no='$outlist'";
|
||||
$query = "select no,name,gold,rice,nation,troop,level,npc,picture,imgsvr,permission,penalty from general where no='$outlist'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
@@ -74,6 +74,13 @@ if($btn == "임명") {
|
||||
exit();
|
||||
}
|
||||
|
||||
//추방할사람이 외교권자이면 불가
|
||||
$permission = checkSecretPermission($general);
|
||||
if($permission == 4){
|
||||
header('location:b_myBossInfo.php');
|
||||
exit();
|
||||
}
|
||||
|
||||
//NPC 부대장 추방 불가
|
||||
if($general['npc'] == 5){
|
||||
header('location:b_myBossInfo.php');
|
||||
@@ -148,6 +155,7 @@ if($btn == "추방") {
|
||||
else{
|
||||
$db->update('general', [
|
||||
'level'=>0,
|
||||
'permission'=>'normal',
|
||||
'nation'=>0,
|
||||
'belong'=>0,
|
||||
'makelimit'=>12,
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
// $title, $msg, $num
|
||||
$title = Util::getReq('title');
|
||||
$msg = Util::getReq('msg');
|
||||
$num = Util::getReq('num', 'int');
|
||||
$reply = Util::getReq('reply');
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
if(getBlockLevel() != 1 && getBlockLevel() != 3) {
|
||||
$query = "select no,nation from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
$title = str_replace("|", " ", $title);
|
||||
$msg = str_replace("|", " ", $msg);
|
||||
$reply = str_replace("|", " ", $reply);
|
||||
$title = trim($title);
|
||||
$msg = trim($msg);
|
||||
$reply = trim($reply);
|
||||
|
||||
$nation = getNation($me['nation']);
|
||||
|
||||
//새글 추가시
|
||||
if($num == -1 && $title != "" && $msg != "") {
|
||||
$num = $nation['boardindex'] + 1;
|
||||
if($num >= 20) { $num = 0; }
|
||||
$msg = $title."|".$msg;
|
||||
$msg = addslashes(SQ2DQ($msg));
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$query = "update nation set board{$num}='$msg',board{$num}_who='{$me['no']}',board{$num}_when='$date' where nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$query = "update nation set boardindex='$num' where nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
//$num에 댓글시
|
||||
} elseif($num >= 0 && $reply != "") {
|
||||
$newmsg = $nation["board{$num}"]."|".$me['no']."|".$reply;
|
||||
$newmsg = addslashes(SQ2DQ($newmsg));
|
||||
|
||||
$query = "update nation set board{$num}='$newmsg' where nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
}
|
||||
|
||||
header('location:b_nationboard.php');
|
||||
@@ -1,25 +0,0 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
// $msg
|
||||
$msg = Util::getReq('msg');
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$query = "select no,nation from general where owner='{$userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
$msg = addslashes(SQ2DQ($msg));
|
||||
|
||||
$query = "update nation set rule='$msg' where nation='{$me['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
header('location:b_nationrule.php');
|
||||
+25
-2
@@ -59,12 +59,16 @@
|
||||
height:667px;
|
||||
}
|
||||
|
||||
.private_message{
|
||||
.diplomacy_message{
|
||||
height:667px;
|
||||
}
|
||||
|
||||
.national_message{
|
||||
height:1350px;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.private_message{
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.msg_icon{
|
||||
@@ -83,6 +87,7 @@
|
||||
font-weight: bold;
|
||||
margin-bottom:3px;
|
||||
color:white;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.message_input_form{
|
||||
@@ -129,6 +134,16 @@
|
||||
outline-style:solid;
|
||||
outline-width:1px;
|
||||
outline-color: gray;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
flex-direction: column;
|
||||
}
|
||||
.board_side > div{
|
||||
height: 1.2em;
|
||||
}
|
||||
|
||||
.msg_invalid{
|
||||
color:rgba(255,255,255,0.5);
|
||||
}
|
||||
|
||||
.msg_body{
|
||||
@@ -143,6 +158,14 @@
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.btn-delete-msg{
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
margin:2px 2px 0 2px;
|
||||
font-size:8px;
|
||||
}
|
||||
|
||||
/*
|
||||
.public_message .msg_target{
|
||||
box-shadow: 2px 2px darkslategrey;
|
||||
|
||||
+57
-55
@@ -243,7 +243,7 @@ function cityInfo() {
|
||||
<td height=7>".bar($wall)."</td>
|
||||
<td rowspan=2 style='text-align:center;' class='bg1'><b>시세</b></td>
|
||||
<td height=7>".bar($trade)."</td>
|
||||
<td rowspan=2 style='text-align:center;' class='bg1'><b>시중</b></td>
|
||||
<td rowspan=2 style='text-align:center;' class='bg1'><b>종사</b></td>
|
||||
<td rowspan=2 style='text-align:center;'>{$gen3['name']}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -322,7 +322,7 @@ function myNationInfo() {
|
||||
<td class='center'>";echo $me['nation']==0?"해당 없음":"{$nation['rice']}";echo "</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='bg1 center'><b>지급율</b></td>
|
||||
<td class='bg1 center'><b>지급률</b></td>
|
||||
<td class='center'>";
|
||||
if($me['nation'] == 0) {
|
||||
echo "해당 없음";
|
||||
@@ -399,6 +399,61 @@ function myNationInfo() {
|
||||
";
|
||||
}
|
||||
|
||||
function checkSecretPermission($me){
|
||||
if(!key_exists($me['penalty']) || !key_exists($me['permission'])){
|
||||
trigger_error ('canAccessSecret() 함수에 필요한 인자가 부족');
|
||||
}
|
||||
$penalty = Json::decode($me['penalty'])??[];
|
||||
$permission = $me['permission'];
|
||||
|
||||
if(!$me['nation']){
|
||||
return -1;
|
||||
}
|
||||
|
||||
if($me['level'] == 0){
|
||||
return -1;
|
||||
}
|
||||
|
||||
$secretLimit = $db->queryFirstField('SELECT secretlimit FROM nation WHERE nation = %i', $me['nation']);
|
||||
|
||||
if($pernalty['noSecret']??false){
|
||||
return 0;
|
||||
}
|
||||
|
||||
$secretMin = 0;
|
||||
$secretMax = 3;
|
||||
if($penalty['noTopSecret']??false){
|
||||
$secretMax = 1;
|
||||
}
|
||||
else if($penalty['noChief']??false){
|
||||
$secretMax = 1;
|
||||
}
|
||||
else if($penalty['noAmbassador']??false){
|
||||
$secretMax = 2;
|
||||
}
|
||||
|
||||
if($me['level'] == 12){
|
||||
$secretMin = 4;
|
||||
}
|
||||
else if($me['permission'] == 'ambassador'){
|
||||
$secretMin = 4;
|
||||
}
|
||||
else if($me['permission'] == 'auditor'){
|
||||
$secretMin = 3;
|
||||
}
|
||||
else if($me['level'] >= 5){
|
||||
$secretMin = 2;
|
||||
}
|
||||
else if($me['level'] > 1){
|
||||
$secretMin = 1;
|
||||
}
|
||||
else if($me['belong'] >= $secretLimit){
|
||||
$secretMin = 1;
|
||||
}
|
||||
|
||||
return min($secretMin, $secretMax);
|
||||
}
|
||||
|
||||
function addCommand($typename, $value, $valid = 1, $color=0) {
|
||||
if($valid == 1) {
|
||||
switch($color) {
|
||||
@@ -1128,59 +1183,6 @@ function nationMsg() {
|
||||
return $msg?:'';
|
||||
}
|
||||
|
||||
function msgprint($msg, $name, $picture, $imgsvr, $when, $num, $type) {
|
||||
$db = DB::db();
|
||||
$connect=$db->get();
|
||||
|
||||
$message = explode('|', $msg);
|
||||
$count = (count($message) - 2)/2;
|
||||
$message[0] = Tag2Code($message[0]);
|
||||
$message[1] = Tag2Code($message[1]);
|
||||
// $message[0] = str_replace("\n", "<br>", $message[0]);
|
||||
// $message[1] = str_replace("\n", "<br>", $message[1]);
|
||||
|
||||
if($type == 0) { $board = "c_nationboard.php"; }
|
||||
else { $board = "c_chiefboard.php"; }
|
||||
|
||||
$imageTemp = GetImageURL($imgsvr);
|
||||
echo "
|
||||
<table style='text-align:center;' width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td width=90 style='text-align:center;' class='bg1'><font size=1>$name</font></td>
|
||||
<td width=746 style='text-align:center;' class='bg1'><font size=4><b>$message[0]</b></font></td>
|
||||
<td width=148 style='text-align:center;' class='bg1'>$when</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=90 height=64 valign=top><img width='64' height='64' class='generalIcon' src='{$imageTemp}/{$picture}' border='0'></td>
|
||||
<td width=906 colspan=2>$message[1]</td>
|
||||
</tr>";
|
||||
for($i=0; $i < $count; $i++) {
|
||||
$who = Tag2Code($message[2+$i*2]);
|
||||
$reply = Tag2Code($message[3+$i*2]);
|
||||
$query = "select name from general where no='$who'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$regen = MYDB_fetch_array($result);
|
||||
echo "
|
||||
<tr>
|
||||
<td width=90 style='text-align:center;'><font size=1>{$regen['name']}</font></td>
|
||||
<td width=906 colspan=2>$reply</td>
|
||||
</tr>";
|
||||
}
|
||||
echo "
|
||||
<tr>
|
||||
<form name=reply_form{$num} method=post action=$board>
|
||||
<td width=90 style='text-align:center;'>댓글달기</td>
|
||||
<td width=906 colspan=2>
|
||||
<input type=textarea name=reply maxlength=250 style=color:white;background-color:black;width:804px;>
|
||||
<input type=submit value=댓글달기>
|
||||
<input type=hidden name=num value=$num>
|
||||
</td>
|
||||
</form>
|
||||
</tr>
|
||||
</table>
|
||||
<br>";
|
||||
}
|
||||
|
||||
function banner() {
|
||||
|
||||
return sprintf(
|
||||
|
||||
@@ -278,11 +278,11 @@ function getLevel($level, $nlevel=8) {
|
||||
|
||||
case 712: $call = '황제'; break; case 612: $call = '왕'; break;
|
||||
case 711: $call = '승상'; break; case 611: $call = '광록훈'; break;
|
||||
case 710: $call = '위장군'; break; case 610: $call = '전장군'; break;
|
||||
case 710: $call = '표기장군'; break; case 610: $call = '좌장군'; break;
|
||||
case 709: $call = '사공'; break; case 609: $call = '상서령'; break;
|
||||
case 708: $call = '표기장군'; break; case 608: $call = '좌장군'; break;
|
||||
case 708: $call = '거기장군'; break; case 608: $call = '우장군'; break;
|
||||
case 707: $call = '태위'; break; case 607: $call = '중서령'; break;
|
||||
case 706: $call = '거기장군'; break; case 606: $call = '우장군'; break;
|
||||
case 706: $call = '위장군'; break; case 606: $call = '전장군'; break;
|
||||
case 705: $call = '사도'; break; case 605: $call = '비서령'; break;
|
||||
|
||||
case 512: $call = '공'; break; case 412: $call = '주목'; break;
|
||||
@@ -302,7 +302,7 @@ function getLevel($level, $nlevel=8) {
|
||||
|
||||
case 4: $call = '태수'; break;
|
||||
case 3: $call = '군사'; break;
|
||||
case 2: $call = '시중'; break;
|
||||
case 2: $call = '종사'; break;
|
||||
case 1: $call = '일반'; break;
|
||||
case 0: $call = '재야'; break;
|
||||
default: $call = '-'; break;
|
||||
|
||||
+3
-3
@@ -437,12 +437,12 @@ function processAI($no) {
|
||||
} elseif($admin['month'] == 12) {
|
||||
//세율
|
||||
$nation['rate'] = TaxRate($general['nation']);
|
||||
//지급율
|
||||
//지급률
|
||||
GoldBillRate($nation['nation'], $nation['rate'], $admin['gold_rate'], $nation['type'], $nation['gold']);
|
||||
} elseif($admin['month'] == 6) {
|
||||
//세율
|
||||
$nation['rate'] = TaxRate($general['nation']);
|
||||
//지급율
|
||||
//지급률
|
||||
RiceBillRate($nation['nation'], $nation['rate'], $admin['rice_rate'], $nation['type'], $nation['rice']);
|
||||
}
|
||||
|
||||
@@ -1338,7 +1338,7 @@ function NPCStaffWork($general, $nation, $dipState){
|
||||
return Util::choiceRandomUsingWeight($commandList);
|
||||
}
|
||||
|
||||
//종전하기, 지급율
|
||||
//종전하기, 지급률
|
||||
//$command = $fourth * 100000000 + $type * 100000 + $crew * 100 + 11;
|
||||
|
||||
function Promotion($nation, $level) {
|
||||
|
||||
@@ -446,7 +446,7 @@ function process_4(&$general) {
|
||||
|
||||
// 군주, 참모 보정
|
||||
if($general['level'] == 12 || $general['level'] == 11) { $score *= 1.05; }
|
||||
// 시중 보정
|
||||
// 종사 보정
|
||||
if($general['level'] == 2 && $general['no'] == $city['gen3']) { $score *= 1.05; }
|
||||
|
||||
$rd = Util::randF();
|
||||
@@ -646,7 +646,7 @@ function process_7(&$general) {
|
||||
|
||||
// 군주, 참모 보정
|
||||
if($general['level'] == 12 || $general['level'] == 11) { $score *= 1.05; }
|
||||
// 시중 보정
|
||||
// 종사 보정
|
||||
if($general['level'] == 2 && $general['no'] == $city['gen3']) { $score *= 1.05; }
|
||||
|
||||
$rd = Util::randF();
|
||||
|
||||
@@ -605,11 +605,6 @@ function process_61(&$general) {
|
||||
$validMinutes = max(30, $turnterm*3);
|
||||
$validUntil->add(new \DateInterval("PT{$validMinutes}M"));
|
||||
|
||||
//FIXME: 현재 command가 숫자로만 이루어져 있어서 문자열을 처리할 수 없다.
|
||||
//XXX: 으악.
|
||||
//TODO: 커맨드 처리 방식을 json으로 변경
|
||||
$option = $db->queryFirstField('SELECT reserved FROM diplomacy WHERE me=%i AND you=%i', $src->nationID, $dest->nationID);
|
||||
|
||||
$msg = new DiplomaticMessage(
|
||||
Message::MSGTYPE_DIPLOMACY,
|
||||
$src,
|
||||
@@ -619,19 +614,11 @@ function process_61(&$general) {
|
||||
$validUntil,
|
||||
[
|
||||
'action'=>DiplomaticMessage::TYPE_NO_AGGRESSION,
|
||||
'year'=>$when,
|
||||
'option'=>$option
|
||||
'year'=>$when
|
||||
]
|
||||
);
|
||||
$msg->send();
|
||||
|
||||
//NOTE: 현재 내무부 외교란의 비고는 diplomacy가 기준이니까 유지할 필요는 있다.
|
||||
//FIXME: 외교란도 message란의 diplomacy를 참조하든가 하도록.
|
||||
$db->update('diplomacy', [
|
||||
'showing'=>$validUntil->format('Y-m-d H:i:s')
|
||||
], 'me=%i AND you=%i', $src->nationID, $dest->nationID);
|
||||
// 3턴후
|
||||
|
||||
pushGenLog($general, ["<C>●</>{$month}월:<D><b>{$destNation['name']}</b></>으로 불가침 제의 서신을 보냈습니다.<1>$date</>"]);
|
||||
}
|
||||
|
||||
|
||||
@@ -595,11 +595,11 @@ function process_45(&$general) {
|
||||
pushGeneralHistory($general, "<C>●</>{$admin['year']}년 {$admin['month']}월:<D><b>{$nation['name']}</b></>에서 하야");
|
||||
|
||||
// 국적 바꾸고 등급 재야로 // 명성/공헌 N*10% 감소
|
||||
$query = "update general set resturn='SUCCESS',belong=0,nation=0,level=0,experience=experience*(1-0.1*betray),dedication=dedication*(1-0.1*betray),makelimit='12',gold='{$general['gold']}',rice='{$general['rice']}',betray=betray+1 where no='{$general['no']}'";
|
||||
$query = "update general set resturn='SUCCESS',belong=0,nation=0,level=0,permission='normal',experience=experience*(1-0.1*betray),dedication=dedication*(1-0.1*betray),makelimit='12',gold='{$general['gold']}',rice='{$general['rice']}',betray=betray+1 where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
|
||||
//도시의 태수, 군사, 시중직도 초기화
|
||||
//도시의 태수, 군사, 종사직도 초기화
|
||||
$query = "update city set gen1='0' where gen1='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$query = "update city set gen2='0' where gen2='{$general['no']}'";
|
||||
@@ -848,7 +848,7 @@ function process_54(&$general) {
|
||||
//군주 교체
|
||||
$query = "update general set level='12' where no='$who'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
// 태수,군사,시중이었다면 해제
|
||||
// 태수,군사,종사이었다면 해제
|
||||
$query = "update city set gen1='0' where gen1='$who'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$query = "update city set gen2='0' where gen2='$who'";
|
||||
@@ -1059,7 +1059,7 @@ function process_57(&$general) {
|
||||
//군주 교체
|
||||
$query = "update general set resturn='SUCCESS',level='12' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
// 태수,군사,시중이었다면 해제
|
||||
// 태수,군사,종사이었다면 해제
|
||||
$query = "update city set gen1='0' where gen1='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$query = "update city set gen2='0' where gen2='{$general['no']}'";
|
||||
|
||||
@@ -138,7 +138,7 @@ function commandButton() {
|
||||
$db = DB::db();
|
||||
$me = $db->queryFirstRow("select no,nation,level,belong from general where owner=%i", $userID);
|
||||
|
||||
$nation = $db->queryFirstRow("select nation,level,color,secretlimit from nation where nation=%i",$me['nation'])??[
|
||||
$nation = $db->queryFirstRow("select permission,penalty,nation,level,color,secretlimit from nation where nation=%i",$me['nation'])??[
|
||||
'nation'=>0,
|
||||
'level'=>0,
|
||||
'secretlimit'=>99,
|
||||
@@ -150,15 +150,13 @@ function commandButton() {
|
||||
|
||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||
$showSecret = false;
|
||||
if($me['level'] >= 2){
|
||||
$permission = checkSecretPermission($me);
|
||||
if($permission >= 1){
|
||||
$showSecret = true;
|
||||
}
|
||||
else if($me['level']== 0){
|
||||
$showSecret = false;
|
||||
}
|
||||
else if($me['belong'] >= $nation['secretlimit']){
|
||||
$showSecret = true;
|
||||
}
|
||||
|
||||
return $templates->render('commandButton', [
|
||||
'bgColor'=>$bgColor,
|
||||
|
||||
+10
-10
@@ -68,25 +68,25 @@ function processGoldIncome() {
|
||||
// 기본량도 안될경우
|
||||
if($nation['gold'] < GameConst::$basegold) {
|
||||
$realoutcome = 0;
|
||||
// 실지급율
|
||||
// 실지급률
|
||||
$ratio = 0;
|
||||
//기본량은 넘지만 요구량이 안될경우
|
||||
} elseif($nation['gold'] - GameConst::$basegold < $outcome) {
|
||||
$realoutcome = $nation['gold'] - GameConst::$basegold;
|
||||
$nation['gold'] = GameConst::$basegold;
|
||||
// 실지급율
|
||||
// 실지급률
|
||||
$ratio = $realoutcome / $originoutcome;
|
||||
} else {
|
||||
$realoutcome = $outcome;
|
||||
$nation['gold'] -= $realoutcome;
|
||||
// 실지급율
|
||||
// 실지급률
|
||||
$ratio = $realoutcome / $originoutcome;
|
||||
}
|
||||
$adminLog[] = StringUtil::padStringAlignRight((string)$nation['name'],12," ")
|
||||
." // 세금 : ".StringUtil::padStringAlignRight((string)$income,6," ")
|
||||
." // 세출 : ".StringUtil::padStringAlignRight((string)$originoutcome,6," ")
|
||||
." // 실제 : ".tab2((string)$realoutcome,6," ")
|
||||
." // 지급율 : ".tab2((string)round($ratio*100,2),5," ")
|
||||
." // 지급률 : ".tab2((string)round($ratio*100,2),5," ")
|
||||
." % // 결과금 : ".tab2((string)$nation['gold'],6," ");
|
||||
|
||||
$query = "select no,name,nation from general where nation='{$nation['nation']}' and level>='9'";
|
||||
@@ -223,7 +223,7 @@ function getGoldIncome($nationNo, $rate, $admin_rate, $type) {
|
||||
$gen = MYDB_fetch_array($result);
|
||||
$level3[$gen['no']] = $gen['city'];
|
||||
}
|
||||
$query = "select no,city from general where nation='$nationNo' and level=2"; // 시중
|
||||
$query = "select no,city from general where nation='$nationNo' and level=2"; // 종사
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$count = MYDB_num_rows($result);
|
||||
for($j=0; $j < $count; $j++) {
|
||||
@@ -391,25 +391,25 @@ function processRiceIncome() {
|
||||
// 기본량도 안될경우
|
||||
if($nation['rice'] < GameConst::$baserice) {
|
||||
$realoutcome = 0;
|
||||
// 실지급율
|
||||
// 실지급률
|
||||
$ratio = 0;
|
||||
//기본량은 넘지만 요구량이 안될경우
|
||||
} elseif($nation['rice'] - GameConst::$baserice < $outcome) {
|
||||
$realoutcome = $nation['rice'] - GameConst::$baserice;
|
||||
$nation['rice'] = GameConst::$baserice;
|
||||
// 실지급율
|
||||
// 실지급률
|
||||
$ratio = $realoutcome / $originoutcome;
|
||||
} else {
|
||||
$realoutcome = $outcome;
|
||||
$nation['rice'] -= $realoutcome;
|
||||
// 실지급율
|
||||
// 실지급률
|
||||
$ratio = $realoutcome / $originoutcome;
|
||||
}
|
||||
$adminLog[] = StringUtil::padStringAlignRight($nation['name'],12," ")
|
||||
." // 세곡 : ".StringUtil::padStringAlignRight((string)$income,6," ")
|
||||
." // 세출 : ".StringUtil::padStringAlignRight((string)$originoutcome,6," ")
|
||||
." // 실제 : ".tab2((string)$realoutcome,6," ")
|
||||
." // 지급율 : ".tab2((string)round($ratio*100,2),5," ")
|
||||
." // 지급률 : ".tab2((string)round($ratio*100,2),5," ")
|
||||
." % // 결과곡 : ".tab2((string)$nation['rice'],6," ");
|
||||
|
||||
$query = "select no,name,nation from general where nation='{$nation['nation']}' and level>='9'";
|
||||
@@ -467,7 +467,7 @@ function getRiceIncome($nationNo, $rate, $admin_rate, $type) {
|
||||
$gen = MYDB_fetch_array($result);
|
||||
$level3[$gen['no']] = $gen['city'];
|
||||
}
|
||||
$query = "select no,city from general where nation='$nationNo' and level=2"; // 시중
|
||||
$query = "select no,city from general where nation='$nationNo' and level=2"; // 종사
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$count = MYDB_num_rows($result);
|
||||
for($j=0; $j < $count; $j++) {
|
||||
|
||||
+16
-8
@@ -88,6 +88,7 @@ $mapTheme = $admin['map_theme'];
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery.redirect.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/moment.min.js')?>
|
||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printJS('js/main.js')?>
|
||||
@@ -105,7 +106,7 @@ $(function(){
|
||||
|
||||
setInterval(function(){
|
||||
refreshMsg();
|
||||
}, 10000);
|
||||
}, 5000);
|
||||
});
|
||||
</script>
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
@@ -303,15 +304,22 @@ else if($session->userGrade == 4){
|
||||
<div><?=allButton()?></div>
|
||||
<div id="message_board"><div style="left:0;" class="board_side bg0">
|
||||
<div class="board_header bg0">전체 메시지(최고99자)</div>
|
||||
<section class="public_message"></section>
|
||||
<div class="board_header bg0">개인 메시지(최고99자)</div>
|
||||
<section class="private_message"></section>
|
||||
</div><div style="right:0;" class="board_side bg0">
|
||||
<section class="diplomacy_message">
|
||||
|
||||
<section class="public_message">
|
||||
<button type="button" class="load_old_message btn btn-secondary btn-block" data-msg_type="public">이전 메시지 불러오기</button>
|
||||
</section>
|
||||
<div class="board_header bg0">개인 메시지(최고99자)</div>
|
||||
<section class="private_message">
|
||||
<button type="button" class="load_old_message btn btn-secondary btn-block" data-msg_type="private">이전 메시지 불러오기</button>
|
||||
</section>
|
||||
</div><div style="right:0;" class="board_side bg0">
|
||||
<div class="board_header bg0">국가 메시지(최고99자)</div>
|
||||
<section class="national_message"></section>
|
||||
<section class="national_message">
|
||||
<button type="button" class="load_old_message btn btn-secondary btn-block" data-msg_type="national">이전 메시지 불러오기</button>
|
||||
</section>
|
||||
<div class="board_header bg0">외교 메시지(최고99자)</div>
|
||||
<section class="diplomacy_message">
|
||||
<button type="button" class="load_old_message btn btn-secondary btn-block" data-msg_type="diplomacy">이전 메시지 불러오기</button>
|
||||
</section>
|
||||
</div></div>
|
||||
<div style="clear:left;"><?=allButton()?><?=banner()?></div>
|
||||
</div>
|
||||
|
||||
@@ -11,14 +11,18 @@ $result = [
|
||||
$session = Session::requireGameLogin([])->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$generalInfo = DB::db()->queryFirstRow('SELECT `no`, `nation`, `level` from `general` where `owner`=%i', $userID);
|
||||
$generalInfo = DB::db()->queryFirstRow('SELECT `no`, `nation`, `level`, penalty, permission from `general` where `owner`=%i', $userID);
|
||||
if(!$generalInfo){
|
||||
Json::die($result);
|
||||
}
|
||||
|
||||
$permission = checkSecretPermission($generalInfo);
|
||||
|
||||
|
||||
$result['generalID'] = $generalInfo['no'];
|
||||
$result['myNationID'] = $generalInfo['nation'];
|
||||
$result['isChief'] = ($generalInfo['level'] == 12);
|
||||
$result['generalLevel'] = $generalInfo['level'];
|
||||
$result['permission'] = $permission;
|
||||
|
||||
Json::die($result);
|
||||
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
|
||||
$isSecretBoard = Util::getReq('isSecret', 'bool', false);
|
||||
$title = Util::getReq('title');
|
||||
$text = Util::getReq('text');
|
||||
|
||||
increaseRefresh("회의실", 1);
|
||||
|
||||
$me = $db->queryFirstRow('SELECT no, nation, level, permission, con, turntime, belong, penalty FROM general WHERE owner=%i', $userID);
|
||||
|
||||
$con = checkLimit($me['con']);
|
||||
if ($con >= 2) {
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'접속 제한입니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
if($title === null || $text === null){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'올바르지 않은 입력입니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
$title = trim($title);
|
||||
$text = trim($text);
|
||||
|
||||
if(!$title && !$text){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'제목과 내용이 둘다 비어있습니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
$permission = checkSecretPermission($me);
|
||||
if($permission < 0){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'국가에 소속되어있지 않습니다.'
|
||||
]);
|
||||
|
||||
}
|
||||
else if ($isSecretBoard && $permission < 2) {
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'권한이 부족합니다. 수뇌부가 아닙니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
$db->insert('board', [
|
||||
'nation_no'=>$me['nation'],
|
||||
'is_secret'=>$isSecretBoard,
|
||||
'date'=>TimeUtil::DatetimeNow(),
|
||||
'general_no'=>$me['no'],
|
||||
'author'=>$me['name'],
|
||||
'title'=>$title,
|
||||
'text'=>$text
|
||||
]);
|
||||
|
||||
Json::die([
|
||||
'result'=>true,
|
||||
'reason'=>'success',
|
||||
'row_id'=>$db->insertId()
|
||||
]);
|
||||
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
|
||||
$articleNo = Util::getReq('articleNo', 'int');
|
||||
$text = Util::getReq('text');
|
||||
|
||||
increaseRefresh("회의실", 1);
|
||||
|
||||
$me = $db->queryFirstRow('SELECT no, nation, level, permission, con, turntime, belong, penalty FROM general WHERE owner=%i', $userID);
|
||||
|
||||
$con = checkLimit($me['con']);
|
||||
if ($con >= 2) {
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'접속 제한입니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
if($articleNo === null || $text === null){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'올바르지 않은 입력입니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
$text = trim($text);
|
||||
|
||||
if(!$text){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'내용이 비어있습니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
$article = $db->queryFirstRow('SELECT * FROM board WHERE no = %i AND nation_no = %i', $articleNo, $me['nation']);
|
||||
if(!$article){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'게시물이 없습니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
$isSecretBoard = $article['is_secret'];
|
||||
|
||||
$permission = checkSecretPermission($me);
|
||||
if($permission < 0){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'국가에 소속되어있지 않습니다.'
|
||||
]);
|
||||
|
||||
}
|
||||
else if ($isSecretBoard && $permission < 2) {
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'권한이 부족합니다. 수뇌부가 아닙니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
$db->insert('comment', [
|
||||
'nation_no'=>$me['nation'],
|
||||
'is_secret'=>$isSecretBoard,
|
||||
'date'=>TimeUtil::DatetimeNow(),
|
||||
'document_no'=>$articleNo,
|
||||
'general_no'=>$me['no'],
|
||||
'author'=>$me['name'],
|
||||
'text'=>$text
|
||||
]);
|
||||
|
||||
Json::die([
|
||||
'result'=>true,
|
||||
'reason'=>'success',
|
||||
'row_id'=>$db->insertId()
|
||||
]);
|
||||
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
|
||||
$isSecretBoard = Util::getReq('isSecret', 'bool', false);
|
||||
|
||||
increaseRefresh("회의실", 1);
|
||||
|
||||
$me = $db->queryFirstRow('SELECT no, nation, level, permission, con, turntime, belong, penalty FROM general WHERE owner=%i', $userID);
|
||||
|
||||
|
||||
$con = checkLimit($me['con']);
|
||||
if ($con >= 2) {
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'접속 제한입니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
$permission = checkSecretPermission($me);
|
||||
if($permission < 0){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'국가에 소속되어있지 않습니다.'
|
||||
]);
|
||||
|
||||
}
|
||||
else if ($isSecretBoard && $permission < 2) {
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'권한이 부족합니다. 수뇌부가 아닙니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
$articles = [];
|
||||
|
||||
foreach(
|
||||
$db->query(
|
||||
'SELECT * FROM board WHERE nation_no = %i AND is_secret = %i ORDER BY date desc',
|
||||
$me['nation'],
|
||||
$isSecretBoard
|
||||
) as $article
|
||||
){
|
||||
//TODO:아이콘 받아오기
|
||||
$article['comment'] = [];
|
||||
$articles[$article['no']] = $article;
|
||||
}
|
||||
|
||||
foreach(
|
||||
$db->query(
|
||||
'SELECT * FROM comment WHERE nation_no = %i AND is_secret = %i ORDER BY date asc',
|
||||
$me['nation'],
|
||||
$isSecretBoard
|
||||
) as $comment
|
||||
){
|
||||
//TODO:아이콘 받아오기?
|
||||
$articles[$article['no']]['comment'] = $comment;
|
||||
}
|
||||
|
||||
Json::die([
|
||||
'result'=>true,
|
||||
'articles'=>$articles,
|
||||
'reason'=>'success'
|
||||
]);
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
|
||||
$isSecretBoard = Util::getReq('isSecret', 'bool', false);
|
||||
|
||||
increaseRefresh("외교부", 1);
|
||||
|
||||
$me = $db->queryFirstRow('SELECT no, nation, level, permission, con, turntime, belong, penalty FROM general WHERE owner=%i', $userID);
|
||||
|
||||
|
||||
$con = checkLimit($me['con']);
|
||||
if ($con >= 2) {
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'접속 제한입니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
$permission = checkSecretPermission($me);
|
||||
if($permission < 0){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'국가에 소속되어있지 않습니다.'
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
$letters = [];
|
||||
|
||||
foreach(
|
||||
$db->query(
|
||||
'SELECT * FROM ng_diplomacy WHERE src_nation_id = %i OR dest_nation_id = %i ORDER BY date desc',
|
||||
$me['nation'], $me['nation']
|
||||
) as $letter
|
||||
){
|
||||
|
||||
if($permission < 3){
|
||||
$letter['detail'] = '(권한이 부족합니다)';
|
||||
}
|
||||
$letter['comment'] = [];
|
||||
$letter['aux'] = Json::decode($letter['aux']);
|
||||
$letters[$letter['no']] = $letter;
|
||||
}
|
||||
|
||||
$nations = [];
|
||||
foreach(getAllNationStaticInfo() as $nation){
|
||||
if($nation['nation'] == 0 || $nation['nation'] == $me['nation']){
|
||||
continue;
|
||||
}
|
||||
$nations[] = $nation;
|
||||
}
|
||||
|
||||
Json::die([
|
||||
'result'=>true,
|
||||
'nations'=>$nations,
|
||||
'letters'=>$letters,
|
||||
'reason'=>'success'
|
||||
]);
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
|
||||
$letterNo = Util::getReq('letterNo', 'int');
|
||||
$isAgree = Util::getReq('isAgree', 'bool', false);
|
||||
$reason = Util::getReq('reason', 'string', '');
|
||||
|
||||
|
||||
|
||||
|
||||
increaseRefresh("회의실", 1);
|
||||
|
||||
$me = $db->queryFirstRow('SELECT no, nation, level, permission, con, turntime, belong, penalty FROM general WHERE owner=%i', $userID);
|
||||
|
||||
$con = checkLimit($me['con']);
|
||||
if ($con >= 2) {
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'접속 제한입니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
if($letterNo === null){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'올바르지 않은 입력입니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
$permission = checkSecretPermission($me);
|
||||
if ($permission < 4) {
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'권한이 부족합니다. 수뇌부가 아닙니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
$reason = trim($reason);
|
||||
|
||||
$letter = $db->queryFirstRow('SELECT * FROM ng_diplomacy WHERE no=%i AND dest_nation_id = %i AND state = \'proposed\'', $letterNo, $me['nation']);
|
||||
if(!$letter){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'서신이 없습니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
$aux = Json::decode($letter['aux']);
|
||||
|
||||
if($isAgree){
|
||||
$aux['dest']['generalName'] = $me['name'];
|
||||
$db->update('ng_diplomacy', [
|
||||
'state'=>'activated',
|
||||
'dest_signer'=>$me['no'],
|
||||
'aux'=>Json::encode($aux)
|
||||
], 'no=%i', $letterNo);
|
||||
//TODO: 외교 서신에 대한 메시지를 양국에 발송해야함
|
||||
}
|
||||
else{
|
||||
$aux['reason'] = [
|
||||
'who'=>$me['no'],
|
||||
'action'=>'disagree',
|
||||
'reason'=>$reason
|
||||
];
|
||||
$db->update('ng_diplomacy', [
|
||||
'state'=>'cancelled',
|
||||
'aux'=>Json::encode($aux)
|
||||
]);
|
||||
//TODO: 외교 서신에 대한 메시지를 양국에 발송해야함
|
||||
}
|
||||
|
||||
Json::die([
|
||||
'result'=>true,
|
||||
'reason'=>'success'
|
||||
]);
|
||||
@@ -0,0 +1,146 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
|
||||
$destNationNo = Util::getReq('destNation', 'int', 0);
|
||||
$prevNo = Util::getReq('prevNo', 'int', null);
|
||||
$textBrief = Util::getReq('textBrief');
|
||||
$textDetail = Util::getReq('textDetail');
|
||||
|
||||
increaseRefresh("외교부", 1);
|
||||
|
||||
if($prevNo < 1){
|
||||
$prevNo = null;
|
||||
}
|
||||
|
||||
$me = $db->queryFirstRow('SELECT no, nation, level, permission, con, turntime, belong, penalty FROM general WHERE owner=%i', $userID);
|
||||
|
||||
$con = checkLimit($me['con']);
|
||||
if ($con >= 2) {
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'접속 제한입니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
if($destNationNo == $me['nation']){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'자국으로 보낼 수 없습니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
if($textBrief === null || $textDetail === null){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'올바르지 않은 입력입니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
$textBrief = trim($textBrief);
|
||||
$textDetail = trim($textDetail);
|
||||
|
||||
if(!$textBrief){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'요약문이 비어있습니다'
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
$permission = checkSecretPermission($me);
|
||||
if ($permission < 4) {
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'권한이 부족합니다. 수뇌부가 아닙니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
$srcNationNo = $me['nation'];
|
||||
|
||||
$nations = $db->query('SELECT nation, name, color FROM nation WHERE nation IN (%i, %i)', $srcNationNo, $destNationNo);
|
||||
if(count($nations) != 2){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'올바르지 않은 국가입니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
if($prevNo !== null){
|
||||
//state는 체크하지 않는걸로 하자. 파기한 것을 재 송신하는 경우도 있을 수 있음.
|
||||
$prevLetter = $db->queryFirstRow(
|
||||
'SELECT no, state, aux FROM ng_diplomacy WHERE no = %i AND src_nation_id IN (%i, %i) AND dest_nation_id IN (%i, %i)',
|
||||
$prevNo,
|
||||
$srcNationNo, $destNationNo,
|
||||
$srcNationNo, $destNationNo
|
||||
);
|
||||
|
||||
if(!$prevLetter){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'이전 문서가 없습니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
if($prevLetter['state'] == 'proposed'){
|
||||
$prevAux = Json::decode($prevLetter['aux']);
|
||||
$prevAux['reason'] = [
|
||||
'who'=>$me['no'],
|
||||
'action'=>'new_letter',
|
||||
'reason'=>'new_letter'
|
||||
];
|
||||
$db->update('ng_diplomacy', [
|
||||
'state'=>'cancelled',
|
||||
'aux'=>Json::encode($prevAux)
|
||||
], 'no=%i', $prevNo);
|
||||
}
|
||||
}
|
||||
|
||||
if($nations[0]['nation'] == $me['nation']){
|
||||
//index 순서에 따라 또 모름.
|
||||
$srcNation = $nations[0];
|
||||
$destNation = $nations[1];
|
||||
}
|
||||
else{
|
||||
$srcNation = $nations[1];
|
||||
$destNation = $nations[0];
|
||||
}
|
||||
|
||||
$db->insert('ng_diplomacy', [
|
||||
'src_nation_id'=>$srcNation['nation'],
|
||||
'dest_nation_id'=>$destNation['nation'],
|
||||
'prev_no'=>$prevNo,
|
||||
'state'=>'proposed',
|
||||
'text_brief'=>$textBrief,
|
||||
'text_detail'=>$textDetail,
|
||||
'date'=>TimeUtil::DatetimeNow(),
|
||||
'src_signer'=>$me['no'],
|
||||
'dest_signer'=>null,
|
||||
'aux'=>Json::encode([
|
||||
'src'=>[
|
||||
'nationName'=>$srcNation['name'],
|
||||
'nationColor'=>$srcNation['color'],
|
||||
'generalName'=>$me['name']
|
||||
],
|
||||
'dest'=>[
|
||||
'nationName'=>$destNation['name'],
|
||||
'nationColor'=>$destNation['color']
|
||||
]
|
||||
]),
|
||||
]);
|
||||
|
||||
|
||||
//TODO: 외교 서신에 대한 메시지를 양국에 발송해야함
|
||||
|
||||
Json::die([
|
||||
'result'=>true,
|
||||
'reason'=>'success',
|
||||
'row_id'=>$db->insertId()
|
||||
]);
|
||||
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include('lib.php');
|
||||
include('func.php');
|
||||
|
||||
$session = Session::requireGameLogin([]);
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$msgID = Util::getReq('msgID', 'int');
|
||||
if($msgID === null){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'올바르지 않은 범위 입니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
$lastMsgGet = Json::decode($session->lastMsgGet)??[];
|
||||
$now = new \DateTime();
|
||||
$delayTime = false;
|
||||
if(count($lastMsgGet) >= 10){
|
||||
try{
|
||||
if($lastMsgGet[0] !== 'string'){
|
||||
throw new \Exception('Why not string?');
|
||||
}
|
||||
$first = new \DateTime($lastMsgGet[0]);
|
||||
$diff = $first->diff($now);
|
||||
if($diff->days == 0 && $diff->h > 0 && $diff->i == 0 && $diff->s <= 5){
|
||||
$delayTime = true;
|
||||
}
|
||||
array_shift($lastMsgGet);
|
||||
}
|
||||
catch(\Exception $e){
|
||||
$lastMsgGet = [];
|
||||
}
|
||||
}
|
||||
$lastMsgGet[] = $now;
|
||||
$session->lastMsgGet = Json::encode($lastMsgGet);
|
||||
|
||||
if($delayTime){
|
||||
sleep(1);
|
||||
}
|
||||
$session->setReadOnly();
|
||||
|
||||
list($generalID, $nationID, $generalName) = DB::db()->queryFirstList(
|
||||
'select `no`, `nation`, `name` from `general` where owner = %i',
|
||||
$userID
|
||||
);
|
||||
|
||||
if($nationID === null){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'장수가 사망했습니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
$reason = Message::deleteMsg($msgID, $generalID);
|
||||
if($reason === null){
|
||||
$result = [
|
||||
'result'=>true,
|
||||
'reason'=>'success'
|
||||
];
|
||||
}
|
||||
else{
|
||||
$result = [
|
||||
'result'=>false,
|
||||
'reason'=>$reason
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Json::die($result);
|
||||
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include('lib.php');
|
||||
include('func.php');
|
||||
|
||||
$session = Session::requireGameLogin([]);
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$reqTo = Util::getReq('to', 'int');
|
||||
$reqType = Util::getReq('type', 'string');
|
||||
|
||||
if($reqTo === null){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'올바르지 않은 범위 입니다.'
|
||||
]);
|
||||
}
|
||||
if($reqType === null || !in_array($reqType, ['private', 'public', 'national'])){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'올바르지 않은 타입입니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
$lastMsgGet = Json::decode($session->lastMsgGet)??[];
|
||||
$now = new \DateTime();
|
||||
$delayTime = false;
|
||||
if(count($lastMsgGet) >= 10){
|
||||
try{
|
||||
if($lastMsgGet[0] !== 'string'){
|
||||
throw new \Exception('Why not string?');
|
||||
}
|
||||
$first = new \DateTime($lastMsgGet[0]);
|
||||
$diff = $first->diff($now);
|
||||
if($diff->days == 0 && $diff->h > 0 && $diff->i == 0 && $diff->s <= 1){
|
||||
$delayTime = true;
|
||||
}
|
||||
array_shift($lastMsgGet);
|
||||
}
|
||||
catch(\Exception $e){
|
||||
$lastMsgGet = [];
|
||||
}
|
||||
}
|
||||
$lastMsgGet[] = $now;
|
||||
$session->lastMsgGet = Json::encode($lastMsgGet);
|
||||
|
||||
if($delayTime){
|
||||
sleep(1);
|
||||
}
|
||||
$session->setReadOnly();
|
||||
|
||||
list($generalID, $nationID, $generalName) = DB::db()->queryFirstList(
|
||||
'select `no`, `nation`, `name` from `general` where owner = %i',
|
||||
$userID
|
||||
);
|
||||
|
||||
|
||||
|
||||
if($nationID === null){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'장수가 사망했습니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
$result = [
|
||||
'private'=>[],
|
||||
'public'=>[],
|
||||
'national'=>[],
|
||||
'diplomacy'=>[],
|
||||
'result'=>true,
|
||||
'keepRecent'=>true,
|
||||
'sequence'=>0,
|
||||
'nationID'=>$nationID,
|
||||
'generalName'=>$generalName,
|
||||
];
|
||||
$result['result'] = true;
|
||||
|
||||
$nextSequence = $reqTo;
|
||||
|
||||
if($reqType == 'private'){
|
||||
$result['private'] = array_map(function(Message $msg) use (&$nextSequence){
|
||||
if($msg->id > $nextSequence){
|
||||
$nextSequence = $msg->id;
|
||||
}
|
||||
return $msg->toArray();
|
||||
}, Message::getMessagesFromMailBoxOld($generalID, Message::MSGTYPE_PRIVATE, $reqTo, 20));
|
||||
}
|
||||
else if($reqType == 'public'){
|
||||
$result['public'] = array_map(function(Message $msg)use (&$nextSequence){
|
||||
if($msg->id > $nextSequence){
|
||||
$nextSequence = $msg->id;
|
||||
}
|
||||
return $msg->toArray();
|
||||
}, Message::getMessagesFromMailBoxOld(Message::MAILBOX_PUBLIC, Message::MSGTYPE_PUBLIC, $reqTo, 20));
|
||||
}
|
||||
else{
|
||||
$result['national'] = array_map(function(Message $msg)use (&$nextSequence){
|
||||
if($msg->id > $nextSequence){
|
||||
$nextSequence = $msg->id;
|
||||
}
|
||||
return $msg->toArray();
|
||||
}, Message::getMessagesFromMailBoxOld(Message::MAILBOX_NATIONAL + $nationID, Message::MSGTYPE_NATIONAL, $reqTo, 40));
|
||||
}
|
||||
|
||||
Json::die($result);
|
||||
+77
-18
@@ -4,57 +4,116 @@ namespace sammo;
|
||||
include('lib.php');
|
||||
include('func.php');
|
||||
|
||||
$session = Session::requireGameLogin([])->setReadOnly();
|
||||
$session = Session::requireGameLogin([]);
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$reqSequence = Util::getReq('sequence', 'int', 0);
|
||||
$reqSequence = Util::getReq('sequence', 'int', -1);
|
||||
|
||||
$lastMsgGet = Json::decode($session->lastMsgGet)??[];
|
||||
$now = new \DateTime();
|
||||
$delayTime = false;
|
||||
if(count($lastMsgGet) >= 10){
|
||||
try{
|
||||
if($lastMsgGet[0] !== 'string'){
|
||||
throw new \Exception('Why not string?');
|
||||
}
|
||||
$first = new \DateTime($lastMsgGet[0]);
|
||||
$diff = $first->diff($now);
|
||||
if($diff->days == 0 && $diff->h > 0 && $diff->i == 0 && $diff->s <= 1){
|
||||
$delayTime = true;
|
||||
}
|
||||
array_shift($lastMsgGet);
|
||||
}
|
||||
catch(\Exception $e){
|
||||
$lastMsgGet = [];
|
||||
}
|
||||
}
|
||||
$lastMsgGet[] = $now;
|
||||
$session->lastMsgGet = Json::encode($lastMsgGet);
|
||||
|
||||
if($delayTime){
|
||||
sleep(0.2);
|
||||
}
|
||||
$session->setReadOnly();
|
||||
|
||||
|
||||
list($generalID, $nationID, $generalName) = DB::db()->queryFirstList(
|
||||
'select `no`, `nation`, `name` from `general` where owner = %i',
|
||||
$userID
|
||||
);
|
||||
$db = DB::db();
|
||||
$me = $db->queryFirstRow('SELECT `no`,`name`,`nation`,`level`,`con`,`picture`,`imgsvr`,penalty,permission FROM general WHERE `owner`=%i', $userID);
|
||||
|
||||
|
||||
if($nationID === null){
|
||||
if($me === null){
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'장수가 사망했습니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
$generalID = $me['no'];
|
||||
$nationID = $me['nation'];
|
||||
$generalName = $me['name'];
|
||||
$permission = checkSecretPermission($me);
|
||||
|
||||
$result = [];
|
||||
$result['result'] = true;
|
||||
|
||||
$result['keepRecent'] = false;
|
||||
$nextSequence = $reqSequence;
|
||||
$minSequence = $reqSequence;
|
||||
$lastType = null;
|
||||
|
||||
$result['private'] = array_map(function(Message $msg) use (&$nextSequence){
|
||||
$result['private'] = array_map(function(Message $msg) use (&$nextSequence, &$minSequence, &$lastType){
|
||||
if($msg->id > $nextSequence){
|
||||
$nextSequence = $msg->id;
|
||||
}
|
||||
if($msg->id <= $minSequence){
|
||||
$minSequence = $msg->id;
|
||||
$lastType = 'private';
|
||||
}
|
||||
return $msg->toArray();
|
||||
}, Message::getMessagesFromMailBox($generalID, Message::MSGTYPE_PRIVATE, 10, $reqSequence));
|
||||
}, Message::getMessagesFromMailBox($generalID, Message::MSGTYPE_PRIVATE, 20, $reqSequence));
|
||||
|
||||
$result['public'] = array_map(function(Message $msg)use (&$nextSequence){
|
||||
$result['public'] = array_map(function(Message $msg)use (&$nextSequence, &$minSequence, &$lastType){
|
||||
if($msg->id > $nextSequence){
|
||||
$nextSequence = $msg->id;
|
||||
}
|
||||
if($msg->id <= $minSequence){
|
||||
$minSequence = $msg->id;
|
||||
$lastType = 'public';
|
||||
}
|
||||
return $msg->toArray();
|
||||
}, Message::getMessagesFromMailBox(Message::MAILBOX_PUBLIC, Message::MSGTYPE_PUBLIC, 10, $reqSequence));
|
||||
}, Message::getMessagesFromMailBox(Message::MAILBOX_PUBLIC, Message::MSGTYPE_PUBLIC, 20, $reqSequence));
|
||||
|
||||
$result['national'] = array_map(function(Message $msg)use (&$nextSequence){
|
||||
$result['national'] = array_map(function(Message $msg)use (&$nextSequence, &$minSequence, &$lastType){
|
||||
if($msg->id > $nextSequence){
|
||||
$nextSequence = $msg->id;
|
||||
}
|
||||
if($msg->id <= $minSequence){
|
||||
$minSequence = $msg->id;
|
||||
$lastType = 'national';
|
||||
}
|
||||
return $msg->toArray();
|
||||
}, Message::getMessagesFromMailBox(Message::MAILBOX_NATIONAL + $nationID, Message::MSGTYPE_NATIONAL, 20, $reqSequence));
|
||||
}, Message::getMessagesFromMailBox(Message::MAILBOX_NATIONAL + $nationID, Message::MSGTYPE_NATIONAL, 40, $reqSequence));
|
||||
|
||||
$result['diplomacy']= array_map(function(Message $msg)use (&$nextSequence){
|
||||
$result['diplomacy']= array_map(function(Message $msg)use (&$nextSequence, &$minSequence, &$lastType, $permission){
|
||||
if($msg->id > $nextSequence){
|
||||
$nextSequence = $msg->id;
|
||||
}
|
||||
return $msg->toArray();
|
||||
}, Message::getMessagesFromMailBox(Message::MAILBOX_NATIONAL + $nationID, Message::MSGTYPE_DIPLOMACY, 10, 0));
|
||||
if($msg->id <= $minSequence){
|
||||
$minSequence = $msg->id;
|
||||
$lastType = 'diplomacy';
|
||||
}
|
||||
$values = $msg->toArray();
|
||||
if($permission < 3){
|
||||
$values['text'] = '(외교 문서입니다)';//TODO: 외교서신이라 읽을 수 없음을 보여줘야함
|
||||
}
|
||||
return $values;
|
||||
}, Message::getMessagesFromMailBox(Message::MAILBOX_NATIONAL + $nationID, Message::MSGTYPE_DIPLOMACY, 40, $reqSequence));
|
||||
|
||||
if($lastType !== null){
|
||||
array_pop($result[$lastType]);
|
||||
$result['keepRecent'] = true;
|
||||
}
|
||||
else if($reqSequence <= 0){
|
||||
$result['keepRecent'] = true;
|
||||
}
|
||||
|
||||
$result['sequence'] = $nextSequence;
|
||||
$result['nationID'] = $nationID;
|
||||
|
||||
+11
-4
@@ -49,7 +49,7 @@ $now = new \DateTime();
|
||||
$unlimited = new \DateTime('9999-12-31');
|
||||
|
||||
$db = DB::db();
|
||||
$me = $db->queryFirstRow('SELECT `no`,`name`,`nation`,`level`,`con`,`picture`,`imgsvr` FROM general WHERE `owner`=%i', $userID);
|
||||
$me = $db->queryFirstRow('SELECT `no`,`name`,`nation`,`level`,`con`,`picture`,`imgsvr`,penalty,permission FROM general WHERE `owner`=%i', $userID);
|
||||
|
||||
if(!$me){
|
||||
$session->logoutGame();
|
||||
@@ -70,7 +70,7 @@ if($con >= 2) {
|
||||
}
|
||||
|
||||
$me['icon'] = GetImageURL($me['imgsvr'], $me['picture']);
|
||||
|
||||
$permission = checkSecretPermission($me);
|
||||
$srcNation = getNationStaticInfo($me['nation']);
|
||||
|
||||
$src = new MessageTarget($me['no'], $me['name'], $srcNation['nation'], $srcNation['name'], $srcNation['color'], $me['icon']);
|
||||
@@ -99,19 +99,26 @@ if($mailbox == Message::MAILBOX_PUBLIC) {
|
||||
// 국가 메세지
|
||||
if($mailbox >= Message::MAILBOX_NATIONAL) {
|
||||
|
||||
if($me['level'] < 5){
|
||||
if($permission < 4){
|
||||
$destNationID = $me['nation'];
|
||||
}
|
||||
else{
|
||||
$destNationID = $mailbox - Message::MAILBOX_NATIONAL;
|
||||
}
|
||||
|
||||
if($destNationID == $me['nation']){
|
||||
$msgType = Message::MSGTYPE_NATIONAL;
|
||||
}
|
||||
else{
|
||||
$msgType = Message::MSGTYPE_DIPLOMACY;
|
||||
}
|
||||
|
||||
$destNation = getNationStaticInfo($destNationID);
|
||||
|
||||
$dest = new MessageTarget(0, '', $destNation['nation'], $destNation['name'], $destNation['color']);
|
||||
|
||||
$msg = new Message(
|
||||
Message::MSGTYPE_NATIONAL,
|
||||
$msgType,
|
||||
$src,
|
||||
$dest,
|
||||
$text,
|
||||
|
||||
+157
@@ -0,0 +1,157 @@
|
||||
|
||||
|
||||
function submitArticle(){
|
||||
var $article = $('#newArticle');
|
||||
var $title = $article.find('input.titleInput');
|
||||
var $text = $article.find('input.contentInput');
|
||||
var title = $.trim($title.val());
|
||||
var text = $.trim($text.val());
|
||||
|
||||
|
||||
if(!text && !title){
|
||||
return false;
|
||||
}
|
||||
|
||||
$title.val('');
|
||||
$text.val('');
|
||||
|
||||
$.post({
|
||||
url:'j_board_article_add.php',
|
||||
dataType:'json',
|
||||
data:{
|
||||
isSecret:isSecretBoard,
|
||||
title:title,
|
||||
text:text
|
||||
}
|
||||
}).then(function(data){
|
||||
if(!data){
|
||||
$title.val(title);
|
||||
$text.val(text);
|
||||
alert()
|
||||
return quickReject('글을 올리는데 실패했습니다.');
|
||||
}
|
||||
if(!data.result){
|
||||
$title.val(title);
|
||||
$text.val(text);
|
||||
return quickReject('글을 올리는데 실패했습니다. : '+data.reason);
|
||||
}
|
||||
|
||||
return loadArticles().done(drawArticles);
|
||||
|
||||
}, errUnknown)
|
||||
.fail(function(reason){
|
||||
alert(reason);
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function submitComment(){
|
||||
var $this = $(this);
|
||||
var $article = $this.parents('.article').eq(0);
|
||||
var articleNo = $article.data('no');
|
||||
var $text = $article.find('input.commentText');
|
||||
var text = $.trim($text.val());
|
||||
|
||||
if(!text){
|
||||
return false;
|
||||
}
|
||||
|
||||
$text.val('');
|
||||
|
||||
$.post({
|
||||
url:'j_board_comment_add.php',
|
||||
dataType:'json',
|
||||
data:{
|
||||
articleNo:articleNo,
|
||||
text:text
|
||||
}
|
||||
}).then(function(data){
|
||||
if(!data){
|
||||
$text.val(text);
|
||||
alert()
|
||||
return quickReject('댓글을 다는데 실패했습니다.');
|
||||
}
|
||||
if(!data.result){
|
||||
$text.val(text);
|
||||
return quickReject('댓글을 다는데 실패했습니다. : '+data.reason);
|
||||
}
|
||||
|
||||
return loadArticles().done(drawArticles);
|
||||
|
||||
}, errUnknown)
|
||||
.fail(function(reason){
|
||||
alert(reason);
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function drawArticle(articleObj){
|
||||
var $articleFrame = $('#articleTemplate > .articleFrame');
|
||||
var $commentFrame = $('#commentTemplate > .comment');
|
||||
|
||||
var $article = $articleFrame.clone();
|
||||
$article.addClass('articleObj')
|
||||
.data('no', articleObj.no)
|
||||
.data('author', articleObj.general_no);
|
||||
|
||||
$article.find('.author').text(articleObj.author);
|
||||
$article.find('.title').text(articleObj.title);
|
||||
$article.find('.date').text(articleObj.date);
|
||||
//$article.find('.text').text(articleObj.text);
|
||||
$article.find('.text').html(nl2br(escapeHtml(articleObj.text)));
|
||||
//TODO: 바꿀 것
|
||||
|
||||
var $articleComment = $article.find('ul.commentList');
|
||||
|
||||
$.each(articleObj.comment, function(commentObj){
|
||||
var $comment = $commentFrame.clone();
|
||||
$comment.find('.author').text(commentObj.author);
|
||||
//$comment.find('.text').text(commentObj.text);
|
||||
$comment.find('.text').html(nl2br(escapeHtml(commentObj.text)));
|
||||
$comment.find('.date').text(commentObj.date);
|
||||
$articleComment.append($comment);
|
||||
});
|
||||
|
||||
$('#board').append($article);
|
||||
}
|
||||
|
||||
function drawArticles(articlesObj){
|
||||
var deferred = $.Deferred();
|
||||
if(!articlesObj){
|
||||
return quickReject('받아오는데 실패했습니다.');
|
||||
}
|
||||
if(!articlesObj.result){
|
||||
return quickReject('에러가 발생했습니다. : '+articlesObj.reason);
|
||||
}
|
||||
|
||||
$('.articleObj').detach();//첫 버전이니까 일괄 삭제 일괄 로드
|
||||
$.each(articlesObj.articles, drawArticle);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function loadArticles(){
|
||||
return $.post({
|
||||
url:'j_board_get_articles.php',
|
||||
dataType:'json',
|
||||
data:{
|
||||
isSecret:isSecretBoard, //첫 버전이니까 전체 다 불러오자
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function(){
|
||||
|
||||
$('#submitArticle').click(submitArticle);
|
||||
$('.submitComment').click(submitComment);
|
||||
|
||||
loadArticles()
|
||||
.then(drawArticles, errUnknown)
|
||||
.fail(function(reason){
|
||||
alert(reason);
|
||||
});
|
||||
|
||||
});
|
||||
@@ -216,3 +216,26 @@ jQuery(function($){
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
function errUnknown(){
|
||||
alert('작업을 실패했습니다.');
|
||||
}
|
||||
|
||||
function quickReject(errMsg){
|
||||
if(errMsg === undefined){
|
||||
errMsg = '작업을 실패했습니다.';
|
||||
}
|
||||
var deferred = $.Deferred();
|
||||
deferred.reject(errMsg);
|
||||
return deferred.promise();
|
||||
}
|
||||
|
||||
function nl2br(text){
|
||||
return text.replace(/\n/g,"<br>");
|
||||
}
|
||||
/*
|
||||
function br2nl (text) {
|
||||
return text.replace(/<\s*\/?br\s*[\/]?>/gi, '\n');
|
||||
}
|
||||
*/
|
||||
@@ -0,0 +1,152 @@
|
||||
|
||||
|
||||
function submitLetter(){
|
||||
var $letter = $('#newLetter');
|
||||
var $brief = $letter.find('input.briefInput');
|
||||
var $detail = $letter.find('input.detailInput');
|
||||
var $prevNo = $letter.find('input.prevNo');
|
||||
var $destNation = $letter.find('input.destNation');
|
||||
var brief = $.trim($brief.val());
|
||||
var detail = $.trim($detail.val());
|
||||
var prevNo = parseInt($prevNo.val());
|
||||
var destNation = parseInt($destNation.val());
|
||||
|
||||
if(prevNo !== null && prevNo < 1){
|
||||
prevNo = null;
|
||||
}
|
||||
|
||||
|
||||
if(!brief){
|
||||
return false;
|
||||
}
|
||||
|
||||
$brief.val('');
|
||||
$detail.val('');
|
||||
|
||||
$.post({
|
||||
url:'j_diplomacy_send_letter.php',
|
||||
dataType:'json',
|
||||
data:{
|
||||
brief:brief,
|
||||
detail:detail,
|
||||
destNation:destNation,
|
||||
prevNo:prevNo
|
||||
}
|
||||
}).then(function(data){
|
||||
if(!data){
|
||||
$title.val(title);
|
||||
$text.val(text);
|
||||
alert()
|
||||
return quickReject('외교 서신을 보내는데 실패했습니다.');
|
||||
}
|
||||
if(!data.result){
|
||||
$title.val(title);
|
||||
$text.val(text);
|
||||
return quickReject('외교 서신을 보내는데 실패했습니다. : '+data.reason);
|
||||
}
|
||||
|
||||
return loadLetters().done(drawLetters);
|
||||
|
||||
}, errUnknown)
|
||||
.fail(function(reason){
|
||||
alert(reason);
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function repondLetter(isAgree){
|
||||
var $this = $(this);
|
||||
var $letter = $this.parents('.letter').eq(0);
|
||||
var letterNo = $letter.data('no');
|
||||
|
||||
$.post({
|
||||
url:'j_diplomacy_respond_letter.php',
|
||||
dataType:'json',
|
||||
data:{
|
||||
letterNo:letterNo,
|
||||
isAgree:isAgree,
|
||||
reason:'', //TODO: reason 받기
|
||||
}
|
||||
}).then(function(data){
|
||||
if(!data){
|
||||
$text.val(text);
|
||||
alert()
|
||||
return quickReject('응답을 실패했습니다.');
|
||||
}
|
||||
if(!data.result){
|
||||
$text.val(text);
|
||||
return quickReject('응답을 실패했습니다. : '+data.reason);
|
||||
}
|
||||
|
||||
return loadArticles().done(drawLetters);
|
||||
|
||||
}, errUnknown)
|
||||
.fail(function(reason){
|
||||
alert(reason);
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function drawLetter(letterObj){
|
||||
var $letterFrame = $('#letterTemplate > .letterFrame');
|
||||
|
||||
var $letter = $letterFrame.clone();
|
||||
$letter.addClass('letterObj')
|
||||
.data('no', letterObj.no)
|
||||
|
||||
//TODO: 국가명, 수뇌명 입력
|
||||
$letter.find('.date').text(letterObj.date);
|
||||
$letter.find('.letterNo').text('#'+letterObj.no);
|
||||
$letter.find('.srcNation').text(letterObj.aux[''])
|
||||
$letter.find('.brief').html(nl2br(escapeHtml(letterObj.brief)));
|
||||
$letter.find('.detail').html(nl2br(escapeHtml(letterObj.detail)));
|
||||
//TODO: 바꿀 것
|
||||
|
||||
$('#board').append($letter);
|
||||
}
|
||||
|
||||
function drawLetters(lettersObj){
|
||||
var deferred = $.Deferred();
|
||||
if(!lettersObj){
|
||||
return quickReject('받아오는데 실패했습니다.');
|
||||
}
|
||||
|
||||
//TODO: 국가 리스트 출력
|
||||
|
||||
if(!lettersObj.result){
|
||||
return quickReject('에러가 발생했습니다. : '+lettersObj.reason);
|
||||
}
|
||||
|
||||
$('.letterObj').detach();//첫 버전이니까 일괄 삭제 일괄 로드
|
||||
$.each(lettersObj.letters, drawLetter);
|
||||
return true;
|
||||
}
|
||||
|
||||
function loadLetters(){
|
||||
return $.post({
|
||||
url:'j_diplomacy_get_letters.php',
|
||||
dataType:'json', //첫 버전이니까 전체 다 불러오자
|
||||
data:{
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function(){
|
||||
|
||||
$('#submitLetter').click(submitLetter);
|
||||
$('.respondAgree').click(function(){
|
||||
return repondLetter(true);
|
||||
});
|
||||
$('.respondDisagree').click(function(){
|
||||
return repondLetter(false);
|
||||
});
|
||||
|
||||
loadLetters()
|
||||
.then(drawLetters, errUnknown)
|
||||
.fail(function(reason){
|
||||
alert(reason);
|
||||
});
|
||||
|
||||
});
|
||||
+25
-25
@@ -81,13 +81,13 @@ $(function() {
|
||||
|
||||
var $win = $('<div id="ext_win" style="padding:0;" title="관직 임명"><table style="padding:0;margin:0;" cellspacing="0" cellpadding="0" border="0"><tr><td width="700px" style="padding:0;"><iframe id="in_frame" src="map.php?type=1&graphic=1" width="700" height="520" frameborder="0" marginwidth="0" marginheight="0" topmargin="0" scrolling="no"></iframe></td>'+
|
||||
'<td width="305px" style="padding:0;vertical-align:top;height:520px;"><div style="height:520px;width:305px;overflow-y:scroll;overflow-x:hidden;">'+
|
||||
'<table id="inner_table"><thead><tr><th width="35">도시</th><th width="85">태수</th><th width="85">군사</th><th width="85">시중</th></tr></thead><tbody class="content">'+
|
||||
'<table id="inner_table"><thead><tr><th width="35">도시</th><th width="85">태수</th><th width="85">군사</th><th width="85">종사</th></tr></thead><tbody class="content">'+
|
||||
'</tbody></table></div></td></tr></table>'+
|
||||
'<form name="form1" id="fake_form"><span id="user_name"></span> : <select name="double" id="city_select"></select>'+
|
||||
'<div id="duty_radio" style="display:inline;">'+
|
||||
'<input type="radio" id="duty_type1" value="4" name="duty_radio"><label for="duty_type1">태수</label>'+
|
||||
'<input type="radio" id="duty_type2" value="3" name="duty_radio"><label for="duty_type2">군사</label>'+
|
||||
'<input type="radio" id="duty_type3" value="2" name="duty_radio"><label for="duty_type3">시중</label>'+
|
||||
'<input type="radio" id="duty_type3" value="2" name="duty_radio"><label for="duty_type3">종사</label>'+
|
||||
'</div></form></div>');
|
||||
$win.hide();
|
||||
|
||||
@@ -135,17 +135,17 @@ $(function() {
|
||||
|
||||
var p태수 = cityInfo.p태수 && currUser.p태수;
|
||||
var p군사 = cityInfo.p군사 && currUser.p군사;
|
||||
var p시중 = cityInfo.p시중 && currUser.p시중;
|
||||
var p종사 = cityInfo.p종사 && currUser.p종사;
|
||||
|
||||
//console.log(p태수,p군사,p시중);
|
||||
//console.log(p태수,p군사,p종사);
|
||||
|
||||
$('#duty_type1').button({disabled:!p태수});
|
||||
$('#duty_type2').button({disabled:!p군사});
|
||||
$('#duty_type3').button({disabled:!p시중});
|
||||
$('#duty_type3').button({disabled:!p종사});
|
||||
|
||||
var $태수 = cityInfo.$태수;
|
||||
var $군사 = cityInfo.$군사;
|
||||
var $시중 = cityInfo.$시중;
|
||||
var $종사 = cityInfo.$종사;
|
||||
|
||||
|
||||
|
||||
@@ -222,7 +222,7 @@ $(function() {
|
||||
|
||||
var p태수 = cityInfo.p태수 && currUser.p태수;
|
||||
var p군사 = cityInfo.p군사 && currUser.p군사;
|
||||
var p시중 = cityInfo.p시중 && currUser.p시중;
|
||||
var p종사 = cityInfo.p종사 && currUser.p종사;
|
||||
|
||||
var newInfo = {
|
||||
지역 : 지역,
|
||||
@@ -232,12 +232,12 @@ $(function() {
|
||||
city : cityInfo,
|
||||
p태수 : p태수,
|
||||
p군사 : p군사,
|
||||
p시중 : p시중
|
||||
p종사 : p종사
|
||||
};
|
||||
|
||||
//console.log(newInfo);
|
||||
|
||||
if(p태수 || p군사 || p시중){
|
||||
if(p태수 || p군사 || p종사){
|
||||
if(typeof subCityGroupList[지역] == 'undefined'){
|
||||
subCityGroupList[지역] = [];
|
||||
}
|
||||
@@ -296,11 +296,11 @@ $(function() {
|
||||
}).css('cursor','pointer');
|
||||
}
|
||||
|
||||
var $시중 = cityInfo.$시중.clone();
|
||||
$city.append($시중);
|
||||
if(!newInfo.p시중)$시중.css('color','red');
|
||||
var $종사 = cityInfo.$종사.clone();
|
||||
$city.append($종사);
|
||||
if(!newInfo.p종사)$종사.css('color','red');
|
||||
else{
|
||||
$시중.click(function(){
|
||||
$종사.click(function(){
|
||||
$('#duty_radio :radio:eq(2)').attr('checked','checked');
|
||||
$('#duty_radio :radio').button('refresh');
|
||||
}).css('cursor','pointer');
|
||||
@@ -389,22 +389,22 @@ $(function() {
|
||||
$.each(cityList,function(idx,cityInfo){
|
||||
cityInfo.p태수=false;
|
||||
cityInfo.p군사=false;
|
||||
cityInfo.p시중=false;
|
||||
cityInfo.p종사=false;
|
||||
});
|
||||
|
||||
$.each(userList,function(idx,userInfo){
|
||||
userInfo.p태수=false;
|
||||
userInfo.p군사=false;
|
||||
userInfo.p시중=false;
|
||||
userInfo.p종사=false;
|
||||
});
|
||||
|
||||
setUserAvailable($selects.eq(1).find("option"),"p태수");
|
||||
setUserAvailable($selects.eq(3).find("option"),"p군사");
|
||||
setUserAvailable($selects.eq(5).find("option"),"p시중");
|
||||
setUserAvailable($selects.eq(5).find("option"),"p종사");
|
||||
|
||||
setCityAvailiable($selects.eq(0).find("option"),"p태수");
|
||||
setCityAvailiable($selects.eq(2).find("option"),"p군사");
|
||||
setCityAvailiable($selects.eq(4).find("option"),"p시중");
|
||||
setCityAvailiable($selects.eq(4).find("option"),"p종사");
|
||||
|
||||
|
||||
$.each(cityList,function(idx,cityInfo){
|
||||
@@ -484,10 +484,10 @@ $(function() {
|
||||
|
||||
addBtn($name,cityInfo,userInfo,4,'태수');
|
||||
addBtn($name,cityInfo,userInfo,3,'군사');
|
||||
addBtn($name,cityInfo,userInfo,2,'시중');
|
||||
addBtn($name,cityInfo,userInfo,2,'종사');
|
||||
|
||||
//특수 버튼!
|
||||
if(userInfo.p태수||userInfo.p군사||userInfo.p시중){
|
||||
if(userInfo.p태수||userInfo.p군사||userInfo.p종사){
|
||||
var $btn = $('<button>...</button>');
|
||||
$btn.addClass('for_duty');
|
||||
if(userInfo.is수뇌){
|
||||
@@ -594,8 +594,8 @@ $(function() {
|
||||
if(cityList[cityName].$군사.text() == name){
|
||||
cityList[cityName].$군사.css('color','lightgreen');
|
||||
}
|
||||
if(cityList[cityName].$시중.text() == name){
|
||||
cityList[cityName].$시중.css('color','lightgreen');
|
||||
if(cityList[cityName].$종사.text() == name){
|
||||
cityList[cityName].$종사.css('color','lightgreen');
|
||||
}
|
||||
|
||||
userList[name]={
|
||||
@@ -606,7 +606,7 @@ $(function() {
|
||||
val:'-1',
|
||||
p태수:false,
|
||||
p군사:false,
|
||||
p시중:false,
|
||||
p종사:false,
|
||||
is수뇌:is수뇌
|
||||
};
|
||||
|
||||
@@ -680,7 +680,7 @@ $(function() {
|
||||
|
||||
cityInfo.p태수 = false;
|
||||
cityInfo.p군사 = false;
|
||||
cityInfo.p시중 = false;
|
||||
cityInfo.p종사 = false;
|
||||
|
||||
}
|
||||
|
||||
@@ -777,12 +777,12 @@ $(function() {
|
||||
|
||||
}
|
||||
|
||||
//태수,군사,시중
|
||||
//태수,군사,종사
|
||||
{
|
||||
var $baseTr = $this.find('tr:eq(2)');
|
||||
cityInfo.$태수 = $baseTr.find('td:eq(7)');
|
||||
cityInfo.$군사 = $baseTr.find('td:eq(9)');
|
||||
cityInfo.$시중 = $baseTr.find('td:eq(11)');
|
||||
cityInfo.$종사 = $baseTr.find('td:eq(11)');
|
||||
}
|
||||
|
||||
//기타
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"typeAcquisition": {
|
||||
"include": [
|
||||
"jquery"
|
||||
]
|
||||
}
|
||||
|
||||
}
|
||||
@@ -27,7 +27,6 @@ function refreshing(obj, arg1, arg2) {
|
||||
// if(term <= 0) {
|
||||
switch(arg1) {
|
||||
case 0: location.reload(); break;
|
||||
case 1: go(arg2); break;
|
||||
case 2: turn(arg2); break;
|
||||
case 3: arg2.submit(); break;
|
||||
case 4:
|
||||
@@ -44,27 +43,6 @@ function moveProcessing(commandtype, turn){
|
||||
$.redirect("processing.php",{ commandtype: commandtype, turn: turn}, 'post');
|
||||
}
|
||||
|
||||
function go(type) {
|
||||
if(type == 1) location.replace('b_nationboard.php');
|
||||
else if(type == 2) location.replace('b_troop.php');
|
||||
else if(type == 3) location.replace('b_nationrule.php');
|
||||
else if(type == 4) location.replace('b_chiefboard.php');
|
||||
else if(type == 5) location.replace('b_chiefcenter.php');
|
||||
else if(type == 6) window.open('b_genList.php');
|
||||
else if(type == 7) location.replace('b_myKingdomInfo.php');
|
||||
else if(type == 8) location.replace('b_myCityInfo.php');
|
||||
else if(type == 9) location.replace('b_myGenInfo.php');
|
||||
else if(type == 10) location.replace('b_myBossInfo.php');
|
||||
else if(type == 11) location.replace('b_currentCity.php');
|
||||
else if(type == 12) location.replace('b_myPage.php');
|
||||
else if(type == 13) location.replace('b_dipcenter.php');
|
||||
else if(type == 14) location.replace('b_diplomacy.php');
|
||||
else if(type == 15) window.open('b_tournament.php');
|
||||
else if(type == 16) window.open('b_betting.php');
|
||||
else if(type == 17) window.open('b_auction.php');
|
||||
else if(type == 18) window.open('b_battleCenter.php');
|
||||
}
|
||||
|
||||
function turn(type) {
|
||||
num = form2.sel.value;
|
||||
commandlist.location.replace('turn.php?type=' + type + '&sel=' + num);
|
||||
|
||||
+134
-26
@@ -23,9 +23,13 @@ function isBrightColor(color){
|
||||
var messageTemplate = '';
|
||||
var myGeneralID=null;
|
||||
var isChief = false;
|
||||
var sequence =null;
|
||||
var lastSequence = 0;
|
||||
var myNation = null;
|
||||
var lastMsg = null;
|
||||
var minMsgSeq = {
|
||||
'private':0x7fffffff,
|
||||
'public':0x7fffffff,
|
||||
'national':0x7fffffff,
|
||||
}
|
||||
|
||||
var generalList = {};
|
||||
|
||||
@@ -43,32 +47,93 @@ function responseMessage(msgID, response){
|
||||
}).then(refreshMsg);
|
||||
}
|
||||
|
||||
function deleteMessage(msgID){
|
||||
$.ajax({
|
||||
url: 'j_msg_delete.php',
|
||||
type: 'post',
|
||||
dataType:'json',
|
||||
data: {
|
||||
msgID:msgID
|
||||
}
|
||||
}).then(refreshMsg);
|
||||
}
|
||||
|
||||
function refreshMsg(result){
|
||||
if(result && !result.result){
|
||||
alert(result.reason);
|
||||
}
|
||||
return redrawMsg(fetchMsg());
|
||||
return redrawMsg(fetchRecentMsg(), true);
|
||||
}
|
||||
|
||||
function fetchMsg(){
|
||||
function fetchRecentMsg(){
|
||||
return $.ajax({
|
||||
url: 'j_msg_get_recent.php',
|
||||
type: 'post',
|
||||
dataType:'json',
|
||||
data: {
|
||||
sequence:sequence
|
||||
sequence:lastSequence
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function redrawMsg(deferred){
|
||||
function showOldMsg(msgType){
|
||||
var oldMsg = $.ajax({
|
||||
url: 'j_msg_get_old.php',
|
||||
type: 'post',
|
||||
dataType:'json',
|
||||
data: {
|
||||
to:minMsgSeq[msgType],
|
||||
type:msgType,
|
||||
}
|
||||
});
|
||||
redrawMsg(oldMsg, false);
|
||||
}
|
||||
|
||||
function redrawMsg(deferred, addFront){
|
||||
function checkErasable(obj){
|
||||
|
||||
var now = moment().format('YYYY-MM-DD HH:mm:ss');
|
||||
$('.btn-delete-msg').each(function(){
|
||||
var $btn = $(this);
|
||||
var eraseUntil = $btn.data('erase_until');
|
||||
if(eraseUntil < now){
|
||||
$btn.detach();
|
||||
}
|
||||
})
|
||||
return obj;
|
||||
}
|
||||
function checkClear(obj){
|
||||
if(!obj.result){
|
||||
var t = $.Deferred();
|
||||
t.reject();
|
||||
return t;
|
||||
}
|
||||
if(!obj.keepRecent){
|
||||
var t = $.Deferred();
|
||||
$('.msg_plate').detach();
|
||||
lastSequence = null;
|
||||
console.log('refresh!');
|
||||
redrawMsg(fetchRecentMsg(), true);
|
||||
t.reject();
|
||||
return t;
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
function registerSequence(obj){
|
||||
if(!obj.result){
|
||||
deferred.reject();
|
||||
return;
|
||||
var t = $.Deferred();
|
||||
t.reject();
|
||||
return t;
|
||||
}
|
||||
sequence = obj.sequence;
|
||||
lastSequence = Math.max(lastSequence, obj.sequence);
|
||||
$.each(['public', 'private', 'national', 'diplomacy'], function (_, msgType) {
|
||||
var msgList = obj[msgType];
|
||||
if(msgList === undefined || msgList.length == 0){
|
||||
return true;
|
||||
}
|
||||
var lastMsg = msgList[msgList.length - 1];
|
||||
minMsgSeq[msgType] = Math.min(minMsgSeq[msgType], lastMsg.id);
|
||||
});
|
||||
return obj;
|
||||
}
|
||||
|
||||
@@ -116,14 +181,10 @@ function redrawMsg(deferred){
|
||||
return true;
|
||||
}
|
||||
|
||||
if(msgType == 'diplomacy'){
|
||||
//외교는 항상 새로 그린다
|
||||
$msgBoard.empty();
|
||||
}
|
||||
|
||||
|
||||
var needRefreshLastContact = (msgType == 'private');
|
||||
|
||||
var now = moment().format('YYYY-MM-DD HH:mm:ss');
|
||||
//list의 맨 앞이 가장 최신 메시지임.
|
||||
var $msgs = msgSource.map(function(msg){
|
||||
|
||||
@@ -151,11 +212,20 @@ function redrawMsg(deferred){
|
||||
|
||||
msg.defaultIcon = pathConfig.sharedIcon+'/default.jpg';
|
||||
if(msgType == 'diplomacy'){
|
||||
msg.allowButton = myGeneralLevel>4;
|
||||
msg.allowButton = permissionLevel>=4;
|
||||
}
|
||||
else{
|
||||
msg.allowButton = true;
|
||||
}
|
||||
msg.myGeneralID = myGeneralID;
|
||||
msg.last5min = moment(msg.time).add(5, 'minute').format('YYYY-MM-DD HH:mm:ss');
|
||||
msg.now = now;
|
||||
if(msg.option && msg.option.invalid){
|
||||
msg.invalidType = 'msg_invalid';
|
||||
}
|
||||
else{
|
||||
msg.invalidType = 'msg_valid';
|
||||
}
|
||||
var msgHtml = TemplateEngine(messageTemplate, msg);
|
||||
|
||||
|
||||
@@ -169,11 +239,37 @@ function redrawMsg(deferred){
|
||||
$msg = $existMsg;
|
||||
}
|
||||
|
||||
if(msg.option && msg.option.parent){
|
||||
//parent는 삭제.
|
||||
$('#msg_{0}'.format(msg.option.parent)).detach();
|
||||
var hideMsg = false;
|
||||
if(msg.option){
|
||||
if(msg.option.delete !== undefined){
|
||||
//delete는 삭제.
|
||||
$('#msg_{0}'.format(msg.option.delete)).detach();
|
||||
}
|
||||
if(msg.option.overwrite !== undefined){
|
||||
//overwrite는 숨기기.
|
||||
$.map(msg.option.overwrite, function (overwriteID) {
|
||||
var $msg = $('#msg_{0}'.format(overwriteID));
|
||||
$msg.find('.btn-delete-msg').detach();
|
||||
$msg.find('.msg_content').html('삭제된 메시지입니다.').removeClass('msg_valid').addClass('msg_invalid');
|
||||
});
|
||||
|
||||
}
|
||||
if(msg.option.hide){
|
||||
hideMsg = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(hideMsg){
|
||||
return null;
|
||||
}
|
||||
|
||||
$msg.find('.btn-delete-msg').click(function(){
|
||||
if(!confirm("삭제하시겠습니까?")){
|
||||
return false;
|
||||
}
|
||||
deleteMessage(msg.id);
|
||||
});
|
||||
|
||||
$msg.find('button.prompt_yes').click(function(){
|
||||
if(!confirm("수락하시겠습니까?")){
|
||||
return false;
|
||||
@@ -198,12 +294,20 @@ function redrawMsg(deferred){
|
||||
|
||||
});
|
||||
|
||||
$msgBoard.prepend($msgs);
|
||||
if(addFront){
|
||||
$msgBoard.prepend($msgs);
|
||||
}
|
||||
else{
|
||||
$msgBoard.find('.load_old_message').before($msgs);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
deferred
|
||||
.then(checkErasable)
|
||||
.then(checkClear)
|
||||
.then(registerSequence)
|
||||
.then(refineMessageObjs)
|
||||
.then(printTemplate);
|
||||
@@ -316,7 +420,7 @@ function refreshMailboxList(obj){
|
||||
$favorite.append($lastContact);
|
||||
//TODO:운영자를 추가하는 코드도 넣을 것.
|
||||
|
||||
if(myGeneralLevel >= 5){
|
||||
if(permissionLevel >= 4){
|
||||
$.each(obj.nation, function(){
|
||||
var nation = this;
|
||||
//console.log(nation);
|
||||
@@ -353,12 +457,10 @@ function registerGlobal(basicInfo){
|
||||
'color':'#000000',
|
||||
'nation':'재야'
|
||||
};
|
||||
window.lastMsg = {
|
||||
id : basicInfo.lastContact
|
||||
};
|
||||
window.myGeneralID = basicInfo.generalID;
|
||||
window.isChief = basicInfo.isChief;
|
||||
window.myGeneralLevel = basicInfo.generalLevel;
|
||||
window.permissionLevel = basicInfo.permissionLevel;
|
||||
}
|
||||
|
||||
function activateMessageForm(){
|
||||
@@ -412,7 +514,7 @@ function activateMessageForm(){
|
||||
jQuery(function($){
|
||||
|
||||
//tmp_template.html은 추후 msg.js에 통합될 수 있음
|
||||
var getTemplate = $.get('js/templates/message.html?3',function(obj){
|
||||
var getTemplate = $.get('js/templates/message.html?9',function(obj){
|
||||
messageTemplate = obj;
|
||||
});
|
||||
|
||||
@@ -430,7 +532,7 @@ jQuery(function($){
|
||||
dataType:'json',
|
||||
});
|
||||
|
||||
var MessageList = fetchMsg();
|
||||
var MessageList = fetchRecentMsg();
|
||||
|
||||
senderList = $.when(senderList, basicInfo)
|
||||
.then(refreshMailboxList)
|
||||
@@ -438,6 +540,12 @@ jQuery(function($){
|
||||
|
||||
$.when(MessageList, getTemplate, basicInfo, senderList)
|
||||
.then(function(){
|
||||
redrawMsg(MessageList);
|
||||
redrawMsg(MessageList, true);
|
||||
}).then(function(){
|
||||
$('.load_old_message').click(function(){
|
||||
var $this = $(this);
|
||||
var msgType = $this.data('msg_type');
|
||||
showOldMsg(msgType);
|
||||
})
|
||||
});
|
||||
});
|
||||
@@ -12,6 +12,9 @@
|
||||
</div>
|
||||
<div class="msg_body">
|
||||
<div class="msg_header">
|
||||
<%if(!this.option && !this.option.action && src.id == myGeneralID && now <= last5min && invalidType == 'msg_valid'){%>
|
||||
<button type="button" data-erase_until="<%last5min%>" class="btn btn btn-outline-warning btn-sm btn-delete-msg" style='float:right'>❌</button>
|
||||
<%}%>
|
||||
<%if(msgType == 'private') {%>
|
||||
<%if(src.name == generalName){%>
|
||||
<span class="msg_target msg_<%src.colorType%>" style="background-color:<%src.color%>;">나</span
|
||||
@@ -37,9 +40,8 @@
|
||||
<span class="msg_target msg_<%src.colorType%>" style="background-color:<%src.color%>;"><%e(src.name)%>:<%src.nation%></span>
|
||||
<%} %>
|
||||
<span class="msg_time"><<%e(time)%>></span>
|
||||
</div>
|
||||
|
||||
<div class="msg_content"><%e(text)%></div>
|
||||
</div>
|
||||
<div class="msg_content <%invalidType%>"><%e(text)%></div>
|
||||
<%if(this.option && this.option.action) {%>
|
||||
<div class="msg_prompt">
|
||||
<button class="prompt_yes btn_prompt" <%allowButton?'':'disabled="disabled"'%>>>수락</button> <button class="prompt_no btn_prompt" <%allowButton?'':'disabled="disabled"'%>>거절</button>
|
||||
|
||||
+4
-4
@@ -663,7 +663,7 @@ function ConquerCity($admin, $general, $city, $nation, $destnation) {
|
||||
$renewFront = true;
|
||||
// 멸망이 아니면
|
||||
} else {
|
||||
// 태수,군사,시중은 일반으로...
|
||||
// 태수,군사,종사은 일반으로...
|
||||
$db->update('general',[
|
||||
'level'=>1
|
||||
], 'no IN %li',[$city['gen1'], $city['gen2'], $city['gen3']]);
|
||||
@@ -710,11 +710,11 @@ function ConquerCity($admin, $general, $city, $nation, $destnation) {
|
||||
$query = "update general set city='{$city['city']}' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
if($city['level'] > 3) {
|
||||
// 도시 소속 변경, 태수,군사,시중 초기화
|
||||
// 도시 소속 변경, 태수,군사,종사 초기화
|
||||
$query = "update city set supply=1,conflict='{}',term=0,agri=agri*0.7,comm=comm*0.7,secu=secu*0.7,def=1000,wall=1000,nation='{$general['nation']}',gen1=0,gen2=0,gen3=0 where city='{$city['city']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
} else {
|
||||
// 도시 소속 변경, 태수,군사,시중 초기화
|
||||
// 도시 소속 변경, 태수,군사,종사 초기화
|
||||
$query = "update city set supply=1,conflict='{}',term=0,agri=agri*0.7,comm=comm*0.7,secu=secu*0.7,def=def2/2,wall=wall2/2,nation='{$general['nation']}',gen1=0,gen2=0,gen3=0 where city='{$city['city']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
@@ -748,7 +748,7 @@ function ConquerCity($admin, $general, $city, $nation, $destnation) {
|
||||
$query['def'] = 1000;
|
||||
$query['wall'] = 1000;
|
||||
} else {
|
||||
// 도시 소속 변경, 태수,군사,시중 초기화
|
||||
// 도시 소속 변경, 태수,군사,종사 초기화
|
||||
$query['def'] = $db->sqleval('def2/2');
|
||||
$query['wall'] = $db->sqleval('wall2/2');
|
||||
}
|
||||
|
||||
@@ -1739,7 +1739,6 @@ function command_61($turn, $command) {
|
||||
타국에게 불가침을 제의합니다.<br>
|
||||
제의할 국가를 목록에서 선택하세요.<br>
|
||||
배경색은 현재 제의가 불가능한 국가는 <font color=red>붉은색</font>, 현재 불가침중인 국가는 <font color=blue>푸른색</font>으로 표시됩니다.<br>
|
||||
비고는 불가침시 세부 조건등을 지정하는 곳입니다.(최대 45자) <font color=magenta>※유저 편의를 위한 것일뿐 시스템적으로 보장하지는 않습니다.</font><br>
|
||||
<form name=form1 action=c_double.php method=post>
|
||||
대상 국가 <select name=double size=1 style=color:white;background-color:black>";
|
||||
|
||||
@@ -1796,7 +1795,6 @@ function command_61($turn, $command) {
|
||||
<option value=20>20</option>
|
||||
</select>
|
||||
년<br>
|
||||
비고 : <input type=text name=note size=45 maxlength=45 style=text-align:left;color:white;background-color:black>
|
||||
<input type=submit value=불가침>
|
||||
<input type=hidden name=command value=$command>";
|
||||
for($i=0; $i < count($turn); $i++) {
|
||||
|
||||
@@ -64,8 +64,10 @@ class DiplomaticMessage extends Message{
|
||||
return [self::INVALID, '송신자가 외교서신을 처리할 수 없습니다.'];
|
||||
}
|
||||
|
||||
if(!$general || $general['level'] < 5){
|
||||
return [self::INVALID, '해당 국가의 수뇌가 아닙니다.'];
|
||||
$permission = checkSecretPermission($general);
|
||||
|
||||
if(!$general || $permission < 4){
|
||||
return [self::INVALID, '해당 국가의 외교권자 아닙니다.'];
|
||||
}
|
||||
|
||||
return [self::ACCEPTED, ''];
|
||||
@@ -73,7 +75,6 @@ class DiplomaticMessage extends Message{
|
||||
|
||||
protected function noAggression(){
|
||||
$year = Util::array_get($this->msgOption['year']);
|
||||
$option = Util::array_get($this->msgOption['option'])??'';
|
||||
if($year < 1 || $year > 30){
|
||||
return [self::INVALID, '올바르지 않은 불가침 서신입니다.'];
|
||||
}
|
||||
@@ -81,7 +82,7 @@ class DiplomaticMessage extends Message{
|
||||
$this->diplomacyDetail = "{$year}년";
|
||||
|
||||
$helper = new Engine\Diplomacy($this->src->nationID, $this->dest->nationID);
|
||||
$chk = $helper->noAggression($year, $option);
|
||||
$chk = $helper->noAggression($year);
|
||||
if($chk[0] !== self::ACCEPTED){
|
||||
return $chk;
|
||||
}
|
||||
@@ -272,7 +273,7 @@ class DiplomaticMessage extends Message{
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
|
||||
$general = $db->queryFirstRow(
|
||||
'SELECT `name`, `level` FROM general WHERE `no`=%i AND nation=%i',
|
||||
'SELECT `name`, `level`, `permission`, `penalty` FROM general WHERE `no`=%i AND nation=%i',
|
||||
$receiverID,
|
||||
$this->dest->nationID
|
||||
);
|
||||
@@ -284,13 +285,6 @@ class DiplomaticMessage extends Message{
|
||||
|
||||
|
||||
list($result, $reason) = $this->checkDiplomaticMessageValidation($general);
|
||||
$db->update('diplomacy', [
|
||||
'reserved'=>'',
|
||||
'showing'=>null
|
||||
], '(me=%s AND you=%s) OR (you=%s AND me=%s)',
|
||||
$this->src->nationID, $this->dest->nationID,
|
||||
$this->src->nationID, $this->dest->nationID
|
||||
);
|
||||
if($result !== self::ACCEPTED){
|
||||
pushGenLog(['no'=>$receiverID], ["<C>●</>{$reason} {$this->diplomacyName} 실패."]);
|
||||
if($result === self::DECLINED){
|
||||
@@ -333,7 +327,6 @@ class DiplomaticMessage extends Message{
|
||||
$this->dest->generalID = $receiverID;
|
||||
$this->dest->generalName = $general['name'];
|
||||
$this->msgOption['used'] = true;
|
||||
$this->invalidate();
|
||||
$this->validDiplomacy = false;
|
||||
|
||||
$josaYi = JosaUtil::pick($this->src->nationName, '이');
|
||||
@@ -345,9 +338,11 @@ class DiplomaticMessage extends Message{
|
||||
new \DateTime(),
|
||||
new \DateTime('9999-12-31'),
|
||||
[
|
||||
'delete'=>$this->id
|
||||
'delete'=>$this->id,
|
||||
'silence'=>true,
|
||||
]
|
||||
);
|
||||
$this->invalidate();
|
||||
$newMsg->send();
|
||||
|
||||
return self::ACCEPTED;
|
||||
|
||||
@@ -273,7 +273,7 @@ class Diplomacy{
|
||||
return $prev;
|
||||
}
|
||||
|
||||
public function noAggression(int $when, string $option){
|
||||
public function noAggression(int $when){
|
||||
$chk = $this->checkValidNation();
|
||||
$chk = $this->checkNotWar($chk);
|
||||
$chk = $this->checkAlreadyMerging($chk);
|
||||
@@ -286,8 +286,7 @@ class Diplomacy{
|
||||
$db = DB::db();
|
||||
$db->update('diplomacy',[
|
||||
'state'=>7,
|
||||
'term'=>$when*12,
|
||||
'fixed'=>$option
|
||||
'term'=>$when*12
|
||||
],
|
||||
'(me=%i AND you=%i) OR (you=%i AND me=%i)',
|
||||
$this->srcNation['nation'], $this->destNation['nation'],
|
||||
@@ -308,8 +307,7 @@ class Diplomacy{
|
||||
$db = DB::db();
|
||||
$db->update('diplomacy',[
|
||||
'state'=>2,
|
||||
'term'=>0,
|
||||
'fixed'=>''
|
||||
'term'=>0
|
||||
],
|
||||
'(me=%i AND you=%i) OR (you=%i AND me=%i)',
|
||||
$this->srcNation['nation'], $this->destNation['nation'],
|
||||
@@ -330,8 +328,7 @@ class Diplomacy{
|
||||
$db = DB::db();
|
||||
$db->update('diplomacy',[
|
||||
'state'=>2,
|
||||
'term'=>0,
|
||||
'fixed'=>''
|
||||
'term'=>0
|
||||
],
|
||||
'(me=%i AND you=%i) OR (you=%i AND me=%i)',
|
||||
$this->srcNation['nation'], $this->destNation['nation'],
|
||||
@@ -356,16 +353,14 @@ class Diplomacy{
|
||||
$db = DB::db();
|
||||
$db->update('diplomacy',[
|
||||
'state'=>4,
|
||||
'term'=>24,
|
||||
'fixed'=>''
|
||||
'term'=>24
|
||||
],
|
||||
'me=%i AND you=%i',
|
||||
$this->srcNation['nation'], $this->destNation['nation']);
|
||||
|
||||
$db->update('diplomacy',[
|
||||
'state'=>3,
|
||||
'term'=>24,
|
||||
'fixed'=>''
|
||||
'term'=>24
|
||||
],
|
||||
'you=%i AND me=%i',
|
||||
$this->srcNation['nation'], $this->destNation['nation']);
|
||||
@@ -389,16 +384,14 @@ class Diplomacy{
|
||||
$db = DB::db();
|
||||
$db->update('diplomacy',[
|
||||
'state'=>6,
|
||||
'term'=>24,
|
||||
'fixed'=>''
|
||||
'term'=>24
|
||||
],
|
||||
'me=%i AND you=%i',
|
||||
$this->srcNation['nation'], $this->destNation['nation']);
|
||||
|
||||
$db->update('diplomacy',[
|
||||
'state'=>5,
|
||||
'term'=>24,
|
||||
'fixed'=>''
|
||||
'term'=>24
|
||||
],
|
||||
'you=%i AND me=%i',
|
||||
$this->srcNation['nation'], $this->destNation['nation']);
|
||||
|
||||
@@ -191,6 +191,8 @@ class Personnel{
|
||||
$setValues['killturn'] = $this->killturn;
|
||||
}
|
||||
|
||||
$setValues['permission'] = 'normal';
|
||||
|
||||
$db->update('general', $setValues, 'no=%i', $generalID);
|
||||
$db->update('general', $setSenderValues, 'no=%i', $this->senderID);
|
||||
$db->update('nation', $setOriginalNationValues, 'nation=%i', $general['nation']);
|
||||
|
||||
+126
-24
@@ -149,7 +149,7 @@ class Message
|
||||
];
|
||||
|
||||
$action = Util::array_get($option['action'], null);
|
||||
if ($msgType === self::MSGTYPE_DIPLOMACY) {
|
||||
if ($msgType === self::MSGTYPE_DIPLOMACY && $action !== null) {
|
||||
$objMessage = new DiplomaticMessage(...$args);
|
||||
} elseif ($action === 'scout') {
|
||||
$objMessage = new ScoutMessage(...$args);
|
||||
@@ -184,7 +184,7 @@ class Message
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function getMessageByID(int $messageID) : Message
|
||||
public static function getMessageByID(int $messageID) : ?Message
|
||||
{
|
||||
$db = DB::db();
|
||||
$now = new \DateTime();
|
||||
@@ -217,7 +217,7 @@ class Message
|
||||
$where->add('type = %s', $msgType);
|
||||
$where->add('valid_until > %s', $date);
|
||||
if ($fromSeq > 0) {
|
||||
$where->add('id > %i', $fromSeq);
|
||||
$where->add('id >= %i', $fromSeq);
|
||||
}
|
||||
|
||||
if ($limit > 0) {
|
||||
@@ -231,6 +231,95 @@ class Message
|
||||
}, $db->query('SELECT * FROM `message` WHERE %l ORDER BY id DESC %? ', $where, $limitSql));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $mailbox 메일 사서함.
|
||||
* @param string $msgType 메일 타입. MSGTYPE 중 하나.
|
||||
* @param int $toSeq 가져오고자 하는 위치. $toSeq보다 '작은' seq만 가져온다.
|
||||
* @param int $limit 가져오고자 하는 수.
|
||||
* @return Message[]
|
||||
*/
|
||||
public static function getMessagesFromMailBoxOld(int $mailbox, string $msgType, int $toSeq, int $limit = 20)
|
||||
{
|
||||
$db = DB::db();
|
||||
|
||||
if (!static::isValidMsgType($msgType)) {
|
||||
throw new \InvalidArgumentException('올바르지 않은 $msgType');
|
||||
}
|
||||
|
||||
$date = (new \DateTime())->format('Y-m-d H:i:s');
|
||||
|
||||
$where = new \WhereClause('and');
|
||||
$where->add('mailbox = %i', $mailbox);
|
||||
$where->add('type = %s', $msgType);
|
||||
$where->add('valid_until > %s', $date);
|
||||
$where->add('id < %i', $toSeq);
|
||||
|
||||
if ($limit > 0) {
|
||||
$limitSql = $db->sqleval('LIMIT %i', $limit);
|
||||
} else {
|
||||
$limitSql = new \MeekroDBEval('');
|
||||
}
|
||||
|
||||
return array_map(function ($row) {
|
||||
return static::buildFromArray($row);
|
||||
}, $db->query('SELECT * FROM `message` WHERE %l ORDER BY id DESC %? ', $where, $limitSql));
|
||||
}
|
||||
|
||||
public static function deleteMsg(int $msgID, int $generalID):?string{
|
||||
$msgObj = static::getMessageByID($msgID);
|
||||
if($msgObj=== null){
|
||||
return '메시지가 없습니다';
|
||||
}
|
||||
|
||||
if($msgObj->src->generalID != $generalID){
|
||||
return '본인의 메시지만 삭제할 수 있습니다.';
|
||||
}
|
||||
|
||||
if($msgObj->msgType == Message::MSGTYPE_DIPLOMACY){
|
||||
return '외교 메시지는 삭제할 수 없습니다.';
|
||||
}
|
||||
|
||||
$prev5min = new \DateTime();
|
||||
$prev5min->sub(new \DateInterval('PT5M'));
|
||||
|
||||
if($msgObj->date < $prev5min){
|
||||
return '5분 이내의 메시지만 삭제할 수 있습니다.';
|
||||
}
|
||||
|
||||
$msgOption = [
|
||||
'hide'=>true,
|
||||
'silence'=>true,
|
||||
'overwrite'=>[$msgObj->id]
|
||||
];
|
||||
|
||||
if($msgObj->msgType == Message::MSGTYPE_PRIVATE || $msgObj->msgType == Message::MSGTYPE_NATIONAL){
|
||||
$receiveID = $msgObj->msgOption['receiverMessageID']??null;
|
||||
if($receiveID !== null){
|
||||
$msgObj2 = static::getMessageByID($receiveID);
|
||||
if($msgObj2 !== null){
|
||||
$msgObj2->invalidate(null, false);
|
||||
$msgOption['overwrite'][] = [$msgObj2->id];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$in1min = new \DateTime();
|
||||
$in1min->add(new \DateInterval('PT1M'));
|
||||
$newMsg = new Message(
|
||||
$msgObj->msgType,
|
||||
$msgObj->src,
|
||||
$msgObj->dest,
|
||||
"req_del_msg",
|
||||
new \DateTime(),
|
||||
$in1min,
|
||||
$msgOption
|
||||
);
|
||||
$msgObj->invalidate(null, false);
|
||||
$newMsg->send(false);
|
||||
return null;
|
||||
}
|
||||
|
||||
protected function sendRaw(int $mailbox):array{
|
||||
//NOTE:: 여기선 검증하지 않는다.
|
||||
|
||||
@@ -268,7 +357,7 @@ class Message
|
||||
}
|
||||
|
||||
private function sendToSender():array{
|
||||
if($this->sendCnt > 0){
|
||||
if($this->sendCnt > 1){
|
||||
throw new \RuntimeException('이미 전송한 메일입니다.');
|
||||
}
|
||||
if($this->msgType === self::MSGTYPE_PRIVATE && $this->src->generalID !== $this->dest->generalID){
|
||||
@@ -281,15 +370,17 @@ class Message
|
||||
}
|
||||
|
||||
private function sendToReceiver() : array{
|
||||
if($this->sendCnt > 1 || $this->isInboxMail){
|
||||
if($this->sendCnt > 0 || $this->isInboxMail){
|
||||
throw new \RuntimeException('이미 전송한 메일입니다.');
|
||||
}
|
||||
|
||||
if($this->msgType === self::MSGTYPE_PRIVATE){
|
||||
//XXX: 알림을 이런식으로 보내는게 맞는가에 대한 의문 있음
|
||||
DB::db()->update('general', [
|
||||
'newmsg'=>1
|
||||
], 'no=%i',$this->dest->generalID);
|
||||
if(!($this->msgOption['silence']??false)){
|
||||
//XXX: 알림을 이런식으로 보내는게 맞는가에 대한 의문 있음
|
||||
DB::db()->update('general', [
|
||||
'newmsg'=>1
|
||||
], 'no=%i',$this->dest->generalID);
|
||||
}
|
||||
return $this->sendRaw($this->dest->generalID);
|
||||
}
|
||||
|
||||
@@ -305,18 +396,7 @@ class Message
|
||||
}
|
||||
|
||||
public function send(bool $sendDestOnly=false):int{
|
||||
if(!$sendDestOnly){
|
||||
list($senderMailbox, $sendID) = $this->sendToSender();
|
||||
if($sendID){
|
||||
$this->mailbox = $senderMailbox;
|
||||
$this->isInboxMail = false;
|
||||
$this->id = $sendID;
|
||||
$this->msgOption['senderMessageID'] = $sendID;
|
||||
$this->sendCnt = 1;
|
||||
}
|
||||
}
|
||||
|
||||
list($receiverMailbox, $receiveID) = $this->sendToReceiver();
|
||||
[$receiverMailbox, $receiveID] = $this->sendToReceiver();
|
||||
if(!$receiveID && !$sendDestOnly){
|
||||
return $sendID;
|
||||
}
|
||||
@@ -324,17 +404,39 @@ class Message
|
||||
$this->isInboxMail = true;
|
||||
$this->id = $receiveID;
|
||||
$this->msgOption['receiverMessageID'] = $receiveID;
|
||||
$this->sendCnt = 2;
|
||||
$this->sendCnt = 1;
|
||||
|
||||
if(!$sendDestOnly){
|
||||
[$senderMailbox, $sendID] = $this->sendToSender();
|
||||
if($sendID){
|
||||
$this->mailbox = $senderMailbox;
|
||||
$this->isInboxMail = false;
|
||||
$this->id = $sendID;
|
||||
$this->msgOption['senderMessageID'] = $sendID;
|
||||
$this->sendCnt = 2;
|
||||
}
|
||||
}
|
||||
|
||||
return $receiveID;
|
||||
}
|
||||
|
||||
public function invalidate(array $newMsgOption=null){
|
||||
public function invalidate(?array $newMsgOption=null, bool $hideMsg=true){
|
||||
if($newMsgOption !== null){
|
||||
$this->msgOption = $newMsgOption;
|
||||
}
|
||||
|
||||
$this->validUntil = new \DateTime('2000-12-31');
|
||||
$this->msgOption['invalid'] = true;
|
||||
|
||||
if($hideMsg){
|
||||
$this->validUntil = new \DateTime('2000-12-31');
|
||||
}
|
||||
else{
|
||||
if(key_exists('receiverMessageID', $this->msgOption)){
|
||||
$this->msgOption['originalText'] = $this->msg;
|
||||
}
|
||||
$this->msg = '삭제된 메시지입니다.';
|
||||
}
|
||||
|
||||
|
||||
$db = DB::db();
|
||||
$db->update('message', [
|
||||
|
||||
@@ -14,24 +14,24 @@
|
||||
"npcMax":95
|
||||
},
|
||||
"general":[
|
||||
[0, "아이유", null, 0, null, 90, 56, 100, 0, 160, 250, null, null],
|
||||
[0, "걸스데이민아", null, 0, null, 96, 52, 95, 0, 160, 250, null, null],
|
||||
[0, "구하라", null, 0, null, 95, 91, 57, 0, 160, 250, null, null],
|
||||
[0, "손나은", null, 0, null, 92, 54, 92, 0, 160, 250, null, null],
|
||||
[0, "윤아", null, 0, null, 94, 94, 62, 0, 160, 250, null, null],
|
||||
[0, "걸스데이소진", null, 0, null, 86, 94, 70, 0, 160, 250, null, null],
|
||||
[0, "수지", null, 0, null, 100, 58, 95, 0, 160, 250, null, null],
|
||||
[0, "정예인", null, 0, null, 90, 90, 65, 0, 160, 250, null, null],
|
||||
[0, "혜리", null, 0, null, 90, 68, 90, 0, 160, 250, null, null],
|
||||
[0, "은하", null, 0, null, 88, 69, 87, 0, 160, 250, null, null],
|
||||
[0, "슈", null, 0, null, 92, 54, 80, 0, 160, 250, null, null],
|
||||
[0, "소원", null, 0, null, 90, 85, 60, 0, 160, 250, null, null],
|
||||
[0, "보아", null, 0, null, 95, 99, 96, 0, 160, 250, null, null],
|
||||
[0, "김세정", null, 0, null, 100, 92, 100, 0, 160, 250, null, null],
|
||||
[0, "나라", null, 0, null, 94, 97, 65, 0, 160, 250, null, null],
|
||||
[0, "서지수", null, 0, null, 90, 89, 63, 0, 160, 250, null, null],
|
||||
[0, "양파", null, 0, null, 85, 54, 92, 0, 160, 250, null, null],
|
||||
[0, "앨리스", null, 0, null, 90, 90, 67, 0, 160, 250, null, null],
|
||||
[0, "아이유", null, 0, null, 90, 56, 100, 0, 160, 250, "의협", "집중"],
|
||||
[0, "걸스데이 민아", null, 0, null, 96, 52, 95, 0, 160, 250, "대의", "환술"],
|
||||
[0, "구하라", null, 0, null, 95, 91, 57, 0, 160, 250, "출세", "무쌍"],
|
||||
[0, "손나은", null, 0, null, 92, 54, 92, 0, 160, 250, "안전", "귀병"],
|
||||
[0, "윤아", null, 0, null, 94, 94, 62, 0, 160, 250, "출세", "위압"],
|
||||
[0, "걸스데이 소진", null, 0, null, 86, 94, 70, 0, 160, 250, "할거", "무쌍"],
|
||||
[0, "수지", null, 0, null, 100, 58, 95, 0, 160, 250, "정복", "신중"],
|
||||
[0, "정예인", null, 0, null, 90, 90, 65, 0, 160, 250, "패권", "위압"],
|
||||
[0, "혜리", null, 0, null, 90, 68, 90, 0, 160, 250, "유지", "환술"],
|
||||
[0, "은하", null, 0, null, 88, 69, 87, 0, 160, 250, "안전", "환술"],
|
||||
[0, "슈", null, 0, null, 92, 54, 80, 0, 160, 250, "패권", "신중"],
|
||||
[0, "소원", null, 0, null, 90, 85, 60, 0, 160, 250, "왕좌", "필살"],
|
||||
[0, "보아", null, 0, null, 95, 99, 96, 0, 160, 250, "왕좌", "위압"],
|
||||
[0, "김세정", null, 0, null, 100, 92, 100, 0, 160, 250, "의협", "집중"],
|
||||
[0, "나라", null, 0, null, 94, 97, 65, 0, 160, 250, "대의", "무쌍"],
|
||||
[0, "서지수", null, 0, null, 90, 89, 63, 0, 160, 250, "할거", "필살"],
|
||||
[0, "양파", null, 0, null, 85, 54, 92, 0, 160, 250, "대의", "환술"],
|
||||
[0, "앨리스", null, 0, null, 90, 90, 67, 0, 160, 250, "유지", "위압"],
|
||||
[0, "효린", null, 0, null, 40, 72, 97, 0, 160, 250, null, null],
|
||||
[0, "보라", null, 0, null, 82, 81, 68, 0, 160, 250, null, null],
|
||||
[0, "소유", null, 0, null, 70, 68, 81, 0, 160, 250, null, null],
|
||||
@@ -41,11 +41,11 @@
|
||||
[0, "은정", null, 0, null, 70, 60, 72, 0, 160, 250, null, null],
|
||||
[0, "큐리", null, 0, null, 70, 61, 58, 0, 160, 250, null, null],
|
||||
[0, "보람", null, 0, null, 72, 60, 60, 0, 160, 250, null, null],
|
||||
[0, "티아라소연", null, 0, null, 71, 58, 77, 0, 160, 250, null, null],
|
||||
[0, "티아라 소연", null, 0, null, 71, 58, 77, 0, 160, 250, null, null],
|
||||
[0, "라임", null, 0, null, 78, 70, 74, 0, 160, 250, null, null],
|
||||
[0, "유영", null, 0, null, 70, 53, 64, 0, 160, 250, null, null],
|
||||
[0, "서영", null, 0, null, 65, 67, 62, 0, 160, 250, null, null],
|
||||
[0, "헬비여름", null, 0, null, 63, 62, 63, 0, 160, 250, null, null],
|
||||
[0, "헬로비너스 여름", null, 0, null, 63, 62, 63, 0, 160, 250, null, null],
|
||||
[0, "남지현", null, 0, null, 80, 62, 74, 0, 160, 250, null, null],
|
||||
[0, "허가윤", null, 0, null, 70, 64, 82, 0, 160, 250, null, null],
|
||||
[0, "전지윤", null, 0, null, 69, 61, 69, 0, 160, 250, null, null],
|
||||
@@ -59,12 +59,12 @@
|
||||
[0, "한나", null, 0, null, 40, 43, 41, 0, 160, 250, null, null],
|
||||
[0, "김한별", null, 0, null, 60, 41, 57, 0, 160, 250, null, null],
|
||||
[0, "김한샘", null, 0, null, 31, 41, 40, 0, 160, 250, null, null],
|
||||
[0, "블랙핑크지수", null, 0, null, 83, 73, 80, 0, 160, 250, null, null],
|
||||
[0, "블랙핑크제니", null, 0, null, 84, 70, 82, 0, 160, 250, null, null],
|
||||
[0, "블랙핑크 지수", null, 0, null, 83, 73, 80, 0, 160, 250, null, null],
|
||||
[0, "블랙핑크 제니", null, 0, null, 84, 70, 82, 0, 160, 250, null, null],
|
||||
[0, "로제", null, 0, null, 80, 70, 87, 0, 160, 250, null, null],
|
||||
[0, "리사", null, 0, null, 80, 74, 84, 0, 160, 250, null, null],
|
||||
[0, "수민", null, 0, null, 66, 62, 72, 0, 160, 250, null, null],
|
||||
[0, "소나무민재", null, 0, null, 60, 61, 80, 0, 160, 250, null, null],
|
||||
[0, "소나무 민재", null, 0, null, 60, 61, 80, 0, 160, 250, null, null],
|
||||
[0, "디애나", null, 0, null, 68, 73, 64, 0, 160, 250, null, null],
|
||||
[0, "나현", null, 0, null, 71, 79, 57, 0, 160, 250, null, null],
|
||||
[0, "의진", null, 0, null, 76, 80, 61, 0, 160, 250, null, null],
|
||||
@@ -72,20 +72,20 @@
|
||||
[0, "뉴썬", null, 0, null, 60, 61, 59, 0, 160, 250, null, null],
|
||||
[0, "유라", null, 0, null, 80, 70, 61, 0, 160, 250, null, null],
|
||||
[0, "지민", null, 0, null, 69, 66, 72, 0, 160, 250, null, null],
|
||||
[0, "AOA유나", null, 0, null, 74, 54, 68, 0, 160, 250, null, null],
|
||||
[0, "AOA 유나", null, 0, null, 74, 54, 68, 0, 160, 250, null, null],
|
||||
[0, "혜정", null, 0, null, 74, 57, 65, 0, 160, 250, null, null],
|
||||
[0, "AOA민아", null, 0, null, 75, 62, 58, 0, 160, 250, null, null],
|
||||
[0, "AOA 민아", null, 0, null, 75, 62, 58, 0, 160, 250, null, null],
|
||||
[0, "설현", null, 0, null, 90, 78, 59, 0, 160, 250, null, null],
|
||||
[0, "찬미", null, 0, null, 68, 62, 60, 0, 160, 250, null, null],
|
||||
[0, "AOA초아", null, 0, null, 80, 58, 74, 0, 160, 250, null, null],
|
||||
[0, "AOA 초아", null, 0, null, 80, 58, 74, 0, 160, 250, null, null],
|
||||
[0, "솔빈", null, 0, null, 80, 66, 62, 0, 160, 250, null, null],
|
||||
[0, "해인", null, 0, null, 67, 63, 60, 0, 160, 250, null, null],
|
||||
[0, "라붐유정", null, 0, null, 66, 61, 71, 0, 160, 250, null, null],
|
||||
[0, "라붐소연", null, 0, null, 80, 58, 70, 0, 160, 250, null, null],
|
||||
[0, "라붐 유정", null, 0, null, 66, 61, 71, 0, 160, 250, null, null],
|
||||
[0, "라붐 소연", null, 0, null, 80, 58, 70, 0, 160, 250, null, null],
|
||||
[0, "지엔", null, 0, null, 61, 60, 62, 0, 160, 250, null, null],
|
||||
[0, "율희", null, 0, null, 60, 54, 60, 0, 160, 250, null, null],
|
||||
[0, "효정", null, 0, null, 78, 54, 59, 0, 160, 250, null, null],
|
||||
[0, "오마이걸미미", null, 0, null, 51, 57, 55, 0, 160, 250, null, null],
|
||||
[0, "오마이걸 미미", null, 0, null, 51, 57, 55, 0, 160, 250, null, null],
|
||||
[0, "유아", null, 0, null, 73, 81, 70, 0, 160, 250, null, null],
|
||||
[0, "승희", null, 0, null, 69, 76, 78, 0, 160, 250, null, null],
|
||||
[0, "지호", null, 0, null, 69, 67, 62, 0, 160, 250, null, null],
|
||||
@@ -104,8 +104,8 @@
|
||||
[0, "정윤혜", null, 0, null, 75, 59, 60, 0, 160, 250, null, null],
|
||||
[0, "조현영", null, 0, null, 79, 60, 63, 0, 160, 250, null, null],
|
||||
[0, "경리", null, 0, null, 80, 82, 64, 0, 160, 250, null, null],
|
||||
[0, "나뮤혜미", null, 0, null, 72, 67, 60, 0, 160, 250, null, null],
|
||||
[0, "나뮤소진", null, 0, null, 73, 63, 59, 0, 160, 250, null, null],
|
||||
[0, "나인뮤지스 혜미", null, 0, null, 72, 67, 60, 0, 160, 250, null, null],
|
||||
[0, "나인뮤지스 소진", null, 0, null, 73, 63, 59, 0, 160, 250, null, null],
|
||||
[0, "금조", null, 0, null, 70, 60, 54, 0, 160, 250, null, null],
|
||||
[0, "손성아", null, 0, null, 69, 63, 60, 0, 160, 250, null, null],
|
||||
[0, "박민하", null, 0, null, 90, 73, 57, 0, 160, 250, null, null],
|
||||
@@ -123,7 +123,7 @@
|
||||
[0, "모모", null, 0, null, 80, 88, 63, 0, 160, 250, null, null],
|
||||
[0, "사나", null, 0, null, 83, 83, 64, 0, 160, 250, null, null],
|
||||
[0, "지효", null, 0, null, 73, 63, 86, 0, 160, 250, null, null],
|
||||
[0, "트와이스미나", null, 0, null, 79, 87, 66, 0, 160, 250, null, null],
|
||||
[0, "트와이스 미나", null, 0, null, 79, 87, 66, 0, 160, 250, null, null],
|
||||
[0, "다현", null, 0, null, 78, 66, 68, 0, 160, 250, null, null],
|
||||
[0, "채영", null, 0, null, 70, 68, 67, 0, 160, 250, null, null],
|
||||
[0, "쯔위", null, 0, null, 100, 72, 61, 0, 160, 250, null, null],
|
||||
@@ -132,13 +132,13 @@
|
||||
[0, "미료", null, 0, null, 60, 57, 82, 0, 160, 250, null, null],
|
||||
[0, "가인", null, 0, null, 67, 77, 80, 0, 160, 250, null, null],
|
||||
[0, "하나", null, 0, null, 66, 62, 64, 0, 160, 250, null, null],
|
||||
[0, "구구단미미", null, 0, null, 69, 60, 63, 0, 160, 250, null, null],
|
||||
[0, "구구단나영", null, 0, null, 80, 62, 83, 0, 160, 250, null, null],
|
||||
[0, "구구단 미미", null, 0, null, 69, 60, 63, 0, 160, 250, null, null],
|
||||
[0, "구구단 나영", null, 0, null, 80, 62, 83, 0, 160, 250, null, null],
|
||||
[0, "해빈", null, 0, null, 70, 60, 86, 0, 160, 250, null, null],
|
||||
[0, "소이", null, 0, null, 66, 61, 64, 0, 160, 250, null, null],
|
||||
[0, "샐리", null, 0, null, 68, 66, 67, 0, 160, 250, null, null],
|
||||
[0, "구구단미나", null, 0, null, 80, 70, 63, 0, 160, 250, null, null],
|
||||
[0, "구구단혜연", null, 0, null, 63, 64, 66, 0, 160, 250, null, null],
|
||||
[0, "구구단 미나", null, 0, null, 80, 70, 63, 0, 160, 250, null, null],
|
||||
[0, "구구단 혜연", null, 0, null, 63, 64, 66, 0, 160, 250, null, null],
|
||||
[0, "최유정", null, 0, null, 70, 80, 67, 0, 160, 250, null, null],
|
||||
[0, "김도연", null, 0, null, 81, 81, 68, 0, 160, 250, null, null],
|
||||
[0, "지수연", null, 0, null, 64, 62, 74, 0, 160, 250, null, null],
|
||||
@@ -160,14 +160,14 @@
|
||||
[0, "은서", null, 0, null, 68, 63, 60, 0, 160, 250, null, null],
|
||||
[0, "다영", null, 0, null, 71, 60, 62, 0, 160, 250, null, null],
|
||||
[0, "다원", null, 0, null, 65, 60, 60, 0, 160, 250, null, null],
|
||||
[0, "우주소녀수빈", null, 0, null, 66, 61, 61, 0, 160, 250, null, null],
|
||||
[0, "우주소녀 수빈", null, 0, null, 66, 61, 61, 0, 160, 250, null, null],
|
||||
[0, "선의", null, 0, null, 70, 62, 59, 0, 160, 250, null, null],
|
||||
[0, "우주소녀여름", null, 0, null, 58, 60, 60, 0, 160, 250, null, null],
|
||||
[0, "우주소녀 여름", null, 0, null, 58, 60, 60, 0, 160, 250, null, null],
|
||||
[0, "미기", null, 0, null, 63, 63, 61, 0, 160, 250, null, null],
|
||||
[0, "루다", null, 0, null, 81, 67, 66, 0, 160, 250, null, null],
|
||||
[0, "연정", null, 0, null, 68, 58, 83, 0, 160, 250, null, null],
|
||||
[0, "윤채경", null, 0, null, 80, 64, 70, 0, 160, 250, null, null],
|
||||
[0, "김채원", null, 0, null, 67, 60, 63, 0, 160, 250, null, null],
|
||||
[0, "에이프릴 김채원", null, 0, null, 67, 60, 63, 0, 160, 250, null, null],
|
||||
[0, "양예나", null, 0, null, 70, 61, 68, 0, 160, 250, null, null],
|
||||
[0, "레이첼", null, 0, null, 68, 62, 62, 0, 160, 250, null, null],
|
||||
[0, "이진솔", null, 0, null, 69, 56, 70, 0, 160, 250, null, null],
|
||||
@@ -183,7 +183,7 @@
|
||||
[0, "가은", null, 0, null, 60, 59, 63, 0, 160, 250, null, null],
|
||||
[0, "가희", null, 0, null, 67, 90, 62, 0, 160, 250, null, null],
|
||||
[0, "전효성", null, 0, null, 88, 87, 84, 0, 160, 250, null, null],
|
||||
[0, "송가은", null, 0, null, 80, 68, 77, 0, 160, 250, null, null],
|
||||
[0, "송지은", null, 0, null, 80, 68, 77, 0, 160, 250, null, null],
|
||||
[0, "정하나", null, 0, null, 68, 63, 70, 0, 160, 250, null, null],
|
||||
[0, "한선화", null, 0, null, 79, 59, 71, 0, 160, 250, null, null],
|
||||
[0, "베이비소울", null, 0, null, 71, 60, 70, 0, 160, 250, null, null],
|
||||
@@ -207,7 +207,7 @@
|
||||
[0, "혜린", null, 0, null, 86, 60, 86, 0, 160, 250, null, null],
|
||||
[0, "유니스", null, 0, null, 75, 58, 73, 0, 160, 250, null, null],
|
||||
[0, "기희현", null, 0, null, 86, 66, 70, 0, 160, 250, null, null],
|
||||
[0, "다이아제니", null, 0, null, 71, 66, 68, 0, 160, 250, null, null],
|
||||
[0, "다이아 제니", null, 0, null, 71, 66, 68, 0, 160, 250, null, null],
|
||||
[0, "정채연", null, 0, null, 79, 63, 66, 0, 160, 250, null, null],
|
||||
[0, "은진", null, 0, null, 66, 67, 63, 0, 160, 250, null, null],
|
||||
[0, "예빈", null, 0, null, 68, 65, 67, 0, 160, 250, null, null],
|
||||
@@ -221,21 +221,21 @@
|
||||
[0, "세리", null, 0, null, 74, 73, 80, 0, 160, 250, null, null],
|
||||
[0, "아영", null, 0, null, 78, 76, 64, 0, 160, 250, null, null],
|
||||
[0, "우희", null, 0, null, 77, 77, 63, 0, 160, 250, null, null],
|
||||
[0, "달샤벳수빈", null, 0, null, 79, 74, 67, 0, 160, 250, null, null],
|
||||
[0, "달샤벳 수빈", null, 0, null, 79, 74, 67, 0, 160, 250, null, null],
|
||||
[0, "효은", null, 0, null, 72, 71, 69, 0, 160, 250, null, null],
|
||||
[0, "민희", null, 0, null, 69, 73, 66, 0, 160, 250, null, null],
|
||||
[0, "소영", null, 0, null, 64, 70, 65, 0, 160, 250, null, null],
|
||||
[0, "혜빈", null, 0, null, 62, 59, 66, 0, 160, 250, null, null],
|
||||
[0, "연우", null, 0, null, 76, 61, 63, 0, 160, 250, null, null],
|
||||
[0, "연우", null, 0, null, 82, 79, 63, 0, 160, 250, null, null],
|
||||
[0, "제인", null, 0, null, 72, 67, 61, 0, 160, 250, null, null],
|
||||
[0, "모모랜드태하", null, 0, null, 60, 60, 60, 0, 160, 250, null, null],
|
||||
[0, "모모랜드 태하", null, 0, null, 60, 64, 66, 0, 160, 250, null, null],
|
||||
[0, "나윤", null, 0, null, 62, 61, 63, 0, 160, 250, null, null],
|
||||
[0, "데이지", null, 0, null, 68, 63, 59, 0, 160, 250, null, null],
|
||||
[0, "데이지", null, 0, null, 68, 63, 68, 0, 160, 250, null, null],
|
||||
[0, "아인", null, 0, null, 72, 57, 69, 0, 160, 250, null, null],
|
||||
[0, "주이", null, 0, null, 40, 74, 56, 0, 160, 250, null, null],
|
||||
[0, "낸시", null, 0, null, 80, 69, 67, 0, 160, 250, null, null],
|
||||
[0, "낸시", null, 0, null, 86, 74, 67, 0, 160, 250, null, null],
|
||||
[0, "선예", null, 0, null, 80, 61, 78, 0, 160, 250, null, null],
|
||||
[0, "선미", null, 0, null, 80, 82, 70, 0, 160, 250, null, null],
|
||||
[0, "선미", null, 0, null, 80, 86, 70, 0, 160, 250, null, null],
|
||||
[0, "유빈", null, 0, null, 76, 69, 77, 0, 160, 250, null, null],
|
||||
[0, "혜림", null, 0, null, 69, 63, 67, 0, 160, 250, null, null],
|
||||
[0, "예은", null, 0, null, 70, 61, 80, 0, 160, 250, null, null],
|
||||
@@ -247,14 +247,14 @@
|
||||
[0, "재이", null, 0, null, 80, 70, 70, 0, 160, 250, null, null],
|
||||
[0, "린지", null, 0, null, 69, 68, 71, 0, 160, 250, null, null],
|
||||
[0, "예지", null, 0, null, 58, 63, 78, 0, 160, 250, null, null],
|
||||
[0, "피에스타혜미", null, 0, null, 66, 54, 59, 0, 160, 250, null, null],
|
||||
[0, "피에스타 혜미", null, 0, null, 66, 54, 59, 0, 160, 250, null, null],
|
||||
[0, "차오루", null, 0, null, 78, 73, 67, 0, 160, 250, null, null],
|
||||
[0, "민영", null, 0, null, 76, 72, 81, 0, 160, 250, null, null],
|
||||
[0, "브브걸유정", null, 0, null, 64, 73, 67, 0, 160, 250, null, null],
|
||||
[0, "브레이브걸스 유정", null, 0, null, 64, 73, 67, 0, 160, 250, null, null],
|
||||
[0, "은지", null, 0, null, 70, 73, 68, 0, 160, 250, null, null],
|
||||
[0, "브브걸유나", null, 0, null, 66, 76, 66, 0, 160, 250, null, null],
|
||||
[0, "브레브브걸스 유나", null, 0, null, 66, 76, 66, 0, 160, 250, null, null],
|
||||
[0, "하윤", null, 0, null, 71, 78, 69, 0, 160, 250, null, null],
|
||||
[0, "베리굿태하", null, 0, null, 78, 75, 78, 0, 160, 250, null, null],
|
||||
[0, "베리굿 태하", null, 0, null, 78, 75, 78, 0, 160, 250, null, null],
|
||||
[0, "조현", null, 0, null, 79, 78, 72, 0, 160, 250, null, null],
|
||||
[0, "서율", null, 0, null, 68, 63, 62, 0, 160, 250, null, null],
|
||||
[0, "다예", null, 0, null, 70, 62, 64, 0, 160, 250, null, null],
|
||||
@@ -267,7 +267,7 @@
|
||||
[0, "이희진", null, 0, null, 63, 54, 78, 0, 160, 250, null, null],
|
||||
[0, "유지", null, 0, null, 72, 59, 73, 0, 160, 250, null, null],
|
||||
[0, "다혜", null, 0, null, 70, 67, 63, 0, 160, 250, null, null],
|
||||
[0, "베스티혜연", null, 0, null, 64, 63, 70, 0, 160, 250, null, null],
|
||||
[0, "베스티 혜연", null, 0, null, 64, 63, 70, 0, 160, 250, null, null],
|
||||
[0, "해령", null, 0, null, 81, 70, 76, 0, 160, 250, null, null],
|
||||
[0, "김보아", null, 0, null, 69, 63, 86, 0, 160, 250, null, null],
|
||||
[0, "박시현", null, 0, null, 73, 62, 66, 0, 160, 250, null, null],
|
||||
@@ -291,7 +291,7 @@
|
||||
[0, "김예원", null, 0, null, 62, 57, 58, 0, 160, 250, null, null],
|
||||
[0, "서인영", null, 0, null, 73, 78, 68, 0, 160, 250, null, null],
|
||||
[0, "차희", null, 0, null, 71, 59, 80, 0, 160, 250, null, null],
|
||||
[0, "멜로디유민", null, 0, null, 79, 55, 78, 0, 160, 250, null, null],
|
||||
[0, "멜로디 유민", null, 0, null, 79, 55, 78, 0, 160, 250, null, null],
|
||||
[0, "예인", null, 0, null, 78, 63, 78, 0, 160, 250, null, null],
|
||||
[0, "여은", null, 0, null, 70, 57, 80, 0, 160, 250, null, null],
|
||||
[0, "오승희", null, 0, null, 73, 60, 69, 0, 160, 250, null, null],
|
||||
@@ -301,7 +301,7 @@
|
||||
[0, "장예은", null, 0, null, 70, 76, 66, 0, 160, 250, null, null],
|
||||
[0, "엘키", null, 0, null, 78, 71, 60, 0, 160, 250, null, null],
|
||||
[0, "권은빈", null, 0, null, 76, 73, 68, 0, 160, 250, null, null],
|
||||
[0, "프리스틴나영", null, 0, null, 73, 75, 70, 0, 160, 250, null, null],
|
||||
[0, "프리스틴 나영", null, 0, null, 73, 75, 70, 0, 160, 250, null, null],
|
||||
[0, "로아", null, 0, null, 68, 71, 61, 0, 160, 250, null, null],
|
||||
[0, "유하", null, 0, null, 70, 68, 65, 0, 160, 250, null, null],
|
||||
[0, "은우", null, 0, null, 72, 67, 63, 0, 160, 250, null, null],
|
||||
@@ -312,9 +312,9 @@
|
||||
[0, "시연", null, 0, null, 66, 62, 66, 0, 160, 250, null, null],
|
||||
[0, "카일라", null, 0, null, 60, 69, 60, 0, 160, 250, null, null],
|
||||
[0, "지유", null, 0, null, 72, 63, 66, 0, 160, 250, null, null],
|
||||
[0, "라니아혜미", null, 0, null, 66, 63, 61, 0, 160, 250, null, null],
|
||||
[0, "라니아 혜미", null, 0, null, 66, 63, 61, 0, 160, 250, null, null],
|
||||
[0, "지은", null, 0, null, 61, 60, 56, 0, 160, 250, null, null],
|
||||
[0, "라니아유민", null, 0, null, 68, 63, 66, 0, 160, 250, null, null],
|
||||
[0, "라니아 유민", null, 0, null, 68, 63, 66, 0, 160, 250, null, null],
|
||||
[0, "따보", null, 0, null, 58, 60, 57, 0, 160, 250, null, null],
|
||||
[0, "제니", null, 0, null, 62, 51, 81, 0, 160, 250, null, null],
|
||||
[0, "건지", null, 0, null, 72, 53, 84, 0, 160, 250, null, null],
|
||||
@@ -322,17 +322,17 @@
|
||||
[0, "나리", null, 0, null, 84, 86, 80, 0, 160, 250, null, null],
|
||||
[0, "지애", null, 0, null, 63, 81, 72, 0, 160, 250, null, null],
|
||||
[0, "우주", null, 0, null, 67, 86, 69, 0, 160, 250, null, null],
|
||||
[0, "와썹수진", null, 0, null, 64, 80, 73, 0, 160, 250, null, null],
|
||||
[0, "타히티민재", null, 0, null, 62, 63, 66, 0, 160, 250, null, null],
|
||||
[0, "와썹 수진", null, 0, null, 64, 80, 73, 0, 160, 250, null, null],
|
||||
[0, "타히티 민재", null, 0, null, 62, 63, 66, 0, 160, 250, null, null],
|
||||
[0, "미소", null, 0, null, 63, 60, 61, 0, 160, 250, null, null],
|
||||
[0, "타히티지수", null, 0, null, 61, 57, 67, 0, 160, 250, null, null],
|
||||
[0, "타히티 지수", null, 0, null, 61, 57, 67, 0, 160, 250, null, null],
|
||||
[0, "아리", null, 0, null, 72, 69, 64, 0, 160, 250, null, null],
|
||||
[0, "제리", null, 0, null, 66, 61, 68, 0, 160, 250, null, null],
|
||||
[0, "아유미", null, 0, null, 80, 68, 69, 0, 160, 250, null, null],
|
||||
[0, "혜승", null, 0, null, 68, 57, 71, 0, 160, 250, null, null],
|
||||
[0, "하린", null, 0, null, 70, 60, 66, 0, 160, 250, null, null],
|
||||
[0, "황정음", null, 0, null, 79, 55, 72, 0, 160, 250, null, null],
|
||||
[0, "슈가수진", null, 0, null, 83, 54, 63, 0, 160, 250, null, null],
|
||||
[0, "슈가 수진", null, 0, null, 83, 54, 63, 0, 160, 250, null, null],
|
||||
[0, "산다라박", null, 0, null, 80, 66, 64, 0, 160, 250, null, null],
|
||||
[0, "씨엘", null, 0, null, 40, 88, 77, 0, 160, 250, null, null],
|
||||
[0, "박봄", null, 0, null, 55, 60, 73, 0, 160, 250, null, null],
|
||||
@@ -351,14 +351,32 @@
|
||||
[0, "엘린", null, 0, null, 71, 61, 63, 0, 160, 250, null, null],
|
||||
[0, "소율", null, 0, null, 70, 66, 64, 0, 160, 250, null, null],
|
||||
[0, "금미", null, 0, null, 73, 63, 61, 0, 160, 250, null, null],
|
||||
[0, "크레용팝초아", null, 0, null, 72, 67, 65, 0, 160, 250, null, null],
|
||||
[0, "크레용팝 초아", null, 0, null, 72, 67, 65, 0, 160, 250, null, null],
|
||||
[0, "웨이", null, 0, null, 70, 65, 60, 0, 160, 250, null, null],
|
||||
[0, "쥬니엘", null, 0, null, 80, 46, 81, 0, 160, 250, null, null],
|
||||
[0, "이민", null, 0, null, 64, 50, 83, 0, 160, 250, null, null],
|
||||
[0, "크리스탈채", null, 0, null, 72, 51, 84, 0, 160, 250, null, null],
|
||||
[0, "윤미래", null, 0, null, 57, 80, 102, 0, 160, 250, null, null],
|
||||
[0, "애니", null, 0, null, 58, 92, 88, 0, 160, 250, null, null],
|
||||
[0, "NS윤지", null, 0, null, 86, 84, 78, 0, 160, 250, null, null]
|
||||
[0, "NS윤지", null, 0, null, 86, 84, 78, 0, 160, 250, null, null],
|
||||
[0, "미연", null, 0, null, 89, 69, 88, 0, 160, 250, null, null],
|
||||
[0, "민니", null, 0, null, 73, 59, 66, 0, 160, 250, null, null],
|
||||
[0, "여자아이들 수진", null, 0, null, 70, 66, 71, 0, 160, 250, null, null],
|
||||
[0, "여자아이들 소연", null, 0, null, 74, 81, 90, 0, 160, 250, null, null],
|
||||
[0, "우기", null, 0, null, 67, 70, 66, 0, 160, 250, null, null],
|
||||
[0, "슈화", null, 0, null, 71, 59, 78, 0, 160, 250, null, null],
|
||||
[0, "장원영", null, 0, null, 88, 79, 78, 0, 160, 250, null, null],
|
||||
[0, "미야와키 사쿠라", null, 0, null, 84, 69, 64, 0, 160, 250, null, null],
|
||||
[0, "조유리", null, 0, null, 81, 64, 87, 0, 160, 250, null, null],
|
||||
[0, "최예나", null, 0, null, 79, 74, 68, 0, 160, 250, null, null],
|
||||
[0, "안유진", null, 0, null, 78, 66, 70, 0, 160, 250, null, null],
|
||||
[0, "야부키 나코", null, 0, null, 75, 63, 82, 0, 160, 250, null, null],
|
||||
[0, "권은비", null, 0, null, 79, 77, 70, 0, 160, 250, null, null],
|
||||
[0, "강혜원", null, 0, null, 73, 70, 68, 0, 160, 250, null, null],
|
||||
[0, "혼다 히토미", null, 0, null, 70, 71, 70, 0, 160, 250, null, null],
|
||||
[0, "아이즈원 김채원", null, 0, null, 72, 65, 73, 0, 160, 250, null, null],
|
||||
[0, "김민주", null, 0, null, 80, 66, 74, 0, 160, 250, null, null],
|
||||
[0, "이채연", null, 0, null, 71, 87, 65, 0, 160, 250, null, null]
|
||||
],
|
||||
"general_ex":[
|
||||
],
|
||||
|
||||
@@ -4,6 +4,10 @@ DROP TABLE IF EXISTS general;
|
||||
# 국가 테이블 삭제
|
||||
DROP TABLE IF EXISTS nation;
|
||||
|
||||
# 회의실 테이블 삭제
|
||||
DROP TABLE IF EXISTS board;
|
||||
DROP TABLE IF EXISTS comment;
|
||||
|
||||
# 도시 테이블 삭제
|
||||
DROP TABLE IF EXISTS city;
|
||||
|
||||
@@ -21,6 +25,7 @@ DROP TABLE IF EXISTS message;
|
||||
|
||||
# 외교 테이블 삭제
|
||||
DROP TABLE IF EXISTS diplomacy;
|
||||
DROP TABLE IF EXISTS ng_diplomacy;
|
||||
|
||||
# 토너먼트 테이블 삭제
|
||||
DROP TABLE IF EXISTS tournament;
|
||||
|
||||
+51
-126
@@ -41,6 +41,7 @@ CREATE TABLE `general` (
|
||||
`dex30` INT(8) NULL DEFAULT '0',
|
||||
`dex40` INT(8) NULL DEFAULT '0',
|
||||
`level` INT(2) NULL DEFAULT '0',
|
||||
`permission` ENUM('normal','auditor','ambassador') NULL DEFAULT 'normal',
|
||||
`gold` INT(6) NULL DEFAULT '1000',
|
||||
`rice` INT(6) NULL DEFAULT '1000',
|
||||
`crew` INT(5) NULL DEFAULT '0',
|
||||
@@ -150,6 +151,7 @@ CREATE TABLE `general` (
|
||||
`turn23` VARCHAR(50) NULL DEFAULT '[0,0,0,0]',
|
||||
`recturn` VARCHAR(50) NULL DEFAULT '[0,0,0,0]',
|
||||
`resturn` VARCHAR(30) NULL DEFAULT '',
|
||||
`penalty` TEXT NULL DEFAULT '',
|
||||
PRIMARY KEY (`no`),
|
||||
INDEX `nation` (`nation`, `npc`),
|
||||
INDEX `city` (`city`),
|
||||
@@ -203,130 +205,7 @@ CREATE TABLE `nation` (
|
||||
`spy` CHAR(255) NOT NULL DEFAULT '{}',
|
||||
`level` INT(1) NULL DEFAULT '0',
|
||||
`type` INT(2) NULL DEFAULT '0',
|
||||
`rule` TEXT NULL DEFAULT '',
|
||||
`history` MEDIUMTEXT NULL DEFAULT '',
|
||||
`board0` TEXT NULL DEFAULT '',
|
||||
`board0_who` INT(6) NULL DEFAULT '0',
|
||||
`board0_when` DATETIME NULL DEFAULT NULL,
|
||||
`board1` TEXT NULL DEFAULT '',
|
||||
`board1_who` INT(6) NULL DEFAULT '0',
|
||||
`board1_when` DATETIME NULL DEFAULT NULL,
|
||||
`board2` TEXT NULL DEFAULT '',
|
||||
`board2_who` INT(6) NULL DEFAULT '0',
|
||||
`board2_when` DATETIME NULL DEFAULT NULL,
|
||||
`board3` TEXT NULL DEFAULT '',
|
||||
`board3_who` INT(6) NULL DEFAULT '0',
|
||||
`board3_when` DATETIME NULL DEFAULT NULL,
|
||||
`board4` TEXT NULL DEFAULT '',
|
||||
`board4_who` INT(6) NULL DEFAULT '0',
|
||||
`board4_when` DATETIME NULL DEFAULT NULL,
|
||||
`board5` TEXT NULL DEFAULT '',
|
||||
`board5_who` INT(6) NULL DEFAULT '0',
|
||||
`board5_when` DATETIME NULL DEFAULT NULL,
|
||||
`board6` TEXT NULL DEFAULT '',
|
||||
`board6_who` INT(6) NULL DEFAULT '0',
|
||||
`board6_when` DATETIME NULL DEFAULT NULL,
|
||||
`board7` TEXT NULL DEFAULT '',
|
||||
`board7_who` INT(6) NULL DEFAULT '0',
|
||||
`board7_when` DATETIME NULL DEFAULT NULL,
|
||||
`board8` TEXT NULL DEFAULT '',
|
||||
`board8_who` INT(6) NULL DEFAULT '0',
|
||||
`board8_when` DATETIME NULL DEFAULT NULL,
|
||||
`board9` TEXT NULL DEFAULT '',
|
||||
`board9_who` INT(6) NULL DEFAULT '0',
|
||||
`board9_when` DATETIME NULL DEFAULT NULL,
|
||||
`board10` TEXT NULL DEFAULT '',
|
||||
`board10_who` INT(6) NULL DEFAULT '0',
|
||||
`board10_when` DATETIME NULL DEFAULT NULL,
|
||||
`board11` TEXT NULL DEFAULT '',
|
||||
`board11_who` INT(6) NULL DEFAULT '0',
|
||||
`board11_when` DATETIME NULL DEFAULT NULL,
|
||||
`board12` TEXT NULL DEFAULT '',
|
||||
`board12_who` INT(6) NULL DEFAULT '0',
|
||||
`board12_when` DATETIME NULL DEFAULT NULL,
|
||||
`board13` TEXT NULL DEFAULT '',
|
||||
`board13_who` INT(6) NULL DEFAULT '0',
|
||||
`board13_when` DATETIME NULL DEFAULT NULL,
|
||||
`board14` TEXT NULL DEFAULT '',
|
||||
`board14_who` INT(6) NULL DEFAULT '0',
|
||||
`board14_when` DATETIME NULL DEFAULT NULL,
|
||||
`board15` TEXT NULL DEFAULT '',
|
||||
`board15_who` INT(6) NULL DEFAULT '0',
|
||||
`board15_when` DATETIME NULL DEFAULT NULL,
|
||||
`board16` TEXT NULL DEFAULT '',
|
||||
`board16_who` INT(6) NULL DEFAULT '0',
|
||||
`board16_when` DATETIME NULL DEFAULT NULL,
|
||||
`board17` TEXT NULL DEFAULT '',
|
||||
`board17_who` INT(6) NULL DEFAULT '0',
|
||||
`board17_when` DATETIME NULL DEFAULT NULL,
|
||||
`board18` TEXT NULL DEFAULT '',
|
||||
`board18_who` INT(6) NULL DEFAULT '0',
|
||||
`board18_when` DATETIME NULL DEFAULT NULL,
|
||||
`board19` TEXT NULL DEFAULT '',
|
||||
`board19_who` INT(6) NULL DEFAULT '0',
|
||||
`board19_when` DATETIME NULL DEFAULT NULL,
|
||||
`coreboard0` TEXT NULL DEFAULT '',
|
||||
`coreboard0_who` INT(6) NULL DEFAULT '0',
|
||||
`coreboard0_when` DATETIME NULL DEFAULT NULL,
|
||||
`coreboard1` TEXT NULL DEFAULT '',
|
||||
`coreboard1_who` INT(6) NULL DEFAULT '0',
|
||||
`coreboard1_when` DATETIME NULL DEFAULT NULL,
|
||||
`coreboard2` TEXT NULL DEFAULT '',
|
||||
`coreboard2_who` INT(6) NULL DEFAULT '0',
|
||||
`coreboard2_when` DATETIME NULL DEFAULT NULL,
|
||||
`coreboard3` TEXT NULL DEFAULT '',
|
||||
`coreboard3_who` INT(6) NULL DEFAULT '0',
|
||||
`coreboard3_when` DATETIME NULL DEFAULT NULL,
|
||||
`coreboard4` TEXT NULL DEFAULT '',
|
||||
`coreboard4_who` INT(6) NULL DEFAULT '0',
|
||||
`coreboard4_when` DATETIME NULL DEFAULT NULL,
|
||||
`coreboard5` TEXT NULL DEFAULT '',
|
||||
`coreboard5_who` INT(6) NULL DEFAULT '0',
|
||||
`coreboard5_when` DATETIME NULL DEFAULT NULL,
|
||||
`coreboard6` TEXT NULL DEFAULT '',
|
||||
`coreboard6_who` INT(6) NULL DEFAULT '0',
|
||||
`coreboard6_when` DATETIME NULL DEFAULT NULL,
|
||||
`coreboard7` TEXT NULL DEFAULT '',
|
||||
`coreboard7_who` INT(6) NULL DEFAULT '0',
|
||||
`coreboard7_when` DATETIME NULL DEFAULT NULL,
|
||||
`coreboard8` TEXT NULL DEFAULT '',
|
||||
`coreboard8_who` INT(6) NULL DEFAULT '0',
|
||||
`coreboard8_when` DATETIME NULL DEFAULT NULL,
|
||||
`coreboard9` TEXT NULL DEFAULT '',
|
||||
`coreboard9_who` INT(6) NULL DEFAULT '0',
|
||||
`coreboard9_when` DATETIME NULL DEFAULT NULL,
|
||||
`coreboard10` TEXT NULL DEFAULT '',
|
||||
`coreboard10_who` INT(6) NULL DEFAULT '0',
|
||||
`coreboard10_when` DATETIME NULL DEFAULT NULL,
|
||||
`coreboard11` TEXT NULL DEFAULT '',
|
||||
`coreboard11_who` INT(6) NULL DEFAULT '0',
|
||||
`coreboard11_when` DATETIME NULL DEFAULT NULL,
|
||||
`coreboard12` TEXT NULL DEFAULT '',
|
||||
`coreboard12_who` INT(6) NULL DEFAULT '0',
|
||||
`coreboard12_when` DATETIME NULL DEFAULT NULL,
|
||||
`coreboard13` TEXT NULL DEFAULT '',
|
||||
`coreboard13_who` INT(6) NULL DEFAULT '0',
|
||||
`coreboard13_when` DATETIME NULL DEFAULT NULL,
|
||||
`coreboard14` TEXT NULL DEFAULT '',
|
||||
`coreboard14_who` INT(6) NULL DEFAULT '0',
|
||||
`coreboard14_when` DATETIME NULL DEFAULT NULL,
|
||||
`coreboard15` TEXT NULL DEFAULT '',
|
||||
`coreboard15_who` INT(6) NULL DEFAULT '0',
|
||||
`coreboard15_when` DATETIME NULL DEFAULT NULL,
|
||||
`coreboard16` TEXT NULL DEFAULT '',
|
||||
`coreboard16_who` INT(6) NULL DEFAULT '0',
|
||||
`coreboard16_when` DATETIME NULL DEFAULT NULL,
|
||||
`coreboard17` TEXT NULL DEFAULT '',
|
||||
`coreboard17_who` INT(6) NULL DEFAULT '0',
|
||||
`coreboard17_when` DATETIME NULL DEFAULT NULL,
|
||||
`coreboard18` TEXT NULL DEFAULT '',
|
||||
`coreboard18_who` INT(6) NULL DEFAULT '0',
|
||||
`coreboard18_when` DATETIME NULL DEFAULT NULL,
|
||||
`coreboard19` TEXT NULL DEFAULT '',
|
||||
`coreboard19_who` INT(6) NULL DEFAULT '0',
|
||||
`coreboard19_when` DATETIME NULL DEFAULT NULL,
|
||||
`boardindex` INT(2) NULL DEFAULT '19',
|
||||
`coreindex` INT(2) NULL DEFAULT '19',
|
||||
`l12term` INT(4) NULL DEFAULT '0',
|
||||
`l11term` INT(4) NULL DEFAULT '0',
|
||||
`l10term` INT(4) NULL DEFAULT '0',
|
||||
@@ -436,6 +315,36 @@ CREATE TABLE `nation` (
|
||||
)
|
||||
ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
##회의실
|
||||
CREATE TABLE `board` (
|
||||
`no` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`nation_no` INT(11) NOT NULL,
|
||||
`is_secret` TINYINT(1) NOT NULL,
|
||||
`date` DATETIME NOT NULL,
|
||||
`general_no` INT(11) NOT NULL,
|
||||
`author` VARCHAR(32) NOT NULL,
|
||||
`title` TEXT NOT NULL,
|
||||
`text` TEXT NOT NULL,
|
||||
PRIMARY KEY (`no`),
|
||||
INDEX `nation_no` (`nation_no`, `is_secret`, `date`)
|
||||
)
|
||||
ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
CREATE TABLE `comment` (
|
||||
`no` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`nation_no` INT(11) NOT NULL,
|
||||
`is_secret` TINYINT(1) NOT NULL,
|
||||
`date` DATETIME NOT NULL,
|
||||
`document_no` INT(11) NOT NULL,
|
||||
`general_no` INT(11) NOT NULL,
|
||||
`author` VARCHAR(32) NOT NULL,
|
||||
`text` TEXT NOT NULL,
|
||||
PRIMARY KEY (`no`),
|
||||
INDEX `nation_no` (`nation_no`, `is_secret`, `date`),
|
||||
INDEX `document_no` (`document_no`, `date`)
|
||||
)
|
||||
ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
###########################################################################
|
||||
## 도시 테이블
|
||||
###########################################################################
|
||||
@@ -645,14 +554,30 @@ create table diplomacy (
|
||||
`state` INT(6) NULL DEFAULT '0',
|
||||
`term` INT(6) NULL DEFAULT '0',
|
||||
`dead` INT(8) NULL DEFAULT '0',
|
||||
`fixed` CHAR(128) NULL DEFAULT '',
|
||||
`reserved` CHAR(128) NULL DEFAULT '',
|
||||
`showing` DATETIME NULL DEFAULT NULL,
|
||||
|
||||
PRIMARY KEY (`no`),
|
||||
UNIQUE INDEX `me` (`me`, `you`)
|
||||
) ENGINE=INNODB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
CREATE TABLE `ng_diplomacy` (
|
||||
`no` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`src_nation_id` INT(11) NOT NULL,
|
||||
`dest_nation_id` INT(11) NOT NULL,
|
||||
`prev_no` INT(11) NULL DEFAULT NULL,
|
||||
`state` ENUM('proposed','activated','cancelled') NOT NULL DEFAULT 'proposed',
|
||||
`text_brief` TEXT NOT NULL,
|
||||
`text_detail` TEXT NOT NULL,
|
||||
`date` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`src_signer` INT(11) NOT NULL,
|
||||
`dest_signer` INT(11) NULL DEFAULT NULL,
|
||||
`aux` TEXT NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`no`),
|
||||
INDEX `by_nation_src` (`src_nation_id`, `dest_nation_id`, `state`, `date`),
|
||||
INDEX `by_nation_dest` (`dest_nation_id`, `src_nation_id`, `state`, `date`)
|
||||
)
|
||||
ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
###########################################################################
|
||||
## 토너먼트 테이블
|
||||
###########################################################################
|
||||
@@ -819,4 +744,4 @@ CREATE TABLE IF NOT EXISTS `storage` (
|
||||
UNIQUE INDEX `key` (`namespace`, `key`)
|
||||
)
|
||||
COLLATE='utf8mb4_general_ci'
|
||||
ENGINE=MyISAM
|
||||
ENGINE=MyISAM
|
||||
+110
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
|
||||
$isSecretBoard = Util::getReq('isSecret', 'bool', false);
|
||||
|
||||
//increaseRefresh("회의실", 1);
|
||||
|
||||
$me = $db->queryFirstRow('SELECT no, nation, level, permission, con, turntime, belong, penalty FROM general WHERE owner=%i', $userID);
|
||||
|
||||
|
||||
$con = checkLimit($me['con']);
|
||||
if ($con >= 2) {
|
||||
printLimitMsg($me['turntime']);
|
||||
exit();
|
||||
}
|
||||
|
||||
$permission = checkSecretPermission($me);
|
||||
if($permission < 0){
|
||||
echo '국가에 소속되어있지 않습니다.';
|
||||
die();
|
||||
}
|
||||
else if ($isSecretBoard && $permission < 2) {
|
||||
echo "권한이 부족합니다. 수뇌부가 아닙니다.";
|
||||
die();
|
||||
}
|
||||
|
||||
$boardName = $isSecretBoard?'회의실':'기밀실';
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title><?=UniqueConst::$serverName?>: <?=$boardName?></title>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<!--<?=WebUtil::printCSS('../e_lib/tui.editor/tui-editor.min.css')?>-->
|
||||
<!--<?=WebUtil::printCSS('../e_lib/tui.editor/tui-editor-contents.min.css')?>-->
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('../css/config.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<?=WebUtil::printCSS('css/board.css')?>
|
||||
<script>
|
||||
var isSecretBoard = <?=($isSecretBoard?'true':'false')?>; //
|
||||
</script>
|
||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<!--<?=WebUtil::printJS('../e_lib/tui.editor/tui-editor-Editor-all.min.js')?>-->
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printJS('js/board.js')?>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id='newArticle'>
|
||||
<div><span class='articleTitle'>제목</span><input class='titleInput' type='text' maxlength='250'></input></div>
|
||||
<div class='boardArticle'>
|
||||
<textarea class="contentInput" rows="10" cols="50"></textarea>
|
||||
</div>
|
||||
<button type='button' id='submitArticle'>등록</button>
|
||||
</div>
|
||||
|
||||
<div id="board">
|
||||
</div>
|
||||
|
||||
<template id='articleTemplate'>
|
||||
<div class='articleFrame'>
|
||||
<div><span class='articleTitle'></span></div>
|
||||
<div class='authorPlate'><span class='authorIcon'></span><span class='authorName'><span><span class='date'></span></div>
|
||||
<div class='boardArticle'>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class='commentFrame'>
|
||||
<ul class='commentList'>
|
||||
|
||||
</ul>
|
||||
<div>
|
||||
<input class='commentText' type='text' maxlength='250'></input>
|
||||
<button type='button' class='submitComment'>등록</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template id='commentTemplate'>
|
||||
<li class='comment'>
|
||||
<span class='author'></span>
|
||||
<span class='text'></span>
|
||||
<span class='date'></span>
|
||||
</li>
|
||||
</template>
|
||||
|
||||
<div style='width=1000px;' class='tb_layout bg0'>
|
||||
<?=backButton()?><br>
|
||||
<?=banner()?>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
|
||||
increaseRefresh("내무부", 1);
|
||||
|
||||
$me = $db->queryFirstRow('SELECT no, nation, level, permission, con, turntime, belong, penalty FROM general WHERE owner=%i', $userID);
|
||||
|
||||
|
||||
$con = checkLimit($me['con']);
|
||||
if ($con >= 2) {
|
||||
printLimitMsg($me['turntime']);
|
||||
exit();
|
||||
}
|
||||
|
||||
$permission = checkSecretPermission($me);
|
||||
if ($permission < 1) {
|
||||
echo "권한이 부족합니다. 수뇌부가 아니거나 사관년도가 부족합니다.";
|
||||
exit();
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title><?=UniqueConst::$serverName?>: 외교부</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||
<!--<?=WebUtil::printCSS('../e_lib/tui.editor/tui-editor.min.css')?>-->
|
||||
<!--<?=WebUtil::printCSS('../e_lib/tui.editor/tui-editor-contents.min.css')?>-->
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('../css/config.css')?>
|
||||
<?=WebUtil::printCSS('css/common.css')?>
|
||||
<?=WebUtil::printCSS('css/diplomacy.css')?>
|
||||
<script>
|
||||
var permissionLevel = <?=$permission?>; //
|
||||
</script>
|
||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
|
||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||
<!--<?=WebUtil::printJS('../e_lib/tui.editor/tui-editor-Editor-all.min.js')?>-->
|
||||
<?=WebUtil::printJS('js/common.js')?>
|
||||
<?=WebUtil::printJS('js/board.js')?>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<template id='diplomacyTemplate'>
|
||||
<div class='diplomacyFrame'>
|
||||
<div><span class='articleTitle'></span></div>
|
||||
<div class='authorPlate'><span class='authorIcon'></span><span class='authorName'><span><span class='date'></span></div>
|
||||
<div class='boardArticle'>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div style='width=1000px;' class='tb_layout bg0'>
|
||||
<?=backButton()?><br>
|
||||
<?=banner()?>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,14 +1,15 @@
|
||||
<div class='buttonPlate bg2'>
|
||||
<div>
|
||||
<a href='b_nationboard.php'><button class='commandButton' <?=$meLevel>=1?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>회 의 실</button></a>
|
||||
<a href='b_chiefboard.php'><button class='commandButton' <?=$meLevel>=5?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>기 밀 실</button></a>
|
||||
<a href='t_board.php'><button class='commandButton' <?=$meLevel>=1?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>회 의 실</button></a>
|
||||
<a href='t_board.php?isSecret=true'><button class='commandButton' <?=$meLevel>=5?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>기 밀 실</button></a>
|
||||
<a href='b_troop.php'><button class='commandButton' <?=($meLevel>=1&&$nationLevel>=1)?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>부대 편성</button></a>
|
||||
<a href='t_diplomacy.php'><button class='commandButton' <?=$meLevel>=1?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>외 교 부</button></a>
|
||||
<a href='b_myBossInfo.php'><button class='commandButton' <?=$meLevel>=1?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>인 사 부</button></a>
|
||||
<a href='b_dipcenter.php'><button class='commandButton' <?=$showSecret?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>내 무 부</button></a>
|
||||
<a href='b_chiefcenter.php'><button class='commandButton' <?=$showSecret?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>사 령 부</button></a>
|
||||
<a href='b_genList.php' target='_blank'><button class='commandButton' <?=$showSecret?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>암 행 부</button></a>
|
||||
<a href='b_tournament.php' target='_blank'><button class='commandButton' style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>토 너 먼 트</button></a>
|
||||
<a href='b_betting.php' target='_blank'><button class='commandButton' style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>베 팅 장</button></a>
|
||||
|
||||
|
||||
</div>
|
||||
<div>
|
||||
@@ -16,12 +17,12 @@
|
||||
<a href='b_myKingdomInfo.php'><button class='commandButton' <?=$meLevel>=1?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>세력 정보</button></a>
|
||||
<a href='b_myCityInfo.php'><button class='commandButton' <?=($meLevel>=1&&$nationLevel>=1)?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>세력 도시</button></a>
|
||||
<a href='b_myGenInfo.php'><button class='commandButton' <?=$meLevel>=1?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>세력 장수</button></a>
|
||||
<a href='b_nationrule.php'><button class='commandButton' <?=$meLevel>=1?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>국 법</button></a>
|
||||
<a href='b_diplomacy.php'><button class='commandButton' style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>중원 정보</button></a>
|
||||
<a href='b_currentCity.php'><button class='commandButton' style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>현재 도시</button></a>
|
||||
<a href='b_battleCenter.php' target='_blank'><button class='commandButton' <?=$showSecret?'':'disabled'?> style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>감 찰 부</button></a>
|
||||
<a href='b_myPage.php'><button class='commandButton' style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>내 정보 & 설정</button></a>
|
||||
<a href='b_auction.php' target='_blank'><button class='commandButton' style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>거 래 장</button></a>
|
||||
<a href='b_betting.php' target='_blank'><button class='commandButton' style='background-color:<?=$bgColor?>;color:<?=$fgColor?>;'>베 팅 장</button></a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
+8
-8
@@ -534,7 +534,7 @@ if ($category == 0) {
|
||||
<font class=bullet>☞</font> 군주와 참모의 작위와 이름<br>
|
||||
<font class=bullet>☞</font> 국가 총주민수와 총병사수<br>
|
||||
<font class=bullet>☞</font> 국가소유 자금과 병량<br>
|
||||
<font class=bullet>☞</font> 지급율 : 1월과 7월에 지급하는 봉록의 정도입니다.<br>
|
||||
<font class=bullet>☞</font> 지급률 : 1월과 7월에 지급하는 봉록의 정도입니다.<br>
|
||||
<font class=bullet>☞</font> 세율 : 1월과 7월에 백성들에게서 거두어 들이는 세금의 정도입니다.<br>
|
||||
<font class=bullet>☞</font> 속령 : 아국이 소유한 거점의 개수입니다.<br>
|
||||
<font class=bullet>☞</font> 장수 : 아국 소속의 장수수입니다.<br>
|
||||
@@ -551,7 +551,7 @@ if ($category == 0) {
|
||||
<font class=bullet>☞</font> 인사부 : 아국내의 각 직위를 볼 수 있습니다.<br>
|
||||
<font class=bullet>☞</font> 내무부 : 아국의 외교상황과 예산 정보 등을 볼 수 있습니다. 아국이 어디와 전쟁중인지 누구와 동맹인지, 가난한지 부유한지 알 수 있겠죠?<br>
|
||||
<font class=bullet>☞</font> 사령부 : 아국의 수뇌부들의 수뇌명령들을 볼 수 있습니다. 무슨 전략을 수행하는지, 자신이 어디로 발령되는지, 언제 포상을 받을지 확인할 수 있겠죠?<br>
|
||||
<font class=bullet>☞</font> 암행부 : 아국 장수들의 일제 실행정보와 병력정보등을 볼 수 있습니다. 시중 이상의 관직 또는 국가에 설정된 사관년도 이상 장수만 볼 수 있습니다.<br>
|
||||
<font class=bullet>☞</font> 암행부 : 아국 장수들의 일제 실행정보와 병력정보등을 볼 수 있습니다. 종사 이상의 관직 또는 국가에 설정된 사관년도 이상 장수만 볼 수 있습니다.<br>
|
||||
<font class=bullet>☞</font> 세력정보 : 아국의 간략 정보와 역사 등을 볼 수 있습니다.<br>
|
||||
<font class=bullet>☞</font> 세력도시 : 아국 소유의 거점들의 일제 정보를 볼 수 있습니다.<br>
|
||||
<font class=bullet>☞</font> 세력장수 : 아국 소속 장수들의 일제 저오를 볼 수 있습니다.<br>
|
||||
@@ -681,16 +681,16 @@ if ($category == 0) {
|
||||
<font class=bullet>☞</font> 세율이 낮으면 인구가 늘고 내정이 증가해요. 다만 거두어 들이는 자금이 적어요.<br>
|
||||
<font class=bullet>☞</font> 세율이 높으면 인구가 줄고 내정이 감소해요. 다만 거두어 들이는 자금이 늘어나요. 군주라면 세율을 적절히 잘 조절해야겠죠?<br>
|
||||
<br>
|
||||
<font class=title>지급율이 뭐지요?</font><br>
|
||||
<font class=bullet>☞</font> 지급율은 국가 수뇌부가 결정하는건데요. 100%일때 자기 자신의 제대로된 봉급을 받을 수 있어요.<br>
|
||||
<font class=title>지급률이 뭐지요?</font><br>
|
||||
<font class=bullet>☞</font> 지급률은 국가 수뇌부가 결정하는건데요. 100%일때 자기 자신의 제대로된 봉급을 받을 수 있어요.<br>
|
||||
<font class=bullet>☞</font> 예를 들어 200%로 정해져 있다면 보너스를 받아서 봉급의 2배를 받게 되는거죠!<br>
|
||||
<font class=bullet>☞</font> 군주라면 장수들의 사기진작과 충성을 위해 재정이 충분할때는 지급율을 높여야겠죠!<br>
|
||||
<font class=bullet>☞</font> 반대로 재정이 어렵다면 안타깝지만 국고를 유지하기 위해 지급율을 낮춰야 해요ㅠㅠ<br>
|
||||
<font class=bullet>☞</font> 군주라면 장수들의 사기진작과 충성을 위해 재정이 충분할때는 지급률을 높여야겠죠!<br>
|
||||
<font class=bullet>☞</font> 반대로 재정이 어렵다면 안타깝지만 국고를 유지하기 위해 지급률을 낮춰야 해요ㅠㅠ<br>
|
||||
<br>
|
||||
<font class=title>수지와 예산이 뭐지요?</font><br>
|
||||
<font class=bullet>☞</font> 예산은 국가정보나 사령부에 들어가면 볼 수 있어요. 우리나라의 총 수입과 지출을 나타내는것이 수지에요.<br>
|
||||
<font class=bullet>☞</font> 총 수입은 도시에서 거둬들이는 금이나 쌀의 양을 나타내구요, 총 지출은 장수들의 봉급으로 나가는 금이나 쌀의 양을 뜻해요.<br>
|
||||
<font class=bullet>☞</font> 예산이 +라면 장수들의 봉급을 주고도 남아서 국고로 쌓이게 되는 것이지요! 이럴땐 지급율을 늘려서 장수들에게 고루 나누어줄수도 있을거에요!<br>
|
||||
<font class=bullet>☞</font> 예산이 +라면 장수들의 봉급을 주고도 남아서 국고로 쌓이게 되는 것이지요! 이럴땐 지급률을 늘려서 장수들에게 고루 나누어줄수도 있을거에요!<br>
|
||||
<br>
|
||||
<font class=title>전쟁에 대해 알고 싶어요.</font><br>
|
||||
<font class=bullet>☞</font> 전쟁에 영향을 미치는 요소는 아주 많답니다. 1번의 전투는 총6~9페이즈로 이루어진답니다.<br>
|
||||
@@ -721,7 +721,7 @@ if ($category == 0) {
|
||||
<font class=bullet>☞</font> 이동: 인접 도시로 이동합니다.<br>
|
||||
<!--<font class=bullet>☞</font> 등용: 재야나 타국의 장수를 등용합니다. 서신은 개인메세지로 도착하며 상대 장수가 수락,거절을 하게 됩니다.<br>--> <!--xxx:등용장 일단 끔-->
|
||||
<font class=bullet>☞</font> 집합: 현재 도시로 부대원들을 집합합니다. 부대장만 가능합니다.<br>
|
||||
<font class=bullet>☞</font> 귀환: 태수, 군사, 시중인 경우 자신의 도시로 귀환합니다.<br>
|
||||
<font class=bullet>☞</font> 귀환: 태수, 군사, 종사인 경우 자신의 도시로 귀환합니다.<br>
|
||||
<font class=bullet>☞</font> 임관: 국가에 사관을 합니다. 대상 국가의 군주가 있는 장소로 바로 이동합니다. 재야만 가능합니다.<br>
|
||||
---------- 계 략 ----------<br>
|
||||
<font class=bullet>☞</font> 첩보: 어느 도시든지 첩보를 수행하여 정보를 얻을 수 있습니다. 거리가 먼 도시라면 정확한 정보를 얻을 수 없습니다.<br>
|
||||
|
||||
@@ -128,4 +128,17 @@ function getIconPath(imgsvr, picture){
|
||||
else{
|
||||
return pathConfig.root+'/d_pic/'+picture;
|
||||
}
|
||||
}
|
||||
|
||||
function errUnknown(){
|
||||
alert('작업을 실패했습니다.');
|
||||
}
|
||||
|
||||
function quickReject(errMsg){
|
||||
if(errMsg === undefined){
|
||||
errMsg = '작업을 실패했습니다.';
|
||||
}
|
||||
var deferred = $.Deferred();
|
||||
deferred.reject(errMsg);
|
||||
return deferred.promise();
|
||||
}
|
||||
Reference in New Issue
Block a user