Skip to main content
Version: 5.11.4

GetTableList

public BackendReturnObject GetTableList();

Description

The information of all tables is retrieved.

Example

Synchronous

Backend.GameData.GetTableList();

Asynchronous

Backend.GameData.GetTableList((callback) => 
{
// Post-process
});

SendQueue

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

Return cases

Success cases

When loaded successfully
statusCode : 200

returnValue : refer to GetReturnValuetoJSON

GetReturnValuetoJSON

{
// Server time when the request was processed
"serverTime":"2021-02-01T05:19:56.853Z",
"tables":
[
{
"tableName":"tableName", // Table name
"tableExplaination":"Table description", // Table description
"isChecked":true, // Status of activation(can be turned on/off by clicking the console's Table Management)
"hasSchema":false // Existence of schema
},
{
"tableName":"tableName2", // Table name
"tableExplaination":"Table description 2", // Table description
"isChecked":true, // Status of activation(can be turned on/off by clicking the console's Table Management)
"hasSchema":false // Existence of schema
},
...
]
}

Sample code

public class TableItem
{
public string tableName;
public string tableExplaination;
public bool isChecked;
public bool hasSchema;

public override string ToString()
{
return $"tableName : {tableName}\n" +
$"tableExplaination : {tableExplaination}\n" +
$"isChecked : {isChecked}\n" +
$"hasSchema : {hasSchema}\n";
}
}
public void GetTableList()
{
var bro = Backend.GameData.GetTableList();

if(!bro.IsSuccess())
{
Debug.LogError(bro.ToString());
return;
}

List<TableItem> tableList = new List<TableItem>();
LitJson.JsonData tableListJson = bro.GetReturnValuetoJSON()["tables"];

for(int i = 0; i < tableListJson.Count; i++)
{
TableItem tableItem = new TableItem();

tableItem.tableName = tableListJson[i]["tableName"].ToString();
tableItem.tableExplaination = tableListJson[i]["tableExplaination"].ToString();
tableItem.isChecked = tableListJson[i]["isChecked"].ToString() == "true" ? true : false;
tableItem.hasSchema = tableListJson[i]["hasSchema"].ToString() == "true" ? true : false;

tableList.Add(tableItem);
Debug.Log(tableItem.ToString());
}
}