루트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:
+13
-19
@@ -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>"; }
|
||||
|
||||
Reference in New Issue
Block a user