LobbyDefines.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. LobbyRoomState roomState;
  46. uint32_t playerLimit;
  47. std::chrono::seconds age;
  48. };
  49. struct LobbyChatMessage
  50. {
  51. std::string accountID;
  52. std::string displayName;
  53. std::string messageText;
  54. std::chrono::seconds age;
  55. };