$connect 박멸중.
This commit is contained in:
@@ -131,7 +131,6 @@ return [
|
|||||||
'hwe/_admin4_submit.php',
|
'hwe/_admin4_submit.php',
|
||||||
'hwe/_admin5.php',
|
'hwe/_admin5.php',
|
||||||
'hwe/_admin5_submit.php',
|
'hwe/_admin5_submit.php',
|
||||||
'hwe/_admin6.php',
|
|
||||||
'hwe/_admin7.php',
|
'hwe/_admin7.php',
|
||||||
'hwe/_admin8.php',
|
'hwe/_admin8.php',
|
||||||
'hwe/_admin_force_rehall.php',
|
'hwe/_admin_force_rehall.php',
|
||||||
|
|||||||
@@ -123,8 +123,10 @@ switch ($btn) {
|
|||||||
], 'no=%i', $general['no']);
|
], 'no=%i', $general['no']);
|
||||||
$specialWarName = buildGeneralSpecialWarClass($specialWar)->getName();
|
$specialWarName = buildGeneralSpecialWarClass($specialWar)->getName();
|
||||||
$josaUl = JosaUtil::pick($specialWarName, '을');
|
$josaUl = JosaUtil::pick($specialWarName, '을');
|
||||||
pushGeneralHistoryLog($general['no'], ["<C>●</>{$year}년 {$month}월:특기 【<b><C>{$specialWarName}</></b>】{$josaUl} 습득"]);
|
$logger = new ActionLogger($general['no'], 0, $year, $month);
|
||||||
pushGeneralActionLog($general['no'], ["<C>●</>특기 【<b><L>{$specialWarName}</></b>】{$josaUl} 익혔습니다!"]);
|
$logger->pushGeneralHistoryLog("특기 【<b><C>{$specialWarName}</></b>】{$josaUl} 습득");
|
||||||
|
$logger->pushGeneralActionLog("특기 【<b><L>{$specialWarName}</></b>】{$josaUl} 익혔습니다!",ActionLogger::PLAIN);
|
||||||
|
$logger->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|||||||
+24
-37
@@ -13,9 +13,23 @@ if ($session->userGrade < 5) {
|
|||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
$connect = $db->get();
|
|
||||||
|
|
||||||
$conlimit = $gameStor->conlimit;
|
$conlimit = $gameStor->conlimit;
|
||||||
|
|
||||||
|
$ipGroupList = Util::arrayGroupBy(
|
||||||
|
$db->query(
|
||||||
|
'SELECT name,ip,lastconnect,owner,block,substring_index(ip,".",3) as ip_c from general WHERE ip!="" and npc<2'
|
||||||
|
),
|
||||||
|
'ip_c'
|
||||||
|
);
|
||||||
|
|
||||||
|
function colorBlockedName($general){
|
||||||
|
if(!$general['blocked']){
|
||||||
|
return $general['name'];
|
||||||
|
}
|
||||||
|
return "<span style='color:magenta;'>{$general['name']}</span>";
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
@@ -92,42 +106,15 @@ $conlimit = $gameStor->conlimit;
|
|||||||
<td align=center width=180>최근로그인</td>
|
<td align=center width=180>최근로그인</td>
|
||||||
<td align=center width=129>IP</td>
|
<td align=center width=129>IP</td>
|
||||||
<td align=center width=100>ID</td>
|
<td align=center width=100>ID</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<?php foreach($ipGroupList as $ipGroupC=>$users): ?>
|
||||||
<?php
|
<tr>
|
||||||
$query = "select substring_index(ip,'.',3) as ip2 from general where ip!='' and npc<2 group by ip2 having count(*)>1";
|
<td><?=join('<br>',array_map('\sammo\colorBlockedName', $users))?></td>
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__ . MYDB_error($connect), "");
|
<td><?=join('<br>',array_column($users, 'lastconnect'))?></td>
|
||||||
$ipCount = MYDB_num_rows($result);
|
<td><?=join('<br>',array_column($users, 'ip'))?></td>
|
||||||
$genName = "";
|
<td><?=join('<br>',array_column($users, 'owner'))?></td>
|
||||||
$genDate = "";
|
</tr>
|
||||||
$genIP = "";
|
<?php endforeach; ?>
|
||||||
$genID = "";
|
|
||||||
for ($i = 0; $i < $ipCount; $i++) {
|
|
||||||
$ip = MYDB_fetch_array($result);
|
|
||||||
|
|
||||||
$query = "select name,ip,lastconnect,owner,block from general where ip like '{$ip['ip2']}%' and npc<2 order by ip";
|
|
||||||
$genResult = MYDB_query($query, $connect) or Error(__LINE__ . MYDB_error($connect), "");
|
|
||||||
$genCount = MYDB_num_rows($genResult);
|
|
||||||
for ($k = 0; $k < $genCount; $k++) {
|
|
||||||
$gen = MYDB_fetch_array($genResult);
|
|
||||||
if ($gen['block'] > 0) $genName .= "<font color=magenta>{$gen['name']}</font><br>";
|
|
||||||
else $genName .= $gen['name'] . "<br>";
|
|
||||||
$genDate .= $gen['lastconnect'] . "<br>";
|
|
||||||
$genIP .= $gen['ip'] . "<br>";
|
|
||||||
$genID .= $gen['owner'] . "<br>";
|
|
||||||
}
|
|
||||||
$genName .= "<br>";
|
|
||||||
$genDate .= "<br>";
|
|
||||||
$genIP .= "<br>";
|
|
||||||
$genID .= "<br>";
|
|
||||||
}
|
|
||||||
echo "
|
|
||||||
<td align=right>$genName</td>
|
|
||||||
<td>$genDate</td>
|
|
||||||
<td>$genIP</td>
|
|
||||||
<td>$genID</td>";
|
|
||||||
?>
|
|
||||||
</tr>
|
|
||||||
</table>
|
</table>
|
||||||
<?php
|
<?php
|
||||||
//NOTE: password의 md5 해시가 같은지 확인하는 방식으로는 앞으로 잡아낼 수 없다. 폐기
|
//NOTE: password의 md5 해시가 같은지 확인하는 방식으로는 앞으로 잡아낼 수 없다. 폐기
|
||||||
|
|||||||
-116
@@ -1,116 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace sammo;
|
|
||||||
|
|
||||||
include "lib.php";
|
|
||||||
include "func.php";
|
|
||||||
|
|
||||||
$type = Util::getPost('type', 'int', 0);
|
|
||||||
if ($type < 0 || $type > 4) {
|
|
||||||
$type = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
//로그인 검사
|
|
||||||
$session = Session::requireGameLogin()->setReadOnly();
|
|
||||||
|
|
||||||
if ($session->userGrade < 5) {
|
|
||||||
die(requireAdminPermissionHTML());
|
|
||||||
}
|
|
||||||
|
|
||||||
$db = DB::db();
|
|
||||||
$connect = $db->get();
|
|
||||||
|
|
||||||
$sel[$type] = "selected";
|
|
||||||
|
|
||||||
?>
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<title>접속정보</title>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
||||||
<meta name="viewport" content="width=1024" />
|
|
||||||
<?= 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><?= closeButton() ?></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<form name=form1 method=post>정렬순서 :
|
|
||||||
<select name=type size=1>
|
|
||||||
<option <?= $sel[0] ?? '' ?> value=0>접속률</option>
|
|
||||||
<option <?= $sel[1] ?? '' ?> value=1>총갱신</option>
|
|
||||||
<option <?= $sel[2] ?? '' ?> value=2>갱신/턴</option>
|
|
||||||
<option <?= $sel[3] ?? '' ?> value=3>총로그인</option>
|
|
||||||
<option <?= $sel[4] ?? '' ?> value=4>갱신/로그인</option>
|
|
||||||
</select>
|
|
||||||
<input type=submit value='정렬하기'></form>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<table align=center class='tb_layout bg0'>
|
|
||||||
<tr id=bg1>
|
|
||||||
<td align=center width=120>장수명</td>
|
|
||||||
<td align=center width=50>접속률</td>
|
|
||||||
<td align=center width=40>시작연령</td>
|
|
||||||
<td align=center width=40>연령</td>
|
|
||||||
<td align=center width=80>총갱신</td>
|
|
||||||
<td align=center width=80>갱신/턴</td>
|
|
||||||
<td align=center width=80>총로그인</td>
|
|
||||||
<td align=center width=100>갱신/로그인</td>
|
|
||||||
</tr>
|
|
||||||
<?php
|
|
||||||
switch ($type) {
|
|
||||||
case 0:
|
|
||||||
$query = "select name,connect,startage,age,refcnt,logcnt,refcnt/(age-startage+1)/12 as ref,refcnt/logcnt as log from general order by connect desc limit 0,30";
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
$query = "select name,connect,startage,age,refcnt,logcnt,refcnt/(age-startage+1)/12 as ref,refcnt/logcnt as log from general order by refcnt desc limit 0,30";
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
$query = "select name,connect,startage,age,refcnt,logcnt,refcnt/(age-startage+1)/12 as ref,refcnt/logcnt as log from general order by ref desc limit 0,30";
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
$query = "select name,connect,startage,age,refcnt,logcnt,refcnt/(age-startage+1)/12 as ref,refcnt/logcnt as log from general order by logcnt desc limit 0,30";
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
$query = "select name,connect,startage,age,refcnt,logcnt,refcnt/(age-startage+1)/12 as ref,refcnt/logcnt as log from general order by log desc limit 0,30";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__ . MYDB_error($connect), "");
|
|
||||||
$gencount = MYDB_num_rows($genresult);
|
|
||||||
|
|
||||||
for ($i = 0; $i < $gencount; $i++) {
|
|
||||||
$gen = MYDB_fetch_array($genresult);
|
|
||||||
echo "
|
|
||||||
<tr>
|
|
||||||
<td align=center>{$gen['name']}</td>
|
|
||||||
<td align=center>{$gen['connect']}</td>
|
|
||||||
<td align=center>{$gen['startage']}</td>
|
|
||||||
<td align=center>{$gen['age']}</td>
|
|
||||||
<td align=center>" . round($gen['refcnt'] / 2, 1) . "</td>
|
|
||||||
<td align=center>" . round($gen['ref'] / 2, 1) . "</td>
|
|
||||||
<td align=center>{$gen['logcnt']}</td>
|
|
||||||
<td align=center>" . round($gen['log'] / 2, 1) . "</td>
|
|
||||||
</tr>";
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
</table>
|
|
||||||
<table align=center width=1000 class='tb_layout bg0'>
|
|
||||||
<tr>
|
|
||||||
<td><?= closeButton() ?></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><?= banner() ?> </td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
||||||
+1
-8
@@ -16,7 +16,6 @@ if ($session->userGrade < 5) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$connect=$db->get();
|
|
||||||
|
|
||||||
if ($btn == '정렬하기') {
|
if ($btn == '정렬하기') {
|
||||||
$gen = 0;
|
$gen = 0;
|
||||||
@@ -65,13 +64,7 @@ foreach (getAllNationStaticInfo() as $nation) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$query = "select * from diplomacy where me < you order by state desc";
|
foreach($db->query('SELECT * from diplomacy where me < you order by state desc') as $dip){
|
||||||
|
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
|
||||||
$dipcount = MYDB_num_rows($result);
|
|
||||||
for ($i=0; $i < $dipcount; $i++) {
|
|
||||||
$dip = MYDB_fetch_array($result);
|
|
||||||
|
|
||||||
$me = $dip['me'];
|
$me = $dip['me'];
|
||||||
$you = $dip['you'];
|
$you = $dip['you'];
|
||||||
|
|
||||||
|
|||||||
+1
-3
@@ -17,9 +17,7 @@ $connect=$db->get();
|
|||||||
|
|
||||||
increaseRefresh("거래장", 2);
|
increaseRefresh("거래장", 2);
|
||||||
|
|
||||||
$query = "select no,special,con,turntime from general where owner='{$userID}'";
|
$me = $db->queryFirstRow('SELECT no,special,con,turntime from general where owner=%i', $userID);
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
|
||||||
$me = MYDB_fetch_array($result);
|
|
||||||
|
|
||||||
$con = checkLimit($me['con']);
|
$con = checkLimit($me['con']);
|
||||||
if ($con >= 2) {
|
if ($con >= 2) {
|
||||||
|
|||||||
+163
-148
@@ -4,16 +4,13 @@ namespace sammo;
|
|||||||
function registerAuction() {
|
function registerAuction() {
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
$connect=$db->get();
|
|
||||||
|
|
||||||
$admin = $gameStor->getValues(['startyear', 'year', 'month', 'turnterm']);
|
$admin = $gameStor->getValues(['startyear', 'year', 'month', 'turnterm']);
|
||||||
|
|
||||||
$unit = 60 * $admin['turnterm'];
|
$unit = 60 * $admin['turnterm'];
|
||||||
|
|
||||||
// 장수들 평금,평쌀
|
// 장수들 평금,평쌀
|
||||||
$query = "select avg(gold) as gold, avg(rice) as rice,max(gold) as maxgold from general where npc<2";
|
$general = $db->queryFirstRow('SELECT avg(gold) as gold, avg(rice) as rice,max(gold) as maxgold from general where npc<2');
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$general = MYDB_fetch_array($result);
|
|
||||||
|
|
||||||
if($general['gold'] < 1000) { $general['gold'] = 1000; }
|
if($general['gold'] < 1000) { $general['gold'] = 1000; }
|
||||||
if($general['gold'] > 20000) { $general['gold'] = 20000; }
|
if($general['gold'] > 20000) { $general['gold'] = 20000; }
|
||||||
@@ -23,7 +20,7 @@ function registerAuction() {
|
|||||||
$count = $db->queryFirstField('SELECT count(*) FROM auction WHERE type=0 AND no1=0');
|
$count = $db->queryFirstField('SELECT count(*) FROM auction WHERE type=0 AND no1=0');
|
||||||
$count += 5;
|
$count += 5;
|
||||||
// 판매건 등록
|
// 판매건 등록
|
||||||
if(rand()%$count == 0) {
|
if(Util::randBool(1/$count)) {
|
||||||
//평균 쌀의 5% ~ 25%
|
//평균 쌀의 5% ~ 25%
|
||||||
$mul = rand() % 5 + 1;
|
$mul = rand() % 5 + 1;
|
||||||
$amount = $general['rice'] / 20 * $mul;
|
$amount = $general['rice'] / 20 * $mul;
|
||||||
@@ -38,16 +35,24 @@ function registerAuction() {
|
|||||||
|
|
||||||
$term = 3 + rand() % 10;
|
$term = 3 + rand() % 10;
|
||||||
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit * $term);
|
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit * $term);
|
||||||
$query = "insert into auction (type, no1, name1, amount, cost, value, topv, expire) values (0, '0', 'ⓝ상인', '$amount', '$cost', '$cost', '$topv', '$date')";
|
$db->insert('auction', [
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
'type'=>0,
|
||||||
|
'no1'=>0,
|
||||||
|
'name1'=>'ⓝ상인',
|
||||||
|
'amount'=>$amount,
|
||||||
|
'cost'=>$cost,
|
||||||
|
'value'=>$cost,
|
||||||
|
'topv'=>$topv,
|
||||||
|
'expire'=>$date
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$count = $db->queryFirstField('SELECT count(*) FROM auction WHERE type=1 AND no1=0');
|
$count = $db->queryFirstField('SELECT count(*) FROM auction WHERE type=1 AND no1=0');
|
||||||
$count += 5;
|
$count += 5;
|
||||||
// 구매건 등록
|
// 구매건 등록
|
||||||
if(rand()%$count == 0) {
|
if(Util::randBool(1/$count)) {
|
||||||
//평균 쌀의 5% ~ 25%
|
//평균 쌀의 5% ~ 25%
|
||||||
$mul = rand() % 5 + 1;
|
$mul = Util::randRangeInt(1, 5);
|
||||||
$amount = $general['rice'] / 20 * $mul;
|
$amount = $general['rice'] / 20 * $mul;
|
||||||
$cost = $general['gold'] / 20 * 1.1 * $mul;
|
$cost = $general['gold'] / 20 * 1.1 * $mul;
|
||||||
$topv = $amount * 0.5;
|
$topv = $amount * 0.5;
|
||||||
@@ -58,36 +63,31 @@ function registerAuction() {
|
|||||||
$cost = Util::round($cost, -1);
|
$cost = Util::round($cost, -1);
|
||||||
$topv = Util::round($topv, -1);
|
$topv = Util::round($topv, -1);
|
||||||
|
|
||||||
$term = 3 + rand() % 10;
|
$term = Util::randRangeInt(3, 12);
|
||||||
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit * $term);
|
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit * $term);
|
||||||
$query = "insert into auction (type, no1, name1, amount, cost, value, topv, expire) values (1, '0', 'ⓝ상인', '$amount', '$cost', '$cost', '$topv', '$date')";
|
$db->insert('auction', [
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
'type'=>1,
|
||||||
|
'no1'=>0,
|
||||||
|
'name1'=>'ⓝ상인',
|
||||||
|
'amount'=>$amount,
|
||||||
|
'cost'=>$cost,
|
||||||
|
'value'=>$cost,
|
||||||
|
'topv'=>$topv,
|
||||||
|
'expire'=>$date
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function processAuction() {
|
function processAuction() {
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
$connect=$db->get();
|
|
||||||
|
|
||||||
$trader = [];
|
|
||||||
$traderLog = [];
|
|
||||||
$auctionLog = [];
|
|
||||||
$bidderLog = [];
|
|
||||||
$alllog = [];
|
|
||||||
$history = [];
|
|
||||||
|
|
||||||
$date = TimeUtil::now();
|
$date = TimeUtil::now();
|
||||||
|
[$year, $month] = $gameStor->getValuesAsArray(['year', 'month']);
|
||||||
|
|
||||||
$admin = $gameStor->getValues(['year', 'month']);
|
$admin = $gameStor->getValues(['year', 'month']);
|
||||||
|
|
||||||
$query = "select * from auction where expire<='$date'";
|
foreach($db->query('SELECT * from auction where expire<=%s', $date) as $auction){
|
||||||
$result2 = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$count2 = MYDB_num_rows($result2);
|
|
||||||
|
|
||||||
for($i=0; $i < $count2; $i++) {
|
|
||||||
$auction = MYDB_fetch_array($result2);
|
|
||||||
|
|
||||||
$josaYi1 = JosaUtil::pick($auction['name1'], '이');
|
$josaYi1 = JosaUtil::pick($auction['name1'], '이');
|
||||||
$josaYi2 = JosaUtil::pick($auction['name2'], '이');
|
$josaYi2 = JosaUtil::pick($auction['name2'], '이');
|
||||||
|
|
||||||
@@ -95,138 +95,153 @@ function processAuction() {
|
|||||||
if($auction['no2'] == 0) {
|
if($auction['no2'] == 0) {
|
||||||
// 상인건수가 아닌것만 출력
|
// 상인건수가 아닌것만 출력
|
||||||
if($auction['no1'] != 0) {
|
if($auction['no1'] != 0) {
|
||||||
$query = "select no from general where no='{$auction['no1']}'";
|
$traderID = $db->queryFirstField('SELECT no FROM general WHERE no=%i', $auction['no1']);
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$logger = new ActionLogger($traderID, 0, $year, $month);
|
||||||
$trader = MYDB_fetch_array($result);
|
$logger->pushGeneralActionLog("입찰자 부재로 {$auction['no']}번 거래 <M>유찰</>!", ActionLogger::EVENT_PLAIN);
|
||||||
|
$logger->flush();
|
||||||
|
|
||||||
$traderLog[0] = "<S>◆</>입찰자 부재로 {$auction['no']}번 거래 <M>유찰</>!";
|
$auctionLog = [];
|
||||||
if($auction['type'] == 0) {
|
if($auction['type'] == 0) {
|
||||||
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
||||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <span class='sell'>판매</span> <M>유찰</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 판매, 그러나 입찰자 부재";
|
$auctionLog[] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <span class='sell'>판매</span> <M>유찰</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 판매, 그러나 입찰자 부재";
|
||||||
} else {
|
} else {
|
||||||
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
||||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <S>구매</> <M>유찰</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 구매, 그러나 입찰자 부재";
|
$auctionLog[] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <S>구매</> <M>유찰</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 구매, 그러나 입찰자 부재";
|
||||||
}
|
}
|
||||||
pushGeneralActionLog($trader['no'], $traderLog);
|
|
||||||
pushAuctionLog($auctionLog);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if($auction['no1'] == 0) {
|
|
||||||
$trader['no'] = 0;
|
|
||||||
$trader['name'] = 'ⓝ상인';
|
|
||||||
$trader['gold'] = 99999;
|
|
||||||
$trader['rice'] = 99999;
|
|
||||||
} else {
|
|
||||||
$query = "select no,name,gold,rice from general where no='{$auction['no1']}'";
|
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$trader = MYDB_fetch_array($result);
|
|
||||||
}
|
|
||||||
|
|
||||||
$query = "select no,name,gold,rice from general where no='{$auction['no2']}'";
|
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$bidder = MYDB_fetch_array($result);
|
|
||||||
//판매거래
|
|
||||||
if($auction['type'] == 0) {
|
|
||||||
if($auction['amount'] > $trader['rice'] - 1000) {
|
|
||||||
$gold = Util::round($auction['value'] * 0.01);
|
|
||||||
$trader['gold'] -= $gold;
|
|
||||||
if($trader['gold'] < 0) $trader['gold'] = 0;
|
|
||||||
$query = "update general set gold='{$trader['gold']}' where no='{$auction['no1']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
|
|
||||||
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
|
||||||
$josaRo = JosaUtil::pick($auction['value'], '로');
|
|
||||||
$traderLog[0] = "<S>◆</>판매자의 군량 부족으로 {$auction['no']}번 거래 <M>유찰</>! 벌금 <C>{$gold}</>";
|
|
||||||
$bidderLog[0] = "<S>◆</>판매자의 군량 부족으로 {$auction['no']}번 거래 <M>유찰</>!";
|
|
||||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <span class='sell'>판매</span> <M>유찰</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 판매, <Y>{$auction['name2']}</>{$josaYi2} 금 <C>{$auction['value']}</>{$josaRo} 입찰, 그러나 판매자 군량부족, 벌금 <C>{$gold}</>";
|
|
||||||
} elseif($auction['value'] > $bidder['gold'] - 1000) {
|
|
||||||
$gold = Util::round($auction['value'] * 0.01);
|
|
||||||
$bidder['gold'] -= $gold;
|
|
||||||
if($bidder['gold'] < 0) $bidder['gold'] = 0;
|
|
||||||
$query = "update general set gold='{$bidder['gold']}' where no='{$auction['no2']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
|
|
||||||
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
|
||||||
$josaRo = JosaUtil::pick($auction['value'], '로');
|
|
||||||
$traderLog[0] = "<S>◆</>입찰자의 자금 부족으로 {$auction['no']}번 거래 <M>유찰</>!";
|
|
||||||
$bidderLog[0] = "<S>◆</>입찰자의 자금 부족으로 {$auction['no']}번 거래 <M>유찰</>! 벌금 <C>{$gold}</>";
|
|
||||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <span class='sell'>판매</span> <M>유찰</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 판매, <Y>{$auction['name2']}</>{$josaYi2} 금 <C>{$auction['value']}</>{$josaRo} 입찰, 그러나 입찰자 자금부족, 벌금 <C>{$gold}</>";
|
|
||||||
} else {
|
|
||||||
$josaUlGold = JosaUtil::pick($auction['value'], '을');
|
|
||||||
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
|
||||||
$josaRo = JosaUtil::pick($auction['value'], '로');
|
|
||||||
$traderLog[0] = "<S>◆</>{$auction['no']}번 거래 <C>성사</>로 쌀 <C>{$auction['amount']}</>{$josaUlRice} 판매, 금 <C>{$auction['value']}</>{$josaUlGold} 획득!";
|
|
||||||
$bidderLog[0] = "<S>◆</>{$auction['no']}번 거래 <C>성사</>로 금 <C>{$auction['value']}</>{$josaUlGold} 지불, 쌀 <C>{$auction['amount']}</>{$josaUlRice} 구입!";
|
|
||||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <span class='sell'>판매</span> <C>성사</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 판매, <Y>{$auction['name2']}</>{$josaYi2} 금 <C>{$auction['value']}</>{$josaRo} 구매";
|
|
||||||
if($auction['value'] >= $auction['amount'] * 2) {
|
|
||||||
$auctionLog[0] .= " <R>★ 최고가 거래 ★</>";
|
|
||||||
} elseif($auction['value'] >= $auction['topv']) {
|
|
||||||
$auctionLog[0] .= " <M>★ 즉시구매가 거래 ★</>";
|
|
||||||
} elseif($auction['value'] * 2 <= $auction['amount']) {
|
|
||||||
$auctionLog[0] .= " <R>★ 최저가 거래 ★</>";
|
|
||||||
}
|
|
||||||
$query = "update general set gold=gold+'{$auction['value']}',rice=rice-'{$auction['amount']}' where no='{$auction['no1']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$query = "update general set gold=gold-'{$auction['value']}',rice=rice+'{$auction['amount']}' where no='{$auction['no2']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
}
|
|
||||||
pushGeneralActionLog($trader['no'], $traderLog);
|
|
||||||
pushGeneralActionLog($bidder['no'], $bidderLog);
|
|
||||||
pushAuctionLog($auctionLog);
|
|
||||||
//구매거래
|
|
||||||
} else {
|
|
||||||
if($auction['amount'] > $bidder['rice'] - 1000) {
|
|
||||||
$gold = Util::round($auction['value'] * 0.01);
|
|
||||||
$bidder['gold'] -= $gold;
|
|
||||||
if($bidder['gold'] < 0) $bidder['gold'] = 0;
|
|
||||||
$query = "update general set gold='{$bidder['gold']}' where no='{$auction['no2']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
|
|
||||||
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
|
||||||
$josaRo = JosaUtil::pick($auction['value'], '로');
|
|
||||||
$traderLog[0] = "<S>◆</>입찰자의 군량 부족으로 {$auction['no']}번 거래 <M>유찰</>!";
|
|
||||||
$bidderLog[0] = "<S>◆</>입찰자의 군량 부족으로 {$auction['no']}번 거래 <M>유찰</>! 벌금 <C>{$gold}</>";
|
|
||||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <S>구매</> <M>유찰</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 구매, <Y>{$auction['name2']}</>{$josaYi2} 금 <C>{$auction['value']}</>{$josaRo} 입찰, 그러나 입찰자 군량부족, 벌금 <C>{$gold}</>";
|
|
||||||
} elseif($auction['value'] > $trader['gold'] - 1000) {
|
|
||||||
$gold = Util::round($auction['value'] * 0.01);
|
|
||||||
$trader['gold'] -= $gold;
|
|
||||||
if($trader['gold'] < 0) $trader['gold'] = 0;
|
|
||||||
$query = "update general set gold='{$trader['gold']}' where no='{$auction['no1']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
|
|
||||||
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
|
||||||
$josaRo = JosaUtil::pick($auction['value'], '로');
|
|
||||||
$traderLog[0] = "<S>◆</>구매자의 자금 부족으로 {$auction['no']}번 거래 <M>유찰</>! 벌금 <C>{$gold}</>";
|
|
||||||
$bidderLog[0] = "<S>◆</>구매자의 자금 부족으로 {$auction['no']}번 거래 <M>유찰</>!";
|
|
||||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <S>구매</> <M>유찰</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 구매, <Y>{$auction['name2']}</>{$josaYi2} 금 <C>{$auction['value']}</>{$josaRo} 입찰, 그러나 구매자 자금부족, 벌금 <C>{$gold}</>";
|
|
||||||
} else {
|
|
||||||
$josaUlGold = JosaUtil::pick($auction['value'], '을');
|
|
||||||
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
|
||||||
$josaRo = JosaUtil::pick($auction['value'], '로');
|
|
||||||
$traderLog[0] = "<S>◆</>{$auction['no']}번 거래 <C>성사</>로 금 <C>{$auction['value']}</>{$josaUlGold} 지불, 쌀 <C>{$auction['amount']}</>{$josaUlRice} 구입!";
|
|
||||||
$bidderLog[0] = "<S>◆</>{$auction['no']}번 거래 <C>성사</>로 쌀 <C>{$auction['amount']}</>{$josaUlRice} 판매, 금 <C>{$auction['value']}</>{$josaUlGold} 획득!";
|
|
||||||
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <S>구매</> <C>성사</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 구매, <Y>{$auction['name2']}</>{$josaYi2} 금 <C>{$auction['value']}</>{$josaRo} 판매";
|
|
||||||
if($auction['value'] >= $auction['amount'] * 2) {
|
|
||||||
$auctionLog[0] .= " <R>★ 최고가 거래 ★</>";
|
|
||||||
} elseif($auction['value'] * 2 <= $auction['amount']) {
|
|
||||||
$auctionLog[0] .= " <R>★ 최저가 거래 ★</>";
|
|
||||||
} elseif($auction['value'] <= $auction['topv']) {
|
|
||||||
$auctionLog[0] .= " <M>★ 즉시구매가 거래 ★</>";
|
|
||||||
}
|
|
||||||
|
|
||||||
$query = "update general set gold=gold-'{$auction['value']}',rice=rice+'{$auction['amount']}' where no='{$auction['no1']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$query = "update general set gold=gold+'{$auction['value']}',rice=rice-'{$auction['amount']}' where no='{$auction['no2']}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
}
|
|
||||||
pushGeneralActionLog($trader['no'], $traderLog);
|
|
||||||
pushGeneralActionLog($bidder['no'], $bidderLog);
|
|
||||||
pushAuctionLog($auctionLog);
|
pushAuctionLog($auctionLog);
|
||||||
}
|
}
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($auction['no1'] == 0) {
|
||||||
|
$trader = [
|
||||||
|
'no'=>0,
|
||||||
|
'name'=>'ⓝ상인',
|
||||||
|
'gold'=>99999,
|
||||||
|
'rice'=>99999
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
$trader = $db->queryFirstRow('SELECT no,name,gold,rice from general where no=%i', $auction['no1']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$bidder = $db->queryFirstRow('SELECT no,name,gold,rice from general where no=%i', $auction['no2']);
|
||||||
|
|
||||||
|
$traderLogger = new ActionLogger($trader['no'], 0, $year, $month, false);
|
||||||
|
$bidderLogger = new ActionLogger($bidder['no'], 0, $year, $month, false);
|
||||||
|
|
||||||
|
$auctionLog = [];
|
||||||
|
|
||||||
|
|
||||||
|
//판매거래
|
||||||
|
if($auction['type'] == 0) {
|
||||||
|
if($auction['amount'] > $trader['rice'] - 1000) {
|
||||||
|
$gold = Util::round($auction['value'] * 0.01);
|
||||||
|
$db->update('general', [
|
||||||
|
'gold'=>Util::valueFit($trader['gold'] - $gold, 0)
|
||||||
|
], 'no=%i', $trader['no']);
|
||||||
|
|
||||||
|
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
||||||
|
$josaRo = JosaUtil::pick($auction['value'], '로');
|
||||||
|
$traderLogger->pushGeneralActionLog("판매자의 군량 부족으로 {$auction['no']}번 거래 <M>유찰</>! 벌금 <C>{$gold}</>", ActionLogger::EVENT_PLAIN);
|
||||||
|
$bidderLogger->pushGeneralActionLog("판매자의 군량 부족으로 {$auction['no']}번 거래 <M>유찰</>!", ActionLogger::EVENT_PLAIN);
|
||||||
|
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <span class='sell'>판매</span> <M>유찰</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 판매, <Y>{$auction['name2']}</>{$josaYi2} 금 <C>{$auction['value']}</>{$josaRo} 입찰, 그러나 판매자 군량부족, 벌금 <C>{$gold}</>";
|
||||||
|
} elseif($auction['value'] > $bidder['gold'] - 1000) {
|
||||||
|
$gold = Util::round($auction['value'] * 0.01);
|
||||||
|
$db->update('general', [
|
||||||
|
'gold'=>Util::valueFit($bidder['gold'] - $gold, 0)
|
||||||
|
], 'no=%i', $bidder['no']);
|
||||||
|
|
||||||
|
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
||||||
|
$josaRo = JosaUtil::pick($auction['value'], '로');
|
||||||
|
$traderLogger->pushGeneralActionLog("입찰자의 자금 부족으로 {$auction['no']}번 거래 <M>유찰</>!", ActionLogger::EVENT_PLAIN);
|
||||||
|
$bidderLogger->pushGeneralActionLog("입찰자의 자금 부족으로 {$auction['no']}번 거래 <M>유찰</>! 벌금 <C>{$gold}</>", ActionLogger::EVENT_PLAIN);
|
||||||
|
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <span class='sell'>판매</span> <M>유찰</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 판매, <Y>{$auction['name2']}</>{$josaYi2} 금 <C>{$auction['value']}</>{$josaRo} 입찰, 그러나 입찰자 자금부족, 벌금 <C>{$gold}</>";
|
||||||
|
} else {
|
||||||
|
$josaUlGold = JosaUtil::pick($auction['value'], '을');
|
||||||
|
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
||||||
|
$josaRo = JosaUtil::pick($auction['value'], '로');
|
||||||
|
$traderLogger->pushGeneralActionLog("{$auction['no']}번 거래 <C>성사</>로 쌀 <C>{$auction['amount']}</>{$josaUlRice} 판매, 금 <C>{$auction['value']}</>{$josaUlGold} 획득!", ActionLogger::EVENT_PLAIN);
|
||||||
|
$bidderLogger->pushGeneralActionLog("{$auction['no']}번 거래 <C>성사</>로 금 <C>{$auction['value']}</>{$josaUlGold} 지불, 쌀 <C>{$auction['amount']}</>{$josaUlRice} 구입!", ActionLogger::EVENT_PLAIN);
|
||||||
|
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <span class='sell'>판매</span> <C>성사</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 판매, <Y>{$auction['name2']}</>{$josaYi2} 금 <C>{$auction['value']}</>{$josaRo} 구매";
|
||||||
|
if($auction['value'] >= $auction['amount'] * 2) {
|
||||||
|
$auctionLog[0] .= " <R>★ 최고가 거래 ★</>";
|
||||||
|
} elseif($auction['value'] >= $auction['topv']) {
|
||||||
|
$auctionLog[0] .= " <M>★ 즉시구매가 거래 ★</>";
|
||||||
|
} elseif($auction['value'] * 2 <= $auction['amount']) {
|
||||||
|
$auctionLog[0] .= " <R>★ 최저가 거래 ★</>";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$db->update('general', [
|
||||||
|
'gold'=>$db->sqleval('gold + %i', $auction['value']),
|
||||||
|
'rice'=>$db->sqleval('rice - %i', $auction['amount']),
|
||||||
|
], 'no=%i', $auction['no1']);
|
||||||
|
$db->update('general', [
|
||||||
|
'gold'=>$db->sqleval('gold - %i', $auction['value']),
|
||||||
|
'rice'=>$db->sqleval('rice + %i', $auction['amount']),
|
||||||
|
], 'no=%i', $auction['no2']);
|
||||||
|
}
|
||||||
|
pushAuctionLog($auctionLog);
|
||||||
|
//구매거래
|
||||||
|
} else {
|
||||||
|
if($auction['amount'] > $bidder['rice'] - 1000) {
|
||||||
|
$gold = Util::round($auction['value'] * 0.01);
|
||||||
|
$db->update('general', [
|
||||||
|
'gold'=>Util::valueFit($bidder['gold'] - $gold, 0)
|
||||||
|
], 'no=%i', $bidder['no']);
|
||||||
|
|
||||||
|
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
||||||
|
$josaRo = JosaUtil::pick($auction['value'], '로');
|
||||||
|
$traderLogger->pushGeneralActionLog("입찰자의 군량 부족으로 {$auction['no']}번 거래 <M>유찰</>!", ActionLogger::EVENT_PLAIN);
|
||||||
|
$bidderLogger->pushGeneralActionLog("입찰자의 군량 부족으로 {$auction['no']}번 거래 <M>유찰</>! 벌금 <C>{$gold}</>", ActionLogger::EVENT_PLAIN);
|
||||||
|
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <S>구매</> <M>유찰</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 구매, <Y>{$auction['name2']}</>{$josaYi2} 금 <C>{$auction['value']}</>{$josaRo} 입찰, 그러나 입찰자 군량부족, 벌금 <C>{$gold}</>";
|
||||||
|
} elseif($auction['value'] > $trader['gold'] - 1000) {
|
||||||
|
$gold = Util::round($auction['value'] * 0.01);
|
||||||
|
$db->update('general', [
|
||||||
|
'gold'=>Util::valueFit($trader['gold'] - $gold, 0)
|
||||||
|
], 'no=%i', $trader['no']);
|
||||||
|
|
||||||
|
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
||||||
|
$josaRo = JosaUtil::pick($auction['value'], '로');
|
||||||
|
$traderLogger->pushGeneralActionLog("구매자의 자금 부족으로 {$auction['no']}번 거래 <M>유찰</>! 벌금 <C>{$gold}</>", ActionLogger::EVENT_PLAIN);
|
||||||
|
$bidderLogger->pushGeneralActionLog("구매자의 자금 부족으로 {$auction['no']}번 거래 <M>유찰</>!", ActionLogger::EVENT_PLAIN);
|
||||||
|
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <S>구매</> <M>유찰</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 구매, <Y>{$auction['name2']}</>{$josaYi2} 금 <C>{$auction['value']}</>{$josaRo} 입찰, 그러나 구매자 자금부족, 벌금 <C>{$gold}</>";
|
||||||
|
} else {
|
||||||
|
$josaUlGold = JosaUtil::pick($auction['value'], '을');
|
||||||
|
$josaUlRice = JosaUtil::pick($auction['amount'], '을');
|
||||||
|
$josaRo = JosaUtil::pick($auction['value'], '로');
|
||||||
|
$traderLogger->pushGeneralActionLog(
|
||||||
|
"{$auction['no']}번 거래 <C>성사</>로 금 <C>{$auction['value']}</>{$josaUlGold} 지불, 쌀 <C>{$auction['amount']}</>{$josaUlRice} 구입!", ActionLogger::EVENT_PLAIN
|
||||||
|
);
|
||||||
|
$bidderLogger->pushGeneralActionLog("{$auction['no']}번 거래 <C>성사</>로 쌀 <C>{$auction['amount']}</>{$josaUlRice} 판매, 금 <C>{$auction['value']}</>{$josaUlGold} 획득!", ActionLogger::EVENT_PLAIN);
|
||||||
|
$auctionLog[0] = "<S>◆</>{$admin['year']}년 {$admin['month']}월, {$auction['no']}번 <S>구매</> <C>성사</> : <Y>{$auction['name1']}</>{$josaYi1} 쌀 <C>{$auction['amount']}</>{$josaUlRice} 구매, <Y>{$auction['name2']}</>{$josaYi2} 금 <C>{$auction['value']}</>{$josaRo} 판매";
|
||||||
|
if($auction['value'] >= $auction['amount'] * 2) {
|
||||||
|
$auctionLog[0] .= " <R>★ 최고가 거래 ★</>";
|
||||||
|
} elseif($auction['value'] * 2 <= $auction['amount']) {
|
||||||
|
$auctionLog[0] .= " <R>★ 최저가 거래 ★</>";
|
||||||
|
} elseif($auction['value'] <= $auction['topv']) {
|
||||||
|
$auctionLog[0] .= " <M>★ 즉시구매가 거래 ★</>";
|
||||||
|
}
|
||||||
|
|
||||||
|
$db->update('general', [
|
||||||
|
'gold'=>$db->sqleval('gold - %i', $auction['value']),
|
||||||
|
'rice'=>$db->sqleval('rice + %i', $auction['amount']),
|
||||||
|
], 'no=%i', $auction['no1']);
|
||||||
|
$db->update('general', [
|
||||||
|
'gold'=>$db->sqleval('gold + %i', $auction['value']),
|
||||||
|
'rice'=>$db->sqleval('rice - %i', $auction['amount']),
|
||||||
|
], 'no=%i', $auction['no2']);
|
||||||
|
}
|
||||||
|
$traderLogger->flush();
|
||||||
|
$bidderLogger->flush();
|
||||||
|
pushAuctionLog($auctionLog);
|
||||||
|
}
|
||||||
|
|
||||||
|
$traderLogger->flush();
|
||||||
|
$bidderLogger->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
$query = "delete from auction where expire<='$date'";
|
$db->delete('auction', 'expire <= %s', $date);
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -224,7 +224,6 @@ if ($session->userGrade >= 5) {
|
|||||||
<a href='_admin2.php' target='_blank'><button type='button'>회원관리</button></a>
|
<a href='_admin2.php' target='_blank'><button type='button'>회원관리</button></a>
|
||||||
<a href='_admin4.php' target='_blank'><button type='button'>멀티관리</button></a>
|
<a href='_admin4.php' target='_blank'><button type='button'>멀티관리</button></a>
|
||||||
<a href='_admin5.php' target='_blank'><button type='button'>일제정보</button></a>
|
<a href='_admin5.php' target='_blank'><button type='button'>일제정보</button></a>
|
||||||
<a href='_admin6.php' target='_blank'><button type='button'>접속정보</button></a>
|
|
||||||
<a href='_admin7.php' target='_blank'><button type='button'>로그정보</button></a>
|
<a href='_admin7.php' target='_blank'><button type='button'>로그정보</button></a>
|
||||||
<a href='_admin8.php' target='_blank'><button type='button'>외교정보</button></a>
|
<a href='_admin8.php' target='_blank'><button type='button'>외교정보</button></a>
|
||||||
<a href='_119.php' target='_blank'><button type='button'>119</button></a>
|
<a href='_119.php' target='_blank'><button type='button'>119</button></a>
|
||||||
|
|||||||
@@ -149,6 +149,8 @@ class DiplomaticMessage extends Message{
|
|||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
|
[$year, $month] = $gameStor->getValuesAsArray(['year', 'month']);
|
||||||
|
|
||||||
|
|
||||||
$general = $db->queryFirstRow(
|
$general = $db->queryFirstRow(
|
||||||
'SELECT `name`, nation, `officer_level`, `permission`, `penalty`,belong FROM general WHERE `no`=%i AND nation=%i',
|
'SELECT `name`, nation, `officer_level`, `permission`, `penalty`,belong FROM general WHERE `no`=%i AND nation=%i',
|
||||||
@@ -164,7 +166,7 @@ class DiplomaticMessage extends Message{
|
|||||||
|
|
||||||
list($result, $reason) = $this->checkDiplomaticMessageValidation($general);
|
list($result, $reason) = $this->checkDiplomaticMessageValidation($general);
|
||||||
if($result !== self::ACCEPTED){
|
if($result !== self::ACCEPTED){
|
||||||
pushGeneralActionLog($receiverID, ["<C>●</>{$reason} {$this->diplomacyName} 실패."]);
|
(new ActionLogger($receiverID, 0, $year, $month))->pushGeneralActionLog("{$reason} {$this->diplomacyName} 실패", ActionLogger::PLAIN);
|
||||||
if($result === self::DECLINED){
|
if($result === self::DECLINED){
|
||||||
$this->_declineMessage();
|
$this->_declineMessage();
|
||||||
}
|
}
|
||||||
@@ -186,14 +188,14 @@ class DiplomaticMessage extends Message{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($result !== self::ACCEPTED){
|
if($result !== self::ACCEPTED){
|
||||||
pushGeneralActionLog($receiverID, ["<C>●</>{$reason}"]);
|
(new ActionLogger($receiverID, 0, $year, $month))->pushGeneralActionLog($reason, ActionLogger::PLAIN);
|
||||||
if($result === self::DECLINED){
|
if($result === self::DECLINED){
|
||||||
$this->_declineMessage();
|
$this->_declineMessage();
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
list($year, $month) = $gameStor->getValuesAsArray(['year', 'month']);
|
|
||||||
|
|
||||||
|
|
||||||
$this->dest->generalID = $receiverID;
|
$this->dest->generalID = $receiverID;
|
||||||
@@ -251,6 +253,9 @@ class DiplomaticMessage extends Message{
|
|||||||
}
|
}
|
||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
|
[$year, $month] = $gameStor->getValuesAsArray(['year', 'month']);
|
||||||
|
|
||||||
$general = $db->queryFirstRow(
|
$general = $db->queryFirstRow(
|
||||||
'SELECT `name`, nation, `officer_level`, `permission`, `penalty`,belong FROM general WHERE `no`=%i AND nation=%i',
|
'SELECT `name`, nation, `officer_level`, `permission`, `penalty`,belong FROM general WHERE `no`=%i AND nation=%i',
|
||||||
$receiverID,
|
$receiverID,
|
||||||
@@ -259,13 +264,13 @@ class DiplomaticMessage extends Message{
|
|||||||
list($result, $reason) = $this->checkDiplomaticMessageValidation($general);
|
list($result, $reason) = $this->checkDiplomaticMessageValidation($general);
|
||||||
|
|
||||||
if($result === self::INVALID){
|
if($result === self::INVALID){
|
||||||
pushGeneralActionLog($receiverID, ["<C>●</>{$reason} {$this->diplomacyName} 거절 불가."]);
|
(new ActionLogger($receiverID, 0, $year, $month))->pushGeneralActionLog("{$reason} {$this->diplomacyName} 거절 불가.", ActionLogger::PLAIN);
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
$josaYi = JosaUtil::pick($this->dest->nationName, '이');
|
$josaYi = JosaUtil::pick($this->dest->nationName, '이');
|
||||||
pushGeneralActionLog($receiverID, ["<C>●</><D>{$this->src->nationName}</>의 {$this->diplomacyName} 제안을 거절했습니다."]);
|
(new ActionLogger($receiverID, 0, $year, $month))->pushGeneralActionLog("<D>{$this->src->nationName}</>의 {$this->diplomacyName} 제안을 거절했습니다.", ActionLogger::PLAIN);
|
||||||
pushGeneralActionLog($this->src->generalID, ["<C>●</><Y>{$this->dest->nationName}</>{$josaYi} {$this->diplomacyName} 제안을 거절했습니다."]);
|
(new ActionLogger($this->src->generalID, 0, $year, $month))->pushGeneralActionLog("<Y>{$this->dest->nationName}</>{$josaYi} {$this->diplomacyName} 제안을 거절했습니다.", ActionLogger::PLAIN);
|
||||||
$this->_declineMessage();
|
$this->_declineMessage();
|
||||||
return self::DECLINED;
|
return self::DECLINED;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,17 +138,21 @@ class ScoutMessage extends Message{
|
|||||||
throw new \RuntimeException('전송되지 않은 메시지에 거절 진행 중');
|
throw new \RuntimeException('전송되지 않은 메시지에 거절 진행 중');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$db = DB::db();
|
||||||
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
|
[$year, $month] = $gameStor->getValuesAsArray(['year', 'month']);
|
||||||
|
|
||||||
list($result, $reason) = $this->checkScoutMessageValidation($receiverID);
|
list($result, $reason) = $this->checkScoutMessageValidation($receiverID);
|
||||||
|
|
||||||
if($result === self::INVALID){
|
if($result === self::INVALID){
|
||||||
pushGeneralActionLog($receiverID, ["<C>●</>{$reason} 등용 취소 불가."]);
|
(new ActionLogger($receiverID, 0, $year, $month))->pushGeneralActionLog("{$reason} 등용 취소 불가.", ActionLogger::PLAIN);
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
$josaRo = JosaUtil::pick($this->src->nationName, '로');
|
$josaRo = JosaUtil::pick($this->src->nationName, '로');
|
||||||
$josaYi = JosaUtil::pick($this->dest->generalName, '이');
|
$josaYi = JosaUtil::pick($this->dest->generalName, '이');
|
||||||
pushGeneralActionLog($receiverID, ["<C>●</><D>{$this->src->nationName}</>{$josaRo} 망명을 거부했습니다."]);
|
(new ActionLogger($receiverID, 0, $year, $month))->pushGeneralActionLog("{$this->src->nationName}</>{$josaRo} 망명을 거부했습니다.", ActionLogger::PLAIN);
|
||||||
pushGeneralActionLog($this->src->generalID, ["<C>●</><Y>{$this->dest->generalName}</>{$josaYi} 등용을 거부했습니다."]);
|
(new ActionLogger($this->src->generalID, 0, $year, $month))->pushGeneralActionLog("<Y>{$this->dest->generalName}</>{$josaYi} 등용을 거부했습니다.", ActionLogger::PLAIN);
|
||||||
$this->_declineMessage();
|
$this->_declineMessage();
|
||||||
|
|
||||||
return self::DECLINED;
|
return self::DECLINED;
|
||||||
|
|||||||
Reference in New Issue
Block a user