Patch some things

This commit is contained in:
quaK 2021-02-25 07:42:53 +02:00
parent bdc26f6dce
commit 15983947f1
5 changed files with 45 additions and 2 deletions

View File

@ -82,6 +82,17 @@ namespace fastfiles
}, 0, false);
});
command::add("rawfilelist", [](const command::params& params)
{
game::DB_EnumXAssets_FastFile(game::ASSET_TYPE_RAWFILE, [](const game::XAssetHeader header, void*)
{
if (header.rawfile && header.rawfile->name)
{
printf("%s\n", header.rawfile->name);
}
}, 0, false);
});
command::add("g_poolSizes", []()
{
for (auto i = 0; i < game::ASSET_TYPE_COUNT; i++)

View File

@ -12,6 +12,8 @@
#include <utils/string.hpp>
#include <utils/hook.hpp>
#include "version.hpp"
namespace patches
{
namespace
@ -265,6 +267,12 @@ namespace patches
// disable codPointStore
dvars::override::Dvar_RegisterInt("codPointStore_enabled", 0, 0, 0, game::DVAR_FLAG_NONE);
// don't register every replicated dvar as a network dvar
utils::hook::nop(0x1403534BE, 5); // dvar_foreach
// patch "Server is different version" to show the server client version
utils::hook::inject(0x1404398B2, VERSION);
}
static void patch_sp()

View File

@ -66,6 +66,15 @@ namespace renderer
r_init_draw_method_hook.create(SELECT_VALUE(0x14046C150, 0x140588B00), &r_init_draw_method_stub);
r_update_front_end_dvar_options_hook.create(SELECT_VALUE(0x1404A5330, 0x1405C3AE0), &r_update_front_end_dvar_options_stub);
// use "saved" flags for "r_normalMap"
utils::hook::set<uint8_t>(SELECT_VALUE(0x14047E0B8, 0x14059AD71), game::DVAR_FLAG_SAVED);
// use "saved" flags for "r_specularMap"
utils::hook::set<uint8_t>(SELECT_VALUE(0x14047E0DA, 0x14059AD99), game::DVAR_FLAG_SAVED);
// use "saved" flags for "r_specOccMap"
utils::hook::set<uint8_t>(SELECT_VALUE(0x14047E0FC, 0x14059ADC1), game::DVAR_FLAG_SAVED);
}
};
}

View File

@ -100,8 +100,8 @@ namespace server_list
return count > 15 ? 15 : count;
}
const char* ui_feeder_item_text(int /*localClientNum*/, void* /*a2*/, void* /*a3*/, const size_t index,
const size_t column)
const char* ui_feeder_item_text(int /*localClientNum*/, void* /*a2*/, void* /*a3*/, const int index,
const int column)
{
std::lock_guard<std::mutex> _(mutex);

View File

@ -981,12 +981,27 @@ namespace game
const char* buffer;
};
struct StringTableCell
{
const char* string;
int hash;
};
struct StringTable
{
const char* name;
int columnCount;
int rowCount;
StringTableCell* values;
};
union XAssetHeader
{
void* data;
Material* material;
Font_s* font;
RawFile* rawfile;
StringTable* stringTable;
};
enum TestClientType