[Friends] Store logged in state

This commit is contained in:
momo5502 2017-02-19 11:38:18 +01:00
parent 81f0116071
commit 131c165401
2 changed files with 7 additions and 1 deletions

View File

@ -2,6 +2,7 @@
namespace Components
{
bool Friends::LoggedOn = false;
bool Friends::TriggerSort = false;
bool Friends::TriggerUpdate = false;
@ -245,6 +246,8 @@ namespace Components
void Friends::UpdateFriends()
{
std::lock_guard<std::recursive_mutex> _(Friends::Mutex);
Friends::LoggedOn = (Steam::Proxy::SteamUser_ && Steam::Proxy::SteamUser_->LoggedOn());
if (!Steam::Proxy::SteamFriends) return;
Game::UI_UpdateArenas();
@ -438,7 +441,7 @@ namespace Components
std::lock_guard<std::recursive_mutex> _(Friends::Mutex);
// Only store our cache if we are logged in, otherwise it might be invalid
if (!Steam::Proxy::SteamUser_ || !Steam::Proxy::SteamUser_->LoggedOn()) return;
if (!Friends::LoggedOn) return;
Proto::Friends::List list;
for(auto entry : Friends::FriendsList)
@ -457,6 +460,8 @@ namespace Components
Friends::Friends()
{
Friends::LoggedOn = false;
if (Dedicated::IsEnabled() ||ZoneBuilder::IsEnabled()) return;
Dvar::Register<bool>("cl_anonymous", false, Game::DVAR_FLAG_SAVED, "");
Dvar::Register<int>("cl_notifyFriendState", 1, -1, 1, Game::DVAR_FLAG_SAVED, "");

View File

@ -57,6 +57,7 @@ namespace Components
int prestige;
};
static bool LoggedOn;
static bool TriggerSort;
static bool TriggerUpdate;
static int InitialState;