feat: NSIS 中文安装器(年糕历险记-Setup-v0.1.0.exe 实际构建+静默安装验证)、菜单鼠标可见性修复、首页 UI 原版复刻(土质背景/原版按钮/splash/版本角标)、全 goroutine 崩溃兜底
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"mc/internal/crash"
|
||||
"mc/internal/netproto"
|
||||
)
|
||||
|
||||
@@ -65,6 +66,7 @@ func Dial(addr string, hs netproto.Handshake, h Handler) (*Client, error) {
|
||||
|
||||
// readLoop 读循环:解帧分发(半包等待,协议错误断开)。
|
||||
func (c *Client) readLoop() {
|
||||
defer crash.RecoverGo("netclient-read") // 非主 goroutine 兜底(防静默闪退)
|
||||
tmp := make([]byte, 64*1024)
|
||||
for {
|
||||
_ = c.conn.SetReadDeadline(time.Now().Add(ioTimeout))
|
||||
@@ -113,6 +115,7 @@ func (c *Client) dispatch(f netproto.Frame) {
|
||||
|
||||
// writeLoop 写循环。
|
||||
func (c *Client) writeLoop() {
|
||||
defer crash.RecoverGo("netclient-write") // 非主 goroutine 兜底(防静默闪退)
|
||||
for {
|
||||
select {
|
||||
case <-c.done:
|
||||
|
||||
Reference in New Issue
Block a user