2017-01-25 16:39:00 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace Components
|
|
|
|
{
|
|
|
|
class Friends : public Component
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Friends();
|
|
|
|
~Friends();
|
|
|
|
|
|
|
|
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
|
|
|
const char* getName() override { return "Friends"; };
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static void UpdateFriends();
|
|
|
|
|
|
|
|
private:
|
2017-01-28 18:31:11 -05:00
|
|
|
#pragma pack(push, 4)
|
2017-01-25 16:39:00 -05:00
|
|
|
struct FriendRichPresenceUpdate
|
|
|
|
{
|
|
|
|
SteamID m_steamIDFriend; // friend who's rich presence has changed
|
|
|
|
int32_t m_nAppID; // the appID of the game (should always be the current game)
|
|
|
|
};
|
2017-01-28 18:31:11 -05:00
|
|
|
#pragma pack(pop)
|
2017-01-25 16:39:00 -05:00
|
|
|
|
|
|
|
struct PersonaStateChange
|
|
|
|
{
|
|
|
|
SteamID m_ulSteamID; // steamID of the friend who changed
|
|
|
|
int m_nChangeFlags; // what's changed
|
|
|
|
};
|
|
|
|
|
|
|
|
class Friend
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SteamID userId;
|
|
|
|
std::string name;
|
|
|
|
Network::Address server;
|
|
|
|
std::string statusName;
|
|
|
|
bool online;
|
2017-01-26 06:42:42 -05:00
|
|
|
int experience;
|
|
|
|
int prestige;
|
2017-01-25 16:39:00 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
static unsigned int CurrentFriend;
|
|
|
|
static std::recursive_mutex Mutex;
|
|
|
|
static std::vector<Friend> FriendsList;
|
|
|
|
|
|
|
|
static void UpdateUserInfo(SteamID user);
|
|
|
|
|
|
|
|
static unsigned int GetFriendCount();
|
|
|
|
static const char* GetFriendText(unsigned int index, int column);
|
|
|
|
static void SelectFriend(unsigned int index);
|
2017-01-28 13:03:44 -05:00
|
|
|
|
|
|
|
static void FriendsResponse(std::vector<std::string> params);
|
|
|
|
static void NameResponse(std::vector<std::string> params);
|
2017-01-28 18:31:11 -05:00
|
|
|
static void PresenceResponse(std::vector<std::string> params);
|
2017-01-29 05:40:20 -05:00
|
|
|
static void InfoResponse(std::vector<std::string> params);
|
2017-01-25 16:39:00 -05:00
|
|
|
};
|
|
|
|
}
|