user_subsidy.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. package gatesink
  2. import (
  3. "encoding/json"
  4. "bet24.com/log"
  5. "bet24.com/redis"
  6. "bet24.com/servers/coreservice/client"
  7. "bet24.com/servers/fishhall/config"
  8. )
  9. // 获取补助信息
  10. func (this *user) subsidyGetInfo(msg, data string) {
  11. resp := client.SubsidyGetInfo(this.getUserId(), config.HallConfig.SubsidyAmount, config.HallConfig.SubsidyTimes)
  12. if resp.RetCode != 1 {
  13. log.Debug("user.subsidyGetInfo failed %v", resp)
  14. }
  15. this.WriteMsg(msg, resp.Data)
  16. return
  17. }
  18. // 领取补助
  19. func (this *user) subsidyGift(msg, data string) {
  20. resp := client.SubsidyGift(this.getUserId(),
  21. config.HallConfig.SubsidyAmount,
  22. config.HallConfig.SubsidyTimes,
  23. config.HallConfig.SubsidyCoolSeconds)
  24. // log.Debug("user.subsidyGift succeeded resp=%+v", resp)
  25. if resp.RetCode != 1 {
  26. log.Debug("user.subsidyGift failed %v", resp)
  27. } else {
  28. var d redis.Channel_msg
  29. d.Message = "RefreshGold"
  30. d.UserID = this.getUserId()
  31. js, _ := json.Marshal(d)
  32. redis.Publish(string(js))
  33. }
  34. this.WriteMsg(msg, resp.Data)
  35. return
  36. }
  37. // 领取元宝补助
  38. func (this *user) subsidyGiftChip(msg, data string) {
  39. // if !Sink.IsChipRoom() {
  40. // return
  41. // }
  42. resp := client.SubsidyGiftChip(this.getUserId(), config.HallConfig.SubsidyAmount, this.GetIP())
  43. if resp.RetCode != 1 {
  44. log.Debug("user.subsidyGiftChip failed %v", resp)
  45. }
  46. this.WriteMsg(msg, resp.Data)
  47. return
  48. }