feat, refac: 메인 페이지에서 커맨드 리스트를 동적으로 받아옴
This commit is contained in:
@@ -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,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user