找回密码
 registerss
搜索
查看: 13|回复: 0

洱海月 v0-07-0300 封包解析:ID 1031 CGFashionDepotOperation(时装衣柜操作请求)

[复制链接]
  • 打卡等级:本地老炮
  • 打卡总天数:603
  • 打卡月天数:1
  • 打卡总奖励:600
  • 最近打卡:2026-10-03 06:32:28
Waylee 发表于 2026-4-15 15:13 | 显示全部楼层 |阅读模式 | Google Chrome | Windows 10

马上注册,查看网站隐藏内容!!

您需要 登录 才可以下载或查看,没有账号?registerss

×

CGFashionDepotOperation 是当前版本时装衣柜系统的现役请求包。背包、衣柜以及当前已装备时装位之间的移动和换位,都是通过这条包进入场景逻辑。

包信息

项目 内容
封包 ID 1031
包名 CGFashionDepotOperation
方向 CG 客户端 -> 游戏服
固定包长 9
专用回包 GCFashionDepotOperation(1030)
当前 Lua 协议定义 /home/ubuntu/Game2/services/game/packet.lua
当前请求入口 /home/ubuntu/Game2/services/msgagent.lua 的 request:CGFashionDepotOperation()
当前场景落点 /home/ubuntu/Game2/services/scene/scenecore.lua 的 char_fashion_depot_operation()
当前用途 提交时装衣柜移动、取出、换位和与已装备时装位联动的请求

当前 Game.exe 可直接确认:

GetPacketID()   = 1031;
GetPacketSize() = 9;
Read()          = read_u8(dest_container), read_u32(from_index), read_i32(dest_index);
Write()         = 同结构写回;
Execute()       = 2;

包体结构

偏移 长度 字段 类型 含义
0x00 0x01 dest_container uint8 当前 Lua 实际用它区分时装衣柜操作类型
0x01 0x04 from_index uint32 源槽位索引
0x05 0x04 dest_index int32 目标槽位索引;为 define.INVAILD_ID 时表示自动分配

当前实际行为

  • 当前 Lua request:CGFashionDepotOperation() 会直接把整包转发到场景层。
  • 场景层 char_fashion_depot_operation() 目前已确认的分支如下:
    • dest_container == 1:背包 -> 衣柜
    • dest_container == 2:衣柜 -> 背包
    • dest_container == 3 或 4:衣柜内部移动,或与当前已装备时装位联动
  • 当 dest_index == define.INVAILD_ID 时,当前 Lua 会尝试自动寻找空槽位。
  • 当前衣柜操作的结果反馈全部通过 GCFashionDepotOperation、GCItemInfo、GCNotifyEquip 等包回推给客户端。

服务端落点

  • 协议定义:/home/ubuntu/Game2/services/game/packet.lua
  • 请求入口:/home/ubuntu/Game2/services/msgagent.lua
  • 场景处理:/home/ubuntu/Game2/services/scene/scenecore.lua

关键代码

当前 Lua 协议定义

packet.CGFashionDepotOperation = {
    xy_id = packet.XYID_CG_FASHION_DEPOT_OPERATION,
    bis = function(self, buffer)
        local stream = bistream.new()
        stream:attach(buffer)
        self.dest_container = stream:readuchar()
        self.from_index = stream:readuint()
        self.dest_index = stream:readint()
    end,
}

当前 Lua 请求入口

function request:CGFashionDepotOperation()
    skynet.call(my_scene, "lua", "char_fashion_depot_operation", my_obj_id, self)
end

当前场景分支

if operation.dest_container == 1 then
    -- 背包 -> 衣柜
elseif operation.dest_container == 2 then
    -- 衣柜 -> 背包
elseif operation.dest_container == 3 or operation.dest_container == 4 then
    -- 衣柜内部移动 / 与已装备时装位联动
end

结论

  1. CGFashionDepotOperation 是当前时装衣柜系统的现役请求包。
  2. 包体固定 9 字节,结构稳定为 dest_container + from_index + dest_index。
  3. 当前 Lua 已明确接入并完整实现背包、衣柜和已装备时装位之间的联动处理。
  4. 结果回推主链是 GCFashionDepotOperation(1030)。
您需要登录后才可以回帖 登录 | registerss

本版积分规则

QQ|手机版|雪舞知识库 ( 浙ICP备15015590号-1 | 萌ICP备20232229号|浙公网安备33048102000118号 )|天天打卡

GMT+8, 2026-10-4 11:26 , Processed in 0.068435 second(s), 26 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表