RomesteadLiveBridge.dll 的源码。
这是一个托管 C# 桥接 DLL。它在游戏进程内启动一个命名管道服务器,用于接收外部工具发送的实时命令。
当前支持的命令:
pingget_inventoryadd_itemremove_slot
在 Windows PowerShell 中运行:
powershell -NoProfile -ExecutionPolicy Bypass -File .\build_live_bridge.ps1构建后会生成:
RomesteadLiveBridge.dll
源码只引用:
System.dllSystem.Core.dll
游戏相关类型全部通过反射按名称查找,所以构建时不需要附带游戏 DLL。
它需要由外部补丁或其他加载方式注入/加载到游戏进程中。方式是给游戏目录中的 Romestead.dll 打一个小补丁,让游戏运行后加载 RomesteadLiveBridge.dll。
命名管道名称:
RomesteadLiveBridge
每条消息是一个 UTF-8 文本帧:
- 4 字节 little-endian 长度
- UTF-8 payload
payload 使用 tab 分隔字段,例如:
ping
get_inventory
add_item<TAB>material:wood_plank<TAB>10<TAB>
remove_slot<TAB>inventory<TAB>0<TAB>1<TAB>expected-item-instance-guid
响应格式:
OK<TAB>message
ERR<TAB>message
get_inventory 的 message 是 JSON。