MCPcopy Create free account
hub / github.com/cuberite/cuberite / SendData

Method SendData

src/Protocol/Protocol17x.cpp:1991–2009  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1989
1990
1991void cProtocol172::SendData(const char * a_Data, size_t a_Size)
1992{
1993 if (m_IsEncrypted)
1994 {
1995 Byte Encrypted[8192]; // Larger buffer, we may be sending lots of data (chunks)
1996 while (a_Size > 0)
1997 {
1998 size_t NumBytes = (a_Size > sizeof(Encrypted)) ? sizeof(Encrypted) : a_Size;
1999 m_Encryptor.ProcessData(Encrypted, (Byte *)a_Data, NumBytes);
2000 m_Client->SendData((const char *)Encrypted, NumBytes);
2001 a_Size -= NumBytes;
2002 a_Data += NumBytes;
2003 }
2004 }
2005 else
2006 {
2007 m_Client->SendData(a_Data, a_Size);
2008 }
2009}
2010
2011
2012

Callers 1

~cPacketizerMethod · 0.45

Calls 1

ProcessDataMethod · 0.80

Tested by

no test coverage detected