sngmatch.go 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package sngmatch
  2. import (
  3. "bet24.com/log"
  4. )
  5. func Run() {
  6. log.Release("sngmatch.Run")
  7. getMatchManager().run()
  8. getHistoryManager().run()
  9. getFreeCountManager().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 EnrollSngMatch(matchId int, userId int, nickname string, faceId int, faceUrl string, feeIndex int) (int, string) {
  20. return getMatchManager().enrollSngMatch(matchId, userId, nickname, faceId, faceUrl, feeIndex)
  21. }
  22. func QuitSngMatch(matchId int, userId int) bool {
  23. return getMatchManager().quitSngMatch(matchId, userId)
  24. }
  25. func GetMatchList(userId int) string {
  26. return getMatchManager().getMatchList(userId)
  27. }
  28. func Flush() {
  29. getHistoryManager().forceFlush()
  30. }
  31. func GetSngMatchHistory(userId int) string {
  32. return getHistoryManager().getHistory(userId)
  33. }
  34. func GetUserSngMatchId(userId int) int {
  35. ret := getMatchManager().getUserMatchId(userId)
  36. log.Debug("GetUserSngMatchId [%d] returns %d", userId, ret)
  37. return ret
  38. }