LosaDev source snapshot 2019
This commit is contained in:
commit
c198676e97
20588 files changed
+8812878
No files matched your search
@@ -0,0 +1,52 @@
|
||||
#pragma once
|
||||
|
||||
#include "cHeader.h"
|
||||
#include "cEncrypt.h"
|
||||
|
||||
|
||||
// network packet
|
||||
class cPacket : public cEncrypt
|
||||
{
|
||||
public:
|
||||
cPacket(const uint32 encoding=0);
|
||||
~cPacket(void);
|
||||
|
||||
public:
|
||||
// ÆÐŶ Á¤º¸
|
||||
uint8* GetBuffer() { return m_buffer; }
|
||||
uint32 GetLength() { return m_length; }
|
||||
|
||||
// ÆÐŶ »ý¼º
|
||||
BOOL Make( const uint16 command,
|
||||
const uint8 *data,
|
||||
const uint16 length,
|
||||
const uint8 sequence = 0 );
|
||||
|
||||
BOOL Pack( const uint16 command,
|
||||
const uint8 *data,
|
||||
const uint16 length,
|
||||
const uint8 sequence = 0 );
|
||||
|
||||
public:
|
||||
BOOL Decode( uint8 *buffer,
|
||||
const uint32 length,
|
||||
const uint8 sequence,
|
||||
uint32& result );
|
||||
|
||||
const uint8* GetOutput() { return m_decompressor; }
|
||||
|
||||
private:
|
||||
void CreateCompressor();
|
||||
void CreateDecompressor();
|
||||
|
||||
private:
|
||||
cHeader m_header;
|
||||
|
||||
uint8 *m_buffer;
|
||||
uint8 *m_compressor, *m_decompressor;
|
||||
uint32 m_length;
|
||||
uint32 m_encoding;
|
||||
|
||||
public:
|
||||
static uint32 m_maxLength;
|
||||
};
|
||||
Reference in new issue
Block a user