마지막 남은 iframe 안녕!!!
This commit is contained in:
File diff suppressed because one or more lines are too long
+4
-66
@@ -8,66 +8,10 @@ $session = Session::getInstance()->setReadOnly();
|
|||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
|
|
||||||
?>
|
if (!$session->isGameLoggedIn()) {
|
||||||
<!DOCTYPE html>
|
die('<script>window.location.href = "../"</script>');
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>커맨드리스트</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')?>
|
|
||||||
<script type="text/javascript">
|
|
||||||
<?php
|
|
||||||
if(!$session->isGameLoggedIn()){
|
|
||||||
echo 'window.parent.location.href = "../";';
|
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
function myclock() {
|
|
||||||
lastday = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
|
|
||||||
|
|
||||||
date = document.clock.clock.value;
|
|
||||||
|
|
||||||
year = parseInt(date.substr(0, 4), 10);
|
|
||||||
month = parseInt(date.substr(5,2), 10);
|
|
||||||
day = parseInt(date.substr(8, 2), 10);
|
|
||||||
hour = parseInt(date.substr(11, 2), 10);
|
|
||||||
min = parseInt(date.substr(14, 2), 10);
|
|
||||||
sec = parseInt(date.substr(17, 2), 10);
|
|
||||||
|
|
||||||
//윤년계산
|
|
||||||
if(((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) { lastday[1] = 29; }
|
|
||||||
else { lastday[1] = 28; }
|
|
||||||
|
|
||||||
// if(term > 0) term--;
|
|
||||||
|
|
||||||
sec++;
|
|
||||||
if(sec >= 60) { sec = 0; min++; }
|
|
||||||
if(min >= 60) { min = 0; hour++; }
|
|
||||||
if(hour >= 24) { hour = 0; day++; }
|
|
||||||
if(day > lastday[month-1]) { month++; day = 1; }
|
|
||||||
if(month >= 13) { year++; month = 1; }
|
|
||||||
if(month < 10) { month = '0' + month; }
|
|
||||||
if(day < 10) { day = '0' + day; }
|
|
||||||
if(hour < 10) { hour = '0' + hour; }
|
|
||||||
if(min < 10) { min = '0' + min; }
|
|
||||||
if(sec < 10) { sec = '0' + sec; }
|
|
||||||
date = '' + year + '-' + month + '-' + day + ' ' + hour + ':' + min + ':' + sec;
|
|
||||||
|
|
||||||
document.clock.clock.value = date;
|
|
||||||
|
|
||||||
window.setTimeout("myclock();", 1000);
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body OnLoad='myclock()'>
|
|
||||||
<?php
|
|
||||||
myCommandList();
|
myCommandList();
|
||||||
|
|
||||||
function myCommandList() {
|
function myCommandList() {
|
||||||
@@ -88,9 +32,8 @@ function myCommandList() {
|
|||||||
$turn = getTurn($me, 2);
|
$turn = getTurn($me, 2);
|
||||||
|
|
||||||
echo "<table width=300 height=700 class='tb_layout bg2'>
|
echo "<table width=300 height=700 class='tb_layout bg2'>
|
||||||
<form name=clock>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan=4 align=center id=bg0><b>- 명령 목록 - <input value='$date' type=text name=clock size=19 style=background-color:black;color:white;border-style:none;></b></td>
|
<td colspan=4 align=center id=bg0><b>- 명령 목록 - <input value='$date' type=text id=clock size=19 style=background-color:black;color:white;border-style:none;></b></td>
|
||||||
</tr>";
|
</tr>";
|
||||||
|
|
||||||
$year = $admin['year'];
|
$year = $admin['year'];
|
||||||
@@ -120,11 +63,6 @@ function myCommandList() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo "
|
echo "
|
||||||
</form>
|
|
||||||
</table>
|
</table>
|
||||||
";
|
";
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
+23
-31
@@ -720,8 +720,11 @@ where nation='{$general['nation']}'
|
|||||||
|
|
||||||
function command_Single($turn, $command) {
|
function command_Single($turn, $command) {
|
||||||
if(!$turn){
|
if(!$turn){
|
||||||
header('location:commandlist.php', true, 303);
|
Json::die([
|
||||||
return;
|
'result'=>true,
|
||||||
|
'nextPage'=>null,
|
||||||
|
'reason'=>'invalid turn'
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
@@ -735,7 +738,11 @@ function command_Single($turn, $command) {
|
|||||||
}
|
}
|
||||||
$db->update('general', $setValues, 'owner=%i',$userID);
|
$db->update('general', $setValues, 'owner=%i',$userID);
|
||||||
|
|
||||||
header('location:commandlist.php', true, 303);
|
Json::die([
|
||||||
|
'result'=>true,
|
||||||
|
'nextPage'=>null,
|
||||||
|
'reason'=>'success'
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function command_Chief($turn, $command) {
|
function command_Chief($turn, $command) {
|
||||||
@@ -762,37 +769,22 @@ function command_Chief($turn, $command) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function command_Other($turn, $commandtype) {
|
function command_Other($turn, $commandtype) {
|
||||||
|
if(!$turn){
|
||||||
$target = "processing.php?commandtype={$commandtype}";
|
Json::die([
|
||||||
foreach($turn as $turnItem){
|
'result'=>true,
|
||||||
$target.="&turn[]={$turnItem}";
|
'nextPage'=>null,
|
||||||
|
'reason'=>'invalid turn'
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
$target.="&".mt_rand();
|
|
||||||
?>
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="ko">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
||||||
<meta name="viewport" content="width=1024" />
|
|
||||||
<script>
|
|
||||||
parent.moveProcessing(<?=$commandtype?>, <?=Json::encode($turn)?>);
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
<body style="background-color:black;">
|
|
||||||
|
|
||||||
</body>
|
$unixNow = time();
|
||||||
</html>
|
$turnArg = join('&turn[]=', $turn);
|
||||||
<?php
|
|
||||||
|
|
||||||
/*
|
Json::die([
|
||||||
<form name='form1' action='processing.php' method='post' target=_parent>
|
'result'=>true,
|
||||||
<?php foreach($turn as $turnItem): ?>
|
'nextPage'=>"processing.php?commandtype={$commandtype}&turn[]={$turnArg}&t={$unixNow}",
|
||||||
<input type='hidden' name='turn[]' value='<?=$turnItem?>'>
|
'reason'=>'success'
|
||||||
<?php endforeach; ?>
|
]);
|
||||||
<input type=hidden name=commandtype value=<?=$commandtype?>>
|
|
||||||
</form>
|
|
||||||
<script>*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+5
-2
@@ -91,6 +91,7 @@ $serverCnt = $db->queryFirstField('SELECT count(*) FROM ng_games');
|
|||||||
<?=WebUtil::printJS('../e_lib/jquery.redirect.js')?>
|
<?=WebUtil::printJS('../e_lib/jquery.redirect.js')?>
|
||||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||||
<?=WebUtil::printJS('../e_lib/moment.min.js')?>
|
<?=WebUtil::printJS('../e_lib/moment.min.js')?>
|
||||||
|
<?=WebUtil::printJS('../e_lib/moment-timezone-with-data-10-year-range.min.js')?>
|
||||||
<?=WebUtil::printJS('../e_lib/linkify/linkify.min.js')?>
|
<?=WebUtil::printJS('../e_lib/linkify/linkify.min.js')?>
|
||||||
<?=WebUtil::printJS('../e_lib/linkify/linkify-string.min.js')?>
|
<?=WebUtil::printJS('../e_lib/linkify/linkify-string.min.js')?>
|
||||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||||
@@ -111,6 +112,8 @@ $(function(){
|
|||||||
setInterval(function(){
|
setInterval(function(){
|
||||||
refreshMsg();
|
refreshMsg();
|
||||||
}, 5000);
|
}, 5000);
|
||||||
|
|
||||||
|
reloadCommandList();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
|
||||||
@@ -241,9 +244,9 @@ else if($session->userGrade == 4){
|
|||||||
<td style='width:700px;height:520px;' colspan=2>
|
<td style='width:700px;height:520px;' colspan=2>
|
||||||
<?=getMapHtml($mapTheme)?>
|
<?=getMapHtml($mapTheme)?>
|
||||||
</td>
|
</td>
|
||||||
<td style='width:300px;' rowspan=4><iframe seamless="seamless" name=commandlist src='commandlist.php' style='width:300px;height:700px;' frameborder=0 marginwidth=0 marginheight=0 topmargin=0 scrolling=no></iframe></td>
|
<td style='width:300px;' rowspan=4 id='commandlist'></td>
|
||||||
</tr>
|
</tr>
|
||||||
<form name=form2 action=preprocessing.php method=post target=commandlist>
|
<form id='form2' name=form2>
|
||||||
<tr>
|
<tr>
|
||||||
<td rowspan=3 width=50 valign=top><?=turnTable()?></td>
|
<td rowspan=3 width=50 valign=top><?=turnTable()?></td>
|
||||||
<td style="width:650px;border:none;text-align:center;"><?php cityInfo(); ?></td>
|
<td style="width:650px;border:none;text-align:center;"><?php cityInfo(); ?></td>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ namespace sammo;
|
|||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
//로그인 검사
|
//로그인 검사
|
||||||
$session = Session::requireGameLogin()->setReadOnly();
|
$session = Session::requireGameLogin([])->setReadOnly();
|
||||||
$userID = Session::getUserID();
|
$userID = Session::getUserID();
|
||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
@@ -17,8 +17,10 @@ $commandtype = Util::getReq('commandtype', 'int');
|
|||||||
increaseRefresh("턴입력", 1);
|
increaseRefresh("턴입력", 1);
|
||||||
|
|
||||||
if(!$turn || $commandtype === null || $sel === null){
|
if(!$turn || $commandtype === null || $sel === null){
|
||||||
header('location:commandlist.php', true, 303);
|
Json::die([
|
||||||
die();
|
'result'=>true,
|
||||||
|
'reason'=>'empty command'
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$count = count($turn);
|
$count = count($turn);
|
||||||
+63
-1
@@ -6,4 +6,66 @@ include "func.php";
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
$session = Session::requireGameLogin([])->setReadOnly();
|
$session = Session::requireGameLogin([])->setReadOnly();
|
||||||
|
|
||||||
|
$type = Util::getReq('type', 'int', 0);
|
||||||
|
$sel = Util::getReq('sel', 'int', 1);
|
||||||
|
|
||||||
|
if($sel <= 0 || $sel > 12){
|
||||||
|
$sel = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
$userID = Session::getUserID();
|
||||||
|
|
||||||
|
$db = DB::db();
|
||||||
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
|
|
||||||
|
increaseRefresh("턴반복", 1);
|
||||||
|
|
||||||
|
$myActionCnt = $db->queryFirstField('SELECT con FROM general WHERE `owner`=%i', $userID);
|
||||||
|
|
||||||
|
$con = checkLimit($myActionCnt);
|
||||||
|
if($con >= 2) {
|
||||||
|
Json::die([
|
||||||
|
'result'=>false,
|
||||||
|
'result'=>'접속 제한입니다.'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
switch($type) {
|
||||||
|
case 0://반복
|
||||||
|
$valueMap = [];
|
||||||
|
foreach(range($sel, GameConst::$maxTurn - 1) as $idx){
|
||||||
|
$src = $idx % $sel;
|
||||||
|
$valueMap['turn'.$idx] = $db->sqleval('%b', 'turn'.$src);
|
||||||
|
}
|
||||||
|
$db->update('general', $valueMap, 'owner=%i', $userID);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
$valueMap = [];
|
||||||
|
foreach(range(GameConst::$maxTurn -1, $sel, -1) as $idx){
|
||||||
|
$src = $idx - $sel;
|
||||||
|
$valueMap['turn'.$idx] = $db->sqleval('%b', 'turn'.$src);
|
||||||
|
}
|
||||||
|
foreach(range($sel -1, 0, -1) as $idx){
|
||||||
|
$valueMap['turn'.$idx] = EncodeCommand(0, 0, 0, 0);
|
||||||
|
}
|
||||||
|
$db->update('general', $valueMap, 'owner=%i', $userID);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
$valueMap = [];
|
||||||
|
foreach(range(0, GameConst::$maxTurn - $sel - 1) as $idx){
|
||||||
|
$src = $idx + $sel;
|
||||||
|
$valueMap['turn'.$idx] = $db->sqleval('%b', 'turn'.$src);
|
||||||
|
}
|
||||||
|
foreach(range(GameConst::$maxTurn - $sel, GameConst::$maxTurn - 1) as $idx){
|
||||||
|
$valueMap['turn'.$idx] = EncodeCommand(0, 0, 0, 0);
|
||||||
|
}
|
||||||
|
$db->update('general', $valueMap, 'owner=%i', $userID);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
Json::die([
|
||||||
|
'result'=>true,
|
||||||
|
'result'=>'success'
|
||||||
|
]);
|
||||||
+61
-8
@@ -28,7 +28,7 @@ function refreshing(obj, arg1, arg2) {
|
|||||||
switch(arg1) {
|
switch(arg1) {
|
||||||
case 0: document.location.reload(); break;
|
case 0: document.location.reload(); break;
|
||||||
case 2: turn(arg2); break;
|
case 2: turn(arg2); break;
|
||||||
case 3: arg2.submit(); break;
|
case 3: $(arg2).submit(); break;
|
||||||
case 4:
|
case 4:
|
||||||
arg2.submit();
|
arg2.submit();
|
||||||
message.msg.value = "";
|
message.msg.value = "";
|
||||||
@@ -39,14 +39,38 @@ function refreshing(obj, arg1, arg2) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function moveProcessing(commandtype, turn){
|
function turn(type) {
|
||||||
console.log(commandtype, turn);
|
$.post({
|
||||||
$.redirect("processing.php",{ commandtype: commandtype, turn: turn}, 'post');
|
url:'j_turn.php',
|
||||||
|
dataType:'json',
|
||||||
|
data:{
|
||||||
|
type:type,
|
||||||
|
sel:form2.sel.value
|
||||||
|
}
|
||||||
|
}).then(function(data){
|
||||||
|
if(!data.result){
|
||||||
|
alert(data.reason);
|
||||||
|
}
|
||||||
|
reloadCommandList();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function turn(type) {
|
function reloadCommandList(){
|
||||||
num = form2.sel.value;
|
$.get({
|
||||||
commandlist.location.replace('turn.php?type=' + type + '&sel=' + num);
|
url:'commandlist.php',
|
||||||
|
cache: false,
|
||||||
|
}).then(function(rdata){
|
||||||
|
$('#commandlist').html(rdata);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function myclock() {
|
||||||
|
|
||||||
|
$('#clock').val(moment().tz('Asia/Seoul').format('YYYY-MM-DD HH:mm:ss'));
|
||||||
|
|
||||||
|
window.setTimeout(function(){
|
||||||
|
myclock();
|
||||||
|
}, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
jQuery(function($){
|
jQuery(function($){
|
||||||
@@ -54,11 +78,40 @@ jQuery(function($){
|
|||||||
var $this = $(this);
|
var $this = $(this);
|
||||||
var target = $('[name="genlist"]').val();
|
var target = $('[name="genlist"]').val();
|
||||||
var msg = $('#msg').val();
|
var msg = $('#msg').val();
|
||||||
console.log(target, msg);
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#mainBtnSubmit').click(function(){
|
$('#mainBtnSubmit').click(function(){
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#form2').submit(function(){
|
||||||
|
var values = $(this).serializeArray();
|
||||||
|
console.log(values);
|
||||||
|
$.post({
|
||||||
|
url:'j_preprocessing.php',
|
||||||
|
dataType:'json',
|
||||||
|
data:values
|
||||||
|
}).then(function(data){
|
||||||
|
if(!data.result){
|
||||||
|
alert(data.reason);
|
||||||
|
reloadCommandList();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!data.nextPage){
|
||||||
|
reloadCommandList();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
document.location = data.nextPage;
|
||||||
|
return;
|
||||||
|
}, function(){
|
||||||
|
alert('알 수 없는 에러');
|
||||||
|
location.reload();
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
myclock();
|
||||||
});
|
});
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
<?php
|
|
||||||
namespace sammo;
|
|
||||||
|
|
||||||
include "lib.php";
|
|
||||||
include "func.php";
|
|
||||||
//로그인 검사
|
|
||||||
|
|
||||||
$type = Util::getReq('type', 'int', 0);
|
|
||||||
$sel = Util::getReq('sel', 'int', 1);
|
|
||||||
|
|
||||||
if($sel <= 0 || $sel > 12){
|
|
||||||
$sel = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
$session = Session::requireGameLogin()->setReadOnly();
|
|
||||||
$userID = Session::getUserID();
|
|
||||||
|
|
||||||
$db = DB::db();
|
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
|
||||||
$connect=$db->get();
|
|
||||||
|
|
||||||
increaseRefresh("턴반복", 1);
|
|
||||||
|
|
||||||
$myActionCnt = $db->queryFirstField('SELECT con FROM general WHERE `owner`=%i', $userID);
|
|
||||||
|
|
||||||
$con = checkLimit($myActionCnt);
|
|
||||||
if($con >= 2) {
|
|
||||||
header('location:commandlist.php', true, 303);
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
switch($type) {
|
|
||||||
case 0://반복
|
|
||||||
$valueMap = [];
|
|
||||||
foreach(range($sel, GameConst::$maxTurn - 1) as $idx){
|
|
||||||
$src = $idx % $sel;
|
|
||||||
$valueMap['turn'.$idx] = $db->sqleval('%b', 'turn'.$src);
|
|
||||||
}
|
|
||||||
$db->update('general', $valueMap, 'owner=%i', $userID);
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
$valueMap = [];
|
|
||||||
foreach(range(GameConst::$maxTurn -1, $sel, -1) as $idx){
|
|
||||||
$src = $idx - $sel;
|
|
||||||
$valueMap['turn'.$idx] = $db->sqleval('%b', 'turn'.$src);
|
|
||||||
}
|
|
||||||
foreach(range($sel -1, 0, -1) as $idx){
|
|
||||||
$valueMap['turn'.$idx] = EncodeCommand(0, 0, 0, 0);
|
|
||||||
}
|
|
||||||
$db->update('general', $valueMap, 'owner=%i', $userID);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
$valueMap = [];
|
|
||||||
foreach(range(0, GameConst::$maxTurn - $sel - 1) as $idx){
|
|
||||||
$src = $idx + $sel;
|
|
||||||
$valueMap['turn'.$idx] = $db->sqleval('%b', 'turn'.$src);
|
|
||||||
}
|
|
||||||
foreach(range(GameConst::$maxTurn - $sel, GameConst::$maxTurn - 1) as $idx){
|
|
||||||
$valueMap['turn'.$idx] = EncodeCommand(0, 0, 0, 0);
|
|
||||||
}
|
|
||||||
$db->update('general', $valueMap, 'owner=%i', $userID);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
header('location:commandlist.php', true, 303);
|
|
||||||
Reference in New Issue
Block a user