the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at master 68 lines 1.8 kB view raw
1#pragma once 2 3// 4J Stu - This file defines the id's for the dynamic configurations that we are currently using 4// as well as the format of the data in them 5 6/*********************** 7* 8* TRIAL TIMER 9* 10************************/ 11 12#define DYNAMIC_CONFIG_TRIAL_ID 0 13#define DYNAMIC_CONFIG_TRIAL_VERSION 1 14#define DYNAMIC_CONFIG_DEFAULT_TRIAL_TIME 2400 //40 mins 1200 // 20 mins //300; // 5 minutes 15 16class MinecraftDynamicConfigurations 17{ 18private: 19 enum EDynamic_Configs 20 { 21 eDynamic_Config_Trial, 22 23 eDynamic_Config_Max, 24 }; 25 26 /*********************** 27 * 28 * TRIAL TIMER 29 * 30 ************************/ 31 32 // 4J Stu - The first 4 bytes define a version number, that defines the structure of the data 33 // After reading those bytes into a DWORD, the remainder of the data should be the size of the 34 // relevant struct and can be cast to the struct 35 struct _dynamic_config_trial_data_version1 36 { 37 // The time in seconds that the player can play the trial for 38 DWORD trialTimeSeconds; 39 40 _dynamic_config_trial_data_version1() { trialTimeSeconds = DYNAMIC_CONFIG_DEFAULT_TRIAL_TIME; } 41 }; 42 43 typedef _dynamic_config_trial_data_version1 Dynamic_Config_Trial_Data; 44 45 // Stored configurations 46 static Dynamic_Config_Trial_Data trialData; 47 48 static bool s_bFirstUpdateStarted; 49 static bool s_bUpdatedConfigs[eDynamic_Config_Max]; 50 static EDynamic_Configs s_eCurrentConfig; 51 static size_t s_currentConfigSize; 52 53 static size_t s_dataWrittenSize; 54 static byte *s_dataWritten; 55 56public: 57 static void Tick(); 58 59 static DWORD GetTrialTime(); 60 61private: 62 static void UpdateAllConfigurations(); 63 static void UpdateNextConfiguration(); 64 static void UpdateConfiguration(EDynamic_Configs id); 65 66 static void GetSizeCompletedCallback(HRESULT taskResult, void *userCallbackData); 67 static void GetDataCompletedCallback(HRESULT taskResult, void *userCallbackData); 68};