CGReportWaigua 是当前客户端外挂举报界面使用的上行包。客户端 AccusationStudio.lua 在提交时调用 Lua_ReportWaigua(name, report_type, desc),当前 Game.exe 会把它序列化为 type == 2 的举报提交包;场景或人物菜单中的举报入口会先走 type == 1 查询目标资料,再由服务端回 GCRetReportWaigua 打开举报界面。
包信息
| 项目 |
内容 |
| 封包 ID |
1215 |
| 包名 |
CGReportWaigua |
| 方向 |
CG 客户端 -> 游戏服 |
| 对应回包 |
type == 1 对应 GCRetReportWaigua(79);type == 2 无专用回包 |
| 作用 |
查询被举报玩家资料,或提交外挂举报类型和填写内容 |
当前 Game.exe 可确认这条包按首字节 type 分支变长:
type == 1: 1 + 30 + 4 = 35
type == 2: 1 + 30 + 4 + 256 = 291
其他: 1 + 30 = 31
包体结构
| 偏移 |
长度 |
字段 |
类型 |
含义 |
0x00 |
0x01 |
type |
uint8 |
功能分支;1 查询目标资料,2 提交举报 |
0x01 |
0x1E |
name |
char[30] |
被举报玩家名,GBK 固定槽 |
0x1F |
0x04 |
guid |
int32 |
仅 type == 1 存在;目标玩家 GUID |
0x1F |
0x04 |
report_type |
int32 |
仅 type == 2 存在;举报类型 1..8 |
0x23 |
0x100 |
desc |
char[256] |
仅 type == 2 存在;举报界面填写内容,GBK 固定槽 |
guid 与 report_type 复用同一偏移,由 type 决定解释方式。
当前实际行为
type == 1:当前 Lua 服务端优先按 guid 查 .world 玩家信息,失败时按 name 查询;查到后返回 GCRetReportWaigua(79)。
type == 2:当前 Lua 服务端校验 report_type 必须在 1..8,然后把举报记录写入 log_report_waigua。
type == 2 的填写内容会进入 report_desc 字段,同时运行日志会打印 report_desc。
- 提交举报后客户端自己会提示举报提交成功;服务端不需要为
type == 2 再回专用确认包。
服务端落点
- 协议定义:
/home/ubuntu/Game2/services/game/packet.lua
- 请求入口:
/home/ubuntu/Game2/services/msgagent.lua
- 查询目标资料:
.world 的 get_player_info / get_player_info_by_name
- 举报日志集合:
log_report_waigua
关键代码
当前 Lua 包体解析:
packet.CGReportWaigua = {
xy_id = packet.XYID_CG_REPORT_WAIGUA,
bis = function(self, buffer)
local stream = bistream.new()
stream:attach(buffer)
self.type = stream:readuchar()
self.name = packet_read_gbk_string(stream, 0x1E):gsub("%z+$", "")
if self.type == 1 then
self.guid = stream:readint()
elseif self.type == 2 then
self.report_type = stream:readint()
self.desc = packet_read_gbk_string(stream, 0x100):gsub("%z+$", "")
end
end
}
当前 Lua 提交落库:
local doc = {
fun_name = "CGReportWaigua",
reporter_name = ma_func:get_name(),
reporter_guid = ma_func:get_guid(),
target_name = self.name or "",
target_guid = (target_info and target_info.guid) or self.guid or 0,
target_level = target_info and target_info.level or 0,
target_menpai = target_info and target_info.menpai or 0,
report_type = report_type,
report_desc = self.desc or "",
date_time = utils.get_day_time(),
}
skynet.send(".logdb", "lua", "insert", { collection = "log_report_waigua", doc = doc })
结论
CGReportWaigua(1215) 是外挂举报界面的主包,type == 1 用于打开界面前查询目标资料,type == 2 用于提交举报。
- 当前服务端已经完整解析
type == 2 的 report_type 和 desc[256],填写内容会保存到 log_report_waigua.report_desc。
- 聊天界面的右键投诉不走这条包,而是走
CGDisclosureToGM(171),两条举报链路需要分开看。
|