Files
bl/common/data/socket/Client.go
昔念 7b5ec208fc refactor(socket): 重构 ClientData 结构体并优化相关逻辑
- 简化 ClientData 结构体,移除不必要的方法
- 优化 Player 结构体,调整 Conn 类型
- 更新 wscodec.go 中的 Conn 结构体
- 删除未使用的 XML 相关文件和代码
- 调整 ServerEvent 和 controller 中的相关逻辑
2025-08-30 00:36:08 +08:00

31 lines
480 B
Go

package socket
func ConutPlayer() int {
count := 0
Mainplayer.Range(func(uint32, *Player) bool {
count++
return true // 继续遍历
})
return count
}
type ClientData struct {
IsCrossDomain bool //是否跨域过
Player *Player //客户实体
//UserID uint32
Wsmsg *WsCodec
}
func NewClientData() *ClientData {
cd := ClientData{
IsCrossDomain: false,
Player: nil,
Wsmsg: &WsCodec{},
}
return &cd
}