Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
42 lines
1.5 KiB
C++
42 lines
1.5 KiB
C++
#include "stdafx.h"
|
|
#include "../ClientSocket.h"
|
|
#include "SendPacket.h"
|
|
#include <Network/ClientNetwork/ClientEventHandler.h>
|
|
#include <Network/ClientNetwork/NetworkMsgBlock.h>
|
|
#include "GMMemory.h"
|
|
|
|
bool SendPacket::SendPacket(ClientNet::CClientEventHandler* lpHandler,
|
|
ClientNet::CNetworkMsgBlock* lpNetworkMsgBlock,
|
|
unsigned short Len_In, unsigned char Cmd_In,
|
|
unsigned short State_In, unsigned short Error_In)
|
|
{
|
|
if (0 != lpNetworkMsgBlock &&
|
|
lpNetworkMsgBlock->WrapCrypt(Len_In, Cmd_In, State_In, Error_In) &&
|
|
!ClientSocket::IsNSFlagChainChecked(Cmd_In))
|
|
{
|
|
ClientSocket::SetNSFlagOn( Cmd_In );
|
|
lpHandler->SendPacket(lpNetworkMsgBlock);
|
|
return true;
|
|
}
|
|
|
|
ClientNet::CNetworkMsgPool::GetInstance().FreeNetworkMsgBlock(lpNetworkMsgBlock);
|
|
return false;
|
|
}
|
|
|
|
bool SendPacket::SendPacket(ClientNet::CClientEventHandler* lpHandler,
|
|
ClientNet::CNetworkMsgBlock* lpNetworkMsgBlock,
|
|
unsigned short Len_In, unsigned char Cmd_In, unsigned long Tick_In)
|
|
{
|
|
if (0 != lpNetworkMsgBlock &&
|
|
lpNetworkMsgBlock->WrapCrypt(Len_In, Cmd_In, Tick_In) &&
|
|
!ClientSocket::IsNSFlagChainChecked(Cmd_In))
|
|
{
|
|
ClientSocket::SetNSFlagOn( Cmd_In );
|
|
lpHandler->SendPacket(lpNetworkMsgBlock);
|
|
return true;
|
|
}
|
|
|
|
ClientNet::CNetworkMsgPool::GetInstance().FreeNetworkMsgBlock(lpNetworkMsgBlock);
|
|
return false;
|
|
}
|