~~ssh~~ https auto update

This commit is contained in:
lhy6305 2024-09-23 23:21:04 +08:00
parent 0d0fa0c508
commit 799640bb4e

29
api.php
View File

@ -39,6 +39,21 @@ if(!array_key_exists("action", $query)||gettype($query["action"])!="string") {
$action=$query["action"];
$action=explode(",", $action);
//check if requested to show the help info before parsing game param
if($action[0]=="help") {
echo "notice: use comma(',') to split args\n";
echo "all available commands:\n";
echo " user-panel: display a interactive content for user\n";
echo " team-info: show your team info as json\n";
echo " challenge-list: list all challenges as json which are defined internally\n";
echo " attachment-dl <cid or alias>: download attachment for challenge <cid>, or interact with it\n";
echo " external-flag <cid or alias>: used for dispatching flags for external containers that cannot be changed easily\n";
exit;
}
if(!array_key_exists("game", $query)||gettype($query["game"])!="string"||strlen($query["game"])<=0) {
gen_error_400("key \"game\" not found or is empty, or has an invalid type.");
exit;
@ -106,20 +121,6 @@ if($action[0]=="attachment-dl") {
}
//show the help info if no action matches
if($action[0]=="help") {
echo "notice: use comma(',') to split args\n";
echo "all available commands:\n";
echo " user-panel: display a interactive content for user\n";
echo " team-info: show your team info as json\n";
echo " challenge-list: list all challenges as json which are defined internally\n";
echo " attachment-dl <cid>: download attachment for challenge <cid>, or interact with it\n";
echo " external-flag <cid>: used for dispatching flags for external containers that cannot be changed easily\n";
exit;
}
gen_error_400("unknown action '".$action[0]."'. use 'help' to view help");
exit;