From 5c145450b7aa7d4a59a7565d196fe67cec4f8880 Mon Sep 17 00:00:00 2001 From: aunsane Date: Fri, 2 Feb 2018 23:32:00 +0300 Subject: Steam: - switched on c++17 language support - forsed update user summaries when got "personastate" message - added detection of VR (?) clent into MirVer --- protocols/Steam/src/api/enums.h | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) (limited to 'protocols/Steam/src/api/enums.h') 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 ( + static_cast::type>(lhs) & + static_cast::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 ( + static_cast::type>(lhs) & + static_cast::type>(rhs)); +} + +enum class PersonaRelationshipAction : int { // friend removed from contact list Remove = 0, @@ -61,4 +77,11 @@ enum PersonaRelationshipAction AuthRequested = 4, }; +template +bool contains_flag(T x, T y) { + return (static_cast::type>(x) + & static_cast::type>(y)) + == static_cast::type>(y); +} + #endif //_STEAM_ENUMS_H_ -- cgit v1.2.3