Files
MinecraftConsoles/Minecraft.Client/Xbox/Sentient/Include/SenClientDynamicConfig.h
ModMaker101 a9be52c41a Project modernization (#630)
* Fixed boats falling and a TP glitch #266

* Replaced every C-style cast with C++ ones

* Replaced every C-style cast with C++ ones

* Fixed boats falling and a TP glitch #266

* Updated NULL to nullptr and fixing some type issues

* Modernized and fixed a few bugs

- Replaced most instances of `NULL` with `nullptr`.
- Replaced most `shared_ptr(new ...)` with `make_shared`.
- Removed the `nullptr` macro as it was interfering with the actual nullptr keyword in some instances.

* Fixing more conflicts

* Replace int loops with size_t and start work on overrides
2026-03-08 09:56:03 +07:00

171 lines
6.5 KiB
C++

/********************************************************
* *
* Copyright (C) Microsoft. All rights reserved. *
* *
********************************************************/
// Sentient Client DynamicConfig API
//
// Include this to get access to all DynamicConfig-related Sentient features
#pragma once
#include "SenClientSys.h"
namespace Sentient
{
/// @brief Gets the size of a config file, so memory can be allocated
///
/// @param[in] titleID
/// Which title's config file to search for.
///
/// @param[in] resourceID
/// Which config file to find.
///
/// @param[out] out_size
/// The size of the file, in bytes.
///
/// @param[in] userCallback
/// If this call returns a success code, the userCallback will be called at the end of the asynchronous process.
///
/// @param[in] userCallbackData
/// Data to be passed to the @a userCallback on completion.
///
/// @return Check SUCCEEDED( hresult ) or FAILED( hresult ) to determine success. Specific values include:
/// SENTIENT_E_NOT_INITIALIZED: You did not call SentientInitialize() first.
/// E_POINTER: size is nullptr.
/// E_FAIL: Failed to spawn server call.
/// S_OK: Server call spawned successfully.
///
/// @details Search the service for a specific config file at the current time.
///
/// @related SenDynamicConfigFileGetBytes()
///
HRESULT SenDynamicConfigGetSize(
__in unsigned int titleID,
__in unsigned int resourceID,
__out size_t* out_size,
__in SenSysCompletedCallback userCallback,
__in void *userCallbackData );
/// @brief Gets the size of a config file, so memory can be allocated
///
/// @param[in] resourceID
/// Which config file to find.
///
/// @param[out] out_size
/// The size of the file, in bytes.
///
/// @param[in] userCallback
/// If this call returns a success code, the userCallback will be called at the end of the asynchronous process.
///
/// @param[in] userCallbackData
/// Data to be passed to the @a userCallback on completion.
///
/// @return Check SUCCEEDED( hresult ) or FAILED( hresult ) to determine success. Specific values include:
/// SENTIENT_E_NOT_INITIALIZED: You did not call SentientInitialize() first.
/// E_POINTER: size is nullptr.
/// E_FAIL: Failed to spawn server call.
/// S_OK: Server call spawned successfully.
///
/// @details Search the service for a specific config file at the current time.
///
/// @related SenDynamicConfigFileGetBytes()
///
__inline HRESULT SenDynamicConfigGetSize(
__in unsigned int resourceID,
__out size_t* out_size,
__in SenSysCompletedCallback userCallback,
__in void *userCallbackData )
{
return SenDynamicConfigGetSize(SenSysTitleID_This, resourceID, out_size, userCallback, userCallbackData);
}
/// @brief Gets the contents of a config file
///
/// @param[in] titleID
/// Which title's config file to search for.
///
/// @param[in] resourceID
/// Which config file to return.
///
/// @param[in] dataSizeMax
/// Maximum number of bytes to return.
///
/// @param[out] out_bytesWritten
/// The number of bytes written into the buffer.
///
/// @param[out] out_data
/// The buffer that receives the contents of the file.
///
/// @param[in] userCallback
/// If this call returns a success code, the userCallback will be called at the end of the asynchronous process.
///
/// @param[in] userCallbackData
/// Data to be passed to the @a userCallback on completion.
///
/// @return Check SUCCEEDED( hresult ) or FAILED( hresult ) to determine success. Specific values include:
/// SENTIENT_E_NOT_INITIALIZED: You did not call SentientInitialize() first.
/// E_POINTER: out_data is nullptr.
/// E_FAIL: Failed to spawn server call.
/// S_OK: Server call spawned successfully.
///
/// @details Search the service for a specific config file at the current time.
///
/// @related SenDynamicConfigFileGetSize()
///
HRESULT SenDynamicConfigGetBytes(
__in unsigned int titleID,
__in unsigned int resourceID,
__in size_t dataSizeMax,
__out_opt size_t* out_bytesWritten,
__out void *out_data,
__in SenSysCompletedCallback userCallback,
__in void *userCallbackData );
/// @brief Gets the contents of a config file
///
/// @param[in] resourceID
/// Which config file to return.
///
/// @param[in] dataSizeMax
/// Maximum number of bytes to return.
///
/// @param[out] out_bytesWritten
/// The number of bytes written into the buffer.
///
/// @param[out] out_data
/// The buffer that receives the contents of the file.
///
/// @param[in] userCallback
/// If this call returns a success code, the userCallback will be called at the end of the asynchronous process.
///
/// @param[in] userCallbackData
/// Data to be passed to the @a userCallback on completion.
///
/// @return Check SUCCEEDED( hresult ) or FAILED( hresult ) to determine success. Specific values include:
/// SENTIENT_E_NOT_INITIALIZED: You did not call SentientInitialize() first.
/// E_POINTER: out_data is nullptr.
/// E_FAIL: Failed to spawn server call.
/// S_OK: Server call spawned successfully.
///
/// @details Search the service for a specific config file at the current time.
///
/// @related SenDynamicConfigFileGetSize()
///
__inline HRESULT SenDynamicConfigGetBytes(
__in unsigned int resourceID,
__in size_t dataSizeMax,
__out_opt size_t* out_bytesWritten,
__out void *out_data,
__in SenSysCompletedCallback userCallback,
__in void *userCallbackData )
{
return SenDynamicConfigGetBytes(SenSysTitleID_This, resourceID, dataSizeMax, out_bytesWritten, out_data, userCallback, userCallbackData);
}
}