Commit 6915ff18f5425405fc6eddff6d689f5260dee540

Authored by 陆恒
1 parent ea33d928
Exists in master

提交

src/HttpServer/jsonconf/RobotConfig.json
1 [ 1 [
2 { 2 {
  3 + "id": 1,
  4 + "name": "残留笑颜",
  5 + "image": 1
  6 + },
  7 + {
  8 + "id": 2,
  9 + "name": "咆哮",
  10 + "image": 2
  11 + },
  12 + {
3 "id": 3, 13 "id": 3,
4 "name": "能不能给我分红猫", 14 "name": "能不能给我分红猫",
5 "image": 3 15 "image": 3
src/HttpServer/jsonconf/jsonconf.go
@@ -159,6 +159,12 @@ func GetRedCatConfig(lv int) *RedCatDesc { @@ -159,6 +159,12 @@ func GetRedCatConfig(lv int) *RedCatDesc {
159 return nil 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 func GetRandName() string { 169 func GetRandName() string {
164 length := len(g_jsonconf.RobotConfig) 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,8 +2872,10 @@ func HandlerQueryGambling(w http.ResponseWriter, data string, uuid int) {
2872 } 2872 }
2873 } else { 2873 } else {
2874 //todo 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 logger.Info("HandlerQueryGambling rewardnickname=%v,rewardhead=%v", rewardnickname, rewardhead) 2881 logger.Info("HandlerQueryGambling rewardnickname=%v,rewardhead=%v", rewardnickname, rewardhead)