fix: GetNationInfo Full mode
This commit is contained in:
@@ -27,7 +27,7 @@ class GetNationInfo extends \sammo\BaseAPI
|
|||||||
public function validateArgs(): ?string
|
public function validateArgs(): ?string
|
||||||
{
|
{
|
||||||
$v = new Validator($this->args);
|
$v = new Validator($this->args);
|
||||||
$v->rule('boolean', 'full');
|
$v->rule('in', 'full', ['true', 'false']);
|
||||||
|
|
||||||
if (!$v->validate()) {
|
if (!$v->validate()) {
|
||||||
return $v->errorStr();
|
return $v->errorStr();
|
||||||
@@ -70,7 +70,7 @@ class GetNationInfo extends \sammo\BaseAPI
|
|||||||
$gameEnv = $gameStor->getValues(['year', 'month', 'startyear']);
|
$gameEnv = $gameStor->getValues(['year', 'month', 'startyear']);
|
||||||
|
|
||||||
$nation = $db->queryFirstRow(
|
$nation = $db->queryFirstRow(
|
||||||
'SELECT nation, `name`, color, capital, gennum, gold, rice, bill, rate, secretlimit, chief_set, scout, war, strategic_cmd_limit, surlimit, tech, `power`, `level`, `type` FROM nation WHERE id = %i',
|
'SELECT nation, `name`, color, capital, gennum, gold, rice, bill, rate, secretlimit, chief_set, scout, war, strategic_cmd_limit, surlimit, tech, `power`, `level`, `type` FROM nation WHERE nation = %i',
|
||||||
$nationID
|
$nationID
|
||||||
);
|
);
|
||||||
$nationStor = \sammo\KVStorage::getStorage($db, $nationID, 'nation_env');
|
$nationStor = \sammo\KVStorage::getStorage($db, $nationID, 'nation_env');
|
||||||
|
|||||||
@@ -154,10 +154,17 @@ export type NationInfoFull = ValidResponse & {
|
|||||||
nation: NationItem;
|
nation: NationItem;
|
||||||
isFull: true,
|
isFull: true,
|
||||||
impossibleStrategicCommandLists: [string, number][];
|
impossibleStrategicCommandLists: [string, number][];
|
||||||
nationNotice: string,
|
nationNotice: NationNotice,
|
||||||
troops: Record<number, string>;
|
troops: Record<number, string>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type NationNotice = {
|
||||||
|
date: string,
|
||||||
|
msg: string,
|
||||||
|
author: string,
|
||||||
|
authorID: number,
|
||||||
|
}
|
||||||
|
|
||||||
export type NationInfoResponse =
|
export type NationInfoResponse =
|
||||||
| (ValidResponse & {
|
| (ValidResponse & {
|
||||||
nation: NationStaticItem;
|
nation: NationStaticItem;
|
||||||
|
|||||||
Reference in New Issue
Block a user