aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/Windows64/Sentient/DynamicConfigurations.h
diff options
context:
space:
mode:
authordaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
committerdaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
commitb691c43c44ff180d10e7d4a9afc83b98551ff586 (patch)
tree3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.Client/Windows64/Sentient/DynamicConfigurations.h
parentdef8cb415354ac390b7e89052a50605285f1aca9 (diff)
Initial commit
Diffstat (limited to 'Minecraft.Client/Windows64/Sentient/DynamicConfigurations.h')
-rw-r--r--Minecraft.Client/Windows64/Sentient/DynamicConfigurations.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/Minecraft.Client/Windows64/Sentient/DynamicConfigurations.h b/Minecraft.Client/Windows64/Sentient/DynamicConfigurations.h
new file mode 100644
index 00000000..61b206eb
--- /dev/null
+++ b/Minecraft.Client/Windows64/Sentient/DynamicConfigurations.h
@@ -0,0 +1,68 @@
+#pragma once
+
+// 4J Stu - This file defines the id's for the dynamic configurations that we are currently using
+// as well as the format of the data in them
+
+/***********************
+*
+* TRIAL TIMER
+*
+************************/
+
+#define DYNAMIC_CONFIG_TRIAL_ID 0
+#define DYNAMIC_CONFIG_TRIAL_VERSION 1
+#define DYNAMIC_CONFIG_DEFAULT_TRIAL_TIME 2400 //40 mins 1200 // 20 mins //300; // 5 minutes
+
+class MinecraftDynamicConfigurations
+{
+private:
+ enum EDynamic_Configs
+ {
+ eDynamic_Config_Trial,
+
+ eDynamic_Config_Max,
+ };
+
+ /***********************
+ *
+ * TRIAL TIMER
+ *
+ ************************/
+
+ // 4J Stu - The first 4 bytes define a version number, that defines the structure of the data
+ // After reading those bytes into a DWORD, the remainder of the data should be the size of the
+ // relevant struct and can be cast to the struct
+ struct _dynamic_config_trial_data_version1
+ {
+ // The time in seconds that the player can play the trial for
+ DWORD trialTimeSeconds;
+
+ _dynamic_config_trial_data_version1() { trialTimeSeconds = DYNAMIC_CONFIG_DEFAULT_TRIAL_TIME; }
+ };
+
+ typedef _dynamic_config_trial_data_version1 Dynamic_Config_Trial_Data;
+
+ // Stored configurations
+ static Dynamic_Config_Trial_Data trialData;
+
+ static bool s_bFirstUpdateStarted;
+ static bool s_bUpdatedConfigs[eDynamic_Config_Max];
+ static EDynamic_Configs s_eCurrentConfig;
+ static size_t s_currentConfigSize;
+
+ static size_t s_dataWrittenSize;
+ static byte *s_dataWritten;
+
+public:
+ static void Tick();
+
+ static DWORD GetTrialTime();
+
+private:
+ static void UpdateAllConfigurations();
+ static void UpdateNextConfiguration();
+ static void UpdateConfiguration(EDynamic_Configs id);
+
+ static void GetSizeCompletedCallback(HRESULT taskResult, void *userCallbackData);
+ static void GetDataCompletedCallback(HRESULT taskResult, void *userCallbackData);
+}; \ No newline at end of file