2017-01-19 16:23:59 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#ifndef RC_INVOKED
|
|
|
|
|
|
|
|
#define WIN32_LEAN_AND_MEAN
|
2018-07-17 08:30:29 -04:00
|
|
|
#define _CRT_SECURE_NO_WARNINGS
|
2023-05-06 09:20:56 -04:00
|
|
|
#define _WINSOCK_DEPRECATED_NO_WARNINGS
|
2021-08-25 13:59:55 -04:00
|
|
|
#define _USE_MATH_DEFINES
|
2017-01-19 16:23:59 -05:00
|
|
|
|
2022-05-05 10:03:14 -04:00
|
|
|
#include <Windows.h>
|
2022-08-01 13:15:03 -04:00
|
|
|
#include <WinSock2.h>
|
2022-08-02 07:24:22 -04:00
|
|
|
#include <ShlObj.h>
|
2017-01-19 16:23:59 -05:00
|
|
|
#include <timeapi.h>
|
|
|
|
#include <shellapi.h>
|
2023-02-19 10:06:49 -05:00
|
|
|
#include <wininet.h>
|
2017-01-19 16:23:59 -05:00
|
|
|
#include <d3d9.h>
|
2022-06-12 17:07:53 -04:00
|
|
|
#include <AclAPI.h>
|
2017-01-30 11:47:29 -05:00
|
|
|
#include <Psapi.h>
|
2022-06-12 17:07:53 -04:00
|
|
|
#include <TlHelp32.h>
|
2017-06-07 05:22:38 -04:00
|
|
|
#include <Shlwapi.h>
|
2017-01-19 16:23:59 -05:00
|
|
|
|
2022-05-05 10:03:14 -04:00
|
|
|
#include <DbgHelp.h>
|
2017-03-13 16:50:42 -04:00
|
|
|
|
2021-04-04 12:04:28 -04:00
|
|
|
#include <algorithm>
|
2022-11-29 09:18:10 -05:00
|
|
|
#include <cctype>
|
|
|
|
#include <chrono>
|
2023-04-03 07:13:42 -04:00
|
|
|
#include <cinttypes>
|
2021-09-11 11:54:50 -04:00
|
|
|
#include <cmath>
|
2023-03-09 13:39:10 -05:00
|
|
|
#include <cstring>
|
2017-01-19 16:23:59 -05:00
|
|
|
#include <filesystem>
|
2022-11-29 09:18:10 -05:00
|
|
|
#include <format>
|
|
|
|
#include <fstream>
|
|
|
|
#include <future>
|
|
|
|
#include <limits>
|
2017-06-13 09:35:12 -04:00
|
|
|
#include <optional>
|
2022-11-29 09:18:10 -05:00
|
|
|
#include <queue>
|
2021-11-16 13:21:06 -05:00
|
|
|
#include <random>
|
2022-11-29 09:18:10 -05:00
|
|
|
#include <ranges>
|
|
|
|
#include <regex>
|
2022-06-12 17:07:53 -04:00
|
|
|
#include <source_location>
|
2022-11-29 09:18:10 -05:00
|
|
|
#include <sstream>
|
|
|
|
#include <thread>
|
2022-12-05 13:45:14 -05:00
|
|
|
#include <type_traits>
|
2023-01-03 07:16:44 -05:00
|
|
|
#include <map>
|
|
|
|
#include <set>
|
2023-03-21 14:06:48 -04:00
|
|
|
#include <type_traits>
|
2022-11-29 09:18:10 -05:00
|
|
|
#include <unordered_map>
|
2023-01-03 07:16:44 -05:00
|
|
|
#include <unordered_set>
|
2017-01-19 16:23:59 -05:00
|
|
|
|
2017-01-20 08:36:52 -05:00
|
|
|
#include <d3dx9tex.h>
|
2017-01-19 16:23:59 -05:00
|
|
|
#pragma comment(lib, "D3dx9.lib")
|
|
|
|
|
2022-05-05 10:03:14 -04:00
|
|
|
#include <XInput.h>
|
2021-01-02 02:17:37 -05:00
|
|
|
#pragma comment (lib, "xinput.lib")
|
|
|
|
|
2022-09-20 12:33:21 -04:00
|
|
|
#include <dwmapi.h>
|
|
|
|
#pragma comment (lib, "dwmapi.lib")
|
|
|
|
|
2024-02-02 18:31:03 -05:00
|
|
|
#include <iphlpapi.h>
|
|
|
|
#pragma comment (lib, "iphlpapi.lib")
|
|
|
|
|
2022-03-07 17:35:12 -05:00
|
|
|
// Ignore the warnings
|
2017-01-19 16:23:59 -05:00
|
|
|
#pragma warning(push)
|
|
|
|
#pragma warning(disable: 4100)
|
2022-03-07 17:35:12 -05:00
|
|
|
#pragma warning(disable: 26812)
|
2017-01-19 16:23:59 -05:00
|
|
|
|
2022-05-05 10:03:14 -04:00
|
|
|
// Enable additional literals
|
|
|
|
using namespace std::literals;
|
2017-01-19 16:23:59 -05:00
|
|
|
|
|
|
|
#ifdef max
|
2022-05-05 10:03:14 -04:00
|
|
|
#undef max
|
2017-01-19 16:23:59 -05:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef min
|
2022-05-05 10:03:14 -04:00
|
|
|
#undef min
|
2017-01-19 16:23:59 -05:00
|
|
|
#endif
|
|
|
|
|
2023-01-16 12:55:26 -05:00
|
|
|
#ifdef GetObject
|
|
|
|
#undef GetObject
|
|
|
|
#endif
|
|
|
|
|
2022-05-05 10:03:14 -04:00
|
|
|
#define AssertSize(x, size) \
|
|
|
|
static_assert(sizeof(x) == (size), \
|
|
|
|
"Structure has an invalid size. " #x " must be " #size " bytes")
|
|
|
|
|
|
|
|
#define AssertOffset(x, y, offset) \
|
|
|
|
static_assert(offsetof(x, y) == (offset), \
|
|
|
|
#x "::" #y " is not at the right offset. Must be at " #offset)
|
|
|
|
|
2022-08-10 17:03:26 -04:00
|
|
|
#define AssertIn(x, y) assert(static_cast<unsigned int>(x) < static_cast<unsigned int>(y))
|
|
|
|
|
|
|
|
#define AssertUnreachable assert(0 && "unreachable")
|
|
|
|
|
2023-01-19 12:24:12 -05:00
|
|
|
#include <gsl/gsl>
|
2023-02-09 19:12:05 -05:00
|
|
|
#include <json.hpp>
|
2023-01-19 12:24:12 -05:00
|
|
|
#include <tomcrypt.h>
|
|
|
|
|
2017-01-19 16:23:59 -05:00
|
|
|
#pragma warning(pop)
|
|
|
|
|
2022-05-05 10:03:14 -04:00
|
|
|
#include "Utils/Memory.hpp" // Breaks order on purpose
|
|
|
|
|
2017-01-20 08:36:52 -05:00
|
|
|
#include "Utils/Cache.hpp"
|
|
|
|
#include "Utils/Chain.hpp"
|
2022-05-05 10:03:14 -04:00
|
|
|
#include "Utils/Concurrency.hpp"
|
2017-01-20 08:36:52 -05:00
|
|
|
#include "Utils/Cryptography.hpp"
|
2022-05-05 10:03:14 -04:00
|
|
|
#include "Utils/CSV.hpp"
|
|
|
|
#include "Utils/Entities.hpp"
|
|
|
|
#include "Utils/Hooking.hpp"
|
|
|
|
#include "Utils/IO.hpp"
|
|
|
|
#include "Utils/Library.hpp"
|
2022-06-26 09:40:57 -04:00
|
|
|
#include "Utils/Maths.hpp"
|
2022-06-28 03:26:43 -04:00
|
|
|
#include "Utils/NamedMutex.hpp"
|
2022-05-05 10:03:14 -04:00
|
|
|
#include "Utils/String.hpp"
|
|
|
|
#include "Utils/Thread.hpp"
|
|
|
|
#include "Utils/Time.hpp"
|
|
|
|
#include "Utils/Utils.hpp"
|
2017-01-20 08:36:52 -05:00
|
|
|
|
2022-05-05 10:03:14 -04:00
|
|
|
#include "Steam/Steam.hpp" // Some definitions are used in functions and structs
|
2017-01-20 08:36:52 -05:00
|
|
|
|
|
|
|
#include "Game/Structs.hpp"
|
2022-08-23 06:58:33 -04:00
|
|
|
#include "Game/Game.hpp"
|
|
|
|
|
2022-06-14 14:43:19 -04:00
|
|
|
#include <Game/Scripting/Function.hpp>
|
2022-06-30 11:07:39 -04:00
|
|
|
#include <Game/Scripting/StackIsolation.hpp>
|
2017-01-20 08:36:52 -05:00
|
|
|
|
2022-05-05 10:03:14 -04:00
|
|
|
#include "Utils/Stream.hpp" // Breaks order on purpose
|
2017-01-20 08:36:52 -05:00
|
|
|
|
|
|
|
#include "Components/Loader.hpp"
|
2017-01-19 16:23:59 -05:00
|
|
|
|
|
|
|
// Libraries
|
|
|
|
#pragma comment(lib, "Winmm.lib")
|
|
|
|
#pragma comment(lib, "Crypt32.lib")
|
|
|
|
#pragma comment(lib, "Ws2_32.lib")
|
|
|
|
#pragma comment(lib, "d3d9.lib")
|
|
|
|
#pragma comment(lib, "Wininet.lib")
|
|
|
|
#pragma comment(lib, "shlwapi.lib")
|
|
|
|
#pragma comment(lib, "Urlmon.lib")
|
|
|
|
#pragma comment(lib, "Advapi32.lib")
|
|
|
|
#pragma comment(lib, "rpcrt4.lib")
|
2017-03-13 16:50:42 -04:00
|
|
|
#pragma comment(lib, "dbghelp.lib")
|
2021-07-18 12:11:20 -04:00
|
|
|
#pragma comment(lib, "ntdll.lib")
|
2017-01-19 16:23:59 -05:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define BASEGAME "iw4x"
|
2022-12-06 08:05:03 -05:00
|
|
|
#define BASEGAME_NAME "iw4mp_ceg.exe"
|
2017-01-19 16:23:59 -05:00
|
|
|
#define CLIENT_CONFIG "iw4x_config.cfg"
|
|
|
|
|
2023-06-18 08:59:37 -04:00
|
|
|
#define XFILE_MAGIC_UNSIGNED 0x3030317566665749
|
|
|
|
#define XFILE_VERSION 276
|
|
|
|
|
|
|
|
#define XFILE_HEADER_IW4X 0x78345749 // 'IW4x'
|
|
|
|
#define XFILE_VERSION_IW4X 3
|
|
|
|
|
2017-01-19 16:23:59 -05:00
|
|
|
// Resource stuff
|
|
|
|
#ifdef APSTUDIO_INVOKED
|
|
|
|
#ifndef APSTUDIO_READONLY_SYMBOLS
|
|
|
|
// Defines below make accessing the resources from the code easier.
|
|
|
|
#define _APS_NEXT_RESOURCE_VALUE 102
|
|
|
|
#define _APS_NEXT_COMMAND_VALUE 40001
|
|
|
|
#define _APS_NEXT_CONTROL_VALUE 1001
|
|
|
|
#define _APS_NEXT_SYMED_VALUE 101
|
|
|
|
#endif
|
|
|
|
#endif
|