Rise
The Vieneo Province
Loading...
Searching...
No Matches
SteamPresencePayload.h
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4
5namespace RiseSteam
6{
8 {
9 std::string details;
10 std::string state;
11 std::string status;
12 const char* display;
13 };
14
15 PresencePayload BuildPresence(const char* details, const char* state, const char* screen = nullptr);
16
17 // The template also lets tests exercise the actual publishing sequence without
18 // starting Steam or sending presence to anyone.
19 template<class Friends>
20 bool PublishPresence(Friends& friends, const PresencePayload& payload)
21 {
22 // Hide the previous template while its substitutions are being replaced.
23 bool success = friends.SetRichPresence("steam_display", nullptr);
24 success = friends.SetRichPresence("details", payload.details.c_str()) && success;
25 success = friends.SetRichPresence("state", payload.state.c_str()) && success;
26 success = friends.SetRichPresence("status", payload.status.c_str()) && success;
27 if (success)
28 success = friends.SetRichPresence("steam_display", payload.display);
29 if (!success)
30 friends.SetRichPresence("steam_display", nullptr);
31 return success;
32 }
33}
float payload
Definition globals.cpp:92
bool PublishPresence(Friends &friends, const PresencePayload &payload)
PresencePayload BuildPresence(const char *details, const char *state, const char *screen=nullptr)