Formatting

This commit is contained in:
Federico Cecchetto 2022-02-23 21:23:00 +01:00
parent 3835dd5544
commit b49aea8ecc
29 changed files with 1036 additions and 1059 deletions

View File

@ -1,16 +1,18 @@
#include <std_include.hpp>
#include "loader/component_loader.hpp"
#include "localized_strings.hpp"
#include "scheduler.hpp"
#include "command.hpp"
#include "version.hpp"
#include "game/game.hpp"
#include "game/dvars.hpp"
#include <utils/hook.hpp>
#include <utils/string.hpp>
#include <game/dvars.hpp>
#include "version.hpp"
// fonts/default.otf, fonts/defaultBold.otf, fonts/fira_mono_regular.ttf, fonts/fira_mono_bold.ttf
namespace branding
{
@ -72,6 +74,3 @@ namespace branding
}
REGISTER_COMPONENT(branding::component)
// fonts/default.otf, fonts/defaultBold.otf, fonts/fira_mono_regular.ttf, fonts/fira_mono_bold.ttf

View File

@ -261,6 +261,7 @@ namespace command
add_commands_mp();
}
add_commands_generic();
}
@ -330,8 +331,7 @@ namespace command
console::info("================================ END COMMAND DUMP =================================\n");
});
/*
add("listassetpool", [](const params& params)
/*add("listassetpool", [](const params& params)
{
if (params.size() < 2)
{

View File

@ -36,7 +36,7 @@ namespace fps
std::int32_t max{};
};
cg_perf_data cg_perf = cg_perf_data();
cg_perf_data cg_perf{};
void perf_calc_fps(cg_perf_data* data, const std::int32_t value)
{

View File

@ -243,7 +243,6 @@ namespace game_console
con.globals.left_x = con.globals.x;
con.globals.auto_complete_choice[0] = 0;
game::R_AddCmdDrawTextWithCursor(con.buffer, 0x7FFFFFFF, console_font, 18, con.globals.x,
con.globals.y + con.globals.font_height, 1.0f, 1.0f, 0, color_white, 0,
con.cursor, '|');
@ -251,7 +250,6 @@ namespace game_console
game::R_AddCmdDrawText(con.buffer, 0x7FFF, console_font, con.globals.x,
con.globals.y + con.globals.font_height, 1.0f, 1.0f, 0.0f, color_white, 0);
// check if using a prefixed '/' or not
const auto input = con.buffer[1] && (con.buffer[0] == '/' || con.buffer[0] == '\\')
? std::string(con.buffer).substr(1)
@ -336,8 +334,6 @@ namespace game_console
}
}
void draw_output_scrollbar(const float x, float y, const float width, const float height, output_queue& output)
{
const auto _x = (x + width) - 10.0f;

View File

@ -15,7 +15,10 @@ namespace lui
public:
void post_unpack() override
{
if (!game::environment::is_mp()) return;
if (!game::environment::is_mp())
{
return;
}
// Don't show create cod account popup
//utils::hook::set<uint32_t>(0x14017C957, 0); // H1(1.4)

View File

@ -180,11 +180,9 @@ namespace scheduler
void post_unpack() override
{
r_end_frame_hook.create(SELECT_VALUE(0x1404F7310, 0x1405FE470), scheduler::r_end_frame_stub); // H1(1.4)
g_run_frame_hook.create(SELECT_VALUE(0x1402772D0, 0x1402772D0), scheduler::server_frame_stub); // H1(1.4)
main_frame_hook.create(SELECT_VALUE(0x1401CE8D0, 0x1401CE8D0), scheduler::main_frame_stub); // H1(1.4)
}
void pre_destroy() override

View File

@ -151,8 +151,6 @@ namespace dvars
}
}
std::vector<std::string> dvar_list =
{
"accessToSubscriberContent",
@ -581,7 +579,8 @@ namespace dvars
return game::Dvar_RegisterVec4(hash, "", x, y, z, w, min, max, flags);
}
namespace override {
namespace override
{
static std::unordered_map<std::string, std::string> set_string_overrides;
game::dvar_t* register_int(const std::string& name, int value, int min, int max,

View File

@ -34,7 +34,8 @@ namespace dvars
game::dvar_t* register_float(const std::string& name, float value, float min, float max, game::DvarFlags flags, bool add_to_list = true);
game::dvar_t* register_vec4(const std::string& name, float x, float y, float z, float w, float min, float max, game::DvarFlags flags, bool add_to_list = true);
namespace override {
namespace override
{
game::dvar_t* register_int(const std::string& name, int value, int min, int max, const unsigned int flags, bool add_to_list = true);
void Dvar_SetString(const std::string& name, const std::string& string);
game::dvar_t* register_float(const std::string& name, float value, float min, float max, game::DvarFlags flags, bool add_to_list = true);

View File

@ -23,7 +23,6 @@ namespace game
return sv_cmd_args->argv[sv_cmd_args->nesting][index];
}
namespace environment
{
launcher::mode mode = launcher::mode::none;

View File

@ -8,35 +8,28 @@ namespace game
* Functions
**************************************************************/
WEAK symbol<void(int localClientNum, const char* text)> Cbuf_AddText{ 0x140342EB0, 0x1404033B0 }; // H1(1.4)
WEAK symbol<void(int localClientNum, int controllerIndex, const char* text)> Cmd_ExecuteSingleCommand{ 0x140343980, 0x140343980 }; // H1SP64[CODEX]
WEAK symbol<void(unsigned int weapon, bool isAlternate,
char* output, unsigned int maxStringLen)> BG_GetWeaponNameComplete{0, 0x140165580};
WEAK symbol<void(int localClientNum, const char* text)> Cbuf_AddText{0x140342EB0, 0x1404033B0}; // H1(1.4)
WEAK symbol<void(const char* message)> Conbuf_AppendText{0x1403E3300, 0x140513FF0}; // H1(1.4)
WEAK symbol<void(int localClientNum, int controllerIndex, const char* text)> Cmd_ExecuteSingleCommand{0x140343980, 0x140343980}; // H1SP64[CODEX]
WEAK symbol<void(const char* cmdName, void(), cmd_function_s* allocedCmd)> Cmd_AddCommandInternal{0x1403433E0, 0x140403950}; // H1(1.4)
WEAK symbol<void(const char* text_in)> Cmd_TokenizeString{0x140344110, 0x1404046F0}; // H1(1.4)
WEAK symbol<void()> Cmd_EndTokenizeString{0x140343630, 0x140403C20}; // H1(1.4)
WEAK symbol<void()> Com_Frame_Try_Block_Function{0, 0x1400D8310}; //H1MP MWR TEST
WEAK symbol<CodPlayMode()> Com_GetCurrentCoDPlayMode{0, 0x1405039A0}; // H1(1.4)
WEAK symbol<void(float, float, int)> Com_SetSlowMotion{0, 0x1400DB790}; // H1(1.4)
WEAK symbol<void(unsigned int weapon, bool isAlternate, char* output, unsigned int maxStringLen)> BG_GetWeaponNameComplete{ 0, 0x140165580 };
WEAK symbol<void(errorParm code, const char* message, ...)> Com_Error{0x1403509C0, 0x1400D78A0}; // H1(1.4)
WEAK symbol<void()> Com_Quit_f{0x140352BE0, 0x1400DA830}; // H1(1.4)
WEAK symbol<const char* (int, int, int)> Key_KeynumToString{0x140187CC0, 0x14024FE10}; // H1(1.4)
WEAK symbol<void(const char* text_in)> Cmd_TokenizeString{ 0x140344110, 0x1404046F0 }; // H1(1.4)
WEAK symbol<void(const char* dvar, const char* buffer)> Dvar_SetCommand{ 0x1403C72B0, 0x1404FD0A0 }; // H1(1.4)
WEAK symbol<void(errorParm code, const char* message, ...)> Com_Error{ 0x1403509C0, 0x1400D78A0 }; // H1(1.4)
WEAK symbol<void(int localClientNum, const char* message)> CG_GameMessage{0x1401389A0, 0x140220CC0}; // H1(1.4)
WEAK symbol<void(int localClientNum, const char* message)> CG_GameMessageBold{0x140138750, 0x140220620}; // H1(1.4)
WEAK symbol<void(const char* message)> Conbuf_AppendText{ 0x1403E3300, 0x140513FF0 }; // H1(1.4)
WEAK symbol<void()> Cmd_EndTokenizeString{ 0x140343630, 0x140403C20 }; // H1(1.4)
WEAK symbol<void(const char* dvar, const char* buffer)> Dvar_SetCommand{0x1403C72B0, 0x1404FD0A0}; // H1(1.4)
WEAK symbol<dvar_t* (const char* name)> Dvar_FindVar{0x1403C5D50, 0x1404FBB00}; // H1(1.4)
WEAK symbol<void(char* buffer, int index)> Dvar_GetCombinedString{0x140354DF0, 0x14041D830}; // H1(1.4)
//WEAK symbol<const char* (const dvar_t* dvar, dvar_value value, __int64 a3)> Dvar_ValueToString{0x1403C8560,0x1404FE660}; // H1(1.4); different typedef from previous titles
@ -51,15 +44,11 @@ namespace game
WEAK symbol<dvar_t* (const char* dvarName, const char** valueList, int defaultIndex, unsigned int flags)> Dvar_RegisterEnum{0x1403C4AC0, 0x1404C0EC0}; // H1(1.4)
WEAK symbol<float(int index)> Scr_GetFloat{0x140374D20, 0x140442D10}; // H1(1.4)
WEAK symbol<int()> Scr_GetNumParam{0x140374F30, 0x140442E70}; // H1(1.4)
WEAK symbol<long long(const char* qpath, char** buffer)> FS_ReadFile{0x1403B9020, 0x1404EE720}; // H1(1.4)
WEAK symbol<void(void* buffer)> FS_FreeFile{0x1403B9010, 0x1404EE710}; // H1(1.4)
WEAK symbol<void(const char* gameName)> FS_Startup{0x1403B85D0, 0x1404EDD30}; // H1(1.4)
WEAK symbol<void(const char* path, const char* dir)> FS_AddLocalizedGameDirectory{0x1403B6030, 0x1404EBE20}; // H1(1.4)
WEAK symbol<int(const char* fname)> generateHashValue{0x1400FE8A0, 0x1401B1010}; // H1(1.4)
@ -71,19 +60,13 @@ namespace game
WEAK symbol<bool()> Sys_IsDatabaseReady2{0, 0x14042B090}; // H1(1.4)
WEAK symbol<void(netadr_s* from)> SV_DirectConnect{0, 0x140480860}; // H1(1.4)
WEAK symbol<void(const char* text_in)> SV_Cmd_TokenizeString{0x1402EF050, 0x140404D20}; // H1(1.4)
WEAK symbol<void()> SV_Cmd_EndTokenizedString{0x140344700, 0x140404CE0}; // H1(1.4)
WEAK symbol<bool(int, void const*, const netadr_s*)> Sys_SendPacket{0x1403E2820, 0x1405133B0}; // H1(1.4)
WEAK symbol<void(netadr_s*, sockaddr*)> NetadrToSockadr{0x1403C11C0, 0x1404F62F0}; // H1(1.4)
WEAK symbol<void(netsrc_t, netadr_s*, const char*)> NET_OutOfBandPrint{0x140357560, 0x1404255D0}; // H1(1.4)
WEAK symbol<SOCKET> query_socket{ 0, 0x14DDFBF98 }; // H1(1.4)
WEAK symbol<void(netsrc_t sock, int length, const void* data, const netadr_s* to)> NET_SendLoopPacket{0, 0x140425790}; // H1(1.4)
WEAK symbol<char* (char* string)> I_CleanStr{0x1403CD230, 0}; // H1(1.4)
@ -116,6 +99,7 @@ namespace game
WEAK symbol<int> keyCatchers{0x14243DAF0,0x142D0BA9C}; // H1(1.4)
WEAK symbol<PlayerKeyState> playerKeys{0x1422A873C,0x142C19AFC}; // H1(1.4)
WEAK symbol<CmdArgs> cmd_args{0x14AD99960, 0x14946B970}; // H1(1.4)
WEAK symbol<SOCKET> query_socket{0, 0x14DDFBF98}; // H1(1.4)
//###########################################################################################################################################################################
//###########################################################################################################################################################################
@ -129,7 +113,6 @@ namespace game
WEAK symbol<void(int type, VariableUnion u)> RemoveRefToValue{0, 0x1405C29B0};
WEAK symbol<void(unsigned int id)> RemoveRefToObject{0,0x1405C28A0};
WEAK symbol<void(XAssetType type, void(__cdecl* func)(game::XAssetHeader, void*), const void* inData, bool includeOverride)>
DB_EnumXAssets_Internal{0, 0x1404129F0};
WEAK symbol<const char* (const XAsset* asset)> DB_GetXAssetName{0,0x1403E4090};
@ -206,8 +189,8 @@ namespace game
WEAK symbol<bool(const char* path)> Sys_FileExists{0x1403E0CE0, 0x1405115E0}; // H1(1.4)
// Variables
WEAK symbol<CmdArgs> sv_cmd_args{ 0, 0x14946BA20 }; // H1(1.4)
WEAK symbol<CmdArgs> sv_cmd_args{0, 0x14946BA20}; // H1(1.4)
WEAK symbol<const char*> command_whitelist{0x141079A60, 0x14120C360}; // H1(1.4)

View File

@ -14,7 +14,6 @@ DECLSPEC_NORETURN void WINAPI exit_hook(const int code)
exit(code);
}
BOOL WINAPI system_parameters_info_a(const UINT uiAction, const UINT uiParam, const PVOID pvParam, const UINT fWinIni)
{
component_loader::post_unpack();