Skip to main content
Version: SDK-5.9.6

GetProbabilityCardList

public BackendReturnObject GetProbabilityCardList();

Description

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

Example

Synchronous

Backend.Probability.GetProbabilityCardList();

Asynchronous

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

SendQueue

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

Return cases

Success cases

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

GetReturnValuetoJSON

{
rows:
[
// version 1(old)
// When there is no probability file applied
{
// Probability card description
probabilityCardExplain:{ S: "Game item gacha probability card" },
// Probability card indate
inDate:{ S: "2018-10-22T08:21:11.508Z" },
// Probability card uuid
uuid:{ S: "6f30b940-d5d3-11e8-9726-450436703261" },
// Probability card name
probabilityCardName:{ S: "Item probability card" },
// version information(y: version1, n: version2)
old:{ S: "y" }
},
// version 1(old)
// When there is a probability file applied
{
// Probability card description
probabilityCardExplain:{ S: "ThisIsRandom" },
// Probability card indate
inDate:{ S: "2018-10-16T02:57:20.237Z" },
// Probability card file information
selectedProbabilityCardFile:
{
M:
{
// Probability card file name
probabilityCardFileName:{ S: "random00.xlsx" },
// Number of probability outcomes(number of rows)
count:{ N: "15" },
// Probability card file indate
inDate:{ S: "2018-10-16T09:12:24.804Z" },
// Probability card file uuid
uuid:{ S: "9889fa40-d123-11e8-8344-cbf89aabaf9f" }
}
},
// Probability card uuid
uuid:{ S: "32c591d0-d0ef-11e8-8375-11c8fed923ed" },
// Probability card name
probabilityCardName:{ S: "ThisIsRandom" }
// version information(y: version1, n: version2)
old:{ S: "y"}
},
// version 2(new)
// When there is no probability file applied
{
// Probability name
probabilityName: { S: "Random weapon draw" },
// Probability description
probabilityExplain: { NULL: true },
// Applied chart file id(if non-existent)
selectedProbabilityFileId: { NULL: true },
// version information(y: version1, n: version2)
old:{ S: "n" }
},
// 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" },
// version information(y: version1, n: version2)
old:{ S: "n" }
}
]
}

Sample code

public class ProbabilityCard
{
public bool isChartUpload = true; //Whether the chart is applied(value does not exist in returnValue)
public string probabilityName; // Chart name
public string probabilityExplain; // Chart description
public int selectedProbabilityFileId;// Chart file ID
public string old; // Whether it is a new version

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

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

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

LitJson.JsonData json = bro.FlattenRows();

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

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

int outNum = 0;
if(int.TryParse(json[i]["selectedProbabilityFileId"].ToString(), out outNum))
{
probabilityCard.isChartUpload = true;
probabilityCard.selectedProbabilityFileId = outNum;
}
else
{
probabilityCard.isChartUpload = false;
probabilityCard.selectedProbabilityFileId = 0;
}

probabilityCard.old = json[i]["old"].ToString();

probabilityCardList.Add(probabilityCard);
}

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