Skip to main content
Version: SDK-6.0.0

GetRandomLookupList

public BackndRandomLookupTableItemReturnObject GetRandomLookupList();

BackndRandomLookupTableItemReturnObject

GetReturnValueByRandomLookupTableList

If an error occurred, null is returned.

BackndRandomLookupTableItemReturnObject bro = Backnd.GetRandomLookupList.GetRandomLookupList();

foreach(BackndRandomLookupTableItem item in bro.GetReturnValueByRandomLookupTableList()) {
Debug.Log(item.ToString());
}

public class BackndRandomLookupTableItem {
public string title;
public string uuid;
public RandomType randomtype;
}

Description

Calls all random lookup history generated in BACKND Console.
The list contains the following information:

  • Name of the random lookup
  • uuid
  • Classification(user/guild)

Example

Synchronous

Backnd.RandomLookup.GetRandomLookupList();

Asynchronous

Backnd.RandomLookup.GetRandomLookupList(callback=>
{
// Post-process
});

Return cases

Success cases

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

When the random lookup result is 0
statusCode : 200
message : Success returnValue : {"rows":[]}

GetReturnValuetoJSON

{
"rows": [
{
"randomType": "user",
"uuid": "6f438bd0-01a6-11ed-bdc8-a700365a13a1",
"title": "Random lookup for PVP"
},
{
"randomType": "user",
"uuid": "94b07a80-00f3-11ed-ade3-6d5252f35aa5",
"title": "Random lookup for friend recommendation"
},
{
"randomType": "guild",
"uuid": "96ab48f0-fce9-11ec-a8e9-3fc17cd7d4bd",
"title": "Random lookup for guild recommendation"
}
]
}

Sample code

public class RandomLookupTable {

public string title; // Random lookup title
public string uuid; // Random lookup uuid
public RandomType randomtype; //Random lookup type

public override string ToString() {
return $"title: {title}\n" +
$"uuid: {uuid}\n" +
$"randomtype: {randomtype}";
}
}
public void GetRandomLookupList() {

var bro = Backnd.RandomLookup.GetRandomLookupList();

if(bro.IsSuccess()) {

BACKND.LitJson.JsonData json = bro.Rows();
List<RandomLookupTable> list = new List<RandomLookupTable>();

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

RandomLookupTable table = new RandomLookupTable();

table.title = json[i]["title"].ToString();
table.uuid = json[i]["uuid"].ToString();

if(json[i]["randomType"].ToString() == "user") {
table.randomtype = RandomType.Player;
}
else {
table.randomtype = RandomType.Guild;
}
list.Add(table);
}

foreach(var table in list) {
Debug.Log(list.ToString());
}
}
}