combomatch.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package combomatch
  2. import (
  3. "bet24.com/log"
  4. pb "bet24.com/servers/micros/matches/proto"
  5. )
  6. func Run() {
  7. log.Release("combomatch.Run")
  8. getMatchManager().run()
  9. getHistoryManager().run()
  10. }
  11. func Dump(param1, param2 string) {
  12. if param1 == "free" {
  13. getFreeCountManager().dump(param2)
  14. return
  15. }
  16. getMatchManager().dump(param1, param2)
  17. }
  18. // 参加比赛,成功后返回MatchNo
  19. func EnrollComboMatch(matchId int, userId int, nickname string, faceId int, faceUrl string, feeIndex int) (int, string) {
  20. return getMatchManager().enrollComboMatch(matchId, userId, nickname, faceId, faceUrl, feeIndex, false)
  21. }
  22. func QuitComboMatch(matchId int, userId int) bool {
  23. return getMatchManager().quitComboMatch(matchId, userId)
  24. }
  25. func GetMatchList(userId int) string {
  26. return getMatchManager().getMatchList(userId)
  27. }
  28. func Flush() {
  29. getHistoryManager().forceFlush()
  30. }
  31. func GetComboMatchHistory(userId int) string {
  32. return getHistoryManager().getHistory(userId)
  33. }
  34. func GetUserComboMatchId(userId int) []pb.UserComboMatchId {
  35. return getMatchManager().getUserMatchId(userId)
  36. }
  37. func GetComboMatchInfo(matchId int, userId int) string {
  38. return getMatchManager().getUserMatchInfo(matchId, userId)
  39. }
  40. func GetComboMatchConfirmCount(matchId int) int {
  41. return getMatchManager().getConfirmCount(matchId)
  42. }
  43. func ComboMatchConfirm(matchId, userId int) bool {
  44. return getMatchManager().confirmMatch(matchId, userId)
  45. }