KVStorage로 game 테이블 대체 준비

This commit is contained in:
2018-05-12 22:05:44 +09:00
parent 5e74a34d3e
commit 52f4b79fdf
65 changed files with 243 additions and 20 deletions
+25 -1
View File
@@ -96,6 +96,7 @@ function checkLimit($con = null, $conlimit = null) {
}
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
if($con === null){
$con = $db->queryFirstField('SELECT con FROM general WHERE `owner`=%i', Session::getUserID());
@@ -258,6 +259,7 @@ function cityInfo() {
function myNationInfo() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$connect=$db->get();
$userID = Session::getUserID();
@@ -435,6 +437,7 @@ function commandGroup($typename, $type=0) {
function commandTable() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$connect=$db->get();
$userID = Session::getUserID();
@@ -675,6 +678,7 @@ function commandTable() {
function CoreCommandTable() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$connect=$db->get();
$userID = Session::getUserID();
@@ -777,6 +781,7 @@ function myInfo() {
function generalInfo($no) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$connect=$db->get();
$query = "select show_img_level from game limit 1";
@@ -1084,6 +1089,7 @@ function generalInfo2($no) {
function adminMsg() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$connect=$db->get();
$query = "select msg from game limit 1";
@@ -1100,6 +1106,7 @@ function getOnlineNum() {
function onlinegen() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$connect=$db->get();
$onlinegen = "";
@@ -1119,6 +1126,7 @@ function onlinegen() {
function onlineNation() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$connect=$db->get();
$query = "select onlinenation from game limit 1";
@@ -1268,6 +1276,7 @@ function increaseRefresh($type="", $cnt=1) {
$date = date('Y-m-d H:i:s');
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$db->update('game', [
'refresh'=>$db->sqleval('refresh+%i', $cnt)
], true);
@@ -1338,6 +1347,7 @@ function increaseRefresh($type="", $cnt=1) {
function updateTraffic() {
$online = getOnlineNum();
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$game = $db->queryFirstRow('SELECT year,month,refresh,maxonline,maxrefresh from game limit 1');
//최다갱신자
@@ -1374,6 +1384,7 @@ function updateTraffic() {
function CheckOverhead() {
//서버정보
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$admin = $db->queryFirstRow('SELECT turnterm, conlimit from game LIMIT 1');
$con = Util::round(pow($admin['turnterm'], 0.6) * 3) * 10;
@@ -1420,6 +1431,8 @@ function unlock() {
}
function timeover() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$admin = DB::db()->queryFirstRow(
'SELECT turnterm,TIMESTAMPDIFF(SECOND,turntime,now()) as diff from game limit 1'
);
@@ -1433,6 +1446,7 @@ function timeover() {
function checkDelay() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$connect=$db->get();
//서버정보
@@ -1465,6 +1479,7 @@ function checkDelay() {
function updateOnline() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$connect=$db->get();
$nationname = ["재야"];
@@ -1514,6 +1529,7 @@ function updateOnline() {
function checkTurn() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$connect=$db->get();
$alllog = [];
@@ -1743,6 +1759,7 @@ function checkTurn() {
function addAge() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$connect=$db->get();
//나이와 호봉 증가
@@ -1787,7 +1804,7 @@ function addAge() {
function turnDate($curtime) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$admin = $db->queryFirstRow('SELECT startyear,starttime,turnterm,year,month from game limit 1');
$turn = $admin['starttime'];
@@ -1816,6 +1833,7 @@ function turnDate($curtime) {
function triggerTournament() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$connect=$db->get();
$query = "select tournament,tnmt_trig from game limit 1";
@@ -1913,6 +1931,7 @@ function PreprocessCommand($no) {
function updateTurntime($no) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$connect=$db->get();
$alllog = [];
$log = [];
@@ -2163,6 +2182,7 @@ function CheckHall($no) {
function uniqueItem($general, $log, $vote=0) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$connect=$db->get();
$alllog = [];
$history = [];
@@ -2374,6 +2394,7 @@ function checkExperience($general, $log) {
function getAdmin() {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$connect=$db->get();
$query = "select * from game limit 1";
@@ -2430,6 +2451,7 @@ function getNation($nation) {
function deleteNation($general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$connect=$db->get();
$history = [];
@@ -2465,6 +2487,7 @@ function deleteNation($general) {
function nextRuler($general) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$connect=$db->get();
$query = "select year,month from game limit 1";
@@ -2672,6 +2695,7 @@ function CharCritical($rate, $personal) {
function SabotageInjury($city, $type=0) {
$db = DB::db();
$gameStor = KVStorage::getStorage($db, 'game');
$connect=$db->get();
$log = [];