matchuser.go 1001 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package simplematch
  2. import (
  3. "bet24.com/servers/micros/matches/handler/matchbase"
  4. )
  5. type matchuser struct {
  6. matchbase.MatchUser
  7. RoomNo int
  8. // 私人场房间信息
  9. ServerAddr string
  10. TableId int
  11. ChairId int
  12. Round int // 止步第几轮
  13. prize int
  14. tax int
  15. teamId int // 如果有对家的玩法,第一轮会分配用户teamId,方便后续继续分配的时候保证坐一起
  16. }
  17. func newMatchUser(userId int, nickName string, faceId int, faceUrl string, score int, baseScore int) *matchuser {
  18. return &matchuser{
  19. MatchUser: matchbase.MatchUser{
  20. UserId: userId,
  21. NickName: nickName,
  22. FaceUrl: faceUrl,
  23. FaceId: faceId,
  24. Score: score,
  25. BaseScore: baseScore,
  26. },
  27. }
  28. }
  29. func (mu *matchuser) arrangeRoom(roomNo int, serverAddr string, tableId int, chairId int) {
  30. mu.RoomNo = roomNo
  31. mu.ServerAddr = serverAddr
  32. mu.TableId = tableId
  33. mu.ChairId = chairId
  34. }
  35. func (mu *matchuser) clearRoomInfo() {
  36. mu.ServerAddr = ""
  37. mu.TableId = -1
  38. mu.ChairId = -1
  39. }