Initial qiwei secondary development handoff
This commit is contained in:
27
helper/client_helper.go
Normal file
27
helper/client_helper.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package main
|
||||
|
||||
// GetActiveClientCount 返回当前活跃的客户端数量
|
||||
func GetActiveClientCount() int {
|
||||
globalLogger.Info("获取活跃客户端数量")
|
||||
|
||||
// 获取当前活跃的客户端数量
|
||||
// 这里需要实现实际的逻辑来获取活跃客户端
|
||||
// 暂时返回模拟数据
|
||||
clientCount := recognizedClientCount()
|
||||
|
||||
globalLogger.Info("当前活跃客户端数量: %d", clientCount)
|
||||
return clientCount
|
||||
}
|
||||
|
||||
// GetClientMap 返回客户端映射(用于调试)
|
||||
func GetClientMap() map[uint32]string {
|
||||
clientIdMutex.Lock()
|
||||
defer clientIdMutex.Unlock()
|
||||
result := make(map[uint32]string, len(globalClientMap))
|
||||
for clientID, userID := range globalClientMap {
|
||||
if userID != "" {
|
||||
result[clientID] = userID
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
Reference in New Issue
Block a user