diff --git a/hwe/sammo/API/Message/SendMessage.php b/hwe/sammo/API/Message/SendMessage.php index 627e61ce..bc44c92d 100644 --- a/hwe/sammo/API/Message/SendMessage.php +++ b/hwe/sammo/API/Message/SendMessage.php @@ -192,6 +192,9 @@ class SendMessage extends \sammo\BaseAPI // 전체 메세지 if ($mailbox === Message::MAILBOX_PUBLIC) { + if($penalty[PenaltyKey::NoSendPublicMsg->value] ?? 0) { + return '공개 메세지를 보낼 수 없습니다.'; + } $msgID = $this->genPublicMessage($src, $text)->send(); return [ 'msgType' => 'public', @@ -232,6 +235,10 @@ class SendMessage extends \sammo\BaseAPI $lastMsg = new \DateTime($session->lastMsg ?? '0000-00-00'); $msg_interval = $now->getTimestamp() - $lastMsg->getTimestamp(); + if($penalty[PenaltyKey::NoSendPrivateMsg->value] ?? 0) { + return '개인 메세지를 보낼 수 없습니다.'; + } + $msg_min_interval = $penalty[PenaltyKey::SendPrivateMsgDelay->value] ?? 2; if ($msg_interval < $msg_min_interval) { return "개인메세지는 {$msg_min_interval}초당 1건만 보낼 수 있습니다!"; diff --git a/hwe/sammo/Enums/PenaltyKey.php b/hwe/sammo/Enums/PenaltyKey.php index 0e9302f7..08b6574a 100644 --- a/hwe/sammo/Enums/PenaltyKey.php +++ b/hwe/sammo/Enums/PenaltyKey.php @@ -7,6 +7,8 @@ namespace sammo\Enums; */ enum PenaltyKey: string{ case SendPrivateMsgDelay = 'sendPrivateMsgDelay'; + case NoSendPrivateMsg = 'noSendPrivateMsg'; + case NoSendPublicMsg = 'noSendPublicMsg'; case NoTopSecret = 'noTopSecret'; case NoChief = 'noChief'; case NoAmbassador = 'noAmbassador'; @@ -14,4 +16,5 @@ enum PenaltyKey: string{ case NoChiefTurnInput = 'noChiefTurnInput'; case NoChiefChange = 'noChiefChange'; case NoFoundNation = 'noFoundNation'; + case NoChosenAssignment = 'noChosenAssignment'; } \ No newline at end of file