修复Windows 幻兽帕鲁转发输出流功能#85
Merged
Merged
Conversation
1. 使用PTY包装转发进程解决stdout块缓冲问题 - Windows下通过spawn()以管道模式启动的进程,stdout会切换为块缓冲(~4KB) - 游戏服务器日志输出量低,缓冲区填不满导致输出不实时 - 改用PTY二进制文件包装转发进程,让游戏服务器获得伪终端,保持行缓冲 2. 修复实例重启后旧PTY退出事件覆盖新实例状态的竞态条件 - virtualSocket的terminal-exit处理器增加会话ID检查 - 防止旧会话退出事件将新实例的status覆写为stopped 3. 修复handleInput中session.socket被无操作虚拟socket替换的问题 - stopInstance/sendInput创建的虚拟socket会在会话断开时替换session.socket - 导致后续流转发输出丢失(emit变为空操作) - 增加socket.connected检查,仅允许真实Socket.IO连接替换 4. 实例会话启用autoCloseOnForwardExit - 转发进程退出后自动关闭无用的PTY shell - 加速实例停止流程,减少竞态条件窗口 Co-Authored-By: Claude <noreply@anthropic.com>
|
⚠ 本 PR 已进入自动化语法检查流程,请稍后 本次变更文件 (2 个):
正在进行 TypeScript 语法检查... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
spawn()以管道模式启动游戏服务器时,C运行时将stdout从行缓冲切换为块缓冲(~4KB),导致只有启动时的第一条消息能立即显示。改用PTY二进制文件包装转发进程,让游戏服务器获得伪终端,保持行缓冲实时输出。terminal-exit处理器增加会话ID守卫检查,防止旧PTY退出事件覆盖新实例状态(status被覆写为stopped,terminalSessionId被清空)。handleInput中增加socket.connected检查,仅允许真实Socket.IO连接替换session.socket,防止stopInstance/sendInput的虚拟socket导致流转发输出丢失。Test plan
🤖 Generated with Claude Code