Compare commits
2 Commits
master
...
disc-read-
Author | SHA1 | Date | |
---|---|---|---|
25cd907a32 | |||
8acf4fcf8b |
2
deps/GSL
vendored
2
deps/GSL
vendored
Submodule deps/GSL updated: 7e0943d20d...466e4ebaa5
2
deps/asmjit
vendored
2
deps/asmjit
vendored
Submodule deps/asmjit updated: a3199e8857...cecc73f297
2
deps/libtommath
vendored
2
deps/libtommath
vendored
Submodule deps/libtommath updated: 839ae9ea66...e823b0c34c
@@ -117,7 +117,7 @@ namespace demonware
|
||||
{
|
||||
hostent* WINAPI gethostbyname_stub(const char* name)
|
||||
{
|
||||
#ifdef DW_DEBUG
|
||||
#ifdef DEBUG
|
||||
printf("[ network ]: [gethostbyname]: \"%s\"\n", name);
|
||||
#endif
|
||||
|
||||
|
@@ -6,9 +6,9 @@
|
||||
#include "command.hpp"
|
||||
#include "console.hpp"
|
||||
|
||||
#include <utils/concurrency.hpp>
|
||||
#include <utils/hook.hpp>
|
||||
#include <utils/io.hpp>
|
||||
#include <utils/concurrency.hpp>
|
||||
|
||||
namespace fastfiles
|
||||
{
|
||||
@@ -115,7 +115,7 @@ namespace fastfiles
|
||||
char* reallocate_asset_pool()
|
||||
{
|
||||
constexpr auto element_size = get_asset_type_size(Type);
|
||||
static char new_pool[element_size * Size]{0};
|
||||
static char new_pool[element_size * Size] = {0};
|
||||
assert(get_asset_type_size(Type) == game::DB_GetXAssetTypeSize(Type));
|
||||
|
||||
std::memmove(new_pool, game::DB_XAssetPool[Type], game::g_poolSize[Type] * element_size);
|
||||
@@ -167,30 +167,8 @@ namespace fastfiles
|
||||
utils::hook::inject(0x14027463C, xmodel_pool + 8);
|
||||
utils::hook::inject(0x140274689, xmodel_pool + 8);
|
||||
|
||||
// Reallocate asset pools
|
||||
// Disabled because it causes a crash in the main menu once you rejoin a server after
|
||||
// disconnecting and waiting for the server to map rotating.
|
||||
#if 0
|
||||
reallocate_asset_pool<game::ASSET_TYPE_LUA_FILE, 768>();
|
||||
reallocate_asset_pool<game::ASSET_TYPE_WEAPON, 1400>();
|
||||
reallocate_asset_pool<game::ASSET_TYPE_LOCALIZE_ENTRY, 27200>();
|
||||
reallocate_asset_pool<game::ASSET_TYPE_XANIMPARTS, 11600>();
|
||||
reallocate_asset_pool<game::ASSET_TYPE_ATTACHMENT, 256>();
|
||||
reallocate_asset_pool<game::ASSET_TYPE_FONT, 96>();
|
||||
reallocate_asset_pool<game::ASSET_TYPE_SNDDRIVER_GLOBALS, 4>();
|
||||
reallocate_asset_pool<game::ASSET_TYPE_EQUIPMENT_SND_TABLE, 4>();
|
||||
reallocate_asset_pool<game::ASSET_TYPE_SOUND, 32000>();
|
||||
reallocate_asset_pool<game::ASSET_TYPE_LOADED_SOUND, 14000>();
|
||||
reallocate_asset_pool<game::ASSET_TYPE_VERTEXDECL, 3072>();
|
||||
reallocate_asset_pool<game::ASSET_TYPE_COMPUTESHADER, 1024>();
|
||||
reallocate_asset_pool<game::ASSET_TYPE_REVERB_PRESET, 128>();
|
||||
reallocate_asset_pool<game::ASSET_TYPE_IMPACT_FX, 40>();
|
||||
#endif
|
||||
// Fix compressor type on streamed file load
|
||||
db_read_stream_file_hook.create(0x14027AA70, db_read_stream_file_stub);
|
||||
|
||||
// Allow loading of unsigned fastfiles
|
||||
utils::hook::nop(0x1402427A5, 2); // DB_InflateInit
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@@ -189,6 +189,9 @@ namespace mods
|
||||
// Load mod.ff
|
||||
utils::hook::call(0x1405A562A, db_load_x_assets_stub); // R_LoadGraphicsAssets According to myself but I don't remember where I got it from
|
||||
|
||||
// Allow loading of unsigned fastfiles
|
||||
utils::hook::nop(0x1402427A5, 2); // DB_InflateInit
|
||||
|
||||
command::add("loadmod", [](const command::params& params) -> void
|
||||
{
|
||||
if (params.size() != 2)
|
||||
|
@@ -89,7 +89,7 @@ namespace demonware
|
||||
std::memcpy(data.m_dec_key, &out_3[40], 16);
|
||||
std::memcpy(data.m_enc_key, &out_3[56], 16);
|
||||
|
||||
#ifdef DW_DEBUG
|
||||
#ifdef DEBUG
|
||||
printf("[DW] Response id: %s\n", utils::string::dump_hex(std::string(&out_2[8], 8)).data());
|
||||
printf("[DW] Hash verify: %s\n", utils::string::dump_hex(std::string(&out_3[20], 20)).data());
|
||||
printf("[DW] AES dec key: %s\n", utils::string::dump_hex(std::string(&out_3[40], 16)).data());
|
||||
|
@@ -38,7 +38,7 @@ namespace demonware
|
||||
{
|
||||
if (packet.starts_with("POST /auth/"))
|
||||
{
|
||||
#ifdef DW_DEBUG
|
||||
#ifdef DEBUG
|
||||
printf("[DW]: [auth]: user requested authentication.\n");
|
||||
#endif
|
||||
return;
|
||||
@@ -81,7 +81,7 @@ namespace demonware
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DW_DEBUG
|
||||
#ifdef DEBUG
|
||||
printf("[DW]: [auth]: authenticating user %s\n", token.data() + 64);
|
||||
#endif
|
||||
|
||||
@@ -160,7 +160,7 @@ namespace demonware
|
||||
raw_reply reply(result);
|
||||
this->send_reply(&reply);
|
||||
|
||||
#ifdef DW_DEBUG
|
||||
#ifdef DEBUG
|
||||
printf("[DW]: [auth]: user successfully authenticated.\n");
|
||||
#endif
|
||||
}
|
||||
|
@@ -56,7 +56,7 @@ namespace demonware
|
||||
}
|
||||
else if (size == 0xC8)
|
||||
{
|
||||
#ifdef DW_DEBUG
|
||||
#ifdef DEBUG
|
||||
printf("[DW]: [lobby]: received client_header_ack.\n");
|
||||
#endif
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace demonware
|
||||
|
||||
raw_reply reply(packet_2);
|
||||
this->send_reply(&reply);
|
||||
#ifdef DW_DEBUG
|
||||
#ifdef DEBUG
|
||||
printf("[DW]: [lobby]: sending server_header_ack.\n");
|
||||
#endif
|
||||
return;
|
||||
@@ -89,7 +89,7 @@ namespace demonware
|
||||
|
||||
if (type == 0x82)
|
||||
{
|
||||
#ifdef DW_DEBUG
|
||||
#ifdef DEBUG
|
||||
printf("[DW]: [lobby]: received client_auth.\n");
|
||||
#endif
|
||||
std::string packet_3(packet.data(), packet.size() - 8); // this 8 are client hash check?
|
||||
@@ -104,7 +104,7 @@ namespace demonware
|
||||
raw_reply reply(response);
|
||||
this->send_reply(&reply);
|
||||
|
||||
#ifdef DW_DEBUG
|
||||
#ifdef DEBUG
|
||||
printf("[DW]: [lobby]: sending server_auth_done.\n");
|
||||
#endif
|
||||
return;
|
||||
@@ -163,9 +163,8 @@ namespace demonware
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef DW_DEBUG
|
||||
printf("[DW]: [lobby]: missing service '%s'\n", utils::string::va("%d", id));
|
||||
#endif
|
||||
|
||||
// return no error
|
||||
byte_buffer buffer(data);
|
||||
uint8_t task_id;
|
||||
|
@@ -51,7 +51,7 @@ namespace demonware
|
||||
|
||||
if (it != this->tasks_.end())
|
||||
{
|
||||
#ifdef DW_DEBUG
|
||||
#ifdef DEBUG
|
||||
printf("[DW] %s: executing task '%d'\n", name_.data(), this->task_id_);
|
||||
#endif
|
||||
|
||||
|
@@ -75,7 +75,7 @@ namespace demonware
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DW_DEBUG
|
||||
#ifdef DEBUG
|
||||
printf("[DW]: [bdStorage]: missing publisher file: %s\n", name.data());
|
||||
#endif
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace demonware
|
||||
std::string filename;
|
||||
buffer->read_string(&filename);
|
||||
|
||||
#ifdef DW_DEBUG
|
||||
#ifdef DEBUG
|
||||
printf("[DW]: [bdStorage]: loading publisher file: %s\n", filename.data());
|
||||
#endif
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace demonware
|
||||
|
||||
if (this->load_publisher_resource(filename, data))
|
||||
{
|
||||
#ifdef DW_DEBUG
|
||||
#ifdef DEBUG
|
||||
printf("[DW]: [bdStorage]: sending publisher file: %s, size: %lld\n", filename.data(), data.size());
|
||||
#endif
|
||||
|
||||
@@ -185,7 +185,7 @@ namespace demonware
|
||||
buffer->read_uint64(&owner);
|
||||
buffer->read_string(&platform);
|
||||
|
||||
#ifdef DW_DEBUG
|
||||
#ifdef DEBUG
|
||||
printf("[DW]: [bdStorage]: user file: %s, %s, %s\n", game.data(), filename.data(), platform.data());
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user