원조 받으면 불가침 제의
This commit is contained in:
@@ -26,6 +26,7 @@ use function \sammo\GetImageUR;
|
||||
use \sammo\Constraint\Constraint;
|
||||
use \sammo\Constraint\ConstraintHelper;
|
||||
use sammo\Json;
|
||||
use sammo\KVStorage;
|
||||
|
||||
class che_불가침수락 extends Command\NationCommand
|
||||
{
|
||||
@@ -188,11 +189,12 @@ class che_불가침수락 extends Command\NationCommand
|
||||
$destNationID = $destNation['nation'];
|
||||
$destNationName = $destNation['name'];
|
||||
|
||||
$destNationAux = Json::decode($db->queryFirstField('SELECT aux FROM nation WHERE nation = %i', $destNationID));
|
||||
if(!key_exists('resp_assist', $destNationAux)){
|
||||
$destNationAux['resp_assist'] = [];
|
||||
}
|
||||
$destNationAux['resp_assist'][$nationID] = $destNationAux['recv_assist'][$nationID]??0;
|
||||
$destNationStor = KVStorage::getStorage(DB::db(), $destNationID, 'nation_env');
|
||||
$destRecvAssist = $destNationStor->getValue('recv_assist')??[];
|
||||
$destRespAssist = $destNationStor->getValue('resp_assist')??[];
|
||||
|
||||
$destRespAssist["n{$nationID}"] = [$nationID, $destRecvAssist["n{$nationID}"][1]??0];
|
||||
$destNationStor->setValue('resp_assist', $destRespAssist);
|
||||
|
||||
$year = $this->arg['year'];
|
||||
$month = $this->arg['month'];
|
||||
@@ -203,10 +205,6 @@ class che_불가침수락 extends Command\NationCommand
|
||||
$currentMonth = $env['year'] * 12 + $env['month'] - 1;
|
||||
$reqMonth = $year * 12 + $month - 1;
|
||||
|
||||
$db->update('nation', [
|
||||
'aux'=>Json::encode($destNationAux)
|
||||
], 'nation=%i', $destNationID);
|
||||
|
||||
$db->update(
|
||||
'diplomacy',
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user