Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
2.2 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef IFRIENDSUSER_H
  8. #define IFRIENDSUSER_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "interface.h"
  13. //-----------------------------------------------------------------------------
  14. // Purpose: Interface to accessing information about Friends Users
  15. //-----------------------------------------------------------------------------
  16. class IFriendsUser : public IBaseInterface
  17. {
  18. public:
  19. // returns true if the interface is ready for use
  20. virtual bool IsValid() = 0;
  21. // returns the Friends ID of the current user
  22. virtual unsigned int GetFriendsID() = 0;
  23. // returns information about a user
  24. // information may not be known about some users, "" will be returned
  25. virtual const char *GetUserName(unsigned int friendsID) = 0;
  26. virtual const char *GetFirstName(unsigned int friendsID) = 0;
  27. virtual const char *GetLastName(unsigned int friendsID) = 0;
  28. virtual const char *GetEmail(unsigned int friendsID) = 0;
  29. // returns true if buddyID is a buddy of the current user
  30. // ie. the current is authorized to see when the buddy is online
  31. virtual bool IsBuddy(unsigned int buddyID) = 0;
  32. // requests authorization from a user
  33. virtual void RequestAuthorizationFromUser(unsigned int potentialBuddyID) = 0;
  34. // returns the status of the buddy, > 0 is online, 4 is ingame
  35. virtual int GetBuddyStatus(unsigned int friendsID) = 0;
  36. // gets the IP address of the server the buddy is on, returns false if couldn't get
  37. virtual bool GetBuddyGameAddress(unsigned int friendsID, int *ip, int *port) = 0;
  38. // returns the number of buddies
  39. virtual int GetNumberOfBuddies() = 0;
  40. // returns the FriendsID of a buddy - buddyIndex is valid in the range [0, GetNumberOfBuddies)
  41. virtual unsigned int GetBuddyFriendsID(int buddyIndex) = 0;
  42. // sets whether or not the user can receive messages at this time
  43. // messages will be queued until this is set to true
  44. virtual void SetCanReceiveMessages(bool state) = 0;
  45. };
  46. #define FRIENDSUSER_INTERFACE_VERSION "FriendsUser001"
  47. #endif // IFRIENDSUSER_H