fixed connless packets sending

This commit is contained in:
heinrich5991 2012-10-09 17:01:14 +02:00 committed by oy
parent 4e7137ad48
commit ad070fe277
2 changed files with 7 additions and 4 deletions

View file

@ -105,8 +105,8 @@ void CNetBase::SendPacketConnless(NETSOCKET Socket, const NETADDR *pAddr, TOKEN
aBuffer[10] = (ResponseToken>>8)&0xff;
aBuffer[11] = (ResponseToken)&0xff;
mem_copy(&aBuffer[15], pData, DataSize);
net_udp_send(Socket, pAddr, aBuffer, 15+DataSize);
mem_copy(&aBuffer[NET_PACKETHEADERSIZE_CONNLESS], pData, DataSize);
net_udp_send(Socket, pAddr, aBuffer, NET_PACKETHEADERSIZE_CONNLESS+DataSize);
}
void CNetBase::SendPacket(NETSOCKET Socket, const NETADDR *pAddr, CNetPacketConstruct *pPacket)

View file

@ -155,11 +155,11 @@ int CNetServer::Recv(CNetChunk *pChunk, TOKEN *pResponseToken)
}
int Accept = m_TokenManager.ProcessMessage(&Addr, &m_RecvUnpacker.m_Data, true);
if(!Accept)
continue;
if(m_RecvUnpacker.m_Data.m_Flags&NET_PACKETFLAG_CONTROL)
{
if(!Accept)
continue;
if(m_RecvUnpacker.m_Data.m_aChunkData[0] == NET_CTRLMSG_CONNECT)
{
bool Found = false;
@ -229,6 +229,9 @@ int CNetServer::Recv(CNetChunk *pChunk, TOKEN *pResponseToken)
}
else
{
if(!Accept)
continue;
// TODO: check size here
if(m_RecvUnpacker.m_Data.m_Flags&NET_PACKETFLAG_CONTROL && m_RecvUnpacker.m_Data.m_aChunkData[0] == NET_CTRLMSG_CONNECT)
{