Restructure repository to include all source folders
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>
This commit is contained in:
136
Server/NFAuthTool/NFAuthServer/NaveNet/NFPacket.h
Normal file
136
Server/NFAuthTool/NFAuthServer/NaveNet/NFPacket.h
Normal file
@@ -0,0 +1,136 @@
|
||||
/**
|
||||
* @file NFPacket.h
|
||||
* @brief <09><>Ŷ Ŭ<><C5AC><EFBFBD><EFBFBD>
|
||||
* @remarks
|
||||
* @author <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(edith2580@gmail.com)
|
||||
* @date 2009-04-02
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef _WIN32
|
||||
#pragma pack( push ,1 )
|
||||
#else
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
|
||||
namespace NaveNet {
|
||||
|
||||
#define DEF_BUFSIZE 1024 /// Mem Pool and Socket Buffer size
|
||||
#define DEF_PACKETSIZE 1016 /// Packet Size
|
||||
#define DEF_MAXPACKETSIZE 1024 /// Max Packet Size ( Header + Packet )
|
||||
|
||||
#define CONNECT_CHECK_DATA "NAV" /// CheckSum <20><>Ŷ (ó<><C3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Server<65><72> Connect <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ȴ<DEB5>)
|
||||
#define CONNECT_CHECK_SIZE 4 /// <20>ʱ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ** WARINING **
|
||||
|
||||
/// <20><>Ŷ <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ü
|
||||
typedef struct PACKETHEADER
|
||||
{
|
||||
USHORT Size; /// <20><><EFBFBD><EFBFBD> <20><>Ŷ ũ<><C5A9>
|
||||
USHORT Command; /// <20><>Ŷ<EFBFBD><C5B6> <20><><EFBFBD><EFBFBD>
|
||||
DWORD CheckSum; /// üũ<C3BC><C5A9>
|
||||
}*LPPACKETHEADER;
|
||||
|
||||
#define HEADERSIZE 8 /// <20><>Ŷ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
/**
|
||||
* @class NFPacket
|
||||
* @brief <20>Ѱ<EFBFBD><D1B0><EFBFBD> <20><>Ŷ<EFBFBD><C5B6> <20><><EFBFBD><EFBFBD> <20>ϱ<EFBFBD> <20><><EFBFBD><EFBFBD> Ŭ<><C5AC><EFBFBD><EFBFBD> <20><>ü
|
||||
* @remarks <20><>Ŷ<EFBFBD><C5B6> <20><><EFBFBD><EFBFBD> \r\n
|
||||
\r\n
|
||||
Header( Size, Command) + CheckSum + Data \r\n
|
||||
------------------------------------------------------------0-------------------\r\n
|
||||
| 2byte | 2byte | CheckSum(4Byte) | Header.Size-Header <20><>ŭ<EFBFBD><C5AD> <20><><EFBFBD><EFBFBD> Packet <20>뷮 |\r\n
|
||||
--------------------------------------------------------------00----------------\r\n
|
||||
\r\n
|
||||
<09><>) \r\n
|
||||
#define USER_LOGIN 1 \r\n
|
||||
\r\n
|
||||
typedef struct stLogin \r\n
|
||||
{ \r\n
|
||||
CHAR UserID[16]; \r\n
|
||||
CHAR UserPass[12]; \r\n
|
||||
}LOGIN, *LPLOGIN; \r\n
|
||||
\r\n
|
||||
// Header <20><><EFBFBD><EFBFBD> \r\n
|
||||
Packet.m_Header.Size = sizeof(LOGIN); \r\n
|
||||
Packet.m_Header.Command = USER_LOGIN; \r\n
|
||||
\r\n
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \r\n
|
||||
static LPLOGIN login = (LPLOGIN)Packet.m_Packet; \r\n
|
||||
login->UserID; \r\n
|
||||
login->UserPass; \r\n
|
||||
|
||||
*
|
||||
* @par
|
||||
* @author Edith
|
||||
* @date 2009-04-05
|
||||
*/
|
||||
class NFPacket
|
||||
{
|
||||
public:
|
||||
/// NFPacket <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
NFPacket();
|
||||
/// NFPacket <20>Ҹ<EFBFBD><D2B8><EFBFBD>
|
||||
~NFPacket();
|
||||
|
||||
/// <20><>Ŷ <20>ʱ<EFBFBD>ȭ
|
||||
VOID Init();
|
||||
|
||||
/**
|
||||
* @brief <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Command <20><><EFBFBD><EFBFBD>
|
||||
* @return Command <20><><EFBFBD><EFBFBD>
|
||||
*/
|
||||
inline USHORT GetCommand() const
|
||||
{
|
||||
return m_Header.Command;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Command<6E><64> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
|
||||
* @param shCommand Command <20><>
|
||||
*/
|
||||
inline VOID SetCommand(USHORT shCommand)
|
||||
{
|
||||
m_Header.Command = shCommand;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief <09><>Ŷ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ϱ<EFBFBD>
|
||||
* @return <20><>Ŷ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
*/
|
||||
inline int GetSize()
|
||||
{
|
||||
return m_Header.Size-HEADERSIZE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief <09><>Ŷ<EFBFBD><C5B6> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
|
||||
* @param shDataSize
|
||||
*/
|
||||
inline VOID SetSize(USHORT shDataSize)
|
||||
{
|
||||
// Size = Header + DataSize;
|
||||
m_Header.Size = HEADERSIZE + shDataSize;
|
||||
}
|
||||
|
||||
/// <20><>Ŷ<EFBFBD><C5B6> <20><>ȣȭ<C8A3>Ѵ<EFBFBD>.
|
||||
int EncryptPacket();
|
||||
|
||||
/// <20><>Ŷ<EFBFBD><C5B6> <20><><EFBFBD>ڵ<EFBFBD><DAB5>Ѵ<EFBFBD>.
|
||||
VOID DecryptPacket();
|
||||
|
||||
/// CheckSum <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> üũ<C3BC><C5A9><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>˻<EFBFBD><CBBB>Ѵ<EFBFBD>.
|
||||
BOOL IsAliveChecksum();
|
||||
|
||||
public:
|
||||
/// <20><>Ŷ<EFBFBD><C5B6> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
PACKETHEADER m_Header;
|
||||
|
||||
/// <20><><EFBFBD><EFBFBD> <20><>Ŷ<EFBFBD><C5B6> <20><><EFBFBD><EFBFBD>
|
||||
CHAR m_Packet[DEF_PACKETSIZE];
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#pragma pack()
|
||||
Reference in New Issue
Block a user