[Friends] Set presence data correctly

This commit is contained in:
momo5502 2017-02-17 11:59:16 +01:00
parent ac3697f89b
commit aa8ca9cee7
2 changed files with 11 additions and 8 deletions

View File

@ -160,17 +160,19 @@ namespace Components
void Friends::ClearPresence(std::string key)
{
if (Steam::Proxy::SteamFriends)
if (Steam::Proxy::ClientFriends)
{
Steam::Proxy::SteamFriends->SetRichPresence(key.data(), nullptr);
Steam::Proxy::ClientFriends.invoke<void>("SetRichPresence", 0, key.data(), nullptr);
Steam::Proxy::ClientFriends.invoke<void>("SetRichPresence", Steam::Proxy::AppId, key.data(), nullptr);
}
}
void Friends::SetPresence(std::string key, std::string value)
{
if (Steam::Proxy::SteamFriends && !Dvar::Var("cl_anonymous").get<bool>())
if (Steam::Proxy::ClientFriends && !Dvar::Var("cl_anonymous").get<bool>())
{
Steam::Proxy::SteamFriends->SetRichPresence(key.data(), value.data());
Steam::Proxy::ClientFriends.invoke<void>("SetRichPresence", 0, key.data(), value.data());
Steam::Proxy::ClientFriends.invoke<void>("SetRichPresence", Steam::Proxy::AppId, key.data(), value.data());
}
}
@ -584,9 +586,10 @@ namespace Components
if(Dvar::Var("cl_anonymous").get<bool>())
{
if (Steam::Proxy::SteamFriends)
if (Steam::Proxy::ClientFriends)
{
Steam::Proxy::SteamFriends->ClearRichPresence();
Steam::Proxy::ClientFriends.invoke<void>("ClearRichPresence", 0);
Steam::Proxy::ClientFriends.invoke<void>("ClearRichPresence", Steam::Proxy::AppId);
}
}

View File

@ -110,12 +110,12 @@ namespace Steam
if (!Proxy::Inititalize())
{
OutputDebugStringA("Steamproxy not initialized properly");
OutputDebugStringA("Steam proxy not initialized properly");
Components::StartupMessages::AddMessage("Warning:\nUnable to connect to Steam. Steam features will be unavailable");
}
else
{
Steam::Proxy::SetMod("IW4x - Modern Warfare 2");
Steam::Proxy::SetMod("IW4x \xF0\x9F\x90\x8D");
}
return true;