Files
bl/common/data/socket/Client.go

31 lines
480 B
Go
Raw Normal View History

2025-08-28 21:35:56 +00:00
package socket
2025-08-28 21:35:56 +00:00
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
}