아이콘, 게임 이미지 경로를 일괄 지정 가능하도록 변경

This commit is contained in:
2018-04-08 16:56:26 +09:00
parent fe53fb9359
commit bc7efae08c
31 changed files with 515 additions and 346 deletions
+17 -15
View File
@@ -1,7 +1,8 @@
<?php
namespace sammo;
class RootDB{
class RootDB
{
private static $uDB = null;
private static $host = '_tK_host_';
@@ -13,21 +14,20 @@ class RootDB{
private static $globalSalt = '_tK_globalSalt_';
public static $serverWebPath = '_tK_serverBasePath';
private function __construct(){
private function __construct()
{
}
/**
* DB 객체 생성
*
* @return \MeekroDB
*
* @return \MeekroDB
* @suppress PhanTypeMismatchProperty
*/
public static function db(){
if(self::$uDB === null){
self::$uDB = new \MeekroDB(self::$host,self::$user,self::$password,self::$dbName,self::$port,self::$encoding);
public static function db()
{
if (self::$uDB === null) {
self::$uDB = new \MeekroDB(self::$host, self::$user, self::$password, self::$dbName, self::$port, self::$encoding);
self::$uDB->connect_options[MYSQLI_OPT_INT_AND_FLOAT_NATIVE] = true;
}
return self::$uDB;
@@ -36,20 +36,22 @@ class RootDB{
/**
* 비밀번호 해시용 전역 SALT 반환
* 비밀번호는 sha512(usersalt|sha512(globalsalt|password|globalsalt)|usersalt); 순임
*
*
* @return string
*/
public static function getGlobalSalt(){
public static function getGlobalSalt()
{
return self::$globalSalt;
}
/**
* 서버 주소 반환. 서버의 경로가 하부 디렉토리인 경우에 하부 디렉토리까지 포함
*
*
* @return string
*/
public static function getServerBasepath(){
public static function getServerBasepath()
{
//FIXME: 더 좋은 위치가 있을 것.
return self::$globalSalt;
}
}
}
+65
View File
@@ -0,0 +1,65 @@
<?php
namespace sammo;
class ServConfig
{
private function __construct()
{
}
public static $serverWebPath = '_tK_serverBasePath_';
public static $sharedIconPath = '_tK_sharedIconPath_';
public static $gameImagePath = "_tK_gameImagePath_";
public static function getSharedIconPath() : string
{
static $path = '';
if($path){
$path;
}
if (Util::starts_with('http', self::$sharedIconPath)
|| Util::starts_with('//', self::$sharedIconPath))
{
$path = self::$sharedIconPath;
}
else{
$path = self::$serverWebPath.'/'.self::$sharedIconPath;
}
return $path;
}
public static function getUserIconPath() : string
{
return AppConf::getUserIconPathWeb();
}
public static function getGameImagePath() : string
{
static $path = '';
if($path){
$path;
}
if (Util::starts_with('http', self::$gameImagePath)
|| Util::starts_with('//', self::$gameImagePath))
{
$path = self::$gameImagePath;
}
else{
$path = self::$serverWebPath.'/'.self::$gameImagePath;
}
return $path;
}
/**
* 서버 주소 반환. 서버의 경로가 하부 디렉토리인 경우에 하부 디렉토리까지 포함
*
* @return string
*/
public static function getServerBasepath() : string
{
return self::$serverWebPath;
}
}
-5
View File
@@ -1,11 +1,6 @@
<?php
namespace sammo;
define('IMAGE', '../../image');
define('IMAGES', '../../images');
//define('IMAGE', 'http://115.68.28.99/image');
//define('IMAGES', 'http://115.68.28.99/images');
define('ROOT', realpath(__dir__.'/..'));
mb_internal_encoding("UTF-8");
+32 -14
View File
@@ -31,56 +31,74 @@ require(__dir__.'/../vendor/autoload.php');
<div class="card-body">
<form id="db_form" method="post" action="#">
<div class="form-group row">
<label for="db_host" class="col-sm-3 col-form-label">DB호스트</label>
<div class="col-sm-9">
<label for="db_host" class="col-sm-4 col-form-label">DB호스트</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="db_host" id="db_host"
placeholder="호스트" value="localhost" />
</div>
</div>
<div class="form-group row">
<label for="db_port" class="col-sm-3 col-form-label">DB포트</label>
<div class="col-sm-9">
<label for="db_port" class="col-sm-4 col-form-label">DB포트</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="db_port" id="db_port"
placeholder="접속 포트" value="3306" />
</div>
</div>
<div class="form-group row">
<label for="db_id" class="col-sm-3 col-form-label">DB계정명</label>
<div class="col-sm-9">
<label for="db_id" class="col-sm-4 col-form-label">DB계정명</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="db_id" id="db_id" placeholder="DB계정"/>
</div>
</div>
<div class="form-group row">
<label for="db_pw" class="col-sm-3 col-form-label">DB비밀번호</label>
<div class="col-sm-9">
<label for="db_pw" class="col-sm-4 col-form-label">DB비밀번호</label>
<div class="col-sm-8">
<input type="password" class="form-control" name="db_pw" id="db_pw"
placeholder="DB비밀번호"/>
</div>
</div>
<div class="form-group row">
<label for="db_name" class="col-sm-3 col-form-label">DB명</label>
<div class="col-sm-9">
<label for="db_name" class="col-sm-4 col-form-label">DB명</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="db_name" id="db_name"
placeholder="DB명(예:sammo)"/>
</div>
</div>
<div class="form-group row">
<label for="serv_host" class="col-sm-3 col-form-label">접속 경로</label>
<div class="col-sm-9">
<label for="serv_host" class="col-sm-4 col-form-label">접속 경로</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="serv_host" id="serv_host"
placeholder="접속경로(예:http://www.example.com)"/>
</div>
</div>
<div class="form-group row">
<div class="col-sm-3"></div>
<div class="col-sm-9">
<label for="shared_icon_path" class="col-sm-4 col-form-label">공용 아이콘 주소</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="shared_icon_path" id="shared_icon_path"
placeholder="공용 아이콘 주소(웹 주소, 또는 접속 경로에 따른 상대 주소)"
value="image/icons" />
</div>
</div>
<div class="form-group row">
<label for="game_image_path" class="col-sm-4 col-form-label">게임 이미지 주소</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="game_image_path" id="game_image_path"
placeholder="게임 이미지 주소(웹 주소, 또는 접속 경로에 따른 상대 주소)"
value="image/game" />
</div>
</div>
<div class="form-group row">
<div class="col-sm-4"></div>
<div class="col-sm-8">
<button type="submit"
class="btn btn-primary btn-lg btn-block login-button">설정 파일 생성</button>
</div>
+26 -9
View File
@@ -9,8 +9,10 @@ $username = Util::getReq('db_id');
$password = Util::getReq('db_pw');
$dbName = Util::getReq('db_name');
$servHost = Util::getReq('serv_host');
$sharedIconPath = Util::getReq('shared_icon_path');
$gameImagePath = Util::getReq('game_image_path');
if(!$host || !$port || !$username || !$password || !$dbName || !$servHost){
if(!$host || !$port || !$username || !$password || !$dbName || !$servHost || !$sharedIconPath || !$gameImagePath){
Json::die([
'result'=>false,
'reason'=>'입력 값이 올바르지 않습니다'
@@ -39,10 +41,10 @@ if(class_exists('\\sammo\\RootDB')){
}
//파일 권한 검사
if(file_exists(ROOT.'/d_pic') && !is_dir(ROOT.'/d_pic')){
if(file_exists(AppConf::getUserIconPathFS()) && !is_dir(AppConf::getUserIconPathFS())){
Json::die([
'result'=>false,
'reason'=>'d_pic 이 디렉토리가 아닙니다'
'reason'=>AppConf::$userIconPath.' 이 디렉토리가 아닙니다'
]);
}
@@ -60,10 +62,10 @@ if(!file_exists(ROOT.'/d_setting')){
]);
}
if(!is_writable(ROOT.'/d_pic')){
if(!is_writable(AppConf::getUserIconPathFS())){
Json::die([
'result'=>false,
'reason'=>'d_pic 디렉토리의 쓰기 권한이 없습니다'
'reason'=>AppConf::$userIconPath.' 디렉토리의 쓰기 권한이 없습니다'
]);
}
@@ -82,8 +84,8 @@ if(!is_writable(ROOT.'/d_setting')){
}
//기본 파일 생성
if(!file_exists(ROOT.'/d_pic')){
mkdir(ROOT.'/d_pic');
if(!file_exists(AppConf::getUserIconPathFS())){
mkdir(AppConf::getUserIconPathFS());
}
if(!file_exists(ROOT.'/d_log')){
@@ -140,6 +142,22 @@ $rootDB->insert('system', array(
$globalSalt = bin2hex(random_bytes(16));
$result = Util::generateFileUsingSimpleTemplate(
ROOT.'/d_setting/ServConfig.orig.php',
ROOT.'/d_setting/ServConfig.php',[
'serverBasePath'=>$servHost,
'sharedIconPath'=>$sharedIconPath,
'gameImagePath'=>$gameImagePath
]
, true);
if($result !== true){
Json::die([
'result'=>false,
'reason'=>$result
]);
}
$result = Util::generateFileUsingSimpleTemplate(
ROOT.'/d_setting/RootDB.orig.php',
ROOT.'/d_setting/RootDB.php',[
@@ -149,9 +167,8 @@ $result = Util::generateFileUsingSimpleTemplate(
'dbName'=>$dbName,
'port'=>$port,
'globalSalt'=>$globalSalt,
'serverBasePath'=>$servHost
]
);
);
if($result !== true){
Json::die([
+3 -4
View File
@@ -2,7 +2,6 @@
DROP TABLE IF EXISTS `system`;
DROP TABLE IF EXISTS `member`;
DROP TABLE IF EXISTS `member_log`;
DROP TABLE IF EXISTS `auth_kakao`;
-- 시스템 테이블
-- TODO:장기적으로는 key-value(json) storage 형태로 바꾸는게 나을 듯.
@@ -15,7 +14,7 @@ CREATE TABLE `system` (
`MDF_DATE` DATETIME NULL DEFAULT NULL,
PRIMARY KEY (`NO`)
)
ENGINE=InnoDB DEFAULT CHARSET=UTF8;
ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- 회원 테이블
CREATE TABLE `member` (
@@ -41,7 +40,7 @@ CREATE TABLE `member` (
UNIQUE INDEX `kauth_id` (`oauth_id`),
INDEX `delete_after` (`delete_after`)
)
ENGINE=InnoDB DEFAULT CHARSET=UTF8;
ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- 로그인 로그 테이블
CREATE TABLE `member_log` (
@@ -54,4 +53,4 @@ CREATE TABLE `member_log` (
INDEX `action` (`member_no`, `action_type`, `date`),
INDEX `member` (`member_no`, `date`)
)
ENGINE=MyISAM DEFAULT CHARSET=UTF8;
ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
+14 -8
View File
@@ -1,34 +1,40 @@
<?php
namespace sammo;
function MYDB_query($query, $connect) {
function MYDB_query($query, $connect)
{
return mysqli_query($connect, $query);
}
function MYDB_num_rows($result) {
function MYDB_num_rows($result) : int
{
return mysqli_num_rows($result);
}
/**
* @return mixed[]
*/
function MYDB_fetch_array($result) {
function MYDB_fetch_array($result)
{
return mysqli_fetch_array($result);
}
function MYDB_fetch_row($result) {
function MYDB_fetch_row($result)
{
return mysqli_fetch_row($result);
}
function MYDB_list_tables($db, $connect) {
function MYDB_list_tables($db, $connect)
{
return mysqli_query($connect, "show tables");
}
function MYDB_error($connect) {
function MYDB_error($connect)
{
return mysqli_error($connect);
}
function MYDB_close($connect) {
function MYDB_close($connect)
{
return mysqli_close($connect);
}
+62 -43
View File
@@ -13,15 +13,18 @@ $connect=$db->get();
increaseRefresh("명장일람", 2);
$query = "select conlimit from game limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$admin = MYDB_fetch_array($result);
$query = "select con,turntime from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$me = MYDB_fetch_array($result);
$con = checkLimit($me['con'], $admin['conlimit']);
if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
if ($con >= 2) {
printLimitMsg($me['turntime']);
exit();
}
?>
<!DOCTYPE html>
<html>
@@ -47,13 +50,13 @@ if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
</table>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<?php
if(isset($btn) && $btn == "NPC 보기") {
if (isset($btn) && $btn == "NPC 보기") {
$sel = "npc>=2";
} else {
$sel = "npc<2";
}
foreach(getAllNationStaticInfo() as $nation){
foreach (getAllNationStaticInfo() as $nation) {
$nationName[$nation['nation']] = $nation['name'];
$nationColor[$nation['nation']] = $nation['color'];
}
@@ -81,8 +84,8 @@ $type = array(
"베 팅 수 익 금",
"베 팅 수 익 률"
);
for($i=0; $i < 21; $i++) {
switch($i) {
for ($i=0; $i < 21; $i++) {
switch ($i) {
case 0: $query = "select nation,no,name,picture,imgsvr,experience as data from general where $sel order by data desc limit 0,10"; break;
case 1: $query = "select nation,no,name,picture,imgsvr,dedication as data from general where $sel order by data desc limit 0,10"; break;
case 2: $query = "select nation,no,name,picture,imgsvr,firenum as data from general where $sel order by data desc limit 0,10"; break;
@@ -105,24 +108,24 @@ for($i=0; $i < 21; $i++) {
case 19: $query = "select nation,no,name,picture,imgsvr,betwingold as data from general where $sel order by data desc limit 0,10"; break;
case 20: $query = "select nation,no,name,picture,imgsvr,betwingold/betgold*10000 as data from general where $sel and betgold >= 1000 order by data desc limit 0,10"; break;
}
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
echo "
<tr><td align=center colspan=10 id=bg1><font size=4>$type[$i]</font></td></tr>
<tr align=center id=bg2><td>1위</td><td>2위</td><td>3위</td><td>4위</td><td>5위</td><td>6위</td><td>7위</td><td>8위</td><td>9위</td><td>10위</td></tr>
<tr>";
for($k=0; $k < 10; $k++) {
for ($k=0; $k < 10; $k++) {
$gen = MYDB_fetch_array($result);
if($i != 2) {
if(isset($gen)) {
if ($i != 2) {
if (isset($gen)) {
$name[$k] = $gen['name'];
$nation[$k] = $gen['nation'] == 0 ? "재야" : $nationName[$gen['nation']];
$data[$k] = $gen['data'];
$color[$k] = $gen['nation'] == 0 ? "#FFFFFF" : $nationColor[$gen['nation']];
$pic[$k] = $gen['picture'];
}else{
} else {
$name[$k] = "-";
$nation[$k] = "-";
$data[$k] = "-";
@@ -137,9 +140,13 @@ for($i=0; $i < 21; $i++) {
$gen['imgsvr'] = 0;
$pic[$k] = "9999.jpg";
}
if($color[$k] == "") $color[$k] = GameConst::$basecolor4;
if($nation[$k] == "") $nation[$k] = "&nbsp;";
if($pic[$k] == "") {
if ($color[$k] == "") {
$color[$k] = GameConst::$basecolor4;
}
if ($nation[$k] == "") {
$nation[$k] = "&nbsp;";
}
if ($pic[$k] == "") {
echo "<td align=center>&nbsp;</td>";
} else {
$imageTemp = GetImageURL($gen['imgsvr']);
@@ -149,21 +156,25 @@ for($i=0; $i < 21; $i++) {
echo "</tr><tr>";
for($k=0; $k < 10; $k++) {
for ($k=0; $k < 10; $k++) {
echo "<td align=center style=background-color:{$color[$k]};color:".newColor($color[$k]).">{$nation[$k]}</td>";
}
echo "</tr><tr>";
for($k=0; $k < 10; $k++) {
for ($k=0; $k < 10; $k++) {
echo "<td align=center style=background-color:{$color[$k]};color:".newColor($color[$k]).">{$name[$k]}</td>";
}
echo "</tr><tr>";
for($k=0; $k < 10; $k++) {
if($i == 5 || $i == 7 || $i == 20) { $data[$k] = floor($data[$k]/100).".".($data[$k]%100)." %"; }
if($i >= 13 && $i <= 16) { $data[$k] = floor($data[$k]/100).".".($data[$k]%100)." %"; }
for ($k=0; $k < 10; $k++) {
if ($i == 5 || $i == 7 || $i == 20) {
$data[$k] = floor($data[$k]/100).".".($data[$k]%100)." %";
}
if ($i >= 13 && $i <= 16) {
$data[$k] = floor($data[$k]/100).".".($data[$k]%100)." %";
}
echo "<td align=center>{$data[$k]}</td>";
}
echo "</tr><tr><td colspan=10 height=5 id=bg1></td></tr>";
@@ -196,51 +207,55 @@ $func = array(
"getItemName"
);
for($i=0; $i < 4; $i++) {
for ($i=0; $i < 4; $i++) {
echo "
<tr><td align=center colspan=10 id=bg1><font size=4>$type[$i]</font></td></tr>
<tr align=center id=bg2>";
for($k=26; $k > 16; $k--) {
for ($k=26; $k > 16; $k--) {
$str = $func[$i]($k);
echo "<td>".$str."</td>";
}
echo "</tr><tr>";
for($k=26; $k > 16; $k--) {
for ($k=26; $k > 16; $k--) {
$query = "select nation,no,name,picture,imgsvr from general where {$call[$i]}={$k}";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$gen = MYDB_fetch_array($result);
if(isset($gen)) {
if (isset($gen)) {
$name[$k] = $gen['name'];
$nation[$k] = $gen['nation'] == 0 ? "재야" : $nationName[$gen['nation']];
$color[$k] = $gen['nation'] == 0 ? "#FFFFFF" : $nationColor[$gen['nation']];
$pic[$k] = $gen['picture'];
}else{
} else {
$name[$k] = "미발견";
$nation[$k] = "-";
$color[$k] = "";
$pic[$k] = "";
}
if($color[$k] == "") $color[$k] = GameConst::$basecolor4;
if($nation[$k] == "") $nation[$k] = "&nbsp;";
if($pic[$k] == "") {
if ($color[$k] == "") {
$color[$k] = GameConst::$basecolor4;
}
if ($nation[$k] == "") {
$nation[$k] = "&nbsp;";
}
if ($pic[$k] == "") {
echo "<td align=center>&nbsp;</td>";
} else {
$imageTemp = GetImageURL($gen['imgsvr']);
$imageTemp = GetImageURL($gen['imgsvr']??0);
echo "<td align=center><img src={$imageTemp}/{$pic[$k]}></img></td>";
}
}
echo "</tr><tr>";
for($k=26; $k > 16; $k--) {
for ($k=26; $k > 16; $k--) {
echo "<td align=center style=background-color:{$color[$k]};color:".newColor($color[$k]).">{$nation[$k]}</td>";
}
echo "</tr><tr>";
for($k=26; $k > 16; $k--) {
for ($k=26; $k > 16; $k--) {
echo "<td align=center style=background-color:{$color[$k]};color:".newColor($color[$k]).">{$name[$k]}</td>";
}
@@ -248,47 +263,51 @@ for($i=0; $i < 4; $i++) {
echo "
<tr align=center id=bg2>";
for($k=16; $k > 6; $k--) {
for ($k=16; $k > 6; $k--) {
$str = $func[$i]($k);
echo "<td>".$str."</td>";
}
echo "</tr><tr>";
for($k=16; $k > 6; $k--) {
for ($k=16; $k > 6; $k--) {
$query = "select nation,no,name,picture,imgsvr from general where {$call[$i]}={$k}";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$gen = MYDB_fetch_array($result);
if(isset($gen)) {
if (isset($gen)) {
$name[$k] = $gen['name'];
$nation[$k] = $gen['nation'] == 0 ? "재야" : $nationName[$gen['nation']];
$color[$k] = $gen['nation'] == 0 ? "#FFFFFF" : $nationColor[$gen['nation']];
$pic[$k] = $gen['picture'];
}else{
} else {
$name[$k] = "미발견";
$nation[$k] = "-";
$color[$k] = "";
$pic[$k] = "";
}
if($color[$k] == "") $color[$k] = GameConst::$basecolor4;
if($nation[$k] == "") $nation[$k] = "&nbsp;";
if($pic[$k] == "") {
if ($color[$k] == "") {
$color[$k] = GameConst::$basecolor4;
}
if ($nation[$k] == "") {
$nation[$k] = "&nbsp;";
}
if ($pic[$k] == "") {
echo "<td align=center>&nbsp;</td>";
} else {
$imageTemp = GetImageURL($gen['imgsvr']);
$imageTemp = GetImageURL($gen['imgsvr']??0);
echo "<td align=center><img src={$imageTemp}/{$pic[$k]}></img></td>";
}
}
echo "</tr><tr>";
for($k=16; $k > 6; $k--) {
for ($k=16; $k > 6; $k--) {
echo "<td align=center style=background-color:{$color[$k]};color:".newColor($color[$k]).">{$nation[$k]}</td>";
}
echo "</tr><tr>";
for($k=16; $k > 6; $k--) {
for ($k=16; $k > 6; $k--) {
echo "<td align=center style=background-color:{$color[$k]};color:".newColor($color[$k]).">{$name[$k]}</td>";
}
+6 -6
View File
@@ -4,6 +4,8 @@ namespace sammo;
include "lib.php";
include "func.php";
$select = Util::getReq('select', 'int', 0);
$db = DB::db();
$connect=$db->get();
@@ -28,12 +30,12 @@ increaseRefresh("왕조일람", 2);
<?php
if($select == 0) {
if ($select == 0) {
$query = "select * from emperior order by no desc";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$empcount = MYDB_num_rows($result);
for($i=0; $i < $empcount; $i++) {
for ($i=0; $i < $empcount; $i++) {
$emperior = MYDB_fetch_array($result);
echo "
@@ -76,11 +78,9 @@ if($select == 0) {
}
} else {
$query = "select * from emperior where no='$select'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$emperior = MYDB_fetch_array($result);
//background={$image}/{$emperior['l12pic']}
echo "
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style='font-size:13px;word-break:break-all;color:white;' id=bg0>
<tr>
+6 -6
View File
@@ -4,6 +4,8 @@ namespace sammo;
include "lib.php";
include "func.php";
$select = Util::getReq('select', 'int', 0);
$db = DB::db();
$connect=$db->get();
@@ -28,12 +30,12 @@ increaseRefresh("왕조일람", 2);
<?php
if($select == 0) {
if ($select == 0) {
$query = "select * from emperior_table order by no desc";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$empcount = MYDB_num_rows($result);
for($i=0; $i < $empcount; $i++) {
for ($i=0; $i < $empcount; $i++) {
$emperior = MYDB_fetch_array($result);
echo "
@@ -76,11 +78,9 @@ if($select == 0) {
}
} else {
$query = "select * from emperior_table where no='$select'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$emperior = MYDB_fetch_array($result);
//background={$image}/{$emperior['l12pic']}
echo "
<form action=a_emperior2.php method=post>
<table align=center width=1000 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
+94 -60
View File
@@ -10,11 +10,13 @@ $connect=$db->get();
increaseRefresh("갱신정보", 2);
$query = "select year,month,refresh,maxrefresh,maxonline from game limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$game = MYDB_fetch_array($result);
$log = [];
$curonline = getOnlineNum();
for($i=0; $i < 11; $i++) {
for ($i=0; $i < 11; $i++) {
$parse = explode("|", $log[count($log)-12+$i]);
$date[$i] = trim($parse[0]);
$year[$i] = trim($parse[1]);
@@ -22,10 +24,18 @@ for($i=0; $i < 11; $i++) {
$refresh[$i] = trim($parse[3]);
$online[$i] = trim($parse[4]);
}
if($game['maxrefresh'] == 0) { $game['maxrefresh'] = 1; }
if($game['maxrefresh'] < $game['refresh']) { $game['maxrefresh'] = $game['refresh']; }
if($game['maxonline'] == 0) { $game['maxonline'] = 1; }
if($game['maxonline'] < $curonline) { $game['maxonline'] = $curonline; }
if ($game['maxrefresh'] == 0) {
$game['maxrefresh'] = 1;
}
if ($game['maxrefresh'] < $game['refresh']) {
$game['maxrefresh'] = $game['refresh'];
}
if ($game['maxonline'] == 0) {
$game['maxonline'] = 1;
}
if ($game['maxonline'] < $curonline) {
$game['maxonline'] = $curonline;
}
?>
<!DOCTYPE html>
<html>
@@ -45,97 +55,119 @@ if($game['maxonline'] < $curonline) { $game['maxonline'] = $curonline; }
<table align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<tr><td colspan=4 align=center id=bg2><font size=5>접 속 량</font></td></tr>
<?php
for($i=0; $i < 11; $i++) {
for ($i=0; $i < 11; $i++) {
$w = round($refresh[$i] / $game['maxrefresh'] * 100, 1);
if($w >= 100) { $w -= 0.1; }
if($refresh[$i] < 10 && $w < 3) { $w = 3; }
elseif($refresh[$i] < 100 && $w < 6) { $w = 6; }
elseif($refresh[$i] < 1000 && $w < 9) { $w = 9; }
if ($w >= 100) {
$w -= 0.1;
}
if ($refresh[$i] < 10 && $w < 3) {
$w = 3;
} elseif ($refresh[$i] < 100 && $w < 6) {
$w = 6;
} elseif ($refresh[$i] < 1000 && $w < 9) {
$w = 9;
}
$w2 = round(100 - $w, 1);
$color = getColor($w);
$dt = substr($date[$i], 11, 5);
echo "
$color = getTrafficColor($w);
$dt = substr($date[$i], 11, 5); ?>
<tr height=30>
<td width=100 align=center>{$year[$i]}년 {$month[$i]}월</td>
<td width=60 align=center id=bg2>{$dt}</td>
<td width=100 align=center><?=$year[$i]?>년 <?=$month[$i]?>월</td>
<td width=60 align=center id=bg2><?=$dt?></td>
<td width=2 align=center id=bg1></td>
<td width=320 align=center>
<table align=center width=100% height=30 border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<tr>
<td width={$w}% bgcolor={$color} align=right>{$refresh[$i]}&nbsp;</td>
<td width={$w2}% id=bg0><font size=1>&nbsp;</font></td>
<td width=<?=$w?>% bgcolor=<?=$color?> align=right><?=$refresh[$i]?>&nbsp;</td>
<td width=<?=$w2?>% id=bg0><font size=1>&nbsp;</font></td>
</tr>
</table>
</td>
</tr>
";
<?php
}
$w = round($game['refresh'] / $game['maxrefresh'] * 100, 1);
if($w >= 100) { $w -= 0.1; }
if($game['refresh'] < 10 && $w < 3) { $w = 3; }
elseif($game['refresh'] < 100 && $w < 6) { $w = 6; }
elseif($game['refresh'] < 1000 && $w < 9) { $w = 9; }
if ($w >= 100) {
$w -= 0.1;
}
if ($game['refresh'] < 10 && $w < 3) {
$w = 3;
} elseif ($game['refresh'] < 100 && $w < 6) {
$w = 6;
} elseif ($game['refresh'] < 1000 && $w < 9) {
$w = 9;
}
$w2 = round(100 - $w, 1);
$color = getColor($w);
$color = getTrafficColor($w);
$dt = date('H:i');
echo "
?>
<tr height=30>
<td width=100 align=center>{$game['year']}년 {$game['month']}월</td>
<td width=60 align=center id=bg2>{$dt}</td>
<td width=100 align=center><?=$game['year']?>년 <?=$game['month']?>월</td>
<td width=60 align=center id=bg2><?=$dt?></td>
<td width=2 align=center id=bg1></td>
<td width=320 align=center>
<table align=center width=100% height=30 border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<tr>
<td width={$w}% bgcolor={$color} align=right>{$game['refresh']}&nbsp;</td>
<td width={$w2}% id=bg0><font size=1>&nbsp;</font></td>
<td width=<?=$w?>% bgcolor=<?=$color?> align=right><?=$game['refresh']?>&nbsp;</td>
<td width=<?=$w2?>% id=bg0><font size=1>&nbsp;</font></td>
</tr>
</table>
</td>
</tr>
<tr><td colspan=4 height=5 align=center id=bg1></td></tr>
<tr>
<td colspan=4 height=30 align=center id=bg0>최고기록: {$game['maxrefresh']}</td>
<td colspan=4 height=30 align=center id=bg0>최고기록: <?=$game['maxrefresh']?></td>
</tr>
";
?>
</table>
</td>
<td align=right>
<table align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<tr><td colspan=4 align=center id=bg2><font size=5>접 속 자</font></td></tr>
<?php
for($i=0; $i < 11; $i++) {
for ($i=0; $i < 11; $i++) {
$w = round($online[$i] / $game['maxonline'] * 100, 1);
if($w >= 100) { $w -= 0.1; }
if($online[$i] < 10 && $w < 3) { $w = 3; }
elseif($online[$i] < 100 && $w < 6) { $w = 6; }
elseif($online[$i] < 1000 && $w < 9) { $w = 9; }
if ($w >= 100) {
$w -= 0.1;
}
if ($online[$i] < 10 && $w < 3) {
$w = 3;
} elseif ($online[$i] < 100 && $w < 6) {
$w = 6;
} elseif ($online[$i] < 1000 && $w < 9) {
$w = 9;
}
$w2 = round(100 - $w, 1);
$color = getColor($w);
$dt = substr($date[$i], 11, 5);
echo "
$color = getTrafficColor($w);
$dt = substr($date[$i], 11, 5); ?>
<tr height=30>
<td width=100 align=center>{$year[$i]}년 {$month[$i]}월</td>
<td width=60 align=center id=bg2>{$dt}</td>
<td width=100 align=center><?=$year[$i]?>년 <?=$month[$i]?>월</td>
<td width=60 align=center id=bg2><?=$dt?></td>
<td width=2 align=center id=bg1></td>
<td width=320 align=center>
<table align=center width=100% height=30 border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<tr>
<td width={$w}% bgcolor={$color} align=right>{$online[$i]}&nbsp;</td>
<td width={$w2}% id=bg0><font size=1>&nbsp;</font></td>
<td width=<?=$w?>% bgcolor=<?=$color?> align=right><?=$online[$i]?>&nbsp;</td>
<td width=<?=$w2?>% id=bg0><font size=1>&nbsp;</font></td>
</tr>
</table>
</td>
</tr>
";
<?php
}
$w = round($curonline / $game['maxonline'] * 100, 1);
if($w >= 100) { $w -= 0.1; }
if($curonline < 10 && $w < 3) { $w = 3; }
elseif($curonline < 100 && $w < 6) { $w = 6; }
elseif($curonline < 1000 && $w < 9) { $w = 9; }
if ($w >= 100) {
$w -= 0.1;
}
if ($curonline < 10 && $w < 3) {
$w = 3;
} elseif ($curonline < 100 && $w < 6) {
$w = 6;
} elseif ($curonline < 1000 && $w < 9) {
$w = 9;
}
$w2 = round(100 - $w, 1);
$color = getColor($w);
$color = getTrafficColor($w);
$dt = date('H:i');
echo "
<tr height=30>
@@ -165,14 +197,14 @@ echo "
<tr><td colspan=3 align=center id=bg2><font size=5>주 의 대 상 자 (순간과도갱신)</font></td></tr>
<?php
$query = "select sum(refresh) as refresh,sum(connect) as connect from general";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$user = MYDB_fetch_array($result);
$user['connect'] = round($user['connect'], 1);
$maxrefresh = $user['refresh'];
$w = round($maxrefresh / $maxrefresh * 100, 1);
$w2 = round(100 - $w, 1);
$color = getColor($w);
$color = getTrafficColor($w);
echo "
<tr id=bg2>
<td width=98 align=center>주의대상자</td>
@@ -194,14 +226,14 @@ echo "
";
$query = "select name,refresh,connect from general order by refresh desc limit 0,5";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) {
for ($i=0; $i < $count; $i++) {
$user = MYDB_fetch_array($result);
$w = round($user['refresh'] / $maxrefresh * 100, 1);
$w2 = round(100 - $w, 1);
$color = getColor($w);
$color = getTrafficColor($w);
echo "
<tr>
<td width=98 align=center>{$user['name']}</td>
@@ -229,26 +261,28 @@ for($i=0; $i < $count; $i++) {
</html>
<?php
function getColor($per) {
function getTrafficColor($per)
{
$r = getHex($per);
$b = getHex(100 - $per);
$color = $r . "00" . $b;
return $color;
}
function getHex($dec) {
function getHex($dec)
{
$hex = floor($dec * 255 / 100);
$code = getHexCode(floor($hex / 16));
$code .= getHexCode($hex % 16);
return $code;
}
function getHexCode($hex) {
switch($hex) {
function getHexCode($hex)
{
switch ($hex) {
case 0: return "0"; case 1: return "1"; case 2: return "2"; case 3: return "3";
case 4: return "4"; case 5: return "5"; case 6: return "6"; case 7: return "7";
case 8: return "8"; case 9: return "9"; case 10: return "A"; case 11: return "B";
case 12: return "C"; case 13: return "D"; case 14: return "E"; case 15: return "F";
}
}
+80 -58
View File
@@ -12,15 +12,15 @@ $connect=$db->get();
increaseRefresh("설문조사", 1);
$query = "select no,vote from general where owner='{$userID}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$me = MYDB_fetch_array($result);
$query = "select develcost,voteopen,vote,votecomment from game limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$admin = MYDB_fetch_array($result);
$vote = explode("|", $admin['vote']);
if($vote[0] == "") {
if ($vote[0] == "") {
$vote[0] = "-";
}
@@ -51,7 +51,7 @@ function captureKey(e) {
<tr><td colspan=3 align=center id=bg2><font size=5>설 문 조 사 (<?=$admin['develcost']*5?>금과 추첨으로 유니크템 증정!)</font></td></tr>
<?php
if($session->userGrade >= 5) {
if ($session->userGrade >= 5) {
echo "
<tr>
<td width=48 align=center><input type=submit name=btn value='알림'></td>
@@ -70,29 +70,29 @@ echo "
";
$query = "select no from general where vote>0 and npc<2";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$voteCount = MYDB_num_rows($result);
$query = "select no from general where npc<2";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$allCount = MYDB_num_rows($result);
$percentage = round($voteCount / $allCount * 100, 1);
$voteTypeCount = count($vote);
for($i=1; $i < $voteTypeCount; $i++) {
for ($i=1; $i < $voteTypeCount; $i++) {
echo "
<tr>
<td width=48 align=center style=color:".getNewColor($i)."; bgcolor=".getColor($i).">{$i}.</td>
<td width=48 align=center style=color:".getNewColor($i)."; bgcolor=".getVoteColor($i).">{$i}.</td>
<td width=98 align=center>
";
if($me['vote'] == 0 && $me['no'] > 0) {
if ($me['vote'] == 0 && $me['no'] > 0) {
echo "
<input type=radio name=sel value={$i}>
";
} elseif($admin['voteopen'] >= 1 || $session->userGrade >= 5) {
} elseif ($admin['voteopen'] >= 1 || $session->userGrade >= 5) {
$query = "select no from general where vote='{$i}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$vCount = MYDB_num_rows($result);
$per = @round($vCount / $voteCount * 100, 1);
@@ -111,7 +111,7 @@ for($i=1; $i < $voteTypeCount; $i++) {
echo "
<tr>
";
if($me['vote'] == 0 && $me['no'] > 0) {
if ($me['vote'] == 0 && $me['no'] > 0) {
echo "
<td align=center>투표</td>
<td align=center><input type=submit name=btn value='투표'></td>
@@ -126,7 +126,7 @@ echo "
</tr>
";
if($session->userGrade >= 5) {
if ($session->userGrade >= 5) {
echo "
<tr>
<td align=center><input type=submit name=btn value='리셋'></td>
@@ -136,7 +136,7 @@ if($session->userGrade >= 5) {
";
}
if($admin['votecomment'] != "") {
if ($admin['votecomment'] != "") {
$comment = explode("|", $admin['votecomment']);
$commentCount = count($comment);
} else {
@@ -149,7 +149,7 @@ echo "
<td colspan=4 align=center id=bg1>댓 글</td>
</tr>
";
for($i=0; $i < $commentCount; $i++) {
for ($i=0; $i < $commentCount; $i++) {
$cmt = explode(":", $comment[$i]);
$cmt[2] = Tag2Code($cmt[2]);
$j = $i+1;
@@ -162,7 +162,7 @@ for($i=0; $i < $commentCount; $i++) {
</tr>
";
}
if($me['no'] > 0) {
if ($me['no'] > 0) {
echo "
<tr>
<td width=108 colspan=2 align=center>-</td>
@@ -178,7 +178,7 @@ if($me['no'] > 0) {
<tr><td colspan=3 align=center id=bg2><font size=5>
전 체 통 계
<?php
if($session->userGrade >= 5) {
if ($session->userGrade >= 5) {
echo "
<input type=submit name=btn value='숨김'>
<input type=submit name=btn value='전체통계만'>
@@ -187,7 +187,7 @@ if($session->userGrade >= 5) {
echo "
</font></td></tr>";
if($admin['voteopen'] >= 1 || $session->userGrade >= 5) {
if ($admin['voteopen'] >= 1 || $session->userGrade >= 5) {
echo "
<tr>
<td width=98 align=center>전 체</td>
@@ -197,26 +197,43 @@ if($admin['voteopen'] >= 1 || $session->userGrade >= 5) {
<tr>
";
$query = "select no from general where npc<2";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$memCount = MYDB_num_rows($result);
$query = "select nation,vote from general where npc<2";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) {
$vote = MYDB_fetch_array($result);
$totalVote[$vote['vote']]++;
if($vote['vote'] > 0) { $nationVoteCount[$vote['nation']]++; }
$nationVote[$vote['nation']][$vote['vote']]++;
$memCount = $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc<2');
if ($memCount == 0) {
$memCount = 1;
}
for($i=0; $i < $voteTypeCount; $i++) {
$per = @round($totalVote[$i] / $memCount * 100, 1);
$totalVote = [];
$nationVoteCount = [[0]];
$nationVote = [[]];
foreach ($db->query("SELECT nation, vote, count(`no`) as cnt FROM general WHERE npc<2 GROUP BY nation, vote") as $row) {
$nation = $row['nation'];
$vote = $row['vote'];
$cnt = $row['cnt'];
if (!isset($totalVote[$vote])) {
$totalVote[$vote] = 0;
}
if (!isset($nationVoteCount[$nation])) {
$nationVoteCount[$nation] = 0;
$nationVote[$nation] = [];
}
if (!isset($nationVote[$nation][$vote])) {
$nationVote[$nation][$vote] = 0;
}
$totalVote[$vote] += $cnt;
$nationVoteCount[$nation] += $cnt;
$nationVote[$nation][$vote] += $cnt;
}
for ($i=0; $i < $voteTypeCount; $i++) {
$per = round(($totalVote[$i]??0) / $memCount * 100, 1);
// if($per < 5) { $vote['cnt'] = "&nbsp;"; }
echo "
<td width={$per}% align=center style=color:".getNewColor($i)."; bgcolor=".getColor($i).">{$totalVote[$i]}</td>
<td width={$per}% align=center style=color:".getNewColor($i)."; bgcolor=".getVoteColor($i).">{$totalVote[$i]}</td>
";
}
@@ -228,13 +245,18 @@ if($admin['voteopen'] >= 1 || $session->userGrade >= 5) {
";
}
if($admin['voteopen'] >= 2 || $session->userGrade >= 5) {
if ($admin['voteopen'] >= 2 || $session->userGrade >= 5) {
$query = "select no from general where nation=0 and npc<2";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$memCount = MYDB_num_rows($result);
if ($memCount == 0) {
$memCount = 1;
}
if(!$nationVoteCount[0]) { $nationVoteCount[0] = 0; }
$percentage = @round($nationVoteCount[0] / $memCount * 100, 1);
if (!isset($nationVoteCount[0])) {
$nationVoteCount[0] = 0;
}
$percentage = round($nationVoteCount[0] / $memCount * 100, 1);
echo "
<tr>
@@ -245,11 +267,11 @@ if($admin['voteopen'] >= 2 || $session->userGrade >= 5) {
<tr>
";
for($i=0; $i < $voteTypeCount; $i++) {
$per = @round($nationVote[0][$i] / $memCount * 100, 1);
for ($i=0; $i < $voteTypeCount; $i++) {
$per = round(Util::array_get($nationVote[0][$i], 0) / $memCount * 100, 1);
// if($per < 5) { $vote['cnt'] = "&nbsp;"; }
echo "
<td width={$per}% align=center style=color:".getNewColor($i)."; bgcolor=".getColor($i).">{$nationVote[0][$i]}</td>
<td width={$per}% align=center style=color:".getNewColor($i)."; bgcolor=".getVoteColor($i).">{$nationVote[0][$i]}</td>
";
}
@@ -261,32 +283,32 @@ if($admin['voteopen'] >= 2 || $session->userGrade >= 5) {
";
$query = "select nation,color,name,gennum from nation order by gennum desc";
$nationResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nationResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$nationcount = MYDB_num_rows($nationResult);
for($i=0; $i < $nationcount; $i++) {
for ($i=0; $i < $nationcount; $i++) {
$nation = MYDB_fetch_array($nationResult);
$query = "select no from general where nation='{$nation['nation']}' and npc<2";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
$memCount = MYDB_num_rows($result);
if(!$nationVoteCount[$nation['nation']]) { $nationVoteCount[$nation['nation']] = 0; }
$percentage = @round($nationVoteCount[$nation['nation']] / $memCount * 100, 1);
$voteCount = $nationVoteCount[$nation['nation']] ?? 0;
$percentage = round($voteCount / $memCount * 100, 1);
echo "
<tr>
<td align=center style=color:".newColor($nation['color'])."; bgcolor={$nation['color']}>{$nation['name']}</td>
<td align=center>{$nationVoteCount[$nation['nation']]} / {$memCount} ({$percentage} %)</td>
<td align=center>{$voteCount} / {$memCount} ({$percentage} %)</td>
<td align=center>
<table align=center width=100% height=100% border=0 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<tr>
";
for($k=0; $k < $voteTypeCount; $k++) {
$per = @round($nationVote[$nation['nation']][$k] / $memCount * 100, 1);
for ($k=0; $k < $voteTypeCount; $k++) {
$per = round($nationVote[$nation['nation']][$k] / $memCount * 100, 1);
// if($per < 5) { $vote['cnt'] = "&nbsp;"; }
echo "
<td width={$per}% align=center style=color:".getNewColor($k)."; bgcolor=".getColor($k).">{$nationVote[$nation['nation']][$k]}</td>
<td width={$per}% align=center style=color:".getNewColor($k)."; bgcolor=".getVoteColor($k).">{$nationVote[$nation['nation']][$k]}</td>
";
}
@@ -310,12 +332,13 @@ if($admin['voteopen'] >= 2 || $session->userGrade >= 5) {
</html>
<?php
function getColor($type) {
if($type > 0) {
function getVoteColor($type)
{
if ($type > 0) {
$type = (($type - 1) % 7) + 1;
}
switch($type) {
switch ($type) {
case 0: $color = "black"; break;
case 1: $color = "red"; break;
case 2: $color = "orange"; break;
@@ -329,12 +352,13 @@ function getColor($type) {
return $color;
}
function getNewColor($type) {
if($type > 0) {
function getNewColor($type)
{
if ($type > 0) {
$type = (($type - 1) % 7) + 1;
}
switch($type) {
switch ($type) {
case 2: $color = "black"; break;
case 3: $color = "black"; break;
default:$color = "white"; break;
@@ -342,5 +366,3 @@ function getNewColor($type) {
return $color;
}
+5 -1
View File
@@ -3,6 +3,10 @@ namespace sammo;
include "lib.php";
include "func.php";
$msg = Util::getReq('msg');
$msg2 = Util::getReq('msg2');
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
@@ -105,7 +109,7 @@ for ($i=0; $i < $count; $i++) {
$chk = 1;
}
$pv = round($auction['value'] * 100 / $auction['amount']) / 100 + 0.001;
$pv = substr($pv, 0, 4);
$pv = substr((string)$pv, 0, 4);
if ($auction['stuff'] != 0) {
$pv = '-';
}
+3 -3
View File
@@ -53,9 +53,9 @@ table { font-family:'맑은 고딕'; line-height:110%; }
font { font-family:'맑은 고딕'; line-height:110%; }
input { font-family:'맑은 고딕'; line-height:110%; height:20px }
select { font-family:'굴림'; line-height:100%; }
#bg0 { background-image:url(<?=$images?>/back_walnut.jpg); }
#bg1 { background-image:url(<?=$images?>/back_green.jpg); }
#bg2 { background-image:url(<?=$images?>/back_blue.jpg); }
#bg0 { background-image:url(<?=ServConfig::$gameImagePath?>/back_walnut.jpg); }
#bg1 { background-image:url(<?=ServConfig::$gameImagePath?>/back_green.jpg); }
#bg2 { background-image:url(<?=ServConfig::$gameImagePath?>/back_blue.jpg); }
</style>
</head>
+3 -3
View File
@@ -49,9 +49,9 @@ table { font-family:'맑은 고딕'; line-height:110%; }
font { font-family:'맑은 고딕'; line-height:110%; }
input { font-family:'맑은 고딕'; line-height:110%; height:20px }
select { font-family:'굴림'; line-height:100%; }
#bg0 { background-image:url(<?=$images?>/back_walnut.jpg); }
#bg1 { background-image:url(<?=$images?>/back_green.jpg); }
#bg2 { background-image:url(<?=$images?>/back_blue.jpg); }
#bg0 { background-image:url(<?=ServConfig::$gameImagePath?>/back_walnut.jpg); }
#bg1 { background-image:url(<?=ServConfig::$gameImagePath?>/back_green.jpg); }
#bg2 { background-image:url(<?=ServConfig::$gameImagePath?>/back_blue.jpg); }
</style>
</head>
-2
View File
@@ -65,8 +65,6 @@ function myclock() {
myCommandList();
function myCommandList() {
global $images;
$db = DB::db();
$connect=$db->get();
$userID = Session::getUserID();
+5 -14
View File
@@ -68,11 +68,10 @@ function getAllNationStaticInfo(){
}
function GetImageURL($imgsvr) {
global $image, $image1;
if($imgsvr == 0) {
return $image;
return ServConfig::$sharedIconPath;
} else {
return $image1;
return AppConf::getUserIconPathWeb();
}
}
@@ -117,8 +116,6 @@ function getRandGenName() {
function cityInfo() {
global $images;
$db = DB::db();
$connect=$db->get();
$userID = Session::getUserID();
@@ -232,8 +229,6 @@ function cityInfo() {
}
function myNationInfo() {
global $images;
$db = DB::db();
$connect=$db->get();
$userID = Session::getUserID();
@@ -749,8 +744,6 @@ function myInfo() {
}
function generalInfo($no) {
global $image, $images;
$db = DB::db();
$connect=$db->get();
@@ -851,8 +844,8 @@ function generalInfo($no) {
elseif($general['mode'] == 1) { $general['mode'] = "<font color=limegreen>수비 함(훈사60)</font>"; }
else { $general['mode'] = "<font color=red>수비 안함</font>"; }
$weapImage = "{$images}/weap{$general['crewtype']}.jpg";
if($admin['show_img_level'] < 2) { $weapImage = "{$image}/default.jpg"; };
$weapImage = ServConfig::$gameImagePath."/weap{$general['crewtype']}.jpg";
if($admin['show_img_level'] < 2) { $weapImage = ServConfig::$sharedIconPath."/default.jpg"; };
$imageTemp = GetImageURL($general['imgsvr']);
echo "<table width=498 border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg2>
<tr>
@@ -940,7 +933,7 @@ function myInfo2() {
}
function generalInfo2($no) {
global $image, $images, $_dexLimit;
global $_dexLimit;
$db = DB::db();
$connect=$db->get();
@@ -1127,8 +1120,6 @@ function PushMsg($type, $nation, $picture, $imgsvr, $from, $fromcolor, $to, $toc
}
function msgprint($msg, $name, $picture, $imgsvr, $when, $num, $type) {
global $images;
$db = DB::db();
$connect=$db->get();
+2 -3
View File
@@ -23,14 +23,13 @@ function printLimitMsg($turntime) {
function bar($per, $h=7) {
global $images;
if($h == 7) { $bd = 0; $h = 7; $h2 = 5; }
else { $bd = 1; $h = 12; $h2 = 8; }
$per = round($per, 1);
if($per < 1 || $per > 99) { $per = round($per); }
$str1 = "<td width={$per}% background={$images}/pb{$h2}.gif></td>";
$str2 = "<td width=*% background={$images}/pr{$h2}.gif></td>";
$str1 = "<td width={$per}% background=".ServConfig::$gameImagePath."/pb{$h2}.gif></td>";
$str2 = "<td width=*% background=".ServConfig::$gameImagePath."/pr{$h2}.gif></td>";
if($per <= 0) { $str1 = ""; }
elseif($per >= 100) { $str2 = ""; }
$str = "
+1 -1
View File
@@ -31,7 +31,7 @@ if($general){
if($general['imgsvr'] == 0) {
$me['picture'] = '../../image/'.$general['picture'];
} else {
$me['picture'] = '../d_pic/'.$general['picture'];
$me['picture'] = AppConf::getUserIconPathWeb().'/'.$general['picture'];
}
}
+1 -1
View File
@@ -6,7 +6,7 @@ $(document).ready( function () {
db_port:"required",
db_id:"required",
db_pw:"required",
db_name:"required",
db_name:"required"
},
errorElement: "div",
errorPlacement: function ( error, element ) {
+4 -16
View File
@@ -5,11 +5,11 @@ namespace sammo;
$loader = require __dir__.'/../vendor/autoload.php';
$loader->addPsr4('sammo\\', __DIR__.'/sammo', true);
$loader->addClassMap((function(){
$loader->addClassMap((function () {
$d_settingMap = [];
foreach(glob(__dir__.'/d_setting/*.php') as $filepath){
foreach (glob(__dir__.'/d_setting/*.php') as $filepath) {
$filename = basename($filepath);
if(Util::ends_with($filename, '.orig.php')){
if (Util::ends_with($filename, '.orig.php')) {
continue;
}
$classname = explode('.', $filename)[0];
@@ -36,11 +36,6 @@ include "MYDB.php";
define('STEP_LOG', true);
define('PROCESS_LOG', true);
$_startTime = microtime(true);
$_ver = "서비스중";
$x_version = "삼국지 모의전투 PHP HideD v0.1";
$x_banner = "KOEI의 이미지를 사용, 응용하였습니다 / 제작 : 유기체(jwh1807@gmail.com), HideD(hided62@gmail.com)";
$x_helper = "도움 주신 분들";
$x_develrate = 50; // 내정시 최하 민심 설정
$_upgradeLimit = 30; // 능력치 상승 경험치
$_dexLimit = 1000000; // 숙련도 제한치
$_defaultatmos = 40; // 초기 사기치
@@ -61,13 +56,6 @@ $x_goodgenleader = 65; // 명장,지장에 사용될 통솔 제한
$x_goodgenpower = 65; // 명장에 사용될 무력 제한
$x_goodgenintel = 65; // 지장에 사용될 지력 제한
$_taxrate = 0.01; // 군량 매매시 세율
//$images = "http://115.68.28.99/images";
//$image = "http://115.68.28.99/image";
//$images = "http://jwh1807.vipweb.kr/images";
//$image = "http://jwh1807.vipweb.kr/image";
$image1 = "../d_pic";
$images = "/images";
$image = "/image";
ob_start();
session_cache_limiter('nocache');//NOTE: 캐시가 가능하도록 설정해야 할 수도 있음. 주의!
@@ -76,7 +64,7 @@ session_cache_limiter('nocache');//NOTE: 캐시가 가능하도록 설정해야
// 에러 메세지 출력
function Error($message, $url="")
{
if(!$url){
if (!$url) {
$url = $_SERVER['REQUEST_URI'];
}
file_put_contents(__dir__."/logs/_db_bug.txt", "{\"url\":\"$url\",\"msg\":\"$message\"}\n", FILE_APPEND);
+4 -10
View File
@@ -110,8 +110,6 @@ switch($commandtype) {
}
function starter($name, $type=0) {
//FIXME: 장기적으로 template로 변경해야함.
global $images;
echo '
<!DOCTYPE html>
<html>
@@ -238,7 +236,6 @@ function command_11($turn, $command) {
$connect=$db->get();
$userID = Session::getUserID();
global $images, $image;
starter("징병");
$query = "select * from game limit 1";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
@@ -400,8 +397,8 @@ function calc(cost, formnum) {
$defence = $this->defence + $abil;
$speed = $this->speed;
$avoid = $this->avoid;
$weapImage = "{$images}/weap{$i}.jpg";
if($admin['show_img_level'] < 2) { $weapImage = "{$image}/default.jpg"; }
$weapImage = ServConfig::$gameImagePath."/weap{$i}.jpg";
if($admin['show_img_level'] < 2) { $weapImage = ServConfig::$sharedIconPath."/default.jpg"; }
$baseRiceShort = round($baseRice, 1);
$baseCostShort = round($baseCost, 1);
@@ -447,7 +444,6 @@ function command_12($turn, $command) {
$connect=$db->get();
$userID = Session::getUserID();
global $images, $image;
starter("모병");
$query = "select * from game limit 1";
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
@@ -611,8 +607,8 @@ function calc(cost, formnum) {
$defence = $this->defence + $abil;
$speed = $this->speed;
$avoid = $this->avoid;
$weapImage = "{$images}/weap{$i}.jpg";
if($admin['show_img_level'] < 2) { $weapImage = "{$image}/default.jpg"; }
$weapImage = ServConfig::$gameImagePath."/weap{$i}.jpg";
if($admin['show_img_level'] < 2) { $weapImage = ServConfig::$sharedIconPath."/default.jpg"; }
$baseRiceShort = round($baseRice, 1);
$baseCostShort = round($baseCost, 1);
@@ -999,8 +995,6 @@ function command_24($turn, $command) {
}
function command_25($turn, $command) {
global $images;
$db = DB::db();
$connect=$db->get();
$userID = Session::getUserID();
+2 -2
View File
@@ -88,7 +88,7 @@ if($admin['show_img_level'] >= 3) {
?>
<tr>
<td width=498 align=right rowspan=2 height=64 id=bg1>장수</td>
<td width=498><img src=<?=$image?>/1001.jpg border=0 name=picture width=64 height=64></td>
<td width=498><img src=<?=ServConfig::$sharedIconPath?>/1001.jpg border=0 name=picture width=64 height=64></td>
</tr>
<?php
}
@@ -133,7 +133,7 @@ function changeGen() {
sel = Math.floor(Math.random() * <?=$count?>);
document.form1.face.selectedIndex = sel;
num = document.form1.face.value;
document.form1.picture.src="<?=$image?>" + "/"+ num +".jpg";
document.form1.picture.src="<?=ServConfig::$sharedIconPath?>" + "/"+ num +".jpg";
}
function selectGen() {
+9 -4
View File
@@ -12,16 +12,21 @@ $db = RootDB::db();
$member = $db->queryFirstRow('SELECT `id`, `name`, `grade`, `picture` FROM `MEMBER` WHERE `NO` = %i', $userID);
if(!$member['picture']){
$picture = IMAGE.'/default.jpg';
$picture = ServConfig::$sharedIconPath.'/default.jpg';
}
else{
$picture = $member['picture'];
if(strlen($picture) > 11){
$picture = substr($picture, 0, -10);
}
$picture = '../d_pic/'.$picture;
if(!file_exists($picture)){
$picture = IMAGE.'/'.$picture;
$pictureFSPath = AppConf::getUserIconPathFS().'/'.$picture;
if(file_exists($pictureFSPath)){
$picture = AppConf::getUserIconPathWeb().'/'.$picture;
}
else{
$picture = ServConfig::$sharedIconPath.'/'.$picture;
}
}
+2 -2
View File
@@ -19,10 +19,10 @@ foreach($db->query('SELECT member.*, max(member_log.date) as loginDate from memb
group by member.no order by member.no asc') as $member){
if($member['IMGSVR']){
$icon = RootDB::getServerBasepath().'/d_pic/'.$member['PICTURE'];
$icon = AppConf::getUserIconPathWeb().'/'.$member['PICTURE'];
}
else{
$icon = IMAGE.'/'.$member['PICTURE'];
$icon = ServConfig::$sharedIconPath.'/'.$member['PICTURE'];
}
$userList[] = [
+1 -1
View File
@@ -20,7 +20,7 @@ else{
$dt = '00000000';
}
$dest = ROOT.'/d_pic/'.$picName;
$dest = AppConf::getUserIconPathFS().'/'.$picName;
$rf = date('Ymd');
+1 -1
View File
@@ -88,7 +88,7 @@ if($action == 'scrub_icon'){
$cnt = 0;
foreach(glob(__DIR__.'/../d_pic/*.{jpg,png,gif}', GLOB_BRACE) as $filepath){
foreach(glob(AppConf::getUserIconPathFS().'/*.{jpg,png,gif}', GLOB_BRACE) as $filepath){
$filename = basename($filepath);
if (array_key_exists($filename, $usedIcon)) {
+39 -40
View File
@@ -6,7 +6,6 @@ require(__dir__.'/../vendor/autoload.php');
WebUtil::setHeaderNoCache();
$category = Util::array_get($_GET['category'], 0);
//FIXME: 겨우 category 구분을 위해 php를 써야하는가? JavaScript로 바꾸자
$images = IMAGES;
?>
<!DOCTYPE html>
<html>
@@ -20,9 +19,9 @@ $images = IMAGES;
body { color:white; background-color:black; border-width:1; border-color:gray; }
table { font-family:'맑은 고딕'; line-height:110%; }
font { font-family:'맑은 고딕'; line-height:110%; }
#bg0 { background-image:url(<?=$images?>/back_walnut.jpg); }
#bg1 { background-image:url(<?=$images?>/back_blue.jpg); }
#bg2 { background-image:url(<?=$images?>/back_green.jpg); }
#bg0 { background-image:url(<?=ServConfig::$gameImagePath?>/back_walnut.jpg); }
#bg1 { background-image:url(<?=ServConfig::$gameImagePath?>/back_blue.jpg); }
#bg2 { background-image:url(<?=ServConfig::$gameImagePath?>/back_green.jpg); }
.intro {
font-size: 15px;
@@ -87,7 +86,7 @@ if ($category == 0) {
<br>
◈ 우선 예약턴제 전략 웹게임인 『체섭』의 컨셉 &amp; 모토를 이해해봅시다.</font><br>
<br>
<img src=<?=$images?>/help_01_01.jpg class=leftFloat>
<img src=<?=ServConfig::$gameImagePath?>/help_01_01.jpg class=leftFloat>
<font class=title>『웹게임』이란?</font><br>
 <font class=bullet>☞</font> 온라인게임과 달리 특별한 프로그램 설치 없이도 인터넷 브라우저상에서 바로 즐길 수 있는 게임들을 칭합니다. 그렇기 때문에 어딜가든 인터넷이 되는 곳이라면 언제든지 접속해서 플레이가 가능합니다. 심지어 모바일기기(휴대폰, PMP)에서도 가능합니다!<br>
<br>
@@ -102,7 +101,7 @@ if ($category == 0) {
<br>
 <font class=bullet>☞</font> 체섭 입문을 권유하는 분들이 항상 하는 말씀 : 하루 5분 투자만으로도 가능한 게임!<br>
<br>
<img src=<?=$images; ?>/help_01_03.jpg class=rightFloat>
<img src=<?=ServConfig::$gameImagePath?>/help_01_03.jpg class=rightFloat>
<font class=title>『삼국지 모의전투』?</font><br>
 <font class=bullet>☞</font> 동양인들이 열광하는 중국 삼국시대(서기 184년~280년)를 배경으로 하여, 유저 자신이 한명의 장수가 되어 다른 장수들과 각축을 벌이며 중원에서 활약하는 게임입니다.<br>
<br>
@@ -115,7 +114,7 @@ if ($category == 0) {
<br>
 <font class=bullet>☞</font> 일반 MMORPG에서 길드장, 혈맹장을 즐겨 하신분들이라면 체섭에서의 수뇌부나 군주를 하면서 휘하 장수들을 거느리며 통솔하는 것에서 재미를 찾을 수 있을지도 모릅니다!<br>
<br>
<img src=<?=$images; ?>/help_01_02.jpg class=leftFloat>
<img src=<?=ServConfig::$gameImagePath?>/help_01_02.jpg class=leftFloat>
 <font class=bullet>☞</font> 힘들이지 않고 여유롭게, 캐릭터를 육성하거나 전투하는 재미를 찾을 수 있습니다!<br>
<br>
 <font class=bullet>☞</font> 온라인 게임을 하면서도 뭔지 모르게 외롭다거나, 심심하거나, 멍때리며 칼질만 하는 당신을 발견했다면... 삼모전만의 매력인 IRC 채팅(공개채널, 국가채널 등)을 즐기며 여유로운 게임을 겸해보세요! 몇시간이 훌쩍 지나는 것을 체험할 수 있습니다!<br>
@@ -137,7 +136,7 @@ if ($category == 0) {
<td>
<font class=intro>◈ 회원 가입을 해봅시다!</font><br>
<br>
<img src=<?=$images; ?>/help_02_01.jpg class=leftFloat>
<img src=<?=ServConfig::$gameImagePath?>/help_02_01.jpg class=leftFloat>
 <font class=bullet>☞</font> 아직 회원가입을 하지 않았다면 계정생성을 눌러봅시다.<br>
<br>
 <font class=bullet>☞</font> 원하는 ID를 입력합니다.<br>
@@ -146,7 +145,7 @@ if ($category == 0) {
<br>
 <font class=bullet>☞</font> 확인을 위해 다시한번 PW를 입력합니다.<br>
<br>
<img src=<?=$images; ?>/help_02_02.jpg class=rightFloat>
<img src=<?=ServConfig::$gameImagePath?>/help_02_02.jpg class=rightFloat>
 <font class=bullet>※</font> 비밀번호는 가입하는 순간 암호화되어 저장되므로 운영자도 알 수 없습니다. 그래서 비밀번호 찾기 기능이 없지요. 비밀번호를 잊었을 경우, 운영자에게 요청하여 초기화는 가능합니다. 안심하셔도 좋습니다.<br>
<br>
 <font class=bullet>☞</font> 주민등록번호를 입력합니다.<br>
@@ -180,16 +179,16 @@ if ($category == 0) {
<td>
<font class=intro>◈ 웹게임에서 로그인은 굉장히 중요한 부분입니다. 잘 읽어주세요~</font><br>
<br>
<img src=<?=$images; ?>/help_03_01.jpg class=leftFloat>
<img src=<?=ServConfig::$gameImagePath?>/help_03_01.jpg class=leftFloat>
 <font class=bullet>☞</font> 로그인하는 순간 IP같은 몇가지 접속 정보가 서버에 기록됩니다. 특히 공공장소에서 접속 장소를 명시하지 않고 접속하는 경우, 멀티로 판단되어 캐릭터가 블럭되는 경우가 있으므로 주의해주세요!<br>
<br>
 <font class=bullet>☞</font> 한 가정에서 형과 동생, 직장에서 직장 동료들과 함께 플레이하는 경우는 특히 접속장소를 잘 적어주세요.<br>
<br>
 <font class=bullet>예시)</font> 자택/형, 삼모대학 도서관, 62사단 사지방 등<br>
<br>
<p align=center><img src=<?=$images; ?>/help_03_02.jpg>
<img src=<?=$images; ?>/help_03_03.jpg>
<img src=<?=$images; ?>/help_03_04.jpg></p>
<p align=center><img src=<?=ServConfig::$gameImagePath?>/help_03_02.jpg>
<img src=<?=ServConfig::$gameImagePath?>/help_03_03.jpg>
<img src=<?=ServConfig::$gameImagePath?>/help_03_04.jpg></p>
 <font class=bullet>☞</font> 위처럼, 한 IP에서 여러명이 접속해야하는 경우는 항상 멀티후보로 분류되므로 조심해야 합니다. 동생이 형의 계정으로 접속하여 대신 명령을 해준다든지(이하 대턴입력) 하는 등의 행동은 여러가지 분석정보에 의해서 적발될 수 있습니다.<br>
<br>
 <font class=bullet>☞</font> 한 IP에서 다수가 접속해야 하는 경우는 정황판단에 의해서 언제든지 블럭대상이 될 수 있음을 명심하시고, 블럭당할시에 이의제기는 받지 않습니다. 그만큼 확실히 멀티나 대턴이 확실하다고 판단되는 경우를 적발합니다.<br>
@@ -213,7 +212,7 @@ if ($category == 0) {
<td>
<font class=intro>◈ 각 서버의 특징을 알아봅시다.</font><br>
<br>
<img src=<?=$images; ?>/help_04_01.jpg class=leftFloat>
<img src=<?=ServConfig::$gameImagePath?>/help_04_01.jpg class=leftFloat>
 <font class=bullet>☞</font> 온라인 게임을 해보셨다면 익숙한 서버 선택 화면입니다. 체섭은 크게 유저들만 활동하는 메이져 서버인 체섭과 NPC들과 어울릴 수 있는 마이너 서버인 퀘풰퉤훼섭으로 분류됩니다. 마이너 서버들은 본래 테스트 서버 목적이므로 언제든지 리셋, 폐쇄될 수 있습니다.<br>
<br>
 <font class=bullet>☞</font> 체섭은 180년에 모두 공백지인 상태에서 유저들끼리 경쟁하는 가장 기본적인 방법의 삼모전입니다. 활동 유저도 가장 많고 그만큼 치열합니다. 대신 눈에 띄는 활약을 했다면 『명예의 전당』과 『왕조일람』에 그 명성을 영원히 남길 수 있습니다!<br>
@@ -227,7 +226,7 @@ if ($category == 0) {
 <font class=bullet>☞</font> 훼섭은 퉤섭과 비슷한 스타일이지만 고속진행이 특징입니다. 아침에 시작해서 밤에 통일되는 쾌속 서버! 휴가나 방학에 즐기면 좋습니다.<br>
<div class=clear></div>
<br>
<img src=<?=$images; ?>/help_04_02.jpg class=rightFloat>
<img src=<?=ServConfig::$gameImagePath?>/help_04_02.jpg class=rightFloat>
<font class=intro>◈ 원하는 서버에 캐릭터를 생성해 봅시다.</font><br>
<br>
 <font class=bullet>☞</font> 마음에 드는 서버에서 장수생성을 클릭해봅시다. 저는 퉤섭을 찍어볼게요~<br>
@@ -245,13 +244,13 @@ if ($category == 0) {
 <font class=bullet>☞</font> 장수생성을 누릅시다.<br>
<br>
 <font class=bullet>☞</font> 다시 로그인 해봅시다. 캐릭터가 생성되었군요!<br>
<img src=<?=$images; ?>/help_04_03.jpg class=leftFloat>
<img src=<?=ServConfig::$gameImagePath?>/help_04_03.jpg class=leftFloat>
<div class=clear></div>
<br>
<font class=intro>◈ 자신의 계정을 관리하는 방법을 알아봅시다.</font><br>
<br>
<img src=<?=$images; ?>/help_04_04.jpg class=leftFloat>
<img src=<?=$images; ?>/help_04_05.jpg class=rightFloat>
<img src=<?=ServConfig::$gameImagePath?>/help_04_04.jpg class=leftFloat>
<img src=<?=ServConfig::$gameImagePath?>/help_04_05.jpg class=rightFloat>
 <font class=bullet>☞</font> 플레이에 들어가기에 앞서 계정관리를 살펴봅시다. 계정관리의 비번&amp;전콘을 눌러봅시다.<br>
<br>
 <font class=bullet>☞</font> 비밀번호를 변경할 수 있습니다.<br>
@@ -279,11 +278,11 @@ if ($category == 0) {
<td>
<font class=intro>◈ 가장 기본이 되는 턴입력을 해봅시다.</font><br>
<br>
<img src=<?=$images; ?>/help_05_01.jpg class=leftFloat>
<img src=<?=ServConfig::$gameImagePath?>/help_05_01.jpg class=leftFloat>
 <font class=bullet>☞</font> 중간에 보이는 세로 스크롤창에서 클릭, 드래그, Ctrl+클릭, Shift+클릭을 해봅시다. 클릭은 1개만 선택됩니다.<br>
<br>
<img src=<?=$images; ?>/help_05_03.jpg class=rightFloat>
<img src=<?=$images; ?>/help_05_02.jpg class=rightFloat>
<img src=<?=ServConfig::$gameImagePath?>/help_05_03.jpg class=rightFloat>
<img src=<?=ServConfig::$gameImagePath?>/help_05_02.jpg class=rightFloat>
 <font class=bullet>☞</font> 1턴 부분에서 버튼을 누른 후, 떼지 말고 5턴 부분까지 끌어봅시다. 여러개가 선택됩니다. 드래그라고 하지요.<br>
<br>
 <font class=bullet>☞</font> 이번엔 1턴을 클릭해봅시다. 그리고 Ctrl키를 누른 상태에서 3턴, 6턴을 눌러봅시다. 떨어져있는 여러가지를 선택할 수 있답니다.<br>
@@ -291,7 +290,7 @@ if ($category == 0) {
 <font class=bullet>☞</font> 이번엔 1턴 부분을 클릭해봅시다. 그리고 Shift키를 누른 상태에서 5턴 부분을 클릭해 봅시다. 드래그와 비슷한 기능이죠? 이처럼 여러가지 방법을 사용해서 예약할 턴을 선택할 수 있습니다.<br>
<div class=clear></div>
<br>
<img src=<?=$images; ?>/help_05_04.jpg class=leftFloat>
<img src=<?=ServConfig::$gameImagePath?>/help_05_04.jpg class=leftFloat>
 <font class=bullet>☞</font> 간단하게 1턴, 3턴을 골라봅시다.<br>
<br>
 <font class=bullet>☞</font> 우측에 보이는 콤보박스를 클릭하면 명령 목록이 쭉 나열됩니다. 휠이나 스크롤바를 사용하여 아래로 쭉 내려봅시다. ===개인=== 탭에 가장 먼저 보이는 견문을 선택합니다.
@@ -300,7 +299,7 @@ if ($category == 0) {
<br>
 <font class=bullet>☞</font> 가장 우측에 보이는 곳에 1, 3번째 칸에 견문이 입력되었을겁니다. 이처럼 원하는 턴을 선택하고, 원하는 명령을 선택하고, 실행을 눌러서 원하는 명령을 원하는 턴에 입력하는게 가장 기본적인 플레이 방법입니다.<br>
<br>
<img src=<?=$images; ?>/help_05_05.jpg class=leftFloat>
<img src=<?=ServConfig::$gameImagePath?>/help_05_05.jpg class=leftFloat>
 <font class=bullet>☞</font> 우측에 보이는 정보창(이하 예턴창)에서는 턴 순서, 게임시간, 실제시간, 명령이 보이게 됩니다. 방금 입력한대로 따르면 1턴이 197년 9월이고 실제 시간으로는 21시 30분에 실행된다는 뜻이네요^^<br>
<br>
 <font class=bullet>☞</font> 이처럼 자신의 턴시간에 자신이 예약해둔 명령이 실행되는 형태로 게임이 진행됩니다. 예약턴을 지정해놓고 잠을 자도 되고, 일을 해도 되고, IRC에 가서 전략을 토론하거나 잡담을 해도 되며, 심지어 멍때려도 됩니다!<br>
@@ -308,7 +307,7 @@ if ($category == 0) {
<br>
<font class=intro>◈ 고급 턴 입력 스킬을 공부해 봅시다.</font><br>
<br>
<img src=<?=$images; ?>/help_05_06.jpg class=leftFloat>
<img src=<?=ServConfig::$gameImagePath?>/help_05_06.jpg class=leftFloat>
 <font class=bullet>☞</font> 1턴에 견문을 입력해봅시다.<br>
<br>
 <font class=bullet>☞</font> 2턴에 요양을 입력해봅시다.<br>
@@ -319,7 +318,7 @@ if ($category == 0) {
<br>
 <font class=bullet>☞</font> 이번엔 전체턴에 견문을 입력해봅시다. 1~24턴까지 견문이 입력될겁니다.<br>
<br>
<img src=<?=$images; ?>/help_05_07.jpg class=leftFloat>
<img src=<?=ServConfig::$gameImagePath?>/help_05_07.jpg class=leftFloat>
 <font class=bullet>☞</font> 반복&amp;수정에서 5턴 미루기를 선택해 봅시다. 1~5턴이 휴식으로 된것을 볼 수 있습니다.<br>
<br>
 <font class=bullet>☞</font> 무슨 기능인지 눈치 채셨나요? 현재 입력된 1~24턴이 그대로 5칸이 6~24턴으로 밀리게 되고 공백칸은 휴식으로 채워지게 됩니다. 전체 턴 순서는 유지하면서도 끼워넣거나 할때 편리하게 이용할 수 있습니다. 당기기도 비슷한 기능이랍니다. 직접 해보세요!<br>
@@ -345,7 +344,7 @@ if ($category == 0) {
<td>
<font class=intro>◈ 올턴 견문을 입력해놓으셨나요? 그럼 이제 각종 정보를 구경해볼까요?</font><br>
<br>
<img src=<?=$images; ?>/help_06_01.jpg class=leftFloat>
<img src=<?=ServConfig::$gameImagePath?>/help_06_01.jpg class=leftFloat>
<font class=title>세력도</font><br>
 <font class=bullet>☞</font> 전체 지도와 장수동향, 정세동향을 볼 수 있습니다. 여기 나오는 정보들은 최신 소식이 가장 위에 나오는 형태이므로 아래에서 위로(↑방향) 읽는 것이 시간순서가 되겠지요^^<br>
<br>
@@ -395,7 +394,7 @@ if ($category == 0) {
 <font class=bullet>☞</font> 현재 서버내의 접속현황을 확인할 수 있습니다.<br>
<div class=clear></div>
<br>
<img src=<?=$images; ?>/help_06_03.jpg class=rightFloat>
<img src=<?=ServConfig::$gameImagePath?>/help_06_03.jpg class=rightFloat>
 <font class=bullet>☞</font> 1. 현재 토너먼트 진행상황을 알 수 있습니다.<br>
 <font class=bullet>☞</font> 2. 서버의 과부하 상황을 알 수 있습니다.<br>
 <font class=bullet>☞</font> 3. 서버의 시나리오 종류를 알 수 있습니다.<br>
@@ -416,7 +415,7 @@ if ($category == 0) {
 <font class=bullet>☞</font> 18. 1~24턴의 예약턴 표시<br>
<div class=clear></div>
<br>
<img src=<?=$images; ?>/help_06_04.jpg class=rightFloat>
<img src=<?=ServConfig::$gameImagePath?>/help_06_04.jpg class=rightFloat>
 <font class=bullet>☞</font> 소속 국가 정보 : 현재는 재야이므로 당연히 없겠죠? ^^ (일반장수 튜토리얼)<br>
 <font class=bullet>☞</font> 내 장수 정보 표시<br>
 <font class=bullet>☞</font> 캐릭터의 얼굴입니다.<br>
@@ -446,7 +445,7 @@ if ($category == 0) {
 <font class=bullet>☞</font> 벌점 : 갱신(클릭)량에 따라서 벌점이 쌓입니다. 너무 무리한 갱신은 서버에 무리를 줄 수 있으므로 벌점이 너무 높으면 안되겠죠. 일반적으로 플레이하는 유저라면 신경쓰지 않아도 됩니다.<br>
<div class=clear></div>
<br>
<img src=<?=$images; ?>/help_06_05.jpg class=rightFloat>
<img src=<?=ServConfig::$gameImagePath?>/help_06_05.jpg class=rightFloat>
 <font class=bullet>☞</font> 1. 국가정보창들 : 일반장수 튜토리얼 참고<br>
 <font class=bullet>☞</font> 2. 장수동향 : 전체 장수들의 눈에 띄는 동향들이 표시됩니다.<br>
 <font class=bullet>☞</font> 3. 개인기록 : 내 캐릭터의 명령 실행 결과들이 표시됩니다.<br>
@@ -460,27 +459,27 @@ if ($category == 0) {
<div class=clear></div>
<br>
<font class=intro>◈ 인터페이스 구경 잘 하셨나요? ^^ 그럼 이제 갱신 버튼을 눌러볼까요?</font><br>
<img src=<?=$images; ?>/help_06_06.jpg class=leftFloat>
<img src=<?=ServConfig::$gameImagePath?>/help_06_06.jpg class=leftFloat>
<br>
 <font class=bullet>☞</font> 음? 뭐가 바뀐거지? 잘 살펴보시면 명령목록이 구경하시는동안 시간만큼 수행되어서 당겨진 것을 볼 수 있을겁니다. 5분턴 서버 기준으로 20분정도 구경을 하셨다면 약 4턴이 실행되었겠군요^^<br>
<div class=clear></div>
<br>
<img src=<?=$images; ?>/help_06_07.jpg class=rightFloat>
<img src=<?=ServConfig::$gameImagePath?>/help_06_07.jpg class=rightFloat>
 <font class=bullet>☞</font> 개인기록을 보시면 4턴이 실행된동안의 결과가 기록되어있습니다. 하하핫! 동네 장사를 이겼군요!.<br>
<br>
 <font class=bullet>☞</font> 오오~ 레벨업 하는 모습도 보이는군요.<br>
<div class=clear></div>
<br>
<img src=<?=$images; ?>/help_06_08.jpg class=leftFloat>
<img src=<?=ServConfig::$gameImagePath?>/help_06_08.jpg class=leftFloat>
<div class=clear></div>
<br>
<img src=<?=$images; ?>/help_06_09.jpg class=rightFloat>
<img src=<?=ServConfig::$gameImagePath?>/help_06_09.jpg class=rightFloat>
 <font class=bullet>☞</font> 자, 재야에서도 볼 수 있는 중원 정보를 눌러봅시다.<br>
<br>
 <font class=bullet>☞</font> 각 국가별로 외교상황이나 장수 숫자를 살펴볼 수 있습니다. 한눈에 전체 정세를 파악할 때 유용하겠죠?<br>
<div class=clear></div>
<br>
<img src=<?=$images; ?>/help_06_10.jpg class=rightFloat>
<img src=<?=ServConfig::$gameImagePath?>/help_06_10.jpg class=rightFloat>
 <font class=bullet>☞</font> 현재도시를 눌러봅시다.<br>
<br>
 <font class=bullet>☞</font> 현재 자신이 소재하고 있는 도시의 정보를 볼 수 있습니다. 흠... 각종 수치들을 보니 아직 이 도시는 개발이 더딘 것 같군요. 뭐 우리나라가 아니므로 패스~<br>
@@ -490,7 +489,7 @@ if ($category == 0) {
 <font class=bullet>☞</font> 아악... 제 능력치가 빨간색인걸 보니 현재 부상을 입은 상태이군요. ㅠㅠ<br>
<div class=clear></div>
<br>
<img src=<?=$images; ?>/help_06_11.jpg class=rightFloat>
<img src=<?=ServConfig::$gameImagePath?>/help_06_11.jpg class=rightFloat>
 <font class=bullet>☞</font> 이번엔 내정보&amp;설정을 눌러봅시다.<br>
<br>
 <font class=bullet>☞</font> 오. 좀 더 자세한 정보가 보이는군요. 명성과 계급, 전투기록과 숙련도도 볼 수 있군요. 개인기록도 더 오래전 것까지 볼 수 있구요. 전투 결과나 자신의 열전(역사)도 볼 수 있답니다.<br>
@@ -516,17 +515,17 @@ if ($category == 0) {
<td>
<font class=intro>◈ 국가에 임관하여 일반장수가 되어서 국가를 강성하게 만들어 봅시다!</font><br>
<br>
<img src=<?=$images; ?>/help_07_01.jpg class=rightFloat>
<img src=<?=ServConfig::$gameImagePath?>/help_07_01.jpg class=rightFloat>
 <font class=bullet>☞</font> 1턴에 임관을 실행해봅시다.<br>
<br>
 <font class=bullet>☞</font> 화면이 전환되면서 각국의 홍보문구가 나타납니다. 홍보문구를 보고 마음에 드는 국가를 선택해서 임관 버튼을 눌러봅시다. 손권을 돕고 싶으니 吳을 선택!<br>
<br>
<img src=<?=$images; ?>/help_07_02.jpg class=leftFloat>
<img src=<?=ServConfig::$gameImagePath?>/help_07_02.jpg class=leftFloat>
 <font class=bullet>☞</font> 1턴에 【吳】(으)로 임관이라고 입력된게 보이죠? 지루하게 어떻게 기다리느냐구요? 나중에 중요 장수가 되거나 수뇌부, 군주가 되면 정신이 없을정도로 시간이 촉박할겁니다. ㅎㅎ 이리저리 구경하면서 임관이 되길 기다려봅시다.<br>
<br>
 <font class=bullet>☞</font> 1턴이 실행될즈음 중원정보나 현재도시를 들락날락 하거나 갱신 버튼을 눌러보면 임관명령 결과가 보이게 됩니다. 잘 임관 되었군요.<br>
<br>
<img src=<?=$images; ?>/help_07_03.jpg class=leftFloat>
<img src=<?=ServConfig::$gameImagePath?>/help_07_03.jpg class=leftFloat>
 <font class=bullet>☞</font> 이제 한 국가의 소속 장수이므로 신분도 일반이 되었고 국가를 강성하게 만들기 위해서 열심히 일을 해봅시다. 국가는 열심히 일한 장수들을 위해서 1월마다 자금을, 7월마다 군량을 지급하게 됩니다. 이 돈을 가지고 내정도 하고, 나중에 전쟁이 벌어지면 병사도 모으게 됩니다. 혹은 여유자금을 가지고 아이템을 구입하거나 베팅장에 투자를 할 수도 있습니다!(응?)<br>
<br>
 <font class=bullet>☞</font> 임관을 하게 되면 자동으로 수도(깃발에 별표시)로 이동하게 되는데요. 흠. 도시정보를 보니 농업, 수비가 부족하군요. 전체 선택후 명령목록에서 농업이나 수비를 선택합시다. 이 장수는 무력보다 지력이 높으므로 지력이 중요한 농지개간을 선택합니다. 실행을 누르면 올턴 농지개간이 입력!<br>
@@ -536,7 +535,7 @@ if ($category == 0) {
 <font class=bullet>☞</font> 국가방침에서 장수들에게 방침을 정해준다면 그대로 따르는것이 더 좋겠죠? 국가는 일사불란하게 장수들이 움직일 때 더욱 강성해지는 법!<br>
<div class=clear></div>
<br>
<img src=<?=$images; ?>/help_07_04.jpg class=rightFloat>
<img src=<?=ServConfig::$gameImagePath?>/help_07_04.jpg class=rightFloat>
 <font class=bullet>☞</font> 이제 국가 정보가 나타나는군요. 살펴볼까요?<br>
 <font class=bullet>☞</font> 국가명<br>
 <font class=bullet>☞</font> 성향 : 국가의 성향입니다. 성향마다 장점과 단점이 존재합니다.<br>
@@ -620,7 +619,7 @@ if ($category == 0) {
 <font class=bullet>☞</font> 특수병은 강력한 전투력 대신 자금과 군량 소모가 큰 특징이 있답니다.<br>
 <font class=bullet>☞</font> 이민족병은 준수한 전투력과 더불어 자금과 군량 소모가 적은 특징이 있답니다.<br>
 <font class=bullet>☞</font> 지역병은 일반병과 비슷한 능력에 기동력이나 회피율이 뛰어난 특징이 있답니다.<br>
<img src=<?=$images; ?>/help_08_01.jpg class=rightFloat>
<img src=<?=ServConfig::$gameImagePath?>/help_08_01.jpg class=rightFloat>
  ---------- 보병계열 ----------<br>
    보병 : 특별한 조건이 없이 만들 수 있어요.<br>
   청주병 : <font color=cyan>중원</font>지역에서 생산이 가능해요.<br>
+11 -12
View File
@@ -3,7 +3,6 @@ namespace sammo;
require(__dir__.'/../vendor/autoload.php');
WebUtil::setHeaderNoCache();//FIXME: 이 파일에는 이럴 이유가 없다. javascript 기반으로 바꿔도 충분
$images = IMAGES;
if($sel == 0) $sel = 1;
?>
@@ -18,9 +17,9 @@ if($sel == 0) $sel = 1;
body { color:white; background-color:black; border-width:1; border-color:gray; }
table { font-family:'맑은 고딕'; line-height:110%; }
font { font-family:'맑은 고딕'; line-height:110%; }
#bg0 { background-image:url(<?=$images?>/back_walnut.jpg); }
#bg1 { background-image:url(<?=$images?>/back_blue.jpg); }
#bg2 { background-image:url(<?=$images?>/back_green.jpg); }
#bg0 { background-image:url(<?=ServConfig::$gameImagePath?>/back_walnut.jpg); }
#bg1 { background-image:url(<?=ServConfig::$gameImagePath?>/back_blue.jpg); }
#bg2 { background-image:url(<?=ServConfig::$gameImagePath?>/back_green.jpg); }
.leftFloat {
float: left;
@@ -49,13 +48,13 @@ font { font-family:'맑은 고딕'; line-height:110%; }
</tr>
<tr>
<td align=center>
<img src=<?=$images?>/screenshot_01.jpg style=border-style:ridge;width:125px;height:75px; onclick=location.replace('screenshot.php?sel=1')>
<img src=<?=$images?>/screenshot_02.jpg style=border-style:ridge;width:125px;height:75px; onclick=location.replace('screenshot.php?sel=2')>
<img src=<?=$images?>/screenshot_03.jpg style=border-style:ridge;width:125px;height:75px; onclick=location.replace('screenshot.php?sel=3')>
<img src=<?=$images?>/screenshot_04.jpg style=border-style:ridge;width:125px;height:75px; onclick=location.replace('screenshot.php?sel=4')>
<img src=<?=$images?>/screenshot_05.jpg style=border-style:ridge;width:125px;height:75px; onclick=location.replace('screenshot.php?sel=5')>
<img src=<?=$images?>/screenshot_06.jpg style=border-style:ridge;width:125px;height:75px; onclick=location.replace('screenshot.php?sel=6')>
<img src=<?=$images?>/screenshot_07.jpg style=border-style:ridge;width:125px;height:75px; onclick=location.replace('screenshot.php?sel=7')>
<img src=<?=ServConfig::$gameImagePath?>/screenshot_01.jpg style=border-style:ridge;width:125px;height:75px; onclick=location.replace('screenshot.php?sel=1')>
<img src=<?=ServConfig::$gameImagePath?>/screenshot_02.jpg style=border-style:ridge;width:125px;height:75px; onclick=location.replace('screenshot.php?sel=2')>
<img src=<?=ServConfig::$gameImagePath?>/screenshot_03.jpg style=border-style:ridge;width:125px;height:75px; onclick=location.replace('screenshot.php?sel=3')>
<img src=<?=ServConfig::$gameImagePath?>/screenshot_04.jpg style=border-style:ridge;width:125px;height:75px; onclick=location.replace('screenshot.php?sel=4')>
<img src=<?=ServConfig::$gameImagePath?>/screenshot_05.jpg style=border-style:ridge;width:125px;height:75px; onclick=location.replace('screenshot.php?sel=5')>
<img src=<?=ServConfig::$gameImagePath?>/screenshot_06.jpg style=border-style:ridge;width:125px;height:75px; onclick=location.replace('screenshot.php?sel=6')>
<img src=<?=ServConfig::$gameImagePath?>/screenshot_07.jpg style=border-style:ridge;width:125px;height:75px; onclick=location.replace('screenshot.php?sel=7')>
</td>
</tr>
<tr>
@@ -77,7 +76,7 @@ case 7: echo "독 특 한 &nbsp; 커 뮤 니 티"; break;
</tr>
<tr>
<td align=center>
<img src=<?=$images?>/screenshot_0<?=$sel?>.jpg style=border-style:ridge;>
<img src=<?=ServConfig::$gameImagePath?>/screenshot_0<?=$sel?>.jpg style=border-style:ridge;>
</td>
</tr>
</table>
+6 -2
View File
@@ -54,7 +54,9 @@ $(document).ready( function () {
db_id:"required",
db_pw:"required",
db_name:"required",
serv_host:"required"
serv_host:"required",
shared_icon_path:"required",
game_image_path:"required"
},
errorElement: "div",
errorPlacement: function ( error, element ) {
@@ -90,7 +92,9 @@ $(document).ready( function () {
db_id:$('#db_id').val(),
db_pw:$('#db_pw').val(),
db_name:$('#db_name').val(),
serv_host:$('#serv_host').val()
serv_host:$('#serv_host').val(),
shared_icon_path:$('#shared_icon_path').val(),
game_image_path:$('#game_image_path').val()
}
}).then(function(result){
var deferred = $.Deferred();
+11
View File
@@ -5,6 +5,9 @@ class AppConf
{
private static $serverList = null;
/** @var string 전용 아이콘 경로 */
public static $userIconPath = 'd_pic';
/**
* 서버 설정 반환
*
@@ -55,4 +58,12 @@ class AppConf
}
return DB::db();
}
public static function getUserIconPathFS() : string{
return ROOT.'/'.static::$userIconPath;
}
public static function getUserIconPathWeb() : string{
return ServConfig::$serverWebPath.'/'.static::$userIconPath;
}
}