* generalID, generalName 동작 안하는 문제 해결
* Event 관련 클래스 표기 실수 해결
This commit is contained in:
@@ -187,6 +187,11 @@ function popIncrease($connect) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getGoldIncome($connect, $nationNo, $rate, $admin_rate, $type) {
|
function getGoldIncome($connect, $nationNo, $rate, $admin_rate, $type) {
|
||||||
|
$level2 = [];
|
||||||
|
$level3 = [];
|
||||||
|
$level4 = [];
|
||||||
|
|
||||||
|
|
||||||
$query = "select no,city from general where nation='$nationNo' and level=4"; // 태수
|
$query = "select no,city from general where nation='$nationNo' and level=4"; // 태수
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$count = MYDB_num_rows($result);
|
$count = MYDB_num_rows($result);
|
||||||
@@ -225,9 +230,9 @@ function getGoldIncome($connect, $nationNo, $rate, $admin_rate, $type) {
|
|||||||
$tax1 = ($city['pop'] * $city['comm'] / $city['comm2'] * $ratio / 1000) / 3;
|
$tax1 = ($city['pop'] * $city['comm'] / $city['comm2'] * $ratio / 1000) / 3;
|
||||||
$tax1 *= (1 + $city['secu']/$city['secu2']/10); //치안에 따라 최대 10% 추가
|
$tax1 *= (1 + $city['secu']/$city['secu2']/10); //치안에 따라 최대 10% 추가
|
||||||
//도시 관직 추가 세수
|
//도시 관직 추가 세수
|
||||||
if($level4[$city['gen1']] == $city['city']) { $tax1 *= 1.05; }
|
if(Util::array_get($level4[$city['gen1']]) == $city['city']) { $tax1 *= 1.05; }
|
||||||
if($level3[$city['gen2']] == $city['city']) { $tax1 *= 1.05; }
|
if(Util::array_get($level3[$city['gen2']]) == $city['city']) { $tax1 *= 1.05; }
|
||||||
if($level2[$city['gen3']] == $city['city']) { $tax1 *= 1.05; }
|
if(Util::array_get($level2[$city['gen3']]) == $city['city']) { $tax1 *= 1.05; }
|
||||||
//수도 추가 세수 130%~105%
|
//수도 추가 세수 130%~105%
|
||||||
if($city['city'] == $nation['capital']) { $tax1 *= 1+(1/3/$nation['level']); };
|
if($city['city'] == $nation['capital']) { $tax1 *= 1+(1/3/$nation['level']); };
|
||||||
|
|
||||||
|
|||||||
@@ -2,22 +2,21 @@
|
|||||||
namespace sammo;
|
namespace sammo;
|
||||||
|
|
||||||
include('lib.php');
|
include('lib.php');
|
||||||
include('func.php');
|
|
||||||
|
|
||||||
$result = [
|
$result = [
|
||||||
"generalID"=>null,
|
"generalID"=>null,
|
||||||
"myNationID"=>null,
|
"myNationID"=>null,
|
||||||
"isChief"=>false
|
"isChief"=>false
|
||||||
];
|
];
|
||||||
$generalID = Session::Instance()->generalID;
|
$session = Session::Instance()->loginGame()->setReadOnly();
|
||||||
|
|
||||||
session_write_close();
|
$generalID = $session->generalID;
|
||||||
|
|
||||||
if(!$generalID){
|
if(!$generalID){
|
||||||
Json::die($result);
|
Json::die($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
$generalInfo = DB::db()->queryFirstRow('SELECT `nation`, `level` from `general` where `id`=%i', $generalID);
|
$generalInfo = DB::db()->queryFirstRow('SELECT `nation`, `level` from `general` where `no`=%i', $generalID);
|
||||||
if(!$generalInfo){
|
if(!$generalInfo){
|
||||||
Json::die($result);
|
Json::die($result);
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-9
@@ -33,21 +33,21 @@ function reloadWorldMap(option){
|
|||||||
var cityPosition = getCityPosition();
|
var cityPosition = getCityPosition();
|
||||||
|
|
||||||
//OBJ : startYear, year, month, cityList, nationList, spyList, shownByGeneralList, myCity
|
//OBJ : startYear, year, month, cityList, nationList, spyList, shownByGeneralList, myCity
|
||||||
|
|
||||||
|
|
||||||
var deferred;
|
|
||||||
|
|
||||||
function checkReturnObject(obj){
|
function checkReturnObject(obj){
|
||||||
if(!obj.result){
|
if(!obj.result){
|
||||||
deferred.reject();
|
var obj = $.Deferred();
|
||||||
return;
|
obj.reject('fail');
|
||||||
|
return obj.promise();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$.isNumeric(obj.startYear)
|
if(!$.isNumeric(obj.startYear)
|
||||||
||!$.isNumeric(obj.year)
|
||!$.isNumeric(obj.year)
|
||||||
||!$.isNumeric(obj.month)){
|
||!$.isNumeric(obj.month)
|
||||||
deferred.reject();
|
){
|
||||||
return;
|
var obj = $.Deferred();
|
||||||
|
obj.reject('fail');
|
||||||
|
return obj.promise();
|
||||||
}
|
}
|
||||||
|
|
||||||
return obj;
|
return obj;
|
||||||
@@ -504,7 +504,7 @@ function reloadWorldMap(option){
|
|||||||
}
|
}
|
||||||
|
|
||||||
//deferred mode of jQuery. != promise-then.
|
//deferred mode of jQuery. != promise-then.
|
||||||
deferred = $.ajax({
|
var deferred = $.ajax({
|
||||||
url: option.targetJson,
|
url: option.targetJson,
|
||||||
type: 'post',
|
type: 'post',
|
||||||
dataType:'json',
|
dataType:'json',
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ class DeleteEvent extends \sammo\Event\Action{
|
|||||||
public function __construct(){
|
public function __construct(){
|
||||||
}
|
}
|
||||||
|
|
||||||
public function run($env){
|
public function run($env=null){
|
||||||
|
|
||||||
$eventID = \sammo\Util::array_get($env['currentEventID']);
|
$eventID = \sammo\Util::array_get($env['currentEventID']);
|
||||||
if(!$eventID){
|
if(!$eventID){
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class RegNPC extends \sammo\Event\Action{
|
|||||||
string $name,
|
string $name,
|
||||||
int $pictureID,
|
int $pictureID,
|
||||||
int $nationID,
|
int $nationID,
|
||||||
string $locatedCity,
|
$locatedCity,
|
||||||
int $leadership,
|
int $leadership,
|
||||||
int $power,
|
int $power,
|
||||||
int $intel,
|
int $intel,
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class Date extends \sammo\Event\Condition{
|
|||||||
$this->month = $month;
|
$this->month = $month;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function eval(array $env=null){
|
public function eval($env=null){
|
||||||
if($env === null){
|
if($env === null){
|
||||||
return [
|
return [
|
||||||
'value'=>false,
|
'value'=>false,
|
||||||
@@ -50,7 +50,7 @@ class Date extends \sammo\Event\Condition{
|
|||||||
}
|
}
|
||||||
|
|
||||||
$lhs = [
|
$lhs = [
|
||||||
$this->$year,
|
$this->year,
|
||||||
$this->month
|
$this->month
|
||||||
];
|
];
|
||||||
$rhs = [
|
$rhs = [
|
||||||
|
|||||||
@@ -118,10 +118,10 @@ class Session {
|
|||||||
|
|
||||||
public function __get(string $name){
|
public function __get(string $name){
|
||||||
if($name == 'generalID'){
|
if($name == 'generalID'){
|
||||||
return $this->get(DB::prefix().static::GAME_KEY_GENERAL_ID);
|
return $this->get(UniqueConst::$serverID.static::GAME_KEY_GENERAL_ID);
|
||||||
}
|
}
|
||||||
if($name == 'generalName'){
|
if($name == 'generalName'){
|
||||||
return $this->get(DB::prefix().static::GAME_KEY_GENERAL_NAME);
|
return $this->get(UniqueConst::$serverID.static::GAME_KEY_GENERAL_NAME);
|
||||||
}
|
}
|
||||||
return $this->get($name);
|
return $this->get($name);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user