refactor(socket): 重构 ClientData 结构体并优化相关逻辑
- 简化 ClientData 结构体,移除不必要的方法 - 优化 Player 结构体,调整 Conn 类型 - 更新 wscodec.go 中的 Conn 结构体 - 删除未使用的 XML 相关文件和代码 - 调整 ServerEvent 和 controller 中的相关逻辑
This commit is contained in:
@@ -4,14 +4,18 @@ import (
|
||||
"blazing/common/data/socket"
|
||||
"blazing/common/socket/errorcode"
|
||||
"blazing/logic/service/space"
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v2/os/glog"
|
||||
"github.com/jinzhu/copier"
|
||||
)
|
||||
|
||||
func (h Controller) Walk(data *space.InInfo, c *socket.Player) (result *space.OutInfo, err errorcode.ErrorCode) {
|
||||
|
||||
data.Broadcast(c.Info.UserID, space.OutInfo{Flag: data.Flag,
|
||||
UserID: c.Info.UserID,
|
||||
Reserve2: data.Reverse2,
|
||||
Point: data.Point}) //走路的广播
|
||||
result = &space.OutInfo{}
|
||||
err1 := copier.Copy(result, data)
|
||||
result.UserID = data.Head.UserID
|
||||
glog.Debug(context.Background(), err1)
|
||||
data.Broadcast(c.Info.MapID, *result) //走路的广播
|
||||
|
||||
return nil, -1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user