├── .clang-format ├── .editorconfig ├── .github └── ISSUE_TEMPLATE.md ├── .gitignore ├── .gitmodules ├── .modio ├── CMakeLists.txt ├── CMakePresets.json ├── LICENSE ├── Modio.natvis ├── README.adoc ├── cmake ├── GetGitRevisionDescription.cmake ├── GetGitRevisionDescription.cmake.in ├── LocateVisualStudio.cmake ├── ModioGeneratedVariables.h.in ├── initialise-platform.cmake ├── modio-packaging.cmake ├── modio-version.cmake ├── platform-defines.cmake └── split-compilation.cmake ├── doc ├── .nojekyll ├── assets │ ├── css │ │ └── styles.58715c6c.css │ ├── fonts │ │ ├── EuclidCircularB-Bold-WebS-85b3e0686fa738474f5c5cbae48da808.woff │ │ ├── EuclidCircularB-Bold-WebS-f996f0f3c9d7e69a3a8e9d9e5f3c8e5c.woff2 │ │ ├── EuclidCircularB-Regular-WebS-a2e11c861d5a9f3541d340c87e5403ea.woff2 │ │ ├── EuclidCircularB-Regular-WebS-bf8d727ab20d44bfe4c19326a7f7656e.woff │ │ ├── mod_Bold-6a828d6c1ee525b8ccdaab51a5555dad.woff │ │ ├── mod_Bold-ef576a3617e7d78bf072ca28fac9ec27.woff2 │ │ ├── mod_Regular-64d7bd55cab96b676cc4ab2cf89c717e.woff2 │ │ └── mod_Regular-db0da0c22c8114761de7dede60f78da4.woff │ └── js │ │ ├── 05ae0fb1.9232a171.js │ │ ├── 0879cf16.0fc9b352.js │ │ ├── 0ce884cc.5bd0a887.js │ │ ├── 1169.906279d0.js │ │ ├── 1176.29c7b74f.js │ │ ├── 1245.391f752c.js │ │ ├── 1303.b2925fda.js │ │ ├── 1303.b2925fda.js.LICENSE.txt │ │ ├── 1331.07d85199.js │ │ ├── 1398.7d0c6f19.js │ │ ├── 17896441.11c71f9b.js │ │ ├── 1946.7aa0f22a.js │ │ ├── 1a4e3797.3546f7d6.js │ │ ├── 1a4e3797.3546f7d6.js.LICENSE.txt │ │ ├── 20e13d56.0bd7309b.js │ │ ├── 2130.43d43741.js │ │ ├── 2237.e3f2ebcc.js │ │ ├── 22dd74f7.860a0aae.js │ │ ├── 2376.08677b50.js │ │ ├── 2453.82d6d7f3.js │ │ ├── 2548.576f7461.js │ │ ├── 26683747.24b8f85f.js │ │ ├── 281fb486.5b88acb6.js │ │ ├── 2843.4eed0390.js │ │ ├── 2925.d1fbe33d.js │ │ ├── 2983.35c1e573.js │ │ ├── 3068.ad695da7.js │ │ ├── 3626.bba7e379.js │ │ ├── 3706.44baf066.js │ │ ├── 403f919c.25e1abf9.js │ │ ├── 416.0a5ddd77.js │ │ ├── 4162.a4ae0f07.js │ │ ├── 4741.c22b4e87.js │ │ ├── 4943.5f57954a.js │ │ ├── 4d3f9fe4.4612858b.js │ │ ├── 5e95c892.9bed6022.js │ │ ├── 6420.4b92d03f.js │ │ ├── 6788.3f735aa4.js │ │ ├── 6803.08628f2d.js │ │ ├── 68befa13.fb3df4bf.js │ │ ├── 7106.16bfe2ec.js │ │ ├── 7106.16bfe2ec.js.LICENSE.txt │ │ ├── 7426.f5922b1f.js │ │ ├── 79d1d0e4.f0969688.js │ │ ├── 7a4c24c2.3663d11d.js │ │ ├── 7b283257.6c95601c.js │ │ ├── 8055.3d30768b.js │ │ ├── 808e7408.fa8fac32.js │ │ ├── 8158.9593b541.js │ │ ├── 8337.b44523c6.js │ │ ├── 8478.4a99735e.js │ │ ├── 8635.42ee7d4b.js │ │ ├── 8810.a22d1b82.js │ │ ├── 8869.440bc5a1.js │ │ ├── 8913.78590cf1.js │ │ ├── 9689.54850d81.js │ │ ├── a7456010.17260dd7.js │ │ ├── a7bd4aaa.3ca9d01e.js │ │ ├── a94703ab.8c09d48e.js │ │ ├── aba21aa0.9c3e38ee.js │ │ ├── b4c43290.48088b47.js │ │ ├── c141421f.a7090503.js │ │ ├── c2069388.956caae5.js │ │ ├── ca562bb2.fb099bc7.js │ │ ├── d9b18962.afd241b0.js │ │ ├── e1c3e416.ca7c254a.js │ │ ├── e6d24e8a.1f628175.js │ │ ├── eb928fe6.13cfc2c4.js │ │ ├── f9983479.9da7fe24.js │ │ ├── main.43446498.js │ │ ├── main.43446498.js.LICENSE.txt │ │ └── runtime~main.87501012.js ├── chapters │ └── diagrams │ │ └── general-overview │ │ └── modio_sdk_flow-init.puml ├── fonts │ ├── EuclidCircularB-Bold-WebS.woff │ ├── EuclidCircularB-Bold-WebS.woff2 │ ├── EuclidCircularB-Regular-WebS.woff │ ├── EuclidCircularB-Regular-WebS.woff2 │ ├── mod_Bold.woff │ ├── mod_Bold.woff2 │ ├── mod_Regular.woff │ └── mod_Regular.woff2 ├── getting-started.mdx ├── img │ ├── chevron-down.svg │ ├── favicon.ico │ ├── modio-cog-blue.svg │ ├── modio_reg_black.svg │ └── modio_unreg_white.svg ├── index.html └── js │ └── rest_api_nav.js ├── examples ├── 01_Initialization.cpp ├── 02_ModQueries.cpp ├── 03_Authentication.cpp ├── 04_Threading.cpp ├── 05_SubscriptionManagement.cpp ├── 06_ForceUninstall.cpp ├── 07_ReportMod.cpp ├── 08_SubmitMod.cpp ├── 09_MonetizationWalletManagement.cpp ├── 10_MonetizationPurchase.cpp ├── 11_TempModSets.cpp ├── 12_RefreshEntitlements.cpp ├── 13_MetricsSession.cpp ├── CMakeLists.txt └── advanced │ ├── 01_SteamAuthAndEntitlements │ ├── 01_SteamAuthEntitlements.cpp │ └── CMakeLists.txt │ └── CMakeLists.txt ├── ext ├── CMakeLists.txt ├── asio.cmake ├── httpparser.cmake ├── json.cmake └── lua.cmake ├── modio ├── CMakeLists.txt └── modio │ ├── ModioSDK.h │ ├── cache │ ├── CMakeLists.txt │ ├── ModioCacheService.h │ └── ModioCacheService.ipp │ ├── compression │ ├── CMakeLists.txt │ ├── ModioArchiveReader.h │ ├── ModioArchiveWriter.h │ ├── ModioCompressionService.h │ └── ModioCompressionService.ipp │ ├── core │ ├── CMakeLists.txt │ ├── ModioBuffer.h │ ├── ModioBuffer.ipp │ ├── ModioCoreTypes.h │ ├── ModioCoreTypes.ipp │ ├── ModioCreateModFileParams.h │ ├── ModioCreateModParams.h │ ├── ModioDefaultRequestParameters.h │ ├── ModioEditModParams.h │ ├── ModioErrorCode.h │ ├── ModioErrorCondition.h │ ├── ModioFilterParams.h │ ├── ModioFilterParams.ipp │ ├── ModioFlag.h │ ├── ModioInitializeOptions.h │ ├── ModioInitializeOptions.ipp │ ├── ModioLogBuffer.h │ ├── ModioLogEnum.h │ ├── ModioLogService.h │ ├── ModioLogService.ipp │ ├── ModioLogger.h │ ├── ModioMetricsService.h │ ├── ModioMetricsService.ipp │ ├── ModioModCollectionEntry.h │ ├── ModioModCollectionEntry.ipp │ ├── ModioModDependency.h │ ├── ModioModDependency.ipp │ ├── ModioReportParams.h │ ├── ModioReportParams.ipp │ ├── ModioServices.h │ ├── ModioSplitCompilation.h │ ├── ModioStdTypes.h │ ├── ModioTemporaryModSet.h │ ├── ModioTemporaryModSet.ipp │ └── entities │ │ ├── CMakeLists.txt │ │ ├── ModioEntitlementConsumptionStatus.h │ │ ├── ModioEntitlementConsumptionStatus.ipp │ │ ├── ModioEntitlementConsumptionStatusList.h │ │ ├── ModioEntitlementConsumptionStatusList.ipp │ │ ├── ModioFileMetadata.h │ │ ├── ModioFileMetadata.ipp │ │ ├── ModioGameCommunityOptions.h │ │ ├── ModioGameCommunityOptions.ipp │ │ ├── ModioGameInfo.h │ │ ├── ModioGameInfo.ipp │ │ ├── ModioGameInfoList.h │ │ ├── ModioGameInfoList.ipp │ │ ├── ModioGameMaturityOptions.h │ │ ├── ModioGameMaturityOptions.ipp │ │ ├── ModioGameMonetization.h │ │ ├── ModioGameMonetization.ipp │ │ ├── ModioGameStats.h │ │ ├── ModioGameStats.ipp │ │ ├── ModioList.h │ │ ├── ModioMetricsSessionEndParams.h │ │ ├── ModioMetricsSessionHeartbeatParams.h │ │ ├── ModioMetricsSessionStartParams.h │ │ ├── ModioModCommunityOptions.h │ │ ├── ModioModCommunityOptions.ipp │ │ ├── ModioModDetails.h │ │ ├── ModioModDetails.ipp │ │ ├── ModioModInfo.h │ │ ├── ModioModInfo.ipp │ │ ├── ModioModInfoList.h │ │ ├── ModioModInfoList.ipp │ │ ├── ModioModStats.h │ │ ├── ModioModStats.ipp │ │ ├── ModioModTagOptions.h │ │ ├── ModioModTagOptions.ipp │ │ ├── ModioPagedResult.h │ │ ├── ModioPagedResult.ipp │ │ ├── ModioProfileMaturity.h │ │ ├── ModioProfileMaturity.ipp │ │ ├── ModioTerms.h │ │ ├── ModioTerms.ipp │ │ ├── ModioToken.h │ │ ├── ModioToken.ipp │ │ ├── ModioTransactionRecord.h │ │ ├── ModioTransactionRecord.ipp │ │ ├── ModioURLList.h │ │ ├── ModioURLList.ipp │ │ ├── ModioUser.h │ │ ├── ModioUser.ipp │ │ ├── ModioUserDelegationToken.h │ │ ├── ModioUserDelegationToken.ipp │ │ ├── ModioUserList.h │ │ ├── ModioUserList.ipp │ │ ├── ModioUserRatingList.h │ │ └── ModioUserRatingList.ipp │ ├── detail │ ├── AsioWrapper.h │ ├── CMakeLists.txt │ ├── ConcurrentQueueWrapper.h │ ├── FilesystemWrapper.h │ ├── FilterOperations.inl │ ├── FmtWrapper.h │ ├── HedleyWrapper.h │ ├── JsonWrapper.h │ ├── MbedtlsWrapper.h │ ├── ModioCRC.h │ ├── ModioCompilerMacros.h │ ├── ModioConstants.h │ ├── ModioDefines.h │ ├── ModioExtInitParamStub.h │ ├── ModioFormatters.h │ ├── ModioHashHelpers.h │ ├── ModioJsonHelpers.h │ ├── ModioJsonHelpers.ipp │ ├── ModioLibraryConfigurationHelpers.h │ ├── ModioMovableTypes.h │ ├── ModioObjectTrack.h │ ├── ModioOperationQueue.h │ ├── ModioProfiling.h │ ├── ModioProfiling.ipp │ ├── ModioSDKSessionData.h │ ├── ModioSDKSessionData.ipp │ ├── ModioSDKSharedLibrary.cpp │ ├── ModioSingletons.h │ ├── ModioStringHash.h │ ├── ModioStringHelpers.h │ ├── ModioThrow.h │ ├── ModioTransactional.h │ ├── ModioUndefs.h │ ├── OptionalWrapper.h │ ├── compression │ │ ├── zip │ │ │ ├── ArchiveFileImplementation.h │ │ │ ├── ArchiveFileImplementation.ipp │ │ │ ├── CompressionImplementation.h │ │ │ └── ZipStructures.h │ │ └── zlib │ │ │ ├── deflate_stream.hpp │ │ │ ├── detail │ │ │ ├── bitstream.hpp │ │ │ ├── deflate_stream.hpp │ │ │ ├── deflate_stream.ipp │ │ │ ├── inflate_stream.hpp │ │ │ ├── inflate_stream.ipp │ │ │ ├── ranges.hpp │ │ │ └── window.hpp │ │ │ ├── error.hpp │ │ │ ├── inflate_stream.hpp │ │ │ └── zlib.hpp │ ├── entities │ │ ├── ModioAvatar.h │ │ ├── ModioAvatar.ipp │ │ ├── ModioGalleryList.h │ │ ├── ModioGalleryList.ipp │ │ ├── ModioIcon.h │ │ ├── ModioIcon.ipp │ │ ├── ModioImage.h │ │ ├── ModioImage.ipp │ │ ├── ModioLogo.h │ │ ├── ModioLogo.ipp │ │ ├── ModioUploadPart.h │ │ └── ModioUploadSession.h │ ├── hedley.h │ ├── hmac_sha256.h │ ├── http │ │ ├── ModioRequestBodyKVPContainer.h │ │ ├── PerformRequestImpl.h │ │ ├── ResponseError.h │ │ └── ResponseParser.h │ ├── ops │ │ ├── AddOrUpdateModLogoOp.h │ │ ├── AuthenticateUserByEmailOp.h │ │ ├── DownloadFileOp.h │ │ ├── FetchExternalUpdates.h │ │ ├── GetGameInfoOp.h │ │ ├── GetMutedUsersOp.h │ │ ├── LoadGlobalConfigOverrideFileDataOp.h │ │ ├── LoadModCollectionFromStorage.h │ │ ├── ModManagementLoop.h │ │ ├── ModioAvatarImageType.h │ │ ├── ModioDownloadImage.h │ │ ├── ModioGalleryImageType.h │ │ ├── ModioLogoImageType.h │ │ ├── MuteUserOp.h │ │ ├── PreviewExternalUpdatesOp.h │ │ ├── ReportContentOp.h │ │ ├── RequestEmailAuthCodeOp.h │ │ ├── SaveModCollectionToStorage.h │ │ ├── ServiceInitializationOp.h │ │ ├── Shutdown.h │ │ ├── SubscribeToModOp.h │ │ ├── UnmuteUserOp.h │ │ ├── UnsubscribeFromMod.h │ │ ├── ValidateAllInstalledModsOp.h │ │ ├── ValidateModInstallationOp.h │ │ ├── auth │ │ │ ├── AuthenticateUserByApple.h │ │ │ ├── AuthenticateUserByDiscord.h │ │ │ ├── AuthenticateUserByEpic.h │ │ │ ├── AuthenticateUserByGog.h │ │ │ ├── AuthenticateUserByGoogleIDToken.h │ │ │ ├── AuthenticateUserByGoogleServerSideToken.h │ │ │ ├── AuthenticateUserByItch.h │ │ │ ├── AuthenticateUserByOculus.h │ │ │ ├── AuthenticateUserByOpenID.h │ │ │ ├── AuthenticateUserByPSN.h │ │ │ ├── AuthenticateUserBySteam.h │ │ │ ├── AuthenticateUserBySwitchID.h │ │ │ ├── AuthenticateUserByXBoxLive.h │ │ │ ├── AuthenticateUserExternal.h │ │ │ └── ModioGetTermsOfUseOp.h │ │ ├── compression │ │ │ ├── CompressFolderOp.h │ │ │ ├── ExtractAllToFolderOp.h │ │ │ ├── ExtractEntryDeflateOp.h │ │ │ ├── ExtractEntryStoreOp.h │ │ │ ├── ParseArchiveContentsOp.h │ │ │ └── zip │ │ │ │ ├── AddDirectoryEntryOp.h │ │ │ │ ├── AddFileEntryOp.h │ │ │ │ └── FinalizeArchiveOp.h │ │ ├── http │ │ │ └── PerformRequestAndGetResponseOp.h │ │ ├── metrics │ │ │ ├── MetricsSessionEndOp.h │ │ │ ├── MetricsSessionSendHeartbeatAtIntervalOp.h │ │ │ ├── MetricsSessionSendHeartbeatOnceOp.h │ │ │ └── MetricsSessionStartOp.h │ │ ├── mod │ │ │ ├── AddModDependenciesOp.h │ │ │ ├── ArchiveModOp.h │ │ │ ├── DeleteModDependenciesOp.h │ │ │ ├── GetModDependenciesOp.h │ │ │ ├── GetModDetailsOp.h │ │ │ ├── GetModInfoOp.h │ │ │ ├── GetModMediaAvatarOp.h │ │ │ ├── GetModMediaGalleryOp.h │ │ │ ├── GetModMediaLogoOp.h │ │ │ ├── GetModTagsOp.h │ │ │ ├── ListAllModsOp.h │ │ │ ├── ListUserCreatedModsOp.h │ │ │ ├── SubmitModChangesOp.h │ │ │ ├── SubmitModRatingOp.h │ │ │ ├── SubmitNewModFileOp.h │ │ │ └── SubmitNewModOp.h │ │ ├── modmanagement │ │ │ ├── FetchUserSubscriptionsFromServer.h │ │ │ ├── ForceUninstallModOp.h │ │ │ ├── InstallOrUpdateMod.h │ │ │ ├── ProcessNextModInTempModSet.h │ │ │ ├── ProcessNextModInUserCollection.h │ │ │ └── UninstallMod.h │ │ ├── monetization │ │ │ ├── FetchUserPurchasesOp.h │ │ │ ├── GetUserDelegationTokenOp.h │ │ │ ├── GetUserWalletBalanceOp.h │ │ │ ├── PurchaseModOp.h │ │ │ ├── RefreshUserEntitlementsOp.h │ │ │ ├── RefreshUserEntitlementsPSN.h │ │ │ ├── RefreshUserEntitlementsSteam.h │ │ │ └── RefreshUserEntitlementsXboxLive.h │ │ ├── upload │ │ │ ├── Multipart │ │ │ │ ├── MultipartGetSessionOp.h │ │ │ │ └── MultipartGetUploadedOp.h │ │ │ ├── UploadFileOp.h │ │ │ ├── UploadFilePartOp.h │ │ │ └── UploadMultipartFileOp.h │ │ ├── user │ │ │ └── GetUserMediaOp.h │ │ └── userdata │ │ │ ├── GetUserRatingsOp.h │ │ │ ├── InitializeUserDataOp.h │ │ │ ├── ListUserGamesOp.h │ │ │ ├── RefreshUserDataOp.h │ │ │ ├── SaveUserDataToStorageOp.h │ │ │ └── VerifyUserAuthenticationOp.h │ ├── serialization │ │ ├── ModioAvatarSerialization.h │ │ ├── ModioEntitlementConsumptionStatusListSerialization.h │ │ ├── ModioEntitlementConsumptionStatusSerialization.h │ │ ├── ModioFileMetadataSerialization.h │ │ ├── ModioGalleryListSerialization.h │ │ ├── ModioGameCommunityOptionsSerialization.h │ │ ├── ModioGameInfoListSerialization.h │ │ ├── ModioGameInfoSerialization.h │ │ ├── ModioGameMaturityOptionsSerialization.h │ │ ├── ModioGameMonetizationSerialization.h │ │ ├── ModioGameStatsSerialization.h │ │ ├── ModioIconSerialization.h │ │ ├── ModioImageSerialization.h │ │ ├── ModioJsonHelpersSerialization.h │ │ ├── ModioLogoSerialization.h │ │ ├── ModioMetricsSessionEndParamsSerialization.h │ │ ├── ModioMetricsSessionHeartbeatParamsSerialization.h │ │ ├── ModioMetricsSessionStartParamsSerialization.h │ │ ├── ModioModCollectionEntrySerialization.h │ │ ├── ModioModCommunityOptionsSerialization.h │ │ ├── ModioModDependencySerialization.h │ │ ├── ModioModDetailsSerialization.h │ │ ├── ModioModInfoListSerialization.h │ │ ├── ModioModInfoSerialization.h │ │ ├── ModioModStatsSerialization.h │ │ ├── ModioModTagOptionsSerialization.h │ │ ├── ModioPagedResultSerialization.h │ │ ├── ModioProfileMaturitySerialization.h │ │ ├── ModioResponseErrorSerialization.h │ │ ├── ModioTermsSerialization.h │ │ ├── ModioTokenSerialization.h │ │ ├── ModioTransactionRecordSerialization.h │ │ ├── ModioURLListSerialization.h │ │ ├── ModioUploadPartSerialization.h │ │ ├── ModioUploadSessionSerialization.h │ │ ├── ModioUserDataContainerSerialization.h │ │ ├── ModioUserDelegationTokenSerialization.h │ │ ├── ModioUserListSerialization.h │ │ ├── ModioUserRatingListSerialization.h │ │ └── ModioUserSerialization.h │ └── userdata │ │ ├── ModioUserDataContainer.h │ │ ├── ModioUserDataContainer.ipp │ │ ├── ModioUserProfile.h │ │ └── ModioUserProfile.ipp │ ├── file │ ├── ModioFile.h │ └── ModioFileService.h │ ├── http │ ├── CMakeLists.txt │ ├── ModioHttpParams.h │ ├── ModioHttpParams.ipp │ ├── ModioHttpRequest.h │ ├── ModioHttpRequest.ipp │ ├── ModioHttpService.h │ └── ModioHttpService.ipp │ ├── impl │ ├── CMakeLists.txt │ ├── SDKCore.ipp │ ├── SDKMetrics.ipp │ ├── SDKModManagement.ipp │ ├── SDKModMetadata.ipp │ ├── SDKMonetization.ipp │ ├── SDKPostAsync.h │ ├── SDKPreconditionChecks.h │ ├── SDKUserData.ipp │ └── detail │ │ └── ModioObjectTrack.ipp │ ├── timer │ ├── CMakeLists.txt │ ├── ModioTimer.h │ ├── ModioTimerImplementationBase.h │ ├── ModioTimerService.h │ └── ModioTimerService.ipp │ └── userdata │ └── ModioUserDataService.h └── platform ├── android ├── .gitignore ├── CMakeLists.txt ├── README.mdx ├── android │ ├── AsioIPV6Emulation.h │ ├── CMakeLists.txt │ ├── ModioAndroid.h │ ├── ModioAndroid.ipp │ ├── ModioPlatformDefines.h │ ├── ModioWeakSymbol.h │ ├── android │ │ ├── FileSharedState.h │ │ ├── Guid.h │ │ ├── HttpSharedState.h │ │ ├── LibUringWrapper.h │ │ ├── TimerCallback.h │ │ ├── TimerSharedState.h │ │ └── detail │ │ │ ├── ModioUEPlatformEpilogue.h │ │ │ ├── ModioUEPlatformPreamble.h │ │ │ └── ops │ │ │ ├── file │ │ │ ├── DeleteFileOp.h │ │ │ ├── DeleteFolderOp.h │ │ │ ├── InitializeFileSystemOp.h │ │ │ ├── ReadSomeFromFileBufferedOp.h │ │ │ ├── ReadSomeFromFileOp.h │ │ │ └── WriteSomeToFileOp.h │ │ │ ├── http │ │ │ ├── InitializeHttpOp.h │ │ │ ├── ReadHttpResponseHeadersOp.h │ │ │ ├── ReadSomeResponseBodyOp.h │ │ │ ├── SSLConnectionReadSomeOp.h │ │ │ ├── SSLConnectionWriteOp.h │ │ │ ├── SSLConnectionWriteSomeOp.h │ │ │ ├── SendHttpRequestOp.h │ │ │ └── WaitForSSLHandshakeOp.h │ │ │ └── timer │ │ │ ├── InitializeTimerServiceOp.h │ │ │ ├── ProcessTimersOp.h │ │ │ └── WaitForTimerOp.h │ ├── file │ │ ├── FileObjectImplementation.h │ │ ├── FileSystemImplementation.h │ │ └── StaticDirectoriesImplementation.h │ ├── http │ │ ├── HttpImplementation.h │ │ └── HttpRequestImplementation.h │ ├── jni │ │ ├── AndroidContextService.h │ │ ├── AndroidContextService.ipp │ │ ├── JavaClassWrapper.h │ │ ├── JavaClassWrapper.ipp │ │ ├── JavaClassWrapperModio.h │ │ ├── JavaClassWrapperModio.ipp │ │ ├── JavaHelpers.h │ │ └── JavaHelpers.ipp │ ├── logging │ │ └── LoggerImplementation.h │ ├── platform │ │ └── PlatformUtilImplementation.h │ └── timer │ │ ├── TimerImplementation.h │ │ └── TimerServiceImplementation.h ├── assets │ └── modio.crt ├── doc │ ├── cmake-integration.mdx │ └── getting-started.mdx ├── java │ └── com │ │ └── modio │ │ └── modiosdk │ │ └── Modio.java ├── platform.cmake └── ueplatform.json ├── interface ├── CMakeLists.txt ├── modio │ └── detail │ │ ├── cache │ │ └── ICacheServiceImplementation.h │ │ ├── file │ │ ├── IFileObjectImplementation.h │ │ └── IFileServiceImplementation.h │ │ ├── http │ │ ├── IHttpRequestImplementation.h │ │ └── IHttpServiceImplementation.h │ │ ├── timer │ │ ├── ITimerImplementation.h │ │ └── ITimerServiceImplementation.h │ │ └── userdata │ │ └── IUserDataServiceImplementation.h └── platform.cmake ├── ios ├── CMakeLists.txt ├── README.mdx ├── cmake │ └── ios.toolchain.cmake ├── doc │ ├── cmake-integration.mdx │ └── getting-started.mdx ├── examples │ ├── modioSSO │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── AppViewController.h │ │ ├── AppViewController.m │ │ ├── CMakeLists.txt │ │ ├── ModioSDKHelper.h │ │ ├── ModioSDKHelper.mm │ │ ├── README.adoc │ │ ├── main.m │ │ └── resources │ │ │ ├── Info-iOS.plist │ │ │ ├── MainMenu.storyboard │ │ │ ├── icon.png │ │ │ ├── icons.icns │ │ │ └── modioSSO.entitlements │ └── modioSwift │ │ ├── CMakeLists.txt │ │ ├── ContentView.swift │ │ ├── ModioSDKHelper.h │ │ ├── ModioSDKHelper.mm │ │ ├── README.adoc │ │ ├── modioSDK-BridgingHeader.h │ │ ├── modioSDKApp.swift │ │ └── resources │ │ ├── Info-iOS.plist │ │ ├── icon.png │ │ └── icons.icns ├── ios │ ├── AsioIPV6Emulation.h │ ├── CMakeLists.txt │ ├── ModioPlatformDefines.h │ ├── ModioWeakSymbol.h │ ├── file │ │ ├── FileObjectImplementation.h │ │ ├── FileSystemImplementation.h │ │ └── StaticDirectoriesImplementation.h │ ├── http │ │ ├── HttpImplementation.h │ │ └── HttpRequestImplementation.h │ ├── ios │ │ ├── FileSharedState.h │ │ ├── HttpSharedState.h │ │ ├── TimerCallback.h │ │ ├── TimerSharedState.h │ │ └── detail │ │ │ ├── ModioUEPlatformEpilogue.h │ │ │ ├── ModioUEPlatformPreamble.h │ │ │ └── ops │ │ │ ├── file │ │ │ ├── DeleteFileOp.h │ │ │ ├── DeleteFolderOp.h │ │ │ ├── InitializeFileSystemOp.h │ │ │ ├── ReadSomeFromFileBufferedOp.h │ │ │ ├── ReadSomeFromFileOp.h │ │ │ └── WriteSomeToFileOp.h │ │ │ ├── http │ │ │ ├── InitializeHttpOp.h │ │ │ ├── ReadHttpResponseHeadersOp.h │ │ │ ├── ReadSomeResponseBodyOp.h │ │ │ ├── SendHttpRequestOp.h │ │ │ └── WriteSomeToRequestOp.h │ │ │ └── timer │ │ │ ├── InitializeTimerServiceOp.h │ │ │ ├── ProcessTimersOp.h │ │ │ └── WaitForTimerOp.h │ ├── logging │ │ └── LoggerImplementation.h │ ├── platform │ │ └── PlatformUtilImplementation.h │ └── timer │ │ ├── TimerImplementation.h │ │ └── TimerServiceImplementation.h ├── platform.cmake └── ueplatform.json ├── linux ├── CMakeLists.txt ├── README.mdx ├── doc │ ├── cmake-integration.mdx │ └── getting-started.mdx ├── linux │ ├── AsioIPV6Emulation.h │ ├── CMakeLists.txt │ ├── ModioPlatformDefines.h │ ├── ModioWeakSymbol.h │ ├── file │ │ ├── FileObjectImplementation.h │ │ ├── FileSystemImplementation.h │ │ └── StaticDirectoriesImplementation.h │ ├── http │ │ ├── HttpImplementation.h │ │ └── HttpRequestImplementation.h │ ├── linux │ │ ├── FileSharedState.h │ │ ├── HttpSharedState.h │ │ ├── LibUringWrapper.h │ │ ├── TimerCallback.h │ │ ├── TimerSharedState.h │ │ └── detail │ │ │ ├── ModioUEPlatformEpilogue.h │ │ │ ├── ModioUEPlatformPreamble.h │ │ │ └── ops │ │ │ ├── file │ │ │ ├── DeleteFileOp.h │ │ │ ├── DeleteFolderOp.h │ │ │ ├── InitializeFileSystemOp.h │ │ │ ├── ReadSomeFromFileBufferedOp.h │ │ │ ├── ReadSomeFromFileOp.h │ │ │ └── WriteSomeToFileOp.h │ │ │ ├── http │ │ │ ├── InitializeHttpOp.h │ │ │ ├── ReadHttpResponseHeadersOp.h │ │ │ ├── ReadSomeResponseBodyOp.h │ │ │ ├── SSLConnectionReadSomeOp.h │ │ │ ├── SSLConnectionWriteOp.h │ │ │ ├── SSLConnectionWriteSomeOp.h │ │ │ ├── SendHttpRequestOp.h │ │ │ └── WaitForSSLHandshakeOp.h │ │ │ └── timer │ │ │ ├── InitializeTimerServiceOp.h │ │ │ ├── ProcessTimersOp.h │ │ │ └── WaitForTimerOp.h │ ├── logging │ │ └── LoggerImplementation.h │ ├── platform │ │ └── PlatformUtilImplementation.h │ └── timer │ │ ├── TimerImplementation.h │ │ └── TimerServiceImplementation.h ├── platform.cmake └── ueplatform.json ├── macos ├── CMakeLists.txt ├── README.adoc ├── README.mdx ├── doc │ ├── cmake-integration.mdx │ └── getting-started.mdx ├── macos │ ├── AsioIPV6Emulation.h │ ├── CMakeLists.txt │ ├── ModioPlatformDefines.h │ ├── ModioWeakSymbol.h │ ├── file │ │ ├── FileObjectImplementation.h │ │ ├── FileSystemImplementation.h │ │ └── StaticDirectoriesImplementation.h │ ├── http │ │ ├── HttpImplementation.h │ │ └── HttpRequestImplementation.h │ ├── logging │ │ └── LoggerImplementation.h │ ├── macos │ │ ├── FileSharedState.h │ │ ├── HttpSharedState.h │ │ ├── TimerCallback.h │ │ ├── TimerSharedState.h │ │ └── detail │ │ │ ├── ModioUEPlatformEpilogue.h │ │ │ ├── ModioUEPlatformPreamble.h │ │ │ └── ops │ │ │ ├── file │ │ │ ├── DeleteFileOp.h │ │ │ ├── DeleteFolderOp.h │ │ │ ├── InitializeFileSystemOp.h │ │ │ ├── ReadSomeFromFileBufferedOp.h │ │ │ ├── ReadSomeFromFileOp.h │ │ │ └── WriteSomeToFileOp.h │ │ │ ├── http │ │ │ ├── InitializeHttpOp.h │ │ │ ├── ReadHttpResponseHeadersOp.h │ │ │ ├── ReadSomeResponseBodyOp.h │ │ │ ├── SendHttpRequestOp.h │ │ │ └── WriteSomeToRequestOp.h │ │ │ └── timer │ │ │ ├── InitializeTimerServiceOp.h │ │ │ ├── ProcessTimersOp.h │ │ │ └── WaitForTimerOp.h │ ├── platform │ │ └── PlatformUtilImplementation.h │ └── timer │ │ ├── TimerImplementation.h │ │ └── TimerServiceImplementation.h ├── platform.cmake └── ueplatform.json ├── ms-common ├── CMakeLists.txt └── include │ ├── ModioWeakSymbol.h │ └── common │ ├── FileSharedState.h │ ├── HttpCallback.h │ ├── HttpSharedState.h │ ├── HttpSharedState.ipp │ ├── UTF16Support.h │ ├── detail │ └── ops │ │ ├── file │ │ ├── DeleteFileOp.h │ │ ├── DeleteFolderOp.h │ │ ├── GetFolderSize.h │ │ ├── InitializeFileSystemOp.h │ │ ├── ReadSomeFromFileBufferedOp.h │ │ ├── ReadSomeFromFileOp.h │ │ ├── StreamReadOp.h │ │ ├── StreamWriteOp.h │ │ └── WriteSomeToFileOp.h │ │ └── http │ │ ├── InitializeHttpOp.h │ │ ├── ReadHttpResponseHeadersOp.h │ │ ├── ReadSomeResponseBodyOp.h │ │ ├── SendHttpRequestOp.h │ │ └── WriteSomeToRequestOp.h │ ├── file │ ├── FileObjectImplementation.h │ ├── FileSystemImplementation.h │ └── StaticDirectoriesImplementation.h │ ├── http │ ├── HttpImplementation.h │ ├── HttpRequestImplementation.h │ └── HttpRequestImplementation.ipp │ └── logging │ └── LoggerImplementation.h └── win32 ├── CMakeLists.txt ├── README.mdx ├── doc ├── cmake-integration.mdx └── getting-started.mdx ├── platform.cmake ├── ueplatform.json └── win32 ├── CMakeLists.txt ├── ModioPlatformDefines.h ├── file ├── FileObjectImplementation.h ├── FileSystemImplementation.h └── StaticDirectoriesImplementation.h ├── http └── HttpImplementation.h ├── logging └── LoggerImplementation.h ├── platform └── PlatformUtilImplementation.h ├── timer ├── TimerImplementation.h └── TimerServiceImplementation.h └── win32 ├── HttpSharedState.h ├── TimerCallback.h ├── TimerSharedState.h └── detail ├── ModioUEPlatformEpilogue.h ├── ModioUEPlatformPreamble.h └── ops ├── file └── WriteSomeToFileOp.h ├── http └── InitializeHttpOp.h └── timer ├── InitializeTimerServiceOp.h ├── ProcessTimersOp.h └── WaitForTimerOp.h /.editorconfig: -------------------------------------------------------------------------------- 1 | [*.{c++,cc,cpp,cppm,cxx,h,h++,hh,hpp,hxx,inl,ipp,ixx,tlh,tli}] 2 | cpp_generate_documentation_comments = doxygen_triple_slash 3 | 4 | 5 | [*.{yml,yaml}] 6 | indent_style = space 7 | indent_size = 2 8 | 9 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | This issue tracker is for the use of developers integrating the mod.io SDK and Plugins into their games. If you are a player wanting support for a game that uses mod.io, please contact the game developer directly. 2 | 3 | To submit a private issue report if you wish to attach confidential data, please email the following information to support@mod.io instead. 4 | 5 | 6 | ### Bug Report 7 | 8 | Please provide at least one of the following: 9 | * [ ] Detailed steps to reproduce the issue 10 | * [ ] SDK/Plugin logs 11 | * [ ] A self-contained project that reproduces the issue 12 | 13 | #### Description 14 | 15 | [Description of the bug] 16 | 17 | #### Steps to Reproduce 18 | 19 | 1. [First Step] 20 | 2. [Second Step] 21 | 3. [and so on...] 22 | 23 | **Expected behavior:** [What you expected to happen] 24 | 25 | **Actual behavior:** [What actually happened] 26 | 27 | #### Environment 28 | 29 | * Which version of the plugin experiences the issue? If unsure, the .modio file in the root of the SDK contains the version number. 30 | * Which OS does the issue occur in? Which version of the OS? 31 | * Which compiler/toolchain does the issue occur with? 32 | 33 | 34 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Visual studio files 2 | .vs/ 3 | CMakeSettings.json 4 | *.user 5 | 6 | # Output directory 7 | out/ 8 | build/ 9 | installed-sdk/ 10 | 11 | # Generated documentation shouldn't be submitted 12 | doc/**/*.pdf 13 | doc/scripts/Gemfile.lock 14 | .ccls-cache/ 15 | .vscode 16 | .DS_Store 17 | xcuserdata 18 | 19 | # Android Ignores 20 | 21 | # Gradle files 22 | .gradle/ 23 | build/ 24 | 25 | # Local configuration file (sdk path, etc) 26 | local.properties 27 | 28 | # Log/OS Files 29 | *.log 30 | 31 | # Android Studio generated files and folders 32 | captures/ 33 | .externalNativeBuild/ 34 | .cxx/ 35 | *.apk 36 | output.json 37 | 38 | # IntelliJ 39 | *.iml 40 | .idea/ 41 | misc.xml 42 | deploymentTargetDropDown.xml 43 | render.experimental.xml 44 | 45 | # Keystore files 46 | *.jks 47 | *.keystore 48 | 49 | # Google Services (e.g. APIs or Firebase) 50 | google-services.json 51 | 52 | # Android Profiling 53 | *.hprof -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "ext/asio"] 2 | path = ext/asio 3 | url = https://github.com/modio/modio-integration-asio 4 | branch = master 5 | [submodule "ext/optional"] 6 | path = ext/optional 7 | url = https://github.com/modio/modio-integration-optional 8 | [submodule "ext/filesystem"] 9 | path = ext/filesystem 10 | url = https://github.com/modio/modio-integration-filesystem 11 | branch = ghc_os_custom 12 | [submodule "ext/fmt"] 13 | path = ext/fmt 14 | url = https://github.com/modio/modio-integration-fmt.git 15 | [submodule "ext/utfcpp"] 16 | path = ext/utfcpp 17 | url = https://github.com/nemtrif/utfcpp 18 | [submodule "ext/httpparser"] 19 | path = ext/httpparser 20 | url = https://github.com/nekipelov/httpparser.git 21 | [submodule "ext/json"] 22 | path = ext/json 23 | url = https://github.com/nlohmann/json.git 24 | [submodule "ext/mbedtls"] 25 | path = ext/mbedtls 26 | url = https://github.com/ARMmbed/mbedtls.git 27 | [submodule "ext/expected"] 28 | path = ext/expected 29 | url = https://github.com/TartanLlama/expected.git 30 | [submodule "ext/function2"] 31 | path = ext/function2 32 | url = https://github.com/Naios/function2.git 33 | [submodule "ext/concurrentqueue"] 34 | path = ext/concurrentqueue 35 | url = https://github.com/cameron314/concurrentqueue.git 36 | -------------------------------------------------------------------------------- /.modio: -------------------------------------------------------------------------------- 1 | 3232d -------------------------------------------------------------------------------- /Modio.natvis: -------------------------------------------------------------------------------- 1 | ?xml version="1.0" encoding="utf-8"?> 2 | 3 | 4 | 5 | {{ Value = {m_value}}} 6 | {{Not Set}} 7 | 8 | 9 | 10 | {{ID = {Value}}} 11 | 12 | 13 | 14 | {{{_Myval} - {message()}}} 15 | 16 | 17 | -------------------------------------------------------------------------------- /cmake/GetGitRevisionDescription.cmake.in: -------------------------------------------------------------------------------- 1 | # 2 | # Internal file for GetGitRevisionDescription.cmake 3 | # 4 | # Requires CMake 2.6 or newer (uses the 'function' command) 5 | # 6 | # Original Author: 7 | # 2009-2010 Ryan Pavlik 8 | # http://academic.cleardefinition.com 9 | # Iowa State University HCI Graduate Program/VRAC 10 | # 11 | # Copyright Iowa State University 2009-2010. 12 | # Distributed under the Boost Software License, Version 1.0. 13 | # (See accompanying file LICENSE_1_0.txt or copy at 14 | # http://www.boost.org/LICENSE_1_0.txt) 15 | 16 | set(HEAD_HASH) 17 | 18 | file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024) 19 | 20 | string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS) 21 | if(HEAD_CONTENTS MATCHES "ref") 22 | # named branch 23 | string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}") 24 | if(EXISTS "@GIT_DIR@/${HEAD_REF}") 25 | configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) 26 | else() 27 | configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY) 28 | file(READ "@GIT_DATA@/packed-refs" PACKED_REFS) 29 | if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}") 30 | set(HEAD_HASH "${CMAKE_MATCH_1}") 31 | endif() 32 | endif() 33 | else() 34 | # detached HEAD 35 | configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY) 36 | endif() 37 | 38 | if(NOT HEAD_HASH) 39 | file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024) 40 | string(STRIP "${HEAD_HASH}" HEAD_HASH) 41 | endif() 42 | -------------------------------------------------------------------------------- /cmake/ModioGeneratedVariables.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | // ModioGeneratedVariables.h automatically generated by CMake - don't edit it manually! 12 | 13 | #pragma once 14 | 15 | #cmakedefine MODIO_COMMIT_HASH "@MODIO_COMMIT_HASH@" 16 | -------------------------------------------------------------------------------- /cmake/initialise-platform.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2021 mod.io Pty Ltd. 3 | # 4 | # This file is part of the mod.io SDK. 5 | # 6 | # Distributed under the MIT License. (See accompanying file LICENSE or 7 | # view online at ) 8 | # 9 | # 10 | 11 | include_guard(GLOBAL) 12 | include(platform-defines) 13 | 14 | macro(list_subdirs result curdir) 15 | FILE(GLOB children RELATIVE ${curdir} ${curdir}/*) 16 | SET(dirlist "") 17 | FOREACH(child ${children}) 18 | IF(IS_DIRECTORY ${curdir}/${child}) 19 | SET(dirlist ${dirlist} ${child}) 20 | ENDIF() 21 | ENDFOREACH() 22 | SET(${result} ${dirlist}) 23 | endmacro() 24 | 25 | message("Fetching platform dependencies...") 26 | 27 | #iterate through all the currently installed platform directories 28 | list_subdirs(modio_platform_dirs ${MODIO_ROOT_DIR}/platform ) 29 | 30 | #add_subdirectory will only populate targets for the currently valid MODIO_PLATFORM 31 | foreach (platform_dir ${modio_platform_dirs}) 32 | set(full_platform_dir ${MODIO_ROOT_DIR}/platform/${platform_dir}) 33 | if (EXISTS ${full_platform_dir}/platform.cmake) 34 | include(${full_platform_dir}/platform.cmake) 35 | endif() 36 | endforeach() 37 | 38 | 39 | add_generated_defines_to_platform() 40 | -------------------------------------------------------------------------------- /cmake/modio-packaging.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2021 mod.io Pty Ltd. 3 | # 4 | # This file is part of the mod.io SDK. 5 | # 6 | # Distributed under the MIT License. (See accompanying file LICENSE or 7 | # view online at ) 8 | # 9 | # 10 | 11 | macro(create_target_installing_component Component ) 12 | add_custom_target(component_${Component} 13 | COMMAND ${CMAKE_COMMAND} --install ${CMAKE_CURRENT_BINARY_DIR} --component ${Component} 14 | DEPENDS ${MODIO_TARGET_NAME} 15 | # WORKING_DIRECTORY directory of the modio target 16 | ) 17 | set_target_properties(component_${Component} PROPERTIES FOLDER "Installation/Packaging") 18 | endmacro() 19 | 20 | 21 | create_target_installing_component(header_only) 22 | 23 | -------------------------------------------------------------------------------- /cmake/platform-defines.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2021 mod.io Pty Ltd. 3 | # 4 | # This file is part of the mod.io SDK. 5 | # 6 | # Distributed under the MIT License. (See accompanying file LICENSE or 7 | # view online at ) 8 | # 9 | # 10 | 11 | include(GetGitRevisionDescription) 12 | include(modio-version) 13 | 14 | function (add_generated_defines_to_platform) 15 | message("Initializing platform") 16 | 17 | set(MODIO_COMMIT_HASH "NOT_SET") 18 | #get_git_head_revision(MODIO_REFSPEC MODIO_COMMIT_HASH) 19 | 20 | #if (NOT MODIO_REFSPEC) 21 | #set(MODIO_REFSPEC UNKNOWN) 22 | #endif() 23 | #if (NOT MODIO_COMMIT_HASH) 24 | #set(MODIO_COMMIT_HASH UNKNOWN) 25 | #endif() 26 | 27 | GetVersionInfo("main" MAIN_COMMIT_COUNT CURRENT_BRANCH_PREFIX CURRENT_BRANCH_COMMIT_COUNT FALSE) 28 | 29 | set(MODIO_COMMIT_HASH "${MAIN_COMMIT_COUNT}${CURRENT_BRANCH_PREFIX}${CURRENT_BRANCH_COMMIT_COUNT}") 30 | 31 | message(STATUS "Setting revision to ${MODIO_COMMIT_HASH}") 32 | 33 | message(STATUS "Generating global definitions in ${CMAKE_BINARY_DIR}/generated/ModioGeneratedVariables.h") 34 | 35 | set(MODIO_TARGET_PLATFORM_ID ${MODIO_PLATFORM}) 36 | configure_file(cmake/ModioGeneratedVariables.h.in ${CMAKE_BINARY_DIR}/generated/ModioGeneratedVariables.h) 37 | target_compile_definitions(platform INTERFACE MODIO_TARGET_PLATFORM_ID="${MODIO_TARGET_PLATFORM_ID}" MODIO_COMMIT_HASH="${MODIO_COMMIT_HASH}") 38 | 39 | endfunction() 40 | -------------------------------------------------------------------------------- /doc/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modio/modio-sdk/eacc18dc4c1d8ee2404da4373f1ecdd4521a9b52/doc/.nojekyll -------------------------------------------------------------------------------- /doc/assets/fonts/EuclidCircularB-Bold-WebS-85b3e0686fa738474f5c5cbae48da808.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modio/modio-sdk/eacc18dc4c1d8ee2404da4373f1ecdd4521a9b52/doc/assets/fonts/EuclidCircularB-Bold-WebS-85b3e0686fa738474f5c5cbae48da808.woff -------------------------------------------------------------------------------- /doc/assets/fonts/EuclidCircularB-Bold-WebS-f996f0f3c9d7e69a3a8e9d9e5f3c8e5c.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modio/modio-sdk/eacc18dc4c1d8ee2404da4373f1ecdd4521a9b52/doc/assets/fonts/EuclidCircularB-Bold-WebS-f996f0f3c9d7e69a3a8e9d9e5f3c8e5c.woff2 -------------------------------------------------------------------------------- /doc/assets/fonts/EuclidCircularB-Regular-WebS-a2e11c861d5a9f3541d340c87e5403ea.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modio/modio-sdk/eacc18dc4c1d8ee2404da4373f1ecdd4521a9b52/doc/assets/fonts/EuclidCircularB-Regular-WebS-a2e11c861d5a9f3541d340c87e5403ea.woff2 -------------------------------------------------------------------------------- /doc/assets/fonts/EuclidCircularB-Regular-WebS-bf8d727ab20d44bfe4c19326a7f7656e.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modio/modio-sdk/eacc18dc4c1d8ee2404da4373f1ecdd4521a9b52/doc/assets/fonts/EuclidCircularB-Regular-WebS-bf8d727ab20d44bfe4c19326a7f7656e.woff -------------------------------------------------------------------------------- /doc/assets/fonts/mod_Bold-6a828d6c1ee525b8ccdaab51a5555dad.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modio/modio-sdk/eacc18dc4c1d8ee2404da4373f1ecdd4521a9b52/doc/assets/fonts/mod_Bold-6a828d6c1ee525b8ccdaab51a5555dad.woff -------------------------------------------------------------------------------- /doc/assets/fonts/mod_Bold-ef576a3617e7d78bf072ca28fac9ec27.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modio/modio-sdk/eacc18dc4c1d8ee2404da4373f1ecdd4521a9b52/doc/assets/fonts/mod_Bold-ef576a3617e7d78bf072ca28fac9ec27.woff2 -------------------------------------------------------------------------------- /doc/assets/fonts/mod_Regular-64d7bd55cab96b676cc4ab2cf89c717e.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modio/modio-sdk/eacc18dc4c1d8ee2404da4373f1ecdd4521a9b52/doc/assets/fonts/mod_Regular-64d7bd55cab96b676cc4ab2cf89c717e.woff2 -------------------------------------------------------------------------------- /doc/assets/fonts/mod_Regular-db0da0c22c8114761de7dede60f78da4.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modio/modio-sdk/eacc18dc4c1d8ee2404da4373f1ecdd4521a9b52/doc/assets/fonts/mod_Regular-db0da0c22c8114761de7dede60f78da4.woff -------------------------------------------------------------------------------- /doc/assets/js/05ae0fb1.9232a171.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkmodio_docs=self.webpackChunkmodio_docs||[]).push([[1697],{6623:(e,s,r)=>{r.r(s),r.d(s,{default:()=>i});var c=r(8774),o=r(955),t=r(4848);function i(){return(0,t.jsx)(o.A,{children:(0,t.jsx)("div",{className:"container margin-vert--xl",children:(0,t.jsx)("div",{className:"row",children:(0,t.jsxs)("div",{className:"col col--6 col--offset-3",children:[(0,t.jsx)("p",{className:"hero__title",children:"Server error"}),(0,t.jsxs)("p",{children:["You may try to refresh the page or",(0,t.jsx)(c.A,{to:"https://mod.io/contact",children:"contact us"}),"if the problem persists."]})]})})})})}}}]); -------------------------------------------------------------------------------- /doc/assets/js/0879cf16.0fc9b352.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkmodio_docs=self.webpackChunkmodio_docs||[]).push([[673],{941:(e,o,s)=>{s.d(o,{A:()=>n});var r=s(955),a=s(4848);function n(e){let{children:o}=e;return(0,a.jsx)(r.A,{children:(0,a.jsx)("div",{className:"container margin-vert--xl",children:(0,a.jsx)("div",{className:"row",children:(0,a.jsx)("div",{className:"col col--6 col--offset-3",children:o})})})})}},968:(e,o,s)=>{s.r(o),s.d(o,{default:()=>t});var r=s(941),a=s(8774),n=s(4848);function t(){return(0,n.jsxs)(r.A,{children:[(0,n.jsx)("p",{className:"tw-text-xl tw-font-bold",children:"Unauthorized Access - PlayStation 5 Documentation"}),(0,n.jsx)("p",{children:"For access to our PlayStation Documentation, we need approval from Sony that you are an authorized PlayStation developer."}),(0,n.jsxs)("p",{children:["Instructions for verifying your access can be found in our",(0,n.jsx)(a.A,{to:"/platforms/playstation/#sdk-access",children:"Console SDK"})," documentation."]}),(0,n.jsxs)("p",{children:["If you are already authorized and believe you are seeing this in error, please reach out to your mod.io account manager or",(0,n.jsx)(a.A,{to:"mailto:developers@mod.io",children:"developers@mod.io"}),"to resolve this issue."]})]})}}}]); -------------------------------------------------------------------------------- /doc/assets/js/0ce884cc.5bd0a887.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkmodio_docs=self.webpackChunkmodio_docs||[]).push([[881],{941:(e,o,n)=>{n.d(o,{A:()=>i});var r=n(955),s=n(4848);function i(e){let{children:o}=e;return(0,s.jsx)(r.A,{children:(0,s.jsx)("div",{className:"container margin-vert--xl",children:(0,s.jsx)("div",{className:"row",children:(0,s.jsx)("div",{className:"col col--6 col--offset-3",children:o})})})})}},3626:(e,o,n)=>{n.r(o),n.d(o,{default:()=>c});var r=n(941),s=n(8774),i=n(4848);function c(){return(0,i.jsxs)(r.A,{children:[(0,i.jsx)("p",{className:"tw-text-xl tw-font-bold",children:"Unauthorized Access - Nintendo Switch Documentation"}),(0,i.jsx)("p",{children:"For access to our Nintendo Switch Documentation, we need approval from Nintendo that you are an authorized Nintendo Switch developer."}),(0,i.jsxs)("p",{children:["Instructions for verifying your access can be found in our",(0,i.jsx)(s.A,{to:"/platforms/switch/#sdk-access",children:"Console SDK"})," documentation."]}),(0,i.jsxs)("p",{children:["If you are already authorized and believe you are seeing this in error, please reach out to your mod.io account manager or",(0,i.jsx)(s.A,{href:"mailto:developers@mod.io",children:"developers@mod.io"}),"to resolve this issue."]})]})}}}]); -------------------------------------------------------------------------------- /doc/assets/js/1303.b2925fda.js.LICENSE.txt: -------------------------------------------------------------------------------- 1 | /*! 2 | Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable 3 | Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com) 4 | Licensed under The MIT License (http://opensource.org/licenses/MIT) 5 | */ 6 | 7 | /*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */ 8 | 9 | /*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */ 10 | -------------------------------------------------------------------------------- /doc/assets/js/17896441.11c71f9b.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkmodio_docs=self.webpackChunkmodio_docs||[]).push([[8401],{8195:(e,t,r)=>{r.d(t,{A:()=>c});var s=r(6446),d=r(9365),l=r(6540),o=r(4848);var n=r(1470);const a=e=>{let{children:t,colWidths:r={},stripes:s="odd",border:d=0}=e;const n=(0,l.useRef)(null),a=`${d}px`;let c="";return c="odd"===s?"odd:tw-bg-table-stripes even:tw-bg-transparent":"even:tw-bg-table-stripes odd:tw-bg-transparent",(0,l.useEffect)((()=>{const e=n.current.querySelector("thead"),t=n.current.querySelectorAll("tr"),s=n.current.querySelectorAll("th, td");e.style.visibility="hidden",s.forEach(((e,t)=>{e.style.width=r[t]??"auto",e.style.borderWidth=a,e.style.overflowWrap="anywhere"})),t.forEach(((e,t)=>{0!==t&&(e.className=c),e.style.borderWidth=a}))}),[]),(0,o.jsx)("div",{ref:n,children:t})},c={...s.A,TabItem:function(e){return(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(d.A,{className:"tw-rounded-md",...e})})},Tabs:function(e){return(0,o.jsx)("div",{className:"tw-border tw-border-solid tw-border-skyblue tw-rounded-md tw-bg-darkslategray tw-p-4 tw-mb-4",children:(0,o.jsx)(n.A,{...e})})},RefTable:a}}}]); -------------------------------------------------------------------------------- /doc/assets/js/1a4e3797.3546f7d6.js.LICENSE.txt: -------------------------------------------------------------------------------- 1 | /*! algoliasearch-lite.umd.js | 4.24.0 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */ 2 | -------------------------------------------------------------------------------- /doc/assets/js/2237.e3f2ebcc.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkmodio_docs=self.webpackChunkmodio_docs||[]).push([[2237],{3363:(e,t,o)=>{o.d(t,{A:()=>a});o(6540);var i=o(8215),n=o(1312),s=o(1107),r=o(4848);function a(e){let{className:t}=e;return(0,r.jsx)("main",{className:(0,i.A)("container margin-vert--xl",t),children:(0,r.jsx)("div",{className:"row",children:(0,r.jsxs)("div",{className:"col col--6 col--offset-3",children:[(0,r.jsx)(s.A,{as:"h1",className:"hero__title",children:(0,r.jsx)(n.A,{id:"theme.NotFound.title",description:"The title of the 404 page",children:"Page Not Found"})}),(0,r.jsx)("p",{children:(0,r.jsx)(n.A,{id:"theme.NotFound.p1",description:"The first paragraph of the 404 page",children:"We could not find what you were looking for."})}),(0,r.jsx)("p",{children:(0,r.jsx)(n.A,{id:"theme.NotFound.p2",description:"The 2nd paragraph of the 404 page",children:"Please contact the owner of the site that linked you to the original URL and let them know their link is broken."})})]})})})}},2237:(e,t,o)=>{o.r(t),o.d(t,{default:()=>d});o(6540);var i=o(1312),n=o(9024),s=o(955),r=o(3363),a=o(4848);function d(){const e=(0,i.T)({id:"theme.NotFound.title",message:"Page Not Found"});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.be,{title:e}),(0,a.jsx)(s.A,{children:(0,a.jsx)(r.A,{})})]})}}}]); -------------------------------------------------------------------------------- /doc/assets/js/416.0a5ddd77.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkmodio_docs=self.webpackChunkmodio_docs||[]).push([[416],{416:(s,o,c)=>{c.r(o)}}]); -------------------------------------------------------------------------------- /doc/assets/js/4d3f9fe4.4612858b.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkmodio_docs=self.webpackChunkmodio_docs||[]).push([[7742],{941:(e,o,r)=>{r.d(o,{A:()=>c});var s=r(955),n=r(4848);function c(e){let{children:o}=e;return(0,n.jsx)(s.A,{children:(0,n.jsx)("div",{className:"container margin-vert--xl",children:(0,n.jsx)("div",{className:"row",children:(0,n.jsx)("div",{className:"col col--6 col--offset-3",children:o})})})})}},161:(e,o,r)=>{r.r(o),r.d(o,{default:()=>i});var s=r(941),n=r(8774),c=r(4848);function i(){return(0,c.jsxs)(s.A,{children:[(0,c.jsx)("p",{className:"tw-text-xl tw-font-bold",children:"Unauthorized Access - Xbox Documentation"}),(0,c.jsx)("p",{children:"For access to our Xbox Documentation, we need approval from Microsoft that you are an authorized XBox developer."}),(0,c.jsxs)("p",{children:["Instructions for verifying your access can be found in our",(0,c.jsx)(n.A,{to:"/platforms/gdk/#sdk-access",children:"Console SDK"})," documentation."]}),(0,c.jsxs)("p",{children:["If you are already authorized and believe you are seeing this in error, please reach out to your mod.io account manager or",(0,c.jsx)(n.A,{href:"mailto:developers@mod.io",children:"developers@mod.io"}),"to resolve this issue."]})]})}}}]); -------------------------------------------------------------------------------- /doc/assets/js/5e95c892.9bed6022.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkmodio_docs=self.webpackChunkmodio_docs||[]).push([[9647],{7121:(e,s,r)=>{r.r(s),r.d(s,{default:()=>t});r(6540);var c=r(8215),o=r(9024),d=r(7559),u=r(2831),a=r(955),n=r(4848);function t(e){return(0,n.jsx)(o.e3,{className:(0,c.A)(d.G.wrapper.docsPages),children:(0,n.jsx)(a.A,{children:(0,u.v)(e.route.routes)})})}}}]); -------------------------------------------------------------------------------- /doc/assets/js/7106.16bfe2ec.js.LICENSE.txt: -------------------------------------------------------------------------------- 1 | /*! 2 | * Wait for document loaded before starting the execution 3 | */ 4 | 5 | /*! @license DOMPurify 3.1.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.6/LICENSE */ 6 | 7 | /*! Check if previously processed */ 8 | 9 | /*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */ 10 | -------------------------------------------------------------------------------- /doc/assets/js/7b283257.6c95601c.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkmodio_docs=self.webpackChunkmodio_docs||[]).push([[5753],{941:(e,o,s)=>{s.d(o,{A:()=>n});var r=s(955),a=s(4848);function n(e){let{children:o}=e;return(0,a.jsx)(r.A,{children:(0,a.jsx)("div",{className:"container margin-vert--xl",children:(0,a.jsx)("div",{className:"row",children:(0,a.jsx)("div",{className:"col col--6 col--offset-3",children:o})})})})}},3697:(e,o,s)=>{s.r(o),s.d(o,{default:()=>t});var r=s(941),a=s(8774),n=s(4848);function t(){return(0,n.jsxs)(r.A,{children:[(0,n.jsx)("p",{className:"tw-text-xl tw-font-bold",children:"Unauthorized Access - PlayStation\xae4 Documentation"}),(0,n.jsx)("p",{children:"For access to our PlayStation Documentation, we need approval from Sony that you are an authorized PlayStation developer."}),(0,n.jsxs)("p",{children:["Instructions for verifying your access can be found in our",(0,n.jsx)(a.A,{to:"/platforms/playstation/#sdk-access",children:"Console SDK"})," documentation."]}),(0,n.jsxs)("p",{children:["If you are already authorized and believe you are seeing this in error, please reach out to your mod.io account manager or",(0,n.jsx)(a.A,{to:"mailto:developers@mod.io",children:"developers@mod.io"}),"to resolve this issue."]})]})}}}]); -------------------------------------------------------------------------------- /doc/assets/js/8158.9593b541.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkmodio_docs=self.webpackChunkmodio_docs||[]).push([[8158],{8158:(o,c,s)=>{s.r(c),s.d(c,{DocSearchModal:()=>a.a1});var a=s(3219)}}]); -------------------------------------------------------------------------------- /doc/assets/js/8913.78590cf1.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkmodio_docs=self.webpackChunkmodio_docs||[]).push([[8913],{8913:(s,o,c)=>{c.r(o)}}]); -------------------------------------------------------------------------------- /doc/assets/js/a7456010.17260dd7.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkmodio_docs=self.webpackChunkmodio_docs||[]).push([[1235],{8552:s=>{s.exports=JSON.parse('{"name":"docusaurus-plugin-content-pages","id":"default"}')}}]); -------------------------------------------------------------------------------- /doc/assets/js/a7bd4aaa.3ca9d01e.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkmodio_docs=self.webpackChunkmodio_docs||[]).push([[7098],{4532:(n,e,s)=>{s.r(e),s.d(e,{default:()=>l});s(6540);var o=s(9024),r=s(2967),t=s(2252),i=s(2831),c=s(1463),d=s(4848);function u(n){const{version:e}=n;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(c.A,{version:e.version,tag:(0,r.tU)(e.pluginId,e.version)}),(0,d.jsx)(o.be,{children:e.noIndex&&(0,d.jsx)("meta",{name:"robots",content:"noindex, nofollow"})})]})}function a(n){const{version:e,route:s}=n;return(0,d.jsx)(o.e3,{className:e.className,children:(0,d.jsx)(t.n,{version:e,children:(0,i.v)(s.routes)})})}function l(n){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(u,{...n}),(0,d.jsx)(a,{...n})]})}}}]); -------------------------------------------------------------------------------- /doc/assets/js/aba21aa0.9c3e38ee.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkmodio_docs=self.webpackChunkmodio_docs||[]).push([[5742],{7093:s=>{s.exports=JSON.parse('{"name":"docusaurus-plugin-content-docs","id":"default"}')}}]); -------------------------------------------------------------------------------- /doc/assets/js/c141421f.a7090503.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkmodio_docs=self.webpackChunkmodio_docs||[]).push([[957],{936:e=>{e.exports=JSON.parse('{"name":"docusaurus-theme-search-algolia","id":"default"}')}}]); -------------------------------------------------------------------------------- /doc/chapters/diagrams/general-overview/modio_sdk_flow-init.puml: -------------------------------------------------------------------------------- 1 | @startuml 2 | start 3 | :Videogame Starts; 4 | :User Generated Content Interface; 5 | fork 6 | repeat :RunPendingHandlers; 7 | repeat while (SDK did "Shutdown") is (no) 8 | fork again 9 | -[dashed]-> 10 | #SkyBlue:Initialize**Async**; 11 | -[dashed]-> 12 | #SkyBlue:ListAllMods**Async**; 13 | -[dashed]-> 14 | #SkyBlue:Shutdown**Async**; 15 | end merge 16 | end 17 | @enduml 18 | -------------------------------------------------------------------------------- /doc/fonts/EuclidCircularB-Bold-WebS.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modio/modio-sdk/eacc18dc4c1d8ee2404da4373f1ecdd4521a9b52/doc/fonts/EuclidCircularB-Bold-WebS.woff -------------------------------------------------------------------------------- /doc/fonts/EuclidCircularB-Bold-WebS.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modio/modio-sdk/eacc18dc4c1d8ee2404da4373f1ecdd4521a9b52/doc/fonts/EuclidCircularB-Bold-WebS.woff2 -------------------------------------------------------------------------------- /doc/fonts/EuclidCircularB-Regular-WebS.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modio/modio-sdk/eacc18dc4c1d8ee2404da4373f1ecdd4521a9b52/doc/fonts/EuclidCircularB-Regular-WebS.woff -------------------------------------------------------------------------------- /doc/fonts/EuclidCircularB-Regular-WebS.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modio/modio-sdk/eacc18dc4c1d8ee2404da4373f1ecdd4521a9b52/doc/fonts/EuclidCircularB-Regular-WebS.woff2 -------------------------------------------------------------------------------- /doc/fonts/mod_Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modio/modio-sdk/eacc18dc4c1d8ee2404da4373f1ecdd4521a9b52/doc/fonts/mod_Bold.woff -------------------------------------------------------------------------------- /doc/fonts/mod_Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modio/modio-sdk/eacc18dc4c1d8ee2404da4373f1ecdd4521a9b52/doc/fonts/mod_Bold.woff2 -------------------------------------------------------------------------------- /doc/fonts/mod_Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modio/modio-sdk/eacc18dc4c1d8ee2404da4373f1ecdd4521a9b52/doc/fonts/mod_Regular.woff -------------------------------------------------------------------------------- /doc/fonts/mod_Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modio/modio-sdk/eacc18dc4c1d8ee2404da4373f1ecdd4521a9b52/doc/fonts/mod_Regular.woff2 -------------------------------------------------------------------------------- /doc/img/chevron-down.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /doc/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modio/modio-sdk/eacc18dc4c1d8ee2404da4373f1ecdd4521a9b52/doc/img/favicon.ico -------------------------------------------------------------------------------- /doc/js/rest_api_nav.js: -------------------------------------------------------------------------------- 1 | "/"===location.pathname&&location.hash.startsWith("#")&&(location.href=`${location.origin}/restapiref/${location.hash}`); -------------------------------------------------------------------------------- /examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2020-2022 mod.io Pty Ltd. 3 | # 4 | # This file is part of the mod.io SDK. 5 | # 6 | # Distributed under the MIT License. (See accompanying file LICENSE or 7 | # view online at ) 8 | # 9 | 10 | set (CMAKE_CXX_STANDARD 17) 11 | 12 | 13 | function(add_example FileName) 14 | add_executable(modio_${FileName} ${CMAKE_CURRENT_LIST_DIR}/${FileName}.cpp) 15 | install( 16 | TARGETS modio_${FileName} RUNTIME 17 | DESTINATION ${CMAKE_INSTALL_PREFIX}/examples 18 | COMPONENT examples 19 | ) 20 | target_link_libraries(modio_${FileName} ${MODIO_TARGET_NAME}Static) 21 | set_target_properties(modio_${FileName} PROPERTIES FOLDER "examples") 22 | target_include_directories(modio_${FileName} PRIVATE "${CMAKE_SOURCE_DIR}/ext/inja/third_party/include") 23 | 24 | endfunction() 25 | 26 | 27 | 28 | if (MODIO_BUILD_EXAMPLES) 29 | add_example(01_Initialization) 30 | add_example(02_ModQueries) 31 | add_example(03_Authentication) 32 | add_example(04_Threading) 33 | add_example(05_SubscriptionManagement) 34 | add_example(06_ForceUninstall) 35 | add_example(07_ReportMod) 36 | add_example(08_SubmitMod) 37 | add_example(09_MonetizationWalletManagement) 38 | add_example(10_MonetizationPurchase) 39 | add_example(11_TempModSets) 40 | add_example(12_RefreshEntitlements) 41 | add_example(13_MetricsSession) 42 | endif() 43 | 44 | if (MODIO_BUILD_ADVANCED_EXAMPLES) 45 | add_subdirectory(advanced) 46 | endif() 47 | 48 | -------------------------------------------------------------------------------- /examples/advanced/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(01_SteamAuthAndEntitlements) 2 | -------------------------------------------------------------------------------- /ext/asio.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2021 mod.io Pty Ltd. 3 | # 4 | # This file is part of the mod.io SDK. 5 | # 6 | # Distributed under the MIT License. (See accompanying file LICENSE or 7 | # view online at ) 8 | # 9 | 10 | add_library(asio INTERFACE) 11 | 12 | #note the trailing slash 13 | #install(FILES "${CMAKE_CURRENT_LIST_DIR}/asio/asio/LICENSE_1_0.txt" 14 | # DESTINATION "licenses/asio/") 15 | 16 | target_include_directories(asio INTERFACE ${CMAKE_CURRENT_LIST_DIR}/asio/asio/include) 17 | target_compile_definitions(asio INTERFACE 18 | -DASIO_STANDALONE 19 | -DASIO_HAS_STD_ADDRESSOF 20 | -DASIO_HAS_STD_ARRAY 21 | -DASIO_HAS_CSTDINT 22 | -DASIO_HAS_STD_SHARED_PTR 23 | -DASIO_HAS_STD_TYPE_TRAITS 24 | -DASIO_HAS_VARIADIC_TEMPLATES 25 | -DASIO_HAS_STD_FUNCTION 26 | -DASIO_HAS_STD_CHRONO 27 | -DASIO_HAS_MOVE 28 | -DASIO_NO_DEFAULT_LINKED_LIBS 29 | -DASIO_DISABLE_IOCP 30 | -DASIO_NO_DEPRECATED 31 | -DBOOST_ALL_NO_LIB 32 | ) 33 | -------------------------------------------------------------------------------- /ext/httpparser.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2021 mod.io Pty Ltd. 3 | # 4 | # This file is part of the mod.io SDK. 5 | # 6 | # Distributed under the MIT License. (See accompanying file LICENSE or 7 | # view online at ) 8 | # 9 | 10 | add_library(httpparser INTERFACE) 11 | target_include_directories(httpparser INTERFACE ${CMAKE_CURRENT_LIST_DIR}/httpparser/src) 12 | -------------------------------------------------------------------------------- /ext/json.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2021 mod.io Pty Ltd. 3 | # 4 | # This file is part of the mod.io SDK. 5 | # 6 | # Distributed under the MIT License. (See accompanying file LICENSE or 7 | # view online at ) 8 | # 9 | 10 | set(JSON_BuildTests OFF CACHE BOOL "" FORCE) 11 | set(JSON_MultipleHeaders OFF CACHE BOOL "" FORCE) 12 | add_subdirectory(json EXCLUDE_FROM_ALL) 13 | 14 | set(nlohmann_json_DIR "${nlohmann_json_BINARY_DIR}" CACHE INTERNAL "") 15 | #install(FILES "${CMAKE_CURRENT_LIST_DIR}/json/LICENSE.MIT" 16 | # DESTINATION "licenses/json/") 17 | -------------------------------------------------------------------------------- /modio/modio/cache/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2021 mod.io Pty Ltd. 3 | # 4 | # This file is part of the mod.io SDK. 5 | # 6 | # Distributed under the MIT License. (See accompanying file LICENSE or 7 | # view online at ) 8 | # 9 | 10 | include(split-compilation) 11 | add_modio_implementation_file(${CMAKE_CURRENT_LIST_DIR}/ModioCacheService.ipp) 12 | -------------------------------------------------------------------------------- /modio/modio/compression/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2021 mod.io Pty Ltd. 3 | # 4 | # This file is part of the mod.io SDK. 5 | # 6 | # Distributed under the MIT License. (See accompanying file LICENSE or 7 | # view online at ) 8 | # 9 | 10 | include(split-compilation) 11 | add_modio_implementation_file(${CMAKE_CURRENT_LIST_DIR}/ModioCompressionService.ipp) 12 | 13 | -------------------------------------------------------------------------------- /modio/modio/core/ModioCoreTypes.ipp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2025 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #ifdef MODIO_SEPARATE_COMPILATION 12 | #include "modio/core/ModioCoreTypes.h" 13 | #endif 14 | 15 | #include "platform/PlatformUtilImplementation.h" 16 | -------------------------------------------------------------------------------- /modio/modio/core/ModioInitializeOptions.ipp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #ifdef MODIO_SEPARATE_COMPILATION 12 | #include "modio/core/ModioInitializeOptions.h" 13 | #endif 14 | 15 | namespace Modio 16 | { 17 | InitializeOptions::InitializeOptions() {} 18 | 19 | InitializeOptions::InitializeOptions(Modio::GameID GameID, Modio::ApiKey APIKey, Modio::Environment GameEnvironment, 20 | Modio::Portal PortalInUse, Modio::UserHandleType LocalSessionIdentifier) 21 | : GameID(GameID), 22 | APIKey(APIKey), 23 | User(LocalSessionIdentifier), 24 | PortalInUse(PortalInUse), 25 | GameEnvironment(GameEnvironment) 26 | {} 27 | } // namespace Modio 28 | -------------------------------------------------------------------------------- /modio/modio/core/ModioLogBuffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | #include 13 | 14 | /// @brief Internal buffer of the most recent log messages 15 | class LogBuffer 16 | { 17 | std::deque elements; 18 | 19 | public: 20 | void Insert(std::string Item) 21 | { 22 | elements.push_back(Item); 23 | while (elements.size() > 10) 24 | { 25 | elements.pop_front(); 26 | } 27 | } 28 | void Clear() 29 | { 30 | elements.clear(); 31 | } 32 | 33 | auto begin() const 34 | { 35 | return elements.begin(); 36 | } 37 | 38 | auto end() const 39 | { 40 | return elements.end(); 41 | } 42 | }; -------------------------------------------------------------------------------- /modio/modio/core/ModioModDependency.ipp: -------------------------------------------------------------------------------- 1 | // This file intentionally empty, for temporary resolution of CI/CD issues. 2 | -------------------------------------------------------------------------------- /modio/modio/core/ModioSplitCompilation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2022 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #ifdef MODIO_SEPARATE_COMPILATION 14 | #define MODIO_IMPL 15 | #else 16 | #define MODIO_IMPL inline 17 | #endif -------------------------------------------------------------------------------- /modio/modio/core/entities/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2021 mod.io Pty Ltd. 3 | # 4 | # This file is part of the mod.io SDK. 5 | # 6 | # Distributed under the MIT License. (See accompanying file LICENSE or 7 | # view online at ) 8 | # 9 | 10 | include(split-compilation) 11 | add_modio_implementation_file(${CMAKE_CURRENT_LIST_DIR}/ModioEntitlementConsumptionStatusList.ipp) 12 | 13 | -------------------------------------------------------------------------------- /modio/modio/core/entities/ModioEntitlementConsumptionStatus.ipp: -------------------------------------------------------------------------------- 1 | // This file intentionally empty, for temporary resolution of CI/CD issues. -------------------------------------------------------------------------------- /modio/modio/core/entities/ModioEntitlementConsumptionStatusList.ipp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #ifdef MODIO_SEPARATE_COMPILATION 12 | #include "modio/core/entities/ModioEntitlementConsumptionStatusList.h" 13 | #endif 14 | 15 | #include "modio/core/ModioLogger.h" 16 | #include "modio/detail/ModioJsonHelpers.h" 17 | 18 | namespace Modio 19 | { 20 | 21 | Modio::Optional EntitlementConsumptionStatusList:: 22 | EntitlementsThatRequireRetry() const 23 | { 24 | if (InternalList.empty()) 25 | { 26 | return {}; 27 | } 28 | 29 | EntitlementConsumptionStatusList RetryElements; 30 | for (EntitlementConsumptionStatus Entitlement : InternalList) 31 | { 32 | if (Entitlement.EntitlementRequiresRetry() == true) 33 | { 34 | Modio::Detail::Logger().Log(Modio::LogLevel::Warning, Modio::LogCategory::Http, 35 | "Entitlement transaction needs retry with SKU: {} & TransactionID: {}", 36 | Entitlement.SkuId, Entitlement.TransactionId); 37 | RetryElements.Append(Entitlement); 38 | } 39 | } 40 | 41 | return RetryElements; 42 | } 43 | 44 | } // namespace Modio -------------------------------------------------------------------------------- /modio/modio/core/entities/ModioFileMetadata.ipp: -------------------------------------------------------------------------------- 1 | // This file intentionally empty, for temporary resolution of CI/CD issues. -------------------------------------------------------------------------------- /modio/modio/core/entities/ModioGameCommunityOptions.ipp: -------------------------------------------------------------------------------- 1 | // This file intentionally empty, for temporary resolution of CI/CD issues. -------------------------------------------------------------------------------- /modio/modio/core/entities/ModioGameInfo.ipp: -------------------------------------------------------------------------------- 1 | // This file intentionally empty, for temporary resolution of CI/CD issues. -------------------------------------------------------------------------------- /modio/modio/core/entities/ModioGameInfoList.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2024 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | #include "modio/detail/ModioDefines.h" 13 | 14 | #include "modio/core/entities/ModioList.h" 15 | #include "modio/core/entities/ModioGameInfo.h" 16 | #include "modio/core/entities/ModioPagedResult.h" 17 | #include "modio/detail/JsonWrapper.h" 18 | #include 19 | 20 | namespace Modio 21 | { 22 | /// @docpublic 23 | /// @brief Class representing a list of games that may be a page from a larger set of results 24 | class GameInfoList : public PagedResult, public List 25 | { 26 | public: 27 | /// @docpublic 28 | /// @brief Insert GameInfoList to the end of this list 29 | void Append(const GameInfoList& Other) 30 | { 31 | InternalList.insert(InternalList.end(), std::begin(Other.InternalList), std::end(Other.InternalList)); 32 | } 33 | 34 | /// @docpublic 35 | /// @brief Insert a GameInfo to the end of this list 36 | void Append(const GameInfo& GameInfoData) 37 | { 38 | InternalList.push_back(GameInfoData); 39 | } 40 | 41 | /// @docnone 42 | MODIO_IMPL friend void from_json(const nlohmann::json& Json, Modio::GameInfoList& OutGameInfoList); 43 | }; 44 | 45 | } // namespace Modio 46 | -------------------------------------------------------------------------------- /modio/modio/core/entities/ModioGameInfoList.ipp: -------------------------------------------------------------------------------- 1 | // This file intentionally empty, for temporary resolution of CI/CD issues. -------------------------------------------------------------------------------- /modio/modio/core/entities/ModioGameMaturityOptions.ipp: -------------------------------------------------------------------------------- 1 | // This file intentionally empty, for temporary resolution of CI/CD issues. -------------------------------------------------------------------------------- /modio/modio/core/entities/ModioGameMonetization.ipp: -------------------------------------------------------------------------------- 1 | // This file intentionally empty, for temporary resolution of CI/CD issues. -------------------------------------------------------------------------------- /modio/modio/core/entities/ModioGameStats.ipp: -------------------------------------------------------------------------------- 1 | // This file intentionally empty, for temporary resolution of CI/CD issues. -------------------------------------------------------------------------------- /modio/modio/core/entities/ModioMetricsSessionEndParams.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/core/ModioCoreTypes.h" 14 | #include "modio/detail/JsonWrapper.h" 15 | #include "modio/detail/ModioHashHelpers.h" 16 | 17 | #include 18 | 19 | namespace Modio 20 | { 21 | /// @docpublic 22 | /// @brief Parameters to end a metrics session 23 | struct MetricsSessionEndParams 24 | { 25 | public: 26 | /// @brief A unique Guid to identify the active session to end 27 | Modio::Guid SessionId; 28 | 29 | /// @brief Milliseconds since UNIX when this request was made 30 | int64_t SessionTimestamp; 31 | 32 | /// @brief Hashed value of the session timestamp, Id, nonce and the secret metrics key 33 | std::string SessionHash; 34 | 35 | /// @brief unique Guid to identify this request 36 | Modio::Guid SessionNonce; 37 | 38 | /// @brief An incremental order Id for each request sent to the server. 39 | uint64_t SessionOrderId; 40 | 41 | /// @docnone 42 | MODIO_IMPL friend void to_json(nlohmann::json& Json, const Modio::MetricsSessionEndParams& Params); 43 | }; 44 | } // namespace Modio -------------------------------------------------------------------------------- /modio/modio/core/entities/ModioMetricsSessionHeartbeatParams.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/core/ModioCoreTypes.h" 14 | #include "modio/detail/JsonWrapper.h" 15 | #include "modio/detail/ModioHashHelpers.h" 16 | 17 | #include 18 | 19 | namespace Modio 20 | { 21 | /// @docpublic 22 | /// @brief Parameters to keep alive a metrics session 23 | struct MetricsSessionHeartbeatParams 24 | { 25 | public: 26 | /// @brief A unique Guid to identify the active session to keep alive 27 | Modio::Guid SessionId; 28 | 29 | /// @brief Milliseconds since UNIX when this request was made 30 | int64_t SessionTimestamp; 31 | 32 | /// @brief Hashed value of the session timestamp, Id, nonce and the secret metrics key 33 | std::string SessionHash; 34 | 35 | /// @brief A unique Guid to identify this request 36 | Modio::Guid SessionNonce; 37 | 38 | /// @brief An incremental order Id for each request sent to the server. 39 | uint64_t SessionOrderId; 40 | 41 | /// @docnone 42 | MODIO_IMPL friend void to_json(nlohmann::json& Json, const Modio::MetricsSessionHeartbeatParams& Params); 43 | }; 44 | } // namespace Modio -------------------------------------------------------------------------------- /modio/modio/core/entities/ModioMetricsSessionStartParams.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/core/ModioCoreTypes.h" 14 | #include "modio/detail/JsonWrapper.h" 15 | #include "modio/detail/ModioHashHelpers.h" 16 | 17 | #include 18 | 19 | namespace Modio 20 | { 21 | /// @docpublic 22 | /// @brief Parameters to start a metrics session 23 | struct MetricsSessionStartParams 24 | { 25 | public: 26 | /// @brief A unique Guid to identify the starting session 27 | Modio::Guid SessionId; 28 | 29 | /// @brief Milliseconds since UNIX when this request was made 30 | int64_t SessionTimestamp; 31 | 32 | /// @brief Hashed value of the session timestamp, Id, nonce and the secret metrics key 33 | std::string SessionHash; 34 | 35 | /// @brief A unique Guid to identify this request 36 | Modio::Guid SessionNonce; 37 | 38 | /// @brief The list of mods being tracked in this session 39 | std::vector ModIds; 40 | 41 | /// @brief An incremental order Id for each request sent to the server. 42 | uint64_t SessionOrderId; 43 | 44 | /// @docnone 45 | MODIO_IMPL friend void to_json(nlohmann::json& Json, const Modio::MetricsSessionStartParams& Params); 46 | }; 47 | } // namespace Modio -------------------------------------------------------------------------------- /modio/modio/core/entities/ModioModCommunityOptions.ipp: -------------------------------------------------------------------------------- 1 | // This file intentionally empty, for temporary resolution of CI/CD issues. -------------------------------------------------------------------------------- /modio/modio/core/entities/ModioModDetails.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/core/entities/ModioFileMetadata.h" 14 | #include "modio/core/entities/ModioList.h" 15 | #include "modio/core/entities/ModioPagedResult.h" 16 | #include 17 | 18 | namespace Modio 19 | { 20 | /// @docpublic 21 | /// @brief Collection of FileMetadata objects representing mod file updates 22 | class ModDetails : public PagedResult, public List 23 | { 24 | /// @docnone 25 | friend inline void from_json(const nlohmann::json& Json, Modio::ModDetails& ModDetails); 26 | }; 27 | 28 | } // namespace Modio 29 | -------------------------------------------------------------------------------- /modio/modio/core/entities/ModioModDetails.ipp: -------------------------------------------------------------------------------- 1 | // This file intentionally empty, for temporary resolution of CI/CD issues. -------------------------------------------------------------------------------- /modio/modio/core/entities/ModioModInfo.ipp: -------------------------------------------------------------------------------- 1 | // This file intentionally empty, for temporary resolution of CI/CD issues. -------------------------------------------------------------------------------- /modio/modio/core/entities/ModioModInfoList.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | #include "modio/detail/ModioDefines.h" 13 | 14 | #include "modio/core/entities/ModioList.h" 15 | #include "modio/core/entities/ModioModInfo.h" 16 | #include "modio/core/entities/ModioPagedResult.h" 17 | #include "modio/detail/JsonWrapper.h" 18 | #include 19 | 20 | namespace Modio 21 | { 22 | /// @docpublic 23 | /// @brief Class representing a list of mods that may be a page from a larger set of results 24 | class ModInfoList : public PagedResult, public List 25 | { 26 | public: 27 | /// @docpublic 28 | /// @brief Insert ModInfoList to the end of this list 29 | void Append(const ModInfoList& Other) 30 | { 31 | InternalList.insert(InternalList.end(), std::begin(Other.InternalList), std::end(Other.InternalList)); 32 | } 33 | 34 | /// @docpublic 35 | /// @brief Insert a ModInfo to the end of this list 36 | void Append(const ModInfo& ModInfoData) 37 | { 38 | InternalList.push_back(ModInfoData); 39 | } 40 | 41 | /// @docnone 42 | MODIO_IMPL friend void from_json(const nlohmann::json& Json, Modio::ModInfoList& OutModInfoList); 43 | }; 44 | } // namespace Modio 45 | -------------------------------------------------------------------------------- /modio/modio/core/entities/ModioModInfoList.ipp: -------------------------------------------------------------------------------- 1 | // This file intentionally empty, for temporary resolution of CI/CD issues. -------------------------------------------------------------------------------- /modio/modio/core/entities/ModioModStats.ipp: -------------------------------------------------------------------------------- 1 | // This file intentionally empty, for temporary resolution of CI/CD issues. -------------------------------------------------------------------------------- /modio/modio/core/entities/ModioModTagOptions.ipp: -------------------------------------------------------------------------------- 1 | // This file intentionally empty, for temporary resolution of CI/CD issues. -------------------------------------------------------------------------------- /modio/modio/core/entities/ModioPagedResult.ipp: -------------------------------------------------------------------------------- 1 | // This file intentionally empty, for temporary resolution of CI/CD issues. -------------------------------------------------------------------------------- /modio/modio/core/entities/ModioProfileMaturity.ipp: -------------------------------------------------------------------------------- 1 | // This file intentionally empty, for temporary resolution of CI/CD issues. -------------------------------------------------------------------------------- /modio/modio/core/entities/ModioTerms.ipp: -------------------------------------------------------------------------------- 1 | // This file intentionally empty, for temporary resolution of CI/CD issues. -------------------------------------------------------------------------------- /modio/modio/core/entities/ModioToken.ipp: -------------------------------------------------------------------------------- 1 | // This file intentionally empty, for temporary resolution of CI/CD issues. -------------------------------------------------------------------------------- /modio/modio/core/entities/ModioTransactionRecord.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2023 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | #include "modio/core/ModioCoreTypes.h" 13 | #include "modio/core/ModioSplitCompilation.h" 14 | #include "modio/detail/JsonWrapper.h" 15 | #include "modio/core/entities/ModioModInfo.h" 16 | 17 | 18 | namespace Modio 19 | { 20 | /// @docpublic 21 | /// @brief Contains information about a successful transaction for a mod 22 | struct TransactionRecord 23 | { 24 | /// @brief The mod the purchase was for 25 | Modio::ModID AssociatedModID = {}; 26 | /// @brief The price the mod was purchased for 27 | uint64_t Price = 0; 28 | /// @brief The updated balance in the user's wallet after the transaction 29 | uint64_t UpdatedUserWalletBalance = 0; 30 | /// @brief ModInfo of the mod that was purchase and subscribed to 31 | Modio::ModInfo Mod = {}; 32 | 33 | /// @docnone 34 | MODIO_IMPL friend void from_json(const nlohmann::json& Json, Modio::TransactionRecord& Transaction); 35 | 36 | }; 37 | } 38 | -------------------------------------------------------------------------------- /modio/modio/core/entities/ModioTransactionRecord.ipp: -------------------------------------------------------------------------------- 1 | // This file intentionally empty, for temporary resolution of CI/CD issues. -------------------------------------------------------------------------------- /modio/modio/core/entities/ModioURLList.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | #include "modio/core/ModioSplitCompilation.h" 13 | #include "modio/core/entities/ModioList.h" 14 | #include "modio/detail/JsonWrapper.h" 15 | #include 16 | #include 17 | 18 | namespace Modio 19 | { 20 | /// @brief Typedef a List into URLList 21 | using URLList = List; 22 | 23 | /// @docpublic 24 | /// @brief A URLList subclass to match Youtube urls 25 | class YoutubeURLList : public URLList 26 | { 27 | /// @docnone 28 | MODIO_IMPL friend void from_json(const nlohmann::json& Json, Modio::YoutubeURLList& YoutubeURLList); 29 | 30 | /// @docnone 31 | MODIO_IMPL friend void to_json(nlohmann::json& Json, const Modio::YoutubeURLList& YoutubeURLList); 32 | }; 33 | 34 | /// @docpublic 35 | /// @brief A URLList subclass to match Sketchfab urls 36 | class SketchfabURLList : public URLList 37 | { 38 | /// @docnone 39 | MODIO_IMPL friend void from_json(const nlohmann::json& Json, Modio::SketchfabURLList& SketchfabURLList); 40 | 41 | /// @docnone 42 | MODIO_IMPL friend void to_json(nlohmann::json& Json, const Modio::SketchfabURLList& SketchfabURLList); 43 | }; 44 | 45 | } // namespace Modio 46 | -------------------------------------------------------------------------------- /modio/modio/core/entities/ModioURLList.ipp: -------------------------------------------------------------------------------- 1 | // This file intentionally empty, for temporary resolution of CI/CD issues. -------------------------------------------------------------------------------- /modio/modio/core/entities/ModioUser.ipp: -------------------------------------------------------------------------------- 1 | // This file intentionally empty, for temporary resolution of CI/CD issues. -------------------------------------------------------------------------------- /modio/modio/core/entities/ModioUserDelegationToken.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2023 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | #include "modio/core/ModioCoreTypes.h" 13 | #include "modio/core/ModioSplitCompilation.h" 14 | #include "modio/core/entities/ModioModInfo.h" 15 | #include "modio/detail/JsonWrapper.h" 16 | 17 | namespace Modio 18 | { 19 | /// @docpublic 20 | /// @brief Contains information about a UserDelegationToken used for S2S transactions 21 | struct UserDelegationToken 22 | { 23 | /// @brief The type of token we are getting 24 | std::string Entity; 25 | 26 | /// @brief The token that we got 27 | std::string Token; 28 | 29 | /// @docnone 30 | MODIO_IMPL friend void from_json(const nlohmann::json& Json, Modio::UserDelegationToken& Token); 31 | }; 32 | } // namespace Modio 33 | -------------------------------------------------------------------------------- /modio/modio/core/entities/ModioUserDelegationToken.ipp: -------------------------------------------------------------------------------- 1 | // This file intentionally empty, for temporary resolution of CI/CD issues. 2 | -------------------------------------------------------------------------------- /modio/modio/core/entities/ModioUserList.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2022 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/detail/ModioDefines.h" 14 | 15 | #include "modio/core/ModioSplitCompilation.h" 16 | #include "modio/core/entities/ModioList.h" 17 | #include "modio/core/entities/ModioPagedResult.h" 18 | #include "modio/core/entities/ModioUser.h" 19 | #include "modio/detail/JsonWrapper.h" 20 | #include 21 | 22 | namespace Modio 23 | { 24 | /// @docpublic 25 | /// @brief Class representing a list of users 26 | class UserList : public PagedResult, public List 27 | { 28 | public: 29 | /// @docpublic 30 | /// @brief Insert UserList to the end of this list 31 | void Append(const UserList& Other) 32 | { 33 | InternalList.insert(InternalList.end(), std::begin(Other.InternalList), std::end(Other.InternalList)); 34 | } 35 | 36 | /// @docpublic 37 | /// @brief Insert a User to the end of this list 38 | void Append(const User& UserData) 39 | { 40 | InternalList.push_back(UserData); 41 | } 42 | 43 | /// @docnone 44 | MODIO_IMPL friend void from_json(const nlohmann::json& Json, Modio::UserList& OutUserList); 45 | }; 46 | 47 | } // namespace Modio 48 | -------------------------------------------------------------------------------- /modio/modio/core/entities/ModioUserList.ipp: -------------------------------------------------------------------------------- 1 | // This file intentionally empty, for temporary resolution of CI/CD issues. -------------------------------------------------------------------------------- /modio/modio/core/entities/ModioUserRatingList.ipp: -------------------------------------------------------------------------------- 1 | // This file intentionally empty, for temporary resolution of CI/CD issues. -------------------------------------------------------------------------------- /modio/modio/detail/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2021 mod.io Pty Ltd. 3 | # 4 | # This file is part of the mod.io SDK. 5 | # 6 | # Distributed under the MIT License. (See accompanying file LICENSE or 7 | # view online at ) 8 | # 9 | 10 | include(split-compilation) 11 | add_modio_implementation_file(${CMAKE_CURRENT_LIST_DIR}/ModioProfiling.ipp) 12 | add_modio_implementation_file(${CMAKE_CURRENT_LIST_DIR}/ModioSDKSessionData.ipp) 13 | add_modio_implementation_file(${CMAKE_CURRENT_LIST_DIR}/ModioJsonHelpers.ipp) 14 | add_modio_implementation_file(${CMAKE_CURRENT_LIST_DIR}/compression/zip/ArchiveFileImplementation.ipp) 15 | add_modio_implementation_file(${CMAKE_CURRENT_LIST_DIR}/compression/zlib/detail/deflate_stream.ipp) 16 | add_modio_implementation_file(${CMAKE_CURRENT_LIST_DIR}/compression/zlib/detail/inflate_stream.ipp) 17 | add_modio_implementation_file(${CMAKE_CURRENT_LIST_DIR}/userdata/ModioUserDataContainer.ipp) 18 | add_modio_implementation_file(${CMAKE_CURRENT_LIST_DIR}/userdata/ModioUserProfile.ipp) 19 | add_public_header(${MODIO_TARGET_NAME} ${CMAKE_CURRENT_LIST_DIR}/ModioDefines.h) 20 | add_public_header(${MODIO_TARGET_NAME} ${CMAKE_CURRENT_LIST_DIR}/ModioLibraryConfigurationHelpers.h) 21 | -------------------------------------------------------------------------------- /modio/modio/detail/ConcurrentQueueWrapper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #pragma push_macro("BLOCK_SIZE") 14 | #undef BLOCK_SIZE 15 | 16 | #include "modio/detail/ModioCompilerMacros.h" 17 | MODIO_DISABLE_WARNING_PUSH 18 | MODIO_DISABLE_WARNING_ASSIGNMENT_IMPLICITLY_DELETED 19 | MODIO_DISABLE_WARNING_COPY_CONSTRUCTOR_IMPLICITLY_DELETED 20 | MODIO_DISABLE_WARNING_CPP98_COMPAT 21 | MODIO_DISABLE_WARNING_SUGGEST_DESTRUCTOR_OVERRIDE 22 | MODIO_DISABLE_WARNING_EXIT_TIME_DESTRUCTORS 23 | MODIO_DISABLE_WARNING_MOVE_ASSIGNMENT_IMPLICITLY_DELETED 24 | MODIO_DISABLE_WARNING_MOVE_CONSTRUCTOR_IMPLICITLY_DELETED 25 | MODIO_DISABLE_WARNING_SPECTRE_MITIGATION 26 | MODIO_DISABLE_WARNING_STRUCTURE_PADDING 27 | MODIO_DISABLE_WARNING_UNSAFE_BUFFER_USAGE 28 | MODIO_DISABLE_WARNING_UNUSED_FUNCTION 29 | #include "concurrentqueue.h" 30 | MODIO_DISABLE_WARNING_POP 31 | 32 | #pragma pop_macro("BLOCK_SIZE") -------------------------------------------------------------------------------- /modio/modio/detail/FilterOperations.inl: -------------------------------------------------------------------------------- 1 | FILTER_OP(Contains, "_q") 2 | FILTER_OP(Equals, "") 3 | FILTER_OP(Not, "-not") 4 | FILTER_OP(Like,"-lk") 5 | FILTER_OP(NotLike,"-not-lk") 6 | FILTER_OP(In,"-in") 7 | FILTER_OP(NotIn,"-not-in") 8 | FILTER_OP(GreaterThan,"-min") 9 | FILTER_OP(LessThan,"-max") 10 | FILTER_OP(BitwiseAnd,"-bitwise-and") -------------------------------------------------------------------------------- /modio/modio/detail/MbedtlsWrapper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2025 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/detail/ModioCompilerMacros.h" 14 | 15 | MODIO_DISABLE_WARNING_PUSH 16 | #include "mbedtls/ctr_drbg.h" 17 | #include "mbedtls/entropy.h" 18 | #include "mbedtls/net_sockets.h" 19 | #include "mbedtls/ssl.h" 20 | MODIO_DISABLE_WARNING_POP -------------------------------------------------------------------------------- /modio/modio/detail/ModioExtInitParamStub.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | namespace Modio 14 | { 15 | namespace Detail 16 | { 17 | 18 | /// @brief Stub struct for handling internal-only initialization options 19 | struct ExtendedInitParamHandler 20 | { 21 | static void PostSessionDataInit(struct Modio::InitializeOptions&) {}; 22 | static void PostUserDataServiceInit(Modio::InitializeOptions&) {}; 23 | }; 24 | } // namespace Detail 25 | } // namespace Modio -------------------------------------------------------------------------------- /modio/modio/detail/ModioHashHelpers.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "hmac_sha256.h" 4 | #include "modio/core/ModioStdTypes.h" 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | 14 | namespace Modio 15 | { 16 | namespace Detail 17 | { 18 | namespace Hash 19 | { 20 | inline static std::string HMACSHA256String(const std::string& SecretKey, const std::string& StringToHash) 21 | { 22 | std::stringstream ss_result; 23 | std::vector out(SHA256_HASH_SIZE); 24 | 25 | hmac_sha256(SecretKey.data(), SecretKey.size(), StringToHash.data(), StringToHash.size(), out.data(), 26 | out.size()); 27 | 28 | for (uint8_t x : out) 29 | { 30 | ss_result << std::hex << std::setfill('0') << std::setw(2) << (int) x; 31 | } 32 | 33 | return ss_result.str(); 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /modio/modio/detail/ModioLibraryConfigurationHelpers.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #ifndef MODIO_SEPARATE_COMPILATION 14 | #define MODIOSDK_API inline 15 | #else 16 | #define MODIOSDK_API 17 | #endif 18 | 19 | -------------------------------------------------------------------------------- /modio/modio/detail/ModioMovableTypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | namespace Modio 14 | { 15 | namespace Detail 16 | { 17 | struct MoveIndicator 18 | { 19 | bool bMoved = false; 20 | MoveIndicator() = default; 21 | MoveIndicator(MoveIndicator&& Other) 22 | { 23 | Other.bMoved = true; 24 | } 25 | }; 26 | } // namespace Detail 27 | } // namespace Modio -------------------------------------------------------------------------------- /modio/modio/detail/ModioProfiling.ipp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #ifdef MODIO_SEPARATE_COMPILATION 12 | #include "modio/detail/ModioProfiling.h" 13 | #endif 14 | 15 | 16 | Modio::Detail::ScopedProfileEvent& Modio::Detail::ScopedProfileEvent::operator=(ScopedProfileEvent&& Other) 17 | { 18 | if (this != &Other) 19 | { 20 | EventName = Other.EventName; 21 | Other.bMovedFrom = true; 22 | } 23 | return *this; 24 | } -------------------------------------------------------------------------------- /modio/modio/detail/ModioSDKSharedLibrary.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #include "modio/ModioSDK.h" -------------------------------------------------------------------------------- /modio/modio/detail/ModioSingletons.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | namespace Modio 14 | { 15 | namespace Detail 16 | { 17 | template 18 | class RefSingleton 19 | { 20 | protected: 21 | /// 22 | /// 23 | static T Instance; 24 | 25 | public: 26 | static T& GetInstance() 27 | { 28 | return Instance; 29 | } 30 | }; 31 | 32 | template 33 | T RefSingleton::Instance; 34 | 35 | template 36 | class WeakSingleton 37 | { 38 | protected: 39 | /// 40 | /// We don't own the instance of ourselves here, as we don't want the singleton to extend its own 41 | /// lifetime. Lifetime of the shared state should be effectively managed by the HttpImplementation 42 | /// 43 | static std::weak_ptr Instance; 44 | 45 | public: 46 | static std::shared_ptr GetInstance() 47 | { 48 | return Instance.lock(); 49 | } 50 | }; 51 | 52 | template 53 | std::weak_ptr WeakSingleton::Instance; 54 | } // namespace Detail 55 | } // namespace Modio -------------------------------------------------------------------------------- /modio/modio/detail/ModioThrow.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/detail/HedleyWrapper.h" 14 | #include "modio/detail/ModioCompilerMacros.h" 15 | 16 | MODIO_DISABLE_WARNING_PUSH 17 | MODIO_DISABLE_WARNING_UNREACHABLE_CODE 18 | 19 | namespace Modio 20 | { 21 | namespace Detail 22 | { 23 | template 24 | MODIO_NORETURN void MaybeThrowException(const Exception& e) 25 | { 26 | #ifdef __cpp_exceptions 27 | throw e; 28 | #else 29 | MODIO_UNREACHABLE(); abort(); 30 | #endif 31 | } 32 | 33 | } // namespace Detail 34 | } // namespace Modio 35 | 36 | MODIO_DISABLE_WARNING_POP 37 | -------------------------------------------------------------------------------- /modio/modio/detail/entities/ModioAvatar.ipp: -------------------------------------------------------------------------------- 1 | // This file intentionally empty, for temporary resolution of CI/CD issues. 2 | -------------------------------------------------------------------------------- /modio/modio/detail/entities/ModioGalleryList.ipp: -------------------------------------------------------------------------------- 1 | // This file intentionally empty, for temporary resolution of CI/CD issues. 2 | -------------------------------------------------------------------------------- /modio/modio/detail/entities/ModioIcon.ipp: -------------------------------------------------------------------------------- 1 | // This file intentionally empty, for temporary resolution of CI/CD issues. 2 | -------------------------------------------------------------------------------- /modio/modio/detail/entities/ModioImage.ipp: -------------------------------------------------------------------------------- 1 | // This file intentionally empty, for temporary resolution of CI/CD issues. 2 | -------------------------------------------------------------------------------- /modio/modio/detail/entities/ModioLogo.ipp: -------------------------------------------------------------------------------- 1 | // This file intentionally empty, for temporary resolution of CI/CD issues. 2 | -------------------------------------------------------------------------------- /modio/modio/detail/http/PerformRequestImpl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/core/ModioBuffer.h" 14 | #include "modio/core/ModioCoreTypes.h" 15 | #include "modio/detail/ModioOperationQueue.h" 16 | #include "modio/file/ModioFile.h" 17 | #include "modio/http/ModioHttpParams.h" 18 | 19 | namespace Modio 20 | { 21 | namespace Detail 22 | { 23 | struct PerformRequestImpl 24 | { 25 | Modio::Detail::OperationQueue::Ticket RequestTicket; 26 | std::unique_ptr CurrentPayloadFile; 27 | Modio::Detail::DynamicBuffer PayloadFileBuffer; 28 | Modio::FileSize CurrentPayloadFileBytesRead; 29 | Modio::Optional> PayloadElement; 30 | std::unique_ptr HeaderBuf; 31 | std::weak_ptr ProgressInfo; 32 | 33 | public: 34 | PerformRequestImpl(Modio::Detail::OperationQueue::Ticket RequestTicket) 35 | : RequestTicket(std::move(RequestTicket)) {} 36 | PerformRequestImpl(const PerformRequestImpl& Other) = delete; 37 | }; 38 | } // namespace Detail 39 | } // namespace Modio -------------------------------------------------------------------------------- /modio/modio/detail/http/ResponseError.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | #include "modio/core/ModioCoreTypes.h" 13 | #include "modio/detail/JsonWrapper.h" 14 | #include "modio/detail/ModioJsonHelpers.h" 15 | #include 16 | #include 17 | 18 | namespace Modio 19 | { 20 | namespace Detail 21 | { 22 | /// @docinternal 23 | /// @brief Container for the error codes a response can store 24 | struct ResponseError 25 | { 26 | std::int32_t Code = -1; 27 | std::int32_t ErrorRef = -1; 28 | std::string Error; 29 | Modio::Optional> ExtendedErrorInformation; 30 | 31 | MODIO_IMPL friend void from_json(const nlohmann::json& Json, Modio::Detail::ResponseError& Error); 32 | }; 33 | 34 | } // namespace Detail 35 | } // namespace Modio -------------------------------------------------------------------------------- /modio/modio/detail/http/ResponseParser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | #include "modio/core/ModioBuffer.h" 13 | 14 | namespace Modio 15 | { 16 | namespace Detail 17 | { 18 | 19 | } 20 | } -------------------------------------------------------------------------------- /modio/modio/detail/ops/MuteUserOp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2022 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/detail/AsioWrapper.h" 14 | #include "modio/detail/ops/http/PerformRequestAndGetResponseOp.h" 15 | #include "modio/http/ModioHttpParams.h" 16 | 17 | #include 18 | namespace Modio::Detail 19 | { 20 | class MuteUserOp 21 | { 22 | public: 23 | MuteUserOp(Modio::UserID UserID) 24 | { 25 | ID = UserID; 26 | } 27 | 28 | template 29 | void operator()(CoroType& Self, Modio::ErrorCode ec = {}) 30 | { 31 | reenter(CoroutineState) 32 | { 33 | yield Modio::Detail::PerformRequestAndGetResponseAsync( 34 | ResponseBodyBuffer, Modio::Detail::MuteAUserRequest.SetUserID(ID), 35 | Modio::Detail::CachedResponse::Disallow, std::move(Self)); 36 | 37 | Self.complete(ec); 38 | return; 39 | } 40 | } 41 | 42 | private: 43 | Modio::UserID ID; 44 | Modio::Detail::DynamicBuffer ResponseBodyBuffer; 45 | asio::coroutine CoroutineState; 46 | }; 47 | } // namespace Modio::Detail 48 | #include 49 | -------------------------------------------------------------------------------- /modio/modio/detail/ops/ReportContentOp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/core/ModioReportParams.h" 14 | #include "modio/detail/AsioWrapper.h" 15 | #include "modio/detail/ops/http/PerformRequestAndGetResponseOp.h" 16 | #include "modio/http/ModioHttpParams.h" 17 | 18 | #include 19 | namespace Modio 20 | { 21 | namespace Detail 22 | { 23 | class ReportContentOp 24 | { 25 | Modio::Detail::DynamicBuffer ResponseBodyBuffer; 26 | 27 | asio::coroutine CoroutineState; 28 | Modio::Detail::HttpRequestParams Request; 29 | 30 | public: 31 | ReportContentOp(Modio::ReportParams Params) 32 | { 33 | Request = ToRequest(Params); 34 | } 35 | 36 | template 37 | void operator()(CoroType& Self, Modio::ErrorCode ec = {}) 38 | { 39 | reenter(CoroutineState) 40 | { 41 | yield Modio::Detail::PerformRequestAndGetResponseAsync( 42 | ResponseBodyBuffer, Request, Modio::Detail::CachedResponse::Disallow, std::move(Self)); 43 | Self.complete(ec); 44 | return; 45 | } 46 | } 47 | }; 48 | } // namespace Detail 49 | } // namespace Modio 50 | #include -------------------------------------------------------------------------------- /modio/modio/detail/ops/UnmuteUserOp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2022 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/detail/AsioWrapper.h" 14 | #include "modio/detail/ops/http/PerformRequestAndGetResponseOp.h" 15 | #include "modio/http/ModioHttpParams.h" 16 | 17 | #include 18 | namespace Modio 19 | { 20 | namespace Detail 21 | { 22 | class UnmuteUserOp 23 | { 24 | public: 25 | UnmuteUserOp(Modio::UserID UserID) 26 | { 27 | ID = UserID; 28 | } 29 | 30 | template 31 | void operator()(CoroType& Self, Modio::ErrorCode ec = {}) 32 | { 33 | reenter(CoroutineState) 34 | { 35 | yield Modio::Detail::PerformRequestAndGetResponseAsync( 36 | ResponseBodyBuffer, Modio::Detail::UnmuteAUserRequest.SetUserID(ID), 37 | Modio::Detail::CachedResponse::Disallow, std::move(Self)); 38 | Self.complete(ec); 39 | return; 40 | } 41 | } 42 | 43 | private: 44 | Modio::UserID ID; 45 | Modio::Detail::DynamicBuffer ResponseBodyBuffer; 46 | asio::coroutine CoroutineState; 47 | }; 48 | } // namespace Detail 49 | } // namespace Modio 50 | #include 51 | -------------------------------------------------------------------------------- /modio/modio/detail/ops/auth/AuthenticateUserByApple.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | #include "modio/detail/AsioWrapper.h" 13 | #include "modio/detail/ops/auth/AuthenticateUserExternal.h" 14 | 15 | namespace Modio 16 | { 17 | namespace Detail 18 | { 19 | inline void AuthenticateUserByAppleAsync(Modio::AuthenticationParams User, 20 | std::function Callback) 21 | { 22 | Modio::Detail::HttpRequestParams Params = 23 | Modio::Detail::AuthenticateViaAppleRequest 24 | .AppendPayloadValue(Modio::Detail::Constants::APIStrings::OpenIDToken, User.AuthToken) 25 | .EncodeAndAppendPayloadValue(Modio::Detail::Constants::APIStrings::EmailAddress, User.UserEmail) 26 | .AppendPayloadValue(Modio::Detail::Constants::APIStrings::TermsAgreed, 27 | User.bUserHasAcceptedTerms ? "true" : "false"); 28 | return asio::async_compose, void(Modio::ErrorCode)>( 29 | Modio::Detail::AuthenticateUserExternal(Params), Callback, 30 | Modio::Detail::Services::GetGlobalContext().get_executor()); 31 | } 32 | } // namespace Detail 33 | } // namespace Modio 34 | -------------------------------------------------------------------------------- /modio/modio/detail/ops/auth/AuthenticateUserByDiscord.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | #include "modio/detail/ops/auth/AuthenticateUserExternal.h" 13 | #include "modio/detail/AsioWrapper.h" 14 | namespace Modio 15 | { 16 | namespace Detail 17 | { 18 | inline void AuthenticateUserByDiscordAsync(Modio::AuthenticationParams User, 19 | std::function Callback) 20 | { 21 | Modio::Detail::HttpRequestParams Params = 22 | Modio::Detail::AuthenticateViaDiscordRequest 23 | .AppendPayloadValue(Modio::Detail::Constants::APIStrings::DiscordToken, User.AuthToken) 24 | .EncodeAndAppendPayloadValue(Modio::Detail::Constants::APIStrings::EmailAddress, User.UserEmail) 25 | .AppendPayloadValue(Modio::Detail::Constants::APIStrings::TermsAgreed, 26 | User.bUserHasAcceptedTerms ? "true" : "false"); 27 | return asio::async_compose, void(Modio::ErrorCode)>( 28 | Modio::Detail::AuthenticateUserExternal(Params), Callback, 29 | Modio::Detail::Services::GetGlobalContext().get_executor()); 30 | } 31 | } // namespace Detail 32 | } // namespace Modio -------------------------------------------------------------------------------- /modio/modio/detail/ops/auth/AuthenticateUserByEpic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | #include "modio/detail/AsioWrapper.h" 13 | #include "modio/detail/ops/auth/AuthenticateUserExternal.h" 14 | #include "modio/http/ModioHttpParams.h" 15 | 16 | namespace Modio 17 | { 18 | namespace Detail 19 | { 20 | 21 | inline void AuthenticateUserByEpicAsync(Modio::AuthenticationParams User, 22 | std::function Callback) 23 | { 24 | Modio::Detail::HttpRequestParams Params = 25 | Modio::Detail::AuthenticateViaEpicgamesRequest 26 | .AppendPayloadValue(Modio::Detail::Constants::APIStrings::AccessToken, User.AuthToken) 27 | .EncodeAndAppendPayloadValue(Modio::Detail::Constants::APIStrings::EmailAddress, User.UserEmail) 28 | .AppendPayloadValue(Modio::Detail::Constants::APIStrings::TermsAgreed, 29 | User.bUserHasAcceptedTerms ? "true" : "false"); 30 | return asio::async_compose, void(Modio::ErrorCode)>( 31 | AuthenticateUserExternal(Params), Callback, Modio::Detail::Services::GetGlobalContext().get_executor()); 32 | } 33 | 34 | } // namespace Detail 35 | } // namespace Modio -------------------------------------------------------------------------------- /modio/modio/detail/ops/auth/AuthenticateUserByGog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | #include "modio/detail/ops/auth/AuthenticateUserExternal.h" 13 | #include "modio/detail/AsioWrapper.h" 14 | namespace Modio 15 | { 16 | namespace Detail 17 | { 18 | inline void AuthenticateUserByGoGAsync(Modio::AuthenticationParams User, std::function Callback) 19 | { 20 | Modio::Detail::HttpRequestParams Params = 21 | Modio::Detail::AuthenticateViaGogGalaxyRequest 22 | .AppendPayloadValue(Modio::Detail::Constants::APIStrings::Appdata, User.AuthToken) 23 | .EncodeAndAppendPayloadValue(Modio::Detail::Constants::APIStrings::EmailAddress, User.UserEmail) 24 | .AppendPayloadValue(Modio::Detail::Constants::APIStrings::TermsAgreed, 25 | User.bUserHasAcceptedTerms ? "true" : "false"); 26 | return asio::async_compose, void(Modio::ErrorCode)>( 27 | Modio::Detail::AuthenticateUserExternal(Params), Callback, 28 | Modio::Detail::Services::GetGlobalContext().get_executor()); 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /modio/modio/detail/ops/auth/AuthenticateUserByGoogleIDToken.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | #include "modio/detail/AsioWrapper.h" 13 | #include "modio/detail/ops/auth/AuthenticateUserExternal.h" 14 | namespace Modio 15 | { 16 | namespace Detail 17 | { 18 | inline void AuthenticateUserByGoogleIDTokenAsync(Modio::AuthenticationParams User, 19 | std::function Callback) 20 | { 21 | Modio::Detail::HttpRequestParams Params = 22 | Modio::Detail::AuthenticateViaGoogleRequest 23 | .AppendPayloadValue(Modio::Detail::Constants::APIStrings::GoogleIDToken, User.AuthToken) 24 | .AppendPayloadValue(Modio::Detail::Constants::APIStrings::TermsAgreed, 25 | User.bUserHasAcceptedTerms ? "true" : "false"); 26 | return asio::async_compose, void(Modio::ErrorCode)>( 27 | Modio::Detail::AuthenticateUserExternal(Params), Callback, 28 | Modio::Detail::Services::GetGlobalContext().get_executor()); 29 | } 30 | } // namespace Detail 31 | } // namespace Modio -------------------------------------------------------------------------------- /modio/modio/detail/ops/auth/AuthenticateUserByGoogleServerSideToken.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | #include "modio/detail/AsioWrapper.h" 13 | #include "modio/detail/ops/auth/AuthenticateUserExternal.h" 14 | namespace Modio 15 | { 16 | namespace Detail 17 | { 18 | inline void AuthenticateUserByGoogleServerSideTokenAsync(Modio::AuthenticationParams User, 19 | std::function Callback) 20 | { 21 | Modio::Detail::HttpRequestParams Params = 22 | Modio::Detail::AuthenticateViaGoogleRequest 23 | .AppendPayloadValue(Modio::Detail::Constants::APIStrings::GoogleServerSideToken, User.AuthToken) 24 | .AppendPayloadValue(Modio::Detail::Constants::APIStrings::TermsAgreed, 25 | User.bUserHasAcceptedTerms ? "true" : "false"); 26 | return asio::async_compose, void(Modio::ErrorCode)>( 27 | Modio::Detail::AuthenticateUserExternal(Params), Callback, 28 | Modio::Detail::Services::GetGlobalContext().get_executor()); 29 | } 30 | } // namespace Detail 31 | } // namespace Modio -------------------------------------------------------------------------------- /modio/modio/detail/ops/auth/AuthenticateUserByItch.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | #include "modio/detail/ops/auth/AuthenticateUserExternal.h" 13 | #include "modio/detail/AsioWrapper.h" 14 | namespace Modio 15 | { 16 | namespace Detail 17 | { 18 | inline void AuthenticateUserByItchAsync(Modio::AuthenticationParams User, 19 | std::function Callback) 20 | { 21 | Modio::Detail::HttpRequestParams Params = 22 | Modio::Detail::AuthenticateViaItchioRequest 23 | .AppendPayloadValue(Modio::Detail::Constants::APIStrings::ItchToken, User.AuthToken) 24 | .EncodeAndAppendPayloadValue(Modio::Detail::Constants::APIStrings::EmailAddress, User.UserEmail) 25 | .AppendPayloadValue(Modio::Detail::Constants::APIStrings::TermsAgreed, 26 | User.bUserHasAcceptedTerms ? "true" : "false"); 27 | return asio::async_compose, void(Modio::ErrorCode)>( 28 | Modio::Detail::AuthenticateUserExternal(Params), Callback, 29 | Modio::Detail::Services::GetGlobalContext().get_executor()); 30 | } 31 | } // namespace Detail 32 | } // namespace Modio -------------------------------------------------------------------------------- /modio/modio/detail/ops/auth/AuthenticateUserByOpenID.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2023 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/detail/AsioWrapper.h" 14 | #include "modio/detail/ModioConstants.h" 15 | #include "modio/detail/ops/auth/AuthenticateUserExternal.h" 16 | #include "modio/http/ModioHttpParams.h" 17 | 18 | namespace Modio 19 | { 20 | namespace Detail 21 | { 22 | inline void AuthenticateUserByOpenIDAsync(Modio::AuthenticationParams User, 23 | std::function Callback) 24 | { 25 | Modio::Detail::HttpRequestParams Params = 26 | Modio::Detail::AuthenticateViaOpenidRequest 27 | .AppendPayloadValue(Modio::Detail::Constants::APIStrings::OpenIDToken, User.AuthToken) 28 | .EncodeAndAppendPayloadValue(Modio::Detail::Constants::APIStrings::EmailAddress, User.UserEmail) 29 | .AppendPayloadValue(Modio::Detail::Constants::APIStrings::TermsAgreed, 30 | User.bUserHasAcceptedTerms ? "true" : "false"); 31 | 32 | return asio::async_compose, void(Modio::ErrorCode)>( 33 | Modio::Detail::AuthenticateUserExternal(Params), Callback, 34 | Modio::Detail::Services::GetGlobalContext().get_executor()); 35 | } 36 | } // namespace Detail 37 | } // namespace Modio -------------------------------------------------------------------------------- /modio/modio/detail/ops/auth/AuthenticateUserBySteam.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | #include "modio/detail/ops/auth/AuthenticateUserExternal.h" 13 | #include "modio/detail/AsioWrapper.h" 14 | namespace Modio 15 | { 16 | namespace Detail 17 | { 18 | inline void AuthenticateUserBySteamAsync(Modio::AuthenticationParams User, 19 | std::function Callback) 20 | { 21 | Modio::Detail::HttpRequestParams Params = 22 | Modio::Detail::AuthenticateViaSteamRequest 23 | .AppendPayloadValue(Modio::Detail::Constants::APIStrings::Appdata, User.AuthToken) 24 | .EncodeAndAppendPayloadValue(Modio::Detail::Constants::APIStrings::EmailAddress, User.UserEmail) 25 | .AppendPayloadValue(Modio::Detail::Constants::APIStrings::TermsAgreed, 26 | User.bUserHasAcceptedTerms ? "true" : "false"); 27 | return asio::async_compose, void(Modio::ErrorCode)>( 28 | Modio::Detail::AuthenticateUserExternal(Params), Callback, 29 | Modio::Detail::Services::GetGlobalContext().get_executor()); 30 | } 31 | } // namespace Detail 32 | } // namespace Modio -------------------------------------------------------------------------------- /modio/modio/detail/ops/auth/AuthenticateUserBySwitchID.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | #include "modio/detail/ops/auth/AuthenticateUserExternal.h" 13 | #include "modio/detail/AsioWrapper.h" 14 | namespace Modio 15 | { 16 | namespace Detail 17 | { 18 | inline void AuthenticateUserBySwitchIDAsync(Modio::AuthenticationParams User, 19 | std::function Callback) 20 | { 21 | Modio::Detail::HttpRequestParams Params = 22 | Modio::Detail::AuthenticateViaSwitchRequest 23 | .AppendPayloadValue(Modio::Detail::Constants::APIStrings::SwitchToken, User.AuthToken) 24 | .EncodeAndAppendPayloadValue(Modio::Detail::Constants::APIStrings::EmailAddress, User.UserEmail) 25 | .AppendPayloadValue(Modio::Detail::Constants::APIStrings::TermsAgreed, 26 | User.bUserHasAcceptedTerms ? "true" : "false"); 27 | return asio::async_compose, void(Modio::ErrorCode)>( 28 | Modio::Detail::AuthenticateUserExternal(Params), Callback, 29 | Modio::Detail::Services::GetGlobalContext().get_executor()); 30 | } 31 | } // namespace Detail 32 | } // namespace Modio -------------------------------------------------------------------------------- /modio/modio/detail/ops/auth/AuthenticateUserByXBoxLive.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | #include "modio/detail/ops/auth/AuthenticateUserExternal.h" 13 | #include "modio/detail/AsioWrapper.h" 14 | namespace Modio 15 | { 16 | namespace Detail 17 | { 18 | inline void AuthenticateUserByXBoxLiveAsync(Modio::AuthenticationParams User, 19 | std::function Callback) 20 | { 21 | Modio::Detail::HttpRequestParams Params = 22 | Modio::Detail::AuthenticateViaXboxLiveRequest 23 | .AppendPayloadValue(Modio::Detail::Constants::APIStrings::XboxToken, User.AuthToken) 24 | .EncodeAndAppendPayloadValue(Modio::Detail::Constants::APIStrings::EmailAddress, User.UserEmail) 25 | .AppendPayloadValue(Modio::Detail::Constants::APIStrings::TermsAgreed, 26 | User.bUserHasAcceptedTerms ? "true" : "false"); 27 | return asio::async_compose, void(Modio::ErrorCode)>( 28 | Modio::Detail::AuthenticateUserExternal(Params), Callback, 29 | Modio::Detail::Services::GetGlobalContext().get_executor()); 30 | } 31 | } // namespace Detail 32 | } // namespace Modio -------------------------------------------------------------------------------- /modio/modio/detail/ops/modmanagement/ForceUninstallModOp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | #include "modio/detail/ops/modmanagement/UninstallMod.h" 13 | #include "modio/detail/ops/SaveModCollectionToStorage.h" 14 | #include "modio/detail/AsioWrapper.h" 15 | 16 | #include 17 | namespace Modio 18 | { 19 | namespace Detail 20 | { 21 | class ForceUninstallModOp 22 | { 23 | public: 24 | ForceUninstallModOp(Modio::ModID ModToRemove) : ModToRemove(ModToRemove) {} 25 | 26 | template 27 | void operator()(CoroType& Self, Modio::ErrorCode ec = {}) 28 | { 29 | reenter(CoroutineState) { 30 | yield Modio::Detail::UninstallModAsync(ModToRemove, std::move(Self), true); 31 | if (ec) 32 | { 33 | Self.complete(ec); 34 | return; 35 | } 36 | else 37 | { 38 | yield Modio::Detail::SaveModCollectionToStorageAsync(std::move(Self)); 39 | 40 | Self.complete({}); 41 | return; 42 | } 43 | } 44 | } 45 | 46 | private: 47 | Modio::ModID ModToRemove; 48 | asio::coroutine CoroutineState; 49 | }; 50 | } 51 | } 52 | #include -------------------------------------------------------------------------------- /modio/modio/detail/ops/monetization/RefreshUserEntitlementsSteam.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | #include "modio/detail/AsioWrapper.h" 13 | #include "modio/detail/ops/monetization/RefreshUserEntitlementsOp.h" 14 | namespace Modio 15 | { 16 | namespace Detail 17 | { 18 | inline void RefreshUserEntitlementsSteamAsync(Modio::EntitlementParams Params, 19 | std::function)> Callback) 20 | { 21 | const Modio::Detail::HttpRequestParams RequestParams = Modio::Detail::SyncSteamEntitlementRequest; 22 | 23 | return asio::async_compose< 24 | std::function)>, 25 | void(Modio::ErrorCode, Modio::Optional)>( 26 | Modio::Detail::RefreshUserEntitlementsOp(RequestParams), Callback, 27 | Modio::Detail::Services::GetGlobalContext().get_executor()); 28 | } 29 | } // namespace Detail 30 | } // namespace Modio -------------------------------------------------------------------------------- /modio/modio/detail/ops/monetization/RefreshUserEntitlementsXboxLive.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | #include "modio/detail/AsioWrapper.h" 13 | #include "modio/detail/ops/monetization/RefreshUserEntitlementsOp.h" 14 | namespace Modio 15 | { 16 | namespace Detail 17 | { 18 | inline void RefreshUserEntitlementsXboxLiveAsync(Modio::EntitlementParams Params, 19 | std::function)> Callback) 20 | { 21 | const Modio::Detail::HttpRequestParams RequestParams = Modio::Detail::SyncXboxLiveEntitlementsRequest 22 | .AppendPayloadValue(Modio::Detail::Constants::APIStrings::XboxToken, Params.ExtendedParameters[Modio::Detail::Constants::APIStrings::XboxToken]); 23 | 24 | return asio::async_compose< 25 | std::function)>, 26 | void(Modio::ErrorCode, Modio::Optional)>( 27 | Modio::Detail::RefreshUserEntitlementsOp(RequestParams), Callback, 28 | Modio::Detail::Services::GetGlobalContext().get_executor()); 29 | } 30 | } // namespace Detail 31 | } // namespace Modio -------------------------------------------------------------------------------- /modio/modio/detail/serialization/ModioAvatarSerialization.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/detail/entities/ModioAvatar.h" 14 | 15 | #include "modio/detail/ModioJsonHelpers.h" 16 | 17 | namespace Modio 18 | { 19 | namespace Detail 20 | { 21 | inline void from_json(const nlohmann::json& Json, Modio::Detail::Avatar& Avatar) 22 | { 23 | Detail::ParseSafe(Json, Avatar.Filename, "filename"); 24 | Detail::ParseSafe(Json, Avatar.Original, "original"); 25 | Detail::ParseSafe(Json, Avatar.Thumb50x50, "thumb_50x50"); 26 | Detail::ParseSafe(Json, Avatar.Thumb100x100, "thumb_100x100"); 27 | } 28 | 29 | inline void to_json(nlohmann::json& Json, const Modio::Detail::Avatar& Avatar) 30 | { 31 | Json = nlohmann::json {{"filename", Avatar.Filename}, 32 | {"original", Avatar.Original}, 33 | {"thumb_50x50", Avatar.Thumb50x50}, 34 | {"thumb_100x100", Avatar.Thumb100x100}}; 35 | } 36 | } // namespace Detail 37 | } // namespace Modio -------------------------------------------------------------------------------- /modio/modio/detail/serialization/ModioEntitlementConsumptionStatusListSerialization.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2024 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/core/entities/ModioEntitlementConsumptionStatusList.h" 14 | #include "modio/detail/serialization/ModioPagedResultSerialization.h" 15 | 16 | #include "modio/detail/ModioConstants.h" 17 | #include "modio/detail/ModioJsonHelpers.h" 18 | 19 | namespace Modio 20 | { 21 | inline void from_json(const nlohmann::json& Json, Modio::EntitlementWalletBalance& WalletBalance) 22 | { 23 | Detail::ParseSafe(Json, WalletBalance.Balance, "balance"); 24 | } 25 | 26 | inline void from_json(const nlohmann::json& Json, 27 | Modio::EntitlementConsumptionStatusList& OutEntitlementConsumptionStatusList) 28 | { 29 | from_json(Json, static_cast(OutEntitlementConsumptionStatusList)); 30 | 31 | Detail::ParseSafe(Json, OutEntitlementConsumptionStatusList.InternalList, "data"); 32 | 33 | if (OutEntitlementConsumptionStatusList.InternalList.empty()) 34 | { 35 | return; 36 | } 37 | 38 | Modio::EntitlementWalletBalance WalletBalance; 39 | if (Detail::ParseSafe(Json, WalletBalance, "wallet")) 40 | { 41 | OutEntitlementConsumptionStatusList.WalletBalance = WalletBalance; 42 | } 43 | } 44 | } // namespace Modio -------------------------------------------------------------------------------- /modio/modio/detail/serialization/ModioGalleryListSerialization.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2024 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/detail/entities/ModioGalleryList.h" 14 | 15 | #include "modio/detail/ModioJsonHelpers.h" 16 | 17 | namespace Modio 18 | { 19 | inline void from_json(const nlohmann::json& Json, Modio::GalleryList& GalleryList) 20 | { 21 | using nlohmann::from_json; 22 | from_json(Json, GalleryList.InternalList); 23 | } 24 | inline void to_json(nlohmann::json& Json, const Modio::GalleryList& GalleryList) 25 | { 26 | using nlohmann::to_json; 27 | to_json(Json, GalleryList.InternalList); 28 | } 29 | } // namespace Modio 30 | -------------------------------------------------------------------------------- /modio/modio/detail/serialization/ModioGameCommunityOptionsSerialization.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2024 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/core/entities/ModioGameCommunityOptions.h" 14 | 15 | #include "modio/core/ModioLogger.h" 16 | #include "modio/detail/ModioJsonHelpers.h" 17 | 18 | namespace Modio 19 | { 20 | inline void from_json(const nlohmann::json& Json, Modio::GameCommunityOptionsFlags& GameCommunity) 21 | { 22 | // We marshal to a uint64_t initially to protect against an overflow 23 | std::uint64_t gameCommunity = 0; 24 | if (Json.is_number_integer()) 25 | { 26 | using nlohmann::from_json; 27 | from_json(Json, gameCommunity); 28 | } 29 | else 30 | { 31 | Modio::Detail::Logger().Log( 32 | Modio::LogLevel::Warning, Modio::LogCategory::Core, 33 | "GameCommunity from_json requires an integer. Using default GameCommunityOptions 0"); 34 | } 35 | GameCommunity = static_cast(gameCommunity); 36 | } 37 | 38 | inline void to_json(nlohmann::json& Json, const Modio::GameCommunityOptionsFlags& GameCommunity) 39 | { 40 | Json = GameCommunity.RawValue(); 41 | } 42 | } // namespace Modio 43 | -------------------------------------------------------------------------------- /modio/modio/detail/serialization/ModioGameInfoListSerialization.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2024 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/core/entities/ModioGameInfoList.h" 14 | #include "modio/detail/serialization/ModioPagedResultSerialization.h" 15 | 16 | #include "modio/detail/ModioConstants.h" 17 | #include "modio/detail/ModioJsonHelpers.h" 18 | 19 | namespace Modio 20 | { 21 | inline void from_json(const nlohmann::json& Json, Modio::GameInfoList& OutGameInfoList) 22 | { 23 | from_json(Json, static_cast(OutGameInfoList)); 24 | 25 | Detail::ParseSafe(Json, OutGameInfoList.InternalList, "data"); 26 | } 27 | } // namespace Modio -------------------------------------------------------------------------------- /modio/modio/detail/serialization/ModioGameMaturityOptionsSerialization.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2024 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/core/entities/ModioGameMaturityOptions.h" 14 | 15 | #include "modio/core/ModioLogger.h" 16 | #include "modio/detail/ModioJsonHelpers.h" 17 | 18 | namespace Modio 19 | { 20 | inline void from_json(const nlohmann::json& Json, Modio::GameMaturityOptionsFlags& GameMaturity) 21 | { 22 | // We marshal to a uint64_t initially to protect against an overflow 23 | std::uint64_t gameMaturity = 0; 24 | if (Json.is_number_integer()) 25 | { 26 | using nlohmann::from_json; 27 | from_json(Json, gameMaturity); 28 | } 29 | else 30 | { 31 | Modio::Detail::Logger().Log( 32 | Modio::LogLevel::Warning, Modio::LogCategory::Core, 33 | "GameMaturity from_json requires an integer. Using default GameMaturityOptions 0"); 34 | } 35 | GameMaturity = static_cast(gameMaturity); 36 | } 37 | 38 | inline void to_json(nlohmann::json& Json, const Modio::GameMaturityOptionsFlags& GameMaturity) 39 | { 40 | Json = GameMaturity.RawValue(); 41 | } 42 | } // namespace Modio 43 | -------------------------------------------------------------------------------- /modio/modio/detail/serialization/ModioGameMonetizationSerialization.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2024 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/core/entities/ModioGameMonetization.h" 14 | 15 | #include "modio/core/ModioLogger.h" 16 | #include "modio/detail/ModioJsonHelpers.h" 17 | 18 | namespace Modio 19 | { 20 | inline void from_json(const nlohmann::json& Json, Modio::GameMonetization& GameMonetization) 21 | { 22 | std::uint8_t monetization = 0; 23 | if (Json.is_number_integer()) 24 | { 25 | using nlohmann::from_json; 26 | from_json(Json, monetization); 27 | } 28 | else 29 | { 30 | Modio::Detail::Logger().Log( 31 | Modio::LogLevel::Warning, Modio::LogCategory::Core, 32 | "GameMonetization from_json requires an integer. Using default GameMonetizationOptions 0"); 33 | } 34 | GameMonetization = monetization; 35 | } 36 | 37 | inline void to_json(nlohmann::json& Json, const Modio::GameMonetization& GameMonetization) 38 | { 39 | Json = GameMonetization.RawValue(); 40 | } 41 | } // namespace Modio 42 | -------------------------------------------------------------------------------- /modio/modio/detail/serialization/ModioGameStatsSerialization.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2024 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/core/entities/ModioGameStats.h" 14 | 15 | #include "modio/detail/ModioJsonHelpers.h" 16 | 17 | namespace Modio 18 | { 19 | inline void from_json(const nlohmann::json& Json, Modio::GameStats& GameStats) 20 | { 21 | Detail::ParseSafe(Json, GameStats.GameID, "game_id"); 22 | Detail::ParseSafe(Json, GameStats.ModCountTotal, "mods_count_total"); 23 | Detail::ParseSafe(Json, GameStats.ModDownloadsToday, "mods_downloads_today"); 24 | Detail::ParseSafe(Json, GameStats.ModDownloadsTotal, "mods_downloads_total"); 25 | Detail::ParseSafe(Json, GameStats.ModDownloadsDailyAverage, "mods_downloads_daily_average"); 26 | Detail::ParseSafe(Json, GameStats.ModSubscribersTotal, "mods_subscribers_total"); 27 | Detail::ParseSafe(Json, GameStats.DateExpires, "date_expires"); 28 | } 29 | } // namespace Modio 30 | -------------------------------------------------------------------------------- /modio/modio/detail/serialization/ModioIconSerialization.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2024 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/detail/entities/ModioIcon.h" 14 | 15 | #include "modio/detail/ModioJsonHelpers.h" 16 | 17 | namespace Modio 18 | { 19 | namespace Detail 20 | { 21 | inline void from_json(const nlohmann::json& Json, Modio::Detail::Icon& Icon) 22 | { 23 | Detail::ParseSafe(Json, Icon.Filename, "filename"); 24 | Detail::ParseSafe(Json, Icon.Original, "original"); 25 | Detail::ParseSafe(Json, Icon.Thumb64x64, "thumb_64x64"); 26 | Detail::ParseSafe(Json, Icon.Thumb128x128, "thumb_128x128"); 27 | Detail::ParseSafe(Json, Icon.Thumb256x256, "thumb_256x256"); 28 | } 29 | } // namespace Detail 30 | } // namespace Modio -------------------------------------------------------------------------------- /modio/modio/detail/serialization/ModioImageSerialization.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2024 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/detail/entities/ModioImage.h" 14 | 15 | #include "modio/detail/ModioJsonHelpers.h" 16 | 17 | namespace Modio 18 | { 19 | namespace Detail 20 | { 21 | inline void from_json(const nlohmann::json& Json, Modio::Detail::Image& Image) 22 | { 23 | Detail::ParseSafe(Json, Image.Filename, "filename"); 24 | Detail::ParseSafe(Json, Image.Original, "original"); 25 | Detail::ParseSafe(Json, Image.Thumb320x180, "thumb_320x180"); 26 | Detail::ParseSafe(Json, Image.Thumb1280x720, "thumb_1280x720"); 27 | } 28 | 29 | inline void to_json(nlohmann::json& Json, const Modio::Detail::Image& Image) 30 | { 31 | Json = nlohmann::json {{"filename", Image.Filename}, 32 | {"original", Image.Original}, 33 | {"thumb_320x180", Image.Thumb320x180}, 34 | {"thumb_1280x720", Image.Thumb1280x720}}; 35 | } 36 | } // namespace Detail 37 | } // namespace Modio 38 | -------------------------------------------------------------------------------- /modio/modio/detail/serialization/ModioJsonHelpersSerialization.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modio/modio-sdk/eacc18dc4c1d8ee2404da4373f1ecdd4521a9b52/modio/modio/detail/serialization/ModioJsonHelpersSerialization.h -------------------------------------------------------------------------------- /modio/modio/detail/serialization/ModioLogoSerialization.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2024 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/detail/entities/ModioLogo.h" 14 | 15 | #include "modio/detail/ModioJsonHelpers.h" 16 | 17 | namespace Modio 18 | { 19 | namespace Detail 20 | { 21 | inline void from_json(const nlohmann::json& Json, Modio::Detail::Logo& ModLogo) 22 | { 23 | Detail::ParseSafe(Json, ModLogo.Filename, "filename"); 24 | Detail::ParseSafe(Json, ModLogo.Original, "original"); 25 | Detail::ParseSafe(Json, ModLogo.Thumb320x180, "thumb_320x180"); 26 | Detail::ParseSafe(Json, ModLogo.Thumb640x360, "thumb_640x360"); 27 | Detail::ParseSafe(Json, ModLogo.Thumb1280x720, "thumb_1280x720"); 28 | } 29 | 30 | inline void to_json(nlohmann::json& Json, const Modio::Detail::Logo& ModLogo) 31 | { 32 | Json = {{"filename", ModLogo.Filename}, 33 | {"original", ModLogo.Original}, 34 | {"thumb_320x180", ModLogo.Thumb320x180}, 35 | {"thumb_640x360", ModLogo.Thumb640x360}, 36 | {"thumb_1280x720", ModLogo.Thumb1280x720}}; 37 | } 38 | } // namespace Detail 39 | } // namespace Modio -------------------------------------------------------------------------------- /modio/modio/detail/serialization/ModioMetricsSessionEndParamsSerialization.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/core/entities/ModioMetricsSessionEndParams.h" 14 | 15 | namespace Modio 16 | { 17 | inline void to_json(nlohmann::json& Json, const Modio::MetricsSessionEndParams& Params) 18 | { 19 | Json = nlohmann::json {{"session_id", *Params.SessionId}, 20 | {"session_ts", Params.SessionTimestamp}, 21 | {"session_hash", Params.SessionHash}, 22 | {"session_nonce", *Params.SessionNonce}, 23 | {"session_order_id", Params.SessionOrderId}}; 24 | } 25 | } // namespace Modio -------------------------------------------------------------------------------- /modio/modio/detail/serialization/ModioMetricsSessionHeartbeatParamsSerialization.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/core/entities/ModioMetricsSessionHeartbeatParams.h" 14 | 15 | namespace Modio 16 | { 17 | inline void to_json(nlohmann::json& Json, const Modio::MetricsSessionHeartbeatParams& Params) 18 | { 19 | Json = nlohmann::json {{"session_id", *Params.SessionId}, 20 | {"session_ts", Params.SessionTimestamp}, 21 | {"session_hash", Params.SessionHash}, 22 | {"session_nonce", *Params.SessionNonce}, 23 | {"session_order_id", Params.SessionOrderId}}; 24 | } 25 | } // namespace Modio -------------------------------------------------------------------------------- /modio/modio/detail/serialization/ModioMetricsSessionStartParamsSerialization.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/core/entities/ModioMetricsSessionStartParams.h" 14 | 15 | namespace Modio 16 | { 17 | inline void to_json(nlohmann::json& Json, const Modio::MetricsSessionStartParams& Params) 18 | { 19 | Json = nlohmann::json {{"session_id", *Params.SessionId}, {"ids", Params.ModIds}, 20 | {"session_ts", Params.SessionTimestamp}, {"session_hash", Params.SessionHash}, 21 | {"session_nonce", *Params.SessionNonce}, {"session_order_id", Params.SessionOrderId}}; 22 | } 23 | } // namespace Modio -------------------------------------------------------------------------------- /modio/modio/detail/serialization/ModioModCommunityOptionsSerialization.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2024 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/core/entities/ModioModCommunityOptions.h" 14 | 15 | #include "modio/core/ModioLogger.h" 16 | #include "modio/detail/ModioJsonHelpers.h" 17 | 18 | namespace Modio 19 | { 20 | inline void from_json(const nlohmann::json& Json, Modio::ModCommunityOptionsFlags& ModCommunity) 21 | { 22 | // We marshal to a uint64_t initially to protect against an overflow 23 | std::uint64_t modCommunity = 0; 24 | if (Json.is_number_integer()) 25 | { 26 | using nlohmann::from_json; 27 | from_json(Json, modCommunity); 28 | } 29 | else 30 | { 31 | Modio::Detail::Logger().Log( 32 | Modio::LogLevel::Warning, Modio::LogCategory::Core, 33 | "ModCommunity from_json requires an integer. Using default ModCommunityOptions 0"); 34 | } 35 | ModCommunity = Modio::ModCommunityOptionsFlags::StorageType(modCommunity); 36 | } 37 | 38 | inline void to_json(nlohmann::json& Json, const Modio::ModCommunityOptionsFlags& ModCommunity) 39 | { 40 | // In case the Value inside ModCommunity is Optional::None, then it matches ModCommunityOptions::None 41 | Json = ModCommunity.RawValue(); 42 | } 43 | } // namespace Modio 44 | -------------------------------------------------------------------------------- /modio/modio/detail/serialization/ModioModDetailsSerialization.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2024 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/core/entities/ModioModDetails.h" 14 | #include "modio/detail/serialization/ModioPagedResultSerialization.h" 15 | 16 | #include "modio/detail/ModioConstants.h" 17 | #include "modio/detail/ModioJsonHelpers.h" 18 | 19 | namespace Modio 20 | { 21 | /// @docnone 22 | inline void from_json(const nlohmann::json& Json, Modio::ModDetails& ModDetails) 23 | { 24 | from_json(Json, static_cast(ModDetails)); 25 | 26 | Modio::Detail::ParseSafe(Json, ModDetails.InternalList, "data"); 27 | } 28 | } // namespace Modio -------------------------------------------------------------------------------- /modio/modio/detail/serialization/ModioModInfoListSerialization.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2024 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/core/entities/ModioModInfoList.h" 14 | 15 | #include "modio/detail/ModioConstants.h" 16 | #include "modio/detail/ModioJsonHelpers.h" 17 | 18 | namespace Modio 19 | { 20 | inline void from_json(const nlohmann::json& Json, Modio::ModInfoList& OutModInfoList) 21 | { 22 | from_json(Json, static_cast(OutModInfoList)); 23 | 24 | Detail::ParseSafe(Json, OutModInfoList.InternalList, "data"); 25 | } 26 | } // namespace Modio -------------------------------------------------------------------------------- /modio/modio/detail/serialization/ModioProfileMaturitySerialization.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2024 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/core/entities/ModioProfileMaturity.h" 14 | 15 | #include "modio/core/ModioLogger.h" 16 | #include "modio/detail/ModioJsonHelpers.h" 17 | 18 | namespace Modio 19 | { 20 | inline void from_json(const nlohmann::json& Json, Modio::ProfileMaturity& ProfileMaturity) 21 | { 22 | std::uint8_t maturity = 0; 23 | if (Json.is_number_integer()) 24 | { 25 | using nlohmann::from_json; 26 | from_json(Json, maturity); 27 | } 28 | else 29 | { 30 | Modio::Detail::Logger().Log( 31 | Modio::LogLevel::Warning, Modio::LogCategory::Core, 32 | "ProfileMaturity from_json requires an integer. Using default ProfileMaturity 0"); 33 | } 34 | ProfileMaturity = maturity; 35 | } 36 | 37 | inline void to_json(nlohmann::json& Json, const Modio::ProfileMaturity& ProfileMaturity) 38 | { 39 | Json = ProfileMaturity.RawValue(); 40 | } 41 | } // namespace Modio 42 | -------------------------------------------------------------------------------- /modio/modio/detail/serialization/ModioTransactionRecordSerialization.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2024 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/core/entities/ModioTransactionRecord.h" 14 | 15 | #include "modio/detail/ModioConstants.h" 16 | #include "modio/detail/ModioJsonHelpers.h" 17 | 18 | namespace Modio 19 | { 20 | inline void from_json(const nlohmann::json& Json, Modio::TransactionRecord& Transaction) 21 | { 22 | Modio::Detail::ParseSafe(Json, Transaction.Price, Modio::Detail::Constants::JSONKeys::GrossAmount); 23 | Modio::Detail::ParseSafe(Json, Transaction.UpdatedUserWalletBalance, 24 | Modio::Detail::Constants::JSONKeys::WalletBalance); 25 | 26 | Modio::Detail::ParseSafe(Json, Transaction.Mod, "mod"); 27 | } 28 | 29 | } // namespace Modio 30 | -------------------------------------------------------------------------------- /modio/modio/detail/serialization/ModioURLListSerialization.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2024 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/core/entities/ModioURLList.h" 14 | 15 | #include "modio/detail/ModioJsonHelpers.h" 16 | 17 | namespace Modio 18 | { 19 | inline void from_json(const nlohmann::json& Json, Modio::YoutubeURLList& YoutubeURLList) 20 | { 21 | Detail::ParseSafe(Json, YoutubeURLList.InternalList, "youtube"); 22 | } 23 | 24 | inline void from_json(const nlohmann::json& Json, Modio::SketchfabURLList& SketchfabURLList) 25 | { 26 | Detail::ParseSafe(Json, SketchfabURLList.InternalList, "sketchfab"); 27 | } 28 | 29 | inline void to_json(nlohmann::json& Json, const Modio::YoutubeURLList& YoutubeURLList) 30 | { 31 | Json = nlohmann::json {{"youtube", YoutubeURLList.GetRawList()}}; 32 | } 33 | 34 | inline void to_json(nlohmann::json& Json, const Modio::SketchfabURLList& SketchfabURLList) 35 | { 36 | Json = nlohmann::json {{"sketchfab", SketchfabURLList.GetRawList()}}; 37 | } 38 | } // namespace Modio 39 | -------------------------------------------------------------------------------- /modio/modio/detail/serialization/ModioUploadSessionSerialization.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2024 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/detail/entities/ModioUploadSession.h" 14 | 15 | #include "modio/detail/ModioConstants.h" 16 | #include "modio/detail/ModioJsonHelpers.h" 17 | 18 | namespace Modio 19 | { 20 | namespace Detail 21 | { 22 | 23 | inline void from_json(const nlohmann::json& Json, Modio::Detail::UploadSession& Session) 24 | { 25 | std::string UploadID; 26 | if (Detail::ParseSafe(Json, UploadID, "upload_id")) 27 | { 28 | Session.UploadID = UploadID; 29 | } 30 | Detail::ParseSafe(Json, Session.UploadStatus, "status"); 31 | } 32 | 33 | inline void to_json(nlohmann::json& Json, const Modio::Detail::UploadSession& Session) 34 | { 35 | Json = nlohmann::json {{"upload_id", Session.UploadID.value_or("")}, {"status", Session.UploadStatus}}; 36 | } 37 | 38 | inline void from_json(const nlohmann::json& Json, Modio::Detail::UploadSessionList& List) 39 | { 40 | from_json(Json, static_cast(List)); 41 | Modio::Detail::ParseSafe(Json, List.InternalList, "data"); 42 | } 43 | 44 | } // namespace Detail 45 | } // namespace Modio -------------------------------------------------------------------------------- /modio/modio/detail/serialization/ModioUserDelegationTokenSerialization.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2024 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/core/entities/ModioUserDelegationToken.h" 14 | 15 | #include "modio/detail/ModioConstants.h" 16 | #include "modio/detail/ModioJsonHelpers.h" 17 | 18 | namespace Modio 19 | { 20 | inline void from_json(const nlohmann::json& Json, Modio::UserDelegationToken& Token) 21 | { 22 | Modio::Detail::ParseSafe(Json, Token.Entity, Modio::Detail::Constants::JSONKeys::TokenEntity); 23 | Modio::Detail::ParseSafe(Json, Token.Token, Modio::Detail::Constants::JSONKeys::TokenValue); 24 | } 25 | 26 | } // namespace Modio -------------------------------------------------------------------------------- /modio/modio/detail/serialization/ModioUserListSerialization.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2024 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/core/entities/ModioUserList.h" 14 | 15 | #include "modio/detail/ModioConstants.h" 16 | #include "modio/detail/ModioJsonHelpers.h" 17 | 18 | namespace Modio 19 | { 20 | inline void from_json(const nlohmann::json& Json, Modio::UserList& OutUserList) 21 | { 22 | from_json(Json, static_cast(OutUserList)); 23 | 24 | Detail::ParseSafe(Json, OutUserList.InternalList, "data"); 25 | } 26 | } // namespace Modio -------------------------------------------------------------------------------- /modio/modio/detail/serialization/ModioUserRatingListSerialization.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2024 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/core/entities/ModioUserRatingList.h" 14 | #include "modio/detail/serialization/ModioPagedResultSerialization.h" 15 | 16 | #include "modio/detail/ModioConstants.h" 17 | #include "modio/detail/ModioJsonHelpers.h" 18 | 19 | namespace Modio 20 | { 21 | inline void from_json(const nlohmann::json& Json, Modio::UserRating& OutUserRating) 22 | { 23 | Detail::ParseSafe(Json, OutUserRating.GameId, "game_id"); 24 | Detail::ParseSafe(Json, OutUserRating.ModId, "mod_id"); 25 | Detail::ParseSafe(Json, OutUserRating.ModRating, "rating"); 26 | } 27 | 28 | inline void from_json(const nlohmann::json& Json, Modio::UserRatingList& OutUserRatingList) 29 | { 30 | from_json(Json, static_cast(OutUserRatingList)); 31 | 32 | Detail::ParseSafe(Json, OutUserRatingList.InternalList, "data"); 33 | } 34 | } // namespace Modio -------------------------------------------------------------------------------- /modio/modio/detail/userdata/ModioUserProfile.ipp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #ifdef MODIO_SEPARATE_COMPILATION 12 | #include "modio/detail/userdata/ModioUserProfile.h" 13 | #endif 14 | 15 | 16 | namespace Modio 17 | { 18 | namespace Detail 19 | { 20 | #ifdef MODIO_SEPARATE_COMPILATION 21 | Modio::Optional OAuthToken::NoToken {}; 22 | #endif 23 | } 24 | } 25 | 26 | 27 | -------------------------------------------------------------------------------- /modio/modio/http/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2021 mod.io Pty Ltd. 3 | # 4 | # This file is part of the mod.io SDK. 5 | # 6 | # Distributed under the MIT License. (See accompanying file LICENSE or 7 | # view online at ) 8 | # 9 | 10 | include(split-compilation) 11 | add_modio_implementation_file(${CMAKE_CURRENT_LIST_DIR}/ModioHttpParams.ipp) 12 | add_modio_implementation_file(${CMAKE_CURRENT_LIST_DIR}/ModioHttpRequest.ipp) 13 | add_modio_implementation_file(${CMAKE_CURRENT_LIST_DIR}/ModioHttpService.ipp) 14 | 15 | -------------------------------------------------------------------------------- /modio/modio/impl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2021 mod.io Pty Ltd. 3 | # 4 | # This file is part of the mod.io SDK. 5 | # 6 | # Distributed under the MIT License. (See accompanying file LICENSE or 7 | # view online at ) 8 | # 9 | 10 | include(split-compilation) 11 | add_modio_implementation_file(${CMAKE_CURRENT_LIST_DIR}/SDKCore.ipp) 12 | add_modio_implementation_file(${CMAKE_CURRENT_LIST_DIR}/SDKMetrics.ipp) 13 | add_modio_implementation_file(${CMAKE_CURRENT_LIST_DIR}/SDKModManagement.ipp) 14 | add_modio_implementation_file(${CMAKE_CURRENT_LIST_DIR}/SDKModMetadata.ipp) 15 | add_modio_implementation_file(${CMAKE_CURRENT_LIST_DIR}/SDKMonetization.ipp) 16 | add_modio_implementation_file(${CMAKE_CURRENT_LIST_DIR}/SDKUserData.ipp) 17 | add_modio_implementation_file(${CMAKE_CURRENT_LIST_DIR}/detail/ModioObjectTrack.ipp) 18 | -------------------------------------------------------------------------------- /modio/modio/timer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2021 mod.io Pty Ltd. 3 | # 4 | # This file is part of the mod.io SDK. 5 | # 6 | # Distributed under the MIT License. (See accompanying file LICENSE or 7 | # view online at ) 8 | # 9 | 10 | include(split-compilation) 11 | add_modio_implementation_file(${CMAKE_CURRENT_LIST_DIR}/ModioTimerService.ipp) 12 | -------------------------------------------------------------------------------- /modio/modio/timer/ModioTimerImplementationBase.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/detail/timer/ITimerImplementation.h" 14 | #include 15 | 16 | namespace Modio 17 | { 18 | namespace Detail 19 | { 20 | class TimerImplementationBase : public ITimerImplementation 21 | { 22 | protected: 23 | // std::chrono::steady_clock::time_point ExpiryTime; 24 | std::chrono::steady_clock::duration TimerDuration; 25 | 26 | public: 27 | void ExpiresAfter(std::chrono::steady_clock::duration Duration) override 28 | { 29 | TimerDuration = Duration; 30 | } 31 | 32 | std::chrono::steady_clock::duration GetTimerDuration() 33 | { 34 | return TimerDuration; 35 | } 36 | 37 | /*void ExpireAt(std::chrono::steady_clock::time_point Time) override 38 | { 39 | ExpiryTime = Time; 40 | }*/ 41 | 42 | void Cancel() override {} 43 | }; 44 | } // namespace Detail 45 | } // namespace Modio -------------------------------------------------------------------------------- /modio/modio/timer/ModioTimerService.ipp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #ifdef MODIO_SEPARATE_COMPILATION 12 | #include "modio/timer/ModioTimerService.h" 13 | #endif 14 | 15 | namespace Modio 16 | { 17 | namespace Detail 18 | { 19 | TimerService::TimerService(asio::io_context& IOService) 20 | : asio::detail::service_base(IOService) 21 | { 22 | PlatformImplementation = std::make_shared(*this); 23 | } 24 | 25 | void TimerService::construct(implementation_type& Implementation) 26 | { 27 | Implementation = std::make_shared(); 28 | } 29 | 30 | void TimerService::destroy(implementation_type& Implementation) 31 | { 32 | Implementation.reset(); 33 | } 34 | 35 | void TimerService::Cancel(implementation_type& Implementation) 36 | { 37 | PlatformImplementation->Cancel(Implementation); 38 | } 39 | 40 | } // namespace Detail 41 | } 42 | 43 | -------------------------------------------------------------------------------- /platform/android/.gitignore: -------------------------------------------------------------------------------- 1 | *.so 2 | 3 | local.properties -------------------------------------------------------------------------------- /platform/android/README.mdx: -------------------------------------------------------------------------------- 1 | ## mod.io Android SDK Integration 2 | 3 | Please read the Getting Started guide located in the docs folder for using the Android platform module. 4 | -------------------------------------------------------------------------------- /platform/android/android/AsioIPV6Emulation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | // Stub file, to be removed when asio is refactored to only include this file when NN specific defines are included -------------------------------------------------------------------------------- /platform/android/android/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2021 mod.io Pty Ltd. 3 | # 4 | # This file is part of the mod.io SDK. 5 | # 6 | # Distributed under the MIT License. (See accompanying file LICENSE or 7 | # view online at ) 8 | # 9 | 10 | if (NOT TARGET platform) 11 | add_library(platform INTERFACE) 12 | endif() 13 | 14 | target_compile_features(platform INTERFACE cxx_std_17) 15 | target_compile_options(platform INTERFACE 16 | $<$: 17 | /WX # Enable warnings as errors 18 | > 19 | $<$: 20 | -Werror # Enable warnings as errors 21 | > 22 | $<$: 23 | -Werror # Enable warnings as errors 24 | > 25 | ) 26 | target_include_directories(platform INTERFACE ${CMAKE_CURRENT_LIST_DIR}) 27 | 28 | target_link_libraries(platform INTERFACE mbedtls mbedcrypto mbedx509) 29 | target_link_libraries(platform INTERFACE httpparser ghc_filesystem) 30 | target_link_libraries(platform INTERFACE log) 31 | -------------------------------------------------------------------------------- /platform/android/android/ModioAndroid.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "modio/detail/ModioLibraryConfigurationHelpers.h" 3 | 4 | #include 5 | #include 6 | 7 | namespace Modio 8 | { 9 | /// @docpublic 10 | /// @brief Initializes the JNI environment for the Plugin to be able to set up all of its bindings 11 | /// @param InJavaVM Pointer to the JavaVM from the host application 12 | /// @param InClassLoader ClassLoader from the host application 13 | /// @param bUseExternalStorageForMods Flag to specify whether to use external storage for storing downloaded mods (default is true) 14 | MODIOSDK_API void InitializeAndroidJNI(JavaVM* InJavaVM, jobject InClassLoader, 15 | bool bUseExternalStorageForMods = true); 16 | 17 | /// @docpublic 18 | /// @brief Sets the global activity object for the Plugin to be able to call Java methods 19 | /// @param ActivityObject Main ActivityObject from the host Java application 20 | MODIOSDK_API void SetGlobalActivity(jobject ActivityObject); 21 | 22 | /// @docpublic 23 | /// @brief Initialize the Modio SDK for Android. Called after InitializeAndroidJNI and SetGlobalActivity 24 | MODIOSDK_API void InitializeAndroid(); 25 | } 26 | 27 | #ifndef MODIO_SEPARATE_COMPILATION 28 | #include "ModioAndroid.ipp" 29 | #endif -------------------------------------------------------------------------------- /platform/android/android/ModioAndroid.ipp: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifdef MODIO_SEPARATE_COMPILATION 4 | #include "ModioAndroid.h" 5 | #endif 6 | 7 | #include "jni/AndroidContextService.h" 8 | #include "modio/core/ModioServices.h" 9 | 10 | namespace Modio 11 | { 12 | void InitializeAndroidJNI(JavaVM* InJavaVM, jobject ClassLoader, bool bUseExternalStorageForMods) 13 | { 14 | Modio::Detail::AndroidContextService::InitializeJNI(InJavaVM, ClassLoader, bUseExternalStorageForMods); 15 | } 16 | 17 | void SetGlobalActivity(jobject ActivityObject) 18 | { 19 | Modio::Detail::AndroidContextService::Get().SetGlobalActivity(ActivityObject); 20 | } 21 | 22 | void InitializeAndroid() 23 | { 24 | Modio::Detail::AndroidContextService::Get().InitializeAndroid(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /platform/android/android/ModioPlatformDefines.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2022 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | // This file enables platform specific flags 12 | // It is called by the ModioGeneratedVariables.h 13 | 14 | -------------------------------------------------------------------------------- /platform/android/android/ModioWeakSymbol.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | extern "C" 14 | { 15 | #ifdef __clang__ 16 | inline void modio_profile_stub(...) {}; 17 | #else 18 | static inline void modio_profile_stub(...) {}; 19 | #endif 20 | } 21 | 22 | #define MODIO_WEAK(Name) __attribute__((weak, alias("modio_profile_stub"))) 23 | -------------------------------------------------------------------------------- /platform/android/android/android/Guid.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modio/modio-sdk/eacc18dc4c1d8ee2404da4373f1ecdd4521a9b52/platform/android/android/android/Guid.h -------------------------------------------------------------------------------- /platform/android/android/android/LibUringWrapper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | #ifdef MODIO_PLATFORM_UNREAL 13 | 14 | // Unreal has some imports that define these values, then they are 15 | // refefined in the liburing header. For that reason, this wrapper 16 | // helps to avoid those warnings/errors. 17 | #ifdef RWF_HIPRI 18 | #undef RWF_HIPRI 19 | #endif 20 | 21 | #ifdef RWF_DSYNC 22 | #undef RWF_DSYNC 23 | #endif 24 | 25 | #ifdef RWF_SYNC 26 | #undef RWF_SYNC 27 | #endif 28 | 29 | #ifdef RWF_NOWAIT 30 | #undef RWF_NOWAIT 31 | #endif 32 | 33 | #ifdef RWF_APPEND 34 | #undef RWF_APPEND 35 | #endif 36 | #endif 37 | 38 | #include "liburing.h" 39 | -------------------------------------------------------------------------------- /platform/android/android/android/TimerCallback.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #include "android/TimerSharedState.h" 12 | -------------------------------------------------------------------------------- /platform/android/android/android/detail/ModioUEPlatformEpilogue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | // clang-format off 12 | 13 | #pragma GCC diagnostic pop 14 | 15 | // clang-format on 16 | -------------------------------------------------------------------------------- /platform/android/android/android/detail/ModioUEPlatformPreamble.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | // clang-format off 12 | 13 | #include "Clang/ClangPlatformCompilerPreSetup.h" 14 | #include "GenericPlatform/GenericPlatformCompilerPreSetup.h" 15 | #undef PRAGMA_DEFAULT_VISIBILITY_START 16 | #undef PRAGMA_DEFAULT_VISIBILITY_END 17 | #include "HAL/PlatformMisc.h" 18 | #include "Misc/AssertionMacros.h" 19 | #include "Android/AndroidPlatform.h" 20 | #include "Android/AndroidPlatformCompilerPreSetup.h" 21 | #include "Android/AndroidPlatformCompilerSetup.h" 22 | 23 | #pragma GCC diagnostic push 24 | 25 | #pragma GCC diagnostic ignored "-Wshadow" 26 | 27 | // clang-format on 28 | -------------------------------------------------------------------------------- /platform/android/android/android/detail/ops/timer/InitializeTimerServiceOp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | #include "modio/detail/AsioWrapper.h" 13 | #include 14 | 15 | #include 16 | class InitializeTimerServiceOp 17 | { 18 | std::weak_ptr SharedState; 19 | 20 | public: 21 | InitializeTimerServiceOp(std::weak_ptr SharedState) : SharedState(SharedState) {}; 22 | 23 | template 24 | void operator()(CoroType& Self, Modio::ErrorCode ec = {}) 25 | { 26 | reenter(CoroState) 27 | { 28 | BeginTimerLoopAsync(SharedState, [](Modio::ErrorCode) {}); 29 | 30 | Self.complete({}); 31 | return; 32 | } 33 | } 34 | 35 | private: 36 | asio::coroutine CoroState; 37 | }; 38 | 39 | #include -------------------------------------------------------------------------------- /platform/android/android/file/StaticDirectoriesImplementation.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | #include 5 | #include "jni/AndroidContextService.h" 6 | #include "jni/JavaClassWrapperModio.h" 7 | 8 | namespace Modio 9 | { 10 | namespace Detail 11 | { 12 | static bool GetDefaultRootDataPath(Modio::filesystem::path& RootDataPath) 13 | { 14 | RootDataPath = Modio::Detail::AndroidContextService::Get().GetJavaClassModio()->GetExternalStoragePath(); 15 | return true; 16 | } 17 | static bool GetDefaultCommonDataPath(Modio::filesystem::path& CommonDataPath) 18 | { 19 | CommonDataPath = Modio::Detail::AndroidContextService::Get() 20 | .GetJavaClassModio()->GetInternalStoragePath(); 21 | 22 | return true; 23 | } 24 | } // namespace Detail 25 | } // namespace Modio 26 | -------------------------------------------------------------------------------- /platform/android/android/jni/JavaClassWrapper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "modio/core/ModioSplitCompilation.h" 4 | #include 5 | #include 6 | 7 | namespace Modio 8 | { 9 | namespace Detail 10 | { 11 | /// @docinternal 12 | /// @brief Base class that wraps any native Java classes that need to be instantiated 13 | /// and called for any Java-based Modio functionality 14 | class JavaClassWrapper 15 | { 16 | public: 17 | MODIO_IMPL JavaClassWrapper(std::string ClassName, const char* ConstructorSignature, ...); 18 | MODIO_IMPL ~JavaClassWrapper(); 19 | 20 | MODIO_IMPL bool CallBooleanMethod(jmethodID Method, ...); 21 | MODIO_IMPL std::string CallStringMethod(jmethodID Method, ...); 22 | MODIO_IMPL void CallVoidMethod(jmethodID Method, ...); 23 | 24 | protected: 25 | jobject Object = NULL; 26 | jclass Class = NULL; 27 | }; 28 | }; // namespace Detail 29 | 30 | } // namespace Modio 31 | 32 | #ifndef MODIO_SEPARATE_COMPILATION 33 | #include "JavaClassWrapper.ipp" 34 | #endif -------------------------------------------------------------------------------- /platform/android/android/jni/JavaClassWrapperModio.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "JavaClassWrapper.h" 4 | #include "modio/core/ModioSplitCompilation.h" 5 | #include 6 | #include 7 | 8 | namespace Modio 9 | { 10 | namespace Detail 11 | { 12 | /// @docinternal 13 | /// @brief WRapper around the internal core Modio Java class 14 | class JavaClassWrapperModio : JavaClassWrapper 15 | { 16 | public: 17 | MODIO_IMPL JavaClassWrapperModio(jobject Activity, bool bUseExternalStorageForMods); 18 | 19 | MODIO_IMPL std::string GetCertificatePath(); 20 | MODIO_IMPL std::string GetInternalStoragePath(); 21 | MODIO_IMPL std::string GetExternalStoragePath(); 22 | 23 | private: 24 | jmethodID GetCertificatePathMethodId; 25 | jmethodID GetInternalStoragePathMethodId; 26 | jmethodID GetExternalStoragePathMethodId; 27 | }; 28 | }; // namespace Detail 29 | 30 | } // namespace Modio 31 | 32 | #ifndef MODIO_SEPARATE_COMPILATION 33 | #include "JavaClassWrapperModio.ipp" 34 | #endif -------------------------------------------------------------------------------- /platform/android/android/timer/TimerImplementation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/timer/ModioTimerImplementationBase.h" 14 | #include 15 | #include 16 | 17 | class TimerImplementation : public Modio::Detail::TimerImplementationBase 18 | { 19 | public: 20 | std::chrono::steady_clock::time_point CalculatedExpiryTime; 21 | }; -------------------------------------------------------------------------------- /platform/android/platform.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2021 mod.io Pty Ltd. 3 | # 4 | # This file is part of the mod.io SDK. 5 | # 6 | # Distributed under the MIT License. (See accompanying file LICENSE or 7 | # view online at ) 8 | # 9 | # 10 | 11 | if(MODIO_PLATFORM STREQUAL "ANDROID" OR MODIO_PLATFORM STREQUAL "OCULUS") 12 | add_subdirectory(${CMAKE_CURRENT_LIST_DIR}) 13 | endif() 14 | -------------------------------------------------------------------------------- /platform/android/ueplatform.json: -------------------------------------------------------------------------------- 1 | { 2 | "Platforms": { 3 | "Android": { 4 | "IncludeDirectories": [], 5 | "PlatformSpecificDefines": [], 6 | "ModuleDependencies": ["Launch"], 7 | "AndroidPluginPropertiesForReceipt" : ["ModioAndroid_UPL.xml"] 8 | } 9 | }, 10 | "IncludeDirectories": [ 11 | "android/android" 12 | ], 13 | "PlatformSpecificDefines": [ 14 | "MODIO_TARGET_PLATFORM_ID=\"ANDROID\"", 15 | "MODIO_UNREAL_PLATFORM_PREAMBLE=\"android/detail/ModioUEPlatformPreamble.h\"", 16 | "MODIO_UNREAL_PLATFORM_EPILOGUE=\"android/detail/ModioUEPlatformEpilogue.h\"", 17 | "_LIBCPP_DISABLE_DEPRECATION_WARNINGS" 18 | ], 19 | "ModuleDependencies": [ 20 | "mbedtls" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /platform/interface/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2021 mod.io Pty Ltd. 3 | # 4 | # This file is part of the mod.io SDK. 5 | # 6 | # Distributed under the MIT License. (See accompanying file LICENSE or 7 | # view online at ) 8 | # 9 | 10 | if (NOT TARGET ${MODIO_TARGET_NAME}) 11 | add_library (${MODIO_TARGET_NAME} INTERFACE) 12 | endif() 13 | 14 | target_include_directories(${MODIO_TARGET_NAME} INTERFACE ${CMAKE_CURRENT_LIST_DIR}) 15 | 16 | 17 | install( 18 | DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/ 19 | DESTINATION ${CMAKE_INSTALL_PREFIX}/header_only/common 20 | COMPONENT header_only 21 | 22 | ) 23 | -------------------------------------------------------------------------------- /platform/interface/modio/detail/cache/ICacheServiceImplementation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | namespace Modio 14 | { 15 | namespace Detail 16 | { 17 | class ICacheServiceImplementation 18 | { 19 | public: 20 | virtual void SetCacheExpireTime(std::chrono::steady_clock::duration ExpireTime) = 0; 21 | virtual void AddToCache(std::string ResourceURL, Modio::Detail::DynamicBuffer ResponseData) = 0; 22 | virtual void Modio::Optional FetchFromCache(std::string ResourceURL) = 0; 23 | virtual void ClearCache() = 0; 24 | }; 25 | } 26 | } -------------------------------------------------------------------------------- /platform/interface/modio/detail/http/IHttpRequestImplementation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | #include "modio/core/ModioStdTypes.h" 13 | #include "modio/http/ModioHttpParams.h" 14 | #include 15 | 16 | namespace Modio 17 | { 18 | namespace Detail 19 | { 20 | class IHttpRequestImplementation 21 | { 22 | public: 23 | virtual ~IHttpRequestImplementation() {} 24 | virtual Modio::Detail::HttpRequestParams& GetParameters() = 0; 25 | virtual std::uint32_t GetResponseCode() = 0; 26 | virtual Modio::Optional GetRedirectURL() = 0; 27 | virtual Modio::Optional GetRetryAfter() = 0; 28 | virtual Modio::Optional GetHeaderValue(std::string Key) = 0; 29 | }; 30 | } // namespace Detail 31 | } // namespace Modio 32 | -------------------------------------------------------------------------------- /platform/interface/modio/detail/timer/ITimerImplementation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | namespace Modio 14 | { 15 | namespace Detail 16 | { 17 | class ITimerImplementation 18 | { 19 | public: 20 | virtual ~ITimerImplementation() {} 21 | virtual void ExpiresAfter(std::chrono::steady_clock::duration Duration) = 0; 22 | //virtual void ExpireAt(std::chrono::steady_clock::time_point Time) = 0; 23 | virtual void Cancel() = 0; 24 | }; 25 | } // namespace Detail 26 | } // namespace Modio -------------------------------------------------------------------------------- /platform/interface/modio/detail/timer/ITimerServiceImplementation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | namespace Modio 14 | { 15 | namespace Detail 16 | { 17 | class ITimerServiceImplementation 18 | { 19 | public: 20 | virtual ~ITimerServiceImplementation() {} 21 | virtual void Shutdown() = 0; 22 | //virtual void Cancel(IOObjectImplementationType) = 0; 23 | //template 24 | //auto WaitAsync(IOObjectImplementationType PlatformIOObjectInstance, CompletionToken&& Token); 25 | 26 | }; 27 | } // namespace Detail 28 | } // namespace Modio 29 | -------------------------------------------------------------------------------- /platform/interface/modio/detail/userdata/IUserDataServiceImplementation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | namespace Modio 14 | { 15 | namespace Detail 16 | { 17 | class IUserDataServiceImplementation 18 | { 19 | public: 20 | //async_Initialize 21 | //async_ClearUserData 22 | //SaveUserDataToStorageAsync 23 | }; 24 | } 25 | } -------------------------------------------------------------------------------- /platform/interface/platform.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2021 mod.io Pty Ltd. 3 | # 4 | # This file is part of the mod.io SDK. 5 | # 6 | # Distributed under the MIT License. (See accompanying file LICENSE or 7 | # view online at ) 8 | # 9 | # 10 | 11 | #workaround for now, the platform interfaces may actually just be put into the core folders 12 | add_subdirectory(${CMAKE_CURRENT_LIST_DIR}) 13 | -------------------------------------------------------------------------------- /platform/ios/README.mdx: -------------------------------------------------------------------------------- 1 | ## mod.io iOS integration 2 | 3 | Please read the Getting Started guide located in the docs folder for using the iOS module. -------------------------------------------------------------------------------- /platform/ios/doc/cmake-integration.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: ios-cmake-integration 3 | title: CMake Integration 4 | slug: /cppsdk/ios/cmake-integration 5 | sidebar_position: 1 6 | custom_edit_url: https://github.com/modio/modio-sdk-internal/blob/develop/platform/ios/doc/cmake-integration.mdx 7 | --- 8 | 9 | # Inside a CMake project 10 | 11 | Unzip the archive. Confirm `your_project` uses CMake 3.20 or later. 12 | 13 | ```cmake 14 | cmake_minimum_required(VERSION 3.20) 15 | ``` 16 | 17 | Specify the target platform with `IOS`. 18 | 19 | ```cmake 20 | set (MODIO_PLATFORM IOS) 21 | ``` 22 | Add the SDK subdirectory to your project 23 | 24 | ```cmake 25 | add_subdirectory( EXCLUDE_FROM_ALL) 26 | target_compile_features(your_project PUBLIC cxx_std_17) 27 | ``` 28 | 29 | Link the library to your project. 30 | 31 | To use the header-only configuration: 32 | ```cmake 33 | target_link_libraries(your_project PUBLIC modio) 34 | ``` 35 | Or to use the static library configuration: 36 | ```cmake 37 | target_link_libraries(your_project PUBLIC modioStatic) 38 | ``` 39 | 40 | To simplify the CMake configuration, the folder `cmake/` has the file `CMakePresets.json` with the basic configuration required to guide the mod.io SDK compilation using the iOS SDK. If you copy that file to the folder root, it can be used as follows: 41 | 42 | ```cmake 43 | cmake --preset ios 44 | ``` -------------------------------------------------------------------------------- /platform/ios/examples/modioSSO/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #import 12 | 13 | @interface AppDelegate : UIResponder 14 | 15 | @property (strong, nonatomic) UIWindow *window; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /platform/ios/examples/modioSSO/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2024 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #import "AppDelegate.h" 12 | #import "AppViewController.h" 13 | 14 | @interface AppDelegate () 15 | 16 | @end 17 | 18 | @implementation AppDelegate 19 | 20 | - (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions 21 | { 22 | AppViewController* VController = [[AppViewController alloc] init]; 23 | self.window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds]; 24 | self.window.rootViewController = VController; 25 | [self.window makeKeyAndVisible]; 26 | return YES; 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /platform/ios/examples/modioSSO/AppViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2024 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #import 12 | #import 13 | 14 | extern NSString* const ModioAppIdentifier; 15 | 16 | @interface AppViewController 17 | : UIViewController 18 | 19 | @property(nonatomic, strong) UITextView* LoginInfoTextView; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /platform/ios/examples/modioSSO/ModioSDKHelper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2024 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #include 12 | 13 | extern bool FinishBackGroundThread; 14 | extern bool UserAuthenticated; 15 | 16 | typedef void(^SDKAuthCallback)(bool Authenticated); 17 | 18 | @interface ModioSDKHelper : NSObject 19 | 20 | + (void)StartModioSDK; 21 | + (void)AuthenticateWithAppleToken:(NSString*)Token Email:(NSString*)Email AuthCallback:(SDKAuthCallback)Callback; 22 | + (NSString *)QueryUserName; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /platform/ios/examples/modioSSO/main.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2024 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #import 12 | #import "AppDelegate.h" 13 | 14 | int main(int Argc, char** Argv) 15 | { 16 | @autoreleasepool 17 | { 18 | return UIApplicationMain(Argc, Argv, nil, NSStringFromClass([AppDelegate class])); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /platform/ios/examples/modioSSO/resources/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modio/modio-sdk/eacc18dc4c1d8ee2404da4373f1ecdd4521a9b52/platform/ios/examples/modioSSO/resources/icon.png -------------------------------------------------------------------------------- /platform/ios/examples/modioSSO/resources/icons.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modio/modio-sdk/eacc18dc4c1d8ee2404da4373f1ecdd4521a9b52/platform/ios/examples/modioSSO/resources/icons.icns -------------------------------------------------------------------------------- /platform/ios/examples/modioSSO/resources/modioSSO.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.developer.applesignin 6 | 7 | Default 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /platform/ios/examples/modioSwift/ModioSDKHelper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2024 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #include 12 | 13 | extern bool FinishBackGroundThread; 14 | extern bool UserAuthenticated; 15 | 16 | typedef void(^SDKInitialization)(bool finished); 17 | typedef void(^SDKListCallback)(NSArray * _Nonnull); 18 | 19 | @interface ModioSDKHelper : NSObject 20 | 21 | + (void)StartModioSDK:(SDKInitialization _Nonnull)Callback; 22 | + (void)ModioModList:(SDKListCallback _Nonnull)Callback; 23 | + (void)ShutdownModioSDK; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /platform/ios/examples/modioSwift/README.adoc: -------------------------------------------------------------------------------- 1 | = mod.io iOS SDK Example 2 | 3 | == About this Sample 4 | 5 | This sample demonstrates the interactions between Swift and the mod.io SDK. This allows users to engage with the mod.io service and access your game's User Generated Content. 6 | 7 | iOS has two options to run: Simulator and device. To choose either, enable/disable the variable `MODIO_IOS_DEVICE`. When it is `True``, it will load the frameworks that allow Xcode to run on device. When `False` (default), it will load the simulator binaries offered by the Apple SDK. 8 | 9 | In case you want to run any binary on device, you need a paid Apple Developer Account, which you can get at https://developer.apple.com[Apple Developer account]. 10 | 11 | As of the date of this writing, Swift does not support `std::function` as callbacks with the C++ support. Therefore, the easiest way to integrate the mod.io SDK is using Objective-C++ and the bridging header. This example uses both. 12 | 13 | == Running the sample 14 | 15 | Once you have built the mod.io SDK project with CMake and flag `MODIO_BUILD_EXAMPLES` enabled, you will have access to the target `modioSwift`. This project is configured to run on Xcode. 16 | 17 | After these steps, make sure to update your `GAME_ID` and `API_KEY` in the `ModioSDKHelper.mm` file. -------------------------------------------------------------------------------- /platform/ios/examples/modioSwift/modioSDK-BridgingHeader.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2024 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #import "ModioSDKHelper.h" 12 | -------------------------------------------------------------------------------- /platform/ios/examples/modioSwift/modioSDKApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // modioSDKApp.swift 3 | // modioSDK 4 | // 5 | // Created by RH VT on 9/4/2024. 6 | // 7 | 8 | import SwiftUI 9 | 10 | @main 11 | struct modioSDKApp: App 12 | { 13 | var body: some Scene { 14 | WindowGroup { 15 | ContentView() 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /platform/ios/examples/modioSwift/resources/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modio/modio-sdk/eacc18dc4c1d8ee2404da4373f1ecdd4521a9b52/platform/ios/examples/modioSwift/resources/icon.png -------------------------------------------------------------------------------- /platform/ios/examples/modioSwift/resources/icons.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/modio/modio-sdk/eacc18dc4c1d8ee2404da4373f1ecdd4521a9b52/platform/ios/examples/modioSwift/resources/icons.icns -------------------------------------------------------------------------------- /platform/ios/ios/AsioIPV6Emulation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | // Stub file, to be removed when asio is refactored to only include this file when NN specific defines are included -------------------------------------------------------------------------------- /platform/ios/ios/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2021 mod.io Pty Ltd. 3 | # 4 | # This file is part of the mod.io SDK. 5 | # 6 | # Distributed under the MIT License. (See accompanying file LICENSE or 7 | # view online at ) 8 | # 9 | 10 | if (NOT TARGET platform) 11 | add_library(platform INTERFACE) 12 | endif() 13 | 14 | target_compile_features(platform INTERFACE cxx_std_17) 15 | target_compile_definitions(platform INTERFACE -DFU2_WITH_NO_EMPTY_PROPAGATION) 16 | target_include_directories(platform INTERFACE ${CMAKE_CURRENT_LIST_DIR}) 17 | 18 | find_library(FOUNDATION Foundation) 19 | find_library(CFNETWORK CFNetwork) 20 | 21 | target_link_libraries(platform INTERFACE httpparser pthread ghc_filesystem ${FOUNDATION} ${CFNETWORK}) 22 | 23 | -------------------------------------------------------------------------------- /platform/ios/ios/ModioPlatformDefines.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2022 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | // This file enables platform specific flags 12 | // It is called by the ModioGeneratedVariables.h 13 | #ifndef FU2_WITH_NO_EMPTY_PROPAGATION 14 | #define FU2_WITH_NO_EMPTY_PROPAGATION 15 | #endif -------------------------------------------------------------------------------- /platform/ios/ios/ModioWeakSymbol.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #define MODIO_WEAK_STUB_IMPL {} 14 | 15 | #define MODIO_WEAK(Name) __attribute__((weak)) -------------------------------------------------------------------------------- /platform/ios/ios/ios/TimerCallback.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #include "ios/TimerSharedState.h" 12 | -------------------------------------------------------------------------------- /platform/ios/ios/ios/detail/ModioUEPlatformEpilogue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma GCC diagnostic pop 12 | -------------------------------------------------------------------------------- /platform/ios/ios/ios/detail/ModioUEPlatformPreamble.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | // clang-format off 12 | 13 | #include "Clang/ClangPlatformCompilerPreSetup.h" 14 | #include "GenericPlatform/GenericPlatformCompilerPreSetup.h" 15 | #undef PRAGMA_DEFAULT_VISIBILITY_START 16 | #undef PRAGMA_DEFAULT_VISIBILITY_END 17 | #include "HAL/PlatformMisc.h" 18 | #include "Misc/AssertionMacros.h" 19 | #include "ios/iOSPlatform.h" 20 | #include "ios/iOSPlatformCompilerSetup.h" 21 | #include "ios/iOSPlatformCompilerPreSetup.h" 22 | #include "ios/iOSPlatformAtomics.h" 23 | 24 | #pragma GCC diagnostic push 25 | 26 | // This is required by file "resolver_base.hpp" in line 69 which complains about this: 27 | // Declaration shadows a variable in namespace 'asio::ip' 28 | // https://github.com/chriskohlhoff/asio/issues/721 29 | #pragma GCC diagnostic ignored "-Wshadow" 30 | 31 | // clang-format on 32 | -------------------------------------------------------------------------------- /platform/ios/ios/ios/detail/ops/timer/InitializeTimerServiceOp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | #include "modio/detail/AsioWrapper.h" 13 | #include 14 | 15 | #include 16 | class InitializeTimerServiceOp 17 | { 18 | std::weak_ptr SharedState; 19 | 20 | public: 21 | InitializeTimerServiceOp(std::weak_ptr SharedState) : SharedState(SharedState) {}; 22 | 23 | template 24 | void operator()(CoroType& Self, Modio::ErrorCode ec = {}) 25 | { 26 | reenter(CoroState) 27 | { 28 | BeginTimerLoopAsync(SharedState, [](Modio::ErrorCode) {}); 29 | 30 | Self.complete({}); 31 | return; 32 | } 33 | } 34 | 35 | private: 36 | asio::coroutine CoroState; 37 | }; 38 | 39 | #include -------------------------------------------------------------------------------- /platform/ios/ios/timer/TimerImplementation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/timer/ModioTimerImplementationBase.h" 14 | #include 15 | #include 16 | 17 | class TimerImplementation : public Modio::Detail::TimerImplementationBase 18 | { 19 | public: 20 | std::chrono::steady_clock::time_point CalculatedExpiryTime; 21 | }; -------------------------------------------------------------------------------- /platform/ios/platform.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2021 mod.io Pty Ltd. 3 | # 4 | # This file is part of the mod.io SDK. 5 | # 6 | # Distributed under the MIT License. (See accompanying file LICENSE or 7 | # view online at ) 8 | # 9 | # 10 | 11 | if(MODIO_PLATFORM STREQUAL "IOS") 12 | add_subdirectory(${CMAKE_CURRENT_LIST_DIR}) 13 | endif() 14 | -------------------------------------------------------------------------------- /platform/ios/ueplatform.json: -------------------------------------------------------------------------------- 1 | { 2 | "Platforms": { 3 | "iOS": { 4 | "IncludeDirectories": [], 5 | "PlatformSpecificDefines": [], 6 | "ModuleDependencies": [], 7 | "SystemLibraryDependencies": [] 8 | } 9 | }, 10 | "IncludeDirectories": [ 11 | "ios/ios" 12 | ], 13 | "PlatformSpecificDefines": [ 14 | "MODIO_TARGET_PLATFORM_ID=\"ios\"", 15 | "MODIO_UNREAL_PLATFORM_PREAMBLE=\"ios/detail/ModioUEPlatformPreamble.h\"", 16 | "MODIO_UNREAL_PLATFORM_EPILOGUE=\"ios/detail/ModioUEPlatformEpilogue.h\"", 17 | "FU2_WITH_NO_EMPTY_PROPAGATION", 18 | "ASIO_INITIALIZE_CALL_STACK" 19 | ], 20 | "ModuleDependencies": [ 21 | ], 22 | "SystemLibraryDependencies": [] 23 | } 24 | -------------------------------------------------------------------------------- /platform/linux/README.mdx: -------------------------------------------------------------------------------- 1 | ## mod.io Linux integration 2 | 3 | Please read the Getting Started guide located in the docs folder for using the Linux module. -------------------------------------------------------------------------------- /platform/linux/doc/cmake-integration.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: linux-cmake-integration 3 | title: CMake Integration 4 | slug: /cppsdk/linux/cmake-integration 5 | sidebar_position: 1 6 | custom_edit_url: https://github.com/modio/modio-sdk-internal/blob/develop/platform/linux/doc/cmake-integration.mdx 7 | --- 8 | 9 | ## Inside a CMake project 10 | 11 | Unzip the archive. Confirm `your_project` uses CMake 3.20 or later. 12 | 13 | ```cmake 14 | cmake_minimum_required(VERSION 3.20) 15 | ``` 16 | 17 | Specify the target platform with `LINUX`. 18 | 19 | ```cmake 20 | set (MODIO_PLATFORM LINUX) 21 | ``` 22 | Add the SDK subdirectory to your project 23 | 24 | ```cmake 25 | add_subdirectory( EXCLUDE_FROM_ALL) 26 | target_compile_features(your_project PUBLIC cxx_std_17) 27 | ``` 28 | 29 | Link the library to your project. 30 | 31 | To use the header-only configuration: 32 | ```cmake 33 | target_link_libraries(your_project PUBLIC modio) 34 | ``` 35 | Or to use the static library configuration: 36 | ```cmake 37 | target_link_libraries(your_project PUBLIC modioStatic) 38 | ``` 39 | 40 | To simplify the CMake configuration, the folder `cmake/` has the file `CMakePresets.json` with the basic configuration required to guide the mod.io SDK compilation using the Linux SDK. If you copy that file to the folder root, it can be used as follows: 41 | 42 | ```cmake 43 | cmake --preset linux 44 | ``` -------------------------------------------------------------------------------- /platform/linux/linux/AsioIPV6Emulation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | // Stub file, to be removed when asio is refactored to only include this file when NN specific defines are included -------------------------------------------------------------------------------- /platform/linux/linux/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2021 mod.io Pty Ltd. 3 | # 4 | # This file is part of the mod.io SDK. 5 | # 6 | # Distributed under the MIT License. (See accompanying file LICENSE or 7 | # view online at ) 8 | # 9 | 10 | if (NOT TARGET platform) 11 | add_library(platform INTERFACE) 12 | endif() 13 | 14 | target_compile_features(platform INTERFACE cxx_std_17) 15 | 16 | target_include_directories(platform INTERFACE ${CMAKE_CURRENT_LIST_DIR}) 17 | 18 | target_link_libraries(platform INTERFACE mbedtls mbedcrypto mbedx509) 19 | target_link_libraries(platform INTERFACE httpparser pthread uring ghc_filesystem) 20 | 21 | if (MODIO_USE_LIBUUID) 22 | target_compile_definitions(platform INTERFACE MODIO_USE_LIBUUID=1) 23 | target_link_libraries(platform INTERFACE uuid) 24 | endif() 25 | 26 | -------------------------------------------------------------------------------- /platform/linux/linux/ModioPlatformDefines.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2022 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | // This file enables platform specific flags 12 | // It is called by the ModioGeneratedVariables.h 13 | 14 | -------------------------------------------------------------------------------- /platform/linux/linux/ModioWeakSymbol.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | extern "C" 14 | { 15 | #ifdef __clang__ 16 | inline void modio_profile_stub(...) {}; 17 | #else 18 | static inline void modio_profile_stub(...) {}; 19 | #endif 20 | } 21 | 22 | #define MODIO_WEAK(Name) __attribute__((weak, alias("modio_profile_stub"))) 23 | -------------------------------------------------------------------------------- /platform/linux/linux/file/StaticDirectoriesImplementation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | namespace Modio 16 | { 17 | namespace Detail 18 | { 19 | static bool GetDefaultCommonDataPath(Modio::filesystem::path& CommonDataPath) 20 | { 21 | const char* HomeDir = std::getenv("HOME"); 22 | if (HomeDir == nullptr) 23 | { 24 | Modio::Detail::Logger().Log(Modio::LogLevel::Error, Modio::LogCategory::File, 25 | "Could not get home directory environment variable!"); 26 | return false; 27 | } 28 | CommonDataPath = Modio::filesystem::path(HomeDir) / "mod.io" / "common/"; 29 | return true; 30 | } 31 | } // namespace Detail 32 | } // namespace Modio 33 | -------------------------------------------------------------------------------- /platform/linux/linux/linux/LibUringWrapper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | #ifdef MODIO_PLATFORM_UNREAL 13 | 14 | // Unreal has some imports that define these values, then they are 15 | // refefined in the liburing header. For that reason, this wrapper 16 | // helps to avoid those warnings/errors. 17 | #ifdef RWF_HIPRI 18 | #undef RWF_HIPRI 19 | #endif 20 | 21 | #ifdef RWF_DSYNC 22 | #undef RWF_DSYNC 23 | #endif 24 | 25 | #ifdef RWF_SYNC 26 | #undef RWF_SYNC 27 | #endif 28 | 29 | #ifdef RWF_NOWAIT 30 | #undef RWF_NOWAIT 31 | #endif 32 | 33 | #ifdef RWF_APPEND 34 | #undef RWF_APPEND 35 | #endif 36 | #endif 37 | 38 | #include "liburing.h" 39 | -------------------------------------------------------------------------------- /platform/linux/linux/linux/TimerCallback.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #include "linux/TimerSharedState.h" 12 | -------------------------------------------------------------------------------- /platform/linux/linux/linux/detail/ModioUEPlatformEpilogue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | // clang-format off 12 | 13 | #pragma GCC diagnostic pop 14 | 15 | // clang-format on 16 | -------------------------------------------------------------------------------- /platform/linux/linux/linux/detail/ModioUEPlatformPreamble.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | // clang-format off 12 | 13 | #include "Clang/ClangPlatformCompilerPreSetup.h" 14 | #include "HAL/PlatformMisc.h" 15 | #include "Misc/AssertionMacros.h" 16 | #include "Linux/LinuxPlatform.h" 17 | #include "Linux/LinuxPlatformCompilerPreSetup.h" 18 | #include "Linux/LinuxPlatformCompilerSetup.h" 19 | 20 | // NOTE!! I tried to add "-Wshadow" as a "target_compile_options" in many CMake files: 21 | // platform/macos/macos, asio.cmake, howeever it dit not like it. 22 | #pragma GCC diagnostic push 23 | 24 | // This is required by file "resolver_base.hpp" in line 69 which complains about this: 25 | // Declaration shadows a variable in namespace 'asio::ip' 26 | // https://github.com/chriskohlhoff/asio/issues/721 27 | #pragma GCC diagnostic ignored "-Wshadow" 28 | 29 | // clang-format on 30 | -------------------------------------------------------------------------------- /platform/linux/linux/linux/detail/ops/timer/InitializeTimerServiceOp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | #include "modio/detail/AsioWrapper.h" 13 | #include 14 | 15 | #include 16 | class InitializeTimerServiceOp 17 | { 18 | std::weak_ptr SharedState; 19 | 20 | public: 21 | InitializeTimerServiceOp(std::weak_ptr SharedState) : SharedState(SharedState) {}; 22 | 23 | template 24 | void operator()(CoroType& Self, Modio::ErrorCode ec = {}) 25 | { 26 | reenter(CoroState) 27 | { 28 | BeginTimerLoopAsync(SharedState, [](Modio::ErrorCode) {}); 29 | 30 | Self.complete({}); 31 | return; 32 | } 33 | } 34 | 35 | private: 36 | asio::coroutine CoroState; 37 | }; 38 | 39 | #include -------------------------------------------------------------------------------- /platform/linux/linux/timer/TimerImplementation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/timer/ModioTimerImplementationBase.h" 14 | #include 15 | #include 16 | 17 | class TimerImplementation : public Modio::Detail::TimerImplementationBase 18 | { 19 | public: 20 | std::chrono::steady_clock::time_point CalculatedExpiryTime; 21 | }; -------------------------------------------------------------------------------- /platform/linux/platform.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2021 mod.io Pty Ltd. 3 | # 4 | # This file is part of the mod.io SDK. 5 | # 6 | # Distributed under the MIT License. (See accompanying file LICENSE or 7 | # view online at ) 8 | # 9 | # 10 | 11 | if(MODIO_PLATFORM STREQUAL "LINUX") 12 | add_subdirectory(${CMAKE_CURRENT_LIST_DIR}) 13 | endif() 14 | -------------------------------------------------------------------------------- /platform/linux/ueplatform.json: -------------------------------------------------------------------------------- 1 | { 2 | "Platforms": { 3 | "Linux": { 4 | "IncludeDirectories": [], 5 | "PlatformSpecificDefines": [], 6 | "ModuleDependencies": [], 7 | "SystemLibraryDependencies": [] 8 | }, 9 | "LinuxArm64": { 10 | "IncludeDirectories": [], 11 | "PlatformSpecificDefines": [], 12 | "ModuleDependencies": [], 13 | "SystemLibraryDependencies": [] 14 | } 15 | }, 16 | "IncludeDirectories": [ 17 | "linux/linux" 18 | ], 19 | "PlatformSpecificDefines": [ 20 | "MODIO_TARGET_PLATFORM_ID=\"LINUX\"", 21 | "MODIO_UNREAL_PLATFORM_PREAMBLE=\"linux/detail/ModioUEPlatformPreamble.h\"", 22 | "MODIO_UNREAL_PLATFORM_EPILOGUE=\"linux/detail/ModioUEPlatformEpilogue.h\"", 23 | ], 24 | "ModuleDependencies": [ 25 | "uring", 26 | "mbedtls" 27 | ], 28 | "SystemLibraryDependencies": [] 29 | } 30 | -------------------------------------------------------------------------------- /platform/macos/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2021 mod.io Pty Ltd. 3 | # 4 | # This file is part of the mod.io SDK. 5 | # 6 | # Distributed under the MIT License. (See accompanying file LICENSE or 7 | # view online at ) 8 | # 9 | 10 | if(MODIO_PLATFORM STREQUAL "MACOS") 11 | set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake;${CMAKE_MODULE_PATH}") 12 | set (MODIO_PLATFORM_MACOS ON INTERNAL "building for macos") 13 | 14 | enable_language(C) 15 | enable_language(CXX) 16 | 17 | add_subdirectory(macos) 18 | 19 | if (MODIO_BUILD_TESTS) 20 | add_subdirectory(tests EXCLUDE_FROM_ALL) 21 | endif() 22 | 23 | install( 24 | DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/macos 25 | DESTINATION ${CMAKE_INSTALL_PREFIX}/header_only 26 | COMPONENT header_only 27 | ) 28 | endif() 29 | -------------------------------------------------------------------------------- /platform/macos/README.mdx: -------------------------------------------------------------------------------- 1 | ## mod.io Mac integration 2 | 3 | Please read the Getting Started guide located in the docs folder for using the Mac module. -------------------------------------------------------------------------------- /platform/macos/doc/cmake-integration.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: mac-cmake-integration 3 | title: CMake Integration 4 | slug: /cppsdk/mac/cmake-integration 5 | sidebar_position: 1 6 | custom_edit_url: https://github.com/modio/modio-sdk-internal/blob/develop/platform/macos/doc/cmake-integration.mdx 7 | --- 8 | 9 | # Inside a CMake project 10 | 11 | Unzip the archive. Confirm `your_project` uses CMake 3.20 or later. 12 | 13 | ```cmake 14 | cmake_minimum_required(VERSION 3.20) 15 | ``` 16 | 17 | Specify the target platform with `MACOS`. 18 | 19 | ```cmake 20 | set (MODIO_PLATFORM MACOS) 21 | ``` 22 | Add the SDK subdirectory to your project 23 | 24 | ```cmake 25 | add_subdirectory( EXCLUDE_FROM_ALL) 26 | target_compile_features(your_project PUBLIC cxx_std_17) 27 | ``` 28 | 29 | Link the library to your project. 30 | 31 | To use the header-only configuration: 32 | ```cmake 33 | target_link_libraries(your_project PUBLIC modio) 34 | ``` 35 | Or to use the static library configuration: 36 | ```cmake 37 | target_link_libraries(your_project PUBLIC modioStatic) 38 | ``` 39 | 40 | To simplify the CMake configuration, the folder `cmake/` has the file `CMakePresets.json` with the basic configuration required to guide the mod.io SDK compilation using the Mac SDK. If you copy that file to the folder root, it can be used as follows: 41 | 42 | ```cmake 43 | cmake --preset mac 44 | ``` -------------------------------------------------------------------------------- /platform/macos/macos/AsioIPV6Emulation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | // Stub file, to be removed when asio is refactored to only include this file when NN specific defines are included -------------------------------------------------------------------------------- /platform/macos/macos/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2021 mod.io Pty Ltd. 3 | # 4 | # This file is part of the mod.io SDK. 5 | # 6 | # Distributed under the MIT License. (See accompanying file LICENSE or 7 | # view online at ) 8 | # 9 | 10 | if (NOT TARGET platform) 11 | add_library(platform INTERFACE) 12 | endif() 13 | 14 | target_compile_features(platform INTERFACE cxx_std_17) 15 | target_compile_definitions(platform INTERFACE -DFU2_WITH_NO_EMPTY_PROPAGATION) 16 | target_include_directories(platform INTERFACE ${CMAKE_CURRENT_LIST_DIR}) 17 | 18 | find_library(FOUNDATION Foundation) 19 | find_library(CFNETWORK CFNetwork) 20 | 21 | target_link_libraries(platform INTERFACE httpparser pthread ghc_filesystem ${FOUNDATION} ${CFNETWORK}) 22 | 23 | -------------------------------------------------------------------------------- /platform/macos/macos/ModioPlatformDefines.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2022 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | // This file enables platform specific flags 12 | // It is called by the ModioGeneratedVariables.h 13 | #ifndef FU2_WITH_NO_EMPTY_PROPAGATION 14 | #define FU2_WITH_NO_EMPTY_PROPAGATION 15 | #endif -------------------------------------------------------------------------------- /platform/macos/macos/ModioWeakSymbol.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #define MODIO_WEAK_STUB_IMPL {} 14 | 15 | #define MODIO_WEAK(Name) __attribute__((weak)) -------------------------------------------------------------------------------- /platform/macos/macos/file/StaticDirectoriesImplementation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include 14 | 15 | namespace Modio 16 | { 17 | namespace Detail 18 | { 19 | static bool GetDefaultCommonDataPath(Modio::filesystem::path& CommonDataPath) 20 | { 21 | const char* HomeDir = std::getenv("HOME"); 22 | if (HomeDir == nullptr) 23 | { 24 | Modio::Detail::Logger().Log(Modio::LogLevel::Error, Modio::LogCategory::File, 25 | "Could not get home directory environment variable!"); 26 | return false; 27 | } 28 | CommonDataPath = Modio::filesystem::path(HomeDir) / "Library/Application Support/mod.io/common/"; 29 | return true; 30 | } 31 | } // namespace Detail 32 | } // namespace Modio 33 | -------------------------------------------------------------------------------- /platform/macos/macos/macos/TimerCallback.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #include "macos/TimerSharedState.h" 12 | -------------------------------------------------------------------------------- /platform/macos/macos/macos/detail/ModioUEPlatformEpilogue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma GCC diagnostic pop 12 | -------------------------------------------------------------------------------- /platform/macos/macos/macos/detail/ModioUEPlatformPreamble.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | // clang-format off 12 | 13 | #include "Clang/ClangPlatformCompilerPreSetup.h" 14 | #include "GenericPlatform/GenericPlatformCompilerPreSetup.h" 15 | #undef PRAGMA_DEFAULT_VISIBILITY_START 16 | #undef PRAGMA_DEFAULT_VISIBILITY_END 17 | #include "Mac/MacPlatformCompilerPreSetup.h" 18 | #include "HAL/PlatformMisc.h" 19 | #include "Misc/AssertionMacros.h" 20 | #include "Mac/MacPlatform.h" 21 | #include "Mac/MacPlatformCompilerSetup.h" 22 | #include "Mac/MacPlatformAtomics.h" 23 | 24 | #pragma GCC diagnostic push 25 | 26 | // This is required by file "resolver_base.hpp" in line 69 which complains about this: 27 | // Declaration shadows a variable in namespace 'asio::ip' 28 | // https://github.com/chriskohlhoff/asio/issues/721 29 | #pragma GCC diagnostic ignored "-Wshadow" 30 | 31 | // clang-format on 32 | -------------------------------------------------------------------------------- /platform/macos/macos/macos/detail/ops/timer/InitializeTimerServiceOp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | #include "modio/detail/AsioWrapper.h" 13 | #include 14 | 15 | #include 16 | class InitializeTimerServiceOp 17 | { 18 | std::weak_ptr SharedState; 19 | 20 | public: 21 | InitializeTimerServiceOp(std::weak_ptr SharedState) : SharedState(SharedState) {}; 22 | 23 | template 24 | void operator()(CoroType& Self, Modio::ErrorCode ec = {}) 25 | { 26 | reenter(CoroState) 27 | { 28 | BeginTimerLoopAsync(SharedState, [](Modio::ErrorCode) {}); 29 | 30 | Self.complete({}); 31 | return; 32 | } 33 | } 34 | 35 | private: 36 | asio::coroutine CoroState; 37 | }; 38 | 39 | #include -------------------------------------------------------------------------------- /platform/macos/macos/timer/TimerImplementation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/timer/ModioTimerImplementationBase.h" 14 | #include 15 | #include 16 | 17 | class TimerImplementation : public Modio::Detail::TimerImplementationBase 18 | { 19 | public: 20 | std::chrono::steady_clock::time_point CalculatedExpiryTime; 21 | }; -------------------------------------------------------------------------------- /platform/macos/platform.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2021 mod.io Pty Ltd. 3 | # 4 | # This file is part of the mod.io SDK. 5 | # 6 | # Distributed under the MIT License. (See accompanying file LICENSE or 7 | # view online at ) 8 | # 9 | # 10 | 11 | if(MODIO_PLATFORM STREQUAL "MACOS") 12 | add_subdirectory(${CMAKE_CURRENT_LIST_DIR}) 13 | endif() 14 | -------------------------------------------------------------------------------- /platform/macos/ueplatform.json: -------------------------------------------------------------------------------- 1 | { 2 | "Platforms": { 3 | "Mac": { 4 | "IncludeDirectories": [], 5 | "PlatformSpecificDefines": [], 6 | "ModuleDependencies": [], 7 | "SystemLibraryDependencies": [] 8 | } 9 | }, 10 | "IncludeDirectories": [ 11 | "macos/macos" 12 | ], 13 | "PlatformSpecificDefines": [ 14 | "MODIO_TARGET_PLATFORM_ID=\"MACOS\"", 15 | "MODIO_UNREAL_PLATFORM_PREAMBLE=\"macos/detail/ModioUEPlatformPreamble.h\"", 16 | "MODIO_UNREAL_PLATFORM_EPILOGUE=\"macos/detail/ModioUEPlatformEpilogue.h\"", 17 | "FU2_WITH_NO_EMPTY_PROPAGATION", 18 | "ASIO_INITIALIZE_CALL_STACK" 19 | ], 20 | "ModuleDependencies": [ 21 | ], 22 | "SystemLibraryDependencies": [] 23 | } 24 | -------------------------------------------------------------------------------- /platform/ms-common/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2021 mod.io Pty Ltd. 3 | # 4 | # This file is part of the mod.io SDK. 5 | # 6 | # Distributed under the MIT License. (See accompanying file LICENSE or 7 | # view online at ) 8 | # 9 | 10 | if(MODIO_PLATFORM STREQUAL "WIN" OR MODIO_FORCE_MS_COMMON) 11 | if (NOT TARGET platform) 12 | add_library(platform INTERFACE) 13 | endif() 14 | 15 | include(split-compilation) 16 | 17 | if (MSVC) 18 | target_compile_definitions(platform INTERFACE _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING ) 19 | target_compile_options(platform INTERFACE /bigobj) 20 | target_compile_options(platform INTERFACE /permissive-) 21 | elseif(GCC) 22 | target_compile_options(platform INTERFACE -Wa,-mbig-obj -Og) 23 | endif() 24 | 25 | target_include_directories(platform INTERFACE ${CMAKE_CURRENT_LIST_DIR}/include) 26 | 27 | add_modio_implementation_file(${CMAKE_CURRENT_LIST_DIR}/include/common/HttpSharedState.ipp) 28 | add_modio_implementation_file(${CMAKE_CURRENT_LIST_DIR}/include/common/http/HttpRequestImplementation.ipp) 29 | 30 | if (MODIO_BUILD_TESTS) 31 | add_subdirectory(tests EXCLUDE_FROM_ALL) 32 | endif() 33 | 34 | install( 35 | DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/include/ 36 | DESTINATION ${CMAKE_INSTALL_PREFIX}/header_only/ms-common 37 | COMPONENT header_only 38 | ) 39 | 40 | endif() 41 | -------------------------------------------------------------------------------- /platform/ms-common/include/ModioWeakSymbol.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | extern "C" 14 | { 15 | inline void modio_profile_stub(...) {} 16 | __declspec(selectany) void (*modio_profile_stub_ptr)(...) = modio_profile_stub; 17 | } 18 | 19 | #define MODIO_WEAK(Name) __pragma(comment(linker, "/alternatename:" #Name "=modio_profile_stub")); 20 | -------------------------------------------------------------------------------- /platform/ms-common/include/common/FileSharedState.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | namespace Modio 14 | { 15 | namespace Detail 16 | { 17 | struct FileSharedState 18 | { 19 | bool bCancelRequested = false; 20 | }; 21 | } // namespace Detail 22 | } // namespace Modio -------------------------------------------------------------------------------- /platform/ms-common/include/common/UTF16Support.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/detail/ModioCompilerMacros.h" 14 | MODIO_DISABLE_WARNING_PUSH 15 | MODIO_DISABLE_WARNING_SIGNED_UNSIGNED_INTEGER_CONVERSION 16 | MODIO_DISABLE_WARNING_SPECTRE_MITIGATION 17 | MODIO_DISABLE_WARNING_STRUCTURE_PADDING 18 | MODIO_DISABLE_WARNING_UNSAFE_BUFFER_USAGE 19 | MODIO_DISABLE_WARNING_UNUSED_FUNCTION 20 | #include "utf8/cpp11.h" 21 | MODIO_DISABLE_WARNING_POP 22 | #include 23 | 24 | inline const std::wstring UTF8ToWideChar(std::string UTF8String) 25 | { 26 | std::wstring Result; 27 | utf8::utf8to16(UTF8String.begin(), UTF8String.end(), back_inserter(Result)); 28 | return Result; 29 | } 30 | 31 | inline const std::string WideCharToUTF8(std::wstring WideString) 32 | { 33 | std::string Result; 34 | utf8::utf16to8(WideString.begin(), WideString.end(), back_inserter(Result)); 35 | return Result; 36 | } -------------------------------------------------------------------------------- /platform/ms-common/include/common/file/StaticDirectoriesImplementation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/detail/FilesystemWrapper.h" 14 | #include "modio/detail/FmtWrapper.h" 15 | #include 16 | #include 17 | 18 | namespace Modio 19 | { 20 | namespace Detail 21 | { 22 | static bool GetDefaultCommonDataPath(Modio::filesystem::path& CommonDataPath) 23 | { 24 | PWSTR PublicPath = nullptr; 25 | HRESULT hr = SHGetKnownFolderPath(FOLDERID_Public, 0, nullptr, &PublicPath); 26 | if (SUCCEEDED(hr)) 27 | { 28 | CommonDataPath = Modio::filesystem::path(std::wstring(PublicPath)); 29 | CommonDataPath /= fmt::format("mod.io/"); 30 | CoTaskMemFree(PublicPath); 31 | return true; 32 | } 33 | else 34 | { 35 | CoTaskMemFree(PublicPath); 36 | return false; 37 | } 38 | } 39 | } // namespace Detail 40 | } // namespace Modio 41 | -------------------------------------------------------------------------------- /platform/ms-common/include/common/http/HttpRequestImplementation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | #include "modio/detail/http/IHttpRequestImplementation.h" 13 | #include "modio/http/ModioHttpParams.h" 14 | #include "common/HttpSharedState.h" 15 | 16 | class HttpRequestImplementation : public Modio::Detail::IHttpRequestImplementation 17 | { 18 | public: 19 | MODIO_IMPL ~HttpRequestImplementation() override; 20 | 21 | HINTERNET ConnectionHandle; 22 | HINTERNET RequestHandle; 23 | std::uint32_t ResponseCode; 24 | Modio::Optional RetryAfter; 25 | Modio::Detail::HttpRequestParams Parameters; 26 | std::map ResponseHeaders; 27 | 28 | MODIO_IMPL bool HasBeenSent(); 29 | 30 | // Common members 31 | MODIO_IMPL virtual std::uint32_t GetResponseCode() override; 32 | 33 | MODIO_IMPL virtual Modio::Detail::HttpRequestParams& GetParameters() override; 34 | 35 | MODIO_IMPL virtual Modio::Optional GetRedirectURL() override; 36 | 37 | MODIO_IMPL virtual Modio::Optional GetRetryAfter() override; 38 | 39 | MODIO_IMPL virtual Modio::Optional GetHeaderValue(std::string Key) override; 40 | }; 41 | 42 | 43 | #ifndef MODIO_SEPARATE_COMPILATION 44 | #include "HttpRequestImplementation.ipp" 45 | #endif 46 | -------------------------------------------------------------------------------- /platform/win32/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2021 mod.io Pty Ltd. 3 | # 4 | # This file is part of the mod.io SDK. 5 | # 6 | # Distributed under the MIT License. (See accompanying file LICENSE or 7 | # view online at ) 8 | # 9 | 10 | if(MODIO_PLATFORM STREQUAL "WIN") 11 | message("Initializing modio-WIN") 12 | set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake;${CMAKE_MODULE_PATH}") 13 | set (MODIO_PLATFORM_WIN ON INTERNAL "building windows") 14 | 15 | enable_language(C) 16 | enable_language(CXX) 17 | 18 | add_subdirectory(win32) 19 | 20 | 21 | 22 | add_subdirectory(../ms-common ../ms-common) 23 | 24 | if (MODIO_BUILD_TESTS) 25 | add_subdirectory(tests) 26 | endif() 27 | 28 | install( 29 | DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/win32 30 | DESTINATION ${CMAKE_INSTALL_PREFIX}/header_only 31 | COMPONENT header_only 32 | ) 33 | endif() 34 | -------------------------------------------------------------------------------- /platform/win32/README.mdx: -------------------------------------------------------------------------------- 1 | ## mod.io Windows integration 2 | 3 | Please read the Getting Started guide located in the docs folder for using the Windows module 4 | -------------------------------------------------------------------------------- /platform/win32/doc/cmake-integration.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: windows-cmake-integration 3 | title: CMake Integration 4 | slug: /cppsdk/windows/cmake-integration 5 | sidebar_position: 1 6 | custom_edit_url: https://github.com/modio/modio-sdk-internal/blob/develop/platform/win32/doc/cmake-integration.mdx 7 | --- 8 | 9 | ## Inside a CMake project 10 | 11 | Unzip the archive. Confirm `your_project` uses CMake 3.20 or later. 12 | 13 | ```cmake 14 | cmake_minimum_required(VERSION 3.20) 15 | ``` 16 | 17 | Specify the target platform with `WIN`. 18 | 19 | ```cmake 20 | set (MODIO_PLATFORM WIN) 21 | ``` 22 | Add the SDK subdirectory to your project 23 | 24 | ```cmake 25 | add_subdirectory( EXCLUDE_FROM_ALL) 26 | target_compile_features(your_project PUBLIC cxx_std_17) 27 | ``` 28 | 29 | Link the library to your project. 30 | 31 | To use the header-only configuration: 32 | ```cmake 33 | target_link_libraries(your_project PUBLIC modio) 34 | ``` 35 | Or to use the static library configuration: 36 | ```cmake 37 | target_link_libraries(your_project PUBLIC modioStatic) 38 | ``` 39 | 40 | To simplify the CMake configuration, the folder `cmake/` has the file `CMakePresets.json` with the basic configuration required to guide the mod.io SDK compilation using the Windows SDK. If you copy that file to the folder root, it can be used as follows: 41 | 42 | ```cmake 43 | cmake --preset win64 44 | ``` 45 | ``` -------------------------------------------------------------------------------- /platform/win32/doc/getting-started.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | id: windows-getting-started 3 | title: Getting Started 4 | slug: /cppsdk/windows/getting-started 5 | sidebar_position: 0 6 | custom_edit_url: https://github.com/modio/modio-sdk-internal/blob/develop/platform/win32/doc/getting-started.mdx 7 | --- 8 | 9 | ## mod.io Windows SDK Integration 10 | 11 | The use of Windows with the mod.io SDK is ready by default. You can find the `windows` directory in the platform subdirectory of your SDK installation. 12 | You can then target `WIN` to compile the mod.io SDK for Windows. 13 | 14 | ## Windows Terminal Compilation of x64 library 15 | 16 | When you compile the mod.io SDK and you require a x64 library in Windows, confirm the use the "x64 Native Tools Command Prompt for VS 2019", which by default employs the x64 compiler. To verify the Static or Shared library was compiled with x64 architecture, you can use the "dumpbin" command: 17 | ``` 18 | dumpbin out\build\win\modio\modioStatic.lib /headers 19 | ``` 20 | Then search for the confirmation as follows: 21 | ``` 22 | Dump of file out\build\win\modio\modioStatic.lib 23 | 24 | File Type: LIBRARY 25 | 26 | FILE HEADER VALUES 27 | 8664 machine (x64) 28 | 34A number of sections 29 | 63336D7D time date stamp Wed Sep 28 10:39:09 2022 30 | 136EC file pointer to symbol table 31 | AC9 number of symbols 32 | 0 size of optional header 33 | 0 characteristics 34 | ``` 35 | 36 | --- -------------------------------------------------------------------------------- /platform/win32/platform.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2021 mod.io Pty Ltd. 3 | # 4 | # This file is part of the mod.io SDK. 5 | # 6 | # Distributed under the MIT License. (See accompanying file LICENSE or 7 | # view online at ) 8 | # 9 | # 10 | 11 | if(MODIO_PLATFORM STREQUAL "WIN") 12 | add_subdirectory(${CMAKE_CURRENT_LIST_DIR}) 13 | endif() 14 | -------------------------------------------------------------------------------- /platform/win32/ueplatform.json: -------------------------------------------------------------------------------- 1 | { 2 | "Platforms": { 3 | "Win64": { 4 | "IncludeDirectories": [], 5 | "PlatformSpecificDefines": [], 6 | "ModuleDependencies": [], 7 | "SystemLibraryDependencies": [] 8 | } 9 | }, 10 | "IncludeDirectories": [ 11 | "win32/win32", 12 | "ms-common/include" 13 | ], 14 | "PlatformSpecificDefines": [ 15 | "MODIO_TARGET_PLATFORM_ID=\"WIN\"", 16 | "MODIO_UNREAL_PLATFORM_PREAMBLE=\"win32/detail/ModioUEPlatformPreamble.h\"", 17 | "MODIO_UNREAL_PLATFORM_EPILOGUE=\"win32/detail/ModioUEPlatformEpilogue.h\"", 18 | ], 19 | "ModuleDependencies": [ 20 | "WinHttp" 21 | ], 22 | "SystemLibraryDependencies": [] 23 | } -------------------------------------------------------------------------------- /platform/win32/win32/ModioPlatformDefines.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021-2022 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | // This file enables platform specific flags 12 | // It is called by the ModioGeneratedVariables.h 13 | 14 | -------------------------------------------------------------------------------- /platform/win32/win32/file/FileObjectImplementation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | #include "common/file/FileObjectImplementation.h" -------------------------------------------------------------------------------- /platform/win32/win32/file/StaticDirectoriesImplementation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2023 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "modio/detail/FilesystemWrapper.h" 14 | #include "modio/detail/FmtWrapper.h" 15 | #include 16 | #include 17 | 18 | namespace Modio 19 | { 20 | namespace Detail 21 | { 22 | static bool GetDefaultCommonDataPath(Modio::filesystem::path& CommonDataPath) 23 | { 24 | PWSTR PublicPath = NULL; 25 | HRESULT hr = SHGetKnownFolderPath(FOLDERID_Public, 0, NULL, &PublicPath); 26 | if (SUCCEEDED(hr)) 27 | { 28 | CommonDataPath = Modio::filesystem::path(std::wstring(PublicPath)); 29 | CommonDataPath /= fmt::format("mod.io/"); 30 | CoTaskMemFree(PublicPath); 31 | return true; 32 | } 33 | else 34 | { 35 | CoTaskMemFree(PublicPath); 36 | return false; 37 | } 38 | } 39 | } // namespace Detail 40 | } // namespace Modio 41 | -------------------------------------------------------------------------------- /platform/win32/win32/logging/LoggerImplementation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | //Win32 logging implementation is shared with all MS platforms 13 | #include "common/logging/LoggerImplementation.h" -------------------------------------------------------------------------------- /platform/win32/win32/timer/TimerImplementation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "Windows.h" 14 | #include "modio/timer/ModioTimerImplementationBase.h" 15 | #include 16 | #include 17 | 18 | class TimerImplementation : public Modio::Detail::TimerImplementationBase 19 | { 20 | public: 21 | std::chrono::steady_clock::time_point CalculatedExpiryTime; 22 | 23 | }; -------------------------------------------------------------------------------- /platform/win32/win32/win32/HttpSharedState.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | #include "common/HttpSharedState.h" 13 | #include "modio/core/ModioErrorCode.h" 14 | #include "modio/detail/FmtWrapper.h" 15 | #include 16 | 17 | 18 | /// @brief Win32 http shared state is just a thin wrapper around the common functionality 19 | class HttpSharedState : public std::enable_shared_from_this, public HttpSharedStateBase 20 | { 21 | public: 22 | using HttpSharedStateBase::HttpSharedStateBase; 23 | }; 24 | -------------------------------------------------------------------------------- /platform/win32/win32/win32/TimerCallback.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #include "win32/TimerSharedState.h" 12 | 13 | 14 | -------------------------------------------------------------------------------- /platform/win32/win32/win32/detail/ModioUEPlatformEpilogue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | // clang-format off 12 | 13 | #include "Misc/EngineVersionComparison.h" 14 | 15 | #if UE_VERSION_OLDER_THAN(5, 4, 0) 16 | #include "Windows/PostWindowsApi.h" 17 | #endif 18 | 19 | #include "Windows/HideWindowsPlatformTypes.h" 20 | #include "Windows/HideWindowsPlatformAtomics.h" 21 | 22 | // clang-format on -------------------------------------------------------------------------------- /platform/win32/win32/win32/detail/ModioUEPlatformPreamble.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | // clang-format off 12 | 13 | #include 14 | #include "HAL/PlatformMisc.h" 15 | #include "Misc/AssertionMacros.h" 16 | #include "Windows/AllowWindowsPlatformTypes.h" 17 | 18 | #include "Misc/EngineVersionComparison.h" 19 | 20 | #if UE_VERSION_OLDER_THAN(5, 4, 0) 21 | #include "Windows/PreWindowsApi.h" 22 | #endif 23 | 24 | #include "Windows/AllowWindowsPlatformAtomics.h" 25 | 26 | // clang-format on -------------------------------------------------------------------------------- /platform/win32/win32/win32/detail/ops/timer/InitializeTimerServiceOp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 mod.io Pty Ltd. 3 | * 4 | * This file is part of the mod.io SDK. 5 | * 6 | * Distributed under the MIT License. (See accompanying file LICENSE or 7 | * view online at ) 8 | * 9 | */ 10 | 11 | #pragma once 12 | #include "modio/detail/AsioWrapper.h" 13 | 14 | #include 15 | class InitializeTimerServiceOp 16 | { 17 | std::weak_ptr SharedState; 18 | 19 | public: 20 | InitializeTimerServiceOp(std::weak_ptr SharedState) : SharedState(SharedState) {} 21 | 22 | template 23 | void operator()(CoroType& Self, Modio::ErrorCode MODIO_UNUSED_ARGUMENT(ec) = {}) 24 | { 25 | reenter(CoroState) { 26 | BeginTimerLoopAsync(SharedState, [](Modio::ErrorCode) {}); 27 | 28 | Self.complete({}); 29 | return; 30 | } 31 | } 32 | private: 33 | asio::coroutine CoroState; 34 | }; 35 | 36 | #include --------------------------------------------------------------------------------