refactor(socket): 优化消息处理逻辑,避免顺序执行问题

将消息处理的循环从协程外部移入协程内部,确保每个消息在独立的 goroutine 中处理,
避免因并发导致的消息顺序错乱问题。同时移除了多余的空行,使代码更简洁。

fix(controller): 为低 ID 用户设置 VIP 标志

在 COMMEND_ONLINE 接口逻辑中,新增对 UserID 小于 10000 的用户设置 IsVip = 1,
用于标识测试或特殊用户身份。

ref
This commit is contained in:
2025-11-03 03:59:59 +08:00
parent 7a8be1c23a
commit 30ed47a30c
17 changed files with 300 additions and 242 deletions

View File

@@ -11,7 +11,13 @@ import (
// 处理命令: 105
func (h *Controller) COMMEND_ONLINE(data *user.SidInfo, c gnet.Conn) (result *user.CommendSvrInfo, err errorcode.ErrorCode) { //这个时候player应该是空的
result = user.NewInInfo()
if data.Head.UserID < 100000 {
result.IsVip = 1
}
result.ServerList = user.GetServerInfoList()
return
//return //TODO 这里待实现改成接口调用Ret方法