diff --git a/f_config/config.php b/f_config/config.php
index ebcf9521..bd6edd1e 100644
--- a/f_config/config.php
+++ b/f_config/config.php
@@ -1,55 +1,56 @@
isLoggedIn(true)){
- $owner .= '('.$session->getUserID().','.$session->userName.')';
+ if ($session->isLoggedIn(true)) {
+ $owner .= '(' . $session->getUserID() . ',' . $session->userName . ')';
}
$fdb->insert('err_log', [
- 'date'=>$date,
- 'err'=>$err,
- 'errstr'=>$errstr,
- 'errpath'=>$errpath,
- 'trace'=>Json::encode($trace),
- 'webuser'=>$owner
+ 'date' => $date,
+ 'err' => $err,
+ 'errstr' => $errstr,
+ 'errpath' => $errpath,
+ 'trace' => Json::encode($trace),
+ 'webuser' => $owner
]);
}
-function logErrorByCustomHandler(int $errno, string $errstr, string $errfile, int $errline, array $errcontext){
+function logErrorByCustomHandler(int $errno, string $errstr, string $errfile, int $errline, array $errcontext)
+{
if (!(error_reporting() & $errno)) {
// This error code is not included in error_reporting, so let it fall
// through to the standard PHP error handler
return false;
}
-
+
$e = new \Exception();
logError(
getFriendlyErrorType($errno),
$errstr,
- $errfile.':'.$errline,
+ $errfile . ':' . $errline,
getExceptionTraceAsString($e)
);
}
set_error_handler("\sammo\logErrorByCustomHandler");
-function logExceptionByCustomHandler(\Throwable $e){
-
+function logExceptionByCustomHandler(\Throwable $e)
+{
+
logError(
get_class($e),
$e->getMessage(),
- $e->getFile().':'.$e->getLine(),
+ $e->getFile() . ':' . $e->getLine(),
getExceptionTraceAsString($e)
);
-
+
echo $e->getTraceAsString();
throw $e;
}
-set_exception_handler('\\sammo\\logExceptionByCustomHandler');
\ No newline at end of file
+set_exception_handler('\\sammo\\logExceptionByCustomHandler');
diff --git a/f_install/j_create_admin.php b/f_install/j_create_admin.php
index 4e50fcc3..bfabd179 100644
--- a/f_install/j_create_admin.php
+++ b/f_install/j_create_admin.php
@@ -1,7 +1,8 @@
false,
- 'reason'=>'입력값이 설정되지 않았습니다.'
+ 'result' => false,
+ 'reason' => '입력값이 설정되지 않았습니다.'
]);
}
-if(strlen((string)$password)!=128){
+if (strlen((string) $password) != 128) {
Json::die([
- 'result'=>false,
- 'reason'=>'올바르지 않은 비밀번호 해시 포맷입니다.'
+ 'result' => false,
+ 'reason' => '올바르지 않은 비밀번호 해시 포맷입니다.'
]);
}
-if(!class_exists('\\sammo\\RootDB')){
+if (!class_exists('\\sammo\\RootDB')) {
Json::die([
- 'result'=>false,
- 'reason'=>'DB 설정이 완료되지 않았습니다.'
+ 'result' => false,
+ 'reason' => 'DB 설정이 완료되지 않았습니다.'
]);
}
@@ -37,10 +38,10 @@ $rootDB = RootDB::db();
$rootDB->query('LOCK TABLES member WRITE, member_log WRITE');
$memberCnt = $rootDB->queryFirstField('SELECT count(`NO`) from member');
-if($memberCnt > 0){
+if ($memberCnt > 0) {
Json::die([
- 'result'=>'false',
- 'reason'=>'이미 계정이 생성되어 있습니다'
+ 'result' => 'false',
+ 'reason' => '이미 계정이 생성되어 있습니다'
]);
}
@@ -48,32 +49,32 @@ $userSalt = bin2hex(random_bytes(8));
$finalPassword = Util::hashPassword($userSalt, $password);
$nowDate = TimeUtil::now();
-$rootDB->insert('member',[
+$rootDB->insert('member', [
'oauth_type' => 'NONE',
'id' => $username,
'email' => null,
- 'token_valid_until'=>'2999-01-01 00:00:00',
+ 'token_valid_until' => '2999-01-01 00:00:00',
'pw' => $finalPassword,
'salt' => $userSalt,
- 'grade'=> 6,
- 'name'=>$nickname,
- 'reg_date'=>$nowDate
+ 'grade' => 6,
+ 'name' => $nickname,
+ 'reg_date' => $nowDate
]);
$userID = $rootDB->insertId();
$rootDB->insert('member_log', [
- 'member_no'=>$userID,
- 'date'=>$nowDate,
- 'action_type'=>'reg',
- 'action'=>Json::encode([
- 'type'=>'none',
- 'aux'=>'admin',
- 'id'=>$username,
- 'name'=>$nickname
+ 'member_no' => $userID,
+ 'date' => $nowDate,
+ 'action_type' => 'reg',
+ 'action' => Json::encode([
+ 'type' => 'none',
+ 'aux' => 'admin',
+ 'id' => $username,
+ 'name' => $nickname
])
]);
Json::die([
- 'result'=>true,
- 'reason'=>'success'
-]);
\ No newline at end of file
+ 'result' => true,
+ 'reason' => 'success'
+]);
diff --git a/f_install/j_install_status.php b/f_install/j_install_status.php
index a8182f38..a03d7311 100644
--- a/f_install/j_install_status.php
+++ b/f_install/j_install_status.php
@@ -1,38 +1,39 @@
'config'
+ 'step' => 'config'
]);
}
$rootDB = RootDB::db();
$rootDB->throw_exception_on_nonsql_error = false;
-$rootDB->nonsql_error_handler = function($params){
+$rootDB->nonsql_error_handler = function ($params) {
Json::die([
- 'step'=>'conn_fail'
+ 'step' => 'conn_fail'
]);
};
-$rootDB->error_handler = function($params){
+$rootDB->error_handler = function ($params) {
Json::die([
- 'step'=>'sql_fail'
+ 'step' => 'sql_fail'
]);
};
$memberCnt = $rootDB->queryFirstField('SELECT count(`NO`) from member');
-if($memberCnt == 0){
+if ($memberCnt == 0) {
Json::die([
- 'step'=>'admin',
- 'globalSalt'=>RootDB::getGlobalSalt()
+ 'step' => 'admin',
+ 'globalSalt' => RootDB::getGlobalSalt()
]);
}
Json::die([
- 'step'=>'done'
-]);
\ No newline at end of file
+ 'step' => 'done'
+]);
diff --git a/f_install/j_setup_db.php b/f_install/j_setup_db.php
index 8185bb64..465da5f2 100644
--- a/f_install/j_setup_db.php
+++ b/f_install/j_setup_db.php
@@ -1,7 +1,8 @@
false,
- 'reason'=>'입력 값이 올바르지 않습니다'
+ 'result' => false,
+ 'reason' => '입력 값이 올바르지 않습니다'
]);
}
if (!filter_var($servHost, FILTER_VALIDATE_URL)) {
Json::die([
- 'result'=>false,
- 'reason'=>'접속 경로가 올바르지 않습니다.'
+ 'result' => false,
+ 'reason' => '접속 경로가 올바르지 않습니다.'
]);
}
-if (file_exists(ROOT.'/d_setting/RootDB.php') && is_dir(ROOT.'/d_setting/RootDB.php')) {
+if (file_exists(ROOT . '/d_setting/RootDB.php') && is_dir(ROOT . '/d_setting/RootDB.php')) {
Json::die([
- 'result'=>false,
- 'reason'=>'d_setting/RootDB.php 가 디렉토리입니다'
+ 'result' => false,
+ 'reason' => 'd_setting/RootDB.php 가 디렉토리입니다'
]);
}
if (class_exists('\\sammo\\RootDB')) {
Json::die([
- 'result'=>false,
- 'reason'=>'이미 RootDB.php 파일이 있습니다'
+ 'result' => false,
+ 'reason' => '이미 RootDB.php 파일이 있습니다'
]);
}
//파일 권한 검사
if (file_exists(AppConf::getUserIconPathFS()) && !is_dir(AppConf::getUserIconPathFS())) {
Json::die([
- 'result'=>false,
- 'reason'=>AppConf::$userIconPath.' 이 디렉토리가 아닙니다'
+ 'result' => false,
+ 'reason' => AppConf::$userIconPath . ' 이 디렉토리가 아닙니다'
]);
}
-if (file_exists(ROOT.'/d_log') && !is_dir(ROOT.'/d_log')) {
+if (file_exists(ROOT . '/d_log') && !is_dir(ROOT . '/d_log')) {
Json::die([
- 'result'=>false,
- 'reason'=>'d_log 가 디렉토리가 아닙니다'
+ 'result' => false,
+ 'reason' => 'd_log 가 디렉토리가 아닙니다'
]);
}
-if (file_exists(ROOT.'/d_shared') && !is_dir(ROOT.'/d_shared')) {
+if (file_exists(ROOT . '/d_shared') && !is_dir(ROOT . '/d_shared')) {
Json::die([
- 'result'=>false,
- 'reason'=>'d_shared 가 디렉토리가 아닙니다'
+ 'result' => false,
+ 'reason' => 'd_shared 가 디렉토리가 아닙니다'
]);
}
-if (file_exists(ROOT.'/d_setting') && !is_dir(ROOT.'/d_setting')) {
+if (file_exists(ROOT . '/d_setting') && !is_dir(ROOT . '/d_setting')) {
Json::die([
- 'result'=>false,
- 'reason'=>'d_shared 가 디렉토리가 아닙니다'
+ 'result' => false,
+ 'reason' => 'd_shared 가 디렉토리가 아닙니다'
]);
}
-if (!file_exists(ROOT.'/d_log')
- || !file_exists(ROOT.'/d_shared')
- || !file_exists(ROOT.'/d_setting')
+if (
+ !file_exists(ROOT . '/d_log')
+ || !file_exists(ROOT . '/d_shared')
+ || !file_exists(ROOT . '/d_setting')
|| !file_exists(AppConf::getUserIconPathFS())
) {
if (!is_writable(ROOT)) {
Json::die([
- 'result'=>false,
- 'reason'=>'하위 디렉토리 생성 권한이 없습니다'
+ 'result' => false,
+ 'reason' => '하위 디렉토리 생성 권한이 없습니다'
]);
}
@@ -91,56 +93,56 @@ if (!file_exists(ROOT.'/d_log')
mkdir(AppConf::getUserIconPathFS());
}
- if (!file_exists(ROOT.'/d_log')) {
- mkdir(ROOT.'/d_log');
+ if (!file_exists(ROOT . '/d_log')) {
+ mkdir(ROOT . '/d_log');
}
- if (!file_exists(ROOT.'/d_setting')) {
- mkdir(ROOT.'/d_setting');
+ if (!file_exists(ROOT . '/d_setting')) {
+ mkdir(ROOT . '/d_setting');
}
- if (!file_exists(ROOT.'/d_shared')) {
- mkdir(ROOT.'/d_shared');
+ if (!file_exists(ROOT . '/d_shared')) {
+ mkdir(ROOT . '/d_shared');
}
}
if (!is_writable(AppConf::getUserIconPathFS())) {
Json::die([
- 'result'=>false,
- 'reason'=>AppConf::$userIconPath.' 디렉토리의 쓰기 권한이 없습니다'
+ 'result' => false,
+ 'reason' => AppConf::$userIconPath . ' 디렉토리의 쓰기 권한이 없습니다'
]);
}
-if (!is_writable(ROOT.'/d_log')) {
+if (!is_writable(ROOT . '/d_log')) {
Json::die([
- 'result'=>false,
- 'reason'=>'d_log 디렉토리의 쓰기 권한이 없습니다'
+ 'result' => false,
+ 'reason' => 'd_log 디렉토리의 쓰기 권한이 없습니다'
]);
}
-if (!is_writable(ROOT.'/d_shared')) {
+if (!is_writable(ROOT . '/d_shared')) {
Json::die([
- 'result'=>false,
- 'reason'=>'d_shared 디렉토리의 쓰기 권한이 없습니다'
+ 'result' => false,
+ 'reason' => 'd_shared 디렉토리의 쓰기 권한이 없습니다'
]);
}
-if (!is_writable(ROOT.'/d_setting')) {
+if (!is_writable(ROOT . '/d_setting')) {
Json::die([
- 'result'=>false,
- 'reason'=>'d_setting 디렉토리의 쓰기 권한이 없습니다.'
+ 'result' => false,
+ 'reason' => 'd_setting 디렉토리의 쓰기 권한이 없습니다.'
]);
}
-if (!file_exists(ROOT.'/d_log/.htaccess')) {
- @file_put_contents(ROOT.'/d_log/.htaccess', 'Deny from all');
+if (!file_exists(ROOT . '/d_log/.htaccess')) {
+ @file_put_contents(ROOT . '/d_log/.htaccess', 'Deny from all');
}
-if (!file_exists(ROOT.'/d_setting/.htaccess')) {
- @file_put_contents(ROOT.'/d_setting/.htaccess', 'Deny from all');
+if (!file_exists(ROOT . '/d_setting/.htaccess')) {
+ @file_put_contents(ROOT . '/d_setting/.htaccess', 'Deny from all');
}
//DB 접근 권한 검사
@@ -151,21 +153,21 @@ $rootDB->connect_options[MYSQLI_OPT_INT_AND_FLOAT_NATIVE] = true;
$rootDB->throw_exception_on_nonsql_error = false;
$rootDB->nonsql_error_handler = function ($params) {
Json::die([
- 'result'=>false,
- 'reason'=>'DB 접속에 실패했습니다.'
+ 'result' => false,
+ 'reason' => 'DB 접속에 실패했습니다.'
]);
};
$rootDB->error_handler = function ($params) {
Json::die([
- 'result'=>false,
- 'reason'=>'SQL을 제대로 실행하지 못했습니다. DB상태를 확인해 주세요.'
+ 'result' => false,
+ 'reason' => 'SQL을 제대로 실행하지 못했습니다. DB상태를 확인해 주세요.'
]);
};
$mysqli_obj = $rootDB->get(); //로그인에 실패할 경우 자동으로 dbConnFail()이 실행됨.
-if ($mysqli_obj->multi_query(file_get_contents(__DIR__.'/sql/common_schema.sql'))) {
+if ($mysqli_obj->multi_query(file_get_contents(__DIR__ . '/sql/common_schema.sql'))) {
while (true) {
if (!$mysqli_obj->more_results()) {
break;
@@ -191,113 +193,113 @@ $globalSalt = bin2hex(random_bytes(16));
$sharedIconPath = WebUtil::resolveRelativePath($sharedIconPath, $servHost);
$gameImagePath = WebUtil::resolveRelativePath($gameImagePath, $servHost);
-$imageRequestPath = WebUtil::resolveRelativePath($gameImagePath.'/../hook/git_pull.php', $servHost);
-$imageKeyInstallPath = WebUtil::resolveRelativePath($gameImagePath.'/../hook/InstallKey.php', $servHost);
+$imageRequestPath = WebUtil::resolveRelativePath($gameImagePath . '/../hook/git_pull.php', $servHost);
+$imageKeyInstallPath = WebUtil::resolveRelativePath($gameImagePath . '/../hook/InstallKey.php', $servHost);
$result = Util::generateFileUsingSimpleTemplate(
- __DIR__.'/templates/ServConfig.orig.php',
- ROOT.'/d_setting/ServConfig.php',
+ __DIR__ . '/templates/ServConfig.orig.php',
+ ROOT . '/d_setting/ServConfig.php',
[
- 'serverBasePath'=>$servHost,
- 'sharedIconPath'=>$sharedIconPath,
- 'gameImagePath'=>$gameImagePath,
- 'imageRequestPath'=>$imageRequestPath,
- 'imageRequestKey'=>$imageRequestKey
+ 'serverBasePath' => $servHost,
+ 'sharedIconPath' => $sharedIconPath,
+ 'gameImagePath' => $gameImagePath,
+ 'imageRequestPath' => $imageRequestPath,
+ 'imageRequestKey' => $imageRequestKey
],
true
);
-if($imageRequestKey){
- @file_get_contents($imageKeyInstallPath.'?key='.$imageRequestKey);
+if ($imageRequestKey) {
+ @file_get_contents($imageKeyInstallPath . '?key=' . $imageRequestKey);
}
if ($result !== true) {
Json::die([
- 'result'=>false,
- 'reason'=>$result
+ 'result' => false,
+ 'reason' => $result
]);
}
$result = Util::generateFileUsingSimpleTemplate(
- __DIR__.'/templates/common_path.orig.js',
- ROOT.'/d_shared/common_path.js',
+ __DIR__ . '/templates/common_path.orig.js',
+ ROOT . '/d_shared/common_path.js',
[
- 'serverBasePath'=>$servHost,
- 'sharedIconPath'=>$sharedIconPath,
- 'gameImagePath'=>$gameImagePath
+ 'serverBasePath' => $servHost,
+ 'sharedIconPath' => $sharedIconPath,
+ 'gameImagePath' => $gameImagePath
],
true
);
$result = Util::generateFileUsingSimpleTemplate(
- __DIR__.'/templates/menu.orig.json',
- ROOT.'/d_shared/menu.json',
+ __DIR__ . '/templates/menu.orig.json',
+ ROOT . '/d_shared/menu.json',
[],
true
);
if ($result !== true) {
Json::die([
- 'result'=>false,
- 'reason'=>$result
+ 'result' => false,
+ 'reason' => $result
]);
}
$result = Util::generateFileUsingSimpleTemplate(
- __DIR__.'/templates/common.orig.css',
- ROOT.'/d_shared/common.css',
+ __DIR__ . '/templates/common.orig.css',
+ ROOT . '/d_shared/common.css',
[
- 'serverBasePath'=>$servHost,
- 'sharedIconPath'=>$sharedIconPath,
- 'gameImagePath'=>$gameImagePath
+ 'serverBasePath' => $servHost,
+ 'sharedIconPath' => $sharedIconPath,
+ 'gameImagePath' => $gameImagePath
],
true
);
if ($result !== true) {
Json::die([
- 'result'=>false,
- 'reason'=>$result
+ 'result' => false,
+ 'reason' => $result
]);
}
$result = Util::generateFileUsingSimpleTemplate(
- __DIR__.'/templates/RootDB.orig.php',
- ROOT.'/d_setting/RootDB.php',
+ __DIR__ . '/templates/RootDB.orig.php',
+ ROOT . '/d_setting/RootDB.php',
[
- 'host'=>$host,
- 'user'=>$username,
- 'password'=>$password,
- 'dbName'=>$dbName,
- 'port'=>$port,
- 'globalSalt'=>$globalSalt,
+ 'host' => $host,
+ 'user' => $username,
+ 'password' => $password,
+ 'dbName' => $dbName,
+ 'port' => $port,
+ 'globalSalt' => $globalSalt,
]
);
-$kakaoRedirectURI = WebUtil::resolveRelativePath('oauth_kakao/oauth.php', $servHost.'/');
+$kakaoRedirectURI = WebUtil::resolveRelativePath('oauth_kakao/oauth.php', $servHost . '/');
Util::generateFileUsingSimpleTemplate(
- __DIR__.'/templates/KakaoKey.orig.php',
- ROOT.'/d_setting/KakaoKey.php',
+ __DIR__ . '/templates/KakaoKey.orig.php',
+ ROOT . '/d_setting/KakaoKey.php',
[
- 'REST_API_KEY'=>$kakaoRESTKey,
- 'ADMIN_KEY'=>$kakaoAdminKey,
- 'REDIRECT_URI'=>$kakaoRedirectURI
+ 'REST_API_KEY' => $kakaoRESTKey,
+ 'ADMIN_KEY' => $kakaoAdminKey,
+ 'REDIRECT_URI' => $kakaoRedirectURI
],
true
);
if ($result !== true) {
Json::die([
- 'result'=>false,
- 'reason'=>$result
+ 'result' => false,
+ 'reason' => $result
]);
}
Json::die([
- 'result'=>true,
- 'reason'=>'success',
- 'globalSalt'=>$globalSalt
+ 'result' => true,
+ 'reason' => 'success',
+ 'globalSalt' => $globalSalt
]);
diff --git a/f_install/j_update_js_css_path.php b/f_install/j_update_js_css_path.php
index 5b5f215a..56802714 100644
--- a/f_install/j_update_js_css_path.php
+++ b/f_install/j_update_js_css_path.php
@@ -1,13 +1,14 @@
setReadOnly();
-if($session->userGrade < 6){
+if ($session->userGrade < 6) {
Json::die([
- 'result'=>false,
- 'reason'=>'관리자 아님'
+ 'result' => false,
+ 'reason' => '관리자 아님'
]);
}
@@ -15,11 +16,11 @@ $servHost = Util::getReq('serv_host');
$sharedIconPath = Util::getReq('shared_icon_path');
$gameImagePath = Util::getReq('game_image_path');
-if($servHost){
- if(!$sharedIconPath || $gameImagePath){
+if ($servHost) {
+ if (!$sharedIconPath || $gameImagePath) {
Json::die([
- 'result'=>false,
- 'reason'=>'serv_host가 지정된 경우, sharedIconPath와 gameImagePath가 모두 지정되어야합니다.'
+ 'result' => false,
+ 'reason' => 'serv_host가 지정된 경우, sharedIconPath와 gameImagePath가 모두 지정되어야합니다.'
]);
}
@@ -27,58 +28,54 @@ if($servHost){
$gameImagePath = WebUtil::resolveRelativePath($gameImagePath, $servHost);
$result = Util::generateFileUsingSimpleTemplate(
- __DIR__.'/templates/ServConfig.orig.php',
- ROOT.'/d_setting/ServConfig.php',
+ __DIR__ . '/templates/ServConfig.orig.php',
+ ROOT . '/d_setting/ServConfig.php',
[
- 'serverBasePath'=>$servHost,
- 'sharedIconPath'=>$sharedIconPath,
- 'gameImagePath'=>$gameImagePath
+ 'serverBasePath' => $servHost,
+ 'sharedIconPath' => $sharedIconPath,
+ 'gameImagePath' => $gameImagePath
],
true
);
if ($result !== true) {
Json::die([
- 'result'=>false,
- 'reason'=>$result
+ 'result' => false,
+ 'reason' => $result
]);
}
-}
-else if($sharedIconPath || $gameImagePath){
+} else if ($sharedIconPath || $gameImagePath) {
$servHost = ServConfig::$serverWebPath;
- if($sharedIconPath){
+ if ($sharedIconPath) {
$sharedIconPath = WebUtil::resolveRelativePath($sharedIconPath, $servHost);
- }
- else{
+ } else {
$sharedIconPath = ServConfig::$sharedIconPath;
}
- if($gameImagePath){
+ if ($gameImagePath) {
$gameImagePath = WebUtil::resolveRelativePath($gameImagePath, $servHost);
- }
- else{
+ } else {
$gameImagePath = ServConfig::$gameImagePath;
}
$result = Util::generateFileUsingSimpleTemplate(
- __DIR__.'/templates/ServConfig.orig.php',
- ROOT.'/d_setting/ServConfig.php',
+ __DIR__ . '/templates/ServConfig.orig.php',
+ ROOT . '/d_setting/ServConfig.php',
[
- 'serverBasePath'=>$servHost,
- 'sharedIconPath'=>$sharedIconPath,
- 'gameImagePath'=>$gameImagePath
+ 'serverBasePath' => $servHost,
+ 'sharedIconPath' => $sharedIconPath,
+ 'gameImagePath' => $gameImagePath
],
true
);
if ($result !== true) {
Json::die([
- 'result'=>false,
- 'reason'=>$result
+ 'result' => false,
+ 'reason' => $result
]);
}
-}
-else{
+} else {
$servHost = ServConfig::$serverWebPath;
$sharedIconPath = ServConfig::$sharedIconPath;
$gameImagePath = ServConfig::$gameImagePath;
@@ -87,31 +84,31 @@ else{
$result = Util::generateFileUsingSimpleTemplate(
- __DIR__.'/templates/common_path.orig.js',
- ROOT.'/d_shared/common_path.js',
+ __DIR__ . '/templates/common_path.orig.js',
+ ROOT . '/d_shared/common_path.js',
[
- 'serverBasePath'=>$servHost,
- 'sharedIconPath'=>$sharedIconPath,
- 'gameImagePath'=>$gameImagePath
+ 'serverBasePath' => $servHost,
+ 'sharedIconPath' => $sharedIconPath,
+ 'gameImagePath' => $gameImagePath
],
true
);
$result = Util::generateFileUsingSimpleTemplate(
- __DIR__.'/templates/common.orig.css',
- ROOT.'/d_shared/common.css',
+ __DIR__ . '/templates/common.orig.css',
+ ROOT . '/d_shared/common.css',
[
- 'serverBasePath'=>$servHost,
- 'sharedIconPath'=>$sharedIconPath,
- 'gameImagePath'=>$gameImagePath
+ 'serverBasePath' => $servHost,
+ 'sharedIconPath' => $sharedIconPath,
+ 'gameImagePath' => $gameImagePath
],
true
);
if ($result !== true) {
Json::die([
- 'result'=>false,
- 'reason'=>$result
+ 'result' => false,
+ 'reason' => $result
]);
}
diff --git a/f_install/templates/RootDB.orig.php b/f_install/templates/RootDB.orig.php
index f41fbd15..1d6f74ce 100644
--- a/f_install/templates/RootDB.orig.php
+++ b/f_install/templates/RootDB.orig.php
@@ -1,4 +1,5 @@
connect_options[MYSQLI_OPT_INT_AND_FLOAT_NATIVE] = true;
- self::$uDB->error_handler= function(){};
+ self::$uDB->error_handler = function () {
+ };
self::$uDB->throw_exception_on_error = true;
self::$uDB->throw_exception_on_nonsql_error = true;
}
diff --git a/f_install/templates/ServConfig.orig.php b/f_install/templates/ServConfig.orig.php
index ef6c7aa3..304f9bbb 100644
--- a/f_install/templates/ServConfig.orig.php
+++ b/f_install/templates/ServConfig.orig.php
@@ -1,4 +1,5 @@
setReadOnly();
if($session->userGrade < 4) {
-?>
-
-
-
-관리메뉴
-
-
-
-=WebUtil::printCSS('../d_shared/common.css')?>
-=WebUtil::printCSS('css/common.css')?>
-
-
-관리자가 아닙니다.
- =banner()?>
-
-
-setReadOnly();
-if($session->userGrade < 4){
+if ($session->userGrade < 4) {
header('location:_119.php');
die();
}
@@ -16,7 +17,7 @@ $v->rule('integer', [
'minute',
'minutes2'
]);
-if(!$v->validate()){
+if (!$v->validate()) {
Error($v->errorStr());
}
@@ -26,92 +27,92 @@ $minute2 = Util::getReq('minute2', 'int');
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env');
-switch($btn) {
-case "분당김":
- $locked = false;
- for($i = 0; $i < 10; $i++){
- if(tryLock()){
- $locked = true;
- break;
+switch ($btn) {
+ case "분당김":
+ $locked = false;
+ for ($i = 0; $i < 10; $i++) {
+ if (tryLock()) {
+ $locked = true;
+ break;
+ }
+ usleep(500000);
}
- usleep(500000);
- }
-
- $gameStor->cacheValues(['turntime', 'starttime', 'tnmt_time']);
- $turntime = (new \DateTimeImmutable($gameStor->turntime))->sub(new \DateInterval("PT{$minute}M"));
- $starttime = (new \DateTimeImmutable($gameStor->starttime))->sub(new \DateInterval("PT{$minute}M"));
- $tnmt_time = (new \DateTimeImmutable($gameStor->tnmt_time))->sub(new \DateInterval("PT{$minute}M"));
- $gameStor->turntime = $turntime->format('Y-m-d H:i:s.u');
- $gameStor->starttime = $starttime->format('Y-m-d H:i:s');
- $gameStor->tnmt_time = $tnmt_time->format('Y-m-d H:i:s');
+ $gameStor->cacheValues(['turntime', 'starttime', 'tnmt_time']);
+ $turntime = (new \DateTimeImmutable($gameStor->turntime))->sub(new \DateInterval("PT{$minute}M"));
+ $starttime = (new \DateTimeImmutable($gameStor->starttime))->sub(new \DateInterval("PT{$minute}M"));
+ $tnmt_time = (new \DateTimeImmutable($gameStor->tnmt_time))->sub(new \DateInterval("PT{$minute}M"));
- $db->update('general', [
- 'turntime'=>$db->sqleval('DATE_SUB(turntime, INTERVAL %i MINUTE)', $minute)
- ], true);
- $db->update('auction', [
- 'expire'=>$db->sqleval('DATE_SUB(expire, INTERVAL %i MINUTE)', $minute)
- ], true);
- if($locked){
+ $gameStor->turntime = $turntime->format('Y-m-d H:i:s.u');
+ $gameStor->starttime = $starttime->format('Y-m-d H:i:s');
+ $gameStor->tnmt_time = $tnmt_time->format('Y-m-d H:i:s');
+
+ $db->update('general', [
+ 'turntime' => $db->sqleval('DATE_SUB(turntime, INTERVAL %i MINUTE)', $minute)
+ ], true);
+ $db->update('auction', [
+ 'expire' => $db->sqleval('DATE_SUB(expire, INTERVAL %i MINUTE)', $minute)
+ ], true);
+ if ($locked) {
+ unlock();
+ }
+ break;
+ case "분지연":
+ $locked = false;
+ for ($i = 0; $i < 5; $i++) {
+ if (tryLock()) {
+ $locked = true;
+ break;
+ }
+ usleep(500000);
+ }
+ $gameStor->cacheValues(['turntime', 'starttime', 'tnmt_time']);
+ $turntime = (new \DateTimeImmutable($gameStor->turntime))->add(new \DateInterval("PT{$minute}M"));
+ $starttime = (new \DateTimeImmutable($gameStor->starttime))->add(new \DateInterval("PT{$minute}M"));
+ $tnmt_time = (new \DateTimeImmutable($gameStor->tnmt_time))->add(new \DateInterval("PT{$minute}M"));
+
+ $gameStor->turntime = $turntime->format('Y-m-d H:i:s.u');
+ $gameStor->starttime = $starttime->format('Y-m-d H:i:s');
+ $gameStor->tnmt_time = $tnmt_time->format('Y-m-d H:i:s');
+
+ $db->update('general', [
+ 'turntime' => $db->sqleval('DATE_ADD(turntime, INTERVAL %i MINUTE)', $minute)
+ ], true);
+ $db->update('auction', [
+ 'expire' => $db->sqleval('DATE_ADD(expire, INTERVAL %i MINUTE)', $minute)
+ ], true);
+ if ($locked) {
+ unlock();
+ }
+ break;
+ case "토너분당김":
+ $tnmt_time = new \DateTime($gameStor->tnmt_time);
+ $tnmt_time->sub(new \DateInterval("PT{$minute2}M"));
+ $gameStor->tnmt_time = $tnmt_time->format('Y-m-d H:i:s');
+ break;
+ case "토너분지연":
+ $tnmt_time = new \DateTimeImmutable($gameStor->tnmt_time);
+ $tnmt_time->add(new \DateInterval("PT{$minute2}M"));
+ $gameStor->tnmt_time = $tnmt_time->format('Y-m-d H:i:s');
+ break;
+ case "금지급":
+ processGoldIncome();
+ break;
+ case "쌀지급":
+ processRiceIncome();
+ break;
+ case "락걸기":
+ for ($i = 0; $i < 10; $i++) {
+ if (tryLock()) {
+ $locked = true;
+ break;
+ }
+ usleep(500000);
+ }
+ break;
+ case "락풀기":
unlock();
- }
- break;
-case "분지연":
- $locked = false;
- for($i = 0; $i < 5; $i++){
- if(tryLock()){
- $locked = true;
- break;
- }
- usleep(500000);
- }
- $gameStor->cacheValues(['turntime', 'starttime', 'tnmt_time']);
- $turntime = (new \DateTimeImmutable($gameStor->turntime))->add(new \DateInterval("PT{$minute}M"));
- $starttime = (new \DateTimeImmutable($gameStor->starttime))->add(new \DateInterval("PT{$minute}M"));
- $tnmt_time = (new \DateTimeImmutable($gameStor->tnmt_time))->add(new \DateInterval("PT{$minute}M"));
-
- $gameStor->turntime = $turntime->format('Y-m-d H:i:s.u');
- $gameStor->starttime = $starttime->format('Y-m-d H:i:s');
- $gameStor->tnmt_time = $tnmt_time->format('Y-m-d H:i:s');
-
- $db->update('general', [
- 'turntime'=>$db->sqleval('DATE_ADD(turntime, INTERVAL %i MINUTE)', $minute)
- ], true);
- $db->update('auction', [
- 'expire'=>$db->sqleval('DATE_ADD(expire, INTERVAL %i MINUTE)', $minute)
- ], true);
- if($locked){
- unlock();
- }
- break;
-case "토너분당김":
- $tnmt_time = new \DateTime($gameStor->tnmt_time);
- $tnmt_time->sub(new \DateInterval("PT{$minute2}M"));
- $gameStor->tnmt_time = $tnmt_time->format('Y-m-d H:i:s');
- break;
-case "토너분지연":
- $tnmt_time = new \DateTimeImmutable($gameStor->tnmt_time);
- $tnmt_time->add(new \DateInterval("PT{$minute2}M"));
- $gameStor->tnmt_time = $tnmt_time->format('Y-m-d H:i:s');
- break;
-case "금지급":
- processGoldIncome();
- break;
-case "쌀지급":
- processRiceIncome();
- break;
-case "락걸기":
- for($i = 0; $i < 10; $i++){
- if(tryLock()){
- $locked = true;
- break;
- }
- usleep(500000);
- }
- break;
-case "락풀기":
- unlock();
- break;
+ break;
}
-header('Location:_119.php', true, 303);
\ No newline at end of file
+header('Location:_119.php', true, 303);
diff --git a/hwe/_admin1.php b/hwe/_admin1.php
index 44df5342..ddaae6f6 100644
--- a/hwe/_admin1.php
+++ b/hwe/_admin1.php
@@ -7,24 +7,7 @@ include "func.php";
$session = Session::requireGameLogin()->setReadOnly();
if($session->userGrade < 5) {
-?>
-
-
-
-관리메뉴
-
-
-
-=WebUtil::printCSS('../d_shared/common.css')?>
-=WebUtil::printCSS('css/common.css')?>
-
-
-관리자가 아닙니다.
- =banner()?>
-
-
-setReadOnly();
-if($session->userGrade < 5) {
-?>
-
-
-
-관리메뉴
-
-
-
-=WebUtil::printCSS('../d_shared/common.css')?>
-=WebUtil::printCSS('css/common.css')?>
-
-
-관리자가 아닙니다.
- =banner()?>
-
-
-userGrade < 5) {
+ die(requireAdminPermissionHTML());
}
$db = DB::db();
@@ -32,115 +16,132 @@ $db = DB::db();
?>
+
-회원관리
-
-
-
-=WebUtil::printCSS('../d_shared/common.css')?>
-=WebUtil::printCSS('css/common.css')?>
+ 회원관리
+
+
+
+ = WebUtil::printCSS('../d_shared/common.css') ?>
+ = WebUtil::printCSS('css/common.css') ?>
+
-
- 회 원 관 리 =backButton()?> |
-
-
-
- | =backButton()?> |
- | =banner()?> |
-
+ }
+ ?>
+
+
+
+
+
+
+
+
+ | 블럭 |
+
+
+ 1단계:발언권, 2단계:턴블럭
+ |
+
+
+ | 강제 사망 |
+ |
+
+
+ | 이벤트 |
+ |
+
+
+ | 이벤트2 |
+ |
+
+
+ | 접속제한 |
+ |
+
+
+ | 턴 시각 설정 |
+ |
+
+
+ | 명령 설정 |
+ |
+
+
+ | 메세지 전달 |
+ |
+
+
+
+
+
+ | = backButton() ?> |
+
+
+ | = banner() ?> |
+
+
-
+
+