Lobby2Presence.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. #ifndef __LOBBY_2_PRESENCE_H
  11. #define __LOBBY_2_PRESENCE_H
  12. #include "RakString.h"
  13. namespace RakNet
  14. {
  15. class BitStream;
  16. /// Lobby2Presence is information about your online status. It is only held in memory, so is lost when you go offline.
  17. /// Set by calling Client_SetPresence and retrieve with Client_GetPresence
  18. struct Lobby2Presence
  19. {
  20. Lobby2Presence();
  21. Lobby2Presence(const Lobby2Presence& input);
  22. Lobby2Presence& operator = ( const Lobby2Presence& input );
  23. ~Lobby2Presence();
  24. void Serialize(RakNet::BitStream *bitStream, bool writeToBitstream);
  25. enum Status
  26. {
  27. /// Set by the constructor, meaning it was never set. This is the default if a user is online, but SetPresence() was never called.
  28. UNDEFINED,
  29. /// Returned by Client_GetPresence() if you query for a user that is not online, whether or not SetPresence was ever called().
  30. NOT_ONLINE,
  31. /// Set by the user (you)
  32. AWAY,
  33. /// Set by the user (you)
  34. DO_NOT_DISTURB,
  35. /// Set by the user (you)
  36. MINIMIZED,
  37. /// Set by the user (you)
  38. TYPING,
  39. /// Set by the user (you)
  40. VIEWING_PROFILE,
  41. /// Set by the user (you)
  42. EDITING_PROFILE,
  43. /// Set by the user (you)
  44. IN_LOBBY,
  45. /// Set by the user (you)
  46. IN_ROOM,
  47. /// Set by the user (you)
  48. IN_GAME
  49. } status;
  50. /// Visibility flag. This is not enforced by the server, so if you want a user's presence to be not visible, just don't display it on the client
  51. bool isVisible;
  52. /// Although game name is also present in the titleNameOrID member of Client_Login, this is the visible name returned by presence queries
  53. /// That is because Client_Login::titleNameOrID member is optional, for example for lobbies that support multiple titles.
  54. /// Set by the user (you) or leave blank if desired.
  55. RakString titleNameOrID;
  56. /// Anything you want
  57. RakString statusString;
  58. };
  59. }
  60. #endif
粤ICP备19079148号