diff --git a/src/HttpServer/jsonconf/RobotConfig.json b/src/HttpServer/jsonconf/RobotConfig.json index ecbdb22..6ff9fa6 100644 --- a/src/HttpServer/jsonconf/RobotConfig.json +++ b/src/HttpServer/jsonconf/RobotConfig.json @@ -1,5 +1,15 @@ [ { + "id": 1, + "name": "残留笑颜", + "image": 1 + }, + { + "id": 2, + "name": "咆哮", + "image": 2 + }, + { "id": 3, "name": "能不能给我分红猫", "image": 3 diff --git a/src/HttpServer/jsonconf/jsonconf.go b/src/HttpServer/jsonconf/jsonconf.go index 9ae884c..9541d6c 100644 --- a/src/HttpServer/jsonconf/jsonconf.go +++ b/src/HttpServer/jsonconf/jsonconf.go @@ -159,6 +159,12 @@ func GetRedCatConfig(lv int) *RedCatDesc { return nil } +//计算中奖名字 +func CalcWinner(round int) (string, int) { + length := round % len(g_jsonconf.RobotConfig) + return g_jsonconf.RobotConfig[length].Name, int(g_jsonconf.RobotConfig[length].Image) +} + //获取一个随机名字 func GetRandName() string { length := len(g_jsonconf.RobotConfig) diff --git a/src/HttpServer/logic/logic.go b/src/HttpServer/logic/logic.go index 4799d92..c5125ad 100644 --- a/src/HttpServer/logic/logic.go +++ b/src/HttpServer/logic/logic.go @@ -2872,8 +2872,10 @@ func HandlerQueryGambling(w http.ResponseWriter, data string, uuid int) { } } else { //todo - rewardhead = "1" - rewardnickname = "他的爸爸" + rname, rdx := jsonconf.CalcWinner(vv.Round) + + rewardhead = "https://app-cdn.miso-lab.com/online/luckycat/defaultAvatar/" + strconv.Itoa(rdx) + ".jpg" + rewardnickname = rname } logger.Info("HandlerQueryGambling rewardnickname=%v,rewardhead=%v", rewardnickname, rewardhead) -- libgit2 0.21.0