diff --git a/CMakeLists.txt b/CMakeLists.txt index d46e277..4c8561a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,6 +48,7 @@ set(SOURCE2GEN_SUPPORTED_GAMES DESKJOB HL_ALYX THE_LAB_ROBOT_REPAIR + DEADLOCK ) option(SOURCE2GEN_GAME "Game to generate" "CS2") diff --git a/README.md b/README.md index 7efe2d5..1c02d43 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ git clone --recurse-submodules https://github.com/neverlosecc/source2gen.git Before building the project in Visual Studio, you will need to update the game definition. The default definition is `CS2`. \ -Possible options are: `CS2`, `SBOX`, `ARTIFACT2`, `ARTIFACT1`, `DOTA2`, `UNDERLORDS`, `DESKJOB`. +Possible options are: `CS2`, `SBOX`, `ARTIFACT2`, `ARTIFACT1`, `DOTA2`, `UNDERLORDS`, `DESKJOB`, `DEADLOCK`. When using CMake, you can set `cmake -DSOURCE2GEN_GAME=CS2` diff --git a/source2gen-loader/src/main.cpp b/source2gen-loader/src/main.cpp index ef97b7e..d40f463 100644 --- a/source2gen-loader/src/main.cpp +++ b/source2gen-loader/src/main.cpp @@ -25,6 +25,8 @@ namespace { 546560 #elif defined(THE_LAB_ROBOT_REPAIR) 450390 +#elif defined(DEADLOCK) + 1422450 #else #error #endif diff --git a/source2gen/include/sdk/interfaces/common/CThreadSpinMutex.h b/source2gen/include/sdk/interfaces/common/CThreadSpinMutex.h index e9c651e..ed043ab 100644 --- a/source2gen/include/sdk/interfaces/common/CThreadSpinMutex.h +++ b/source2gen/include/sdk/interfaces/common/CThreadSpinMutex.h @@ -5,7 +5,7 @@ #include "CThreadMutex.h" #include -#if defined(CS2) || defined(DOTA2) +#if defined(CS2) || defined(DOTA2) || defined(DEADLOCK) constexpr auto kThreadSpinMutex = 2; #else constexpr auto kThreadSpinMutex = 1; diff --git a/source2gen/include/sdk/interfaces/common/CUtlMemoryPoolBase.h b/source2gen/include/sdk/interfaces/common/CUtlMemoryPoolBase.h index b6234d7..cba9b12 100644 --- a/source2gen/include/sdk/interfaces/common/CUtlMemoryPoolBase.h +++ b/source2gen/include/sdk/interfaces/common/CUtlMemoryPoolBase.h @@ -9,7 +9,7 @@ #include #include -#if defined(CS2) || defined(DOTA2) +#if defined(CS2) || defined(DOTA2) || defined(DEADLOCK) constexpr auto kUtlMemoryPoolBaseVersion = 2; #else constexpr auto kUtlMemoryPoolBaseVersion = 1; diff --git a/source2gen/include/sdk/interfaces/common/CUtlTSHash.h b/source2gen/include/sdk/interfaces/common/CUtlTSHash.h index b01b69e..2b77396 100644 --- a/source2gen/include/sdk/interfaces/common/CUtlTSHash.h +++ b/source2gen/include/sdk/interfaces/common/CUtlTSHash.h @@ -7,7 +7,7 @@ #include #include -#if defined(CS2) || defined(DOTA2) +#if defined(CS2) || defined(DOTA2) || defined(DEADLOCK) constexpr auto kUtlTsHashVersion = 2; #else constexpr auto kUtlTsHashVersion = 1; @@ -166,7 +166,7 @@ class CUtlTSHashV1 { CUtlMemoryPoolBase m_EntryMemory; std::array m_aBuckets; -#if defined(DOTA2) +#if defined(DOTA2) || defined(DEADLOCK) bool m_bNeedsCommit; CInterlockedInt m_ContentionCheck; #endif @@ -308,7 +308,7 @@ std::vector CUtlTSHashV2::GetElements(int /// @note: @og: basically, its hacky-way to obtain first-time commited information to memory #if defined(CS2_OLD) n_count = PeakAlloc(); -#elif defined(DOTA2) || defined(CS2) +#elif defined(DOTA2) || defined(CS2) || defined(DEADLOCK) n_count = PeakAlloc() - BlocksAllocated(); #endif std::vector unAllocatedList; @@ -329,7 +329,7 @@ std::vector CUtlTSHashV2::GetElements(int #if defined(CS2_OLD) return unAllocatedList.size() > AllocatedList.size() ? unAllocatedList : AllocatedList; -#elif defined(DOTA2) || defined(CS2) +#elif defined(DOTA2) || defined(CS2) || defined(DEADLOCK) return merge_without_duplicates(AllocatedList, unAllocatedList, ptr_compare); #endif } diff --git a/source2gen/include/sdk/interfaces/schemasystem/schema.h b/source2gen/include/sdk/interfaces/schemasystem/schema.h index d1d6ae1..4faf723 100644 --- a/source2gen/include/sdk/interfaces/schemasystem/schema.h +++ b/source2gen/include/sdk/interfaces/schemasystem/schema.h @@ -122,7 +122,7 @@ enum { #error unimplemented #elif defined(THE_LAB_ROBOT_REPAIR) #error unimplemented -#elif defined(DOTA2) || defined(CS2) +#elif defined(DOTA2) || defined(CS2) || defined(DEADLOCK) constexpr auto kSchemaSystemVersion = platform_specific{.windows = 2, .linux = 1}.get(); constexpr auto kSchemaSystem_PAD0 = platform_specific{.windows = 0x188, .linux = 0x188 + 0x68}.get(); @@ -184,7 +184,7 @@ using CSchemaClassBinding = CSchemaClassInfo; // @note: @og: now CSchemaEnumBinding is the same class\structure as CSchemaEnumInfoData\SchemaEnumInfoData_t using CSchemaEnumBinding = CSchemaEnumInfo; -#if defined(CS2) || defined(DOTA2) +#if defined(CS2) || defined(DOTA2) || defined(DEADLOCK) enum SchemaClassFlags_t { SCHEMA_CF1_HAS_VIRTUAL_MEMBERS = (1 << 0), SCHEMA_CF1_IS_ABSTRACT = (1 << 1), @@ -385,7 +385,7 @@ class CSchemaType { [[nodiscard]] CSchemaType* GetRefClass(); [[nodiscard]] ETypeCategory GetTypeCategory() const { -#if defined(CS2) || defined(DOTA2) +#if defined(CS2) || defined(DOTA2) || defined(DEADLOCK) return m_unTypeCategory; #else return Virtual::Get(this, 0)(this); @@ -393,7 +393,7 @@ class CSchemaType { } [[nodiscard]] EAtomicCategory GetAtomicCategory() const { -#if defined(CS2) || defined(DOTA2) +#if defined(CS2) || defined(DOTA2) || defined(DEADLOCK) return m_unAtomicCategory; #else return Virtual::Get(this, 1)(this); @@ -406,7 +406,7 @@ class CSchemaType { CSchemaSystemTypeScope* m_pTypeScope; // 0x0010 -#if defined(CS2) || defined(DOTA2) +#if defined(CS2) || defined(DOTA2) || defined(DEADLOCK) ETypeCategory m_unTypeCategory; // 0x0018 EAtomicCategory m_unAtomicCategory; // 0x0019 IF_LINUX(char _pad_0x20[0x02];) @@ -755,7 +755,7 @@ class CSchemaPtrMap { char pad_0x28[0x08]; #endif -#if !defined(DOTA2) && !defined(CS2) +#if !defined(DOTA2) && !defined(CS2) && !defined(DEADLOCK) CThreadFastMutex m_Mutex; #endif }; @@ -901,7 +901,7 @@ class CSchemaSystemTypeScope { CSchemaPtrMap m_FixedArrays; // 0x0558 CSchemaPtrMap m_Bitfields; // 0x0588 -#if !defined(DOTA2) && !defined(CS2) +#if !defined(DOTA2) && !defined(CS2) && !defined(DEADLOCK) CSchemaType_NoschemaType m_pNoschemaType = {}; #endif