summaryrefslogtreecommitdiff
path: root/protocols/Steam/src/api
diff options
context:
space:
mode:
authoraunsane <aunsane@gmail.com>2018-02-02 23:32:00 +0300
committeraunsane <aunsane@gmail.com>2018-02-02 23:34:06 +0300
commit5c145450b7aa7d4a59a7565d196fe67cec4f8880 (patch)
tree4ebc54062545f6ae00d13a8dfd17e0751a39def5 /protocols/Steam/src/api
parenta7c14294ccfc26f48b5e4c511b7dc65b7e3020a9 (diff)
Steam:
- switched on c++17 language support - forsed update user summaries when got "personastate" message - added detection of VR (?) clent into MirVer
Diffstat (limited to 'protocols/Steam/src/api')
-rw-r--r--protocols/Steam/src/api/enums.h35
1 files changed, 29 insertions, 6 deletions
diff --git a/protocols/Steam/src/api/enums.h b/protocols/Steam/src/api/enums.h
index 1a1643a15d..b0b4caa2ee 100644
--- a/protocols/Steam/src/api/enums.h
+++ b/protocols/Steam/src/api/enums.h
@@ -21,17 +21,25 @@ enum PersonaState
LookingToPlay = 6,
};
-enum PersonaStateFlag
+enum class PersonaStateFlag : int
{
None = 0,
HasRichPresence = 1,
InJoinableGame = 2,
- OnlineUsingWeb = 256,
- OnlineUsingMobile = 512,
- OnlineUsingBigPicture = 1024,
+ ClientTypeWeb = 256,
+ ClientTypeMobile = 512,
+ ClientTypeBigPicture = 1024,
+ ClientTypeVR = 2048,
};
-enum PersonaStatusFlag
+inline PersonaStateFlag operator &(PersonaStateFlag lhs, PersonaStateFlag rhs)
+{
+ return static_cast<PersonaStateFlag> (
+ static_cast<std::underlying_type<PersonaStateFlag>::type>(lhs) &
+ static_cast<std::underlying_type<PersonaStateFlag>::type>(rhs));
+}
+
+enum class PersonaStatusFlag : int
{
Status = 1,
PlayerName = 2,
@@ -45,9 +53,17 @@ enum PersonaStatusFlag
GameDataBlob = 512,
ClanTag = 1024,
Facebook = 2048,
+ Unknown = 4096,
};
-enum PersonaRelationshipAction
+inline PersonaStatusFlag operator &(PersonaStatusFlag lhs, PersonaStatusFlag rhs)
+{
+ return static_cast<PersonaStatusFlag> (
+ static_cast<std::underlying_type<PersonaStatusFlag>::type>(lhs) &
+ static_cast<std::underlying_type<PersonaStatusFlag>::type>(rhs));
+}
+
+enum class PersonaRelationshipAction : int
{
// friend removed from contact list
Remove = 0,
@@ -61,4 +77,11 @@ enum PersonaRelationshipAction
AuthRequested = 4,
};
+template<typename T>
+bool contains_flag(T x, T y) {
+ return (static_cast<typename std::underlying_type<T>::type>(x)
+ & static_cast<typename std::underlying_type<T>::type>(y))
+ == static_cast<typename std::underlying_type<T>::type>(y);
+}
+
#endif //_STEAM_ENUMS_H_