[ServerCommands] Old code removed.

This commit is contained in:
RektInator 2017-06-01 14:30:56 +02:00
parent e64e9bffd6
commit a6abc8fe72
2 changed files with 0 additions and 47 deletions

View File

@ -3,7 +3,6 @@
namespace Components
{
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)
{
@ -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()
{
// Server command receive hook
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()

View File

@ -12,12 +12,8 @@ namespace Components
private:
static std::unordered_map<std::int32_t, std::function<bool(Command::Params*)>> Commands;
static std::uint32_t LastServerCommand;
static bool OnServerCommand();
static void OnServerCommandStub();
static void OnServerCommandPreFailStub();
static void OnServerCommandFailPrint(int type, const char * trash, ...);
static void OnServerCommandFailPrintStub();
};
}