mirror of
https://github.com/XLabsProject/s1x-client.git
synced 2023-08-02 15:02:12 +02:00
commit
228b739ac8
2
deps/WinToast
vendored
2
deps/WinToast
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 5e441fd03543b999edb663caf8df7be37c0d575c
|
Subproject commit 717e6638059d4fdc2bc8ba5a1ce655c93b22738d
|
2
deps/gsc-tool
vendored
2
deps/gsc-tool
vendored
@ -1 +1 @@
|
|||||||
Subproject commit f6ae955f34fbe8cfefa8e9d8112c5c4a993c19bb
|
Subproject commit 04c0e0fce0194902f7f13536ab13e4b50cc048de
|
2
deps/libtomcrypt
vendored
2
deps/libtomcrypt
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 29986d04f2dca985ee64fbca1c7431ea3e3422f4
|
Subproject commit fae62af0ab16f469c2512ec04575dd60ca018657
|
2
deps/libtommath
vendored
2
deps/libtommath
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 03de03dee753442d4b23166982514639c4ccbc39
|
Subproject commit 0df542cb70f621bbeec207be1949832fb1442479
|
2
deps/lua
vendored
2
deps/lua
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 7ca8105a2ea7b6a0d7b55b59d273ccd271c35268
|
Subproject commit e15f1f2bb7a38a3c94519294d031e48508d65006
|
6
deps/premake/wintoast.lua
vendored
6
deps/premake/wintoast.lua
vendored
@ -9,7 +9,7 @@ end
|
|||||||
|
|
||||||
function wintoast.includes()
|
function wintoast.includes()
|
||||||
includedirs {
|
includedirs {
|
||||||
path.join(wintoast.source, "src"),
|
path.join(wintoast.source, "include"),
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -21,8 +21,8 @@ function wintoast.project()
|
|||||||
rapidjson.import();
|
rapidjson.import();
|
||||||
|
|
||||||
files {
|
files {
|
||||||
path.join(wintoast.source, "src/*.h"),
|
path.join(wintoast.source, "include/wintoastlib.h"),
|
||||||
path.join(wintoast.source, "src/*.cpp"),
|
path.join(wintoast.source, "src/wintoastlib.cpp"),
|
||||||
}
|
}
|
||||||
|
|
||||||
warnings "Off"
|
warnings "Off"
|
||||||
|
2
deps/rapidjson
vendored
2
deps/rapidjson
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 012be8528783cdbf4b7a9e64f78bd8f056b97e24
|
Subproject commit 949c771b03de448bdedea80c44a4a5f65284bfeb
|
2
deps/zlib
vendored
2
deps/zlib
vendored
@ -1 +1 @@
|
|||||||
Subproject commit eb0e038b297f2c9877ed8b3515c6718a4b65d485
|
Subproject commit b8a8373ec195c8d286fe7e81e78b4a6d31bd859f
|
@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
#include "command.hpp"
|
#include "command.hpp"
|
||||||
#include "console.hpp"
|
#include "console.hpp"
|
||||||
#include "network.hpp"
|
|
||||||
#include "scheduler.hpp"
|
#include "scheduler.hpp"
|
||||||
#include "filesystem.hpp"
|
#include "filesystem.hpp"
|
||||||
#include "fastfiles.hpp"
|
#include "fastfiles.hpp"
|
||||||
@ -192,20 +191,6 @@ namespace patches
|
|||||||
|
|
||||||
cmd_lui_notify_server_hook.invoke<void>(ent);
|
cmd_lui_notify_server_hook.invoke<void>(ent);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sv_execute_client_message_stub(game::mp::client_t* client, game::msg_t* msg)
|
|
||||||
{
|
|
||||||
if (client->reliableAcknowledge < 0)
|
|
||||||
{
|
|
||||||
client->reliableAcknowledge = client->reliableSequence;
|
|
||||||
console::info("Negative reliableAcknowledge from %s - cl->reliableSequence is %i, reliableAcknowledge is %i\n",
|
|
||||||
client->name, client->reliableSequence, client->reliableAcknowledge);
|
|
||||||
network::send(client->header.remoteAddress, "error", "EXE_LOSTRELIABLECOMMANDS", '\n');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
reinterpret_cast<void(*)(game::mp::client_t*, game::msg_t*)>(0x14043AA90)(client, msg);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class component final : public component_interface
|
class component final : public component_interface
|
||||||
@ -335,9 +320,6 @@ namespace patches
|
|||||||
|
|
||||||
// Prevent clients from ending the game as non host by sending 'end_game' lui notification
|
// Prevent clients from ending the game as non host by sending 'end_game' lui notification
|
||||||
cmd_lui_notify_server_hook.create(0x1402E9390, cmd_lui_notify_server_stub);
|
cmd_lui_notify_server_hook.create(0x1402E9390, cmd_lui_notify_server_stub);
|
||||||
|
|
||||||
// Prevent clients from sending invalid reliableAcknowledge
|
|
||||||
utils::hook::call(0x140443051, sv_execute_client_message_stub);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void patch_sp()
|
static void patch_sp()
|
||||||
|
@ -40,6 +40,19 @@ namespace security
|
|||||||
a.popad64();
|
a.popad64();
|
||||||
a.jmp(0x14044DE51);
|
a.jmp(0x14044DE51);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void sv_execute_client_message_stub(game::mp::client_t* client, game::msg_t* msg)
|
||||||
|
{
|
||||||
|
if ((client->reliableSequence - client->reliableAcknowledge) < 0)
|
||||||
|
{
|
||||||
|
client->reliableAcknowledge = client->reliableSequence;
|
||||||
|
console::info("Negative reliableAcknowledge from %s - cl->reliableSequence is %i, reliableAcknowledge is %i\n",
|
||||||
|
client->name, client->reliableSequence, client->reliableAcknowledge);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
utils::hook::invoke<void>(0x14043AA90, client, msg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class component final : public component_interface
|
class component final : public component_interface
|
||||||
@ -54,6 +67,9 @@ namespace security
|
|||||||
|
|
||||||
// Patch entity overflow
|
// Patch entity overflow
|
||||||
utils::hook::jump(0x14044DE3A, assemble(remap_cached_entities_stub), true);
|
utils::hook::jump(0x14044DE3A, assemble(remap_cached_entities_stub), true);
|
||||||
|
|
||||||
|
// It is possible to make the server hang if left unchecked
|
||||||
|
utils::hook::call(0x140443051, sv_execute_client_message_stub);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ namespace game
|
|||||||
WEAK symbol<XAssetHeader(XAssetType type, const char *name, int allowCreateDefault)> DB_FindXAssetHeader{0x14017DCA0, 0x14026F0F0};
|
WEAK symbol<XAssetHeader(XAssetType type, const char *name, int allowCreateDefault)> DB_FindXAssetHeader{0x14017DCA0, 0x14026F0F0};
|
||||||
WEAK symbol<const char*(const XAsset* asset)> DB_GetXAssetName{0x140151C00, 0x140240DD0};
|
WEAK symbol<const char*(const XAsset* asset)> DB_GetXAssetName{0x140151C00, 0x140240DD0};
|
||||||
WEAK symbol<int(XAssetType type)> DB_GetXAssetTypeSize{0x140151C20, 0x140240DF0};
|
WEAK symbol<int(XAssetType type)> DB_GetXAssetTypeSize{0x140151C20, 0x140240DF0};
|
||||||
WEAK symbol<void(XZoneInfo* zoneInfo, unsigned int zoneCount, DBSyncMode syncMode)> DB_LoadXAssets{0x1402F8B50, 0x140270F30};
|
WEAK symbol<void(XZoneInfo* zoneInfo, unsigned int zoneCount, DBSyncMode syncMode)> DB_LoadXAssets{0x14017FB20, 0x140270F30};
|
||||||
WEAK symbol<int(XAssetType type, const char* name)> DB_XAssetExists{0x140182190, 0x1402750F0};
|
WEAK symbol<int(XAssetType type, const char* name)> DB_XAssetExists{0x140182190, 0x1402750F0};
|
||||||
WEAK symbol<int(XAssetType type, const char* name)> DB_IsXAssetDefault{0x14017EEF0, 0x140270320};
|
WEAK symbol<int(XAssetType type, const char* name)> DB_IsXAssetDefault{0x14017EEF0, 0x140270320};
|
||||||
WEAK symbol<int(const RawFile* rawfile)> DB_GetRawFileLen{0x14017E890, 0x14026FCC0};
|
WEAK symbol<int(const RawFile* rawfile)> DB_GetRawFileLen{0x14017E890, 0x14026FCC0};
|
||||||
|
@ -41,20 +41,20 @@ namespace utils
|
|||||||
{
|
{
|
||||||
const auto& key = key_values[i];
|
const auto& key = key_values[i];
|
||||||
const auto& value = key_values[i + 1];
|
const auto& value = key_values[i + 1];
|
||||||
this->key_value_pairs_[key] = value;
|
|
||||||
|
if (!this->key_value_pairs_.contains(key))
|
||||||
|
{
|
||||||
|
this->key_value_pairs_[key] = value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string info_string::build() const
|
std::string info_string::build() const
|
||||||
{
|
{
|
||||||
//auto first = true;
|
|
||||||
std::string info_string;
|
std::string info_string;
|
||||||
for (const auto& [key, val] : this->key_value_pairs_)
|
for (const auto& [key, val] : this->key_value_pairs_)
|
||||||
{
|
{
|
||||||
//if (first) first = false;
|
|
||||||
/*else*/
|
|
||||||
info_string.append("\\");
|
info_string.append("\\");
|
||||||
|
|
||||||
info_string.append(key);
|
info_string.append(key);
|
||||||
info_string.append("\\");
|
info_string.append("\\");
|
||||||
info_string.append(val);
|
info_string.append(val);
|
||||||
|
Loading…
Reference in New Issue
Block a user