[ServerCommands] Old code removed.
This commit is contained in:
parent
e64e9bffd6
commit
a6abc8fe72
@ -3,7 +3,6 @@
|
|||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
std::unordered_map<std::int32_t, std::function<bool(Command::Params*)>> ServerCommands::Commands;
|
std::unordered_map<std::int32_t, std::function<bool(Command::Params*)>> ServerCommands::Commands;
|
||||||
std::uint32_t ServerCommands::LastServerCommand;
|
|
||||||
|
|
||||||
void ServerCommands::OnCommand(std::int32_t cmd, std::function<bool(Command::Params*)> cb)
|
void ServerCommands::OnCommand(std::int32_t cmd, std::function<bool(Command::Params*)> cb)
|
||||||
{
|
{
|
||||||
@ -61,52 +60,10 @@ namespace Components
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
__declspec(naked) void ServerCommands::OnServerCommandPreFailStub()
|
|
||||||
{
|
|
||||||
__asm
|
|
||||||
{
|
|
||||||
mov ServerCommands::LastServerCommand, ecx
|
|
||||||
cmp ecx, 79h
|
|
||||||
|
|
||||||
jl above
|
|
||||||
|
|
||||||
push 59449Fh
|
|
||||||
retn
|
|
||||||
|
|
||||||
above:
|
|
||||||
push 593C28h
|
|
||||||
retn
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerCommands::OnServerCommandFailPrint(int type, const char *, ...)
|
|
||||||
{
|
|
||||||
Command::ClientParams params(*Game::cmd_id);
|
|
||||||
Game::Com_Printf(type, "Unknown client game command: %i %s\n", LastServerCommand, params.join(1));
|
|
||||||
}
|
|
||||||
|
|
||||||
__declspec(naked) void ServerCommands::OnServerCommandFailPrintStub()
|
|
||||||
{
|
|
||||||
__asm
|
|
||||||
{
|
|
||||||
pushad
|
|
||||||
call ServerCommands::OnServerCommandFailPrint
|
|
||||||
popad
|
|
||||||
|
|
||||||
push 5944C0h
|
|
||||||
retn
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ServerCommands::ServerCommands()
|
ServerCommands::ServerCommands()
|
||||||
{
|
{
|
||||||
// Server command receive hook
|
// Server command receive hook
|
||||||
Utils::Hook(0x59449F, ServerCommands::OnServerCommandStub).install()->quick();
|
Utils::Hook(0x59449F, ServerCommands::OnServerCommandStub).install()->quick();
|
||||||
|
|
||||||
// Server command fail hooks
|
|
||||||
// Utils::Hook(0x593C1F, ServerCommands::OnServerCommandPreFailStub).install()->quick();
|
|
||||||
// Utils::Hook(0x5944BB, ServerCommands::OnServerCommandFailPrintStub).install()->quick();
|
|
||||||
// Utils::Hook::Set<std::uint8_t>(0x5944D3, 0xEB);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ServerCommands::~ServerCommands()
|
ServerCommands::~ServerCommands()
|
||||||
|
@ -12,12 +12,8 @@ namespace Components
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static std::unordered_map<std::int32_t, std::function<bool(Command::Params*)>> Commands;
|
static std::unordered_map<std::int32_t, std::function<bool(Command::Params*)>> Commands;
|
||||||
static std::uint32_t LastServerCommand;
|
|
||||||
|
|
||||||
static bool OnServerCommand();
|
static bool OnServerCommand();
|
||||||
static void OnServerCommandStub();
|
static void OnServerCommandStub();
|
||||||
static void OnServerCommandPreFailStub();
|
|
||||||
static void OnServerCommandFailPrint(int type, const char * trash, ...);
|
|
||||||
static void OnServerCommandFailPrintStub();
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user