Files
fc/server/tools/gen_proto/cfg/proto_102.erl
T
2026-05-23 22:10:14 +08:00

273 lines
9.8 KiB
Erlang

%%----------------------------------------------------
%% 地图相关RPC调用
%% @author yeahoo2000@gmail.com
%% @end
%%----------------------------------------------------
-module(proto_102).
-export([
info/0
,cfg/0
]
).
-include("protocol.hrl").
info() -> {
"地图相关RPC调用"
,[
"role.hrl"
,"unit.hrl"
,"item.hrl"
,"attr.hrl"
]
}.
cfg() ->
[
#rpc{
code = 10200
,log_title = "操作地图单位"
,req_desc = "操作地图单位"
,req = [
{uint32, battle_id, "单位战场ID"}
,{uint32, id, "单位ID"}
,{uint16, code, "操作码"}
]
,reply_desc = {"结果:~w,~ts", [result, msg]}
,reply = [
{uint8, result, "是否成功(0:失败 1:成功)"}
,{string, msg, "附加信息"}
,{uint32, battle_id, "单位战场ID"}
,{uint32, id, "单位ID"}
,{uint32, time, "采集时间(>0需要采集进度)"}
]
}
%% ,#rpc{
%% code = 10201
%% ,log_title = "请求进入指定场景"
%% ,req_desc = "请求进入指定场景"
%% ,req = [
%% {uint32, id, "场景ID"}
%% ]
%% ,reply_desc = {"结果~w", [flag]}
%% ,reply = [
%% {uint8, flag, "结果(0:失败 1:成功)"}
%% ]
%% }
,#rpc{
code = 10210
,log_title = "服务端通知地图切换"
,req_desc = "服务端通知地图切换"
,reply_desc = {"~w ~w,~w", [base_id, x, y]}
,reply = [
{uint32, bid, "地图基础ID"}
,{uint32, res_id, "地图资源ID(0:默认资源)"}
,{uint16, x, "x坐标"}
,{uint16, y, "y坐标"}
,{uint8, dir, "方向"}
]
}
,#rpc{
code = 10211
,log_title = "动态区域信息"
,reply_desc = "动态区域信息"
,reply = [
{uint32, bid, "地图基础ID"}
,{array, tuple, dynamic_block, "动态可行走区域", [
{uint8, id, "区域ID"}
,{uint8, val, "区域值"}
]}
]
}
,#rpc{
code = 10213
,log_title = "角色进入地图事件"
,reply_desc = "角色进入地图事件"
,reply = {map_role, ?p_g_set(map_role, [
{uint32, rid, "角色ID"}
,{string, srv_id, "平台标识"}
,{string, name, "角色名称"}
,{uint16, speed, "移动速度"}
,{uint8, dir, "角色朝向"}
,{uint16, x, "x坐标"}
,{uint16, y, "y坐标"}
,{uint32, face, "头像"}
,{uint8, lev, "等级"}
,{uint8, sex, "性别"}
,{uint32, avatar, "头像框"}
,{uint8, status, "角色状态"}
,{uint8, event, "角色事件"}
,{array, tuple, looks, "外观效果", [
{uint32, looks_type, "外观类型"}
,{uint32, looks_mode, "子外观类型"}
,{uint32, looks_val, "外观值"}
,{string, looks_str, "附加串"}
]
}
])
}
}
,#rpc{
code = 10214
,log_title = "角色离开地图事件"
,reply_desc = "角色离开地图事件"
,reply = [
{uint32, bid, "场景基础id"},
{array, tuple, role_ids, "role_id列表", [
{uint32, rid, "角色id"},
{string, srv_id, "服务器id"}
]
}
]
}
,#rpc{
code = 10215
,log_title = "角色移动事件"
,req_desc = "角色移动事件"
,req = [
{uint32, base_id, "地图基础ID"}
,{uint16, x, "x坐标"}
,{uint16, y, "y坐标"}
,{uint8, dir, "角色朝向"}
]
,reply = [
{uint32, rid, "角色ID"}
,{string, srv_id, "平台标识"}
,{uint8, dir, "角色朝向"}
,{uint16, dx, "目的地x坐标"}
,{uint16, dy, "目的地y坐标"}
]
}
,#rpc{
code = 10216
,log_title = "服务端主动发送的新网格的角色列表"
,reply_desc = "服务端主动发送的新网格的角色列表"
,reply = [
{array, map_role, role_list, "角色列表", ?p_g_get(map_role)}
]
}
,#rpc{
code = 10217
,log_title = "角色信息更新事件"
,reply_desc = "角色信息更新事件"
,reply = {map_role, ?p_g_get(map_role)
}
}
,#rpc{
code = 10219
,log_title = "外观变化处理"
,reply_desc = "外观变化处理"
,reply = [
{tuple, rid, [
{uint32, rid, "角色ID"}
,{string, srv_id, "平台标识"}
]}
,{uint8, type, "推送方式(0:全部 1:部分)"}
,{array, tuple, looks, "外观效果", [
{uint32, looks_type, "外观类型"}
,{uint32, looks_mode, "子外观类型"}
,{uint32, looks_val, "外观值"}
,{string, looks_str, "附加串"}
]
}
]
}
,#rpc{
code = 10220
,log_title = "推送当前地图单位列表"
,reply_desc = "推送当前地图单位列表"
,reply = [
{array, map_unit, unit_list, "单位列表", ?p_g_set(map_unit, [
{tuple, id, [
{uint32, battle_id, "所属战场ID"}
,{uint32, id, "ID"}
]
}
,{uint32, base_id, "基础ID"}
,{string, name, "单位名称"}
,{uint8, status, "单位状态"}
,{uint16, speed, "移动速度"}
,{uint16, x, "x坐标"}
,{uint16, y, "y坐标"}
,{uint8, lev, "等级"}
,{array, tuple, looks, "外观效果", [
{uint32, looks_type, "外观类型"}
,{uint32, looks_mode, "子外观类型"}
,{uint32, looks_val, "外观值"}
,{string, looks_str, "附加串"}
]
}
])
}
]
}
,#rpc{
code = 10222
,log_title = "推送当前地图角色列表"
,reply_desc = "推送当前地图角色列表"
,reply = [
{array, map_role, role_list, "角色列表", ?p_g_get(map_role)}
]
}
,#rpc{
code = 10250
,log_title = "角色播放动作"
,reply_desc = "角色播放动作"
,reply = [
{tuple, rid, [
{uint32, rid, "角色ID"}
,{string, srv_id, "平台标识"}
]}
,{uint32, act_type, "动作类型()"}
,{uint8, num, "次数(0:表示循环)"}
]
}
,#rpc{
code = 10260
,log_title = "单位进入地图事件"
,reply_desc = "单位进入地图事件"
,reply = {map_unit, ?p_g_get(map_unit)}
}
,#rpc{
code = 10262
,log_title = "单位离开地图事件"
,req_desc = "单位离开地图事件"
,reply = [
{uint32, battle_id, "所属战场ID"}
,{uint32, id, "单位ID"}
]
}
,#rpc{
code = 10264
,log_title = "单位移动事件"
,req_desc = "单位移动事件"
,reply = [
{uint32, battle_id, "所属战场ID"}
,{uint32, id, "单位ID"}
,{uint16, dx, "目的地x坐标"}
,{uint16, dy, "目的地y坐标"}
]
}
,#rpc{
code = 10265
,log_title = "单位场景说话"
,req_desc = "单位场景说话"
,reply = [
{tuple, id, [
{uint32, battle_id, "所属战场ID"}
,{uint32, id, "ID"}
]
}
,{string, msg, "说话内容"}
]
}
,#rpc{
code = 10266
,log_title = "单位信息更新事件"
,reply_desc = "单位信息更新事件"
,reply = {map_unit, ?p_g_get(map_unit)}
}
].