forked from devsam/core
feat: 중원 정세에 메시지를 출력하는 Event Action 추가
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace sammo\Event\Action;
|
||||
|
||||
use RuntimeException;
|
||||
use sammo\ActionLogger;
|
||||
|
||||
class NoticeToHistoryLog extends \sammo\Event\Action
|
||||
{
|
||||
public function __construct(private string $msg)
|
||||
{
|
||||
}
|
||||
|
||||
public function run(array $env)
|
||||
{
|
||||
if(!key_exists('year', $env) && !key_exists('month', $env)){
|
||||
throw new RuntimeException('year, month가 없음');
|
||||
}
|
||||
$logger = new ActionLogger(0, 0, $env['year'], $env['month']);
|
||||
$logger->pushGlobalHistoryLog($this->msg);
|
||||
$logger->flush();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user