Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add deprecation and authentication comments to dorequest #2120

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion public/dorequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,18 +137,21 @@ function DoRequestError(string $error, ?int $status = 200, ?string $code = null)
/*
* Global, no permissions required
*/

// TODO deprecate?
case "allprogress":
$consoleID = (int) request()->input('c');
$response['Response'] = GetAllUserProgress($username, $consoleID);
break;

// TODO deprecate - next image ID should be provided by the server
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is used by the DLL to determine the maximum value allowed for manually specifying a badge.

We could remove the validation and just allow the user to enter any number, but I'm not sure how well the client would handle the 404 response.

case "badgeiter":
// Used by RALibretro achievement editor
$response['FirstBadge'] = 80;
$response['NextBadge'] = (int) FilenameIterator::getBadgeIterator();
break;

// TODO: Deprecate - not used anymore
// TODO deprecate - not used anymore
case "codenotes":
if (!getCodeNotes($gameID, $codeNotesOut)) {
return DoRequestError("FAILED!");
Expand All @@ -162,25 +165,30 @@ function DoRequestError(string $error, ?int $status = 200, ?string $code = null)
}
break;

// TODO require authentication?
case "codenotes2":
$response['CodeNotes'] = getCodeNotesData($gameID);
$response['GameID'] = $gameID;
break;

case "gameid":
$md5 = request()->input('m') ?? '';
$response['GameID'] = getGameIDFromMD5($md5);
break;

// TODO require authentication?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is exposed through rcheevos without authentication. Clients would have to upgrade, though I'm not sure if any clients besides the DLL use it.

case "gameslist":
$consoleID = (int) request()->input('c', 0);
$response['Response'] = getGamesListDataNamesOnly($consoleID);
break;

// TODO require authentication?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not aware of any official uses for this. If it's being used by unofficial clients, we should provide a public API for this instead.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is indeed being used by third-party front-ends.

case "officialgameslist":
$consoleID = (int) request()->input('c', 0);
$response['Response'] = getGamesListDataNamesOnly($consoleID, true);
break;

// TODO deprecate?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the functionality that used to rely on this was removed from the DLL in 0.76 (2019)

case "hashlibrary":
$consoleID = (int) request()->input('c', 0);
$response['MD5List'] = getMD5List($consoleID);
Expand Down Expand Up @@ -277,6 +285,7 @@ function DoRequestError(string $error, ?int $status = 200, ?string $code = null)
$response['AchievementID'] = $achIDToAward;
break;

// TODO deprecate
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DLL still uses this to show friend activity in the clients. It's buried in the overlay. I don't think I've ever used it. We could probably deprecate it.

case "getfriendlist":
$response['Friends'] = GetFriendList($username);
break;
Expand Down
Loading