RoomTypes.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * Copyright (c) 2014, Oculus VR, Inc.
  3. * All rights reserved.
  4. *
  5. * This source code is licensed under the BSD-style license found in the
  6. * LICENSE file in the root directory of this source tree. An additional grant
  7. * of patent rights can be found in the PATENTS file in the same directory.
  8. *
  9. */
  10. #include "DS_Table.h"
  11. #ifndef __ROOM_TYPES_H
  12. #define __ROOM_TYPES_H
  13. enum RoomMemberMode
  14. {
  15. /// The owner of the room, who is also a player in the room. The owner cannot be a spectator
  16. RMM_MODERATOR,
  17. /// The room member is a player in a public slot
  18. RMM_PUBLIC,
  19. /// The room member is a player in a reserved slot
  20. RMM_RESERVED,
  21. /// The room member is a spectator in a public slot.
  22. RMM_SPECTATOR_PUBLIC,
  23. /// The room member is a spectator in a reserved slot.
  24. RMM_SPECTATOR_RESERVED,
  25. /// Used as a query flag - join any slot that is playable (reserved or public)
  26. RMM_ANY_PLAYABLE,
  27. /// Used as a query flag - join any slot that is for a spectator (reserved or public)
  28. RMM_ANY_SPECTATOR,
  29. };
  30. const char *RoomMemberModeToEnum(RoomMemberMode e);
  31. struct DefaultRoomColumns
  32. {
  33. enum
  34. {
  35. TC_TITLE_NAME,
  36. TC_TITLE_ID,
  37. TC_ROOM_NAME,
  38. TC_ROOM_ID,
  39. TC_TOTAL_SLOTS,
  40. TC_TOTAL_PUBLIC_PLUS_RESERVED_SLOTS,
  41. TC_USED_SLOTS,
  42. TC_USED_PUBLIC_PLUS_RESERVED_SLOTS,
  43. TC_REMAINING_SLOTS,
  44. TC_REMAINING_PUBLIC_PLUS_RESERVED_SLOTS,
  45. TC_TOTAL_PUBLIC_SLOTS,
  46. TC_TOTAL_RESERVED_SLOTS,
  47. TC_TOTAL_SPECTATOR_SLOTS,
  48. TC_USED_PUBLIC_SLOTS,
  49. TC_USED_RESERVED_SLOTS,
  50. TC_USED_SPECTATOR_SLOTS,
  51. TC_REMAINING_PUBLIC_SLOTS,
  52. TC_REMAINING_RESERVED_SLOTS,
  53. TC_REMAINING_SPECTATOR_SLOTS,
  54. TC_CREATION_TIME,
  55. TC_DESTROY_ON_MODERATOR_LEAVE,
  56. TC_LOBBY_ROOM_PTR,
  57. TC_TABLE_COLUMNS_COUNT
  58. } columnId;
  59. const char *columnName;
  60. DataStructures::Table::ColumnType columnType;
  61. static const char *GetColumnName(int columnId);
  62. static int GetColumnIndex(const char *columnName);
  63. static DataStructures::Table::ColumnType GetColumnType(int columnId);
  64. static bool HasColumnName(const char *columnName);
  65. static void AddDefaultColumnsToTable(DataStructures::Table *table);
  66. static bool HasDefaultColumns(DataStructures::Table *table);
  67. };
  68. #endif
粤ICP备19079148号