refeshNationStaticInfo 함수 추가
getNationStaticInfo 함수에 level 추가
This commit is contained in:
+1
-1
@@ -199,7 +199,7 @@ $history[count($history)] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<
|
||||
$history[count($history)] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【이벤트】</b></>이민족의 기세는 그 누구도 막을 수 없을듯 합니다!";
|
||||
pushHistory($connect, $history);
|
||||
|
||||
getNationStaticInfo(null, true);
|
||||
refreshNationStaticInfo();
|
||||
|
||||
echo "<script>location.replace('./');</script>";
|
||||
|
||||
|
||||
+1
-1
@@ -203,7 +203,7 @@ $history[count($history)] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<
|
||||
$history[count($history)] = "<C>●</>{$admin['year']}년 {$admin['month']}월:<L><b>【이벤트】</b></>그러나 중원의 영웅들이라면 막아낼 수도 있을법 해 보입니다!";
|
||||
pushHistory($connect, $history);
|
||||
|
||||
getNationStaticInfo(null, true);
|
||||
refreshNationStaticInfo();
|
||||
|
||||
echo "<script>location.replace('./');</script>";
|
||||
|
||||
|
||||
+9
-4
@@ -140,7 +140,7 @@ function getGeneralName($forceExit=false)
|
||||
}
|
||||
|
||||
/**
|
||||
* nationID를 이용하여 국가의 '어지간해선' 변경되지 않는 정보(이름, 색, 성향, 수도)를 반환해줌
|
||||
* nationID를 이용하여 국가의 '어지간해선' 변경되지 않는 정보(이름, 색, 성향, 규모, 수도)를 반환해줌
|
||||
*
|
||||
* @param int|null $nationID 국가 코드
|
||||
* @param bool $forceRefresh 강제 갱신 여부
|
||||
@@ -161,7 +161,7 @@ function getNationStaticInfo($nationID, $forceRefresh=false)
|
||||
|
||||
if($nationList === null){
|
||||
$nationList = ArrayToDict(
|
||||
getDB()->query("select nation, name, color, type, capital from nation"),
|
||||
getDB()->query("select nation, name, color, type, level, capital from nation"),
|
||||
"nation");
|
||||
}
|
||||
|
||||
@@ -169,8 +169,13 @@ function getNationStaticInfo($nationID, $forceRefresh=false)
|
||||
return $nationList[$nationID];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getNationStaticInfo() 함수의 국가 캐시를 초기화
|
||||
*/
|
||||
function refreshNationStaticInfo(){
|
||||
getNationStaticInfo(null, true);
|
||||
}
|
||||
|
||||
function GetImageURL($imgsvr) {
|
||||
@@ -3757,7 +3762,7 @@ function deleteNation($connect, $general) {
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
pushHistory($connect, $history);
|
||||
getNationStaticInfo(null, false);
|
||||
refreshNationStaticInfo();
|
||||
}
|
||||
|
||||
function nextRuler($connect, $general) {
|
||||
|
||||
@@ -868,7 +868,7 @@ function checkMerge($connect) {
|
||||
unset($youlog);
|
||||
unset($history);
|
||||
|
||||
getNationStaticInfo(null, true);
|
||||
refreshNationStaticInfo();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -988,7 +988,7 @@ function checkSurrender($connect) {
|
||||
unset($youlog);
|
||||
unset($history);
|
||||
|
||||
getNationStaticInfo(null, true);
|
||||
refreshNationStaticInfo();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1058,6 +1058,8 @@ function updateNationState($connect) {
|
||||
//작위 상승
|
||||
$query = "update nation set level='{$nation['level']}' where nation='{$nation['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
refreshNationStaticInfo();
|
||||
}
|
||||
$gennum = $gencount;
|
||||
if($gencount < 10) $gencount = 10;
|
||||
|
||||
+1
-1
@@ -1042,7 +1042,7 @@ function RegCity($connect, $nation, $name, $cap=0) {
|
||||
if($cap > 0) {
|
||||
@MYDB_query("update nation set capital='$city' where nation='$nation'",$connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
}
|
||||
getNationStaticInfo(null, true);
|
||||
refreshNationStaticInfo();
|
||||
}
|
||||
|
||||
function Promotion($connect, $nation, $level) {
|
||||
|
||||
@@ -3698,7 +3698,7 @@ function process_46($connect, &$general) {
|
||||
$exp = 1000;
|
||||
$ded = 1000;
|
||||
|
||||
getNationStaticInfo(null, true);
|
||||
refreshNationStaticInfo();
|
||||
|
||||
// 성격 보정
|
||||
$exp = CharExperience($exp, $general['personal']);
|
||||
@@ -3773,7 +3773,7 @@ function process_47($connect, &$general) {
|
||||
|
||||
pushHistory($connect, $history);
|
||||
|
||||
getNationStaticInfo(null, true);
|
||||
refreshNationStaticInfo();
|
||||
}
|
||||
pushAllLog($alllog);
|
||||
pushGenLog($general, $log);
|
||||
@@ -4401,7 +4401,7 @@ function process_55($connect, &$general) {
|
||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
$nationcount = MYDB_num_rows($result);
|
||||
|
||||
getNationStaticInfo(null, true);
|
||||
refreshNationStaticInfo();
|
||||
|
||||
for($i=0; $i < $nationcount; $i++) {
|
||||
$younation = MYDB_fetch_array($result);
|
||||
@@ -4460,7 +4460,7 @@ function process_56($connect, &$general) {
|
||||
DeleteConflict($connect, $general['nation']);
|
||||
deleteNation($connect, $general);
|
||||
|
||||
getNationStaticInfo(null, true);
|
||||
refreshNationStaticInfo();
|
||||
}
|
||||
pushAllLog($alllog);
|
||||
pushGenLog($general, $log);
|
||||
@@ -5007,7 +5007,7 @@ function process_66($connect, &$general) {
|
||||
$query = "update general set dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
getNationStaticInfo(null, true);
|
||||
refreshNationStaticInfo();
|
||||
}
|
||||
|
||||
pushHistory($connect, $history);
|
||||
@@ -6326,7 +6326,7 @@ function process_81($connect, &$general) {
|
||||
$query = "update general set dedication=dedication+'$ded',experience=experience+'$exp' where no='{$general['no']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
getNationStaticInfo(null, true);
|
||||
refreshNationStaticInfo();
|
||||
}
|
||||
|
||||
pushHistory($connect, $history);
|
||||
|
||||
+1
-1
@@ -1861,7 +1861,7 @@ function ConquerCity($connect, $game, $general, $city, $nation, $destnation) {
|
||||
$query = "update general set atmos=atmos*0.8 where nation='{$destnation['nation']}'";
|
||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||
|
||||
getNationStaticInfo(null, true);
|
||||
refreshNationStaticInfo();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user