루트DB를 관리하는 방식을 통째로 변경

- DB 불러오는 방식을 기존의 set.php에서 conf.php의 getRootDB()를 이용하도록 변경
- ADODB 에 기반한 _DB 클래스 폐기
- DBS.php 폐기
- _Setting 클래스 용도 변경
- 서버 목록 정의 방식을 하나로 모음
- 로그인시 세션에 사용자 등급을 추가
- "참여"(donation) 관련 코드 전면 제거
- 서버 리셋시 부운영자 비밀번호 문제 수정
- 서버 오픈,닫힘 여부를 새 서버 목록 정의 방식에 따르도록 수정
- DBS.php가 폐기 되었으므로 서버 오픈시 기본 정보를 json으로 받아오도록 하기 위하여 기본 준비
-  기존에 남아있던 세부 서버 로그인 처리 파일을 제거(enterPost.php)
- DBS.php 삭제로 전콘 변경시에도 각 서버로 json 호출을 하도록 하는 방식으로 준비
- 전콘을 수동으로 서버에 올린뒤 처리할 수 있도록 하던 legacy 코드 제거
- general 테이블에서 userlevel 컬럼을 삭제하고, 세션에 기록된 userGrade를 이용하도록 변경
- 벌점 제한을 모든 유저 공통으로 하도록 수정
- 세부 서버 리셋을 json ajax로 처리하도록 준비
This commit is contained in:
2018-03-07 00:59:31 +09:00
parent e8a9f73611
commit 0c9be5c53f
115 changed files with 1169 additions and 2217 deletions
+1 -5
View File
@@ -4,11 +4,7 @@ include "func.php";
$connect=dbConn();
$query = "select userlevel from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me['userlevel'] < 5) {
if(getUserGrade() < 5) {
echo "
<html>
<head>
+1 -5
View File
@@ -4,11 +4,7 @@ include "func.php";
$connect=dbConn();
$query = "select userlevel from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me['userlevel'] < 5) {
if(getUserGrade() < 5){
//echo "<script>location.replace('_119.php');</script>";
echo '_119.php';//TODO:debug all and replace
}
+1 -5
View File
@@ -5,11 +5,7 @@ include "func.php";
CheckLogin();
$connect = dbConn();
$query = "select userlevel from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me['userlevel'] < 5) {
if(getUserGrade() < 5) {
echo "
<html>
<head>
+1 -5
View File
@@ -7,11 +7,7 @@ $connect = dbConn();
$admin = getAdmin($connect);
$query = "select userlevel from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me['userlevel'] < 5) {
if(getUserGrade() < 5) {
//echo "<script>location.replace('_admin1.php');</script>";
echo '_admin1.php';//TODO:debug all and replace
}
+3 -12
View File
@@ -5,11 +5,7 @@ include "func.php";
CheckLogin();
$connect = dbConn();
$query = "select userlevel from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me['userlevel'] < 5) {
if(getUserGrade() < 5) {
echo "
<html>
<head>
@@ -58,14 +54,14 @@ $admin = MYDB_fetch_array($result);
</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>
<tr>
<td width=80 align=center rowspan=12>회원선택<br><br><font color=cyan>NPC</font><br><font color=skyblue>NPC유저</font><br><font color=blue>특별회원</font><br><font color=red>접속제한</font><br><b style=background-color:red;>블럭회원</b></td>
<td width=80 align=center rowspan=12>회원선택<br><br><font color=cyan>NPC</font><br><font color=skyblue>NPC유저</font><br><font color=red>접속제한</font><br><b style=background-color:red;>블럭회원</b></td>
<td width=105 rowspan=12>
<?php
echo "
<select name=genlist[] size=20 multiple style=color:white;background-color:black;font-size:13>";
$query = "select no,name,npc,userlevel,block from general order by npc,binary(name)";
$query = "select no,name,npc,block from general order by npc,binary(name)";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result);
@@ -76,7 +72,6 @@ for($i=0; $i < $gencount; $i++) {
if($general['npc'] >= 2) { $style .= "color:cyan;"; }
elseif($general['npc'] == 1) { $style .= "color:skyblue;"; }
if($general['con'] > $admin['conlimit']) { $style .= "color:red;"; }
if($general['userlevel'] > 2) { $style .= "color:blue;"; }
echo "
<option value={$general['no']} $style>{$general['name']}</option>";
@@ -119,10 +114,6 @@ for($i=0; $i < 27; $i++) {
<td align=center>이벤트2</td>
<td><input type=submit name=btn value='보숙10000'><input type=submit name=btn value='궁숙10000'><input type=submit name=btn value='기숙10000'><input type=submit name=btn value='귀숙10000'><input type=submit name=btn value='차숙10000'></td>
</tr>
<tr>
<td align=center>특별회원</td>
<td><input type=submit name=btn value='특별회원 임명'><input type=submit name=btn value='특별회원 해제'></td>
</tr>
<tr>
<td align=center>접속제한</td>
<td><input type=submit name=btn value='접속 허용'><input type=submit name=btn value='접속 제한'></td>
+1 -17
View File
@@ -5,11 +5,7 @@ include "func.php";
CheckLogin();
$connect = dbConn();
$query = "select userlevel from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me['userlevel'] < 5) {
if(getUserGrade() < 5) {
//echo "<script>location.replace('_admin2.php');</script>";
echo '_admin2.php';//TODO:debug all and replace
}
@@ -161,18 +157,6 @@ switch($btn) {
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "특별회원 임명":
for($i=0; $i < sizeof($genlist); $i++) {
$query = "update general set userlevel=3 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "특별회원 해제":
for($i=0; $i < sizeof($genlist); $i++) {
$query = "update general set userlevel=1 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "접속 허용":
for($i=0; $i < sizeof($genlist); $i++) {
$query = "update general set con=0 where no='$genlist[$i]'";
-100
View File
@@ -1,100 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
$query = "select userlevel from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me['userlevel'] < 5) {
echo "
<html>
<head>
<title>관리메뉴</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=css/common.css type=text/css>
</head>
<body>
관리자가 아닙니다.<br>
";
echo banner();
echo "
</body>
</html>";
exit();
}
//$admin = getAdmin($connect);
?>
<html>
<head>
<title>특별회원</title>
<meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=utf-8'>
<link rel=stylesheet href=css/common.css type=text/css>
</head>
<body>
<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>
<tr><td>특 별 회 원<br><?=backButton()?></td></tr>
</table>
<form name=form1 method=post action=_admin3_submit.php>
<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>
<tr>
<td width=80 align=center rowspan=5>회원선택<br><br><font color=orange>무장</font><br><font color=skyblue>지장</font></td>
<td width=105 rowspan=5>
<?php
echo "
<select name=genlist[] size=20 multiple style=color:white;background-color:black;font-size:13>";
$query = "select no,name,power,intel from general where userlevel>2 order by npc,binary(name)";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result);
for($i=0; $i < $gencount; $i++) {
$general = MYDB_fetch_array($result);
if($general['power'] >= $general['intel']) {
echo "
<option value={$general['no']} style=color:orange;>{$general['name']}</option>";
} else {
echo "
<option value={$general['no']} style=color:skyblue;>{$general['name']}</option>";
}
}
echo "
</select>
</td>
<td width=100 align=center>아이템 지급</td>
<td width=504>
<select name=weap size=1 style=color:white;background-color:black;font-size:13>";
for($i=0; $i < 27; $i++) {
echo "
<option value={$i}>{$i}</option>";
}
?>
</select>
<input type=submit name=btn value='무기지급'>
<input type=submit name=btn value='책지급'>
<input type=submit name=btn value='말지급'>
<input type=submit name=btn value='도구지급'>
</td>
</tr>
<tr>
<td align=center>특별회원</td>
<td><input type=submit name=btn value='특별회원 해제'></td>
</tr>
<tr>
<td align=center>메세지 전달</td>
<td><input type=textarea size=60 maxlength=255 name=msg style=background-color:black;color:white;><input type=submit name=btn value='메세지 전달'></td>
</tr>
</table>
</form>
<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>
<tr><td><?=backButton()?></td></tr>
<tr><td><?=banner()?> </td></tr>
</table>
</body>
</html>
-113
View File
@@ -1,113 +0,0 @@
<?php
include "lib.php";
include "func.php";
//로그인 검사
CheckLogin();
$connect = dbConn();
$admin = getAdmin($connect);
$query = "select userlevel from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me['userlevel'] < 4) {
//echo "<script>location.replace('_admin3.php');</script>";
echo '_admin3.php';//TODO:debug all and replace
}
$generalID = getGeneralID();
switch($btn) {
case "무기지급":
$date = date('Y-m-d H:i:s');
for($i=0; $i < sizeof($genlist); $i++) {
$you = getDB()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]);
if($weap == 0) { $msg = "무기 회수!"; }
else { $msg = getWeapName($weap)." 지급!"; }
// 상대에게 발송
sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg);
}
for($i=0; $i < sizeof($genlist); $i++) {
if($weap == 0) {
$query = "update general set weap='0' where no='$genlist[$i]'";
} else {
$query = "update general set weap='$weap' where no='$genlist[$i]' and weap<'$weap'";
}
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "책지급":
$date = date('Y-m-d H:i:s');
for($i=0; $i < sizeof($genlist); $i++) {
$you = getDB()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]);
if($weap == 0) { $msg = "서적 회수!"; }
else { $msg = getBookName($weap)." 지급!"; }
// 상대에게 발송
sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg);
}
for($i=0; $i < sizeof($genlist); $i++) {
if($weap == 0) {
$query = "update general set book='0' where no='$genlist[$i]'";
} else {
$query = "update general set book='$weap' where no='$genlist[$i]' and book<'$weap'";
}
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "말지급":
$date = date('Y-m-d H:i:s');
for($i=0; $i < sizeof($genlist); $i++) {
$you = getDB()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]);
if($weap == 0) { $msg = "말 회수!"; }
else { $msg = getHorseName($weap)." 지급!"; }
// 상대에게 발송
sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg);
}
for($i=0; $i < sizeof($genlist); $i++) {
if($weap == 0) {
$query = "update general set horse='0' where no='$genlist[$i]'";
} else {
$query = "update general set horse='$weap' where no='$genlist[$i]' and horse<'$weap'";
}
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "도구지급":
$date = date('Y-m-d H:i:s');
for($i=0; $i < sizeof($genlist); $i++) {
$you = getDB()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]);
if($weap == 0) { $msg = "특수도구 회수!"; }
else { $msg = getItemName($weap)." 지급!"; }
// 상대에게 발송
sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg);
}
for($i=0; $i < sizeof($genlist); $i++) {
if($weap == 0) {
$query = "update general set item='0' where no='$genlist[$i]'";
} else {
$query = "update general set item='$weap' where no='$genlist[$i]' and item<'$weap'";
}
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "특별회원 해제":
for($i=0; $i < sizeof($genlist); $i++) {
$query = "update general set userlevel=1 where no='$genlist[$i]'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
break;
case "메세지 전달":
//TODO:새 갠메 시스템으로 변경
$date = date('Y-m-d H:i:s');
for($i=0; $i < sizeof($genlist); $i++) {
$you = getDB()->queryFirstRow('select `no`, `nation` from `general` where `no` = %i', $genlist[$i]);
// 상대에게 발송
sendMessage('private', ['id'=>$generalID, 'nation_id'=>0], ['id'=>$you['no'], 'nation_id'=>$you['nation']], $msg);
}
break;
}
//echo "<script>location.replace('_admin3.php');</script>";
echo '_admin3.php';//TODO:debug all and replace
+3 -8
View File
@@ -5,11 +5,7 @@ include "func.php";
CheckLogin();
$connect = dbConn();
$query = "select userlevel from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me['userlevel'] < 5) {
if(getUserGrade() < 5) {
echo "
<html>
<head>
@@ -45,14 +41,14 @@ $admin = MYDB_fetch_array($result);
<form name=form1 method=post action=_admin4_submit.php>
<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>
<tr>
<td width=80 align=center rowspan=3>회원선택<br><br><font color=cyan>NPC</font><br><font color=skyblue>NPC유저</font><br><font color=blue>특별회원</font><br><font color=red>접속제한</font><br><b style=background-color:red;>블럭회원</b></td>
<td width=80 align=center rowspan=3>회원선택<br><br><font color=cyan>NPC</font><br><font color=skyblue>NPC유저</font><br><font color=red>접속제한</font><br><b style=background-color:red;>블럭회원</b></td>
<td width=105 rowspan=3>
<?php
echo "
<select name=genlist[] size=20 multiple style=color:white;background-color:black;font-size:13>";
$query = "select no,name,npc,userlevel,block from general where ip!='' order by npc,ip";
$query = "select no,name,npc,block from general where ip!='' order by npc,ip";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($result);
@@ -63,7 +59,6 @@ for($i=0; $i < $gencount; $i++) {
if($general['npc'] >= 2) { $style .= "color:cyan;"; }
elseif($general['npc'] == 1) { $style .= "color:skyblue;"; }
if($general['con'] > $admin['conlimit']) { $style .= "color:red;"; }
if($general['userlevel'] > 2) { $style .= "color:blue;"; }
echo "
<option value={$general['no']} $style>{$general['name']}</option>";
+1 -5
View File
@@ -5,11 +5,7 @@ include "func.php";
CheckLogin();
$connect = dbConn();
$query = "select userlevel from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me['userlevel'] < 5) {
if(getUserGrade() < 5) {
//echo "<script>location.replace('_admin4.php');</script>";
echo '_admin4.php';//TODO:debug all and replace
}
+2 -2
View File
@@ -5,11 +5,11 @@ include "func.php";
CheckLogin();
$connect = dbConn();
$query = "select userlevel,skin from general where owner='{$_SESSION['noMember']}'";
$query = "select skin from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me['userlevel'] < 5) {
if(getUserGrade() < 5) {
echo "
<html>
<head>
+1 -5
View File
@@ -5,11 +5,7 @@ include "func.php";
CheckLogin();
$connect = dbConn();
$query = "select userlevel from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me['userlevel'] < 5) {
if(getUserGrade() < 5) {
//echo "<script>location.replace('_admin5.php');</script>";
echo '_admin5.php';//TODO:debug all and replace
}
+1 -5
View File
@@ -5,11 +5,7 @@ include "func.php";
CheckLogin();
$connect = dbConn();
$query = "select userlevel from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me['userlevel'] < 5) {
if(getUserGrade() < 5) {
echo "
<html>
<head>
+2 -2
View File
@@ -5,11 +5,11 @@ include "func.php";
CheckLogin();
$connect = dbConn();
$query = "select userlevel,skin from general where owner='{$_SESSION['noMember']}'";
$query = "select skin from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me['userlevel'] < 5) {
if(getUserGrade() < 5) {
echo "
<html>
<head>
+2 -2
View File
@@ -5,11 +5,11 @@ include "func.php";
CheckLogin();
$connect = dbConn();
$query = "select userlevel,skin from general where owner='{$_SESSION['noMember']}'";
$query = "select skin from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me['userlevel'] < 5) {
if(getUserGrade() < 5) {
echo "
<html>
<head>
+3 -3
View File
@@ -48,7 +48,7 @@ CheckLogin();
$connect = dbConn();
increaseRefresh("시뮬", 2);
$query = "select no,tournament,userlevel,con,turntime from general where owner='{$_SESSION['noMember']}'";
$query = "select no,tournament,con,turntime from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
@@ -56,10 +56,10 @@ $query = "select * from game where no='1'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$game = MYDB_fetch_array($result);
$con = checkLimit($me['userlevel'], $me['con'], $game['conlimit']);
$con = checkLimit($me['con'], $game['conlimit']);
if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
if($me['userlevel'] < 3) {
if(getUserGrade() < 3) {
echo "특별회원이 아닙니다.";
exit();
}
+2 -2
View File
@@ -10,11 +10,11 @@ $query = "select conlimit from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select con,userlevel,turntime from general where owner='{$_SESSION['noMember']}'";
$query = "select con,turntime from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$con = checkLimit($me['userlevel'], $me['con'], $admin['conlimit']);
$con = checkLimit($me['con'], $admin['conlimit']);
if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
?>
<html>
+2 -4
View File
@@ -10,11 +10,11 @@ $query = "select conlimit from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select con,userlevel,turntime from general where owner='{$_SESSION['noMember']}'";
$query = "select con,turntime from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$con = checkLimit($me['userlevel'], $me['con'], $admin['conlimit']);
$con = checkLimit($me['con'], $admin['conlimit']);
if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
if(!isset($type) || $type == 0) {
@@ -52,7 +52,6 @@ if(!isset($type) || $type == 0) {
<option value=13>전특</option>
<option value=14>연령</option>
<option value=15>NPC</option>
<option value=16>특별</option>
</select>
<input type=submit value='정렬하기'></form>
</td></tr>
@@ -80,7 +79,6 @@ switch($type) {
case 13: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by special2 desc"; break;
case 14: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by age desc"; break;
case 15: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by npc desc"; break;
case 16: $query = "select picture,imgsvr,npc,age,nation,special,special2,personal,name,injury,leader,power,intel,experience,dedication,level,killturn,connect from general order by userlevel desc"; break;
}
$genresult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$gencount = MYDB_num_rows($genresult);
+2 -2
View File
@@ -11,11 +11,11 @@ $query = "select startyear,year,month,conlimit from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select skin,map,con,userlevel,turntime from general where owner='{$_SESSION['noMember']}'";
$query = "select skin,map,con,turntime from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$con = checkLimit($me['userlevel'], $me['con'], $admin['conlimit']);
$con = checkLimit($me['con'], $admin['conlimit']);
if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
$query = "select year,month from history order by no limit 1";
+2 -2
View File
@@ -10,11 +10,11 @@ $query = "select conlimit from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select con,userlevel,turntime from general where owner='{$_SESSION['noMember']}'";
$query = "select con,turntime from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$con = checkLimit($me['userlevel'], $me['con'], $admin['conlimit']);
$con = checkLimit($me['con'], $admin['conlimit']);
if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
?>
<html>
+2 -2
View File
@@ -11,11 +11,11 @@ $query = "select conlimit from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select skin,map,con,userlevel,turntime from general where owner='{$_SESSION['noMember']}'";
$query = "select skin,map,con,turntime from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$con = checkLimit($me['userlevel'], $me['con'], $admin['conlimit']);
$con = checkLimit($me['con'], $admin['conlimit']);
if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
?>
<!DOCTYPE html>
+7 -7
View File
@@ -4,7 +4,7 @@ include "func.php";
$connect = dbConn();
increaseRefresh("설문조사", 1);
$query = "select no,userlevel,vote from general where owner='{$_SESSION['noMember']}'";
$query = "select no,vote from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
@@ -43,7 +43,7 @@ function captureKey(e) {
<tr><td colspan=3 align=center id=bg2><font size=5>설 문 조 사 (<?=$admin['develcost']*5;?>금과 추첨으로 유니크템 증정!)</font></td></tr>
<?php
if($me['userlevel'] >= 5) {
if(getUserGrade() >= 5) {
echo "
<tr>
<td width=48 align=center><input type=submit name=btn value='알림'></td>
@@ -82,7 +82,7 @@ for($i=1; $i < $voteTypeCount; $i++) {
echo "
<input type=radio name=sel value={$i}>
";
} elseif($admin['voteopen'] >= 1 || $me['userlevel'] >= 5) {
} elseif($admin['voteopen'] >= 1 || getUserGrade() >= 5) {
$query = "select no from general where vote='{$i}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$vCount = MYDB_num_rows($result);
@@ -118,7 +118,7 @@ echo "
</tr>
";
if($me['userlevel'] >= 5) {
if(getUserGrade() >= 5) {
echo "
<tr>
<td align=center><input type=submit name=btn value='리셋'></td>
@@ -170,7 +170,7 @@ if($me['no'] > 0) {
<tr><td colspan=3 align=center id=bg2><font size=5>
전 체 통 계
<?php
if($me['userlevel'] >= 5) {
if(getUserGrade() >= 5) {
echo "
<input type=submit name=btn value='숨김'>
<input type=submit name=btn value='전체통계만'>
@@ -179,7 +179,7 @@ if($me['userlevel'] >= 5) {
echo "
</font></td></tr>";
if($admin['voteopen'] >= 1 || $me['userlevel'] >= 5) {
if($admin['voteopen'] >= 1 || getUserGrade() >= 5) {
echo "
<tr>
<td width=98 align=center>전 체</td>
@@ -220,7 +220,7 @@ if($admin['voteopen'] >= 1 || $me['userlevel'] >= 5) {
";
}
if($admin['voteopen'] >= 2 || $me['userlevel'] >= 5) {
if($admin['voteopen'] >= 2 || getUserGrade() >= 5) {
$query = "select no from general where nation=0 and npc<2";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$memCount = MYDB_num_rows($result);
+3 -3
View File
@@ -6,7 +6,7 @@ CheckLogin();
$connect = dbConn();
increaseRefresh("거래장", 2);
$query = "select no,special,skin,userlevel,con,turntime from general where owner='{$_SESSION['noMember']}'";
$query = "select no,special,skin,con,turntime from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
@@ -14,7 +14,7 @@ $query = "select conlimit from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$con = checkLimit($me['userlevel'], $me['con'], $admin['conlimit']);
$con = checkLimit($me['con'], $admin['conlimit']);
if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
$query = "select no from auction where no1='{$me['no']}'";
@@ -27,7 +27,7 @@ $bidCount = MYDB_num_rows($result);
$btCount = $tradeCount + $bidCount;
if($me['userlevel'] >= 5 || ($me['special'] != 30 && $btCount < 1) || ($me['special'] == 30 && $btCount < 3)) {
if(getUserGrade() >= 5 || ($me['special'] != 30 && $btCount < 1) || ($me['special'] == 30 && $btCount < 3)) {
$btn = "submit";
} else {
$btn = "hidden";
+2 -2
View File
@@ -16,7 +16,7 @@ $query = "select nation from general where no='$gen'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
$query = "select skin,no,nation,level,userlevel,con,turntime,belong from general where owner='{$_SESSION['noMember']}'";
$query = "select skin,no,nation,level,con,turntime,belong from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
@@ -24,7 +24,7 @@ $query = "select secretlimit from nation where nation='{$me['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
$con = checkLimit($me['userlevel'], $me['con'], $admin['conlimit']);
$con = checkLimit($me['con'], $admin['conlimit']);
if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
//재야인 경우
+2 -2
View File
@@ -7,7 +7,7 @@ $connect = dbConn();
increaseRefresh("베팅장", 1);
checkTurn($connect);
$query = "select no,tournament,userlevel,con,turntime,bet0+bet1+bet2+bet3+bet4+bet5+bet6+bet7+bet8+bet9+bet10+bet11+bet12+bet13+bet14+bet15 as bet from general where owner='{$_SESSION['noMember']}'";
$query = "select no,tournament,con,turntime,bet0+bet1+bet2+bet3+bet4+bet5+bet6+bet7+bet8+bet9+bet10+bet11+bet12+bet13+bet14+bet15 as bet from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
@@ -15,7 +15,7 @@ $query = "select conlimit,tournament,phase,tnmt_type,develcost,bet0,bet1,bet2,be
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$con = checkLimit($me['userlevel'], $me['con'], $admin['conlimit']);
$con = checkLimit($me['con'], $admin['conlimit']);
if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
switch($admin['tnmt_type']) {
+2 -2
View File
@@ -10,7 +10,7 @@ $query = "select conlimit from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select skin,no,nation,level,userlevel,con,turntime,belong from general where owner='{$_SESSION['noMember']}'";
$query = "select skin,no,nation,level,con,turntime,belong from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
@@ -18,7 +18,7 @@ $query = "select secretlimit from nation where nation='{$me['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
$con = checkLimit($me['userlevel'], $me['con'], $admin['conlimit']);
$con = checkLimit($me['con'], $admin['conlimit']);
if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
if($me['level'] == 0 || ($me['level'] == 1 && $me['belong'] < $nation['secretlimit'])) {
+3 -3
View File
@@ -6,7 +6,7 @@ CheckLogin();
$connect = dbConn();
increaseRefresh("현재도시", 1);
$query = "select skin,no,nation,userlevel,level,city from general where owner='{$_SESSION['noMember']}'";
$query = "select skin,no,nation,level,city from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
@@ -129,7 +129,7 @@ echo "
<br>";
// 첩보된 도시까지만 허용
if($valid == 0 && $me['userlevel'] < 5) {
if($valid == 0 && getUserGrade() < 5) {
$_REQUEST['citylist'] = $me['city'];
}
@@ -280,7 +280,7 @@ for($j=0; $j < $gencount; $j++) {
<td align=center>$intel</td>
<td align=center>".getLevel($general['level'])."</td>";
//아국장수이거나 보는 사람이 운영자일때 보여줌
if(($general['nation'] != 0 && $general['nation'] == $myNation['nation']) || $me['userlevel'] >= 5) {
if(($general['nation'] != 0 && $general['nation'] == $myNation['nation']) || getUserGrade() >= 5) {
switch($general['mode']) {
case 0: $mode = "×"; break;
case 1: $mode = "○"; break;
+2 -2
View File
@@ -10,7 +10,7 @@ $query = "select conlimit from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select skin,no,nation,level,userlevel,con,turntime,belong from general where owner='{$_SESSION['noMember']}'";
$query = "select skin,no,nation,level,con,turntime,belong from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
@@ -18,7 +18,7 @@ $query = "select secretlimit from nation where nation='{$me['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
$con = checkLimit($me['userlevel'], $me['con'], $admin['conlimit']);
$con = checkLimit($me['con'], $admin['conlimit']);
if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
if($me['level'] == 0 || ($me['level'] == 1 && $me['belong'] < $nation['secretlimit'])) {
+3 -3
View File
@@ -10,7 +10,7 @@ $query = "select turnterm from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select no,nation,skin,map,userlevel from general where owner='{$_SESSION['noMember']}'";
$query = "select no,nation,skin,map from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
@@ -115,7 +115,7 @@ for($i=0; $i < $nationcount; $i++) {
case 0: $str = "<font color=red>★</font>"; break;
case 1: $str = "<font color=magenta>▲</font>"; break;
case 2:
if($nationnum[$i] == $me['nation'] || $nationnum[$k] == $me['nation'] || $me['userlevel'] >= 4) { $str = "ㆍ"; }
if($nationnum[$i] == $me['nation'] || $nationnum[$k] == $me['nation'] || getUserGrade() >= 5) { $str = "ㆍ"; }
else { $str = "?"; }
// $str = "ㆍ";
break;
@@ -124,7 +124,7 @@ for($i=0; $i < $nationcount; $i++) {
case 5: $str = "<font color=cyan>◎</font>"; break;
case 6: $str = "<font color=cyan>◎</font>"; break;
case 7:
if($nationnum[$i] == $me['nation'] || $nationnum[$k] == $me['nation'] || $me['userlevel'] >= 4) { $str = "<font color=green>@</font>"; }
if($nationnum[$i] == $me['nation'] || $nationnum[$k] == $me['nation'] || getUserGrade() >= 5) { $str = "<font color=green>@</font>"; }
else { $str = "?"; }
// $str = "<font color=limegreen>@</font>";
break;
+2 -2
View File
@@ -10,7 +10,7 @@ $query = "select conlimit from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select skin,no,nation,level,userlevel,con,turntime,belong from general where owner='{$_SESSION['noMember']}'";
$query = "select skin,no,nation,level,con,turntime,belong from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
@@ -18,7 +18,7 @@ $query = "select level,secretlimit from nation where nation='{$me['nation']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nation = MYDB_fetch_array($result);
$con = checkLimit($me['userlevel'], $me['con'], $admin['conlimit']);
$con = checkLimit($me['con'], $admin['conlimit']);
if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
if($me['level'] == 0 || ($me['level'] == 1 && $me['belong'] < $nation['secretlimit'])) {
+3 -3
View File
@@ -7,7 +7,7 @@ $connect = dbConn();
increaseRefresh("토너먼트", 1);
checkTurn($connect);
$query = "select no,tournament,userlevel,con,turntime from general where owner='{$_SESSION['noMember']}'";
$query = "select no,tournament,con,turntime from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
@@ -15,7 +15,7 @@ $query = "select conlimit,tournament,phase,tnmt_msg,tnmt_type,develcost,tnmt_tri
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$con = checkLimit($me['userlevel'], $me['con'], $admin['conlimit']);
$con = checkLimit($me['con'], $admin['conlimit']);
if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
switch($admin['tnmt_type']) {
@@ -50,7 +50,7 @@ select { font-family:'굴림'; line-height:100%; }
</table>
<table align=center border=1 cellspacing=0 cellpadding=0 bordercolordark=gray bordercolorlight=black style=font-size:13px;word-break:break-all; id=bg0>
<?php
if($me['userlevel'] >= 5) {
if(getUserGrade() >= 5) {
echo "
<form method=post action=c_tournament.php>
<tr><td colspan=8><input type=textarea size=150 style=color:white;background-color:black; name=msg><input type=submit name=btn value='메시지'></td></tr>
+2 -2
View File
@@ -10,7 +10,7 @@ $query = "select turnterm from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select no,name,gold,rice,special,userlevel from general where owner='{$_SESSION['noMember']}'";
$query = "select no,name,gold,rice,special from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
@@ -42,7 +42,7 @@ $value = round($value / 10) * 10;
if($term > 24) $term = 24;
$valid = 1;
if($me['userlevel'] >= 5 || ($me['special'] != 30 && $btCount < 1) || ($me['special'] == 30 && $btCount < 3)) {
if(getUserGrade() >= 5 || ($me['special'] != 30 && $btCount < 1) || ($me['special'] == 30 && $btCount < 3)) {
} else {
$msg = "ㆍ<span class='ev_warning'>더이상 등록할 수 없습니다.</span>";
$msg2 = "ㆍ<span class='ev_warning'>더이상 등록할 수 없습니다.</span>";
+23 -23
View File
@@ -11,7 +11,7 @@ $query = "select tournament,phase,tnmt_type,develcost from game where no='1'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select no,name,userlevel,tournament from general where owner='{$_SESSION['noMember']}'";
$query = "select no,name,tournament from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
@@ -22,17 +22,17 @@ case 2: $tp = "power"; $tp2 = "일기토"; $tp3 = "power"; break;
case 3: $tp = "intel"; $tp2 = "설전"; $tp3 = "intel"; break;
}
if($me['tournament'] == 1 && $me['userlevel'] < 5) { echo "<script>location.replace('b_tournament.php');</script>"; exit(); }
if($me['tournament'] == 1 && getUserGrade() < 5) { echo "<script>location.replace('b_tournament.php');</script>"; exit(); }
if($btn == "자동개최설정" && $me['userlevel'] >= 5) {
if($btn == "자동개최설정" && getUserGrade() >= 5) {
$query = "update game set tnmt_trig={$trig}";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "개최" && $me['userlevel'] >= 5) {
} elseif($btn == "개최" && getUserGrade() >= 5) {
startTournament($connect, $auto, $type);
} elseif($btn == "중단" && $me['userlevel'] >= 5) {
} elseif($btn == "중단" && getUserGrade() >= 5) {
$query = "update game set tnmt_auto=0, tournament=0, phase=0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif((($btn == "투입" || $btn == "무명투입" || $btn == "쪼렙투입" || $btn == "일반투입" || $btn == "굇수투입" || $btn == "랜덤투입") && $me['userlevel'] >= 5) || $btn == "참가") {
} elseif((($btn == "투입" || $btn == "무명투입" || $btn == "쪼렙투입" || $btn == "일반투입" || $btn == "굇수투입" || $btn == "랜덤투입") && getUserGrade() >= 5) || $btn == "참가") {
if($btn == "투입") {
$query = "select no,name,npc,leader,power,intel,explevel,gold,horse,weap,book from general where no='$gen'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
@@ -123,7 +123,7 @@ if($btn == "자동개최설정" && $me['userlevel'] >= 5) {
$query = "update game set tournament=2, phase=0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
} elseif(($btn == "쪼렙전부투입" || $btn == "일반전부투입" || $btn == "굇수전부투입" || $btn == "랜덤전부투입") && $me['userlevel'] >= 5) {
} elseif(($btn == "쪼렙전부투입" || $btn == "일반전부투입" || $btn == "굇수전부투입" || $btn == "랜덤전부투입") && getUserGrade() >= 5) {
$z = 0;
for($i=0; $i < 8; $i++) {
$query = "select grp from tournament where grp='$i'";
@@ -177,25 +177,25 @@ if($btn == "자동개최설정" && $me['userlevel'] >= 5) {
$query = "update game set tournament=2, phase=0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "무명전부투입" && $me['userlevel'] >= 5) { fillLowGenAll($connect);
} elseif($btn == "예선" && $me['userlevel'] >= 5) { qualify($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase']);
} elseif($btn == "예선전부" && $me['userlevel'] >= 5) { qualifyAll($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase']);
} elseif($btn == "추첨" && $me['userlevel'] >= 5) { selection($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase']);
} elseif($btn == "추첨전부" && $me['userlevel'] >= 5) { selectionAll($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase']);
} elseif($btn == "본선" && $me['userlevel'] >= 5) { finallySingle($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase']);
} elseif($btn == "본선전부" && $me['userlevel'] >= 5) { finallyAll($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase']);
} elseif($btn == "배정" && $me['userlevel'] >= 5) { final16set($connect);
} elseif($btn == "베팅마감" && $me['userlevel'] >= 5) {
} elseif($btn == "무명전부투입" && getUserGrade() >= 5) { fillLowGenAll($connect);
} elseif($btn == "예선" && getUserGrade() >= 5) { qualify($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase']);
} elseif($btn == "예선전부" && getUserGrade() >= 5) { qualifyAll($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase']);
} elseif($btn == "추첨" && getUserGrade() >= 5) { selection($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase']);
} elseif($btn == "추첨전부" && getUserGrade() >= 5) { selectionAll($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase']);
} elseif($btn == "본선" && getUserGrade() >= 5) { finallySingle($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase']);
} elseif($btn == "본선전부" && getUserGrade() >= 5) { finallyAll($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase']);
} elseif($btn == "배정" && getUserGrade() >= 5) { final16set($connect);
} elseif($btn == "베팅마감" && getUserGrade() >= 5) {
$dt = date("Y-m-d H:i:s", time() + 60);
$query = "update game set tournament='7',phase='0',tnmt_time='$dt' where no=1";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "16강" && $me['userlevel'] >= 5) { finalFight($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase'], 16);
} elseif($btn == "8강" && $me['userlevel'] >= 5) { finalFight($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase'], 8);
} elseif($btn == "4강" && $me['userlevel'] >= 5) { finalFight($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase'], 4);
} elseif($btn == "결승" && $me['userlevel'] >= 5) { finalFight($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase'], 2);
} elseif($btn == "포상" && $me['userlevel'] >= 5) { setGift($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase']);
} elseif($btn == "회수" && $me['userlevel'] >= 5) { setRefund($connect);
} elseif($btn == "메시지" && $me['userlevel'] >= 5) {
} elseif($btn == "16강" && getUserGrade() >= 5) { finalFight($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase'], 16);
} elseif($btn == "8강" && getUserGrade() >= 5) { finalFight($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase'], 8);
} elseif($btn == "4강" && getUserGrade() >= 5) { finalFight($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase'], 4);
} elseif($btn == "결승" && getUserGrade() >= 5) { finalFight($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase'], 2);
} elseif($btn == "포상" && getUserGrade() >= 5) { setGift($connect, $admin['tnmt_type'], $admin['tournament'], $admin['phase']);
} elseif($btn == "회수" && getUserGrade() >= 5) { setRefund($connect);
} elseif($btn == "메시지" && getUserGrade() >= 5) {
$msg = addslashes(SQ2DQ($msg));
$query = "update game set tnmt_msg='$msg'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
+51 -38
View File
@@ -9,44 +9,11 @@ $query = "select develcost,vote,votecomment from game where no='1'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select no,userlevel,vote,name,nation,horse,weap,book,item,npc from general where owner='{$_SESSION['noMember']}'";
$query = "select no,vote,name,nation,horse,weap,book,item,npc from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($btn == "수정" && $me['userlevel'] >= 5) {
if($title != "") {
$vote = explode("|", $admin['vote']);
$vote[0] = addslashes(SQ2DQ($title));
$admin['vote'] = implode("|", $vote);
$query = "update game set vote='{$admin['vote']}' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
} elseif($btn == "추가" && $me['userlevel'] >= 5) {
if($str != "") {
$str = addslashes(SQ2DQ($str));
$admin['vote'] .= "|{$str}";
$query = "update game set vote='{$admin['vote']}' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
} elseif($btn == "리셋" && $me['userlevel'] >= 5) {
$query = "update game set voteopen=1,vote='',votecomment='' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update general set vote='0'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "알림" && $me['userlevel'] >= 5) {
$query = "update general set newvote='1' where vote=0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "숨김" && $me['userlevel'] >= 5) {
$query = "update game set voteopen=0 where no=1";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "전체통계만" && $me['userlevel'] >= 5) {
$query = "update game set voteopen=1 where no=1";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "전부" && $me['userlevel'] >= 5) {
$query = "update game set voteopen=2 where no=1";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "투표" && $me['vote'] == 0 && $sel > 0) {
if($btn == "투표" && $me['vote'] == 0 && $sel > 0) {
$develcost = $admin['develcost'] * 5;
$query = "update general set gold=gold+{$develcost},vote='{$sel}' where owner='{$_SESSION['noMember']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
@@ -54,7 +21,8 @@ if($btn == "수정" && $me['userlevel'] >= 5) {
$log = array();
$log = uniqueItem($connect, $me, $log, 1);
pushGenLog($me, $log);
} elseif($btn == "댓글" && $comment != "") {
}
else if($btn == "댓글" && $comment != "") {
$comment = str_replace("|", " ", $comment);
$comment = str_replace(":", " ", $comment);
$comment = trim($comment);
@@ -70,8 +38,53 @@ if($btn == "수정" && $me['userlevel'] >= 5) {
$query = "update game set votecomment='{$admin['votecomment']}' where no=1";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
if(getUserGrade() < 5){
echo "<!--<script>location.replace('a_vote.php');</script>"; //TODO:debug all and replace -->
echo 'a_vote.php ';
die();
}
if($btn == "수정") {
if($title != "") {
$vote = explode("|", $admin['vote']);
$vote[0] = addslashes(SQ2DQ($title));
$admin['vote'] = implode("|", $vote);
$query = "update game set vote='{$admin['vote']}' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
} elseif($btn == "추가") {
if($str != "") {
$str = addslashes(SQ2DQ($str));
$admin['vote'] .= "|{$str}";
$query = "update game set vote='{$admin['vote']}' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
} elseif($btn == "리셋") {
$query = "update game set voteopen=1,vote='',votecomment='' where no='1'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "update general set vote='0'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "알림") {
$query = "update general set newvote='1' where vote=0";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "숨김") {
$query = "update game set voteopen=0 where no=1";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "전체통계만") {
$query = "update game set voteopen=1 where no=1";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif($btn == "전부") {
$query = "update game set voteopen=2 where no=1";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
}
?>
<!--<script>location.replace('a_vote.php');</script> //TODO:debug all and replace -->
a_vote.php
<!--<script>location.replace('a_vote.php');</script>"; //TODO:debug all and replace -->
a_vote.php
+7 -20
View File
@@ -1,9 +1,12 @@
<?php
require_once(__dir__.'/../../d_setting/conf.php');
$_currentToken = '_token_';
function getDB__token_(){
/**
* DB 객체 생성
*
* @return MeekroDB
*/
function getDB(){
$host = '_host_';
$user = '_user_';
$password = '_password_';
@@ -21,23 +24,7 @@ function getDB__token_(){
return $uDB;
}
//XXX: 단일 서버 기준이고 외부에서 접근할일이 없다면 굳이 이런 구조를 할 이유가 없는데!
if(!function_exists('getDB')){
/**
* DB 객체 생성
*
* @return MeekroDB
*/
function getDB($getToken='_token_'){
$func = "getDB_{$getToken}";
return $func();
}
}
if (!function_exists('getServPrefix')) {
function getServPrefix($getToken='_token_')
function getServPrefix()
{
return '_prefix_';
}
}
+1 -5
View File
@@ -9,11 +9,7 @@ include "func.php";
CheckLogin();
$connect = dbConn();
$query = "select userlevel from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me['userlevel'] < 5) {
if(getUserGrade() < 5) {
echo "
<html>
<head>
+1 -5
View File
@@ -9,11 +9,7 @@ include "func.php";
CheckLogin();
$connect = dbConn();
$query = "select userlevel from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me['userlevel'] < 5) {
if(getUserGrade() < 5) {
echo "
<html>
<head>
+1 -5
View File
@@ -9,11 +9,7 @@ include "func.php";
CheckLogin();
$connect = dbConn();
$query = "select userlevel from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me['userlevel'] < 5) {
if(getUserGrade() < 5) {
echo "
<html>
<head>
+1 -5
View File
@@ -12,11 +12,7 @@ include "func.php";
CheckLogin();
$connect = dbConn();
$query = "select userlevel from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
if($me['userlevel'] < 5) {
if(getUserGrade() < 5) {
echo "
<html>
<head>
+13 -19
View File
@@ -64,11 +64,13 @@ function getUserID($forceExit=false){
* @return int|null
*/
function getUserGrade($forceExit=false){
$userID = getUserID($forceExit);
if(!$userID){
return null;
$userGrade = util::array_get($_SESSION['userGrade'], null);
if(!$userGrade && $forceExit){
header('Location:..');
die();
}
return getRootDB()->queryFirstField('SELECT `GRADE` from `MEMBER` WHERE NO=%i', $userID);
return $userGrade;
}
/**
@@ -76,7 +78,7 @@ function getUserGrade($forceExit=false){
*
* @return int|null
*/
function getGeneralID($forceExit=false){
function getGeneralID($forceExit=false, $countLogin=true){
$userID = getUserID();
if(!$userID){ //유저id 없으면 어차피 의미 없음.
return null;
@@ -97,7 +99,7 @@ function getGeneralID($forceExit=false){
die();
}
if($generalID){
if($generalID && $countLogin){
//로그인으로 처리
//XXX: 'get' 함수인데 update가 들어가있다.
//TODO: 조금더 적절한 형태의 로그인 카운트를 생각해볼 것
@@ -230,13 +232,10 @@ function isSigned(){
}
function checkLimit($userlevel, $con, $conlimit) {
//TODO: 접속 제한의 기준을 새로 세울 것.
//운영자
if($userlevel >= 5) { return 0; }
//특회이면 3배
if($userlevel >= 3) { $conlimit *= 3; }
//접속률 이상이면 제한
function checkLimit($con, $conlimit) {
if(getUserGrade()>=4){
return 0;
}
if($con > $conlimit) {
return 2;
//접속제한 90%이면 경고문구
@@ -918,7 +917,7 @@ function generalInfo($connect, $no, $skin) {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$query = "select block,userlevel,no,name,picture,imgsvr,injury,nation,city,troop,leader,leader2,power,power2,intel,intel2,explevel,experience,level,gold,rice,crew,crewtype,train,atmos,weap,book,horse,item,turntime,killturn,age,personal,special,specage,special2,specage2,mode,con,connect from general where no='$no'";
$query = "select block,no,name,picture,imgsvr,injury,nation,city,troop,leader,leader2,power,power2,intel,intel2,explevel,experience,level,gold,rice,crew,crewtype,train,atmos,weap,book,horse,item,turntime,killturn,age,personal,special,specage,special2,specage2,mode,con,connect from general where no='$no'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
@@ -980,11 +979,6 @@ function generalInfo($connect, $no, $skin) {
$remaining = substr($general['turntime'], 14, 2) - date('i');
if($remaining < 0) { $remaining = 60 + $remaining; }
if($general['userlevel'] > 2) { $specUser = "<font color=cyan><b>특별</b></font>"; }
else { $specUser = "<font color=gray><b>일반</b></font>"; }
if($general['block'] > 0) { $specUser = "<font color=red><b>블럭</b></font>"; }
$specUser = '';
if($nation['color'] == "" || $skin < 1) { $nation['color'] = "000000"; }
if($general['age'] < 60) { $general['age'] = "<font color=limegreen>{$general['age']} 세</font>"; }
+3 -3
View File
@@ -449,7 +449,7 @@ function getCoreTurn($connect, $nation, $level) {
function processCommand($connect, $no) {
$query = "select npc,no,name,userlevel,picture,imgsvr,nation,nations,city,troop,injury,leader,leader2,power,power2,intel,intel2,experience,dedication,level,gold,rice,crew,crewtype,train,atmos,weap,book,horse,item,turntime,makenation,makelimit,killturn,block,dedlevel,explevel,age,belong,personal,special,special2,term,turn0,dex0,dex10,dex20,dex30,dex40 from general where no='$no'";
$query = "select npc,no,name,picture,imgsvr,nation,nations,city,troop,injury,leader,leader2,power,power2,intel,intel2,experience,dedication,level,gold,rice,crew,crewtype,train,atmos,weap,book,horse,item,turntime,makenation,makelimit,killturn,block,dedlevel,explevel,age,belong,personal,special,special2,term,turn0,dex0,dex10,dex20,dex30,dex40 from general where no='$no'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
@@ -513,7 +513,7 @@ function processCommand($connect, $no) {
}
//장수정보 재로드
$query = "select npc,no,name,userlevel,picture,imgsvr,nation,nations,city,troop,injury,leader,leader2,power,power2,intel,intel2,experience,dedication,level,gold,rice,crew,crewtype,train,atmos,weap,book,horse,item,turntime,makenation,makelimit,killturn,block,dedlevel,explevel,age,belong,personal,special,special2,term,turn0,dex0,dex10,dex20,dex30,dex40 from general where no='$no'";
$query = "select npc,no,name,picture,imgsvr,nation,nations,city,troop,injury,leader,leader2,power,power2,intel,intel2,experience,dedication,level,gold,rice,crew,crewtype,train,atmos,weap,book,horse,item,turntime,makenation,makelimit,killturn,block,dedlevel,explevel,age,belong,personal,special,special2,term,turn0,dex0,dex10,dex20,dex30,dex40 from general where no='$no'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
}
@@ -523,7 +523,7 @@ function processCommand($connect, $no) {
if($general['npc'] >= 2 || $general['killturn'] > $admin['killturn']) {
$query = "update general set recturn=turn0,resturn='FAIL',myset=3,con=0,killturn=killturn-1 where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} elseif(floor($command[0]) == 0 && $general['userlevel'] < 5) {
} elseif(floor($command[0]) == 0 && getUserGrade() < 5) {
$query = "update general set recturn=turn0,resturn='FAIL',myset=3,con=0,killturn=killturn-1 where no='{$general['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
} else {
+3 -4
View File
@@ -21,7 +21,7 @@ if(!$userID){
die();
}
$me = $db->queryFirstRow('select no,skin,userlevel,con,turntime,newmsg,newvote,map from general where owner = %i', $userID);
$me = $db->queryFirstRow('select no,skin,con,turntime,newmsg,newvote,map from general where owner = %i', $userID);
//그새 사망이면
if($me === null) {
@@ -49,7 +49,7 @@ $query = "select plock from plock where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$plock = MYDB_fetch_array($result);
$con = checkLimit($me['userlevel'], $me['con'], $admin['conlimit']);
$con = checkLimit($me['con'], $admin['conlimit']);
if($con >= 2) { printLimitMsg($me['turntime']); exit(); }
if($me['skin'] < 1) {
@@ -172,12 +172,11 @@ echo "
<tr><td colspan=5>【 국가방침 】<?php nationMsg($connect, $me['skin']); ?></td></tr>
<tr><td colspan=5>【 접속자 】<?=onlinegen($connect);?></td></tr>
<?php
if($me['userlevel'] >= 5) {
if(getUserGrade() >= 5) {
echo "
<tr><td colspan=5>
<input type=button value=게임관리 onclick=location.replace('_admin1.php')>
<input type=button value=회원관리 onclick=location.replace('_admin2.php')>
<input type=button value=특별회원 onclick=location.replace('_admin3.php')>
<input type=button value=멀티관리 onclick=location.replace('_admin4.php')>
<input type=button value=일제정보 onclick=window.open('_admin5.php')>
<input type=button value=접속정보 onclick=window.open('_admin6.php')>
+8 -3
View File
@@ -1,8 +1,13 @@
<?php
include "lib.php";
if(file_exists("d_setting/set.php")) error("이미 set.php가 생성되어 있습니다.<br><br>재설치하려면 해당 파일을 지우세요");
include "lib.php";
@chmod(".",0707);
if(getUserGrade(true) < 5){
die('관리자 아님');
}
if(file_exists("d_setting/conf.php")) error("이미 conf.php가 생성되어 있습니다.<br><br>재설치하려면 해당 파일을 지우세요");
@chmod(".",0707);
?>
<html>
+7 -2
View File
@@ -1,6 +1,11 @@
<?php
include "lib.php";
if(file_exists("d_setting/set.php")) error("이미 set.php가 생성되어 있습니다.<br><br>재설치하려면 해당 파일을 지우세요");
include "lib.php";
if(getUserGrade(true) < 5){
die('관리자 아님');
}
if(file_exists("d_setting/conf.php")) error("이미 conf.php가 생성되어 있습니다.<br><br>재설치하려면 해당 파일을 지우세요");
?>
<html>
+5 -1
View File
@@ -1,5 +1,9 @@
<?php
require "lib.php";
require "lib.php";
if(getUserGrade(true) < 5){
die('관리자 아님');
}
?>
<html>
-384
View File
@@ -1,384 +0,0 @@
<?php
include "lib.php";
include "func.php";
use utilphp\util as util;
$turnterm = util::array_get($_POST['turnterm'],'0');
$sync = util::array_get($_POST['sync'],'0');
$scenario = util::array_get($_POST['scenario'],'0');
$fiction = util::array_get($_POST['fiction'],'0');
$extend = util::array_get($_POST['extend'],'0');
$npcmode = util::array_get($_POST['npcmode'],'0');
$img = util::array_get($_POST['img'],'0');
$connect=dbConn();
switch($scenario) {
case 0: $startyear = 180; break;
case 1: $startyear = 184 - 3; break;
case 2: $startyear = 190 - 3; break;
case 3: $startyear = 194 - 3; break;
case 4: $startyear = 196 - 3; break;
case 5: $startyear = 200 - 3; break;
case 6: $startyear = 202 - 3; break;
case 7: $startyear = 207 - 3; break;
case 8: $startyear = 213 - 3; break;
case 9: $startyear = 219 - 3; break;
case 10: $startyear = 225 - 3; break;
case 11: $startyear = 228 - 3; break;
case 12: $startyear = 191 - 3; break;
case 20: $startyear = 180; break;
case 21: $startyear = 180; break;
case 22: $startyear = 179; break;
case 23: $startyear = 180; break;
case 24: $startyear = 180; break;
case 25: $startyear = 180; break;
case 26: $startyear = 180; break;
case 27: $startyear = 180; break;
case 28: $startyear = 180; break;
default: $startyear = 180; break;
}
// 관리자 등록
$turntime = date('Y-m-d H:i:s');
$lastconnect = $turntime;
$turntime = addTurn($turntime, $turnterm);
$turntime = cutTurn($turntime, $turnterm);
$picture = 'pic_1.jpg';
if($img < 1) { $picture = 'default.jpg'; };
@MYDB_query("
insert into general (
owner, connect, name, picture, nation, city, troop, makelimit,
leader, power, intel, experience, dedication, gold, rice, crew, train, atmos,
weap, book, level, turntime, killturn, lastconnect, userlevel
) values (
'1', '0', '운영자', '$picture', '0', '3', '0', '0',
'50', '50', '50', '0', '0', '10000', '10000', '0', '0', '0',
'0', '0', '0', '$turntime', '80', '$lastconnect', '6'
)",
$connect
) or Error(__LINE__.MYDB_error($connect),"");
$picture = 'pic_2.jpg';
if($img < 1) { $picture = 'default.jpg'; };
//부운영자는 비밀번호를 지정하지 않아 로그인할수 없도록 처리한다.
@MYDB_query("
insert into general (
owner, connect, name, picture, nation, city, troop, makelimit,
leader, power, intel, experience, dedication, gold, rice, crew, train, atmos,
weap, book, level, turntime, killturn, lastconnect, userlevel
) values (
'2', '0', '부운영자', '$picture', '0', '3', '0', '0',
'50', '50', '50', '0', '0', '10000', '10000', '0', '0', '0',
'0', '0', '0', '$turntime', '80', '$lastconnect', '5'
)",
$connect
) or Error(__LINE__.MYDB_error($connect),"");
// 게임정보 입력
$turntime = date('Y-m-d H:i:s');
$time = substr($turntime, 11, 2);
if($sync == 0) {
// 항상 정각으로 설정
$starttime = cutTurn($turntime, $turnterm);
} else {
// 항상 13시로 설정
$starttime = CutDay($turntime);
}
switch($turnterm) {
case 0: $killturn = 40; break;
case 1: $killturn = 80; break;
case 2: $killturn = 160; break;
case 3: $killturn = 240; break;
case 4: $killturn = 480; break;
case 5: $killturn = 960; break;
case 6: $killturn =2400; break;
case 7: $killturn =4800; break;
}
if($npcmode == 1) { $killturn = floor($killturn / 3); }
//락 생성
@MYDB_query("insert into plock ( plock ) values ( 0 )", $connect) or Error(__LINE__.MYDB_error($connect),"");
//게임 정보 생성
@MYDB_query("
insert into game (
year, month, msg,
maxgeneral, normgeneral, maxnation, conlimit, gold_rate, rice_rate,
turntime, starttime, turnterm, killturn,
genius, startyear,scenario,img,npcmode,extend,fiction,
att0, def0, spd0, avd0, cst0, ric0,
att1, def1, spd1, avd1, cst1, ric1,
att2, def2, spd2, avd2, cst2, ric2,
att3, def3, spd3, avd3, cst3, ric3,
att4, def4, spd4, avd4, cst4, ric4,
att5, def5, spd5, avd5, cst5, ric5,
att10, def10, spd10, avd10, cst10, ric10,
att11, def11, spd11, avd11, cst11, ric11,
att12, def12, spd12, avd12, cst12, ric12,
att13, def13, spd13, avd13, cst13, ric13,
att14, def14, spd14, avd14, cst14, ric14,
att20, def20, spd20, avd20, cst20, ric20,
att21, def21, spd21, avd21, cst21, ric21,
att22, def22, spd22, avd22, cst22, ric22,
att23, def23, spd23, avd23, cst23, ric23,
att24, def24, spd24, avd24, cst24, ric24,
att25, def25, spd25, avd25, cst25, ric25,
att26, def26, spd26, avd26, cst26, ric26,
att27, def27, spd27, avd27, cst27, ric27,
att30, def30, spd30, avd30, cst30, ric30,
att31, def31, spd31, avd31, cst31, ric31,
att32, def32, spd32, avd32, cst32, ric32,
att33, def33, spd33, avd33, cst33, ric33,
att34, def34, spd34, avd34, cst34, ric34,
att35, def35, spd35, avd35, cst35, ric35,
att36, def36, spd36, avd36, cst36, ric36,
att37, def37, spd37, avd37, cst37, ric37,
att38, def38, spd38, avd38, cst38, ric38,
att40, def40, spd40, avd40, cst40, ric40,
att41, def41, spd41, avd41, cst41, ric41,
att42, def42, spd42, avd42, cst42, ric42,
att43, def43, spd43, avd43, cst43, ric43
) values (
'$startyear', 1, '삼모전의 매력은 IRC에서의 커뮤니티입니다. 흠냐 채널을 찾아주세요^^ <font color=cyan>웹 IRC</font> : <a target=_blank href=http://barosl.com/webirc/흠냐>http://barosl.com/webirc/흠냐</a><br><font color=orange size=6>폭력적/선정적인 전콘/전메는 블럭/삭제 대상이 될 수 있습니다.</font>',
500, 300, 55, 120, 100, 100,
'$turntime', '$starttime', '$turnterm', '$killturn',
5, '$startyear', '$scenario', '$img', '$npcmode', '$extend', '$fiction',
100, 150, 7, 10, 9, 9, -- 보병
100, 200, 7, 10, 10, 11, -- 청주병(중원)
150, 150, 7, 10, 11, 10, -- 수병(오월)
100, 150, 7, 20, 10, 10, -- 자객병(저)
150, 200, 7, 10, 12, 12, -- 근위병(낙양)
100, 250, 7, 5, 13, 10, -- 등갑병(남중)
100, 100, 7, 20, 10, 10, -- 궁병
100, 100, 8, 30, 11, 12, -- 궁기병(동이)
150, 100, 8, 20, 12, 11, -- 연노병(서촉)
150, 150, 7, 20, 13, 13, -- 강궁병(양양)
200, 100, 7, 20, 13, 13, -- 석궁병(건업)
150, 100, 7, 5, 11, 11, -- 기병
200, 100, 7, 5, 12, 13, -- 백마병(하북)
150, 150, 7, 5, 13, 12, -- 중장기병(서북)
200, 100, 8, 5, 13, 11, -- 돌격기병(흉노)
100, 200, 7, 5, 11, 13, -- 철기병(강)
150, 100, 8, 15, 12, 12, -- 수렵기병(산월)
250, 200, 6, 0, 16, 16, -- 맹수병(남만)
200, 150, 7, 5, 14, 14, -- 호표기병(허창)
80, 80, 7, 5, 9, 9, -- 귀병
80, 80, 7, 20, 10, 10, -- 신귀병(초)
80, 130, 7, 5, 9, 11, -- 백귀병(오환)
130, 80, 7, 5, 11, 9, -- 흑귀병(왜)
130, 130, 7, 0, 12, 12, -- 악귀병(장안)
60, 60, 7, 10, 8, 8, -- 남귀병
110, 110, 7, 0, 13, 10, -- 황귀병(낙양)
80, 130, 7, 15, 11, 12, -- 천귀병(성도)
130, 80, 7, 15, 12, 11, -- 마귀병(업)
100, 100, 6, 0, 15, 5, -- 정란
150, 100, 6, 0, 20, 5, -- 충차
200, 100, 6, 0, 25, 5, -- 벽력거(업)
50, 200, 5, 0, 30, 5 -- 목우(성도)
)",
$connect
) or Error(__LINE__.MYDB_error($connect),"");
// 도시정보 입력
// 이름 규모 인구 농업 상업 치안 수비 성벽 지역 경로
insertCity($connect, "", 8, 620500, 12500, 11300, 10000, 11700, 12200, 1, "9|18|70|78|80"); // 1 : 업
insertCity($connect, "허창", 8, 587600, 12100, 12400, 10000, 11700, 12500, 2, "10|19|38|71|74|80"); // 2 : 허창
insertCity($connect, "낙양", 8, 835700, 11700, 12000, 10000, 12100, 12400, 2, "70|71|72|74"); // 3 : 낙양
insertCity($connect, "장안", 8, 592300, 11600, 12300, 10000, 12000, 11800, 3, "41|73|86"); // 4 : 장안
insertCity($connect, "성도", 8, 652500, 12300, 12500, 10000, 12500, 12300, 4, "26|27|87"); // 5 : 성도
insertCity($connect, "양양", 8, 583700, 12000, 12600, 10000, 11500, 11700, 6, "51|89"); // 6 : 양양
insertCity($connect, "건업", 8, 638600, 11600, 12300, 10000, 11500, 11900, 7, "31|82|83"); // 7 : 건업
insertCity($connect, "북평", 7, 486200, 10200, 9500, 8000, 10300, 9900, 1, "77|90"); // 8 : 북평
insertCity($connect, "남피", 7, 503200, 9900, 10100, 8000, 10100, 10500, 1, "1|36|77"); // 9 : 남피
insertCity($connect, "", 7, 472400, 10300, 10000, 8000, 10100, 9900, 2, "2|20|51|71"); // 10 : 완
insertCity($connect, "수춘", 7, 514300, 9900, 9600, 8000, 9900, 9500, 2, "12|20|38|82"); // 11 : 수춘
insertCity($connect, "서주", 7, 485300, 10100, 9800, 8000, 10200, 9700, 2, "11|21|38|39"); // 12 : 서주
insertCity($connect, "강릉", 7, 485000, 10500, 9600, 8000, 9500, 9600, 6, "14|53|88|89"); // 13 : 강릉
insertCity($connect, "장사", 7, 471000, 9700, 9900, 8000, 10000, 10500, 6, "13|15|30|53|54"); // 14 : 장사
insertCity($connect, "시상", 7, 525200, 9800, 10000, 10000, 9900, 9600, 7, "14|56|58|91|92"); // 15 : 시상
insertCity($connect, "위례", 7, 492600, 10000, 9300, 8000, 9800, 10300, 8, "32|33|34|60|79"); // 16 : 위례
insertCity($connect, "", 6, 388500, 7500, 8000, 6000, 7800, 8100, 1, "35|77"); // 17 : 계
insertCity($connect, "복양", 6, 418500, 8000, 8300, 6000, 8200, 8000, 2, "1|19|78|81"); // 18 : 복양
insertCity($connect, "진류", 6, 395700, 8200, 8000, 6000, 8000, 8300, 2, "2|18|74|80|81"); // 19 : 진류
insertCity($connect, "여남", 6, 383100, 7700, 8100, 6000, 8400, 7700, 2, "10|11|38"); // 20 : 여남
insertCity($connect, "하비", 6, 427800, 8500, 8300, 6000, 8200, 7800, 2, "12|83"); // 21 : 하비
insertCity($connect, "서량", 6, 387400, 7700, 7900, 6000, 8300, 8000, 3, "40|63|64"); // 22 : 서량
insertCity($connect, "하내", 6, 373600, 7700, 8100, 6000, 8100, 8000, 3, "35|42|65|70"); // 23 : 하내
insertCity($connect, "한중", 6, 402700, 7700, 8400, 6000, 8000, 8500, 4, "25|75|86"); // 24 : 한중
insertCity($connect, "상용", 6, 368700, 7800, 7600, 6000, 7700, 8100, 4, "24|51"); // 25 : 상용
insertCity($connect, "덕양", 6, 380300, 8100, 8400, 6000, 7900, 7700, 4, "5|27|44|45"); // 26 : 덕양
insertCity($connect, "강주", 6, 412600, 7900, 8000, 6000, 8400, 8100, 4, "5|26|45|46|47"); // 27 : 강주
insertCity($connect, "건녕", 6, 376500, 8200, 8000, 6000, 8600, 8100, 5, "46|48|49"); // 28 : 건녕
insertCity($connect, "남해", 6, 380300, 8200, 7600, 6000, 8000, 8100, 5, "50|55|59|67"); // 29 : 남해
insertCity($connect, "계양", 6, 395500, 8300, 8000, 6000, 8100, 7700, 6, "14|54|55"); // 30 : 계양
insertCity($connect, "", 6, 435500, 7700, 8100, 6000, 7700, 7600, 7, "7|57|92|93"); // 31 : 오
insertCity($connect, "평양", 6, 398200, 7800, 8000, 6000, 8300, 7800, 8, "16|61"); // 32 : 평양
insertCity($connect, "사비", 6, 415700, 7700, 7900, 6000, 7800, 8000, 8, "16|34|93"); // 33 : 사비
insertCity($connect, "계림", 6, 391100, 8000, 7400, 6000, 8100, 7800, 8, "16|33|62|93"); // 34 : 계림
insertCity($connect, "진양", 5, 307400, 5600, 5900, 4000, 6400, 5900, 1, "17|23|70"); // 35 : 진양
insertCity($connect, "평원", 5, 307400, 6200, 6500, 4000, 6100, 6300, 1, "9|37|78"); // 36 : 평원
insertCity($connect, "북해", 5, 314600, 5500, 6300, 4000, 6300, 5800, 1, "36|39|79"); // 37 : 북해
insertCity($connect, "", 5, 328600, 6000, 6200, 4000, 6200, 5700, 2, "2|11|12|20|81"); // 38 : 초
insertCity($connect, "", 5, 287700, 6400, 5800, 4000, 5800, 5900, 2, "12|37|81"); // 39 : 패
insertCity($connect, "천수", 5, 298500, 5900, 6400, 4000, 6000, 5800, 3, "22|41|64|84"); // 40 : 천수
insertCity($connect, "안정", 5, 276400, 5700, 5900, 4000, 5700, 6200, 3, "4|40|85"); // 41 : 안정
insertCity($connect, "홍농", 5, 274800, 5700, 6300, 4000, 5800, 6300, 3, "23|72|73"); // 42 : 홍농
insertCity($connect, "하변", 5, 278500, 5800, 6200, 4000, 6000, 5600, 4, "76|85"); // 43 : 하변
insertCity($connect, "자동", 5, 287000, 5700, 5500, 4000, 6000, 5800, 4, "26|75|76|87"); // 44 : 자동
insertCity($connect, "영안", 5, 315300, 6200, 5900, 4000, 5800, 5900, 4, "26|27|88"); // 45 : 영안
insertCity($connect, "귀양", 5, 274600, 5800, 6100, 4000, 6100, 5800, 5, "27|28|47"); // 46 : 귀양
insertCity($connect, "주시", 5, 282800, 6000, 5900, 4000, 5800, 6300, 5, "27|46|48"); // 47 : 주시
insertCity($connect, "운남", 5, 325800, 6200, 6000, 4000, 6400, 6100, 5, "28|47|66"); // 48 : 운남
insertCity($connect, "남영", 5, 285300, 5900, 6200, 4000, 5800, 5700, 5, "28|54|66"); // 49 : 남영
insertCity($connect, "교지", 5, 319500, 5800, 5900, 4000, 5800, 5900, 5, "29|66"); // 50 : 교지
insertCity($connect, "신야", 5, 278600, 6000, 6200, 4000, 5800, 5500, 6, "6|10|25"); // 51 : 신야
insertCity($connect, "강하", 5, 307400, 5500, 5600, 4000, 5700, 6000, 6, "89|91"); // 52 : 강하
insertCity($connect, "무릉", 5, 319600, 5800, 6300, 4000, 6300, 5800, 6, "13|14|54"); // 53 : 무릉
insertCity($connect, "영릉", 5, 284900, 6200, 5800, 4000, 6200, 6200, 6, "14|30|49|53"); // 54 : 영릉
insertCity($connect, "상동", 5, 276700, 5800, 5900, 4000, 6200, 5800, 6, "29|30|58"); // 55 : 상동
insertCity($connect, "여강", 5, 290500, 5600, 5800, 4000, 6000, 5500, 7, "15|82|91|92"); // 56 : 여강
insertCity($connect, "회계", 5, 300500, 6400, 5900, 4000, 6200, 6400, 7, "31|67"); // 57 : 회계
insertCity($connect, "고창", 5, 280200, 5700, 6200, 4000, 5800, 6300, 7, "15|55|67"); // 58 : 고창
insertCity($connect, "", 5, 325600, 6000, 6200, 4000, 5700, 6000, 7, "29|67|94"); // 59 : 대
insertCity($connect, "안평", 5, 293700, 6300, 5900, 4000, 5900, 6300, 8, "16|61|79|90"); // 60 : 안평
insertCity($connect, "졸본", 5, 293900, 5500, 5900, 4000, 6000, 5800, 8, "32|60|68"); // 61 : 졸본
insertCity($connect, "이도", 5, 317400, 5800, 6100, 4000, 5800, 5600, 8, "34|69|93"); // 62 : 이도
insertCity($connect, "", 4, 209500, 4000, 4200, 2000, 4300, 4000, 3, "22|84"); // 63 : 강
insertCity($connect, "", 4, 195700, 4000, 4200, 2000, 4300, 4200, 3, "22|40|85"); // 64 : 저
insertCity($connect, "흉노", 4, 206400, 4000, 4100, 2000, 4000, 3800, 3, "23|84"); // 65 : 흉노
insertCity($connect, "남만", 4, 237800, 4000, 4200, 2000, 4300, 4500, 5, "48|49|50"); // 66 : 남만
insertCity($connect, "산월", 4, 227500, 4000, 3700, 2000, 4300, 3800, 7, "29|57|58|59"); // 67 : 산월
insertCity($connect, "오환", 4, 215300, 4200, 3700, 2000, 4300, 4000, 8, "61|90"); // 68 : 오환
insertCity($connect, "", 4, 206500, 3900, 3700, 2000, 4300, 4100, 8, "62|94"); // 69 : 왜
insertCity($connect, "호관", 3, 88700, 1900, 1800, 2000, 9500, 9600, 1, "1|3|23|35"); // 70 : 호관
insertCity($connect, "호로", 3, 111200, 2200, 2100, 2000, 10300, 9800, 2, "2|3|10"); // 71 : 호로
insertCity($connect, "사곡", 3, 100800, 2100, 1900, 2000, 9900, 10100, 3, "3|42"); // 72 : 사곡
insertCity($connect, "함곡", 3, 108100, 2000, 2200, 2000, 10100, 10200, 3, "4|42"); // 73 : 함곡
insertCity($connect, "사수", 3, 95800, 1700, 1900, 2000, 9500, 9600, 2, "2|3|19|80"); // 74 : 사수
insertCity($connect, "양평", 3, 86800, 1900, 1900, 2000, 9700, 9600, 4, "24|44|86"); // 75 : 양평
insertCity($connect, "가맹", 3, 85500, 1700, 1800, 2000, 9600, 9500, 4, "43|44"); // 76 : 가맹
insertCity($connect, "역경", 2, 98500, 1800, 1900, 2000, 3900, 4100, 1, "8|9|17"); // 77 : 역경
insertCity($connect, "계교", 2, 101200, 2100, 1900, 2000, 4000, 4200, 1, "1|18|36"); // 78 : 계교
insertCity($connect, "동황", 2, 99200, 1900, 2100, 2000, 3800, 4000, 1, "16|37|60"); // 79 : 동황
insertCity($connect, "관도", 2, 112300, 2200, 2000, 2000, 4200, 4300, 2, "1|2|19|74"); // 80 : 관도
insertCity($connect, "정도", 2, 108500, 2100, 2100, 2000, 4100, 3800, 2, "18|19|38|39"); // 81 : 정도
insertCity($connect, "합비", 2, 99800, 2000, 1900, 2000, 3900, 4100, 2, "7|11|56"); // 82 : 합비
insertCity($connect, "광릉", 2, 100100, 2000, 2100, 2000, 4100, 4000, 2, "7|21"); // 83 : 광릉
insertCity($connect, "적도", 2, 95200, 1800, 1700, 2000, 3800, 3700, 3, "40|63|65"); // 84 : 적도
insertCity($connect, "가정", 2, 93100, 1700, 1700, 2000, 3600, 3800, 3, "41|43|64"); // 85 : 가정
insertCity($connect, "기산", 2, 100500, 1900, 1800, 2000, 4100, 4000, 4, "4|24|75"); // 86 : 기산
insertCity($connect, "면죽", 3, 109300, 2200, 2100, 2000, 10800, 9900, 4, "5|44"); // 87 : 면죽
insertCity($connect, "이릉", 2, 96800, 1800, 1900, 2000, 3900, 4100, 6, "13|45"); // 88 : 이릉
insertCity($connect, "장판", 2, 103200, 2100, 2000, 2000, 4000, 3700, 6, "6|13|52|91"); // 89 : 장판
insertCity($connect, "백랑", 2, 105200, 2200, 1900, 2000, 3800, 4200, 8, "8|60|68"); // 90 : 백랑
insertCity($connect, "적벽", 1, 111700, 2300, 2100, 2000, 4200, 4100, 7, "15|52|56|89"); // 91 : 적벽
insertCity($connect, "파양", 1, 103700, 2000, 2200, 2000, 3800, 3800, 7, "15|31|56"); // 92 : 파양
insertCity($connect, "탐라", 1, 113000, 2200, 2100, 2000, 4300, 4100, 8, "31|33|34|62"); // 93 : 탐라
insertCity($connect, "유구", 1, 92100, 1700, 1800, 2000, 3700, 3700, 8, "59|69"); // 94 : 유구
//TODO:debug all and replace
switch($scenario) {
case 0: echo "index.php"; break;
case 1: echo "scenario_1.php"; break;
case 2: echo "scenario_2.php"; break;
case 3: echo "scenario_3.php"; break;
case 4: echo "scenario_4.php"; break;
case 5: echo "scenario_5.php"; break;
case 6: echo "scenario_6.php"; break;
case 7: echo "scenario_7.php"; break;
case 8: echo "scenario_8.php"; break;
case 9: echo "scenario_9.php"; break;
case 10: echo "scenario_10.php"; break;
case 11: echo "scenario_11.php"; break;
case 12: echo "scenario_12.php"; break;
case 20: echo "scenario_20.php"; break;
case 21: echo "scenario_21.php"; break;
case 22: echo "scenario_22.php"; break;
case 23: echo "scenario_23.php"; break;
case 24: echo "scenario_24.php"; break;
case 25: echo "scenario_25.php"; break;
case 26: echo "scenario_26.php"; break;
case 27: echo "scenario_27.php"; break;
case 28: echo "scenario_28.php"; break;
default: echo "install3_ok.php"; break;
}
/*
switch($scenario) {
case 0: echo "<script>location.replace('index.php');</script>"; break;
case 1: echo "<script>location.replace('scenario_1.php');</script>"; break;
case 2: echo "<script>location.replace('scenario_2.php');</script>"; break;
case 3: echo "<script>location.replace('scenario_3.php');</script>"; break;
case 4: echo "<script>location.replace('scenario_4.php');</script>"; break;
case 5: echo "<script>location.replace('scenario_5.php');</script>"; break;
case 6: echo "<script>location.replace('scenario_6.php');</script>"; break;
case 7: echo "<script>location.replace('scenario_7.php');</script>"; break;
case 8: echo "<script>location.replace('scenario_8.php');</script>"; break;
case 9: echo "<script>location.replace('scenario_9.php');</script>"; break;
case 10: echo "<script>location.replace('scenario_10.php');</script>"; break;
case 11: echo "<script>location.replace('scenario_11.php');</script>"; break;
case 12: echo "<script>location.replace('scenario_12.php');</script>"; break;
case 20: echo "<script>location.replace('scenario_20.php');</script>"; break;
case 21: echo "<script>location.replace('scenario_21.php');</script>"; break;
case 22: echo "<script>location.replace('scenario_22.php');</script>"; break;
case 23: echo "<script>location.replace('scenario_23.php');</script>"; break;
case 24: echo "<script>location.replace('scenario_24.php');</script>"; break;
case 25: echo "<script>location.replace('scenario_25.php');</script>"; break;
case 26: echo "<script>location.replace('scenario_26.php');</script>"; break;
case 27: echo "<script>location.replace('scenario_27.php');</script>"; break;
case 28: echo "<script>location.replace('scenario_28.php');</script>"; break;
default: echo "<script>location.replace('install3_ok.php');</script>"; break;
}
*/
function insertCity($connect, $name, $level, $pop2, $agri2, $comm2, $secu2, $def2, $wall2, $region, $path) {
switch($level) {
case 1: $pop = 5000; $agri = 100; $comm = 100; $secu = 100; $def = 500; $wall = 500; break;
case 2: $pop = 5000; $agri = 100; $comm = 100; $secu = 100; $def = 500; $wall = 500; break;
case 3: $pop = 10000; $agri = 100; $comm = 100; $secu = 100; $def = 1000; $wall = 1000; break;
case 4: $pop = 50000; $agri = 1000; $comm = 1000; $secu = 1000; $def = 1000; $wall = 1000; break;
case 5: $pop = 100000; $agri = 1000; $comm = 1000; $secu = 1000; $def = 2000; $wall = 2000; break;
case 6: $pop = 100000; $agri = 1000; $comm = 1000; $secu = 1000; $def = 3000; $wall = 3000; break;
case 7: $pop = 150000; $agri = 1000; $comm = 1000; $secu = 1000; $def = 4000; $wall = 4000; break;
case 8: $pop = 150000; $agri = 1000; $comm = 1000; $secu = 1000; $def = 5000; $wall = 5000; break;
}
@MYDB_query("
insert into city (
name, level, path, pop, pop2, agri, agri2, comm, comm2, secu, secu2, rate,
trade, def, def2, wall, wall2, gen1, gen2, gen3, region
) values (
'$name', '$level', '$path', '$pop', '$pop2', '$agri', '$agri2', '$comm', '$comm2', '$secu', '$secu2', 50,
100, '$def', '$def2', '$wall', '$wall2', 0, 0, 0, '$region'
)",
$connect
) or Error(__LINE__.MYDB_error($connect),"");
}
+98
View File
@@ -0,0 +1,98 @@
<?php
require(__dir__.'/../vendor/autoload.php');
require(__dir__.'/../d_setting/conf.php');
use utilphp\util as util;
/**
* conf.php 파일 생성용 코드
*
* 이 파일만 예외적으로 lib.php, func.php를 참조하지 않고 독자적으로 동작함.
*/
function parseJsonPost(){
// http://thisinterestsme.com/receiving-json-post-data-via-php/
// http://thisinterestsme.com/php-json-error-handling/
if(strcasecmp($_SERVER['REQUEST_METHOD'], 'POST') != 0){
throw new Exception('Request method must be POST!');
}
//Make sure that the content type of the POST request has been set to application/json
$contentType = isset($_SERVER["CONTENT_TYPE"]) ? trim($_SERVER["CONTENT_TYPE"]) : '';
if(strcasecmp($contentType, 'application/json') != 0){
throw new Exception('Content type must be: application/json');
}
//Receive the RAW post data.
$content = trim(file_get_contents("php://input"));
//Attempt to decode the incoming RAW post data from JSON.
$decoded = json_decode($content, true);
$jsonError = json_last_error();
//In some cases, this will happen.
if(is_null($decoded) && $jsonError == JSON_ERROR_NONE){
throw new Exception('Could not decode JSON!');
}
//If an error exists.
if($jsonError != JSON_ERROR_NONE){
$error = 'Could not decode JSON! ';
//Use a switch statement to figure out the exact error.
switch($jsonError){
case JSON_ERROR_DEPTH:
$error .= 'Maximum depth exceeded!';
break;
case JSON_ERROR_STATE_MISMATCH:
$error .= 'Underflow or the modes mismatch!';
break;
case JSON_ERROR_CTRL_CHAR:
$error .= 'Unexpected control character found';
break;
case JSON_ERROR_SYNTAX:
$error .= 'Malformed JSON';
break;
case JSON_ERROR_UTF8:
$error .= 'Malformed UTF-8 characters found!';
break;
default:
$error .= 'Unknown error!';
break;
}
throw new Exception($error);
}
return $decoded;
}
function returnJson($value, $noCache = true, $pretty = false, $die = true){
header('Content-Type: application/json');
if($noCache){
header('Expires: Sun, 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');
}
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([
'result'=>false,
'reason'=>'이미 설정 파일이 존재합니다.'
]);
}
+40
View File
@@ -0,0 +1,40 @@
<?php
include "lib.php";
include "func.php";
if(getUserGrade(true) < 5){
die('관리자 아님');
}
$db = getDB();
// 관리자 테이블 삭제
$db->query("DROP TABLE IF EXISTS game");
// 장수 테이블 삭제
$db->query("DROP TABLE IF EXISTS general");
// 국가 테이블 삭제
$db->query("DROP TABLE IF EXISTS nation");
// 도시 테이블 삭제
$db->query("DROP TABLE IF EXISTS city");
// 부대 테이블 삭제
$db->query("DROP TABLE IF EXISTS troop");
// 외교 테이블 삭제
$db->query("DROP TABLE IF EXISTS diplomacy");
// 토너먼트 테이블 삭제
$db->query("DROP TABLE IF EXISTS tournament");
// 거래 테이블 삭제
$db->query("DROP TABLE IF EXISTS auction");
// 통계 테이블 삭제
$db->query("DROP TABLE IF EXISTS statistic");
// 연감 테이블 삭제
$db->query("DROP TABLE IF EXISTS history");
// 삭제
unlink(__DIR__."/d_setting/conf.php");
delInDir("logs");
delInDir("data/session");
@unlink("data/connected.php");
+40
View File
@@ -0,0 +1,40 @@
<?php
include "lib.php";
include "func.php";
//////////////////////////국가색////////////////////////////////////////////////
//"#FF0000",빨강 "#800000",갈색 "#A0522D",연갈색 "#FF6347",토마토 "#FFA500",오렌지
//"#FFDAB9",살색 "#FFD700",금색 "#FFFF00",노랑색 "#7CFC00",잔디색 "#00FF00",밝은녹색
//"#808000",카키 "#008000",녹색 "#2E8B57",청록색 "#008080",진청록 "#20B2AA",연청록
//"#6495ED",연보 "#7FFFD4",상아 "#AFEEEE",연상아 "#87CEEB",진상아 "#00FFFF",사이안
//"#00BFFF",하늘 "#0000FF",파랑 "#000080",바다색 "#483D8B",탁바다 "#7B68EE",연바다
//"#BA55D3",핑크 "#800080",보라 "#FF00FF",마젠타 "#FFC0CB",연핑크 "#F5F5DC",베이지
//"#E0FFFF",샤얀 "#FFFFFF",하양 "#A9A9A9",연회색
//////////////////////////국가종류//////////////////////////////////////////////
// 7 황제 6 왕 5 공 4 주목 3 주자사 2 군벌 1 호족 0 방랑군
////////////////////////////////////////////////////////////////////////
//////////////////////////국가종류//////////////////////////////////////////////
//도적 오두미도 태평도 도가 묵가 덕가 병가 유가 법가
////////////////////////////////////////////////////////////////////////
//////////////////////////장수성격//////////////////////////////////////////////
//은둔 안전 유지 재간 출세 할거 정복 패권 의협 대의 왕좌
////////////////////////////////////////////////////////////////////////
//////////////////////////도시목록//////////////////////////////////////////////
// 업 허창 낙양 장안 성도 양양 건업 북평 남피 완 수춘 서주 강릉 장사 시상 위례
// 계 복양 진류 여남 하비 서량 하내 한중 상용 덕양 강주 건녕 남해 계양 오 평양
// 사비 계림 진양 평원 북해 초 패 천수 안정 홍농 하변 자동 영안 귀양 주시 운남
// 남영 교지 신야 강하 무릉 영릉 상동 여강 회계 고창 대 양평 졸본 이도 강 저
// 흉노 남만 산월 오환 왜 호관 호로 사곡 함곡 사수 양평 가맹 역경 계교 동황 관도
// 정도 합비 광릉 적도 가정 기산 면죽 이릉 장판 백랑 적벽 파양 탐라 유구
////////////////////////////////////////////////////////////////////////
//////////////////////////관직정보//////////////////////////////////////
// 7 "황제"
// 6 "왕"
// 5 "공"
// 4 "주목"
// 3 "주자사"
// 2 "군벌"
// 1 "호족"
// 0 "방랑군"
////////////////////////////////////////////////////////////////////////
+49
View File
@@ -0,0 +1,49 @@
<?php
include "lib.php";
include "func.php";
include "schema.php";
if(getUserGrade(true) < 5){
die('관리자 아님');
}
// 파일로 DB 정보 저장
$file=@fopen("d_setting/conf.php","w") or Error("conf.php 파일 생성 실패<br><br>디렉토리의 퍼미션을 707로 주십시요","");
//@fwrite($file,"<?php /*\n$hostname\n$user_id\n$password\n$dbname\n */\n") or Error("conf.php 파일 생성 실패<br><br>디렉토리의 퍼미션을 707로 주십시요","");
@fclose($file);
@mkdir("data",0707);
@chmod("data",0707);
//@chmod("d_setting/conf.php",0707);
$temp=MYDB_fetch_array(MYDB_query("select count(*) from general where level = '1'", $connect));
MYDB_close($connect);
//echo "<script>location.replace('install2.php');</script>";
echo 'install2.php';//TODO:debug all and replace
// 관리자 테이블 생성
$db->query($game_schema);
// 장수 테이블 생성
$db->query($general_schema);
// 국가 테이블 생성
$db->query($nation_schema);
// 도시 테이블 생성
$db->query($city_schema);
// 부대 테이블 생성
$db->query($troop_schema);
// 토큰 테이블 생성
$db->query($token_schema);
// 외교 테이블 생성
$db->query($diplomacy_schema);
// 전당 테이블 생성
$db->query($hall_schema);
// 토너먼트 테이블 생성
$db->query($tournament_schema);
// 거래 테이블 생성
$db->query($auction_schema);
// 통계 테이블 생성
$db->query($statistic_schema);
// 연감 테이블 생성
$db->query($history_schema);
+8 -5
View File
@@ -5,7 +5,11 @@ include "func.php";
use utilphp\util as util;
if(file_exists("d_setting/set.php")) error("이미 set.php가 생성되어 있습니다.<br><br>재설치하려면 해당 파일을 지우세요");
if(getUserGrade(true) < 5){
die('관리자 아님');
}
if(file_exists("d_setting/conf.php")) error("이미 conf.php가 생성되어 있습니다.<br><br>재설치하려면 해당 파일을 지우세요");
$hostname = util::array_get($_POST['hostname'], '');
@@ -95,12 +99,11 @@ if(!isTable($connect, "statistic",$dbname)) @MYDB_query($statistic_schema, $conn
if(!isTable($connect, "history",$dbname)) @MYDB_query($history_schema, $connect) or Error("create history ".MYDB_error($connect),"");
// 파일로 DB 정보 저장
$file=@fopen("d_setting/set.php","w") or Error("set.php 파일 생성 실패<br><br>디렉토리의 퍼미션을 707로 주십시요","");
@fwrite($file,"<?php /*\n$hostname\n$user_id\n$password\n$dbname\n */\n") or Error("set.php 파일 생성 실패<br><br>디렉토리의 퍼미션을 707로 주십시요","");
@fclose($file);
//TODO:Template로 기록
@mkdir("data",0707);
@chmod("data",0707);
@chmod("d_setting/set.php",0707);
@chmod("d_setting/conf.php",0707);
$temp=MYDB_fetch_array(MYDB_query("select count(*) from general where level = '1'", $connect));
+401
View File
@@ -0,0 +1,401 @@
<?php
include "lib.php";
include "func.php";
use utilphp\util as util;
$turnterm = util::array_get($_POST['turnterm'],'0');
$sync = util::array_get($_POST['sync'],'0');
$scenario = util::array_get($_POST['scenario'],'0');
$fiction = util::array_get($_POST['fiction'],'0');
$extend = util::array_get($_POST['extend'],'0');
$npcmode = util::array_get($_POST['npcmode'],'0');
$img = util::array_get($_POST['img'],'0');
if(getUserGrade(true) < 5){
die('관리자 아님');
}
$connect=dbConn();
switch($scenario) {
case 0: $startyear = 180; break;
case 1: $startyear = 184 - 3; break;
case 2: $startyear = 190 - 3; break;
case 3: $startyear = 194 - 3; break;
case 4: $startyear = 196 - 3; break;
case 5: $startyear = 200 - 3; break;
case 6: $startyear = 202 - 3; break;
case 7: $startyear = 207 - 3; break;
case 8: $startyear = 213 - 3; break;
case 9: $startyear = 219 - 3; break;
case 10: $startyear = 225 - 3; break;
case 11: $startyear = 228 - 3; break;
case 12: $startyear = 191 - 3; break;
case 20: $startyear = 180; break;
case 21: $startyear = 180; break;
case 22: $startyear = 179; break;
case 23: $startyear = 180; break;
case 24: $startyear = 180; break;
case 25: $startyear = 180; break;
case 26: $startyear = 180; break;
case 27: $startyear = 180; break;
case 28: $startyear = 180; break;
default: $startyear = 180; break;
}
// 관리자 등록
$turntime = date('Y-m-d H:i:s');
$lastconnect = $turntime;
$turntime = addTurn($turntime, $turnterm);
$turntime = cutTurn($turntime, $turnterm);
$picture = 'pic_1.jpg';
if($img < 1) { $picture = 'default.jpg'; };
@MYDB_query("
insert into general (
owner, connect, name, picture, nation, city, troop, makelimit,
leader, power, intel, experience, dedication, gold, rice, crew, train, atmos,
weap, book, level, turntime, killturn, lastconnect
) values (
'1', '0', '운영자', '$picture', '0', '3', '0', '0',
'50', '50', '50', '0', '0', '10000', '10000', '0', '0', '0',
'0', '0', '0', '$turntime', '80', '$lastconnect'
)",
$connect
) or Error(__LINE__.MYDB_error($connect),"");
$picture = 'pic_2.jpg';
if($img < 1) { $picture = 'default.jpg'; };
//부운영자는 비밀번호를 지정하지 않아 로그인할수 없도록 처리한다.
@MYDB_query("
insert into general (
owner, connect, name, picture, nation, city, troop, makelimit,
leader, power, intel, experience, dedication, gold, rice, crew, train, atmos,
weap, book, level, turntime, killturn, lastconnect
) values (
'2', '0', '부운영자', '$picture', '0', '3', '0', '0',
'50', '50', '50', '0', '0', '10000', '10000', '0', '0', '0',
'0', '0', '0', '$turntime', '80', '$lastconnect'
)",
$connect
) or Error(__LINE__.MYDB_error($connect),"");
// 게임정보 입력
$turntime = date('Y-m-d H:i:s');
$time = substr($turntime, 11, 2);
if($sync == 0) {
// 항상 정각으로 설정
$starttime = cutTurn($turntime, $turnterm);
} else {
// 항상 13시로 설정
$starttime = CutDay($turntime);
}
switch($turnterm) {
case 0: $killturn = 40; break;
case 1: $killturn = 80; break;
case 2: $killturn = 160; break;
case 3: $killturn = 240; break;
case 4: $killturn = 480; break;
case 5: $killturn = 960; break;
case 6: $killturn =2400; break;
case 7: $killturn =4800; break;
}
if($npcmode == 1) { $killturn = floor($killturn / 3); }
//락 생성
@MYDB_query("insert into plock ( plock ) values ( 0 )", $connect) or Error(__LINE__.MYDB_error($connect),"");
//게임 정보 생성
@MYDB_query("
insert into game (
year, month, msg,
maxgeneral, normgeneral, maxnation, conlimit, gold_rate, rice_rate,
turntime, starttime, turnterm, killturn,
genius, startyear,scenario,img,npcmode,extend,fiction,
att0, def0, spd0, avd0, cst0, ric0,
att1, def1, spd1, avd1, cst1, ric1,
att2, def2, spd2, avd2, cst2, ric2,
att3, def3, spd3, avd3, cst3, ric3,
att4, def4, spd4, avd4, cst4, ric4,
att5, def5, spd5, avd5, cst5, ric5,
att10, def10, spd10, avd10, cst10, ric10,
att11, def11, spd11, avd11, cst11, ric11,
att12, def12, spd12, avd12, cst12, ric12,
att13, def13, spd13, avd13, cst13, ric13,
att14, def14, spd14, avd14, cst14, ric14,
att20, def20, spd20, avd20, cst20, ric20,
att21, def21, spd21, avd21, cst21, ric21,
att22, def22, spd22, avd22, cst22, ric22,
att23, def23, spd23, avd23, cst23, ric23,
att24, def24, spd24, avd24, cst24, ric24,
att25, def25, spd25, avd25, cst25, ric25,
att26, def26, spd26, avd26, cst26, ric26,
att27, def27, spd27, avd27, cst27, ric27,
att30, def30, spd30, avd30, cst30, ric30,
att31, def31, spd31, avd31, cst31, ric31,
att32, def32, spd32, avd32, cst32, ric32,
att33, def33, spd33, avd33, cst33, ric33,
att34, def34, spd34, avd34, cst34, ric34,
att35, def35, spd35, avd35, cst35, ric35,
att36, def36, spd36, avd36, cst36, ric36,
att37, def37, spd37, avd37, cst37, ric37,
att38, def38, spd38, avd38, cst38, ric38,
att40, def40, spd40, avd40, cst40, ric40,
att41, def41, spd41, avd41, cst41, ric41,
att42, def42, spd42, avd42, cst42, ric42,
att43, def43, spd43, avd43, cst43, ric43
) values (
'$startyear', 1, '삼모전의 매력은 IRC에서의 커뮤니티입니다. 흠냐 채널을 찾아주세요^^ <font color=cyan>웹 IRC</font> : <a target=_blank href=http://barosl.com/webirc/흠냐>http://barosl.com/webirc/흠냐</a><br><font color=orange size=6>폭력적/선정적인 전콘/전메는 블럭/삭제 대상이 될 수 있습니다.</font>',
500, 300, 55, 120, 100, 100,
'$turntime', '$starttime', '$turnterm', '$killturn',
5, '$startyear', '$scenario', '$img', '$npcmode', '$extend', '$fiction',
100, 150, 7, 10, 9, 9, -- 보병
100, 200, 7, 10, 10, 11, -- 청주병(중원)
150, 150, 7, 10, 11, 10, -- 수병(오월)
100, 150, 7, 20, 10, 10, -- 자객병(저)
150, 200, 7, 10, 12, 12, -- 근위병(낙양)
100, 250, 7, 5, 13, 10, -- 등갑병(남중)
100, 100, 7, 20, 10, 10, -- 궁병
100, 100, 8, 30, 11, 12, -- 궁기병(동이)
150, 100, 8, 20, 12, 11, -- 연노병(서촉)
150, 150, 7, 20, 13, 13, -- 강궁병(양양)
200, 100, 7, 20, 13, 13, -- 석궁병(건업)
150, 100, 7, 5, 11, 11, -- 기병
200, 100, 7, 5, 12, 13, -- 백마병(하북)
150, 150, 7, 5, 13, 12, -- 중장기병(서북)
200, 100, 8, 5, 13, 11, -- 돌격기병(흉노)
100, 200, 7, 5, 11, 13, -- 철기병(강)
150, 100, 8, 15, 12, 12, -- 수렵기병(산월)
250, 200, 6, 0, 16, 16, -- 맹수병(남만)
200, 150, 7, 5, 14, 14, -- 호표기병(허창)
80, 80, 7, 5, 9, 9, -- 귀병
80, 80, 7, 20, 10, 10, -- 신귀병(초)
80, 130, 7, 5, 9, 11, -- 백귀병(오환)
130, 80, 7, 5, 11, 9, -- 흑귀병(왜)
130, 130, 7, 0, 12, 12, -- 악귀병(장안)
60, 60, 7, 10, 8, 8, -- 남귀병
110, 110, 7, 0, 13, 10, -- 황귀병(낙양)
80, 130, 7, 15, 11, 12, -- 천귀병(성도)
130, 80, 7, 15, 12, 11, -- 마귀병(업)
100, 100, 6, 0, 15, 5, -- 정란
150, 100, 6, 0, 20, 5, -- 충차
200, 100, 6, 0, 25, 5, -- 벽력거(업)
50, 200, 5, 0, 30, 5 -- 목우(성도)
)",
$connect
) or Error(__LINE__.MYDB_error($connect),"");
// 도시정보 입력
// 이름 규모 인구 농업 상업 치안 수비 성벽 지역 경로
insertCity( "", 8, 620500, 12500, 11300, 10000, 11700, 12200, 1, "9|18|70|78|80"); // 1 : 업
insertCity("허창", 8, 587600, 12100, 12400, 10000, 11700, 12500, 2, "10|19|38|71|74|80"); // 2 : 허창
insertCity("낙양", 8, 835700, 11700, 12000, 10000, 12100, 12400, 2, "70|71|72|74"); // 3 : 낙양
insertCity("장안", 8, 592300, 11600, 12300, 10000, 12000, 11800, 3, "41|73|86"); // 4 : 장안
insertCity("성도", 8, 652500, 12300, 12500, 10000, 12500, 12300, 4, "26|27|87"); // 5 : 성도
insertCity("양양", 8, 583700, 12000, 12600, 10000, 11500, 11700, 6, "51|89"); // 6 : 양양
insertCity("건업", 8, 638600, 11600, 12300, 10000, 11500, 11900, 7, "31|82|83"); // 7 : 건업
insertCity("북평", 7, 486200, 10200, 9500, 8000, 10300, 9900, 1, "77|90"); // 8 : 북평
insertCity("남피", 7, 503200, 9900, 10100, 8000, 10100, 10500, 1, "1|36|77"); // 9 : 남피
insertCity( "", 7, 472400, 10300, 10000, 8000, 10100, 9900, 2, "2|20|51|71"); // 10 : 완
insertCity("수춘", 7, 514300, 9900, 9600, 8000, 9900, 9500, 2, "12|20|38|82"); // 11 : 수춘
insertCity("서주", 7, 485300, 10100, 9800, 8000, 10200, 9700, 2, "11|21|38|39"); // 12 : 서주
insertCity("강릉", 7, 485000, 10500, 9600, 8000, 9500, 9600, 6, "14|53|88|89"); // 13 : 강릉
insertCity("장사", 7, 471000, 9700, 9900, 8000, 10000, 10500, 6, "13|15|30|53|54"); // 14 : 장사
insertCity("시상", 7, 525200, 9800, 10000, 10000, 9900, 9600, 7, "14|56|58|91|92"); // 15 : 시상
insertCity("위례", 7, 492600, 10000, 9300, 8000, 9800, 10300, 8, "32|33|34|60|79"); // 16 : 위례
insertCity( "", 6, 388500, 7500, 8000, 6000, 7800, 8100, 1, "35|77"); // 17 : 계
insertCity("복양", 6, 418500, 8000, 8300, 6000, 8200, 8000, 2, "1|19|78|81"); // 18 : 복양
insertCity("진류", 6, 395700, 8200, 8000, 6000, 8000, 8300, 2, "2|18|74|80|81"); // 19 : 진류
insertCity("여남", 6, 383100, 7700, 8100, 6000, 8400, 7700, 2, "10|11|38"); // 20 : 여남
insertCity("하비", 6, 427800, 8500, 8300, 6000, 8200, 7800, 2, "12|83"); // 21 : 하비
insertCity("서량", 6, 387400, 7700, 7900, 6000, 8300, 8000, 3, "40|63|64"); // 22 : 서량
insertCity("하내", 6, 373600, 7700, 8100, 6000, 8100, 8000, 3, "35|42|65|70"); // 23 : 하내
insertCity("한중", 6, 402700, 7700, 8400, 6000, 8000, 8500, 4, "25|75|86"); // 24 : 한중
insertCity("상용", 6, 368700, 7800, 7600, 6000, 7700, 8100, 4, "24|51"); // 25 : 상용
insertCity("덕양", 6, 380300, 8100, 8400, 6000, 7900, 7700, 4, "5|27|44|45"); // 26 : 덕양
insertCity("강주", 6, 412600, 7900, 8000, 6000, 8400, 8100, 4, "5|26|45|46|47"); // 27 : 강주
insertCity("건녕", 6, 376500, 8200, 8000, 6000, 8600, 8100, 5, "46|48|49"); // 28 : 건녕
insertCity("남해", 6, 380300, 8200, 7600, 6000, 8000, 8100, 5, "50|55|59|67"); // 29 : 남해
insertCity("계양", 6, 395500, 8300, 8000, 6000, 8100, 7700, 6, "14|54|55"); // 30 : 계양
insertCity( "", 6, 435500, 7700, 8100, 6000, 7700, 7600, 7, "7|57|92|93"); // 31 : 오
insertCity("평양", 6, 398200, 7800, 8000, 6000, 8300, 7800, 8, "16|61"); // 32 : 평양
insertCity("사비", 6, 415700, 7700, 7900, 6000, 7800, 8000, 8, "16|34|93"); // 33 : 사비
insertCity("계림", 6, 391100, 8000, 7400, 6000, 8100, 7800, 8, "16|33|62|93"); // 34 : 계림
insertCity("진양", 5, 307400, 5600, 5900, 4000, 6400, 5900, 1, "17|23|70"); // 35 : 진양
insertCity("평원", 5, 307400, 6200, 6500, 4000, 6100, 6300, 1, "9|37|78"); // 36 : 평원
insertCity("북해", 5, 314600, 5500, 6300, 4000, 6300, 5800, 1, "36|39|79"); // 37 : 북해
insertCity( "", 5, 328600, 6000, 6200, 4000, 6200, 5700, 2, "2|11|12|20|81"); // 38 : 초
insertCity( "", 5, 287700, 6400, 5800, 4000, 5800, 5900, 2, "12|37|81"); // 39 : 패
insertCity("천수", 5, 298500, 5900, 6400, 4000, 6000, 5800, 3, "22|41|64|84"); // 40 : 천수
insertCity("안정", 5, 276400, 5700, 5900, 4000, 5700, 6200, 3, "4|40|85"); // 41 : 안정
insertCity("홍농", 5, 274800, 5700, 6300, 4000, 5800, 6300, 3, "23|72|73"); // 42 : 홍농
insertCity("하변", 5, 278500, 5800, 6200, 4000, 6000, 5600, 4, "76|85"); // 43 : 하변
insertCity("자동", 5, 287000, 5700, 5500, 4000, 6000, 5800, 4, "26|75|76|87"); // 44 : 자동
insertCity("영안", 5, 315300, 6200, 5900, 4000, 5800, 5900, 4, "26|27|88"); // 45 : 영안
insertCity("귀양", 5, 274600, 5800, 6100, 4000, 6100, 5800, 5, "27|28|47"); // 46 : 귀양
insertCity("주시", 5, 282800, 6000, 5900, 4000, 5800, 6300, 5, "27|46|48"); // 47 : 주시
insertCity("운남", 5, 325800, 6200, 6000, 4000, 6400, 6100, 5, "28|47|66"); // 48 : 운남
insertCity("남영", 5, 285300, 5900, 6200, 4000, 5800, 5700, 5, "28|54|66"); // 49 : 남영
insertCity("교지", 5, 319500, 5800, 5900, 4000, 5800, 5900, 5, "29|66"); // 50 : 교지
insertCity("신야", 5, 278600, 6000, 6200, 4000, 5800, 5500, 6, "6|10|25"); // 51 : 신야
insertCity("강하", 5, 307400, 5500, 5600, 4000, 5700, 6000, 6, "89|91"); // 52 : 강하
insertCity("무릉", 5, 319600, 5800, 6300, 4000, 6300, 5800, 6, "13|14|54"); // 53 : 무릉
insertCity("영릉", 5, 284900, 6200, 5800, 4000, 6200, 6200, 6, "14|30|49|53"); // 54 : 영릉
insertCity("상동", 5, 276700, 5800, 5900, 4000, 6200, 5800, 6, "29|30|58"); // 55 : 상동
insertCity("여강", 5, 290500, 5600, 5800, 4000, 6000, 5500, 7, "15|82|91|92"); // 56 : 여강
insertCity("회계", 5, 300500, 6400, 5900, 4000, 6200, 6400, 7, "31|67"); // 57 : 회계
insertCity("고창", 5, 280200, 5700, 6200, 4000, 5800, 6300, 7, "15|55|67"); // 58 : 고창
insertCity( "", 5, 325600, 6000, 6200, 4000, 5700, 6000, 7, "29|67|94"); // 59 : 대
insertCity("안평", 5, 293700, 6300, 5900, 4000, 5900, 6300, 8, "16|61|79|90"); // 60 : 안평
insertCity("졸본", 5, 293900, 5500, 5900, 4000, 6000, 5800, 8, "32|60|68"); // 61 : 졸본
insertCity("이도", 5, 317400, 5800, 6100, 4000, 5800, 5600, 8, "34|69|93"); // 62 : 이도
insertCity( "", 4, 209500, 4000, 4200, 2000, 4300, 4000, 3, "22|84"); // 63 : 강
insertCity( "", 4, 195700, 4000, 4200, 2000, 4300, 4200, 3, "22|40|85"); // 64 : 저
insertCity("흉노", 4, 206400, 4000, 4100, 2000, 4000, 3800, 3, "23|84"); // 65 : 흉노
insertCity("남만", 4, 237800, 4000, 4200, 2000, 4300, 4500, 5, "48|49|50"); // 66 : 남만
insertCity("산월", 4, 227500, 4000, 3700, 2000, 4300, 3800, 7, "29|57|58|59"); // 67 : 산월
insertCity("오환", 4, 215300, 4200, 3700, 2000, 4300, 4000, 8, "61|90"); // 68 : 오환
insertCity( "", 4, 206500, 3900, 3700, 2000, 4300, 4100, 8, "62|94"); // 69 : 왜
insertCity("호관", 3, 88700, 1900, 1800, 2000, 9500, 9600, 1, "1|3|23|35"); // 70 : 호관
insertCity("호로", 3, 111200, 2200, 2100, 2000, 10300, 9800, 2, "2|3|10"); // 71 : 호로
insertCity("사곡", 3, 100800, 2100, 1900, 2000, 9900, 10100, 3, "3|42"); // 72 : 사곡
insertCity("함곡", 3, 108100, 2000, 2200, 2000, 10100, 10200, 3, "4|42"); // 73 : 함곡
insertCity("사수", 3, 95800, 1700, 1900, 2000, 9500, 9600, 2, "2|3|19|80"); // 74 : 사수
insertCity("양평", 3, 86800, 1900, 1900, 2000, 9700, 9600, 4, "24|44|86"); // 75 : 양평
insertCity("가맹", 3, 85500, 1700, 1800, 2000, 9600, 9500, 4, "43|44"); // 76 : 가맹
insertCity("역경", 2, 98500, 1800, 1900, 2000, 3900, 4100, 1, "8|9|17"); // 77 : 역경
insertCity("계교", 2, 101200, 2100, 1900, 2000, 4000, 4200, 1, "1|18|36"); // 78 : 계교
insertCity("동황", 2, 99200, 1900, 2100, 2000, 3800, 4000, 1, "16|37|60"); // 79 : 동황
insertCity("관도", 2, 112300, 2200, 2000, 2000, 4200, 4300, 2, "1|2|19|74"); // 80 : 관도
insertCity("정도", 2, 108500, 2100, 2100, 2000, 4100, 3800, 2, "18|19|38|39"); // 81 : 정도
insertCity("합비", 2, 99800, 2000, 1900, 2000, 3900, 4100, 2, "7|11|56"); // 82 : 합비
insertCity("광릉", 2, 100100, 2000, 2100, 2000, 4100, 4000, 2, "7|21"); // 83 : 광릉
insertCity("적도", 2, 95200, 1800, 1700, 2000, 3800, 3700, 3, "40|63|65"); // 84 : 적도
insertCity("가정", 2, 93100, 1700, 1700, 2000, 3600, 3800, 3, "41|43|64"); // 85 : 가정
insertCity("기산", 2, 100500, 1900, 1800, 2000, 4100, 4000, 4, "4|24|75"); // 86 : 기산
insertCity("면죽", 3, 109300, 2200, 2100, 2000, 10800, 9900, 4, "5|44"); // 87 : 면죽
insertCity("이릉", 2, 96800, 1800, 1900, 2000, 3900, 4100, 6, "13|45"); // 88 : 이릉
insertCity("장판", 2, 103200, 2100, 2000, 2000, 4000, 3700, 6, "6|13|52|91"); // 89 : 장판
insertCity("백랑", 2, 105200, 2200, 1900, 2000, 3800, 4200, 8, "8|60|68"); // 90 : 백랑
insertCity("적벽", 1, 111700, 2300, 2100, 2000, 4200, 4100, 7, "15|52|56|89"); // 91 : 적벽
insertCity("파양", 1, 103700, 2000, 2200, 2000, 3800, 3800, 7, "15|31|56"); // 92 : 파양
insertCity("탐라", 1, 113000, 2200, 2100, 2000, 4300, 4100, 8, "31|33|34|62"); // 93 : 탐라
insertCity("유구", 1, 92100, 1700, 1800, 2000, 3700, 3700, 8, "59|69"); // 94 : 유구
//TODO:debug all and replace
switch($scenario) {
case 0: echo "index.php"; break;
case 1: echo "scenario_1.php"; break;
case 2: echo "scenario_2.php"; break;
case 3: echo "scenario_3.php"; break;
case 4: echo "scenario_4.php"; break;
case 5: echo "scenario_5.php"; break;
case 6: echo "scenario_6.php"; break;
case 7: echo "scenario_7.php"; break;
case 8: echo "scenario_8.php"; break;
case 9: echo "scenario_9.php"; break;
case 10: echo "scenario_10.php"; break;
case 11: echo "scenario_11.php"; break;
case 12: echo "scenario_12.php"; break;
case 20: echo "scenario_20.php"; break;
case 21: echo "scenario_21.php"; break;
case 22: echo "scenario_22.php"; break;
case 23: echo "scenario_23.php"; break;
case 24: echo "scenario_24.php"; break;
case 25: echo "scenario_25.php"; break;
case 26: echo "scenario_26.php"; break;
case 27: echo "scenario_27.php"; break;
case 28: echo "scenario_28.php"; break;
default: echo "install3_ok.php"; break;
}
/*
switch($scenario) {
case 0: echo "<script>location.replace('index.php');</script>"; break;
case 1: echo "<script>location.replace('scenario_1.php');</script>"; break;
case 2: echo "<script>location.replace('scenario_2.php');</script>"; break;
case 3: echo "<script>location.replace('scenario_3.php');</script>"; break;
case 4: echo "<script>location.replace('scenario_4.php');</script>"; break;
case 5: echo "<script>location.replace('scenario_5.php');</script>"; break;
case 6: echo "<script>location.replace('scenario_6.php');</script>"; break;
case 7: echo "<script>location.replace('scenario_7.php');</script>"; break;
case 8: echo "<script>location.replace('scenario_8.php');</script>"; break;
case 9: echo "<script>location.replace('scenario_9.php');</script>"; break;
case 10: echo "<script>location.replace('scenario_10.php');</script>"; break;
case 11: echo "<script>location.replace('scenario_11.php');</script>"; break;
case 12: echo "<script>location.replace('scenario_12.php');</script>"; break;
case 20: echo "<script>location.replace('scenario_20.php');</script>"; break;
case 21: echo "<script>location.replace('scenario_21.php');</script>"; break;
case 22: echo "<script>location.replace('scenario_22.php');</script>"; break;
case 23: echo "<script>location.replace('scenario_23.php');</script>"; break;
case 24: echo "<script>location.replace('scenario_24.php');</script>"; break;
case 25: echo "<script>location.replace('scenario_25.php');</script>"; break;
case 26: echo "<script>location.replace('scenario_26.php');</script>"; break;
case 27: echo "<script>location.replace('scenario_27.php');</script>"; break;
case 28: echo "<script>location.replace('scenario_28.php');</script>"; break;
default: echo "<script>location.replace('install3_ok.php');</script>"; break;
}
*/
function insertCity($name, $level, $pop2, $agri2, $comm2, $secu2, $def2, $wall2, $region, $path) {
switch($level) {
case 1: $pop = 5000; $agri = 100; $comm = 100; $secu = 100; $def = 500; $wall = 500; break;
case 2: $pop = 5000; $agri = 100; $comm = 100; $secu = 100; $def = 500; $wall = 500; break;
case 3: $pop = 10000; $agri = 100; $comm = 100; $secu = 100; $def = 1000; $wall = 1000; break;
case 4: $pop = 50000; $agri = 1000; $comm = 1000; $secu = 1000; $def = 1000; $wall = 1000; break;
case 5: $pop = 100000; $agri = 1000; $comm = 1000; $secu = 1000; $def = 2000; $wall = 2000; break;
case 6: $pop = 100000; $agri = 1000; $comm = 1000; $secu = 1000; $def = 3000; $wall = 3000; break;
case 7: $pop = 150000; $agri = 1000; $comm = 1000; $secu = 1000; $def = 4000; $wall = 4000; break;
case 8: $pop = 150000; $agri = 1000; $comm = 1000; $secu = 1000; $def = 5000; $wall = 5000; break;
}
getDB()->insert('city',[
'name'=>$name,
'level'=>$level,
'path'=>$path,
'pop'=>$pop,
'pop2'=>$pop2,
'agri'=>$agri,
'agri2'=>$agri2,
'comm'=>$comm,
'comm2'=>$comm2,
'secu'=>$secu,
'secu2'=>$secu2,
'rate'=>50,
'trade'=>100,
'def'=>$def,
'def2'=>$def2,
'wall'=>$wall,
'wall2'=>$wall2,
'gen1'=>0,
'gen2'=>0,
'gen3'=>0,
'region'=>$region
]);
}
@@ -2,6 +2,10 @@
include "lib.php";
include "func.php";
if(getUserGrade(true) < 5){
die('관리자 아님');
}
$connect=dbConn();
LogHistory(1);
+2 -2
View File
@@ -54,7 +54,7 @@ if(getBlockLevel() == 1 || getBlockLevel() == 3) {
$conlimit = $db->queryFirstField('select conlimit from game where no=1');
$me = $db->queryFirstRow('select `no`,`name`,`nation`,`level`,`userlevel`,`con`,`picture`,`imgsvr` from `general` where `owner` = %i', getUserID());
$me = $db->queryFirstRow('select `no`,`name`,`nation`,`level`,`con`,`picture`,`imgsvr` from `general` where `owner` = %i', getUserID());
if(!$me){
resetSessionGeneralValues();
@@ -65,7 +65,7 @@ if(!$me){
]);
}
$con = checkLimit($me['userlevel'], $me['con'], $conlimit);
$con = checkLimit($me['con'], $conlimit);
if($con >= 2) {
returnJson([
'result' => false,
+94
View File
@@ -0,0 +1,94 @@
<?php
include "lib.php";
include "func.php";
if(!getUserID()){
jsonReturn([
'game'=>'x',
'me'=>'no'
]);
}
//FIXME:Name이 없는 동명의 함수가 있음
function getScenarioName($scenario) {
switch($scenario) {
case 0: $str = "공백지모드"; break;
case 1: $str = "역사모드1 : 184년 황건적의 난"; break;
case 2: $str = "역사모드2 : 190년 반동탁연합"; break;
case 3: $str = "역사모드3 : 194년 군웅할거"; break;
case 4: $str = "역사모드4 : 196년 황제는 허도로"; break;
case 5: $str = "역사모드5 : 200년 관도대전"; break;
case 6: $str = "역사모드6 : 202년 원가의 분열"; break;
case 7: $str = "역사모드7 : 207년 적벽대전"; break;
case 8: $str = "역사모드8 : 213년 익주 공방전"; break;
case 9: $str = "역사모드9 : 219년 삼국정립"; break;
case 10: $str = "역사모드10 : 225년 칠종칠금"; break;
case 11: $str = "역사모드11 : 228년 출사표"; break;
case 12: $str = "IF모드1 : 191년 백마장군의 위세"; break;
case 20: $str = "가상모드1 : 180년 영웅 난무"; break;
case 21: $str = "가상모드1 : 180년 영웅 집결"; break;
case 22: $str = "가상모드2 : 179년 훼신 집결"; break;
case 23: $str = "가상모드3 : 180년 영웅 시대"; break;
case 24: $str = "가상모드4 : 180년 결사항전"; break;
case 25: $str = "가상모드5 : 180년 영웅독존"; break;
case 26: $str = "가상모드6 : 180년 무풍지대"; break;
case 27: $str = "가상모드7 : 180년 가요대잔치"; break;
case 28: $str = "가상모드8 : 180년 확산성 밀리언 아서"; break;
default: $str = "시나리오?"; break;
}
return $str;
}
function getTurnTerm($term) {
switch($term) {
case 0: $str = "120분 턴 서버"; break;
case 1: $str = "60분 턴 서버"; break;
case 2: $str = "30분 턴 서버"; break;
case 3: $str = "20분 턴 서버"; break;
case 4: $str = "10분 턴 서버"; break;
case 5: $str = "5분 턴 서버"; break;
case 6: $str = "2분 턴 서버"; break;
case 7: $str = "1분 턴 서버"; break;
}
return $str;
}
$db = getDB();
$game = $db->queryFirstRow('SELECT isUnited, npcMode, year, month, scenario, maxgeneral as maxUserCnt, turnTerm from game where `no`=1');
$nationCnt = $db->queryFirstField('SELECT count(`nation`) from nation where `level` > 0');
$genCnt = $db->queryFirstField('SELECT count(`no`) from general where `npc` < 2');
$npcCnt = $db->queryFirstField('SELECT count(`no`) from general where `npc` >= 2');
$game['turnTerm'] = getTurnTerm($game['turnTerm']);
$game['scenario'] = getScenarioName($game['scenario']);
$game['userCnt'] = $genCnt;
$game['npcCnt'] = $npcCnt;
$generalID = getGeneralID(false, false);
$userGrade = getUserGrade();
$me = [
'blocked'=> ($userGrade == 0)
];
if($generalID){
$general = queryFirstRow('SELECT name, picture, imgsvr from general where no=%i', $generalID);
if($general){
$me['name'] = $general['name'];
if($me['imgsvr'] == 0) {
$me['picture'] = IMAGE.W.$me['PICTURE'];
} else {
$me['picture'] = '../d_pic/'.$me['PICTURE'];
}
}
}
//TODO: 이를 표현하는 방법은 '이전 버전'의 serverListPost.php를 참고할 것.
jsonReturn([
'game'=>$game,
'me'=>$me
]);
-3
View File
@@ -179,8 +179,6 @@ if($id_num) {
$face = "default.jpg";
$imgsvr = 0;
}
//특회
$userlevel = $member['grade'];
//성격 랜덤시
if($character == 11) $character = rand()%10;
@@ -207,7 +205,6 @@ if($id_num) {
'crew' => 0,
'train' => 0,
'atmos' => 0,
'userlevel' => $userlevel,
'level' => 0,
'turntime' => $turntime,
'killturn' => 6,
+2 -2
View File
@@ -10,11 +10,11 @@ $query = "select conlimit from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select no,name,nation,userlevel,con from general where owner='{$_SESSION['noMember']}'";
$query = "select no,name,nation,con from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$con = checkLimit($me['userlevel'], $me['con'], $admin['conlimit']);
$con = checkLimit($me['con'], $admin['conlimit']);
if($con >= 2) {
//echo "<script>window.top.main.location.replace('index.php');</script>";
echo 'index.php';//TODO:debug all and replace
+17 -19
View File
@@ -3,10 +3,7 @@ include "lib.php";
include "func.php";
include "schema.php";
$userID = getUserID();
$userLevel = toInt(getRootDB()->queryFirstField('select userlevel from member where no=%i',$userID));
if($userLevel < 5){
if(getUserGrade(true) < 5){
echo '관리자 아님';
die();
}
@@ -17,7 +14,7 @@ $connect = dbConn();
// 삭제
unlink("d_setting/set.php");
unlink("d_setting/conf.php");
// DB에 커넥트 하고 DB NAME으로 select DB
$connect = @MYDB_connect($hostname,$user_id,$password) or Error("MySQL-DB Connect<br>Error!!!","");
@@ -28,28 +25,29 @@ delInDir("logs");
delInDir("data/session");
@unlink("data/connected.php");
// 관리자 테이블 삭제
if(isTable($connect, "game",$dbname)) @MYDB_query("drop table game", $connect) or Error(__LINE__.MYDB_error($connect),"");
if(isTable($connect, "game",$dbname)) @MYDB_query("DROP TABLE IF EXISTS game", $connect) or Error(__LINE__.MYDB_error($connect),"");
// 장수 테이블 삭제
if(isTable($connect, "gen",$dbname)) @MYDB_query("drop table general", $connect) or Error(__LINE__.MYDB_error($connect),"");
if(isTable($connect, "gen",$dbname)) @MYDB_query("DROP TABLE IF EXISTS general", $connect) or Error(__LINE__.MYDB_error($connect),"");
// 국가 테이블 삭제
if(isTable($connect, "nation",$dbname)) @MYDB_query("drop table nation", $connect) or Error(__LINE__.MYDB_error($connect),"");
if(isTable($connect, "nation",$dbname)) @MYDB_query("DROP TABLE IF EXISTS nation", $connect) or Error(__LINE__.MYDB_error($connect),"");
// 도시 테이블 삭제
if(isTable($connect, "city",$dbname)) @MYDB_query("drop table city", $connect) or Error(__LINE__.MYDB_error($connect),"");
if(isTable($connect, "city",$dbname)) @MYDB_query("DROP TABLE IF EXISTS city", $connect) or Error(__LINE__.MYDB_error($connect),"");
// 부대 테이블 삭제
if(isTable($connect, "troop",$dbname)) @MYDB_query("drop table troop", $connect) or Error(__LINE__.MYDB_error($connect),"");
if(isTable($connect, "troop",$dbname)) @MYDB_query("DROP TABLE IF EXISTS troop", $connect) or Error(__LINE__.MYDB_error($connect),"");
// 토큰 테이블 삭제
if(isTable($connect, "token",$dbname)) @MYDB_query("drop table token", $connect) or Error(__LINE__.MYDB_error($connect),"");
if(isTable($connect, "token",$dbname)) @MYDB_query("DROP TABLE IF EXISTS token", $connect) or Error(__LINE__.MYDB_error($connect),"");
// 외교 테이블 삭제
if(isTable($connect, "diplomacy",$dbname)) @MYDB_query("drop table diplomacy", $connect) or Error(__LINE__.MYDB_error($connect),"");
if(isTable($connect, "diplomacy",$dbname)) @MYDB_query("DROP TABLE IF EXISTS diplomacy", $connect) or Error(__LINE__.MYDB_error($connect),"");
// 토너먼트 테이블 삭제
if(isTable($connect, "tournament",$dbname)) @MYDB_query("drop table tournament", $connect) or Error(__LINE__.MYDB_error($connect),"");
if(isTable($connect, "tournament",$dbname)) @MYDB_query("DROP TABLE IF EXISTS tournament", $connect) or Error(__LINE__.MYDB_error($connect),"");
// 거래 테이블 삭제
if(isTable($connect, "auction",$dbname)) @MYDB_query("drop table auction", $connect) or Error("drop ".MYDB_error($connect),"");
if(isTable($connect, "auction",$dbname)) @MYDB_query("DROP TABLE IF EXISTS auction", $connect) or Error("drop ".MYDB_error($connect),"");
// 통계 테이블 삭제
if(isTable($connect, "statistic",$dbname)) @MYDB_query("drop table statistic", $connect) or Error("drop ".MYDB_error($connect),"");
if(isTable($connect, "statistic",$dbname)) @MYDB_query("DROP TABLE IF EXISTS statistic", $connect) or Error("drop ".MYDB_error($connect),"");
// 연감 테이블 삭제
if(isTable($connect, "history",$dbname)) @MYDB_query("drop table history", $connect) or Error("drop ".MYDB_error($connect),"");
if(isTable($connect, "history",$dbname)) @MYDB_query("DROP TABLE IF EXISTS history", $connect) or Error("drop ".MYDB_error($connect),"");
// 관리자 테이블 생성
if(!isTable($connect, "game",$dbname)) @MYDB_query($game_schema, $connect) or Error(__LINE__.MYDB_error($connect),"");
@@ -77,12 +75,12 @@ if(!isTable($connect, "statistic",$dbname)) @MYDB_query($statistic_schema, $conn
if(!isTable($connect, "history",$dbname)) @MYDB_query($history_schema, $connect) or Error("create history ".MYDB_error($connect),"");
// 파일로 DB 정보 저장
$file=@fopen("d_setting/set.php","w") or Error("set.php 파일 생성 실패<br><br>디렉토리의 퍼미션을 707로 주십시요","");
@fwrite($file,"<?php /*\n$hostname\n$user_id\n$password\n$dbname\n */\n") or Error("set.php 파일 생성 실패<br><br>디렉토리의 퍼미션을 707로 주십시요","");
$file=@fopen("d_setting/conf.php","w") or Error("conf.php 파일 생성 실패<br><br>디렉토리의 퍼미션을 707로 주십시요","");
@fwrite($file,"<?php /*\n$hostname\n$user_id\n$password\n$dbname\n */\n") or Error("conf.php 파일 생성 실패<br><br>디렉토리의 퍼미션을 707로 주십시요","");
@fclose($file);
@mkdir("data",0707);
@chmod("data",0707);
@chmod("d_setting/set.php",0707);
@chmod("d_setting/conf.php",0707);
$temp=MYDB_fetch_array(MYDB_query("select count(*) from general where level = '1'", $connect));
-1
View File
@@ -87,7 +87,6 @@ CREATE TABLE `general` (
`tnmt` INT(1) NULL DEFAULT '1',
`map` INT(1) NULL DEFAULT '0',
`myset` INT(1) NULL DEFAULT '3',
`userlevel` INT(1) NULL DEFAULT '1',
`tournament` INT(1) NULL DEFAULT '0',
`vote` INT(1) NULL DEFAULT '0',
`newvote` INT(1) NULL DEFAULT '0',
-4
View File
@@ -81,9 +81,6 @@ if($admin['npcmode'] != 1) {
exit;
*/
} else {
//특회
$userlevel = $member['grade'];
$query = "
update general set
name2='{$member['name']}',
@@ -94,7 +91,6 @@ if($admin['npcmode'] != 1) {
mode=2,
map=0,
owner='$userID',
userlevel='{$userlevel}'
where no='{$npcid}'
";
MYDB_query($query, $connect) or Error("join_post ".MYDB_error($connect),"");
+2 -2
View File
@@ -12,11 +12,11 @@ $query = "select conlimit from game where no=1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$query = "select no,name,nation,userlevel,con from general where owner='{$_SESSION['noMember']}'";
$query = "select no,name,nation,con from general where owner='{$_SESSION['noMember']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$con = checkLimit($me['userlevel'], $me['con'], $admin['conlimit']);
$con = checkLimit($me['con'], $admin['conlimit']);
if($con >= 2) {
//echo "<script>window.top.main.location.replace('index.php');</script>";
echo 'index.php';//TODO:debug all and replace