重构
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package cool
|
||||
|
||||
import (
|
||||
"blazing/common/data/entity"
|
||||
"blazing/common/utils"
|
||||
"context"
|
||||
"reflect"
|
||||
@@ -14,8 +13,7 @@ import (
|
||||
var ctx = context.TODO()
|
||||
|
||||
var (
|
||||
Mainplayer = &utils.SyncMap[uint32, *entity.Player]{} //玩家数据
|
||||
CmdCache = &utils.SyncMap[uint32, reflect.Value]{} //命令缓存
|
||||
CmdCache = &utils.SyncMap[uint32, reflect.Value]{} //命令缓存
|
||||
|
||||
Loger = glog.New()
|
||||
)
|
||||
@@ -37,12 +35,3 @@ func init() {
|
||||
glog.Debug(context.Background(), "初始化雪花算法", newId)
|
||||
|
||||
}
|
||||
func ConutPlayer() int {
|
||||
|
||||
count := 0
|
||||
Mainplayer.Range(func(uint32, *entity.Player) bool {
|
||||
count++
|
||||
return true // 继续遍历
|
||||
})
|
||||
return count
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user