[Friends]
This commit is contained in:
parent
d01d27a3e9
commit
6ee814cef5
@ -86,7 +86,7 @@ namespace Components
|
||||
return;
|
||||
}
|
||||
|
||||
if (Steam::Enabled() && !Dvar::Var("cl_anonymous").get<bool>() && Steam::Proxy::SteamUser_)
|
||||
if (Steam::Enabled() && !Friends::IsInvisible() && !Dvar::Var("cl_anonymous").get<bool>() && Steam::Proxy::SteamUser_)
|
||||
{
|
||||
infostr.set("realsteamId", Utils::String::VA("%llX", Steam::Proxy::SteamUser_->GetSteamID().bits));
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ namespace Components
|
||||
|
||||
void Friends::UpdateState(bool force)
|
||||
{
|
||||
if (Dvar::Var("cl_anonymous").get<bool>() || !Steam::Enabled()) return;
|
||||
if (Dvar::Var("cl_anonymous").get<bool>() || Friends::IsInvisible() || !Steam::Enabled()) return;
|
||||
|
||||
if (force)
|
||||
{
|
||||
@ -228,7 +228,7 @@ namespace Components
|
||||
|
||||
void Friends::SetPresence(const std::string& key, const std::string& value)
|
||||
{
|
||||
if (Steam::Proxy::ClientFriends && Steam::Proxy::SteamUtils && !Dvar::Var("cl_anonymous").get<bool>() && Steam::Enabled())
|
||||
if (Steam::Proxy::ClientFriends && Steam::Proxy::SteamUtils && !Dvar::Var("cl_anonymous").get<bool>() && !Friends::IsInvisible() && Steam::Enabled())
|
||||
{
|
||||
Friends::SetRawPresence(key.data(), value.data());
|
||||
}
|
||||
@ -494,6 +494,11 @@ namespace Components
|
||||
return appId;
|
||||
}
|
||||
|
||||
bool Friends::IsInvisible()
|
||||
{
|
||||
return Friends::InitialState == 7;
|
||||
}
|
||||
|
||||
void Friends::UpdateTimeStamp()
|
||||
{
|
||||
Friends::SetPresence("iw4x_playing", Utils::String::VA("%d", Steam::SteamUtils()->GetServerRealTime()));
|
||||
@ -696,10 +701,10 @@ namespace Components
|
||||
{
|
||||
if (Steam::Proxy::SteamFriends)
|
||||
{
|
||||
Friends::InitialState = Steam::Proxy::SteamFriends->GetPersonaState();
|
||||
Friends::InitialState = Steam::Proxy::SteamFriends->GetFriendPersonaState(Steam::Proxy::SteamUser_->GetSteamID());
|
||||
}
|
||||
|
||||
if (Dvar::Var("cl_anonymous").get<bool>() || !Steam::Enabled())
|
||||
if (Dvar::Var("cl_anonymous").get<bool>() || Friends::IsInvisible() || !Steam::Enabled())
|
||||
{
|
||||
if (Steam::Proxy::ClientFriends)
|
||||
{
|
||||
|
@ -23,6 +23,8 @@ namespace Components
|
||||
|
||||
static int GetGame(SteamID user);
|
||||
|
||||
static bool IsInvisible();
|
||||
|
||||
private:
|
||||
#pragma pack(push, 4)
|
||||
struct FriendRichPresenceUpdate
|
||||
|
@ -86,7 +86,11 @@ namespace Steam
|
||||
if (ud_insn_mnemonic(&ud) == UD_Iret)
|
||||
{
|
||||
const ud_operand* operand = ud_insn_opr(&ud, 0);
|
||||
if (!operand) break;
|
||||
if (!operand)
|
||||
{
|
||||
*params = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (operand->type == UD_OP_IMM && operand->size == 16)
|
||||
{
|
||||
@ -110,6 +114,8 @@ namespace Steam
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (*reinterpret_cast<unsigned char*>(ud.pc) == 0xCC) break;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user