Compare commits

..
Author SHA1 Message Date
Hide_D f2a785f2fc imagePull 기능 추가, 인스톨러 완성 2019-09-23 00:28:15 +09:00
Hide_D 6fafcfae4e 훈사 분리 2019-09-21 23:27:43 +09:00
Hide_D 33e075f669 훈사를 분리 2019-09-21 21:29:20 +09:00
Hide_D e5fc467c4e 버그 수정 2019-09-21 21:04:17 +09:00
Hide_D b7a5de49c6 표기 일부 변경 2019-09-21 18:09:37 +09:00
Hide_D 3f145abd6f 모훈사 기준을 징병 6회로 변경 2019-09-21 17:39:13 +09:00
Hide_D 4612834870 워프 기준, 쌀 삼팜 기준 변경 2019-09-21 14:41:23 +09:00
Hide_D 83c5609fad 징병 버그 수정 2 2019-09-21 11:42:10 +09:00
Hide_D d142056098 징병 안되는 버그 수정 2019-09-21 11:39:51 +09:00
Hide_D 4d8ecf4191 진짜로 삭턴 버그 수정 2019-09-21 02:44:00 +09:00
Hide_D af6c3f466d 삭턴 버그 수정 2019-09-21 02:38:06 +09:00
Hide_D 033a2d8674 삭턴 버그 수정 2019-09-21 02:35:15 +09:00
Hide_D 9079788b2b 삭턴 기준 변경 2019-09-21 02:33:39 +09:00
Hide_D 44ddb2e480 git fetch에도 -q 2019-09-21 02:28:49 +09:00
Hide_D 295ba84071 자동 행동 세부를 툴팁으로 2019-09-21 02:27:05 +09:00
Hide_D 8773250aab 초기 병종이 보병일 때 고정되는 버그 수정 2019-09-21 02:14:25 +09:00
Hide_D c5a4602fe1 옵션 표기 버그 수정 2019-09-21 02:11:54 +09:00
Hide_D 5f4c43baf6 Merge branch 'devel' into autorun 2019-09-21 02:07:26 +09:00
Hide_D 0ef3921e17 update 서버 변경 2019-09-21 02:06:49 +09:00
Hide_D efcf0f772e server checkout 추가2 2019-09-21 01:50:36 +09:00
Hide_D ccabe847bb 루트도 git tree-ish 지정 가능 2019-09-21 01:42:21 +09:00
Hide_D 45ed63ffe3 버그 수정 2019-09-21 01:38:29 +09:00
Hide_D 7bebbe3a16 징병, 모병 추가 2019-09-21 01:09:17 +09:00
Hide_D 53ba1db79f autorun_user 초기 세팅 2019-09-20 02:12:42 +09:00
Hide_D 76c306a122 npc AI를 '사전 턴' 수행 이후에 처리하도록 변경 2019-09-20 00:41:38 +09:00
Hide_D 89c2c163cb 서버 정보에 자동행동 표기 2019-09-20 00:35:13 +09:00
Hide_D 8826061266 autorun_user 인자 세팅 2019-09-20 00:05:40 +09:00
Hide_D e684877c94 리셋 화면에서 '휴식 턴 시 장수 턴' 추가 2019-09-19 02:21:51 +09:00
Hide_D 12c8152901 docker 메시지 수정 2019-09-19 01:16:21 +09:00
Hide_D 8ba20bf4d2 Docker를 이용한 설치 안내 2019-09-15 23:25:11 +09:00
Hide_D 0bc1ad09d1 년도 변경 2019-09-15 23:19:04 +09:00
Hide_D 231c79132a run_daemon 1분 유지 수정 2019-09-15 20:59:35 +09:00
Hide_D 089803c599 cron 수정 2019-09-15 20:53:23 +09:00
Hide_D 4ea373aff6 gitignore change 2019-09-15 20:08:57 +09:00
Hide_D 0d94b8c742 Merge branch 'devel' of ssh://storage.hided.net:2525/devsam/core into devel 2019-09-15 19:49:32 +09:00
Hide_D d444f19043 date_default_timezone_set 해제 2019-09-15 19:49:24 +09:00
Hide_D 87a0e73c96 인스톨러 버그 수정 2019-09-15 02:59:38 +09:00
Hide_D b5922095f0 인스톨러 임시 트윅 2019-09-15 02:50:10 +09:00
Hide_D 3fee29e9e9 setup_db에서 global_salt 추가 2019-09-15 00:55:57 +09:00
Hide_D 4e351b3be8 Merge branch 'devel' of ssh://storage.hided.net:2525/devsam/core into devel 2019-09-15 00:38:00 +09:00
Hide_D 3432b900df 설치 직후 기본 gitpath 변경 2019-09-15 00:37:46 +09:00
Hide_D fb7c67f317 빙의 안되는 버그 수정, 가입/빙의 시 락 2019-08-18 18:01:11 +09:00
Hide_D 28d5a5c39a 장수 생성시 빠르게 쿼리를 날려 중복 생성하는 것이 불가능하도록 2019-08-18 17:50:38 +09:00
Hide_D e2754511d9 부대탈퇴 시 propergation 처리 실수 수정 2019-08-18 00:46:39 +09:00
Hide_D 71d179de76 서버 시간을 더 정교하게 반영하도록 수정 2019-08-16 23:42:46 +09:00
Hide_D 08523852da 마지막 남은 iframe 안녕!!! 2019-08-16 23:27:28 +09:00
Hide_D 3dd52942d2 부대 명령을 json api로 변경 2019-08-16 22:16:28 +09:00
Hide_D bb24e45028 서버가 오픈되지 않으면 벌점이 늘지 않도록 변경 2019-08-15 19:37:03 +09:00
Hide_D f8c72a6a0a NPC기술연구 관련 마저 고침 2019-08-15 16:10:39 +09:00
Hide_D fa246ff810 단순 건국 상품 롤백 2019-08-15 00:37:49 +09:00
Hide_D 1a1d384a3e 최종 보정 수정 2019-08-14 01:36:41 +09:00
Hide_D 6d85c609fd 동시에 관직이 여러번 뛸때에도 관직 보상 많이 줌 2019-08-14 01:33:50 +09:00
Hide_D e1b8dde60a 보정 롤백 2019-08-14 01:27:37 +09:00
Hide_D e8d32eef4e 작위보상의 수뇌 보정을 낮춤 2019-08-14 01:26:05 +09:00
Hide_D ec0fa686a9 여유를 '절대 시간' 으로 변경 2019-08-14 01:00:10 +09:00
Hide_D 7604273c1a 삭턴에 조금 여유를 줌 2019-08-14 00:58:56 +09:00
Hide_D 00db927ce7 작위 보상 추가 2019-08-14 00:55:45 +09:00
Hide_D 9fea24f0f6 건국 즉시 얻는 템 삭제, 유니크 복권 리팩토링, '고정된 한개'를 주는 유니크 복권 추가 2019-08-14 00:27:36 +09:00
Hide_D c903ce929f 서버 정보 추가 제공 2019-08-13 23:37:46 +09:00
Hide_D d48d9f85b3 가오픈시 별도 표기 추가 2019-08-13 23:24:05 +09:00
Hide_D 5bdf7ba316 가오픈시 삭제는 유저장만 가능하도록 변경 2019-08-13 02:24:58 +09:00
Hide_D 518c74736f 가 오픈기간내 장수 삭제/빙의해제 가능 2019-08-13 02:23:27 +09:00
Hide_D 223d2cf786 서버 가오픈시 대비 넉넉하게 시간 제공 2019-08-13 01:30:41 +09:00
Hide_D cfa2cff34a NPC의 기술 연구 기준을 '기술제한이 아니면'으로 변경 2019-08-13 00:20:07 +09:00
Hide_D 26eacfe795 랜임 버그 핫픽스 2019-07-18 21:21:58 +09:00
Hide_D b1b937ee31 (6턴 제외) 삭턴사시 본닉 공개 2019-07-17 23:32:59 +09:00
Hide_D 122479158c '장수를 따라' 임관하는 기능 추가 2019-07-17 23:06:20 +09:00
Hide_D 0af5e9ec84 외교권자 임명 시 내부적으로 warning뜨는 버그 수정 2019-07-17 21:19:34 +09:00
Hide_D cb5414f789 youtube, vimeo iframe 가능하도록 변경 2019-07-17 21:12:25 +09:00
sars 224cb1b913 server_title id 추가 2019-07-10 19:52:29 -07:00
sars 8bd84cc701 serverCnt 변수로 지정 2019-07-10 19:39:25 -07:00
sars a14dcf8b3e 깃수 출력 2019-07-10 15:27:44 -07:00
Hide_D a1a26bf8fe 훈련,사기템 효과 두배 증가, 철벽서 버그 수정 2019-06-21 10:06:05 +09:00
Hide_D fea229c4ad 사령부 턴 높이 늘림 2019-06-21 09:58:17 +09:00
Hide_D 7040d940ac 왕조 일람 정보 추가 2019-06-21 09:55:40 +09:00
Hide_D a576d72335 메인 페이지 부대 이름 관련 보조정보 추가 2019-06-21 09:51:39 +09:00
Hide_D 5aab373d20 발령, 포상, 몰수에서 보조 데이터 추가 2019-06-21 09:29:33 +09:00
Hide_D 32f8160eb2 시즌 값 추가 2019-06-18 03:32:14 +09:00
Hide_D 701355beb3 시즌 별 검색 기능 추가, 기본 값으로 현재 시즌 표기 2019-06-18 03:30:09 +09:00
Hide_D 28de7c517b UniqueConst와 game_env에 seasonIdx 추가 2019-06-18 03:12:36 +09:00
Hide_D 7365ca7a64 숙련전환 커맨드 추가 2019-06-16 04:42:43 +09:00
Hide_D 2a61813b67 스1 시나리오 업데이트 2019-06-14 23:55:43 +09:00
Hide_D 85e9223603 서버의 오픈 시간을 기록했으므로 변경 2019-05-09 02:00:25 +09:00
Hide_D 943e2be676 커맨드 창에서 가오픈 때문에 턴이 이상하게 보이는 버그 수정 2019-05-09 01:59:06 +09:00
Hide_D 2f09df7521 가오픈 일자 표시 2019-05-09 01:34:06 +09:00
Hide_D 445e445e49 예약턴 초기 릴리즈 2019-05-09 01:28:49 +09:00
Hide_D f20e4bd572 동작 시간 베이스로 변경 2019-05-05 20:13:48 +09:00
67 changed files with 2296 additions and 1480 deletions
+1 -7
View File
@@ -1,11 +1,4 @@
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
# 체섭 ignore
*.log
@@ -48,3 +41,4 @@ test.php
phpinfo.php
vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/*
*.sqlite3
+1 -1
View File
@@ -1,6 +1,6 @@
The MIT License
Copyright (c) 2018 Hide_D, 62che
Copyright (c) 2019 Hide_D, 62che
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
+11 -6
View File
@@ -11,16 +11,21 @@
* <code>php-fpm</code> 권장
* php에서 curl, pdo-sqlite을 실행가능해야 합니다. (기본값: 지원)
* mysqlnd가 지원되어야합니다. (기본값: 지원)
* mysqli
* gd
* MariaDB 10.2.1 이상
* MySQL 5.6 이상도 가능하도록 할 예정입니다.
* 현재 MySQL은 지원하지 않습니다.
* <code>git</code>
* <code>curl</code>
Linux는 Ubuntu 16.04, Windows는 Windows 10에서 XAMPP를 사용한 환경에서 테스트되었습니다.
Linux는 Ubuntu 16.04, 18.04, Windows는 Windows 10에서 XAMPP를 사용한 환경에서 테스트되었습니다.
Docker를 이용한 설치는 계획중입니다.
## 설치
## Docker를 이용한 설치
https://storage.hided.net/gogs/devsam/docker 를 참고해 주세요.
## 수동 설치
본 게임은 <code>git</code>을 이용한 업그레이드 시스템을 구현하였으므로, <code>git</code>이 필요합니다.
또한 웹 서비스 데몬을 운영중인 사용자(일반적으로 <code>www-data</code>, <code>apache</code>)에게 디렉토리 권한이 주어져야합니다.
@@ -30,8 +35,8 @@ Docker를 이용한 설치는 계획중입니다.
웹 데몬 user가 <code>www-data</code>인 경우 다음과 같이 입력하여 최신 배포버전과 이미지 파일을 얻을 수 있습니다.
```
sudo -u www-data git clone ssh://git@storage.hided.net:2525/devsam/core.git
git clone ssh://git@storage.hided.net:2525/devsam/image.git
sudo -u www-data git clone https://storage.hided.net/gogs/devsam/core.git
git clone https://storage.hided.net/gogs/devsam/image.git
```
> 이미지는 git hook을 이용한 업데이트 기능을 제공하지만 아직 범용성 있는 설계가 되어있진 않습니다.
File diff suppressed because one or more lines are too long
-1
View File
@@ -3,7 +3,6 @@ namespace sammo;
define('ROOT', realpath(__dir__.'/..'));
setlocale(LC_ALL, 'ko_KR.UTF-8');
date_default_timezone_set('Asia/Seoul');
mb_internal_encoding("UTF-8");
mb_http_output('UTF-8');
mb_regex_encoding('UTF-8');
+32
View File
@@ -98,6 +98,38 @@ require(__dir__.'/../vendor/autoload.php');
</div>
</div>
<div class="form-group row">
<label for="image_request_key" class="col-sm-4 col-form-label">이미지 갱신 키</label>
<div class="input-group col-sm-8">
<input type="text" class="form-control" name="image_request_key" id="image_request_key"
placeholder="이미지 서버의 hook/HashKey.php의 값과 동일하게"
value="" />
<div class="input-group-append">
<button id="btn_random_generate_key" class="btn btn-secondary" type="button">랜덤 생성</button>
</div>
</div>
</div>
<hr style="width:100%; border-top: 1px solid lightgray;">
<div class="form-group row">
<label for="kakao_rest_key" class="col-sm-4 col-form-label">카카오 API Rest Key</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="kakao_rest_key" id="kakao_rest_key"
placeholder="카카오톡 API의 Rest Key"
value="" />
</div>
</div>
<div class="form-group row">
<label for="kakao_admin_key" class="col-sm-4 col-form-label">카카오 API Admin Key</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="kakao_admin_key" id="kakao_admin_key"
placeholder="카카오톡 API의 Admin Key"
value="" />
</div>
</div>
<div class="form-group row">
<div class="col-sm-4"></div>
<div class="col-sm-8">
+21 -2
View File
@@ -11,6 +11,11 @@ $dbName = Util::getReq('db_name');
$servHost = Util::getReq('serv_host');
$sharedIconPath = Util::getReq('shared_icon_path');
$gameImagePath = Util::getReq('game_image_path');
$imageRequestKey = Util::getReq('image_request_key');
$kakaoRESTKey = Util::getReq('kakao_rest_key', 'string', '');
$kakaoAdminKey = Util::getReq('kakao_admin_key', 'string', '');
if (!$host || !$port || !$username || !$password || !$dbName || !$servHost || !$sharedIconPath || !$gameImagePath) {
Json::die([
@@ -186,6 +191,8 @@ $globalSalt = bin2hex(random_bytes(16));
$sharedIconPath = WebUtil::resolveRelativePath($sharedIconPath, $servHost);
$gameImagePath = WebUtil::resolveRelativePath($gameImagePath, $servHost);
$imageRequestPath = WebUtil::resolveRelativePath($gameImagePath.'/../hook/git_pull.php', $servHost);
$imageKeyInstallPath = WebUtil::resolveRelativePath($gameImagePath.'/../hook/InstallKey.php', $servHost);
$result = Util::generateFileUsingSimpleTemplate(
__dir__.'/templates/ServConfig.orig.php',
@@ -193,11 +200,17 @@ $result = Util::generateFileUsingSimpleTemplate(
[
'serverBasePath'=>$servHost,
'sharedIconPath'=>$sharedIconPath,
'gameImagePath'=>$gameImagePath
'gameImagePath'=>$gameImagePath,
'imageRequestPath'=>$imageRequestPath,
'imageRequestKey'=>$imageRequestKey
],
true
);
if($imageRequestKey){
@file_get_contents($imageKeyInstallPath.'?key='.$imageRequestKey);
}
if ($result !== true) {
Json::die([
'result'=>false,
@@ -263,10 +276,15 @@ $result = Util::generateFileUsingSimpleTemplate(
]
);
$kakaoRedirectURI = WebUtil::resolveRelativePath('oauth_kakao/oauth.php', $servHost.'/');
Util::generateFileUsingSimpleTemplate(
__dir__.'/templates/KakaoKey.orig.php',
ROOT.'/d_setting/KakaoKey.php',
[
'REST_API_KEY'=>$kakaoRESTKey,
'ADMIN_KEY'=>$kakaoAdminKey,
'REDIRECT_URI'=>$kakaoRedirectURI
],
true
);
@@ -280,5 +298,6 @@ if ($result !== true) {
Json::die([
'result'=>true,
'reason'=>'success'
'reason'=>'success',
'globalSalt'=>$globalSalt
]);
+9
View File
@@ -10,6 +10,8 @@ class ServConfig
public static $serverWebPath = '_tK_serverBasePath_';
public static $sharedIconPath = '_tK_sharedIconPath_';
public static $gameImagePath = "_tK_gameImagePath_";
public static $imageRequestPath = "_tK_imageRequestPath_";
public static $imageRequestKey = '_tK_imageRequestKey_';
public static function getSharedIconPath(string $filepath='') : string
{
@@ -32,6 +34,13 @@ class ServConfig
return static::$gameImagePath;
}
public static function getImagePullURI() : string
{
$now = time();
$req_hash = Util::hashPassword(sprintf("%016x",$now), static::$imageRequestKey);
return static::$imageRequestPath."?req={$req_hash}&time={$now}";
}
/**
* 서버 주소 반환. 서버의 경로가 하부 디렉토리인 경우에 하부 디렉토리까지 포함
+3 -1
View File
@@ -223,7 +223,9 @@ foreach($types as $idx=>[$typeName, $typeValue, $typeFunc]){
<?php
//유니크 아이템 소유자
$itemTypes = [
["명 마", 'horse', function($v){return getHorseName($v);}, 11, 40, []],
["명 마", 'horse', function($v){return getHorseName($v);}, 7, 26, []],
["명 검", 'weap', function($v){return getWeapName($v);}, 7, 26, []],
["명 서", 'book', function($v){return getBookName($v);}, 7, 26, []],
["도 구", 'item', function($v){return displayItemInfo($v);}, 7, 26, []],
];
+11 -1
View File
@@ -98,11 +98,21 @@ foreach($emperiors as $emperior){
<td align=center><?=$emperior['l12name']?></td>
<td id=bg1 align=center>승 상</td>
<td align=center><?=$emperior['l11name']?></td>
<td id=bg1 align=center> 장 군</td>
<td id=bg1 align=center>표 기 장 군</td>
<td align=center><?=$emperior['l10name']?></td>
<td id=bg1 align=center>사 공</td>
<td align=center><?=$emperior['l9name']?></td>
</tr>
<tr>
<td id=bg1 align=center>거 기 장 군</td>
<td align=center><?=$emperior['l8name']?></td>
<td id=bg1 align=center>태 위</td>
<td align=center><?=$emperior['l7name']?></td>
<td id=bg1 align=center>위 장 군</td>
<td align=center><?=$emperior['l6name']?></td>
<td id=bg1 align=center>사 도</td>
<td align=center><?=$emperior['l5name']?></td>
</tr>
</table>
+30 -16
View File
@@ -5,26 +5,34 @@ include "lib.php";
include "func.php";
$session = Session::getInstance()->setReadOnly();
$seasonIdx = Util::getReq('seasonIdx', 'int', UniqueConst::$seasonIdx);
$scenarioIdx = Util::getReq('scenarioIdx', 'int', null);
$db = DB::db();
increaseRefresh("명예의전당", 1);
$scenarioList= [];
foreach($db->query('SELECT scenario_name as name, count(scenario) as cnt, scenario from ng_games group by scenario order by scenario asc') as $scenarioInfo){
$scenarioList[$scenarioInfo['scenario']] = $scenarioInfo;
}
$scenarioList = (function(){
$db = DB::db();
$scenarioList= [];
foreach($db->query('SELECT season, scenario_name as name, count(scenario) as cnt, scenario from ng_games group by season, scenario order by season desc, scenario asc') as $scenarioInfo){
$seasonIdx = $scenarioInfo['season'];
$scenarioIdx = $scenarioInfo['scenario'];
if(!key_exists($seasonIdx, $scenarioList)){
$scenarioList[$seasonIdx] = [];
}
$scenarioList[$seasonIdx][$scenarioIdx] = $scenarioInfo;
}
return $scenarioList;
})();
if($scenarioIdx !== null || key_exists($scenarioIdx, $scenarioList)){
$searchScenarioName = $scenarioList[$scenarioIdx]['name'];
$searchFilter = $db->sqleval('scenario = %i', $scenarioIdx);
$searchScenarioName = $scenarioList[$seasonIdx][$scenarioIdx]['name'];
$searchFilter = $db->sqleval('season = %i AND scenario = %i', $seasonIdx, $scenarioIdx);
}
else{
$searchScenarioName = '* 모두 *';
$searchFilter = $db->sqleval(true);
$searchFilter = $db->sqleval('season = %i', $seasonIdx);
}
?>
@@ -53,14 +61,20 @@ else{
<tr><td>명 예 의 전 당<br><?=closeButton()?></td></tr>
<tr><td>
시나리오 검색 : <select id="by_scenario" name="by_scenario">
<option value="" <?=$scenarioIdx?"selected='selected'":''?>>* 종합 *</option>
<?php foreach($scenarioList as $info): ?>
<option
value="<?=$info['scenario']?>"
<?=($info['scenario']===$scenarioIdx)?"selected='selected'":''?>
><?=$info['name']?>(<?=$info['cnt']?>회)</option>
<?php foreach($scenarioList as $iterSeasonIdx=>$subScenarioList): ?>
<option
data-season="<?=$iterSeasonIdx?>"
value=""
<?=($iterSeasonIdx == $seasonIdx && $scenarioIdx === null)?"selected='selected'":''?>
>* 시즌 : <?=$iterSeasonIdx?> 종합 *</option>
<?php foreach($subScenarioList as $info): ?>
<option
data-season="<?=$iterSeasonIdx?>"
value="<?=$info['scenario']?>"
<?=($iterSeasonIdx == $seasonIdx && $info['scenario']===$scenarioIdx)?"selected='selected'":''?>
><?=$info['name']?>(<?=$info['cnt']?>회)</option>
<?php endforeach; ?>
<?php endforeach; ?>
?>
</select>
</td></tr>
</table>
+51 -6
View File
@@ -18,21 +18,24 @@ if($tnmt < 0 || $tnmt > 1){
$tnmt = 1;
}
$showDieImmediatelyBtn = false;
$availableDieImmediately = false;
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env');
$gameStor->cacheValues(['turnterm', 'opentime', 'turntime','autorun_user']);
$connect=$db->get();
increaseRefresh("내정보", 1);
$query = "select no,npc,mode,tnmt,myset,train,atmos from general where owner='{$userID}'";
$query = "select no,npc,mode,tnmt,myset,train,atmos,lastrefresh from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$me = MYDB_fetch_array($result);
if ($me['myset'] > 0) {
$submit = 'submit';
} else {
@@ -46,10 +49,20 @@ if (($btn == "설정저장" || $detachNPC) && $me['myset'] > 0) {
$submit = 'hidden';
}
$db->update('general', [
'myset'=>$db->sqleval('myset-1'),
'mode'=>$mode
], 'owner=%i AND mode!=%i', $userID, $mode);
if($mode == 0){
$db->update('general', [
'myset'=>$db->sqleval('myset-1'),
'mode'=>$mode,
'train'=>max(0, $me['train'] - 3),
'atmos'=>max(0, $me['atmos'] - 3),
], 'owner=%i AND mode!=%i', $userID, $mode);
}
else{
$db->update('general', [
'myset'=>$db->sqleval('myset-1'),
'mode'=>$mode
], 'owner=%i AND mode!=%i', $userID, $mode);
}
if($db->affectedRows()){
$me['myset'] -= 1;
@@ -81,6 +94,16 @@ if (($btn == "설정저장" || $detachNPC) && $me['myset'] > 0) {
}
}
if($gameStor->turntime <= $gameStor->opentime){
//서버 가오픈시 할 수 있는 행동
if($me['npc'] == 0){
$showDieImmediatelyBtn = true;
if(addTurn($me['lastrefresh'], $gameStor->turnterm, 2) <= TimeUtil::DatetimeNow()){
$availableDieImmediately = true;
}
}
}
?>
<!DOCTYPE html>
<html>
@@ -96,7 +119,21 @@ if (($btn == "설정저장" || $detachNPC) && $me['myset'] > 0) {
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
<script>
var availableDieImmediately = <?=$availableDieImmediately?'true':'false'?>;
jQuery(function($){
$('#die_immediately').click(function(){
if(!availableDieImmediately){
alert('삭제를 위해서는 생성 후 2턴 가량의 시간이 필요합니다.');
location.reload();
return false;
}
return confirm('정말로 삭제하시겠습니까?');
});
});
</script>
</head>
<body>
@@ -124,10 +161,18 @@ if (($btn == "설정저장" || $detachNPC) && $me['myset'] > 0) {
<input type=<?=$submit?> name=btn style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px; value=설정저장><br>
∞<font color=orange>설정저장은 이달중 <?=$me['myset']?>회 남았습니다.</font><br><br>
</form>
<?php if(!($gameStor->autorun_user['limit_minutes']??false)): ?>
휴 가 신 청<br>
<a href="c_vacation.php"><button type="button" style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px;>휴가 신청</button></a><br><br>
<?php endif; ?>
<!--빙의 해제용 삭턴 조절<br>
<a href="b_myPage.php?detachNPC=1"><button type="button" style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px;>빙의 해체 요청</button></a>-->
<?php if($showDieImmediatelyBtn): ?>
가오픈 기간 내 장수 삭제<br>
<a href="c_die_immediately.php" id='die_immediately'><button type="button" style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px;>장수 삭제</button></a><br><br>
<?php endif; ?>
개인용 CSS<br>
<textarea id='custom_css' style='color:white;background-color:black;width:420px;height:150px;'></textarea>
</td>
+52 -10
View File
@@ -81,6 +81,48 @@ uasort($troops, function($lhs, $rhs){
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
<?=WebUtil::printCSS('css/troops.css')?>
<script>
jQuery(function($){
$('#form1').submit(function(){
return false;
});
$('#leaveTroop').click(function(e){
return confirm("정말 부대를 탈퇴하시겠습니까?");
})
$('.submitBtn').click(function(event){
if(event.isPropagationStopped()){
return false;
}
console.log('b');
var $this=$(this);
$.post({
url:'j_troop.php',
dataType:'json',
data:{
action:$this.val().replace(/\s/g, ''),
troop:$('input.troopId:checked').val(),
name:$('#troopName').val(),
gen:$('#genNo').val()
}
}).then(function(data){
console.log(data);
if(!data.result){
alert(data.reason);
location.reload();
}
location.reload();
}, function(){
alert('알 수 없는 에러가 발생했습니다.');
});
return false;
});
});
</script>
</head>
<body>
@@ -88,7 +130,7 @@ uasort($troops, function($lhs, $rhs){
<table width=1000 class='tb_layout bg0'>
<tr><td>부 대 편 성<br><?=backButton()?></td></tr>
</table>
<form name=form1 method=post action=c_troop.php>
<form id=form1 name=form1 method=post>
<table id="troop_list" class='tb_layout bg0'>
<thead>
<tr>
@@ -102,9 +144,9 @@ uasort($troops, function($lhs, $rhs){
<tfoot><tr><td colspan='5'>
<?php if(!$troops): ?>
<?php elseif($me['troop'] == 0): ?>
<input type=submit name=btn value='부 대 가 입'>
<input type=submit class='submitBtn' value='부 대 가 입'>
<?php else: ?>
<input type=submit name=btn value='부 대 탈 퇴' onclick='return confirm("정말 부대를 탈퇴하시겠습니까?")'>
<input type=submit id="leaveTroop" class='submitBtn' value='부 대 탈 퇴'>
<?php endif;?>
</td></tr></tfoot>
<tbody>
@@ -133,7 +175,7 @@ foreach ($troops as $troopNo=>$troop) {
<?php if ($me['troop'] == 0): ?>
<tr>
<td align=center rowspan=2><input type='radio' name='troop' value='<?=$troop['troop']?>'></td>
<td align=center rowspan=2><input type='radio' class='troopId' name='troop' value='<?=$troop['troop']?>'></td>
<td align=center><?=$troop['name']?><br>【 <?=$cityText?> 】</td>
<td height=64 class='generalIcon' style='background:no-repeat center url("<?=$troopLeader['pictureFullPath']?>");background-size:64px;'>&nbsp;</td>
<td rowspan=2 width=62><?=$genlistText?></td>
@@ -152,15 +194,15 @@ foreach ($troops as $troopNo=>$troop) {
<td rowspan=2 width=62><?=$genlistText?></td>
<td rowspan=2>
<?php if ($me['no'] == $troopLeader['no']): ?>
<select name=gen size=3 style=color:white;background-color:black;font-size:13px;width:128px;>";
<select id='genNo' name=gen size=3 style=color:white;background-color:black;font-size:13px;width:128px;>";
<?php foreach ($troop['users'] as $troopUser): ?>
<?php if ($troopUser['no'] == $me['no']) {
continue;
} ?>
<option value='<?=$troopUser['no']?>'><?=$troopUser['name']?></option>
<option value='<?=$troopUser['no']?>'><?=$troopUser['name']?></option>
<?php endforeach; ?>
</select><br>
<input type=submit name=btn value='부 대 추 방' style=width:130px;height:25px;>
<input type=submit class='submitBtn' value='부 대 추 방' style=width:130px;height:25px;>
<?php else: ?>
<?=$troopLeader['turnText']?>
<?php endif; ?>
@@ -181,11 +223,11 @@ foreach ($troops as $troopNo=>$troop) {
<table width=1000 class='tb_layout bg0'>
<tr>
<td width=80 id=bg1>부 대 명</td>
<td width=130><input type=text style=color:white;background-color:black; size=18 maxlength=9 name=name></td>
<td width=130><input id='troopName' type=text style=color:white;background-color:black; size=18 maxlength=9 name=name></td>
<?php if($me['troop'] == 0): ?>
<td><input type=submit name=btn value='부 대 창 설'></td>
<td><input type=submit class='submitBtn' value='부 대 창 설'></td>
<?php else: ?>
<td><input type=submit name=btn value='부 대 변 경'></td>
<td><input type=submit class='submitBtn' value='부 대 변 경'></td>
<?php endif; ?>
</tr>
</table>
+3 -3
View File
@@ -286,7 +286,7 @@ $startYear = $gameStor->getValue('startyear');
<span class="input-group-text">명마</span>
</div>
<select class="custom-select form_general_horse">
<?php foreach(range(0, 40) as $horseID): ?>
<?php foreach(range(0, 26) as $horseID): ?>
<option value="<?=$horseID?>"><?=getHorseName($horseID)?></option>
<?php endforeach; ?>
</select>
@@ -294,7 +294,7 @@ $startYear = $gameStor->getValue('startyear');
<span class="input-group-text">무기</span>
</div>
<select class="custom-select form_general_weap">
<?php foreach(range(0, 6) as $weapID): ?>
<?php foreach(range(0, 26) as $weapID): ?>
<option value="<?=$weapID?>"><?=getWeapName($weapID)?></option>
<?php endforeach; ?>
</select>
@@ -302,7 +302,7 @@ $startYear = $gameStor->getValue('startyear');
<span class="input-group-text">서적</span>
</div>
<select class="custom-select form_general_book">
<?php foreach(range(0, 6) as $bookID): ?>
<?php foreach(range(0, 26) as $bookID): ?>
<option value="<?=$bookID?>"><?=getBookName($bookID)?></option>
<?php endforeach; ?>
</select>
+49
View File
@@ -0,0 +1,49 @@
<?php
namespace sammo;
include "lib.php";
include "func.php";
$availableDieImmediately = false;
//로그인 검사
$session = Session::requireGameLogin();
$userID = Session::getUserID();
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env');
$general = $db->queryFirstRow('SELECT no,name,name2,npc,lastrefresh FROM general WHERE owner=%i AND npc = 0', $userID);
if(!$general){
header('location:b_myPage.php');
die();
}
increaseRefresh("장수 삭제", 1);
$gameStor->cacheValues(['turnterm', 'opentime', 'turntime', 'year', 'month']);
if($gameStor->turntime <= $gameStor->opentime){
//서버 가오픈시 할 수 있는 행동
if(addTurn($general['lastrefresh'], $gameStor->turnterm, 2) <= TimeUtil::DatetimeNow()){
$availableDieImmediately = true;
}
}
if(!$availableDieImmediately){
header('location:b_myPage.php');
die();
}
if(!$db->query('DELETE FROM general WHERE owner=%i AND npc=0', $userID)){
trigger_error("올바르지 않은 삭제 프로세스 $userID", E_USER_WARNING);
}
$generalName = $general['name'];
$josaYi = JosaUtil::pick($generalName, '이');
pushGeneralPublicRecord(["<C>●</>{$gameStor->month}월:<Y>{$generalName}</>{$josaYi} 이 홀연히 모습을 <R>감추었습니다</>"], $gameStor->year, $gameStor->month);
$session->logoutGame();
header('location:..');
-66
View File
@@ -1,66 +0,0 @@
<?php
namespace sammo;
include "lib.php";
include "func.php";
// $btn, $name, $troop
$btn = Util::getReq('btn');
$name = Util::getReq('name');
$gen = Util::getReq('gen', 'int');
$troop = Util::getReq('troop', 'int');
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = $session::getUserID();
$db = DB::db();
$me = $db->queryFirstRow('SELECT `no`, nation, troop FROM general WHERE `owner`=%i', $userID);
$name = trim($name);
if($btn == "부 대 창 설" && $name != "" && $me['troop'] == 0) {
$db->insert('troop',[
'name'=>$name,
'nation'=>$me['nation'],
'no'=>$me['no']
]);
$troopID = $db->insertId();
$db->update('general', [
'troop'=>$troopID
], 'no=%i',$me['no']);
} elseif($btn == "부 대 변 경" && $name != "") {
$db->update('troop', [
'name'=>$name
], 'no=%i',$me['no']);
} elseif($btn == "부 대 추 방" && $gen != 0) {
$db->update('general', [
'troop'=>0
], 'no=%i AND troop=(SELECT troop FROM troop WHERE no = %i)', $gen, $me['no']);
} elseif($btn == "부 대 가 입" && $troop != 0) {
$troopLeader = $db->queryFirstField('SELECT `no` FROM troop WHERE troop=%i', $troop);
$troopLeaderNation = $db->queryFirstField('SELECT `nation` FROM `general` WHERE `no`=%i AND `nation`=%i', $troopLeader, $me['nation']);
if($troopLeaderNation){
$db->update('general', [
'troop'=>$troop
], 'no=%i', $me['no']);
}
} elseif($btn == "부 대 탈 퇴") {
$troopLeader = $db->queryFirstField('SELECT `no` FROM troop WHERE troop=%i', $me['troop']);
//부대장일 경우
if($troopLeader == $me['no']) {
// 모두 탈퇴
$db->update('general', [
'troop'=>0
], 'troop=%i',$me['troop']);
// 부대 삭제
$db->delete('troop', 'troop=%i', $me['troop']);
} else {
$db->update('general', [
'troop'=>0
], 'no=%i', $me['no']);
}
}
header('Location:b_troop.php', true, 303);
+6
View File
@@ -10,6 +10,12 @@ $userID = Session::getUserID();
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env');
$autorun_user = $gameStor->autorun_user;
if($autorun_user['limit_minutes']??false){
//자동 턴인 경우에는 휴가 불가
header('location:b_myPage.php', true, 303);
}
$killturn = $gameStor->killturn;
$db->update('general', [
+7 -68
View File
@@ -8,66 +8,10 @@ $session = Session::getInstance()->setReadOnly();
$db = DB::db();
?>
<!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::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 = "../";';
if (!$session->isGameLoggedIn()) {
die('<script>window.location.href = "../"</script>');
}
?>
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();
function myCommandList() {
@@ -76,9 +20,10 @@ function myCommandList() {
$userID = Session::getUserID();
$date = date('Y-m-d H:i:s');
$date_precise = (new \DateTime())->format("Y-m-d H:i:s.u");
// 명령 목록
$admin = $gameStor->getValues(['year','month','turnterm']);
$admin = $gameStor->getValues(['year','month','turnterm','turntime','opentime']);
$me = $db->queryFirstRow("SELECT `no`,turntime,term,turn0,turn1,turn2,turn3,turn4,turn5,turn6,turn7,turn8,turn9,turn10,turn11,turn12,turn13,turn14,turn15,turn16,turn17,turn18,turn19,turn20,turn21,turn22,turn23 FROM general WHERE `owner`=%s", $userID);
if(!$me){
@@ -88,16 +33,15 @@ function myCommandList() {
$turn = getTurn($me, 2);
echo "<table width=300 height=700 class='tb_layout bg2'>
<form name=clock>
<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; data-server-time='{$date_precise}'></b></td>
</tr>";
$year = $admin['year'];
$month = $admin['month'];
// 실행된 턴시간이면 +1
$cutTurn = cutTurn($me['turntime'], $admin['turnterm']);
if($date <= $cutTurn) { $month++; }
if($date <= $cutTurn && $date >= $admin['opentime']) { $month++; }
$totaldate = $me['turntime'];
@@ -120,11 +64,6 @@ function myCommandList() {
}
echo "
</form>
</table>
";
}
?>
</body>
</html>
}
+1
View File
@@ -4,6 +4,7 @@ namespace sammo;
class UniqueConst{
public static $serverID = '_tK_serverID_';
public static $serverName = '_tK_serverName_';
public static $seasonIdx = '_tK_seasonIdx_';
private function __construct(){}
+254 -155
View File
@@ -659,8 +659,10 @@ function commandTable() {
commandGroup("======= 개 인 ========");
if($me['level'] >= 1) {
addCommand("단련(자금$develcost, 군량$develcost)", 41);
addCommand("숙련전환(통솔경험, 자금$develcost, 군량$develcost)", 58);
} else {
addCommand("단련(자금$develcost, 군량$develcost)", 41, 0);
addCommand("숙련전환(통솔경험, 자금$develcost, 군량$develcost)", 58, 0);
}
addCommand("견문(자금?, 군량?, 경험치?)", 42);
if($city['trade'] > 0 || $me['special'] == 30) {
@@ -865,8 +867,6 @@ function generalInfo($no) {
$lbonus = "";
}
$troop = getTroop($general['troop']);
$level = getLevel($general['level'], $nation['level']);
if($general['level'] == 2) {
$query = "select name from city where gen3='{$general['no']}'";
@@ -934,7 +934,23 @@ function generalInfo($no) {
default:
$train = "{$general['train']}"; break;
}
if($general['troop'] == 0) { $troop['name'] = "-"; }
if($general['troop'] == 0){
$troopInfo = '-';
}
else{
$troop = getTroop($general['troop']);
$troopLeader = $db->queryFirstRow('SELECT city,turn0 FROM general WHERE no=%i', $troop['no']);
$troopInfo = $troop['name'];
if(DecodeCommand($troopLeader['turn0'])[0] != 26){
$troopInfo = "<strike style='color:gray;'>{$troopInfo}</strike>";
}
else if($troopLeader['city'] != $general['city']){
$troopCityName = CityConst::byID($troopLeader['city'])->name;
$troopInfo = "<span style='color:orange;'>{$troopInfo}({$troopCityName})</span>";
}
}
if($general['mode'] == 2) { $general['mode'] = "<font color=limegreen>수비 함(훈사80)</font>"; }
elseif($general['mode'] == 1) { $general['mode'] = "<font color=limegreen>수비 함(훈사60)</font>"; }
else { $general['mode'] = "<font color=red>수비 안함</font>"; }
@@ -1008,7 +1024,7 @@ function generalInfo($no) {
</tr>
<tr height=20>
<td style='text-align:center;' class='bg1'><b>부대</b></td>
<td style='text-align:center;' colspan=3>{$troop['name']}</td>
<td style='text-align:center;' colspan=3>{$troopInfo}</td>
<td style='text-align:center;' class='bg1'><b>벌점</b></td>
<td style='text-align:center;' colspan=5>".getConnect($general['connect'])." {$general['connect']}({$general['con']})</td>
</tr>
@@ -1267,8 +1283,9 @@ function increaseRefresh($type="", $cnt=1) {
$gameStor = KVStorage::getStorage($db, 'game_env');
$gameStor->refresh = $gameStor->refresh+$cnt; //TODO: +로 증가하는 값은 별도로 분리
$isunited = $gameStor->isunited;
$opentime = $gameStor->opentime;
if($isunited != 2 && $generalID && $userGrade < 6) {
if($isunited != 2 && $generalID && $userGrade < 6 && $opentime <= TimeUtil::DatetimeNow()) {
$db->update('general', [
'lastrefresh'=>$date,
'con'=>$db->sqleval('con + %i', $cnt),
@@ -1523,6 +1540,11 @@ function checkTurn() {
$alllog = [];
if(date('Y-m-d H:i:s') < $gameStor->turntime){
//턴 시각 이전이면 아무것도 하지 않음
return true;
}
// 잦은 갱신 금지 현재 5초당 1회
if(!timeover()) { return; }
// 현재 처리중이면 접근 불가
@@ -1557,7 +1579,12 @@ function checkTurn() {
$db->update('plock', ['plock'=>1], true);
return;
}
$date = date('Y-m-d H:i:s');
$gameStor->cacheAll();
// 1턴이상 갱신 없었으면 서버 지연
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', checkDelay');
checkDelay();
@@ -1569,10 +1596,12 @@ function checkTurn() {
CheckOverhead();
//서버정보
$date = date('Y-m-d H:i:s');
$autorun_user = $gameStor->autorun_user;
// 최종 처리 월턴의 다음 월턴시간 구함
$prevTurn = cutTurn($gameStor->turntime, $gameStor->turnterm);
$nextTurn = addTurn($prevTurn, $gameStor->turnterm);
$computedPrevTurn = false;
// 현재 턴 이전 월턴까지 모두처리.
//최종 처리 이후 다음 월턴이 현재 시간보다 전이라면
while($nextTurn <= $date) {
@@ -1586,12 +1615,15 @@ function checkTurn() {
//if(PROCESS_LOG) $processlog[0] = "[{$date}] 월턴 이전 갱신: name({$general['name']}), no({$general['no']}), turntime({$general['turntime']}), turn0({$general['turn0']})";
//if(PROCESS_LOG) pushProcessLog($processlog);
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', processAI');
if($general['npc'] >= 2) { processAI($general['no']); } // npc AI 처리
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', PreprocessCommand');
PreprocessCommand($general['no']);
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', processAI');
$reduce_turn = false;
if($general['npc'] >= 2 || ($autorun_user['limit_minutes']??false)) {
processAI($general['no'], $reduce_turn);
} // npc AI 처리
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', processCommand');
processCommand($general['no']);
processCommand($general['no'], $reduce_turn);
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', updateCommand');
updateCommand($general['no']);
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', updateTurntime');
@@ -1678,12 +1710,16 @@ function checkTurn() {
// 다음달로 넘김
$prevTurn = $nextTurn;
$nextTurn = addTurn($prevTurn, $gameStor->turnterm);
$computedPrevTurn = true;
}
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', '.__LINE__);
// 이시각 정각 시까지 업데이트 완료했음
$gameStor->turntime = $prevTurn;
if($computedPrevTurn){
$gameStor->turntime = $prevTurn;
}
// 그 시각 년도,월 저장
list($gameStor->year, $gameStor->month) = turnDate($prevTurn);
@@ -1699,12 +1735,14 @@ function checkTurn() {
//if(PROCESS_LOG) $processlog[0] = "[{$date}] 월턴 이후 갱신: name({$general['name']}), no({$general['no']}), turntime({$general['turntime']}), turn0({$general['turn0']})";
//if(PROCESS_LOG) pushProcessLog($processlog);
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', processAI');
if($general['npc'] >= 2) { processAI($general['no']); } // npc AI 처리
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', PreprocessCommand');
PreprocessCommand($general['no']);
$reduce_turn = false;
if($general['npc'] >= 2 || ($autorun_user['limit_minutes']??false)) {
processAI($general['no'], $reduce_turn);
}
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', processCommand');
processCommand($general['no']);
processCommand($general['no'], $reduce_turn);
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', updateCommand');
updateCommand($general['no']);
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', updateTurntime');
@@ -1937,7 +1975,7 @@ function updateTurntime($no) {
$admin = $gameStor->getValues(['year', 'month', 'isunited', 'turnterm']);
$query = "select no,name,name2,nation,troop,age,turntime,killturn,level,deadyear,npc,npc_org,affinity,npcid from general where no='$no'";
$query = "select no,owner,name,name2,nation,troop,age,startage,turntime,killturn,level,deadyear,npc,npc_org,affinity,npcid from general where no='$no'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
@@ -2007,68 +2045,77 @@ function updateTurntime($no) {
$query = "update nation set totaltech=tech*'$gencount',gennum='$gennum' where nation='{$general['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$generalName = $general['name'];
// 병, 요절, 객사, 번개, 사채, 일확천금, 호랑이, 곰, 수영, 처형, 발견
$josaYi = JosaUtil::pick($general['name'], '이');
$josaYi = JosaUtil::pick($generalName, '이');
if($general['owner'] > 0 && $general['startage'] + 1 < $general['age']){
$realName = RootDB::db()->queryFirstField('SELECT name FROM member WHERE no = %i', $general['owner'])??'??';
$generalName .= "({$realName})";
}
switch(rand()%42) {
case 0: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 역병에 걸려 <R>죽고</> 말았습니다."; break;
case 1: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <R>요절</>하고 말았습니다."; break;
case 2: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 거리에서 갑자기 <R>객사</>하고 말았습니다."; break;
case 3: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 안타깝게도 번개에 맞아 <R>죽고</> 말았습니다."; break;
case 4: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 고리대금에 시달리다가 <R>자살</>하고 말았습니다."; break;
case 5: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 일확천금에 놀라 심장마비로 <R>죽고</> 말았습니다."; break;
case 6: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 산속에서 호랑이에게 물려 <R>죽고</> 말았습니다."; break;
case 7: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 산책중 곰에게 할퀴어 <R>죽고</> 말았습니다."; break;
case 8: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 수영을 하다 <R>익사</>하고 말았습니다."; break;
case 9: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 황제를 모독하다가 <R>처형</>당하고 말았습니다."; break;
case 10: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 이튿날 침실에서 <R>죽은채로</>발견되었습니다."; break;
case 11: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 색에 빠져 기력이 쇠진해 <R>죽고</>말았습니다."; break;
case 12: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 미녀를 보고 심장마비로 <R>죽고</>말았습니다."; break;
case 13: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 우울증에 걸려 <R>자살</>하고 말았습니다."; break;
case 14: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 천하 정세를 비관하며 <R>분신</>하고 말았습니다."; break;
case 15: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 어떤 관심도 못받고 쓸쓸히 <R>죽고</>말았습니다."; break;
case 16: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 유산 상속 문제로 다투다가 <R>살해</>당했습니다."; break;
case 17: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 누군가의 사주로 자객에게 <R>암살</>당했습니다."; break;
case 18: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 바람난 배우자에게 <R>독살</>당하고 말았습니다."; break;
case 19: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 농약을 술인줄 알고 마셔 <R>죽고</>말았습니다."; break;
case 20: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 아무 이유 없이 <R>죽고</>말았습니다."; break;
case 21: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 전재산을 잃고 화병으로 <R>죽고</>말았습니다."; break;
case 22: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 단식운동을 하다가 굶어 <R>죽고</>말았습니다."; break;
case 23: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 귀신에게 홀려 시름 앓다가 <R>죽고</>말았습니다."; break;
case 24: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 사람들에게 집단으로 맞아서 <R>죽고</>말았습니다."; break;
case 25: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 갑자기 성벽에서 뛰어내려 <R>죽고</>말았습니다."; break;
case 26: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 농사중 호미에 머리를 맞아 <R>죽고</>말았습니다."; break;
case 27: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 저세상이 궁금하다며 <R>자살</>하고 말았습니다."; break;
case 28: $alllog[0] = "<C>●</>{$admin['month']}월:운좋기로 소문난 <Y>{$general['name']}</>{$josaYi} 불운하게도 <R>죽고</>말았습니다."; break;
case 29: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 무리하게 단련을 하다가 <R>죽고</>말았습니다."; break;
case 30: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 생활고를 비관하며 <R>자살</>하고 말았습니다."; break;
case 31: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 평생 결혼도 못해보고 <R>죽고</> 말았습니다."; break;
case 32: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 과식하다 배가 터져 <R>죽고</> 말았습니다."; break;
case 33: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 웃다가 숨이 넘어가 <R>죽고</> 말았습니다."; break;
case 34: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 추녀를 보고 놀라서 <R>죽고</> 말았습니다."; break;
case 35: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 물에 빠진 사람을 구하려다 같이 <R>죽고</> 말았습니다."; break;
case 36: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 독살을 준비하다 독에 걸려 <R>죽고</> 말았습니다."; break;
case 37: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 뒷간에서 너무 힘을 주다가 <R>죽고</> 말았습니다."; break;
case 38: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 돌팔이 의사에게 치료받다가 <R>죽고</> 말았습니다."; break;
case 39: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 남의 보약을 훔쳐먹다 부작용으로 <R>죽고</> 말았습니다."; break;
case 40: $alllog[0] = "<C>●</>{$admin['month']}월:희대의 사기꾼 <Y>{$general['name']}</>{$josaYi} <R>사망</>했습니다."; break;
case 41: $alllog[0] = "<C>●</>{$admin['month']}월:희대의 호색한 <Y>{$general['name']}</>{$josaYi} <R>사망</>했습니다."; break;
default: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <R>사망</>했습니다."; break;
case 0: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 역병에 걸려 <R>죽고</> 말았습니다."; break;
case 1: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} <R>요절</>하고 말았습니다."; break;
case 2: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 거리에서 갑자기 <R>객사</>하고 말았습니다."; break;
case 3: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 안타깝게도 번개에 맞아 <R>죽고</> 말았습니다."; break;
case 4: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 고리대금에 시달리다가 <R>자살</>하고 말았습니다."; break;
case 5: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 일확천금에 놀라 심장마비로 <R>죽고</> 말았습니다."; break;
case 6: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 산속에서 호랑이에게 물려 <R>죽고</> 말았습니다."; break;
case 7: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 산책중 곰에게 할퀴어 <R>죽고</> 말았습니다."; break;
case 8: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 수영을 하다 <R>익사</>하고 말았습니다."; break;
case 9: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 황제를 모독하다가 <R>처형</>당하고 말았습니다."; break;
case 10: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 이튿날 침실에서 <R>죽은채로</>발견되었습니다."; break;
case 11: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 색에 빠져 기력이 쇠진해 <R>죽고</>말았습니다."; break;
case 12: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 미녀를 보고 심장마비로 <R>죽고</>말았습니다."; break;
case 13: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 우울증에 걸려 <R>자살</>하고 말았습니다."; break;
case 14: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 천하 정세를 비관하며 <R>분신</>하고 말았습니다."; break;
case 15: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 어떤 관심도 못받고 쓸쓸히 <R>죽고</>말았습니다."; break;
case 16: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 유산 상속 문제로 다투다가 <R>살해</>당했습니다."; break;
case 17: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 누군가의 사주로 자객에게 <R>암살</>당했습니다."; break;
case 18: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 바람난 배우자에게 <R>독살</>당하고 말았습니다."; break;
case 19: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 농약을 술인줄 알고 마셔 <R>죽고</>말았습니다."; break;
case 20: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 아무 이유 없이 <R>죽고</>말았습니다."; break;
case 21: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 전재산을 잃고 화병으로 <R>죽고</>말았습니다."; break;
case 22: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 단식운동을 하다가 굶어 <R>죽고</>말았습니다."; break;
case 23: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 귀신에게 홀려 시름 앓다가 <R>죽고</>말았습니다."; break;
case 24: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 사람들에게 집단으로 맞아서 <R>죽고</>말았습니다."; break;
case 25: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 갑자기 성벽에서 뛰어내려 <R>죽고</>말았습니다."; break;
case 26: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 농사중 호미에 머리를 맞아 <R>죽고</>말았습니다."; break;
case 27: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 저세상이 궁금하다며 <R>자살</>하고 말았습니다."; break;
case 28: $alllog[0] = "<C>●</>{$admin['month']}월:운좋기로 소문난 <Y>{$generalName}</>{$josaYi} 불운하게도 <R>죽고</>말았습니다."; break;
case 29: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 무리하게 단련을 하다가 <R>죽고</>말았습니다."; break;
case 30: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 생활고를 비관하며 <R>자살</>하고 말았습니다."; break;
case 31: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 평생 결혼도 못해보고 <R>죽고</> 말았습니다."; break;
case 32: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 과식하다 배가 터져 <R>죽고</> 말았습니다."; break;
case 33: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 웃다가 숨이 넘어가 <R>죽고</> 말았습니다."; break;
case 34: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 추녀를 보고 놀라서 <R>죽고</> 말았습니다."; break;
case 35: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 물에 빠진 사람을 구하려다 같이 <R>죽고</> 말았습니다."; break;
case 36: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 독살을 준비하다 독에 걸려 <R>죽고</> 말았습니다."; break;
case 37: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 뒷간에서 너무 힘을 주다가 <R>죽고</> 말았습니다."; break;
case 38: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 돌팔이 의사에게 치료받다가 <R>죽고</> 말았습니다."; break;
case 39: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 남의 보약을 훔쳐먹다 부작용으로 <R>죽고</> 말았습니다."; break;
case 40: $alllog[0] = "<C>●</>{$admin['month']}월:희대의 사기꾼 <Y>{$generalName}</>{$josaYi} <R>사망</>했습니다."; break;
case 41: $alllog[0] = "<C>●</>{$admin['month']}월:희대의 호색한 <Y>{$generalName}</>{$josaYi} <R>사망</>했습니다."; break;
default: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} <R>사망</>했습니다."; break;
}
// 엔피씨,엠피씨,의병 사망로그
if($general['npc'] == 2 || $general['npc'] == 6) {
$alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <R>사망</>했습니다.";
$alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} <R>사망</>했습니다.";
} elseif($general['npc'] >= 3) {
switch(rand()%10) {
case 0: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 푸대접에 실망하여 떠났습니다."; break;
case 1: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 갑자기 화를 내며 떠났습니다."; break;
case 2: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 의견차이를 좁히지 못하고 떠났습니다."; break;
case 3: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 판단 착오였다며 떠났습니다."; break;
case 4: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 생활고가 나아지지 않는다며 떠났습니다."; break;
case 5: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 기대가 너무 컸다며 떠났습니다."; break;
case 6: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 아무 이유 없이 떠났습니다."; break;
case 7: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 자기 목적은 달성했다며 떠났습니다."; break;
case 8: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 자기가 없어도 될것 같다며 떠났습니다."; break;
case 9: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 처자식이 그립다며 떠났습니다."; break;
case 0: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 푸대접에 실망하여 떠났습니다."; break;
case 1: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 갑자기 화를 내며 떠났습니다."; break;
case 2: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 의견차이를 좁히지 못하고 떠났습니다."; break;
case 3: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 판단 착오였다며 떠났습니다."; break;
case 4: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 생활고가 나아지지 않는다며 떠났습니다."; break;
case 5: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 기대가 너무 컸다며 떠났습니다."; break;
case 6: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 아무 이유 없이 떠났습니다."; break;
case 7: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 자기 목적은 달성했다며 떠났습니다."; break;
case 8: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 자기가 없어도 될것 같다며 떠났습니다."; break;
case 9: $alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$generalName}</>{$josaYi} 처자식이 그립다며 떠났습니다."; break;
}
}
@@ -2195,6 +2242,7 @@ function CheckHall($no) {
$db->insertIgnore('ng_hall', [
'server_id'=>UniqueConst::$serverID,
'season'=>UniqueConst::$seasonIdx,
'scenario'=>$scenarioIdx,
'general_no'=>$no,
'type'=>$idx,
@@ -2220,11 +2268,78 @@ function CheckHall($no) {
}
function guaranteedUniqueItemLottery(array $weightedArray, string $headerText='아이템'):?int{
//NOTE: Util::choiceRandomUsingWeight 사용
//TODO: 또 재 구현해야함.... ㅜㅜ
if(!$weightedArray){
return null;
}
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env');
$targetGeneralID = Util::choiceRandomUsingWeight($weightedArray);
$alllog = [];
$history = [];
$occupied = [];
$item = [];
$admin = $gameStor->getValues(['year', 'month', 'scenario']);
$selGroup = [
20 - $db->queryFirstField('SELECT count(*) from general where weap > 6'),
20 - $db->queryFirstField('SELECT count(*) from general where book > 6'),
20 - $db->queryFirstField('SELECT count(*) from general where horse > 6'),
20 - $db->queryFirstField('SELECT count(*) from general where item > 6')
];
if(array_sum($selGroup) == 0){
return null;
}
$sel = Util::choiceRandomUsingWeight($selGroup);
switch($sel) {
case 0: [$type, $nameFunc] = ["weap", 'sammo\getWeapName']; break;
case 1: [$type, $nameFunc] = ["book", 'sammo\getBookName']; break;
case 2: [$type, $nameFunc] = ["horse", 'sammo\getHorseName']; break;
case 3: [$type, $nameFunc] = ["item", 'sammo\getItemName']; break;
}
foreach($db->queryFirstColumn('SELECT %b FROM general WHERE %b > 6', $type, $type) as $itemIdx){
$occupied[$itemIdx] = 1;
}
for($i=7; $i <= 26; $i++) {
if(!Util::array_get($occupied[$i])) {
$item[] = $i;
}
}
$it = Util::choiceRandom($item);
$general = $db->queryFirstRow('SELECT no, name, nation FROM general WHERE no = %i', $targetGeneralID);
$db->update('general', [$type=>$it], 'no=%i', $general['no']);
$nation = getNationStaticInfo($general['nation']);
$josaUl = JosaUtil::pick(($nameFunc)($it), '을');
$josaYi = JosaUtil::pick($general['name'], '이');
$log[] = "<C>●</><C>".($nameFunc)($it)."</>{$josaUl} 습득했습니다!";
$alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <C>".($nameFunc)($it)."</>{$josaUl} 습득했습니다!";
pushGeneralHistory($general, "<C>●</>{$admin['year']}{$admin['month']}월:<C>".($nameFunc)($it)."</>{$josaUl} 습득");
$history[] = "<C>●</>{$admin['year']}{$admin['month']}월:<C><b>【{$headerText}】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} <C>".($nameFunc)($it)."</>{$josaUl} 습득했습니다!";
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
pushWorldHistory($history, $admin['year'], $admin['month']);
pushGenLog($general, $log);
return $targetGeneralID;
}
function uniqueItem($general, $log, $vote=0) {
//TODO: uniqueItem 재 구현
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$alllog = [];
$history = [];
$occupied = [];
@@ -2235,95 +2350,71 @@ function uniqueItem($general, $log, $vote=0) {
$admin = $gameStor->getValues(['year', 'month', 'scenario']);
$query = "select count(*) as cnt from general where npc<2";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gen = MYDB_fetch_array($result);
$genCnt = $db->queryFirstField('SELECT count(*) FROM general WHERE npc < 2');
if($admin['scenario'] < 1000) { $prob = $gen['cnt'] * 5; } // 5~6개월에 하나씩 등장
else { $prob = $gen['cnt']; } // 1~2개월에 하나씩 등장
if($admin['scenario'] < 100) { $prob = $genCnt * 5; } // 5~6개월에 하나씩 등장
else { $prob = $genCnt; } // 1~2개월에 하나씩 등장
if($vote == 1) { $prob = Util::round($gen['cnt'] * 0.7 / 3); } // 투표율 70%, 투표 한번에 2~3개 등장
elseif($vote == 2) { $prob = Util::round($gen['cnt'] / 10 / 2); } // 랜임시 2개(10%) 등장(200명중 20명 랜임시도?)
elseif($vote == 3) { $prob = Util::round($gen['cnt'] / 10 / 4); } // 건국시 4개(20%) 등장(200명시 20국 정도 됨)
if($vote == 1) { $prob = Util::round($genCnt * 0.7 / 3); } // 투표율 70%, 투표 한번에 2~3개 등장
elseif($vote == 2) { $prob = Util::round($genCnt / 10 / 2); } // 랜임시 2개(10%) 등장(200명중 20명 랜임시도?)
elseif($vote == 3) { $prob = Util::round($genCnt / 10 / 4); } // 건국시 4개(20%) 등장(200명시 20국 정도 됨)
if($prob < 3) { $prob = 3; }
//아이템 습득 상황
if(rand() % $prob == 0) {
//셋중 선택
$selGroup = [
'horse'=>30 - $db->queryFirstField('SELECT count(*) from general where horse > 10'),
'item'=>20 - $db->queryFirstField('SELECT count(*) from general where item > 6')
];
$type = Util::choiceRandomUsingWeight($selGroup);
if (rand() % $prob != 0) {
return $log;
if($type == 'horse'){
foreach($db->queryFirstColumn('SELECT horse FROM general WHERE horse > 10') as $horse){
$occupied[$horse] = 1;
}
for($i = 11; $i <= 40; $i++){
if(!Util::array_get($occupied[$i])) {
$remainItems[] = $i;
}
}
}
else{
foreach($db->queryFirstColumn('SELECT item FROM general WHERE item > 6') as $item){
$occupied[$item] = 1;
}
for($i = 7; $i <= 26; $i++){
if(!Util::array_get($occupied[$i])) {
$remainItems[] = $i;
}
}
}
}
//셋중 선택
$selGroup = [
20 - $db->queryFirstField('SELECT count(*) from general where weap > 6'),
20 - $db->queryFirstField('SELECT count(*) from general where book > 6'),
20 - $db->queryFirstField('SELECT count(*) from general where horse > 6'),
20 - $db->queryFirstField('SELECT count(*) from general where item > 6')
];
if($remainItems) {
$it = Util::choiceRandom($remainItems);
if(array_sum($selGroup) == 0){
return $log;
}
$query = "update general set {$type}='$it' where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$sel = Util::choiceRandomUsingWeight($selGroup);
switch($sel) {
case 0: [$type, $nameFunc] = ["weap", 'sammo\getWeapName']; break;
case 1: [$type, $nameFunc] = ["book", 'sammo\getBookName']; break;
case 2: [$type, $nameFunc] = ["horse", 'sammo\getHorseName']; break;
case 3: [$type, $nameFunc] = ["item", 'sammo\getItemName']; break;
}
$nation = getNationStaticInfo($general['nation']);
switch($vote){
case 1: $voteTypeText = '설문상품'; break;
case 2: $voteTypeText = '랜덤임관상품'; break;
case 3: $voteTypeText = '건국상품'; break;
default: $voteTypeText = '아이템'; break;
}
switch($type) {
case 'horse':
$josaUl = JosaUtil::pick(getHorseName($it), '을');
$josaYi = JosaUtil::pick($general['name'], '이');
$log[] = "<C>●</><C>".getHorseName($it)."</>{$josaUl} 습득했습니다!";
$alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <C>".getHorseName($it)."</>{$josaUl} 습득했습니다!";
pushGeneralHistory($general, "<C>●</>{$admin['year']}{$admin['month']}월:<C>".getHorseName($it)."</>{$josaUl} 습득");
if($vote == 0) {
$history[] = "<C>●</>{$admin['year']}{$admin['month']}월:<C><b>【아이템】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} <C>".getHorseName($it)."</>{$josaUl} 습득했습니다!";
} elseif($vote == 1) {
$history[] = "<C>●</>{$admin['year']}{$admin['month']}월:<C><b>【설문상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} <C>".getHorseName($it)."</>{$josaUl} 습득했습니다!";
} elseif($vote == 2) {
$history[] = "<C>●</>{$admin['year']}{$admin['month']}월:<C><b>【랜덤임관상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} <C>".getHorseName($it)."</>{$josaUl} 습득했습니다!";
} elseif($vote == 3) {
$history[] = "<C>●</>{$admin['year']}{$admin['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} <C>".getHorseName($it)."</>{$josaUl} 습득했습니다!";
}
break;
case 'item':
$josaUl = JosaUtil::pick(getItemName($it), '을');
$josaYi = JosaUtil::pick($general['name'], '이');
$log[] = "<C>●</><C>".getItemName($it)."</>{$josaUl} 습득했습니다!";
$alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <C>".getItemName($it)."</>{$josaUl} 습득했습니다!";
pushGeneralHistory($general, "<C>●</>{$admin['year']}{$admin['month']}월:<C>".getItemName($it)."</>{$josaUl} 습득");
if($vote == 0) {
$history[] = "<C>●</>{$admin['year']}{$admin['month']}월:<C><b>【아이템】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} <C>".getItemName($it)."</>{$josaUl} 습득했습니다!";
} elseif($vote == 1) {
$history[] = "<C>●</>{$admin['year']}{$admin['month']}월:<C><b>【설문상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} <C>".getItemName($it)."</>{$josaUl} 습득했습니다!";
} elseif($vote == 2) {
$history[] = "<C>●</>{$admin['year']}{$admin['month']}월:<C><b>【랜덤임관상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} <C>".getItemName($it)."</>{$josaUl} 습득했습니다!";
} elseif($vote == 3) {
$history[] = "<C>●</>{$admin['year']}{$admin['month']}월:<C><b>【건국상품】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} <C>".getItemName($it)."</>{$josaUl} 습득했습니다!";
}
break;
}
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
pushWorldHistory($history, $admin['year'], $admin['month']);
foreach($db->queryFirstColumn('SELECT %b FROM general WHERE %b > 6', $type, $type) as $itemIdx){
$occupied[$itemIdx] = 1;
}
for($i=7; $i <= 26; $i++) {
if(!Util::array_get($occupied[$i])) {
$item[] = $i;
}
}
$it = Util::choiceRandom($item);
$db->update('general', [$type=>$it], 'no=%i', $general['no']);
$nation = getNationStaticInfo($general['nation']);
$josaUl = JosaUtil::pick(($nameFunc)($it), '을');
$josaYi = JosaUtil::pick($general['name'], '이');
$log[] = "<C>●</><C>".($nameFunc)($it)."</>{$josaUl} 습득했습니다!";
$alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} <C>".($nameFunc)($it)."</>{$josaUl} 습득했습니다!";
pushGeneralHistory($general, "<C>●</>{$admin['year']}{$admin['month']}월:<C>".($nameFunc)($it)."</>{$josaUl} 습득");
$history[] = "<C>●</>{$admin['year']}{$admin['month']}월:<C><b>【{$voteTypeText}】</b></><D><b>{$nation['name']}</b></>의 <Y>{$general['name']}</>{$josaYi} <C>".($nameFunc)($it)."</>{$josaUl} 습득했습니다!";
pushGeneralPublicRecord($alllog, $admin['year'], $admin['month']);
pushWorldHistory($history, $admin['year'], $admin['month']);
return $log;
}
@@ -2886,16 +2977,24 @@ function SabotageInjury($city, $type=0) {
return $injuryCount;
}
function getRandTurn($term) {
function getRandTurn($term, ?\DateTimeInterface $baseDateTime = null) {
if($baseDateTime === null){
$baseDateTime = new \DateTimeImmutable();
}
else if($baseDateTime instanceof \DateTime){
$baseDateTime = DateTimeImmutable::createFromMutable($baseDateTime);
}
$randtime = rand(0, 60 * $term - 1);
$turntime = date('Y-m-d H:i:s', strtotime('now') + $randtime);
return $turntime;
return $baseDateTime->add(new \DateInterval('PT'.$randtime.'S'))->format('Y-m-d H:i:s');
}
function getRandTurn2($term) {
function getRandTurn2($term, ?\DateTimeInterface $baseDateTime = null) {
if($baseDateTime === null){
$baseDateTime = new \DateTimeImmutable();
}
else if($baseDateTime instanceof \DateTime){
$baseDateTime = DateTimeImmutable::createFromMutable($baseDateTime);
}
$randtime = rand(0, 60 * $term - 1);
$turntime = date('Y-m-d H:i:s', strtotime('now') - $randtime);
return $turntime;
return $baseDateTime->sub(new \DateInterval('PT'.$randtime.'S'))->format('Y-m-d H:i:s');
}
+48 -41
View File
@@ -103,21 +103,30 @@ function getTurn(array $general, $type, $font=1) {
$str[$i] = "{$general['name']}{$josaUl} 등용";
break;
case 25: //임관
$third = $command[2];
$double = $command[1];
if($double == 98){
$nationName = '건국된 임의 국가';
if($third == 98){
$str[$i] = "【건국된 임의 국가】로 임관";
}
else if($double == 99){
$nationName = '임의의 국가';
else if($third == 99){
$str[$i] = "【임의의 국가】로 임관";
}
else if($third == 1){
$generalName = $db->queryFirstField('SELECT name FROM general WHERE no=%i', $double)??'?!?!';
$josaUl = JosaUtil::pick($generalName, '을');
$str[$i] = "{$generalName}{$josaUl} 따라 임관";
}
else if($third == 0){
$nationName = getNationStaticInfo($double)['name']??'?!?!';
$josaRo = JosaUtil::pick($nationName, '로');
$str[$i] = "{$nationName}{$josaRo} 임관";
}
else{
$nationName = getNationStaticInfo($double)['name']??'?!?!';
$str[$i] = "????";
}
$josaRo = JosaUtil::pick($nationName, '로');
$str[$i] = "{$nationName}{$josaRo} 임관";
break;
case 26: //집합
$str[$i] = "집합";
@@ -251,7 +260,9 @@ function getTurn(array $general, $type, $font=1) {
case 57: //모반 시도
$str[$i] = "모반 시도";
break;
case 58: //숙련 전환
$str[$i] = "숙련 전환";
break;
default:
$str[$i] = "????";
break;
@@ -472,7 +483,7 @@ function getCoreTurn($nation, $level) {
}
function processCommand($no) {
function processCommand($no, $reduceTurn) {
$session = Session::getInstance();
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env');
@@ -550,6 +561,8 @@ function processCommand($no) {
$newKillturn = $general['killturn'] - 1;
} elseif($command[0] == 0) {
$newKillturn = $general['killturn'] - 1;
} elseif($reduceTurn == true){
$newKillturn = $general['killturn'] - 1;
} else {
$newKillturn = $killturn;
}
@@ -623,6 +636,8 @@ function processCommand($no) {
case 55: process_55($general); break; //거병
case 56: process_56($general); break; //해산
case 57: process_57($general); break; //모반 시도
case 58: process_58($general); break; //숙련 전환
}
}
}
@@ -707,8 +722,11 @@ where nation='{$general['nation']}'
function command_Single($turn, $command) {
if(!$turn){
header('location:commandlist.php', true, 303);
return;
Json::die([
'result'=>true,
'nextPage'=>null,
'reason'=>'invalid turn'
]);
}
$db = DB::db();
@@ -722,7 +740,11 @@ function command_Single($turn, $command) {
}
$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) {
@@ -749,37 +771,22 @@ function command_Chief($turn, $command) {
}
function command_Other($turn, $commandtype) {
$target = "processing.php?commandtype={$commandtype}";
foreach($turn as $turnItem){
$target.="&turn[]={$turnItem}";
if(!$turn){
Json::die([
'result'=>true,
'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>
</html>
<?php
$unixNow = time();
$turnArg = join('&turn[]=', $turn);
/*
<form name='form1' action='processing.php' method='post' target=_parent>
<?php foreach($turn as $turnItem): ?>
<input type='hidden' name='turn[]' value='<?=$turnItem?>'>
<?php endforeach; ?>
<input type=hidden name=commandtype value=<?=$commandtype?>>
</form>&nbsp;
<script>*/
Json::die([
'result'=>true,
'nextPage'=>"processing.php?commandtype={$commandtype}&turn[]={$turnArg}&t={$unixNow}",
'reason'=>'success'
]);
}
+143 -80
View File
@@ -535,16 +535,60 @@ function getWeapName($weap) : ?string {
case 4: $weapname = '목검(+4)'; break;
case 5: $weapname = '죽창(+5)'; break;
case 6: $weapname = '소부(+6)'; break;
case 7: $weapname = '동추(+7)'; break;
case 8: $weapname = '철편(+7)'; break;
case 9: $weapname = '철쇄(+7)'; break;
case 10: $weapname = '맥궁(+7)'; break;
case 11: $weapname = '유성추(+8)'; break;
case 12: $weapname = '철질여골(+8)'; break;
case 13: $weapname = '쌍철극(+9)'; break;
case 14: $weapname = '동호비궁(+9)'; break;
case 15: $weapname = '삼첨도(+10)'; break;
case 16: $weapname = '대부(+10)'; break;
case 17: $weapname = '고정도(+11)'; break;
case 18: $weapname = '이광궁(+11)'; break;
case 19: $weapname = '철척사모(+12)'; break;
case 20: $weapname = '칠성검(+12)'; break;
case 21: $weapname = '사모(+13)'; break;
case 22: $weapname = '양유기궁(+13)'; break;
case 23: $weapname = '언월도(+14)'; break;
case 24: $weapname = '방천화극(+14)'; break;
case 25: $weapname = '청홍검(+15)'; break;
case 26: $weapname = '의천검(+15)'; break;
}
return $weapname;
}
function getWeapEff($weap) : ?int{
switch($weap) {
case 7: $weap = 7; break;
case 8: $weap = 7; break;
case 9: $weap = 7; break;
case 10: $weap = 7; break;
case 11: $weap = 8; break;
case 12: $weap = 8; break;
case 13: $weap = 9; break;
case 14: $weap = 9; break;
case 15: $weap = 10; break;
case 16: $weap = 10; break;
case 17: $weap = 11; break;
case 18: $weap = 11; break;
case 19: $weap = 12; break;
case 20: $weap = 12; break;
case 21: $weap = 13; break;
case 22: $weap = 13; break;
case 23: $weap = 14; break;
case 24: $weap = 14; break;
case 25: $weap = 15; break;
case 26: $weap = 15; break;
default: break;
}
return $weap;
}
function getBookName($book) : ?string {
switch ($book) {
switch($book) {
case 0: $bookname = '-'; break;
case 1: $bookname = '효경전(+1)'; break;
case 2: $bookname = '회남자(+2)'; break;
@@ -552,11 +596,55 @@ function getBookName($book) : ?string {
case 4: $bookname = '건상역주(+4)'; break;
case 5: $bookname = '여씨춘추(+5)'; break;
case 6: $bookname = '사민월령(+6)'; break;
case 7: $bookname = '위료자(+7)'; break;
case 8: $bookname = '사마법(+7)'; break;
case 9: $bookname = '한서(+7)'; break;
case 10: $bookname = '논어(+7)'; break;
case 11: $bookname = '전론(+8)'; break;
case 12: $bookname = '사기(+8)'; break;
case 13: $bookname = '장자(+9)'; break;
case 14: $bookname = '역경(+9)'; break;
case 15: $bookname = '시경(+10)'; break;
case 16: $bookname = '구국론(+10)'; break;
case 17: $bookname = '상군서(+11)'; break;
case 18: $bookname = '춘추전(+11)'; break;
case 19: $bookname = '산해경(+12)'; break;
case 20: $bookname = '맹덕신서(+12)'; break;
case 21: $bookname = '관자(+13)'; break;
case 22: $bookname = '병법24편(+13)'; break;
case 23: $bookname = '한비자(+14)'; break;
case 24: $bookname = '오자병법(+14)'; break;
case 25: $bookname = '노자(+15)'; break;
case 26: $bookname = '손자병법(+15)'; break;
}
return $bookname;
}
function getBookEff($book) : ?int {
switch($book) {
case 7: $book = 7; break;
case 8: $book = 7; break;
case 9: $book = 7; break;
case 10: $book = 7; break;
case 11: $book = 8; break;
case 12: $book = 8; break;
case 13: $book = 9; break;
case 14: $book = 9; break;
case 15: $book = 10; break;
case 16: $book = 10; break;
case 17: $book = 11; break;
case 18: $book = 11; break;
case 19: $book = 12; break;
case 20: $book = 12; break;
case 21: $book = 13; break;
case 22: $book = 13; break;
case 23: $book = 14; break;
case 24: $book = 14; break;
case 25: $book = 15; break;
case 26: $book = 15; break;
default: break;
}
return $book;
}
@@ -569,77 +657,56 @@ function getHorseName($horse) : ?string {
case 4: $horsename = '나귀(+4)'; break;
case 5: $horsename = '갈색마(+5)'; break;
case 6: $horsename = '흑색마(+6)'; break;
case 7: $horsename = '백마(+7)'; break;
case 8: $horsename = '기주마(+8)'; break;
case 9: $horsename = '주마(+9)'; break;
case 10: $horsename = '과하마(+10)'; break;
case 11: $horsename = '대완마(+11)'; break;
case 12: $horsename = '대완마(+11)'; break;
case 13: $horsename = '대완마(+11)'; break;
case 14: $horsename = '서량마(+12)'; break;
case 15: $horsename = '서량마(+12)'; break;
case 16: $horsename = '서량마(+12)'; break;
case 17: $horsename = '화종마(+13)'; break;
case 18: $horsename = '화종마(+13)'; break;
case 19: $horsename = '화종마(+13)'; break;
case 20: $horsename = '옥룡마(+14)'; break;
case 21: $horsename = '옥룡마(+14)'; break;
case 22: $horsename = '옥룡마(+14)'; break;
case 23: $horsename = '사륜거(+15)'; break;
case 24: $horsename = '사륜거(+15)'; break;
case 25: $horsename = '사륜거(+15)'; break;
case 26: $horsename = '적(+16)'; break;
case 27: $horsename = '적로(+16)'; break;
case 28: $horsename = '적로(+16)'; break;
case 29: $horsename = '적란마(+17)'; break;
case 30: $horsename = '적란마(+17)'; break;
case 31: $horsename = '적란마(+17)'; break;
case 32: $horsename = '조황비전(+18)'; break;
case 33: $horsename = '조황비전(+18)'; break;
case 34: $horsename = '조황비전(+18)'; break;
case 35: $horsename = '한혈마(+19)'; break;
case 36: $horsename = '한혈마(+19)'; break;
case 37: $horsename = '한혈마(+19)'; break;
case 38: $horsename = '적토마(+20)'; break;
case 39: $horsename = '적토마(+20)'; break;
case 40: $horsename = '적토마(+20)'; break;
case 8: $horsename = '마(+7)'; break;
case 9: $horsename = '주마(+7)'; break;
case 10: $horsename = '기주마(+7)'; break;
case 11: $horsename = '양주마(+8)'; break;
case 12: $horsename = '양주마(+8)'; break;
case 13: $horsename = '과하마(+9)'; break;
case 14: $horsename = '과하마(+9)'; break;
case 15: $horsename = '대완마(+10)'; break;
case 16: $horsename = '대완마(+10)'; break;
case 17: $horsename = '서량마(+11)'; break;
case 18: $horsename = '서량마(+11)'; break;
case 19: $horsename = '사륜거(+12)'; break;
case 20: $horsename = '사륜거(+12)'; break;
case 21: $horsename = '절영(+13)'; break;
case 22: $horsename = '적로(+13)'; break;
case 23: $horsename = '적란마(+14)'; break;
case 24: $horsename = '조황비전(+14)'; break;
case 25: $horsename = '한혈마(+15)'; break;
case 26: $horsename = '적토마(+15)'; break;
}
return $horsename;
}
function getHorseEff($horse) : ?int {
return [
11=>11,
12=>11,
13=>11,
14=>12,
15=>12,
16=>12,
17=>13,
18=>13,
19=>13,
20=>14,
21=>14,
22=>14,
23=>15,
24=>15,
25=>15,
26=>16,
27=>16,
28=>16,
29=>17,
30=>17,
31=>17,
32=>18,
33=>18,
34=>18,
35=>19,
36=>19,
37=>19,
38=>20,
39=>20,
40=>20,
][$horse]??$horse;
switch($horse) {
case 7: $horse = 7; break;
case 8: $horse = 7; break;
case 9: $horse = 7; break;
case 10: $horse = 7; break;
case 11: $horse = 8; break;
case 12: $horse = 8; break;
case 13: $horse = 9; break;
case 14: $horse = 9; break;
case 15: $horse = 10; break;
case 16: $horse = 10; break;
case 17: $horse = 11; break;
case 18: $horse = 11; break;
case 19: $horse = 12; break;
case 20: $horse = 12; break;
case 21: $horse = 13; break;
case 22: $horse = 13; break;
case 23: $horse = 14; break;
case 24: $horse = 14; break;
case 25: $horse = 15; break;
case 26: $horse = 15; break;
default: break;
}
return $horse;
}
function getItemName($item) : ?string {
@@ -691,15 +758,15 @@ function getItemInfo(?int $item):?string{
9=>['도소연명(치료)', '[군사] 턴 실행 전 부상 회복.'],
10=>['칠엽청점(치료)', '[군사] 턴 실행 전 부상 회복.'],
11=>['정력견혈(치료)', '[군사] 턴 실행 전 부상 회복.'],
12=>['과실주(훈련)', '[전투] 훈련 보정 +5'],
13=>['이강주(훈련)', '[전투] 훈련 보정 +5'],
14=>['의적주(사기)', '[전투] 사기 보정 +5'],
15=>['두강주(사기)', '[전투] 사기 보정 +5'],
16=>['보령압주(사기)', '[전투] 사기 보정 +5'],
17=>['철벽서(훈련)', '[전투] 훈련 보정 +7'],
18=>['단결도(훈련)', '[전투] 훈련 보정 +7'],
19=>['춘화첩(사기)', '[전투] 사기 보정 +7'],
20=>['초선화(사기)', '[전투] 사기 보정 +7'],
12=>['과실주(훈련)', '[전투] 훈련 보정 +10'],
13=>['이강주(훈련)', '[전투] 훈련 보정 +10'],
14=>['의적주(사기)', '[전투] 사기 보정 +10'],
15=>['두강주(사기)', '[전투] 사기 보정 +10'],
16=>['보령압주(사기)', '[전투] 사기 보정 +10'],
17=>['철벽서(훈련)', '[전투] 훈련 보정 +14'],
18=>['단결도(훈련)', '[전투] 훈련 보정 +14'],
19=>['춘화첩(사기)', '[전투] 사기 보정 +14'],
20=>['초선화(사기)', '[전투] 사기 보정 +14'],
21=>['육도(계략)', '[계략] 화계·탈취·파괴·선동 : 성공률 +20%p'],
22=>['삼략(계략)', '[계략] 화계·탈취·파괴·선동 : 성공률 +20%p'],
23=>['청낭서(의술)', '[군사] 매 턴마다 자신(100%)과 소속 도시 장수(적 포함 50%) 부상 회복<br>[전투] 페이즈마다 20% 확률로 치료 발동(아군 피해 1/3 감소)'],
@@ -734,10 +801,6 @@ function getItemCost($weap) : int {
case 4: $weapcost = 10000; break;
case 5: $weapcost = 15000; break;
case 6: $weapcost = 21000; break;
case 7: $weapcost = 28000; break;
case 8: $weapcost = 36000; break;
case 9: $weapcost = 45000; break;
case 10: $weapcost = 55000; break;
default: $weapcost = 200; break;
}
return $weapcost;
@@ -818,4 +881,4 @@ function newColor($color) : string {
function backColor($color) : string {
return newColor($color);
}
}
+76 -116
View File
@@ -346,85 +346,16 @@ function preUpdateMonthly() {
//미보급도시 10% 감소
$query = "update city set pop=pop*0.9,rate=rate*0.9,agri=agri*0.9,comm=comm*0.9,secu=secu*0.9,def=def*0.9,wall=wall*0.9 where supply='0'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$relYear = $admin['year'] - $admin['startyear'];
$relMaxTech = Util::valueFit(
floor($relYear / 5) + 1,
1,
GameConst::$maxTechLevel
) * 1000;
foreach($db->queryAllLists('SELECT count(no), nation FROM general WHERE nation != 0 GROUP BY nation') as [$genCnt, $nationID]){
$genCnt = Util::valueFit($genCnt, GameConst::$initialNationGenLimit);
$nationType = getNationStaticInfo($nationID)['type'];
//자동 기술연구
$techOffset = 20;
if(in_array($nationType, [3, 13])){
$techOffset *= 1.05;
}
else if(in_array($nationType, [5, 6, 7, 8, 12])){
$techOffset *= 0.95;
}
$db->update('nation', [
'totaltech'=>$db->sqleval(
'if(tech >= %i, totaltech, totaltech + %i)',
$relMaxTech,
$techOffset * $genCnt
),
'tech'=>$db->sqleval('totaltech / %i', $genCnt)
], 'nation = %i', $nationID);
//내정이 덜 찬곳은 1%p씩 증가. 내정이 오버된 곳은 1%씩 감소.
$setValues = [];
//인구는 고정
$setValues['pop'] = $db->sqleval('if(pop > pop2, GREATEST(pop2, pop*0.99), pop)');
//농지, 상업
if(in_array($nationType, [2, 12])){
$agriOffset = 1.1;
}
else if(in_array($nationType, [8, 11])){
$agriOffset = 0.9;
}
else{
$agriOffset = 1;
}
$setValues['agri'] = $db->sqleval('if(agri > agri2, GREATEST(agri2, agri*0.99), LEAST(agri2, agri + 80*%d))', $agriOffset);
$setValues['comm'] = $db->sqleval('if(comm > comm2, GREATEST(comm2, comm*0.99), LEAST(comm2, comm + 80*%d))', $agriOffset);
//치안
if(in_array($nationType, [1, 4])){
$secuOffset = 1.1;
}
else if(in_array($nationType, [6, 9])){
$secuOffset = 0.9;
}
else{
$secuOffset = 1;
}
$setValues['secu'] = $db->sqleval('if(secu > secu2, GREATEST(secu2, secu*0.99), LEAST(secu2, secu + 60*%d))', $secuOffset);
//수비, 성벽
if(in_array($nationType, [3, 5, 10, 11])){
$defOffset = 1.1;
}
else if(in_array($nationType, [4, 7, 8, 13])){
$defOffset = 0.9;
}
else{
$defOffset = 1;
}
$setValues['def'] = $db->sqleval('if(def > def2, GREATEST(def2, def*0.99), LEAST(def2, def + 80*%d))', $defOffset);
$setValues['wall'] = $db->sqleval('if(wall > wall2, GREATEST(wall2, wall*0.99), LEAST(wall2, wall + 80*%d))', $defOffset);
$db->update('city', $setValues, 'nation = %i AND supply = 1', $nationID);
//미보급도시 장수 5% 감소
$query = "select city,nation from city where supply='0'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$cityCount = MYDB_num_rows($result);
for($i=0; $i < $cityCount; $i++) {
$city = MYDB_fetch_array($result);
//병 훈 사 5%감소
$query = "update general set crew=crew*0.95,atmos=atmos*0.95,train=train*0.95 where city='{$city['city']}' and nation='{$city['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
//민심30이하 공백지 처리
$query = "select city,name,gen1,gen2,gen3 from city where rate<='30' and supply='0'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
@@ -1042,7 +973,7 @@ function updateNationState() {
$connect=$db->get();
$history = array();
$admin = $gameStor->getValues(['year', 'month', 'fiction', 'startyear', 'show_img_level', 'turnterm']);
$admin = $gameStor->getValues(['year', 'month', 'fiction', 'startyear', 'show_img_level', 'turnterm', 'turntime', 'killturn']);
$query = "select nation,name,level,gennum,tech from nation";
$nationresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
@@ -1074,8 +1005,10 @@ function updateNationState() {
}
if($nationlevel > $nation['level']) {
$levelDiff = $nationlevel - $nation['level'];
$oldLevel = $nation['level'];
$nation['level'] = $nationlevel;
switch($nationlevel) {
case 7:
@@ -1100,46 +1033,73 @@ function updateNationState() {
}
$maxTroopLeader = [
1=>0,
2=>2,
3=>4,
4=>6,
5=>8,
6=>10,
7=>12,
][$nationlevel]??0;
foreach(range(1, $levelDiff) as $idx){
//유니크 아이템 하나 돌리자
$targetKillTurn = $admin['killturn'];
$targetKillTurn -= 24 * 60 / $admin['turnterm'];
$nationGenList = $db->query('SELECT no, level, belong, horse, weap, book, item FROM general WHERE nation = %i AND killturn >= %i AND npc < 2', $nation['nation'], $targetKillTurn);
$uniqueLotteryWeightList = [];
foreach($nationGenList as $nationGen){
if($nationGen['horse'] > 6 || $nationGen['weap'] > 6 || $nationGen['book'] > 6 || $nationGen['item'] > 6){
continue;
}
$score = $nationGen['belong'] + 5; //임관 년도 + 5
if($nationGen['level'] == 12){
$score += 200; //NOTE: 꼬우면 군주하세요.
}
else if($nationGen['level'] == 11){
$score += 70;
}
else if($nationGen['level'] > 4){
$score += 35;
}
$uniqueLotteryWeightList[$nationGen['no']] = $score;
}
guaranteedUniqueItemLottery($uniqueLotteryWeightList, '작위보상');
}
$lastAssemblerID = $gameStor->assembler_id??0;
$currentTroopLeaderCnt = $db->queryFirstField('SELECT count(no) FROM general WHERE nation = %i AND npc = 5', $nation['nation']);
while($currentTroopLeaderCnt < $maxTroopLeader){
$currentTroopLeaderCnt++;
$lastAssemblerID += 1;
$npcObj = new Scenario\NPC(
999, sprintf('부대장%3d',$lastAssemblerID), null, $nation['nation'], null,
10, 10, 10, 1, $admin['year'] - 15, $admin['year'] + 15, '은둔', '의술'
);
$npcObj->npc = 5;
$npcObj->build($admin);
$npcID = $npcObj->generalID;
for($levelGen = max(1, $oldLevel) + 1; $levelGen <= $nationlevel; $levelGen+=1){
if(in_array($levelGen, [3, 5, 7])){
$genStep = 2;
}
else{
$genStep = 1;
}
while($genStep > 0){
$lastAssemblerID += 1;
$npcObj = new Scenario\NPC(
999, sprintf('부대장%3d',$lastAssemblerID), null, $nation['nation'], null,
10, 10, 10, 1, $admin['year'] - 15, $admin['year'] + 15, '은둔', '척사'
);
$npcObj->npc = 5;
$npcObj->build($admin);
$npcID = $npcObj->generalID;
$db->insert('troop', [
'name'=>$npcObj->realName,
'nation'=>$nation['nation'],
'no'=>$npcID
]);
$troopID = $db->insertId();
$db->insert('troop', [
'name'=>$npcObj->realName,
'nation'=>$nation['nation'],
'no'=>$npcID
]);
$troopID = $db->insertId();
$command = EncodeCommand(0, 0, 0, 26); //집합
$db->update('general', [
'troop'=>$troopID,
'turn0'=>$command,
'turn1'=>$command,
'turn2'=>$command,
'turn3'=>$command,
'turn4'=>$command,
'turn5'=>$command,
'killturn'=>80
], 'no=%i', $npcID);
$command = EncodeCommand(0, 0, 0, 26); //집합
$db->update('general', [
'troop'=>$troopID,
'turn0'=>$command,
'turn1'=>$command,
'turn2'=>$command,
'turn3'=>$command,
'turn4'=>$command,
'turn5'=>$command,
'killturn'=>80
], 'no=%i', $npcID);
$genStep -= 1;
}
}
$gameStor->assembler_id = $lastAssemblerID;
+271 -92
View File
@@ -1,10 +1,82 @@
<?php
namespace sammo;
class AIAllowedAction{
public $develop = true;
public $warp = true;
public $randomRecruit = true;
public $recruit = true;
public $recruit_high = false;
public $train = true;
public $atmos = true;
public $battle = true;
public $appointment = true;
public $changeWarCondition = true;
public $donation = true;
public $buySellRice = true;
public $staffAction = true;
function __construct($npc, $aiOptions){
if($npc >= 2){
return;
}
$this->develop = false;
$this->warp = false;
$this->randomRecruit = false;
$this->recruit = false;
$this->recruit_high = false;
$this->train = false;
$this->atmos = false;
$this->battle = false;
$this->appointment = false;
$this->changeWarCondition = false;
$this->donation = false;
$this->buySellRice = true;
$this->staffAction = false;
foreach($aiOptions as $key=>$value){
assert($value);
switch($key){
case 'develop':
$this->develop = true;
break;
case 'warp':
$this->warp = true;
break;
case 'recruit_high':
$this->recruit_high = true;
case 'recruit':
$this->recruit = true;
$this->changeWarCondition = true;
break;
case 'train':
$this->train = true;
$this->atmos = true;
$this->changeWarCondition = true;
break;
case 'battle':
$this->battle = true;
break;
}
}
}
}
function SetDevelop($genType, $no, $city, $tech) {
$db = DB::db();
$connect=$db->get();
$gameStor = KVStorage::getStorage($db, 'game_env');
[$startyear, $year] = $gameStor->getValuesAsArray(['startyear', 'year']);
$query = "select rate,pop/pop2*100 as po,comm/comm2*100 as co,def/def2*100 as de,wall/wall2*100 as wa,secu/secu2*100 as se,agri/agri2*100 as ag from city where city='$city'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$city = MYDB_fetch_array($result);
@@ -22,22 +94,6 @@ function SetDevelop($genType, $no, $city, $tech) {
$command = EncodeCommand(0, 0, 0, 9); //조달
switch($genType) {
case 0: //무장
if($prob < 30) {
if($city['po'] < $city['de']) { $command = EncodeCommand(0, 0, 0, 7); } //정장
elseif($city['de'] < 99) { $command = EncodeCommand(0, 0, 0, 5); } //수비
else { $command = EncodeCommand(0, 0, 0, 9); } //조달
} elseif($prob < 60) {
if($city['po'] < $city['wa']) { $command = EncodeCommand(0, 0, 0, 7); } //정장
elseif($city['wa'] < 99) { $command = EncodeCommand(0, 0, 0, 6); } //성벽
else { $command = EncodeCommand(0, 0, 0, 9); } //조달
} elseif($prob < 90) {
if($city['po'] < $city['se']) { $command = EncodeCommand(0, 0, 0, 7); } //정장
elseif($city['se'] < 99) { $command = EncodeCommand(0, 0, 0, 8); } //치안
else { $command = EncodeCommand(0, 0, 0, 9); } //조달
} else {
$command = EncodeCommand(0, 0, 0, 29);
}
break;
case 2: //무내정장
if($prob < 30) {
if($city['de'] < 99) { $command = EncodeCommand(0, 0, 0, 5); } //수비
@@ -56,42 +112,23 @@ function SetDevelop($genType, $no, $city, $tech) {
}
break;
case 1: //지장
if($prob < 40) {
if($city['po'] < $city['ag']) { $command = EncodeCommand(0, 0, 0, 7); } //정장
elseif($tech < 10000) { $command = EncodeCommand(0, 0, 0, 3); } //기술
elseif($city['ag'] < 99) { $command = EncodeCommand(0, 0, 0, 1); } //농업
else { $command = EncodeCommand(0, 0, 0, 9); } //조달
} elseif($prob < 80) {
if($city['po'] < $city['co']) { $command = EncodeCommand(0, 0, 0, 7); } //정장
elseif($tech < 10000) { $command = EncodeCommand(0, 0, 0, 3); } //기술
elseif($city['co'] < 99) { $command = EncodeCommand(0, 0, 0, 2); } //상업
else { $command = EncodeCommand(0, 0, 0, 9); } //조달
} elseif($prob < 90) {
if($city['po'] < 99) { $command = EncodeCommand(0, 0, 0, 7); } //정장
elseif($tech < 10000) { $command = EncodeCommand(0, 0, 0, 3); } //기술
else { $command = EncodeCommand(0, 0, 0, 9); } //조달
} else {
if($tech < 10000) { $command = EncodeCommand(0, 0, 0, 3 + (rand() % 2) * 6); } //기술, 조달
else { $command = EncodeCommand(0, 0, 0, 29); }
}
break;
case 3: //지내정장
if($prob < 40) {
if($tech < 10000) { $command = EncodeCommand(0, 0, 0, 3); } //기술
elseif($city['ag'] < 99) { $command = EncodeCommand(0, 0, 0, 1); } //농업
if($city['ag'] < 99) { $command = EncodeCommand(0, 0, 0, 1); } //농업
elseif(!TechLimit($startyear, $year, $tech)) { $command = EncodeCommand(0, 0, 0, 3); } //기술
elseif($city['po'] < 99) { $command = EncodeCommand(0, 0, 0, 7); } //정장
else { $command = EncodeCommand(0, 0, 0, 9); } //조달
} elseif($prob < 80) {
if($tech < 10000) { $command = EncodeCommand(0, 0, 0, 3); } //기술
elseif($city['co'] < 99) { $command = EncodeCommand(0, 0, 0, 2); } //상업
if($city['co'] < 99) { $command = EncodeCommand(0, 0, 0, 2); } //상업
elseif(!TechLimit($startyear, $year, $tech)) { $command = EncodeCommand(0, 0, 0, 3); } //기술
elseif($city['po'] < 99) { $command = EncodeCommand(0, 0, 0, 7); } //정장
else { $command = EncodeCommand(0, 0, 0, 9); } //조달
} elseif($prob < 90) {
if($tech < 10000) { $command = EncodeCommand(0, 0, 0, 3); } //기술
if(!TechLimit($startyear, $year, $tech)) { $command = EncodeCommand(0, 0, 0, 3); } //기술
elseif($city['po'] < 99) { $command = EncodeCommand(0, 0, 0, 7); } //정장
else { $command = EncodeCommand(0, 0, 0, 9); } //조달
} else {
if($tech < 10000) { $command = EncodeCommand(0, 0, 0, 3 + (rand() % 2) * 6); } //기술, 조달
if(!TechLimit($startyear, $year, $tech)) { $command = EncodeCommand(0, 0, 0, 3 + (rand() % 2) * 6); } //기술, 조달
else { $command = EncodeCommand(0, 0, 0, 29); }
}
break;
@@ -115,7 +152,7 @@ function SetDevelop($genType, $no, $city, $tech) {
return;
}
function SetCrew($no, $nationID, $personal, $gold, $leader, $genType, $tech, $dex0, $dex10, $dex20, $dex30, $dex40) {
function SetCrew($no, $nationID, $personal, $gold, $leader, $genType, $tech, $dex0, $dex10, $dex20, $dex30, $dex40, $currentCrewType, AIAllowedAction $allowedAction) {
$db = DB::db();
$connect=$db->get();
@@ -131,7 +168,78 @@ function SetCrew($no, $nationID, $personal, $gold, $leader, $genType, $tech, $de
[$startyear, $year] = $gameStor->getValuesAsArray(['startyear', 'year']);
$relYear = Util::valueFit($year-$startyear, 0);
$type = GameUnitConst::DEFAULT_CREWTYPE;
$type = 0;
switch($genType) {
case 0: //무장
case 2: //무내정장
$dex0 = $dex0 + rand()%1000;
$dex10 = $dex10 + rand()%1000;
$dex20 = $dex20 + rand()%1000;
$sel = 0;
// 보궁기 선택
if($dex0 > $dex10) {
if($dex0 > $dex20) {
$sel = 0;
} else {
$sel = 2;
}
} else {
if($dex10 > $dex20) {
$sel = 1;
} else {
$sel = 2;
}
}
$types = [];
switch($sel) {
case 0:
foreach(GameUnitConst::byType(GameUnitConst::T_FOOTMAN) as $crewtype){
if($crewtype->isValid($cities, $regions, $relYear, $tech)){
$types[] = $crewtype->id;
}
}
break;
case 1:
foreach(GameUnitConst::byType(GameUnitConst::T_ARCHER) as $crewtype){
if($crewtype->isValid($cities, $regions, $relYear, $tech)){
$types[] = $crewtype->id;
}
}
break;
case 2:
foreach(GameUnitConst::byType(GameUnitConst::T_CAVALRY) as $crewtype){
if($crewtype->isValid($cities, $regions, $relYear, $tech)){
$types[] = $crewtype->id;
}
}
break;
}
break;
case 1: //지장
case 3: //지내정장
foreach(GameUnitConst::byType(GameUnitConst::T_WIZARD) as $crewtype){
if($crewtype->isValid($cities, $regions, $relYear, $tech)){
$types[] = $crewtype->id;
}
}
break;
}
if($types){
if(!$allowedAction->randomRecruit && in_array($currentCrewType, $types) && $type != GameUnitConst::DEFAULT_CREWTYPE){
$type = $currentCrewType;
}
else{
$type = Util::choiceRandom($types);
}
}
else{
$type = GameUnitConst::DEFAULT_CREWTYPE;
}
@@ -142,19 +250,25 @@ function SetCrew($no, $nationID, $personal, $gold, $leader, $genType, $tech, $de
$crew = intdiv($gold, $cost);
if($leader < $crew) { $crew = $leader; }
$command = EncodeCommand(0, $type, $crew, 11);
if($allowedAction->recruit_high && $crew * $cost * 6 < $gold){
$command = EncodeCommand(0, $type, $crew, 12);
}
else{
$command = EncodeCommand(0, $type, $crew, 11);
}
$query = "update general set turn0='$command' where no='$no'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
return;
}
function processAI($no) {
function processAI($no, &$reduce_turn) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$admin = $gameStor->getValues(['startyear','year','month','turnterm','scenario','gold_rate','rice_rate']);
$admin = $gameStor->getValues(['startyear','year','month','turnterm','scenario','gold_rate','rice_rate','killturn','autorun_user']);
// 초반 여부
if($admin['startyear']+2 > $admin['year'] || ($admin['startyear']+2 == $admin['year'] && $admin['month'] < 5)) {
$isStart = 1;
@@ -162,7 +276,8 @@ function processAI($no) {
$isStart = 0;
}
$query = "select no,turn0,npcid,name,nation,nations,city,level,npcmsg,personal,leader,intel,power,gold,rice,crew,train,atmos,troop,npc,affinity,mode,injury,picture,imgsvr,killturn,makelimit,dex0,dex10,dex20,dex30,dex40 from general where no='$no'";
$query = "select no,turn0,npcid,name,nation,nations,city,level,npcmsg,personal,leader,intel,power,gold,rice,crew,crewtype,train,atmos,troop,npc,affinity,mode,injury,picture,imgsvr,killturn,makelimit,dex0,dex10,dex20,dex30,dex40 from general where no='$no'";
$result = MYDB_query($query, $connect) or Error("processAI01 ".MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
@@ -207,15 +322,55 @@ function processAI($no) {
return;
}
$autorun_user = $admin['autorun_user'];
if($general['npc'] < 2){
$autorun_limit_minutes = $autorun_user['limit_minutes']??0;
if(!$autorun_limit_minutes){
return;
}
if($general['nation'] == 0){
return;
}
$blankTurnCnt = $admin['killturn']-$general['killturn'];
if($blankTurnCnt * $admin['turnterm'] > $autorun_limit_minutes){
return;
}
}
// 입력된 턴이 있으면 그것 실행
if(DecodeCommand($general['turn0'])[0] != 0) {
return;
}
$query = "select city,region,nation,level,path,rate,gen1,gen2,gen3,pop,supply,front from city where city='{$general['city']}'";
$reduce_turn = true;
$allowedAction = new AIAllowedAction($general['npc'], $autorun_user['options']??[]);
if($general['troop'] && $allowedAction->warp){
$troopLeader = $db->query(
'SELECT general.no,general.name,general.city,turn0,troop,general.nation, city.nation AS city_nation FROM general JOIN city ON city.city = general.city WHERE troop = %i', $general['troop']
);
if(DecodeCommand($troopLeader['turn0'])[0] != 26){
//valid
}
else if($troopLeader['nation'] == $troopLeader['city_nation']){
//valid
}
else{
$allowedAction->warp = false;
}
}
$query = "select city,region,nation,level,path,rate,gen1,gen2,gen3,pop,supply,front,trade from city where city='{$general['city']}'";
$result = MYDB_query($query, $connect) or Error("processAI02 ".MYDB_error($connect),"");
$city = MYDB_fetch_array($result);
if ($general['npc'] < 2 && $allowedAction->buySellRice) {
if($city['trade'] == 0){
$allowedAction->buySellRice = false;
}
}
$query = "select nation,level,tech,gold,rice,rate,type,color,name,war from nation where nation='{$general['nation']}'";
$result = MYDB_query($query, $connect) or Error("processAI03 ".MYDB_error($connect),"");
$nation = MYDB_fetch_array($result)??[
@@ -294,17 +449,20 @@ function processAI($no) {
$tech = getTechCost($nation['tech']);
$resrc = $tech * 700;//XXX: 왜 700이지?
if($general['atmos'] >= 90 && $general['train'] >= 90) {
if($general['mode'] == 0) {
$query = "update general set mode=1 where no='{$general['no']}'";
MYDB_query($query, $connect) or Error("processAI05 ".MYDB_error($connect),"");
}
} else {
if($general['mode'] == 1) {
$query = "update general set mode=0 where no='{$general['no']}'";
MYDB_query($query, $connect) or Error("processAI05 ".MYDB_error($connect),"");
if($allowedAction->changeWarCondition){
if($general['atmos'] >= 90 && $general['train'] >= 90) {
if($general['mode'] == 0) {
$query = "update general set mode=1 where no='{$general['no']}'";
MYDB_query($query, $connect) or Error("processAI05 ".MYDB_error($connect),"");
}
} else {
if($general['mode'] == 1) {
$query = "update general set mode=0 where no='{$general['no']}'";
MYDB_query($query, $connect) or Error("processAI05 ".MYDB_error($connect),"");
}
}
}
//운영자메시지 출력 하루 6번..?
//특별 메세지 있는 경우 출력 하루 4번
@@ -336,7 +494,7 @@ function processAI($no) {
$rulerNation = $db->queryFirstField('SELECT nation FROM general WHERE `level`=12 AND npc=9 and nation not in %li ORDER BY RAND() limit 1', Json::decode($general['nations']));
if($ruler) {
if($rulerNation) {
$command = EncodeCommand(0, 0, $rulerNation, 25); //임관
} else {
$command = EncodeCommand(0, 0, 0, 42); //견문
@@ -344,7 +502,7 @@ function processAI($no) {
$query = "update general set turn0='$command' where no='{$general['no']}'";
MYDB_query($query, $connect) or Error("processAI07 ".MYDB_error($connect),"");
return;
} elseif($general['npc'] != 9 && $general['level'] == 0) {
} elseif($general['npc'] != 9 && $general['level'] == 0 && $allowedAction->appointment) {
switch(Util::choiceRandomUsingWeight([11.4, 40, 20, 28.6])) {
//임관 10%
case 0:
@@ -369,7 +527,7 @@ function processAI($no) {
}
else{
//랜임 커맨드 입력.
$command = EncodeCommand(0, 0, 99, 25); //임관
$command = EncodeCommand(0, 99, 0, 25); //임관
}
break;
case 1: //거병이나 견문 40%
@@ -399,7 +557,7 @@ function processAI($no) {
$rulerCommand = 0;
//군주가 할일
if($general['level'] == 12) {
if($general['level'] == 12 && $allowedAction->staffAction) {
//오랑캐인데 공격 못하면 바로 방랑/해산
if($general['npc'] == 9 && $dipState == 0 && !$attackable) {
//방랑군이냐 아니냐
@@ -514,7 +672,7 @@ function processAI($no) {
}
//방랑군 아니고, 입력된 턴이 없을때 수뇌부가 할일
if($nation['level'] != 0 && $general['level'] >= 5 && $rulerCommand == 0) {
if($nation['level'] != 0 && $general['level'] >= 5 && $rulerCommand == 0 && $allowedAction->staffAction) {
$command = NPCStaffWork($general, $nation, $dipState);
if($command){
$db->update('nation', [
@@ -536,7 +694,7 @@ function processAI($no) {
} elseif($general['injury'] > 10) {
// 부상 2달 이상이면 요양
$command = EncodeCommand(0, 0, 0, 50); //요양
} elseif($nation['level'] == 0) {
} elseif($nation['level'] == 0 && $allowedAction->appointment) {
//방랑군일때
if($admin['startyear']+3 <= $admin['year']) {
$command = EncodeCommand(0, 0, 0, 45); //하야
@@ -558,7 +716,7 @@ function processAI($no) {
return;
}
if($general['leader'] < 40){
if($general['leader'] < 40 && $allowedAction->donation){
//무지장인데
if(
@@ -593,7 +751,7 @@ function processAI($no) {
}
//국가 병량이 없을때 바로 헌납
if($nation['rice'] < 2000 && $general['rice'] > 200) {
if($nation['rice'] < 2000 && $general['rice'] > 200 && $allowedAction->donation) {
$amount = intdiv($general['rice'] - 200, 100) + 1;
if($amount > 20) { $amount = 20; }
$command = EncodeCommand(0, 2, $amount, 44); //헌납
@@ -613,23 +771,23 @@ function processAI($no) {
$target = array();
// 평시거나 초반아니면서 공격가능 없으면서 병사 있으면 해제(25%)
if($dipState == 0 && $isStart == 0 && !$attackable && $general['crew'] > 0 && rand()% 100 < 25) {
if($allowedAction->recruit && $dipState == 0 && $isStart == 0 && !$attackable && $general['crew'] > 0 && rand()% 100 < 25) {
$command = EncodeCommand(0, 0, 0, 17); //소집해제
} elseif($dipState <= 1 || $isStart == 1) {
//평시이거나 선포있어도 초반이면
if($general['gold'] + $general['rice'] < 200) { $command = EncodeCommand(0, 0, 0, 9); } //금쌀없으면 조달9
elseif($general['rice'] > 100 && $city['rate'] < 95) { $command = EncodeCommand(0, 0, 0, 4); } //우선 선정
elseif($general['gold'] < 100) { //금없으면 쌀팜
elseif($general['rice'] > 100 && $city['rate'] < 95 && $allowedAction->develop) { $command = EncodeCommand(0, 0, 0, 4); } //우선 선정
elseif($general['gold'] < 100 && $allowedAction->buySellRice) { //금없으면 쌀팜
$amount = intdiv(($general['rice'] - $general['gold'])/2, 100); // 100단위
$command = EncodeCommand(0, 1, $amount, 49); //팜
} elseif($general['gold'] < 500 && $general['rice'] < 500) { $command = EncodeCommand(0, 0, 0, 1); } //금쌀되면 내정
elseif($general['rice'] < 100) { //쌀없으면 쌀삼
} elseif($general['gold'] < 500 && $general['rice'] < 500 && $allowedAction->develop) { $command = EncodeCommand(0, 0, 0, 1); } //금쌀되면 내정
elseif($general['rice'] < 100 && $allowedAction->buySellRice) { //쌀없으면 쌀삼
$amount = intdiv(($general['gold'] - $general['rice'])/2, 100); // 100단위
$command = EncodeCommand(0, 2, $amount, 49); //삼
} elseif($genType >= 2) { $command = EncodeCommand(0, 0, 0, 1); } //내정장일때 내정
} elseif($genType >= 2 && $allowedAction->develop) { $command = EncodeCommand(0, 0, 0, 1); } //내정장일때 내정
else {
//현도시가 전방이면 공격 가능성 체크
if($city['front'] > 0) {
if($city['front'] > 0 && $allowedAction->battle) {
//주변도시 체크
$paths = explode('|', $city['path']);
for($i=0; $i < count($paths); $i++) {
@@ -654,6 +812,11 @@ function processAI($no) {
$sel = rand() % 10;
if($selCity['dev'] > 95) { $sel = 9; }
elseif($selCity['dev'] < 70) { $sel = 0; }
if(!$allowedAction->warp){
$sel = 0;
}
switch($sel) {
case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: // 그대로 내정 80 %
$command = EncodeCommand(0, 0, 0, 1);
@@ -696,22 +859,22 @@ function processAI($no) {
} else { // 공격인 경우
if($general['crew'] < 1000 && $general['gold'] >= $resrc && $general['rice'] >= $resrc) { //자원되고, 병사없을때
if($city['pop'] > 40000) { $command = EncodeCommand(0, 0, 0, 11); }
if($city['pop'] > 40000 && $allowedAction->recruit) { $command = EncodeCommand(0, 0, 0, 11); }
else { $command = EncodeCommand(0, 0, 0, 1); }
} elseif($general['rice'] < $resrc && $general['rice'] <= $general['gold']) {
} elseif($general['rice'] < $resrc && $general['rice'] <= $general['gold'] && $allowedAction->buySellRice) {
//금이 더 많으면 매매
$amount = intdiv(($general['gold'] - $general['rice']) / 2, 100); // 100단위
if($amount > 0) { $command = EncodeCommand(0, 2, $amount, 49); }//삼
else { $command = EncodeCommand(0, 0, 0, (rand()%2)*8 + 1); } // 내정, 조달
} elseif($general['gold'] < $resrc && $general['rice'] > $general['gold']) {
} elseif($general['gold'] < $resrc && $general['rice'] > $general['gold'] && $allowedAction->buySellRice) {
//쌀이 더 많으면 매매
$amount = intdiv(($general['rice'] - $general['gold']) / 2, 100); // 100단위
if($amount > 0) { $command = EncodeCommand(0, 1, $amount, 49); }//팜
else { $command = EncodeCommand(0, 0, 0, (rand()%2)*8 + 1); } // 내정, 조달
//자원, 병사 모두 충족
} elseif($general['crew'] >= 1000 && $general['train'] < 90) {
} elseif($general['crew'] >= 1000 && $general['train'] < 90 && $allowedAction->train) {
$command = EncodeCommand(0, 0, 0, 13); //훈련
} elseif($general['crew'] >= 1000 && $general['atmos'] < 90) {
} elseif($general['crew'] >= 1000 && $general['atmos'] < 90 && $allowedAction->atmos) {
$command = EncodeCommand(0, 0, 0, 14); //사기진작
} else {
//공격
@@ -731,18 +894,18 @@ function processAI($no) {
//전시일때
if($general['gold'] + $general['rice'] < $resrc*2) { $command = EncodeCommand(0, 0, 0, 9); } //금쌀없으면 조달
elseif($general['rice'] > $resrc && $city['rate'] < 95 && $city['front'] == 0) { $command = EncodeCommand(0, 0, 0, 4); } // 우선 선정
elseif($general['rice'] > $resrc && $city['rate'] < 50 && $city['front'] > 0) { $command = EncodeCommand(0, 0, 0, 4); } // 우선 선정
elseif($general['gold'] < $resrc || ($general['gold'] < $resrc *2 && $general['rice'] > $resrc * 6)) { // 금없으면 쌀팜
elseif($general['rice'] > $resrc && $city['rate'] < 95 && $city['front'] == 0 && $allowedAction->develop) { $command = EncodeCommand(0, 0, 0, 4); } // 우선 선정
elseif($general['rice'] > $resrc && $city['rate'] < 50 && $city['front'] > 0 && $allowedAction->develop) { $command = EncodeCommand(0, 0, 0, 4); } // 우선 선정
elseif(($general['gold'] < $resrc || ($general['gold'] < $resrc *2 && $general['rice'] > $resrc * 6)) && $allowedAction->buySellRice) { // 금없으면 쌀팜
$amount = intdiv(($general['rice'] - $general['gold'])/2, 100); // 100단위
if($amount > 0) { $command = EncodeCommand(0, 1, $amount, 49); }// 팜
else { $command = EncodeCommand(0, 0, 0, 9); } // 조달
} elseif($general['rice'] < $resrc || ($general['rice'] < $resrc *2 && $general['gold'] > $resrc * 6)) { // 쌀없으면 쌀삼
} elseif(($general['rice'] < $resrc || ($general['rice'] < $resrc *2 && $general['gold'] > $resrc * 6)) && $allowedAction->buySellRice) { // 쌀없으면 쌀삼
$amount = intdiv(($general['gold'] - $general['rice'])/2, 100); // 100단위
if($amount > 0) { $command = EncodeCommand(0, 2, $amount, 49); }// 팜
else { $command = EncodeCommand(0, 0, 0, 9); } // 조달
} elseif($genType >= 2) { $command = EncodeCommand(0, 0, 0, 1); } //내정장일때 내정
elseif($general['crew'] < 1000 && $general['gold'] >= $resrc && $general['rice'] >= $resrc) {
elseif($general['crew'] < 1000 && $general['gold'] >= $resrc && $general['rice'] >= $resrc && $allowedAction->recruit) {
$query = "select no from general where nation='{$general['nation']}'";
$result = MYDB_query($query, $connect) or Error("processAI16 ".MYDB_error($connect),"");
$genCount = MYDB_num_rows($result);
@@ -762,12 +925,12 @@ function processAI($no) {
// 전체 인구 대비 확률로 현지에서 징병
if($city['pop'] > 40000 && 100 + $ratio - $ratio2 > $ratio3) {
$command = EncodeCommand(0, 0, 0, 11); //인구 되면 징병
} else {
} else{
// 인구 안되면 4만 이상인 도시로 워프
$query = "select city from city where nation='{$general['nation']}' and pop>40000 and supply='1' order by rand() limit 0,1";
$result = MYDB_query($query, $connect) or Error("processAI16 ".MYDB_error($connect),"");
$cityCount = MYDB_num_rows($result);
if($cityCount > 0) {
if($cityCount > 0 && $allowedAction->warp) {
$selCity = MYDB_fetch_array($result);
//워프
$query = "update general set city='{$selCity['city']}' where no='{$general['no']}'";
@@ -777,17 +940,17 @@ function processAI($no) {
$query = "update general set turn0='$command' where no='{$general['no']}'";
MYDB_query($query, $connect) or Error("processAI23 ".MYDB_error($connect),"");
return;
} else {
} else if($allowedAction->develop){
$command = EncodeCommand(0, 0, 0, 7); //인구 안되면 정장
}
}
} elseif($general['crew'] >= 1000 && $general['train'] < 90) {
} elseif($general['crew'] >= 1000 && $general['train'] < 90 && $allowedAction->train) {
if($general['atmos'] >= 90 && $general['train'] >= 60 && $general['mode'] == 0) {
$query = "update general set mode=1 where no='{$general['no']}'";
MYDB_query($query, $connect) or Error("processAI05 ".MYDB_error($connect),"");
}
$command = EncodeCommand(0, 0, 0, 13); //훈련
} elseif($general['crew'] >= 1000 && $general['atmos'] < 90) {
} elseif($general['crew'] >= 1000 && $general['atmos'] < 90 && $allowedAction->atmos) {
if($general['atmos'] >= 60 && $general['train'] >= 90 && $general['mode'] == 0) {
$query = "update general set mode=1 where no='{$general['no']}'";
MYDB_query($query, $connect) or Error("processAI05 ".MYDB_error($connect),"");
@@ -811,7 +974,7 @@ function processAI($no) {
if($dip['state'] == 0) $target[] = $targetCity['city'];
}
}
if(count($target) == 0) {
if(count($target) == 0 && $allowedAction->warp) {
//전방 도시 선택, 30% 확률로 태수 있는 전방으로 워프
if(rand()%100 < 30) {
$query = "select city from city where nation='{$general['nation']}' and supply='1' and front>0 order by gen1 desc,rand() limit 0,1";
@@ -846,20 +1009,36 @@ function processAI($no) {
} else {
$command = EncodeCommand(0, 0, 0, (rand()%2)*8 + 1); //공격 가능도시가 없고 워프도 안되면 내정, 조달
}
} elseif($nation['war'] == 1) {
} elseif($nation['war'] == 1 || !$allowedAction->battle) {
//전금이면 내정, 조달
$command = EncodeCommand(0, 0, 0, (rand()%2)*8 + 1); //내정, 조달
} else { $command = EncodeCommand(0, 0, $target[rand()%count($target)], 16); } //있으면 공격
} else if($target){ $command = EncodeCommand(0, 0, $target[rand()%count($target)], 16); } //있으면 공격
}
}
}
switch($command) {
case EncodeCommand(0, 0, 0, 1): //내정
SetDevelop($genType, $general['no'], $general['city'], $nation['tech']);
if($allowedAction->develop){
SetDevelop($genType, $general['no'], $general['city'], $nation['tech']);
}
else{
$db->update('general', [
'turn0'=>EncodeCommand(0, 0, 0, 29)
], 'no=%i', $general['no']);
}
return;
case EncodeCommand(0, 0, 0, 11): //징병
SetCrew($general['no'], $general['nation'], $general['personal'], $general['gold'], $general['leader'], $genType, $nation['tech'], $general['dex0'], $general['dex10'], $general['dex20'], $general['dex30'], $general['dex40']);
if ($allowedAction->recruit) {
SetCrew($general['no'], $general['nation'], $general['personal'], $general['gold'], $general['leader'], $genType, $nation['tech'], $general['dex0'], $general['dex10'], $general['dex20'], $general['dex30'], $general['dex40'], $general['crewtype'], $allowedAction);
}
else{
$db->update('general', [
'turn0'=>EncodeCommand(0, 0, 0, 29)
], 'no=%i', $general['no']);
}
return;
default:
$query = "update general set turn0='$command' where no='{$general['no']}'";
+112 -1
View File
@@ -229,6 +229,8 @@ function process_1(&$general, $type) {
$log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. $dtype 실패. <1>$date</>";
} elseif($general['gold'] < $admin['develcost']) {
$log[] = "<C>●</>{$admin['month']}월:자금이 모자랍니다. $dtype 실패. <1>$date</>";
} elseif($city["$stype"] >= $city["$stype"."2"]) {
$log[] = "<C>●</>{$admin['month']}월:{$dtype}{$btype} 충분합니다. $dtype 실패. <1>$date</>";
} else {
// 민심 50 이하이면 50과 같게
if($city['rate'] < GameConst::$develrate) { $city['rate'] = GameConst::$develrate; }
@@ -276,7 +278,19 @@ function process_1(&$general, $type) {
$exp = CharExperience($exp, $general['personal']);
$ded = CharDedication($ded, $general['personal']);
if($city['front'] == 1){
if($city['city'] == $nation['capital']){
$degrade = 1 - ($admin['year'] - $admin['startyear'] - 5) * 0.025;
$score *= Util::valueFit($degrade, 0.5, 1);
}
else{
$score *= 0.5;
}
}
$score += $city["$stype"];
if($score > $city["{$stype}2"]) { $score = $city["{$stype}2"]; }
// 내정 상승
$query = "update city set {$stype}='$score' where city='{$general['city']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
@@ -524,6 +538,8 @@ function process_5(&$general, $type) {
$log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. $dtype 실패. <1>$date</>";
} elseif($general['gold'] < $admin['develcost']) {
$log[] = "<C>●</>{$admin['month']}월:자금이 모자랍니다. $dtype 실패. <1>$date</>";
} elseif($city["$stype"] >= $city["$stype"."2"]) {
$log[] = "<C>●</>{$admin['month']}월:{$dtype}는 충분합니다. $dtype 실패. <1>$date</>";
} else {
// 민심 50 이하이면 50과 같게
if($city['rate'] < GameConst::$develrate) { $city['rate'] = GameConst::$develrate; }
@@ -567,11 +583,35 @@ function process_5(&$general, $type) {
$exp = $score * 0.7;
$ded = $score * 1.0;
if($city['front'] == 1){
if($city['city'] == $nation['capital']){
if($stype == 'def'){
$degrade = 1 - ($admin['year'] - $admin['startyear'] - 5) * 0.025;
$score *= Util::valueFit($degrade, 0.5, 1);
}
else{
$degrade = 1 - ($admin['year'] - $admin['startyear'] - 5) * 0.0375;
$score *= Util::valueFit($degrade, 0.25, 1);
}
}
else{
if($stype == 'def'){
$score *= 0.5;
}
else{
$score *= 0.25;
}
}
}
// 성격 보정
$exp = CharExperience($exp, $general['personal']);
$ded = CharDedication($ded, $general['personal']);
$score += $city["$stype"];
if($score > $city["{$stype}2"]) { $score = $city["{$stype}2"]; }
// 내정 상승
$query = "update city set {$stype}='$score' where city='{$general['city']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
@@ -618,6 +658,8 @@ function process_7(&$general) {
$log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. 정착 장려 실패. <1>$date</>";
} elseif($general['rice'] < $admin['develcost'] * 2) {
$log[] = "<C>●</>{$admin['month']}월:군량이 모자랍니다. 정착 장려 실패. <1>$date</>";
} elseif($city['pop'] >= $city['pop2']) {
$log[] = "<C>●</>{$admin['month']}월:이미 포화상태입니다. 정착 장려 실패. <1>$date</>";
} else {
$score = getGeneralLeadership($general, true, true, true);
$score = $score * (100 + $general['explevel']/5)/100;
@@ -659,6 +701,7 @@ function process_7(&$general) {
$ded = CharDedication($ded, $general['personal']);
$score = $city['pop'] + ($score * 10);
if($score > $city['pop2']) { $score = $city['pop2']; }
// 민심 상승
$query = "update city set pop='$score' where city='{$general['city']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
@@ -756,6 +799,7 @@ function process_8(&$general) {
$ded = CharDedication($ded, $general['personal']);
$score += $city["$stype"];
if($score > $city["{$stype}2"]) { $score = $city["{$stype}2"]; }
// 내정 상승
$query = "update city set {$stype}='$score' where city='{$general['city']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
@@ -2240,7 +2284,7 @@ function process_48(&$general) {
$log[] = "<C>●</>{$admin['month']}월:도시에 상인이 없습니다. 장비매매 실패. <1>$date</>";
} elseif($city['secu']/1000 < $type) {
$log[] = "<C>●</>{$admin['month']}월:이 도시에서는 구할 수 없었습니다. 구입 실패. <1>$date</>";
} elseif(($isweap == 2 && $type > 10) || ($isweap != 2 && $type > 6) || $type < 0) {
} elseif($type > 6 || $type < 0) {
$log[] = "<C>●</>{$admin['month']}월:구입할 수 있는 물건이 아닙니다. 구입 실패. <1>$date</>";
} elseif($general['gold'] < $cost && $type != 0) {
$log[] = "<C>●</>{$admin['month']}월:자금이 모자랍니다. 구입 실패. <1>$date</>";
@@ -2484,6 +2528,73 @@ function process_50(&$general) {
pushGenLog($general, $log);
}
function process_58(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env');
$log = [];
$alllog = [];
$history = [];
$date = substr($general['turntime'],11,5);
$admin = $gameStor->getValues(['year', 'month', 'develcost']);
$command = DecodeCommand($general['turn0']);
$fromDexIdx = $command[1];
$toDexIdx = $command[2];
if($general['nation'] == 0) {
$log[] = "<C>●</>{$admin['month']}월:재야입니다. 숙련 전환 실패. <1>$date</>";
} elseif($general['gold'] < $admin['develcost']) {
$log[] = "<C>●</>{$admin['month']}월:자금이 모자랍니다. 숙련 전환 실패. <1>$date</>";
} elseif($general['rice'] < $admin['develcost']) {
$log[] = "<C>●</>{$admin['month']}월:군량이 모자랍니다. 숙련 전환 실패. <1>$date</>";
} elseif($fromDexIdx < 0 || $fromDexIdx > 4 || $toDexIdx < 0 || $toDexIdx > 4){
$log[] = "<C>●</>{$admin['month']}월:올바르지 않은 병종 코드입니다. 숙련 전환 실패. <1>$date</>";
} elseif($general['dex'.($fromDexIdx*10)] == 0) {
$log[] = "<C>●</>{$admin['month']}월:전환할 병종 숙련이 없습니다. 숙련 전환 실패. <1>$date</>";
} else {
$fromOrigDex = $general['dex'.($fromDexIdx*10)];
$toOrigDex = $general['dex'.($toDexIdx*10)];
$cutDex = Util::toInt($fromOrigDex * 0.3);
$fromNewDex = $fromOrigDex - $cutDex;
$addDex = Util::toInt($cutDex * 2 / 3);
$toNewDex = $toOrigDex + $addDex;
$exp = 10;
$exp = CharExperience($exp, $general['personal']);
$fromCrewStr = GameUnitConst::allType()[$fromDexIdx];
$toCrewStr = GameUnitConst::allType()[$toDexIdx];
$josaUl = JosaUtil::pick($cutDex, '을');
$josaRo = JosaUtil::pick($addDex, '로');
$log[] = "<C>●</>{$admin['month']}월:$fromCrewStr 숙련 {$cutDex}{$josaUl} $toCrewStr 숙련 {$addDex}{$josaRo} 전환했습니다. <1>$date</>";
$general['leader2'] += 2;
$db->update('general', [
'resturn'=>'SUCCESS',
'gold'=>$db->sqleval('gold-%i', $admin['develcost']),
'rice'=>$db->sqleval('rice-%i', $admin['develcost']),
'experience'=>$db->sqleval('experience+%i',$exp),
'leader2'=>$general['leader2'],
'dex'.($fromDexIdx*10)=>$fromNewDex,
'dex'.($toDexIdx*10)=>$toNewDex,
], 'no=%i', $general['no']);
}
pushGenLog($general, $log);
}
function process_99(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env');
+46 -5
View File
@@ -55,6 +55,8 @@ function process_23(&$general) {
$log[] = "<C>●</>{$admin['month']}월:수뇌부가 아닙니다. 포상 실패. <1>$date</>";
} elseif($city['nation'] != $general['nation']) {
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. 포상 실패. <1>$date</>";
} elseif($city['supply'] == 0) {
$log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. 포상 실패. <1>$date</>";
} elseif($what == 1 && $amount <= 0) {
$log[] = "<C>●</>{$admin['month']}월:국고가 부족합니다. 포상 실패. <1>$date</>";
} elseif($what == 2 && $amount <= 0) {
@@ -148,6 +150,8 @@ function process_24(&$general) {
$log[] = "<C>●</>{$admin['month']}월:수뇌부가 아닙니다. 몰수 실패. <1>$date</>";
} elseif($city['nation'] != $general['nation']) {
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. 몰수 실패. <1>$date</>";
} elseif($city['supply'] == 0) {
$log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. 몰수 실패. <1>$date</>";
} elseif($gen['nation'] != $general['nation']) {
$log[] = "<C>●</>{$admin['month']}월:아국 장수가 아닙니다. 몰수 실패. <1>$date</>";
} else {
@@ -253,6 +257,10 @@ function process_27(&$general) {
$log[] = "<C>●</>{$admin['month']}월:수뇌부가 아닙니다. <Y>{$you['name']}</> 발령 실패. <1>$date</>";
} elseif($city['nation'] != $general['nation']) {
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. <Y>{$you['name']}</> 발령 실패. <1>$date</>";
} elseif($destcity['supply'] == 0) {
$log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. <Y>{$you['name']}</> 발령 실패. <1>$date</>";
} elseif($city['supply'] == 0) {
$log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. <Y>{$you['name']}</> 발령 실패. <1>$date</>";
} elseif($destcity['nation'] != $general['nation']) {
$log[] = "<C>●</>{$admin['month']}월:아국 도시가 아닙니다. <Y>{$you['name']}</> 발령 실패. <1>$date</>";
} elseif($general['nation'] != $you['nation']) {
@@ -309,7 +317,12 @@ function process_51(&$general) {
pushGenLog($general, ["<C>●</>{$month}월:아국이 아닙니다. 권고 실패. <1>$date</>"]);
return;
}
if($supply === 0) {
pushGenLog($general, ["<C>●</>{$month}월:고립된 도시입니다. 권고 실패. <1>$date</>"]);
return;
}
// 상대에게 발송
$src = new MessageTarget(
$general['no'],
@@ -402,6 +415,8 @@ function process_52(&$general) {
$log[] = "<C>●</>{$admin['month']}월:상대국이 외교제한중입니다. 원조 실패. <1>$date</>";
} elseif($city['nation'] != $general['nation']) {
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. 원조 실패. <1>$date</>";
} elseif($city['supply'] == 0) {
$log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. 원조 실패. <1>$date</>";
} else {
// 본국 자원 감소
$query = "update nation set gold=gold-'$gold',rice=rice-'$rice',surlimit=surlimit+12 where nation='{$general['nation']}'";
@@ -487,6 +502,11 @@ function process_53(&$general) {
return;
}
if($supply === 0) {
pushGenLog($general, ["<C>●</>{$month}월:고립된 도시입니다. 제의 실패. <1>$date</>"]);
return;
}
// 상대에게 발송
$src = new MessageTarget(
$general['no'],
@@ -556,7 +576,12 @@ function process_61(&$general) {
pushGenLog($general, ["<C>●</>{$month}월:아국이 아닙니다. 제의 실패. <1>$date</>"]);
return;
}
if($supply === 0) {
pushGenLog($general, ["<C>●</>{$month}월:고립된 도시입니다. 제의 실패. <1>$date</>"]);
return;
}
// 상대에게 발송
$src = new MessageTarget(
$general['no'],
@@ -643,6 +668,8 @@ function process_62(&$general) {
$log[] = "<C>●</>{$admin['month']}월:수뇌부가 아닙니다. 선포 실패. <1>$date</>";
} elseif($city['nation'] != $general['nation']) {
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. 선포 실패. <1>$date</>";
} elseif($city['supply'] == 0) {
$log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. 선포 실패. <1>$date</>";
} elseif($dip['state'] == 0) {
$log[] = "<C>●</>{$admin['month']}월:아국과 이미 교전중입니다. 선포 실패. <1>$date</>";
} elseif($dip['state'] == 1) {
@@ -738,6 +765,11 @@ function process_63(&$general) {
return;
}
if($supply === 0) {
pushGenLog($general, ["<C>●</>{$month}월:고립된 도시입니다. 제의 실패. <1>$date</>"]);
return;
}
// 상대에게 발송
$src = new MessageTarget(
$general['no'],
@@ -805,6 +837,11 @@ function process_64(&$general) {
return;
}
if($supply === 0) {
pushGenLog($general, ["<C>●</>{$month}월:고립된 도시입니다. 제의 실패. <1>$date</>"]);
return;
}
// 상대에게 발송
$src = new MessageTarget(
$general['no'],
@@ -885,6 +922,8 @@ function process_65(&$general) {
$log[] = "<C>●</>{$admin['month']}월:수뇌부가 아닙니다. 초토화 실패. <1>$date</>";
} elseif($nation['capital'] == $destcity['city']) {
$log[] = "<C>●</>{$admin['month']}월:수도입니다. 초토화 실패. <1>$date</>";
} elseif($city['supply'] == 0) {
$log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. 초토화 실패. <1>$date</>";
} elseif($destcity['nation'] != $general['nation']) {
$log[] = "<C>●</>{$admin['month']}월:아국 영토가 아닙니다. 초토화 실패. <1>$date</>";
} elseif($citycount <= 4) {
@@ -972,6 +1011,8 @@ function process_66(&$general) {
$log[] = "<C>●</>{$admin['month']}월:아국이 아닙니다. 천도 실패. <1>$date</>";
} elseif($general['level'] < 5) {
$log[] = "<C>●</>{$admin['month']}월:수뇌부가 아닙니다. 천도 실패. <1>$date</>";
} elseif($city['supply'] == 0) {
$log[] = "<C>●</>{$admin['month']}월:고립된 도시입니다. 천도 실패. <1>$date</>";
} elseif($destcity['nation'] != $general['nation']) {
$log[] = "<C>●</>{$admin['month']}월:아국 영토가 아닙니다. 천도 실패. <1>$date</>";
} elseif($destcity['city'] == $nation['capital'] || !key_exists($destcity['city'], $nearCities)){
@@ -1853,7 +1894,7 @@ function process_76(&$general) {
$date = substr($general['turntime'],11,5);
$admin = $gameStor->getValues(['startyear','year','month','develcost','npccount','turnterm']);
$admin = $gameStor->getValues(['startyear','year','month','develcost','npccount','turnterm','turntime']);
$query = "select nation,supply from city where city='{$general['city']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
@@ -2029,7 +2070,7 @@ function process_76(&$general) {
$affinity = rand() % 150 + 1;
$name = "ⓖ의병장{$npcid}";
$picture = 'default.jpg';
$turntime = getRandTurn($admin['turnterm']);
$turntime = getRandTurn($admin['turnterm'], new \DateTimeImmutable($admin['turntime']));
$personal = rand() % 10;
$bornyear = $admin['year'];
$deadyear = $admin['year'] + 3;
@@ -2047,7 +2088,7 @@ function process_76(&$general) {
'$npccount','$npc','$npc','$affinity','$name','$picture','{$nation['nation']}',
'{$general['city']}','$leader','$power','$intel','{$avgGen['exp']}','{$avgGen['ded']}',
'1','100','100','0','".GameUnitConst::DEFAULT_CREWTYPE."','0','0','0',
'0','0','0','$turntime','$killturn','{$avgGen['age']}','1','$personal','20','0','70','0','',
'0','0','0','$turntime','$killturn','{$avgGen['age']}','1','$personal','0','0','0','0','',
'0','$bornyear','$deadyear',
'{$dexVal[0]}','{$dexVal[1]}','{$dexVal[2]}','{$dexVal[3]}','{$avgGen['dex40']}'
)",
+19 -15
View File
@@ -80,10 +80,11 @@ function process_25(&$general) {
$city = MYDB_fetch_array($result);
$command = DecodeCommand($general['turn0']);
$type = $command[2];
$where = $command[1];
if($admin['join_mode'] == 'onlyRandom' && $where < 98){
$where = 99;
if($admin['join_mode'] == 'onlyRandom' && $type < 98){
$type = 99;
}
$nation = null;
@@ -91,7 +92,7 @@ function process_25(&$general) {
$joinedNations = Json::decode($general['nations']);
// 랜덤임관인 경우
if($general['npc'] >= 2 && $where >= 98 && !$admin['fiction'] && 1000 <= $admin['scenario'] && $admin['scenario'] < 2000){
if($general['npc'] >= 2 && $type >= 98 && !$admin['fiction'] && 1000 <= $admin['scenario'] && $admin['scenario'] < 2000){
//'사실' 모드에서는 '성향'에 우선을 두되, 장수수, 랜덤에 비중을 둠
$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',
@@ -124,7 +125,7 @@ function process_25(&$general) {
}
}
else if($where >= 98) {
else if($type >= 98) {
//랜임
$generals = [];
foreach($db->queryAllLists('SELECT count(no), nation FROM general WHERE npc <= 2 AND nation > 0 GROUP BY nation') as list($cnt, $nation)){
@@ -161,7 +162,7 @@ function process_25(&$general) {
$randVals = [];
foreach($nations as $idx=>$testNation){
// 임관금지없음 국가, 방랑군 제외
if($where == 98 && $testNation['level'] == 0){
if($type == 98 && $testNation['level'] == 0){
continue;
}
@@ -181,7 +182,10 @@ function process_25(&$general) {
$nation = null;
}
} else {
} else if($type == 0) {
$nation = $db->queryFirstRow('SELECT `name`,nation,scout,`level` FROM nation WHERE nation=%i', $where);
} else if($type == 1){
$where = $db->queryFirstField('SELECT nation FROM general WHERE no=%i', $where)??0;
$nation = $db->queryFirstRow('SELECT `name`,nation,scout,`level` FROM nation WHERE nation=%i', $where);
}
@@ -192,10 +196,10 @@ function process_25(&$general) {
if(!$nation) {
$log[] = "<C>●</>{$admin['month']}월:임관할 국가가 없습니다. 임관 실패. <1>$date</>";
if($where >= 98 && $genLimit == GameConst::$initialNationGenLimitForRandInit){
if($type >= 98 && $genLimit == GameConst::$initialNationGenLimitForRandInit){
//랜덤 모드, 초기화시에는 랜덤 임관을 대신 한턴 더 넣어준다.
$db->update('general', [
'turn1'=>EncodeCommand(0, 0, $where, 25),
'turn1'=>EncodeCommand(0, 0, $type, 25),
], '`no` = %i', $general['no']);
pushGenLog($general, $log);
process_42($general);
@@ -217,7 +221,7 @@ function process_25(&$general) {
$log[] = "<C>●</>{$admin['month']}월:이미 임관했었던 국가입니다. 임관 실패. <1>$date</>";
} else {
$josaYi = JosaUtil::pick($general['name'], '이');
if($where == 99 || $where == 98) {
if($type == 99 || $type == 98) {
$alllog[] = "<C>●</>{$admin['month']}월:<Y>{$general['name']}</>{$josaYi} 어쩌다보니 <D><b>{$nation['name']}</b></>에 <S>임관</>했습니다.";
$log[] = "<C>●</>{$admin['month']}월:<D>{$nation['name']}</>에 랜덤으로 임관했습니다. <1>$date</>";
pushGeneralHistory($general, "<C>●</>{$admin['year']}{$admin['month']}월:<D><b>{$nation['name']}</b></>에 임관");
@@ -269,7 +273,7 @@ function process_25(&$general) {
$query = "update nation set totaltech=tech*'$gencount',gennum='$gennum' where nation='{$nation['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
if($where < 99) {
if($type < 99) {
$log = uniqueItem($general, $log);
} else {
$log = uniqueItem($general, $log, 2);
@@ -290,7 +294,7 @@ function process_29(&$general) {
$history = [];
$date = substr($general['turntime'],11,5);
$admin = $gameStor->getValues(['startyear','year','month','develcost','npccount','turnterm','scenario','maxgeneral']);
$admin = $gameStor->getValues(['startyear','year','month','develcost','npccount','turnterm','scenario','maxgeneral', 'turntime']);
$query = "select nation,name,level,gennum,scout from nation where nation='{$general['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
@@ -490,13 +494,13 @@ function process_29(&$general) {
$npccount = 10000 + $npcid;
$affinity = rand() % 150 + 1;
$picture = 'default.jpg';
$turntime = getRandTurn($admin['turnterm']);
$turntime = getRandTurn($admin['turnterm'], new \DateTimeImmutable($admin['turntime']));
$personal = rand() % 10;
$bornyear = $admin['year'];
$deadyear = $admin['year'] + 3;
$age = 20;
$specage = $age;
$specage2 = $age;
$specage = Util::round((GameConst::$retirementYear - $age)/12) + $age;
$specage2 = Util::round((GameConst::$retirementYear - $age)/3) + $age;
//$specage = $age + 1 + rand() % 3;
//$specage2 = $age + 5 + rand() % 5;
// 20년 ~ 50년
@@ -514,7 +518,7 @@ function process_29(&$general) {
'$npccount','$npc','$npc','$affinity','$name','$picture','$scoutNation',
'{$general['city']}','$leader','$power','$intel','{$avgGen['exp']}','{$avgGen['ded']}',
'$scoutLevel','100','100','0','".GameUnitConst::DEFAULT_CREWTYPE."','0','0','0',
'0','0','0','$turntime','$killturn','$age','1','$personal','20','$specage','70','$specage2','',
'0','0','0','$turntime','$killturn','$age','1','$personal','0','$specage','0','$specage2','',
'0','$bornyear','$deadyear',
'{$dexVal[0]}','{$dexVal[1]}','{$dexVal[2]}','{$dexVal[3]}','{$avgGen['dex40']}'
)",
+1 -1
View File
@@ -47,7 +47,7 @@ function turnTable() {
function CoreTurnTable() {
return "
<select name=turn[] size=3 multiple style=color:white;background-color:black;font-size:13px;>
<select name=turn[] size=6 multiple style=color:white;background-color:black;font-size:13px;>
<option selected value=0> 1턴</option>
<option value=1> 2턴</option>
<option value=2> 3턴</option>
+18 -14
View File
@@ -160,16 +160,11 @@ function popIncrease() {
$wall = $city['wall'];
} else {
$ratio = (20 - $rate[$city['nation']])/200; // 20일때 0% 0일때 10% 100일때 -40%
$agri = $city['agri']; //내정도 증감
$comm = $city['comm'];
$secu = $city['secu'];
$def = $city['def'] ;
$wall = $city['wall'];
if($ratio < 0 || $city['agri'] < $city['agri2']) $agri += intval($city['agri'] * $ratio); //내정도 증감
if($ratio < 0 || $city['comm'] < $city['comm2']) $comm += intval($city['comm'] * $ratio);
if($ratio < 0 || $city['secu'] < $city['secu2']) $secu += intval($city['secu'] * $ratio);
if($ratio < 0 || $city['def'] < $city['def2'] ) $def += intval($city['def'] * $ratio);
if($ratio < 0 || $city['wall'] < $city['wall2']) $wall += intval($city['wall'] * $ratio);
$agri = $city['agri'] + intval($city['agri'] * $ratio); //내정도 증감
$comm = $city['comm'] + intval($city['comm'] * $ratio);
$secu = $city['secu'] + intval($city['secu'] * $ratio);
$def = $city['def'] + intval($city['def'] * $ratio);
$wall = $city['wall'] + intval($city['wall'] * $ratio);
$ratio = (30 - $rate[$city['nation']])/200; // 20일때 5% 5일때 12.5% 50일때 -10%
if($ratio >= 0) {
// 국가보정
@@ -183,10 +178,7 @@ function popIncrease() {
$ratio *= (1 - $city['secu']/$city['secu2']/10); //치안에 따라 최대 10% 경감
}
if($ratio < 0 || $city['pop'] < $city['pop2']){
$pop = $city['pop'] + (int)($city['pop'] * $ratio) + 5000; // 기본 5000명은 증가
}
$pop = $city['pop'] + (int)($city['pop'] * $ratio) + 5000; // 기본 5000명은 증가
$ratio = round($ratio*100, 2);
$cityrate = $city['rate'];
@@ -194,7 +186,13 @@ function popIncrease() {
if($cityrate > 100) { $cityrate = 100; }
if($cityrate < 0) { $cityrate = 0; }
}
if($pop > $city['pop2']) { $pop = $city['pop2']; }
if($pop < 0) { $pop = 0; }
if($agri > $city['agri2']) { $agri = $city['agri2']; }
if($comm > $city['comm2']) { $comm = $city['comm2']; }
if($secu > $city['secu2']) { $secu = $city['secu2']; }
if($def > $city['def2']) { $def= $city['def2']; }
if($wall > $city['wall2']) { $wall = $city['wall2']; }
//시세
$query = "update city set pop='$pop',rate='$cityrate',agri='$agri',comm='$comm',secu='$secu',def='$def',wall='$wall' where city='{$city['city']}'";
@@ -723,7 +721,13 @@ function disaster() {
$city['comm'] *= $ratio; $city['secu'] *= $ratio; $city['def'] *= $ratio;
$city['wall'] *= $ratio;
if($city['pop'] > $city['pop2']) { $city['pop'] = $city['pop2']; }
if($city['rate'] > 100) { $city['rate'] = 100; }
if($city['agri'] > $city['agri2']) { $city['agri'] = $city['agri2']; }
if($city['comm'] > $city['comm2']) { $city['comm'] = $city['comm2']; }
if($city['secu'] > $city['secu2']) { $city['secu'] = $city['secu2']; }
if($city['def'] > $city['def2']) { $city['def'] = $city['def2']; }
if($city['wall'] > $city['wall2']) { $city['wall'] = $city['wall2']; }
$query = "update city set state='$state',pop='{$city['pop']}',rate='{$city['rate']}',agri='{$city['agri']}',comm='{$city['comm']}',secu='{$city['secu']}',def='{$city['def']}',wall='{$city['wall']}' where city='$disastercity[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
+12 -8
View File
@@ -44,7 +44,7 @@ if ($me['newmsg'] == 1 || $me['newvote'] == 1) {
], 'owner=%i', $userID);
}
$admin = $gameStor->getValues(['develcost','online','conlimit','tournament','tnmt_type','turnterm','scenario','scenario_text','extended_general','fiction','npcmode','vote','vote_title','map_theme']);
$admin = $gameStor->getValues(['develcost','online','conlimit','tournament','tnmt_type','turnterm','turntime','scenario','scenario_text','extended_general','fiction','npcmode','vote','vote_title','map_theme']);
$plock = $db->queryFirstField('SELECT plock FROM plock LIMIT 1');
@@ -77,11 +77,13 @@ if ($admin['npcmode'] == 0) {
}
$color = "cyan";
$mapTheme = $admin['map_theme'];
$serverName = UniqueConst::$serverName;
$serverCnt = $db->queryFirstField('SELECT count(*) FROM ng_games');
?>
<!DOCTYPE html>
<html>
<head>
<title><?=UniqueConst::$serverName?>: 메인</title>
<title><?=$serverName?>: 메인</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
@@ -109,6 +111,8 @@ $(function(){
setInterval(function(){
refreshMsg();
}, 5000);
reloadCommandList();
});
</script>
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
@@ -127,7 +131,7 @@ $(function(){
<div><?=allButton()?></div>
<table class="tb_layout bg0" style="width:1000px;">
<tr height=50>
<td colspan=5 align=center><font size=4>삼국지 모의전투 HiDCHe (<font color=cyan><?=$scenario?></font>)</font></td>
<td colspan=5 id="server_title" align=center><font size=4>삼국지 모의전투 HiDCHe <?=$serverName.$serverCnt?>기 (<font color=cyan><?=$scenario?></font>)</font></td>
</tr>
<?php if ($valid == 1): ?>
<tr height=30>
@@ -145,12 +149,12 @@ $(function(){
<td width=398 colspan=2><?=info(3)?></td>
</tr>
<tr height=30>
<td>
<td style='text-align:center;'>
<?php
if (!$plock) {
echo "<marquee scrollamount=2><font color=cyan>서버 가동중</font></marquee>";
echo "<span style='color:cyan;'>동작 시각: ".substr($admin['turntime'], 5)."</span>";
} else {
echo "<font color=magenta>서버 동결중</font>";
echo "<span style='color:magenta;'>동작 시각: ".substr($admin['turntime'], 5)."</span>";
}
echo "
@@ -239,9 +243,9 @@ else if($session->userGrade == 4){
<td style='width:700px;height:520px;' colspan=2>
<?=getMapHtml($mapTheme)?>
</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>
<form name=form2 action=preprocessing.php method=post target=commandlist>
<form id='form2' name=form2>
<tr>
<td rowspan=3 width=50 valign=top><?=turnTable()?></td>
<td style="width:650px;border:none;text-align:center;"><?php cityInfo(); ?></td>
+102
View File
@@ -152,6 +152,101 @@ if($session->userGrade < 5 && !$allowReset){
</div>
</div>
<div class="form-group row">
<label class="col-sm-3 col-form-label">휴식 턴 시 장수 턴</label>
<div class="col-sm-9">
<div class="input-group">
<div class="input-group-prepend btn-group btn-group-toggle" data-toggle="buttons">
<label class="btn btn-secondary">
<input type="checkbox" class="autorun_user_chk" data-key="develop" name="autorun_develop" id="autorun_develop">내정
</label>
<label class="btn btn-secondary">
<input type="checkbox" class="autorun_user_chk" data-key="warp" name="autorun_warp" id="autorun_warp">순간이동
</label>
<label class="btn btn-secondary">
<input type="checkbox" class="autorun_user_chk" data-key="recruit" name="autorun_recruit" id="autorun_recruit">징병
</label>
<label class="btn btn-secondary">
<input type="checkbox" class="autorun_user_chk" data-key="recruit_high" name="autorun_recruit_high" id="autorun_recruit_high">모병
</label>
<label class="btn btn-secondary">
<input type="checkbox" class="autorun_user_chk" data-key="train" name="autorun_train" id="autorun_train">훈사
</label>
<label class="btn btn-secondary">
<input type="checkbox" class="autorun_user_chk" data-key="battle" name="autorun_battle" id="autorun_battle">출병
</label>
</div>
<div class="input-group-append">
<span class="input-group-text">유효 시간</span>
</div>
<select class="custom-select" name="autorun_user_minutes" id="autorun_user_minutes">
<option value="0" selected>꺼짐</option>
<option value="43200">항상</option>
<option value="10">10분</option>
<option value="20">20분</option>
<option value="30">30분</option>
<option value="60">1시간</option>
<option value="120">2시간</option>
<option value="180">3시간</option>
<option value="240">4시간</option>
<option value="360">6시간</option>
<option value="480">8시간</option>
<option value="600">10시간</option>
<option value="720">12시간</option>
<option value="1440">24시간</option>
<option value="2160">36시간</option>
<option value="2880">48시간</option>
<option value="3600">60시간</option>
<option value="4320">72시간</option>
</select>
</div>
</div>
</div>
<!--
<div class="form-group row">
<label class="col-sm-3 col-form-label">휴식 턴 시 사령 턴</label>
<div class="col-sm-9">
<div class="input-group">
<div class="input-group-prepend btn-group btn-group-toggle" data-toggle="buttons">
<label class="btn btn-secondary">
<input type="radio" name="autorun_chief_reward" id="autorun_chief_reward">포상/몰수
</label>
<label class="btn btn-secondary">
<input type="radio" name="autorun_chief_warp" id="autorun_chief_warp">발령
</label>
<label class="btn btn-secondary">
<input type="radio" name="autorun_chief_declaration" id="autorun_chief_declaration">선포
</label>
</div>
<div class="input-group-append">
<span class="input-group-text">유효 시간</span>
</div>
<select class="custom-select" name="autorun_chief_minutes" id="autorun_chief_minutes">
<option value="0" selected>꺼짐</option>
<option value="43200">항상</option>
<option value="10">10분</option>
<option value="20">20분</option>
<option value="30">30분</option>
<option value="60">1시간</option>
<option value="120">2시간</option>
<option value="180">3시간</option>
<option value="240">4시간</option>
<option value="360">6시간</option>
<option value="480">8시간</option>
<option value="600">10시간</option>
<option value="720">12시간</option>
<option value="1440">24시간</option>
<option value="2160">36시간</option>
<option value="2880">48시간</option>
<option value="3600">60시간</option>
<option value="4320">72시간</option>
</select>
</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">
@@ -225,6 +320,13 @@ if($session->userGrade < 5 && !$allowReset){
</div>
</div>
<div class="form-group row">
<label for="pre_reserve_open" class="col-sm-3 col-form-label">가오픈 예약</label>
<div class="col-sm-9">
<input type="text" class="form-control" name="pre_reserve_open" id="pre_reserve_open" placeholder="YYYY-MM-DD hh:mm" value="" />
</div>
</div>
<div class="form-group row">
<div class="col-sm-3"></div>
<div class="col-sm-9">
+3 -1
View File
@@ -88,7 +88,9 @@ $result = ResetHelper::buildScenario(
$options['npcmode'],
$options['show_img_level'],
$options['tournament_trig'],
$options['join_mode']
$options['join_mode'],
$options['starttime'],
$options['autorun_user']?:null
);
$result['affected']=1;
+1 -1
View File
@@ -32,7 +32,7 @@ $nationID = $me['nation'];
if($isAmbassador){
$targetType = 'ambassador';
$targetLevel = 4;
if(count($genlist) > 2){
if($genlist && count($genlist) > 2){
Json::die([
'result'=>false,
'reason'=>'외교권자는 최대 둘까지만 설정 가능합니다.'
+72 -16
View File
@@ -27,6 +27,20 @@ if($reserve_open && $reserve_open < date('Y-m-d H:i')){
]);
}
$pre_reserve_open = Util::getReq('pre_reserve_open');
if($pre_reserve_open && !$reserve_open){
Json::die([
'result'=>false,
'reason'=>'가오픈 예약을 위해선 오픈 예약을 지정해야합니다.'
]);
}
if($pre_reserve_open && $pre_reserve_open >= $reserve_open){
Json::die([
'result'=>false,
'reason'=>'가오픈 시간이 오픈 예약 시점보다 이전이어야 합니다.'
]);
}
if($session->userGrade < 5 && !$allowReset){
Json::die([
'result'=>false,
@@ -43,7 +57,8 @@ $v->rule('required', [
'extend',
'join_mode',
'npcmode',
'show_img_level'
'show_img_level',
'autorun_user_minutes'
])->rule('integer', [
'turnterm',
'sync',
@@ -53,6 +68,7 @@ $v->rule('required', [
'npcmode',
'show_img_level',
'tournament_trig',
'autorun_user_minutes'
])->rule('in', 'join_mode', ['onlyRandom', 'full']);
if(!$v->validate()){
Json::die([
@@ -94,6 +110,30 @@ $npcmode = (int)$_POST['npcmode'];
$show_img_level = (int)$_POST['show_img_level'];
$tournament_trig = (int)$_POST['tournament_trig'];
$join_mode = $_POST['join_mode'];
$autorun_user_minutes = (int)$_POST['autorun_user_minutes'];
$autorun_user_options = [];
foreach(Util::getReq('autorun_user', 'array_string', []) as $autorun_option){
$autorun_user_options[$autorun_option] = 1;
}
if($autorun_user_minutes > 0 && !$autorun_user_options){
Json::die([
'result'=>false,
'reason'=>'적어도 자동 행동 중 하나는 선택을 해야합니다.'
]);
}
if($autorun_user_minutes < 0){
Json::die([
'result'=>false,
'reason'=>'자동 행동 기한이 0보다 작을 수 없습니다.'
]);
}
$autorun_user = $autorun_user_minutes?[
'limit_minutes'=>$autorun_user_minutes,
'options'=>$autorun_user_options
]:null;
if($reserve_open){
$reserve_open = new \DateTime($reserve_open);
@@ -114,22 +154,36 @@ if($reserve_open){
}
$scenarioObj = new Scenario($scenario, true);
$open_date = $reserve_open->format('Y-m-d H:i:s');
$reserveInfo = [
'turnterm'=>$turnterm,
'sync'=>$sync,
'scenario'=>$scenario,
'scenarioName'=>$scenarioObj->getTitle(),
'fiction'=>$fiction,
'extend'=>$extend,
'npcmode'=>$npcmode,
'show_img_level'=>$show_img_level,
'tournament_trig'=>$tournament_trig,
'gameConf'=>$scenarioObj->getGameConf(),
'join_mode'=>$join_mode,
'starttime'=>$open_date,
'autorun_user'=>$autorun_user
];
if($pre_reserve_open){
$pre_reserve_open = new \DateTime($pre_reserve_open);
$open_date = $pre_reserve_open->format('Y-m-d H:i:s');
}
$db->delete('reserved_open', true);
$db->insert('reserved_open', [
'options'=>Json::encode([
'turnterm'=>$turnterm,
'sync'=>$sync,
'scenario'=>$scenario,
'scenarioName'=>$scenarioObj->getTitle(),
'fiction'=>$fiction,
'extend'=>$extend,
'npcmode'=>$npcmode,
'show_img_level'=>$show_img_level,
'tournament_trig'=>$tournament_trig,
'gameConf'=>$scenarioObj->getGameConf(),
'join_mode'=>$join_mode,
]),
'date'=>$reserve_open->format('Y-m-d H:i:s')
'options'=>Json::encode($reserveInfo),
'date'=>$open_date
]);
AppConf::getList()[DB::prefix()]->closeServer();
Json::die([
@@ -147,5 +201,7 @@ Json::die(ResetHelper::buildScenario(
$npcmode,
$show_img_level,
$tournament_trig,
$join_mode
$join_mode,
TimeUtil::DatetimeNow(),
$autorun_user
));
@@ -4,7 +4,7 @@ namespace sammo;
include "lib.php";
include "func.php";
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$session = Session::requireGameLogin([])->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
@@ -17,8 +17,10 @@ $commandtype = Util::getReq('commandtype', 'int');
increaseRefresh("턴입력", 1);
if(!$turn || $commandtype === null || $sel === null){
header('location:commandlist.php', true, 303);
die();
Json::die([
'result'=>true,
'reason'=>'empty command'
]);
}
$count = count($turn);
@@ -98,6 +100,7 @@ switch($commandtype) {
case 55: command_Single($turn, 55); break; //거병
case 56: command_Single($turn, 56); break; //해산
case 57: command_Single($turn, 57); break; //모반 시도
// case 58: command_Single($turn, 58); break; //숙련 전환
// case 61: command_61($turn, 61); break; //불가침
// case 62: command_62($turn, 62); break; //선포
+18 -7
View File
@@ -22,6 +22,13 @@ $rootDB = RootDB::db();
$oNow = new \DateTimeImmutable();
$now = $oNow->format('Y-m-d H:i:s');
list(
$year,
$month,
$maxgeneral,
$npcmode
) = $gameStor->getValuesAsArray(['year', 'month', 'maxgeneral', 'npcmode']);
$userNick = RootDB::db()->queryFirstField('SELECT `NAME` FROM member WHERE `NO`=%i',$userID);
if(!$userNick){
Json::die([
@@ -30,6 +37,8 @@ if(!$userNick){
]);
}
$db->query("lock tables general write, select_npc_token write");
$pickResult = $db->queryFirstField('SELECT pick_result FROM select_npc_token WHERE `owner`=%i AND `valid_until`>=%s', $userID, $now);
if(!$pickResult){
Json::die([
@@ -38,7 +47,6 @@ if(!$pickResult){
]);
}
$pickResult = Json::decode($pickResult);
if(!key_exists($pick, $pickResult)){
Json::die([
@@ -50,14 +58,9 @@ $pickedNPC = $pickResult[$pick];
$gencount = $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc<2');
list(
$year,
$month,
$maxgeneral,
$npcmode
) = $gameStor->getValuesAsArray(['year', 'month', 'maxgeneral', 'npcmode']);
if(!$npcmode){
$db->query("unlock tables");
Json::die([
'result'=>false,
'reason'=>'빙의 가능한 서버가 아닙니다'
@@ -65,12 +68,15 @@ if(!$npcmode){
}
if ($gencount >= $maxgeneral) {
$db->query("unlock tables");
Json::die([
'result'=>false,
'reason'=>'더 이상 등록 할 수 없습니다.'
]);
}
//등록 시작
$db->update('general', [
'name2'=>$userNick,
@@ -81,7 +87,10 @@ $db->update('general', [
'owner'=>$userID,
], 'owner <= 0 AND npc = 2 AND no = %i', $pick);
if(!$db->affectedRows()){
$db->query("unlock tables");
Json::die([
'result'=>false,
'reason'=>'장수 등록에 실패했습니다.'
@@ -90,6 +99,8 @@ if(!$db->affectedRows()){
$db->delete('select_npc_token', 'owner=%i or valid_until < %s', $userID, $now);
$db->query("unlock tables");
$josaYi = JosaUtil::pick($userNick, '이');
pushGeneralHistory($pickedNPC, "<C>●</>{$year}{$month}월:<Y>{$pickedNPC['name']}</>의 육체에 <Y>{$userNick}</>{$josaYi} 빙의되다.");
//pushGenLog($me, $mylog);
+68 -2
View File
@@ -16,6 +16,8 @@ if(!class_exists('\\sammo\\DB')){
]);
}
$templates = new \League\Plates\Engine(__dir__.'/templates');
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env');
@@ -38,6 +40,27 @@ if(file_exists(__dir__.'/.htaccess')){
$otherTextInfo[] = '랜덤 임관 전용';
}
if($options['autorun_user']['limit_minutes']??false){
$auto_info = [];
foreach($options['autorun_user']['options'] as $auto_option => $value){
assert($value);
switch($auto_option){
case 'develop': $auto_info['내정'] = '내정'; break;
case 'warp': $auto_info['순간이동'] = '순간이동'; break;
case 'recruit': $auto_info['징병'] = $auto_info['징병']??'징병'; break;
case 'recruit_high': $auto_info['징병'] = '모병'; break;
case 'train': $auto_info['훈사'] = '훈련/사기진작'; break;
case 'battle': $auto_info['출병'] = '출병'; break;
}
}
$auto_info = join(', ', array_values($auto_info));
$otherTextInfo[] = $templates->render('tooltip', [
'text'=>'자율행동',
'info'=>$auto_info,
'style'=>'text-decoration:underline'
]);
}
if(!$otherTextInfo){
$otherTextInfo = '표준';
}
@@ -53,6 +76,7 @@ if(file_exists(__dir__.'/.htaccess')){
'fictionMode'=>($options['fiction']?'가상':'사실'),
'npcMode'=>($options['npcmode']?'가능':'불가'),
'openDatetime'=>$reserved['date'],
'starttime'=>$options['starttime'],
'gameConf'=>$options['gameConf'],
'otherTextInfo'=>$otherTextInfo
],
@@ -63,12 +87,12 @@ if(file_exists(__dir__.'/.htaccess')){
//TODO: 천통시에도 예약 오픈 알림이 필요..?
$admin = $gameStor->getValues(['isunited', 'npcmode', 'year', 'month', 'scenario', 'scenario_text', 'maxgeneral', 'turnterm', 'starttime', 'turntime']);
$admin = $gameStor->getValues(['isunited', 'npcmode', 'year', 'month', 'scenario', 'scenario_text', 'maxgeneral', 'turnterm', 'opentime', 'turntime', 'join_mode', 'fiction', 'autorun_user']);
$admin['maxUserCnt'] = $admin['maxgeneral'];
$admin['npcMode'] = $admin['npcmode'];
$admin['turnTerm'] = $admin['turnterm'];
$admin['isUnited'] = $admin['isunited'];
$admin['starttime'] = substr($admin['starttime'], 5, 11);
$admin['starttime'] = substr($admin['opentime'], 5, 11);
$admin['turntime'] = substr($admin['turntime'], 5, 11);
unset($admin['npcmode']);
unset($admin['maxgeneral']);
@@ -84,6 +108,48 @@ $admin['userCnt'] = $genCnt;
$admin['npcCnt'] = $npcCnt;
$admin['nationCnt'] = $nationCnt;
$admin['npcMode'] = $admin['npcMode']?'가능':'불가';
$admin['fictionMode'] = $admin['fiction']?'가상':'사실';
$otherTextInfo = [];
if($admin['join_mode'] == 'onlyRandom'){
$otherTextInfo[] = '랜덤 임관 전용';
}
if($admin['autorun_user']['limit_minutes']??false){
$auto_info = [];
foreach($admin['autorun_user']['options'] as $auto_option => $value){
assert($value);
switch($auto_option){
case 'develop': $auto_info['내정'] = '내정'; break;
case 'warp': $auto_info['순간이동'] = '순간이동'; break;
case 'recruit': $auto_info['징병'] = $auto_info['징병']??'징병'; break;
case 'recruit_high': $auto_info['징병'] = '모병'; break;
case 'train': $auto_info['훈사'] = '훈련/사기진작'; break;
case 'battle': $auto_info['출병'] = '출병'; break;
}
}
$auto_info = join(', ', array_values($auto_info));
$otherTextInfo[] = $templates->render('tooltip', [
'text'=>'자율행동',
'info'=>$auto_info,
'style'=>'text-decoration:underline'
]);
}
if(!$otherTextInfo){
$otherTextInfo = '표준';
}
else{
$otherTextInfo = join(', ', $otherTextInfo);
}
$admin['otherTextInfo'] = $otherTextInfo;
$admin['defaultStatTotal'] = GameConst::$defaultStatTotal;
$me = [];
$general = $db->queryFirstRow('SELECT name, picture, imgsvr from general where owner=%i', $userID);
+3 -3
View File
@@ -111,9 +111,9 @@ $generalCheck = [
'between'=>[
['train', [40, GameConst::$maxTrainByWar]],
['atmos', [40, GameConst::$maxAtmosByWar]],
['book', [0, 6]],
['weap', [0, 6]],
['horse', [0, 40]],
['book', [0, 26]],
['weap', [0, 26]],
['horse', [0, 26]],
['item', [0, 26]],
['explevel', [0, 300]],
['injury', [0, 80]],
+165
View File
@@ -0,0 +1,165 @@
<?php
namespace sammo;
include "lib.php";
include "func.php";
// $btn, $name, $troop
$action = Util::getReq('action');
$name = Util::getReq('name');
$gen = Util::getReq('gen', 'int');
$troop = Util::getReq('troop', 'int');
//로그인 검사
$session = Session::requireGameLogin([])->setReadOnly();
$userID = $session::getUserID();
$db = DB::db();
$me = $db->queryFirstRow('SELECT `no`, name, nation, troop FROM general WHERE `owner`=%i', $userID);
if($action == '부대창설'){
$name = trim($name);
if(!$name){
Json::die([
'result'=>false,
'reason'=>'부대 이름이 없습니다.'
]);
}
if($me['troop'] != 0){
Json::die([
'result'=>false,
'reason'=>'이미 부대에 가입해있습니다.'
]);
}
$db->insert('troop',[
'name'=>$name,
'nation'=>$me['nation'],
'no'=>$me['no']
]);
$troopID = $db->insertId();
$db->update('general', [
'troop'=>$troopID
], 'no=%i',$me['no']);
Json::die([
'result'=>true,
'reason'=>'success'
]);
}
if($action == '부대변경'){
$name = trim($name);
if(!$name){
Json::die([
'result'=>false,
'reason'=>'부대 이름이 없습니다.'
]);
}
$db->update('troop', [
'name'=>$name
], 'no=%i',$me['no']);
if($db->affectedRows() == 0){
Json::die([
'result'=>false,
'reason'=>'부대장이 아닙니다.'
]);
}
Json::die([
'result'=>true,
'reason'=>'success'
]);
}
if($action == '부대추방'){
if (!$gen){
Json::die([
'result'=>false,
'reason'=>'장수를 지정해야 합니다.'
]);
}
$db->update('general', [
'troop'=>0
], 'no=%i AND troop=(SELECT troop FROM troop WHERE no = %i)', $gen, $me['no']);
if($db->affectedRows() == 0){
Json::die([
'result'=>false,
'reason'=>'부대장이 아니거나, 장수를 잘못 지정했습니다.'
]);
}
Json::die([
'result'=>true,
'reason'=>'success'
]);
}
if ($action == '부대가입') {
if(!$troop){
Json::die([
'result'=>false,
'reason'=>'부대를 지정해야 합니다.'
]);
}
$troopLeader = $db->queryFirstField('SELECT `no` FROM troop WHERE troop=%i', $troop)?:0;
$troopLeaderNation = $db->queryFirstField('SELECT `nation` FROM `general` WHERE `no`=%i AND `nation`=%i', $troopLeader, $me['nation']);
if (!$troopLeaderNation) {
Json::die([
'result'=>false,
'reason'=>'올바른 부대장이 아닙니다.'
]);
}
$db->update('general', [
'troop'=>$troop
], 'no=%i', $me['no']);
Json::die([
'result'=>true,
'reason'=>'success'
]);
}
if($action == "부대탈퇴") {
if($me['troop'] == 0){
Json::die([
'result'=>false,
'reason'=>'부대에 속해있지 않습니다.'
]);
}
$troopLeader = $db->queryFirstField('SELECT `no` FROM troop WHERE troop=%i', $me['troop']);
//부대장일 경우
if($troopLeader == $me['no']) {
// 모두 탈퇴
$db->update('general', [
'troop'=>0
], 'troop=%i',$me['troop']);
// 부대 삭제
$db->delete('troop', 'troop=%i', $me['troop']);
} else {
$db->update('general', [
'troop'=>0
], 'no=%i', $me['no']);
}
Json::die([
'result'=>true,
'reason'=>'success'
]);
}
Json::die([
'result'=>false,
'reason'=>'올바르지 않은 명령입니다.'
]);
+63 -1
View File
@@ -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'
]);
+38 -14
View File
@@ -68,9 +68,11 @@ if (!$member) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env');
$gameStor->cacheValues(['year','month','maxgeneral','scenario','show_img_level','turnterm','genius','npcmode']);
$gameStor->cacheValues(['year','month','maxgeneral','scenario','show_img_level','turnterm','turntime','genius','npcmode']);
########## 동일 정보 존재여부 확인. ##########
$db->query("lock tables general write, city read, storage read");
$gencount = $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc<2');
$oldGeneral = $db->queryFirstField('SELECT `no` FROM general WHERE `owner`=%i', $userID);
$oldName = $db->queryFirstField('SELECT `no` FROM general WHERE `name`=%s', $name);
@@ -80,6 +82,7 @@ if ($oldGeneral) {
window.alert('이미 등록하셨습니다!')
history.go(-1)
</script>");
$db->query("unlock tables");
exit;
}
if ($oldName) {
@@ -87,6 +90,7 @@ if ($oldName) {
window.alert('이미 있는 장수입니다. 다른 이름으로 등록해 주세요!')
history.go(-1)
</script>");
$db->query("unlock tables");
exit;
}
if ($gameStor->maxgeneral <= $gencount) {
@@ -94,6 +98,7 @@ if ($gameStor->maxgeneral <= $gencount) {
window.alert('더이상 등록할 수 없습니다!')
history.go(-1)
</script>");
$db->query("unlock tables");
exit;
}
if (mb_strlen($name) < 1) {
@@ -101,6 +106,7 @@ if (mb_strlen($name) < 1) {
window.alert('이름이 짧습니다. 다시 가입해주세요!')
history.go(-1)
</script>");
$db->query("unlock tables");
exit;
}
if (mb_strlen($name) > 9) {
@@ -108,6 +114,7 @@ if (mb_strlen($name) > 9) {
window.alert('이름이 유효하지 않습니다. 다시 가입해주세요!')
history.go(-1)
</script>");
$db->query("unlock tables");
exit;
}
if ($leader + $power + $intel > GameConst::$defaultStatTotal) {
@@ -115,6 +122,7 @@ if ($leader + $power + $intel > GameConst::$defaultStatTotal) {
window.alert('능력치가 ".GameConst::$defaultStatTotal."을 넘어섰습니다. 다시 가입해주세요!')
history.go(-1)
</script>");
$db->query("unlock tables");
exit;
}
@@ -153,17 +161,21 @@ $leader = $leader + $pleader;
$power = $power + $ppower;
$intel = $intel + $pintel;
$admin = $gameStor->getValues(['scenario', 'turnterm', 'show_img_level', 'startyear', 'year']);
$admin = $gameStor->getValues(['scenario', 'turnterm', 'turntime', 'show_img_level', 'startyear', 'year']);
$relYear = Util::valueFit($admin['year'] - $admin['startyear'], 0);
$age = 20 + ($pleader + $ppower + $pintel) * 2 - (mt_rand(0, 1));
// 특기 부여
$specage2 = $age;
$special2 = 70;
// 아직 남았고 천재등록상태이면 특기 부여
if ($genius) {
$specage2 = $age;
$special2 = getSpecial2($leader, $power, $intel);
} else {
$specage2 = Util::valueFit(Util::round((GameConst::$retirementYear - $age)/4 - $relYear / 2), 3) + $age;
$special2 = 0;
}
//내특
$specage = $age;
$special = 20;
$specage = Util::valueFit(Util::round((GameConst::$retirementYear - $age)/12 - $relYear / 2), 3) + $age;
$special = 0;
if ($admin['scenario'] >= 1000) {
$specage2 = $age + 3;
@@ -183,10 +195,10 @@ else{
$experience *= 0.8;
}
$turntime = getRandTurn($admin['turnterm']);
$turntime = getRandTurn($admin['turnterm'], new \DateTimeImmutable($admin['turntime']));
$lastconnect = date('Y-m-d H:i:s');
if ($lastconnect >= $turntime) {
$now = date('Y-m-d H:i:s');
if ($now >= $turntime) {
$turntime = addTurn($turntime, $admin['turnterm']);
}
@@ -229,7 +241,8 @@ $db->insert('general', [
'level' => 0,
'turntime' => $turntime,
'killturn' => 6,
'lastconnect' => $lastconnect,
'lastconnect' => $now,
'lastrefresh' => $now,
'crewtype'=>GameUnitConst::DEFAULT_CREWTYPE,
'makelimit' => 0,
'age' => $age,
@@ -242,6 +255,8 @@ $db->insert('general', [
]);
$generalID = $db->insertId();
$db->query("unlock tables");
$cityname = CityConst::byID($city)->name;
$me = [
@@ -252,8 +267,14 @@ $log = [];
$mylog = [];
$josaRa = JosaUtil::pick($name, '라');
$log[0] = "<C>●</>{$gameStor->month}월:<G><b>{$cityname}</b></>에서 <Y>{$name}</>{$josaRa}는 호걸이 천하에 이름을 알립니다.";
if ($genius) {
$log[0] = "<C>●</>{$gameStor->month}월:<G><b>{$cityname}</b></>에서 <Y>{$name}</>{$josaRa}는 기재가 천하에 이름을 알립니다.";
$log[1] = "<C>●</>{$gameStor->month}월:<C>".getGenSpecial($special2)."</> 특기를 가진 <C>천재</>의 등장으로 온 천하가 떠들썩합니다.";
pushWorldHistory(["<C>●</>{$gameStor->year}{$gameStor->month}월:<L><b>【천재】</b></><G><b>{$cityname}</b></>에 천재가 등장했습니다."], $gameStor->year, $gameStor->month);
} else {
$log[0] = "<C>●</>{$gameStor->month}월:<G><b>{$cityname}</b></>에서 <Y>{$name}</>{$josaRa}는 호걸이 천하에 이름을 알립니다.";
}
pushGeneralHistory($me, "<C>●</>{$gameStor->year}{$gameStor->month}월:<Y>{$name}</>, <G>{$cityname}</>에서 큰 뜻을 품다.");
$mylog[] = "<C>●</>삼국지 모의전투 PHP의 세계에 오신 것을 환영합니다 ^o^";
$mylog[] = "<C>●</>처음 하시는 경우에는 <D>도움말</>을 참고하시고,";
@@ -261,7 +282,10 @@ $mylog[] = "<C>●</>문의사항이 있으시면 게시판에 글을 남겨주
$mylog[] = "<C>●</>부디 즐거운 삼모전 되시길 바랍니다 ^^";
$mylog[] = "<C>●</>통솔 <C>$pleader</> 무력 <C>$ppower</> 지력 <C>$pintel</> 의 보너스를 받으셨습니다.";
$mylog[] = "<C>●</>연령은 <C>$age</>세로 시작합니다.";
if ($genius) {
$mylog[] = "<C>●</>축하합니다! 천재로 태어나 처음부터 <C>".getGenSpecial($special2)."</> 특기를 가지게 됩니다!";
pushGeneralHistory($me, "<C>●</>{$gameStor->year}{$gameStor->month}월:<C>".getGenSpecial($special2)."</> 특기를 가진 천재로 탄생.");
}
pushGenLog($me, $mylog);
pushGeneralPublicRecord($log, $gameStor->year, $gameStor->month);
+6 -3
View File
@@ -1,7 +1,10 @@
jQuery(function($){
$('#by_scenario').change(function(){
var scenarioIdx = $(this).val();
$.redirect('a_hallOfFame.php', {scenarioIdx:scenarioIdx}, 'get');
var $this = $(this);
var scenarioIdx = $this.val();
var seasonIdx = $(this).find('option:selected').data('season');
$.redirect('a_hallOfFame.php', {scenarioIdx:scenarioIdx, seasonIdx:seasonIdx}, 'get');
})
//$.redirect("processing.php",{ commandtype: commandtype, turn: turn}, 'post');
});
+29
View File
@@ -105,6 +105,22 @@ function scenarioPreview(){
}
function formSetup(){
$.validator.addMethod("autorun_user", function(value,element){
var parent = $(element).parent('.input-group');
var checkCnt = parent.find('input:checked').length;
if(value <= 0){
if(checkCnt > 0){
return false;
}
return true;
}
if(checkCnt == 0){
return false;
}
return true;
}, "유효 시간과 옵션은 동시에 설정해야합니다.");
$('#game_form').validate({
rules:{
turnterm:"required",
@@ -116,6 +132,7 @@ function formSetup(){
show_img_level:"required",
tournament_trig:"required",
join_mode:'required',
autorun_user_minutes:{required: true, autorun_user: true, min:0}
},
errorElement: "div",
errorPlacement: function ( error, element ) {
@@ -140,6 +157,15 @@ function formSetup(){
if(!$("#game_form").valid()){
return;
}
var autorun_user_minutes = parseInt($('#autorun_user_minutes').val());
var autorun_user = [];
if(autorun_user_minutes > 0){
$('.autorun_user_chk:checked').each(function(){
autorun_user.push($(this).data('key'));
});
}
$.ajax({
cache:false,
type:'post',
@@ -155,7 +181,10 @@ function formSetup(){
show_img_level:$('#show_img_level input:radio:checked').val(),
tournament_trig:$('#tournament_trig input:radio:checked').val(),
reserve_open:$('#reserve_open').val(),
pre_reserve_open:$('#pre_reserve_open').val(),
join_mode:$('#join_mode input:radio:checked').val(),
autorun_user_minutes:autorun_user_minutes,
autorun_user:autorun_user
}
}).then(function(result){
var deferred = $.Deferred();
+71 -8
View File
@@ -28,7 +28,7 @@ function refreshing(obj, arg1, arg2) {
switch(arg1) {
case 0: document.location.reload(); break;
case 2: turn(arg2); break;
case 3: arg2.submit(); break;
case 3: $(arg2).submit(); break;
case 4:
arg2.submit();
message.msg.value = "";
@@ -39,14 +39,48 @@ function refreshing(obj, arg1, arg2) {
return false;
}
function moveProcessing(commandtype, turn){
console.log(commandtype, turn);
$.redirect("processing.php",{ commandtype: commandtype, turn: turn}, 'post');
function turn(type) {
$.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) {
num = form2.sel.value;
commandlist.location.replace('turn.php?type=' + type + '&sel=' + num);
function reloadCommandList(){
$.get({
url:'commandlist.php',
cache: false,
}).then(function(rdata){
$('#commandlist').html(rdata);
});
}
function myclock() {
var $clock = $('#clock');
var now_clock = moment();
if(!$clock.attr('data-time-diff')){
var base_clock = moment($clock.attr('data-server-time'));
$clock.attr('data-time-diff', base_clock.diff(now_clock));
}
var game_clock = now_clock.add(parseInt($clock.attr('data-time-diff')), 'milliseconds');
$('#clock').val(game_clock.format('YYYY-MM-DD HH:mm:ss'));
window.setTimeout(function(){
myclock();
}, 500);
}
jQuery(function($){
@@ -54,11 +88,40 @@ jQuery(function($){
var $this = $(this);
var target = $('[name="genlist"]').val();
var msg = $('#msg').val();
console.log(target, msg);
return false;
});
$('#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();
});
+10 -5
View File
@@ -725,9 +725,9 @@ function ConquerCity($admin, $general, $city, $nation, $destnation) {
'supply'=>1,
'term'=>0,
'conflict'=>'{}',
'agri'=>$db->sqleval('GREATEST(agri*0.7, agri2*0.25)'),
'comm'=>$db->sqleval('GREATEST(comm*0.7, comm2*0.25)'),
'secu'=>$db->sqleval('GREATEST(secu*0.7, secu2*0.25)'),
'agri'=>$db->sqleval('agri*0.7'),
'comm'=>$db->sqleval('comm*0.7'),
'secu'=>$db->sqleval('secu*0.7'),
'nation'=>$conquerNation,
'gen1'=>0,
'gen2'=>0,
@@ -736,8 +736,13 @@ function ConquerCity($admin, $general, $city, $nation, $destnation) {
'gen2set'=>0,
'gen3set'=>0
];
$query['def'] = $db->sqleval('def2/2');
$query['wall'] = $db->sqleval('wall2/2');
if($city['level'] > 3) {
$query['def'] = 1000;
$query['wall'] = 1000;
} else {
$query['def'] = $db->sqleval('def2/2');
$query['wall'] = $db->sqleval('wall2/2');
}
$db->update('city', $query, 'city=%i', (int)$city['city']);
//전방설정
+109 -29
View File
@@ -95,6 +95,7 @@ switch($commandtype) {
case 55: command_Single($turn, 55); break; //거병
case 56: command_Single($turn, 56); break; //해산
case 57: command_Single($turn, 57); break; //모반 시도
case 58: command_58( $turn, 58); break; //숙련 전환
case 61: command_61($turn, 61); break; //불가침
case 62: command_62($turn, 62); break; //선포
@@ -535,7 +536,7 @@ function command_23($turn, $command) {
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
$query = "select no,name,level,npc from general where nation='{$general['nation']}' and no!='{$general['no']}' order by npc,binary(name)";
$query = "select no,name,level,gold,rice,npc from general where nation='{$general['nation']}' and no!='{$general['no']}' order by npc,binary(name)";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$gencount = MYDB_num_rows($result);
@@ -551,10 +552,10 @@ function command_23($turn, $command) {
else { $style = ""; }
if($general['level'] >= 5) {
echo "
<option value={$general['no']} {$style}>*{$general['name']}*</option>";
<option value={$general['no']} {$style}>*{$general['name']}*(:{$general['gold']}, :{$general['rice']})</option>";
} else {
echo "
<option value={$general['no']} {$style}>{$general['name']}</option>";
<option value={$general['no']} {$style}>{$general['name']}(:{$general['gold']}, :{$general['rice']})</option>";
}
}
@@ -612,7 +613,7 @@ function command_24($turn, $command) {
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
$query = "select no,name,level,npc from general where nation='{$general['nation']}' and no!='{$general['no']}' order by npc,binary(name)";
$query = "select no,name,level,gold,rice,npc from general where nation='{$general['nation']}' and no!='{$general['no']}' order by npc,binary(name)";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$gencount = MYDB_num_rows($result);
@@ -628,11 +629,9 @@ function command_24($turn, $command) {
elseif($general['npc'] == 1) { $style = "style=color:skyblue;"; }
else { $style = ""; }
if($general['level'] >= 5) {
echo "
<option value={$general['no']} {$style}>*{$general['name']}*</option>";
echo "<option value={$general['no']} {$style}>*{$general['name']}*(금:{$general['gold']}, 쌀:{$general['rice']})</option>";
} else {
echo "
<option value={$general['no']} {$style}>{$general['name']}</option>";
echo "<option value={$general['no']} {$style}>{$general['name']}(금:{$general['gold']}, 쌀:{$general['rice']})</option>";
}
}
@@ -718,6 +717,8 @@ function command_25($turn, $command) {
}
}
unset($nation);
$generalList = $db->query('SELECT no,name,nation,npc FROM general WHERE owner!=%i ORDER BY name ASC', $userID);
?>
국가에 임관합니다.<br>
@@ -728,22 +729,31 @@ function command_25($turn, $command) {
<?php else: ?>
임관할 국가를 목록에서 선택하세요.<br>
<?php endif; ?>
!!! 방랑군을 포함한 랜덤임관입니다. 유니크를 기대하신다면!<br>
??? 방랑군을 제외한 랜덤임관입니다. 유니크 혜택은 없습니다.<br>
임의의 국가로 임관할 경우 유니크 아이템을 얻을 기회가 높습니다.
임관 금지이거나 초기 제한중인 국가는 붉은색 배경으로 표시됩니다.<br>
870px x 200px를 넘어서는 내용은 표시되지 않습니다.<br>
<form name=form1 action=c_double.php method=post>
<select name=double size=1 style=color:white;background-color:black>
<option value=99 style=color:white;background-color:black;>!!!</option>
<option value=98 style=color:white;background-color:black;>???</option>
<?php foreach($nationList as $nation): ?>
<?php if(!$nation['availableJoin']): ?>
<option value='<?=$nation['nation']?>' style='color:<?=$nation['color']?>;background-color:red;' <?=$onlyRandom?'disabled':''?>>【 <?=$nation['name']?> 】</option>
<?php else: ?>
<option value='<?=$nation['nation']?>' style='color:<?=$nation['color']?>;' <?=$onlyRandom?'disabled':''?>>【 <?=$nation['name']?> 】</option>
<?php endif; ?>
<?php endforeach; ?>
<input id='double' name='double' type='hidden'>
<input id='third' name='third' type='hidden'>
<select id='selectorV' name=value size=1 style=color:white;background-color:black>
<optgroup label='랜덤 임관'>
<option value=99 style=color:white;background-color:black;>임의의 국가</option>
<option value=98 style=color:white;background-color:black;>건국된 임의 국가</option>
</optgroup>
<optgroup label='국가로 임관'>
<?php foreach($nationList as $nation): ?>
<?php if(!$nation['availableJoin']): ?>
<option value='<?=$nation['nation']?>' style='color:<?=$nation['color']?>;background-color:red;' <?=$onlyRandom?'disabled':''?>>【 <?=$nation['name']?> 】</option>
<?php else: ?>
<option value='<?=$nation['nation']?>' style='color:<?=$nation['color']?>;' <?=$onlyRandom?'disabled':''?>>【 <?=$nation['name']?> 】</option>
<?php endif; ?>
<?php endforeach; ?>
</optgroup>
<optgroup label='장수를 따라 임관'>
<?php foreach($generalList as $targetGeneral): ?>
<option value='-<?=$targetGeneral['no']?>' <?=$onlyRandom?'disabled':''?>><?=formatName($targetGeneral['name'],$targetGeneral['npc'])?>【<?=getNationStaticInfo($targetGeneral['nation'])['name']??'재야'?>】</option>
<?php endforeach; ?>
</optgroup>
</select>
<input type=submit value=임관>
@@ -752,6 +762,29 @@ function command_25($turn, $command) {
<input type=hidden name=turn[] value=<?=$turn[$i]?>>
<?php endforeach; ?>
</form>
<script>
$(function(){
var $third = $('#third');
var $double = $('#double');
var $selector = $('#selectorV');
$selector.on('change', function(){
var value=$selector.val();
if(value >= 98){
$third.val(value);
$double.val(0);
}
else if(value>0){
$third.val(0);
$double.val(value);
}
else{
$third.val(1);
$double.val(-value);
}
});
$selector.val(99).trigger('change');
});
</script>
<?php
echo getInvitationList($nationList);
@@ -769,7 +802,7 @@ function command_27($turn, $command) {
$result = MYDB_query($query, $connect) or Error("command_27 ".MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$query = "select no,name,level,npc from general where nation='{$me['nation']}' and no!='{$me['no']}' order by npc,binary(name)";
$query = "select no,name,city,level,npc from general where nation='{$me['nation']}' and no!='{$me['no']}' order by npc,binary(name)";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
$gencount = MYDB_num_rows($result);
@@ -783,15 +816,16 @@ function command_27($turn, $command) {
for($i=0; $i < $gencount; $i++) {
$general = MYDB_fetch_array($result);
$cityName = CityConst::byID($general['city'])->name;
if ($general['npc'] >= 2) { $style = "style=color:cyan;"; }
elseif($general['npc'] == 1) { $style = "style=color:skyblue;"; }
else { $style = ""; }
if($general['level'] >= 5) {
echo "
<option value={$general['no']} {$style}>*{$general['name']}*</option>";
<option value={$general['no']} {$style}>*{$general['name']}*({$cityName})</option>";
} else {
echo "
<option value={$general['no']} {$style}>{$general['name']}</option>";
<option value={$general['no']} {$style}>{$general['name']}({$cityName})</option>";
}
}
@@ -1367,7 +1401,7 @@ function command_48($turn, $command) {
$color = [];
for($i=1; $i <= 10; $i++) {
for($i=1; $i <= 6; $i++) {
if($city['secu'] >= $i*1000) {
$color[$i] = "white";
} else {
@@ -1402,10 +1436,6 @@ function command_48($turn, $command) {
<option value=204 style=color:$color[4]>".getHorseName(4)."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;가격: ".getItemCost(4)."</option>
<option value=205 style=color:$color[5]>".getHorseName(5)."&nbsp;&nbsp;&nbsp;&nbsp;가격: ".getItemCost(5)."</option>
<option value=206 style=color:$color[6]>".getHorseName(6)."&nbsp;&nbsp;&nbsp;&nbsp;가격: ".getItemCost(6)."</option>
<option value=207 style=color:$color[7]>".getHorseName(7)."&nbsp;&nbsp;&nbsp;&nbsp;가격: ".getItemCost(7)."</option>
<option value=208 style=color:$color[8]>".getHorseName(8)."&nbsp;&nbsp;&nbsp;&nbsp;가격: ".getItemCost(8)."</option>
<option value=209 style=color:$color[9]>".getHorseName(9)."&nbsp;&nbsp;&nbsp;&nbsp;가격: ".getItemCost(9)."</option>
<option value=210 style=color:$color[10]>".getHorseName(10)."&nbsp;&nbsp;&nbsp;&nbsp;가격: ".getItemCost(10)."</option>
<option value=300 style=color:skyblue>_____도구매각(반값)____</option>
<option value=301 style=color:$color[1]>".getItemName(1)."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;가격: ".getItemCost2(1)."</option>
<option value=302 style=color:$color[2]>".getItemName(2)."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;가격: ".getItemCost2(2)."</option>
@@ -1728,6 +1758,56 @@ function command_54($turn, $command) {
ender();
}
function command_58($turn, $command) {
$db = DB::db();
$connect=$db->get();
$userID = Session::getUserID();
starter("숙련 전환");
$dexVals = $db->queryFirstList('SELECT dex0, dex10, dex20, dex30, dex40 FROM general WHERE owner = %i', $userID);
$dexTexts = [];
foreach($dexVals as $idx => $val){
$prevDexLevel = getDexCall($val);
$newDexLevel = getDexCall(Util::toInt($val * 0.7));
$addDex = Util::toInt(($val - $val * 0.7) * 0.5);
$dexTexts[$idx] = "$prevDexLevel$newDexLevel, {$addDex} 전환";
}
echo "
본인의 특정 병종 숙련을 30% 줄이고, 줄어든 숙련 2/3(20%p) 다른 병종 숙련으로 전환합니다.<br>
<form name=form1 action=c_double.php method=post>
<select name=double size=1 style=color:white;background-color:black>
<option value=0>보병 ({$dexTexts[0]})</option>
<option value=1>궁병 ({$dexTexts[1]})</option>
<option value=2>기병 ({$dexTexts[2]})</option>
<option value=3>귀병 ({$dexTexts[3]})</option>
<option value=4>차병 ({$dexTexts[4]})</option>
</select>
숙련을
<select name=third size=1 style=color:white;background-color:black>
<option value=0>보병 ({$dexVals[0]})</option>
<option value=1>궁병 ({$dexVals[1]})</option>
<option value=2>기병 ({$dexVals[2]})</option>
<option value=3>귀병 ({$dexVals[3]})</option>
<option value=4>차병 ({$dexVals[4]})</option>
</select>
으로
<input type=submit value=전환>
<input type=hidden name=command value=$command>";
for($i=0; $i < count($turn); $i++) {
echo "
<input type=hidden name=turn[] value=$turn[$i]>";
}
echo "
</form>
";
ender();
}
function command_61($turn, $command) {
$db = DB::db();
$connect=$db->get();
+1 -7
View File
@@ -349,12 +349,6 @@ class CityConstBase{
] + $initValue + static::$buildInitCommon;
}, array_values(static::$constID));
$db = DB::db();
$db->insert('city', $queries);
$db->update('city', [
'agri'=>$db->sqleval('agri2 * 0.25'),
'comm'=>$db->sqleval('comm2 * 0.25'),
'secu'=>$db->sqleval('secu2 * 0.25'),
], true);
DB::db()->insert('city', $queries);
}
}
+1 -1
View File
@@ -72,7 +72,7 @@ class GameConstBase
/** @var int 최대 계급 */
public static $maxDedLevel = 30;
/** @var int 최대 기술 레벨 */
public static $maxTechLevel = 15;
public static $maxTechLevel = 12;
/** @var int 초기 제한시 장수 제한 */
public static $initialNationGenLimitForRandInit = 3;
+25 -7
View File
@@ -81,11 +81,22 @@ class ResetHelper{
mkdir($servRoot.'/logs/'.$serverID, 0755);
mkdir($servRoot.'/data/'.$serverID, 0755);
$seasonIdx = 1;
if($db->queryFirstField('SHOW TABLES LIKE %s', 'storage') !== null){
$gameStor = KVStorage::getStorage($db, 'game_env');
$nextSeasonIdx = $gameStor->next_season_idx;
if($nextSeasonIdx !== null){
$seasonIdx = $nextSeasonIdx;
}
$gameStor->resetCache();
}
$result = Util::generateFileUsingSimpleTemplate(
$servRoot.'/d_setting/UniqueConst.orig.php',
$servRoot.'/d_setting/UniqueConst.php',[
'serverID'=>$serverID,
'serverName'=>AppConf::getList()[$prefix]->getKorName(),
'seasonIdx'=>$seasonIdx
], true
);
@@ -112,11 +123,14 @@ class ResetHelper{
}
}
(KVStorage::getStorage($db, 'game_env'))->resetValues();
$gameStor = KVStorage::getStorage($db, 'game_env');
$gameStor->resetValues();
$gameStor->next_season_idx = $seasonIdx;
return [
'result'=>true,
'serverID'=>$serverID
'serverID'=>$serverID,
'seasonIdx'=>$seasonIdx
];
}
@@ -129,7 +143,9 @@ class ResetHelper{
int $npcmode,
int $show_img_level,
int $tournament_trig,
string $join_mode
string $join_mode,
string $turntime,
?array $autorun_user
):array{
//FIXME: 분리할 것
if(120 % $turnterm != 0){
@@ -152,6 +168,7 @@ class ResetHelper{
}
$serverID = $clearResult['serverID'];
$seasonIdx = $clearResult['seasonIdx'];
$scenarioObj = new Scenario($scenario, false);
$scenarioObj->buildConf();
@@ -186,8 +203,6 @@ class ResetHelper{
true
);
$turntime = date('Y-m-d H:i:s');
$time = substr($turntime, 11, 2);
if($sync == 0) {
// 현재 시간을 1월로 맞춤
@@ -223,12 +238,13 @@ class ResetHelper{
'msg'=>'공지사항',//TODO:공지사항
'maxgeneral'=>GameConst::$defaultMaxGeneral,
'maxnation'=>GameConst::$defaultMaxNation,
'conlimit'=>300,
'conlimit'=>30000,
'gold_rate'=>100,
'rice_rate'=>100,
'develcost'=>$develcost,
'turntime'=>$turntime,
'starttime'=>$starttime,
'opentime'=>$turntime,
'turnterm'=>$turnterm,
'killturn'=>$killturn,
'genius'=>GameConst::$defaultMaxGenius,
@@ -238,7 +254,8 @@ class ResetHelper{
'extended_general'=>$extend,
'fiction'=>$fiction,
'tnmt_trig'=>$tournament_trig,
'prev_winner'=>$prevWinner
'prev_winner'=>$prevWinner,
'autorun_user'=>$autorun_user
];
foreach(RootDB::db()->query('SELECT `no`, `name`, `picture`, `imgsvr` FROM member WHERE grade >= 5') as $admin){
@@ -262,6 +279,7 @@ class ResetHelper{
'date'=>$turntime,
'winner_nation'=>null,
'map'=>$scenarioObj->getMapTheme(),
'season'=>$seasonIdx,
'scenario'=>$scenario,
'scenario_name'=>$scenarioObj->getTitle(),
'env'=>Json::encode($env)
+1 -1
View File
@@ -227,7 +227,7 @@ class NPC{
$level = $nationID?1:0;
}
$turntime = \sammo\getRandTurn($env['turnterm']);
$turntime = \sammo\getRandTurn($env['turnterm'], new \DateTimeImmutable($env['turntime']));
$killturn = ($this->death - $year) * 12 + mt_rand(0, 11);
+5 -5
View File
@@ -314,12 +314,12 @@ class WarUnitGeneral extends WarUnit{
}
else if($item >= 14 && $item <= 16){
//의적주, 두강주, 보령압주 사용
$this->addAtmosBonus(5);
$this->addAtmosBonus(10);
$itemActivated = true;
}
else if($item >= 19 && $item <= 20){
//춘화첩, 초선화 사용
$this->addAtmosBonus(7);
$this->addAtmosBonus(14);
$itemActivated = true;
}
else if($item == 4){
@@ -330,12 +330,12 @@ class WarUnitGeneral extends WarUnit{
}
else if($item >= 12 && $item <= 13){
//과실주, 이강주 사용
$this->addTrainBonus(5);
$this->addTrainBonus(10);
$itemActivated = true;
}
else if($item >= 18 && $item <= 18){
else if($item >= 17 && $item <= 18){
//철벽서, 단결도 사용
$this->addTrainBonus(7);
$this->addTrainBonus(14);
$itemActivated = true;
}
+32 -32
View File
@@ -23,18 +23,18 @@
},
"diplomacy":[],
"general":[
[0, "이윤열", null, 0, null, 101, 103, 103, 0, 1985, 2190, null, null],
[0, "임요환", null, 0, null, 94, 93, 101, 0, 1985, 2190, null, null],
[0, "이영호", null, 0, null, 111, 108, 108, 0, 1985, 2190, null, null],
[0, "서지훈", null, 0, null, 93, 95, 88, 0, 1985, 2190, null, null],
[0, "전상욱", null, 0, null, 89, 87, 84, 0, 1985, 2190, null, null],
[0, "이윤열", null, 0, null, 110, 105, 111, 0, 1985, 2190, null, null, "전 전설로 남고 싶셒습니다"],
[0, "임요환", null, 0, null, 95, 100, 112, 0, 1985, 2190, null, null, "역시 콩은 까야 제맛이지"],
[0, "이영호", null, 0, null, 115, 111, 111, 0, 1985, 2190, null, null, "정말 득도를 했어요 정말 스타를 깨달았어요!"],
[0, "서지훈", null, 0, null, 99, 99, 96, 0, 1985, 2190, null, null, "엄마 많이 사랑해요!"],
[0, "전상욱", null, 0, null, 93, 90, 91, 0, 1985, 2190, null, null],
[0, "염보성", null, 0, null, 90, 88, 86, 0, 1985, 2190, null, null],
[0, "최연성", null, 0, null, 104, 110, 99, 0, 1985, 2190, null, null],
[0, "최연성", null, 0, null, 112, 115, 100, 0, 1985, 2190, null, null, "별로.. 별로 안좋아요"],
[0, "이재호", null, 0, null, 91, 86, 81, 0, 1985, 2190, null, null],
[0, "변형태", null, 0, null, 89, 93, 79, 0, 1985, 2190, null, null],
[0, "구성훈", null, 0, null, 76, 79, 81, 0, 1985, 2190, null, null],
[0, "정명훈", null, 0, null, 99, 100, 99, 0, 1985, 2190, null, null],
[0, "박성균", null, 0, null, 90, 82, 93, 0, 1985, 2190, null, null],
[0, "정명훈", null, 0, null, 102, 100, 99, 0, 1985, 2190, null, null],
[0, "박성균", null, 0, null, 94, 93, 98, 0, 1985, 2190, null, null],
[0, "신상문", null, 0, null, 91, 94, 81, 0, 1985, 2190, null, null],
[0, "이성은", null, 0, null, 89, 95, 79, 0, 1985, 2190, null, null],
[0, "한동욱", null, 0, null, 94, 91, 96, 0, 1985, 2190, null, null],
@@ -85,7 +85,7 @@
[0, "오세기", null, 0, null, 46, 33, 68, 0, 1985, 2190, null, null],
[0, "백승혁", null, 0, null, 55, 30, 47, 0, 1985, 2190, null, null],
[0, "모상호", null, 0, null, 55, 60, 65, 0, 1985, 2190, null, null],
[0, "김대기", null, 0, null, 57, 55, 35, 0, 1985, 2190, null, null],
[0, "김대기", null, 0, null, 70, 70, 70, 0, 1985, 2190, null, null],
[0, "박상규", null, 0, null, 46, 46, 68, 0, 1985, 2190, null, null],
[0, "최은창", null, 0, null, 50, 37, 46, 0, 1985, 2190, null, null],
[0, "김우영", null, 0, null, 59, 46, 30, 0, 1985, 2190, null, null],
@@ -140,17 +140,17 @@
[0, "김용호", null, 0, null, 45, 67, 56, 0, 1985, 2190, null, null],
[0, "김도욱", null, 0, null, 41, 40, 22, 0, 1985, 2190, null, null],
[0, "서지수", null, 0, null, 100, 100, 100, 0, 1985, 2190, null, null],
[0, "송병구", null, 0, null, 100, 100, 98, 0, 1985, 2190, null, null],
[0, "김택용", null, 0, null, 109, 105, 103, 0, 1985, 2190, null, null],
[0, "송병구", null, 0, null, 102, 102, 98, 0, 1985, 2190, null, null],
[0, "김택용", null, 0, null, 110, 105, 105, 0, 1985, 2190, null, null],
[0, "박정석", null, 0, null, 98, 95, 90, 0, 1985, 2190, null, null],
[0, "강민", null, 0, null, 99, 94, 99, 0, 1985, 2190, null, null],
[0, "윤용태", null, 0, null, 93, 99, 79, 0, 1985, 2190, null, null],
[0, "김구현", null, 0, null, 88, 91, 70, 0, 1985, 2190, null, null],
[0, "허영무", null, 0, null, 94, 94, 94, 0, 1985, 2190, null, null],
[0, "허영무", null, 0, null, 97, 97, 97, 0, 1985, 2190, null, null, "게임 알지도 못하는 놈들아 너네들이 와서 함 해볼래!?"],
[0, "박지호", null, 0, null, 81, 94, 69, 0, 1985, 2190, null, null],
[0, "전태규", null, 0, null, 83, 87, 75, 0, 1985, 2190, null, null],
[0, "오영종", null, 0, null, 93, 85, 93, 0, 1985, 2190, null, null],
[0, "도재욱", null, 0, null, 108, 96, 79, 0, 1985, 2190, null, null],
[0, "오영종", null, 0, null, 97, 88, 96, 0, 1985, 2190, null, null],
[0, "도재욱", null, 0, null, 103, 101, 79, 0, 1985, 2190, null, null],
[0, "박영민", null, 0, null, 78, 73, 68, 0, 1985, 2190, null, null],
[0, "기욤패트리", null, 0, null, 93, 91, 91, 0, 1985, 2190, null, null],
[0, "안기효", null, 0, null, 81, 76, 73, 0, 1985, 2190, null, null],
@@ -179,7 +179,7 @@
[0, "한동훈", null, 0, null, 61, 63, 46, 0, 1985, 2190, null, null],
[0, "김민제", null, 0, null, 51, 43, 58, 0, 1985, 2190, null, null],
[0, "신재욱", null, 0, null, 50, 40, 31, 0, 1985, 2190, null, null],
[0, "손석희", null, 0, null, 55, 43, 52, 0, 1985, 2190, null, null],
[0, "손석희", null, 0, null, 40, 20, 89, 0, 1985, 2190, null, null],
[0, "손재범", null, 0, null, 60, 36, 62, 0, 1985, 2190, null, null],
[0, "노영훈", null, 0, null, 55, 36, 54, 0, 1985, 2190, null, null],
[0, "김인기", null, 0, null, 59, 31, 64, 0, 1985, 2190, null, null],
@@ -193,7 +193,7 @@
[0, "김학수", null, 0, null, 47, 40, 41, 0, 1985, 2190, null, null],
[0, "임효진", null, 0, null, 61, 31, 33, 0, 1985, 2190, null, null],
[0, "윤현욱", null, 0, null, 47, 49, 49, 0, 1985, 2190, null, null],
[0, "변현제", null, 0, null, 51, 33, 42, 0, 1985, 2190, null, null],
[0, "변현제", null, 0, null, 51, 33, 79, 0, 1985, 2190, null, null],
[0, "최홍희", null, 0, null, 57, 44, 48, 0, 1985, 2190, null, null],
[0, "정경두", null, 0, null, 47, 39, 60, 0, 1985, 2190, null, null],
[0, "최수민", null, 0, null, 55, 56, 47, 0, 1985, 2190, null, null],
@@ -245,7 +245,6 @@
[0, "김진", null, 0, null, 53, 30, 49, 0, 1985, 2190, null, null],
[0, "hao lei", null, 0, null, 53, 35, 32, 0, 1985, 2190, null, null],
[0, "김승엽", null, 0, null, 56, 30, 45, 0, 1985, 2190, null, null],
[0, "윤지현", null, 0, null, 47, 50, 36, 0, 1985, 2190, null, null],
[0, "이상길", null, 0, null, 50, 63, 60, 0, 1985, 2190, null, null],
[0, "정재우P", null, 0, null, 59, 37, 30, 0, 1985, 2190, null, null],
[0, "곽기성", null, 0, null, 50, 38, 49, 0, 1985, 2190, null, null],
@@ -260,15 +259,15 @@
[0, "정정호", null, 0, null, 50, 39, 31, 0, 1985, 2190, null, null],
[0, "구찬우", null, 0, null, 60, 30, 41, 0, 1985, 2190, null, null],
[0, "원선재", null, 0, null, 46, 39, 52, 0, 1985, 2190, null, null],
[0, "콩", null, 0, null, 22, 22, 22, 0, 1985, 2190, null, null],
[0, "이제동", null, 0, null, 103, 101, 100, 0, 1985, 2190, null, null],
[0, "홍진호", null, 0, null, 92, 102, 83, 0, 1985, 2190, null, null],
[0, "박성준", null, 0, null, 97, 100, 91, 0, 1985, 2190, null, null],
[0, "박태민", null, 0, null, 98, 88, 97, 0, 1985, 2190, null, null],
[0, "콩", null, 0, null, 22, 22, 22, 0, 1985, 2190, null, null, "Chili Con Carne Chili Con Carne"],
[0, "이제동", null, 0, null, 109, 113, 106, 0, 1985, 2190, null, null],
[0, "홍진호", null, 0, null, 100, 102, 98, 0, 1985, 2190, null, null, "오늘의 전 홍진호도 아니고 폭풍저그도 아니었습니다. 그냥.. 그냥.. 저그 였습니다. 저그.."],
[0, "박성준", null, 0, null, 101, 109, 95, 0, 1985, 2190, null, null],
[0, "박태민", null, 0, null, 98, 90, 106, 0, 1985, 2190, null, null],
[0, "김윤환Z", null, 0, null, 90, 81, 95, 0, 1985, 2190, null, null],
[0, "김명운", null, 0, null, 97, 94, 97, 0, 1985, 2190, null, null],
[0, "김정우", null, 0, null, 100, 99, 99, 0, 1985, 2190, null, null],
[0, "김준영", null, 0, null, 102, 87, 94, 0, 1985, 2190, null, null],
[0, "김명운", null, 0, null, 97, 94, 99, 0, 1985, 2190, null, null],
[0, "김정우", null, 0, null, 100, 108, 99, 0, 1985, 2190, null, null],
[0, "김준영", null, 0, null, 105, 87, 96, 0, 1985, 2190, null, null],
[0, "주진철", null, 0, null, 63, 42, 56, 0, 1985, 2190, null, null],
[0, "박재혁", null, 0, null, 74, 71, 62, 0, 1985, 2190, null, null],
[0, "박준오", null, 0, null, 84, 74, 88, 0, 1985, 2190, null, null],
@@ -280,7 +279,7 @@
[0, "신노열", null, 0, null, 62, 33, 67, 0, 1985, 2190, null, null],
[0, "신동원", null, 0, null, 76, 80, 44, 0, 1985, 2190, null, null],
[0, "이영한", null, 0, null, 78, 84, 39, 0, 1985, 2190, null, null],
[0, "김민철", null, 0, null, 99, 86, 97, 0, 1985, 2190, null, null],
[0, "김민철", null, 0, null, 99, 90, 97, 0, 1985, 2190, null, null],
[0, "김동현", null, 0, null, 63, 32, 62, 0, 1985, 2190, null, null],
[0, "서경종", null, 0, null, 73, 63, 54, 0, 1985, 2190, null, null],
[0, "이승석", null, 0, null, 59, 63, 23, 0, 1985, 2190, null, null],
@@ -292,7 +291,7 @@
[0, "고강민", null, 0, null, 75, 73, 45, 0, 1985, 2190, null, null],
[0, "주영달", null, 0, null, 50, 69, 61, 0, 1985, 2190, null, null],
[0, "박신영", null, 0, null, 50, 61, 34, 0, 1985, 2190, null, null],
[0, "김경모", null, 0, null, 57, 49, 53, 0, 1985, 2190, null, null],
[0, "김경모", null, 0, null, 70, 78, 61, 0, 1985, 2190, null, null],
[0, "정영주", null, 0, null, 53, 52, 33, 0, 1985, 2190, null, null],
[0, "윤종민", null, 0, null, 56, 51, 42, 0, 1985, 2190, null, null],
[0, "배병우", null, 0, null, 50, 53, 60, 0, 1985, 2190, null, null],
@@ -351,10 +350,8 @@
[0, "노재상", null, 0, null, 51, 56, 40, 0, 1985, 2190, null, null],
[0, "장일석", null, 0, null, 47, 37, 34, 0, 1985, 2190, null, null],
[0, "이정진", null, 0, null, 47, 41, 32, 0, 1985, 2190, null, null],
[0, "이종미", null, 0, null, 52, 47, 36, 0, 1985, 2190, null, null],
[0, "이진수", null, 0, null, 45, 60, 58, 0, 1985, 2190, null, null],
[0, "한지원", null, 0, null, 48, 34, 63, 0, 1985, 2190, null, null],
[0, "김지혜", null, 0, null, 61, 68, 66, 0, 1985, 2190, null, null],
[0, "박경호", null, 0, null, 46, 43, 40, 0, 1985, 2190, null, null],
[0, "이병렬", null, 0, null, 56, 38, 59, 0, 1985, 2190, null, null],
[0, "김현철", null, 0, null, 49, 64, 48, 0, 1985, 2190, null, null],
@@ -421,6 +418,9 @@
[0, "김지은", null, 0, null, 92, 87, 93, 0, 1985, 2190, null, null],
[0, "강민경", null, 0, null, 88, 71, 97, 0, 1985, 2190, null, null],
[0, "이현주", null, 0, null, 97, 98, 90, 0, 1985, 2190, null, null],
[0, "김지혜", null, 0, null, 98, 94, 89, 0, 1985, 2190, null, null],
[0, "이종미", null, 0, null, 102, 96, 103, 0, 1985, 2190, null, null],
[0, "윤지현", null, 0, null, 99, 90, 104, 0, 1985, 2190, null, null],
[0, "김정민", null, 0, null, 92, 88, 93, 0, 1985, 2190, null, null],
[0, "조용호", null, 0, null, 100, 99, 94, 0, 1985, 2190, null, null],
[0, "변길섭", null, 0, null, 89, 99, 78, 0, 1985, 2190, null, null],
@@ -481,12 +481,12 @@
[0, "장육", null, 0, null, 78, 32, 33, 0, 1985, 2190, null, null],
[0, "이용범", null, 0, null, 63, 46, 63, 0, 1985, 2190, null, null],
[0, "김상우", null, 0, null, 48, 49, 31, 0, 1985, 2190, null, null],
[0, "문준희", null, 0, null, 69, 39, 45, 0, 1985, 2190, null, null],
[0, "문준희", null, 0, null, 69, 99, 35, 0, 1985, 2190, null, null],
[0, "박동수", null, 0, null, 45, 67, 59, 0, 1985, 2190, null, null],
[0, "박대경", null, 0, null, 65, 34, 56, 0, 1985, 2190, null, null],
[0, "임재덕", null, 0, null, 74, 45, 35, 0, 1985, 2190, null, null],
[0, "김원기", null, 0, null, 51, 58, 53, 0, 1985, 2190, null, null],
[0, "유대현", null, 0, null, 52, 36, 63, 0, 1985, 2190, null, null],
[0, "유대현", null, 0, null, 84, 43, 90, 0, 1985, 2190, null, null],
[0, "김동우", null, 0, null, 64, 37, 64, 0, 1985, 2190, null, null],
[0, "김민호", null, 0, null, 46, 44, 59, 0, 1985, 2190, null, null],
[0, "이건준", null, 0, null, 52, 43, 48, 0, 1985, 2190, null, null],
@@ -499,7 +499,7 @@
[0, "문지훈", null, 0, null, 63, 56, 34, 0, 1985, 2190, null, null],
[0, "장용석", null, 0, null, 66, 55, 44, 0, 1985, 2190, null, null],
[0, "유인봉", null, 0, null, 62, 64, 60, 0, 1985, 2190, null, null],
[0, "김동준", null, 0, null, 63, 64, 38, 0, 1985, 2190, null, null]
[0, "김동준", null, 0, null, 86, 72, 93, 0, 1985, 2190, null, null]
],
"general_ex":[
+24
View File
@@ -10,5 +10,29 @@
},
"history": [
"<C>●</>180년 1월:<L><b>【이벤트】</b></>병기로 싸운다! 최고의 충차 지휘관을 가린다"
],
"initialEvents":[
[
true,
["ChangeCity", "free", {
"pop":"70%",
"agri":"70%",
"comm":"70%",
"secu":"70%",
"rate":80
}],
["ChangeCity", "occupied", {
"pop":"70%",
"agri":"70%",
"comm":"70%",
"secu":"70%",
"rate":80,
"def":"70%",
"wall":"70%"
}]
]
],
"events":[
]
}
-507
View File
@@ -1,507 +0,0 @@
{
"title":"【공백지】 충차전(디버그)",
"startYear":180,
"map":{
"mapName":"che",
"unitSet":"siegetank"
},
"stat":{
"chiefMin":9
},
"history": [
"<C>●</>180년 1월:<L><b>【이벤트】</b></>병기로 싸운다! 최고의 충차 지휘관을 가린다"
],
"general":[
[1,"소제1",1001,0,null,20,10,48,0,160,300,"유지","저격"],
[1,"헌제",1002,0,null,17,10,61,0,160,300,"안전","저격"],
[999,"사마휘",1003,0,null,71,10,65,0,160,300,"은둔","저격","좋지, 좋아~"],
[999,"우길",1004,0,null,17,10,65,0,160,300,"은둔","저격"],
[999,"화타",1005,0,null,53,10,65,0,160,300,"은둔","저격","아픈 사람들은 모두 내게 오시오. 껄껄껄."],
[999,"길평",1006,0,null,27,10,65,0,160,300,"은둔","저격"],
[29,"가규",1007,0,null,55,10,65,0,160,300,"재간","저격"],
[136,"가범",1008,0,null,58,10,65,0,160,300,"유지","저격"],
[49,"가비능",1009,0,null,58,65,10,0,160,300,"정복","저격"],
[31,"가충",1010,0,null,50,10,65,0,160,300,"출세","저격"],
[20,"가후",1011,0,null,69,10,65,0,160,300,"할거","저격"],
[73,"간옹",1012,0,null,31,10,65,0,160,300,"안전","저격"],
[129,"감녕",1013,0,null,75,10,65,0,160,300,"출세","저격"],
[127,"감택",1014,0,null,62,10,65,0,160,300,"유지","저격"],
[60,"강단",1015,0,null,41,65,10,0,160,300,"재간","저격"],
[73,"강유",1016,0,null,75,10,65,0,160,300,"왕좌","저격","갈고 닦은 무예와 승상께 배운 책략을 발휘해 보이겠다!"],
[102,"고간",1017,0,null,60,57,10,0,160,300,"유지","저격"],
[27,"고람",1018,0,null,72,65,10,0,160,300,"출세","저격"],
[69,"고상",1019,0,null,41,40,10,0,160,300,"재간","저격"],
[144,"고순",1020,0,null,75,10,65,0,160,300,"의협","저격"],
[7,"고승",1021,0,null,42,65,10,0,160,300,"출세","저격"],
[120,"고옹",1022,0,null,57,10,65,0,160,300,"출세","저격"],
[63,"고정",1023,0,null,67,65,10,0,160,300,"정복","저격"],
[53,"고패",1024,0,null,53,56,10,0,160,300,"유지","저격"],
[74,"공도",1025,0,null,26,65,10,0,160,300,"재간","저격"],
[142,"공손강",1026,0,null,64,65,10,0,160,300,"정복","저격"],
[142,"공손공",1027,0,null,68,10,65,0,160,300,"정복","저격"],
[142,"공손도",1028,0,null,62,65,10,0,160,300,"정복","저격"],
[65,"공손범",1029,0,null,61,65,10,0,160,300,"출세","저격"],
[65,"공손속",1030,0,null,60,65,10,0,160,300,"정복","저격"],
[10,"공손연",1031,0,null,74,65,10,0,160,300,"패권","저격"],
[65,"공손월",1032,0,null,47,63,10,0,160,300,"정복","저격"],
[65,"공손찬",1033,0,null,61,10,65,0,160,300,"패권","저격"],
[43,"공융",1034,0,null,63,10,65,0,160,300,"왕좌","저격"],
[35,"공주",1035,0,null,64,10,65,0,160,300,"재간","저격"],
[83,"공지",1036,0,null,57,10,64,0,160,300,"대의","저격"],
[26,"곽가",1037,0,null,47,10,65,0,160,300,"패권","저격"],
[111,"곽도",1038,0,null,63,10,65,0,160,300,"재간","저격"],
[2,"곽사",1039,0,null,58,65,10,0,160,300,"패권","저격"],
[80,"곽유지",1040,0,null,37,10,65,0,160,300,"재간","저격"],
[67,"곽익",1041,0,null,67,10,65,0,160,300,"재간","저격"],
[67,"곽준",1042,0,null,75,10,65,0,160,300,"출세","저격"],
[27,"곽혁",1043,0,null,40,10,65,0,160,300,"안전","저격"],
[20,"곽회",1044,0,null,75,10,65,0,160,300,"정복","저격"],
[39,"관구검",1045,0,null,72,10,65,0,160,300,"대의","저격"],
[76,"관색",1046,0,null,69,10,65,0,160,300,"의협","저격"],
[76,"관우",1047,0,null,75,10,65,0,160,300,"의협","저격","나의 청룡 언월도를 과연 막아낼 수 있겠소?"],
[76,"관이",1048,0,null,48,60,10,0,160,300,"안전","저격"],
[76,"관통",1049,0,null,49,63,10,0,160,300,"대의","저격"],
[76,"관평",1050,0,null,75,10,65,0,160,300,"의협","저격"],
[7,"관해",1051,0,null,66,65,10,0,160,300,"출세","저격"],
[76,"관흥",1052,0,null,69,10,65,0,160,300,"의협","저격"],
[40,"괴량",1053,0,null,41,10,65,0,160,300,"안전","저격"],
[40,"괴월",1054,0,null,26,10,65,0,160,300,"유지","저격"],
[98,"교모",1055,0,null,59,10,61,0,160,300,"안전","저격"],
[98,"교현",1056,0,null,50,10,60,0,160,300,"재간","저격"],
[6,"구역거",1057,0,null,51,65,10,0,160,300,"안전","저격"],
[80,"극정",1058,0,null,38,10,65,0,160,300,"유지","저격"],
[46,"금선",1059,0,null,55,49,10,0,160,300,"할거","저격"],
[62,"금환삼결",1060,0,null,46,65,10,0,160,300,"출세","저격"],
[141,"기령",1061,0,null,75,65,10,0,160,300,"대의","저격"],
[122,"낙통",1062,0,null,57,10,65,0,160,300,"유지","저격"],
[124,"노숙1",1063,0,null,75,10,65,0,160,300,"왕좌","저격"],
[75,"노식",1064,0,null,75,10,65,0,160,300,"왕좌","저격"],
[59,"뇌동",1065,0,null,70,65,10,0,160,300,"출세","저격"],
[142,"뇌박",1066,0,null,54,54,10,0,160,300,"유지","저격"],
[127,"능조",1067,0,null,67,65,10,0,160,300,"재간","저격"],
[127,"능통",1068,0,null,71,65,10,0,160,300,"의협","저격"],
[64,"단경",1069,0,null,68,10,65,0,160,300,"정복","저격"],
[132,"담웅",1070,0,null,52,65,10,0,160,300,"출세","저격"],
[99,"답둔",1071,0,null,59,65,10,0,160,300,"유지","저격"],
[132,"당자",1072,0,null,59,56,10,0,160,300,"안전","저격"],
[60,"대래동주",1073,0,null,40,65,10,0,160,300,"안전","저격"],
[82,"도겸",1074,0,null,51,10,61,0,160,300,"할거","저격"],
[120,"도준",1075,0,null,64,57,10,0,160,300,"안전","저격"],
[73,"동궐",1076,0,null,66,10,65,0,160,300,"대의","저격"],
[62,"동다나",1077,0,null,51,65,10,0,160,300,"유지","저격"],
[2,"동민",1078,0,null,52,65,10,0,160,300,"안전","저격"],
[21,"동소",1079,0,null,46,10,62,0,160,300,"패권","저격"],
[127,"동습",1080,0,null,53,64,10,0,160,300,"출세","저격"],
[89,"동승",1081,0,null,75,10,65,0,160,300,"왕좌","저격"],
[78,"동윤",1082,0,null,64,10,65,0,160,300,"왕좌","저격"],
[2,"동탁",1083,0,null,75,65,10,0,160,300,"패권","저격"],
[66,"동화",1084,0,null,48,64,10,0,160,300,"대의","저격"],
[32,"두예",1085,0,null,75,10,65,0,160,300,"정복","저격"],
[7,"등무",1086,0,null,43,65,10,0,160,300,"정복","저격"],
[41,"등애",1087,0,null,75,10,65,0,160,300,"패권","저격"],
[116,"등윤",1088,0,null,34,10,65,0,160,300,"안전","저격"],
[73,"등지",1089,0,null,74,10,65,0,160,300,"할거","저격"],
[41,"등충",1090,0,null,60,65,10,0,160,300,"출세","저격"],
[54,"등현",1091,0,null,65,10,61,0,160,300,"출세","저격"],
[29,"마균",1092,0,null,33,10,65,0,160,300,"안전","저격"],
[71,"마대",1093,0,null,75,65,10,0,160,300,"대의","저격"],
[70,"마등",1094,0,null,75,65,10,0,160,300,"왕좌","저격"],
[80,"마속",1095,0,null,73,10,65,0,160,300,"패권","저격"],
[77,"마량",1096,0,null,57,10,65,0,160,300,"왕좌","저격"],
[48,"마완",1097,0,null,49,64,10,0,160,300,"안전","저격"],
[19,"마준",1098,0,null,45,63,10,0,160,300,"안전","저격"],
[71,"마철",1099,0,null,71,60,10,0,160,300,"대의","저격"],
[70,"마초",1100,0,null,75,65,10,0,160,300,"대의","저격","금마초 나가신닷!"],
[131,"마충1",1101,0,null,67,62,10,0,160,300,"재간","저격"],
[69,"마충2",1102,0,null,61,65,10,0,160,300,"출세","저격"],
[71,"마휴",1103,0,null,71,60,10,0,160,300,"대의","저격"],
[116,"만총",1104,0,null,75,10,65,0,160,300,"할거","저격"],
[51,"망아장",1105,0,null,29,64,10,0,160,300,"출세","저격"],
[44,"맹달",1106,0,null,70,10,65,0,160,300,"할거","저격"],
[60,"맹우",1107,0,null,63,65,10,0,160,300,"정복","저격"],
[60,"맹획",1108,0,null,75,65,10,0,160,300,"왕좌","저격"],
[29,"모개",1109,0,null,46,10,56,0,160,300,"대의","저격"],
[51,"목록대왕",1110,0,null,58,10,65,0,160,300,"재간","저격"],
[96,"목순",1111,0,null,17,10,65,0,160,300,"왕좌","저격"],
[43,"무안국",1112,0,null,51,65,10,0,160,300,"재간","저격"],
[28,"문빙",1113,0,null,70,65,10,0,160,300,"유지","저격"],
[38,"문앙",1114,0,null,71,65,10,0,160,300,"대의","저격"],
[102,"문추",1115,0,null,72,65,10,0,160,300,"출세","저격"],
[38,"문흠",1116,0,null,75,65,10,0,160,300,"대의","저격"],
[49,"미당대왕",1117,0,null,64,65,10,0,160,300,"유지","저격"],
[108,"미방",1118,0,null,58,65,10,0,160,300,"패권","저격"],
[77,"미축",1119,0,null,26,10,65,0,160,300,"왕좌","저격"],
[94,"반봉",1120,0,null,61,65,10,0,160,300,"출세","저격"],
[44,"반준",1121,0,null,41,10,65,0,160,300,"안전","저격"],
[65,"방덕",1122,0,null,75,10,65,0,160,300,"의협","저격"],
[73,"방통",1123,0,null,75,10,65,0,160,300,"패권","저격"],
[65,"방회",1124,0,null,25,10,59,0,160,300,"안전","저격"],
[68,"배원소",1125,0,null,45,65,10,0,160,300,"재간","저격"],
[78,"번건",1126,0,null,28,10,65,0,160,300,"대의","저격"],
[149,"번주",1127,0,null,67,65,10,0,160,300,"할거","저격"],
[72,"법정",1128,0,null,75,10,65,0,160,300,"패권","저격"],
[8,"변희",1129,0,null,65,65,10,0,160,300,"안전","저격"],
[121,"보질",1130,0,null,58,10,65,0,160,300,"유지","저격"],
[113,"복양흥",1131,0,null,58,10,65,0,160,300,"유지","저격"],
[110,"봉기",1132,0,null,68,10,65,0,160,300,"패권","저격"],
[74,"부동",1133,0,null,58,10,65,0,160,300,"대의","저격"],
[108,"부사인",1134,0,null,54,59,10,0,160,300,"출세","저격"],
[38,"부손",1135,0,null,24,10,65,0,160,300,"안전","저격"],
[74,"부첨",1136,0,null,61,65,10,0,160,300,"대의","저격"],
[66,"비시",1137,0,null,18,10,61,0,160,300,"재간","저격"],
[141,"비연",1138,0,null,66,65,10,0,160,300,"출세","저격"],
[77,"비위",1139,0,null,72,10,65,0,160,300,"대의","저격"],
[144,"사광",1140,0,null,57,10,65,0,160,300,"안전","저격"],
[71,"사마가",1141,0,null,61,65,10,0,160,300,"정복","저격"],
[20,"사마랑",1142,0,null,25,10,63,0,160,300,"대의","저격"],
[24,"사마망",1143,0,null,71,10,65,0,160,300,"정복","저격"],
[24,"사마부",1144,0,null,55,10,65,0,160,300,"대의","저격"],
[31,"사마사",1145,0,null,75,10,65,0,160,300,"정복","저격"],
[31,"사마소",1146,0,null,75,10,65,0,160,300,"정복","저격"],
[31,"사마염",1147,0,null,75,10,65,0,160,300,"패권","저격"],
[30,"사마유",1148,0,null,62,10,65,0,160,300,"왕좌","저격"],
[31,"사마의",1149,0,null,75,10,65,0,160,300,"패권","저격"],
[139,"사섭",1150,0,null,63,10,65,0,160,300,"안전","저격"],
[139,"사일",1151,0,null,59,10,65,0,160,300,"유지","저격"],
[132,"사정",1152,0,null,67,65,10,0,160,300,"안전","저격"],
[146,"사지",1153,0,null,61,10,65,0,160,300,"안전","저격"],
[144,"사휘",1154,0,null,67,65,10,0,160,300,"유지","저격"],
[35,"서막",1155,0,null,56,10,65,0,160,300,"유지","저격"],
[76,"서서",1156,0,null,75,10,65,0,160,300,"의협","저격"],
[124,"서성",1157,0,null,75,10,65,0,160,300,"대의","저격"],
[142,"서영",1158,0,null,47,63,10,0,160,300,"안전","저격"],
[23,"서질",1159,0,null,55,65,10,0,160,300,"재간","저격"],
[23,"서황",1160,0,null,75,10,65,0,160,300,"의협","저격"],
[32,"석포",1161,0,null,71,63,10,0,160,300,"정복","저격"],
[131,"설영",1162,0,null,46,10,64,0,160,300,"유지","저격"],
[128,"설종",1163,0,null,27,10,65,0,160,300,"유지","저격"],
[69,"성의",1164,0,null,45,64,10,0,160,300,"재간","저격"],
[129,"소비",1165,0,null,67,63,10,0,160,300,"대의","저격"],
[76,"손건",1166,0,null,42,10,65,0,160,300,"대의","저격"],
[125,"손견",1167,0,null,75,10,65,0,160,300,"왕좌","저격"],
[126,"손광",1168,0,null,63,10,58,0,160,300,"유지","저격"],
[125,"손권",1169,0,null,75,10,65,0,160,300,"할거","저격"],
[126,"손랑",1170,0,null,27,54,10,0,160,300,"안전","저격"],
[126,"손등",1171,0,null,52,10,65,0,160,300,"할거","저격"],
[125,"손량",1172,0,null,24,10,65,0,160,300,"할거","저격"],
[20,"손례",1173,0,null,64,10,65,0,160,300,"안전","저격"],
[124,"손소",1174,0,null,75,10,65,0,160,300,"정복","저격"],
[130,"손수",1175,0,null,67,10,59,0,160,300,"안전","저격"],
[126,"손유",1176,0,null,75,10,65,0,160,300,"정복","저격"],
[122,"손이",1177,0,null,57,62,10,0,160,300,"안전","저격"],
[126,"손정",1178,0,null,59,10,62,0,160,300,"유지","저격"],
[115,"손준",1179,0,null,59,65,10,0,160,300,"정복","저격"],
[7,"손중",1180,0,null,53,63,10,0,160,300,"안전","저격"],
[125,"손책",1181,0,null,75,10,65,0,160,300,"패권","저격","소패왕 손책이 나가신다! 길을 비켜라!"],
[115,"손침",1182,0,null,49,65,10,0,160,300,"패권","저격"],
[114,"손호",1183,0,null,20,10,65,0,160,300,"패권","저격"],
[126,"손화",1184,0,null,35,10,65,0,160,300,"왕좌","저격"],
[127,"손환",1185,0,null,75,10,65,0,160,300,"정복","저격"],
[126,"손휴",1186,0,null,63,10,64,0,160,300,"정복","저격"],
[117,"손흠",1187,0,null,66,63,10,0,160,300,"정복","저격"],
[147,"송헌",1188,0,null,42,63,10,0,160,300,"안전","저격"],
[95,"순우경",1189,0,null,72,65,10,0,160,300,"할거","저격"],
[22,"순욱1",1190,0,null,54,10,65,0,160,300,"왕좌","저격"],
[22,"순유",1191,0,null,73,10,65,0,160,300,"대의","저격"],
[29,"신비",1192,0,null,47,10,65,0,160,300,"재간","저격"],
[37,"신의",1193,0,null,55,61,10,0,160,300,"출세","저격"],
[37,"신탐",1194,0,null,56,58,10,0,160,300,"출세","저격"],
[85,"신평",1195,0,null,68,10,65,0,160,300,"왕좌","저격"],
[102,"심배",1196,0,null,75,10,65,0,160,300,"패권","저격"],
[126,"심영",1197,0,null,53,65,10,0,160,300,"재간","저격"],
[47,"아하소과",1198,0,null,53,65,10,0,160,300,"안전","저격"],
[62,"아회남",1199,0,null,50,65,10,0,160,300,"출세","저격"],
[23,"악진",1200,0,null,73,65,10,0,160,300,"대의","저격"],
[23,"악침",1201,0,null,45,52,10,0,160,300,"대의","저격"],
[63,"악환",1202,0,null,54,65,10,0,160,300,"재간","저격"],
[102,"안량",1203,0,null,73,65,10,0,160,300,"출세","저격"],
[14,"양백",1204,0,null,55,54,10,0,160,300,"안전","저격"],
[92,"양봉1",1205,0,null,57,64,10,0,160,300,"유지","저격"],
[91,"양봉2",1206,0,null,62,65,10,0,160,300,"정복","저격"],
[13,"양송",1207,0,null,15,35,10,0,160,300,"안전","저격"],
[43,"양수",1208,0,null,18,10,65,0,160,300,"재간","저격"],
[61,"양의",1209,0,null,67,10,65,0,160,300,"유지","저격"],
[141,"양조1",1210,0,null,68,10,60,0,160,300,"출세","저격"],
[9,"양추1",1211,0,null,51,65,10,0,160,300,"정복","저격"],
[31,"양호",1212,0,null,75,10,65,0,160,300,"패권","저격"],
[53,"양회",1213,0,null,60,65,10,0,160,300,"출세","저격"],
[141,"양흥",1214,0,null,52,65,10,0,160,300,"안전","저격"],
[6,"어부라",1215,0,null,75,65,10,0,160,300,"정복","저격"],
[64,"엄강",1216,0,null,57,65,10,0,160,300,"재간","저격"],
[10,"엄백호",1217,0,null,48,65,10,0,160,300,"할거","저격"],
[10,"엄여",1218,0,null,35,65,10,0,160,300,"할거","저격"],
[69,"엄안",1219,0,null,72,10,65,0,160,300,"왕좌","저격"],
[7,"엄정",1220,0,null,31,65,10,0,160,300,"출세","저격"],
[121,"엄준",1221,0,null,44,10,65,0,160,300,"재간","저격"],
[71,"여개",1222,0,null,51,10,65,0,160,300,"유지","저격"],
[29,"여건",1223,0,null,44,65,10,0,160,300,"출세","저격"],
[107,"여광",1224,0,null,60,65,10,0,160,300,"유지","저격"],
[124,"여몽",1225,0,null,75,10,65,0,160,300,"패권","저격"],
[123,"여범",1226,0,null,43,10,65,0,160,300,"할거","저격"],
[107,"여상",1227,0,null,62,65,10,0,160,300,"유지","저격"],
[105,"여위황",1228,0,null,42,62,10,0,160,300,"정복","저격"],
[145,"여포",1229,0,null,75,65,10,0,160,300,"패권","저격","다 죽여버리겠다! 으하하."],
[50,"염우",1230,0,null,58,51,10,0,160,300,"출세","저격"],
[40,"염유",1231,0,null,59,65,10,0,160,300,"출세","저격"],
[18,"염포",1232,0,null,33,10,65,0,160,300,"유지","저격"],
[40,"예형",1233,0,null,75,10,65,0,160,300,"은둔","저격"],
[133,"오강",1234,0,null,47,10,61,0,160,300,"안전","저격"],
[59,"오란",1235,0,null,67,65,10,0,160,300,"재간","저격"],
[72,"오반",1236,0,null,70,65,10,0,160,300,"재간","저격"],
[128,"오언",1237,0,null,71,60,10,0,160,300,"재간","저격"],
[126,"오연",1238,0,null,36,65,10,0,160,300,"정복","저격"],
[69,"오의",1239,0,null,75,10,65,0,160,300,"유지","저격"],
[19,"오질",1240,0,null,43,10,65,0,160,300,"출세","저격"],
[51,"올돌골",1241,0,null,75,65,10,0,160,300,"출세","저격"],
[52,"옹개",1242,0,null,58,65,10,0,160,300,"안전","저격"],
[20,"왕경",1243,0,null,55,10,65,0,160,300,"재간","저격"],
[97,"왕광",1244,0,null,72,65,10,0,160,300,"유지","저격"],
[30,"왕기1",1245,0,null,75,10,65,0,160,300,"유지","저격"],
[34,"왕랑",1246,0,null,49,10,51,0,160,300,"할거","저격"],
[57,"왕루",1247,0,null,40,10,65,0,160,300,"유지","저격"],
[76,"왕보",1248,0,null,47,10,65,0,160,300,"대의","저격"],
[86,"왕수",1249,0,null,34,10,65,0,160,300,"재간","저격"],
[26,"왕쌍",1250,0,null,58,65,10,0,160,300,"정복","저격"],
[46,"왕위",1251,0,null,59,10,65,0,160,300,"안전","저격"],
[92,"왕윤",1252,0,null,16,10,65,0,160,300,"왕좌","저격"],
[40,"왕융",1253,0,null,62,10,65,0,160,300,"재간","저격"],
[32,"왕준",1254,0,null,75,10,65,0,160,300,"대의","저격"],
[30,"왕찬",1255,0,null,28,10,65,0,160,300,"안전","저격"],
[33,"왕창",1256,0,null,74,57,10,0,160,300,"정복","저격"],
[69,"왕평",1257,0,null,75,10,65,0,160,300,"재간","저격"],
[71,"왕항",1258,0,null,51,10,60,0,160,300,"대의","저격"],
[33,"왕혼",1259,0,null,69,10,59,0,160,300,"정복","저격"],
[71,"요립",1260,0,null,65,10,65,0,160,300,"출세","저격"],
[74,"요화",1261,0,null,67,10,60,0,160,300,"의협","저격"],
[22,"우금1",1262,0,null,75,10,65,0,160,300,"정복","저격"],
[27,"우금2",1263,0,null,63,65,10,0,160,300,"대의","저격"],
[122,"우번",1264,0,null,23,10,65,0,160,300,"유지","저격"],
[126,"우전",1265,0,null,63,55,10,0,160,300,"안전","저격"],
[86,"원담",1266,0,null,67,59,10,0,160,300,"왕좌","저격"],
[101,"원상",1267,0,null,54,10,65,0,160,300,"패권","저격"],
[101,"원소",1268,0,null,75,10,65,0,160,300,"패권","저격"],
[140,"원술",1269,0,null,75,10,65,0,160,300,"패권","저격"],
[140,"원윤",1270,0,null,41,10,60,0,160,300,"패권","저격"],
[101,"원희",1271,0,null,69,10,65,0,160,300,"할거","저격"],
[131,"위소",1272,0,null,39,10,65,0,160,300,"재간","저격"],
[147,"위속",1273,0,null,57,59,10,0,160,300,"안전","저격"],
[81,"위연",1274,0,null,75,65,10,0,160,300,"패권","저격"],
[96,"위유",1275,0,null,53,10,65,0,160,300,"재간","저격"],
[76,"유기",1276,0,null,57,10,65,0,160,300,"왕좌","저격"],
[36,"유대",1277,0,null,61,10,62,0,160,300,"재간","저격"],
[134,"유도",1278,0,null,35,10,65,0,160,300,"재간","저격"],
[46,"유벽",1279,0,null,63,65,10,0,160,300,"출세","저격"],
[75,"유봉",1280,0,null,60,65,10,0,160,300,"출세","저격"],
[75,"유비",1281,0,null,75,10,65,0,160,300,"왕좌","저격"],
[75,"유선1",1282,0,null,24,10,21,0,160,300,"대의","저격"],
[55,"유순",1283,0,null,67,61,10,0,160,300,"출세","저격"],
[75,"유심",1284,0,null,63,10,65,0,160,300,"왕좌","저격"],
[129,"유약",1285,0,null,67,63,10,0,160,300,"유지","저격"],
[55,"유언",1286,0,null,60,10,65,0,160,300,"할거","저격"],
[27,"유엽",1287,0,null,40,10,65,0,160,300,"유지","저격"],
[11,"유요",1288,0,null,23,10,48,0,160,300,"안전","저격"],
[96,"유우",1289,0,null,68,10,65,0,160,300,"왕좌","저격"],
[55,"유장",1290,0,null,38,10,63,0,160,300,"할거","저격"],
[45,"유종",1291,0,null,22,10,61,0,160,300,"할거","저격"],
[56,"유파",1292,0,null,47,10,65,0,160,300,"대의","저격"],
[45,"유표1",1293,0,null,71,10,65,0,160,300,"할거","저격"],
[27,"유표2",1294,0,null,75,10,65,0,160,300,"안전","저격"],
[134,"유현",1295,0,null,32,56,10,0,160,300,"안전","저격"],
[122,"육개",1296,0,null,66,10,65,0,160,300,"재간","저격"],
[122,"육손",1297,0,null,75,10,65,0,160,300,"왕좌","저격"],
[121,"육적",1298,0,null,44,10,65,0,160,300,"안전","저격"],
[122,"육항",1299,0,null,75,10,65,0,160,300,"왕좌","저격"],
[38,"윤대목",1300,0,null,62,10,65,0,160,300,"재간","저격"],
[80,"윤묵",1301,0,null,19,10,65,0,160,300,"대의","저격"],
[72,"윤상",1302,0,null,30,10,42,0,160,300,"대의","저격"],
[136,"윤직",1303,0,null,44,10,63,0,160,300,"재간","저격"],
[2,"이각",1304,0,null,56,65,10,0,160,300,"패권","저격"],
[146,"이숙",1305,0,null,27,10,65,0,160,300,"재간","저격"],
[71,"이엄",1306,0,null,75,10,65,0,160,300,"패권","저격"],
[2,"이유",1307,0,null,64,10,65,0,160,300,"패권","저격"],
[132,"이이",1308,0,null,55,65,10,0,160,300,"정복","저격"],
[77,"이적",1309,0,null,55,10,65,0,160,300,"할거","저격"],
[22,"이전",1310,0,null,75,10,65,0,160,300,"왕좌","저격"],
[71,"이풍1",1311,0,null,59,10,62,0,160,300,"재간","저격"],
[66,"이회",1312,0,null,67,10,65,0,160,300,"유지","저격"],
[114,"잠혼",1313,0,null,15,10,44,0,160,300,"할거","저격"],
[7,"장각",1314,0,null,75,10,65,0,160,300,"패권","저격"],
[34,"장간",1315,0,null,19,10,65,0,160,300,"재간","저격"],
[7,"장개",1316,0,null,48,65,10,0,160,300,"안전","저격"],
[122,"장굉",1317,0,null,25,10,65,0,160,300,"왕좌","저격"],
[7,"장량",1318,0,null,68,10,65,0,160,300,"정복","저격"],
[15,"장로",1319,0,null,75,10,65,0,160,300,"유지","저격"],
[23,"장료",1320,0,null,75,10,65,0,160,300,"의협","저격"],
[7,"장보",1321,0,null,75,10,65,0,160,300,"패권","저격"],
[76,"장비",1322,0,null,75,65,10,0,160,300,"의협","저격","어쭈. 해보자 이거냐?"],
[62,"장서",1323,0,null,44,48,10,0,160,300,"출세","저격"],
[120,"장소1",1324,0,null,42,10,65,0,160,300,"안전","저격"],
[78,"장소2",1325,0,null,51,10,65,0,160,300,"재간","저격"],
[72,"장송",1326,0,null,49,10,65,0,160,300,"할거","저격"],
[148,"장수",1327,0,null,71,10,65,0,160,300,"할거","저격"],
[145,"장양1",1328,0,null,62,10,65,0,160,300,"출세","저격"],
[8,"장연",1329,0,null,75,65,10,0,160,300,"안전","저격"],
[11,"장영",1330,0,null,55,65,10,0,160,300,"재간","저격"],
[118,"장온",1331,0,null,21,10,65,0,160,300,"할거","저격"],
[78,"장완",1332,0,null,70,10,65,0,160,300,"할거","저격"],
[15,"장위",1333,0,null,65,65,10,0,160,300,"대의","저격"],
[36,"장윤",1334,0,null,67,10,60,0,160,300,"정복","저격"],
[104,"장의거",1335,0,null,68,59,10,0,160,300,"대의","저격"],
[68,"장익",1336,0,null,75,65,10,0,160,300,"유지","저격"],
[56,"장임",1337,0,null,75,10,65,0,160,300,"대의","저격"],
[148,"장제1",1338,0,null,70,65,10,0,160,300,"할거","저격"],
[32,"장제2",1339,0,null,30,10,65,0,160,300,"유지","저격"],
[126,"장제3",1340,0,null,74,10,61,0,160,300,"할거","저격"],
[17,"장패",1341,0,null,44,65,10,0,160,300,"할거","저격"],
[76,"장포1",1342,0,null,69,65,10,0,160,300,"재간","저격"],
[113,"장포2",1343,0,null,63,65,10,0,160,300,"유지","저격"],
[27,"장합",1344,0,null,75,65,10,0,160,300,"출세","저격"],
[23,"장호",1345,0,null,56,62,10,0,160,300,"정복","저격"],
[31,"장화",1346,0,null,49,10,65,0,160,300,"유지","저격"],
[48,"장횡",1347,0,null,53,65,10,0,160,300,"재간","저격"],
[141,"장훈",1348,0,null,67,61,10,0,160,300,"안전","저격"],
[120,"장휴",1349,0,null,42,10,65,0,160,300,"재간","저격"],
[126,"장흠",1350,0,null,64,10,65,0,160,300,"대의","저격"],
[96,"저수",1351,0,null,75,10,65,0,160,300,"할거","저격"],
[130,"전단",1352,0,null,64,65,10,0,160,300,"출세","저격"],
[42,"전속",1353,0,null,66,57,10,0,160,300,"안전","저격"],
[26,"전위1",1354,0,null,61,65,10,0,160,300,"의협","저격"],
[130,"전위2",1355,0,null,74,65,10,0,160,300,"출세","저격"],
[128,"전종",1356,0,null,75,10,65,0,160,300,"패권","저격"],
[42,"전주",1357,0,null,69,65,10,0,160,300,"의협","저격"],
[96,"전풍",1358,0,null,75,10,65,0,160,300,"왕좌","저격"],
[24,"정무",1359,0,null,54,10,65,0,160,300,"출세","저격"],
[119,"정병",1360,0,null,22,10,65,0,160,300,"유지","저격"],
[126,"정보",1361,0,null,75,10,65,0,160,300,"패권","저격"],
[123,"정봉1",1362,0,null,70,65,10,0,160,300,"패권","저격"],
[24,"정욱",1363,0,null,75,10,65,0,160,300,"패권","저격"],
[88,"정원",1364,0,null,64,65,10,0,160,300,"왕좌","저격"],
[7,"정원지",1365,0,null,41,65,10,0,160,300,"출세","저격"],
[69,"정은",1366,0,null,53,62,10,0,160,300,"재간","저격"],
[121,"제갈각",1367,0,null,61,10,65,0,160,300,"왕좌","저격"],
[76,"제갈균",1368,0,null,59,10,65,0,160,300,"안전","저격"],
[121,"제갈근",1369,0,null,60,10,65,0,160,300,"왕좌","저격"],
[76,"제갈량",1370,0,null,75,10,65,0,160,300,"왕좌","저격","슬슬 나의 지모를 발휘해 보겠습니다..."],
[76,"제갈상",1371,0,null,52,10,65,0,160,300,"대의","저격"],
[135,"제갈정",1372,0,null,56,57,10,0,160,300,"안전","저격"],
[76,"제갈첨",1373,0,null,73,10,65,0,160,300,"대의","저격"],
[135,"제갈탄",1374,0,null,75,10,65,0,160,300,"패권","저격"],
[76,"조광",1375,0,null,65,65,10,0,160,300,"재간","저격"],
[74,"조루",1376,0,null,49,10,60,0,160,300,"대의","저격"],
[24,"조모",1377,0,null,53,32,10,0,160,300,"할거","저격"],
[127,"조무",1378,0,null,71,10,65,0,160,300,"의협","저격"],
[26,"조방",1379,0,null,50,10,31,0,160,300,"정복","저격"],
[83,"조범",1380,0,null,58,10,63,0,160,300,"유지","저격"],
[26,"조비",1381,0,null,72,10,65,0,160,300,"패권","저격"],
[19,"조상",1382,0,null,68,62,10,0,160,300,"패권","저격"],
[147,"조성",1383,0,null,44,65,10,0,160,300,"안전","저격"],
[26,"조순",1384,0,null,66,10,65,0,160,300,"정복","저격"],
[25,"조식",1385,0,null,19,10,65,0,160,300,"왕좌","저격"],
[25,"조앙",1386,0,null,44,65,10,0,160,300,"왕좌","저격"],
[25,"조예",1387,0,null,57,10,65,0,160,300,"정복","저격"],
[26,"조우",1388,0,null,67,10,65,0,160,300,"대의","저격"],
[76,"조운",1389,0,null,75,10,65,0,160,300,"왕좌","저격","창술의 달인 상산 조자룡 여기 있소!"],
[25,"조웅",1390,0,null,59,10,44,0,160,300,"안전","저격"],
[26,"조인",1391,0,null,74,65,10,0,160,300,"패권","저격"],
[25,"조조",1392,0,null,75,10,65,0,160,300,"패권","저격"],
[26,"조진",1393,0,null,75,10,65,0,160,300,"정복","저격"],
[25,"조창",1394,0,null,75,65,10,0,160,300,"정복","저격"],
[76,"조통",1395,0,null,65,64,10,0,160,300,"재간","저격"],
[84,"조표",1396,0,null,34,65,10,0,160,300,"안전","저격"],
[7,"조홍1",1397,0,null,52,65,10,0,160,300,"유지","저격"],
[24,"조홍2",1398,0,null,72,65,10,0,160,300,"패권","저격"],
[26,"조환",1399,0,null,34,10,42,0,160,300,"정복","저격"],
[19,"조훈",1400,0,null,67,63,10,0,160,300,"출세","저격"],
[26,"조휴",1401,0,null,75,10,65,0,160,300,"패권","저격"],
[19,"조희",1402,0,null,64,10,65,0,160,300,"대의","저격"],
[22,"종요",1403,0,null,16,10,65,0,160,300,"유지","저격"],
[20,"종회",1404,0,null,75,10,65,0,160,300,"패권","저격"],
[128,"주거",1405,0,null,73,10,65,0,160,300,"유지","저격"],
[118,"주방",1406,0,null,56,10,65,0,160,300,"할거","저격"],
[126,"주연",1407,0,null,73,65,10,0,160,300,"할거","저격"],
[126,"주유",1408,0,null,75,10,65,0,160,300,"패권","저격"],
[128,"주이",1409,0,null,61,10,61,0,160,300,"안전","저격"],
[88,"주준",1410,0,null,75,10,65,0,160,300,"왕좌","저격"],
[32,"주지",1411,0,null,52,65,10,0,160,300,"안전","저격"],
[76,"주창",1412,0,null,42,65,10,0,160,300,"의협","저격"],
[126,"주치",1413,0,null,58,10,56,0,160,300,"안전","저격"],
[41,"주태1",1414,0,null,62,10,61,0,160,300,"안전","저격"],
[126,"주태2",1415,0,null,74,65,10,0,160,300,"정복","저격"],
[128,"주환",1416,0,null,75,10,65,0,160,300,"정복","저격"],
[29,"진건",1417,0,null,62,65,10,0,160,300,"정복","저격"],
[29,"진교",1418,0,null,21,10,65,0,160,300,"유지","저격"],
[28,"진군",1419,0,null,60,10,65,0,160,300,"대의","저격"],
[143,"진궁",1420,0,null,75,10,65,0,160,300,"할거","저격"],
[79,"진규",1421,0,null,22,10,65,0,160,300,"할거","저격"],
[72,"진도",1422,0,null,71,10,65,0,160,300,"대의","저격"],
[79,"진등",1423,0,null,64,10,65,0,160,300,"할거","저격"],
[37,"진림",1424,0,null,50,10,65,0,160,300,"재간","저격"],
[124,"진무",1425,0,null,62,65,10,0,160,300,"재간","저격"],
[66,"진복",1426,0,null,36,10,65,0,160,300,"재간","저격"],
[50,"진수",1427,0,null,25,10,65,0,160,300,"대의","저격"],
[81,"진식",1428,0,null,47,65,10,0,160,300,"출세","저격"],
[79,"진진",1429,0,null,58,10,64,0,160,300,"재간","저격"],
[28,"진태",1430,0,null,75,10,65,0,160,300,"대의","저격"],
[11,"진횡",1431,0,null,38,58,10,0,160,300,"출세","저격"],
[21,"차주",1432,0,null,55,65,10,0,160,300,"안전","저격"],
[11,"착융",1433,0,null,62,59,10,0,160,300,"출세","저격"],
[36,"채모",1434,0,null,75,10,65,0,160,300,"정복","저격"],
[36,"채중",1435,0,null,58,10,55,0,160,300,"출세","저격"],
[36,"채화",1436,0,null,56,10,49,0,160,300,"안전","저격"],
[66,"초주",1437,0,null,22,10,65,0,160,300,"대의","저격"],
[20,"최염",1438,0,null,43,10,65,0,160,300,"대의","저격"],
[60,"축융",1439,0,null,59,65,10,0,160,300,"정복","저격"],
[60,"타사대왕",1440,0,null,61,10,65,0,160,300,"출세","저격"],
[124,"태사자",1441,0,null,71,10,65,0,160,300,"대의","저격"],
[124,"태사향",1442,0,null,51,65,10,0,160,300,"재간","저격"],
[12,"포륭",1443,0,null,53,65,10,0,160,300,"안전","저격"],
[74,"풍습",1444,0,null,36,64,10,0,160,300,"재간","저격"],
[7,"하의",1445,0,null,49,65,10,0,160,300,"출세","저격"],
[121,"하제",1446,0,null,74,65,10,0,160,300,"재간","저격"],
[90,"하진",1447,0,null,49,65,10,0,160,300,"왕좌","저격"],
[24,"하후덕",1448,0,null,67,64,10,0,160,300,"출세","저격"],
[26,"하후돈",1449,0,null,75,10,65,0,160,300,"의협","저격","다 나오거라! 상대해 주마!"],
[19,"하후무",1450,0,null,38,10,37,0,160,300,"안전","저격"],
[24,"하후상",1451,0,null,67,10,65,0,160,300,"출세","저격"],
[26,"하후연",1452,0,null,75,65,10,0,160,300,"패권","저격","궁술로 날 당해낼 자가 있을까? 후후."],
[26,"하후위",1453,0,null,73,10,65,0,160,300,"정복","저격"],
[26,"하후은",1454,0,null,49,51,10,0,160,300,"안전","저격"],
[23,"하후패",1455,0,null,75,10,65,0,160,300,"대의","저격"],
[20,"하후현",1456,0,null,57,10,65,0,160,300,"유지","저격"],
[26,"하후혜",1457,0,null,75,10,65,0,160,300,"정복","저격"],
[26,"하후화",1458,0,null,75,10,65,0,160,300,"정복","저격"],
[22,"학소",1459,0,null,75,10,65,0,160,300,"대의","저격"],
[126,"한당",1460,0,null,68,65,10,0,160,300,"할거","저격"],
[93,"한복",1461,0,null,66,59,10,0,160,300,"안전","저격"],
[8,"한섬",1462,0,null,39,62,10,0,160,300,"출세","저격"],
[48,"한수",1463,0,null,66,10,65,0,160,300,"대의","저격"],
[40,"한숭",1464,0,null,21,10,65,0,160,300,"재간","저격"],
[7,"한충",1465,0,null,41,65,10,0,160,300,"안전","저격"],
[9,"한현",1466,0,null,43,61,10,0,160,300,"유지","저격"],
[27,"한호",1467,0,null,60,65,10,0,160,300,"유지","저격"],
[79,"향랑",1468,0,null,51,10,65,0,160,300,"대의","저격"],
[79,"향총",1469,0,null,75,10,65,0,160,300,"왕좌","저격"],
[139,"허공",1470,0,null,65,63,10,0,160,300,"유지","저격"],
[21,"허유",1471,0,null,47,10,57,0,160,300,"재간","저격"],
[23,"허의",1472,0,null,31,65,10,0,160,300,"출세","저격"],
[26,"허저",1473,0,null,57,65,10,0,160,300,"정복","저격"],
[87,"허정",1474,0,null,18,10,65,0,160,300,"재간","저격"],
[12,"형도영",1475,0,null,49,65,10,0,160,300,"출세","저격"],
[148,"호거아",1476,0,null,35,65,10,0,160,300,"안전","저격"],
[76,"호반",1477,0,null,61,58,10,0,160,300,"재간","저격"],
[20,"호분",1478,0,null,71,10,61,0,160,300,"할거","저격"],
[27,"호주천",1479,0,null,75,10,65,0,160,300,"정복","저격"],
[20,"호준",1480,0,null,67,60,10,0,160,300,"재간","저격"],
[2,"화웅",1481,0,null,68,65,10,0,160,300,"출세","저격"],
[131,"화핵",1482,0,null,37,10,65,0,160,300,"안전","저격"],
[10,"화흠",1483,0,null,18,10,65,0,160,300,"출세","저격"],
[21,"환범",1484,0,null,20,10,65,0,160,300,"유지","저격"],
[127,"황개",1485,0,null,75,10,65,0,160,300,"왕좌","저격"],
[56,"황권",1486,0,null,75,10,65,0,160,300,"대의","저격"],
[41,"황란",1487,0,null,29,65,10,0,160,300,"재간","저격"],
[88,"황보숭",1488,0,null,75,10,65,0,160,300,"왕좌","저격"],
[72,"황충",1489,0,null,75,10,65,0,160,300,"왕좌","저격"],
[50,"황호",1490,0,null,15,10,48,0,160,300,"안전","저격"],
[147,"후성",1491,0,null,56,62,10,0,160,300,"정복","저격"]
]
}
+6 -6
View File
@@ -60,7 +60,7 @@ class GameUnitConst extends GameUnitConstBase
[
40, self::T_SIEGE, '정란',
100, 100, 6, 0, 0, 7, 5,
100, 100, 6, 0, 0, 7, 3,
0, null, null, 0,
[self::T_CASTLE=>1.8],
[],
@@ -68,7 +68,7 @@ class GameUnitConst extends GameUnitConstBase
],
[
41, self::T_SIEGE, '충차',
150, 100, 6, 0, 0, 10, 5,
150, 100, 6, 0, 0, 10, 3,
1000, null, null, 3,
[self::T_CASTLE=>2.4],
[],
@@ -76,16 +76,16 @@ class GameUnitConst extends GameUnitConstBase
],
[
42, self::T_SIEGE, '벽력거',
200, 100, 6, 0, 0, 20, 5,
3000, null, null, 0,
200, 100, 6, 0, 0, 20, 4,
3000, ['업'], null, 0,
[self::T_CASTLE=>1.8],
[],
['상대에게 돌덩이를 날립니다.']
],
[
43, self::T_SIEGE, '목우',
100, 250, 6, 0, 0, 15, 5,
3000, null, null, 0,
50, 200, 5, 0, 0, 15, 3,
3000, ['성도'], null, 0,
[],
[],
['상대를 저지하는 특수병기입니다.']
+3 -1
View File
@@ -438,6 +438,7 @@ ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS `ng_hall` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`server_id` CHAR(20) NOT NULL,
`season` INT(11) NOT NULL,
`scenario` INT(11) NOT NULL,
`general_no` INT(11) NOT NULL,
`type` INT(11) NOT NULL,
@@ -448,7 +449,7 @@ CREATE TABLE IF NOT EXISTS `ng_hall` (
UNIQUE INDEX `server_general` (`server_id`, `type`, `general_no`),
UNIQUE INDEX `owner` (`owner`, `server_id`, `type`),
INDEX `server_show` (`server_id`, `type`, `value`),
INDEX `scenario` (`scenario`, `type`, `value`)
INDEX `scenario` (`season`, `scenario`, `type`, `value`)
)
ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPRESSED;
@@ -463,6 +464,7 @@ CREATE TABLE IF NOT EXISTS `ng_games` (
`date` DATETIME NOT NULL,
`winner_nation` INT(11) NULL DEFAULT NULL,
`map` VARCHAR(50) NULL DEFAULT NULL,
`season` INT(11) NOT NULL,
`scenario` INT(11) NOT NULL,
`scenario_name` TEXT NOT NULL,
`env` TEXT NOT NULL COMMENT 'json',
+6 -5
View File
@@ -1,5 +1,6 @@
<span class="obj_tooltip" data-toggle="tooltip" data-placement="top"><?=$text??''?>
<span class="tooltiptext">
<?=$info??''?>
</span>
</span>
<span class="obj_tooltip" data-toggle="tooltip" data-placement="top"
><span <?=isset($style)?"style=\"$style\"":''?>><?=$text??''?></span
><span class="tooltiptext"
><?=$info??''
?></span
></span>
-65
View File
@@ -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);
+1
View File
@@ -32,6 +32,7 @@ $acl = $session->acl;
<!-- 액션 -->
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
<?=WebUtil::printJS('../e_lib/moment.min.js')?>
<?=WebUtil::printJS('../js/common.js')?>
<?=WebUtil::printJS('../js/func.js')?>
<?=WebUtil::printJS('../js/entrance.js')?>
+1 -1
View File
@@ -76,7 +76,7 @@ foreach (AppConf::getList() as $setting) {
'korName' => $serverKorName,
'color' => $serverColor,
'isRoot' => $serverDir == $rootServer,
'lastGitPath' => ($serverGitPath[$serverDir][0])??'origin/master'
'lastGitPath' => ($serverGitPath[$serverDir][0])??($serverDir == $rootServer?'devel':'origin/devel')
];
$server[] = $state;
}
+1 -1
View File
@@ -196,7 +196,7 @@ function postOAuthResult(result){
</div>
</div>
<div id="bottom_box">
<div class="container"><a href="terms.2.html">개인정보처리방침</a> &amp; <a href="terms.1.html">이용약관</a><br>© 2018 HideD
<div class="container"><a href="terms.2.html">개인정보처리방침</a> &amp; <a href="terms.1.html">이용약관</a><br>© 2019 HideD
<br>크롬과 파이어폭스에 최적화되어있습니다.</div></div>
</div>
+58 -6
View File
@@ -58,12 +58,13 @@ if(!$allowUpdate){
]);
}
$src_target = $storage->$server;
if($src_target){
$src_target = $src_target[0];
}
if(!$allowFullUpdate || !$target){
$target = $storage->$server;
if($target){
$target = $target[0];
}
$target = $src_target;
}
else{
$target = $request['target'];
@@ -114,6 +115,26 @@ if(!file_exists($server)){
if($server == $baseServerName){
exec("git fetch -q 2>&1", $output);
if($output){
Json::die([
'result'=>false,
'reason'=>'git pull 작업 : '.join(', ', $output)
]);
}
if($target != $src_target){
$command = sprintf('git checkout %s -q 2>&1', $target);
exec($command, $output);
if($output){
Json::die([
'result'=>false,
'reason'=>join(', ', $output)
]);
}
}
exec("git pull -q 2>&1", $output);
if($output && $output[0] != 'Already up-to-date.'){
Json::die([
@@ -129,13 +150,44 @@ if($server == $baseServerName){
'verionGit'=>$version
], true
);
if(ServConfig::$imageRequestKey){
try {
$imagePullPath = ServConfig::getImagePullURI();
$pullResult = @file_get_contents($imagePullPath);
if($pullResult === false){
throw new \ErrorException('Invalid URI');
}
$pullResult = Json::decode($pullResult);
if($pullResult['result']){
$imgResult = true;
$imgDetail = $pullResult['version'];
}
else{
$imgResult = false;
$imgDetail = $pullResult['reason'];
}
}
catch(\Exception $e){
$imgResult = false;
$imgDetail = $e->getMessage();
}
}
else{
$imgResult = true;
$imgDetail = 'No key';
}
$storage->$server = [null, $version];
$storage->$server = [$target, $version];
Json::die([
'server'=>$server,
'result'=>true,
'version'=>$version
'version'=>$version,
'imgResult'=>$imgResult,
'imgDetail'=>$imgDetail,
]);
}
+15 -13
View File
@@ -38,22 +38,20 @@ function serverUpdate(caller){
return;
}
if(isRoot){
if(!confirm('서버 라이브러리, 루트 서버에 대해 git pull을 실행합니다.')){
return;
}
}
else if(!allowFullUpdate){
if (!confirm('다음 git tree-ish 주소로 업데이트를 시도합니다 : ' + target)) {
return;
}
}
else {
if(allowFullUpdate){
target = prompt('가져올 git tree-ish 명을 입력해주세요.', target)
if(!target){
return;
}
}
else if(isRoot){
if(!confirm('서버 라이브러리, 루트 서버에 대해 git pull을 실행합니다.')){
return;
}
}
else if (!confirm('다음 git tree-ish 주소로 업데이트를 시도합니다 : ' + target)) {
return;
}
$.ajax({
@@ -66,7 +64,11 @@ function serverUpdate(caller){
}
}).then(function(response) {
if(response.result) {
alert('{0} 서버가 {1} 버전으로 업데이트 되었습니다.'.format(response.server, response.version));
var aux = '';
if(isRoot){
aux = ' (이미지 서버 갱신:{0}, {1})'.format(response.imgResult, response.imgDetail);
}
alert('{0} 서버가 {1} 버전으로 업데이트 되었습니다.{2}'.format(response.server, response.version, aux));
location.reload();
} else {
alert(response.reason);
+34 -8
View File
@@ -12,7 +12,17 @@ var serverListTemplate = "\
var serverTextInfo = "\
<td>\
서기 <%year%> <%month%> (<span style='color:orange;'><%scenario%></span>)<br>\
유저 : <%userCnt%> / <%maxUserCnt%> <span style='color:cyan;'>NPC : <%npcCnt%></span> (<span style='color:limegreen;'><%turnTerm%> </span>)\
유저 : <%userCnt%> / <%maxUserCnt%> <span style='color:cyan;'>NPC : <%npcCnt%></span> (<span style='color:limegreen;'><%turnTerm%> </span>)<br>\
(상성 설정:<%fictionMode%>), (기타 설정:<%otherTextInfo%>)\
</td>\
";
var serverProvisionalInfo = "\
<td>\
- 오픈 일시 : <%opentime%> -<br>\
서기 <%year%> <%month%> (<span style='color:orange;'><%scenario%></span>)<br>\
유저 : <%userCnt%> / <%maxUserCnt%> <span style='color:cyan;'>NPC : <%npcCnt%></span> (<span style='color:limegreen;'><%turnTerm%> </span>)<br>\
(상성 설정:<%fictionMode%>), (기타 설정:<%otherTextInfo%>)\
</td>\
";
@@ -46,9 +56,11 @@ var serverLoginTemplate = "\
var serverReservedTemplate = "\
<td colspan='4' class='server_reserved'>\
- 오픈 일시 : <%openDatetime%> - <br>\
<%openDatetime==starttime?'':'- 가오픈 일시 : '+openDatetime+ '- <br>'%>\
- 오픈 일시 : <%starttime%> - <br>\
<span style='color:orange;'><%scenarioName%></span> <span style='color:limegreen;'><%turnterm%> </span><br>\
(상성 설정:<%fictionMode%>), (빙의 여부:<%npcMode%>), (최대 스탯:<%gameConf.defaultStatTotal%>), (기타 설정:<%otherTextInfo%>)</td>\
(상성 설정:<%fictionMode%>), (빙의 여부:<%npcMode%>), (최대 스탯:<%gameConf.defaultStatTotal%>), (기타 설정:<%otherTextInfo%>)\
</td>\
";
$(function(){
@@ -70,6 +82,7 @@ function Entrance_UpdateServer() {
function Entrance_drawServerList(serverInfos){
var $serverList = $('#server_list');
var now = moment().format('YYYY-MM-DD HH:mm:ss');
$.each(serverInfos, function(idx, serverInfo){
var $serverHtml = $(TemplateEngine(serverListTemplate, serverInfo));
$serverList.append($serverHtml);
@@ -86,6 +99,7 @@ function Entrance_drawServerList(serverInfos){
$serverHtml.append(
TemplateEngine(serverReservedTemplate, result.reserved)
);
initTooltip($serverHtml);
return;
}
@@ -103,14 +117,26 @@ function Entrance_drawServerList(serverInfos){
$serverHtml.find('.n_country').html('§천하통일§');
$serverHtml.find('.server_date').html('{0} <br>~ {1}'.format(game.starttime, game.turntime));
}
else{
else if(game.opentime <= now){
$serverHtml.find('.n_country').html('<{0}국 경쟁중>'.format(game.nationCnt));
$serverHtml.find('.server_date').html('{0} ~'.format(game.starttime));
}
else{
$serverHtml.find('.n_country').html('-가오픈 중-');
$serverHtml.find('.server_date').html('{0} ~'.format(game.starttime));
}
$serverHtml.append(
TemplateEngine(serverTextInfo, game)
);
if(game.opentime <= now){
$serverHtml.append(
TemplateEngine(serverTextInfo, game)
);
}
else{
$serverHtml.append(
TemplateEngine(serverProvisionalInfo, game)
);
}
if(result.me && result.me.name){
var me = result.me;
@@ -124,7 +150,7 @@ function Entrance_drawServerList(serverInfos){
TemplateEngine(serverFullTemplate, {})
);
}
else if(game.npcMode == 1){
else if(game.npcMode == '가능'){
$serverHtml.append(
TemplateEngine(serverCreateAndSelectTemplate, {serverPath:serverPath})
).addClass('server_create_and_select');
+19 -2
View File
@@ -47,6 +47,16 @@ $(document).ready( function () {
$('#serv_host').val(
[location.protocol, '//', location.host, parentPathname].join('')
);
$('#btn_random_generate_key').click(function(){
var token = '';
while(token.length < 24){
token += (Math.random() + 1).toString(36).substring(7);
}
token = token.substr(0,24);
$('#image_request_key').val(token);
});
$('#db_form').validate({
rules:{
db_host:"required",
@@ -56,7 +66,11 @@ $(document).ready( function () {
db_name:"required",
serv_host:"required",
shared_icon_path:"required",
game_image_path:"required"
game_image_path:"required",
image_request_key:{
required:false,
minlength:16
}
},
errorElement: "div",
errorPlacement: function ( error, element ) {
@@ -94,7 +108,10 @@ $(document).ready( function () {
db_name:$('#db_name').val(),
serv_host:$('#serv_host').val(),
shared_icon_path:$('#shared_icon_path').val(),
game_image_path:$('#game_image_path').val()
game_image_path:$('#game_image_path').val(),
image_request_key:$('#image_request_key').val(),
kakao_rest_key:$('#kakao_rest_key').val(),
kakao_admin_key:$('#kakao_admin_key').val(),
}
}).then(function(result){
var deferred = $.Deferred();
+7 -3
View File
@@ -5,9 +5,11 @@ import time
import glob
import urllib.request
import concurrent.futures
from datetime import datetime
def run(webPath):
print(webPath)
now = datetime.now()
print(now.strftime("%Y-%m-%d %H:%M:%S"), webPath)
obj = urllib.request.urlopen(webPath)
obj.read()
@@ -44,15 +46,17 @@ def main():
servList.append(webPath)
with concurrent.futures.ThreadPoolExecutor(max_workers=len(servList)) as executor:
with concurrent.futures.ThreadPoolExecutor(max_workers=max(1,len(servList))) as executor:
waiters=[]
for resetPath in autoResetList:
future = executor.submit(run, resetPath)
waiters.append(future)
for _ in range(4):
for idx in range(4):
for webPath in servList:
future = executor.submit(run, webPath)
waiters.append(future)
if idx == 3:
break
time.sleep(15)
for future in waiters:
future.done()
+3
View File
@@ -133,6 +133,9 @@ class WebUtil
}
$config = \HTMLPurifier_HTML5Config::createDefault();
$config->set('Filter.Custom', array (new \HTMLPurifier_Filter_YouTube()));
$config->set('HTML.SafeIframe', true);
$config->set('URI.SafeIframeRegexp', '%^(https?:)?//(www\.youtube(?:-nocookie)?\.com/embed/|player\.vimeo\.com/video/)%'); //allow YouTube and Vimeo
$def = $config->getHTMLDefinition();
$def->info_global_attr['data-flip'] = new \HTMLPurifier_AttrDef_Text;
$purifier = new \HTMLPurifier($config);