Commit 6915ff18f5425405fc6eddff6d689f5260dee540
1 parent
ea33d928
Exists in
master
提交
Showing
3 changed files
with
20 additions
and
2 deletions
Show diff stats
src/HttpServer/jsonconf/RobotConfig.json
src/HttpServer/jsonconf/jsonconf.go
... | ... | @@ -159,6 +159,12 @@ func GetRedCatConfig(lv int) *RedCatDesc { |
159 | 159 | return nil |
160 | 160 | } |
161 | 161 | |
162 | +//计算中奖名字 | |
163 | +func CalcWinner(round int) (string, int) { | |
164 | + length := round % len(g_jsonconf.RobotConfig) | |
165 | + return g_jsonconf.RobotConfig[length].Name, int(g_jsonconf.RobotConfig[length].Image) | |
166 | +} | |
167 | + | |
162 | 168 | //获取一个随机名字 |
163 | 169 | func GetRandName() string { |
164 | 170 | length := len(g_jsonconf.RobotConfig) | ... | ... |
src/HttpServer/logic/logic.go
... | ... | @@ -2872,8 +2872,10 @@ func HandlerQueryGambling(w http.ResponseWriter, data string, uuid int) { |
2872 | 2872 | } |
2873 | 2873 | } else { |
2874 | 2874 | //todo |
2875 | - rewardhead = "1" | |
2876 | - rewardnickname = "他的爸爸" | |
2875 | + rname, rdx := jsonconf.CalcWinner(vv.Round) | |
2876 | + | |
2877 | + rewardhead = "https://app-cdn.miso-lab.com/online/luckycat/defaultAvatar/" + strconv.Itoa(rdx) + ".jpg" | |
2878 | + rewardnickname = rname | |
2877 | 2879 | } |
2878 | 2880 | |
2879 | 2881 | logger.Info("HandlerQueryGambling rewardnickname=%v,rewardhead=%v", rewardnickname, rewardhead) | ... | ... |