diff --git a/.github/workflows/ci_windows.yml b/.github/workflows/ci_windows.yml index b35590aa..4aae3e8d 100644 --- a/.github/workflows/ci_windows.yml +++ b/.github/workflows/ci_windows.yml @@ -44,7 +44,6 @@ jobs: cp /mingw64/bin/libwinpthread-1.dll _RELEASE cp /mingw64/bin/libstdc++-6.dll _RELEASE cp /mingw64/bin/libgcc_s_seh-1.dll _RELEASE - cp /mingw64/bin/libopenal-1.dll _RELEASE cp _RELEASE/*.dll build/test - name: Upload artifacts diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ca83191..1e0b18fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,7 +97,7 @@ set(SFML_ENABLE_PCH true) CPMAddPackage( NAME SFML GITHUB_REPOSITORY vittorioromeo/SFML - GIT_TAG 5c6d2ef623ca07fc528d794b763bbf67395d4b90 + GIT_TAG 33a4e38c2df3406bc85864f59d0674a9d0bd7482 ) set_target_properties(sfml-system PROPERTIES UNITY_BUILD ON) @@ -360,7 +360,7 @@ vrm_cmake_include_vc_dependency_once(vc_detection) # Targets # ----------------------------------------------------------------------------- -if(WIN32 AND "${vrm_cmake_build_type_lower}" STREQUAL "release") +if(WIN32 AND "${vrm_cmake_build_type_lower}" MATCHES "rel") set(SSVOH_BUILD_WIN32_CONSOLE TRUE) else() set(SSVOH_BUILD_WIN32_CONSOLE FALSE) diff --git a/_RELEASE/discord_game_sdk.dll b/_RELEASE/discord_game_sdk.dll index 10a8928f..be946ea7 100644 Binary files a/_RELEASE/discord_game_sdk.dll and b/_RELEASE/discord_game_sdk.dll differ diff --git a/_RELEASE/sdkencryptedappticket64.dll b/_RELEASE/sdkencryptedappticket64.dll index 1fd4d50f..483840e9 100644 Binary files a/_RELEASE/sdkencryptedappticket64.dll and b/_RELEASE/sdkencryptedappticket64.dll differ diff --git a/_RELEASE/sdkencryptedappticket64.lib b/_RELEASE/sdkencryptedappticket64.lib index d77b9094..15945f19 100644 Binary files a/_RELEASE/sdkencryptedappticket64.lib and b/_RELEASE/sdkencryptedappticket64.lib differ diff --git a/_RELEASE/steam_api64.dll b/_RELEASE/steam_api64.dll index 45a49e96..6594c50e 100644 Binary files a/_RELEASE/steam_api64.dll and b/_RELEASE/steam_api64.dll differ diff --git a/_RELEASE/steam_api64.lib b/_RELEASE/steam_api64.lib index 663b11e5..b8aaa877 100644 Binary files a/_RELEASE/steam_api64.lib and b/_RELEASE/steam_api64.lib differ diff --git a/build/copylibs.sh b/build/copylibs.sh index 100869a0..091adfd9 100644 --- a/build/copylibs.sh +++ b/build/copylibs.sh @@ -6,7 +6,6 @@ function copyTo cp /c/msys64/mingw64/bin/libstdc++-6.dll $1 & cp /c/msys64/mingw64/bin/libgcc_s_seh-1.dll $1 & cp /c/msys64/mingw64/bin/libwinpthread-1.dll $1 & - cp /c/msys64/mingw64/bin/libopenal-1.dll $1 & } copyTo "../_RELEASE" diff --git a/build/make_debug_client_win10_msys_1_build.sh b/build/make_debug_client_win10_msys_1_build.sh index 6f251df3..214d5596 100644 --- a/build/make_debug_client_win10_msys_1_build.sh +++ b/build/make_debug_client_win10_msys_1_build.sh @@ -2,6 +2,15 @@ set -e +echo "" +echo "" +echo "--------------------------------------------------------------------" +echo "| BUILDING WITH NINJA |" +echo "--------------------------------------------------------------------" +echo "" + +ninja + echo "" echo "" echo "--------------------------------------------------------------------" @@ -11,14 +20,14 @@ echo "" ./copylibs.sh (cd ./test && rm -Rf ./Packs/ && ln -sf ../../_RELEASE/Packs .) +(cd ./test && rm -Rf ./Replays/ && ln -sf ../../_RELEASE/Replays .) echo "Done." echo "" echo "" echo "--------------------------------------------------------------------" -echo "| BUILDING WITH NINJA |" +echo "| BUILDING TESTS WITH NINJA |" echo "--------------------------------------------------------------------" echo "" -ninja ninja check diff --git a/buildrel/copylibs.sh b/buildrel/copylibs.sh index 882a1d18..091adfd9 100644 --- a/buildrel/copylibs.sh +++ b/buildrel/copylibs.sh @@ -3,11 +3,9 @@ function copyTo { cp ./_deps/zlib-build/libzlib.dll $1 & - cp /c/msys64/mingw64/bin/libssp-0.dll $1 & cp /c/msys64/mingw64/bin/libstdc++-6.dll $1 & cp /c/msys64/mingw64/bin/libgcc_s_seh-1.dll $1 & cp /c/msys64/mingw64/bin/libwinpthread-1.dll $1 & - cp /c/msys64/mingw64/bin/libopenal-1.dll $1 & } copyTo "../_RELEASE" diff --git a/buildrel/make_release_client_win10_msys_1_build.sh b/buildrel/make_release_client_win10_msys_1_build.sh index 6f251df3..214d5596 100644 --- a/buildrel/make_release_client_win10_msys_1_build.sh +++ b/buildrel/make_release_client_win10_msys_1_build.sh @@ -2,6 +2,15 @@ set -e +echo "" +echo "" +echo "--------------------------------------------------------------------" +echo "| BUILDING WITH NINJA |" +echo "--------------------------------------------------------------------" +echo "" + +ninja + echo "" echo "" echo "--------------------------------------------------------------------" @@ -11,14 +20,14 @@ echo "" ./copylibs.sh (cd ./test && rm -Rf ./Packs/ && ln -sf ../../_RELEASE/Packs .) +(cd ./test && rm -Rf ./Replays/ && ln -sf ../../_RELEASE/Replays .) echo "Done." echo "" echo "" echo "--------------------------------------------------------------------" -echo "| BUILDING WITH NINJA |" +echo "| BUILDING TESTS WITH NINJA |" echo "--------------------------------------------------------------------" echo "" -ninja ninja check diff --git a/include/SSVOpenHexagon/Core/HexagonGame.hpp b/include/SSVOpenHexagon/Core/HexagonGame.hpp index 7c98f995..a1cc0efb 100644 --- a/include/SSVOpenHexagon/Core/HexagonGame.hpp +++ b/include/SSVOpenHexagon/Core/HexagonGame.hpp @@ -24,13 +24,11 @@ #include #include -#include #include #include #include -#include #include #include #include @@ -522,10 +520,8 @@ class HexagonGame const std::string& mPackId, const std::string& mId); // Graphics-related methods - void render(sf::Drawable& mDrawable, - const sf::RenderStates& mStates = sf::RenderStates::Default); - - void render(const sf::Sprite& mSprite, const sf::Texture& mTexture); + template + void render(Ts&&... xs); // Setters void setSides(unsigned int mSides); diff --git a/include/SSVOpenHexagon/Core/MenuGame.hpp b/include/SSVOpenHexagon/Core/MenuGame.hpp index dbdd3000..0d1f6b06 100644 --- a/include/SSVOpenHexagon/Core/MenuGame.hpp +++ b/include/SSVOpenHexagon/Core/MenuGame.hpp @@ -22,7 +22,6 @@ #include #include -#include #include #include #include @@ -299,8 +298,6 @@ class MenuGame [[nodiscard]] bool mouseLeftRisingEdge() const; void draw(); - void render(sf::Drawable& mDrawable); - void render(const sf::Sprite& mSprite, const sf::Texture& mTexture); // Helper functions [[nodiscard]] float getFPSMult() const; diff --git a/include/SSVOpenHexagon/Global/PCH.hpp b/include/SSVOpenHexagon/Global/PCH.hpp index 8794d8cc..9243860d 100644 --- a/include/SSVOpenHexagon/Global/PCH.hpp +++ b/include/SSVOpenHexagon/Global/PCH.hpp @@ -165,7 +165,6 @@ #include #include #include -#include // // diff --git a/include/SSVOpenHexagon/Utils/FastVertexVector.hpp b/include/SSVOpenHexagon/Utils/FastVertexVector.hpp index bd1363fd..7bd9b2bb 100644 --- a/include/SSVOpenHexagon/Utils/FastVertexVector.hpp +++ b/include/SSVOpenHexagon/Utils/FastVertexVector.hpp @@ -11,7 +11,6 @@ #include #include -#include #include #include @@ -21,7 +20,7 @@ namespace hg::Utils { template -struct FastVertexVector : public sf::Drawable +struct FastVertexVector { private: union VertexUnion @@ -118,8 +117,8 @@ struct FastVertexVector : public sf::Drawable ((new (&_data[_size++]._v) sf::Vertex{positions, color}), ...); } - void draw(sf::RenderTarget& mRenderTarget, - sf::RenderStates mRenderStates) const override + void draw( + sf::RenderTarget& mRenderTarget, sf::RenderStates mRenderStates) const { if (_data == nullptr) [[unlikely]] { diff --git a/prepare_release.sh b/prepare_release.sh index 44fdd4a9..5c23e428 100644 --- a/prepare_release.sh +++ b/prepare_release.sh @@ -20,7 +20,6 @@ cp ./_RELEASE/SSVOpenHexagon.exe ./_PREPARED_RELEASE cp ./_RELEASE/SSVOpenHexagon-Console.exe ./_PREPARED_RELEASE cp ./_RELEASE/libzlib.dll ./_PREPARED_RELEASE -cp ./_RELEASE/libopenal-1.dll ./_PREPARED_RELEASE cp ./_RELEASE/steam_api64.dll ./_PREPARED_RELEASE cp ./_RELEASE/discord_game_sdk.dll ./_PREPARED_RELEASE cp ./_RELEASE/sdkencryptedappticket64.dll ./_PREPARED_RELEASE diff --git a/public/discord/achievement_manager.cpp b/public/discord/achievement_manager.cpp index 7e3bc432..43a6d4c9 100644 --- a/public/discord/achievement_manager.cpp +++ b/public/discord/achievement_manager.cpp @@ -13,7 +13,8 @@ namespace discord { class AchievementEvents final { public: - static void OnUserAchievementUpdate(void* callbackData, DiscordUserAchievement* userAchievement) + static void DISCORD_CALLBACK OnUserAchievementUpdate(void* callbackData, + DiscordUserAchievement* userAchievement) { auto* core = reinterpret_cast(callbackData); if (!core) { diff --git a/public/discord/activity_manager.cpp b/public/discord/activity_manager.cpp index b9b67604..3c200746 100644 --- a/public/discord/activity_manager.cpp +++ b/public/discord/activity_manager.cpp @@ -13,7 +13,7 @@ namespace discord { class ActivityEvents final { public: - static void OnActivityJoin(void* callbackData, char const* secret) + static void DISCORD_CALLBACK OnActivityJoin(void* callbackData, char const* secret) { auto* core = reinterpret_cast(callbackData); if (!core) { @@ -24,7 +24,7 @@ class ActivityEvents final { module.OnActivityJoin(static_cast(secret)); } - static void OnActivitySpectate(void* callbackData, char const* secret) + static void DISCORD_CALLBACK OnActivitySpectate(void* callbackData, char const* secret) { auto* core = reinterpret_cast(callbackData); if (!core) { @@ -35,7 +35,7 @@ class ActivityEvents final { module.OnActivitySpectate(static_cast(secret)); } - static void OnActivityJoinRequest(void* callbackData, DiscordUser* user) + static void DISCORD_CALLBACK OnActivityJoinRequest(void* callbackData, DiscordUser* user) { auto* core = reinterpret_cast(callbackData); if (!core) { @@ -46,10 +46,10 @@ class ActivityEvents final { module.OnActivityJoinRequest(*reinterpret_cast(user)); } - static void OnActivityInvite(void* callbackData, - EDiscordActivityActionType type, - DiscordUser* user, - DiscordActivity* activity) + static void DISCORD_CALLBACK OnActivityInvite(void* callbackData, + EDiscordActivityActionType type, + DiscordUser* user, + DiscordActivity* activity) { auto* core = reinterpret_cast(callbackData); if (!core) { diff --git a/public/discord/event.h b/public/discord/event.h index 509f5551..610887d1 100644 --- a/public/discord/event.h +++ b/public/discord/event.h @@ -2,7 +2,6 @@ #include #include -#include namespace discord { diff --git a/public/discord/ffi.h b/public/discord/ffi.h index 765fde7d..4a210574 100644 --- a/public/discord/ffi.h +++ b/public/discord/ffi.h @@ -1,6 +1,23 @@ #ifndef _DISCORD_GAME_SDK_H_ #define _DISCORD_GAME_SDK_H_ +#ifdef _WIN32 +#include +#include +#endif + +#ifdef _WIN32 +#ifdef _WIN64 +#define DISCORD_API +#else +#define DISCORD_API __stdcall +#endif +#else +#define DISCORD_API +#endif + +#define DISCORD_CALLBACK DISCORD_API + #ifdef __cplusplus extern "C" { #endif @@ -11,7 +28,7 @@ extern "C" { #include #endif -#define DISCORD_VERSION 2 +#define DISCORD_VERSION 3 #define DISCORD_APPLICATION_MANAGER_VERSION 1 #define DISCORD_USER_MANAGER_VERSION 1 #define DISCORD_IMAGE_MANAGER_VERSION 1 @@ -19,7 +36,7 @@ extern "C" { #define DISCORD_RELATIONSHIP_MANAGER_VERSION 1 #define DISCORD_LOBBY_MANAGER_VERSION 1 #define DISCORD_NETWORK_MANAGER_VERSION 1 -#define DISCORD_OVERLAY_MANAGER_VERSION 1 +#define DISCORD_OVERLAY_MANAGER_VERSION 2 #define DISCORD_STORAGE_MANAGER_VERSION 1 #define DISCORD_STORE_MANAGER_VERSION 1 #define DISCORD_VOICE_MANAGER_VERSION 1 @@ -70,6 +87,7 @@ enum EDiscordResult { DiscordResult_InvalidGiftCode = 41, DiscordResult_PurchaseError = 42, DiscordResult_TransactionAborted = 43, + DiscordResult_DrawingInitFailed = 44, }; enum EDiscordCreateFlags { @@ -102,6 +120,11 @@ enum EDiscordImageType { DiscordImageType_User, }; +enum EDiscordActivityPartyPrivacy { + DiscordActivityPartyPrivacy_Private = 0, + DiscordActivityPartyPrivacy_Public = 1, +}; + enum EDiscordActivityType { DiscordActivityType_Playing, DiscordActivityType_Streaming, @@ -114,6 +137,12 @@ enum EDiscordActivityActionType { DiscordActivityActionType_Spectate, }; +enum EDiscordActivitySupportedPlatformFlags { + DiscordActivitySupportedPlatformFlags_Desktop = 1, + DiscordActivitySupportedPlatformFlags_Android = 2, + DiscordActivitySupportedPlatformFlags_iOS = 4, +}; + enum EDiscordActivityJoinRequestReply { DiscordActivityJoinRequestReply_No, DiscordActivityJoinRequestReply_Yes, @@ -162,6 +191,18 @@ enum EDiscordLobbySearchDistance { DiscordLobbySearchDistance_Global, }; +enum EDiscordKeyVariant { + DiscordKeyVariant_Normal, + DiscordKeyVariant_Right, + DiscordKeyVariant_Left, +}; + +enum EDiscordMouseButton { + DiscordMouseButton_Left, + DiscordMouseButton_Middle, + DiscordMouseButton_Right, +}; + enum EDiscordEntitlementType { DiscordEntitlementType_Purchase = 1, DiscordEntitlementType_PremiumSubscription, @@ -197,6 +238,18 @@ typedef char DiscordMetadataKey[256]; typedef char DiscordMetadataValue[4096]; typedef uint64_t DiscordNetworkPeerId; typedef uint8_t DiscordNetworkChannelId; +#ifdef __APPLE__ +typedef void IDXGISwapChain; +#endif +#ifdef __linux__ +typedef void IDXGISwapChain; +#endif +#ifdef __APPLE__ +typedef void MSG; +#endif +#ifdef __linux__ +typedef void MSG; +#endif typedef char DiscordPath[4096]; typedef char DiscordDateTime[64]; @@ -245,6 +298,7 @@ struct DiscordPartySize { struct DiscordActivityParty { char id[128]; struct DiscordPartySize size; + enum EDiscordActivityPartyPrivacy privacy; }; struct DiscordActivitySecrets { @@ -264,6 +318,7 @@ struct DiscordActivity { struct DiscordActivityParty party; struct DiscordActivitySecrets secrets; bool instance; + uint32_t supported_platforms; }; struct DiscordPresence { @@ -286,6 +341,21 @@ struct DiscordLobby { bool locked; }; +struct DiscordImeUnderline { + int32_t from; + int32_t to; + uint32_t color; + uint32_t background_color; + bool thick; +}; + +struct DiscordRect { + int32_t left; + int32_t top; + int32_t right; + int32_t bottom; +}; + struct DiscordFileStat { char filename[260]; uint64_t size; @@ -323,558 +393,659 @@ struct DiscordUserAchievement { }; struct IDiscordLobbyTransaction { - enum EDiscordResult (*set_type)(struct IDiscordLobbyTransaction* lobby_transaction, - enum EDiscordLobbyType type); - enum EDiscordResult (*set_owner)(struct IDiscordLobbyTransaction* lobby_transaction, - DiscordUserId owner_id); - enum EDiscordResult (*set_capacity)(struct IDiscordLobbyTransaction* lobby_transaction, - uint32_t capacity); - enum EDiscordResult (*set_metadata)(struct IDiscordLobbyTransaction* lobby_transaction, - DiscordMetadataKey key, - DiscordMetadataValue value); - enum EDiscordResult (*delete_metadata)(struct IDiscordLobbyTransaction* lobby_transaction, - DiscordMetadataKey key); - enum EDiscordResult (*set_locked)(struct IDiscordLobbyTransaction* lobby_transaction, - bool locked); + enum EDiscordResult(DISCORD_API* set_type)(struct IDiscordLobbyTransaction* lobby_transaction, + enum EDiscordLobbyType type); + enum EDiscordResult(DISCORD_API* set_owner)(struct IDiscordLobbyTransaction* lobby_transaction, + DiscordUserId owner_id); + enum EDiscordResult(DISCORD_API* set_capacity)( + struct IDiscordLobbyTransaction* lobby_transaction, + uint32_t capacity); + enum EDiscordResult(DISCORD_API* set_metadata)( + struct IDiscordLobbyTransaction* lobby_transaction, + DiscordMetadataKey key, + DiscordMetadataValue value); + enum EDiscordResult(DISCORD_API* delete_metadata)( + struct IDiscordLobbyTransaction* lobby_transaction, + DiscordMetadataKey key); + enum EDiscordResult(DISCORD_API* set_locked)(struct IDiscordLobbyTransaction* lobby_transaction, + bool locked); }; struct IDiscordLobbyMemberTransaction { - enum EDiscordResult (*set_metadata)( + enum EDiscordResult(DISCORD_API* set_metadata)( struct IDiscordLobbyMemberTransaction* lobby_member_transaction, DiscordMetadataKey key, DiscordMetadataValue value); - enum EDiscordResult (*delete_metadata)( + enum EDiscordResult(DISCORD_API* delete_metadata)( struct IDiscordLobbyMemberTransaction* lobby_member_transaction, DiscordMetadataKey key); }; struct IDiscordLobbySearchQuery { - enum EDiscordResult (*filter)(struct IDiscordLobbySearchQuery* lobby_search_query, - DiscordMetadataKey key, - enum EDiscordLobbySearchComparison comparison, - enum EDiscordLobbySearchCast cast, - DiscordMetadataValue value); - enum EDiscordResult (*sort)(struct IDiscordLobbySearchQuery* lobby_search_query, - DiscordMetadataKey key, - enum EDiscordLobbySearchCast cast, - DiscordMetadataValue value); - enum EDiscordResult (*limit)(struct IDiscordLobbySearchQuery* lobby_search_query, - uint32_t limit); - enum EDiscordResult (*distance)(struct IDiscordLobbySearchQuery* lobby_search_query, - enum EDiscordLobbySearchDistance distance); + enum EDiscordResult(DISCORD_API* filter)(struct IDiscordLobbySearchQuery* lobby_search_query, + DiscordMetadataKey key, + enum EDiscordLobbySearchComparison comparison, + enum EDiscordLobbySearchCast cast, + DiscordMetadataValue value); + enum EDiscordResult(DISCORD_API* sort)(struct IDiscordLobbySearchQuery* lobby_search_query, + DiscordMetadataKey key, + enum EDiscordLobbySearchCast cast, + DiscordMetadataValue value); + enum EDiscordResult(DISCORD_API* limit)(struct IDiscordLobbySearchQuery* lobby_search_query, + uint32_t limit); + enum EDiscordResult(DISCORD_API* distance)(struct IDiscordLobbySearchQuery* lobby_search_query, + enum EDiscordLobbySearchDistance distance); }; typedef void* IDiscordApplicationEvents; struct IDiscordApplicationManager { - void (*validate_or_exit)(struct IDiscordApplicationManager* manager, - void* callback_data, - void (*callback)(void* callback_data, enum EDiscordResult result)); - void (*get_current_locale)(struct IDiscordApplicationManager* manager, DiscordLocale* locale); - void (*get_current_branch)(struct IDiscordApplicationManager* manager, DiscordBranch* branch); - void (*get_oauth2_token)(struct IDiscordApplicationManager* manager, - void* callback_data, - void (*callback)(void* callback_data, - enum EDiscordResult result, - struct DiscordOAuth2Token* oauth2_token)); - void (*get_ticket)(struct IDiscordApplicationManager* manager, - void* callback_data, - void (*callback)(void* callback_data, - enum EDiscordResult result, - const char* data)); + void(DISCORD_API* validate_or_exit)(struct IDiscordApplicationManager* manager, + void* callback_data, + void(DISCORD_API* callback)(void* callback_data, + enum EDiscordResult result)); + void(DISCORD_API* get_current_locale)(struct IDiscordApplicationManager* manager, + DiscordLocale* locale); + void(DISCORD_API* get_current_branch)(struct IDiscordApplicationManager* manager, + DiscordBranch* branch); + void(DISCORD_API* get_oauth2_token)( + struct IDiscordApplicationManager* manager, + void* callback_data, + void(DISCORD_API* callback)(void* callback_data, + enum EDiscordResult result, + struct DiscordOAuth2Token* oauth2_token)); + void(DISCORD_API* get_ticket)(struct IDiscordApplicationManager* manager, + void* callback_data, + void(DISCORD_API* callback)(void* callback_data, + enum EDiscordResult result, + const char* data)); }; struct IDiscordUserEvents { - void (*on_current_user_update)(void* event_data); + void(DISCORD_API* on_current_user_update)(void* event_data); }; struct IDiscordUserManager { - enum EDiscordResult (*get_current_user)(struct IDiscordUserManager* manager, - struct DiscordUser* current_user); - void (*get_user)(struct IDiscordUserManager* manager, - DiscordUserId user_id, - void* callback_data, - void (*callback)(void* callback_data, - enum EDiscordResult result, - struct DiscordUser* user)); - enum EDiscordResult (*get_current_user_premium_type)(struct IDiscordUserManager* manager, - enum EDiscordPremiumType* premium_type); - enum EDiscordResult (*current_user_has_flag)(struct IDiscordUserManager* manager, - enum EDiscordUserFlag flag, - bool* has_flag); + enum EDiscordResult(DISCORD_API* get_current_user)(struct IDiscordUserManager* manager, + struct DiscordUser* current_user); + void(DISCORD_API* get_user)(struct IDiscordUserManager* manager, + DiscordUserId user_id, + void* callback_data, + void(DISCORD_API* callback)(void* callback_data, + enum EDiscordResult result, + struct DiscordUser* user)); + enum EDiscordResult(DISCORD_API* get_current_user_premium_type)( + struct IDiscordUserManager* manager, + enum EDiscordPremiumType* premium_type); + enum EDiscordResult(DISCORD_API* current_user_has_flag)(struct IDiscordUserManager* manager, + enum EDiscordUserFlag flag, + bool* has_flag); }; typedef void* IDiscordImageEvents; struct IDiscordImageManager { - void (*fetch)(struct IDiscordImageManager* manager, - struct DiscordImageHandle handle, - bool refresh, - void* callback_data, - void (*callback)(void* callback_data, - enum EDiscordResult result, - struct DiscordImageHandle handle_result)); - enum EDiscordResult (*get_dimensions)(struct IDiscordImageManager* manager, - struct DiscordImageHandle handle, - struct DiscordImageDimensions* dimensions); - enum EDiscordResult (*get_data)(struct IDiscordImageManager* manager, - struct DiscordImageHandle handle, - uint8_t* data, - uint32_t data_length); + void(DISCORD_API* fetch)(struct IDiscordImageManager* manager, + struct DiscordImageHandle handle, + bool refresh, + void* callback_data, + void(DISCORD_API* callback)(void* callback_data, + enum EDiscordResult result, + struct DiscordImageHandle handle_result)); + enum EDiscordResult(DISCORD_API* get_dimensions)(struct IDiscordImageManager* manager, + struct DiscordImageHandle handle, + struct DiscordImageDimensions* dimensions); + enum EDiscordResult(DISCORD_API* get_data)(struct IDiscordImageManager* manager, + struct DiscordImageHandle handle, + uint8_t* data, + uint32_t data_length); }; struct IDiscordActivityEvents { - void (*on_activity_join)(void* event_data, const char* secret); - void (*on_activity_spectate)(void* event_data, const char* secret); - void (*on_activity_join_request)(void* event_data, struct DiscordUser* user); - void (*on_activity_invite)(void* event_data, - enum EDiscordActivityActionType type, - struct DiscordUser* user, - struct DiscordActivity* activity); + void(DISCORD_API* on_activity_join)(void* event_data, const char* secret); + void(DISCORD_API* on_activity_spectate)(void* event_data, const char* secret); + void(DISCORD_API* on_activity_join_request)(void* event_data, struct DiscordUser* user); + void(DISCORD_API* on_activity_invite)(void* event_data, + enum EDiscordActivityActionType type, + struct DiscordUser* user, + struct DiscordActivity* activity); }; struct IDiscordActivityManager { - enum EDiscordResult (*register_command)(struct IDiscordActivityManager* manager, - const char* command); - enum EDiscordResult (*register_steam)(struct IDiscordActivityManager* manager, - uint32_t steam_id); - void (*update_activity)(struct IDiscordActivityManager* manager, - struct DiscordActivity* activity, - void* callback_data, - void (*callback)(void* callback_data, enum EDiscordResult result)); - void (*clear_activity)(struct IDiscordActivityManager* manager, - void* callback_data, - void (*callback)(void* callback_data, enum EDiscordResult result)); - void (*send_request_reply)(struct IDiscordActivityManager* manager, - DiscordUserId user_id, - enum EDiscordActivityJoinRequestReply reply, - void* callback_data, - void (*callback)(void* callback_data, enum EDiscordResult result)); - void (*send_invite)(struct IDiscordActivityManager* manager, - DiscordUserId user_id, - enum EDiscordActivityActionType type, - const char* content, - void* callback_data, - void (*callback)(void* callback_data, enum EDiscordResult result)); - void (*accept_invite)(struct IDiscordActivityManager* manager, - DiscordUserId user_id, - void* callback_data, - void (*callback)(void* callback_data, enum EDiscordResult result)); + enum EDiscordResult(DISCORD_API* register_command)(struct IDiscordActivityManager* manager, + const char* command); + enum EDiscordResult(DISCORD_API* register_steam)(struct IDiscordActivityManager* manager, + uint32_t steam_id); + void(DISCORD_API* update_activity)(struct IDiscordActivityManager* manager, + struct DiscordActivity* activity, + void* callback_data, + void(DISCORD_API* callback)(void* callback_data, + enum EDiscordResult result)); + void(DISCORD_API* clear_activity)(struct IDiscordActivityManager* manager, + void* callback_data, + void(DISCORD_API* callback)(void* callback_data, + enum EDiscordResult result)); + void(DISCORD_API* send_request_reply)(struct IDiscordActivityManager* manager, + DiscordUserId user_id, + enum EDiscordActivityJoinRequestReply reply, + void* callback_data, + void(DISCORD_API* callback)(void* callback_data, + enum EDiscordResult result)); + void(DISCORD_API* send_invite)(struct IDiscordActivityManager* manager, + DiscordUserId user_id, + enum EDiscordActivityActionType type, + const char* content, + void* callback_data, + void(DISCORD_API* callback)(void* callback_data, + enum EDiscordResult result)); + void(DISCORD_API* accept_invite)(struct IDiscordActivityManager* manager, + DiscordUserId user_id, + void* callback_data, + void(DISCORD_API* callback)(void* callback_data, + enum EDiscordResult result)); }; struct IDiscordRelationshipEvents { - void (*on_refresh)(void* event_data); - void (*on_relationship_update)(void* event_data, struct DiscordRelationship* relationship); + void(DISCORD_API* on_refresh)(void* event_data); + void(DISCORD_API* on_relationship_update)(void* event_data, + struct DiscordRelationship* relationship); }; struct IDiscordRelationshipManager { - void (*filter)(struct IDiscordRelationshipManager* manager, - void* filter_data, - bool (*filter)(void* filter_data, struct DiscordRelationship* relationship)); - enum EDiscordResult (*count)(struct IDiscordRelationshipManager* manager, int32_t* count); - enum EDiscordResult (*get)(struct IDiscordRelationshipManager* manager, - DiscordUserId user_id, - struct DiscordRelationship* relationship); - enum EDiscordResult (*get_at)(struct IDiscordRelationshipManager* manager, - uint32_t index, - struct DiscordRelationship* relationship); + void(DISCORD_API* filter)(struct IDiscordRelationshipManager* manager, + void* filter_data, + bool(DISCORD_API* filter)(void* filter_data, + struct DiscordRelationship* relationship)); + enum EDiscordResult(DISCORD_API* count)(struct IDiscordRelationshipManager* manager, + int32_t* count); + enum EDiscordResult(DISCORD_API* get)(struct IDiscordRelationshipManager* manager, + DiscordUserId user_id, + struct DiscordRelationship* relationship); + enum EDiscordResult(DISCORD_API* get_at)(struct IDiscordRelationshipManager* manager, + uint32_t index, + struct DiscordRelationship* relationship); }; struct IDiscordLobbyEvents { - void (*on_lobby_update)(void* event_data, int64_t lobby_id); - void (*on_lobby_delete)(void* event_data, int64_t lobby_id, uint32_t reason); - void (*on_member_connect)(void* event_data, int64_t lobby_id, int64_t user_id); - void (*on_member_update)(void* event_data, int64_t lobby_id, int64_t user_id); - void (*on_member_disconnect)(void* event_data, int64_t lobby_id, int64_t user_id); - void (*on_lobby_message)(void* event_data, - int64_t lobby_id, - int64_t user_id, - uint8_t* data, - uint32_t data_length); - void (*on_speaking)(void* event_data, int64_t lobby_id, int64_t user_id, bool speaking); - void (*on_network_message)(void* event_data, - int64_t lobby_id, - int64_t user_id, - uint8_t channel_id, - uint8_t* data, - uint32_t data_length); + void(DISCORD_API* on_lobby_update)(void* event_data, int64_t lobby_id); + void(DISCORD_API* on_lobby_delete)(void* event_data, int64_t lobby_id, uint32_t reason); + void(DISCORD_API* on_member_connect)(void* event_data, int64_t lobby_id, int64_t user_id); + void(DISCORD_API* on_member_update)(void* event_data, int64_t lobby_id, int64_t user_id); + void(DISCORD_API* on_member_disconnect)(void* event_data, int64_t lobby_id, int64_t user_id); + void(DISCORD_API* on_lobby_message)(void* event_data, + int64_t lobby_id, + int64_t user_id, + uint8_t* data, + uint32_t data_length); + void(DISCORD_API* on_speaking)(void* event_data, + int64_t lobby_id, + int64_t user_id, + bool speaking); + void(DISCORD_API* on_network_message)(void* event_data, + int64_t lobby_id, + int64_t user_id, + uint8_t channel_id, + uint8_t* data, + uint32_t data_length); }; struct IDiscordLobbyManager { - enum EDiscordResult (*get_lobby_create_transaction)( + enum EDiscordResult(DISCORD_API* get_lobby_create_transaction)( struct IDiscordLobbyManager* manager, struct IDiscordLobbyTransaction** transaction); - enum EDiscordResult (*get_lobby_update_transaction)( + enum EDiscordResult(DISCORD_API* get_lobby_update_transaction)( struct IDiscordLobbyManager* manager, DiscordLobbyId lobby_id, struct IDiscordLobbyTransaction** transaction); - enum EDiscordResult (*get_member_update_transaction)( + enum EDiscordResult(DISCORD_API* get_member_update_transaction)( struct IDiscordLobbyManager* manager, DiscordLobbyId lobby_id, DiscordUserId user_id, struct IDiscordLobbyMemberTransaction** transaction); - void (*create_lobby)(struct IDiscordLobbyManager* manager, - struct IDiscordLobbyTransaction* transaction, - void* callback_data, - void (*callback)(void* callback_data, - enum EDiscordResult result, - struct DiscordLobby* lobby)); - void (*update_lobby)(struct IDiscordLobbyManager* manager, - DiscordLobbyId lobby_id, - struct IDiscordLobbyTransaction* transaction, - void* callback_data, - void (*callback)(void* callback_data, enum EDiscordResult result)); - void (*delete_lobby)(struct IDiscordLobbyManager* manager, - DiscordLobbyId lobby_id, - void* callback_data, - void (*callback)(void* callback_data, enum EDiscordResult result)); - void (*connect_lobby)(struct IDiscordLobbyManager* manager, - DiscordLobbyId lobby_id, - DiscordLobbySecret secret, - void* callback_data, - void (*callback)(void* callback_data, - enum EDiscordResult result, - struct DiscordLobby* lobby)); - void (*connect_lobby_with_activity_secret)(struct IDiscordLobbyManager* manager, - DiscordLobbySecret activity_secret, - void* callback_data, - void (*callback)(void* callback_data, + void(DISCORD_API* create_lobby)(struct IDiscordLobbyManager* manager, + struct IDiscordLobbyTransaction* transaction, + void* callback_data, + void(DISCORD_API* callback)(void* callback_data, enum EDiscordResult result, struct DiscordLobby* lobby)); - void (*disconnect_lobby)(struct IDiscordLobbyManager* manager, - DiscordLobbyId lobby_id, - void* callback_data, - void (*callback)(void* callback_data, enum EDiscordResult result)); - enum EDiscordResult (*get_lobby)(struct IDiscordLobbyManager* manager, + void(DISCORD_API* update_lobby)(struct IDiscordLobbyManager* manager, + DiscordLobbyId lobby_id, + struct IDiscordLobbyTransaction* transaction, + void* callback_data, + void(DISCORD_API* callback)(void* callback_data, + enum EDiscordResult result)); + void(DISCORD_API* delete_lobby)(struct IDiscordLobbyManager* manager, + DiscordLobbyId lobby_id, + void* callback_data, + void(DISCORD_API* callback)(void* callback_data, + enum EDiscordResult result)); + void(DISCORD_API* connect_lobby)(struct IDiscordLobbyManager* manager, DiscordLobbyId lobby_id, - struct DiscordLobby* lobby); - enum EDiscordResult (*get_lobby_activity_secret)(struct IDiscordLobbyManager* manager, - DiscordLobbyId lobby_id, - DiscordLobbySecret* secret); - enum EDiscordResult (*get_lobby_metadata_value)(struct IDiscordLobbyManager* manager, - DiscordLobbyId lobby_id, - DiscordMetadataKey key, - DiscordMetadataValue* value); - enum EDiscordResult (*get_lobby_metadata_key)(struct IDiscordLobbyManager* manager, - DiscordLobbyId lobby_id, - int32_t index, - DiscordMetadataKey* key); - enum EDiscordResult (*lobby_metadata_count)(struct IDiscordLobbyManager* manager, - DiscordLobbyId lobby_id, - int32_t* count); - enum EDiscordResult (*member_count)(struct IDiscordLobbyManager* manager, + DiscordLobbySecret secret, + void* callback_data, + void(DISCORD_API* callback)(void* callback_data, + enum EDiscordResult result, + struct DiscordLobby* lobby)); + void(DISCORD_API* connect_lobby_with_activity_secret)( + struct IDiscordLobbyManager* manager, + DiscordLobbySecret activity_secret, + void* callback_data, + void(DISCORD_API* callback)(void* callback_data, + enum EDiscordResult result, + struct DiscordLobby* lobby)); + void(DISCORD_API* disconnect_lobby)(struct IDiscordLobbyManager* manager, DiscordLobbyId lobby_id, - int32_t* count); - enum EDiscordResult (*get_member_user_id)(struct IDiscordLobbyManager* manager, - DiscordLobbyId lobby_id, - int32_t index, - DiscordUserId* user_id); - enum EDiscordResult (*get_member_user)(struct IDiscordLobbyManager* manager, - DiscordLobbyId lobby_id, - DiscordUserId user_id, - struct DiscordUser* user); - enum EDiscordResult (*get_member_metadata_value)(struct IDiscordLobbyManager* manager, - DiscordLobbyId lobby_id, - DiscordUserId user_id, - DiscordMetadataKey key, - DiscordMetadataValue* value); - enum EDiscordResult (*get_member_metadata_key)(struct IDiscordLobbyManager* manager, + void* callback_data, + void(DISCORD_API* callback)(void* callback_data, + enum EDiscordResult result)); + enum EDiscordResult(DISCORD_API* get_lobby)(struct IDiscordLobbyManager* manager, + DiscordLobbyId lobby_id, + struct DiscordLobby* lobby); + enum EDiscordResult(DISCORD_API* get_lobby_activity_secret)( + struct IDiscordLobbyManager* manager, + DiscordLobbyId lobby_id, + DiscordLobbySecret* secret); + enum EDiscordResult(DISCORD_API* get_lobby_metadata_value)(struct IDiscordLobbyManager* manager, + DiscordLobbyId lobby_id, + DiscordMetadataKey key, + DiscordMetadataValue* value); + enum EDiscordResult(DISCORD_API* get_lobby_metadata_key)(struct IDiscordLobbyManager* manager, + DiscordLobbyId lobby_id, + int32_t index, + DiscordMetadataKey* key); + enum EDiscordResult(DISCORD_API* lobby_metadata_count)(struct IDiscordLobbyManager* manager, + DiscordLobbyId lobby_id, + int32_t* count); + enum EDiscordResult(DISCORD_API* member_count)(struct IDiscordLobbyManager* manager, DiscordLobbyId lobby_id, - DiscordUserId user_id, + int32_t* count); + enum EDiscordResult(DISCORD_API* get_member_user_id)(struct IDiscordLobbyManager* manager, + DiscordLobbyId lobby_id, + int32_t index, + DiscordUserId* user_id); + enum EDiscordResult(DISCORD_API* get_member_user)(struct IDiscordLobbyManager* manager, + DiscordLobbyId lobby_id, + DiscordUserId user_id, + struct DiscordUser* user); + enum EDiscordResult(DISCORD_API* get_member_metadata_value)( + struct IDiscordLobbyManager* manager, + DiscordLobbyId lobby_id, + DiscordUserId user_id, + DiscordMetadataKey key, + DiscordMetadataValue* value); + enum EDiscordResult(DISCORD_API* get_member_metadata_key)(struct IDiscordLobbyManager* manager, + DiscordLobbyId lobby_id, + DiscordUserId user_id, + int32_t index, + DiscordMetadataKey* key); + enum EDiscordResult(DISCORD_API* member_metadata_count)(struct IDiscordLobbyManager* manager, + DiscordLobbyId lobby_id, + DiscordUserId user_id, + int32_t* count); + void(DISCORD_API* update_member)(struct IDiscordLobbyManager* manager, + DiscordLobbyId lobby_id, + DiscordUserId user_id, + struct IDiscordLobbyMemberTransaction* transaction, + void* callback_data, + void(DISCORD_API* callback)(void* callback_data, + enum EDiscordResult result)); + void(DISCORD_API* send_lobby_message)(struct IDiscordLobbyManager* manager, + DiscordLobbyId lobby_id, + uint8_t* data, + uint32_t data_length, + void* callback_data, + void(DISCORD_API* callback)(void* callback_data, + enum EDiscordResult result)); + enum EDiscordResult(DISCORD_API* get_search_query)(struct IDiscordLobbyManager* manager, + struct IDiscordLobbySearchQuery** query); + void(DISCORD_API* search)(struct IDiscordLobbyManager* manager, + struct IDiscordLobbySearchQuery* query, + void* callback_data, + void(DISCORD_API* callback)(void* callback_data, + enum EDiscordResult result)); + void(DISCORD_API* lobby_count)(struct IDiscordLobbyManager* manager, int32_t* count); + enum EDiscordResult(DISCORD_API* get_lobby_id)(struct IDiscordLobbyManager* manager, int32_t index, - DiscordMetadataKey* key); - enum EDiscordResult (*member_metadata_count)(struct IDiscordLobbyManager* manager, - DiscordLobbyId lobby_id, - DiscordUserId user_id, - int32_t* count); - void (*update_member)(struct IDiscordLobbyManager* manager, - DiscordLobbyId lobby_id, - DiscordUserId user_id, - struct IDiscordLobbyMemberTransaction* transaction, - void* callback_data, - void (*callback)(void* callback_data, enum EDiscordResult result)); - void (*send_lobby_message)(struct IDiscordLobbyManager* manager, - DiscordLobbyId lobby_id, - uint8_t* data, - uint32_t data_length, - void* callback_data, - void (*callback)(void* callback_data, enum EDiscordResult result)); - enum EDiscordResult (*get_search_query)(struct IDiscordLobbyManager* manager, - struct IDiscordLobbySearchQuery** query); - void (*search)(struct IDiscordLobbyManager* manager, - struct IDiscordLobbySearchQuery* query, - void* callback_data, - void (*callback)(void* callback_data, enum EDiscordResult result)); - void (*lobby_count)(struct IDiscordLobbyManager* manager, int32_t* count); - enum EDiscordResult (*get_lobby_id)(struct IDiscordLobbyManager* manager, - int32_t index, - DiscordLobbyId* lobby_id); - void (*connect_voice)(struct IDiscordLobbyManager* manager, - DiscordLobbyId lobby_id, - void* callback_data, - void (*callback)(void* callback_data, enum EDiscordResult result)); - void (*disconnect_voice)(struct IDiscordLobbyManager* manager, - DiscordLobbyId lobby_id, - void* callback_data, - void (*callback)(void* callback_data, enum EDiscordResult result)); - enum EDiscordResult (*connect_network)(struct IDiscordLobbyManager* manager, - DiscordLobbyId lobby_id); - enum EDiscordResult (*disconnect_network)(struct IDiscordLobbyManager* manager, - DiscordLobbyId lobby_id); - enum EDiscordResult (*flush_network)(struct IDiscordLobbyManager* manager); - enum EDiscordResult (*open_network_channel)(struct IDiscordLobbyManager* manager, - DiscordLobbyId lobby_id, - uint8_t channel_id, - bool reliable); - enum EDiscordResult (*send_network_message)(struct IDiscordLobbyManager* manager, - DiscordLobbyId lobby_id, - DiscordUserId user_id, - uint8_t channel_id, - uint8_t* data, - uint32_t data_length); + DiscordLobbyId* lobby_id); + void(DISCORD_API* connect_voice)(struct IDiscordLobbyManager* manager, + DiscordLobbyId lobby_id, + void* callback_data, + void(DISCORD_API* callback)(void* callback_data, + enum EDiscordResult result)); + void(DISCORD_API* disconnect_voice)(struct IDiscordLobbyManager* manager, + DiscordLobbyId lobby_id, + void* callback_data, + void(DISCORD_API* callback)(void* callback_data, + enum EDiscordResult result)); + enum EDiscordResult(DISCORD_API* connect_network)(struct IDiscordLobbyManager* manager, + DiscordLobbyId lobby_id); + enum EDiscordResult(DISCORD_API* disconnect_network)(struct IDiscordLobbyManager* manager, + DiscordLobbyId lobby_id); + enum EDiscordResult(DISCORD_API* flush_network)(struct IDiscordLobbyManager* manager); + enum EDiscordResult(DISCORD_API* open_network_channel)(struct IDiscordLobbyManager* manager, + DiscordLobbyId lobby_id, + uint8_t channel_id, + bool reliable); + enum EDiscordResult(DISCORD_API* send_network_message)(struct IDiscordLobbyManager* manager, + DiscordLobbyId lobby_id, + DiscordUserId user_id, + uint8_t channel_id, + uint8_t* data, + uint32_t data_length); }; struct IDiscordNetworkEvents { - void (*on_message)(void* event_data, - DiscordNetworkPeerId peer_id, - DiscordNetworkChannelId channel_id, - uint8_t* data, - uint32_t data_length); - void (*on_route_update)(void* event_data, const char* route_data); + void(DISCORD_API* on_message)(void* event_data, + DiscordNetworkPeerId peer_id, + DiscordNetworkChannelId channel_id, + uint8_t* data, + uint32_t data_length); + void(DISCORD_API* on_route_update)(void* event_data, const char* route_data); }; struct IDiscordNetworkManager { /** * Get the local peer ID for this process. */ - void (*get_peer_id)(struct IDiscordNetworkManager* manager, DiscordNetworkPeerId* peer_id); + void(DISCORD_API* get_peer_id)(struct IDiscordNetworkManager* manager, + DiscordNetworkPeerId* peer_id); /** * Send pending network messages. */ - enum EDiscordResult (*flush)(struct IDiscordNetworkManager* manager); + enum EDiscordResult(DISCORD_API* flush)(struct IDiscordNetworkManager* manager); /** * Open a connection to a remote peer. */ - enum EDiscordResult (*open_peer)(struct IDiscordNetworkManager* manager, - DiscordNetworkPeerId peer_id, - const char* route_data); + enum EDiscordResult(DISCORD_API* open_peer)(struct IDiscordNetworkManager* manager, + DiscordNetworkPeerId peer_id, + const char* route_data); /** * Update the route data for a connected peer. */ - enum EDiscordResult (*update_peer)(struct IDiscordNetworkManager* manager, - DiscordNetworkPeerId peer_id, - const char* route_data); + enum EDiscordResult(DISCORD_API* update_peer)(struct IDiscordNetworkManager* manager, + DiscordNetworkPeerId peer_id, + const char* route_data); /** * Close the connection to a remote peer. */ - enum EDiscordResult (*close_peer)(struct IDiscordNetworkManager* manager, - DiscordNetworkPeerId peer_id); + enum EDiscordResult(DISCORD_API* close_peer)(struct IDiscordNetworkManager* manager, + DiscordNetworkPeerId peer_id); /** * Open a message channel to a connected peer. */ - enum EDiscordResult (*open_channel)(struct IDiscordNetworkManager* manager, - DiscordNetworkPeerId peer_id, - DiscordNetworkChannelId channel_id, - bool reliable); + enum EDiscordResult(DISCORD_API* open_channel)(struct IDiscordNetworkManager* manager, + DiscordNetworkPeerId peer_id, + DiscordNetworkChannelId channel_id, + bool reliable); /** * Close a message channel to a connected peer. */ - enum EDiscordResult (*close_channel)(struct IDiscordNetworkManager* manager, - DiscordNetworkPeerId peer_id, - DiscordNetworkChannelId channel_id); + enum EDiscordResult(DISCORD_API* close_channel)(struct IDiscordNetworkManager* manager, + DiscordNetworkPeerId peer_id, + DiscordNetworkChannelId channel_id); /** * Send a message to a connected peer over an opened message channel. */ - enum EDiscordResult (*send_message)(struct IDiscordNetworkManager* manager, - DiscordNetworkPeerId peer_id, - DiscordNetworkChannelId channel_id, - uint8_t* data, - uint32_t data_length); + enum EDiscordResult(DISCORD_API* send_message)(struct IDiscordNetworkManager* manager, + DiscordNetworkPeerId peer_id, + DiscordNetworkChannelId channel_id, + uint8_t* data, + uint32_t data_length); }; struct IDiscordOverlayEvents { - void (*on_toggle)(void* event_data, bool locked); + void(DISCORD_API* on_toggle)(void* event_data, bool locked); }; struct IDiscordOverlayManager { - void (*is_enabled)(struct IDiscordOverlayManager* manager, bool* enabled); - void (*is_locked)(struct IDiscordOverlayManager* manager, bool* locked); - void (*set_locked)(struct IDiscordOverlayManager* manager, - bool locked, - void* callback_data, - void (*callback)(void* callback_data, enum EDiscordResult result)); - void (*open_activity_invite)(struct IDiscordOverlayManager* manager, - enum EDiscordActivityActionType type, - void* callback_data, - void (*callback)(void* callback_data, enum EDiscordResult result)); - void (*open_guild_invite)(struct IDiscordOverlayManager* manager, - const char* code, - void* callback_data, - void (*callback)(void* callback_data, enum EDiscordResult result)); - void (*open_voice_settings)(struct IDiscordOverlayManager* manager, - void* callback_data, - void (*callback)(void* callback_data, enum EDiscordResult result)); + void(DISCORD_API* is_enabled)(struct IDiscordOverlayManager* manager, bool* enabled); + void(DISCORD_API* is_locked)(struct IDiscordOverlayManager* manager, bool* locked); + void(DISCORD_API* set_locked)(struct IDiscordOverlayManager* manager, + bool locked, + void* callback_data, + void(DISCORD_API* callback)(void* callback_data, + enum EDiscordResult result)); + void(DISCORD_API* open_activity_invite)( + struct IDiscordOverlayManager* manager, + enum EDiscordActivityActionType type, + void* callback_data, + void(DISCORD_API* callback)(void* callback_data, enum EDiscordResult result)); + void(DISCORD_API* open_guild_invite)(struct IDiscordOverlayManager* manager, + const char* code, + void* callback_data, + void(DISCORD_API* callback)(void* callback_data, + enum EDiscordResult result)); + void(DISCORD_API* open_voice_settings)(struct IDiscordOverlayManager* manager, + void* callback_data, + void(DISCORD_API* callback)(void* callback_data, + enum EDiscordResult result)); + enum EDiscordResult(DISCORD_API* init_drawing_dxgi)(struct IDiscordOverlayManager* manager, + IDXGISwapChain* swapchain, + bool use_message_forwarding); + void(DISCORD_API* on_present)(struct IDiscordOverlayManager* manager); + void(DISCORD_API* forward_message)(struct IDiscordOverlayManager* manager, MSG* message); + void(DISCORD_API* key_event)(struct IDiscordOverlayManager* manager, + bool down, + const char* key_code, + enum EDiscordKeyVariant variant); + void(DISCORD_API* char_event)(struct IDiscordOverlayManager* manager, const char* character); + void(DISCORD_API* mouse_button_event)(struct IDiscordOverlayManager* manager, + uint8_t down, + int32_t click_count, + enum EDiscordMouseButton which, + int32_t x, + int32_t y); + void(DISCORD_API* mouse_motion_event)(struct IDiscordOverlayManager* manager, + int32_t x, + int32_t y); + void(DISCORD_API* ime_commit_text)(struct IDiscordOverlayManager* manager, const char* text); + void(DISCORD_API* ime_set_composition)(struct IDiscordOverlayManager* manager, + const char* text, + struct DiscordImeUnderline* underlines, + uint32_t underlines_length, + int32_t from, + int32_t to); + void(DISCORD_API* ime_cancel_composition)(struct IDiscordOverlayManager* manager); + void(DISCORD_API* set_ime_composition_range_callback)( + struct IDiscordOverlayManager* manager, + void* on_ime_composition_range_changed_data, + void(DISCORD_API* on_ime_composition_range_changed)( + void* on_ime_composition_range_changed_data, + int32_t from, + int32_t to, + struct DiscordRect* bounds, + uint32_t bounds_length)); + void(DISCORD_API* set_ime_selection_bounds_callback)( + struct IDiscordOverlayManager* manager, + void* on_ime_selection_bounds_changed_data, + void(DISCORD_API* on_ime_selection_bounds_changed)(void* on_ime_selection_bounds_changed_data, + struct DiscordRect anchor, + struct DiscordRect focus, + bool is_anchor_first)); + bool(DISCORD_API* is_point_inside_click_zone)(struct IDiscordOverlayManager* manager, + int32_t x, + int32_t y); }; typedef void* IDiscordStorageEvents; struct IDiscordStorageManager { - enum EDiscordResult (*read)(struct IDiscordStorageManager* manager, - const char* name, - uint8_t* data, - uint32_t data_length, - uint32_t* read); - void (*read_async)(struct IDiscordStorageManager* manager, - const char* name, - void* callback_data, - void (*callback)(void* callback_data, - enum EDiscordResult result, - uint8_t* data, - uint32_t data_length)); - void (*read_async_partial)(struct IDiscordStorageManager* manager, - const char* name, - uint64_t offset, - uint64_t length, - void* callback_data, - void (*callback)(void* callback_data, - enum EDiscordResult result, - uint8_t* data, - uint32_t data_length)); - enum EDiscordResult (*write)(struct IDiscordStorageManager* manager, - const char* name, - uint8_t* data, - uint32_t data_length); - void (*write_async)(struct IDiscordStorageManager* manager, - const char* name, - uint8_t* data, - uint32_t data_length, - void* callback_data, - void (*callback)(void* callback_data, enum EDiscordResult result)); - enum EDiscordResult (*delete_)(struct IDiscordStorageManager* manager, const char* name); - enum EDiscordResult (*exists)(struct IDiscordStorageManager* manager, + enum EDiscordResult(DISCORD_API* read)(struct IDiscordStorageManager* manager, + const char* name, + uint8_t* data, + uint32_t data_length, + uint32_t* read); + void(DISCORD_API* read_async)(struct IDiscordStorageManager* manager, const char* name, - bool* exists); - void (*count)(struct IDiscordStorageManager* manager, int32_t* count); - enum EDiscordResult (*stat)(struct IDiscordStorageManager* manager, - const char* name, - struct DiscordFileStat* stat); - enum EDiscordResult (*stat_at)(struct IDiscordStorageManager* manager, - int32_t index, - struct DiscordFileStat* stat); - enum EDiscordResult (*get_path)(struct IDiscordStorageManager* manager, DiscordPath* path); + void* callback_data, + void(DISCORD_API* callback)(void* callback_data, + enum EDiscordResult result, + uint8_t* data, + uint32_t data_length)); + void(DISCORD_API* read_async_partial)(struct IDiscordStorageManager* manager, + const char* name, + uint64_t offset, + uint64_t length, + void* callback_data, + void(DISCORD_API* callback)(void* callback_data, + enum EDiscordResult result, + uint8_t* data, + uint32_t data_length)); + enum EDiscordResult(DISCORD_API* write)(struct IDiscordStorageManager* manager, + const char* name, + uint8_t* data, + uint32_t data_length); + void(DISCORD_API* write_async)(struct IDiscordStorageManager* manager, + const char* name, + uint8_t* data, + uint32_t data_length, + void* callback_data, + void(DISCORD_API* callback)(void* callback_data, + enum EDiscordResult result)); + enum EDiscordResult(DISCORD_API* delete_)(struct IDiscordStorageManager* manager, + const char* name); + enum EDiscordResult(DISCORD_API* exists)(struct IDiscordStorageManager* manager, + const char* name, + bool* exists); + void(DISCORD_API* count)(struct IDiscordStorageManager* manager, int32_t* count); + enum EDiscordResult(DISCORD_API* stat)(struct IDiscordStorageManager* manager, + const char* name, + struct DiscordFileStat* stat); + enum EDiscordResult(DISCORD_API* stat_at)(struct IDiscordStorageManager* manager, + int32_t index, + struct DiscordFileStat* stat); + enum EDiscordResult(DISCORD_API* get_path)(struct IDiscordStorageManager* manager, + DiscordPath* path); }; struct IDiscordStoreEvents { - void (*on_entitlement_create)(void* event_data, struct DiscordEntitlement* entitlement); - void (*on_entitlement_delete)(void* event_data, struct DiscordEntitlement* entitlement); + void(DISCORD_API* on_entitlement_create)(void* event_data, + struct DiscordEntitlement* entitlement); + void(DISCORD_API* on_entitlement_delete)(void* event_data, + struct DiscordEntitlement* entitlement); }; struct IDiscordStoreManager { - void (*fetch_skus)(struct IDiscordStoreManager* manager, - void* callback_data, - void (*callback)(void* callback_data, enum EDiscordResult result)); - void (*count_skus)(struct IDiscordStoreManager* manager, int32_t* count); - enum EDiscordResult (*get_sku)(struct IDiscordStoreManager* manager, - DiscordSnowflake sku_id, - struct DiscordSku* sku); - enum EDiscordResult (*get_sku_at)(struct IDiscordStoreManager* manager, - int32_t index, - struct DiscordSku* sku); - void (*fetch_entitlements)(struct IDiscordStoreManager* manager, - void* callback_data, - void (*callback)(void* callback_data, enum EDiscordResult result)); - void (*count_entitlements)(struct IDiscordStoreManager* manager, int32_t* count); - enum EDiscordResult (*get_entitlement)(struct IDiscordStoreManager* manager, - DiscordSnowflake entitlement_id, - struct DiscordEntitlement* entitlement); - enum EDiscordResult (*get_entitlement_at)(struct IDiscordStoreManager* manager, - int32_t index, - struct DiscordEntitlement* entitlement); - enum EDiscordResult (*has_sku_entitlement)(struct IDiscordStoreManager* manager, - DiscordSnowflake sku_id, - bool* has_entitlement); - void (*start_purchase)(struct IDiscordStoreManager* manager, - DiscordSnowflake sku_id, - void* callback_data, - void (*callback)(void* callback_data, enum EDiscordResult result)); + void(DISCORD_API* fetch_skus)(struct IDiscordStoreManager* manager, + void* callback_data, + void(DISCORD_API* callback)(void* callback_data, + enum EDiscordResult result)); + void(DISCORD_API* count_skus)(struct IDiscordStoreManager* manager, int32_t* count); + enum EDiscordResult(DISCORD_API* get_sku)(struct IDiscordStoreManager* manager, + DiscordSnowflake sku_id, + struct DiscordSku* sku); + enum EDiscordResult(DISCORD_API* get_sku_at)(struct IDiscordStoreManager* manager, + int32_t index, + struct DiscordSku* sku); + void(DISCORD_API* fetch_entitlements)(struct IDiscordStoreManager* manager, + void* callback_data, + void(DISCORD_API* callback)(void* callback_data, + enum EDiscordResult result)); + void(DISCORD_API* count_entitlements)(struct IDiscordStoreManager* manager, int32_t* count); + enum EDiscordResult(DISCORD_API* get_entitlement)(struct IDiscordStoreManager* manager, + DiscordSnowflake entitlement_id, + struct DiscordEntitlement* entitlement); + enum EDiscordResult(DISCORD_API* get_entitlement_at)(struct IDiscordStoreManager* manager, + int32_t index, + struct DiscordEntitlement* entitlement); + enum EDiscordResult(DISCORD_API* has_sku_entitlement)(struct IDiscordStoreManager* manager, + DiscordSnowflake sku_id, + bool* has_entitlement); + void(DISCORD_API* start_purchase)(struct IDiscordStoreManager* manager, + DiscordSnowflake sku_id, + void* callback_data, + void(DISCORD_API* callback)(void* callback_data, + enum EDiscordResult result)); }; struct IDiscordVoiceEvents { - void (*on_settings_update)(void* event_data); + void(DISCORD_API* on_settings_update)(void* event_data); }; struct IDiscordVoiceManager { - enum EDiscordResult (*get_input_mode)(struct IDiscordVoiceManager* manager, - struct DiscordInputMode* input_mode); - void (*set_input_mode)(struct IDiscordVoiceManager* manager, - struct DiscordInputMode input_mode, - void* callback_data, - void (*callback)(void* callback_data, enum EDiscordResult result)); - enum EDiscordResult (*is_self_mute)(struct IDiscordVoiceManager* manager, bool* mute); - enum EDiscordResult (*set_self_mute)(struct IDiscordVoiceManager* manager, bool mute); - enum EDiscordResult (*is_self_deaf)(struct IDiscordVoiceManager* manager, bool* deaf); - enum EDiscordResult (*set_self_deaf)(struct IDiscordVoiceManager* manager, bool deaf); - enum EDiscordResult (*is_local_mute)(struct IDiscordVoiceManager* manager, - DiscordSnowflake user_id, - bool* mute); - enum EDiscordResult (*set_local_mute)(struct IDiscordVoiceManager* manager, - DiscordSnowflake user_id, - bool mute); - enum EDiscordResult (*get_local_volume)(struct IDiscordVoiceManager* manager, - DiscordSnowflake user_id, - uint8_t* volume); - enum EDiscordResult (*set_local_volume)(struct IDiscordVoiceManager* manager, - DiscordSnowflake user_id, - uint8_t volume); + enum EDiscordResult(DISCORD_API* get_input_mode)(struct IDiscordVoiceManager* manager, + struct DiscordInputMode* input_mode); + void(DISCORD_API* set_input_mode)(struct IDiscordVoiceManager* manager, + struct DiscordInputMode input_mode, + void* callback_data, + void(DISCORD_API* callback)(void* callback_data, + enum EDiscordResult result)); + enum EDiscordResult(DISCORD_API* is_self_mute)(struct IDiscordVoiceManager* manager, + bool* mute); + enum EDiscordResult(DISCORD_API* set_self_mute)(struct IDiscordVoiceManager* manager, + bool mute); + enum EDiscordResult(DISCORD_API* is_self_deaf)(struct IDiscordVoiceManager* manager, + bool* deaf); + enum EDiscordResult(DISCORD_API* set_self_deaf)(struct IDiscordVoiceManager* manager, + bool deaf); + enum EDiscordResult(DISCORD_API* is_local_mute)(struct IDiscordVoiceManager* manager, + DiscordSnowflake user_id, + bool* mute); + enum EDiscordResult(DISCORD_API* set_local_mute)(struct IDiscordVoiceManager* manager, + DiscordSnowflake user_id, + bool mute); + enum EDiscordResult(DISCORD_API* get_local_volume)(struct IDiscordVoiceManager* manager, + DiscordSnowflake user_id, + uint8_t* volume); + enum EDiscordResult(DISCORD_API* set_local_volume)(struct IDiscordVoiceManager* manager, + DiscordSnowflake user_id, + uint8_t volume); }; struct IDiscordAchievementEvents { - void (*on_user_achievement_update)(void* event_data, - struct DiscordUserAchievement* user_achievement); + void(DISCORD_API* on_user_achievement_update)(void* event_data, + struct DiscordUserAchievement* user_achievement); }; struct IDiscordAchievementManager { - void (*set_user_achievement)(struct IDiscordAchievementManager* manager, - DiscordSnowflake achievement_id, - uint8_t percent_complete, - void* callback_data, - void (*callback)(void* callback_data, enum EDiscordResult result)); - void (*fetch_user_achievements)(struct IDiscordAchievementManager* manager, - void* callback_data, - void (*callback)(void* callback_data, - enum EDiscordResult result)); - void (*count_user_achievements)(struct IDiscordAchievementManager* manager, int32_t* count); - enum EDiscordResult (*get_user_achievement)(struct IDiscordAchievementManager* manager, - DiscordSnowflake user_achievement_id, - struct DiscordUserAchievement* user_achievement); - enum EDiscordResult (*get_user_achievement_at)(struct IDiscordAchievementManager* manager, - int32_t index, - struct DiscordUserAchievement* user_achievement); + void(DISCORD_API* set_user_achievement)( + struct IDiscordAchievementManager* manager, + DiscordSnowflake achievement_id, + uint8_t percent_complete, + void* callback_data, + void(DISCORD_API* callback)(void* callback_data, enum EDiscordResult result)); + void(DISCORD_API* fetch_user_achievements)( + struct IDiscordAchievementManager* manager, + void* callback_data, + void(DISCORD_API* callback)(void* callback_data, enum EDiscordResult result)); + void(DISCORD_API* count_user_achievements)(struct IDiscordAchievementManager* manager, + int32_t* count); + enum EDiscordResult(DISCORD_API* get_user_achievement)( + struct IDiscordAchievementManager* manager, + DiscordSnowflake user_achievement_id, + struct DiscordUserAchievement* user_achievement); + enum EDiscordResult(DISCORD_API* get_user_achievement_at)( + struct IDiscordAchievementManager* manager, + int32_t index, + struct DiscordUserAchievement* user_achievement); }; typedef void* IDiscordCoreEvents; struct IDiscordCore { - void (*destroy)(struct IDiscordCore* core); - enum EDiscordResult (*run_callbacks)(struct IDiscordCore* core); - void (*set_log_hook)(struct IDiscordCore* core, - enum EDiscordLogLevel min_level, - void* hook_data, - void (*hook)(void* hook_data, - enum EDiscordLogLevel level, - const char* message)); - struct IDiscordApplicationManager* (*get_application_manager)(struct IDiscordCore* core); - struct IDiscordUserManager* (*get_user_manager)(struct IDiscordCore* core); - struct IDiscordImageManager* (*get_image_manager)(struct IDiscordCore* core); - struct IDiscordActivityManager* (*get_activity_manager)(struct IDiscordCore* core); - struct IDiscordRelationshipManager* (*get_relationship_manager)(struct IDiscordCore* core); - struct IDiscordLobbyManager* (*get_lobby_manager)(struct IDiscordCore* core); - struct IDiscordNetworkManager* (*get_network_manager)(struct IDiscordCore* core); - struct IDiscordOverlayManager* (*get_overlay_manager)(struct IDiscordCore* core); - struct IDiscordStorageManager* (*get_storage_manager)(struct IDiscordCore* core); - struct IDiscordStoreManager* (*get_store_manager)(struct IDiscordCore* core); - struct IDiscordVoiceManager* (*get_voice_manager)(struct IDiscordCore* core); - struct IDiscordAchievementManager* (*get_achievement_manager)(struct IDiscordCore* core); + void(DISCORD_API* destroy)(struct IDiscordCore* core); + enum EDiscordResult(DISCORD_API* run_callbacks)(struct IDiscordCore* core); + void(DISCORD_API* set_log_hook)(struct IDiscordCore* core, + enum EDiscordLogLevel min_level, + void* hook_data, + void(DISCORD_API* hook)(void* hook_data, + enum EDiscordLogLevel level, + const char* message)); + struct IDiscordApplicationManager*(DISCORD_API* get_application_manager)( + struct IDiscordCore* core); + struct IDiscordUserManager*(DISCORD_API* get_user_manager)(struct IDiscordCore* core); + struct IDiscordImageManager*(DISCORD_API* get_image_manager)(struct IDiscordCore* core); + struct IDiscordActivityManager*(DISCORD_API* get_activity_manager)(struct IDiscordCore* core); + struct IDiscordRelationshipManager*(DISCORD_API* get_relationship_manager)( + struct IDiscordCore* core); + struct IDiscordLobbyManager*(DISCORD_API* get_lobby_manager)(struct IDiscordCore* core); + struct IDiscordNetworkManager*(DISCORD_API* get_network_manager)(struct IDiscordCore* core); + struct IDiscordOverlayManager*(DISCORD_API* get_overlay_manager)(struct IDiscordCore* core); + struct IDiscordStorageManager*(DISCORD_API* get_storage_manager)(struct IDiscordCore* core); + struct IDiscordStoreManager*(DISCORD_API* get_store_manager)(struct IDiscordCore* core); + struct IDiscordVoiceManager*(DISCORD_API* get_voice_manager)(struct IDiscordCore* core); + struct IDiscordAchievementManager*(DISCORD_API* get_achievement_manager)( + struct IDiscordCore* core); }; struct DiscordCreateParams { @@ -931,12 +1102,12 @@ static params->achievement_version = DISCORD_ACHIEVEMENT_MANAGER_VERSION; } -enum EDiscordResult DiscordCreate(DiscordVersion version, - struct DiscordCreateParams* params, - struct IDiscordCore** result); +enum EDiscordResult DISCORD_API DiscordCreate(DiscordVersion version, + struct DiscordCreateParams* params, + struct IDiscordCore** result); #ifdef __cplusplus } #endif -#endif \ No newline at end of file +#endif diff --git a/public/discord/lobby_manager.cpp b/public/discord/lobby_manager.cpp index 6bf1a1aa..3a95b1a0 100644 --- a/public/discord/lobby_manager.cpp +++ b/public/discord/lobby_manager.cpp @@ -13,7 +13,7 @@ namespace discord { class LobbyEvents final { public: - static void OnLobbyUpdate(void* callbackData, int64_t lobbyId) + static void DISCORD_CALLBACK OnLobbyUpdate(void* callbackData, int64_t lobbyId) { auto* core = reinterpret_cast(callbackData); if (!core) { @@ -24,7 +24,7 @@ class LobbyEvents final { module.OnLobbyUpdate(lobbyId); } - static void OnLobbyDelete(void* callbackData, int64_t lobbyId, uint32_t reason) + static void DISCORD_CALLBACK OnLobbyDelete(void* callbackData, int64_t lobbyId, uint32_t reason) { auto* core = reinterpret_cast(callbackData); if (!core) { @@ -35,7 +35,9 @@ class LobbyEvents final { module.OnLobbyDelete(lobbyId, reason); } - static void OnMemberConnect(void* callbackData, int64_t lobbyId, int64_t userId) + static void DISCORD_CALLBACK OnMemberConnect(void* callbackData, + int64_t lobbyId, + int64_t userId) { auto* core = reinterpret_cast(callbackData); if (!core) { @@ -46,7 +48,7 @@ class LobbyEvents final { module.OnMemberConnect(lobbyId, userId); } - static void OnMemberUpdate(void* callbackData, int64_t lobbyId, int64_t userId) + static void DISCORD_CALLBACK OnMemberUpdate(void* callbackData, int64_t lobbyId, int64_t userId) { auto* core = reinterpret_cast(callbackData); if (!core) { @@ -57,7 +59,9 @@ class LobbyEvents final { module.OnMemberUpdate(lobbyId, userId); } - static void OnMemberDisconnect(void* callbackData, int64_t lobbyId, int64_t userId) + static void DISCORD_CALLBACK OnMemberDisconnect(void* callbackData, + int64_t lobbyId, + int64_t userId) { auto* core = reinterpret_cast(callbackData); if (!core) { @@ -68,11 +72,11 @@ class LobbyEvents final { module.OnMemberDisconnect(lobbyId, userId); } - static void OnLobbyMessage(void* callbackData, - int64_t lobbyId, - int64_t userId, - uint8_t* data, - uint32_t dataLength) + static void DISCORD_CALLBACK OnLobbyMessage(void* callbackData, + int64_t lobbyId, + int64_t userId, + uint8_t* data, + uint32_t dataLength) { auto* core = reinterpret_cast(callbackData); if (!core) { @@ -83,7 +87,10 @@ class LobbyEvents final { module.OnLobbyMessage(lobbyId, userId, data, dataLength); } - static void OnSpeaking(void* callbackData, int64_t lobbyId, int64_t userId, bool speaking) + static void DISCORD_CALLBACK OnSpeaking(void* callbackData, + int64_t lobbyId, + int64_t userId, + bool speaking) { auto* core = reinterpret_cast(callbackData); if (!core) { @@ -94,12 +101,12 @@ class LobbyEvents final { module.OnSpeaking(lobbyId, userId, (speaking != 0)); } - static void OnNetworkMessage(void* callbackData, - int64_t lobbyId, - int64_t userId, - uint8_t channelId, - uint8_t* data, - uint32_t dataLength) + static void DISCORD_CALLBACK OnNetworkMessage(void* callbackData, + int64_t lobbyId, + int64_t userId, + uint8_t channelId, + uint8_t* data, + uint32_t dataLength) { auto* core = reinterpret_cast(callbackData); if (!core) { diff --git a/public/discord/network_manager.cpp b/public/discord/network_manager.cpp index 97c219ef..36031b32 100644 --- a/public/discord/network_manager.cpp +++ b/public/discord/network_manager.cpp @@ -13,11 +13,11 @@ namespace discord { class NetworkEvents final { public: - static void OnMessage(void* callbackData, - DiscordNetworkPeerId peerId, - DiscordNetworkChannelId channelId, - uint8_t* data, - uint32_t dataLength) + static void DISCORD_CALLBACK OnMessage(void* callbackData, + DiscordNetworkPeerId peerId, + DiscordNetworkChannelId channelId, + uint8_t* data, + uint32_t dataLength) { auto* core = reinterpret_cast(callbackData); if (!core) { @@ -28,7 +28,7 @@ class NetworkEvents final { module.OnMessage(peerId, channelId, data, dataLength); } - static void OnRouteUpdate(void* callbackData, char const* routeData) + static void DISCORD_CALLBACK OnRouteUpdate(void* callbackData, char const* routeData) { auto* core = reinterpret_cast(callbackData); if (!core) { diff --git a/public/discord/overlay_manager.cpp b/public/discord/overlay_manager.cpp index e1c91cef..f4b1fba7 100644 --- a/public/discord/overlay_manager.cpp +++ b/public/discord/overlay_manager.cpp @@ -13,7 +13,7 @@ namespace discord { class OverlayEvents final { public: - static void OnToggle(void* callbackData, bool locked) + static void DISCORD_CALLBACK OnToggle(void* callbackData, bool locked) { auto* core = reinterpret_cast(callbackData); if (!core) { @@ -109,4 +109,121 @@ void OverlayManager::OpenVoiceSettings(std::function callback) internal_->open_voice_settings(internal_, cb.release(), wrapper); } +Result OverlayManager::InitDrawingDxgi(IDXGISwapChain* swapchain, bool useMessageForwarding) +{ + auto result = + internal_->init_drawing_dxgi(internal_, swapchain, (useMessageForwarding ? 1 : 0)); + return static_cast(result); +} + +void OverlayManager::OnPresent() +{ + internal_->on_present(internal_); +} + +void OverlayManager::ForwardMessage(MSG* message) +{ + internal_->forward_message(internal_, message); +} + +void OverlayManager::KeyEvent(bool down, char const* keyCode, KeyVariant variant) +{ + internal_->key_event(internal_, + (down ? 1 : 0), + const_cast(keyCode), + static_cast(variant)); +} + +void OverlayManager::CharEvent(char const* character) +{ + internal_->char_event(internal_, const_cast(character)); +} + +void OverlayManager::MouseButtonEvent(std::uint8_t down, + std::int32_t clickCount, + MouseButton which, + std::int32_t x, + std::int32_t y) +{ + internal_->mouse_button_event( + internal_, down, clickCount, static_cast(which), x, y); +} + +void OverlayManager::MouseMotionEvent(std::int32_t x, std::int32_t y) +{ + internal_->mouse_motion_event(internal_, x, y); +} + +void OverlayManager::ImeCommitText(char const* text) +{ + internal_->ime_commit_text(internal_, const_cast(text)); +} + +void OverlayManager::ImeSetComposition(char const* text, + ImeUnderline* underlines, + std::uint32_t underlinesLength, + std::int32_t from, + std::int32_t to) +{ + internal_->ime_set_composition(internal_, + const_cast(text), + reinterpret_cast(underlines), + underlinesLength, + from, + to); +} + +void OverlayManager::ImeCancelComposition() +{ + internal_->ime_cancel_composition(internal_); +} + +void OverlayManager::SetImeCompositionRangeCallback( + std::function + onImeCompositionRangeChanged) +{ + static auto wrapper = [](void* callbackData, + int32_t from, + int32_t to, + DiscordRect* bounds, + uint32_t boundsLength) -> void { + std::unique_ptr> cb( + reinterpret_cast*>( + callbackData)); + if (!cb || !(*cb)) { + return; + } + (*cb)(from, to, reinterpret_cast(bounds), boundsLength); + }; + std::unique_ptr> cb{}; + cb.reset(new std::function( + std::move(onImeCompositionRangeChanged))); + internal_->set_ime_composition_range_callback(internal_, cb.release(), wrapper); +} + +void OverlayManager::SetImeSelectionBoundsCallback( + std::function onImeSelectionBoundsChanged) +{ + static auto wrapper = + [](void* callbackData, DiscordRect anchor, DiscordRect focus, bool isAnchorFirst) -> void { + std::unique_ptr> cb( + reinterpret_cast*>(callbackData)); + if (!cb || !(*cb)) { + return; + } + (*cb)(*reinterpret_cast(&anchor), + *reinterpret_cast(&focus), + (isAnchorFirst != 0)); + }; + std::unique_ptr> cb{}; + cb.reset(new std::function(std::move(onImeSelectionBoundsChanged))); + internal_->set_ime_selection_bounds_callback(internal_, cb.release(), wrapper); +} + +bool OverlayManager::IsPointInsideClickZone(std::int32_t x, std::int32_t y) +{ + auto result = internal_->is_point_inside_click_zone(internal_, x, y); + return (result != 0); +} + } // namespace discord diff --git a/public/discord/overlay_manager.h b/public/discord/overlay_manager.h index c452aed3..5f73a367 100644 --- a/public/discord/overlay_manager.h +++ b/public/discord/overlay_manager.h @@ -14,6 +14,30 @@ class OverlayManager final { void OpenActivityInvite(ActivityActionType type, std::function callback); void OpenGuildInvite(char const* code, std::function callback); void OpenVoiceSettings(std::function callback); + Result InitDrawingDxgi(IDXGISwapChain* swapchain, bool useMessageForwarding); + void OnPresent(); + void ForwardMessage(MSG* message); + void KeyEvent(bool down, char const* keyCode, KeyVariant variant); + void CharEvent(char const* character); + void MouseButtonEvent(std::uint8_t down, + std::int32_t clickCount, + MouseButton which, + std::int32_t x, + std::int32_t y); + void MouseMotionEvent(std::int32_t x, std::int32_t y); + void ImeCommitText(char const* text); + void ImeSetComposition(char const* text, + ImeUnderline* underlines, + std::uint32_t underlinesLength, + std::int32_t from, + std::int32_t to); + void ImeCancelComposition(); + void SetImeCompositionRangeCallback( + std::function + onImeCompositionRangeChanged); + void SetImeSelectionBoundsCallback( + std::function onImeSelectionBoundsChanged); + bool IsPointInsideClickZone(std::int32_t x, std::int32_t y); Event OnToggle; diff --git a/public/discord/relationship_manager.cpp b/public/discord/relationship_manager.cpp index 005f2b0c..dce874ea 100644 --- a/public/discord/relationship_manager.cpp +++ b/public/discord/relationship_manager.cpp @@ -13,7 +13,7 @@ namespace discord { class RelationshipEvents final { public: - static void OnRefresh(void* callbackData) + static void DISCORD_CALLBACK OnRefresh(void* callbackData) { auto* core = reinterpret_cast(callbackData); if (!core) { @@ -24,7 +24,8 @@ class RelationshipEvents final { module.OnRefresh(); } - static void OnRelationshipUpdate(void* callbackData, DiscordRelationship* relationship) + static void DISCORD_CALLBACK OnRelationshipUpdate(void* callbackData, + DiscordRelationship* relationship) { auto* core = reinterpret_cast(callbackData); if (!core) { diff --git a/public/discord/store_manager.cpp b/public/discord/store_manager.cpp index d6bdad12..40c7e656 100644 --- a/public/discord/store_manager.cpp +++ b/public/discord/store_manager.cpp @@ -13,7 +13,8 @@ namespace discord { class StoreEvents final { public: - static void OnEntitlementCreate(void* callbackData, DiscordEntitlement* entitlement) + static void DISCORD_CALLBACK OnEntitlementCreate(void* callbackData, + DiscordEntitlement* entitlement) { auto* core = reinterpret_cast(callbackData); if (!core) { @@ -24,7 +25,8 @@ class StoreEvents final { module.OnEntitlementCreate(*reinterpret_cast(entitlement)); } - static void OnEntitlementDelete(void* callbackData, DiscordEntitlement* entitlement) + static void DISCORD_CALLBACK OnEntitlementDelete(void* callbackData, + DiscordEntitlement* entitlement) { auto* core = reinterpret_cast(callbackData); if (!core) { diff --git a/public/discord/types.cpp b/public/discord/types.cpp index 66cdd49d..b60dded0 100644 --- a/public/discord/types.cpp +++ b/public/discord/types.cpp @@ -249,6 +249,16 @@ PartySize const& ActivityParty::GetSize() const return reinterpret_cast(internal_.size); } +void ActivityParty::SetPrivacy(ActivityPartyPrivacy privacy) +{ + internal_.privacy = static_cast(privacy); +} + +ActivityPartyPrivacy ActivityParty::GetPrivacy() const +{ + return static_cast(internal_.privacy); +} + void ActivitySecrets::SetMatch(char const* match) { strncpy(internal_.match, match, 128); @@ -385,6 +395,16 @@ bool Activity::GetInstance() const return internal_.instance != 0; } +void Activity::SetSupportedPlatforms(std::uint32_t supportedPlatforms) +{ + internal_.supported_platforms = supportedPlatforms; +} + +std::uint32_t Activity::GetSupportedPlatforms() const +{ + return internal_.supported_platforms; +} + void Presence::SetStatus(Status status) { internal_.status = static_cast(status); @@ -496,6 +516,96 @@ bool Lobby::GetLocked() const return internal_.locked != 0; } +void ImeUnderline::SetFrom(std::int32_t from) +{ + internal_.from = from; +} + +std::int32_t ImeUnderline::GetFrom() const +{ + return internal_.from; +} + +void ImeUnderline::SetTo(std::int32_t to) +{ + internal_.to = to; +} + +std::int32_t ImeUnderline::GetTo() const +{ + return internal_.to; +} + +void ImeUnderline::SetColor(std::uint32_t color) +{ + internal_.color = color; +} + +std::uint32_t ImeUnderline::GetColor() const +{ + return internal_.color; +} + +void ImeUnderline::SetBackgroundColor(std::uint32_t backgroundColor) +{ + internal_.background_color = backgroundColor; +} + +std::uint32_t ImeUnderline::GetBackgroundColor() const +{ + return internal_.background_color; +} + +void ImeUnderline::SetThick(bool thick) +{ + internal_.thick = thick; +} + +bool ImeUnderline::GetThick() const +{ + return internal_.thick != 0; +} + +void Rect::SetLeft(std::int32_t left) +{ + internal_.left = left; +} + +std::int32_t Rect::GetLeft() const +{ + return internal_.left; +} + +void Rect::SetTop(std::int32_t top) +{ + internal_.top = top; +} + +std::int32_t Rect::GetTop() const +{ + return internal_.top; +} + +void Rect::SetRight(std::int32_t right) +{ + internal_.right = right; +} + +std::int32_t Rect::GetRight() const +{ + return internal_.right; +} + +void Rect::SetBottom(std::int32_t bottom) +{ + internal_.bottom = bottom; +} + +std::int32_t Rect::GetBottom() const +{ + return internal_.bottom; +} + void FileStat::SetFilename(char const* filename) { strncpy(internal_.filename, filename, 260); diff --git a/public/discord/types.h b/public/discord/types.h index abee4a59..76c43117 100644 --- a/public/discord/types.h +++ b/public/discord/types.h @@ -2,9 +2,10 @@ #include "ffi.h" #include "event.h" - -#include -#include +#ifdef _WIN32 +#include +#include +#endif namespace discord { @@ -53,6 +54,7 @@ enum class Result { InvalidGiftCode = 41, PurchaseError = 42, TransactionAborted = 43, + DrawingInitFailed = 44, }; enum class CreateFlags { @@ -85,6 +87,11 @@ enum class ImageType { User, }; +enum class ActivityPartyPrivacy { + Private = 0, + Public = 1, +}; + enum class ActivityType { Playing, Streaming, @@ -97,6 +104,12 @@ enum class ActivityActionType { Spectate, }; +enum class ActivitySupportedPlatformFlags { + Desktop = 1, + Android = 2, + iOS = 4, +}; + enum class ActivityJoinRequestReply { No, Yes, @@ -145,6 +158,18 @@ enum class LobbySearchDistance { Global, }; +enum class KeyVariant { + Normal, + Right, + Left, +}; + +enum class MouseButton { + Left, + Middle, + Right, +}; + enum class EntitlementType { Purchase = 1, PremiumSubscription, @@ -180,6 +205,18 @@ using MetadataKey = char const*; using MetadataValue = char const*; using NetworkPeerId = std::uint64_t; using NetworkChannelId = std::uint8_t; +#ifdef __APPLE__ +using IDXGISwapChain = void; +#endif +#ifdef __linux__ +using IDXGISwapChain = void; +#endif +#ifdef __APPLE__ +using MSG = void; +#endif +#ifdef __linux__ +using MSG = void; +#endif using Path = char const*; using DateTime = char const*; @@ -280,6 +317,8 @@ class ActivityParty final { char const* GetId() const; PartySize& GetSize(); PartySize const& GetSize() const; + void SetPrivacy(ActivityPartyPrivacy privacy); + ActivityPartyPrivacy GetPrivacy() const; private: DiscordActivityParty internal_; @@ -320,6 +359,8 @@ class Activity final { ActivitySecrets const& GetSecrets() const; void SetInstance(bool instance); bool GetInstance() const; + void SetSupportedPlatforms(std::uint32_t supportedPlatforms); + std::uint32_t GetSupportedPlatforms() const; private: DiscordActivity internal_; @@ -368,6 +409,38 @@ class Lobby final { DiscordLobby internal_; }; +class ImeUnderline final { +public: + void SetFrom(std::int32_t from); + std::int32_t GetFrom() const; + void SetTo(std::int32_t to); + std::int32_t GetTo() const; + void SetColor(std::uint32_t color); + std::uint32_t GetColor() const; + void SetBackgroundColor(std::uint32_t backgroundColor); + std::uint32_t GetBackgroundColor() const; + void SetThick(bool thick); + bool GetThick() const; + +private: + DiscordImeUnderline internal_; +}; + +class Rect final { +public: + void SetLeft(std::int32_t left); + std::int32_t GetLeft() const; + void SetTop(std::int32_t top); + std::int32_t GetTop() const; + void SetRight(std::int32_t right); + std::int32_t GetRight() const; + void SetBottom(std::int32_t bottom); + std::int32_t GetBottom() const; + +private: + DiscordRect internal_; +}; + class FileStat final { public: void SetFilename(char const* filename); diff --git a/public/discord/user_manager.cpp b/public/discord/user_manager.cpp index e704e28b..ddb6d5ca 100644 --- a/public/discord/user_manager.cpp +++ b/public/discord/user_manager.cpp @@ -13,7 +13,7 @@ namespace discord { class UserEvents final { public: - static void OnCurrentUserUpdate(void* callbackData) + static void DISCORD_CALLBACK OnCurrentUserUpdate(void* callbackData) { auto* core = reinterpret_cast(callbackData); if (!core) { diff --git a/public/discord/voice_manager.cpp b/public/discord/voice_manager.cpp index a92d4bd7..014ceb3f 100644 --- a/public/discord/voice_manager.cpp +++ b/public/discord/voice_manager.cpp @@ -13,7 +13,7 @@ namespace discord { class VoiceEvents final { public: - static void OnSettingsUpdate(void* callbackData) + static void DISCORD_CALLBACK OnSettingsUpdate(void* callbackData) { auto* core = reinterpret_cast(callbackData); if (!core) { diff --git a/public/steam/isteamapplist.h b/public/steam/isteamapplist.h deleted file mode 100644 index eb574354..00000000 --- a/public/steam/isteamapplist.h +++ /dev/null @@ -1,68 +0,0 @@ -//====== Copyright © 1996-2008, Valve Corporation, All rights reserved. ======= -// -// Purpose: interface to app data in Steam -// -//============================================================================= - -#ifndef ISTEAMAPPLIST_H -#define ISTEAMAPPLIST_H -#ifdef _WIN32 -#pragma once -#endif - -#include "steam_api_common.h" - -//----------------------------------------------------------------------------- -// Purpose: This is a restricted interface that can only be used by previously approved apps, -// contact your Steam Account Manager if you believe you need access to this API. -// This interface lets you detect installed apps for the local Steam client, useful for debugging tools -// to offer lists of apps to debug via Steam. -//----------------------------------------------------------------------------- -class ISteamAppList -{ -public: - virtual uint32 GetNumInstalledApps() = 0; - virtual uint32 GetInstalledApps( AppId_t *pvecAppID, uint32 unMaxAppIDs ) = 0; - - virtual int GetAppName( AppId_t nAppID, STEAM_OUT_STRING() char *pchName, int cchNameMax ) = 0; // returns -1 if no name was found - virtual int GetAppInstallDir( AppId_t nAppID, char *pchDirectory, int cchNameMax ) = 0; // returns -1 if no dir was found - - virtual int GetAppBuildId( AppId_t nAppID ) = 0; // return the buildid of this app, may change at any time based on backend updates to the game -}; - -#define STEAMAPPLIST_INTERFACE_VERSION "STEAMAPPLIST_INTERFACE_VERSION001" - -// Global interface accessor -inline ISteamAppList *SteamAppList(); -STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamAppList *, SteamAppList, STEAMAPPLIST_INTERFACE_VERSION ); - -// callbacks -#if defined( VALVE_CALLBACK_PACK_SMALL ) -#pragma pack( push, 4 ) -#elif defined( VALVE_CALLBACK_PACK_LARGE ) -#pragma pack( push, 8 ) -#else -#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx -#endif - - -//--------------------------------------------------------------------------------- -// Purpose: Sent when a new app is installed (not downloaded yet) -//--------------------------------------------------------------------------------- -STEAM_CALLBACK_BEGIN( SteamAppInstalled_t, k_iSteamAppListCallbacks + 1 ) -STEAM_CALLBACK_MEMBER( 0, AppId_t, m_nAppID ) // ID of the app that installs -STEAM_CALLBACK_MEMBER( 1, int, m_iInstallFolderIndex ) // library folder the app is installed -STEAM_CALLBACK_END( 2 ) - - -//--------------------------------------------------------------------------------- -// Purpose: Sent when an app is uninstalled -//--------------------------------------------------------------------------------- -STEAM_CALLBACK_BEGIN( SteamAppUninstalled_t, k_iSteamAppListCallbacks + 2 ) -STEAM_CALLBACK_MEMBER( 0, AppId_t, m_nAppID ) // ID of the app that installs -STEAM_CALLBACK_MEMBER( 1, int, m_iInstallFolderIndex ) // library folder the app was installed -STEAM_CALLBACK_END(2) - - -#pragma pack( pop ) -#endif // ISTEAMAPPLIST_H diff --git a/public/steam/isteamclient.h b/public/steam/isteamclient.h index 682e8508..25703c29 100644 --- a/public/steam/isteamclient.h +++ b/public/steam/isteamclient.h @@ -115,18 +115,12 @@ class ISteamClient // Expose HTTP interface virtual ISteamHTTP *GetISteamHTTP( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; - // Deprecated - the ISteamUnifiedMessages interface is no longer intended for public consumption. - STEAM_PRIVATE_API( virtual void *DEPRECATED_GetISteamUnifiedMessages( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0 ; ) - // Exposes the ISteamController interface - deprecated in favor of Steam Input virtual ISteamController *GetISteamController( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; // Exposes the ISteamUGC interface virtual ISteamUGC *GetISteamUGC( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; - // returns app list interface, only available on specially registered apps - virtual ISteamAppList *GetISteamAppList( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; - // Music Player virtual ISteamMusic *GetISteamMusic( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; @@ -162,7 +156,7 @@ class ISteamClient STEAM_PRIVATE_API( virtual void DestroyAllInterfaces() = 0; ) }; -#define STEAMCLIENT_INTERFACE_VERSION "SteamClient020" +#define STEAMCLIENT_INTERFACE_VERSION "SteamClient021" #ifndef STEAM_API_EXPORTS diff --git a/public/steam/isteamcontroller.h b/public/steam/isteamcontroller.h index 193a131a..f254c042 100644 --- a/public/steam/isteamcontroller.h +++ b/public/steam/isteamcontroller.h @@ -539,7 +539,6 @@ typedef uint64 ControllerAnalogActionHandle_t; #define ControllerAnalogActionData_t InputAnalogActionData_t #define ControllerDigitalActionData_t InputDigitalActionData_t #define ControllerMotionData_t InputMotionData_t -#define ControllerMotionDataV2_t InputMotionDataV2_t #else struct ControllerAnalogActionData_t { diff --git a/public/steam/isteamfriends.h b/public/steam/isteamfriends.h index d57231aa..1562b995 100644 --- a/public/steam/isteamfriends.h +++ b/public/steam/isteamfriends.h @@ -103,6 +103,10 @@ struct FriendGameInfo_t }; #pragma pack( pop ) +// special values for FriendGameInfo_t::m_usQueryPort +const uint16 k_usFriendGameInfoQueryPort_NotInitialized = 0xFFFF; // We haven't asked the GS for this query port's actual value yet. Was #define QUERY_PORT_NOT_INITIALIZED in older versions of Steamworks SDK. +const uint16 k_usFriendGameInfoQueryPort_Error = 0xFFFE; // We were unable to get the query port for this server. Was #define QUERY_PORT_ERROR in older versions of Steamworks SDK. + // maximum number of characters in a user's name. Two flavors; one for UTF-8 and one for UTF-16. // The UTF-8 version has to be very generous to accomodate characters that get large when encoded // in UTF-8. @@ -517,6 +521,7 @@ struct GameOverlayActivated_t uint8 m_bActive; // true if it's just been activated, false otherwise bool m_bUserInitiated; // true if the user asked for the overlay to be activated/deactivated AppId_t m_nAppID; // the appID of the game (should always be the current game) + uint32 m_dwOverlayPID; // used internally }; diff --git a/public/steam/isteaminput.h b/public/steam/isteaminput.h index 0d2d48af..b04fa137 100644 --- a/public/steam/isteaminput.h +++ b/public/steam/isteaminput.h @@ -660,58 +660,6 @@ struct InputMotionData_t float rotVelZ; }; - -struct InputMotionDataV2_t -{ - // - // Gyro post processing: - // - - // Drift Corrected Quaternion is calculated after steam input controller calibration values have been applied. - // Rawest _useful_ version of a quaternion. - // Most camera implementations should use this by comparing last rotation against current rotation, and applying the difference to the in game camera (plus your own sensitivity tweaks) - // It is worth viewing - float driftCorrectedQuatX; - float driftCorrectedQuatY; - float driftCorrectedQuatZ; - float driftCorrectedQuatW; - - // Sensor fusion corrects using accelerometer, and "average forward over time" for "forward". - // This can "ouija" your aim, so it's not so appropriate for camera controls (sensor fusion was originally made for racing game steering ) - // Same result as from old InputMotionData_t::rotQuatX/Y/Z/W - float sensorFusionQuatX; - float sensorFusionQuatY; - float sensorFusionQuatZ; - float sensorFusionQuatW; - - // Deferred Sensor fusion quaternion with deferred correction - // Reduces perception of "ouija" effect by only applying correction when the controller is below "low noise" thresholds, - // while the controller rotates fast - never when the user is attempting precision aim. - float deferredSensorFusionQuatX; - float deferredSensorFusionQuatY; - float deferredSensorFusionQuatZ; - float deferredSensorFusionQuatW; - - // Same as accel but values are calibrated such that 1 unit = 1G. - // X = Right - // Y = Forward out through the joystick USB port. - // Z = Up through the joystick axis. - float gravityX; - float gravityY; - float gravityZ; - - // - // Same as rotVel values in GetMotionData but values are calibrated to degrees per second. - // Local Space (controller relative) - // X = Pitch = left to right axis - // Y = Roll = axis through charging port - // Z = Yaw = axis through sticks - float degreesPerSecondX; - float degreesPerSecondY; - float degreesPerSecondZ; - -}; - //----------------------------------------------------------------------------- // Purpose: when callbacks are enabled this fires each time a controller action // state changes @@ -805,6 +753,12 @@ class ISteamInput // Note: this is called within either SteamInput()->RunFrame or by SteamAPI_RunCallbacks STEAM_CALL_BACK( SteamInputDeviceDisconnected_t ) + // Controllers using Gamepad emulation (XInput, DirectInput, etc) will be seated in the order that + // input is sent by the device. This callback will fire on first input for each device and when the + // a user has manually changed the order via the Steam overlay. This also has the device type info + // so that you can change out glyph sets without making additional API calls + STEAM_CALL_BACK( SteamInputGamepadSlotChange_t ) + // Enable SteamInputActionEvent_t callbacks. Directly calls your callback function // for lower latency than standard Steam callbacks. Supports one callback at a time. // Note: this is called within either SteamInput()->RunFrame or by SteamAPI_RunCallbacks @@ -1009,6 +963,20 @@ struct SteamInputConfigurationLoaded_t bool m_bUsesGamepadAPI; // Does the configuration contain any Xinput bindings? }; +//----------------------------------------------------------------------------- +// Purpose: called when controller gamepad slots change - on Linux/macOS these +// slots are shared for all running apps. +//----------------------------------------------------------------------------- +struct SteamInputGamepadSlotChange_t +{ + enum { k_iCallback = k_iSteamControllerCallbacks + 4 }; + AppId_t m_unAppID; + InputHandle_t m_ulDeviceHandle; // Handle for device + ESteamInputType m_eDeviceType; // Type of device + int m_nOldGamepadSlot; // Previous GamepadSlot - can be -1 controller doesn't uses gamepad bindings + int m_nNewGamepadSlot; // New Gamepad Slot - can be -1 controller doesn't uses gamepad bindings +}; + #pragma pack( pop ) #endif // ISTEAMINPUT_H diff --git a/public/steam/isteammasterserverupdater.h b/public/steam/isteammasterserverupdater.h deleted file mode 100644 index 19590019..00000000 --- a/public/steam/isteammasterserverupdater.h +++ /dev/null @@ -1 +0,0 @@ -#error "This file isn't used any more" diff --git a/public/steam/isteamnetworkingsockets.h b/public/steam/isteamnetworkingsockets.h index f29baf6d..14750a66 100644 --- a/public/steam/isteamnetworkingsockets.h +++ b/public/steam/isteamnetworkingsockets.h @@ -206,7 +206,7 @@ class ISteamNetworkingSockets /// WARNING: Be *very careful* when using the value provided in callbacks structs. /// Callbacks are queued, and the value that you will receive in your /// callback is the userdata that was effective at the time the callback - /// was queued. There are subtle race conditions that can hapen if you + /// was queued. There are subtle race conditions that can happen if you /// don't understand this! /// /// If any incoming messages for this connection are queued, the userdata @@ -397,10 +397,9 @@ class ISteamNetworkingSockets /// lanes may be sent out of order. Each lane has its own message number /// sequence. The first message sent on each lane will be assigned the number 1. /// - /// Each lane has a "priority". Lower priority lanes will only be processed - /// when all higher-priority lanes are empty. The magnitudes of the priority - /// values are not relevant, only their sort order. Higher numeric values - /// take priority over lower numeric values. + /// Each lane has a "priority". Lanes with higher numeric values will only be processed + /// when all lanes with lower number values are empty. The magnitudes of the priority + /// values are not relevant, only their sort order. /// /// Each lane also is assigned a weight, which controls the approximate proportion /// of the bandwidth that will be consumed by the lane, relative to other lanes @@ -829,7 +828,7 @@ class ISteamNetworkingSockets /// different types of traffic. Because these allocations come from a global /// namespace, there is a relatively strict limit on the maximum number of /// ports you may request. (At the time of this writing, the limit is 4.) - /// The Port assignments are *not* guaranteed to have any particular order + /// The port assignments are *not* guaranteed to have any particular order /// or relationship! Do *not* assume they are contiguous, even though that /// may often occur in practice. /// diff --git a/public/steam/isteamparentalsettings.h b/public/steam/isteamparentalsettings.h index ad435875..3cef0514 100644 --- a/public/steam/isteamparentalsettings.h +++ b/public/steam/isteamparentalsettings.h @@ -29,7 +29,7 @@ enum EParentalFeature k_EFeatureLibrary = 11, k_EFeatureTest = 12, k_EFeatureSiteLicense = 13, - k_EFeatureKioskMode = 14, + k_EFeatureKioskMode_Deprecated = 14, k_EFeatureMax }; diff --git a/public/steam/isteamremoteplay.h b/public/steam/isteamremoteplay.h index 28d352f4..060c1686 100644 --- a/public/steam/isteamremoteplay.h +++ b/public/steam/isteamremoteplay.h @@ -19,6 +19,7 @@ enum ESteamDeviceFormFactor k_ESteamDeviceFormFactorTablet = 2, k_ESteamDeviceFormFactorComputer = 3, k_ESteamDeviceFormFactorTV = 4, + k_ESteamDeviceFormFactorVRHeadset = 5, }; // Steam Remote Play session ID @@ -51,12 +52,17 @@ class ISteamRemotePlay // This is set to 0x0 if the resolution is not available virtual bool BGetSessionClientResolution( RemotePlaySessionID_t unSessionID, int *pnResolutionX, int *pnResolutionY ) = 0; - // Invite a friend to Remote Play Together - // This returns false if the invite can't be sent + // Start Remote Play Together and optionally show the UI in the overlay + // This returns false if Remote Play Together can't be started or your game is not configured for Remote Play Together + virtual bool BStartRemotePlayTogether( bool bShowOverlay = true ) = 0; + + // Invite a friend to Remote Play Together, or create a guest invite if steamIDFriend is empty + // This will automatically start Remote Play Together if it hasn't already been started + // This returns false if the invite can't be sent or your game is not configured for Remote Play Together virtual bool BSendRemotePlayTogetherInvite( CSteamID steamIDFriend ) = 0; }; -#define STEAMREMOTEPLAY_INTERFACE_VERSION "STEAMREMOTEPLAY_INTERFACE_VERSION001" +#define STEAMREMOTEPLAY_INTERFACE_VERSION "STEAMREMOTEPLAY_INTERFACE_VERSION002" // Global interface accessor inline ISteamRemotePlay *SteamRemotePlay(); @@ -82,6 +88,11 @@ STEAM_CALLBACK_BEGIN( SteamRemotePlaySessionDisconnected_t, k_iSteamRemotePlayCa STEAM_CALLBACK_END( 0 ) +STEAM_CALLBACK_BEGIN( SteamRemotePlayTogetherGuestInvite_t, k_iSteamRemotePlayCallbacks + 3 ) + STEAM_CALLBACK_MEMBER_ARRAY( 0, char, m_szConnectURL, 1024 ) +STEAM_CALLBACK_END( 0 ) + + #pragma pack( pop ) diff --git a/public/steam/isteamremotestorage.h b/public/steam/isteamremotestorage.h index 7c24e96a..93b7599c 100644 --- a/public/steam/isteamremotestorage.h +++ b/public/steam/isteamremotestorage.h @@ -102,9 +102,10 @@ enum EWorkshopFileType k_EWorkshopFileTypeSteamworksAccessInvite = 13, // internal k_EWorkshopFileTypeSteamVideo = 14, // Steam video k_EWorkshopFileTypeGameManagedItem = 15, // managed completely by the game, not the user, and not shown on the web + k_EWorkshopFileTypeClip = 16, // internal // Update k_EWorkshopFileTypeMax if you add values. - k_EWorkshopFileTypeMax = 16 + k_EWorkshopFileTypeMax = 17 }; diff --git a/public/steam/isteamugc.h b/public/steam/isteamugc.h index 560258ac..713feb4e 100644 --- a/public/steam/isteamugc.h +++ b/public/steam/isteamugc.h @@ -121,6 +121,7 @@ enum EItemState k_EItemStateNeedsUpdate = 8, // items needs an update. Either because it's not installed yet or creator updated content k_EItemStateDownloading = 16, // item update is currently downloading k_EItemStateDownloadPending = 32, // DownloadItem() was called for this item, content isn't available until DownloadItemResult_t is fired + k_EItemStateDisabledLocally = 64, // Item is disabled locally, so it shouldn't be considered subscribed }; enum EItemStatistic @@ -154,6 +155,7 @@ enum EItemPreviewType // | |Dn | | // +---+---+---+---+ k_EItemPreviewType_EnvironmentMap_LatLong = 4, // standard image file expected + k_EItemPreviewType_Clip = 5, // clip id is stored k_EItemPreviewType_ReservedMax = 255, // you can specify your own types above this value }; @@ -292,7 +294,7 @@ class ISteamUGC virtual bool SetItemUpdateLanguage( UGCUpdateHandle_t handle, const char *pchLanguage ) = 0; // specify the language of the title or description that will be set virtual bool SetItemMetadata( UGCUpdateHandle_t handle, const char *pchMetaData ) = 0; // change the metadata of an UGC item (max = k_cchDeveloperMetadataMax) virtual bool SetItemVisibility( UGCUpdateHandle_t handle, ERemoteStoragePublishedFileVisibility eVisibility ) = 0; // change the visibility of an UGC item - virtual bool SetItemTags( UGCUpdateHandle_t updateHandle, const SteamParamStringArray_t *pTags ) = 0; // change the tags of an UGC item + virtual bool SetItemTags( UGCUpdateHandle_t updateHandle, const SteamParamStringArray_t *pTags, bool bAllowAdminTags = false ) = 0; // change the tags of an UGC item virtual bool SetItemContent( UGCUpdateHandle_t handle, const char *pszContentFolder ) = 0; // update item content from this local folder virtual bool SetItemPreview( UGCUpdateHandle_t handle, const char *pszPreviewFile ) = 0; // change preview image file for this item. pszPreviewFile points to local image file, which must be under 1MB in size virtual bool SetAllowLegacyUpload( UGCUpdateHandle_t handle, bool bAllowLegacyUpload ) = 0; // use legacy upload for a single small file. The parameter to SetItemContent() should either be a directory with one file or the full path to the file. The file must also be less than 10MB in size. @@ -382,9 +384,12 @@ class ISteamUGC // Retrieve information related to the user's acceptance or not of the app's specific Workshop EULA STEAM_CALL_RESULT( WorkshopEULAStatus_t ) virtual SteamAPICall_t GetWorkshopEULAStatus() = 0; + + // Return the user's community content descriptor preferences + virtual uint32 GetUserContentDescriptorPreferences( EUGCContentDescriptorID *pvecDescriptors, uint32 cMaxEntries ) = 0; }; -#define STEAMUGC_INTERFACE_VERSION "STEAMUGC_INTERFACE_VERSION017" +#define STEAMUGC_INTERFACE_VERSION "STEAMUGC_INTERFACE_VERSION018" // Global interface accessor inline ISteamUGC *SteamUGC(); diff --git a/public/steam/isteamuser.h b/public/steam/isteamuser.h index fc144836..b6942067 100644 --- a/public/steam/isteamuser.h +++ b/public/steam/isteamuser.h @@ -127,8 +127,14 @@ class ISteamUser // SteamNetworkingIdentity is an optional input parameter to hold the public IP address or SteamID of the entity you are connecting to // if an IP address is passed Steam will only allow the ticket to be used by an entity with that IP address // if a Steam ID is passed Steam will only allow the ticket to be used by that Steam ID + // not to be used for "ISteamUserAuth\AuthenticateUserTicket" - it will fail virtual HAuthTicket GetAuthSessionTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket, const SteamNetworkingIdentity *pSteamNetworkingIdentity ) = 0; + // Request a ticket which will be used for webapi "ISteamUserAuth\AuthenticateUserTicket" + // pchIdentity is an optional input parameter to identify the service the ticket will be sent to + // the ticket will be returned in callback GetTicketForWebApiResponse_t + virtual HAuthTicket GetAuthTicketForWebApi( const char *pchIdentity ) = 0; + // Authenticate ticket from entity steamID to be sure it is valid and isnt reused // Registers for callbacks if the entity goes offline or cancels the ticket ( see ValidateAuthTicketResponse_t callback and EAuthSessionResponse ) virtual EBeginAuthSessionResult BeginAuthSession( const void *pAuthTicket, int cbAuthTicket, CSteamID steamID ) = 0; @@ -213,7 +219,7 @@ class ISteamUser }; -#define STEAMUSER_INTERFACE_VERSION "SteamUser022" +#define STEAMUSER_INTERFACE_VERSION "SteamUser023" // Global interface accessor inline ISteamUser *SteamUser(); @@ -354,7 +360,6 @@ struct GetAuthSessionTicketResponse_t EResult m_eResult; }; - //----------------------------------------------------------------------------- // Purpose: sent to your game in response to a steam://gamewebcallback/ command //----------------------------------------------------------------------------- @@ -415,6 +420,20 @@ struct DurationControl_t }; +//----------------------------------------------------------------------------- +// callback for GetTicketForWebApi +//----------------------------------------------------------------------------- +struct GetTicketForWebApiResponse_t +{ + enum { k_iCallback = k_iSteamUserCallbacks + 68 }; + HAuthTicket m_hAuthTicket; + EResult m_eResult; + int m_cubTicket; + static const int k_nCubTicketMaxLength = 2560; + uint8 m_rgubTicket[k_nCubTicketMaxLength]; +}; + + #pragma pack( pop ) #endif // ISTEAMUSER_H diff --git a/public/steam/isteamutils.h b/public/steam/isteamutils.h index 94743212..7a4909d5 100644 --- a/public/steam/isteamutils.h +++ b/public/steam/isteamutils.h @@ -215,6 +215,9 @@ class ISteamUtils // Dismisses the floating keyboard. virtual bool DismissFloatingGamepadTextInput() = 0; + + // Dismisses the full-screen text input dialog. + virtual bool DismissGamepadTextInput() = 0; }; #define STEAMUTILS_INTERFACE_VERSION "SteamUtils010" @@ -246,7 +249,7 @@ struct IPCountry_t //----------------------------------------------------------------------------- -// Purpose: Fired when running on a laptop and less than 10 minutes of battery is left, fires then every minute +// Purpose: Fired when running on a handheld PC or laptop with less than 10 minutes of battery is left, fires then every minute //----------------------------------------------------------------------------- struct LowBatteryPower_t { diff --git a/public/steam/lib/linux32/libsdkencryptedappticket.so b/public/steam/lib/linux32/libsdkencryptedappticket.so index 2ec9bd8a..c9f8677a 100644 Binary files a/public/steam/lib/linux32/libsdkencryptedappticket.so and b/public/steam/lib/linux32/libsdkencryptedappticket.so differ diff --git a/public/steam/lib/linux64/libsdkencryptedappticket.so b/public/steam/lib/linux64/libsdkencryptedappticket.so index fe77ac24..1a5eb7f4 100644 Binary files a/public/steam/lib/linux64/libsdkencryptedappticket.so and b/public/steam/lib/linux64/libsdkencryptedappticket.so differ diff --git a/public/steam/lib/osx/libsdkencryptedappticket.dylib b/public/steam/lib/osx/libsdkencryptedappticket.dylib index 6e785d4a..2b5a8fd6 100644 Binary files a/public/steam/lib/osx/libsdkencryptedappticket.dylib and b/public/steam/lib/osx/libsdkencryptedappticket.dylib differ diff --git a/public/steam/lib/win32/sdkencryptedappticket.lib b/public/steam/lib/win32/sdkencryptedappticket.lib index 6f028f56..9bd4fc57 100644 Binary files a/public/steam/lib/win32/sdkencryptedappticket.lib and b/public/steam/lib/win32/sdkencryptedappticket.lib differ diff --git a/public/steam/lib/win64/sdkencryptedappticket64.lib b/public/steam/lib/win64/sdkencryptedappticket64.lib index d77b9094..15945f19 100644 Binary files a/public/steam/lib/win64/sdkencryptedappticket64.lib and b/public/steam/lib/win64/sdkencryptedappticket64.lib differ diff --git a/public/steam/steam_api.h b/public/steam/steam_api.h index 9cac78f1..607f44be 100644 --- a/public/steam/steam_api.h +++ b/public/steam/steam_api.h @@ -36,7 +36,6 @@ #include "isteamhttp.h" #include "isteamcontroller.h" #include "isteamugc.h" -#include "isteamapplist.h" #include "isteamhtmlsurface.h" #include "isteaminventory.h" #include "isteamvideo.h" @@ -55,10 +54,54 @@ // //----------------------------------------------------------------------------------------------------------------------------------------------------------// +enum ESteamAPIInitResult +{ + k_ESteamAPIInitResult_OK = 0, + k_ESteamAPIInitResult_FailedGeneric = 1, // Some other failure + k_ESteamAPIInitResult_NoSteamClient = 2, // We cannot connect to Steam, steam probably isn't running + k_ESteamAPIInitResult_VersionMismatch = 3, // Steam client appears to be out of date +}; + +// Initializing the Steamworks SDK +// ----------------------------- +// +// There are three different methods you can use to initialize the Steamworks SDK, depending on +// your project's environment. You should only use one method in your project. +// +// If you are able to include this C++ header in your project, we recommend using the following +// initialization methods. They will ensure that all ISteam* interfaces defined in other +// C++ header files have versions that are supported by the user's Steam Client: +// - SteamAPI_InitEx() for new projects so you can show a detailed error message to the user +// - SteamAPI_Init() for existing projects that only display a generic error message +// +// If you are unable to include this C++ header in your project and are dynamically loading +// Steamworks SDK methods from dll/so, you can use the following method: +// - SteamAPI_InitFlat() + + +// See "Initializing the Steamworks SDK" above for how to choose an init method. +// On success k_ESteamAPIInitResult_OK is returned. Otherwise, returns a value that can be used +// to create a localized error message for the user. If pOutErrMsg is non-NULL, +// it will receive an example error message, in English, that explains the reason for the failure. +// +// Example usage: +// +// SteamErrMsg errMsg; +// if ( SteamAPI_Init(&errMsg) != k_ESteamAPIInitResult_OK ) +// FatalError( "Failed to init Steam. %s", errMsg ); +inline ESteamAPIInitResult SteamAPI_InitEx( SteamErrMsg *pOutErrMsg ); + +// See "Initializing the Steamworks SDK" above for how to choose an init method. +// Returns true on success +inline bool SteamAPI_Init() +{ + return SteamAPI_InitEx( NULL ) == k_ESteamAPIInitResult_OK; +} -// SteamAPI_Init must be called before using any other API functions. If it fails, an -// error message will be output to the debugger (or stderr) with further information. -S_API bool S_CALLTYPE SteamAPI_Init(); +// See "Initializing the Steamworks SDK" above for how to choose an init method. +// Same usage as SteamAPI_InitEx(), however does not verify ISteam* interfaces are +// supported by the user's client and is exported from the dll +S_API ESteamAPIInitResult S_CALLTYPE SteamAPI_InitFlat( SteamErrMsg *pOutErrMsg ); // SteamAPI_Shutdown should be called during process shutdown if possible. S_API void S_CALLTYPE SteamAPI_Shutdown(); @@ -255,10 +298,6 @@ inline bool CSteamAPIContext::Init() if ( !m_pSteamUGC ) return false; - m_pSteamAppList = ::SteamAppList(); - if ( !m_pSteamAppList ) - return false; - m_pSteamMusic = ::SteamMusic(); if ( !m_pSteamMusic ) return false; @@ -294,4 +333,42 @@ inline bool CSteamAPIContext::Init() #endif +// Internal implementation of SteamAPI_InitEx. This is done in a way that checks +// all of the versions of interfaces from headers being compiled into this code. +S_API ESteamAPIInitResult S_CALLTYPE SteamInternal_SteamAPI_Init( const char *pszInternalCheckInterfaceVersions, SteamErrMsg *pOutErrMsg ); +inline ESteamAPIInitResult SteamAPI_InitEx( SteamErrMsg *pOutErrMsg ) +{ + const char *pszInternalCheckInterfaceVersions = + STEAMUTILS_INTERFACE_VERSION "\0" + STEAMNETWORKINGUTILS_INTERFACE_VERSION "\0" + STEAMAPPS_INTERFACE_VERSION "\0" + STEAMCONTROLLER_INTERFACE_VERSION "\0" + STEAMFRIENDS_INTERFACE_VERSION "\0" + STEAMGAMESEARCH_INTERFACE_VERSION "\0" + STEAMHTMLSURFACE_INTERFACE_VERSION "\0" + STEAMHTTP_INTERFACE_VERSION "\0" + STEAMINPUT_INTERFACE_VERSION "\0" + STEAMINVENTORY_INTERFACE_VERSION "\0" + STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION "\0" + STEAMMATCHMAKING_INTERFACE_VERSION "\0" + STEAMMUSICREMOTE_INTERFACE_VERSION "\0" + STEAMMUSIC_INTERFACE_VERSION "\0" + STEAMNETWORKINGMESSAGES_INTERFACE_VERSION "\0" + STEAMNETWORKINGSOCKETS_INTERFACE_VERSION "\0" + STEAMNETWORKING_INTERFACE_VERSION "\0" + STEAMPARENTALSETTINGS_INTERFACE_VERSION "\0" + STEAMPARTIES_INTERFACE_VERSION "\0" + STEAMREMOTEPLAY_INTERFACE_VERSION "\0" + STEAMREMOTESTORAGE_INTERFACE_VERSION "\0" + STEAMSCREENSHOTS_INTERFACE_VERSION "\0" + STEAMUGC_INTERFACE_VERSION "\0" + STEAMUSERSTATS_INTERFACE_VERSION "\0" + STEAMUSER_INTERFACE_VERSION "\0" + STEAMVIDEO_INTERFACE_VERSION "\0" + + "\0"; + + return SteamInternal_SteamAPI_Init( pszInternalCheckInterfaceVersions, pOutErrMsg ); +} + #endif // STEAM_API_H diff --git a/public/steam/steam_api.json b/public/steam/steam_api.json index c93ba668..5af49b4f 100644 --- a/public/steam/steam_api.json +++ b/public/steam/steam_api.json @@ -125,6 +125,16 @@ ], "struct": "DurationControl_t" }, + { + "callback_id": 168, + "fields": [ + { "fieldname":"m_hAuthTicket", "fieldtype":"HAuthTicket" }, + { "fieldname":"m_eResult", "fieldtype":"EResult" }, + { "fieldname":"m_cubTicket", "fieldtype":"int" }, + { "fieldname":"m_rgubTicket", "fieldtype":"uint8 [2560]" } + ], + "struct": "GetTicketForWebApiResponse_t" + }, { "callback_id": 304, "fields": [ @@ -138,7 +148,8 @@ "fields": [ { "fieldname":"m_bActive", "fieldtype":"uint8" }, { "fieldname":"m_bUserInitiated", "fieldtype":"bool" }, - { "fieldname":"m_nAppID", "fieldtype":"AppId_t" } + { "fieldname":"m_nAppID", "fieldtype":"AppId_t" }, + { "fieldname":"m_dwOverlayPID", "fieldtype":"uint32" } ], "struct": "GameOverlayActivated_t" }, @@ -1201,6 +1212,17 @@ ], "struct": "SteamInputConfigurationLoaded_t" }, + { + "callback_id": 2804, + "fields": [ + { "fieldname":"m_unAppID", "fieldtype":"AppId_t" }, + { "fieldname":"m_ulDeviceHandle", "fieldtype":"InputHandle_t" }, + { "fieldname":"m_eDeviceType", "fieldtype":"ESteamInputType" }, + { "fieldname":"m_nOldGamepadSlot", "fieldtype":"int" }, + { "fieldname":"m_nNewGamepadSlot", "fieldtype":"int" } + ], + "struct": "SteamInputGamepadSlotChange_t" + }, { "callback_id": 3401, "fields": [ @@ -1373,22 +1395,6 @@ ], "struct": "WorkshopEULAStatus_t" }, - { - "callback_id": 3901, - "fields": [ - { "fieldname":"m_nAppID", "fieldtype":"AppId_t" }, - { "fieldname":"m_iInstallFolderIndex", "fieldtype":"int" } - ], - "struct": "SteamAppInstalled_t" - }, - { - "callback_id": 3902, - "fields": [ - { "fieldname":"m_nAppID", "fieldtype":"AppId_t" }, - { "fieldname":"m_iInstallFolderIndex", "fieldtype":"int" } - ], - "struct": "SteamAppUninstalled_t" - }, { "callback_id": 4501, "fields": [ @@ -1691,6 +1697,13 @@ ], "struct": "SteamRemotePlaySessionDisconnected_t" }, + { + "callback_id": 5703, + "fields": [ + { "fieldname":"m_szConnectURL", "fieldtype":"char [1024]" } + ], + "struct": "SteamRemotePlayTogetherGuestInvite_t" + }, { "callback_id": 1251, "fields": [ @@ -1866,16 +1879,20 @@ { "constname":"k_uAppIdInvalid", "consttype":"AppId_t", "constval":"0x0" }, { "constname":"k_uDepotIdInvalid", "consttype":"DepotId_t", "constval":"0x0" }, { "constname":"k_uAPICallInvalid", "consttype":"SteamAPICall_t", "constval":"0x0" }, + { "constname":"k_uAccountIdInvalid", "consttype":"AccountID_t", "constval":"0" }, { "constname":"k_ulPartyBeaconIdInvalid", "consttype":"PartyBeaconID_t", "constval":"0" }, { "constname":"k_HAuthTicketInvalid", "consttype":"HAuthTicket", "constval":"0" }, { "constname":"k_unSteamAccountIDMask", "consttype":"unsigned int", "constval":"0xFFFFFFFF" }, { "constname":"k_unSteamAccountInstanceMask", "consttype":"unsigned int", "constval":"0x000FFFFF" }, { "constname":"k_unSteamUserDefaultInstance", "consttype":"unsigned int", "constval":"1" }, { "constname":"k_cchGameExtraInfoMax", "consttype":"int", "constval":"64" }, + { "constname":"k_cchMaxSteamErrMsg", "consttype":"int", "constval":"1024" }, { "constname":"k_cchMaxFriendsGroupName", "consttype":"int", "constval":"64" }, { "constname":"k_cFriendsGroupLimit", "consttype":"int", "constval":"100" }, { "constname":"k_FriendsGroupID_Invalid", "consttype":"FriendsGroupID_t", "constval":"- 1" }, { "constname":"k_cEnumerateFollowersMax", "consttype":"int", "constval":"50" }, + { "constname":"k_usFriendGameInfoQueryPort_NotInitialized", "consttype":"uint16", "constval":"0xFFFF" }, + { "constname":"k_usFriendGameInfoQueryPort_Error", "consttype":"uint16", "constval":"0xFFFE" }, { "constname":"k_cubChatMetadataMax", "consttype":"uint32", "constval":"8192" }, { "constname":"k_cbMaxGameServerGameDir", "consttype":"int", "constval":"32" }, { "constname":"k_cbMaxGameServerMapName", "consttype":"int", "constval":"32" }, @@ -1913,6 +1930,7 @@ { "constname":"k_SteamItemInstanceIDInvalid", "consttype":"SteamItemInstanceID_t", "constval":"( SteamItemInstanceID_t ) ~ 0" }, { "constname":"k_SteamInventoryResultInvalid", "consttype":"SteamInventoryResult_t", "constval":"- 1" }, { "constname":"k_SteamInventoryUpdateHandleInvalid", "consttype":"SteamInventoryUpdateHandle_t", "constval":"0xffffffffffffffffull" }, + { "constname":"k_nMaxTimelineRangeIDLength", "consttype":"int", "constval":"64" }, { "constname":"k_HSteamNetConnection_Invalid", "consttype":"HSteamNetConnection", "constval":"0" }, { "constname":"k_HSteamListenSocket_Invalid", "consttype":"HSteamListenSocket", "constval":"0" }, { "constname":"k_HSteamNetPollGroup_Invalid", "consttype":"HSteamNetPollGroup", "constval":"0" }, @@ -2102,7 +2120,9 @@ { "name":"k_EResultInsufficientBattery", "value":"124" }, { "name":"k_EResultChargerRequired", "value":"125" }, { "name":"k_EResultCachedCredentialInvalid", "value":"126" }, - { "name":"K_EResultPhoneNumberIsVOIP", "value":"127" } + { "name":"K_EResultPhoneNumberIsVOIP", "value":"127" }, + { "name":"k_EResultNotSupported", "value":"128" }, + { "name":"k_EResultFamilySizeLimitExceeded", "value":"129" } ] }, { @@ -2651,7 +2671,8 @@ { "name":"k_EWorkshopFileTypeSteamworksAccessInvite", "value":"13" }, { "name":"k_EWorkshopFileTypeSteamVideo", "value":"14" }, { "name":"k_EWorkshopFileTypeGameManagedItem", "value":"15" }, - { "name":"k_EWorkshopFileTypeMax", "value":"16" } + { "name":"k_EWorkshopFileTypeClip", "value":"16" }, + { "name":"k_EWorkshopFileTypeMax", "value":"17" } ] }, { @@ -3922,7 +3943,8 @@ { "name":"k_EItemStateInstalled", "value":"4" }, { "name":"k_EItemStateNeedsUpdate", "value":"8" }, { "name":"k_EItemStateDownloading", "value":"16" }, - { "name":"k_EItemStateDownloadPending", "value":"32" } + { "name":"k_EItemStateDownloadPending", "value":"32" }, + { "name":"k_EItemStateDisabledLocally", "value":"64" } ] }, { @@ -3951,6 +3973,7 @@ { "name":"k_EItemPreviewType_Sketchfab", "value":"2" }, { "name":"k_EItemPreviewType_EnvironmentMap_HorizontalCross", "value":"3" }, { "name":"k_EItemPreviewType_EnvironmentMap_LatLong", "value":"4" }, + { "name":"k_EItemPreviewType_Clip", "value":"5" }, { "name":"k_EItemPreviewType_ReservedMax", "value":"255" } ] }, @@ -3972,6 +3995,17 @@ { "name":"k_ESteamItemConsumed", "value":"512" } ] }, + { + "enumname": "ETimelineGameMode", + "values": [ + { "name":"k_ETimelineGameMode_Invalid", "value":"0" }, + { "name":"k_ETimelineGameMode_Playing", "value":"1" }, + { "name":"k_ETimelineGameMode_Staging", "value":"2" }, + { "name":"k_ETimelineGameMode_Menus", "value":"3" }, + { "name":"k_ETimelineGameMode_LoadingScreen", "value":"4" }, + { "name":"k_ETimelineGameMode_Max", "value":"5" } + ] + }, { "enumname": "EParentalFeature", "values": [ @@ -3989,7 +4023,7 @@ { "name":"k_EFeatureLibrary", "value":"11" }, { "name":"k_EFeatureTest", "value":"12" }, { "name":"k_EFeatureSiteLicense", "value":"13" }, - { "name":"k_EFeatureKioskMode", "value":"14" }, + { "name":"k_EFeatureKioskMode_Deprecated", "value":"14" }, { "name":"k_EFeatureMax", "value":"15" } ] }, @@ -4000,7 +4034,8 @@ { "name":"k_ESteamDeviceFormFactorPhone", "value":"1" }, { "name":"k_ESteamDeviceFormFactorTablet", "value":"2" }, { "name":"k_ESteamDeviceFormFactorComputer", "value":"3" }, - { "name":"k_ESteamDeviceFormFactorTV", "value":"4" } + { "name":"k_ESteamDeviceFormFactorTV", "value":"4" }, + { "name":"k_ESteamDeviceFormFactorVRHeadset", "value":"5" } ] }, { @@ -4124,6 +4159,10 @@ { "name":"k_ESteamNetworkingConfig_TimeoutInitial", "value":"24" }, { "name":"k_ESteamNetworkingConfig_TimeoutConnected", "value":"25" }, { "name":"k_ESteamNetworkingConfig_SendBufferSize", "value":"9" }, + { "name":"k_ESteamNetworkingConfig_RecvBufferSize", "value":"47" }, + { "name":"k_ESteamNetworkingConfig_RecvBufferMessages", "value":"48" }, + { "name":"k_ESteamNetworkingConfig_RecvMaxMessageSize", "value":"49" }, + { "name":"k_ESteamNetworkingConfig_RecvMaxSegmentsPerPacket", "value":"50" }, { "name":"k_ESteamNetworkingConfig_ConnectionUserData", "value":"40" }, { "name":"k_ESteamNetworkingConfig_SendRateMin", "value":"10" }, { "name":"k_ESteamNetworkingConfig_SendRateMax", "value":"11" }, @@ -4151,6 +4190,7 @@ { "name":"k_ESteamNetworkingConfig_FakeRateLimit_Send_Burst", "value":"43" }, { "name":"k_ESteamNetworkingConfig_FakeRateLimit_Recv_Rate", "value":"44" }, { "name":"k_ESteamNetworkingConfig_FakeRateLimit_Recv_Burst", "value":"45" }, + { "name":"k_ESteamNetworkingConfig_OutOfOrderCorrectionWindowMicroseconds", "value":"51" }, { "name":"k_ESteamNetworkingConfig_Callback_ConnectionStatusChanged", "value":"201" }, { "name":"k_ESteamNetworkingConfig_Callback_AuthStatusChanged", "value":"202" }, { "name":"k_ESteamNetworkingConfig_Callback_RelayNetworkStatusChanged", "value":"203" }, @@ -4171,15 +4211,17 @@ { "name":"k_ESteamNetworkingConfig_SDRClient_MinPingsBeforePingAccurate", "value":"21" }, { "name":"k_ESteamNetworkingConfig_SDRClient_SingleSocket", "value":"22" }, { "name":"k_ESteamNetworkingConfig_SDRClient_ForceRelayCluster", "value":"29" }, - { "name":"k_ESteamNetworkingConfig_SDRClient_DebugTicketAddress", "value":"30" }, + { "name":"k_ESteamNetworkingConfig_SDRClient_DevTicket", "value":"30" }, { "name":"k_ESteamNetworkingConfig_SDRClient_ForceProxyAddr", "value":"31" }, { "name":"k_ESteamNetworkingConfig_SDRClient_FakeClusterPing", "value":"36" }, + { "name":"k_ESteamNetworkingConfig_SDRClient_LimitPingProbesToNearestN", "value":"60" }, { "name":"k_ESteamNetworkingConfig_LogLevel_AckRTT", "value":"13" }, { "name":"k_ESteamNetworkingConfig_LogLevel_PacketDecode", "value":"14" }, { "name":"k_ESteamNetworkingConfig_LogLevel_Message", "value":"15" }, { "name":"k_ESteamNetworkingConfig_LogLevel_PacketGaps", "value":"16" }, { "name":"k_ESteamNetworkingConfig_LogLevel_P2PRendezvous", "value":"17" }, { "name":"k_ESteamNetworkingConfig_LogLevel_SDRRelayPings", "value":"18" }, + { "name":"k_ESteamNetworkingConfig_ECN", "value":"999" }, { "name":"k_ESteamNetworkingConfig_DELETED_EnumerateDevVars", "value":"35" }, { "name":"k_ESteamNetworkingConfigValue__Force32Bit", "value":"2147483647" } ] @@ -4210,6 +4252,15 @@ { "name":"k_ESteamNetworkingSocketsDebugOutputType__Force32Bit", "value":"2147483647" } ] }, + { + "enumname": "ESteamAPIInitResult", + "values": [ + { "name":"k_ESteamAPIInitResult_OK", "value":"0" }, + { "name":"k_ESteamAPIInitResult_FailedGeneric", "value":"1" }, + { "name":"k_ESteamAPIInitResult_NoSteamClient", "value":"2" }, + { "name":"k_ESteamAPIInitResult_VersionMismatch", "value":"3" } + ] + }, { "enumname": "EServerMode", "values": [ @@ -4463,16 +4514,6 @@ ], "returntype": "ISteamUGC *" }, - { - "methodname": "GetISteamAppList", - "methodname_flat": "SteamAPI_ISteamClient_GetISteamAppList", - "params": [ - { "paramname":"hSteamUser", "paramtype":"HSteamUser" }, - { "paramname":"hSteamPipe", "paramtype":"HSteamPipe" }, - { "paramname":"pchVersion", "paramtype":"const char *" } - ], - "returntype": "ISteamAppList *" - }, { "methodname": "GetISteamMusic", "methodname_flat": "SteamAPI_ISteamClient_GetISteamMusic", @@ -4513,16 +4554,6 @@ ], "returntype": "ISteamInventory *" }, - { - "methodname": "GetISteamVideo", - "methodname_flat": "SteamAPI_ISteamClient_GetISteamVideo", - "params": [ - { "paramname":"hSteamuser", "paramtype":"HSteamUser" }, - { "paramname":"hSteamPipe", "paramtype":"HSteamPipe" }, - { "paramname":"pchVersion", "paramtype":"const char *" } - ], - "returntype": "ISteamVideo *" - }, { "methodname": "GetISteamParentalSettings", "methodname_flat": "SteamAPI_ISteamClient_GetISteamParentalSettings", @@ -4570,7 +4601,7 @@ { "kind": "user", "name": "SteamUser", - "name_flat": "SteamAPI_SteamUser_v022" + "name_flat": "SteamAPI_SteamUser_v023" } ], "classname": "ISteamUser", @@ -4704,6 +4735,14 @@ ], "returntype": "HAuthTicket" }, + { + "methodname": "GetAuthTicketForWebApi", + "methodname_flat": "SteamAPI_ISteamUser_GetAuthTicketForWebApi", + "params": [ + { "paramname":"pchIdentity", "paramtype":"const char *" } + ], + "returntype": "HAuthTicket" + }, { "methodname": "BeginAuthSession", "methodname_flat": "SteamAPI_ISteamUser_BeginAuthSession", @@ -4846,7 +4885,7 @@ "returntype": "bool" } ], - "version_string": "SteamUser022" + "version_string": "SteamUser023" }, { "accessors": [ @@ -5846,6 +5885,12 @@ "methodname_flat": "SteamAPI_ISteamUtils_DismissFloatingGamepadTextInput", "params": [], "returntype": "bool" + }, + { + "methodname": "DismissGamepadTextInput", + "methodname_flat": "SteamAPI_ISteamUtils_DismissGamepadTextInput", + "params": [], + "returntype": "bool" } ], "version_string": "SteamUtils010" @@ -9036,7 +9081,7 @@ "returntype": "void" }, { - "callback": "SteamInputDeviceDisconnected_t", + "callback": "SteamInputGamepadSlotChange_t", "methodname": "EnableActionEventCallbacks", "methodname_flat": "SteamAPI_ISteamInput_EnableActionEventCallbacks", "params": [ @@ -9750,12 +9795,12 @@ { "kind": "user", "name": "SteamUGC", - "name_flat": "SteamAPI_SteamUGC_v017" + "name_flat": "SteamAPI_SteamUGC_v018" }, { "kind": "gameserver", "name": "SteamGameServerUGC", - "name_flat": "SteamAPI_SteamGameServerUGC_v017" + "name_flat": "SteamAPI_SteamGameServerUGC_v018" } ], "classname": "ISteamUGC", @@ -10280,7 +10325,8 @@ "methodname_flat": "SteamAPI_ISteamUGC_SetItemTags", "params": [ { "paramname":"updateHandle", "paramtype":"UGCUpdateHandle_t" }, - { "paramname":"pTags", "paramtype":"const SteamParamStringArray_t *" } + { "paramname":"pTags", "paramtype":"const SteamParamStringArray_t *" }, + { "paramname":"bAllowAdminTags", "paramtype":"bool" } ], "returntype": "bool" }, @@ -10653,70 +10699,18 @@ "methodname_flat": "SteamAPI_ISteamUGC_GetWorkshopEULAStatus", "params": [], "returntype": "SteamAPICall_t" - } - ], - "version_string": "STEAMUGC_INTERFACE_VERSION017" - }, - { - "accessors": [ - { - "kind": "user", - "name": "SteamAppList", - "name_flat": "SteamAPI_SteamAppList_v001" - } - ], - "classname": "ISteamAppList", - "fields": [], - "methods": [ - { - "methodname": "GetNumInstalledApps", - "methodname_flat": "SteamAPI_ISteamAppList_GetNumInstalledApps", - "params": [], - "returntype": "uint32" }, { - "methodname": "GetInstalledApps", - "methodname_flat": "SteamAPI_ISteamAppList_GetInstalledApps", + "methodname": "GetUserContentDescriptorPreferences", + "methodname_flat": "SteamAPI_ISteamUGC_GetUserContentDescriptorPreferences", "params": [ - { "paramname":"pvecAppID", "paramtype":"AppId_t *" }, - { "paramname":"unMaxAppIDs", "paramtype":"uint32" } + { "paramname":"pvecDescriptors", "paramtype":"EUGCContentDescriptorID *" }, + { "paramname":"cMaxEntries", "paramtype":"uint32" } ], "returntype": "uint32" - }, - { - "methodname": "GetAppName", - "methodname_flat": "SteamAPI_ISteamAppList_GetAppName", - "params": [ - { "paramname":"nAppID", "paramtype":"AppId_t" }, - { - "out_string": "", - "paramname": "pchName", - "paramtype": "char *" - }, - { "paramname":"cchNameMax", "paramtype":"int" } - ], - "returntype": "int" - }, - { - "methodname": "GetAppInstallDir", - "methodname_flat": "SteamAPI_ISteamAppList_GetAppInstallDir", - "params": [ - { "paramname":"nAppID", "paramtype":"AppId_t" }, - { "paramname":"pchDirectory", "paramtype":"char *" }, - { "paramname":"cchNameMax", "paramtype":"int" } - ], - "returntype": "int" - }, - { - "methodname": "GetAppBuildId", - "methodname_flat": "SteamAPI_ISteamAppList_GetAppBuildId", - "params": [ - { "paramname":"nAppID", "paramtype":"AppId_t" } - ], - "returntype": "int" } ], - "version_string": "STEAMAPPLIST_INTERFACE_VERSION001" + "version_string": "STEAMUGC_INTERFACE_VERSION018" }, { "accessors": [ @@ -11634,55 +11628,6 @@ ], "version_string": "STEAMINVENTORY_INTERFACE_V003" }, - { - "accessors": [ - { - "kind": "user", - "name": "SteamVideo", - "name_flat": "SteamAPI_SteamVideo_v002" - } - ], - "classname": "ISteamVideo", - "fields": [], - "methods": [ - { - "methodname": "GetVideoURL", - "methodname_flat": "SteamAPI_ISteamVideo_GetVideoURL", - "params": [ - { "paramname":"unVideoAppID", "paramtype":"AppId_t" } - ], - "returntype": "void" - }, - { - "methodname": "IsBroadcasting", - "methodname_flat": "SteamAPI_ISteamVideo_IsBroadcasting", - "params": [ - { "paramname":"pnNumViewers", "paramtype":"int *" } - ], - "returntype": "bool" - }, - { - "callback": "GetOPFSettingsResult_t", - "methodname": "GetOPFSettings", - "methodname_flat": "SteamAPI_ISteamVideo_GetOPFSettings", - "params": [ - { "paramname":"unVideoAppID", "paramtype":"AppId_t" } - ], - "returntype": "void" - }, - { - "methodname": "GetOPFStringForApp", - "methodname_flat": "SteamAPI_ISteamVideo_GetOPFStringForApp", - "params": [ - { "paramname":"unVideoAppID", "paramtype":"AppId_t" }, - { "paramname":"pchBuffer", "paramtype":"char *" }, - { "paramname":"pnBufferSize", "paramtype":"int32 *" } - ], - "returntype": "bool" - } - ], - "version_string": "STEAMVIDEO_INTERFACE_V002" - }, { "accessors": [ { @@ -11746,7 +11691,7 @@ { "kind": "user", "name": "SteamRemotePlay", - "name_flat": "SteamAPI_SteamRemotePlay_v001" + "name_flat": "SteamAPI_SteamRemotePlay_v002" } ], "classname": "ISteamRemotePlay", @@ -11801,6 +11746,14 @@ ], "returntype": "bool" }, + { + "methodname": "BStartRemotePlayTogether", + "methodname_flat": "SteamAPI_ISteamRemotePlay_BStartRemotePlayTogether", + "params": [ + { "paramname":"bShowOverlay", "paramtype":"bool" } + ], + "returntype": "bool" + }, { "methodname": "BSendRemotePlayTogetherInvite", "methodname_flat": "SteamAPI_ISteamRemotePlay_BSendRemotePlayTogetherInvite", @@ -11810,7 +11763,7 @@ "returntype": "bool" } ], - "version_string": "STEAMREMOTEPLAY_INTERFACE_VERSION001" + "version_string": "STEAMREMOTEPLAY_INTERFACE_VERSION002" }, { "accessors": [ @@ -13476,29 +13429,6 @@ ], "struct": "InputMotionData_t" }, - { - "fields": [ - { "fieldname":"driftCorrectedQuatX", "fieldtype":"float" }, - { "fieldname":"driftCorrectedQuatY", "fieldtype":"float" }, - { "fieldname":"driftCorrectedQuatZ", "fieldtype":"float" }, - { "fieldname":"driftCorrectedQuatW", "fieldtype":"float" }, - { "fieldname":"sensorFusionQuatX", "fieldtype":"float" }, - { "fieldname":"sensorFusionQuatY", "fieldtype":"float" }, - { "fieldname":"sensorFusionQuatZ", "fieldtype":"float" }, - { "fieldname":"sensorFusionQuatW", "fieldtype":"float" }, - { "fieldname":"deferredSensorFusionQuatX", "fieldtype":"float" }, - { "fieldname":"deferredSensorFusionQuatY", "fieldtype":"float" }, - { "fieldname":"deferredSensorFusionQuatZ", "fieldtype":"float" }, - { "fieldname":"deferredSensorFusionQuatW", "fieldtype":"float" }, - { "fieldname":"gravityX", "fieldtype":"float" }, - { "fieldname":"gravityY", "fieldtype":"float" }, - { "fieldname":"gravityZ", "fieldtype":"float" }, - { "fieldname":"degreesPerSecondX", "fieldtype":"float" }, - { "fieldname":"degreesPerSecondY", "fieldtype":"float" }, - { "fieldname":"degreesPerSecondZ", "fieldtype":"float" } - ], - "struct": "InputMotionDataV2_t" - }, { "fields": [ { "fieldname":"controllerHandle", "fieldtype":"InputHandle_t" }, @@ -14063,6 +13993,7 @@ { "typedef":"PFNPreMinidumpCallback", "type":"void (*)(void *)" }, { "typedef":"HSteamPipe", "type":"int" }, { "typedef":"HSteamUser", "type":"int" }, + { "typedef":"SteamErrMsg", "type":"char [1024]" }, { "typedef":"FriendsGroupID_t", "type":"short" }, { "typedef":"HServerListRequest", "type":"void *" }, { "typedef":"HServerQuery", "type":"int" }, diff --git a/public/steam/steam_api_common.h b/public/steam/steam_api_common.h index f8e80d1a..f71a39cb 100644 --- a/public/steam/steam_api_common.h +++ b/public/steam/steam_api_common.h @@ -36,6 +36,12 @@ #endif // STEAM_API_EXPORTS #endif +#if defined( __cplusplus ) && ( __cplusplus >= 201103L ) + #define S_OVERRIDE override +#else + #define S_OVERRIDE +#endif + #if ( defined(STEAM_API_EXPORTS) || defined(STEAM_API_NODLL) ) && !defined(API_GEN) #define STEAM_PRIVATE_API( ... ) __VA_ARGS__ #elif defined(STEAM_API_EXPORTS) && defined(API_GEN) @@ -49,6 +55,11 @@ typedef int32 HSteamPipe; // handle to single instance of a steam user typedef int32 HSteamUser; +// A fixed size buffer to receive an error message that is returned by some API +// calls. +const int k_cchMaxSteamErrMsg = 1024; +typedef char SteamErrMsg[ k_cchMaxSteamErrMsg ]; + // #define away __cdecl on posix. // This is really, really bad. We're sorry. But it's been this way for // a long time now and it's scary to change it, as there may be others that @@ -157,9 +168,9 @@ class CCallbackImpl : protected CCallbackBase protected: friend class CCallbackMgr; - virtual void Run( void *pvParam ) = 0; - virtual void Run( void *pvParam, bool /*bIOFailure*/, SteamAPICall_t /*hSteamAPICall*/ ) { Run( pvParam ); } - virtual int GetCallbackSizeBytes() { return sizeof_P; } + virtual void Run( void *pvParam ) S_OVERRIDE = 0; + virtual void Run( void *pvParam, bool /*bIOFailure*/, SteamAPICall_t /*hSteamAPICall*/ ) S_OVERRIDE { Run( pvParam ); } + virtual int GetCallbackSizeBytes() S_OVERRIDE { return sizeof_P; } }; @@ -182,9 +193,9 @@ class CCallResult : private CCallbackBase void SetGameserverFlag() { m_nCallbackFlags |= k_ECallbackFlagsGameServer; } private: - virtual void Run( void *pvParam ); - virtual void Run( void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall ); - virtual int GetCallbackSizeBytes() { return sizeof( P ); } + virtual void Run( void *pvParam ) S_OVERRIDE; + virtual void Run( void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall ) S_OVERRIDE; + virtual int GetCallbackSizeBytes() S_OVERRIDE { return sizeof( P ); } SteamAPICall_t m_hAPICall; T *m_pObj; @@ -212,7 +223,7 @@ class CCallback : public CCallbackImpl< sizeof( P ) > void Unregister(); protected: - virtual void Run( void *pvParam ); + virtual void Run( void *pvParam ) S_OVERRIDE; T *m_pObj; func_t m_Func; diff --git a/public/steam/steam_api_flat.h b/public/steam/steam_api_flat.h index 9e851799..95c62ad4 100644 --- a/public/steam/steam_api_flat.h +++ b/public/steam/steam_api_flat.h @@ -44,7 +44,6 @@ S_API bool SteamAPI_ISteamClient_BShutdownIfAllPipesClosed( ISteamClient* self ) S_API ISteamHTTP * SteamAPI_ISteamClient_GetISteamHTTP( ISteamClient* self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion ); S_API ISteamController * SteamAPI_ISteamClient_GetISteamController( ISteamClient* self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion ); S_API ISteamUGC * SteamAPI_ISteamClient_GetISteamUGC( ISteamClient* self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion ); -S_API ISteamAppList * SteamAPI_ISteamClient_GetISteamAppList( ISteamClient* self, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion ); S_API ISteamMusic * SteamAPI_ISteamClient_GetISteamMusic( ISteamClient* self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion ); S_API ISteamMusicRemote * SteamAPI_ISteamClient_GetISteamMusicRemote( ISteamClient* self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion ); S_API ISteamHTMLSurface * SteamAPI_ISteamClient_GetISteamHTMLSurface( ISteamClient* self, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion ); @@ -58,9 +57,9 @@ S_API ISteamRemotePlay * SteamAPI_ISteamClient_GetISteamRemotePlay( ISteamClient // ISteamUser // A versioned accessor is exported by the library -S_API ISteamUser *SteamAPI_SteamUser_v022(); +S_API ISteamUser *SteamAPI_SteamUser_v023(); // Inline, unversioned accessor to get the current version. Essentially the same as SteamUser(), but using this ensures that you are using a matching library. -inline ISteamUser *SteamAPI_SteamUser() { return SteamAPI_SteamUser_v022(); } +inline ISteamUser *SteamAPI_SteamUser() { return SteamAPI_SteamUser_v023(); } S_API HSteamUser SteamAPI_ISteamUser_GetHSteamUser( ISteamUser* self ); S_API bool SteamAPI_ISteamUser_BLoggedOn( ISteamUser* self ); S_API uint64_steamid SteamAPI_ISteamUser_GetSteamID( ISteamUser* self ); @@ -75,6 +74,7 @@ S_API EVoiceResult SteamAPI_ISteamUser_GetVoice( ISteamUser* self, bool bWantCom S_API EVoiceResult SteamAPI_ISteamUser_DecompressVoice( ISteamUser* self, const void * pCompressed, uint32 cbCompressed, void * pDestBuffer, uint32 cbDestBufferSize, uint32 * nBytesWritten, uint32 nDesiredSampleRate ); S_API uint32 SteamAPI_ISteamUser_GetVoiceOptimalSampleRate( ISteamUser* self ); S_API HAuthTicket SteamAPI_ISteamUser_GetAuthSessionTicket( ISteamUser* self, void * pTicket, int cbMaxTicket, uint32 * pcbTicket, const SteamNetworkingIdentity * pSteamNetworkingIdentity ); +S_API HAuthTicket SteamAPI_ISteamUser_GetAuthTicketForWebApi( ISteamUser* self, const char * pchIdentity ); S_API EBeginAuthSessionResult SteamAPI_ISteamUser_BeginAuthSession( ISteamUser* self, const void * pAuthTicket, int cbAuthTicket, uint64_steamid steamID ); S_API void SteamAPI_ISteamUser_EndAuthSession( ISteamUser* self, uint64_steamid steamID ); S_API void SteamAPI_ISteamUser_CancelAuthTicket( ISteamUser* self, HAuthTicket hAuthTicket ); @@ -228,6 +228,7 @@ S_API bool SteamAPI_ISteamUtils_IsSteamRunningOnSteamDeck( ISteamUtils* self ); S_API bool SteamAPI_ISteamUtils_ShowFloatingGamepadTextInput( ISteamUtils* self, EFloatingGamepadTextInputMode eKeyboardMode, int nTextFieldXPosition, int nTextFieldYPosition, int nTextFieldWidth, int nTextFieldHeight ); S_API void SteamAPI_ISteamUtils_SetGameLauncherMode( ISteamUtils* self, bool bLauncherMode ); S_API bool SteamAPI_ISteamUtils_DismissFloatingGamepadTextInput( ISteamUtils* self ); +S_API bool SteamAPI_ISteamUtils_DismissGamepadTextInput( ISteamUtils* self ); // ISteamMatchmaking @@ -753,14 +754,14 @@ S_API bool SteamAPI_ISteamController_GetControllerBindingRevision( ISteamControl // ISteamUGC // A versioned accessor is exported by the library -S_API ISteamUGC *SteamAPI_SteamUGC_v017(); +S_API ISteamUGC *SteamAPI_SteamUGC_v018(); // Inline, unversioned accessor to get the current version. Essentially the same as SteamUGC(), but using this ensures that you are using a matching library. -inline ISteamUGC *SteamAPI_SteamUGC() { return SteamAPI_SteamUGC_v017(); } +inline ISteamUGC *SteamAPI_SteamUGC() { return SteamAPI_SteamUGC_v018(); } // A versioned accessor is exported by the library -S_API ISteamUGC *SteamAPI_SteamGameServerUGC_v017(); +S_API ISteamUGC *SteamAPI_SteamGameServerUGC_v018(); // Inline, unversioned accessor to get the current version. Essentially the same as SteamGameServerUGC(), but using this ensures that you are using a matching library. -inline ISteamUGC *SteamAPI_SteamGameServerUGC() { return SteamAPI_SteamGameServerUGC_v017(); } +inline ISteamUGC *SteamAPI_SteamGameServerUGC() { return SteamAPI_SteamGameServerUGC_v018(); } S_API UGCQueryHandle_t SteamAPI_ISteamUGC_CreateQueryUserUGCRequest( ISteamUGC* self, AccountID_t unAccountID, EUserUGCList eListType, EUGCMatchingUGCType eMatchingUGCType, EUserUGCListSortOrder eSortOrder, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage ); S_API UGCQueryHandle_t SteamAPI_ISteamUGC_CreateQueryAllUGCRequestPage( ISteamUGC* self, EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage ); S_API UGCQueryHandle_t SteamAPI_ISteamUGC_CreateQueryAllUGCRequestCursor( ISteamUGC* self, EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, const char * pchCursor ); @@ -809,7 +810,7 @@ S_API bool SteamAPI_ISteamUGC_SetItemDescription( ISteamUGC* self, UGCUpdateHand S_API bool SteamAPI_ISteamUGC_SetItemUpdateLanguage( ISteamUGC* self, UGCUpdateHandle_t handle, const char * pchLanguage ); S_API bool SteamAPI_ISteamUGC_SetItemMetadata( ISteamUGC* self, UGCUpdateHandle_t handle, const char * pchMetaData ); S_API bool SteamAPI_ISteamUGC_SetItemVisibility( ISteamUGC* self, UGCUpdateHandle_t handle, ERemoteStoragePublishedFileVisibility eVisibility ); -S_API bool SteamAPI_ISteamUGC_SetItemTags( ISteamUGC* self, UGCUpdateHandle_t updateHandle, const SteamParamStringArray_t * pTags ); +S_API bool SteamAPI_ISteamUGC_SetItemTags( ISteamUGC* self, UGCUpdateHandle_t updateHandle, const SteamParamStringArray_t * pTags, bool bAllowAdminTags ); S_API bool SteamAPI_ISteamUGC_SetItemContent( ISteamUGC* self, UGCUpdateHandle_t handle, const char * pszContentFolder ); S_API bool SteamAPI_ISteamUGC_SetItemPreview( ISteamUGC* self, UGCUpdateHandle_t handle, const char * pszPreviewFile ); S_API bool SteamAPI_ISteamUGC_SetAllowLegacyUpload( ISteamUGC* self, UGCUpdateHandle_t handle, bool bAllowLegacyUpload ); @@ -850,18 +851,7 @@ S_API SteamAPICall_t SteamAPI_ISteamUGC_GetAppDependencies( ISteamUGC* self, Pub S_API SteamAPICall_t SteamAPI_ISteamUGC_DeleteItem( ISteamUGC* self, PublishedFileId_t nPublishedFileID ); S_API bool SteamAPI_ISteamUGC_ShowWorkshopEULA( ISteamUGC* self ); S_API SteamAPICall_t SteamAPI_ISteamUGC_GetWorkshopEULAStatus( ISteamUGC* self ); - -// ISteamAppList - -// A versioned accessor is exported by the library -S_API ISteamAppList *SteamAPI_SteamAppList_v001(); -// Inline, unversioned accessor to get the current version. Essentially the same as SteamAppList(), but using this ensures that you are using a matching library. -inline ISteamAppList *SteamAPI_SteamAppList() { return SteamAPI_SteamAppList_v001(); } -S_API uint32 SteamAPI_ISteamAppList_GetNumInstalledApps( ISteamAppList* self ); -S_API uint32 SteamAPI_ISteamAppList_GetInstalledApps( ISteamAppList* self, AppId_t * pvecAppID, uint32 unMaxAppIDs ); -S_API int SteamAPI_ISteamAppList_GetAppName( ISteamAppList* self, AppId_t nAppID, char * pchName, int cchNameMax ); -S_API int SteamAPI_ISteamAppList_GetAppInstallDir( ISteamAppList* self, AppId_t nAppID, char * pchDirectory, int cchNameMax ); -S_API int SteamAPI_ISteamAppList_GetAppBuildId( ISteamAppList* self, AppId_t nAppID ); +S_API uint32 SteamAPI_ISteamUGC_GetUserContentDescriptorPreferences( ISteamUGC* self, EUGCContentDescriptorID * pvecDescriptors, uint32 cMaxEntries ); // ISteamHTMLSurface @@ -984,15 +974,16 @@ S_API bool SteamAPI_ISteamParentalSettings_BIsFeatureInBlockList( ISteamParental // ISteamRemotePlay // A versioned accessor is exported by the library -S_API ISteamRemotePlay *SteamAPI_SteamRemotePlay_v001(); +S_API ISteamRemotePlay *SteamAPI_SteamRemotePlay_v002(); // Inline, unversioned accessor to get the current version. Essentially the same as SteamRemotePlay(), but using this ensures that you are using a matching library. -inline ISteamRemotePlay *SteamAPI_SteamRemotePlay() { return SteamAPI_SteamRemotePlay_v001(); } +inline ISteamRemotePlay *SteamAPI_SteamRemotePlay() { return SteamAPI_SteamRemotePlay_v002(); } S_API uint32 SteamAPI_ISteamRemotePlay_GetSessionCount( ISteamRemotePlay* self ); S_API RemotePlaySessionID_t SteamAPI_ISteamRemotePlay_GetSessionID( ISteamRemotePlay* self, int iSessionIndex ); S_API uint64_steamid SteamAPI_ISteamRemotePlay_GetSessionSteamID( ISteamRemotePlay* self, RemotePlaySessionID_t unSessionID ); S_API const char * SteamAPI_ISteamRemotePlay_GetSessionClientName( ISteamRemotePlay* self, RemotePlaySessionID_t unSessionID ); S_API ESteamDeviceFormFactor SteamAPI_ISteamRemotePlay_GetSessionClientFormFactor( ISteamRemotePlay* self, RemotePlaySessionID_t unSessionID ); S_API bool SteamAPI_ISteamRemotePlay_BGetSessionClientResolution( ISteamRemotePlay* self, RemotePlaySessionID_t unSessionID, int * pnResolutionX, int * pnResolutionY ); +S_API bool SteamAPI_ISteamRemotePlay_BStartRemotePlayTogether( ISteamRemotePlay* self, bool bShowOverlay ); S_API bool SteamAPI_ISteamRemotePlay_BSendRemotePlayTogetherInvite( ISteamRemotePlay* self, uint64_steamid steamIDFriend ); // ISteamNetworkingMessages diff --git a/public/steam/steam_api_internal.h b/public/steam/steam_api_internal.h index 86defb10..d7090bf5 100644 --- a/public/steam/steam_api_internal.h +++ b/public/steam/steam_api_internal.h @@ -54,6 +54,7 @@ S_API void S_CALLTYPE SteamAPI_UnregisterCallback( class CCallbackBase *pCallbac S_API void S_CALLTYPE SteamAPI_RegisterCallResult( class CCallbackBase *pCallback, SteamAPICall_t hAPICall ); S_API void S_CALLTYPE SteamAPI_UnregisterCallResult( class CCallbackBase *pCallback, SteamAPICall_t hAPICall ); +#define _STEAM_CALLBACK_OFFSETOF( type, member ) ( (size_t)( (char *)&( (type *)0 )->member ) ) #define _STEAM_CALLBACK_AUTO_HOOK( thisclass, func, param ) #define _STEAM_CALLBACK_HELPER( _1, _2, SELECTED, ... ) _STEAM_CALLBACK_##SELECTED #define _STEAM_CALLBACK_SELECT( X, Y ) _STEAM_CALLBACK_HELPER X Y @@ -62,8 +63,8 @@ S_API void S_CALLTYPE SteamAPI_UnregisterCallResult( class CCallbackBase *pCallb CCallbackInternal_ ## func () { extra_code SteamAPI_RegisterCallback( this, param::k_iCallback ); } \ CCallbackInternal_ ## func ( const CCallbackInternal_ ## func & ) { extra_code SteamAPI_RegisterCallback( this, param::k_iCallback ); } \ CCallbackInternal_ ## func & operator=( const CCallbackInternal_ ## func & ) { return *this; } \ - private: virtual void Run( void *pvParam ) { _STEAM_CALLBACK_AUTO_HOOK( thisclass, func, param ) \ - thisclass *pOuter = reinterpret_cast( reinterpret_cast(this) - offsetof( thisclass, m_steamcallback_ ## func ) ); \ + private: virtual void Run( void *pvParam ) S_OVERRIDE { _STEAM_CALLBACK_AUTO_HOOK( thisclass, func, param ) \ + thisclass *pOuter = reinterpret_cast( reinterpret_cast(this) - _STEAM_CALLBACK_OFFSETOF( thisclass, m_steamcallback_ ## func ) ); \ pOuter->func( reinterpret_cast( pvParam ) ); \ } \ } m_steamcallback_ ## func ; void func( param *pParam ) @@ -228,7 +229,6 @@ class ISteamPS3OverlayRender; class ISteamHTTP; class ISteamController; class ISteamUGC; -class ISteamAppList; class ISteamHTMLSurface; class ISteamInventory; class ISteamVideo; @@ -271,7 +271,6 @@ enum { k_iSteamStreamLauncherCallbacks = 2600 }; enum { k_iSteamControllerCallbacks = 2800 }; enum { k_iSteamUGCCallbacks = 3400 }; enum { k_iSteamStreamClientCallbacks = 3500 }; -enum { k_iSteamAppListCallbacks = 3900 }; enum { k_iSteamMusicCallbacks = 4000 }; enum { k_iSteamMusicRemoteCallbacks = 4100 }; enum { k_iSteamGameNotificationCallbacks = 4400 }; @@ -335,7 +334,6 @@ class CSteamAPIContext ISteamHTTP* SteamHTTP() const { return m_pSteamHTTP; } ISteamController* SteamController() const { return m_pController; } ISteamUGC* SteamUGC() const { return m_pSteamUGC; } - ISteamAppList* SteamAppList() const { return m_pSteamAppList; } ISteamMusic* SteamMusic() const { return m_pSteamMusic; } ISteamMusicRemote* SteamMusicRemote() const { return m_pSteamMusicRemote; } ISteamHTMLSurface* SteamHTMLSurface() const { return m_pSteamHTMLSurface; } @@ -359,7 +357,6 @@ class CSteamAPIContext ISteamHTTP *m_pSteamHTTP; ISteamController *m_pController; ISteamUGC *m_pSteamUGC; - ISteamAppList *m_pSteamAppList; ISteamMusic *m_pSteamMusic; ISteamMusicRemote *m_pSteamMusicRemote; ISteamHTMLSurface *m_pSteamHTMLSurface; diff --git a/public/steam/steam_gameserver.h b/public/steam/steam_gameserver.h index af714be7..147f8150 100644 --- a/public/steam/steam_gameserver.h +++ b/public/steam/steam_gameserver.h @@ -48,7 +48,17 @@ const uint16 MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE = STEAMGAMESERVER_QUERY_ // ISteamGameServer::GetNextOutgoingPacket.) // - The version string should be in the form x.x.x.x, and is used by the master server to detect when the // server is out of date. (Only servers with the latest version will be listed.) -inline bool SteamGameServer_Init( uint32 unIP, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString ); +// +// On success k_ESteamAPIInitResult_OK is returned. Otherwise, if pOutErrMsg is non-NULL, +// it will receive a non-localized message that explains the reason for the failure +inline ESteamAPIInitResult SteamGameServer_InitEx( uint32 unIP, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString, SteamErrMsg *pOutErrMsg ); + +// This function is included for compatibility with older SDK. +// You can use it if you don't care about decent error handling +inline bool SteamGameServer_Init( uint32 unIP, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString ) +{ + return SteamGameServer_InitEx( unIP, usGamePort, usQueryPort, eServerMode, pchVersionString, NULL ) == k_ESteamAPIInitResult_OK; +} // Shutdown SteamGameSeverXxx interfaces, log out, and free resources. S_API void SteamGameServer_Shutdown(); @@ -101,13 +111,23 @@ inline bool CSteamGameServerAPIContext::Init() } #endif -S_API bool S_CALLTYPE SteamInternal_GameServer_Init( uint32 unIP, uint16 usLegacySteamPort, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString ); -inline bool SteamGameServer_Init( uint32 unIP, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString ) +S_API ESteamAPIInitResult S_CALLTYPE SteamInternal_GameServer_Init_V2( uint32 unIP, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString, const char *pszInternalCheckInterfaceVersions, SteamErrMsg *pOutErrMsg ); +inline ESteamAPIInitResult SteamGameServer_InitEx( uint32 unIP, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString, SteamErrMsg *pOutErrMsg ) { - if ( !SteamInternal_GameServer_Init( unIP, 0, usGamePort, usQueryPort, eServerMode, pchVersionString ) ) - return false; - - return true; + const char *pszInternalCheckInterfaceVersions = + STEAMUTILS_INTERFACE_VERSION "\0" + STEAMNETWORKINGUTILS_INTERFACE_VERSION "\0" + + STEAMGAMESERVER_INTERFACE_VERSION "\0" + STEAMGAMESERVERSTATS_INTERFACE_VERSION "\0" + STEAMHTTP_INTERFACE_VERSION "\0" + STEAMINVENTORY_INTERFACE_VERSION "\0" + STEAMNETWORKING_INTERFACE_VERSION "\0" + STEAMNETWORKINGMESSAGES_INTERFACE_VERSION "\0" + STEAMNETWORKINGSOCKETS_INTERFACE_VERSION "\0" + STEAMUGC_INTERFACE_VERSION "\0" + "\0"; + return SteamInternal_GameServer_Init_V2( unIP, usGamePort, usQueryPort, eServerMode, pchVersionString, pszInternalCheckInterfaceVersions, pOutErrMsg ); } inline void SteamGameServer_ReleaseCurrentThreadMemory() { diff --git a/public/steam/steamclientpublic.h b/public/steam/steamclientpublic.h index ee6b9783..1be1960d 100644 --- a/public/steam/steamclientpublic.h +++ b/public/steam/steamclientpublic.h @@ -141,6 +141,8 @@ enum EResult k_EResultChargerRequired = 125, // The operation requires a charger to be plugged in, which wasn't present k_EResultCachedCredentialInvalid = 126, // Cached credential was invalid - user must reauthenticate K_EResultPhoneNumberIsVOIP = 127, // The phone number provided is a Voice Over IP number + k_EResultNotSupported = 128, // The data being accessed is not supported by this API + k_EResultFamilySizeLimitExceeded = 129, // Reached the maximum size of the family }; // Error codes for use with the voice functions diff --git a/public/steam/steamdatagram_tickets.h b/public/steam/steamdatagram_tickets.h deleted file mode 100644 index b9cae3a7..00000000 --- a/public/steam/steamdatagram_tickets.h +++ /dev/null @@ -1,286 +0,0 @@ -//====== Copyright Valve Corporation, All rights reserved. ==================== -// -// Types and utilities for handling steam datagram tickets. These are -// useful for both the client and the backend ticket generating authority. -// -//============================================================================= - -#ifndef STEAMDATAGRAM_TICKETS_H -#define STEAMDATAGRAM_TICKETS_H -#ifdef _WIN32 -#pragma once -#endif - -#ifndef assert - #include -#endif - -#include -#include "steamnetworkingtypes.h" - -#if defined( VALVE_CALLBACK_PACK_SMALL ) -#pragma pack( push, 4 ) -#elif defined( VALVE_CALLBACK_PACK_LARGE ) -#pragma pack( push, 8 ) -#else -#error "Must define VALVE_CALLBACK_PACK_SMALL or VALVE_CALLBACK_PACK_LARGE" -#endif - -/// Max length of serialized auth ticket. This is important so that we -/// can ensure that we always fit into a single UDP datagram (along with -/// other certs and signatures) and keep the implementation simple. -const size_t k_cbSteamDatagramMaxSerializedTicket = 512; - -/// Network-routable identifier for a service. This is an intentionally -/// opaque byte blob. The relays know how to use this to forward it on -/// to the intended destination, but otherwise clients really should not -/// need to know what's inside. (Indeed, we don't really want them to -/// know, as it could reveal information useful to an attacker.) -struct SteamDatagramHostedAddress -{ - - // Size of data blob. - int m_cbSize; - - // Opaque data - char m_data[ 128 ]; - - // Reset to empty state - void Clear() { memset( this, 0, sizeof(*this) ); } - - // Parse the data center out of the blob. - SteamNetworkingPOPID GetPopID() const { return CalculateSteamNetworkingPOPIDFromString( m_data ); } - - /// Set a dummy routing blob with a hardcoded IP:port. You should only use - /// this in a dev environment, since the address is in plaintext! - /// In production this information should come from the server, - /// using ISteamNetworkingSockets::GetHostedDedicatedServerAddress - void SetDevAddress( uint32 nIP, uint16 nPort, SteamNetworkingPOPID popid = 0 ) - { - GetSteamNetworkingLocationPOPStringFromID( popid, m_data ); - m_cbSize = 4; - m_data[m_cbSize++] = 1; - m_data[m_cbSize++] = 1; - m_data[m_cbSize++] = char(nPort); - m_data[m_cbSize++] = char(nPort>>8); - m_data[m_cbSize++] = char(nIP); - m_data[m_cbSize++] = char(nIP>>8); - m_data[m_cbSize++] = char(nIP>>16); - m_data[m_cbSize++] = char(nIP>>24); - } - - /// Convert to/from std::string (or anything that acts like it). - /// Useful for interfacing with google protobuf. It's a template - /// mainly so that we don't have to include in the header. - /// Note: by "string", we don't mean that it's text. It's a binary - /// blob, and it might have zeros in it. (std::string can handle that.) - template bool SetFromStdString( const T &str ) - { - if ( str.length() >= sizeof(m_data) ) - { - m_cbSize = 0; - return false; - } - m_cbSize = (int)str.length(); - memcpy( m_data, str.c_str(), m_cbSize ); - return true; - } - template void GetAsStdString( T *str ) const - { - str->assign( m_data, m_cbSize ); - } -}; - -/// Ticket used to gain access to the relay network. -struct SteamDatagramRelayAuthTicket -{ - SteamDatagramRelayAuthTicket() { Clear(); } - - /// Reset all fields - void Clear() { memset( this, 0, sizeof(*this) ); m_nRestrictToVirtualPort = -1; } - - /// Identity of the gameserver we want to talk to. This is required. - SteamNetworkingIdentity m_identityGameserver; - - /// Identity of the person who was authorized. This is required. - SteamNetworkingIdentity m_identityAuthorizedClient; - - /// SteamID is authorized to send from a particular public IP. If this - /// is 0, then the sender is not restricted to a particular IP. - /// - /// Recommend to leave this set to zero. - uint32 m_unPublicIP; - - /// Time when the ticket expires. Recommended: take the current - /// time and add 6 hours, or maybe a bit longer if your gameplay - /// sessions are longer. - /// - /// NOTE: relays may reject tickets with expiry times excessively - /// far in the future, so contact us if you wish to use an expiry - /// longer than, say, 24 hours. - RTime32 m_rtimeTicketExpiry; - - /// Routing information where the gameserver is listening for - /// relayed traffic. You should fill this in when generating - /// a ticket. - /// - /// When generating tickets on your backend: - /// - In production: The gameserver knows the proper routing - /// information, so you need to call - /// ISteamNetworkingSockets::GetHostedDedicatedServerAddress - /// and send the info to your backend. - /// - In development, you will need to provide public IP - /// of the server using SteamDatagramServiceNetID::SetDevAddress. - /// Relays need to be able to send UDP - /// packets to this server. Since it's very likely that - /// your server is behind a firewall/NAT, make sure that - /// the address is the one that the outside world can use. - /// The traffic from the relays will be "unsolicited", so - /// stateful firewalls won't work -- you will probably have - /// to set up an explicit port forward. - /// On the client: - /// - this field will always be blank. - SteamDatagramHostedAddress m_routing; - - /// App ID this is for. This is required, and should be the - /// App ID the client is running. (Even if your gameserver - /// uses a different App ID.) - uint32 m_nAppID; - - /// Restrict this ticket to be used for a particular virtual port? - /// Set to -1 to allow any virtual port. - /// - /// This is useful as a security measure, and also so the client will - /// use the right ticket (which might have extra fields that are useful - /// for proper analytics), if the client happens to have more than one - /// appropriate ticket. - /// - /// Note: if a client has more that one acceptable ticket, they will - /// always use the one expiring the latest. - int m_nRestrictToVirtualPort; - - // - // Extra fields. - // - // These are collected for backend analytics. For example, you might - // send a MatchID so that all of the records for a particular match can - // be located. Or send a game mode field so that you can compare - // the network characteristics of different game modes. - // - // (At the time of this writing we don't have a way to expose the data - // we collect to partners, but we hope to in the future so that you can - // get visibility into network conditions.) - // - - struct ExtraField - { - enum EType - { - k_EType_String, - k_EType_Int, // For most small integral values. Uses google protobuf sint64, so it's small on the wire. WARNING: In some places this value may be transmitted in JSON, in which case precision may be lost in backend analytics. Don't use this for an "identifier", use it for a scalar quantity. - k_EType_Fixed64, // 64 arbitrary bits. This value is treated as an "identifier". In places where JSON format is used, it will be serialized as a string. No aggregation / analytics can be performed on this value. - }; - int /* EType */ m_eType; - char m_szName[28]; - - union { - char m_szStringValue[128]; - int64 m_nIntValue; - uint64 m_nFixed64Value; - }; - }; - enum { k_nMaxExtraFields = 16 }; - int m_nExtraFields; - ExtraField m_vecExtraFields[ k_nMaxExtraFields ]; - - /// Helper to add an extra field in a single call - void AddExtraField_Int( const char *pszName, int64 val ) - { - ExtraField *p = AddExtraField( pszName, ExtraField::k_EType_Int ); - if ( p ) - p->m_nIntValue = val; - } - void AddExtraField_Fixed64( const char *pszName, uint64 val ) - { - ExtraField *p = AddExtraField( pszName, ExtraField::k_EType_Fixed64 ); - if ( p ) - p->m_nFixed64Value = val; - } - void AddExtraField_String( const char *pszName, const char *val ) - { - ExtraField *p = AddExtraField( pszName, ExtraField::k_EType_String ); - if ( p ) - { - size_t l = strlen( val ); - if ( l > sizeof(p->m_szStringValue)-1 ) - l = sizeof(p->m_szStringValue)-1; - memcpy( p->m_szStringValue, val, l ); - p->m_szStringValue[l] = '\0'; - } - } - -private: - ExtraField *AddExtraField( const char *pszName, ExtraField::EType eType ) - { - if ( m_nExtraFields >= k_nMaxExtraFields ) - { - assert( false ); - return NULL; - } - ExtraField *p = &m_vecExtraFields[ m_nExtraFields++ ]; - p->m_eType = eType; - - size_t l = strlen( pszName ); - if ( l > sizeof(p->m_szName)-1 ) - l = sizeof(p->m_szName)-1; - memcpy( p->m_szName, pszName, l ); - p->m_szName[l] = '\0'; - return p; - } -}; - -#pragma pack(pop) - -/// Max size of user data blob -const size_t k_cbMaxSteamDatagramGameCoordinatorServerLoginAppData = 2048; - -/// Max size of serialized data blob -const size_t k_cbMaxSteamDatagramGameCoordinatorServerLoginSerialized = 4096; - -/// Structure that describes a gameserver attempting to authenticate -/// with your central server allocator / matchmaking service ("game coordinator"). -/// This is useful because the game coordinator needs to know: -/// -/// - What data center is the gameserver running in? -/// - The routing blob of the gameserver -/// - Is the gameserver actually trusted? -/// -/// Using this structure, you can securely communicate this information -/// to your server, and you can do this WITHOUT maintaining any -/// whitelists or tables of IP addresses. -/// -/// See ISteamNetworkingSockets::GetGameCoordinatorServerLogin -struct SteamDatagramGameCoordinatorServerLogin -{ - /// Server's identity - SteamNetworkingIdentity m_identity; - - /// Routing info. Note that this includes the POPID - SteamDatagramHostedAddress m_routing; - - /// AppID that the server thinks it is running - AppId_t m_nAppID; - - /// Unix timestamp when this was generated - RTime32 m_rtime; - - /// Size of application data - int m_cbAppData; - - /// Application data. This is any additional information - /// that you need to identify the server not contained above. - /// (E.g. perhaps a public IP as seen by the coordinator service.) - char m_appData[ k_cbMaxSteamDatagramGameCoordinatorServerLoginAppData ]; -}; - -#endif // STEAMDATAGRAM_TICKETS_H diff --git a/public/steam/steamhttpenums.h b/public/steam/steamhttpenums.h index ecb21ed7..7ded89a0 100644 --- a/public/steam/steamhttpenums.h +++ b/public/steam/steamhttpenums.h @@ -97,4 +97,9 @@ enum EHTTPStatusCode k_EHTTPStatusCode5xxUnknown = 599, }; +inline bool BIsHTTPStatusSuccess( EHTTPStatusCode eStatus ) +{ + return eStatus >= 200 && eStatus <= 299; +} + #endif // STEAMHTTPENUMS_H \ No newline at end of file diff --git a/public/steam/steamnetworkingtypes.h b/public/steam/steamnetworkingtypes.h index a1b93924..fa5b510d 100644 --- a/public/steam/steamnetworkingtypes.h +++ b/public/steam/steamnetworkingtypes.h @@ -26,7 +26,7 @@ #if defined( STEAMNETWORKINGSOCKETS_STATIC_LINK ) #define STEAMNETWORKINGSOCKETS_INTERFACE extern "C" #elif defined( STEAMNETWORKINGSOCKETS_FOREXPORT ) - #ifdef _WIN32 + #if defined( _WIN32 ) || defined( __ORBIS__ ) || defined( __PROSPERO__ ) #define STEAMNETWORKINGSOCKETS_INTERFACE extern "C" __declspec( dllexport ) #else #define STEAMNETWORKINGSOCKETS_INTERFACE extern "C" __attribute__((visibility("default"))) @@ -1152,6 +1152,42 @@ enum ESteamNetworkingConfigValue /// Default is 512k (524288 bytes) k_ESteamNetworkingConfig_SendBufferSize = 9, + /// [connection int32] Upper limit on total size (in bytes) of received messages + /// that will be buffered waiting to be processed by the application. If this limit + /// is exceeded, packets will be dropped. This is to protect us from a malicious + /// peer flooding us with messages faster than we can process them. + /// + /// This must be bigger than k_ESteamNetworkingConfig_RecvMaxMessageSize + k_ESteamNetworkingConfig_RecvBufferSize = 47, + + /// [connection int32] Upper limit on the number of received messages that will + /// that will be buffered waiting to be processed by the application. If this limit + /// is exceeded, packets will be dropped. This is to protect us from a malicious + /// peer flooding us with messages faster than we can pull them off the wire. + k_ESteamNetworkingConfig_RecvBufferMessages = 48, + + /// [connection int32] Maximum message size that we are willing to receive. + /// if a client attempts to send us a message larger than this, the connection + /// will be immediately closed. + /// + /// Default is 512k (524288 bytes). Note that the peer needs to be able to + /// send a message this big. (See k_cbMaxSteamNetworkingSocketsMessageSizeSend.) + k_ESteamNetworkingConfig_RecvMaxMessageSize = 49, + + /// [connection int32] Max number of message segments that can be received + /// in a single UDP packet. While decoding a packet, if the number of segments + /// exceeds this, we will abort further packet processing. + /// + /// The default is effectively unlimited. If you know that you very rarely + /// send small packets, you can protect yourself from malicious senders by + /// lowering this number. + /// + /// In particular, if you are NOT using the reliability layer and are only using + /// SteamNetworkingSockets for datagram transport, setting this to a very low + /// number may be beneficial. (We recommend a value of 2.) Make sure your sender + /// disables Nagle! + k_ESteamNetworkingConfig_RecvMaxSegmentsPerPacket = 50, + /// [connection int64] Get/set userdata as a configuration option. /// The default value is -1. You may want to set the user data as /// a config value, instead of using ISteamNetworkingSockets::SetConnectionUserData @@ -1187,9 +1223,12 @@ enum ESteamNetworkingConfigValue // ensure you have the current value. k_ESteamNetworkingConfig_ConnectionUserData = 40, - /// [connection int32] Minimum/maximum send rate clamp, 0 is no limit. - /// This value will control the min/max allowed sending rate that - /// bandwidth estimation is allowed to reach. Default is 0 (no-limit) + /// [connection int32] Minimum/maximum send rate clamp, in bytes/sec. + /// At the time of this writing these two options should always be set to + /// the same value, to manually configure a specific send rate. The default + /// value is 256K. Eventually we hope to have the library estimate the bandwidth + /// of the channel and set the send rate to that estimated bandwidth, and these + /// values will only set limits on that send rate. k_ESteamNetworkingConfig_SendRateMin = 10, k_ESteamNetworkingConfig_SendRateMax = 11, @@ -1393,6 +1432,32 @@ enum ESteamNetworkingConfigValue k_ESteamNetworkingConfig_FakeRateLimit_Recv_Rate = 44, k_ESteamNetworkingConfig_FakeRateLimit_Recv_Burst = 45, + // Timeout used for out-of-order correction. This is used when we see a small + // gap in the sequence number on a packet flow. For example let's say we are + // processing packet 105 when the most recent one was 103. 104 might have dropped, + // but there is also a chance that packets are simply being reordered. It is very + // common on certain types of connections for packet 104 to arrive very soon after 105, + // especially if 104 was large and 104 was small. In this case, when we see packet 105 + // we will shunt it aside and pend it, in the hopes of seeing 104 soon after. If 104 + // arrives before the a timeout occurs, then we can deliver the packets in order to the + // remainder of packet processing, and we will record this as a "correctable" out-of-order + // situation. If the timer expires, then we will process packet 105, and assume for now + // that 104 has dropped. (If 104 later arrives, we will process it, but that will be + // accounted for as uncorrected.) + // + // The default value is 1000 microseconds. Note that the Windows scheduler does not + // have microsecond precision. + // + // Set the value to 0 to disable out of order correction at the packet layer. + // In many cases we are still effectively able to correct the situation because + // reassembly of message fragments is tolerant of fragments packets arriving out of + // order. Also, when messages are decoded and inserted into the queue for the app + // to receive them, we will correct out of order messages that have not been + // dequeued by the app yet. However, when out-of-order packets are corrected + // at the packet layer, they will not reduce the connection quality measure. + // (E.g. SteamNetConnectionRealTimeStatus_t::m_flConnectionQualityLocal) + k_ESteamNetworkingConfig_OutOfOrderCorrectionWindowMicroseconds = 51, + // // Callbacks // @@ -1506,24 +1571,24 @@ enum ESteamNetworkingConfigValue // Settings for SDR relayed connections // - /// [int32 global] If the first N pings to a port all fail, mark that port as unavailable for + /// [global int32] If the first N pings to a port all fail, mark that port as unavailable for /// a while, and try a different one. Some ISPs and routers may drop the first /// packet, so setting this to 1 may greatly disrupt communications. k_ESteamNetworkingConfig_SDRClient_ConsecutitivePingTimeoutsFailInitial = 19, - /// [int32 global] If N consecutive pings to a port fail, after having received successful + /// [global int32] If N consecutive pings to a port fail, after having received successful /// communication, mark that port as unavailable for a while, and try a /// different one. k_ESteamNetworkingConfig_SDRClient_ConsecutitivePingTimeoutsFail = 20, - /// [int32 global] Minimum number of lifetime pings we need to send, before we think our estimate + /// [global int32] Minimum number of lifetime pings we need to send, before we think our estimate /// is solid. The first ping to each cluster is very often delayed because of NAT, /// routers not having the best route, etc. Until we've sent a sufficient number /// of pings, our estimate is often inaccurate. Keep pinging until we get this /// many pings. k_ESteamNetworkingConfig_SDRClient_MinPingsBeforePingAccurate = 21, - /// [int32 global] Set all steam datagram traffic to originate from the same + /// [global int32] Set all steam datagram traffic to originate from the same /// local port. By default, we open up a new UDP socket (on a different local /// port) for each relay. This is slightly less optimal, but it works around /// some routers that don't implement NAT properly. If you have intermittent @@ -1535,10 +1600,13 @@ enum ESteamNetworkingConfigValue /// only use relays in that cluster. E.g. 'iad' k_ESteamNetworkingConfig_SDRClient_ForceRelayCluster = 29, - /// [connection string] For debugging, generate our own (unsigned) ticket, using - /// the specified gameserver address. Router must be configured to accept unsigned - /// tickets. - k_ESteamNetworkingConfig_SDRClient_DebugTicketAddress = 30, + /// [connection string] For development, a base-64 encoded ticket generated + /// using the cert tool. This can be used to connect to a gameserver via SDR + /// without a ticket generated using the game coordinator. (You will still + /// need a key that is trusted for your app, however.) + /// + /// This can also be passed using the SDR_DEVTICKET environment variable + k_ESteamNetworkingConfig_SDRClient_DevTicket = 30, /// [global string] For debugging. Override list of relays from the config with /// this set (maybe just one). Comma-separated list. @@ -1551,6 +1619,10 @@ enum ESteamNetworkingConfigValue /// in production. k_ESteamNetworkingConfig_SDRClient_FakeClusterPing = 36, + /// [global int32] When probing the SteamDatagram network, we limit exploration + /// to the closest N POPs, based on our current best approximated ping to that POP. + k_ESteamNetworkingConfig_SDRClient_LimitPingProbesToNearestN = 60, + // // Log levels for debugging information of various subsystems. // Higher numeric values will cause more stuff to be printed. @@ -1566,6 +1638,10 @@ enum ESteamNetworkingConfigValue k_ESteamNetworkingConfig_LogLevel_P2PRendezvous = 17, // [connection int32] P2P rendezvous messages k_ESteamNetworkingConfig_LogLevel_SDRRelayPings = 18, // [global int32] Ping relays + // Experimental. Set the ECN header field on all outbound UDP packets + // -1 = the default, and means "don't set anything". + // 0..3 = set that value. (Even though 0 is the default UDP ECN value, a 0 here means "explicitly set a 0".) + k_ESteamNetworkingConfig_ECN = 999, // Deleted, do not use k_ESteamNetworkingConfig_DELETED_EnumerateDevVars = 35, diff --git a/public/steam/steamtypes.h b/public/steam/steamtypes.h index 49653c4a..513deffe 100644 --- a/public/steam/steamtypes.h +++ b/public/steam/steamtypes.h @@ -98,6 +98,7 @@ typedef uint64 SteamAPICall_t; const SteamAPICall_t k_uAPICallInvalid = 0x0; typedef uint32 AccountID_t; +const AccountID_t k_uAccountIdInvalid = 0; // Party Beacon ID typedef uint64 PartyBeaconID_t; diff --git a/src/SSVOpenHexagon/Core/Audio.cpp b/src/SSVOpenHexagon/Core/Audio.cpp index a14f4d37..f4699abb 100644 --- a/src/SSVOpenHexagon/Core/Audio.cpp +++ b/src/SSVOpenHexagon/Core/Audio.cpp @@ -173,7 +173,7 @@ class Audio::AudioImpl if (path == nullptr) { - ssvu::lo("hg::AudioImpl::playMusic") + ssvu::lo("hg::AudioImpl::loadAndPlayMusic") << "No path for music id '" << assetId << "'\n"; return false; @@ -183,7 +183,7 @@ class Audio::AudioImpl { if (!(_music = sf::Music::openFromFile(*path))) { - ssvu::lo("hg::AudioImpl::playMusic") + ssvu::lo("hg::AudioImpl::loadAndPlayMusic") << "Failed loading music file '" << path << "'\n"; _music.reset(); diff --git a/src/SSVOpenHexagon/Core/HGGraphics.cpp b/src/SSVOpenHexagon/Core/HGGraphics.cpp index 3ed27163..15102db3 100644 --- a/src/SSVOpenHexagon/Core/HGGraphics.cpp +++ b/src/SSVOpenHexagon/Core/HGGraphics.cpp @@ -35,8 +35,8 @@ namespace hg { return ssvu::toStr(std::floor(x * 1000) / 1000.f); } -void HexagonGame::render( - sf::Drawable& mDrawable, const sf::RenderStates& mStates) +template +void HexagonGame::render(Ts&&... xs) { if (window == nullptr) { @@ -46,20 +46,7 @@ void HexagonGame::render( return; } - window->draw(mDrawable, mStates); -} - -void HexagonGame::render(const sf::Sprite& mSprite, const sf::Texture& mTexture) -{ - if (window == nullptr) - { - ssvu::lo("hg::HexagonGame::render") - << "Attempted to render without a game window\n"; - - return; - } - - window->getRenderWindow().draw(mSprite, mTexture); + window->draw(SSVOH_FWD(xs)...); } void HexagonGame::draw() @@ -399,7 +386,7 @@ void HexagonGame::drawKeyIcons() void HexagonGame::drawLevelInfo(const sf::RenderStates& mStates) { - render(levelInfoRectangle, mStates); + render(levelInfoRectangle, /* texture */ nullptr, mStates); if (textUI.has_value()) { diff --git a/src/SSVOpenHexagon/Core/MenuGame.cpp b/src/SSVOpenHexagon/Core/MenuGame.cpp index 64be7b6c..2b840c37 100644 --- a/src/SSVOpenHexagon/Core/MenuGame.cpp +++ b/src/SSVOpenHexagon/Core/MenuGame.cpp @@ -3259,7 +3259,7 @@ void MenuGame::renderText( { mText.setString(mStr); mText.setPosition(mPos); - render(mText); + window.draw(mText); } void MenuGame::renderText(const std::string& mStr, sf::Text& mText, @@ -3296,7 +3296,7 @@ void MenuGame::renderTextCentered( { mText.setString(mStr); mText.setPosition({mPos.x - ssvs::getGlobalHalfWidth(mText), mPos.y}); - render(mText); + window.draw(mText); } void MenuGame::renderTextCentered(const std::string& mStr, sf::Text& mText, @@ -3332,7 +3332,7 @@ void MenuGame::renderTextCenteredOffset(const std::string& mStr, mText.setString(mStr); mText.setPosition( {xOffset + mPos.x - ssvs::getGlobalHalfWidth(mText), mPos.y}); - render(mText); + window.draw(mText); } void MenuGame::renderTextCenteredOffset(const std::string& mStr, @@ -3578,7 +3578,7 @@ void MenuGame::drawScrollbar(const float totalHeight, const int size, menuQuads.reserve_quad(1); createQuad( color, x, x + textToQuadBorder, startHeight, startHeight + barHeight); - render(menuQuads); + window.draw(menuQuads); } void MenuGame::drawMainSubmenus( @@ -3761,7 +3761,7 @@ void MenuGame::drawMainMenu( quadHeight += interline; } - render(menuQuads); + window.draw(menuQuads); // Draw the text on top of the quads for (int i{0}; i < size; ++i) @@ -3807,7 +3807,7 @@ void MenuGame::drawOptionsSubmenus( quadHeight + totalHeight); createQuad(menuQuadColor, 0, indent + quadBorder, quadHeight + quadBorder, quadHeight + totalHeight - quadBorder); - render(menuQuads); + window.draw(menuQuads); // Draw the text on top of the quads quadBorder = quadBorder * 1.5f - panelOffset; @@ -3953,7 +3953,7 @@ void MenuGame::drawProfileSelection( indent + profFrameSize + textWidth, quadHeight + profFrameSize, quadHeight + totalHeight - profFrameSize); - render(menuQuads); + window.draw(menuQuads); if (scrollbarNotches != 0) { @@ -3999,7 +3999,7 @@ void MenuGame::drawProfileSelection( txtInstructionsSmall.font.setPosition( {indent + (textWidth - instructionsWidth) / 2.f, quadHeight + totalHeight}); - render(txtInstructionsSmall.font); + window.draw(txtInstructionsSmall.font); } void MenuGame::drawProfileSelectionBoot() @@ -4121,7 +4121,7 @@ void MenuGame::drawEnteringText(const float xOffset, const bool revertOffset) indent + profFrameSize + textWidth, quadHeight + profFrameSize, quadHeight + totalHeight - profFrameSize); - render(menuQuads); + window.draw(menuQuads); // Draw the text on top of the quads renderTextCenteredOffset(enteredStr, txtEnteringText.font, @@ -4205,7 +4205,7 @@ void MenuGame::drawLoadResults() w / 2.f + i * xOffset + 5.f, topHeight, bottomHeight); } - render(menuQuads); + window.draw(menuQuads); //-------------------------------------- // Counters: text and numbers @@ -5072,7 +5072,7 @@ void MenuGame::drawLevelSelectionRightSide( } } - render(menuQuads); + window.draw(menuQuads); prevLevelIndent = indent; //------------------------------------- @@ -5120,7 +5120,7 @@ void MenuGame::drawLevelSelectionRightSide( height - textToQuadBorder + txtSelectionRanked.height + padding + 1.f); - render(menuQuads); + window.draw(menuQuads); renderText("RANKED", txtSelectionRanked.font, {w - width, height - @@ -5149,7 +5149,7 @@ void MenuGame::drawLevelSelectionRightSide( menuQuads.reserve_quad(1); createQuad( menuQuadColor, prevLevelIndent, w, height, height + slctFrameSize); - render(menuQuads); + window.draw(menuQuads); height += slctFrameSize; i = ssvu::getMod(drawer.packIdx + 1, packsSize); @@ -5190,7 +5190,7 @@ void MenuGame::drawLevelSelectionRightSide( mustChangePackIndexTo = i; } - render(menuQuads); + window.draw(menuQuads); // Name & > if (drawer.isFavorites) @@ -5217,7 +5217,7 @@ void MenuGame::drawLevelSelectionRightSide( const sf::Color oldC = txtSelectionMedium.font.getFillColor(); txtSelectionMedium.font.setFillColor( mouseOverlapColor(mouseOverlap, menuTextColor)); - render(txtSelectionMedium.font); + window.draw(txtSelectionMedium.font); txtSelectionMedium.font.setFillColor(oldC); menuQuads.clear(); @@ -5256,7 +5256,7 @@ void MenuGame::drawLevelSelectionRightSide( menuQuads.batch_unsafe_emplace_back_quad( menuTextColor, topLeft, bottomLeft, bottomRight, topRight); - render(menuQuads); + window.draw(menuQuads); } else { @@ -5288,7 +5288,7 @@ void MenuGame::drawLevelSelectionRightSide( menuQuads.batch_unsafe_emplace_back_quad( menuTextColor, topLeft, bottomLeft, bottomRight, topRight); - render(menuQuads); + window.draw(menuQuads); height -= slctFrameSize / 2.f; } @@ -5333,7 +5333,7 @@ void MenuGame::drawLevelSelectionLeftSide( createQuad({menuTextColor.r, menuTextColor.g, menuTextColor.b, 150}, 0, width, 0, h); createQuad(menuQuadColor, width, width + lineThickness, 0, h); - render(menuQuads); + window.draw(menuQuads); menuQuads.clear(); //------------------------------------- @@ -5528,7 +5528,7 @@ void MenuGame::drawLevelSelectionLeftSide( } // Also renders all previous quads - render(menuQuads); + window.draw(menuQuads); menuQuads.clear(); renderTextCenteredOffset( @@ -5743,7 +5743,7 @@ void MenuGame::drawLevelSelectionLeftSide( } } - render(menuQuads); + window.draw(menuQuads); } void MenuGame::draw() @@ -5781,7 +5781,7 @@ void MenuGame::draw() levelStatus.darkenUnevenBackgroundChunk, Config::getBlackAndWhite(), fourByThree); - render(menuBackgroundTris); + window.draw(menuBackgroundTris); } window.setView(overlayCamera.apply()); @@ -5830,7 +5830,7 @@ void MenuGame::draw() return; case States::EpilepsyWarning: - render(epilepsyWarning, txEpilepsyWarning); + window.draw(epilepsyWarning, txEpilepsyWarning); renderText("PRESS ANY KEY OR BUTTON TO CONTINUE", txtProf.font, {txtProf.height, h - txtProf.height * 2.7f + 5.f}); return; @@ -5975,16 +5975,6 @@ void MenuGame::draw() } } -void MenuGame::render(sf::Drawable& mDrawable) -{ - window.draw(mDrawable); -} - -void MenuGame::render(const sf::Sprite& mSprite, const sf::Texture& mTexture) -{ - window.getRenderWindow().draw(mSprite, mTexture); -} - [[nodiscard]] float MenuGame::getFPSMult() const { // multiplier for FPS consistent drawing operations. @@ -5993,10 +5983,10 @@ void MenuGame::render(const sf::Sprite& mSprite, const sf::Texture& mTexture) void MenuGame::drawGraphics() { - render(titleBar, txTitleBar); - render(creditsBar1, txCreditsBar1); - render(creditsBar2, *txCreditsBar2); - render(txtVersion.font); + window.draw(titleBar, txTitleBar); + window.draw(creditsBar1, txCreditsBar1); + window.draw(creditsBar2, *txCreditsBar2); + window.draw(txtVersion.font); } void MenuGame::drawOnlineStatus() @@ -6103,9 +6093,9 @@ void MenuGame::drawOnlineStatus() {ssvs::getGlobalLeft(rsOnlineStatus) + padding * 2.f, ssvs::getGlobalCenter(rsOnlineStatus).y}); - render(sOnline, *txSOnline); - render(rsOnlineStatus); - render(txtOnlineStatus); + window.draw(sOnline, *txSOnline); + window.draw(rsOnlineStatus, /* texture */ nullptr); + window.draw(txtOnlineStatus); } void MenuGame::showDialogBox(const std::string& msg) diff --git a/src/SSVOpenHexagon/Core/Steam.cpp b/src/SSVOpenHexagon/Core/Steam.cpp index d888bc32..0e8c06c1 100644 --- a/src/SSVOpenHexagon/Core/Steam.cpp +++ b/src/SSVOpenHexagon/Core/Steam.cpp @@ -38,7 +38,7 @@ namespace hg::Steam { { // Using C API here because C++ one doesn't work with MinGW. - ISteamUser* steam_user = SteamAPI_SteamUser_v022(); + ISteamUser* steam_user = SteamAPI_SteamUser_v023(); if (!SteamAPI_ISteamUser_BLoggedOn(steam_user)) { diff --git a/src/SSVOpenHexagon/Global/Assets.cpp b/src/SSVOpenHexagon/Global/Assets.cpp index 168f622f..a71c6af1 100644 --- a/src/SSVOpenHexagon/Global/Assets.cpp +++ b/src/SSVOpenHexagon/Global/Assets.cpp @@ -1306,7 +1306,7 @@ void HGAssets::HGAssetsImpl::reloadAllShaders() return "invalid level folder path\n"; } - auto levelFile = scanSingleByName(temp, mId + ".json"); + const auto& levelFile = scanSingleByName(temp, mId + ".json"); if (levelFile.empty()) { return "no matching level data file found\n"; @@ -1338,7 +1338,8 @@ void HGAssets::HGAssetsImpl::reloadAllShaders() } else { - auto styleFile = scanSingleByName(temp, levelData.styleId + ".json"); + const auto& styleFile = + scanSingleByName(temp, levelData.styleId + ".json"); if (styleFile.empty()) { output += "no matching style file found\n"; @@ -1395,7 +1396,8 @@ void HGAssets::HGAssetsImpl::reloadAllShaders() { assetId = mPackId + "_" + levelData.musicId; - auto musicFile = scanSingleByName(temp, levelData.musicId + ".ogg"); + const auto& musicFile = + scanSingleByName(temp, levelData.musicId + ".ogg"); if (musicFile.empty()) { output += "no matching music file found\n"; @@ -1432,7 +1434,7 @@ void HGAssets::HGAssetsImpl::reloadAllShaders() return output; } - auto soundFile = scanSingleByName(temp, levelData.soundId + ".ogg"); + const auto& soundFile = scanSingleByName(temp, levelData.soundId + ".ogg"); if (soundFile.empty()) { output += "no matching custom sound file found\n";