autoloader 구성.
class 정의
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
|
||||
function MYDB_connect($host, $id, $pw) {
|
||||
$conn = mysqli_connect($host, $id, $pw);
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
+3
-1
@@ -1,8 +1,10 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
use utilphp\util as util;
|
||||
|
||||
|
||||
//로그인 검사
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
$connect = dbConn();
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
$connect = dbConn();
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
$connect = dbConn();
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
$yearmonth = $_POST['yearmonth'];
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
$connect = dbConn();
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
$connect = dbConn();
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
$connect = dbConn();
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
// $title, $msg, $num
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
// $btn, $msg, $scoutmsg, $rate, $bill, $secretlimit
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
// $turn, $command, $cost, $name, $nationname, $note, $double, $third, $fourth
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
// $btn, $level, $genlist, $outlist
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
// $title, $msg, $num
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
// $msg
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
// $btn, $msg
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
// $btn, $name, $troop
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
//TODO: 등용장 재 디자인.
|
||||
//xxx: 일단 비활성화
|
||||
header('Location:msglist.php');
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
if(!defined('ROOT')){
|
||||
define('ROOT', '../..');
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
file_put_contents("logs/_db_bug.txt", $message."\n", FILE_APPEND);
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//////////////////////////장수성격//////////////////////////////////////////////
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//////////////////////////장수성격//////////////////////////////////////////////
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//////////////////////////장수성격//////////////////////////////////////////////
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
|
||||
+3
-1
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require_once(__dir__.'/d_setting/conf.php');
|
||||
require_once 'process_war.php';
|
||||
@@ -22,7 +24,7 @@ require_once('func_map.php');
|
||||
require_once('func_diplomacy.php');
|
||||
require_once('func_command.php');
|
||||
|
||||
use utilphp\util as util;
|
||||
|
||||
|
||||
/**
|
||||
* 0.0~1.0 사이의 랜덤 float
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
function GetStuffName($stuff) {
|
||||
$type1 = $stuff % 10;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
require_once(__dir__.'/d_setting/conf.php');
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
|
||||
use utilphp\util as util;
|
||||
|
||||
|
||||
function checkScoutAvailable($messageInfo, $general, $srcGeneral, $startyear, $year){
|
||||
$nationID = $messageInfo['src']['nationID'];
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
|
||||
use utilphp\util as util;
|
||||
|
||||
|
||||
function getHistory($count, $year, $month, $isFirst=0) {
|
||||
$fp = @fopen("logs/_history.txt", "r");
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
|
||||
function CheckLogin($type=0) {
|
||||
if(!isset($_SESSION['noMember'])) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
require_once(__dir__.'/d_setting/conf.php');
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
|
||||
use utilphp\util as util;
|
||||
|
||||
|
||||
class Message{
|
||||
//기본 정보
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
|
||||
include('func_regnpc.php');
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
|
||||
/**
|
||||
* 장수의 통솔을 받아옴
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
|
||||
function RegNPC($connect) {
|
||||
$query = "select startyear,year,turnterm,scenario,extend,fiction,img from game where no='1'";
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
|
||||
function getFont($str) {
|
||||
if(strlen($str) >= 22) { $str = "<font size=1>{$str}</font>"; }
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
|
||||
/**
|
||||
* 템플릿 생성과 관련된 함수들을 모아두는 파일
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
|
||||
function processTournament($connect) {
|
||||
$query = "select tournament,phase,tnmt_type,tnmt_auto,tnmt_time,now() as now,TIMESTAMPDIFF(SECOND,tnmt_time,now()) as offset from game where no=1";
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
|
||||
@@ -7,14 +7,14 @@ $generalID = getGeneralID();
|
||||
session_write_close();
|
||||
|
||||
if(!$userID){
|
||||
returnJson([
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'로그인되지 않았습니다.'
|
||||
]);
|
||||
}
|
||||
|
||||
if(!$generalID){
|
||||
returnJson([
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'장수를 생성하지 않았습니다.'
|
||||
]);
|
||||
@@ -26,7 +26,7 @@ $db = getDB();
|
||||
$image = $rootDB->queryFirstRow('SELECT picture, imgsvr FROM `MEMBER` WHERE no = %i', $userID);
|
||||
|
||||
if(!$image){
|
||||
returnJson([
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'회원 기록 정보가 없습니다'
|
||||
]);
|
||||
@@ -37,7 +37,7 @@ $db->update('general', [
|
||||
'imgsvr'=>$image['imgsvr']
|
||||
], 'owner = %i and npc = 0', $userID);
|
||||
|
||||
returnJson([
|
||||
Json::die([
|
||||
'result'=>true,
|
||||
'reason'=>'success'
|
||||
]);
|
||||
@@ -12,16 +12,16 @@ $generalID = getGeneralID();
|
||||
session_write_close();
|
||||
|
||||
if(!$generalID){
|
||||
returnJson($result);
|
||||
Json::die($result);
|
||||
}
|
||||
|
||||
$generalInfo = getDB()->queryFirstRow('SELECT `nation`, `level` from `general` where `id`=%i', $generalID);
|
||||
if(!$generalInfo){
|
||||
returnJson($result);
|
||||
Json::die($result);
|
||||
}
|
||||
|
||||
$result['generalID'] = $generalID;
|
||||
$result['myNationID'] = $generalInfo['nation'];
|
||||
$result['isChief'] = ($generalInfo['level'] == 12);
|
||||
|
||||
returnJson($result);
|
||||
Json::die($result);
|
||||
+2
-30
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require(__dir__.'/../d_setting/conf.php');
|
||||
use utilphp\util as util;
|
||||
|
||||
|
||||
/**
|
||||
* conf.php 파일 생성용 코드
|
||||
@@ -9,15 +9,6 @@ use utilphp\util as util;
|
||||
* 이 파일만 예외적으로 lib.php, func.php를 참조하지 않고 독자적으로 동작함.
|
||||
*/
|
||||
|
||||
function SetHeaderNoCache(){
|
||||
if(!headers_sent()) {
|
||||
header('Expires: Wed, 01 Jan 2014 00:00:00 GMT');
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', FALSE);
|
||||
header('Pragma: no-cache');
|
||||
}
|
||||
}
|
||||
|
||||
function parseJsonPost(){
|
||||
// http://thisinterestsme.com/receiving-json-post-data-via-php/
|
||||
// http://thisinterestsme.com/php-json-error-handling/
|
||||
@@ -76,27 +67,8 @@ function parseJsonPost(){
|
||||
return $decoded;
|
||||
}
|
||||
|
||||
function returnJson($value, $noCache = true, $pretty = false, $die = true){
|
||||
if($noCache){
|
||||
SetHeaderNoCache();
|
||||
}
|
||||
|
||||
header('Content-Type: application/json');
|
||||
|
||||
if($pretty){
|
||||
$flag = JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT;
|
||||
}
|
||||
else{
|
||||
$flag = JSON_UNESCAPED_UNICODE;
|
||||
}
|
||||
echo json_encode($value, $flag);
|
||||
if($die){
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
if(file_exist(__dir__.'/d_setting/conf.php')){
|
||||
returnJson([
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'이미 설정 파일이 존재합니다.'
|
||||
]);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
include('lib.php');
|
||||
include('func.php');
|
||||
|
||||
use utilphp\util as util;
|
||||
|
||||
|
||||
$generalID = getGeneralID();
|
||||
|
||||
@@ -20,13 +20,13 @@ $nationID = getDB()->queryFirstField(
|
||||
|
||||
|
||||
if($nationID === null){
|
||||
returnJson([
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'소속 국가가 없습니다'
|
||||
]);
|
||||
}
|
||||
|
||||
returnJson([
|
||||
Json::die([
|
||||
'result'=>true,
|
||||
'private'=>getMessage('private', $nationID, 10, $reqSequence),
|
||||
'public'=>getMessage('public', $nationID, 20, $reqSequence),
|
||||
|
||||
@@ -4,10 +4,10 @@ require(__DIR__.'/../f_func/func.php');
|
||||
require(__DIR__.'/../f_config/SESSION.php');
|
||||
require('func_install.php');
|
||||
|
||||
use utilphp\util as util;
|
||||
|
||||
|
||||
if($SESSION->getGrade() < 5){
|
||||
returnJson([
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'충분한 권한을 가지고 있지 않습니다.'
|
||||
]);
|
||||
@@ -16,7 +16,7 @@ if($SESSION->getGrade() < 5){
|
||||
$scenarioIdx = toInt(util::array_get($_GET['scenarioIdx']));
|
||||
|
||||
if($scenarioIdx === null){
|
||||
returnJson([
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'올바르지 않은 scenarioIdx'
|
||||
]);
|
||||
|
||||
+6
-4
@@ -1,8 +1,10 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include 'lib.php';
|
||||
include 'func.php';
|
||||
|
||||
use utilphp\util as util;
|
||||
|
||||
|
||||
getGeneralID();
|
||||
|
||||
@@ -21,7 +23,7 @@ $post = array_merge($defaultPost, parseJsonPost());
|
||||
|
||||
if($post['year']){
|
||||
if($post['month'] < 1 || $post['month'] > 12){
|
||||
returnJson([
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'잘못된 개월 값'
|
||||
]);
|
||||
@@ -38,8 +40,8 @@ else{
|
||||
$result = getWorldMap($post);
|
||||
if($post['year'] && $post['month'] && $result['result']){
|
||||
//연감 자료는 캐싱 가능
|
||||
returnJson($result, false);
|
||||
Json::die($result, false);
|
||||
}
|
||||
else{
|
||||
returnJson($result);
|
||||
Json::die($result);
|
||||
}
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
include('lib.php');
|
||||
include('func.php');
|
||||
|
||||
use utilphp\util as util;
|
||||
|
||||
|
||||
if(!getGeneralID()){
|
||||
returnJson([
|
||||
Json::die([
|
||||
"nation"=>[]
|
||||
]);
|
||||
}
|
||||
|
||||
//NOTE: 모든 국가, 모든 장수에 대해서 같은 결과라면 캐싱 가능하지 않을까?
|
||||
|
||||
returnJson([
|
||||
Json::die([
|
||||
"nation"=>getMailboxList()
|
||||
]);
|
||||
+12
-12
@@ -4,12 +4,12 @@ include 'func.php';
|
||||
|
||||
//{msgID: 1206, response: true}
|
||||
|
||||
use utilphp\util as util;
|
||||
|
||||
|
||||
$generalID = getGeneralID();
|
||||
|
||||
if (!$generalID) {
|
||||
returnJson([
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'로그인하지 않음'
|
||||
]);
|
||||
@@ -23,7 +23,7 @@ $msgID = toInt(util::array_get($jsonPost['msgID'], null), false);
|
||||
$msgResponse = util::array_get($jsonPost['response'], null);
|
||||
|
||||
if ($msgID === null || !is_bool($msgResponse)) {
|
||||
returnJson([
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'올바르지 않은 인자'
|
||||
]);
|
||||
@@ -32,7 +32,7 @@ if ($msgID === null || !is_bool($msgResponse)) {
|
||||
|
||||
$general = getDB()->queryFirstRow('select `no`, `name`, `nation`, `nations`, `level`, `npc`, `gold`, `rice`, `troop` from `general` where `no` = %i', $generalID);
|
||||
if(!$general){
|
||||
returnJson([
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'존재하지 않는 장수'
|
||||
]);
|
||||
@@ -41,7 +41,7 @@ if(!$general){
|
||||
$result = getSingleMessage($msgID, $general);
|
||||
|
||||
if (!$result[0]) {
|
||||
returnJson([
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>$result[1]
|
||||
]);
|
||||
@@ -54,7 +54,7 @@ $msgType = $messageInfo['type'];
|
||||
$validUntil = $messageInfo['valid_until'];
|
||||
$date = date('Y-m-d H:i:s');
|
||||
if ($validUntil < $date) {
|
||||
returnJson([
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'만료된 메시지'
|
||||
]);
|
||||
@@ -70,7 +70,7 @@ $msgDest = json_decode($messageInfo['dest']);
|
||||
$messageInfo['dest'] = $msgDest;
|
||||
|
||||
if (!$msgAction) {
|
||||
returnJson([
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'응답 대상 메시지 아님'
|
||||
]);
|
||||
@@ -78,7 +78,7 @@ if (!$msgAction) {
|
||||
|
||||
if ($msgType == 'diplomacy' && $msgSrc['nation_id'] != $msgDest['nation_id']) {
|
||||
//여기로 올일이 있나?
|
||||
returnJson([
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'(버그) 외교 대상 동일'
|
||||
]);
|
||||
@@ -86,14 +86,14 @@ if ($msgType == 'diplomacy' && $msgSrc['nation_id'] != $msgDest['nation_id']) {
|
||||
|
||||
if($msgType == 'diplomacy'){
|
||||
if($general['level'] < 6){
|
||||
returnJson([
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'외교 권한 없음'
|
||||
]);
|
||||
}
|
||||
|
||||
if($general['nation'] != $msgDest['nation_id']){
|
||||
returnJson([
|
||||
Json::die([
|
||||
'result'=>false,
|
||||
'reason'=>'올바르지 않은 소속 국가'
|
||||
]);
|
||||
@@ -110,7 +110,7 @@ case 'ally':
|
||||
break;
|
||||
//TODO:기타 등등
|
||||
case '':
|
||||
returnJson([]);
|
||||
Json::die([]);
|
||||
break;
|
||||
default:
|
||||
//구현이 정상적으로 된 경우 이쪽으로 오지 않음
|
||||
@@ -118,7 +118,7 @@ default:
|
||||
}
|
||||
|
||||
|
||||
returnJson([
|
||||
Json::die([
|
||||
'result' => $result[0],
|
||||
'reason' => $result[1]
|
||||
]);
|
||||
+13
-11
@@ -1,8 +1,10 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include 'lib.php';
|
||||
include 'func.php';
|
||||
|
||||
use utilphp\util as util;
|
||||
|
||||
|
||||
/**
|
||||
* 메시지 전송 코드.
|
||||
@@ -16,7 +18,7 @@ session_write_close();
|
||||
$post = parseJsonPost();
|
||||
|
||||
if(!isset($post['genlist']) || !isset($post['msg'])){
|
||||
returnJson([
|
||||
Json::die([
|
||||
'result' => false,
|
||||
'reason' => '올바르지 않은 호출입니다.',
|
||||
'newSeq' => false
|
||||
@@ -31,7 +33,7 @@ $date = $datetime->format('Y-m-d H:i:s');
|
||||
|
||||
//로그인 검사
|
||||
if(!isSigned()){
|
||||
returnJson([
|
||||
Json::die([
|
||||
'result' => false,
|
||||
'reason' => '로그인되지 않았습니다.',
|
||||
'newSeq' => false
|
||||
@@ -45,7 +47,7 @@ $connect = dbConn();
|
||||
increaseRefresh('서신전달', 1);
|
||||
|
||||
if(getBlockLevel() == 1 || getBlockLevel() == 3) {
|
||||
returnJson([
|
||||
Json::die([
|
||||
'result' => false,
|
||||
'reason' => '차단되었습니다.',
|
||||
'newSeq' => false
|
||||
@@ -58,7 +60,7 @@ $me = $db->queryFirstRow('select `no`,`name`,`nation`,`level`,`con`,`picture`,`i
|
||||
|
||||
if(!$me){
|
||||
resetSessionGeneralValues();
|
||||
returnJson([
|
||||
Json::die([
|
||||
'result' => false,
|
||||
'reason' => '로그인되지 않았습니다.',
|
||||
'newSeq' => false
|
||||
@@ -67,7 +69,7 @@ if(!$me){
|
||||
|
||||
$con = checkLimit($me['con'], $conlimit);
|
||||
if($con >= 2) {
|
||||
returnJson([
|
||||
Json::die([
|
||||
'result' => false,
|
||||
'reason' => '접속 제한입니다.',
|
||||
'newSeq' => false
|
||||
@@ -79,7 +81,7 @@ $msg = mb_substr($msg, 0, 99, 'UTF-8');
|
||||
$msg = trim($msg);
|
||||
|
||||
if($msg == ''){
|
||||
returnJson([
|
||||
Json::die([
|
||||
'result' => true,
|
||||
'reason' => 'SUCCESS',
|
||||
'newSeq' => false
|
||||
@@ -123,7 +125,7 @@ if($destMailbox == 9999) {
|
||||
$msg_interval = $datetime->getTimestamp() - $last_msg->getTimestamp();
|
||||
//NOTE: 여기서 유저 레벨을 구별할 코드가 필요할까?
|
||||
if($msg_interval < 2){
|
||||
returnJson([
|
||||
Json::die([
|
||||
'result' => false,
|
||||
'reason' => '개인메세지는 2초당 1건만 보낼 수 있습니다!',
|
||||
'newSeq' => false
|
||||
@@ -133,7 +135,7 @@ if($destMailbox == 9999) {
|
||||
$destUser = $db->queryFirstRow('select `no`,`name`,`nation` from `general` where `no` = %s',$destMailbox);
|
||||
|
||||
if($destUser == null || empty($destUser)){
|
||||
returnJson([
|
||||
Json::die([
|
||||
'result' => false,
|
||||
'reason' => '존재하지 않는 유저입니다.',
|
||||
'newSeq' => false
|
||||
@@ -151,14 +153,14 @@ if($destMailbox == 9999) {
|
||||
sendMessage('private', $src, $dest, $msg, $date);
|
||||
}
|
||||
else{
|
||||
returnJson([
|
||||
Json::die([
|
||||
'result' => false,
|
||||
'reason' => '알 수 없는 에러',
|
||||
'newSeq' => false
|
||||
]);
|
||||
}
|
||||
|
||||
returnJson([
|
||||
Json::die([
|
||||
'result' => true,
|
||||
'reason' => 'SUCCESS',
|
||||
'newSeq' => true
|
||||
|
||||
@@ -3,7 +3,7 @@ include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
if(!getUserID()){
|
||||
returnJson([
|
||||
Json::die([
|
||||
'game'=>'x',
|
||||
'me'=>'no'
|
||||
]);
|
||||
@@ -88,7 +88,7 @@ if($generalID){
|
||||
}
|
||||
|
||||
//TODO: 이를 표현하는 방법은 '이전 버전'의 serverListPost.php를 참고할 것.
|
||||
returnJson([
|
||||
Json::die([
|
||||
'game'=>$game,
|
||||
'me'=>$me?$me:null
|
||||
]);
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
use utilphp\util as util;
|
||||
|
||||
|
||||
if(!isSigned()){
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
require("new_lib.php");
|
||||
|
||||
+3
-1
@@ -1,8 +1,10 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
use utilphp\util as util;
|
||||
|
||||
|
||||
$name = $_POST['name'];
|
||||
$name = _String::NoSpecialCharacter($name);
|
||||
|
||||
+4
-2
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
|
||||
use utilphp\util as util;
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
체섭용 인클루드 파일
|
||||
@@ -141,7 +143,7 @@ function SetHeaderNoCache(){
|
||||
}
|
||||
}
|
||||
|
||||
function returnJson($value, $noCache = true, $pretty = false, $die = true){
|
||||
function Json::die($value, $noCache = true, $pretty = false, $die = true){
|
||||
if($noCache){
|
||||
SetHeaderNoCache();
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
//FIXME: 이 프로세스 전체가 필요없을 수 있다. session 디렉토리를 관리하지 않거나, 자동 로그인을 처리하는 방법을 생각할 것.
|
||||
|
||||
use utilphp\util as util;
|
||||
|
||||
|
||||
$db = getDB();
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
$year = $_GET['year'];
|
||||
$month = $_GET['month'];
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
//임시 땜빵 리팩터링.
|
||||
require_once "lib.php";
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
|
||||
if(getUserGrade(true) < 5){
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user