feat, refac: 메인 페이지에서 커맨드 리스트를 동적으로 받아옴

This commit is contained in:
2023-03-01 02:17:09 +09:00
parent e721642a10
commit c5c7f96c1a
6 changed files with 120 additions and 39 deletions
+30
View File
@@ -0,0 +1,30 @@
<?php
namespace sammo\API\General;
use sammo\General;
use sammo\Session;
use function sammo\getCommandTable;
//getCommandTable 호출을 대신하는 API
class GetCommandTable 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){
$generalID = $session->generalID;
$me = General::createGeneralObjFromDB($generalID);
$commandTable = getCommandTable($me);
return [
'result'=>true,
'commandTable' => $commandTable,
];
}
}