feat, refact: 메시지 연락 리스트 수신

This commit is contained in:
Hide_D committed 2022-12-05 01:10:41 +09:00
1 parent 864ddf7efe
commit 4f21eab7b1
3 files changed
+53 -2

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
<?php
namespace sammo\API\Message;
use sammo\Session;
use DateTimeInterface;
use function sammo\getMailboxList;
class GetContactList extends \sammo\BaseAPI{
public function validateArgs(): ?string
{
return null;
}
public function getRequiredSessionMode(): int
{
return static::REQ_GAME_LOGIN | static::REQ_READ_ONLY;
}
public function launch(Session $session, ?DateTimeInterface $modifiedSince, ?string $reqEtag)
{
if(!$session->generalID){
return [
"nation"=>[]
];
}
//NOTE: 모든 국가, 모든 장수에 대해서 같은 결과라면 캐싱 가능하지 않을까?
return [
"nation"=>getMailboxList()
];
}
}