Skip to content

getGameList ​

Get Game List ​

The getGameList method retrieves a paginated game list and returns pagination information and game records through a callback.

The overload with selectionId retrieves games in a specific selection. Obtain selection IDs using getSelectionList.

For category queries, use getGameListByCategory and getCategories.


Prerequisites ​

Before calling getGameList, you must call SUDOP.initSDK and wait for initialization to succeed.


Method Declaration ​

java
/**
 * Get the game list
 *
 * @param params   Optional pagination and language parameters
 * @param callback Callback listener
 */
public static void getGameList(SUDOPGameListParams params, SUDOPGameListCallback callback);

public static void getGameList(String selectionId, SUDOPGameListParams params,
                               SUDOPGameListCallback callback);

Both methods use the same pagination parameters, callback, and response models.


Parameters ​

ParameterTypeDescription
selectionIdStringRequired when querying a specific selection. Must not be empty.
paramsSUDOPGameListParamsOptional pagination and language parameters. Fields are described below.
callbackSUDOPGameListCallbackCallback listener that receives the game list retrieval result.

SUDOPGameListParams ​

FieldTypeDefaultDescription
pageNoint0Zero-based page number. Values below 0 are treated as 0.
pageSizeint10Records per page. Values less than or equal to 0 are treated as 10.
languageStringnullOptional language for retrieving the game list. Use a BCP 47 language tag, such as zh-CN or en-US.

Leave language as null to retrieve the list without specifying a language. The returned gameName and icon fields remain multilingual maps; select the value to display in your app.

Pass params = null to use the default pagination without specifying a language.


Result Callback ​

java
public interface SUDOPGameListCallback {
    void onSuccess(SUDOPGameListResult result);
    void onFailure(int retCode, String retMsg);
}
MethodParameterTypeDescription
onSuccessresultSUDOPGameListResultThe paginated result returned on success.
onFailureretCodeintThe error code returned on failure.
onFailureretMsgStringThe error description returned on failure.

Response Model: SUDOPGameListResult ​

FieldTypeDescription
pageNointCurrent page number, starting from 0.
pageSizeintNumber of records per page.
totalintTotal number of records.
recordsList<SUDOPGameListItem>The game list for the current page.

SUDOPGameListItem ​

FieldTypeDescription
gameIdStringGame ID.
gameNameMap<String, String>Game names in multiple languages. Each key is a language tag, and its value is the game name in that language.
gameIconStringLegacy game icon URL, available as a fallback.
iconMap<String, String>Game icon URLs in multiple languages, using the same map structure as gameName.
versionStringGame version number.

For gameName and icon, language tags such as zh-CN and en-US map to localized values; default identifies the default value. These fields remain maps in the callback, so the caller selects the value to display.


Example Code ​

Original Game List ​

Run the following code after SUDOP.initSDK initialization succeeds.

java
SUDOPGameListParams params = new SUDOPGameListParams();
params.pageNo = 0;
params.pageSize = 20;
String language = "zh-CN";
params.language = language;

SUDOP.getGameList(params, new SUDOPGameListCallback() {
    @Override
    public void onSuccess(SUDOPGameListResult result) {
        Log.i("SUDOP", "Current page: " + result.pageNo + ", Total records: " + result.total);
        for (SUDOPGameListItem item : result.records) {
            Log.i("SUDOP", "Game ID: " + item.gameId + ", Version: " + item.version);
        }
    }

    @Override
    public void onFailure(int retCode, String retMsg) {
        Log.e("SUDOP", "Failed to get game list: " + retCode + ", " + retMsg);
    }
});

Pass your app's selected BCP 47 language tag, using the same value as getGameInformation.

Games in a Selection ​

Call after SDK initialization succeeds and replace the example ID with an actual selection ID. This query does not require user authentication.

java
String selectionId = "123"; // Replace with an actual selection ID
SUDOPGameListParams params = new SUDOPGameListParams();
params.language = "en-US";

SUDOP.getGameList(selectionId, params, new SUDOPGameListCallback() {
    @Override
    public void onSuccess(SUDOPGameListResult result) {
        Log.i("SUDOP", "Games in this selection: " + result.total);
    }

    @Override
    public void onFailure(int retCode, String retMsg) {
        Log.e("SUDOP", "Failed to get selection games: " + retCode + ", " + retMsg);
    }
});