KVStorage의 game namespace를 game_env로 '편의를 위해' 변경

This commit is contained in:
2018-05-12 22:21:53 +09:00
parent 52f4b79fdf
commit 67ecd514a4
63 changed files with 194 additions and 194 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ if($session->userGrade < 4) {
}
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$query = "select turntime,tnmt_time from game";
+1 -1
View File
@@ -27,7 +27,7 @@ $minute2 = Util::getReq('minute2', 'int');
extractMissingPostToGlobals();
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
switch($btn) {
+1 -1
View File
@@ -33,7 +33,7 @@ $startyear = Util::getReq('startyear', 'int', GameConst::$defaultStartYear);
extractMissingPostToGlobals();
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$admin = getAdmin();
+1 -1
View File
@@ -26,7 +26,7 @@ if($session->userGrade < 5) {
}
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$query = "select conlimit from game limit 1";
+1 -1
View File
@@ -22,7 +22,7 @@ if(!$generalID){
}
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$src = MessageTarget::buildQuick($session->generalID);
+1 -1
View File
@@ -26,7 +26,7 @@ if($session->userGrade < 5) {
}
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$query = "select conlimit from game limit 1";
+1 -1
View File
@@ -39,7 +39,7 @@ if($session->userGrade < 5) {
}
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$sel = [];
+1 -1
View File
@@ -74,7 +74,7 @@ $dec = 0;
$rice = 0;
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
increaseRefresh("시뮬", 2);
+1 -1
View File
@@ -13,7 +13,7 @@ $session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
increaseRefresh("명장일람", 2);
+1 -1
View File
@@ -13,7 +13,7 @@ $session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
increaseRefresh("장수일람", 2);
+1 -1
View File
@@ -13,7 +13,7 @@ $session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
increaseRefresh("연감", 2);
+1 -1
View File
@@ -8,7 +8,7 @@ $session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
increaseRefresh("세력일람", 2);
+2 -1
View File
@@ -8,11 +8,12 @@ $session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
increaseRefresh("세력도", 2);
checkTurn();
$gameStor->resetCache();
$query = "select conlimit from game limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
+1 -1
View File
@@ -5,7 +5,7 @@ include "lib.php";
include "func.php";
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
increaseRefresh("갱신정보", 2);
+1 -1
View File
@@ -7,7 +7,7 @@ include "func.php";
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
increaseRefresh("설문조사", 1);
+1 -1
View File
@@ -14,7 +14,7 @@ $session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
increaseRefresh("거래장", 2);
+2 -1
View File
@@ -23,12 +23,13 @@ $session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
increaseRefresh("감찰부", 2);
//전투 추진을 위해 갱신
checkTurn();
$gameStor->resetCache();
$query = "select conlimit from game limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
+1 -1
View File
@@ -8,7 +8,7 @@ $session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
increaseRefresh("베팅장", 1);
+1 -1
View File
@@ -8,7 +8,7 @@ $session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
increaseRefresh("사령부", 1);
+1 -1
View File
@@ -8,7 +8,7 @@ $session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
increaseRefresh("내무부", 1);
+1 -1
View File
@@ -8,7 +8,7 @@ $session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
increaseRefresh("중원정보", 1);
+1 -1
View File
@@ -16,7 +16,7 @@ $session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
increaseRefresh("암행부", 2);
+1 -1
View File
@@ -8,7 +8,7 @@ $session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
increaseRefresh("세력정보", 1);
+1 -1
View File
@@ -25,7 +25,7 @@ $session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
increaseRefresh("내정보", 1);
+1 -1
View File
@@ -8,7 +8,7 @@ $session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
increaseRefresh("토너먼트", 1);
+1 -1
View File
@@ -34,7 +34,7 @@ $session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
increaseRefresh("입찰", 1);
+1 -1
View File
@@ -38,7 +38,7 @@ $session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
increaseRefresh("베팅", 1);
+1 -1
View File
@@ -18,7 +18,7 @@ $session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$query = "select startyear,year,month,scenario from game limit 1";
+1 -1
View File
@@ -21,7 +21,7 @@ $session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$query = "select tournament,phase,tnmt_type,develcost from game limit 1";
+1 -1
View File
@@ -8,7 +8,7 @@ $session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$query = "select killturn from game limit 1";
+1 -1
View File
@@ -17,7 +17,7 @@ $session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$query = "select develcost,vote,votecomment from game limit 1";
+1 -1
View File
@@ -67,7 +67,7 @@ myCommandList();
function myCommandList() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$userID = Session::getUserID();
+28 -31
View File
@@ -96,7 +96,7 @@ function checkLimit($con = null, $conlimit = null) {
}
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
if($con === null){
$con = $db->queryFirstField('SELECT con FROM general WHERE `owner`=%i', Session::getUserID());
@@ -259,7 +259,7 @@ function cityInfo() {
function myNationInfo() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$userID = Session::getUserID();
@@ -437,7 +437,7 @@ function commandGroup($typename, $type=0) {
function commandTable() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$userID = Session::getUserID();
@@ -678,7 +678,7 @@ function commandTable() {
function CoreCommandTable() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$userID = Session::getUserID();
@@ -781,7 +781,7 @@ function myInfo() {
function generalInfo($no) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$query = "select show_img_level from game limit 1";
@@ -1089,7 +1089,7 @@ function generalInfo2($no) {
function adminMsg() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$query = "select msg from game limit 1";
@@ -1106,7 +1106,7 @@ function getOnlineNum() {
function onlinegen() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$onlinegen = "";
@@ -1126,7 +1126,7 @@ function onlinegen() {
function onlineNation() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$query = "select onlinenation from game limit 1";
@@ -1276,7 +1276,7 @@ function increaseRefresh($type="", $cnt=1) {
$date = date('Y-m-d H:i:s');
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$db->update('game', [
'refresh'=>$db->sqleval('refresh+%i', $cnt)
], true);
@@ -1347,7 +1347,7 @@ function increaseRefresh($type="", $cnt=1) {
function updateTraffic() {
$online = getOnlineNum();
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$game = $db->queryFirstRow('SELECT year,month,refresh,maxonline,maxrefresh from game limit 1');
//최다갱신자
@@ -1384,7 +1384,7 @@ function updateTraffic() {
function CheckOverhead() {
//서버정보
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$admin = $db->queryFirstRow('SELECT turnterm, conlimit from game LIMIT 1');
$con = Util::round(pow($admin['turnterm'], 0.6) * 3) * 10;
@@ -1432,7 +1432,7 @@ function unlock() {
function timeover() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$admin = DB::db()->queryFirstRow(
'SELECT turnterm,TIMESTAMPDIFF(SECOND,turntime,now()) as diff from game limit 1'
);
@@ -1446,7 +1446,7 @@ function timeover() {
function checkDelay() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
//서버정보
@@ -1479,7 +1479,7 @@ function checkDelay() {
function updateOnline() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$nationname = ["재야"];
@@ -1529,7 +1529,7 @@ function updateOnline() {
function checkTurn() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$alllog = [];
@@ -1572,6 +1572,7 @@ function checkTurn() {
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
return;
}
$gameStor->cacheAll();
// 1턴이상 갱신 없었으면 서버 지연
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', checkDelay');
checkDelay();
@@ -1627,6 +1628,7 @@ function checkTurn() {
// 잡금 해제
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', unlock');
$gameStor->resetCache(true);
unlock();
return false;
}
@@ -1748,6 +1750,7 @@ function checkTurn() {
processAuction();
// 잡금 해제
//if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', unlock');
$gameStor->resetCache(true);
unlock();
pushLockLog(["- checkTurn() 출 : ".date('Y-m-d H:i:s')." : ".$session->userName]);
@@ -1759,7 +1762,7 @@ function checkTurn() {
function addAge() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
//나이와 호봉 증가
@@ -1804,7 +1807,7 @@ function addAge() {
function turnDate($curtime) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$admin = $db->queryFirstRow('SELECT startyear,starttime,turnterm,year,month from game limit 1');
$turn = $admin['starttime'];
@@ -1833,7 +1836,7 @@ function turnDate($curtime) {
function triggerTournament() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$query = "select tournament,tnmt_trig from game limit 1";
@@ -1931,7 +1934,7 @@ function PreprocessCommand($no) {
function updateTurntime($no) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$alllog = [];
$log = [];
@@ -2182,7 +2185,7 @@ function CheckHall($no) {
function uniqueItem($general, $log, $vote=0) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$alllog = [];
$history = [];
@@ -2394,14 +2397,8 @@ function checkExperience($general, $log) {
function getAdmin() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$connect=$db->get();
$query = "select * from game limit 1";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
return $admin;
$gameStor = KVStorage::getStorage($db, 'game_env');
return $gameStor->getAll();
}
function getMe() {
@@ -2451,7 +2448,7 @@ function getNation($nation) {
function deleteNation($general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$history = [];
@@ -2487,7 +2484,7 @@ function deleteNation($general) {
function nextRuler($general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$query = "select year,month from game limit 1";
@@ -2695,7 +2692,7 @@ function CharCritical($rate, $personal) {
function SabotageInjury($city, $type=0) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
+2 -2
View File
@@ -18,7 +18,7 @@ function GetStuffName($stuff) {
function registerAuction() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$query = "select startyear,year,month,turnterm from game limit 1";
@@ -143,7 +143,7 @@ function registerAuction() {
function processAuction() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$trader = [];
+1 -1
View File
@@ -457,7 +457,7 @@ function getCoreTurn($nation, $level) {
function processCommand($no) {
$session = Session::getInstance();
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$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'";
+8 -8
View File
@@ -341,7 +341,7 @@ function updateQuaterly() {
// 벌점 감소와 건국제한-1 전턴제한-1 외교제한-1, 1달마다 실행, 병사 있는 장수의 군량 감소, 수입비율 조정
function preUpdateMonthly() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
//연감 월결산
@@ -494,7 +494,7 @@ function preUpdateMonthly() {
// 외교 로그처리, 외교 상태 처리
function postUpdateMonthly() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$query = "select startyear,year,month,scenario from game limit 1";
@@ -649,7 +649,7 @@ group by A.nation
function checkWander() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$query = "select year,month from game limit 1";
@@ -681,7 +681,7 @@ function checkWander() {
function checkMerge() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$mylog = [];
@@ -804,7 +804,7 @@ function checkMerge() {
function checkSurrender() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$query = "select year,month from game limit 1";
@@ -929,7 +929,7 @@ function checkSurrender() {
function updateNationState() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$history = array();
@@ -1011,7 +1011,7 @@ function updateNationState() {
function checkStatistic() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$query = "select year,month from game limit 1";
@@ -1168,7 +1168,7 @@ function checkStatistic() {
function checkEmperior() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$query = "select year,month,isUnited from game limit 1";
+3 -3
View File
@@ -151,7 +151,7 @@ function pushWorldHistory(array $history, $year=null, $month=null) {
return;
}
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
if($year === null || $month === null){
$game = $db->queryFirstRow('SELECT year, month FROM game LIMIT 1');
$year = $game['year'];
@@ -200,7 +200,7 @@ function pushGeneralPublicRecord(array $history, $year=null, $month=null) {
return;
}
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
if($year === null || $month === null){
$game = $db->queryFirstRow('SELECT year, month FROM game LIMIT 1');
$year = $game['year'];
@@ -251,7 +251,7 @@ function LogHistory($isFirst=0) {
if(STEP_LOG) pushStepLog(date('Y-m-d H:i:s').', LogHistory Start');
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$obj = $db->queryFirstRow('SELECT year, month, startyear FROM game limit 1');
//TODO: 새롭게 추가할 지도 값 받아오는 함수를 이용하여 재구성
+1 -1
View File
@@ -106,7 +106,7 @@ function printCitiesBasedOnDistance(int $cityNo, int $maxDistance=1) {
function info($type=0) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$query = "select year,month,turnterm,maxgeneral from game limit 1";
+1 -1
View File
@@ -54,7 +54,7 @@ function getWorldMap($req){
$userID = $session->userID;
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$game = $db->queryFirstRow('select `startyear`, `year`, `month` from `game` where `no` = 1');
$startYear = Util::toInt($game['startyear']);
+2 -2
View File
@@ -165,7 +165,7 @@ function SetCrew($no, $personal, $gold, $leader, $genType, $tech, $region, $city
function processAI($no) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$query = "select startyear,year,month,turnterm,scenario,gold_rate,rice_rate from game limit 1";
@@ -1046,7 +1046,7 @@ function processAI($no) {
function Promotion($nation, $level) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$lv = getNationChiefLevel($level);
+26 -26
View File
@@ -187,7 +187,7 @@ function CriticalScore($score, $type) {
function process_1(&$general, $type) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -289,7 +289,7 @@ function process_1(&$general, $type) {
function process_3(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -390,7 +390,7 @@ function process_3(&$general) {
function process_4(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -482,7 +482,7 @@ function process_4(&$general) {
function process_5(&$general, $type) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -584,7 +584,7 @@ function process_5(&$general, $type) {
function process_7(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -676,7 +676,7 @@ function process_7(&$general) {
function process_8(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -776,7 +776,7 @@ function process_8(&$general) {
function process_9(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -867,7 +867,7 @@ function process_9(&$general) {
function process_11(&$general, $type) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -1054,7 +1054,7 @@ function process_11(&$general, $type) {
function process_13(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -1124,7 +1124,7 @@ function process_13(&$general) {
function process_14(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -1187,7 +1187,7 @@ function process_14(&$general) {
function process_15(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -1261,7 +1261,7 @@ function process_15(&$general) {
function process_16(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -1355,7 +1355,7 @@ function process_16(&$general) {
function process_17(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -1397,7 +1397,7 @@ function process_17(&$general) {
function process_21(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -1459,7 +1459,7 @@ function process_21(&$general) {
function process_26(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -1526,7 +1526,7 @@ function process_26(&$general) {
function process_28(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -1593,7 +1593,7 @@ function process_28(&$general) {
function process_30(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -1662,7 +1662,7 @@ function process_30(&$general) {
function process_31(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -1804,7 +1804,7 @@ function process_31(&$general) {
function process_41(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -1874,7 +1874,7 @@ function process_41(&$general) {
function process_42(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -2096,7 +2096,7 @@ function process_42(&$general) {
function process_43(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$genlog = [];
@@ -2188,7 +2188,7 @@ function process_43(&$general) {
function process_44(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -2280,7 +2280,7 @@ function process_44(&$general) {
function process_48(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -2389,7 +2389,7 @@ function process_48(&$general) {
function process_49(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -2527,7 +2527,7 @@ function process_49(&$general) {
function process_50(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -2555,7 +2555,7 @@ function process_50(&$general) {
function process_99(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
+23 -23
View File
@@ -3,7 +3,7 @@ namespace sammo;
function process_23(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$genlog = [];
@@ -106,7 +106,7 @@ function process_23(&$general) {
function process_24(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$genlog = [];
@@ -235,7 +235,7 @@ function process_24(&$general) {
function process_27(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -313,7 +313,7 @@ function process_27(&$general) {
function process_51(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$date = substr($general['turntime'],11,5);
list($year, $month, $turnterm) = $db->queryFirstList('SELECT year,month,turnterm FROM game LIMIT 1');
@@ -397,7 +397,7 @@ function process_51(&$general) {
function process_52(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -510,7 +510,7 @@ function process_52(&$general) {
function process_53(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$date = substr($general['turntime'],11,5);
list($year, $month, $turnterm) = $db->queryFirstList('SELECT year,month,turnterm FROM game LIMIT 1');
@@ -595,7 +595,7 @@ function process_53(&$general) {
function process_61(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$date = substr($general['turntime'],11,5);
list($year, $month, $turnterm) = $db->queryFirstList('SELECT year,month,turnterm FROM game LIMIT 1');
@@ -696,7 +696,7 @@ function process_61(&$general) {
function process_62(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -817,7 +817,7 @@ function process_62(&$general) {
function process_63(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$date = substr($general['turntime'],11,5);
list($year, $month, $turnterm) = $db->queryFirstList('SELECT year,month,turnterm FROM game LIMIT 1');
@@ -901,7 +901,7 @@ function process_63(&$general) {
function process_64(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$date = substr($general['turntime'],11,5);
list($year, $month, $turnterm) = $db->queryFirstList('SELECT year,month,turnterm FROM game LIMIT 1');
@@ -985,7 +985,7 @@ function process_64(&$general) {
function process_65(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -1080,7 +1080,7 @@ function process_65(&$general) {
function process_66(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -1171,7 +1171,7 @@ function process_66(&$general) {
function process_67(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -1263,7 +1263,7 @@ function process_67(&$general) {
function process_68(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -1367,7 +1367,7 @@ function process_68(&$general) {
function process_71(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -1474,7 +1474,7 @@ function process_71(&$general) {
function process_72(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -1590,7 +1590,7 @@ function process_72(&$general) {
function process_73(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -1722,7 +1722,7 @@ function process_73(&$general) {
function process_74(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -1867,7 +1867,7 @@ function process_74(&$general) {
function process_75(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -1994,7 +1994,7 @@ function process_75(&$general) {
function process_76(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -2214,7 +2214,7 @@ function process_76(&$general) {
function process_77(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -2343,7 +2343,7 @@ function process_77(&$general) {
function process_78(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -2469,7 +2469,7 @@ function process_78(&$general) {
function process_81(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
+10 -10
View File
@@ -3,7 +3,7 @@ namespace sammo;
function process_22(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -61,7 +61,7 @@ function process_22(&$general) {
function process_25(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -185,7 +185,7 @@ function process_25(&$general) {
function process_29(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -440,7 +440,7 @@ function process_29(&$general) {
function process_45(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -553,7 +553,7 @@ function process_45(&$general) {
function process_46(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -642,7 +642,7 @@ function process_46(&$general) {
function process_47(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -708,7 +708,7 @@ function process_47(&$general) {
function process_54(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -775,7 +775,7 @@ function process_54(&$general) {
function process_55(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -865,7 +865,7 @@ function process_55(&$general) {
function process_56(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -919,7 +919,7 @@ function process_56(&$general) {
function process_57(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
+4 -4
View File
@@ -4,7 +4,7 @@ namespace sammo;
function process_32(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -130,7 +130,7 @@ function process_32(&$general) {
function process_33(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -283,7 +283,7 @@ function process_33(&$general) {
function process_34(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
@@ -410,7 +410,7 @@ function process_34(&$general) {
function process_35(&$general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$log = [];
+1 -1
View File
@@ -67,7 +67,7 @@ function CoreTurnTable() {
function allButton() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$npcmode = DB::db()->queryFirstField("select npcmode from game limit 1");
if($npcmode == 1) {
$site = "a_npcList.php";
+3 -3
View File
@@ -8,7 +8,7 @@ namespace sammo;
//1월마다 실행
function processSpring() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
//인구 증가
@@ -370,7 +370,7 @@ function processFall() {
function processRiceIncome() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$query = "select year,month,rice_rate from game limit 1";
@@ -572,7 +572,7 @@ function tradeRate() {
function disaster() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$query = "select startyear,year,month from game limit 1";
+12 -12
View File
@@ -4,7 +4,7 @@ namespace sammo;
function processTournament() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$query = "select tournament,phase,tnmt_type,tnmt_auto,tnmt_time,now() as now,TIMESTAMPDIFF(SECOND,tnmt_time,now()) as offset from game limit 1";
@@ -111,7 +111,7 @@ function processTournament() {
function getTournamentTerm() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$query = "select tnmt_auto from game limit 1";
@@ -133,7 +133,7 @@ function getTournamentTerm() {
function getTournamentTime() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$query = "select tournament,tnmt_time from game limit 1";
@@ -234,7 +234,7 @@ function printFighting($tournament, $phase) {
function startTournament($auto, $type) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
eraseTnmtFightLogAll();
@@ -273,7 +273,7 @@ function startTournament($auto, $type) {
function fillLowGenAll() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$general = [];
@@ -381,7 +381,7 @@ function getTwo($tournament, $phase) {
function qualify($tnmt_type, $tnmt, $phase) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$cand = getTwo($tnmt, $phase);
@@ -422,7 +422,7 @@ function qualifyAll($tnmt_type, $tnmt, $phase) {
function selection($tnmt_type, $tnmt, $phase) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
//시드1 배정
@@ -472,7 +472,7 @@ function selectionAll($tnmt_type, $tnmt, $phase) {
function finallySingle($tnmt_type, $tnmt, $phase) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$cand = getTwo($tnmt, $phase);
@@ -513,7 +513,7 @@ function finallyAll($tnmt_type, $tnmt, $phase) {
function final16set() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
//1조1-5조2, 2조1-6조2, 3조1-7조2, 4조1-8조2, 5조1-1조2, 6조1-2조2, 7조1-3조2, 8조1-4조2
@@ -538,7 +538,7 @@ function final16set() {
function finalFight($tnmt_type, $tnmt, $phase, $type) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
switch($type) {
@@ -571,7 +571,7 @@ function finalFight($tnmt_type, $tnmt, $phase, $type) {
function setGift($tnmt_type, $tnmt, $phase) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$query = "select year,month,develcost from game limit 1";
@@ -726,7 +726,7 @@ function setGift($tnmt_type, $tnmt, $phase) {
function setRefund() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$query = "select develcost from game limit 1";
+1 -1
View File
@@ -10,7 +10,7 @@ $userID = Session::getUserID();
increaseRefresh("메인", 1);
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
if (!$userID) {
+1 -1
View File
@@ -5,7 +5,7 @@ include 'lib.php';
include "func.php";
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$reserved = $db->queryFirstRow('SELECT `date`, options FROM reserved_open ORDER BY `date` ASC LIMIT 1');
if(!$reserved){
+1 -1
View File
@@ -21,7 +21,7 @@ $oNow = new \DateTimeImmutable();
$now = $oNow->format('Y-m-d H:i:s');
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$oldGeneral = $db->queryFirstField('SELECT `no` FROM general WHERE `owner`=%i', $userID);
if($oldGeneral !== null){
+1 -1
View File
@@ -16,7 +16,7 @@ if(!$pick){
$session = Session::requireLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$rootDB = RootDB::db();
$oNow = new \DateTimeImmutable();
+1 -1
View File
@@ -17,7 +17,7 @@ if(!class_exists('\\sammo\\DB')){
}
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
if(file_exists(__dir__.'/.htaccess')){
$reserved = $db->queryFirstRow(
+1 -1
View File
@@ -23,7 +23,7 @@ if (!$member) {
}
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
?>
+12 -14
View File
@@ -66,10 +66,10 @@ if (!$member) {
}
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$gameStor->cacheValues(['year','month','maxgeneral','scenario','show_img_level','turnterm','genius','npcmode']);
########## 동일 정보 존재여부 확인. ##########
$admin = $db->queryFirstRow('SELECT year,month,maxgeneral,scenario,show_img_level,turnterm,genius,npcmode from game limit 1');
$gencount = $db->queryFirstField('SELECT count(`no`) FROM general WHERE npc<2');
$oldGeneral = $db->queryFirstField('SELECT `no` FROM general WHERE `owner`=%i', $userID);
$oldName = $db->queryFirstField('SELECT `no` FROM general WHERE `name`=%s', $name);
@@ -88,7 +88,7 @@ if ($oldName) {
</script>");
exit;
}
if ($admin['maxgeneral'] <= $gencount) {
if ($gameStor->maxgeneral <= $gencount) {
echo("<script>
window.alert('더이상 등록할 수 없습니다!')
history.go(-1)
@@ -119,10 +119,8 @@ if ($leader + $power + $intel > 150) {
$genius = Util::randBool(0.01);
// 현재 1%
if ($genius && $admin['genius'] > 0) {
$db->update('game', [
'genius'=>$db->sqleval('genius-1')
], true);
if ($genius && $gameStor->genius > 0) {
$gameStor->genius = $gameStor->genius-1;
} else {
$genius = false;
}
@@ -240,14 +238,14 @@ $log = [];
$mylog = [];
if ($genius) {
$log[0] = "<C>●</>{$admin['month']}월:<G><b>{$cityname}</b></>에서 <Y>{$name}</>(이)라는 기재가 천하에 이름을 알립니다.";
$log[1] = "<C>●</>{$admin['month']}월:<C>".getGenSpecial($special2)."</> 특기를 가진 <C>천재</>의 등장으로 온 천하가 떠들썩합니다.";
$log[0] = "<C>●</>{$gameStor->month}월:<G><b>{$cityname}</b></>에서 <Y>{$name}</>(이)라는 기재가 천하에 이름을 알립니다.";
$log[1] = "<C>●</>{$gameStor->month}월:<C>".getGenSpecial($special2)."</> 특기를 가진 <C>천재</>의 등장으로 온 천하가 떠들썩합니다.";
pushWorldHistory(["<C>●</>{$admin['year']}{$admin['month']}월:<L><b>【천재】</b></><G><b>{$cityname}</b></>에 천재가 등장했습니다."], $admin['year'], $admin['month']);
pushWorldHistory(["<C>●</>{$gameStor->year}{$gameStor->month}월:<L><b>【천재】</b></><G><b>{$cityname}</b></>에 천재가 등장했습니다."], $gameStor->year, $gameStor->month);
} else {
$log[0] = "<C>●</>{$admin['month']}월:<G><b>{$cityname}</b></>에서 <Y>{$name}</>(이)라는 호걸이 천하에 이름을 알립니다.";
$log[0] = "<C>●</>{$gameStor->month}월:<G><b>{$cityname}</b></>에서 <Y>{$name}</>(이)라는 호걸이 천하에 이름을 알립니다.";
}
pushGeneralHistory($me, "<C>●</>{$admin['year']}{$admin['month']}월:<Y>{$name}</>, <G>{$cityname}</>에서 큰 뜻을 품다.");
pushGeneralHistory($me, "<C>●</>{$gameStor->year}{$gameStor->month}월:<Y>{$name}</>, <G>{$cityname}</>에서 큰 뜻을 품다.");
$mylog[] = "<C>●</>삼국지 모의전투 PHP의 세계에 오신 것을 환영합니다 ^o^";
$mylog[] = "<C>●</>처음 하시는 경우에는 <D>도움말</>을 참고하시고,";
$mylog[] = "<C>●</>문의사항이 있으시면 게시판에 글을 남겨주시면 되겠네요~";
@@ -256,10 +254,10 @@ $mylog[] = "<C>●</>통솔 <C>$pleader</> 무력 <C>$ppower</> 지력 <C>$pinte
$mylog[] = "<C>●</>연령은 <C>$age</>세로 시작합니다.";
if ($genius) {
$mylog[] = "<C>●</>축하합니다! 천재로 태어나 처음부터 <C>".getGenSpecial($special2)."</> 특기를 가지게 됩니다!";
pushGeneralHistory($me, "<C>●</>{$admin['year']}{$admin['month']}월:<C>".getGenSpecial($special2)."</> 특기를 가진 천재로 탄생.");
pushGeneralHistory($me, "<C>●</>{$gameStor->year}{$gameStor->month}월:<C>".getGenSpecial($special2)."</> 특기를 가진 천재로 탄생.");
}
pushGenLog($me, $mylog);
pushGeneralPublicRecord($log, $admin['year'], $admin['month']);
pushGeneralPublicRecord($log, $gameStor->year, $gameStor->month);
pushAdminLog(["가입 : {$userID} // {$name} // {$generalID}".getenv("REMOTE_ADDR")]);
+2 -2
View File
@@ -6,7 +6,7 @@ function processWar($general, $city) {
'@phan-var array<string,int|string|null> $general';
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$templates = new \League\Plates\Engine('templates');
@@ -1635,7 +1635,7 @@ function getRate($game, $type, $dtype) {
function addConflict($city, $nationID, $mykillnum) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$nationlist = [];
$killnum = [0];
+4 -4
View File
@@ -193,7 +193,7 @@ function command_99($turn) {
function command_11($turn, $command) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$userID = Session::getUserID();
@@ -402,7 +402,7 @@ function calc(cost, formnum) {
function command_12($turn, $command) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$userID = Session::getUserID();
@@ -963,7 +963,7 @@ function command_24($turn, $command) {
function command_25($turn, $command) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
$userID = Session::getUserID();
@@ -1531,7 +1531,7 @@ function command_44($turn, $command) {
function command_46($turn, $command) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
starter("건국");
+1 -1
View File
@@ -225,7 +225,7 @@ class DiplomaticMessage extends Message{
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$general = $db->queryFirstRow(
'SELECT `name`, `level` FROM general WHERE `no`=%i AND nation=%i',
+1 -1
View File
@@ -24,7 +24,7 @@ class Diplomacy{
}
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$srcNation = $db->queryFirstRow(
'SELECT nation, `name`, `power`, capital, gold, rice, surlimit, color, `level` FROM nation WHERE nation=%i',
$srcNationID
+1 -1
View File
@@ -21,7 +21,7 @@ class Personnel{
public function __construct(int $nationID, int $senderID){
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$nation = $db->queryFirstRow(
'SELECT nation, `name`, `level`, capital, scout FROM nation WHERE nation=%i',
$nationID
+5 -2
View File
@@ -89,7 +89,7 @@ class ResetHelper{
}
}
(KVStorage::getStorage($db, 'game'))->resetValues();
(KVStorage::getStorage($db, 'game_env'))->resetValues();
return [
'result'=>true
@@ -131,6 +131,7 @@ class ResetHelper{
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game_env');
$db->insert('plock', [
'plock'=>1
]);
@@ -194,7 +195,9 @@ class ResetHelper{
]);
}
$db->insert('game', $env);
foreach($env as $key=>$value){
$gameStor->$key = $value;
}
$scenarioObj->build($env);
+1 -1
View File
@@ -7,7 +7,7 @@ include "func.php";
$session = Session::requireLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
list($npcmode, $maxgeneral) = $db->queryFirstList('SELECT npcmode,maxgeneral FROM game LIMIT 1');
+1 -1
View File
@@ -18,7 +18,7 @@ $session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$connect=$db->get();
increaseRefresh("턴반복", 1);
+1 -1
View File
@@ -230,7 +230,7 @@ class Session
}
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$gameStor = KVStorage::getStorage($db, 'game_env');
$general = $db->queryFirstRow(
'SELECT `no`, `name`, `killturn`, `turntime` from general where `owner` = %i',