CGAskDoubleExp 是当前版本双倍经验系统的现役查询请求包。当前 Game.exe 与 Lua 服务端都能确认,请求发出后会走 CGAskDoubleExp(709) -> GCDoubleExpInfo(675) 这条正式链路;同时也能看到一个很明确的现状差异:客户端 Game.exe 包类仍保留了 4 字节请求体,而当前 Lua 服务端已经把这条请求按“无业务参数的触发包”处理。
包信息
| 项目 |
内容 |
| 封包 ID |
709 |
| 包名 |
CGAskDoubleExp |
| 方向 |
Client -> Server |
| 对应回包 |
GCDoubleExpInfo |
| 对应回包 ID |
675 |
| 作用 |
请求服务端返回当前角色的双倍经验状态 |
包体结构
当前 Game.exe 可以确认,这条请求类仍然保留 4 字节包体;但当前 Lua 协议定义没有读取这 4 字节,也没有写出任何业务字段。
| 偏移 |
长度 |
字段 |
类型 |
含义 |
0x00 |
0x04 |
reserved_u32 |
uint32 |
当前 Game.exe 请求类保留的 4 字节槽位;现版 Lua 服务端未读取、未使用 |
当前实际行为
- 当前
Game.exe 中,CGAskDoubleExp::GetPacketID() 返回 709。
- 当前
Game.exe 中,CGAskDoubleExp::GetPacketSize() 返回 4。
- 当前
Game.exe 的 Read() / Write() 都只对对象偏移 +24 的 4 字节区域做原样读写。
- 当前
Game.exe 的 Execute() 直接返回 2,请求包本身没有额外客户端本地处理逻辑。
- 当前 Lua
packet.CGAskDoubleExp 的 bis() 虽然会 attach(buffer),但没有读取任何字段;bos() 也直接返回空流。
- 当前
msgagent 收到 CGAskDoubleExp 后,不使用包体内容,直接转给场景层 char_ask_double_exp_info()。
- 当前
scenecore:char_ask_double_exp_info() 只做一件事:调用角色对象的 send_double_exp_info(),向请求者下发 GCDoubleExpInfo。
- 当前
human:send_double_exp_info() 发送的回包字段为:
available_hour
is_lock
money_time
total_time
rtime
- 这说明在
Temp_Release_v0-07-0300 现役链路里,CGAskDoubleExp 的业务意义就是“触发查询当前角色自己的双倍经验状态”;当前服务端并不依赖请求包中的那 4 字节。
服务端落点
- 协议定义:
/home/ubuntu/Game2/services/game/packet.lua
- 请求入口:
/home/ubuntu/Game2/services/msgagent.lua
- 场景处理:
/home/ubuntu/Game2/services/scene/scenecore.lua
- 回包发送:
/home/ubuntu/Game2/services/scene/obj/human.lua
关键代码
当前 Lua 协议定义
packet.CGAskDoubleExp = {
xy_id = packet.XYID_CG_ASK_DOUBLE_EXP,
ctor = function(self) end,
bis = function(self, buffer)
local stream = bistream.new()
stream:attach(buffer)
end,
bos = function(self)
local stream = bostream.new()
return stream:get()
end
}
当前 Lua 处理链
function request:CGAskDoubleExp()
skynet.call(my_scene, "lua", "char_ask_double_exp_info", my_obj_id, self)
end
function scenecore:char_ask_double_exp_info(who)
local obj = self.objs[who]
obj:send_double_exp_info()
end
function human:send_double_exp_info()
local msg = packet_def.GCDoubleExpInfo.new()
msg.available_hour = self.double_exp_info.available_hour
msg.is_lock = self.double_exp_info.is_lock and 1 or 0
msg.money_time = math.floor(self.double_exp_info.money_time)
msg.total_time = math.floor(self.double_exp_info.money_time) + math.floor(self.double_exp_info.free_time)
msg.rtime = self.double_exp_info.rtime
self:get_scene():send2client(self, msg)
end
当前 Game.exe 结论
GetPacketID() = 709;
GetPacketSize() = 4;
Read(stream) {
read_u32(reserved_u32);
}
Write(stream) {
write_u32(reserved_u32);
}
Execute() {
return 2;
}
结论
CGAskDoubleExp 在 Temp_Release_v0-07-0300 里是双倍经验系统的正式查询请求包,包 ID 为 709,现役回包是 GCDoubleExpInfo(675)。当前 Game.exe 仍保留了 4 字节请求体,但当前 Lua 服务端并不读取这 4 字节,而是把这条请求当成“触发查询当前角色双倍经验状态”的无业务参数请求处理;因此在现版服务端语义里,这 4 字节只能按 reserved_u32 理解,真正有业务意义的数据都在后续的 GCDoubleExpInfo 回包中。
|