Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
42310fa170 | ||
|
|
bfff1d9e2f | ||
|
|
2c98777b9f | ||
|
|
4a91260a31 | ||
|
|
076971bcae | ||
|
|
01fcc9bcab | ||
|
|
348877c7cd | ||
|
|
478f26e75a | ||
|
|
57cc558b9b | ||
|
|
20b1f8eff8 | ||
|
|
f0a7990404 | ||
|
|
27f53ff4a6 | ||
|
|
9ec5dfc8b1 | ||
|
|
e4c1e414c8 | ||
|
|
a391650472 | ||
|
|
3cfde2b40d | ||
|
|
8bf1ed33dc | ||
|
|
422b3be0c5 | ||
|
|
c34e44c4ec | ||
|
|
a2b20eca67 | ||
|
|
d41c316bfb | ||
|
|
ca1d8aab84 | ||
|
|
32e3dcff7c | ||
|
|
9a23470622 | ||
|
|
c37a186802 | ||
|
|
84c17e3b22 |
@@ -28,6 +28,7 @@ d_shared
|
|||||||
d_pic/*.jpg
|
d_pic/*.jpg
|
||||||
d_pic/*.gif
|
d_pic/*.gif
|
||||||
d_pic/*.png
|
d_pic/*.png
|
||||||
|
d_pic/uploaded_image
|
||||||
|
|
||||||
d_setting/*.php
|
d_setting/*.php
|
||||||
*/d_setting/*.php
|
*/d_setting/*.php
|
||||||
|
|||||||
@@ -9,8 +9,10 @@
|
|||||||
* <code>mpm_event</code> 권장
|
* <code>mpm_event</code> 권장
|
||||||
* PHP 7.2 이상
|
* PHP 7.2 이상
|
||||||
* <code>php-fpm</code> 권장
|
* <code>php-fpm</code> 권장
|
||||||
* php에서 curl을 실행가능해야 합니다.
|
* php에서 curl, pdo-sqlite을 실행가능해야 합니다. (기본값: 지원)
|
||||||
* MySQL 5.6 이상, 또는 MariaDB 10.0 이상
|
* mysqlnd가 지원되어야합니다. (기본값: 지원)
|
||||||
|
* MariaDB 10.2.1 이상
|
||||||
|
* MySQL 5.6 이상도 가능하도록 할 예정입니다.
|
||||||
* <code>git</code>
|
* <code>git</code>
|
||||||
* <code>curl</code>
|
* <code>curl</code>
|
||||||
|
|
||||||
@@ -47,7 +49,7 @@ Database 수는 로그인 관리 서버 1개, 내부 서버 7개로, 총 8개의
|
|||||||
|
|
||||||
현재 카카오로그인 API KEY를 입력하는 작업이 설치과정에 추가되어있지 않습니다.
|
현재 카카오로그인 API KEY를 입력하는 작업이 설치과정에 추가되어있지 않습니다.
|
||||||
|
|
||||||
<code>f_install/templates/KakaoKey.orig.php</code> 를 <code>d_setting/KakaoKey.php</code>로 복사한 후 API 키를 입력하여야 합니다.
|
설치 후 <code>d_setting/KakaoKey.php</code>에서 API키를 입력해야 합니다.
|
||||||
|
|
||||||
|
|
||||||
## 라이선스
|
## 라이선스
|
||||||
|
|||||||
@@ -0,0 +1,153 @@
|
|||||||
|
/* Forked from https://github.com/asiffermann/summernote-image-title */
|
||||||
|
|
||||||
|
(function (factory) {
|
||||||
|
/* Global define */
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
// AMD. Register as an anonymous module.
|
||||||
|
define(['jquery'], factory);
|
||||||
|
} else if (typeof module === 'object' && module.exports) {
|
||||||
|
// Node/CommonJS
|
||||||
|
module.exports = factory(require('jquery'));
|
||||||
|
} else {
|
||||||
|
// Browser globals
|
||||||
|
factory(window.jQuery);
|
||||||
|
}
|
||||||
|
}(function ($) {
|
||||||
|
$.extend(true, $.summernote.lang, {
|
||||||
|
'en-US': {
|
||||||
|
imageFlip: {
|
||||||
|
edit: 'Flip image',
|
||||||
|
flipLabel: 'Alternative Image'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'ko-KR': {
|
||||||
|
imageFlip: {
|
||||||
|
edit: '이미지 전환',
|
||||||
|
flipLabel: '대체 이미지( , 로 구분)'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
$.extend($.summernote.options, {
|
||||||
|
imageFlip: {
|
||||||
|
icon: '<i class="note-icon-pencil"/>',
|
||||||
|
tooltip: 'Image Flip'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$.extend($.summernote.plugins, {
|
||||||
|
'imageFlip': function (context) {
|
||||||
|
var self = this;
|
||||||
|
|
||||||
|
var ui = $.summernote.ui;
|
||||||
|
var $note = context.layoutInfo.note;
|
||||||
|
var $editor = context.layoutInfo.editor;
|
||||||
|
var $editable = context.layoutInfo.editable;
|
||||||
|
var $toolbar = context.layoutInfo.toolbar;
|
||||||
|
|
||||||
|
if (typeof context.options.imageFlip === 'undefined') {
|
||||||
|
context.options.imageFlip = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
var options = context.options;
|
||||||
|
var lang = options.langInfo;
|
||||||
|
|
||||||
|
context.memo('button.imageFlip', function () {
|
||||||
|
var button = ui.button({
|
||||||
|
contents: ui.icon(options.icons.pencil),
|
||||||
|
container: false,
|
||||||
|
tooltip: lang.imageFlip.edit,
|
||||||
|
click: function (e) {
|
||||||
|
context.invoke('imageFlip.show');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return button.render();
|
||||||
|
});
|
||||||
|
|
||||||
|
this.initialize = function () {
|
||||||
|
var $container = options.dialogsInBody ? $(document.body) : $editor;
|
||||||
|
|
||||||
|
var body = '<div class="form-group">' +
|
||||||
|
'<label>' + lang.imageFlip.flipLabel + '</label>' +
|
||||||
|
'<input class="note-image-flip-text form-control" type="text" />' +
|
||||||
|
'</div>';
|
||||||
|
|
||||||
|
var footer = '<button href="#" class="btn btn-primary note-image-flip-btn">' + lang.imageFlip.edit + '</button>';
|
||||||
|
|
||||||
|
this.$dialog = ui.dialog({
|
||||||
|
title: lang.imageFlip.edit,
|
||||||
|
body: body,
|
||||||
|
footer: footer
|
||||||
|
}).render().appendTo($container);
|
||||||
|
};
|
||||||
|
|
||||||
|
this.destroy = function () {
|
||||||
|
ui.hideDialog(this.$dialog);
|
||||||
|
this.$dialog.remove();
|
||||||
|
};
|
||||||
|
|
||||||
|
this.bindEnterKey = function ($input, $btn) {
|
||||||
|
$input.on('keypress', function (event) {
|
||||||
|
if (event.keyCode === 13) {
|
||||||
|
$btn.trigger('click');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
this.show = function () {
|
||||||
|
var $img = $($editable.data('target'));
|
||||||
|
|
||||||
|
var imgInfo = {
|
||||||
|
imgDom: $img,
|
||||||
|
flip: $img.data('flip'),
|
||||||
|
};
|
||||||
|
this.showLinkDialog(imgInfo).then(function (imgInfo) {
|
||||||
|
ui.hideDialog(self.$dialog);
|
||||||
|
var $img = imgInfo.imgDom;
|
||||||
|
|
||||||
|
if (imgInfo.flip) {
|
||||||
|
$img.attr('data-flip', imgInfo.flip);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$img.removeData('flip');
|
||||||
|
}
|
||||||
|
|
||||||
|
$note.val(context.invoke('code'));
|
||||||
|
$note.change();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
this.showLinkDialog = function (imgInfo) {
|
||||||
|
return $.Deferred(function (deferred) {
|
||||||
|
var $imageFlip = self.$dialog.find('.note-image-flip-text');
|
||||||
|
var $editBtn = self.$dialog.find('.note-image-flip-btn');
|
||||||
|
|
||||||
|
ui.onDialogShown(self.$dialog, function () {
|
||||||
|
context.triggerEvent('dialog.shown');
|
||||||
|
|
||||||
|
$editBtn.click(function (event) {
|
||||||
|
event.preventDefault();
|
||||||
|
deferred.resolve({
|
||||||
|
imgDom: imgInfo.imgDom,
|
||||||
|
flip: $imageFlip.val(),
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
$imageFlip.val(imgInfo.flip).trigger('focus');
|
||||||
|
self.bindEnterKey($imageFlip, $editBtn);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
ui.onDialogHidden(self.$dialog, function () {
|
||||||
|
$editBtn.off('click');
|
||||||
|
|
||||||
|
if (deferred.state() === 'pending') {
|
||||||
|
deferred.reject();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
ui.showDialog(self.$dialog);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}));
|
||||||
@@ -263,6 +263,14 @@ $result = Util::generateFileUsingSimpleTemplate(
|
|||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Util::generateFileUsingSimpleTemplate(
|
||||||
|
__dir__.'/templates/KakaoKey.orig.php',
|
||||||
|
ROOT.'/d_setting/KakaoKey.php',
|
||||||
|
[
|
||||||
|
],
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
if ($result !== true) {
|
if ($result !== true) {
|
||||||
Json::die([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ if($showServers){
|
|||||||
if($nation['generals']){
|
if($nation['generals']){
|
||||||
$generals = $db->query('SELECT `general_no`, `name`, `last_yearmonth` FROM ng_old_generals WHERE server_id=%s AND general_no IN %li', $serverID, $nation['generals']);
|
$generals = $db->query('SELECT `general_no`, `name`, `last_yearmonth` FROM ng_old_generals WHERE server_id=%s AND general_no IN %li', $serverID, $nation['generals']);
|
||||||
|
|
||||||
if(count($generals) != $nation['generals'] && $serverID == UniqueConst::$serverID){
|
if(count($generals) != count($nation['generals']) && $serverID == UniqueConst::$serverID){
|
||||||
$liveGenerals = $nation['generals'];
|
$liveGenerals = $nation['generals'];
|
||||||
foreach($generals as $general){
|
foreach($generals as $general){
|
||||||
if(in_array($general['general_no'], $nation['generals'])){
|
if(in_array($general['general_no'], $nation['generals'])){
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ var editable = <?=($me['level']>=5?'true':'false')?>;
|
|||||||
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
|
||||||
<?=WebUtil::printJS('../e_lib/summernote/summernote-bs4.min.js')?>
|
<?=WebUtil::printJS('../e_lib/summernote/summernote-bs4.min.js')?>
|
||||||
<?=WebUtil::printJS('../e_lib/summernote/lang/summernote-ko-KR.js')?>
|
<?=WebUtil::printJS('../e_lib/summernote/lang/summernote-ko-KR.js')?>
|
||||||
|
<?=WebUtil::printJS('../e_lib/summernote/plugin/image-sammo/summernote-image-flip.js')?>
|
||||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||||
<?=WebUtil::printJS('js/common.js')?>
|
<?=WebUtil::printJS('js/common.js')?>
|
||||||
<?=WebUtil::printJS('js/dipcenter.js')?>
|
<?=WebUtil::printJS('js/dipcenter.js')?>
|
||||||
|
|||||||
@@ -11,6 +11,12 @@
|
|||||||
text-align:center;
|
text-align:center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.map_title_tooltiptext .tooltip-inner{
|
||||||
|
max-width:220px;
|
||||||
|
width:220px;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
.map_title_text{
|
.map_title_text{
|
||||||
margin:auto;
|
margin:auto;
|
||||||
text-align:center;
|
text-align:center;
|
||||||
|
|||||||
+5
-2
@@ -437,7 +437,7 @@ function commandTable() {
|
|||||||
$connect=$db->get();
|
$connect=$db->get();
|
||||||
$userID = Session::getUserID();
|
$userID = Session::getUserID();
|
||||||
|
|
||||||
$admin = $gameStor->getValues(['startyear', 'year', 'month', 'develcost', 'scenario']);
|
$admin = $gameStor->getValues(['startyear', 'year', 'month', 'develcost', 'scenario', 'join_mode']);
|
||||||
|
|
||||||
$query = "select no,npc,troop,city,nation,level,crew,makelimit,special from general where owner='{$userID}'";
|
$query = "select no,npc,troop,city,nation,level,crew,makelimit,special from general where owner='{$userID}'";
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
@@ -554,7 +554,10 @@ function commandTable() {
|
|||||||
addCommand("인재탐색(랜덤경험, 자금$develcost)", 29, 0);
|
addCommand("인재탐색(랜덤경험, 자금$develcost)", 29, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($me['level'] >= 1 && $city['supply'] != 0) {
|
if($admin['join_mode'] == 'onlyRandom'){
|
||||||
|
//do Nothing
|
||||||
|
}
|
||||||
|
else if($me['level'] >= 1 && $city['supply'] != 0) {
|
||||||
addCommand("등용(자금{$develcost5}+장수가치)", 22);
|
addCommand("등용(자금{$develcost5}+장수가치)", 22);
|
||||||
} else {
|
} else {
|
||||||
addCommand("등용(자금{$develcost5}+장수가치)", 22, 0);
|
addCommand("등용(자금{$develcost5}+장수가치)", 22, 0);
|
||||||
|
|||||||
+12
-5
@@ -105,12 +105,19 @@ function getTurn(array $general, $type, $font=1) {
|
|||||||
case 25: //임관
|
case 25: //임관
|
||||||
$double = $command[1];
|
$double = $command[1];
|
||||||
|
|
||||||
$nation = getNationStaticInfo($double);
|
if($double == 98){
|
||||||
|
$nationName = '건국된 임의 국가';
|
||||||
|
}
|
||||||
|
else if($double == 99){
|
||||||
|
$nationName = '임의의 국가';
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$nationName = getNationStaticInfo($double)['name']??'?!?!';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(!$nation['name']) { $nation['name'] = '????'; }
|
$josaRo = JosaUtil::pick($nationName, '로');
|
||||||
|
$str[$i] = "【{$nationName}】{$josaRo} 임관";
|
||||||
$josaRo = JosaUtil::pick($nation['name'], '로');
|
|
||||||
$str[$i] = "【{$nation['name']}】{$josaRo} 임관";
|
|
||||||
break;
|
break;
|
||||||
case 26: //집합
|
case 26: //집합
|
||||||
$str[$i] = "집합";
|
$str[$i] = "집합";
|
||||||
|
|||||||
+4
-10
@@ -976,10 +976,6 @@ function updateNationState() {
|
|||||||
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$citycount = MYDB_num_rows($cityresult);
|
$citycount = MYDB_num_rows($cityresult);
|
||||||
|
|
||||||
$query = "select no from general where nation='{$nation['nation']}'";
|
|
||||||
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$gencount = MYDB_num_rows($genresult);
|
|
||||||
|
|
||||||
if($citycount == 0) {
|
if($citycount == 0) {
|
||||||
$nationlevel = 0; // 방랑군
|
$nationlevel = 0; // 방랑군
|
||||||
} elseif($citycount == 1) {
|
} elseif($citycount == 1) {
|
||||||
@@ -1051,11 +1047,6 @@ function updateNationState() {
|
|||||||
]);
|
]);
|
||||||
$troopID = $db->insertId();
|
$troopID = $db->insertId();
|
||||||
|
|
||||||
$db->update('nation', [
|
|
||||||
'gennum'=>$nation['gennum']+1,
|
|
||||||
'totaltech'=>Util::valueFit($nation['gennum']+1, GameConst::$initialNationGenLimit) * $nation['tech'],
|
|
||||||
], 'nation=%i', $nation['nation']);
|
|
||||||
|
|
||||||
$command = EncodeCommand(0, 0, 0, 26); //집합
|
$command = EncodeCommand(0, 0, 0, 26); //집합
|
||||||
$db->update('general', [
|
$db->update('general', [
|
||||||
'troop'=>$troopID,
|
'troop'=>$troopID,
|
||||||
@@ -1078,10 +1069,13 @@ function updateNationState() {
|
|||||||
|
|
||||||
refreshNationStaticInfo();
|
refreshNationStaticInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$gencount = $db->queryFirstField('SELECT count(*) FROM general WHERE nation=%i', $nation['nation']);
|
||||||
|
|
||||||
$gennum = $gencount;
|
$gennum = $gencount;
|
||||||
if($gencount < GameConst::$initialNationGenLimit) $gencount = GameConst::$initialNationGenLimit;
|
if($gencount < GameConst::$initialNationGenLimit) $gencount = GameConst::$initialNationGenLimit;
|
||||||
//기술 및 변경횟수 업데이트
|
//기술 및 변경횟수 업데이트
|
||||||
$query = "update nation set tech=totaltech/'$gencount',gennum='$gennum' where nation='{$nation['nation']}'";
|
$query = "update nation set totaltech=tech*'$gencount',gennum='$gennum' where nation='{$nation['nation']}'";
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
}
|
}
|
||||||
pushWorldHistory($history, $admin['year'], $admin['month']);
|
pushWorldHistory($history, $admin['year'], $admin['month']);
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ function process_22(&$general) {
|
|||||||
$history = [];
|
$history = [];
|
||||||
$date = substr($general['turntime'],11,5);
|
$date = substr($general['turntime'],11,5);
|
||||||
|
|
||||||
$admin = $gameStor->getValues(['startyear','year','month','develcost']);
|
$admin = $gameStor->getValues(['startyear','year','month','develcost','join_mode']);
|
||||||
|
|
||||||
$query = "select nation,supply from city where city='{$general['city']}'";
|
$query = "select nation,supply from city where city='{$general['city']}'";
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
@@ -26,7 +26,10 @@ function process_22(&$general) {
|
|||||||
|
|
||||||
$cost = Util::round($admin['develcost'] + ($you['experience'] + $you['dedication'])/1000) * 10;
|
$cost = Util::round($admin['develcost'] + ($you['experience'] + $you['dedication'])/1000) * 10;
|
||||||
|
|
||||||
if(!$you) {
|
if($admin['join_mode'] == 'onlyRandom'){
|
||||||
|
$log[] = "<C>●</>{$admin['month']}월:랜덤 임관만 가능합니다. 등용 실패. <1>$date</>";
|
||||||
|
}
|
||||||
|
else if(!$you) {
|
||||||
$log[] = "<C>●</>{$admin['month']}월:없는 장수입니다. 등용 실패. <1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:없는 장수입니다. 등용 실패. <1>$date</>";
|
||||||
} elseif($admin['year'] < $admin['startyear']+3) {
|
} elseif($admin['year'] < $admin['startyear']+3) {
|
||||||
$log[] = "<C>●</>{$admin['month']}월:초반 제한중입니다. 등용 실패. <1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:초반 제한중입니다. 등용 실패. <1>$date</>";
|
||||||
@@ -70,7 +73,7 @@ function process_25(&$general) {
|
|||||||
$history = [];
|
$history = [];
|
||||||
$date = substr($general['turntime'],11,5);
|
$date = substr($general['turntime'],11,5);
|
||||||
|
|
||||||
$admin = $gameStor->getValues(['startyear', 'year', 'month', 'scenario', 'fiction']);
|
$admin = $gameStor->getValues(['startyear', 'year', 'month', 'scenario', 'fiction', 'join_mode', 'init_year', 'init_month']);
|
||||||
|
|
||||||
$query = "select nation from city where city='{$general['city']}'";
|
$query = "select nation from city where city='{$general['city']}'";
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
@@ -79,12 +82,16 @@ function process_25(&$general) {
|
|||||||
$command = DecodeCommand($general['turn0']);
|
$command = DecodeCommand($general['turn0']);
|
||||||
$where = $command[1];
|
$where = $command[1];
|
||||||
|
|
||||||
|
if($admin['join_mode'] == 'onlyRandom' && $where < 98){
|
||||||
|
$where = 99;
|
||||||
|
}
|
||||||
|
|
||||||
$nation = null;
|
$nation = null;
|
||||||
|
|
||||||
$joinedNations = Json::decode($general['nations']);
|
$joinedNations = Json::decode($general['nations']);
|
||||||
|
|
||||||
// 랜덤임관인 경우
|
// 랜덤임관인 경우
|
||||||
if($general['npc'] > 2 && $where >= 98 && ($admin['scenario'] < 100 || $admin['scenario'] >= 2000 || !$admin['fiction'])){
|
if($general['npc'] >= 2 && $where >= 98 && !$admin['fiction'] && 1000 <= $admin['scenario'] && $admin['scenario'] < 2000){
|
||||||
//'사실' 모드에서는 '성향'에 우선을 두되, 장수수, 랜덤에 비중을 둠
|
//'사실' 모드에서는 '성향'에 우선을 두되, 장수수, 랜덤에 비중을 둠
|
||||||
$nations = $db->query(
|
$nations = $db->query(
|
||||||
'SELECT nation.`name` as `name`,nation.nation as nation,scout,nation.`level` as `level`,gennum,`affinity` FROM nation join general on general.nation = nation.nation and general.level = 12 WHERE nation.nation not in %li and gennum < %i and scout = 0',
|
'SELECT nation.`name` as `name`,nation.nation as nation,scout,nation.`level` as `level`,gennum,`affinity` FROM nation join general on general.nation = nation.nation and general.level = 12 WHERE nation.nation not in %li and gennum < %i and scout = 0',
|
||||||
@@ -126,10 +133,18 @@ function process_25(&$general) {
|
|||||||
|
|
||||||
$allGen = array_sum($generals);
|
$allGen = array_sum($generals);
|
||||||
|
|
||||||
|
$genLimit = GameConst::$defaultMaxGeneral;
|
||||||
|
if($admin['join_mode'] == 'onlyRandom' && TimeUtil::IsRangeMonth($admin['init_year'], $admin['init_month'], 1, $admin['year'], $admin['month'])){
|
||||||
|
$genLimit = GameConst::$initialNationGenLimitForRandInit;
|
||||||
|
}
|
||||||
|
else if($admin['year'] < $admin['startyear'] + 3){
|
||||||
|
$genLimit = GameConst::$initialNationGenLimit;
|
||||||
|
}
|
||||||
|
|
||||||
$nations = $db->query(
|
$nations = $db->query(
|
||||||
'SELECT nation.`name` as `name`,nation.nation as nation,scout,nation.`level` as `level`,gennum,`injury` FROM nation join general on general.nation = nation.nation and general.level = 12 WHERE nation.nation not in %li and gennum < %i and scout = 0',
|
'SELECT nation.`name` as `name`,nation.nation as nation,scout,nation.`level` as `level`,gennum,`injury` FROM nation join general on general.nation = nation.nation and general.level = 12 WHERE nation.nation not in %li and gennum < %i and scout = 0',
|
||||||
$joinedNations,
|
$joinedNations,
|
||||||
($admin['year'] < $admin['startyear']+3)?GameConst::$initialNationGenLimit:GameConst::$defaultMaxGeneral
|
$genLimit
|
||||||
);
|
);
|
||||||
shuffle($nations);
|
shuffle($nations);
|
||||||
|
|
||||||
@@ -152,6 +167,9 @@ function process_25(&$general) {
|
|||||||
if($randVals){
|
if($randVals){
|
||||||
$nation = $nations[Util::choiceRandomUsingWeight($randVals)];
|
$nation = $nations[Util::choiceRandomUsingWeight($randVals)];
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
$nation = null;
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$nation = $db->queryFirstRow('SELECT `name`,nation,scout,`level` FROM nation WHERE nation=%i', $where);
|
$nation = $db->queryFirstRow('SELECT `name`,nation,scout,`level` FROM nation WHERE nation=%i', $where);
|
||||||
@@ -164,6 +182,12 @@ function process_25(&$general) {
|
|||||||
|
|
||||||
if(!$nation) {
|
if(!$nation) {
|
||||||
$log[] = "<C>●</>{$admin['month']}월:임관할 국가가 없습니다. 임관 실패. <1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:임관할 국가가 없습니다. 임관 실패. <1>$date</>";
|
||||||
|
if($where >= 98 && $genLimit == GameConst::$initialNationGenLimitForRandInit){
|
||||||
|
//랜덤 모드, 초기화시에는 랜덤 임관을 대신 한턴 더 넣어준다.
|
||||||
|
$db->update('general', [
|
||||||
|
'turn1'=>EncodeCommand(0, 0, $where, 25),
|
||||||
|
], '`no` = %i', $general['no']);
|
||||||
|
}
|
||||||
} elseif($general['nation'] != 0) {
|
} elseif($general['nation'] != 0) {
|
||||||
$log[] = "<C>●</>{$admin['month']}월:재야가 아닙니다. 임관 실패. <1>$date</>";
|
$log[] = "<C>●</>{$admin['month']}월:재야가 아닙니다. 임관 실패. <1>$date</>";
|
||||||
} elseif($nation['nation'] == 0) {
|
} elseif($nation['nation'] == 0) {
|
||||||
|
|||||||
+3
-3
@@ -282,11 +282,11 @@ else if($session->userGrade == 4){
|
|||||||
<td width=498 class='bg1 center'><b>개인 기록</b></td>
|
<td width=498 class='bg1 center'><b>개인 기록</b></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width=498 style="text-align:left;"><?=getGeneralPublicRecordRecent(15)?></td>
|
<td width=498 id="general_public_record" style="text-align:left;"><?=getGeneralPublicRecordRecent(15)?></td>
|
||||||
<td width=498 style="text-align:left;"><?=getGenLogRecent($me['no'], 15)?></td>
|
<td width=498 id="general_log" style="text-align:left;"><?=getGenLogRecent($me['no'], 15)?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr><td width=998 colspan=2 class='bg1 center'><b>중원 정세</b></td></tr>
|
<tr><td width=998 colspan=2 class='bg1 center'><b>중원 정세</b></td></tr>
|
||||||
<tr><td width=998 colspan=2 style="text-align:left;"><?=getWorldHistoryRecent(15)?></td></tr>
|
<tr><td width=998 id="world_history" colspan=2 style="text-align:left;"><?=getWorldHistoryRecent(15)?></td></tr>
|
||||||
</table>
|
</table>
|
||||||
<div class="message_input_form bg0">
|
<div class="message_input_form bg0">
|
||||||
<select id="mailbox_list" size="1">
|
<select id="mailbox_list" size="1">
|
||||||
|
|||||||
@@ -152,6 +152,20 @@ if($session->userGrade < 5 && !$allowReset){
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group row">
|
||||||
|
<label for="join_mode" class="col-sm-3 col-form-label">임관 모드</label>
|
||||||
|
<div class="col-sm-9">
|
||||||
|
<div id="join_mode" class="btn-group btn-group-toggle" data-toggle="buttons">
|
||||||
|
<label class="btn btn-secondary active">
|
||||||
|
<input type="radio" name="join_mode" value="full" checked>일반
|
||||||
|
</label>
|
||||||
|
<label class="btn btn-secondary">
|
||||||
|
<input type="radio" name="join_mode" value="onlyRandom">랜덤 임관
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="show_img_level" class="col-sm-3 col-form-label">이미지 표기</label>
|
<label for="show_img_level" class="col-sm-3 col-form-label">이미지 표기</label>
|
||||||
<div class="col-sm-9">
|
<div class="col-sm-9">
|
||||||
|
|||||||
@@ -0,0 +1,109 @@
|
|||||||
|
<?php
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
|
include 'lib.php';
|
||||||
|
include 'func.php';
|
||||||
|
|
||||||
|
$session = Session::requireGameLogin([])->setReadOnly();
|
||||||
|
$userID = $session::getUserID();
|
||||||
|
$serverID = UniqueConst::$serverID;
|
||||||
|
|
||||||
|
$image = $_FILES['img'];
|
||||||
|
switch ($image['error']) {
|
||||||
|
case UPLOAD_ERR_OK:
|
||||||
|
break;
|
||||||
|
case UPLOAD_ERR_NO_FILE:
|
||||||
|
Json::die([
|
||||||
|
'result'=>false,
|
||||||
|
'reason'=>'파일이 없습니다.'
|
||||||
|
]);
|
||||||
|
case UPLOAD_ERR_INI_SIZE:
|
||||||
|
case UPLOAD_ERR_FORM_SIZE:
|
||||||
|
Json::die([
|
||||||
|
'result'=>false,
|
||||||
|
'reason'=>'업로드된 파일이 지나치게 큽니다.'
|
||||||
|
]);
|
||||||
|
default:
|
||||||
|
Json::die([
|
||||||
|
'result'=>false,
|
||||||
|
'reason'=>'업로드되지 않았습니다.'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!is_uploaded_file($image['tmp_name'])) {
|
||||||
|
Json::die([
|
||||||
|
'result'=>false,
|
||||||
|
'reason'=>'제대로 파일이 업로드되지 않았습니다.'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if($image['size'] > 1048576) {
|
||||||
|
//파일크기 검사
|
||||||
|
Json::die([
|
||||||
|
'result'=>false,
|
||||||
|
'reason'=>'1MB 이하로 올려주세요!'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$size = getImageSize($image['tmp_name']);
|
||||||
|
|
||||||
|
$imageType = $size[2];
|
||||||
|
$availableImageType = array('.jpg'=>IMAGETYPE_JPEG, '.png'=>IMAGETYPE_PNG, '.gif'=>IMAGETYPE_GIF);
|
||||||
|
$newExt = array_search($imageType, $availableImageType, true);
|
||||||
|
|
||||||
|
if(!$newExt) {
|
||||||
|
Json::die([
|
||||||
|
'result'=>false,
|
||||||
|
'reason'=>'jpg, gif, png 파일이 아닙니다!'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$db = RootDB::db();
|
||||||
|
$imgStor = KVStorage::getStorage($db, 'img_storage');
|
||||||
|
|
||||||
|
$picName = hash_file('md5', $image['tmp_name']);
|
||||||
|
$newPicName = "$picName$newExt";
|
||||||
|
|
||||||
|
$destDir = AppConf::getUserIconPathFS().'/uploaded_image';
|
||||||
|
$dest = $destDir.'/'.$newPicName;
|
||||||
|
|
||||||
|
if(!file_exists($dest)){
|
||||||
|
if (!file_exists($destDir)) {
|
||||||
|
mkdir($destDir);
|
||||||
|
}
|
||||||
|
if(!is_dir($destDir)) {
|
||||||
|
Json::die([
|
||||||
|
'result'=>false,
|
||||||
|
'reason'=>'버그! 업로드 경로 확인!'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
if(!is_writable($destDir)){
|
||||||
|
Json::die([
|
||||||
|
'result'=>false,
|
||||||
|
'reason'=>'버그! 업로드 권한 확인!'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$dest = $destDir.'/'.$newPicName;
|
||||||
|
|
||||||
|
if(!move_uploaded_file($image['tmp_name'], $dest)) {
|
||||||
|
Json::die([
|
||||||
|
'result'=>false,
|
||||||
|
'reason'=>'업로드에 실패했습니다!'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$storedStatus = $imgStor->$newPicName??[];
|
||||||
|
$imgKey = "$serverID:$userID";
|
||||||
|
if(!key_exists($imgKey, $storedStatus)){
|
||||||
|
$storedStatus[$imgKey] = TimeUtil::DatetimeNow();
|
||||||
|
}
|
||||||
|
|
||||||
|
$imgStor->$newPicName = $storedStatus;
|
||||||
|
|
||||||
|
Json::die([
|
||||||
|
'result'=>true,
|
||||||
|
'reason'=>'성공',
|
||||||
|
'path'=>AppConf::getUserIconPathWeb().'/uploaded_image/'.$newPicName
|
||||||
|
]);
|
||||||
+8
-4
@@ -41,6 +41,7 @@ $v->rule('required', [
|
|||||||
'scenario',
|
'scenario',
|
||||||
'fiction',
|
'fiction',
|
||||||
'extend',
|
'extend',
|
||||||
|
'join_mode',
|
||||||
'npcmode',
|
'npcmode',
|
||||||
'show_img_level'
|
'show_img_level'
|
||||||
])->rule('integer', [
|
])->rule('integer', [
|
||||||
@@ -51,8 +52,8 @@ $v->rule('required', [
|
|||||||
'extend',
|
'extend',
|
||||||
'npcmode',
|
'npcmode',
|
||||||
'show_img_level',
|
'show_img_level',
|
||||||
'tournament_trig'
|
'tournament_trig',
|
||||||
]);
|
])->rule('in', 'join_mode', ['onlyRandom', 'full']);
|
||||||
if(!$v->validate()){
|
if(!$v->validate()){
|
||||||
Json::die([
|
Json::die([
|
||||||
'result'=>false,
|
'result'=>false,
|
||||||
@@ -92,6 +93,7 @@ $extend = (int)$_POST['extend'];
|
|||||||
$npcmode = (int)$_POST['npcmode'];
|
$npcmode = (int)$_POST['npcmode'];
|
||||||
$show_img_level = (int)$_POST['show_img_level'];
|
$show_img_level = (int)$_POST['show_img_level'];
|
||||||
$tournament_trig = (int)$_POST['tournament_trig'];
|
$tournament_trig = (int)$_POST['tournament_trig'];
|
||||||
|
$join_mode = $_POST['join_mode'];
|
||||||
|
|
||||||
if($reserve_open){
|
if($reserve_open){
|
||||||
$reserve_open = new \DateTime($reserve_open);
|
$reserve_open = new \DateTime($reserve_open);
|
||||||
@@ -124,7 +126,8 @@ if($reserve_open){
|
|||||||
'npcmode'=>$npcmode,
|
'npcmode'=>$npcmode,
|
||||||
'show_img_level'=>$show_img_level,
|
'show_img_level'=>$show_img_level,
|
||||||
'tournament_trig'=>$tournament_trig,
|
'tournament_trig'=>$tournament_trig,
|
||||||
'gameConf'=>$scenarioObj->getGameConf()
|
'gameConf'=>$scenarioObj->getGameConf(),
|
||||||
|
'join_mode'=>$join_mode,
|
||||||
]),
|
]),
|
||||||
'date'=>$reserve_open->format('Y-m-d H:i:s')
|
'date'=>$reserve_open->format('Y-m-d H:i:s')
|
||||||
]);
|
]);
|
||||||
@@ -143,5 +146,6 @@ Json::die(ResetHelper::buildScenario(
|
|||||||
$extend,
|
$extend,
|
||||||
$npcmode,
|
$npcmode,
|
||||||
$show_img_level,
|
$show_img_level,
|
||||||
$tournament_trig
|
$tournament_trig,
|
||||||
|
$join_mode
|
||||||
));
|
));
|
||||||
+64
-6
@@ -143,18 +143,76 @@ function getIconPath(imgsvr, picture){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
jQuery(function($){
|
function activeFlip($obj){
|
||||||
$('.obj_tooltip').tooltip({
|
var $result;
|
||||||
title:function(){
|
if($obj === undefined){
|
||||||
return $.trim($(this).find('.tooltiptext').html());
|
$result = $('img[data-flip]');
|
||||||
},
|
}
|
||||||
html:true
|
else{
|
||||||
|
$result = $obj.find('img[data-flip]');
|
||||||
|
}
|
||||||
|
|
||||||
|
$result.each(function(){
|
||||||
|
activeFlipItem($(this));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function activeFlipItem($img){
|
||||||
|
var imageList = [];
|
||||||
|
imageList.push($img.attr('src'));
|
||||||
|
$.each($img.data('flip').split(','), function(idx, value){
|
||||||
|
var value = $.trim(value);
|
||||||
|
if(!value){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
imageList.push(value);
|
||||||
|
});
|
||||||
|
if(imageList.length <= 1){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$img.data('computed_flip_array', imageList);
|
||||||
|
$img.data('computed_flip_idx', 0);
|
||||||
|
|
||||||
|
$img.click(function(){
|
||||||
|
var arr = $img.data('computed_flip_array');
|
||||||
|
var idx = $img.data('computed_flip_idx');
|
||||||
|
idx = (idx + 1)%(arr.length);
|
||||||
|
$img.attr('src', arr[idx]);
|
||||||
|
$img.data('computed_flip_idx', idx);
|
||||||
|
});
|
||||||
|
$img.css('cursor','pointer');
|
||||||
|
}
|
||||||
|
|
||||||
|
jQuery(function($){
|
||||||
|
$('.obj_tooltip').each(function(){
|
||||||
|
var $objTooltip = $(this);
|
||||||
|
var tooltipClassText = $objTooltip.data('tooltip-class');
|
||||||
|
if(!tooltipClassText){
|
||||||
|
tooltipClassText = '';
|
||||||
|
}
|
||||||
|
console.log($objTooltip.data('tooltip-class'));
|
||||||
|
var template = '<div class="tooltip {0}" role="tooltip"><div class="arrow"></div><div class="tooltip-inner"></div></div>'
|
||||||
|
.format(tooltipClassText);
|
||||||
|
|
||||||
|
$objTooltip.tooltip({
|
||||||
|
title:function(){
|
||||||
|
return $.trim($(this).find('.tooltiptext').html());
|
||||||
|
},
|
||||||
|
template:template,
|
||||||
|
html:true
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
activeFlip();
|
||||||
|
|
||||||
var customCSS = localStorage.getItem('sam_customCSS');
|
var customCSS = localStorage.getItem('sam_customCSS');
|
||||||
if(customCSS){
|
if(customCSS){
|
||||||
var $style = $('<style type="text/css"></style>');
|
var $style = $('<style type="text/css"></style>');
|
||||||
$style.text(customCSS);
|
$style.text(customCSS);
|
||||||
$style.appendTo($('head'));
|
$style.appendTo($('head'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
+58
-1
@@ -15,6 +15,12 @@ jQuery(function($){
|
|||||||
function enableEditor(){
|
function enableEditor(){
|
||||||
editMode = true;
|
editMode = true;
|
||||||
$cancelEdit.show();
|
$cancelEdit.show();
|
||||||
|
|
||||||
|
var inputText = $noticeInput.val();
|
||||||
|
if(!inputText || inputText == '<p></p>'){
|
||||||
|
inputText = '<p><br></p>';
|
||||||
|
}
|
||||||
|
|
||||||
$editForm.removeClass('viewer').summernote({
|
$editForm.removeClass('viewer').summernote({
|
||||||
minHeight:200,
|
minHeight:200,
|
||||||
maxHeight:null,
|
maxHeight:null,
|
||||||
@@ -31,10 +37,59 @@ jQuery(function($){
|
|||||||
['para', ['ul', 'ol', 'paragraph']],
|
['para', ['ul', 'ol', 'paragraph']],
|
||||||
['height', ['height', 'codeview']]
|
['height', ['height', 'codeview']]
|
||||||
],
|
],
|
||||||
|
popover: {
|
||||||
|
image: [
|
||||||
|
['imagesize', ['imageSize100', 'imageSize50', 'imageSize25']],
|
||||||
|
['float', ['floatLeft', 'floatRight', 'floatNone']],
|
||||||
|
['remove', ['removeMedia']],
|
||||||
|
['custom', ['imageFlip']],
|
||||||
|
],
|
||||||
|
},
|
||||||
fontNames: ['맑은 고딕', 'Nanum Gothic', 'Nanum Myeongjo', 'Nanum Pen Script', '굴림', '굴림체', '바탕', '바탕체', '궁서', '궁서체'],
|
fontNames: ['맑은 고딕', 'Nanum Gothic', 'Nanum Myeongjo', 'Nanum Pen Script', '굴림', '굴림체', '바탕', '바탕체', '궁서', '궁서체'],
|
||||||
fontSizes: ['8', '9', '10', '11', '12', '14', '16', '20', '24', '28', '32', '36', '40', '46', '52', '60'],
|
fontSizes: ['8', '9', '10', '11', '12', '14', '16', '20', '24', '28', '32', '36', '40', '46', '52', '60'],
|
||||||
|
callbacks: {
|
||||||
|
onImageUpload: function(files) {
|
||||||
|
$editForm.summernote('saveRange');
|
||||||
|
if(files.length == 0){
|
||||||
|
alert('업로드된 파일이 없습니다.');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}).summernote('code', $noticeInput.val());
|
var formData = new FormData();
|
||||||
|
formData.append('img', files[0]);
|
||||||
|
$editForm.summernote("pasteHtml", '');
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type:'post',
|
||||||
|
url:'j_image_upload.php',
|
||||||
|
dataType:'json',
|
||||||
|
contentType: false,
|
||||||
|
processData:false,
|
||||||
|
data:formData
|
||||||
|
}).then(function(result){
|
||||||
|
if(!result.result){
|
||||||
|
alert(result.reason);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log($editForm.summernote('code'));
|
||||||
|
if($editForm.summernote('isEmpty')){
|
||||||
|
|
||||||
|
console.log('haha?');
|
||||||
|
var $img = $('<img>');
|
||||||
|
$img.attr('src', result.path);
|
||||||
|
$editForm.summernote('code', $img);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$editForm.summernote("insertImage", result.path, result.path);
|
||||||
|
|
||||||
|
},function(){
|
||||||
|
alert('알 수 없는 이유로 아이콘 업로드를 실패했습니다.');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).summernote('code', inputText);
|
||||||
}
|
}
|
||||||
|
|
||||||
function disableEditor(){
|
function disableEditor(){
|
||||||
@@ -42,10 +97,12 @@ jQuery(function($){
|
|||||||
$editForm.summernote('destroy');
|
$editForm.summernote('destroy');
|
||||||
$cancelEdit.hide();
|
$cancelEdit.hide();
|
||||||
$editForm.html($noticeInput.val()).addClass('viewer');
|
$editForm.html($noticeInput.val()).addClass('viewer');
|
||||||
|
activeFlip($editForm);
|
||||||
}
|
}
|
||||||
|
|
||||||
$cancelEdit.hide();
|
$cancelEdit.hide();
|
||||||
$editForm.html($noticeInput.val());
|
$editForm.html($noticeInput.val());
|
||||||
|
activeFlip($editForm);
|
||||||
if(editable){
|
if(editable){
|
||||||
$submitBtn.prop('disabled', false);
|
$submitBtn.prop('disabled', false);
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-2
@@ -114,7 +114,8 @@ function formSetup(){
|
|||||||
extend:"required",
|
extend:"required",
|
||||||
npcmode:"required",
|
npcmode:"required",
|
||||||
show_img_level:"required",
|
show_img_level:"required",
|
||||||
tournament_trig:"required"
|
tournament_trig:"required",
|
||||||
|
join_mode:'required',
|
||||||
},
|
},
|
||||||
errorElement: "div",
|
errorElement: "div",
|
||||||
errorPlacement: function ( error, element ) {
|
errorPlacement: function ( error, element ) {
|
||||||
@@ -153,7 +154,8 @@ function formSetup(){
|
|||||||
npcmode:$('#npcmode input:radio:checked').val(),
|
npcmode:$('#npcmode input:radio:checked').val(),
|
||||||
show_img_level:$('#show_img_level input:radio:checked').val(),
|
show_img_level:$('#show_img_level input:radio:checked').val(),
|
||||||
tournament_trig:$('#tournament_trig input:radio:checked').val(),
|
tournament_trig:$('#tournament_trig input:radio:checked').val(),
|
||||||
reserve_open:$('#reserve_open').val()
|
reserve_open:$('#reserve_open').val(),
|
||||||
|
join_mode:$('#join_mode input:radio:checked').val(),
|
||||||
}
|
}
|
||||||
}).then(function(result){
|
}).then(function(result){
|
||||||
var deferred = $.Deferred();
|
var deferred = $.Deferred();
|
||||||
|
|||||||
@@ -173,4 +173,16 @@ jQuery(function($){
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var randomGenType = Math.floor(Math.random()*7);
|
||||||
|
if(randomGenType < 3){
|
||||||
|
abilityLeadpow();
|
||||||
|
}
|
||||||
|
else if(randomGenType < 6){
|
||||||
|
abilityLeadint();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
abilityPowint();
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -90,6 +90,32 @@ function reloadWorldMap(option){
|
|||||||
$map_title.css('color', 'yellow');
|
$map_title.css('color', 'yellow');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$map_title_tooltip = $('.map_title .tooltiptext');
|
||||||
|
$map_title_tooltip.empty();
|
||||||
|
|
||||||
|
var tooltipTexts = [];
|
||||||
|
if(year < startYear + 3){
|
||||||
|
var startYearText = [];
|
||||||
|
var remainYear = startYear + 3 - year;
|
||||||
|
var remainMonth = 12 - month + 1;
|
||||||
|
if(remainMonth > 0){
|
||||||
|
remainYear -= 1;
|
||||||
|
}
|
||||||
|
if(remainYear){
|
||||||
|
startYearText.push('{0}년'.format(remainYear));
|
||||||
|
}
|
||||||
|
if(remainMonth){
|
||||||
|
startYearText.push('{0}개월'.format(remainMonth));
|
||||||
|
}
|
||||||
|
|
||||||
|
tooltipTexts.push('초반제한 기간 : {0} ({1}년)'.format(startYearText.join(' '), startYear + 3));
|
||||||
|
}
|
||||||
|
|
||||||
|
var currentTechLimit = Math.floor(Math.max(0, year - startYear) / 5) + 1;
|
||||||
|
var nextTechLimitYear = currentTechLimit * 5 + startYear;
|
||||||
|
|
||||||
|
tooltipTexts.push('기술등급 제한 : {0}등급 ({1}년 해제)'.format(currentTechLimit, nextTechLimitYear, currentTechLimit+1));
|
||||||
|
$map_title_tooltip.html(tooltipTexts.join('<br>'));
|
||||||
|
|
||||||
$world_map.removeClass('map_string map_summer map_fall map_winter');
|
$world_map.removeClass('map_string map_summer map_fall map_winter');
|
||||||
if(month <= 3){
|
if(month <= 3){
|
||||||
|
|||||||
+8
-7
@@ -31,7 +31,7 @@ function processWar(array $rawAttacker, array $rawDefenderCity){
|
|||||||
}
|
}
|
||||||
|
|
||||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
[$startYear, $year, $month, $cityRate] = $gameStor->getValuesAsArray(['startyear', 'year', 'month', 'city_rate']);
|
[$startYear, $year, $month, $cityRate, $joinMode] = $gameStor->getValuesAsArray(['startyear', 'year', 'month', 'city_rate', 'join_mode']);
|
||||||
|
|
||||||
$attacker = new WarUnitGeneral($rawAttacker, $rawAttackerCity, $rawAttackerNation, true, $year, $month);
|
$attacker = new WarUnitGeneral($rawAttacker, $rawAttackerCity, $rawAttackerNation, true, $year, $month);
|
||||||
|
|
||||||
@@ -154,7 +154,8 @@ function processWar(array $rawAttacker, array $rawDefenderCity){
|
|||||||
'startyear'=>$startYear,
|
'startyear'=>$startYear,
|
||||||
'year'=>$year,
|
'year'=>$year,
|
||||||
'month'=>$month,
|
'month'=>$month,
|
||||||
'city_rate'=>$cityRate
|
'city_rate'=>$cityRate,
|
||||||
|
'join_mode'=>$joinMode,
|
||||||
], $attacker->getRaw(), $city->getRaw(), $rawAttackerNation, $rawDefenderNation);
|
], $attacker->getRaw(), $city->getRaw(), $rawAttackerNation, $rawDefenderNation);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -183,9 +184,9 @@ function extractBattleOrder($general){
|
|||||||
$general['leader'] +
|
$general['leader'] +
|
||||||
$general['power'] +
|
$general['power'] +
|
||||||
$general['intel'] +
|
$general['intel'] +
|
||||||
$general['weap'] +
|
getWeapEff($general['weap']) +
|
||||||
$general['horse'] +
|
getHorseEff($general['horse']) +
|
||||||
$general['book'] +
|
getBookEff($general['book']) +
|
||||||
$general['crew'] / 100
|
$general['crew'] / 100
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -560,7 +561,7 @@ function ConquerCity($admin, $general, $city, $nation, $destnation) {
|
|||||||
$loseGeneralRice += $loseRice;
|
$loseGeneralRice += $loseRice;
|
||||||
|
|
||||||
//모두 등용장 발부
|
//모두 등용장 발부
|
||||||
if(Util::randBool(0.5)) {
|
if($admin['join_mode'] != 'onlyRandom' && Util::randBool(0.5)) {
|
||||||
$msg = ScoutMessage::buildScoutMessage($general['no'], $gen['no']);
|
$msg = ScoutMessage::buildScoutMessage($general['no'], $gen['no']);
|
||||||
if($msg){
|
if($msg){
|
||||||
$msg->send(true);
|
$msg->send(true);
|
||||||
@@ -568,7 +569,7 @@ function ConquerCity($admin, $general, $city, $nation, $destnation) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//NPC인 경우 10% 확률로 임관(엔장, 인재, 의병)
|
//NPC인 경우 10% 확률로 임관(엔장, 인재, 의병)
|
||||||
if($gen['npc'] >= 2 && $gen['npc'] <= 8 && rand() % 100 < 10) {
|
if($admin['join_mode'] != 'onlyRandom' && $gen['npc'] >= 2 && $gen['npc'] <= 8 && rand() % 100 < 10) {
|
||||||
$commissionCommand = EncodeCommand(0, 0, $nation['nation'], 25); //임관
|
$commissionCommand = EncodeCommand(0, 0, $nation['nation'], 25); //임관
|
||||||
$query = "update general set turn0='$commissionCommand' where no={$gen['no']}";
|
$query = "update general set turn0='$commissionCommand' where no={$gen['no']}";
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
|
|||||||
+38
-29
@@ -686,6 +686,9 @@ function command_25($turn, $command) {
|
|||||||
$connect=$db->get();
|
$connect=$db->get();
|
||||||
$userID = Session::getUserID();
|
$userID = Session::getUserID();
|
||||||
|
|
||||||
|
$gameStor->cacheValues(['year','startyear','month','join_mode']);
|
||||||
|
|
||||||
|
$onlyRandom = $gameStor->join_mode == 'onlyRandom';
|
||||||
starter("임관");
|
starter("임관");
|
||||||
|
|
||||||
$query = "select no,nations from general where owner='{$userID}'";
|
$query = "select no,nations from general where owner='{$userID}'";
|
||||||
@@ -700,11 +703,30 @@ function command_25($turn, $command) {
|
|||||||
|
|
||||||
$nationList = $db->query('SELECT nation,`name`,color,scout,scoutmsg,gennum FROM nation ORDER BY rand()');
|
$nationList = $db->query('SELECT nation,`name`,color,scout,scoutmsg,gennum FROM nation ORDER BY rand()');
|
||||||
|
|
||||||
echo "
|
foreach($nationList as $nation){
|
||||||
|
if ($onlyRandom && TimeUtil::IsRangeMonth($gameStor->init_year, $gameStor->init_month, 1, $gameStor->year, $gameStor->month) && $nation['gennum'] >= GameConst::$initialNationGenLimitForRandInit) {
|
||||||
|
$nation['availableJoin'] = false;
|
||||||
|
}
|
||||||
|
else if($gameStor->year < $gameStor->startyear+3 && $nation['gennum'] >= GameConst::$initialNationGenLimit){
|
||||||
|
$nation['availableJoin'] = false;
|
||||||
|
}
|
||||||
|
else if($nation['scout'] == 1) {
|
||||||
|
$nation['availableJoin'] = false;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$nation['availableJoin'] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
국가에 임관합니다.<br>
|
국가에 임관합니다.<br>
|
||||||
이미 임관/등용되었던 국가는 다시 임관할 수 없습니다.<br>
|
이미 임관/등용되었던 국가는 다시 임관할 수 없습니다.<br>
|
||||||
바로 군주의 위치로 이동합니다.<br>
|
바로 군주의 위치로 이동합니다.<br>
|
||||||
|
<?php if($onlyRandom): ?>
|
||||||
|
랜덤 임관 대상 국가는 아래에서 확인할 수 있습니다.<br>
|
||||||
|
<?php else: ?>
|
||||||
임관할 국가를 목록에서 선택하세요.<br>
|
임관할 국가를 목록에서 선택하세요.<br>
|
||||||
|
<?php endif; ?>
|
||||||
!!!는 방랑군을 포함한 랜덤임관입니다. 유니크를 기대하신다면!<br>
|
!!!는 방랑군을 포함한 랜덤임관입니다. 유니크를 기대하신다면!<br>
|
||||||
???는 방랑군을 제외한 랜덤임관입니다. 유니크 혜택은 없습니다.<br>
|
???는 방랑군을 제외한 랜덤임관입니다. 유니크 혜택은 없습니다.<br>
|
||||||
임관 금지이거나 초기 제한중인 국가는 붉은색 배경으로 표시됩니다.<br>
|
임관 금지이거나 초기 제한중인 국가는 붉은색 배경으로 표시됩니다.<br>
|
||||||
@@ -712,37 +734,24 @@ function command_25($turn, $command) {
|
|||||||
<form name=form1 action=c_double.php method=post>
|
<form name=form1 action=c_double.php method=post>
|
||||||
<select name=double size=1 style=color:white;background-color:black>
|
<select name=double size=1 style=color:white;background-color:black>
|
||||||
<option value=99 style=color:white;background-color:black;>!!!</option>
|
<option value=99 style=color:white;background-color:black;>!!!</option>
|
||||||
<option value=98 style=color:white;background-color:black;>???</option>";
|
<option value=98 style=color:white;background-color:black;>???</option>
|
||||||
|
|
||||||
$scoutStr = "";
|
<?php foreach($nationList as $nation): ?>
|
||||||
foreach($nationList as $nation){
|
<?php if($nation['availableJoin']): ?>
|
||||||
if($gameStor->year < $gameStor->startyear+3 && $nation['gennum'] >= GameConst::$initialNationGenLimit) {
|
<option value='<?=$nation['nation']?>' style='color:<?=$nation['color']?>;background-color:red;' <?=$onlyRandom?'disabled':''?>>【 <?=$nation['name']?> 】</option>
|
||||||
echo "
|
<?php else: ?>
|
||||||
<option value={$nation['nation']} style=color:{$nation['color']};background-color:red;>【 {$nation['name']} 】</option>";
|
<option value='<?=$nation['nation']?>' style='color:<?=$nation['color']?>;' <?=$onlyRandom?'disabled':''?>>【 <?=$nation['name']?> 】</option>
|
||||||
} elseif($nation['scout'] == 1) {
|
<?php endif; ?>
|
||||||
echo "
|
<?php endforeach; ?>
|
||||||
<option value={$nation['nation']} style=color:{$nation['color']};background-color:red;>【 {$nation['name']} 】</option>";
|
|
||||||
} elseif(in_array($nation['nation'], $joinedNations)) {
|
|
||||||
/*
|
|
||||||
echo "
|
|
||||||
<option value={$nation['nation']} style=color:{$nation['color']};background-color:red; disabled>【 {$nation['name']} 】</option>";
|
|
||||||
*/
|
|
||||||
} else {
|
|
||||||
echo "
|
|
||||||
<option value={$nation['nation']} style=color:{$nation['color']};>【 {$nation['name']} 】</option>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
echo "
|
|
||||||
</select>
|
</select>
|
||||||
<input type=submit value=임관>
|
<input type=submit value=임관>
|
||||||
<input type=hidden name=command value=$command>";
|
<input type=hidden name=command value=<?=$command?>>
|
||||||
for($i=0; $i < count($turn); $i++) {
|
<?php foreach(range(0, count(turn) - 1) as $i): ?>
|
||||||
echo "
|
<input type=hidden name=turn[] value=<?=$turn[$i]?>>
|
||||||
<input type=hidden name=turn[] value=$turn[$i]>";
|
<?php endforeach; ?>
|
||||||
}
|
</form>
|
||||||
|
<?php
|
||||||
echo "
|
|
||||||
</form>";
|
|
||||||
echo getInvitationList($nationList);
|
echo getInvitationList($nationList);
|
||||||
|
|
||||||
ender();
|
ender();
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class GameConstBase
|
|||||||
/** @var float 훈련시 사기 감소율*/
|
/** @var float 훈련시 사기 감소율*/
|
||||||
public static $atmosSideEffectByTraining = 1;
|
public static $atmosSideEffectByTraining = 1;
|
||||||
/** @var float 계략 기본 성공률*/
|
/** @var float 계략 기본 성공률*/
|
||||||
public static $sabotageDefaultProb = 0.15;
|
public static $sabotageDefaultProb = 0.35;
|
||||||
/** @var int 계략시 확률 가중치(수치가 클수록 변화가 적음 : (지력차/$firing + $basefiring)*/
|
/** @var int 계략시 확률 가중치(수치가 클수록 변화가 적음 : (지력차/$firing + $basefiring)*/
|
||||||
public static $sabotageProbCoefByStat = 300;
|
public static $sabotageProbCoefByStat = 300;
|
||||||
/** @var int 계략시 최소 수치 감소량*/
|
/** @var int 계략시 최소 수치 감소량*/
|
||||||
@@ -74,6 +74,9 @@ class GameConstBase
|
|||||||
/** @var int 최대 기술 레벨 */
|
/** @var int 최대 기술 레벨 */
|
||||||
public static $maxTechLevel = 12;
|
public static $maxTechLevel = 12;
|
||||||
|
|
||||||
|
/** @var int 초기 제한시 장수 제한 */
|
||||||
|
public static $initialNationGenLimitForRandInit = 3;
|
||||||
|
|
||||||
/** @var int 초기 제한시 장수 제한 */
|
/** @var int 초기 제한시 장수 제한 */
|
||||||
public static $initialNationGenLimit = 10;
|
public static $initialNationGenLimit = 10;
|
||||||
|
|
||||||
|
|||||||
@@ -107,7 +107,8 @@ class ResetHelper{
|
|||||||
int $extend,
|
int $extend,
|
||||||
int $npcmode,
|
int $npcmode,
|
||||||
int $show_img_level,
|
int $show_img_level,
|
||||||
int $tournament_trig
|
int $tournament_trig,
|
||||||
|
string $join_mode
|
||||||
):array{
|
):array{
|
||||||
//FIXME: 분리할 것
|
//FIXME: 분리할 것
|
||||||
if(120 % $turnterm != 0){
|
if(120 % $turnterm != 0){
|
||||||
@@ -193,6 +194,8 @@ class ResetHelper{
|
|||||||
'startyear'=>$startyear,
|
'startyear'=>$startyear,
|
||||||
'year'=> $year,
|
'year'=> $year,
|
||||||
'month'=> $month,
|
'month'=> $month,
|
||||||
|
'init_year'=> $year,
|
||||||
|
'init_month'=>$month,
|
||||||
'map_theme' => $scenarioObj->getMapTheme(),
|
'map_theme' => $scenarioObj->getMapTheme(),
|
||||||
'msg'=>'공지사항',//TODO:공지사항
|
'msg'=>'공지사항',//TODO:공지사항
|
||||||
'maxgeneral'=>GameConst::$defaultMaxGeneral,
|
'maxgeneral'=>GameConst::$defaultMaxGeneral,
|
||||||
@@ -207,6 +210,7 @@ class ResetHelper{
|
|||||||
'killturn'=>$killturn,
|
'killturn'=>$killturn,
|
||||||
'genius'=>GameConst::$defaultMaxGenius,
|
'genius'=>GameConst::$defaultMaxGenius,
|
||||||
'show_img_level'=>$show_img_level,
|
'show_img_level'=>$show_img_level,
|
||||||
|
'join_mode'=>$join_mode,
|
||||||
'npcmode'=>$npcmode,
|
'npcmode'=>$npcmode,
|
||||||
'extended_general'=>$extend,
|
'extended_general'=>$extend,
|
||||||
'fiction'=>$fiction,
|
'fiction'=>$fiction,
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
<div class="world_map map_theme_<?=$mapTheme?> draw_required">
|
<div class="world_map map_theme_<?=$mapTheme?> draw_required">
|
||||||
<div class="map_title">
|
<div class="map_title obj_tooltip" data-toggle="tooltip" data-placement="top" data-tooltip-class="map_title_tooltiptext">
|
||||||
<span class="map_title_text">
|
<span class="map_title_text ">
|
||||||
</span>
|
</span>
|
||||||
|
<span class="tooltiptext"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="map_body">
|
<div class="map_body">
|
||||||
<div class="map_bglayer1"></div>
|
<div class="map_bglayer1"></div>
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ function createOTPbyUserNO(int $userNo):bool{
|
|||||||
function createOTP(string $accessToken):?array{
|
function createOTP(string $accessToken):?array{
|
||||||
$restAPI = new Kakao_REST_API_Helper($accessToken);
|
$restAPI = new Kakao_REST_API_Helper($accessToken);
|
||||||
|
|
||||||
$OTPValue = Util::randRangeInt(10000, 99999);
|
$OTPValue = Util::randRangeInt(1000, 9999);
|
||||||
$OTPTrialUntil = TimeUtil::DatetimeFromNowSecond(180);
|
$OTPTrialUntil = TimeUtil::DatetimeFromNowSecond(180);
|
||||||
|
|
||||||
$sendResult = $restAPI->talk_to_me_default([
|
$sendResult = $restAPI->talk_to_me_default([
|
||||||
|
|||||||
@@ -63,4 +63,30 @@ class TimeUtil
|
|||||||
{
|
{
|
||||||
return date('H:i:s', strtotime('00:00:00') + $second);
|
return date('H:i:s', strtotime('00:00:00') + $second);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* $baseYear, $baseMonth 부터 $afterMonth 개월 이내인지. $afterMonth 포함.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public static function IsRangeMonth(int $baseYear, int $baseMonth, int $afterMonth, int $askYear, int $askMonth):bool{
|
||||||
|
if($baseMonth < 1 || $baseMonth > 12){
|
||||||
|
throw new \InvalidArgumentException('개월이 올바르지 않음');
|
||||||
|
}
|
||||||
|
if($askMonth < 1 || $askMonth > 12){
|
||||||
|
throw new \InvalidArgumentException('개월이 올바르지 않음');
|
||||||
|
}
|
||||||
|
|
||||||
|
$minMonth = $baseYear * 12 + $baseMonth;
|
||||||
|
if($afterMonth < 0){
|
||||||
|
$maxMonth = $minMonth;
|
||||||
|
$minMonth = $maxMonth - $afterMonth;
|
||||||
|
}
|
||||||
|
|
||||||
|
$maxMonth = $minMonth + $afterMonth;
|
||||||
|
$askMonth = $askYear * 12 + $askMonth;
|
||||||
|
if($askMonth < $minMonth || $maxMonth < $askMonth){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -132,11 +132,16 @@ class WebUtil
|
|||||||
}
|
}
|
||||||
|
|
||||||
$config = \HTMLPurifier_HTML5Config::createDefault();
|
$config = \HTMLPurifier_HTML5Config::createDefault();
|
||||||
|
$def = $config->getHTMLDefinition();
|
||||||
|
$def->info_global_attr['data-flip'] = new \HTMLPurifier_AttrDef_Text;
|
||||||
$purifier = new \HTMLPurifier($config);
|
$purifier = new \HTMLPurifier($config);
|
||||||
return $purifier->purify($text);
|
return $purifier->purify($text);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function drawMenu(string $path): string{
|
public static function drawMenu(string $path): string{
|
||||||
|
if(!file_exists($path)){
|
||||||
|
return '';
|
||||||
|
}
|
||||||
$json = Json::decode(file_get_contents($path));
|
$json = Json::decode(file_get_contents($path));
|
||||||
|
|
||||||
$result = [];
|
$result = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user