2
0

LobbyDefines.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * LobbyDefines.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. enum class LobbyCookieStatus : int32_t
  12. {
  13. INVALID,
  14. VALID
  15. };
  16. enum class LobbyInviteStatus : int32_t
  17. {
  18. NOT_INVITED,
  19. INVITED,
  20. DECLINED
  21. };
  22. enum class LobbyRoomState : int32_t
  23. {
  24. IDLE = 0, // server is ready but no players are in the room
  25. PUBLIC = 1, // host has joined and allows anybody to join
  26. PRIVATE = 2, // host has joined but only allows those he invited to join
  27. BUSY = 3, // match is ongoing and no longer accepts players
  28. CANCELLED = 4, // game room was cancelled without starting the game
  29. CLOSED = 5, // game room was closed after playing for some time
  30. };
  31. struct LobbyAccount
  32. {
  33. std::string accountID;
  34. std::string displayName;
  35. };
  36. struct LobbyGameRoom
  37. {
  38. std::string roomID;
  39. std::string hostAccountID;
  40. std::string hostAccountDisplayName;
  41. std::string description;
  42. std::string version;
  43. std::string modsJson;
  44. std::vector<LobbyAccount> participants;
  45. std::vector<LobbyAccount> invited;
  46. LobbyRoomState roomState;
  47. uint32_t playerLimit;
  48. std::chrono::seconds age;
  49. };
  50. struct LobbyChatMessage
  51. {
  52. std::string accountID;
  53. std::string displayName;
  54. std::string messageText;
  55. std::chrono::seconds age;
  56. };