Simplify DeployPacketStub
This commit is contained in:
parent
e3904db37c
commit
dea6d5714a
@ -119,7 +119,8 @@ namespace Components
|
|||||||
|
|
||||||
void Network::SendCommand(Game::netsrc_t type, Network::Address target, std::string command, std::string data)
|
void Network::SendCommand(Game::netsrc_t type, Network::Address target, std::string command, std::string data)
|
||||||
{
|
{
|
||||||
// Use space a separator (possible separators are '\n', ' ')
|
// Use space a separator (possible separators are '\n', ' ').
|
||||||
|
// Though, our handler only needs exactly 1 char as separator and doesn't which char it is
|
||||||
std::string packet;
|
std::string packet;
|
||||||
packet.append(command);
|
packet.append(command);
|
||||||
packet.append(" ", 1);
|
packet.append(" ", 1);
|
||||||
@ -182,7 +183,7 @@ namespace Components
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Network::DeployPacket(Game::netadr_t from, Game::msg_t* msg)
|
void Network::DeployPacket(Game::netadr_t* from, Game::msg_t* msg)
|
||||||
{
|
{
|
||||||
if (Network::PacketHandlers.find(Network::SelectedPacket) != Network::PacketHandlers.end())
|
if (Network::PacketHandlers.find(Network::SelectedPacket) != Network::PacketHandlers.end())
|
||||||
{
|
{
|
||||||
@ -211,27 +212,16 @@ namespace Components
|
|||||||
{
|
{
|
||||||
__asm
|
__asm
|
||||||
{
|
{
|
||||||
push ebp //C54
|
lea eax, [esp + 0C54h]
|
||||||
// esp = C54h?
|
push ebp // Command
|
||||||
mov eax, [esp + 0C54h + 14h]
|
push eax // Address pointer
|
||||||
push eax
|
|
||||||
mov eax, [esp + 0C58h + 10h]
|
|
||||||
push eax
|
|
||||||
mov eax, [esp + 0C5Ch + 0Ch]
|
|
||||||
push eax
|
|
||||||
mov eax, [esp + 0C60h + 08h]
|
|
||||||
push eax
|
|
||||||
mov eax, [esp + 0C64h + 04h]
|
|
||||||
push eax
|
|
||||||
call Network::DeployPacket
|
call Network::DeployPacket
|
||||||
add esp, 14h
|
add esp, 8h
|
||||||
add esp, 4h
|
|
||||||
mov al, 1
|
mov al, 1
|
||||||
//C50
|
pop edi
|
||||||
pop edi //C4C
|
pop esi
|
||||||
pop esi //C48
|
pop ebp
|
||||||
pop ebp //C44
|
pop ebx
|
||||||
pop ebx //C40
|
|
||||||
add esp, 0C40h
|
add esp, 0C40h
|
||||||
retn
|
retn
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ namespace Components
|
|||||||
static std::string SelectedPacket;
|
static std::string SelectedPacket;
|
||||||
static std::map<std::string, Callback> PacketHandlers;
|
static std::map<std::string, Callback> PacketHandlers;
|
||||||
static int PacketInterceptionHandler(const char* packet);
|
static int PacketInterceptionHandler(const char* packet);
|
||||||
static void DeployPacket(Game::netadr_t from, Game::msg_t* msg);
|
static void DeployPacket(Game::netadr_t* from, Game::msg_t* msg);
|
||||||
static void DeployPacketStub();
|
static void DeployPacketStub();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user