跳到主要内容

gm_client.gen_response_table

声明

public map gen_response_table(array data)

参数

参数名描述
data处理gm命令之后返回给gmsever的数据,未经加工的原始表格数据

原始表格数据

例子:

"data" : [
// 第一行为表头
{"id" : "玩家ID", "name" : "玩家名", "property" : "属性", "detail1" : "详情1", "detail2" : "详情2"},

// 后面为表字段内容
{"id" : 2, "name" : "暗夜白虎宝箱", "property" : "二阶", "detail1" : "detail1", "detail2" : "detail2"},
{"id" : 3, "name" : "暗夜白虎宝箱", "property" : "三阶", "detail1" : "detail1", "detail2" : "detail2"},
{"id" : 4, "name" : "暗夜白虎宝箱", "property" : "四阶", "detail1" : "detail1", "detail2" : "detail2"},
{"id" : 5, "name" : "暗夜白虎宝箱", "property" : "五阶", "detail1" : "detail1", "detail2" : "detail2"},
{"id" : 6, "name" : "暗夜白虎宝箱", "property" : "六阶", "detail1" : "detail1", "detail2" : "detail2"},
{"id" : 7, "name" : "暗夜白虎宝箱", "property" : "七阶", "detail1" : "detail1", "detail2" : "detail2"}
]

作用

该接口用来生成回调数据的格式

使用方式

GmD.gs

import pkg.gm_client;

public mixed data()
{
ret = [
{"id" : "aaa1", "name" : "bbb1", "lv" : 10},
{"id" : "aaa2", "name" : "bbb2", "lv" : 10},
{"id" : "aaa3", "name" : "bbb3", "lv" : 10},
{"id" : "aaa4", "name" : "bbb4", "lv" : 10}
];

return gm_client.gen_response_table(ret);
}

返回文档