gm_client.gen_response
声明
public mixed gen_response(mixed data = nil)
参数
参数名 | 描述 |
---|---|
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"}
]
作用
该接口用来返回处理好的gm命令到gmserver
使用方式
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(ret);
}