package svcommon import ( "apigame/configs/confglobal" "math/rand" ) // GetName 随机模拟玩家名字 func GetName(gameId string) string { config, err := confglobal.GetConfig(gameId) if err == nil { count := len(config.Names) if count > 0 { return config.Names[rand.Intn(count)] } } return "李四" } // GetIcon 随机模拟玩家头像 func GetIcon(gameId string) string { config, err := confglobal.GetConfig(gameId) if err == nil { count := len(config.Avatars) if count > 0 { return config.Avatars[rand.Intn(count)] } } return "lisi_icon" }