단순 국가 정보를 받아올 때 query하지 않고 저장된 값을 쓰도록 변경

This commit is contained in:
2018-02-24 17:41:04 +09:00
parent b28603d16f
commit 2cd7d525a4
23 changed files with 57 additions and 153 deletions
+11 -4
View File
@@ -142,7 +142,7 @@ function getGeneralName($forceExit=false)
/**
* nationID를 이용하여 국가의 '어지간해선' 변경되지 않는 정보(이름, 색, 성향, 규모, 수도)를 반환해줌
*
* @param int|null $nationID 국가 코드
* @param int|null $nationID 국가 코드, -1인 경우 전체, null인 경우 수행하지 않음
* @param bool $forceRefresh 강제 갱신 여부
*
* @return array|null nationID에 해당하는 국가가 있을 경우 array 반환. 그외의 경우 null
@@ -160,9 +160,9 @@ function getNationStaticInfo($nationID, $forceRefresh=false)
}
if($nationList === null){
$nationList = ArrayToDict(
getDB()->query("select nation, name, color, type, level, capital from nation"),
"nation");
$nationAll = getDB()->query("select nation, name, color, type, level, capital from nation");
$nationList = ArrayToDict($nationAll, "nation");
$nationList[-1] = $nationAll;
}
if(isset($nationList[$nationID])){
@@ -178,6 +178,13 @@ function refreshNationStaticInfo(){
getNationStaticInfo(null, true);
}
/**
* getNationStaticInfo(-1) 의 단축형
*/
function getAllNationStaticInfo(){
return getNationStaticInfo(-1);
}
function GetImageURL($imgsvr) {
global $image, $image1;
if($imgsvr == 0) {