requests.hrl 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. -include("basic_types.hrl").
  2. -include("types.hrl").
  3. -record(session_attach, {token}).
  4. -record(login, {username, password}).
  5. -record(logout, {}).
  6. -record(join_game, {game}).
  7. -record(get_game_info, {game}).
  8. -record(get_player_info, {player_id :: 'PlayerId'() | 0}).
  9. -record(get_player_stats, {player_id :: 'PlayerId'() | 0, game_type :: binary()}).
  10. -record(subscribe_player_rels, {players :: list()}).
  11. -record(unsubscribe_player_rels, {players :: list()}).
  12. -record(chat, {chat_id :: 'GameId'(),message :: string()}).
  13. -record(game_action, { game :: 'GameId'(), action :: any(), args = [] :: proplist()}).
  14. -record(game_event, {
  15. game :: 'GameId'(),
  16. event :: any(),
  17. args = [] :: proplist()
  18. }).
  19. -record(dummy_player_change, {
  20. player :: 'PlayerId'()
  21. }).
  22. -record(chat_msg, {
  23. chat :: 'GameId'(),
  24. content :: string(),
  25. author_id :: 'PlayerId'(),
  26. author_nick :: string()
  27. }).
  28. -record(social_action, {
  29. game :: 'GameId'(),
  30. type :: 'SocialActionEnum'(),
  31. recipient :: 'PlayerId'() | null
  32. }).
  33. -record(social_action_msg, {
  34. type :: 'SocialActionEnum'(),
  35. game :: 'GameId'(),
  36. initiator :: 'PlayerId'(),
  37. recipient :: 'PlayerId'() | null
  38. }).
  39. -record(pause_game, {
  40. table_id :: integer(),
  41. game :: 'GameId'(),
  42. action :: string()
  43. }).
  44. -record(game_paused, {
  45. table_id :: integer(),
  46. game :: 'GameId'(),
  47. action :: string(),
  48. who :: 'PlayerId'(),
  49. retries :: integer()
  50. }).
  51. -record(disconnect, {
  52. reason_id = null :: null | string(),
  53. reason = null :: null | string()
  54. }).
  55. %% packet as game_event:
  56. -record(player_left, {
  57. player :: 'PlayerId'(),
  58. bot_replaced = false :: boolean(), %% will be replaced by bot?
  59. human_replaced = false :: boolean(), %% will be replaced by human?
  60. replacement = null :: 'PlayerId'() | null %% id of replacement player/bot
  61. }).
  62. -record('TableInfo', {
  63. chat = [] :: list(any()),
  64. viewers = [] :: list('PlayerId'()),
  65. players = [] :: list('PlayerId'()),
  66. game :: atom(),
  67. game_status :: atom()
  68. }).