From b691c43c44ff180d10e7d4a9afc83b98551ff586 Mon Sep 17 00:00:00 2001 From: daoge_cmd <3523206925@qq.com> Date: Sun, 1 Mar 2026 12:16:08 +0800 Subject: Initial commit --- .../Xbox/Sentient/Include/SenClientNews.h | 91 ++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 Minecraft.Client/Xbox/Sentient/Include/SenClientNews.h (limited to 'Minecraft.Client/Xbox/Sentient/Include/SenClientNews.h') diff --git a/Minecraft.Client/Xbox/Sentient/Include/SenClientNews.h b/Minecraft.Client/Xbox/Sentient/Include/SenClientNews.h new file mode 100644 index 00000000..22c39a1e --- /dev/null +++ b/Minecraft.Client/Xbox/Sentient/Include/SenClientNews.h @@ -0,0 +1,91 @@ +/******************************************************** +* * +* Copyright (C) Microsoft. All rights reserved. * +* * +********************************************************/ + +// Sentient Client News API +// +// Include this to get access to all News-related Sentient features. + +#pragma once + +#include "SenClientTypes.h" + + +namespace Sentient +{ + + // Maximum number of items that will be returned from the service + static const size_t MAX_NEWS_ITEM_COUNT = 20; + + // Default news cache expire time + // News cache expire time controls the duration between service synchronization. + // This duration is measured in seconds. Default value is 6 minutes + static const int CACHE_EXPIRE = 5 * 60 * 1000; + + // Extern linkage for News Item Count + extern size_t newsItemCount; + class NewsItemCountClass + { + public: NewsItemCountClass() { newsItemCount = MAX_NEWS_ITEM_COUNT; }; + }; + static NewsItemCountClass newsItemCountClass; + + // Extern linkage for cache expire + extern int cacheExpire; + class CacheExpireTimeoutClass + { + public: CacheExpireTimeoutClass() { cacheExpire = CACHE_EXPIRE; }; + }; + static CacheExpireTimeoutClass cacheExpireTimeoutClass; + + // Default characters per second + // Used for displaying local news messages through the PostLocalNews API + // Used for displaying default news messages through the SetDefaultNewsStrings API + static const float DEFAULT_CHARS_PER_SEC = 2.0f; + + // Max size for news ticker messages + static const size_t MAX_NEWS_TICKER_MESSAGE_SIZE = 256; + + /************************** + ***** News Types ***** + **************************/ + + enum SenTickerMessageType + { + SenTickerMessageType_Text = 0, + SenTickerMessageType_MarketplaceOffer, + SenTickerMessageType_Max + }; + + struct SenTickerData + { + wchar_t message[MAX_NEWS_TICKER_MESSAGE_SIZE]; + SenTickerMessageType messageType; + INT64 data1; + INT64 data2; + float charPerSec; + }; + + /************************** + ***** News Functions ***** + **************************/ + + // Ticker messages need to be pulled whenever the ticker is displayed. Call this function to get the next message to display + + /// @brief public + /// + /// @param[in\out] userIndex + /// @param[in\out] out_tickerData + /// + /// @return HRESULT + /// + /// @details + /// + /// @related + HRESULT SenGetTickerMessage( + int userIndex, + SenTickerData *out_tickerData ); + +} // namespace Sentient \ No newline at end of file -- cgit v1.2.3