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:
143
GameTools/GLOBALSCRIPT/Network/Packet/PacketBase.h
Normal file
143
GameTools/GLOBALSCRIPT/Network/Packet/PacketBase.h
Normal file
@@ -0,0 +1,143 @@
|
||||
#ifndef _PACKET_BASE
|
||||
#define _PACKET_BASE
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>۸<EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
//
|
||||
// SS_SMOOTH : <20><>Ȱ<EFBFBD><C8B0> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.
|
||||
// SS_LOADED : <20>ణ<EFBFBD><E0B0A3> <20><><EFBFBD>ϰ<EFBFBD> <20>ֽ<EFBFBD>. (50 % of bufferring)
|
||||
// SS_BUSY : <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ϰ<EFBFBD> <20>ֽ<EFBFBD>. (70 % of bufferring)
|
||||
// SS_VERYBUSY : <20>ؽ<EFBFBD><D8BD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><>Ŷ <20>ս<EFBFBD><D5BD><EFBFBD> <20>ʷ<EFBFBD><CAB7><EFBFBD> <20><> <20>ֽ<EFBFBD>.)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
union ServerInfo
|
||||
{
|
||||
enum ServerState
|
||||
{
|
||||
SS_SMOOTH, SS_LOADED, SS_BUSY, SS_VERYBUSY
|
||||
};
|
||||
|
||||
struct sSrvState
|
||||
{
|
||||
unsigned short wError; // <20><><EFBFBD><EFBFBD> <20>ڵ<EFBFBD>
|
||||
unsigned short wSrvState; // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
};
|
||||
|
||||
sSrvState SrvState;
|
||||
unsigned long dwServerInfo;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// <20>⺻ <20><>Ŷ
|
||||
#pragma pack(1)
|
||||
|
||||
struct PktBase
|
||||
{
|
||||
typedef unsigned char StartType;
|
||||
typedef unsigned char CMDType;
|
||||
typedef unsigned short LengthType;
|
||||
|
||||
protected:
|
||||
StartType m_StartBit;
|
||||
CMDType m_Cmd;
|
||||
LengthType m_Len; // <20><><EFBFBD><EFBFBD> <20><><EFBFBD≯<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>Ŷ <20><><EFBFBD><EFBFBD>
|
||||
|
||||
unsigned long m_CodePage;
|
||||
ServerInfo m_SrvInfo;
|
||||
|
||||
public:
|
||||
|
||||
inline void InitPtHead(unsigned short Len_In, unsigned char Cmd_In,
|
||||
unsigned short State_In, unsigned short Error_In);
|
||||
|
||||
inline void InitPtHead(unsigned short Len_In, unsigned char Cmd_In, unsigned long Tick_In);
|
||||
|
||||
inline unsigned short Error(void) { return m_SrvInfo.SrvState.wError; }
|
||||
inline void SetError(unsigned short Error) { m_SrvInfo.SrvState.wError = Error; }
|
||||
inline unsigned short GetError(void) { return m_SrvInfo.SrvState.wError; }
|
||||
|
||||
inline StartType GetStartBit(void) { return m_StartBit; }
|
||||
|
||||
inline void SetCodePage(unsigned long Code) { m_CodePage = Code; }
|
||||
inline unsigned long GetCodePage(void) { return m_CodePage; }
|
||||
|
||||
inline void SetServerInfo(unsigned long Info) { m_SrvInfo.dwServerInfo = Info; }
|
||||
inline unsigned long GetServerInfo(void) { return m_SrvInfo.dwServerInfo; }
|
||||
|
||||
inline CMDType GetCmd(void) { return m_Cmd; }
|
||||
|
||||
inline bool IsCrypt(void);
|
||||
inline void SetCrypt(void);
|
||||
inline bool IsCompress(void);
|
||||
inline void SetCompress(void);
|
||||
inline LengthType GetUncompressLen(void);
|
||||
|
||||
inline void SetLen(LengthType Len);
|
||||
inline LengthType GetLen(void);
|
||||
};
|
||||
typedef PktBase* LPPktBase;
|
||||
|
||||
#pragma pack()
|
||||
|
||||
|
||||
const unsigned int PktBaseSize = sizeof(PktBase);
|
||||
const PktBase::StartType StartBit = 0xFF; // <20><><EFBFBD><EFBFBD> <20><>Ʈ
|
||||
const PktBase::LengthType Crypt = 0x8000; // <20><>ȣȭ <20><><EFBFBD><EFBFBD> - 1000B
|
||||
const PktBase::LengthType Compress = 0x4000; // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> - 0100B
|
||||
const PktBase::LengthType LengthHdr = 0xC000; // 1100B
|
||||
const PktBase::LengthType LengthMask = 0x3FFF; // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EEB3BB> <20><><EFBFBD><EFBFBD>ũ <20><>. <20><><EFBFBD><EFBFBD> 14<31><34>Ʈ. <20>ִ<EFBFBD> 16383byte.
|
||||
const PktBase::LengthType PktMinLen = sizeof(PktBase);
|
||||
const PktBase::LengthType PktMaxLen = 16383;
|
||||
|
||||
inline bool PktBase::IsCrypt(void) { return ((m_Len & Crypt) == Crypt) ? true : false; }
|
||||
inline void PktBase::SetCrypt(void) { m_Len |= Crypt; }
|
||||
|
||||
inline bool PktBase::IsCompress(void) { return ((m_Len & Compress) == Compress) ? true : false; }
|
||||
inline void PktBase::SetCompress(void) { m_Len |= Compress; }
|
||||
inline PktBase::LengthType PktBase::GetUncompressLen(void) { return PktMaxLen; }
|
||||
|
||||
inline void PktBase::SetLen(PktBase::LengthType Len) { m_Len = (m_Len & LengthHdr) | Len; }
|
||||
inline PktBase::LengthType PktBase::GetLen(void) { return m_Len & LengthMask; }
|
||||
|
||||
|
||||
|
||||
//Interface/////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// <20><>Ŷ <20>ش<EFBFBD> <20>ʱ<EFBFBD>ȭ
|
||||
//
|
||||
// Parameter :
|
||||
// 1st : <20><><EFBFBD><EFBFBD>[In]
|
||||
// 2st : Ŀ<>ǵ<EFBFBD>[In]
|
||||
// 3st : <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>[In]
|
||||
// 4st : <20><><EFBFBD><EFBFBD>[In]
|
||||
//
|
||||
// Return :
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
inline void PktBase::InitPtHead(unsigned short Len_In, unsigned char Cmd_In,
|
||||
unsigned short State_In, unsigned short Error_In)
|
||||
{
|
||||
m_StartBit = StartBit;
|
||||
m_Cmd = Cmd_In;
|
||||
m_Len = Len_In;
|
||||
m_CodePage = 0;
|
||||
m_SrvInfo.SrvState.wSrvState = State_In;
|
||||
m_SrvInfo.SrvState.wError = Error_In;
|
||||
}
|
||||
|
||||
inline void PktBase::InitPtHead(unsigned short Len_In, unsigned char Cmd_In, unsigned long Tick_In)
|
||||
{
|
||||
m_StartBit = StartBit;
|
||||
m_Cmd = Cmd_In;
|
||||
m_Len = Len_In;
|
||||
m_CodePage = 0;
|
||||
m_SrvInfo.dwServerInfo = Tick_In;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user