$_SESSION 으로 직접 접근하는 코드들을 모두 Session 클래스로 통합
This commit is contained in:
@@ -7,7 +7,7 @@ include "func.php";
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$connect = dbConn();
|
||||
|
||||
if(Session::getUserGrade() < 5) {
|
||||
if($session->userGrade < 5) {
|
||||
//echo "<script>location.replace('_admin5.php');</script>";
|
||||
echo '_admin5.php';//TODO:debug all and replace
|
||||
}
|
||||
@@ -15,10 +15,10 @@ if(Session::getUserGrade() < 5) {
|
||||
switch($btn) {
|
||||
case "국가변경":
|
||||
if($nation == 0) {
|
||||
$query = "update general set nation=0,level=0 where owner='{$_SESSION['userID']}'";
|
||||
$query = "update general set nation=0,level=0 where owner='{$session->userID}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
} else {
|
||||
$query = "update general set nation='{$nation}',level=1 where owner='{$_SESSION['userID']}'";
|
||||
$query = "update general set nation='{$nation}',level=1 where owner='{$session->userID}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
break;
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ $rice = 0;
|
||||
$connect = dbConn();
|
||||
increaseRefresh("시뮬", 2);
|
||||
|
||||
$query = "select no,tournament,con,turntime from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,tournament,con,turntime from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ $query = "select conlimit from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select con,turntime from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select con,turntime from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ $query = "select conlimit from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select con,turntime from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select con,turntime from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ $query = "select startyear,year,month,conlimit from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select map,con,turntime from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select map,con,turntime from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ $query = "select conlimit from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select con,turntime from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select con,turntime from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ $query = "select conlimit from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select map,con,turntime from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select map,con,turntime from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ include "func.php";
|
||||
$connect = dbConn();
|
||||
increaseRefresh("설문조사", 1);
|
||||
|
||||
$query = "select no,vote from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,vote from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ $session = Session::requireGameLogin()->setReadOnly();
|
||||
$connect = dbConn();
|
||||
increaseRefresh("거래장", 2);
|
||||
|
||||
$query = "select no,special,con,turntime from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,special,con,turntime from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
@@ -18,7 +18,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 no,nation,level,con,turntime,belong from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,nation,level,con,turntime,belong from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@ $connect = dbConn();
|
||||
increaseRefresh("베팅장", 1);
|
||||
checkTurn($connect);
|
||||
|
||||
$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['userID']}'";
|
||||
$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->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
@@ -194,7 +194,7 @@ for($i=0; $i < 16; $i++) {
|
||||
echo "<td width=70>{$gen[$i]}</td>";
|
||||
}
|
||||
|
||||
$query = "select bet0,bet1,bet2,bet3,bet4,bet5,bet6,bet7,bet8,bet9,bet10,bet11,bet12,bet13,bet14,bet15 from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select bet0,bet1,bet2,bet3,bet4,bet5,bet6,bet7,bet8,bet9,bet10,bet11,bet12,bet13,bet14,bet15 from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
for($i=0; $i < 16; $i++) {
|
||||
|
||||
@@ -8,7 +8,7 @@ $session = Session::requireGameLogin()->setReadOnly();
|
||||
$connect = dbConn();
|
||||
increaseRefresh("기밀실", 1);
|
||||
|
||||
$query = "select no,nation,level from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,nation,level from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ $query = "select conlimit from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select no,nation,level,con,turntime,belong from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,nation,level,con,turntime,belong from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ $session = Session::requireGameLogin()->setReadOnly();
|
||||
$connect = dbConn();
|
||||
increaseRefresh("현재도시", 1);
|
||||
|
||||
$query = "select no,nation,level,city from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,nation,level,city from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ $query = "select conlimit from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select no,nation,level,con,turntime,belong from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,nation,level,con,turntime,belong from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ $query = "select turnterm from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select no,nation,map from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,nation,map from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ $query = "select conlimit from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select no,nation,level,con,turntime,belong from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,nation,level,con,turntime,belong from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ increaseRefresh("인사부", 1);
|
||||
//훼섭 추방을 위해 갱신
|
||||
checkTurn($connect);
|
||||
|
||||
$query = "select no,nation,level from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,nation,level from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ $session = Session::requireGameLogin()->setReadOnly();
|
||||
$connect = dbConn();
|
||||
increaseRefresh("세력도시", 1);
|
||||
|
||||
$query = "select no,nation,level from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,nation,level from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
@@ -55,7 +55,7 @@ $sel[$type] = "selected";
|
||||
</td></tr>
|
||||
</table>
|
||||
<?php
|
||||
$query = "select nation from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select nation from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ $session = Session::requireGameLogin()->setReadOnly();
|
||||
$connect = dbConn();
|
||||
increaseRefresh("세력장수", 1);
|
||||
|
||||
$query = "select no,nation,level from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,nation,level from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ $session = Session::requireGameLogin()->setReadOnly();
|
||||
$connect = dbConn();
|
||||
increaseRefresh("세력정보", 1);
|
||||
|
||||
$query = "select no,nation,level from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,nation,level from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
@@ -33,7 +33,7 @@ if($me['level'] == 0) {
|
||||
</table>
|
||||
<br>
|
||||
<?php
|
||||
$query = "select nation from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select nation from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
+3
-3
@@ -8,7 +8,7 @@ $session = Session::requireGameLogin()->setReadOnly();
|
||||
$connect = dbConn();
|
||||
increaseRefresh("내정보", 1);
|
||||
|
||||
$query = "select myset from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select myset from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
@@ -25,11 +25,11 @@ if($btn == "설정저장" && $me['myset'] > 0) {
|
||||
$submit = 'hidden';
|
||||
}
|
||||
|
||||
$query = "update general set myset=myset-1,map='$map',mode='$mode',tnmt='$tnmt' where owner='{$_SESSION['userID']}'";
|
||||
$query = "update general set myset=myset-1,map='$map',mode='$mode',tnmt='$tnmt' where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
|
||||
$query = "select no,map,mode,tnmt,myset from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,map,mode,tnmt,myset from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ $session = Session::requireGameLogin()->setReadOnly();
|
||||
$connect = dbConn();
|
||||
increaseRefresh("회의실", 1);
|
||||
|
||||
$query = "select no,nation from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,nation from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ increaseRefresh("국법", 1);
|
||||
<tr><td>
|
||||
|
||||
<?php
|
||||
$query = "select no,nation,level from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,nation,level from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ $connect = dbConn();
|
||||
increaseRefresh("토너먼트", 1);
|
||||
checkTurn($connect);
|
||||
|
||||
$query = "select no,tournament,con,turntime from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,tournament,con,turntime from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ $session = Session::requireGameLogin()->setReadOnly();
|
||||
$connect = dbConn();
|
||||
increaseRefresh("부대편성", 1);
|
||||
|
||||
$query = "select no,nation,troop from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,nation,troop from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ $query = "select turnterm from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select no,name,gold,rice,special from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,name,gold,rice,special from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
+2
-2
@@ -22,7 +22,7 @@ if($admin['tournament'] != 6) {
|
||||
exit();
|
||||
}
|
||||
|
||||
$query = "select gold,bet0,bet1,bet2,bet3,bet4,bet5,bet6,bet7,bet8,bet9,bet10,bet11,bet12,bet13,bet14,bet15,bet0+bet1+bet2+bet3+bet4+bet5+bet6+bet7+bet8+bet9+bet10+bet11+bet12+bet13+bet14+bet15 as bet from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select gold,bet0,bet1,bet2,bet3,bet4,bet5,bet6,bet7,bet8,bet9,bet10,bet11,bet12,bet13,bet14,bet15,bet0+bet1+bet2+bet3+bet4+bet5+bet6+bet7+bet8+bet9+bet10+bet11+bet12+bet13+bet14+bet15 as bet from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
@@ -32,7 +32,7 @@ for($i=0; $i < 16; $i++) {
|
||||
$mebet = $me["bet{$i}"];
|
||||
if($gold >= 10 && $gold <= 1000) {
|
||||
if($gold + 500 <= $me['gold'] && $gold + $mebet <= 1000 && $gold + $me['bet'] <= 1000) {
|
||||
$query = "update general set gold=gold-'$gold',bet{$i}=bet{$i}+'$gold',betgold=betgold+'$gold' where owner='{$_SESSION['userID']}'";
|
||||
$query = "update general set gold=gold-'$gold',bet{$i}=bet{$i}+'$gold',betgold=betgold+'$gold' where owner='{$session->userID}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$query = "update game set bet{$i}=bet{$i}+'$gold'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
@@ -10,7 +10,7 @@ $session = Session::requireGameLogin()->setReadOnly();
|
||||
$connect = dbConn();
|
||||
|
||||
if(getBlockLevel() != 1 && getBlockLevel() != 3) {
|
||||
$query = "select no,nation from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,nation from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ include "func.php";
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$connect = dbConn();
|
||||
|
||||
$query = "select no,nation,level from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,nation,level from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
+6
-6
@@ -32,7 +32,7 @@ if($command == 46) {
|
||||
if($name == "") { $name = "무명"; }
|
||||
$name = StringUtil::SubStrForWidth($name, 0, 12);
|
||||
|
||||
$query = "update general set makenation='{$name}' where owner='{$_SESSION['userID']}'";
|
||||
$query = "update general set makenation='{$name}' where owner='{$session->userID}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$count = sizeof($turn);
|
||||
@@ -40,13 +40,13 @@ if($command == 46) {
|
||||
for($i=0; $i < $count; $i++) {
|
||||
$str .= ",turn{$turn[$i]}='{$comStr}'";
|
||||
}
|
||||
$query = "update general set {$str} where owner='{$_SESSION['userID']}'";
|
||||
$query = "update general set {$str} where owner='{$session->userID}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
//echo "<script>location.replace('index.php');</script>";
|
||||
echo 'index.php';//TODO:debug all and replace
|
||||
//통합제의
|
||||
} elseif($command == 53) {
|
||||
$query = "select nation,level from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select nation,level from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
@@ -73,7 +73,7 @@ if($command == 46) {
|
||||
echo 'b_chiefcenter.php';//TODO:debug all and replace
|
||||
//불가침
|
||||
} elseif($command == 61) {
|
||||
$query = "select nation,level from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select nation,level from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
@@ -102,7 +102,7 @@ if($command == 46) {
|
||||
//백성동원, 수몰, 허보, 피장파장, 의병모집, 이호경식, 급습
|
||||
//국기변경
|
||||
} elseif($command == 23 || $command == 24 || $command == 27 || $command == 51 || $command == 52 || $command > 60) {
|
||||
$query = "select no,nation,level from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,nation,level from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
@@ -125,7 +125,7 @@ if($command == 46) {
|
||||
for($i=0; $i < $count; $i++) {
|
||||
$str .= ",turn{$turn[$i]}='{$comStr}'";
|
||||
}
|
||||
$query = "update general set {$str} where owner='{$_SESSION['userID']}'";
|
||||
$query = "update general set {$str} where owner='{$session->userID}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
//echo "<script>location.replace('index.php');</script>";
|
||||
echo 'index.php';//TODO:debug all and replace
|
||||
|
||||
@@ -13,7 +13,7 @@ $query = "select startyear,year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select no,nation,level from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,nation,level from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
$meLevel = $me['level'];
|
||||
|
||||
@@ -10,7 +10,7 @@ $session = Session::requireGameLogin()->setReadOnly();
|
||||
$connect = dbConn();
|
||||
|
||||
if(getBlockLevel() != 1 && getBlockLevel() != 3) {
|
||||
$query = "select no,nation from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,nation from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ include "func.php";
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$connect = dbConn();
|
||||
|
||||
$query = "select no,nation from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,nation from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ $query = "select tournament,phase,tnmt_type,develcost from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select no,name,tournament from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,name,tournament from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ $admin = MYDB_fetch_array($result);
|
||||
|
||||
$admin['killturn'] *= 3;
|
||||
|
||||
$query = "update general set killturn='{$admin['killturn']}' where owner='{$_SESSION['userID']}'";
|
||||
$query = "update general set killturn='{$admin['killturn']}' where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
//echo "<script>location.replace('b_myPage.php');</script>";
|
||||
|
||||
+2
-2
@@ -11,13 +11,13 @@ $query = "select develcost,vote,votecomment from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select no,vote,name,nation,horse,weap,book,item,npc from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,vote,name,nation,horse,weap,book,item,npc from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
if($btn == "투표" && $me['vote'] == 0 && $sel > 0) {
|
||||
$develcost = $admin['develcost'] * 5;
|
||||
$query = "update general set gold=gold+{$develcost},vote='{$sel}' where owner='{$_SESSION['userID']}'";
|
||||
$query = "update general set gold=gold+{$develcost},vote='{$sel}' where owner='{$session->userID}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
$log = [];
|
||||
|
||||
+1
-1
@@ -73,7 +73,7 @@ function myCommandList($connect) {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select no,turntime,term,turn0,turn1,turn2,turn3,turn4,turn5,turn6,turn7,turn8,turn9,turn10,turn11,turn12,turn13,turn14,turn15,turn16,turn17,turn18,turn19,turn20,turn21,turn22,turn23 from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,turntime,term,turn0,turn1,turn2,turn3,turn4,turn5,turn6,turn7,turn8,turn9,turn10,turn11,turn12,turn13,turn14,turn15,turn16,turn17,turn18,turn19,turn20,turn21,turn22,turn23 from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
$turn = getTurn($connect, $me, 2);
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ $query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select no,name,nation,level,picture,imgsvr from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,name,nation,level,picture,imgsvr from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ $query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select no,name,nation,level,picture,imgsvr from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,name,nation,level,picture,imgsvr from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ $query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select no,name,nation,level,picture,imgsvr from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,name,nation,level,picture,imgsvr from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ $query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select no,name,nation,level,picture,imgsvr from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,name,nation,level,picture,imgsvr from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ $query = "select startyear,year,month,killturn from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select no,name,nation,nations,level,troop,npc,gold,rice from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,name,nation,nations,level,troop,npc,gold,rice from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ $query = "select year,month from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select no,name,nation,level,picture,imgsvr from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,name,nation,level,picture,imgsvr from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
+16
-14
@@ -118,7 +118,7 @@ function getRandGenName() {
|
||||
function cityInfo($connect) {
|
||||
global $_basecolor, $_basecolor2, $images;
|
||||
|
||||
$query = "select no,city from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,city from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
@@ -233,7 +233,7 @@ function myNationInfo($connect) {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select no,nation from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,nation from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
@@ -406,7 +406,7 @@ function commandTable($connect) {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select no,npc,troop,city,nation,level,crew,makelimit,special from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,npc,troop,city,nation,level,crew,makelimit,special from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
@@ -640,7 +640,7 @@ function CoreCommandTable($connect) {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select no,nation,city,level from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,nation,city,level from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
@@ -730,7 +730,7 @@ function CoreCommandTable($connect) {
|
||||
}
|
||||
|
||||
function myInfo($connect) {
|
||||
$query = "select no from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
@@ -914,7 +914,7 @@ function generalInfo($connect, $no) {
|
||||
}
|
||||
|
||||
function myInfo2($connect) {
|
||||
$query = "select no from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
@@ -1064,7 +1064,7 @@ function onlineNation($connect) {
|
||||
}
|
||||
|
||||
function nationMsg($connect) {
|
||||
$query = "select no,nation from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,nation from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
@@ -1226,7 +1226,7 @@ function increaseRefresh($type="", $cnt=1) {
|
||||
'connect'=>$db->sqleval('connect + %i', $cnt),
|
||||
'refcnt'=>$db->sqleval('refcnt + %i', $cnt),
|
||||
'refresh'=>$db->sqleval('refresh + %i', $cnt)
|
||||
], 'no=%i', $generalID);
|
||||
], 'owner=%i', $generalID);
|
||||
}
|
||||
|
||||
$date = date('Y_m_d H:i:s');
|
||||
@@ -1463,7 +1463,9 @@ function checkTurn($connect) {
|
||||
return;
|
||||
}
|
||||
|
||||
$locklog[0] = "- checkTurn() : ".date('Y-m-d H:i:s')." : ".$_SESSION['userName'];
|
||||
$session = Session::Instance();
|
||||
|
||||
$locklog[0] = "- checkTurn() : ".date('Y-m-d H:i:s')." : ".$session->userName;
|
||||
pushLockLog($locklog);
|
||||
|
||||
// 파일락 해제
|
||||
@@ -1471,7 +1473,7 @@ function checkTurn($connect) {
|
||||
// 세마포어 해제
|
||||
//if(!@sem_release($sema)) { echo "치명적 에러! 유기체에게 문의하세요!"; exit(1); }
|
||||
|
||||
$locklog[0] = "- checkTurn() 입 : ".date('Y-m-d H:i:s')." : ".$_SESSION['userName'];
|
||||
$locklog[0] = "- checkTurn() 입 : ".date('Y-m-d H:i:s')." : ".$session->userName;
|
||||
pushLockLog($locklog);
|
||||
|
||||
//if(STEP_LOG) delStepLog();
|
||||
@@ -1537,7 +1539,7 @@ function checkTurn($connect) {
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', preUpdateMonthly');
|
||||
$result = preUpdateMonthly($connect);
|
||||
if($result == false) {
|
||||
$locklog[0] = "-- checkTurn() 오류출 : ".date('Y-m-d H:i:s')." : ".$_SESSION['userName'];
|
||||
$locklog[0] = "-- checkTurn() 오류출 : ".date('Y-m-d H:i:s')." : ".$session->userName;
|
||||
pushLockLog($locklog);
|
||||
|
||||
// 잡금 해제
|
||||
@@ -1550,7 +1552,7 @@ function checkTurn($connect) {
|
||||
$dt = turnDate($connect, $nextTurn);
|
||||
$admin['year'] = $dt[0]; $admin['month'] = $dt[1];
|
||||
|
||||
$locklog[0] = "-- checkTurn() ".$admin['month']."월 : ".date('Y-m-d H:i:s')." : ".$_SESSION['userName'];
|
||||
$locklog[0] = "-- checkTurn() ".$admin['month']."월 : ".date('Y-m-d H:i:s')." : ".$session->userName;
|
||||
pushLockLog($locklog);
|
||||
|
||||
// 이벤트 핸들러 동작
|
||||
@@ -1676,7 +1678,7 @@ function checkTurn($connect) {
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', unlock');
|
||||
unlock();
|
||||
|
||||
$locklog[0] = "- checkTurn() 출 : ".date('Y-m-d H:i:s')." : ".$_SESSION['userName'];
|
||||
$locklog[0] = "- checkTurn() 출 : ".date('Y-m-d H:i:s')." : ".$session->userName;
|
||||
pushLockLog($locklog);
|
||||
|
||||
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', finish');
|
||||
@@ -2296,7 +2298,7 @@ function getAdmin($connect) {
|
||||
}
|
||||
|
||||
function getMe($connect) {
|
||||
$query = "select * from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select * from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("접속자가 많아 접속을 중단합니다. 잠시후 갱신해주세요.<br>getMe : ".MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
@@ -674,7 +674,7 @@ function command_Single($connect, $turn, $command) {
|
||||
for($i=0; $i < $count; $i++) {
|
||||
$str .= ",turn{$turn[$i]}='{$command}'";
|
||||
}
|
||||
$query = "update general set {$str} where owner='{$_SESSION['userID']}'";
|
||||
$query = "update general set {$str} where owner='{$session->userID}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
//echo "<script>location.replace('commandlist.php');</script>";
|
||||
echo 'commandlist.php';//TODO:debug all and replace
|
||||
@@ -684,7 +684,7 @@ function command_Single($connect, $turn, $command) {
|
||||
function command_Chief($connect, $turn, $command) {
|
||||
$command = EncodeCommand(0, 0, 0, $command);
|
||||
|
||||
$query = "select nation,level from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select nation,level from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
@@ -279,7 +279,7 @@ function getMailboxList(){
|
||||
// who : xxxx,xxxx(발신인, 수신인)
|
||||
function DecodeMsg($connect, $msg, $type, $who, $date, $bg, $num=0) {
|
||||
//FIXME: 폐기
|
||||
$query = "select no,nation,name,picture,level from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,nation,name,picture,level from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
@@ -340,7 +340,7 @@ function moveMsg($connect, $table, $msgtype, $msgnum, $msg, $type, $who, $when,
|
||||
}
|
||||
|
||||
function MsgDip($connect, $bg) {
|
||||
$query = "select no,nation from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,nation from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
+3
-3
@@ -35,13 +35,13 @@ $session->setReadOnly();
|
||||
|
||||
|
||||
if($me['newmsg'] == 1 && $me['newvote'] == 1) {
|
||||
$query = "update general set newmsg=0,newvote=0 where owner='{$_SESSION['userID']}'";
|
||||
$query = "update general set newmsg=0,newvote=0 where owner='{$session->userID}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
} elseif($me['newmsg'] == 1) {
|
||||
$query = "update general set newmsg=0 where owner='{$_SESSION['userID']}'";
|
||||
$query = "update general set newmsg=0 where owner='{$session->userID}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
} elseif($me['newvote'] == 1) {
|
||||
$query = "update general set newvote=0 where owner='{$_SESSION['userID']}'";
|
||||
$query = "update general set newvote=0 where owner='{$session->userID}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
|
||||
|
||||
+4
-5
@@ -7,7 +7,8 @@ include 'func.php';
|
||||
|
||||
$session = Session::requireGameLogin([
|
||||
'newSeq' => false
|
||||
])->setReadOnly();
|
||||
]);
|
||||
//NOTE: 전송 메시지 시간 계산을 위해 Session을 쓰기 가능 상태로 열어둠.
|
||||
|
||||
/**
|
||||
* 메시지 전송 코드.
|
||||
@@ -15,8 +16,6 @@ $session = Session::requireGameLogin([
|
||||
* TODO: 장기적으로 ajax는 한곳에 모을 필요가 있을 듯.
|
||||
*/
|
||||
|
||||
//읽기 전용이다. 빠르게 세션 끝내자
|
||||
|
||||
$post = WebUtil::parseJsonPost();
|
||||
|
||||
if(!isset($post['genlist']) || !isset($post['msg'])){
|
||||
@@ -112,7 +111,7 @@ if($destMailbox == 9999) {
|
||||
|
||||
// 개인 메세지
|
||||
} elseif($destMailbox > 0) {
|
||||
$last_msg = new \DateTime(Util::array_get($_SESSION['last_msg'], '0000-00-00'));
|
||||
$last_msg = new \DateTime($session->last_msg?:'0000-00-00');
|
||||
|
||||
$msg_interval = $datetime->getTimestamp() - $last_msg->getTimestamp();
|
||||
//NOTE: 여기서 유저 레벨을 구별할 코드가 필요할까?
|
||||
@@ -134,7 +133,7 @@ if($destMailbox == 9999) {
|
||||
]);
|
||||
}
|
||||
|
||||
$_SESSION['last_msg'] = $date;
|
||||
$session->last_msg = $date;
|
||||
|
||||
$dest = [
|
||||
'id' => $destMailbox,
|
||||
|
||||
@@ -12,7 +12,7 @@ $query = "select conlimit from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select no,name,nation,con from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,name,nation,con from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
+38
-38
@@ -172,7 +172,7 @@ function ender($type=0) {
|
||||
}
|
||||
|
||||
function command_99($connect, $turn) {
|
||||
$query = "select nation,level from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select nation,level from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
@@ -236,7 +236,7 @@ function command_11($connect, $turn, $command) {
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select no,nation,level,personal,special2,level,city,crew,horse,injury,leader,crewtype,gold from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,nation,level,personal,special2,level,city,crew,horse,injury,leader,crewtype,gold from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
@@ -441,7 +441,7 @@ function command_12($connect, $turn, $command) {
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select no,nation,level,personal,special2,level,city,crew,horse,injury,leader,crewtype,gold from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,nation,level,personal,special2,level,city,crew,horse,injury,leader,crewtype,gold from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
@@ -643,7 +643,7 @@ function calc(cost, formnum) {
|
||||
|
||||
function command_15($connect, $turn, $command) {
|
||||
starter("재편성");
|
||||
$query = "select no,nation from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,nation from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
$me = $general['no'];
|
||||
@@ -684,7 +684,7 @@ function command_15($connect, $turn, $command) {
|
||||
|
||||
function command_16($connect, $turn, $command) {
|
||||
starter("출병");
|
||||
$query = "select city from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select city from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
@@ -723,7 +723,7 @@ function command_16($connect, $turn, $command) {
|
||||
|
||||
function command_21($connect, $turn, $command) {
|
||||
starter("이동");
|
||||
$query = "select city from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select city from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
@@ -764,7 +764,7 @@ function command_22($connect, $turn, $command) {
|
||||
die('비활성화됨');//TODO:등용장 대 디자인
|
||||
starter("등용");
|
||||
|
||||
$query = "select nation from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select nation from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
@@ -823,7 +823,7 @@ function command_22($connect, $turn, $command) {
|
||||
|
||||
function command_23($connect, $turn, $command) {
|
||||
starter("포상", 1);
|
||||
$query = "select no,nation from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,nation from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
@@ -893,7 +893,7 @@ function command_23($connect, $turn, $command) {
|
||||
|
||||
function command_24($connect, $turn, $command) {
|
||||
starter("몰수", 1);
|
||||
$query = "select no,nation from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,nation from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
@@ -971,7 +971,7 @@ function command_25($connect, $turn, $command) {
|
||||
$result = MYDB_query($query, $connect) or Error("command_46 ".MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select no,nations from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,nations from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("command_27 ".MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
@@ -1041,7 +1041,7 @@ function command_25($connect, $turn, $command) {
|
||||
function command_27($connect, $turn, $command) {
|
||||
starter("발령", 1);
|
||||
|
||||
$query = "select no,nation,level from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,nation,level from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("command_27 ".MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
@@ -1096,7 +1096,7 @@ function command_27($connect, $turn, $command) {
|
||||
|
||||
function command_30($connect, $turn, $command) {
|
||||
starter("강행");
|
||||
$query = "select city from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select city from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
@@ -1135,7 +1135,7 @@ ender();
|
||||
|
||||
function command_31($connect, $turn, $command) {
|
||||
starter("첩보");
|
||||
$query = "select city from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select city from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
@@ -1178,7 +1178,7 @@ function command_31($connect, $turn, $command) {
|
||||
|
||||
function command_32($connect, $turn, $command) {
|
||||
starter("화계");
|
||||
$query = "select city from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select city from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
@@ -1216,7 +1216,7 @@ function command_32($connect, $turn, $command) {
|
||||
|
||||
function command_33($connect, $turn, $command) {
|
||||
starter("탈취");
|
||||
$query = "select city from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select city from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
@@ -1254,7 +1254,7 @@ function command_33($connect, $turn, $command) {
|
||||
|
||||
function command_34($connect, $turn, $command) {
|
||||
starter("파괴");
|
||||
$query = "select city from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select city from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
@@ -1292,7 +1292,7 @@ function command_34($connect, $turn, $command) {
|
||||
|
||||
function command_35($connect, $turn, $command) {
|
||||
starter("선동");
|
||||
$query = "select city from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select city from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
@@ -1330,7 +1330,7 @@ function command_35($connect, $turn, $command) {
|
||||
|
||||
function command_36($connect, $turn, $command) {
|
||||
starter("기습");
|
||||
$query = "select city from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select city from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
@@ -1368,7 +1368,7 @@ function command_36($connect, $turn, $command) {
|
||||
|
||||
function command_43($connect, $turn, $command) {
|
||||
starter("증여");
|
||||
$query = "select no,nation from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,nation from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
@@ -1579,7 +1579,7 @@ function command_46($connect, $turn, $command) {
|
||||
function command_48($connect, $turn, $command) {
|
||||
starter("장비 매매");
|
||||
|
||||
$query = "select no,city,gold from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,city,gold from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("command_48 ".MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
$city = getCity($connect, $me['city'], "secu");
|
||||
@@ -1689,7 +1689,7 @@ function command_49($connect, $turn, $command) {
|
||||
function command_51($connect, $turn, $command) {
|
||||
starter("항복 권고", 1);
|
||||
|
||||
$query = "select nation from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select nation from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
@@ -1740,7 +1740,7 @@ function command_51($connect, $turn, $command) {
|
||||
function command_52($connect, $turn, $command) {
|
||||
starter("원조", 1);
|
||||
|
||||
$query = "select nation from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select nation from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
@@ -1814,7 +1814,7 @@ function command_52($connect, $turn, $command) {
|
||||
function command_53($connect, $turn, $command) {
|
||||
starter("통합제의", 1);
|
||||
|
||||
$query = "select no,nation from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,nation from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("command_53 ".MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
@@ -1878,7 +1878,7 @@ function command_53($connect, $turn, $command) {
|
||||
|
||||
function command_54($connect, $turn, $command) {
|
||||
starter("선양");
|
||||
$query = "select no,nation from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,nation from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
@@ -1922,7 +1922,7 @@ function command_54($connect, $turn, $command) {
|
||||
function command_61($connect, $turn, $command) {
|
||||
starter("불가침", 1);
|
||||
|
||||
$query = "select nation from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select nation from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
@@ -2002,7 +2002,7 @@ function command_61($connect, $turn, $command) {
|
||||
function command_62($connect, $turn, $command) {
|
||||
starter("선전포고", 1);
|
||||
|
||||
$query = "select nation from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select nation from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
@@ -2065,7 +2065,7 @@ function command_62($connect, $turn, $command) {
|
||||
function command_63($connect, $turn, $command) {
|
||||
starter("종전", 1);
|
||||
|
||||
$query = "select nation from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select nation from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
@@ -2120,7 +2120,7 @@ function command_63($connect, $turn, $command) {
|
||||
function command_64($connect, $turn, $command) {
|
||||
starter("파기", 1);
|
||||
|
||||
$query = "select nation from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select nation from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
@@ -2174,7 +2174,7 @@ function command_64($connect, $turn, $command) {
|
||||
|
||||
function command_65($connect, $turn, $command) {
|
||||
starter("초토화", 1);
|
||||
$query = "select city from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select city from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
@@ -2210,7 +2210,7 @@ echo "<br>
|
||||
|
||||
function command_66($connect, $turn, $command) {
|
||||
starter("천도", 1);
|
||||
$query = "select city from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select city from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
@@ -2247,7 +2247,7 @@ echo "<br>
|
||||
|
||||
function command_67($connect, $turn, $command) {
|
||||
starter("증축", 1);
|
||||
$query = "select city from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select city from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
@@ -2284,7 +2284,7 @@ echo "<br>
|
||||
|
||||
function command_68($connect, $turn, $command) {
|
||||
starter("감축", 1);
|
||||
$query = "select city from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select city from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
@@ -2321,7 +2321,7 @@ echo "<br>
|
||||
|
||||
function command_72($connect, $turn, $command) {
|
||||
starter("백성동원", 1);
|
||||
$query = "select city from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select city from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
@@ -2358,7 +2358,7 @@ echo "<br>
|
||||
|
||||
function command_73($connect, $turn, $command) {
|
||||
starter("수몰", 1);
|
||||
$query = "select city from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select city from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
@@ -2395,7 +2395,7 @@ echo "<br>
|
||||
|
||||
function command_74($connect, $turn, $command) {
|
||||
starter("허보", 1);
|
||||
$query = "select city from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select city from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
$general = MYDB_fetch_array($result);
|
||||
|
||||
@@ -2433,7 +2433,7 @@ echo "<br>
|
||||
function command_75($connect, $turn, $command) {
|
||||
starter("피장파장", 1);
|
||||
|
||||
$query = "select nation from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select nation from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
@@ -2489,7 +2489,7 @@ function command_75($connect, $turn, $command) {
|
||||
function command_77($connect, $turn, $command) {
|
||||
starter("이호경식", 1);
|
||||
|
||||
$query = "select nation from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select nation from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
@@ -2545,7 +2545,7 @@ function command_77($connect, $turn, $command) {
|
||||
function command_78($connect, $turn, $command) {
|
||||
starter("급습", 1);
|
||||
|
||||
$query = "select nation from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select nation from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error("aaa_processing.php ".MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
+5
-5
@@ -14,7 +14,7 @@ $query = "select conlimit from game limit 1";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$admin = MYDB_fetch_array($result);
|
||||
|
||||
$query = "select no,name,nation,con from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no,name,nation,con from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
@@ -37,7 +37,7 @@ case 0:
|
||||
if($k >= 24) break;
|
||||
$query .= ",";
|
||||
}
|
||||
$query .= " where owner='{$_SESSION['userID']}'";
|
||||
$query .= " where owner='{$session->userID}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
*/
|
||||
@@ -51,7 +51,7 @@ case 0:
|
||||
if($k >= 24) break;
|
||||
}
|
||||
}
|
||||
$query .= " where owner='{$_SESSION['userID']}'";
|
||||
$query .= " where owner='{$session->userID}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
break;
|
||||
case 1:
|
||||
@@ -69,7 +69,7 @@ case 1:
|
||||
if($k < 0) break;
|
||||
$query .= ",";
|
||||
}
|
||||
$query .= " where owner='{$_SESSION['userID']}'";
|
||||
$query .= " where owner='{$session->userID}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
break;
|
||||
case 2:
|
||||
@@ -87,7 +87,7 @@ case 2:
|
||||
if($i >= 24) break;
|
||||
$query .= ",";
|
||||
}
|
||||
$query .= " where owner='{$_SESSION['userID']}'";
|
||||
$query .= " where owner='{$session->userID}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ include "func.php";
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$connect = dbConn();
|
||||
|
||||
$query = "select no from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ include "func.php";
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$connect = dbConn();
|
||||
|
||||
$query = "select no from general where owner='{$_SESSION['userID']}'";
|
||||
$query = "select no from general where owner='{$session->userID}'";
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$me = MYDB_fetch_array($result);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user