Skip to main content
Version: SDK-5.9.6

GetProbabilityCardListV2

public BackendReturnObject GetProbabilityCardListV2();

Description

Looks up the list of probability cards registered in the console.

Differences with GetProbabilityCardList

There are a few differences between this method and GetProbabilityCardList.

  • Charts where files cannot be applied are excluded
  • JSON return values do not have the 'old' column.
Note on migration from GetProbabilityCardList
Check the following when migrating from the GetProbabilityCardList() method to the GetProbabilityCardListV2() method:
- If 'old' is used for parsing JSON(e.g., json["rows"][0]["S"]["old"].ToString())
- If there is a logic for charts without files applied

Example

Synchronous

Backend.Probability.GetProbabilityCardListV2();

Asynchronous

Backend.Probability.GetProbabilityCardListV2((callback) =>
{
// Post-process
});

SendQueue

SendQueue.Enqueue(Backend.Probability.GetProbabilityCardListV2, (callback) =>
{
// Post-process
});

Return cases

Success cases

When the lookup is successful
statusCode : 200
message : Success returnValue : refer to GetReturnValuetoJSON

GetReturnValuetoJSON

{
rows:
[
// version 2(new)
// When there is a probability file applied
{
// Probability name
probabilityName: { S: "Random boots draw" },
// Probability description
probabilityExplain: { NULL: true },
// Applied chart file id(if present)
selectedProbabilityFileId: { N: "8" }
},
{
probabilityName: { S: "Random weapon draw" },
probabilityExplain: { S: "Get a weapon of S-rank or higher" },
selectedProbabilityFileId: { N: "24945" }
}
...
]
}

Sample code

public class ProbabilityCardV2
{
public string probabilityName; // Chart name
public string probabilityExplain; // Chart description
public int selectedProbabilityFileId;// Chart file ID

public override string ToString()
{
return $"probabilityName: {probabilityName}\n" +
$"probabilityExplain: {probabilityExplain}\n" +
$"selectedProbabilityFileId: {selectedProbabilityFileId}\n";
}
}
public void GetProbabilityCardListTestV2()
{
var bro = Backend.Probability.GetProbabilityCardListV2();

if(!bro.IsSuccess())
{
Debug.LogError("An error occurred : " + bro.ToString());
return;
}

List<ProbabilityCardV2> probabilityCardList = new List<ProbabilityCardV2>();

LitJson.JsonData json = bro.FlattenRows();

for(int i = 0; i < json.Count; i++)
{
ProbabilityCardV2 probabilityCard = new ProbabilityCardV2();

probabilityCard.probabilityName = json[i]["probabilityName"].ToString();
probabilityCard.probabilityExplain = json[i]["probabilityExplain"].ToString();
probabilityCard.selectedProbabilityFileId = json[i]["selectedProbabilityFileId"].ToString();

probabilityCardList.Add(probabilityCard);
}

foreach(var probabilityCard in probabilityCardList)
{
Debug.Log(probabilityCard.ToString() + "\n");
}
}