diff --git a/.clang-format b/.clang-format index 183684af..3e558465 100644 --- a/.clang-format +++ b/.clang-format @@ -1,5 +1,5 @@ --- -AccessModifierOffset: '0' +AccessModifierOffset: '-4' AlignAfterOpenBracket: Align AlignConsecutiveAssignments: 'true' AlignOperands: 'true' diff --git a/include/CDumper.hpp b/include/CDumper.hpp index 2357ea0a..0c43a27c 100644 --- a/include/CDumper.hpp +++ b/include/CDumper.hpp @@ -19,7 +19,7 @@ class CDumper { - public: +public: CDumper() { m_file.open("/tmp/netdump.txt", std::ios::out | std::ios::trunc); @@ -115,7 +115,7 @@ class CDumper m_file << std::endl; } - private: +private: std::fstream m_file; }; diff --git a/include/averager.hpp b/include/averager.hpp index 1fd5f33d..0831b57b 100644 --- a/include/averager.hpp +++ b/include/averager.hpp @@ -21,7 +21,7 @@ template class Averager { - public: +public: /* * Initialize Averager with a given size */ @@ -102,7 +102,7 @@ template class Averager return value_count_; } - private: +private: std::vector values_; size_t size_{ 0 }; size_t value_count_{ 0 }; diff --git a/include/base64.hpp b/include/base64.hpp index 58fc2c27..25373c80 100644 --- a/include/base64.hpp +++ b/include/base64.hpp @@ -36,7 +36,7 @@ const char kBase64Alphabet[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" class Base64 { - public: +public: static bool Encode(const std::string &in, std::string *out) { int i = 0, j = 0; @@ -304,7 +304,7 @@ class Base64 in->resize(in->size() - 1); } - private: +private: static inline void a3_to_a4(unsigned char *a4, unsigned char *a3) { a4[0] = (a3[0] & 0xfc) >> 2; diff --git a/include/classinfo/css.gen.hpp b/include/classinfo/css.gen.hpp index 6b5cda71..1aeec8f5 100644 --- a/include/classinfo/css.gen.hpp +++ b/include/classinfo/css.gen.hpp @@ -11,7 +11,7 @@ namespace client_classes class css { - public: +public: int CTETFParticleEffect{ 0 }; int CTETFExplosion{ 0 }; int CTETFBlood{ 0 }; diff --git a/include/classinfo/css_constexpr.gen.hpp b/include/classinfo/css_constexpr.gen.hpp index d872439d..9555808c 100644 --- a/include/classinfo/css_constexpr.gen.hpp +++ b/include/classinfo/css_constexpr.gen.hpp @@ -11,7 +11,7 @@ namespace client_classes_constexpr class css { - public: +public: static constexpr int CTETFParticleEffect = 0; static constexpr int CTETFExplosion = 0; static constexpr int CTETFBlood = 0; diff --git a/include/classinfo/dab.gen.hpp b/include/classinfo/dab.gen.hpp index 58e0114c..209be827 100644 --- a/include/classinfo/dab.gen.hpp +++ b/include/classinfo/dab.gen.hpp @@ -11,7 +11,7 @@ namespace client_classes class dab { - public: +public: int CTETFParticleEffect{ 0 }; int CTETFExplosion{ 0 }; int CTETFBlood{ 0 }; diff --git a/include/classinfo/dab_constexpr.gen.hpp b/include/classinfo/dab_constexpr.gen.hpp index aa7ad691..d32604a4 100644 --- a/include/classinfo/dab_constexpr.gen.hpp +++ b/include/classinfo/dab_constexpr.gen.hpp @@ -11,7 +11,7 @@ namespace client_classes_constexpr class dab { - public: +public: static constexpr int CTETFParticleEffect = 0; static constexpr int CTETFExplosion = 0; static constexpr int CTETFBlood = 0; diff --git a/include/classinfo/dummy.gen.hpp b/include/classinfo/dummy.gen.hpp index 91e87672..a824716a 100644 --- a/include/classinfo/dummy.gen.hpp +++ b/include/classinfo/dummy.gen.hpp @@ -11,7 +11,7 @@ namespace client_classes class dummy { - public: +public: int CTETFParticleEffect{ 0 }; int CTETFExplosion{ 0 }; int CTETFBlood{ 0 }; diff --git a/include/classinfo/dynamic.gen.hpp b/include/classinfo/dynamic.gen.hpp index 2df48b1e..1c4dcd34 100644 --- a/include/classinfo/dynamic.gen.hpp +++ b/include/classinfo/dynamic.gen.hpp @@ -11,7 +11,7 @@ namespace client_classes class dynamic { - public: +public: dynamic(); void Populate(); int CTETFParticleEffect{ 0 }; diff --git a/include/classinfo/hl2dm.gen.hpp b/include/classinfo/hl2dm.gen.hpp index 9aa49301..40ecd4bb 100644 --- a/include/classinfo/hl2dm.gen.hpp +++ b/include/classinfo/hl2dm.gen.hpp @@ -11,7 +11,7 @@ namespace client_classes class hl2dm { - public: +public: int CTETFParticleEffect{ 0 }; int CTETFExplosion{ 0 }; int CTETFBlood{ 0 }; diff --git a/include/classinfo/hl2dm_constexpr.gen.hpp b/include/classinfo/hl2dm_constexpr.gen.hpp index ad2ebde6..57f928fb 100644 --- a/include/classinfo/hl2dm_constexpr.gen.hpp +++ b/include/classinfo/hl2dm_constexpr.gen.hpp @@ -11,7 +11,7 @@ namespace client_classes_constexpr class hl2dm { - public: +public: static constexpr int CTETFParticleEffect = 0; static constexpr int CTETFExplosion = 0; static constexpr int CTETFBlood = 0; diff --git a/include/classinfo/tf2.gen.hpp b/include/classinfo/tf2.gen.hpp index 09be7085..f66ba19c 100644 --- a/include/classinfo/tf2.gen.hpp +++ b/include/classinfo/tf2.gen.hpp @@ -11,7 +11,7 @@ namespace client_classes class tf2 { - public: +public: int CTETFParticleEffect{ 178 }; int CTETFExplosion{ 177 }; int CTETFBlood{ 176 }; diff --git a/include/classinfo/tf2_constexpr.gen.hpp b/include/classinfo/tf2_constexpr.gen.hpp index 076f59e7..9c43bd8c 100644 --- a/include/classinfo/tf2_constexpr.gen.hpp +++ b/include/classinfo/tf2_constexpr.gen.hpp @@ -11,7 +11,7 @@ namespace client_classes_constexpr class tf2 { - public: +public: static constexpr int CTETFParticleEffect = 178; static constexpr int CTETFExplosion = 177; static constexpr int CTETFBlood = 176; diff --git a/include/classinfo/tf2c.gen.hpp b/include/classinfo/tf2c.gen.hpp index 970a926b..a7d4d780 100644 --- a/include/classinfo/tf2c.gen.hpp +++ b/include/classinfo/tf2c.gen.hpp @@ -11,7 +11,7 @@ namespace client_classes class tf2c { - public: +public: int CTETFParticleEffect{ 155 }; int CTETFExplosion{ 154 }; int CTETFBlood{ 153 }; diff --git a/include/classinfo/tf2c_constexpr.gen.hpp b/include/classinfo/tf2c_constexpr.gen.hpp index d5a22127..d08ef697 100644 --- a/include/classinfo/tf2c_constexpr.gen.hpp +++ b/include/classinfo/tf2c_constexpr.gen.hpp @@ -11,7 +11,7 @@ namespace client_classes_constexpr class tf2c { - public: +public: static constexpr int CTETFParticleEffect = 155; static constexpr int CTETFExplosion = 154; static constexpr int CTETFBlood = 153; diff --git a/include/copypasted/CSignature.h b/include/copypasted/CSignature.h index f24beda8..ef798dc8 100644 --- a/include/copypasted/CSignature.h +++ b/include/copypasted/CSignature.h @@ -7,7 +7,7 @@ class CSignature { - public: +public: uintptr_t dwFindPattern(uintptr_t dwAddress, uintptr_t dwLength, const char *szPattern); void *GetModuleHandleSafe(const char *pszModuleName); diff --git a/include/copypasted/Netvar.h b/include/copypasted/Netvar.h index 6d496a88..60336c9e 100644 --- a/include/copypasted/Netvar.h +++ b/include/copypasted/Netvar.h @@ -13,7 +13,7 @@ class RecvProp; class equal_char { - public: +public: bool operator()(const char *const &v1, const char *const &v2) const { return !strcmp(v1, v2); @@ -22,7 +22,7 @@ class equal_char struct hash_char { - public: +public: size_t operator()(const char *obj) const { size_t res = 0; @@ -54,12 +54,12 @@ class netvar_tree map_type nodes; - public: +public: // netvar_tree ( ); void init(); - private: +private: void populate_nodes(class RecvTable *recv_table, map_type *map); /** @@ -117,7 +117,7 @@ class netvar_tree return get_prop_recursive(node->nodes, args...); } - public: +public: /** * get_offset - Get the offset of a netvar given a list of branch names * @name: Top level datatable name diff --git a/include/cvwrapper.hpp b/include/cvwrapper.hpp index 95f26cb6..ea2e7cd5 100644 --- a/include/cvwrapper.hpp +++ b/include/cvwrapper.hpp @@ -34,11 +34,11 @@ enum CatVar_t // Enum Something class CatEnum { - public: +public: CatEnum(std::vector values, int min = 0); std::string Name(int value); - public: +public: const std::vector value_names; int min_value; int max_value; @@ -48,7 +48,7 @@ class CatEnum // TODO reverse, no idea how catcommands are handled class CatCommand { - public: +public: CatCommand(std::string name, std::string help, FnCommandCallback_t callback); CatCommand(std::string name, std::string help, @@ -56,7 +56,7 @@ class CatCommand void Register(); - public: +public: const std::string name; const std::string help{ "" }; @@ -68,7 +68,7 @@ class CatCommand class CatVar { - public: // TODo, unknown reverse +public: // TODo, unknown reverse CatVar(CatVar_t type, std::string name, std::string defaults, std::string desc_short, std::string desc_long = "no description"); CatVar(CatVar_t type, std::string name, std::string defaults, @@ -154,7 +154,7 @@ class CatVar } // Storage for the catvar - public: +public: const CatVar_t type; const std::string name; const std::string defaults{ "0" }; diff --git a/include/entitycache.hpp b/include/entitycache.hpp index bd2a6b47..e50b54e7 100644 --- a/include/entitycache.hpp +++ b/include/entitycache.hpp @@ -59,7 +59,7 @@ struct mstudiobbox_t; class CachedEntity { - public: +public: CachedEntity(); ~CachedEntity(); diff --git a/include/entityhitboxcache.hpp b/include/entityhitboxcache.hpp index 262ce9ff..e54d3b09 100644 --- a/include/entityhitboxcache.hpp +++ b/include/entityhitboxcache.hpp @@ -29,7 +29,7 @@ struct CachedHitbox class EntityHitboxCache { - public: +public: EntityHitboxCache(); ~EntityHitboxCache(); diff --git a/include/globals.h b/include/globals.h index 2564b71e..44aaa6bc 100644 --- a/include/globals.h +++ b/include/globals.h @@ -43,7 +43,7 @@ extern time_t time_injected; class GlobalSettings { - public: +public: void Init(); bool bInvalid{ true }; bool is_create_move{ false }; diff --git a/include/hacks/ESP.hpp b/include/hacks/ESP.hpp index f924b4f3..1c75127e 100644 --- a/include/hacks/ESP.hpp +++ b/include/hacks/ESP.hpp @@ -20,7 +20,7 @@ namespace esp // Strings class ESPString { - public: +public: std::string data{ "" }; rgba_t color{ colors::empty }; }; @@ -28,7 +28,7 @@ class ESPString // Cached data class ESPData { - public: +public: int string_count{ 0 }; std::array strings{}; rgba_t color{ colors::empty }; diff --git a/include/hacks/SkinChanger.hpp b/include/hacks/SkinChanger.hpp index 31b5ce4b..76151786 100644 --- a/include/hacks/SkinChanger.hpp +++ b/include/hacks/SkinChanger.hpp @@ -51,10 +51,10 @@ struct attribute_s class CAttribute { - public: +public: CAttribute(uint16_t iAttributeDefinitionIndex, float flValue); - public: +public: void *vtable; uint16_t defidx; float value; @@ -63,13 +63,13 @@ class CAttribute class CAttributeList { - public: +public: CAttributeList(); float GetAttribute(int defindex); void SetAttribute(int index, float value); void RemoveAttribute(int index); - public: +public: uint32_t unknown; CUtlVector> m_Attributes; }; @@ -109,7 +109,7 @@ struct patched_weapon_cookie void Update(int entity); bool Check(); - public: +public: int eidx{ 0 }; int defidx{ 0 }; int eclass{ 0 }; diff --git a/include/hooks.hpp b/include/hooks.hpp index 5decae71..1d8dc5b0 100644 --- a/include/hooks.hpp +++ b/include/hooks.hpp @@ -33,7 +33,7 @@ constexpr uint32_t GUARD = 0xD34DC477; class VMTHook { - public: +public: VMTHook(); ~VMTHook(); void Set(ptr_t inst, uint32_t offset = 0); @@ -42,7 +42,7 @@ class VMTHook void *GetMethod(uint32_t idx) const; void Apply(); - public: +public: ptr_t object{ nullptr }; table_ptr_t vtable_ptr{ nullptr }; method_table_t vtable_original{ nullptr }; diff --git a/include/https_request.hpp b/include/https_request.hpp index f3453bd4..b76c3e3a 100644 --- a/include/https_request.hpp +++ b/include/https_request.hpp @@ -21,7 +21,7 @@ extern SSL_CTX *ssl_context; class RAII_HTTPS_Socket { - public: +public: RAII_HTTPS_Socket(const std::string &host); ~RAII_HTTPS_Socket(); diff --git a/include/init.hpp b/include/init.hpp index dcf02e49..a1267d38 100644 --- a/include/init.hpp +++ b/include/init.hpp @@ -15,6 +15,6 @@ std::stack &init_stack(); class InitRoutine { - public: +public: InitRoutine(void (*func)()); }; diff --git a/include/itemtypes.hpp b/include/itemtypes.hpp index 9b8fc32a..af883ceb 100644 --- a/include/itemtypes.hpp +++ b/include/itemtypes.hpp @@ -209,7 +209,7 @@ typedef k_EItemType (*ItemSpecialMapperFn)(CachedEntity *); class ItemModelMapper { - public: +public: void RegisterItem(std::string modelpath, k_EItemType type); k_EItemType GetItemType(CachedEntity *entity); @@ -219,7 +219,7 @@ class ItemModelMapper class ItemManager { - public: +public: ItemManager(); void RegisterModelMapping(std::string path, k_EItemType type); void RegisterSpecialMapping(ItemCheckerFn fn, k_EItemType type); diff --git a/include/json.hpp b/include/json.hpp index 43d3d223..55acd9ad 100644 --- a/include/json.hpp +++ b/include/json.hpp @@ -396,12 +396,12 @@ contains a `mapped_type`, whereas `std::vector` fails the test. #define NLOHMANN_JSON_HAS_HELPER(type) \ template struct has_##type \ { \ - private: \ + private: \ template \ static int detect(U &&); \ static void detect(...); \ \ - public: \ + public: \ static constexpr bool value = \ std::is_integral()))>::value; \ } @@ -497,7 +497,7 @@ struct is_compatible_integer_type // trait checking if JSONSerializer::from_json(json const&, udt&) exists template struct has_from_json { - private: +private: // also check the return type of from_json template ::from_json( @@ -506,7 +506,7 @@ template struct has_from_json static int detect(U &&); static void detect(...); - public: +public: static constexpr bool value = std::is_integral>()))>::value; @@ -516,14 +516,14 @@ template struct has_from_json // this overload is used for non-default-constructible user-defined-types template struct has_non_default_from_json { - private: +private: template ::from_json( std::declval()))>::value>> static int detect(U &&); static void detect(...); - public: +public: static constexpr bool value = std::is_integral>()))>::value; @@ -532,14 +532,14 @@ template struct has_non_default_from_json // This trait checks if BasicJsonType::json_serializer::to_json exists template struct has_to_json { - private: +private: template ::to_json( std::declval(), std::declval()))> static int detect(U &&); static void detect(...); - public: +public: static constexpr bool value = std::is_integral>()))>::value; @@ -898,7 +898,7 @@ void from_json(const BasicJsonType &j, ArithmeticType &val) struct to_json_fn { - private: +private: template auto call(BasicJsonType &j, T &&val, priority_tag<1>) const noexcept(noexcept(to_json(j, std::forward(val)))) @@ -914,7 +914,7 @@ struct to_json_fn "could not find to_json() method in T's namespace"); } - public: +public: template void operator()(BasicJsonType &j, T &&val) const noexcept(noexcept(std::declval().call(j, @@ -927,7 +927,7 @@ struct to_json_fn struct from_json_fn { - private: +private: template auto call(const BasicJsonType &j, T &val, priority_tag<1>) const noexcept(noexcept(from_json(j, val))) @@ -943,7 +943,7 @@ struct from_json_fn "could not find from_json() method in T's namespace"); } - public: +public: template void operator()(const BasicJsonType &j, T &val) const noexcept(noexcept(std::declval().call(j, val, @@ -1113,7 +1113,7 @@ template