From 67ecd514a4dc9907b5173fc3335a9437d75d321c Mon Sep 17 00:00:00 2001 From: hide_d Date: Sat, 12 May 2018 22:21:53 +0900 Subject: [PATCH] =?UTF-8?q?KVStorage=EC=9D=98=20game=20namespace=EB=A5=BC?= =?UTF-8?q?=20game=5Fenv=EB=A1=9C=20'=ED=8E=B8=EC=9D=98=EB=A5=BC=20?= =?UTF-8?q?=EC=9C=84=ED=95=B4'=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/_119.php | 2 +- hwe/_119_b.php | 2 +- hwe/_admin1_submit.php | 2 +- hwe/_admin2.php | 2 +- hwe/_admin2_submit.php | 2 +- hwe/_admin4.php | 2 +- hwe/_admin5.php | 2 +- hwe/_simul.php | 2 +- hwe/a_bestGeneral.php | 2 +- hwe/a_genList.php | 2 +- hwe/a_history.php | 2 +- hwe/a_kingdomList.php | 2 +- hwe/a_status.php | 3 +- hwe/a_traffic.php | 2 +- hwe/a_vote.php | 2 +- hwe/b_auction.php | 2 +- hwe/b_battleCenter.php | 3 +- hwe/b_betting.php | 2 +- hwe/b_chiefcenter.php | 2 +- hwe/b_dipcenter.php | 2 +- hwe/b_diplomacy.php | 2 +- hwe/b_genList.php | 2 +- hwe/b_myKingdomInfo.php | 2 +- hwe/b_myPage.php | 2 +- hwe/b_tournament.php | 2 +- hwe/c_auction.php | 2 +- hwe/c_betting.php | 2 +- hwe/c_myBossInfo.php | 2 +- hwe/c_tournament.php | 2 +- hwe/c_vacation.php | 2 +- hwe/c_vote.php | 2 +- hwe/commandlist.php | 2 +- hwe/func.php | 59 ++++++++++++++++----------------- hwe/func_auction.php | 4 +-- hwe/func_command.php | 2 +- hwe/func_gamerule.php | 16 ++++----- hwe/func_history.php | 6 ++-- hwe/func_legacy.php | 2 +- hwe/func_map.php | 2 +- hwe/func_npc.php | 4 +-- hwe/func_process.php | 52 ++++++++++++++--------------- hwe/func_process_chief.php | 46 ++++++++++++------------- hwe/func_process_personnel.php | 20 +++++------ hwe/func_process_sabotage.php | 8 ++--- hwe/func_template.php | 2 +- hwe/func_time_event.php | 6 ++-- hwe/func_tournament.php | 24 +++++++------- hwe/index.php | 2 +- hwe/j_autoreset.php | 2 +- hwe/j_get_select_npc_token.php | 2 +- hwe/j_select_npc.php | 2 +- hwe/j_server_basic_info.php | 2 +- hwe/join.php | 2 +- hwe/join_post.php | 26 +++++++-------- hwe/process_war.php | 4 +-- hwe/processing.php | 8 ++--- hwe/sammo/DiplomaticMessage.php | 2 +- hwe/sammo/Engine/Diplomacy.php | 2 +- hwe/sammo/Engine/Personnel.php | 2 +- hwe/sammo/ResetHelper.php | 7 ++-- hwe/select_npc.php | 2 +- hwe/turn.php | 2 +- src/sammo/Session.php | 2 +- 63 files changed, 194 insertions(+), 194 deletions(-) diff --git a/hwe/_119.php b/hwe/_119.php index 1d65c38c..118d0a40 100644 --- a/hwe/_119.php +++ b/hwe/_119.php @@ -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"; diff --git a/hwe/_119_b.php b/hwe/_119_b.php index 2b957332..a6a7df24 100644 --- a/hwe/_119_b.php +++ b/hwe/_119_b.php @@ -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) { diff --git a/hwe/_admin1_submit.php b/hwe/_admin1_submit.php index 7423696a..d47f606a 100644 --- a/hwe/_admin1_submit.php +++ b/hwe/_admin1_submit.php @@ -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(); diff --git a/hwe/_admin2.php b/hwe/_admin2.php index c7d363ca..afb6dade 100644 --- a/hwe/_admin2.php +++ b/hwe/_admin2.php @@ -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"; diff --git a/hwe/_admin2_submit.php b/hwe/_admin2_submit.php index ac4160b3..3a5ad413 100644 --- a/hwe/_admin2_submit.php +++ b/hwe/_admin2_submit.php @@ -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); diff --git a/hwe/_admin4.php b/hwe/_admin4.php index f95f7f0c..79dd383c 100644 --- a/hwe/_admin4.php +++ b/hwe/_admin4.php @@ -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"; diff --git a/hwe/_admin5.php b/hwe/_admin5.php index 214a8ac4..f65e4c6d 100644 --- a/hwe/_admin5.php +++ b/hwe/_admin5.php @@ -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 = []; diff --git a/hwe/_simul.php b/hwe/_simul.php index 875f5448..20068c1a 100644 --- a/hwe/_simul.php +++ b/hwe/_simul.php @@ -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); diff --git a/hwe/a_bestGeneral.php b/hwe/a_bestGeneral.php index 3e8945ae..16834e81 100644 --- a/hwe/a_bestGeneral.php +++ b/hwe/a_bestGeneral.php @@ -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); diff --git a/hwe/a_genList.php b/hwe/a_genList.php index 3e59a071..2dea8161 100644 --- a/hwe/a_genList.php +++ b/hwe/a_genList.php @@ -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); diff --git a/hwe/a_history.php b/hwe/a_history.php index a798931e..12937738 100644 --- a/hwe/a_history.php +++ b/hwe/a_history.php @@ -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); diff --git a/hwe/a_kingdomList.php b/hwe/a_kingdomList.php index e83fb199..fcbb41cd 100644 --- a/hwe/a_kingdomList.php +++ b/hwe/a_kingdomList.php @@ -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); diff --git a/hwe/a_status.php b/hwe/a_status.php index 1f5e3a39..fc8e524d 100644 --- a/hwe/a_status.php +++ b/hwe/a_status.php @@ -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),""); diff --git a/hwe/a_traffic.php b/hwe/a_traffic.php index 849e3ceb..c1a455a8 100644 --- a/hwe/a_traffic.php +++ b/hwe/a_traffic.php @@ -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); diff --git a/hwe/a_vote.php b/hwe/a_vote.php index acbfa659..e79b42ee 100644 --- a/hwe/a_vote.php +++ b/hwe/a_vote.php @@ -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); diff --git a/hwe/b_auction.php b/hwe/b_auction.php index 3bf0ba4d..c89f1917 100644 --- a/hwe/b_auction.php +++ b/hwe/b_auction.php @@ -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); diff --git a/hwe/b_battleCenter.php b/hwe/b_battleCenter.php index 33c784d6..3dc5bee3 100644 --- a/hwe/b_battleCenter.php +++ b/hwe/b_battleCenter.php @@ -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), ""); diff --git a/hwe/b_betting.php b/hwe/b_betting.php index d9bd57c9..254a8032 100644 --- a/hwe/b_betting.php +++ b/hwe/b_betting.php @@ -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); diff --git a/hwe/b_chiefcenter.php b/hwe/b_chiefcenter.php index 18b66cbd..ea01a8a8 100644 --- a/hwe/b_chiefcenter.php +++ b/hwe/b_chiefcenter.php @@ -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); diff --git a/hwe/b_dipcenter.php b/hwe/b_dipcenter.php index 96b4f141..2e4fb875 100644 --- a/hwe/b_dipcenter.php +++ b/hwe/b_dipcenter.php @@ -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); diff --git a/hwe/b_diplomacy.php b/hwe/b_diplomacy.php index 5b905d06..3a451dfa 100644 --- a/hwe/b_diplomacy.php +++ b/hwe/b_diplomacy.php @@ -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); diff --git a/hwe/b_genList.php b/hwe/b_genList.php index 0610e207..f77ae5c4 100644 --- a/hwe/b_genList.php +++ b/hwe/b_genList.php @@ -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); diff --git a/hwe/b_myKingdomInfo.php b/hwe/b_myKingdomInfo.php index b2a659f5..918aff99 100644 --- a/hwe/b_myKingdomInfo.php +++ b/hwe/b_myKingdomInfo.php @@ -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); diff --git a/hwe/b_myPage.php b/hwe/b_myPage.php index 505f4bbf..1eaf4069 100644 --- a/hwe/b_myPage.php +++ b/hwe/b_myPage.php @@ -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); diff --git a/hwe/b_tournament.php b/hwe/b_tournament.php index 9a5d1aa9..c9c538e5 100644 --- a/hwe/b_tournament.php +++ b/hwe/b_tournament.php @@ -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); diff --git a/hwe/c_auction.php b/hwe/c_auction.php index 2ebe6a81..454e7e13 100644 --- a/hwe/c_auction.php +++ b/hwe/c_auction.php @@ -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); diff --git a/hwe/c_betting.php b/hwe/c_betting.php index 63333526..c6b8867d 100644 --- a/hwe/c_betting.php +++ b/hwe/c_betting.php @@ -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); diff --git a/hwe/c_myBossInfo.php b/hwe/c_myBossInfo.php index be5dee5e..0c6d70cb 100644 --- a/hwe/c_myBossInfo.php +++ b/hwe/c_myBossInfo.php @@ -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"; diff --git a/hwe/c_tournament.php b/hwe/c_tournament.php index 7ec08161..e8d53140 100644 --- a/hwe/c_tournament.php +++ b/hwe/c_tournament.php @@ -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"; diff --git a/hwe/c_vacation.php b/hwe/c_vacation.php index 2549db77..ea2ff873 100644 --- a/hwe/c_vacation.php +++ b/hwe/c_vacation.php @@ -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"; diff --git a/hwe/c_vote.php b/hwe/c_vote.php index f15b464f..8e445774 100644 --- a/hwe/c_vote.php +++ b/hwe/c_vote.php @@ -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"; diff --git a/hwe/commandlist.php b/hwe/commandlist.php index c315c8fb..cdc3f341 100644 --- a/hwe/commandlist.php +++ b/hwe/commandlist.php @@ -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(); diff --git a/hwe/func.php b/hwe/func.php index 36595e41..844e6b1d 100644 --- a/hwe/func.php +++ b/hwe/func.php @@ -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 = []; diff --git a/hwe/func_auction.php b/hwe/func_auction.php index 9ec3b1e1..fab11a68 100644 --- a/hwe/func_auction.php +++ b/hwe/func_auction.php @@ -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 = []; diff --git a/hwe/func_command.php b/hwe/func_command.php index 961bfeda..36d3d8c5 100644 --- a/hwe/func_command.php +++ b/hwe/func_command.php @@ -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'"; diff --git a/hwe/func_gamerule.php b/hwe/func_gamerule.php index e809e4fe..accae1a6 100644 --- a/hwe/func_gamerule.php +++ b/hwe/func_gamerule.php @@ -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"; diff --git a/hwe/func_history.php b/hwe/func_history.php index 94ec01e8..30e2374f 100644 --- a/hwe/func_history.php +++ b/hwe/func_history.php @@ -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: 새롭게 추가할 지도 값 받아오는 함수를 이용하여 재구성 diff --git a/hwe/func_legacy.php b/hwe/func_legacy.php index 5368284e..119b13cd 100644 --- a/hwe/func_legacy.php +++ b/hwe/func_legacy.php @@ -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"; diff --git a/hwe/func_map.php b/hwe/func_map.php index c3e798c6..f13e523a 100644 --- a/hwe/func_map.php +++ b/hwe/func_map.php @@ -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']); diff --git a/hwe/func_npc.php b/hwe/func_npc.php index 8458be65..80b896f2 100644 --- a/hwe/func_npc.php +++ b/hwe/func_npc.php @@ -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); diff --git a/hwe/func_process.php b/hwe/func_process.php index dc71792c..9d749103 100644 --- a/hwe/func_process.php +++ b/hwe/func_process.php @@ -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 = []; diff --git a/hwe/func_process_chief.php b/hwe/func_process_chief.php index 15483b72..59cd66c2 100644 --- a/hwe/func_process_chief.php +++ b/hwe/func_process_chief.php @@ -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 = []; diff --git a/hwe/func_process_personnel.php b/hwe/func_process_personnel.php index 5392d330..7853eeca 100644 --- a/hwe/func_process_personnel.php +++ b/hwe/func_process_personnel.php @@ -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 = []; diff --git a/hwe/func_process_sabotage.php b/hwe/func_process_sabotage.php index 36cbc368..439a223e 100644 --- a/hwe/func_process_sabotage.php +++ b/hwe/func_process_sabotage.php @@ -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 = []; diff --git a/hwe/func_template.php b/hwe/func_template.php index 68d48702..1ffffcf8 100644 --- a/hwe/func_template.php +++ b/hwe/func_template.php @@ -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"; diff --git a/hwe/func_time_event.php b/hwe/func_time_event.php index e817679f..a1cfdb7e 100644 --- a/hwe/func_time_event.php +++ b/hwe/func_time_event.php @@ -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"; diff --git a/hwe/func_tournament.php b/hwe/func_tournament.php index 3c70329b..eafb1ca7 100644 --- a/hwe/func_tournament.php +++ b/hwe/func_tournament.php @@ -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"; diff --git a/hwe/index.php b/hwe/index.php index 85acf8d9..7a38b7b7 100644 --- a/hwe/index.php +++ b/hwe/index.php @@ -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) { diff --git a/hwe/j_autoreset.php b/hwe/j_autoreset.php index bc35fff1..5f9a97b8 100644 --- a/hwe/j_autoreset.php +++ b/hwe/j_autoreset.php @@ -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){ diff --git a/hwe/j_get_select_npc_token.php b/hwe/j_get_select_npc_token.php index f59d1bef..8c79d64c 100644 --- a/hwe/j_get_select_npc_token.php +++ b/hwe/j_get_select_npc_token.php @@ -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){ diff --git a/hwe/j_select_npc.php b/hwe/j_select_npc.php index 199cbcb0..90c733ed 100644 --- a/hwe/j_select_npc.php +++ b/hwe/j_select_npc.php @@ -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(); diff --git a/hwe/j_server_basic_info.php b/hwe/j_server_basic_info.php index 88ceb33d..0b367ee1 100644 --- a/hwe/j_server_basic_info.php +++ b/hwe/j_server_basic_info.php @@ -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( diff --git a/hwe/join.php b/hwe/join.php index 35621580..76a45232 100644 --- a/hwe/join.php +++ b/hwe/join.php @@ -23,7 +23,7 @@ if (!$member) { } $db = DB::db(); -$gameStor = KVStorage::getStorage($db, 'game'); +$gameStor = KVStorage::getStorage($db, 'game_env'); $connect=$db->get(); ?> diff --git a/hwe/join_post.php b/hwe/join_post.php index 45f576c2..fd4b35d6 100644 --- a/hwe/join_post.php +++ b/hwe/join_post.php @@ -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) { "); exit; } -if ($admin['maxgeneral'] <= $gencount) { +if ($gameStor->maxgeneral <= $gencount) { echo("