pointmatch.pb.go 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. package proto
  2. import (
  3. "bet24.com/log"
  4. "bet24.com/servers/micros/common"
  5. "context"
  6. )
  7. type CreatePointMatch_req struct {
  8. Request
  9. GameId int
  10. GameRule string
  11. TotalUser int
  12. TableUser int
  13. EnrollFee int
  14. Prize int
  15. PlayTime int
  16. EliminateScore int
  17. ShrinkSec int
  18. ShrinkScore int
  19. WinnerCount int
  20. }
  21. type PointMatch_req struct {
  22. Request
  23. MatchNo int
  24. }
  25. type EnrollPointMatch_req struct {
  26. PointMatch_req
  27. NickName string
  28. FaceId int
  29. FaceUrl string
  30. }
  31. func CreatePointMatch(userId int, gameId int, gameRule string, totalUserCount int,
  32. tableUserCount int, enrollFee int, prize int, playTime int,
  33. eliminateScore, shrinkSec, shrinkScore, winnerCount int) (int, string) {
  34. var req CreatePointMatch_req
  35. req.UserId = userId
  36. req.GameId = gameId
  37. req.GameRule = gameRule
  38. req.TotalUser = totalUserCount
  39. req.TableUser = tableUserCount
  40. req.EnrollFee = enrollFee
  41. req.Prize = prize
  42. req.PlayTime = playTime
  43. req.EliminateScore = eliminateScore
  44. req.ShrinkSec = shrinkSec
  45. req.ShrinkScore = shrinkScore
  46. req.WinnerCount = winnerCount
  47. reply := &Response{}
  48. err := getClient().Call(context.Background(), "CreatePointMatch", &req, reply)
  49. if err != nil {
  50. log.Debug("matches.CreatePointMatch failed to call: %v", err)
  51. common.GetClientPool().RemoveClient(ServiceName)
  52. return 0, "server error"
  53. }
  54. return reply.RetCode, reply.Data
  55. }
  56. func ClosePointMatch(userId int, matchNo int) (int, string) {
  57. var req PointMatch_req
  58. req.UserId = userId
  59. req.MatchNo = matchNo
  60. reply := &Response{}
  61. err := getClient().Call(context.Background(), "ClosePointMatch", &req, reply)
  62. if err != nil {
  63. log.Debug("matches.ClosePointMatch failed to call: %v", err)
  64. common.GetClientPool().RemoveClient(ServiceName)
  65. return 0, "server error"
  66. }
  67. return reply.RetCode, reply.Data
  68. }
  69. func EnrollPointMatch(userId int, matchNo int, nickname string, faceId int, faceUrl string) (int, string) {
  70. var req EnrollPointMatch_req
  71. req.UserId = userId
  72. req.MatchNo = matchNo
  73. req.NickName = nickname
  74. req.FaceId = faceId
  75. req.FaceUrl = faceUrl
  76. reply := &Response{}
  77. err := getClient().Call(context.Background(), "EnrollPointMatch", &req, reply)
  78. if err != nil {
  79. log.Debug("matches.EnrollPointMatch failed to call: %v", err)
  80. common.GetClientPool().RemoveClient(ServiceName)
  81. return 0, "server error"
  82. }
  83. return reply.RetCode, reply.Data
  84. }
  85. func QuitPointMatch(userId int, matchNo int) bool {
  86. var req PointMatch_req
  87. req.UserId = userId
  88. req.MatchNo = matchNo
  89. reply := &Response{}
  90. err := getClient().Call(context.Background(), "QuitPointMatch", &req, reply)
  91. if err != nil {
  92. log.Debug("matches.QuitPointMatch failed to call: %v", err)
  93. common.GetClientPool().RemoveClient(ServiceName)
  94. return false
  95. }
  96. return reply.BoolValue
  97. }
  98. func GetPointMatchInfo(matchNo int) string {
  99. var req PointMatch_req
  100. req.MatchNo = matchNo
  101. reply := &Response{}
  102. err := getClient().Call(context.Background(), "GetPointMatchInfo", &req, reply)
  103. if err != nil {
  104. log.Debug("matches.GetPointMatchInfo failed to call: %v", err)
  105. common.GetClientPool().RemoveClient(ServiceName)
  106. return ""
  107. }
  108. return reply.Data
  109. }
  110. func GetUserPointMatches(userId int) string {
  111. var req Request
  112. req.UserId = userId
  113. reply := &Response{}
  114. err := getClient().Call(context.Background(), "GetUserPointMatches", &req, reply)
  115. if err != nil {
  116. log.Debug("matches.GetUserPointMatches failed to call: %v", err)
  117. common.GetClientPool().RemoveClient(ServiceName)
  118. return ""
  119. }
  120. return reply.Data
  121. }
  122. func GetPointMatchConfigs() string {
  123. reply := &Response{}
  124. err := getClient().Call(context.Background(), "GetPointMatchConfigs", nil, reply)
  125. if err != nil {
  126. log.Debug("matches.GetPointMatchConfigs failed to call: %v", err)
  127. common.GetClientPool().RemoveClient(ServiceName)
  128. return ""
  129. }
  130. return reply.Data
  131. }
  132. func GetEnrolledPointMatch(userId int) string {
  133. var req Request
  134. req.UserId = userId
  135. reply := &Response{}
  136. err := getClient().Call(context.Background(), "GetEnrolledPointMatch", req, reply)
  137. if err != nil {
  138. log.Debug("matches.GetEnrolledPointMatch failed to call: %v", err)
  139. common.GetClientPool().RemoveClient(ServiceName)
  140. return ""
  141. }
  142. return reply.Data
  143. }
  144. func GetPointMatchHistory(userId int) string {
  145. var req Request
  146. req.UserId = userId
  147. reply := &Response{}
  148. err := getClient().Call(context.Background(), "GetPointMatchHistory", req, reply)
  149. if err != nil {
  150. log.Debug("matches.GetPointMatchHistory failed to call: %v", err)
  151. common.GetClientPool().RemoveClient(ServiceName)
  152. return ""
  153. }
  154. return reply.Data
  155. }