command.go 566 B

123456789101112131415161718192021222324252627282930
  1. package client
  2. import (
  3. "encoding/json"
  4. _ "bet24.com/log"
  5. )
  6. func OnUserEnter(userId int, ipAddress string) Response {
  7. msg := "OnUserEnter"
  8. var req Request_base
  9. req.UserId = userId
  10. req.IpAddress = ipAddress
  11. d, _ := json.Marshal(req)
  12. return DoRequest(msg, string(d))
  13. }
  14. func OnUserExit(userId int) Response {
  15. msg := "OnUserExit"
  16. var req Request_base
  17. req.UserId = userId
  18. d, _ := json.Marshal(req)
  19. return DoRequest(msg, string(d))
  20. }
  21. func SyncUserList(userlist []int) {
  22. msg := "SyncUserList"
  23. d, _ := json.Marshal(userlist)
  24. DoRequest(msg, string(d))
  25. }