Compare commits

..
66 Commits
Author SHA1 Message Date
Hide_D f2a3bc4626 메시지함 높이 고정을 최소 높이로 변경 2018-07-11 23:49:57 +09:00
Hide_D e8ffa44544 메시지함 사라지는 버그 수정? 2018-07-11 23:04:38 +09:00
Hide_D bc09287666 도움 주신 분 임시 삭제. 나중에 Credit으로 되살리기로 2018-07-11 22:37:36 +09:00
Hide_D 392d9055fe td tr 되돌려놓음 2018-07-11 22:18:08 +09:00
Hide_D 0ee833d7ae list 일부 수정. tfoot 안에 tr td없는거 수정 2018-07-11 22:17:03 +09:00
Hide_D 3074bc00d7 지도 표기에서 box 표기 문제로 일부 수정 2018-07-11 22:04:20 +09:00
Hide_D cb6fb590c4 귀병, 환술 설명 수정 2018-07-11 21:53:13 +09:00
Hide_D a7270b2cd2 장수 성격, 아이템 설명 툴팁 추가 2018-07-11 21:50:01 +09:00
Hide_D 0d925af065 tooltip html trim 추가 2018-07-11 20:52:46 +09:00
Hide_D 7c7991e8ae 특기 없을 때 텍스트 수정 2018-07-11 20:51:13 +09:00
Hide_D 54461b6ea4 특기가 없는 경우에도 tooltip 띄우도록 2018-07-11 17:03:47 +09:00
Hide_D 6a17497fbd 빙의 시에도 전특 표기 2018-07-11 03:27:27 +09:00
Hide_D 84f18aa4b6 특기 전 페이지에 반영 2018-07-11 03:03:52 +09:00
Hide_D 73ab38563f 특기 마우스 오버 1차 적용 2018-07-11 02:47:31 +09:00
Hide_D 1f2b40e4d4 message form box sizing 변경. 메인 페이지에 bootstrap css 적용 2018-07-11 01:31:59 +09:00
Hide_D 1d920c5935 darkly 적용 2018-07-11 01:19:24 +09:00
Hide_D 037a1e9c0c 툴팁 준비 2018-07-11 01:15:22 +09:00
Hide_D 87e324d4d9 bootstrap 최신 버전으로 2018-07-11 01:15:02 +09:00
Hide_D d1e9b489e3 공성 전특 버그 수정. 전특 설명을 위한 텍스트 추가 2018-07-11 00:53:10 +09:00
Hide_D 34f1d538d1 세력도시에서 n장, m장 임명이 불가능한 버그 수정 2018-07-07 05:13:22 +09:00
Hide_D fb8d2a2e01 구버전 첩보 마이그레이션시 지도 표기 버그 수정 2018-07-07 04:58:19 +09:00
Hide_D 837db5183e 첩보를 join '|' 에서 json dict로 변경 2018-07-07 04:39:44 +09:00
Hide_D a556877a17 현재 진행중인 깃수인 경우 장수가 안 죽었으면 안나타나는 문제 해결 2018-07-05 00:24:03 +09:00
Hide_D bcbd6dc4db 왕조일람 버그 수정 2018-07-05 00:12:34 +09:00
Hide_D 41f7ad8d75 왕조 일람에 아무것도 없을 때 '현재'가 안보이는 문제 해결 2018-07-05 00:10:33 +09:00
Hide_D 258d4b28da 왕조 일람에 현재 국가 표시 2018-07-05 00:05:48 +09:00
Hide_D 31e900c422 메시지 버그 수정 2018-07-03 22:09:07 +09:00
Hide_D 7b1a76871a parseJsonPost 기반 동작 포기 2018-07-03 21:35:17 +09:00
Hide_D c6f3e7672f 국가 정보 빈칸 2018-07-03 20:48:34 +09:00
Hide_D 540c31903c 월마다 최대 국력, 최대 병력, 최대 도시 수를 계산하는 코드 추가. ng_old_nations에도 반영 2018-07-03 20:43:14 +09:00
Hide_D 3e5262d7a3 nation 테이블에 aux 추가 2018-07-03 20:09:36 +09:00
Hide_D 2b36ffef45 왕조일람 임시 갱신 2018-07-03 06:59:27 +09:00
Hide_D 4c25d2275c 버튼 대체 css 추가. form 일부 제거 2018-07-03 02:55:45 +09:00
Hide_D 6c66fcdfc3 명예의 전당 시나리오명 제대로 표기 안되는 문제 해결 2018-07-02 19:45:41 +09:00
Hide_D aaa972d767 명예의 전당 배경색 오류 수정 2018-07-02 19:15:43 +09:00
Hide_D 45c8538426 빙의 해제시 닉네임 초기화 2018-07-02 03:23:20 +09:00
Hide_D 95702724a9 베팅수익률 오타 2018-07-01 15:34:20 +09:00
Hide_D 98c4d3853c 명장 일람 레퍼런스 값 미표기 문제 해결 2018-07-01 15:30:15 +09:00
Hide_D 7c91143f39 명장일람에서 제약 조건 수정 2018-07-01 15:27:41 +09:00
Hide_D 56e6f57568 회원 가입시 링크 변경 2018-07-01 03:58:47 +09:00
Hide_D ccab456679 세력도시 스크립트 동작 안하는 문제 해결 2018-07-01 01:35:47 +09:00
Hide_D 5af000ca43 html 5 비표준 스크립트 제거 2018-07-01 01:28:35 +09:00
Hide_D 354c8f04ae IE=edge 대소문자 주의 2018-06-30 01:52:07 +09:00
Hide_D 3fbd336b45 Revert "컬러 프로필 적용"
This reverts commit 4f279c49c8.
2018-06-30 01:32:46 +09:00
Hide_D 3c0b86a322 컬러 프로필 적용 2018-06-30 01:26:23 +09:00
Hide_D fca4b69d5a 범장 -> 만능장 2018-06-30 01:18:52 +09:00
Hide_D ce62072761 확장 스크립트를 위해 태그 일부 정리 2018-06-30 00:28:45 +09:00
Hide_D 93dd7a8478 extractMissingPostToGlobals 호환을 위해 server_id 인자명 변경 2018-06-29 16:23:48 +09:00
Hide_D 02fb84a312 font boosting 약화 2018-06-29 14:46:06 +09:00
Hide_D f3e68989e5 뷰포트 추가 지정 2018-06-29 14:41:09 +09:00
Hide_D 468050a9ce 뷰포트 크기 변경 2018-06-29 14:37:30 +09:00
Hide_D f37a602da3 모든 웹 페이지에 viewport 지정 2018-06-29 14:32:59 +09:00
Hide_D 2979691d7e 기본 폰트 크기 지정 2018-06-29 14:20:20 +09:00
Hide_D 72920a0432 unset대신 []로 초기화 2018-06-29 09:35:24 +09:00
Hide_D e81075ef04 history 함수 인자 제한 완화 2018-06-29 09:28:58 +09:00
Hide_D df1a99d877 기본 폰트 지정 2018-06-29 09:16:40 +09:00
Hide_D 10e825dc9f 예약 테이블 점검. 스키마 수정 2018-06-29 01:50:28 +09:00
Hide_D 07ba7933fb 토너먼트 inf 버그 수정 2018-06-29 01:25:43 +09:00
Hide_D 3059eac0fd jquery 버전 업데이트 2018-06-29 01:22:03 +09:00
Hide_D aa33aa6d4f Json 에러시 에러 표기하도록 2018-06-29 00:30:05 +09:00
Hide_D 0a1cdeeaa3 세력일람 코드 변경 2018-06-28 14:16:38 +09:00
Hide_D e4bef47b7e 세력일람 연동 2018-06-28 14:14:56 +09:00
Hide_D f551f994b5 세력도시 코드 일단 통합 2018-06-28 13:57:21 +09:00
Hide_D 4b7a3af691 IE에서 카카오 2018-06-28 13:39:58 +09:00
Hide_D 6f88a80118 randBool이 아니라 randF 써서 생기는 버그 수정 2018-06-28 01:57:41 +09:00
Hide_D e03715ee46 천통 안되는 버그 수정 2018-06-28 00:28:00 +09:00
123 changed files with 3019 additions and 681 deletions
+74
View File
@@ -89,4 +89,78 @@ input.with_skin:disabled {
caption.section_title {
caption-side:top;
}
.samButton{
float:left;
display:block;
padding:0;
margin:0;
text-decoration: none;
position:relative;
}
a.samButton.disabled {
pointer-events: none;
cursor: default;
}
.samButtonOuter{
display: table;
border: outset 2px white;
box-sizing: border-box;
font-weight:bold;
padding: 1px 6px;
width:125px;
height:30px;
background-color:#000000;
color:#ffffff;
}
.samButtonOuter:active{
border: inset 2px white;
}
.samButtonInner{
display: table-cell;
vertical-align: middle;
width: 100%;
margin: 0 auto;
text-align: center;
user-select: none;
}
.samToolbarButton > .samButtonOuter{
width:125px;
height:30px;
background-color:#225500;
color:white;
}
.samToolbarButton2 > .samButtonOuter{
width:125px;
height:30px;
background-color:#225500;
color:magenta;
}
.samCommandButton > .samButtonOuter{
width:111px;
height:30px;
}
.samCommandButton.disabled > .samButtonOuter{
background-color:transparent !important;
color:gray !important;
border-color:transparent !important;
}
.samCommandButton.disabled > .samButtonOuter > .samButtonInner::before{
content:'【'
}
.samCommandButton.disabled > .samButtonOuter > .samButtonInner::after{
content:'】'
}
+2 -2
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+3 -3
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.

After

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 386 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

-4
View File
File diff suppressed because one or more lines are too long
+2
View File
File diff suppressed because one or more lines are too long
+7
View File
File diff suppressed because one or more lines are too long
+13
View File
File diff suppressed because one or more lines are too long
+4 -2
View File
@@ -8,12 +8,14 @@ require(__dir__.'/../vendor/autoload.php');
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>설치</title>
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
<?=WebUtil::printJS('../e_lib/jquery.validate.min.js')?>
<?=WebUtil::printJS('../e_lib/sha512.min.js')?>
<?=WebUtil::printJS('../js/common.js')?>
<?=WebUtil::printJS('../js/install.js')?>
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
<?=WebUtil::printCSS('../css/install.css')?>
+7 -3
View File
@@ -11,7 +11,9 @@ if($session->userGrade < 4) {
<html>
<head>
<title>관리메뉴</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
@@ -28,7 +30,7 @@ $db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
list($turntime, $tnmt_time) = $gameStor->getValuesAsArray(['turntime','tnmt_time']);
[$turntime, $tnmt_time] = $gameStor->getValuesAsArray(['turntime','tnmt_time']);
$query = "select plock from plock";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
@@ -38,7 +40,9 @@ $plock = MYDB_fetch_array($result);
<html>
<head>
<title>삼국지 모의전투 HiDCHe</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
+6 -2
View File
@@ -12,7 +12,9 @@ if($session->userGrade < 5) {
<html>
<head>
<title>관리메뉴</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
@@ -34,7 +36,9 @@ $admin = getAdmin();
<html>
<head>
<title>게임관리</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
+8 -4
View File
@@ -12,7 +12,9 @@ if($session->userGrade < 5) {
<html>
<head>
<title>관리메뉴</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
@@ -32,7 +34,9 @@ $db = DB::db();
<html>
<head>
<title>회원관리</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
@@ -54,7 +58,7 @@ $db = DB::db();
<?php
echo "
<select name=genlist[] size=20 multiple style=color:white;background-color:black;font-size:13>";
<select name=genlist[] size=20 multiple style='color:white;background-color:black;font-size:13px'>";
$generalList = $db->query('SELECT `no`, `name`, npc, `block` FROM general ORDER BY npc, binary(`name`)');
foreach($generalList as $general){
@@ -72,7 +76,7 @@ echo "
</td>
<td width=100 align=center>아이템 지급</td>
<td width=504>
<select name=weap size=1 style=color:white;background-color:black;font-size:13>";
<select name=weap size=1 style='color:white;background-color:black;font-size:13px'>";
for($i=0; $i < 27; $i++) {
echo "
<option value={$i}>{$i}</option>";
+1 -1
View File
@@ -99,7 +99,7 @@ switch($btn) {
], '`no` IN %li', $genlist);
break;
case "특기 부여":
list($year, $month) = $gameStor->getValuesAsArray(['year', 'month']);
[$year, $month] = $gameStor->getValuesAsArray(['year', 'month']);
$text = "특기 부여!";
foreach($db->query("SELECT `no`,leader,power,intel,dex0,dex10,dex20,dex30,dex40 FROM general WHERE `no` IN %li", $genlist) as $general){
+8 -9
View File
@@ -12,7 +12,9 @@ if($session->userGrade < 5) {
<html>
<head>
<title>관리메뉴</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
@@ -35,7 +37,9 @@ $conlimit = $gameStor->conlimit;
<html>
<head>
<title>멀티관리</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
@@ -51,14 +55,9 @@ $conlimit = $gameStor->conlimit;
<?php
echo "
<select name=genlist[] size=20 multiple style=color:white;background-color:black;font-size:13>";
<select name=genlist[] size=20 multiple style='color:white;background-color:black;font-size:13px'>";
$query = "select no,name,npc,block from general where ip!='' order by npc,ip";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result);
for($i=0; $i < $gencount; $i++) {
$general = MYDB_fetch_array($result);
foreach($db->query('SELECT no,name,npc,block,con from general where ip!=\'\' order by npc,ip') as $general){
$style = "style=;";
if($general['block'] > 0) { $style .= "background-color:red;"; }
if($general['npc'] >= 2) { $style .= "color:cyan;"; }
+6 -2
View File
@@ -25,7 +25,9 @@ if($session->userGrade < 5) {
<html>
<head>
<title>관리메뉴</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
@@ -51,7 +53,9 @@ $sel2[$type2] = "selected";
<html>
<head>
<title>일제정보</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
+6 -2
View File
@@ -19,7 +19,9 @@ if($session->userGrade < 5) {
<html>
<head>
<title>관리메뉴</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
@@ -42,7 +44,9 @@ $sel[$type] = "selected";
<html>
<head>
<title>접속정보</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
+6 -2
View File
@@ -23,7 +23,9 @@ if($session->userGrade < 5) {
<html>
<head>
<title>관리메뉴</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
@@ -49,7 +51,9 @@ $sel[$type] = "selected";
<html>
<head>
<title>로그정보</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
+6 -2
View File
@@ -19,7 +19,9 @@ if ($session->userGrade < 5) {
<html>
<head>
<title>관리메뉴</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
@@ -45,7 +47,9 @@ $sel[$type] = "selected";
<html>
<head>
<title>외교정보</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
+3 -1
View File
@@ -1140,7 +1140,9 @@ switch($dex240) {
<!DOCTYPE html>
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title>전투시뮬레이션</title>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
+85 -11
View File
@@ -22,11 +22,18 @@ increaseRefresh("명장일람", 1);
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1136" />
<title><?=UniqueConst::$serverName?>: 명장일람</title>
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
<?=WebUtil::printCSS('css/hallOfFame.css')?>
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
<?=WebUtil::printJS('js/common.js')?>
</head>
<body>
@@ -67,22 +74,83 @@ $types = [
}],
["전 투 횟 수", "int", function($v){$v['value'] = $v['warnum']; return $v; }],
["승 리", "int", function($v){$v['value'] = $v['killnum']; return $v; }],
["승 률", "percent", function($v){$v['value'] = $v['killnum'] / max(1, $v['warnum']); return $v; }],
["승 률", "percent", function($v){
if($v['warnum'] < 10){
$v['value'] = 0;
}
else{
$v['value'] = $v['killnum'] / max(1, $v['warnum']);
}
return $v;
}],
["사 살", "int", function($v){$v['value'] = $v['killcrew']; return $v; }],
["살 상 률", "percent", function($v){$v['value'] = $v['killcrew'] / max(1, $v['deathcrew']); return $v; }],
["살 상 률", "percent", function($v){
if($v['warnum'] < 10){
$v['value'] = 0;
}
else{
$v['value'] = $v['killcrew'] / max(1, $v['deathcrew']);
}
return $v;
}],
["보 병 숙 련 도", "int", function($v){$v['value'] = $v['dex0']; return $v; }],
["궁 병 숙 련 도", "int", function($v){$v['value'] = $v['dex10']; return $v; }],
["기 병 숙 련 도", "int", function($v){$v['value'] = $v['dex20']; return $v; }],
["귀 병 숙 련 도", "int", function($v){$v['value'] = $v['dex30']; return $v; }],
["차 병 숙 련 도", "int", function($v){$v['value'] = $v['dex40']; return $v; }],
["전 력 전 승 률", "percent", function($v){$v['value'] = $v['ttw']/max(1, $v['ttw']+$v['ttd']+$v['ttl']); return $v; }],
["통 솔 전 승 률", "percent", function($v){$v['value'] = $v['tlw']/max(1, $v['tlw']+$v['tld']+$v['tll']); return $v; }],
["일 기 토 승 률", "percent", function($v){$v['value'] = $v['tpw']/max(1, $v['tpw']+$v['tpd']+$v['tpl']); return $v; }],
["설 전 승 률", "percent", function($v){$v['value'] = $v['tiw']/max(1, $v['tiw']+$v['tid']+$v['til']); return $v; }],
["전 력 전 승 률", "percent", function($v){
$totalCnt = $v['ttw']+$v['ttd']+$v['ttl'];
if($totalCnt < 50){
$v['value'] = 0;
}
else{
$v['value'] = $v['ttw']/max(1, $totalCnt);
}
return $v;
}],
["통 솔 전 승 률", "percent", function($v){
$totalCnt = $v['tlw']+$v['tld']+$v['tll'];
if($totalCnt < 50){
$v['value'] = 0;
}
else{
$v['value'] = $v['tlw']/max(1, $totalCnt);
}
return $v;
}],
["일 기 토 승 률", "percent", function($v){
$totalCnt = $v['tpw']+$v['tpd']+$v['tpl'];
if($totalCnt < 50){
$v['value'] = 0;
}
else{
$v['value'] = $v['tpw']/max(1, $totalCnt);
}
return $v;
}],
["설 전 승 률", "percent", function($v){
$totalCnt = $v['tiw']+$v['tid']+$v['til'];
if($totalCnt < 50){
$v['value'] = 0;
}
else{
$v['value'] = $v['tiw']/max(1, $totalCnt);
}
return $v;
}],
["베 팅 투 자 액", "int", function($v){$v['value'] = $v['betgold']; return $v; }],
["베 팅 당 첨", "int", function($v){$v['value'] = $v['betwin']; return $v; }],
["베 팅 수 익 금", "int", function($v){$v['value'] = $v['betwingold']; return $v; }],
["베 팅 수 익 률", "percent", function($v){$v['value'] = $v['betwingold']/max(1, $v['betgold']); return $v; }],
["베 팅 수 익 률", "percent", function($v){
if($v['betgold'] < 1000){
$v['value'] = 0;
}
else{
$v['value'] = $v['betwingold']/max(1, $v['betgold']);
}
return $v;
}],
];
$generals = array_map(function($general) use($nationColor, $nationName) {
@@ -112,10 +180,15 @@ $generals = array_map(function($general) use($nationColor, $nationName) {
$templates = new \League\Plates\Engine('templates');
foreach($types as $idx=>[$typeName, $typeValue, $typeFunc]){
$typeGenerals = array_map(function($general) use($typeValue, $typeFunc){
$validCnt = 0;
$typeGenerals = array_map(function($general) use($typeValue, $typeFunc, &$validCnt){
$general = ($typeFunc)($general);
$value = $general['value'];
if($value > 0){
$validCnt+=1;
}
if($typeValue == 'percent'){
$general['printValue'] = number_format($value*100, 2).'%';
}
@@ -130,9 +203,10 @@ foreach($types as $idx=>[$typeName, $typeValue, $typeFunc]){
return -($lhs['value'] <=> $rhs['value']);
});
echo $templates->render('hallOfFrame', [
'typeName'=>$typeName,
'generals'=>array_slice($typeGenerals, 0, 10)
'generals'=>array_slice($typeGenerals, 0, min(10, $validCnt))
]);
}
?>
@@ -144,7 +218,7 @@ $itemTypes = [
["명 마", '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 getItemName($v);}, 7, 26, []],
["도 구", 'item', function($v){return displayItemInfo($v);}, 7, 26, []],
];
$simpleItemTypes = array_map(function($itemType){return $itemType[1];}, $itemTypes);
+39 -142
View File
@@ -4,12 +4,7 @@ namespace sammo;
include "lib.php";
include "func.php";
$select = Util::getReq('select', 'int', 0);
extractMissingPostToGlobals();
$db = DB::db();
$connect=$db->get();
increaseRefresh("왕조일람", 1);
?>
@@ -17,7 +12,9 @@ increaseRefresh("왕조일람", 1);
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 왕조일람</title>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
@@ -27,35 +24,57 @@ increaseRefresh("왕조일람", 1);
<body>
<table align=center width=1000 class="tb_layout bg0">
<tr><td>역 대 왕 조<br>
<input type=button value='창 닫기' onclick=window.close()><br>
<button onclick=window.close()>창 닫기</button><br>
</td></tr>
</table>
<?php
if ($select == 0) {
$query = "select * from emperior order by no desc";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$empcount = MYDB_num_rows($result);
$showCurrentNation = true;
for ($i=0; $i < $empcount; $i++) {
$emperior = MYDB_fetch_array($result);
$emperiors = $db->query('SELECT * FROM emperior ORDER BY `no` DESC');
if($emperiors){
$serverID = $emperior[0]['server_id']??($emperior[0]['serverID']??null);
if($serverID == UniqueConst::$serverID){
$showCurrentNation = false;
}
}
if ($showCurrentNation) {
$gameStor = KVStorage::getStorage($db, 'game_env');
[$year, $month] = $gameStor->getValuesAsArray(['year', 'month']);
?>
<table align=center width=1000 class='tb_layout bg0'>
<table align=center width=1000 style="margin-top:10px;" class='tb_layout bg0'>
<tr>
<td style="background-color:#333333;" align=center colspan=8>
<font size=5>현재 (<?=$year?>年 <?=$month?>月)</font>
<a href="a_emperior_detail.php"><button>자세히</button></a>
<a href="a_history.php"><button>역사 보기</button></a>
</td>
</tr>
</table>
<?php
}
foreach($emperiors as $emperior){
$serverID = $emperior['server_id']??($emperior['serverID']??null);
?>
<table align=center width=1000 style="margin-top:10px;" class='tb_layout bg0'>
<tr>
<td bgcolor=skyblue align=center colspan=8>
<form action=a_emperior.php method=get>
<font size=5><?=$emperior['phase']?></font>
<input type=submit value='자세히'>
<input type=hidden name=select value='<?=$emperior['no']?>'>
<a href="a_emperior_detail.php?select=<?=$emperior['no']?>"><button>자세히</button></a>
<?php if($emperior['server_id']): ?>
<a href="a_history.php?server_id=<?=$emperior['server_id']?>"><button type="button">역사 보기</button></a>
<a href="a_history.php?serverID=<?=$emperior['server_id']?>"><button>역사 보기</button></a>
<?php endif ?>
</form>
</td>
</tr>
<tr>
@@ -88,132 +107,10 @@ if ($select == 0) {
<?php
}
?>
<table align=center width=1000 class='tb_layout bg0'>
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
</body>
</html>
<?php
die();
}
$emperior = $db->queryFirstRow('SELECT * FROM emperior WHERE `no`=%i',$select);
?>
<table align=center width=1000 class='tb_layout bg0'>
<tr>
<td bgcolor=skyblue align=center colspan=6>
<form action=a_emperior.php method=get>
<font size=5><?=$emperior['phase']?></font>
<input type=submit value='전체보기'>
</form>
</td>
</tr>
<tr>
<td id=bg1 width=98 align=center>국 가 수<br>(최종 / 최대)</td>
<td align=center width=398 colspan=2><?=$emperior['nation_count']?></td>
<td id=bg1 width=98 align=center>장 수 수<br>(최종 / 최대)</td>
<td align=center width=398 colspan=2><?=$emperior['gen_count']?></td>
</tr>
<tr>
<td id=bg1 align=center>등 장 국 가</td>
<td colspan=5><?=$emperior['nation_name']?></td>
</tr>
<tr>
<td id=bg1 align=center>국가별 성향</td>
<td colspan=5><?=$emperior['nation_hist']?></td>
</tr>
<tr>
<td id=bg1 align=center>장 수 성 격</td>
<td colspan=5><?=$emperior['personal_hist']?></td>
</tr>
<tr>
<td id=bg1 align=center>장 수 특 기</td>
<td colspan=5><?=$emperior['special_hist']?></td>
</tr>
<tr>
<td align=center style=color:<?=newColor($emperior['color'])?>; bgcolor=<?=$emperior['color']?> colspan=6>
<font size=5><?=$emperior['name']?> (<?=$emperior['year']?>年 <?=$emperior['month']?>月)</font>
</td>
</tr>
<tr>
<td id=bg1 width=98 align=center>국 력</td>
<td align=center width=398 colspan=2><?=$emperior['power']?></td>
<td id=bg1 width=98 align=center>성 향</td>
<td align=center width=398 colspan=2><?=$emperior['type']?></td>
</tr>
<tr>
<td id=bg1 width=98 align=center>장 수</td>
<td align=center width=398 colspan=2><?=$emperior['gennum']?></td>
<td id=bg1 width=98 align=center>속 령</td>
<td align=center width=398 colspan=2><?=$emperior['citynum']?></td>
</tr>
<tr>
<td id=bg1 align=center>총 인 구</td>
<td align=center colspan=2><?=$emperior['pop']?></td>
<td id=bg1 align=center>인 구 율</td>
<td align=center colspan=2><?=$emperior['poprate']?></td>
</tr>
<tr>
<td id=bg1 align=center>국 고</td>
<td align=center colspan=2><?=$emperior['gold']?></td>
<td id=bg1 align=center>병 량</td>
<td align=center colspan=2><?=$emperior['rice']?></td>
</tr>
<tr>
<td id=bg1 align=center>황 제</td>
<td width=64>&nbsp;</td>
<td width=332><?=$emperior['l12name']?></td>
<td id=bg1 align=center>승 상</td>
<td width=64>&nbsp;</td>
<td width=332><?=$emperior['l11name']?></td>
</tr>
<tr>
<td id=bg1 align=center>위 장 군</td>
<td width=64>&nbsp;</td>
<td width=332><?=$emperior['l10name']?></td>
<td id=bg1 align=center>사 공</td>
<td width=64>&nbsp;</td>
<td width=332><?=$emperior['l9name']?></td>
</tr>
<tr>
<td id=bg1 align=center>표 기 장 군</td>
<td width=64>&nbsp;</td>
<td width=332><?=$emperior['l8name']?></td>
<td id=bg1 align=center>태 위</td>
<td width=64>&nbsp;</td>
<td width=332><?=$emperior['l7name']?></td>
</tr>
<tr>
<td id=bg1 align=center>거 기 장 군</td>
<td width=64>&nbsp;</td>
<td width=332><?=$emperior['l6name']?></td>
<td id=bg1 align=center>사 도</td>
<td width=64>&nbsp;</td>
<td width=332><?=$emperior['l5name']?></td>
</tr>
<tr>
<td id=bg1 align=center>오 호 장 군</td>
<td colspan=5><?=$emperior['tiger']?></td>
</tr>
<tr>
<td id=bg1 align=center>건 안 칠 자</td>
<td colspan=5><?=$emperior['eagle']?></td>
</tr>
<tr>
<td id=bg1 align=center>장 수 들<br>(공헌도 순서)</td>
<td colspan=5><?=$emperior['gen']?></td>
</tr>
<tr>
<td id=bg1 align=center>역 사 기 록</td>
<td colspan=5><?=ConvertLog($emperior['history'], 1)?></td>
</tr>
</table>
<table align=center width=1000 class='tb_layout bg0'>
<table style="margin-top:10px;" align=center width=1000 class='tb_layout bg0'>
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
+3 -1
View File
@@ -17,7 +17,9 @@ increaseRefresh("왕조일람", 2);
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 왕조일람</title>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
+210
View File
@@ -0,0 +1,210 @@
<?php
namespace sammo;
include "lib.php";
include "func.php";
$select = Util::getReq('select', 'int', 0);
$db = DB::db();
$templates = new \League\Plates\Engine('templates');
$templates->registerFunction('ConvertLog', '\sammo\ConvertLog');
$templates->registerFunction('newColor', '\sammo\newColor');
increaseRefresh("왕조일람", 1);
$emperior = $db->queryFirstRow('SELECT * FROM emperior WHERE `no`=%i',$select);
$serverID = $emperior['server_id']??($emperior['serverID']??null);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 왕조일람</title>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
<body>
<table align=center width=1000 class="tb_layout bg0">
<tr><td><?=$emperior?'역 대 왕 조':'현 재 왕 조'?><br>
<button onclick=window.close()>창 닫기</button>
<div style="float:right;"><a href="a_emperior.php"><button>전체보기</button></a><div>
</td></tr>
</table>
<?php
if($emperior):
?>
<table align=center width=1000 class='tb_layout bg0'>
<tr>
<td bgcolor=skyblue align=center colspan=6>
<font size=5><?=$emperior['phase']?></font>
</td>
</tr>
<tr>
<td id=bg1 width=98 align=center>국 가 수<br>(최종 / 최대)</td>
<td align=center width=398 colspan=2><?=$emperior['nation_count']?></td>
<td id=bg1 width=98 align=center>장 수 수<br>(최종 / 최대)</td>
<td align=center width=398 colspan=2><?=$emperior['gen_count']?></td>
</tr>
<tr>
<td id=bg1 align=center>등 장 국 가</td>
<td colspan=5><?=$emperior['nation_name']?></td>
</tr>
<tr>
<td id=bg1 align=center>국가별 성향</td>
<td colspan=5><?=$emperior['nation_hist']?></td>
</tr>
<tr>
<td id=bg1 align=center>장 수 성 격</td>
<td colspan=5><?=$emperior['personal_hist']?></td>
</tr>
<tr>
<td id=bg1 align=center>장 수 특 기</td>
<td colspan=5><?=$emperior['special_hist']?></td>
</tr>
<tr>
<td align=center style=color:<?=newColor($emperior['color'])?>; bgcolor=<?=$emperior['color']?> colspan=6>
<font size=5><?=$emperior['name']?> (<?=$emperior['year']?>年 <?=$emperior['month']?>月)</font>
</td>
</tr>
<tr>
<td id=bg1 width=98 align=center>국 력</td>
<td align=center width=398 colspan=2><?=$emperior['power']?></td>
<td id=bg1 width=98 align=center>성 향</td>
<td align=center width=398 colspan=2><?=$emperior['type']?></td>
</tr>
<tr>
<td id=bg1 width=98 align=center>장 수</td>
<td align=center width=398 colspan=2><?=$emperior['gennum']?></td>
<td id=bg1 width=98 align=center>속 령</td>
<td align=center width=398 colspan=2><?=$emperior['citynum']?></td>
</tr>
<tr>
<td id=bg1 align=center>총 인 구</td>
<td align=center colspan=2><?=$emperior['pop']?></td>
<td id=bg1 align=center>인 구 율</td>
<td align=center colspan=2><?=$emperior['poprate']?></td>
</tr>
<tr>
<td id=bg1 align=center>국 고</td>
<td align=center colspan=2><?=$emperior['gold']?></td>
<td id=bg1 align=center>병 량</td>
<td align=center colspan=2><?=$emperior['rice']?></td>
</tr>
<tr>
<td id=bg1 align=center>황 제</td>
<td width=64>&nbsp;</td>
<td width=332><?=$emperior['l12name']?></td>
<td id=bg1 align=center>승 상</td>
<td width=64>&nbsp;</td>
<td width=332><?=$emperior['l11name']?></td>
</tr>
<tr>
<td id=bg1 align=center>위 장 군</td>
<td width=64>&nbsp;</td>
<td width=332><?=$emperior['l10name']?></td>
<td id=bg1 align=center>사 공</td>
<td width=64>&nbsp;</td>
<td width=332><?=$emperior['l9name']?></td>
</tr>
<tr>
<td id=bg1 align=center>표 기 장 군</td>
<td width=64>&nbsp;</td>
<td width=332><?=$emperior['l8name']?></td>
<td id=bg1 align=center>태 위</td>
<td width=64>&nbsp;</td>
<td width=332><?=$emperior['l7name']?></td>
</tr>
<tr>
<td id=bg1 align=center>거 기 장 군</td>
<td width=64>&nbsp;</td>
<td width=332><?=$emperior['l6name']?></td>
<td id=bg1 align=center>사 도</td>
<td width=64>&nbsp;</td>
<td width=332><?=$emperior['l5name']?></td>
</tr>
<tr>
<td id=bg1 align=center>오 호 장 군</td>
<td colspan=5><?=$emperior['tiger']?></td>
</tr>
<tr>
<td id=bg1 align=center>건 안 칠 자</td>
<td colspan=5><?=$emperior['eagle']?></td>
</tr>
<tr>
<td id=bg1 align=center>장 수 들<br>(공헌도 순서)</td>
<td colspan=5><?=$emperior['gen']?></td>
</tr>
<tr>
<td id=bg1 align=center>역 사 기 록</td>
<td colspan=5><?=ConvertLog($emperior['history'], 1)?></td>
</tr>
</table>
<?php
endif;
$showServers = $serverID || (!$emperior);
if(!$serverID){
$serverID = UniqueConst::$serverID;
}
if($showServers){
$nations = $db->query('SELECT * FROM ng_old_nations WHERE server_id=%s ORDER BY date DESC', $serverID);
foreach($nations as $nation){
if(!$nation['nation']??null){
continue;
}
$nation += Json::decode($nation['data']);
$nation['typeName'] = getNationType($nation['type']);
$nation['levelName'] = getNationLevel($nation['level']);
if($nation['generals']){
$generals = $db->query('SELECT `general_no`, `name`, `last_yearmonth` FROM ng_old_generals WHERE server_id=%s AND general_no IN %li', $serverID, $nation['generals']);
if(count($generals) != $nation['generals'] && $serverID == UniqueConst::$serverID){
$liveGenerals = $nation['generals'];
foreach($generals as $general){
if(in_array($general['general_no'], $nation['generals'])){
unset($nation['generals'][$general['general_no']]);
}
}
$liveGenerals = $db->query('SELECT `no`as`general_no`, `name` FROM general WHERE no IN %li', $liveGenerals);
$nation['generalsFull'] = array_merge($liveGenerals, $generals);
}
else{
$nation['generalsFull'] = $generals;
}
}
else{
$nation['generalsFull'] = [];
}
if(key_exists('aux', $nation) && !is_array($nation['aux'])){
$nation += Json::decode($nation['aux']);
}
echo $templates->render('oldNation', $nation);
}
}
?>
<table align=center width=1000 class='tb_layout bg0'>
<tr><td><?=closeButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
</body>
</html>
+9 -4
View File
@@ -37,12 +37,17 @@ if ($type <= 0 || $type > 15) {
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 장수일람</title>
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
<?=WebUtil::printJS('../d_shared/common_path.js')?>
<?=WebUtil::printJS('js/common.js')?>
</head>
@@ -165,8 +170,8 @@ for ($j=0; $j < $gencount; $j++) {
<td align=center><img width='64' height='64' src={$imageTemp}/{$general['picture']}></img></td>
<td align=center>$name</td>
<td align=center>{$general['age']}세</td>
<td align=center>".getGenChar($general['personal'])."</td>
<td align=center>".getGenSpecial($general['special'])." / ".getGenSpecial($general['special2'])."</td>
<td align=center>".displayCharInfo($general['personal'])."</td>
<td align=center>".displaySpecialInfo($general['special'])." / ".displaySpecialInfo($general['special2'])."</td>
<td align=center>Lv ".getExpLevel($general['experience'])."</td>
<td align=center>{$nation}</td>
<td align=center>".getHonor($general['experience'])."</td>
+17 -6
View File
@@ -12,7 +12,7 @@ $db = DB::db();
increaseRefresh("명예의전당", 1);
$scenarioList= [];
foreach($db->query('SELECT distinct(scenario_name) as name, count(scenario) as cnt, scenario from ng_games order by scenario asc') as $scenarioInfo){
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;
}
@@ -32,13 +32,19 @@ else{
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1136" />
<title><?=UniqueConst::$serverName?>: 명예의 전당</title>
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
<?=WebUtil::printCSS('css/hallOfFame.css')?>
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('../e_lib/jquery.redirect.js')?>
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
<?=WebUtil::printJS('js/common.js')?>
<?=WebUtil::printJs('js/hallOfFame.js')?>
</head>
@@ -92,10 +98,15 @@ foreach($types as $idx=>[$typeName, $typeValue]) {
$hallResult = array_map(function($general)use($typeValue){
$aux = Json::decode($general['aux']);
$general += $aux;
if(!key_exists('color', $general)){
$general['bgColor'] = GameConst::$basecolor4;
if(!key_exists('bgColor', $general)){
if(!key_exists('color', $general)){
$general['bgColor'] = GameConst::$basecolor4;
}
else{
$general['bgColor'] = $general['color'];
}
}
if(!key_exists('fgColor', $general)){
$general['fgColor'] = newColor($general['bgColor']);
}
+6 -4
View File
@@ -5,7 +5,7 @@ include "lib.php";
include "func.php";
$btn = Util::getReq('btn');
$yearmonth = Util::getReq('yearmonth', 'int');
$serverID = Util::getReq('server_id', 'string', null);
$serverID = Util::getReq('serverID', 'string', null);
extractMissingPostToGlobals();
@@ -84,9 +84,11 @@ if ($month <= 0) {
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 연감</title>
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('../d_shared/common_path.js')?>
<?=WebUtil::printJS('js/common.js')?>
<?=WebUtil::printJS('js/base_map.js')?>
@@ -157,7 +159,7 @@ $history = $db->queryFirstRow('SELECT log,genlog,nation,power,gen,city FROM hist
</table>
<script>
reloadWorldMap({
targetJson:'j_map_history.php?year=<?=$year?>&month=<?=$month?>&server_id=<?=$serverID?>',
targetJson:'j_map_history.php?year=<?=$year?>&month=<?=$month?>&serverID=<?=$serverID?>',
showMe:false,
neutralView:true
});
+5 -1
View File
@@ -24,10 +24,14 @@ if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 세력일람</title>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('js/ext.kingdoms.js')?>
</head>
+10 -3
View File
@@ -25,11 +25,18 @@ $sel[$type] = "selected";
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 빙의일람</title>
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
<?=WebUtil::printJS('js/common.js')?>
</head>
<body>
@@ -104,8 +111,8 @@ for ($j=0; $j < $gencount; $j++) {
<td align=center>{$general['name2']}</td>
<td align=center>Lv {$general['explevel']}</td>
<td align=center>{$nation}</td>
<td align=center>".getGenChar($general['personal'])."</td>
<td align=center>".getGenSpecial($general['special'])." / ".getGenSpecial($general['special2'])."</td>
<td align=center>".displayCharInfo($general['personal'])."</td>
<td align=center>".displaySpecialInfo($general['special'])." / ".displaySpecialInfo($general['special2'])."</td>
<td align=center>{$general['sum']}</td>
<td align=center>{$general['leader']}</td>
<td align=center>{$general['power']}</td>
+2 -1
View File
@@ -26,8 +26,9 @@ if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 세력도</title>
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('../d_shared/common_path.js')?>
<?=WebUtil::printJS('js/common.js')?>
<?=WebUtil::printJS('js/base_map.js')?>
+3 -1
View File
@@ -50,7 +50,9 @@ if ($admin['maxonline'] < $curonline) {
<html>
<head>
<title><?=UniqueConst::$serverName?>: 트래픽정보</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
<style>
+3 -1
View File
@@ -28,7 +28,9 @@ $vote = $admin['vote']?:['-'];
<html>
<head>
<title><?=UniqueConst::$serverName?>: 설문조사</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
<style>
+3 -1
View File
@@ -56,7 +56,9 @@ if ($msg2 == "") {
<html>
<head>
<title><?=UniqueConst::$serverName?>: 거래장</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
+3 -1
View File
@@ -74,7 +74,9 @@ $sel[$type] = "selected";
<head>
<title><?=UniqueConst::$serverName?>: 감찰부</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
+3 -1
View File
@@ -55,7 +55,9 @@ if($str3){
MessageBox("접속제한이 얼마 남지 않았습니다!");
} ?>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 베팅장</title>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
+3 -1
View File
@@ -26,7 +26,9 @@ if($me['level'] < 5) {
<html>
<head>
<title><?=UniqueConst::$serverName?>: 기밀실</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
+3 -1
View File
@@ -77,7 +77,9 @@ for($i= $lv - 1; $i>=5; $i--){
<!DOCTYPE html>
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 사령부</title>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
+29 -22
View File
@@ -21,9 +21,7 @@ $query = "select no,nation,level,city from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$query = "select nation,level,spy from nation where nation='{$me['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$myNation = MYDB_fetch_array($result);
$myNation = $db->queryFirstRow('SELECT nation,level,spy FROM nation WHERE nation=%i', $me['nation']);
$templates = new \League\Plates\Engine('templates');
@@ -33,7 +31,9 @@ $templates = new \League\Plates\Engine('templates');
<head>
<title><?=UniqueConst::$serverName?>: 도시정보</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
<style>
@@ -119,27 +119,34 @@ if($me['level'] == 0) {
if($myNation['level'] > 0) {
// 첩보도시도 목록에 추가
$where = 'city=0';
$cities = array_map('intval',explode("|", $myNation['spy']));
foreach($cities as $citySpy) {
$city = intdiv($citySpy, 10);
$where .= " or city='{$city}'";
$rawSpy = $myNation['spy'];
if($rawSpy == ''){
$spyCities = [];
}
else if(strpos($rawSpy, '|') !== false || is_numeric($rawSpy)){
//TODO: 0.8 버전 이후에는 삭제할 것. 이후 버전은 json으로 변경됨.
$spyCities = array_map(function($val){
$val = intval($val);
return intdiv($val, 10);
}, 'intval',explode('|', $myNation['spy']));
}
else{
$spyCities = array_keys(Json::decode($rawSpy));
}
$query = "select city,name,nation from city where {$where}";
$cityresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$citycount = MYDB_num_rows($cityresult);
for($i=0; $i < $citycount; $i++) {
$city = MYDB_fetch_array($cityresult);
echo "
<option value={$city['city']}";
if($city['city'] == $citylist) { echo " selected"; $valid = 1; }
echo ">==================================================【".StringUtil::padString($city['name'], 4, '_')."】";
if($city['nation'] == 0) echo "공백지";
elseif($me['nation'] == $city['nation']) echo "국==";
else echo "타국==";
echo "============================================</option>";
if($spyCities){
foreach ($db->query('SELECT city,name,nation FROM city WHERE city in %li', $spyCities) as $city) {
echo "<option value={$city['city']}";
if($city['city'] == $citylist) { echo " selected"; $valid = 1; }
echo ">==================================================【".StringUtil::padString($city['name'], 4, '_')."】";
if($city['nation'] == 0) echo "공백지";
elseif($me['nation'] == $city['nation']) echo "본국==";
else echo "국==";
echo "============================================</option>";
}
}
}
+7 -1
View File
@@ -44,8 +44,14 @@ if ($me['level'] >= 5) {
<!DOCTYPE html>
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 내무부</title>
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('../d_shared/common_path.js')?>
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
+4 -3
View File
@@ -45,11 +45,11 @@ for($i=0; $i < $nationcount; $i++) {
}
$realConflict = [];
foreach ($db->queryAllLists('SELECT city, `name`, conflict FROM city WHERE conflict!=%s', '{}') as list(
foreach ($db->queryAllLists('SELECT city, `name`, conflict FROM city WHERE conflict!=%s', '{}') as [
$cityID,
$cityName,
$rawConflict
))
])
{
$conflict = Json::decode($rawConflict);
if (count($conflict)<2) {
@@ -75,8 +75,9 @@ foreach ($db->queryAllLists('SELECT city, `name`, conflict FROM city WHERE confl
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 중원 정보</title>
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('../d_shared/common_path.js')?>
<?=WebUtil::printJS('js/common.js')?>
<?=WebUtil::printJS('js/base_map.js')?>
+42 -32
View File
@@ -50,11 +50,16 @@ $sel[$type] = "selected";
MessageBox("접속제한이 얼마 남지 않았습니다!");
} ?>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 암행부</title>
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
<?=WebUtil::printJS('js/common.js')?>
</head>
<body>
@@ -97,24 +102,28 @@ switch ($type) {
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$gencount = MYDB_num_rows($genresult);
echo"
<table align=center class='tb_layout bg0'>
?>
<table align=center id='general_list' class='tb_layout bg0'>
<thead>
<tr>
<td width=98 align=center id=bg1>이 름</td>
<td width=98 align=center id=bg1>통무지</td>
<td width=98 align=center id=bg1>부 대</td>
<td width=58 align=center id=bg1>자 금</td>
<td width=58 align=center id=bg1>군 량</td>
<td width=48 align=center id=bg1>도시</td>
<td width=28 align=center id=bg1>守</td>
<td width=58 align=center id=bg1>병 종</td>
<td width=68 align=center id=bg1>병 사</td>
<td width=48 align=center id=bg1>훈련</td>
<td width=48 align=center id=bg1>사기</td>
<td width=148 align=center id=bg1>명 령</td>
<td width=58 align=center id=bg1>삭턴</td>
<td width=58 align=center id=bg1>턴</td>
</tr>";
<td width=98 align=center class=bg1>이 름</td>
<td width=98 align=center class=bg1>통무지</td>
<td width=98 align=center class=bg1>부 대</td>
<td width=58 align=center class=bg1>자 금</td>
<td width=58 align=center class=bg1>군 량</td>
<td width=48 align=center class=bg1>도시</td>
<td width=28 align=center class=bg1>守</td>
<td width=58 align=center class=bg1>병 종</td>
<td width=68 align=center class=bg1>병 사</td>
<td width=48 align=center class=bg1>훈련</td>
<td width=48 align=center class=bg1>사기</td>
<td width=148 align=center class=bg1>명 령</td>
<td width=58 align=center class=bg1>삭턴</td>
<td width=58 align=center class=bg1>턴</td>
</tr>
</thead>
<tbody>
<?php
for ($j=0; $j < $gencount; $j++) {
$general = MYDB_fetch_array($genresult);
$city = CityConst::byID($general['city'])->name;
@@ -162,24 +171,24 @@ for ($j=0; $j < $gencount; $j++) {
echo "
<tr>
<td align=center>$name<br>Lv ".getExpLevel($general['experience'])."</td>
<td align=center>{$leader}∥{$power}∥{$intel}</td>
<td align=center>$troop</td>
<td align=center>{$general['gold']}</td>
<td align=center>{$general['rice']}</td>
<td align=center>$city</td>
<td class='i_name' align=center><span class='t_name'>$name</span><br>Lv <span class='t_explevel'>".getExpLevel($general['experience'])."</span></td>
<td class='i_stat' align=center>{$leader}∥{$power}∥{$intel}</td>
<td class='i_troop' align=center>$troop</td>
<td class='i_gold' align=center>{$general['gold']}</td>
<td class='i_rice' align=center>{$general['rice']}</td>
<td class='i_city' align=center>$city</td>
<td align=center>$mode</td>
<td align=center>".GameUnitConst::byId($general['crewtype'])->name."</td>
<td align=center>{$general['crew']}</td>
<td align=center>{$general['train']}</td>
<td align=center>{$general['atmos']}</td>";
<td class='i_crewtype' align=center>".GameUnitConst::byId($general['crewtype'])->name."</td>
<td class='i_crew' align=center>{$general['crew']}</td>
<td class='i_train' align=center>{$general['train']}</td>
<td class='i_atmos' align=center>{$general['atmos']}</td>";
if ($general['npc'] >= 2) {
echo "
<td>
<td class='i_action'>
<font size=3>NPC 장수";
} else {
echo "
<td>
<td class='i_action'>
<font size=1>";
$turn = getTurn($general, 1, 0);
@@ -194,10 +203,11 @@ for ($j=0; $j < $gencount; $j++) {
</font>
</td>
<td align=center>{$general['killturn']}</td>
<td align=center>".substr($general['turntime'], 14, 5)."</td>
<td class='i_turntime' align=center>".substr($general['turntime'], 14, 5)."</td>
</tr>";
}
echo "
</tbody>
</table>
";
+3 -1
View File
@@ -29,7 +29,9 @@ if($meLevel == 0) {
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 인사부</title>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
+9 -3
View File
@@ -36,10 +36,16 @@ $sel = [$type => "selected"];
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 세력도시</title>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('../e_lib/jquery-ui.min.css')?>
<?=WebUtil::printCSS('css/common.css')?>
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('../e_lib/jquery-ui.min.js')?>
<?=WebUtil::printJS('js/ext.expand_city.js')?>
</head>
@@ -188,11 +194,11 @@ for ($j=0; $j < $citycount; $j++) {
}
?>
<table align=center width=1000 class='tb_layout bg0'>
<table align=center width=1000 class='tb_layout bg0 anchor'>
<tr><td><?=backButton()?></td></tr>
<tr><td><?=banner()?></td></tr>
</table>
</body>
<div id="helper_genlist" style="display:none;"></div>
</html>
+9 -3
View File
@@ -36,10 +36,16 @@ $sel = [$type => "selected"];
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 세력장수</title>
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
<?=WebUtil::printJS('js/common.js')?>
</head>
@@ -179,8 +185,8 @@ for($j=0; $j < $gencount; $j++) {
<td align=center>$intel</td>
<td align=center>{$general['gold']}</td>
<td align=center>{$general['rice']}</td>
<td align=center>".getGenChar($general['personal'])."</td>
<td align=center>".getGenSpecial($general['special'])." / ".getGenSpecial($general['special2'])."</td>
<td align=center>".displayCharInfo($general['personal'])."</td>
<td align=center>".displaySpecialInfo($general['special'])." / ".displaySpecialInfo($general['special2'])."</td>
<td align=center>{$general['belong']}</td>
<td align=center>{$general['connect']}"; echo "<br>(".getConnect($general['connect']).")</td>
</tr>";
+3 -1
View File
@@ -26,7 +26,9 @@ if($me['level'] == 0) {
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 세력정보</title>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
+3 -1
View File
@@ -77,7 +77,9 @@ if (($btn == "설정저장" || $detachNPC) && $me['myset'] > 0) {
<!DOCTYPE html>
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 내정보</title>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
+3 -1
View File
@@ -21,7 +21,9 @@ $me = MYDB_fetch_array($result);
<html>
<head>
<title><?=UniqueConst::$serverName?>: 회의실</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
+3 -1
View File
@@ -16,7 +16,9 @@ increaseRefresh("국법", 1);
<html>
<head>
<title><?=UniqueConst::$serverName?>: 국법</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
+4 -2
View File
@@ -41,7 +41,9 @@ case 3: $tnmt_type = "<font color=cyan>설전</font>"; $tp = "itl"; $tp2 = "
MessageBox("접속제한이 얼마 남지 않았습니다! 제한량이 모자라다면 참여를 해보세요^^");
} ?>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 토너먼트</title>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
@@ -400,7 +402,7 @@ for($i=0;$i<16;$i+=1){
}
$bet = [];
for ($i=0; $i < 16; $i++) {
if($betting['bet'] == 0){
if($betting["bet{$i}"] == 0){
$bet[$i] = '∞';
continue;
}
+13 -4
View File
@@ -24,10 +24,14 @@ $troopcount = MYDB_num_rows($result);
<!DOCTYPE html>
<html>
<head>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 부대편성</title>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('js/ext.plugin_troop.js')?>
</head>
<body>
@@ -36,7 +40,8 @@ $troopcount = MYDB_num_rows($result);
<tr><td>부 대 편 성<br><?=backButton()?></td></tr>
</table>
<form name=form1 method=post action=c_troop.php>
<table class='tb_layout bg0'>
<table id="troop_list" class='tb_layout bg0'>
<thead>
<tr>
<td width=64 class='bg1 center'>선 택</td>
<td width=130 class='bg1 center'>부 대 정 보</td>
@@ -44,6 +49,8 @@ $troopcount = MYDB_num_rows($result);
<td width=576 class='bg1 center' style=table-layout:fixed;word-break:break-all;>장 수</td>
<td width=130 class='bg1 center' style=table-layout:fixed;word-break:break-all;>부대장행동</td>
</tr>
</thead>
<tbody>
<?php
for($i=0; $i < $troopcount; $i++) {
$troop = MYDB_fetch_array($result);
@@ -119,10 +126,11 @@ for($i=0; $i < $troopcount; $i++) {
</td>
</tr>
<tr><td align=center><font size=2>【턴】".substr($turntime, 14)."</font></td><td align=center><font size=1>$name</font></td></tr>
<tr><td colspan=5>";
<tr><td colspan=5></td></tr>";
}
}
echo "</tbody>
<tfoot><tr><td>";
if ($troopcount == 0) {
}
else if($me['troop'] == 0) {
@@ -135,6 +143,7 @@ else if($me['troop'] == 0) {
echo "
</td></tr>
</tfoot>
</table>
<br>";
+3 -1
View File
@@ -13,7 +13,9 @@ $db = DB::db();
<html>
<head>
<title>커맨드리스트</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
<script type="text/javascript">
+10 -32
View File
@@ -1,9 +1,15 @@
@charset "UTF-8";
/* font-boostring Block */
html * {max-height:1000000px;}
html, body{
background-color:black;
color:white;
line-height:1.3;
font-family:'맑은 고딕';
font-size:13px;
}
table { font-family:'맑은 고딕'; }
@@ -182,38 +188,10 @@ div.bar_out div.bar_in{
}
.tooltip{
position: relative;
font-size:12px;
font-family: '맑은 고딕';
}
.tooltip .tooltiptext {
visibility: hidden;
width: 120px;
background-color: #555;
color: #fff;
text-align: center;
border-radius: 6px;
padding: 5px 0;
position: absolute;
z-index: 1;
bottom: 125%;
left: 50%;
margin-left: -60px;
opacity: 0;
transition: opacity 0.3s;
.tooltiptext {
display: none;
}
.tooltip .tooltiptext::after {
content: "";
position: absolute;
top: 100%;
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: #555 transparent transparent transparent;
}
.tooltip:hover .tooltiptext {
visibility: visible;
opacity: 1;
}
+2 -2
View File
@@ -63,8 +63,8 @@
.world_map.map_detail .city_filler{
position:absolute;
width:100%;
height:100%;
width:calc(100% + 2px);
height:calc(100% + 2px);
left:-1px;
top:-1px;
background:transparent;
+13 -11
View File
@@ -17,15 +17,14 @@
#message_board section{
overflow-y:auto;
overflow-x:hidden;
max-width:498px;
}
.msg_plate{
width:100%;
border-bottom:solid 1px gray;
border-left:solid 1px gray;
border-right:solid 1px gray;
height:64px;
outline-style:solid;
outline-width:1px;
outline-color: gray;
min-height:64px;
font-size:12px;
word-break:break-all;
color:white;
@@ -96,7 +95,8 @@
font-size:12px;
width:715px;
margin:0 2px;
height:15px;
height:20px;
border:solid 1px gray;
}
#msg_submit{
@@ -116,17 +116,19 @@
.board_header{
color:white;
border:solid 1px gray;
outline-style:solid;
outline-width:1px;
outline-color: gray;
}
.board_side{
position:absolute;
height:1370px;
width:498px;
width:50%;
overflow-y: hidden;
border-left:solid 1px;
border-right:solid 1px;
border-bottom:solid 1px;
outline-style:solid;
outline-width:1px;
outline-color: gray;
}
.msg_body{
+18 -12
View File
@@ -490,7 +490,7 @@ function commandTable() {
$develcostE = Util::round($develcostE);
echo "
<select name=commandtype size=1 style=width:260px;color:white;background-color:black;font-size:12px;>";
<select name=commandtype size=1 style='height:20px;width:260px;color:white;background-color:black;font-size:12px;'>";
addCommand("휴 식", 0);
addCommand("요 양", 50);
commandGroup("========= 내 정 ==========");
@@ -699,7 +699,7 @@ function CoreCommandTable() {
if($city['supply'] == 0) { $valid = 0; }
echo "
<select name=commandtype size=1 style=color:white;background-color:black;font-size:13>";
<select name=commandtype size=1 style='height:20px;color:white;background-color:black;font-size:13px;>";
addCommand("휴 식", 99);
commandGroup("", 1);
commandGroup("====== 인 사 ======");
@@ -821,7 +821,7 @@ function generalInfo($no) {
$weapname = getWeapName($general['weap']);
$bookname = getBookName($general['book']);
$horsename = getHorseName($general['horse']);
$itemname = getItemName($general['item']);
$itemname = displayItemInfo($general['item']);
if($general['injury'] > 0) {
$leader = intdiv($general['leader'] * (100 - $general['injury']), 100);
$power = intdiv($general['power'] * (100 - $general['injury']), 100);
@@ -847,8 +847,8 @@ function generalInfo($no) {
else { $general['age'] = "<font color=red>{$general['age']} 세</font>"; }
$general['connect'] = Util::round($general['connect'] / 10) * 10;
$special = $general['special'] == 0 ? "{$general['specage']}" : "<font color=limegreen>".getGenSpecial($general['special'])."</font>";
$special2 = $general['special2'] == 0 ? "{$general['specage2']}" : "<font color=limegreen>".getGenSpecial($general['special2'])."</font>";
$special = $general['special'] == 0 ? "{$general['specage']}" : "<font color=limegreen>".displaySpecialInfo($general['special'])."</font>";
$special2 = $general['special2'] == 0 ? "{$general['specage2']}" : "<font color=limegreen>".displaySpecialInfo($general['special2'])."</font>";
switch($general['personal']) {
case 2: case 4:
@@ -913,7 +913,7 @@ function generalInfo($no) {
<td style='text-align:center;' class='bg1'><b>병사</b></td>
<td style='text-align:center;' colspan=2>{$general['crew']}</td>
<td style='text-align:center;' class='bg1'><b>성격</b></td>
<td style='text-align:center;' colspan=2>".getGenChar($general['personal'])."</td>
<td style='text-align:center;' colspan=2>".displayCharInfo($general['personal'])."</td>
</tr>
<tr>
<td style='text-align:center;' class='bg1'><b>훈련</b></td>
@@ -1128,7 +1128,7 @@ function msgprint($msg, $name, $picture, $imgsvr, $when, $num, $type) {
$db = DB::db();
$connect=$db->get();
$message = explode("|", $msg);
$message = explode('|', $msg);
$count = (count($message) - 2)/2;
$message[0] = Tag2Code($message[0]);
$message[1] = Tag2Code($message[1]);
@@ -1180,11 +1180,10 @@ function msgprint($msg, $name, $picture, $imgsvr, $when, $num, $type) {
function banner() {
return sprintf(
'<font size=2>%s %s / %s <br> %s</font>',
'<font size=2>%s %s / %s</font>',
GameConst::$title,
VersionGit::$version,
GameConst::$banner,
GameConst::$helper);
GameConst::$banner);
}
function addTurn($date, int $turnterm, int $turn=1) {
@@ -1910,8 +1909,14 @@ function updateTurntime($no) {
if($general['npc'] == 1 && $general['deadyear'] > $admin['year']) {
$general['killturn'] = ($general['deadyear'] - $admin['year']) * 12;
$general['npc'] = $general['npc_org'];
$query = "update general set owner=-1,npc='{$general['npc']}',killturn='{$general['killturn']}',mode=2 where no='$no'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$db->update('general', [
'owner'=>-1,
'npc'=>$general['npc_org'],
'killturn'=>$general['killturn'],
'mode'=>2,
'name2'=>null
], 'no=%i',$no);
$josaYi = JosaUtil::pick($general['name2'], '이');
$alllog[0] = "<C>●</>{$admin['month']}월:<Y>{$general['name2']}</>{$josaYi} <Y>{$general['name']}</>의 육체에서 <S>유체이탈</>합니다!";
@@ -2449,6 +2454,7 @@ function deleteNation($general) {
$oldNation = $db->queryFirstRow('SELECT * FROM nation WHERE nation=%i', $general['nation']);
$oldNationGenerals = $db->queryFirstColumn('SELECT `no` FROM general WHERE nation=%i', $general['nation']);
$oldNation['generals'] = $oldNationGenerals;
$oldNation['aux'] = Json::decode($oldNation['aux']);
// 전 장수 재야로 // 전 장수 소속 무소속으로
$query = "update general set belong=0,troop=0,level=0,nation=0,makelimit=12 where nation='{$general['nation']}'";
+3 -2
View File
@@ -747,8 +747,9 @@ function command_Other($turn, $commandtype) {
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<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>
+107 -1
View File
@@ -135,6 +135,28 @@ function getGenChar($type) {
return $call;
}
function getCharInfo(?int $type):?string {
if($type === null){
return null;
}
$infoText = [
10=>['은둔', '명성 -10%, 계급 -10%, 사기 -5, 훈련 -5, 단련 성공률 +10%'],
9=>['안전', '사기 -5, 징·모병 비용 -20%'],
8=>['유지', '훈련 -5, 징·모병 비용 -20%'],
7=>['재간', '명성 -10%, 징·모병 비용 -20%'],
6=>['출세', '명성 +10%, 징·모병 비용 +20%'],
5=>['할거', '명성 -10%, 훈련 +5'],
4=>['정복', '명성 -10%, 사기 +5'],
3=>['패권', '훈련 +5, 징·모병 비용 +20%'],
2=>['의협', '사기 +5, 징·모병 비용 +20%'],
1=>['대의', '명성 +10%, 훈련 -5'],
0=>['왕좌', '명성 +10%, 사기 -5'],
];
return $infoText[$type][1]??null;
}
function getGenSpecial($type) {
switch($type) {
case 0: $call = '-'; break;
@@ -179,6 +201,55 @@ function getGenSpecial($type) {
return $call;
}
function getSpecialInfo(?int $type):?string{
if($type === null){
return null;
}
//앞칸은 '설명을 위해' '그냥' 적어둠
$infoText = [
0 => ['-', null],
1 => ['경작', '[내정] 농지 개간 : 기본 보정 +10%, 성공률 +10%p, 비용 -20%'],
2 => ['상재', '[내정] 상업 투자 : 기본 보정 +10%, 성공률 +10%p, 비용 -20%'],
3 => ['발명', '[내정] 기술 연구 : 기본 보정 +10%, 성공률 +10%p, 비용 -20%'],
10 => ['축성', '[내정] 성벽 보수 : 기본 보정 +10%, 성공률 +10%p, 비용 -20%'],
11 => ['수비', '[내정] 수비 강화 : 기본 보정 +10%, 성공률 +10%p, 비용 -20%'],
12 => ['통찰', '[내정] 치안 강화 : 기본 보정 +10%, 성공률 +10%p, 비용 -20%'],
20 => ['인덕', '[내정] 주민 선정·정착 장려 : 기본 보정 +10%, 성공률 +10%p, 비용 -20%'],
30 => ['거상', '이것 저것'],
31 => ['귀모', '[계략] 화계·탈취·파괴·선동 : 성공률 +20%p'],
40 => ['귀병', '[군사] 귀병 계통 징·모병비 -10%<br>[전투] 계략 성공 확률 +20%p'],
41 => ['신산', '[계략] 화계·탈취·파괴·선동 : 성공률 +10%p<br>[전투] 계략 시도 확률 +20%p, 계략 성공 확률 +20%p '],
42 => ['환술', '[전투] 계략 성공 확률 +10%p, 계략 성공 시 대미지 +30%'],
43 => ['집중', '[전투] 계략 성공 시 대미지 +50%'],
44 => ['신중', '[전투] 계략 성공 확률 100%'],
45 => ['반계', '[전투] 상대의 계략을 30% 확률로 되돌림, 반목 성공시 대미지 추가(+60% → +100%)'],
50 => ['보병', '[군사] 보병 계통 징·모병비 -10%<br>[전투] 공격 시 아군 피해 -10%, 수비 시 아군 피해 -20%'],
51 => ['궁병', '[군사] 궁병 계통 징·모병비 -10%<br>[전투] 회피 확률 +20%p'],
52 => ['기병', '[군사] 기병 계통 징·모병비 -10%<br>[전투] 수비 시 대미지 +10%, 공격 시 대미지 +20%'],
53 => ['공성', '[군사] 차병 계통 징·모병비 -10%<br>[전투] 성벽 공격 시 대미지 +100%'],
60 => ['돌격', '[전투] 상대 회피 불가, 공격 시 전투 페이즈 +1, 공격 시 대미지 +10%'],
61 => ['무쌍', '[전투] 대미지 +10%, 공격 시 필살 확률 +10%p'],
62 => ['견고', '[전투] 수비 시 대미지 +10%, 공격 시 아군 피해 -10%'],
63 => ['위압', '[전투] 훈련/사기≥90, 병력≥1,000 일 때 첫 페이즈 위압 발동(적 공격 불가)'],
70 => ['저격', '[전투] 전투 개시 시 1/3 확률로 저격 발동'],
71 => ['필살', '[전투] 필살 확률 +20%p'],
72 => ['징병', '[군사] 징·모병비 -50%'],
73 => ['의술', '[군사] 매 턴마다 자신(100%)과 소속 도시 장수(적 포함 50%) 부상 회복<br>[전투] 페이즈마다 20% 확률로 치료 발동(아군 피해 1/3 감소)'],
74 => ['격노', '[전투] 상대방 필살 및 회피 시도시 일정 확률로 격노(필살) 발동, 공격 시 일정 확률로 진노(1페이즈 추가)'],
75 => ['척사', '[전투] 지역·도시 병종 상대로 대미지 +10%, 아군 피해 -10%']
];
return $infoText[$type][1]??null;
}
function getNationType($type) {
switch($type) {
case 13: $call = '명 가'; break;
@@ -727,7 +798,7 @@ function getHorseEff($horse) : int {
return $horse;
}
function getItemName($item) : string {
function getItemName($item) : ?string {
switch($item) {
case 0: $itemname = '-'; break;
case 1: $itemname = '환약(치료)'; break;
@@ -757,10 +828,45 @@ function getItemName($item) : string {
case 24: $itemname = '태평청령(의술)'; break;
case 25: $itemname = '태평요술(회피)'; break;
case 26: $itemname = '둔갑천서(회피)'; break;
default: $itemname = null;
}
return $itemname;
}
function getItemInfo(?int $item):?string{
$itemInfo = [
1=>['환약(치료)', '[군사] 턴 실행 전 부상 회복. 1회용'],
2=>['수극(저격)', '[전투] 전투 개시 전 20% 확률로 저격 시도. 1회용'],
3=>['탁주(사기)', '[전투] 사기 보정 +3. 1회용'],
4=>['청주(훈련)', '[전투] 훈련 보정 +3. 1회용'],
5=>['이추(계략)', '[계략] 화계·탈취·파괴·선동 : 성공률 +10%p. 1회용'],
6=>['향낭(계략)', '[계략] 화계·탈취·파괴·선동 : 성공률 +20%p. 1회용'],
7=>['오석산(치료)', '[군사] 턴 실행 전 부상 회복.'],
8=>['무후행군(치료)', '[군사] 턴 실행 전 부상 회복.'],
9=>['도소연명(치료)', '[군사] 턴 실행 전 부상 회복.'],
10=>['칠엽청점(치료)', '[군사] 턴 실행 전 부상 회복.'],
11=>['정력견혈(치료)', '[군사] 턴 실행 전 부상 회복.'],
12=>['과실주(훈련)', '[전투] 훈련 보정 +5'],
13=>['이강주(훈련)', '[전투] 훈련 보정 +5'],
14=>['의적주(사기)', '[전투] 사기 보정 +5'],
15=>['두강주(사기)', '[전투] 사기 보정 +5'],
16=>['보령압주(사기)', '[전투] 사기 보정 +5'],
17=>['철벽서(훈련)', '[전투] 훈련 보정 +7'],
18=>['단결도(훈련)', '[전투] 훈련 보정 +7'],
19=>['춘화첩(사기)', '[전투] 사기 보정 +7'],
20=>['초선화(사기)', '[전투] 사기 보정 +7'],
21=>['육도(계략)', '[계략] 화계·탈취·파괴·선동 : 성공률 +20%p'],
22=>['삼략(계략)', '[계략] 화계·탈취·파괴·선동 : 성공률 +20%p'],
23=>['청낭서(의술)', '[군사] 매 턴마다 자신(100%)과 소속 도시 장수(적 포함 50%) 부상 회복<br>[전투] 페이즈마다 20% 확률로 치료 발동(아군 피해 1/3 감소)'],
24=>['태평청령(의술)', '[군사] 매 턴마다 자신(100%)과 소속 도시 장수(적 포함 50%) 부상 회복<br>[전투] 페이즈마다 20% 확률로 치료 발동(아군 피해 1/3 감소)'],
25=>['태평요술(회피)', '[전투] 회피 확률 +20%p'],
26=>['둔갑천서(회피)', '[전투] 회피 확률 +20%p'],
];
return $itemInfo[$item][1]??null;
}
function getItemCost2($weap) : int {
switch($weap) {
case 0: $weapcost = 0; break;
+77 -45
View File
@@ -395,23 +395,33 @@ function preUpdateMonthly() {
}
//첩보-1
$query = "select nation,spy from nation where spy!=''";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nationCount = MYDB_num_rows($result);
for($i=0; $i < $nationCount; $i++) {
$nation = MYDB_fetch_array($result);
$spy = ""; $k = 0;
$cities = [];
if($nation['spy'] != "") { $cities = explode("|", (string)$nation['spy']); }
while(count($cities)) {
$cities[$k]--;
if($cities[$k]%10 != 0) { $spy .= (string)$cities[$k]; }
$k++;
if($k >= count($cities)) { break; }
if($cities[$k-1]%10 != 0) { $spy .= "|"; }
foreach($db->queryAllLists("SELECT nation, spy FROM nation WHERE spy!='' AND spy!='{}'") as [$nationNo, $rawSpy]){
if (strpos($rawSpy, '|') !== false || is_numeric($rawSpy)) {
//TODO: 0.8 버전 이후에는 삭제할 것. 이후 버전은 json으로 변경됨.
$spyInfo = [];
foreach(explode('|', $rawSpy) as $value){
$value = intval($value);
$cityNo = intdiv($value, 10);
$remainMonth = $value % 10;
$spyInfo[$cityNo] = $remainMonth;
}
}
$query = "update nation set spy='$spy' where nation='{$nation['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
else{
$spyInfo = Json::decode($rawSpy);
}
foreach($spyInfo as $cityNo => $remainMonth){
if($remainMonth <= 1){
unset($spyInfo[$cityNo]);
}
else{
$spyInfo[$cityNo] -= 1;
}
}
$db->update('nation', [
'spy'=>Json::encode($spyInfo, Json::EMPTY_ARRAY_IS_DICT)
], 'nation=%i', $nationNo);
}
return true;
@@ -427,6 +437,15 @@ function postUpdateMonthly() {
$history = [];
//도시 수 측정
$cityNations = [];
foreach($db->queryAllLists('SELECT city, name, nation FROM city') as [$cityID, $cityName, $cityNation]){
if(!key_exists($cityNation, $cityNations)){
$cityNations[$cityNation] = [];
}
$cityNations[$cityNation][] = $cityName;
}
//각 국가 전월 장수수 대비 당월 장수수로 단합도 산정
//각 국가 장수수를 구하고 국력 산정
// $query = "select nation,gennum from nation where level>0";
@@ -438,34 +457,33 @@ function postUpdateMonthly() {
// 접속률
// 숙련도
// 명성,공헌
$query = "
select
A.nation,
A.gennum, A.gennum2, A.chemi,
round((
round(((A.gold+A.rice)+(select sum(gold+rice) from general where nation=A.nation))/100)
+A.tech
+if(A.level=0,0,(
select round(
sum(pop)*sum(pop+agri+comm+secu+wall+def)/sum(pop2+agri2+comm2+secu2+wall2+def2)/100
) from city where nation=A.nation and supply=1
))
+(select sum(leader+power+intel) from general where nation=A.nation)
+(select round(sum(dex0+dex10+dex20+dex30+dex40)/1000) from general where nation=A.nation)
+(select round(sum(experience+dedication)/100) from general where nation=A.nation)
+(select round(avg(connect)) from general where nation=A.nation)
)/10)
as power
from nation A
group by A.nation
";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nationCount = MYDB_num_rows($result);
$genNum = [];
for($i=0; $i < $nationCount; $i++) {
$nation = MYDB_fetch_array($result);
$nations = $db->query('SELECT
A.nation,
A.gennum, A.gennum2, A.chemi, A.aux,
round((
round(((A.gold+A.rice)+(select sum(gold+rice) from general where nation=A.nation))/100)
+A.tech
+if(A.level=0,0,(
select round(
sum(pop)*sum(pop+agri+comm+secu+wall+def)/sum(pop2+agri2+comm2+secu2+wall2+def2)/100
) from city where nation=A.nation and supply=1
))
+(select sum(leader+power+intel) from general where nation=A.nation)
+(select round(sum(dex0+dex10+dex20+dex30+dex40)/1000) from general where nation=A.nation)
+(select round(sum(experience+dedication)/100) from general where nation=A.nation)
+(select round(avg(connect)) from general where nation=A.nation)
)/10)
as power,
(select sum(crew) from general where nation=A.nation) as totalCrew
from nation A
group by A.nation');
foreach($nations as $nation) {
$genNum[$nation['nation']] = $nation['gennum'];
$aux = Json::decode($nation['aux']);
if($nation['gennum'] > $nation['gennum2']) {
// 장수가 증가했을때
$nation['chemi'] -= ceil(($nation['gennum'] - $nation['gennum2']) / $nation['gennum'] * 100);
@@ -479,9 +497,21 @@ group by A.nation
if($nation['chemi'] > 100) { $nation['chemi'] = 100; }
//약간의 랜덤치 부여 (95% ~ 105%)
$nation['power'] = Util::round($nation['power'] * (rand()%101 + 950) / 1000);
$query = "update nation set power='{$nation['power']}',gennum2='{$nation['gennum']}',chemi='{$nation['chemi']}' where nation='{$nation['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$aux['maxPower'] = max($aux['maxPower']??0, $nation['power']);
$aux['maxCrew'] = max($aux['maxCrew']??0, Util::toInt($nation['totalCrew']));
if(count($cityNations[$nation['nation']]??[]) > count($aux['maxCities']??[])){
$aux['maxCities'] = $cityNations[$nation['nation']];
}
$db->update('nation', [
'power'=>$nation['power'],
'gennum2'=>$nation['gennum'],
'chemi'=>$nation['chemi'],
'aux'=>Json::encode($aux)
], 'nation=%i', $nation['nation']);
}
// 전쟁기한 세팅
@@ -690,6 +720,7 @@ function checkMerge() {
$oldNation = $db->queryFirstRow('SELECT * FROM nation WHERE nation=%i', $me['nation']);
$oldNationGenerals = $db->queryFirstColumn('SELECT `no` FROM general WHERE nation=%i', $me['nation']);
$oldNation['generals'] = $oldNationGenerals;
$oldNation['aux'] = Json::decode($oldNation['aux']);
// 자금 통합, 외교제한 5년, 기술유지
$query = "update nation set name='{$you['makenation']}',gold=gold+'{$mynation['gold']}',rice=rice+'{$mynation['rice']}',surlimit='24',totaltech='$newTotalTech',tech='$newTech',gennum='{$newGenCount}' where nation='{$younation['nation']}'";
@@ -820,6 +851,7 @@ function checkSurrender() {
$oldNation = $db->queryFirstRow('SELECT * FROM nation WHERE nation=%i', $me['nation']);
$oldNationGenerals = $db->queryFirstColumn('SELECT `no` FROM general WHERE nation=%i', $me['nation']);
$oldNation['generals'] = $oldNationGenerals;
$oldNation['aux'] = Json::decode($oldNation['aux']);
$newGenCount = $gencount + $gencount2;
if($newGenCount < GameConst::$initialNationGenLimit) { $newGenCount = GameConst::$initialNationGenLimit; }
@@ -1332,6 +1364,7 @@ function checkEmperior() {
$oldNation = $db->queryFirstRow('SELECT * FROM nation WHERE nation=%i', $nation['nation']);
$oldNation['generals'] = $db->queryFirstColumn('SELECT `no` FROM general WHERE nation=%i', $nation['nation']);
$oldNation['aux'] = Json::decode($oldNation['aux']);
storeOldGenerals(0, $admin['year'], $admin['month']);
storeOldGenerals($nation['nation'], $admin['year'], $admin['month']);
@@ -1339,7 +1372,6 @@ function checkEmperior() {
$db->insert('ng_old_nations', [
'server_id'=>UniqueConst::$serverID,
'nation'=>$nation['nation'],
'history'=>'',
'data'=>Json::encode($oldNation)
]);
+10 -4
View File
@@ -156,7 +156,10 @@ function pushOldNationStop(int $no, int $nationNo){
}
//DB-based
function pushNationHistory($nation, $history) {
function pushNationHistory($nation, ?string $history) {
if(!$history){
return;
}
if(!$nation || !$nation['nation']){
return;
}
@@ -164,7 +167,10 @@ function pushNationHistory($nation, $history) {
$history.'<br>', $nation['nation']);
}
function pushGeneralHistory($me, $history) {
function pushGeneralHistory($me, ?string $history) {
if(!$history){
return;
}
DB::db()->query("UPDATE general set history=concat(%s, history) where no=%i",
$history.'<br>', $me['no']);
}
@@ -174,7 +180,7 @@ function getGeneralHistoryAll(int $no) {
return ConvertLog($history);
}
function pushWorldHistory(array $history, $year=null, $month=null) {
function pushWorldHistory(?array $history, $year=null, $month=null) {
if(!$history){
return;
}
@@ -221,7 +227,7 @@ function getWorldHistoryWithDate($year, $month) {
}
function pushGeneralPublicRecord(array $history, $year=null, $month=null) {
function pushGeneralPublicRecord(?array $history, $year=null, $month=null) {
if(!$history){
return;
}
+4 -2
View File
@@ -8,7 +8,9 @@ function printLimitMsg($turntime) {
<html>
<head>
<title>접속제한</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
</head>
@@ -29,7 +31,7 @@ function bar($per, $h=7) {
$per = round($per, 1);
$str = "<div class='bar_out' style='height:{$h2}px;'>
$str = "<div class='bar_out' style='height:{$h}px;'>
<div class='bar_in' style='background:url(".ServConfig::$gameImagePath."/pr{$h2}.gif)'></div>
<div style='width:{$per}%;background:url(".ServConfig::$gameImagePath."/pb{$h2}.gif)'></div>
</div>";
+19 -9
View File
@@ -94,19 +94,29 @@ function getWorldMap($req){
$myNation = null;
}
$spyInfo = (object)null;
if($myNation){
$spyList = $db->queryFirstField('select `spy` from `nation` where `nation`=%i',
$rawSpy = $db->queryFirstField('select `spy` from `nation` where `nation`=%i',
$myNation);
if($spyList){
$spyList = array_map('\sammo\Util::toInt', explode("|", $spyList));
if(strpos($rawSpy, '|') !== false || is_numeric($rawSpy)){
//NOTE: 0.8 이전 데이터가 남아있으므로, 0.8버전으로 마이그레이션 이후에도 이곳은 삭제하면 안됨
$spyInfo = [];
foreach(explode('|', $rawSpy) as $value){
$value = intval($value);
$cityNo = intdiv($value, 10);
$remainMonth = $value % 10;
$spyInfo[$cityNo] = $remainMonth;
}
}
else{
$spyList = [];
else if($rawSpy != ''){
$spyInfo = Json::decode($rawSpy);
}
}
else{
$spyList = [];
if(!$spyInfo){
$spyInfo = (object)null;
}
$nationList = [];
@@ -142,7 +152,7 @@ function getWorldMap($req){
'month' => $month,
'cityList' => $cityList,
'nationList' => $nationList,
'spyList' => $spyList,
'spyList' => $spyInfo,
'shownByGeneralList' => $shownByGeneralList,
'myCity' => $myCity,
'myNation' => $myNation,
+7 -7
View File
@@ -361,7 +361,7 @@ function processAI($no) {
}
break;
case 2: //이동 20%
$paths = explode("|", $city['path']);
$paths = explode('|', $city['path']);
$command = EncodeCommand(0, 0, $paths[rand()%count($paths)], 21);
break;
default:
@@ -429,7 +429,7 @@ function processAI($no) {
return;
} elseif(rand()%4 > 0) {
//이동
$paths = explode("|", $city['path']);
$paths = explode('|', $city['path']);
$command = EncodeCommand(0, 0, $paths[rand()%count($paths)], 21);
$query = "update general set turn0='$command' where no='{$general['no']}'";
MYDB_query($query, $connect) or Error("processAI09 ".MYDB_error($connect),"");
@@ -600,7 +600,7 @@ function processAI($no) {
//현도시가 전방이면 공격 가능성 체크
if($city['front'] > 0) {
//주변도시 체크
$paths = explode("|", $city['path']);
$paths = explode('|', $city['path']);
for($i=0; $i < count($paths); $i++) {
$query = "select city,nation from city where city='$paths[$i]'";
$result = MYDB_query($query, $connect) or Error("processAI20 ".MYDB_error($connect),"");
@@ -766,7 +766,7 @@ function processAI($no) {
$command = EncodeCommand(0, 0, 0, (rand()%2)*8 + 1); // 준비는 됐으나 아직 선포중이면 내정, 조달
} else {
//공격 & 내정
$paths = explode("|", $city['path']);
$paths = explode('|', $city['path']);
for($i=0; $i < count($paths); $i++) {
$query = "select city,nation from city where city='$paths[$i]'";
$result = MYDB_query($query, $connect) or Error("processAI21 ".MYDB_error($connect),"");
@@ -1008,7 +1008,7 @@ function NPCStaffWork($general, $nation, $dipState){
$isWarUser = true;
break;
}
if(Util::randF(0.2)){
if(Util::randBool(0.2)){
$isWarUser = false;
break;
}
@@ -1206,7 +1206,7 @@ function NPCStaffWork($general, $nation, $dipState){
$score *= 4;
}
if(Util::randF(0.3) && $frontImportantCitiesID){
if(Util::randBool(0.3) && $frontImportantCitiesID){
$targetCityID = Util::choiceRandom($frontImportantCitiesID);
}
else{
@@ -1262,7 +1262,7 @@ function NPCStaffWork($general, $nation, $dipState){
if($targetCity['pop'] < 33000 + $nationGeneral['leader']){
continue;
}
if (Util::randF($targetCity['pop'] / $targetCity['pop2'])) {
if (Util::randBool($targetCity['pop'] / $targetCity['pop2'])) {
break;
}
}
+23 -23
View File
@@ -898,7 +898,7 @@ function process_11(&$general, $type) {
if(intdiv($armtype, 10) == 1 && $general['special2'] == 51) { $cost *= 0.9; }
if(intdiv($armtype, 10) == 2 && $general['special2'] == 52) { $cost *= 0.9; }
if(intdiv($armtype, 10) == 3 && $general['special2'] == 40) { $cost *= 0.9; }
if(intdiv($armtype, 10) == 4 && $general['special2'] == 43) { $cost *= 0.9; }
if(intdiv($armtype, 10) == 4 && $general['special2'] == 53) { $cost *= 0.9; }
if($general['special2'] == 72) { $cost *= 0.5; }
if($type == 1) { $dtype = "징병"; }
@@ -1743,32 +1743,32 @@ function process_31(&$general) {
$query = "update general set resturn='SUCCESS',gold='{$general['gold']}',rice='{$general['rice']}',leader2='{$general['leader2']}',dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "select spy from nation where nation='{$general['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
if($nation['spy'] != "")
{
$cities = array_map('intval', explode("|", $nation['spy']));
$rawSpy = $db->queryFirstField('SELECT spy FROM nation WHERE nation = %i', $general['nation']);
if($rawSpy == ''){
$spyInfo = [];
}
else{
$cities = [];
}
$exist = 0;
for($i=0; $i < count($cities); $i++) {
if(intdiv($cities[$i], 10) == $destination) {
$exist = 1;
break;
else if(strpos($rawSpy, '|') !== false || is_numeric($rawSpy)){
//TODO: 0.8 버전 이후에는 삭제할 것. 이후 버전은 json으로 변경됨.
$spyInfo = [];
foreach(explode('|', $rawSpy) as $value){
$value = intval($value);
$cityNo = intdiv($value, 10);
$remainMonth = $value % 10;
$spyInfo[$cityNo] = $remainMonth;
}
}
// 기존 첩보 목록에 없으면 새로 등록, 있으면 갱신
if($exist == 0) {
$cities[] = $destination * 10 + 3;
} else {
$cities[$i] = $destination * 10 + 3;
else{
$spyInfo = Json::decode($rawSpy);
}
$spy = implode("|", $cities);
$query = "update nation set spy='$spy' where nation='{$general['nation']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$spyInfo[$destination] = 3;
$db->update('nation', [
'spy'=>Json::encode($spyInfo, Json::EMPTY_ARRAY_IS_DICT)
], 'nation=%i', $general['nation']);
$log = checkAbility($general, $log);
}
+36
View File
@@ -64,6 +64,42 @@ function CoreTurnTable() {
";
}
function displayCharInfo(?int $type):string{
$info = getCharInfo($type);
$text = getGenChar($type);
$templates = new \League\Plates\Engine(__dir__.'/templates');
return $templates->render('tooltip', [
'text'=>$text,
'info'=>$info,
]);
}
function displaySpecialInfo(?int $type):string{
$info = getSpecialInfo($type);
$text = getGenSpecial($type);
$templates = new \League\Plates\Engine(__dir__.'/templates');
return $templates->render('tooltip', [
'text'=>$text,
'info'=>$info,
]);
}
function displayItemInfo(?int $type):string{
$info = getItemInfo($type);
$text = getItemName($type);
$templates = new \League\Plates\Engine(__dir__.'/templates');
return $templates->render('tooltip', [
'text'=>$text,
'info'=>$info,
]);
}
function allButton() {
$db = DB::db();
+5 -3
View File
@@ -84,8 +84,10 @@ $color = "cyan";
<title><?=UniqueConst::$serverName?>: 메인</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
<meta name="viewport" content="width=1024" />
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('../e_lib/jquery.redirect.js')?>
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
<?=WebUtil::printJS('../d_shared/common_path.js')?>
<?=WebUtil::printJS('js/common.js')?>
<?=WebUtil::printJS('js/main.js')?>
@@ -103,7 +105,7 @@ $(function(){
}, 10000);
});
</script>
<?=WebUtil::printCSS('css/normalize.css')?>
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
<?=WebUtil::printCSS('css/main.css')?>
@@ -286,7 +288,7 @@ else if($session->userGrade == 4){
<div class="message_input_form bg0">
<select id="mailbox_list" size="1">
<select name="genlist" size="1" style="color:white;background-color:black;font-size:13">
<select name="genlist" size="1" style="color:white;background-color:black;font-size:13px">
+2 -1
View File
@@ -27,7 +27,8 @@ if($session->userGrade < 5 && !$allowReset){
<title>설치</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
<?=WebUtil::printJS('../e_lib/jquery.validate.min.js')?>
<?=WebUtil::printJS('js/common.js')?>
+2 -1
View File
@@ -20,7 +20,8 @@ if($session->userGrade == 5){
<title>설치</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
<?=WebUtil::printJS('../e_lib/jquery.validate.min.js')?>
<?=WebUtil::printJS('js/common.js')?>
+9
View File
@@ -6,6 +6,15 @@ include "func.php";
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env');
if (!$db->queryFirstField("SHOW TABLES LIKE 'reserved_open'")) {
Json::die([
'result'=>true,
'affected'=>0,
'status'=>'no_reserved_table'
]);
}
$reserved = $db->queryFirstRow('SELECT `date`, options FROM reserved_open ORDER BY `date` ASC LIMIT 1');
if(!$reserved){
+2 -1
View File
@@ -13,7 +13,8 @@ $defaultPost = [
'neutralView' => false,
'showMe' => true
];
$post = WebUtil::parseJsonPost() + $defaultPost;
$post = Json::decode(Util::getReq('data', 'string', '{}'));
$post += $defaultPost;
if(!$session->isGameLoggedIn()){
$post['neutralView'] = true;
+1 -1
View File
@@ -6,7 +6,7 @@ include "func.php";
$year = Util::getReq('year', 'int');
$month = Util::getReq('month', 'int');
$serverID = Util::getReq('server_id', 'string', null);
$serverID = Util::getReq('serverID', 'string', null);
extractMissingPostToGlobals();
+1 -1
View File
@@ -17,7 +17,7 @@ if (!$generalID) {
]);
}
$jsonPost = WebUtil::parseJsonPost();
$jsonPost = Json::decode(Util::getReq('data', 'string', '{}'));
$msgID = Util::toInt($jsonPost['msgID']??null);
$msgResponse = $jsonPost['response']??null;
+1 -2
View File
@@ -7,8 +7,7 @@ include('func.php');
$session = Session::requireGameLogin([])->setReadOnly();
$userID = Session::getUserID();
$jsonPost = WebUtil::parseJsonPost();
$reqSequence = (int)Util::array_get($jsonPost['sequence'], 0);
$reqSequence = Util::getReq('sequence', 'int', 0);
list($generalID, $nationID, $generalName) = DB::db()->queryFirstList(
+1 -1
View File
@@ -4,7 +4,7 @@ namespace sammo;
include 'lib.php';
include 'func.php';
$post = WebUtil::parseJsonPost();
$post = Json::decode(Util::getReq('data', 'string', '{}'));
'@phan-var mixed[] $post';
$v = new Validator($post);
+19 -4
View File
@@ -31,16 +31,31 @@ $connect=$db->get();
<html>
<head>
<title><?=UniqueConst::$serverName?>: 장수생성</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<script>
var defaultStatTotal = <?=GameConst::$defaultStatTotal?>;
var defaultStatMin = <?=GameConst::$defaultStatMin?>;
var defaultStatMax = <?=GameConst::$defaultStatMax?>;
var charInfoText = <?php
$charInfoText = [];
for($i=0;$i<=9;$i++){
//XXX:하드코딩 금지!
$charInfoText[$i] = getCharInfo($i);
}
echo Json::encode((object)$charInfoText);
?>;
</script>
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
<?=WebUtil::printJS('../d_shared/common_path.js')?>
<?=WebUtil::printJS('js/common.js')?>
<?=WebUtil::printJS('js/join.js')?>
</head>
@@ -104,7 +119,7 @@ if ($admin['show_img_level'] >= 1 && $member['grade'] >= 1 && $member['picture']
<tr>
<td width=498 align=right id=bg1>성격</td>
<td colspan=2>
<select name=character size=1 maxlength=15 style=color:white;background-color:black;>
<select id="selChar" name=character size=1 maxlength=15 style=color:white;background-color:black;>
<option selected value=11>????</option>
<!--
<option value=10>은둔</option>
@@ -119,7 +134,7 @@ if ($admin['show_img_level'] >= 1 && $member['grade'] >= 1 && $member['picture']
<option value=2>의협</option>
<option value=1>대의</option>
<option value=0>왕좌</option>
</select> ※보정은 도움말 참고
</select> <span id="charInfoText"></span>
</td>
</tr>
<tr>
+1 -1
View File
@@ -281,7 +281,7 @@ $rootDB->insert('member_log', [
?>
<script>
window.alert('정상적으로 회원 가입되었습니다. 장수명 : <?=$name?> \n튜토리얼을 꼭 읽어보세요!');
window.alert('정상적으로 회원 가입되었습니다. 장수명 : <?=$name?> \n위키와 팁/강좌 게시판을 꼭 읽어보세요!');
</script>
<script>location.replace('./');</script>
+10 -1
View File
@@ -128,4 +128,13 @@ function getIconPath(imgsvr, picture){
else{
return pathConfig.root+'/d_pic/'+picture;
}
}
}
jQuery(function($){
$('.obj_tooltip').tooltip({
title:function(){
return $.trim($(this).find('.tooltiptext').html());
},
html:true
});
});
+908
View File
@@ -0,0 +1,908 @@
$(function() {
var cityList = {};
var userList = {};
var cityGroupOrder = ['하북','중원','서북','서촉','남중','초','오월','동이'];
var city규모 = {:1,:2,:3,:4,:5,:6,:7,:8};
window.cityList = cityList;
window.userList = userList;
var basicPath = document.location.pathname;
basicPath = basicPath.substring(0, basicPath.lastIndexOf('/'))+'/';
var mergeSort = function(arr,cmpFunc){
if(typeof cmpFunc == "undefined"){
cmpFunc = function(a,b){
if(a<b) return -1;
if(a>b) return 1;
return 0;
}
}
var merge = function(left,right){
var retVal=[];
var leftIdx=0;
var rightIdx=0;
while(leftIdx<left.length && rightIdx<right.length){
var cmpVal = cmpFunc(left[leftIdx],right[rightIdx]);
if(cmpVal<=0){
retVal.push(left[leftIdx]);
leftIdx++;
}
else{
retVal.push(right[rightIdx]);
rightIdx++;
}
}
retVal = retVal.concat(left.slice(leftIdx)).concat(right.slice(rightIdx))
return retVal;
};
var _mergeSort = function(arr){
if(arr.length<2){
return arr;
}
var middle = Math.floor(arr.length/2);
var left = arr.slice(0,middle);
var right = arr.slice(middle);
return merge(_mergeSort(left),_mergeSort(right));
};
return _mergeSort(arr);
};
window.mergeSort = mergeSort;
var extDutyWindow = function(userInfo){
window.currUser = userInfo;
//도시 순서 재구성
var subCityGroupList = {};
var subCityList = {};
var tmpOldVal = 0;
//var callCity = function(num){console.log('city no.'+num+' is clicked!')};
if($('#ext_win').length==0){
var $win = $('<div id="ext_win" style="padding:0;" title="관직 임명"><table style="padding:0;margin:0;" cellspacing="0" cellpadding="0" border="0"><tr><td width="700px" style="padding:0;"><iframe id="in_frame" src="map.php?type=1&amp;graphic=1" width="700" height="520" frameborder="0" marginwidth="0" marginheight="0" topmargin="0" scrolling="no"></iframe></td>'+
'<td width="305px" style="padding:0;vertical-align:top;height:520px;"><div style="height:520px;width:305px;overflow-y:scroll;overflow-x:hidden;">'+
'<table id="inner_table"><thead><tr><th width="35">도시</th><th width="85">태수</th><th width="85">군사</th><th width="85">시중</th></tr></thead><tbody class="content">'+
'</tbody></table></div></td></tr></table>'+
'<form name="form1" id="fake_form"><span id="user_name"></span> : <select name="double" id="city_select"></select>'+
'<div id="duty_radio" style="display:inline;">'+
'<input type="radio" id="duty_type1" value="4" name="duty_radio"><label for="duty_type1">태수</label>'+
'<input type="radio" id="duty_type2" value="3" name="duty_radio"><label for="duty_type2">군사</label>'+
'<input type="radio" id="duty_type3" value="2" name="duty_radio"><label for="duty_type3">시중</label>'+
'</div></form></div>');
$win.hide();
$win.css('font-size','9pt');
$('#fake_form').css('display','inline');
$('body').append($win);
$('#inner_table').attr('border','1').attr('cellspacing',"0").attr('cellpadding',"0")
.attr('bordercolordark',"gray").attr('bordercolorlight',"black").attr('align','center')
.css('font-size','13px').css('width','290px');
$('#inner_table thead tr');
$('#fake_form').submit(function(){
return false;
});
$('#in_frame').load(function(){
$('#in_frame').contents().find('div').click(function(){$('#city_select').change();});
});
$("#duty_radio").buttonset();
var $city_select = $('#city_select');
$city_select.css('color','white').css('background-color','black');
$city_select.change(function(event){
if($city_select.val()==null){
$city_select.val(tmpOldVal);
return false;
}
if($city_select.val() == tmpOldVal){
return false;
}
tmpOldVal = $city_select.val();
//console.log(tmpOldVal);
var newInfo = subCityList[tmpOldVal];
var cityInfo = newInfo.city;
var p태수 = cityInfo.p태수 && currUser.p태수;
var p군사 = cityInfo.p군사 && currUser.p군사;
var p시중 = cityInfo.p시중 && currUser.p시중;
//console.log(p태수,p군사,p시중);
$('#duty_type1').button({disabled:!p태수});
$('#duty_type2').button({disabled:!p군사});
$('#duty_type3').button({disabled:!p시중});
var $태수 = cityInfo.$태수;
var $군사 = cityInfo.$군사;
var $시중 = cityInfo.$시중;
return true;
});
$win.dialog({
autoOpen:false,
width:1005,
height:680,
buttons:{
"임명":function(){
//console.log("임명!");
var $checked = $('#duty_radio :radio:checked');
if($checked.length==0 || $checked.attr('disabled')=='disabled'){
alert('직책을 선택해주세요!');
return false;
}
var type = $checked.attr('value');
var text = $checked.next().text();
var userVal = currUser.val;
var userName = currUser.name;
var cityVal = $city_select.val();
var cityInfo = subCityList[cityVal].city;
$.post(basicPath+'c_myBossInfo.php',{
citylist:cityVal,
genlist:userVal,
level:type,
btn:'임명'
},function(rawData){
cityInfo['p'+text]=false;
var $target = cityInfo.users.find('.mode_'+type);
$target.prop('disabled',true);
$target.css('background','transparent');
$target.css('border','0');
$target.css('color','');
cityInfo['$'+text].html(userName);
$win.dialog("close");
});
},
"닫기":function(){
$win.dialog("close");
}
}
});
//console.log($win.parent());
$win.parent().css('font-size','10pt');
}
$('#ext_win').dialog("close").dialog( "option", "position", { my: "center top", at: "center bottom", of: userInfo.$user} );
var $innerContent = $('#inner_table .content');
$innerContent.html('');
$("#user_name").html(userInfo.name+'['+userInfo.city+']');
$('#city_select').html('');
$.each(cityList,function(idx,cityInfo){
var 지역 = cityInfo.지역;
var p태수 = cityInfo.p태수 && currUser.p태수;
var p군사 = cityInfo.p군사 && currUser.p군사;
var p시중 = cityInfo.p시중 && currUser.p시중;
var newInfo = {
지역 : 지역,
규모 : cityInfo.규모,
이름 : cityInfo.이름,
val : cityInfo.val,
city : cityInfo,
p태수 : p태수,
p군사 : p군사,
p시중 : p시중
};
//console.log(newInfo);
if(p태수 || p군사 || p시중){
if(typeof subCityGroupList[지역] == 'undefined'){
subCityGroupList[지역] = [];
}
subCityGroupList[지역].push(newInfo);
subCityList[cityInfo.val] = newInfo;
}
});
$.each(cityGroupOrder,function(idx,groupName){
if(typeof subCityGroupList[groupName] == 'undefined'){
return true;
}
var subList = subCityGroupList[groupName];
var $group = $('<tr><td colspan="4" style="color:skyblue;">【 '+groupName+' 】</td></tr>');
$innerContent.append($group);
subList.sort(function(a,b){
var cmp규모 = city규모[a.규모] - city규모[b.규모];
if(cmp규모 != 0) return cmp규모;
return a.이름.localeCompare(b.이름);
});
var $optgroup = $('<optgroup label=" 【 '+groupName+' 】 " style="color:skyblue;"></optgroup>');
$.each(subList,function(idx,newInfo){
$optgroup.append('<option value="'+newInfo.val+'" style="color:white;">'+newInfo.이름+'</option>');
var cityInfo = newInfo.city;
var $city = $('<tr><td>'+newInfo.이름+'</td></tr>');
var $태수 = cityInfo.$태수.clone();
$city.append($태수);
if(!newInfo.p태수){
$태수.css('color','red');
}
else{
$태수.click(function(){
$('#duty_radio :radio:eq(0)').attr('checked','checked');
$('#duty_radio :radio').button('refresh');
}).css('cursor','pointer');
}
var $군사 = cityInfo.$군사.clone();
$city.append($군사);
if(!newInfo.p군사)$군사.css('color','red');
else{
$군사.click(function(){
$('#duty_radio :radio:eq(1)').attr('checked','checked');
$('#duty_radio :radio').button('refresh');
}).css('cursor','pointer');
}
var $시중 = cityInfo.$시중.clone();
$city.append($시중);
if(!newInfo.p시중)$시중.css('color','red');
else{
$시중.click(function(){
$('#duty_radio :radio:eq(2)').attr('checked','checked');
$('#duty_radio :radio').button('refresh');
}).css('cursor','pointer');
}
$innerContent.append($city);
$city.click(function(){
$('#city_select').val(newInfo.val).change();
});
});
$('#city_select').append($optgroup);
});
tmpOldVal = $('#city_select').val();
$('#city_select').change();
$('#ext_win').dialog("open");
};
var loadDuty = function(){
try{
$('.for_duty').remove();
$.get(basicPath+'b_myBossInfo.php',function(rawData){
$html = $(rawData);
//window.$html = $html;
var cnt =0;
var $tmpTable = null;
$html.each(function(idx){
if(this.tagName == "TABLE"){
cnt+=1;
if(cnt==5){
$tmpTable = $(this);
return false;
}
}
});
$selects = $tmpTable.find("select");
if($selects.length == 0){
alert("수뇌가 아닙니다!");
return false;
}
var setUserAvailable = function($userList,typeName){
$userList.each(function(idx){
var $this = $(this);
var val = $this.val();
var name = $.trim($this.text());
for(var i=name.length-1;i>0;i--){
if(name[i]=='【'){
name = $.trim(name.substr(0,i));
break;
}
}
if(val == '0'){
return true;
}
if(typeof userList[name] != 'undefined'){
userList[name].val = val;
userList[name][typeName] = true;
}
});
};
var setCityAvailiable = function($cityList,typeName){
$cityList.each(function(idx){
var $this = $(this);
var val = $.trim($this.val());
var name = $.trim($this.text());
cityList[name].val = val;
cityList[name][typeName] = true;
});
}
$.each(cityList,function(idx,cityInfo){
cityInfo.p태수=false;
cityInfo.p군사=false;
cityInfo.p시중=false;
});
$.each(userList,function(idx,userInfo){
userInfo.p태수=false;
userInfo.p군사=false;
userInfo.p시중=false;
});
setUserAvailable($selects.eq(1).find("option"),"p태수");
setUserAvailable($selects.eq(3).find("option"),"p군사");
setUserAvailable($selects.eq(5).find("option"),"p시중");
setCityAvailiable($selects.eq(0).find("option"),"p태수");
setCityAvailiable($selects.eq(2).find("option"),"p군사");
setCityAvailiable($selects.eq(4).find("option"),"p시중");
$.each(cityList,function(idx,cityInfo){
//console.log(cityInfo.users.children());
cityInfo.users.children().each(function(idx){
//console.log(this);
var $this = $(this);
var username = $this.data('username');
var userInfo = userList[username];
if(!userInfo){
return true;
}
if(userInfo.val == '-1'){
return true;
}
$name = $this.find('.nameplate');
$name.append('<br class="for_duty">');
var addBtn=function($name,cityInfo,userInfo,type,text,warn){
var enabled = cityInfo['p'+text]&&userInfo['p'+text];
var cityVal = cityInfo.val;
var $btn = $('<button>'+text.substr(0,1)+'</button>');
$btn.addClass('mode_'+type);
$btn.addClass('for_duty');
if(!enabled){
$btn.prop('disabled',true);
$btn.css('background','transparent');
$btn.css('border','0');
}
else{
if(userInfo.is수뇌){
$btn.css('color','red');
}
}
$btn.css('padding','1px 4px');
$btn.css('margin','0');
$btn.click(function(){
if(userInfo.is수뇌){
if(!confirm('수뇌입니다. 임명할까요?')){
return false;
}
}
$.post(basicPath+'c_myBossInfo.php',{
citylist:cityVal,
genlist:userInfo.val,
level:type,
btn:'임명'
},function(rawData){
cityInfo['p'+text]=false;
var $target = cityInfo.users.find('.mode_'+type);
$target.prop('disabled',true);
$target.css('background','transparent');
$target.css('border','0');
$target.css('color','');
cityInfo['$'+text].html(userInfo.name);
});
});
//console.log($btn);
$name.append($btn);
};
addBtn($name,cityInfo,userInfo,4,'태수');
addBtn($name,cityInfo,userInfo,3,'군사');
addBtn($name,cityInfo,userInfo,2,'시중');
//특수 버튼!
if(userInfo.p태수||userInfo.p군사||userInfo.p시중){
var $btn = $('<button>...</button>');
$btn.addClass('for_duty');
if(userInfo.is수뇌){
$btn.css('color','red');
}
$btn.css('padding','1px 4px');
$btn.css('margin','0');
$btn.click(function(){
if(userInfo.is수뇌){
if(!confirm('수뇌입니다. 임명할까요?')){
return false;
}
}
extDutyWindow(userInfo);
});
$btn.css('border','solid 1px Chocolate').css('background-color','#400000').css('margin-left','4px');
$btn.css('line-hight','20px').css('color','GhostWhite').css('padding','2px 2px').css('height','18px').css('line-height','8px');
//$name.append($btn);
}
});
});
});
}
catch(a){
console.log(a);
}
return false;
};
var loadUser = function(){
$.each(cityList,function(idx,val){
if(typeof val.users == "undefined"){
val.obj.append('<tr><td colspan="12"><table align="center" class="tb_layout cityUser bg0">'+
'<thead><tr>'+
'<td width="100" align="center" class="bg1">이 름</td><td width="100" align="center" class="bg1">통무지</td><td width="100" align="center" class="bg1">부 대</td><td width="60" align="center" class="bg1">자 금</td>'+
'<td width="60" align="center" class="bg1">군 량</td><td width="30" align="center" class="bg1">守</td><td width="60" align="center" class="bg1">병 종</td>'+
'<td width="60" align="center" class="bg1">병 사</td><td width="50" align="center" class="bg1">훈련</td><td width="50" align="center" class="bg1">사기</td><td width="150" align="center" class="bg1">명 령</td>'+
'<td width="60" align="center" class="bg1">삭턴</td><td width="60" align="center" class="bg1">턴</td>'+
'</tr></thead>'+
'<tbody class="cityUserBody"></tbody></table></td></tr>');
val.users = val.obj.find(".cityUserBody");
}
else{
val.users.html("");
}
});
$.get(basicPath+'b_genList.php',function(rawData){
var cnt =0;
var $helper = $('#helper_genlist');
$helper.html('').append($.parseHTML(rawData));
var tmpUsers = $('#general_list tbody tr');
tmpUsers.each(function(idx){
var $this = $(this);
var $city = $this.children('.i_city');
$city.remove();
var cityName = $.trim($city.text());
var $name = $this.children('.i_name');
$name.addClass('nameplate');
var name = $name.find('.t_name').text();
var $work = $this.children('.i_action');
var cityInfo = cityList[cityName];
if(typeof cityInfo == 'undefined'){
return true;
}
if(cityInfo.warn주민)$work.html($work.html().split('정착 장려').join('<span style="color:yellow;">정착 장려</span>'));
if(cityInfo.warn농업)$work.html($work.html().split('농지 개간').join('<span style="color:yellow;">농지 개간</span>'));
if(cityInfo.warn상업)$work.html($work.html().split('상업 투자').join('<span style="color:yellow;">상업 투자</span>'));
if(cityInfo.warn치안)$work.html($work.html().split('치안 강화').join('<span style="color:yellow;">치안 강화</span>'));
if(cityInfo.warn수비)$work.html($work.html().split('수비 강화').join('<span style="color:yellow;">수비 강화</span>'));
if(cityInfo.warn성벽)$work.html($work.html().split('성벽 보수').join('<span style="color:yellow;">성벽 보수</span>'));
var $stat = $this.children('.i_stat');
var stat = $stat.text();
var is수뇌 = stat.indexOf('+')>=0;
$this.data('username',name);
if(cityList[cityName].$태수.text() == name){
cityList[cityName].$태수.css('color','lightgreen');
}
if(cityList[cityName].$군사.text() == name){
cityList[cityName].$군사.css('color','lightgreen');
}
if(cityList[cityName].$시중.text() == name){
cityList[cityName].$시중.css('color','lightgreen');
}
userList[name]={
$city:cityInfo,
city:cityName,
$user:$this,
name:name,
val:'-1',
p태수:false,
p군사:false,
p시중:false,
is수뇌:is수뇌
};
if(cityList[cityName]){
cityList[cityName].users.append($this);
}
});
});
if($("#loadDutyBtn").length == 0){
var $onBossList = $('<button id="loadDutyBtn">인사부 연동</button>');
$onBossList.click(function(){
loadDuty();
return false;
});
$('form').append($onBossList);
}
$('#by_users').show();
};
var mainFunc = function(){
//대상 추출
window.cityList = {};
window.userList = {};
$("form").each(function(){
var $this = $(this);
$this.attr('name','p'+$this.attr('name'));
});
$("table").each(function(idx,val){
$this = $(this);
if($this.attr('class')=='tb_layout bg2'){
$this.addClass('cityInfo');
}
else{
return true;
}
window.$tmpTable = $this;
var cityInfo = {};
//이름 추출
{
var titleText = $this.find('tr:eq(0)>td:eq(0)').text();
var loc0 = titleText.indexOf("【");
var loc1 = titleText.indexOf("|");
var loc2 = titleText.indexOf("】");
var cityLoc = $.trim(titleText.substring(loc0+1,loc1));
var citySize = $.trim(titleText.substring(loc1+1,loc2));
var cityName = $.trim(titleText.substring(loc2+1));
cityName = cityName.replace("[","");
cityName = cityName.replace("]","");
$this.data('cityname',cityName);
cityInfo.지역 = cityLoc;
cityInfo.규모 = citySize;
cityInfo.이름 = cityName;
cityInfo.val = '-1';
cityInfo.p태수 = false;
cityInfo.p군사 = false;
cityInfo.p시중 = false;
}
//주민, 농상치성수
{
var $baseTr = $this.find('tr:eq(1)');
cityInfo.$주민 = $baseTr.find('td:eq(1)');
cityInfo.$농업 = $baseTr.find('td:eq(3)');
cityInfo.$상업 = $baseTr.find('td:eq(5)');
cityInfo.$치안 = $baseTr.find('td:eq(7)');
cityInfo.$수비 = $baseTr.find('td:eq(9)');
cityInfo.$성벽 = $baseTr.find('td:eq(11)');
var tmpVal;
tmpVal = cityInfo.$주민.text().split('/');
cityInfo.주민 = parseInt(tmpVal[0]);
cityInfo.max주민 = parseInt(tmpVal[1]);
tmpVal = cityInfo.$농업.text().split('/');
cityInfo.농업 = parseInt(tmpVal[0]);
cityInfo.max농업 = parseInt(tmpVal[1]);
tmpVal = cityInfo.$상업.text().split('/');
cityInfo.상업 = parseInt(tmpVal[0]);
cityInfo.max상업 = parseInt(tmpVal[1]);
tmpVal = cityInfo.$치안.text().split('/');
cityInfo.치안 = parseInt(tmpVal[0]);
cityInfo.max치안 = parseInt(tmpVal[1]);
tmpVal = cityInfo.$수비.text().split('/');
cityInfo.수비 = parseInt(tmpVal[0]);
cityInfo.max수비 = parseInt(tmpVal[1]);
tmpVal = cityInfo.$성벽.text().split('/');
cityInfo.성벽 = parseInt(tmpVal[0]);
cityInfo.max성벽 = parseInt(tmpVal[1]);
if (cityInfo.주민>cityInfo.max주민*0.9){ cityInfo.$주민.css('color','lightgreen');}
else if (cityInfo.주민>cityInfo.max주민*0.7){ cityInfo.$주민.css('color','yellow');}
else { cityInfo.$주민.css('color','orangered');}
if (cityInfo.농업>cityInfo.max농업*0.8){ cityInfo.$농업.css('color','lightgreen');}
else if (cityInfo.농업>cityInfo.max농업*0.4){ cityInfo.$농업.css('color','yellow');}
else { cityInfo.$농업.css('color','orangered');}
if (cityInfo.상업>cityInfo.max상업*0.8){ cityInfo.$상업.css('color','lightgreen');}
else if (cityInfo.상업>cityInfo.max상업*0.4){ cityInfo.$상업.css('color','yellow');}
else { cityInfo.$상업.css('color','orangered');}
if (cityInfo.치안>cityInfo.max치안*0.8){ cityInfo.$치안.css('color','lightgreen');}
else if (cityInfo.치안>cityInfo.max치안*0.4){ cityInfo.$치안.css('color','yellow');}
else { cityInfo.$치안.css('color','orangered');}
if (cityInfo.수비>cityInfo.max수비*0.6){ cityInfo.$수비.css('color','lightgreen');}
else if (cityInfo.수비>cityInfo.max수비*0.3){ cityInfo.$수비.css('color','yellow');}
else { cityInfo.$수비.css('color','orangered');}
if (cityInfo.성벽>cityInfo.max성벽*0.6){ cityInfo.$성벽.css('color','lightgreen');}
else if (cityInfo.성벽>cityInfo.max성벽*0.3){ cityInfo.$성벽.css('color','yellow');}
else { cityInfo.$성벽.css('color','orangered');}
cityInfo.remain주민 = cityInfo.주민-cityInfo.max주민;
cityInfo.remain농업 = cityInfo.농업-cityInfo.max농업;
cityInfo.remain상업 = cityInfo.상업-cityInfo.max상업;
cityInfo.remain치안 = cityInfo.치안-cityInfo.max치안;
cityInfo.remain수비 = cityInfo.수비-cityInfo.max수비;
cityInfo.remain성벽 = cityInfo.성벽-cityInfo.max성벽;
cityInfo.warn주민 = false;
cityInfo.warn농업 = false;
cityInfo.warn상업 = false;
cityInfo.warn치안 = false;
cityInfo.warn수비 = false;
cityInfo.warn성벽 = false;
if(cityInfo.remain주민 > -10*2000) cityInfo.warn주민 = true;
if(cityInfo.주민 > 0.92*cityInfo.max주민) cityInfo.warn주민 = true;
if(cityInfo.remain농업 > -10*100) cityInfo.warn농업 = true;
if(cityInfo.remain상업 > -10*100) cityInfo.warn상업 = true;
if(cityInfo.remain치안 > -10*100) cityInfo.warn치안 = true;
if(cityInfo.remain수비 > -10*70) cityInfo.warn수비 = true;
if(cityInfo.remain성벽 > -10*70) cityInfo.warn성벽 = true;
if(cityInfo.warn농업) cityInfo.$농업.append('<span class="remain" style="color:yellow;">['+cityInfo.remain농업+']</span>');
if(cityInfo.warn상업) cityInfo.$상업.append('<span class="remain" style="color:yellow;">['+cityInfo.remain상업+']</span>');
if(cityInfo.warn치안) cityInfo.$치안.append('<span class="remain" style="color:yellow;">['+cityInfo.remain치안+']</span>');
if(cityInfo.warn수비) cityInfo.$수비.append('<span class="remain" style="color:yellow;">['+cityInfo.remain수비+']</span>');
if(cityInfo.warn성벽) cityInfo.$성벽.append('<span class="remain" style="color:yellow;">['+cityInfo.remain성벽+']</span>');
}
//태수,군사,시중
{
var $baseTr = $this.find('tr:eq(2)');
cityInfo.$태수 = $baseTr.find('td:eq(7)');
cityInfo.$군사 = $baseTr.find('td:eq(9)');
cityInfo.$시중 = $baseTr.find('td:eq(11)');
}
//기타
{
cityInfo.userCnt = $this.find('tr:eq(3) td:eq(1)').text().split(',').length -1;
}
cityInfo.obj = $this;
cityList[cityInfo.이름] = cityInfo;
});
var $onGenList = $('<button>암행부 연동</button>');
$onGenList.click(function(){
loadUser();
return false;
});
$('form').append($onGenList);
$('table:eq(0) tr:last').after('<tr><td id="sort_more"></td></tr>');
$sort_more = $('#sort_more');
$sort_more.html('재 정렬 순서 :');
var sortIt = function(callback){
var arCity = [];
$('.cityInfo').each(function(){
var $this = $(this);
var cityName = $this.data('cityname');
var cityInfo = cityList[cityName];
arCity.push(cityInfo);
});
arCity = mergeSort(arCity,callback);
//console.log(arCity);
var $anchor = $('.anchor');
//console.log($anchor);
$('body > br').remove();
$('.cityInfo').detach();
$.each(arCity,function(idx,val){
$anchor.before('<br>');
$anchor.before(val.obj);
});
$anchor.before('<br>');
};
var $btn;
$btn = $('<button>도시명</button>').click(function(){
sortIt(function(a,b){
return a.이름.localeCompare(b.이름);
});
});
$sort_more.append($btn);
$btn = $('<button>인구율</button>').click(function(){
sortIt(function(a,b){
return 1.0*a.주민/a.max주민 - 1.0*b.주민/b.max주민;
});
});
$sort_more.append($btn);
$btn = $('<button>남은 주민</button>').click(function(){
sortIt(function(a,b){
return a.remain주민 - b.remain주민;
});
});
$sort_more.append($btn);
$btn = $('<button>남은 농업</button>').click(function(){
sortIt(function(a,b){
return a.remain농업 - b.remain농업;
});
});
$sort_more.append($btn);
$btn = $('<button>남은 상업</button>').click(function(){
sortIt(function(a,b){
return a.remain상업 - b.remain상업;
});
});
$sort_more.append($btn);
$btn = $('<button>남은 치안</button>').click(function(){
sortIt(function(a,b){
return a.remain치안 - b.remain치안;
});
});
$sort_more.append($btn);
$btn = $('<button>남은 수비</button>').click(function(){
sortIt(function(a,b){
return a.remain수비 - b.remain수비;
});
});
$sort_more.append($btn);
$btn = $('<button>남은 성벽</button>').click(function(){
sortIt(function(a,b){
return a.remain성벽 - b.remain성벽;
});
});
$sort_more.append($btn);
$btn = $('<button>배치 장수 수</button>').click(function(){
sortIt(function(a,b){
return b.userCnt - a.userCnt;
});
});
$sort_more.append($btn);
};
mainFunc();
});
+235
View File
@@ -0,0 +1,235 @@
$(function(){
var basicPath = document.location.pathname;
basicPath = basicPath.substring(0, basicPath.lastIndexOf('/'))+'/';
var headTbl = $('table:eq(0)');
var $userFrame;
var 국가테이블= $('table:gt(0):lt(-2)');
var getUserType = function(,,){
var = ++;
if( < *0.2) {
return "무지";
}else if( < *0.2) {
return "지";
}else if( < *0.2) {
return "무";
}else{
return "만능";
}
};
function formatScore(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
var runAnalysis = function(){
var $content = $('#on_mover .content');
$.get(basicPath+'a_genList.php',function(rawData){
try{
var $html = $(rawData);
var $장수일람 = {};
var 국가별 = {};
var cnt =0;
$html.each(function(idx){
if(this.tagName == "TABLE"){
cnt+=1;
if(cnt==2){
$장수일람 = $(this);
return false;
}
}
});
$장수일람.find('tr:gt(0)').each(function(){
var 장수 = {};
$this = $(this);
$tds = $this.find('td');
var 장수명 = $.trim($tds.eq(1).text());
var 국가 = $.trim($tds.eq(6).text());
장수.html = $this.clone();
장수.장수명 = 장수명;
장수.국가 = 국가;
장수.벌점 = parseInt($tds.eq(-1).text());
장수. = parseInt($tds.eq(10).text().split('+')[0]);
장수. = parseInt($tds.eq(11).text().split('+')[0]);
장수. = parseInt($tds.eq(12).text().split('+')[0]);
장수.삭턴 = parseInt($tds.eq(-2).text());
장수.종류 = getUserType(장수., 장수., 장수.);
장수.의병 = 장수명[0]=="ⓜ" || 장수명[0]=="ⓖ";
if(!(국가 in 국가별)){
국가별[국가] = {};
국가별[국가]. = [];
국가별[국가]. = [];
국가별[국가].충차 = [];
국가별[국가].무지 = [];
국가별[국가].만능 = [];
//국가별[국가].의병 = [];
}
//if(장수.의병) 국가별[국가].의병.push(장수);
국가별[국가][장수.종류].push(장수);
장수.html.hide();
$content.append(장수.html);
});
국가테이블.each(function(idx){
var $this = $(this);
var $tbl = $this;
var $td = $this.find('td:last');
var name = $.trim($this.find('td:first').text());
name = name.substr(2,name.length-4);
var 국가정보 = 국가별[name];
var total = 0;
var 전투유저장수 = 0;
var 삭턴장수 = 0;
var 통솔합 = 0;
$td.html('<p class="sum" style="margin:0;font-weight:bold;color:yellow;text-align:center"></p>');
$td.css('text-indent','-5.8em').css('padding-left','5.8em');
for(var 종류명 in 국가정보){
var $p = $("<p></p>").css('margin','0');
var 테이블 = 국가정보[종류명];
if(테이블.length == 0)continue;
테이블.sort(function(, ){
if(.벌점 == .벌점){
return .장수명 > .장수명 ? 1 : 0;
}
return .벌점 - .벌점
});
var text = "  "+종류명;
text = text.substr(text.length-2);
$p.append(text+'장(');
text = ""+테이블.length;
$p.append(text + ')');
if(text.length<3){
$p.append("<span style='display:inline-block;width:"+(3-text.length)/2+"em;'>&nbsp;</span>");
}
$p.append(': ');
total += 테이블.length;
$.each(테이블,function(idx,val){
var 종능 = val. + val. + val.;
if(종류명 == '무' || 종류명 == '지' || 종류명 == '충차'){
if(val.삭턴 >= 80 && !val.의병){
전투유저장수+=1;
if(종능 > 150) 통솔합 += val.;
else if(종능/0.75 >= 150)통솔합 += parseInt(val./0.75);
else if(종능/0.55 >= 150)통솔합 += parseInt(val./0.55);
else if(종능/0.35 >= 150)통솔합 += parseInt(val./0.35);
else if(종능/0.15 >= 150)통솔합 += parseInt(val./0.15);
}
}
var $obj = $('<span></span>');
var $obj2 = $('<span></span>');
$obj.html(val.장수명);
if(!val.의병 && val.삭턴 < 80){
$obj.css('text-decoration','line-through');
삭턴장수+=1;
}
if(val.의병){
$obj.css('color','cyan');
}
if(val.벌점 >= 1500) $obj.css('color','yellow');
else if(val.벌점 >= 200) $obj.css('color','lightgreen');
$obj2.append($obj);
if(idx < 테이블.length-1){
$obj2.append(', ');
}
$p.append($obj2);
$obj2.hover(function(){
var top = $tbl.offset().top + $tbl.outerHeight() + 3;
$userFrame.css('top',top);
val.html.show();
$userFrame.show();
console.log('올림!'+val.장수명);
},function(){
$userFrame.hide();
val.html.hide();
console.log('내림!'+val.장수명);
});
});
$td.append($p);
}
var result = "* 총("+total+"), 전투장("+전투유저장수+", 약 "+formatScore(통솔합*100)+"명), 삭턴장("+삭턴장수+") *";
$tbl.find('.sum').html(result);
});
}
catch(err){
console.log(err);
}
});
}
$userFrame = $('<div id="on_mover" style="position:absolute;">'+
'<table class="tb_layout bg0" style="width:100%;"><thead><tr>'+
'<td width="64" align="center" class="bg1">얼 굴</td>'+
'<td width="100" align="center" class="bg1">이 름</td>'+
'<td width="50" align="center" class="bg1">연령</td>'+
'<td width="50" align="center" class="bg1">성격</td>'+
'<td width="90" align="center" class="bg1">특기</td>'+
'<td width="50" align="center" class="bg1">레 벨</td>'+
'<td width="100" align="center" class="bg1">국 가</td>'+
'<td width="60" align="center" class="bg1">명 성</td>'+
'<td width="60" align="center" class="bg1">계 급</td>'+
'<td width="80" align="center" class="bg1">관 직</td>'+
'<td width="45" align="center" class="bg1">통솔</td>'+
'<td width="45" align="center" class="bg1">무력</td>'+
'<td width="45" align="center" class="bg1">지력</td>'+
'<td width="45" align="center" class="bg1">삭턴</td>'+
'<td width="84" align="center" class="bg1">벌점</td>'+
'</tr></thead><tbody class="content"></tbody></table></div>');
$userFrame.find('thead td');
$userFrame.css('width','1000px').css('margin','0').css('padding','0').css('left','50%').css('margin-left','-500px');
$userFrame.css('box-shadow','0px 0px 7px 3px rgba(255,255,255,50)');
$userFrame.hide();
$('body').append($userFrame);
var $frame = $('table:eq(0) td:eq(0)');
$frame.find('br:last').remove();
var $btn = $('<input type="button" value="장수 일람 연동">');
$btn.click(function(){
runAnalysis();
$btn.prop("disabled",true);
var $tr0 = $('table:eq(0) tr:eq(0)');
$tr0.append('<td><strong>*벌점 순 정렬*</strong><br><span style="color:yellow">벌점 1500점 이상</span>, <span style="color:lightgreen">벌점 200점 이상</span>, '+
'<span style="text-decoration:line-through">삭턴 장</span>, <span style="color:cyan">ⓝ장</span>'+'<br><strong>전투장 :</strong> 무장 + 지장 + 충차장 - 삭턴자(무,지,충) </td>');
});
$frame.append($btn);
});
+250
View File
@@ -0,0 +1,250 @@
$(function(){
var userList = {};
var groupList = {};
var tGroup = [];
var basicPath = document.location.pathname;
basicPath = basicPath.substring(0, basicPath.lastIndexOf('/'))+'/';
var $userFrame;
window.groupList = groupList;
window.userList = userList;
var aGroup = {};
$('#troop_list tbody > tr').each(function(idx){
var $this = $(this);
//console.log(this);
//console.log($this);
if(idx%3 == 0){
aGroup = {
turn : '77:77',
turnTime : 5555,
부대장 : '에러-집합장없음',
부대명 : '에러-부대명없음',
srclist : [],
도시 : '없지롱',
list: [],
trs:[]
};
aGroup.trs.push($this);
var $children = $this.children();
var names = $.trim($children.eq(1).text()).split('【');
var 부대명 = $.trim(names[0]);
var 도시 = $.trim(names[1].substr(0,names[1].length-1));
aGroup.도시 = 도시;
aGroup.부대명 = 부대명;
aGroup.obj = $this;
aGroup.$users = $children.eq(3);
var lists = $.trim($children.eq(3).text()).split(', ');
lists.pop();
aGroup.srcList = lists;
}
else if(idx%3 == 1){
aGroup.trs.push($this);
var turnBase = $this.children().eq(0).text().split('】')[1];
//console.log(turnBase);
var userName = $this.children().eq(1).text();
var turn = turnBase;
var turnMS = turnBase.split(':');
var turnM = parseInt(turnMS[0]);
var turnS = parseInt(turnMS[1]);
var turnTime = turnM*60+turnS;
aGroup.turn = turn;
aGroup.turnTime = turnTime;
aGroup.부대장 = userName;
aGroup.obj2 = $this;
groupList[aGroup.부대명] = aGroup;
tGroup.push(aGroup);
}
else{
if($this.find('input').length==0){
$this.detach();
}
}
});
$.each(tGroup,function(idx,val){
console.log(val);
for(var i=0;i<val.trs.length;i++){
val.trs[i].detach();
}
});
tGroup.sort(function(lhs,rhs){
return lhs.turnTime-rhs.turnTime;
});
var $last = $('table:eq(1) tr:eq(-1)');
var $tbody = $('table:eq(1) tbody');
$last.detach();
console.log($last);
$.each(tGroup,function(idx,val){
for(var i=0;i<val.trs.length;i++){
$tbody.append(val.trs[i]);
}
$tbody.append('<tr><td colspan="5"></td></tr>');
});
$tbody.find('tr:eq(-1)').detach();
$tbody.append($last);
var runAnalysis = function(){
$.each(groupList,function(idx,val){
val.list = [];
});
userList = [];
var $content = $('#on_mover .content');
$content.html('');
$.get(basicPath+'b_genList.php',function(rawData){
try{
$html = $(rawData);
var cnt =0;
var tmpUsers = {};
$html.each(function(idx){
if(this.tagName == "TABLE"){
cnt+=1;
if(cnt==2){
tmpUsers = $(this);
return false;
}
}
});
tmpUsers.find("tbody > tr").each(function(idx){
var $this = $(this);
var $부대 = $this.children('.i_troop');
var 부대 = $.trim($부대.text());
if(부대 == '-'){
//부대 안탔음!
return true;
}
$부대.remove();
var $name = $this.children('.i_name');
$name.addClass('nameplate');
var name = $name.find('.t_name').text();
var $도시 = $this.children('.i_city');
var 도시 = $.trim($도시.text());
var $턴 = $this.children('.i_action');
//console.log($턴);
var 턴0 = $턴.text().split(':');
var = parseInt(턴0[0])*60 + parseInt(턴0[1]);
var userInfo = {
이름 : name,
부대 : 부대,
도시 : 도시,
: ,
obj : $this
};
groupList[부대].list.push(userInfo);
userList[name] = userInfo;
$this.hide();
$content.append($this);
});
$.each(groupList,function(부대명,aGroup){
aGroup.$users.html('');
$.each(aGroup.list,function(idx,userInfo){
var $user = $('<span><span class="name"></span><span class="other"></span></span>');
var $userName = $user.children('.name');
if(userInfo.이름 == aGroup.부대장){
$userName.html('*'+userInfo.이름+'*');
$userName.css('color','lightgreen');
}
else{
$userName.html(userInfo.이름);
}
if(userInfo.도시 != aGroup.도시){
$userName.css('color','red');
$user.children('.other').html('【'+userInfo.도시+'】');
}
$user.hover(function(){
var top = aGroup.obj2.offset().top + aGroup.obj2.outerHeight();
$userFrame.css('top',top);
userInfo.obj.show();
$userFrame.show();
console.log('올림!'+userInfo.이름);
},function(){
$userFrame.hide();
userInfo.obj.hide();
console.log('내림!'+userInfo.이름);
});
$user.append(', ');
aGroup.$users.append($user);
});
aGroup.$users.append('('+aGroup.list.length+'명)');
});
}
catch(err){
console.log(err);
}
});
};
var $frame = $('table:eq(0) td:eq(0)');
$frame.find('br:last').remove();
var $btn = $('<input type="button" value="암행부 연동">');
$btn.click(function(){
runAnalysis();
});
$frame.append($btn);
$userFrame = $('<div id="on_mover" style="position:absolute;">'+
'<table class="tb_layout bg0" style="width:100%;"><thead><tr>'+
'<td width="98" align="center" class="bg1">이 름</td>'+
'<td width="98" align="center" class="bg1"">통무지</td>'+
'<td width="58" align="center" class="bg1">자 금</td>'+
'<td width="58" align="center" class="bg1">군 량</td>'+
'<td width="48" align="center" class="bg1">도시</td>'+
'<td width="28" align="center" class="bg1">守</td>'+
'<td width="58" align="center" class="bg1">병 종</td>'+
'<td width="68" align="center" class="bg1">병 사</td>'+
'<td width="48" align="center" class="bg1">훈련</td>'+
'<td width="48" align="center" class="bg1">사기</td>'+
'<td width="148" align="center" class="bg1">명 령</td>'+
'<td width="58" align="center" class="bg1">삭턴</td>'+
'<td width="58" align="center" class="bg1">턴</td>'+
'</tr></thead><tbody class="content"></tbody></table></div>');
$userFrame.find('thead td');
$userFrame.css('width','900px').css('margin','0').css('padding','0').css('left','50%').css('margin-left','-450px');
$userFrame.hide();
$('body').append($userFrame);
});
+14 -1
View File
@@ -150,4 +150,17 @@ jQuery(function($){
window.abilityLeadpow = abilityLeadpow;
window.abilityLeadint = abilityLeadint;
window.abilityPowint = abilityPowint;
});
var $charInfoText = $('#charInfoText');
var $selChar = $('#selChar');
$selChar.change(function(){
var $this = $(this);
var char = $this.val();
if(char in charInfoText){
$charInfoText.html(charInfoText[char]);
}
else{
$charInfoText.html('');
}
});
});
+10 -21
View File
@@ -119,23 +119,11 @@ function reloadWorldMap(option){
};
}
function convertSpyList(arr){
var result = [];
arr.forEach(function(v){
var cityId = (v / 10) | 0;
var spy = v % 10;
result[cityId] = spy;
});
return result;
}
var cityList = obj.cityList.map(toCityObj);
var nationList = obj.nationList.map(toNationObj);
nationList = convertDictById(nationList); //array of object -> dict
var spyList = convertSpyList(obj.spyList);//Array -> Dict
var spyList = obj.spyList;
var shownByGeneralList = convertSet(obj.shownByGeneralList);//Array -> Set
var myCity = obj.myCity;
@@ -439,14 +427,15 @@ function reloadWorldMap(option){
url: option.targetJson,
type: 'post',
dataType:'json',
contentType: 'application/json',
data: JSON.stringify({
neutralView:option.neutralView,
year:option.year,
month:option.month,
showMe:option.showMe,
aux:option.aux
})
data: {
data: JSON.stringify({
neutralView:option.neutralView,
year:option.year,
month:option.month,
showMe:option.showMe,
aux:option.aux
})
}
});
deferred
+15 -22
View File
@@ -34,11 +34,12 @@ function responseMessage(msgID, response){
url: 'j_msg_decide_opt.php',
type: 'post',
dataType:'json',
contentType: 'application/json',
data: JSON.stringify({
msgID:msgID,
response:response
})
data: {
data: JSON.stringify({
msgID:msgID,
response:response
})
}
}).then(refreshMsg);
}
@@ -54,10 +55,9 @@ function fetchMsg(){
url: 'j_msg_get_recent.php',
type: 'post',
dataType:'json',
contentType: 'application/json',
data: JSON.stringify({
data: {
sequence:sequence
})
}
});
}
@@ -128,7 +128,7 @@ function redrawMsg(deferred){
var $msgs = msgSource.map(function(msg){
var contactTarget = (msg.src.id != myGeneralID) ? msg.src.id : msg.dest.id;
if(needRefreshLastContact && contactTarget != myGeneralID)
if(needRefreshLastContact && contactTarget != myGeneralID && contactTarget in generalList)
{
needRefreshLastContact = false;
$('#last_contact').val(contactTarget).html(generalList[contactTarget].textName).show();
@@ -373,11 +373,12 @@ function activateMessageForm(){
url:'j_msg_submit.php',
type: 'post',
dataType:'json',
contentType: 'application/json',
data: JSON.stringify({
mailbox:parseInt(targetMailbox),
text:text
})
data: {
data: JSON.stringify({
mailbox:parseInt(targetMailbox),
text:text
})
}
});
}
else{
@@ -404,10 +405,6 @@ jQuery(function($){
url:'j_basic_info.php',
type: 'post',
dataType:'json',
contentType: 'application/json',
data: JSON.stringify({
})
}).then(registerGlobal);
//sender_list.json 은 서버측에선 캐시 가능한 데이터임.
@@ -415,10 +412,6 @@ jQuery(function($){
url: 'j_msg_contact_list.php',
type: 'post',
dataType:'json',
contentType: 'application/json',
data: JSON.stringify({
})
});
var MessageList = fetchMsg();
+35 -1
View File
@@ -3,11 +3,19 @@ var templateGeneralCard =
<h4 class="bg1 with_border"><%name%></h4>\
<h4><img src="<%iconPath%>" height=64 width=64></h4>\
<p><%leader%> / <%power%> / <%intel%><br>\
<%special%> / <%special2%></p>\
<%specialText%> / <%special2Text%></p>\
<button type="subject" class="with_skin with_border select_btn" value="<%no%>" name="pick">빙의하기</button>\
<label><input <%keepCnt?"":disabled="disabled"%> type="checkbox" value="<%no%>" name="keep[]" class="keep_select">보관(<%keepCnt%>)</label>\
</div>';
var templateSpecial =
'<span class="obj_tooltip" data-toggle="tooltip" data-placement="top"><%text%>\
<span class="tooltiptext">\
<%info%>\
</span>\
</span>\
';
function pickGeneral(){
$btn = $(this);
@@ -85,12 +93,38 @@ function printGenerals(value){
$.each(pick, function(idx, cardData){
cardData.iconPath = getIconPath(cardData.imgsvr, cardData.picture);
if(cardData.special in specialInfo){
cardData.specialText = TemplateEngine(templateSpecial, {
text:cardData.special,
info:specialInfo[cardData.special]
});
}
else{
cardData.specialText = cardData.special;
}
if(cardData.special2 in specialInfo){
cardData.special2Text = TemplateEngine(templateSpecial, {
text:cardData.special2,
info:specialInfo[cardData.special2]
});
}
else{
cardData.special2Text = cardData.special2;
}
var $card = $(TemplateEngine(templateGeneralCard, cardData));
console.log($card);
$('.card_holder').append($card);
$card.find('.select_btn').click(pickGeneral);
$card.find('.obj_tooltip').tooltip({
title:function(){
return $.trim($(this).find('.tooltiptext').html());
},
html:true
});
});
updatePickMoreTimer();
+1 -1
View File
@@ -1,5 +1,5 @@
<div
class="msg_plate msg_plate_<%msgType%> msg_plate_<%nationType%>""
class="msg_plate msg_plate_<%msgType%> msg_plate_<%nationType%>"
id="msg_<%id%>"
data-id="<%id%>"
>
+23 -22
View File
@@ -146,9 +146,9 @@ function processWar($general, $city) {
pushGenLog($general, $log);
pushGeneralPublicRecord($alllog, $year, $month);
pushWorldHistory($history);
unset($log);
unset($alllog);
unset($history);
$log = [];
$alllog = [];
$history= [];
//패퇴시 병량보충
$destnation['rice'] += 500;
@@ -602,14 +602,14 @@ function processWar($general, $city) {
//특기보정 : 저격(수극), 활무기저격
$snipe = false;
$snipeItem = false;
if(!$snipe && $general['special2'] == 70 && Util::randF(1/3)){
if(!$snipe && $general['special2'] == 70 && Util::randBool(1/3)){
$snipe = true;
}
if(!$snipe && in_array($general['weap'], [10, 14, 18, 22]) && Util::randF(1/5)){
if(!$snipe && in_array($general['weap'], [10, 14, 18, 22]) && Util::randBool(1/5)){
$snipe = true;
}
if(!$snipe && $general['item'] == 2){
if(Util::randF(1/5)){
if(Util::randBool(1/5)){
$snipe = true;
$snipeItem = true;
}
@@ -642,14 +642,14 @@ function processWar($general, $city) {
//특기보정 : 저격(수극), 활무기저격
$snipe = false;
$snipeItem = false;
if(!$snipe && $oppose['special2'] == 70 && Util::randF(1/3)){
if(!$snipe && $oppose['special2'] == 70 && Util::randBool(1/3)){
$snipe = true;
}
if(!$snipe && in_array($oppose['weap'], [10, 14, 18, 22]) && Util::randF(1/5)){
if(!$snipe && in_array($oppose['weap'], [10, 14, 18, 22]) && Util::randBool(1/5)){
$snipe = true;
}
if(!$snipe && $oppose['item'] == 2){
if(Util::randF(1/5)){
if(Util::randBool(1/5)){
$snipe = true;
$snipeItem = true;
}
@@ -1464,10 +1464,10 @@ function processWar($general, $city) {
pushGenLog($oppose, $opplog);
pushBatLog($oppose, $oppbatlog);
pushBatRes($oppose, $oppbatres);
unset($oppose);
unset($opplog);
unset($oppbatlog);
unset($oppbatres);
$oppose = null;
$opplog = [];
$oppbatlog = [];
$oppbatres = [];
// 공격 장수 병사 소진이나 쌀 소진시 실패 처리
} elseif($general['crew'] <= 0 || $myRice <= Util::round($general['crew']/100)) {
if($myRice <= Util::round($general['crew']/100)) {
@@ -1512,21 +1512,21 @@ function processWar($general, $city) {
pushGenLog($oppose, $opplog);
pushBatLog($oppose, $oppbatlog);
pushBatRes($oppose, $oppbatres);
unset($opplog);
unset($oppbatlog);
unset($oppbatres);
// $josaYi = JosaUtil::pick($general['name'], '이');
// $alllog[] = "<C>●</>{$month}월:<Y>{$general['name']}</>{$josaYi} }<G>{$city['name']}</> 공략에 실패했습니다. <1>$date</>";
// $log[] = "<C>●</> <G>{$city['name']}</> 공략에 실패했습니다. <1>$date</>";
$opplog = [];
$oppbatlog = [];
$oppbatres = [];
// $josaYi = JosaUtil::pick($general['name'], '이');
// $alllog[] = "<C>●</>{$month}월:<Y>{$general['name']}</>{$josaYi} }<G>{$city['name']}</> 공략에 실패했습니다. <1>$date</>";
// $log[] = "<C>●</> <G>{$city['name']}</> 공략에 실패했습니다. <1>$date</>";
break;
} else {
// 무승부일때 로그 남김
pushGenLog($oppose, $opplog);
pushBatLog($oppose, $oppbatlog);
pushBatRes($oppose, $oppbatres);
unset($opplog);
unset($oppbatlog);
unset($oppbatres);
$opplog = [];
$oppbatlog = [];
$oppbatres = [];
}
}
}
@@ -1816,6 +1816,7 @@ function ConquerCity($admin, $general, $city, $nation, $destnation) {
//다른 코드와는 다르게 공용으로 쓰므로 남겨둠
return $gen['no'];
}, $oldNationGenerals);
$oldNation['aux'] = Json::decode($oldNation['aux']);
foreach($oldNationGenerals as $gen){
+4 -2
View File
@@ -123,7 +123,9 @@ function starter($name, $type=0) {
<title><?=$name?></title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<?=WebUtil::printJS('../e_lib/jquery-3.2.1.min.js')?>
<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('../d_shared/common_path.js')?>
<?=WebUtil::printJS('js/common.js')?>
<?=WebUtil::printJS('js/base_map.js')?>
@@ -143,7 +145,7 @@ $(function(){
});
});
</script>
<?=WebUtil::printCSS('css/normalize.css')?>
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
<?=WebUtil::printCSS('css/main.css')?>
+2 -2
View File
@@ -186,7 +186,7 @@ class CityConst{
}
foreach(static::$initCity as $rawCity){
list(
[
$id,
$name,
$level,
@@ -198,7 +198,7 @@ class CityConst{
$wall,
$region,
$path
) = $rawCity;
] = $rawCity;
$level = static::$levelMap[$level];
$population *= 100;

Some files were not shown because too many files have changed in this diff Show More