Console changes + colors

This commit is contained in:
Federico Cecchetto 2022-05-20 00:05:51 +02:00
parent 139f3c44a0
commit a6b7a11af1
4 changed files with 22 additions and 15 deletions

View File

@ -243,12 +243,6 @@ namespace auth
// kill "disconnected from steam" error // kill "disconnected from steam" error
utils::hook::nop(0x1D61DF_b, 0x11); utils::hook::nop(0x1D61DF_b, 0x11);
/*utils::hook::nop(0x1D6193_b, 103); // STEAM
utils::hook::nop(0x60153_b, 0x60426 - 0x60153); // STEAM
utils::hook::nop(0x603E1_b, 0x60426 - 0x603E1); // STEAM
utils::hook::nop(0x1D7553_b, 0x1D7587 - 0x1D7553); // STEAM MAYBE `1401D7553` ON FIRST
utils::hook::nop(0x1D7A82_b, 0x1D7AC8 - 0x1D7A82); // STEAM*/
utils::hook::jump(0x1CAE70_b, get_direct_connect_stub(), true); utils::hook::jump(0x1CAE70_b, get_direct_connect_stub(), true);
utils::hook::jump(0x12D426_b, get_send_connect_data_stub(), true); utils::hook::jump(0x12D426_b, get_send_connect_data_stub(), true);

View File

@ -147,17 +147,30 @@ namespace colors
if (!game::environment::is_sp()) if (!game::environment::is_sp())
{ {
// allows colored name in-game // allows colored name in-game
utils::hook::jump(0x5AEDF0_b, com_clean_name_stub); // 1.15 utils::hook::jump(0x5AEDF0_b, com_clean_name_stub, true);
// don't apply colors to overhead names // don't apply colors to overhead names
utils::hook::call(0xF7B85_b, get_client_name_stub); // 1.15 utils::hook::jump(0xF7B6A_b, utils::hook::assemble([](utils::hook::assembler& a)
{
a.lea(rax, qword_ptr(rbp, -0x10));
a.mov(dword_ptr(rsp, 0x28), 0xB);
a.mov(r9d, 0x20);
a.mov(qword_ptr(rsp, 0x20), rax);
a.lea(r8, qword_ptr(rbp));
a.pushad64();
a.call_aligned(get_client_name_stub);
a.popad64();
a.jmp(0xF7B8A_b);
}), true);
// patch I_CleanStr // patch I_CleanStr
utils::hook::jump(0x5AF2E0_b, i_clean_str_stub); // 1.15 utils::hook::jump(0x5AF2E0_b, i_clean_str_stub, true);
} }
// force new colors // force new colors
utils::hook::jump(SELECT_VALUE(0x0, 0x6C9460_b), rb_lookup_color_stub); // 1.15 utils::hook::jump(SELECT_VALUE(0x0, 0x6C9460_b), rb_lookup_color_stub, true);
// add colors // add colors
add(0, 0, 0); // 0 - Black add(0, 0, 0); // 0 - Black
@ -179,4 +192,4 @@ namespace colors
}; };
} }
//REGISTER_COMPONENT(colors::component) REGISTER_COMPONENT(colors::component)

View File

@ -6,6 +6,7 @@
#include "command.hpp" #include "command.hpp"
#include <utils/thread.hpp> #include <utils/thread.hpp>
#include <utils/hook.hpp>
namespace game_console namespace game_console
{ {
@ -32,9 +33,8 @@ namespace console
void dispatch_message(const int type, const std::string& message) void dispatch_message(const int type, const std::string& message)
{ {
printf("%s\n", message.data()); printf(message.data());
game_console::print(type, message);
//game_console::print(type, message);
} }
void print(const int type, const char* fmt, ...) void print(const int type, const char* fmt, ...)

View File

@ -18,7 +18,7 @@ namespace fastfiles
void db_try_load_x_file_internal(const char* zone_name, const int flags) void db_try_load_x_file_internal(const char* zone_name, const int flags)
{ {
printf("Loading fastfile %s\n", zone_name); console::info("Loading fastfile %s\n", zone_name);
current_fastfile.access([&](std::string& fastfile) current_fastfile.access([&](std::string& fastfile)
{ {
fastfile = zone_name; fastfile = zone_name;