refactor(logic): 重构逻辑处理和错误处理机制

- 新增 Conn 结构体的 NewConn 工厂方法
- 优化 Controller 中的 Recv 方法,增加错误处理逻辑
- 修改 GetServer、Login、MapHot 等方法的返回值类型
- 重构 SystemTimeInfo 方法,使用新的 OutInfo 接口
- 更新 CommendSvrInfo 结构体和相关方法
- 统一错误处理机制,使用新的 OutInfo 接口
This commit is contained in:
2025-07-25 22:50:08 +08:00
parent 487b25ac2f
commit 449552bea7
10 changed files with 73 additions and 76 deletions

View File

@@ -13,6 +13,9 @@ type Conn struct {
MainConn gnet.Conn `struc:"[0]pad"` //TODO 不序列化,,序列化下面的作为blob存数据库
}
func NewConn(c gnet.Conn) *Conn {
return &Conn{MainConn: c}
}
func (c *Conn) SendPack(bytes []byte) error {
if c.MainConn.Context().(*ClientData).Getwsmsg().Upgraded {
// This is the echo server