Merge pull request #417 from diamante0018/fix/persona-state

[Friends] Remove code that forces you to be busy on Steam
This commit is contained in:
Dss0 2022-08-10 11:57:23 +02:00 committed by GitHub
commit c6690d1d8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 34 deletions

View File

@ -126,23 +126,15 @@ namespace Components
} }
} }
void Friends::UpdateState(bool force) void Friends::UpdateState()
{ {
if (Friends::CLAnonymous.get<bool>() || Friends::IsInvisible() || !Steam::Enabled()) return; if (Friends::CLAnonymous.get<bool>() || Friends::IsInvisible() || !Steam::Enabled())
{
return;
}
if (force)
{
if (Steam::Proxy::ClientFriends && Steam::Proxy::SteamFriends)
{
int state = Steam::Proxy::SteamFriends->GetPersonaState();
Steam::Proxy::ClientFriends.invoke<void>("SetPersonaState", (state == 1 ? 2 : 1));
}
}
else
{
Friends::TriggerUpdate = true; Friends::TriggerUpdate = true;
} }
}
void Friends::UpdateServer(Network::Address server, const std::string& hostname, const std::string& mapname) void Friends::UpdateServer(Network::Address server, const std::string& hostname, const std::string& mapname)
{ {
@ -660,7 +652,7 @@ namespace Components
if (Friends::TriggerUpdate) if (Friends::TriggerUpdate)
{ {
Friends::TriggerUpdate = false; Friends::TriggerUpdate = false;
Friends::UpdateState(true); Friends::UpdateState();
} }
} }

View File

@ -83,7 +83,7 @@ namespace Components
static bool IsClientInParty(int controller, int clientNum); static bool IsClientInParty(int controller, int clientNum);
static void UpdateUserInfo(SteamID user); static void UpdateUserInfo(SteamID user);
static void UpdateState(bool force = false); static void UpdateState();
static void SortList(bool force = false); static void SortList(bool force = false);
static void SortIndividualList(std::vector<Friend>* list); static void SortIndividualList(std::vector<Friend>* list);

View File

@ -28,7 +28,7 @@ namespace Steam
SteamID Friends::GetFriendByIndex(int iFriend, int iFriendFlags) SteamID Friends::GetFriendByIndex(int iFriend, int iFriendFlags)
{ {
return SteamID(); return {};
} }
int Friends::GetFriendRelationship(SteamID steamIDFriend) int Friends::GetFriendRelationship(SteamID steamIDFriend)
@ -88,7 +88,7 @@ namespace Steam
SteamID Friends::GetFriendFromSourceByIndex(SteamID steamIDSource, int iFriend) SteamID Friends::GetFriendFromSourceByIndex(SteamID steamIDSource, int iFriend)
{ {
return SteamID(); return {};
} }
bool Friends::IsUserInSource(SteamID steamIDUser, SteamID steamIDSource) bool Friends::IsUserInSource(SteamID steamIDUser, SteamID steamIDSource)