#ifndef __ACE_SDK_SERVER_LIGHT_FEATURE_H__ #define __ACE_SDK_SERVER_LIGHT_FEATURE_H__ #include "ace_sdk_account.h" #include "ace_sdk_server_light_feature_impl.h" #pragma pack(push, 1) #define ACE_SDK_MAX_CLIENT_VERSION_LEN 256 #define ACE_SDK_MAX_LIGHT_FEATURE_NAME_LEN 256 #define ACE_SDK_MAX_LIGHT_FEATURE_DATA_LEN (128 * 1024) /** * TssSdkGetFeatureUserInfo */ typedef struct __AceSdkLightFeatureRequest { /** * Version of the client: string separated by '.' */ char client_version_[ACE_SDK_MAX_CLIENT_VERSION_LEN]; } AceSdkLightFeatureRequest; /** * AceSdkLightFeatureResponse */ typedef struct __AceSdkLightFeatureResponse { /** * Actual length of the light feature. 0 means that no light features are matched. */ int32_t data_len_; /** * Binary content of the light feature. */ char data_[ACE_SDK_MAX_LIGHT_FEATURE_DATA_LEN]; /** * Name of the light feature(C-style string). It is recommended to log it along with the account for trouble shooting. */ char name_[ACE_SDK_MAX_LIGHT_FEATURE_NAME_LEN]; /** * CRC32 of the light feature data. It is recommended to log it along with the account for trouble shooting. */ uint32_t data_crc_; } AceSdkLightFeatureResponse; #pragma pack(pop) /** * @brief It must be called after player logins the game as soon as possible. * @param account Account of player. * @param request Information for matching light feature. * @param response Information of light feature. * @returns Non-0 : Contact ACE to handle it. * 0 : If 'data_len_' is not 0, send light feature data('data_') to ACE client with the actual length('data_len_') and guarante success. * If 'data_len_' is 0, do nothing. * @note If light feature is matched but not sent to ACE client successfully and immediately, players may be punished wrongly by ACE. */ AceSdkResult ace_sdk_server_get_light_feature(const AceSdkAccount* account, const AceSdkLightFeatureRequest* request, AceSdkLightFeatureResponse* response); #endif // __ACE_SDK_SERVER_LIGHT_FEATURE_H__