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:
@@ -0,0 +1,200 @@
|
||||
#ifndef _CHAR_MOVE_PACKET_H_
|
||||
#define _CHAR_MOVE_PACKET_H_
|
||||
|
||||
// CharMovePacket.h
|
||||
#include <winsock2.h>
|
||||
#include <windows.h>
|
||||
#include <Network/Packet/PacketBase.h>
|
||||
#include <DB/DBdefine.h>
|
||||
#include <cmath>
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
class CNetworkPos
|
||||
{
|
||||
private:
|
||||
|
||||
static const float ms_fToRadian;
|
||||
static const float ms_fToAngle;
|
||||
static const float ms_fPositionDetail;
|
||||
static const float ms_fVelocityDetail;
|
||||
|
||||
unsigned short m_usXPos;
|
||||
unsigned short m_usYPos;
|
||||
unsigned short m_usZPos;
|
||||
unsigned char m_cDirection; // <20><><EFBFBD>е<EFBFBD> - 0~180 (1<><31> 2<><32>)
|
||||
unsigned char m_cVelocity; // <20>ӵ<EFBFBD>/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(1<><31><EFBFBD><EFBFBD><EFBFBD>ӿ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>ִ<EFBFBD> <20>ִ<EFBFBD><D6B4>Ÿ<EFBFBD>.)
|
||||
// <20>ӵ<EFBFBD> = <20>ʴ<EFBFBD> <20>̵<EFBFBD><CCB5>Ÿ<EFBFBD> = 1~5<><35><EFBFBD><EFBFBD>.
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> = <20>ִ<EFBFBD> 60<36><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
// <20>ִ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ӵ<EFBFBD>/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> * 1000 = 0 ~ 255
|
||||
// <20>ӵ<EFBFBD>/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> = 0 ~ 0.255<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// TODO : maximum 10meter/sec
|
||||
|
||||
public:
|
||||
|
||||
CNetworkPos() : m_usXPos(0), m_usYPos(0), m_usZPos(0), m_cDirection(0), m_cVelocity(0) { }
|
||||
CNetworkPos(float fXPos, float fYPos, float fZPos, float fDir = 0.0f, float fVel = 0.0f) { Initialize(fXPos, fYPos, fZPos, fDir, fVel); }
|
||||
CNetworkPos(const POS& pos, float fDir = 0.0f, float fVel = 0.0f) { Initialize(pos.fPointX, pos.fPointY, pos.fPointZ, fDir, fVel); }
|
||||
|
||||
void Initialize(float fXPos, float fYPos, float fZPos, float fDir, float fVel);
|
||||
|
||||
float GetXPos() const { return static_cast<float>(m_usXPos) / ms_fPositionDetail; }
|
||||
float GetYPos() const { return static_cast<float>(m_usYPos) / ms_fPositionDetail; }
|
||||
float GetZPos() const { return static_cast<float>(m_usZPos) / ms_fPositionDetail; }
|
||||
|
||||
float GetDirection() const { return static_cast<float>(m_cDirection) * 2 * ms_fToRadian; }
|
||||
float GetVelocity() const { return static_cast<float>(m_cVelocity) / ms_fVelocityDetail; }
|
||||
|
||||
float GetSquaredRange(const CNetworkPos& lhs) const
|
||||
{
|
||||
const float xDiff = GetXPos() - lhs.GetXPos();
|
||||
const float yDiff = GetYPos() - lhs.GetYPos();
|
||||
const float zDiff = GetZPos() - lhs.GetZPos();
|
||||
|
||||
return (xDiff * xDiff) + (yDiff * yDiff) + (zDiff * zDiff);
|
||||
}
|
||||
|
||||
float GetRange(const CNetworkPos& lhs) const { return std::sqrtf(GetSquaredRange(lhs)); }
|
||||
|
||||
inline bool operator == (const CNetworkPos& lhs)
|
||||
{
|
||||
return (m_usXPos == lhs.m_usXPos && m_usYPos == lhs.m_usYPos && m_usZPos == lhs.m_usZPos
|
||||
&& m_cDirection == lhs.m_cDirection && m_cVelocity == lhs.m_cVelocity);
|
||||
}
|
||||
|
||||
inline bool operator != (const CNetworkPos& lhs) { return !(*this == lhs); }
|
||||
};
|
||||
|
||||
inline void CNetworkPos::Initialize(float fXPos, float fYPos, float fZPos, float fDir, float fVel)
|
||||
{
|
||||
float fbuf;
|
||||
fbuf = fXPos * ms_fPositionDetail;
|
||||
m_usXPos = static_cast<unsigned short>(fbuf);
|
||||
fbuf = fYPos * ms_fPositionDetail;
|
||||
m_usYPos = static_cast<unsigned short>(fbuf);
|
||||
fbuf = fZPos * ms_fPositionDetail;
|
||||
m_usZPos = static_cast<unsigned short>(fbuf);
|
||||
|
||||
/*
|
||||
// float<61><74> <20>Ҽ<EFBFBD><D2BC><EFBFBD> <20><><EFBFBD>꿡 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>־<EFBFBD> <20>ݿø<DDBF><C3B8>մϴ<D5B4>.
|
||||
m_usXPos = static_cast<unsigned short>(fXPos * ms_fPositionDetail + 0.5f);
|
||||
m_usYPos = static_cast<unsigned short>(fYPos * ms_fPositionDetail + 0.5f);
|
||||
m_usZPos = static_cast<unsigned short>(fZPos * ms_fPositionDetail + 0.5f);
|
||||
*/
|
||||
|
||||
float fAngle = fDir * ms_fToAngle;
|
||||
while (360 <= fAngle) { fAngle -= 360; }
|
||||
|
||||
m_cDirection = static_cast<unsigned char>(fAngle/2);
|
||||
|
||||
unsigned int nVelocity = static_cast<unsigned int>(fVel * ms_fVelocityDetail);
|
||||
if(255 < nVelocity) { nVelocity = 255; }
|
||||
|
||||
m_cVelocity = static_cast<unsigned char>(nVelocity);
|
||||
}
|
||||
|
||||
|
||||
// ij<><C4B3><EFBFBD><EFBFBD> <20>̵<EFBFBD> <20><>Ŷ Ex (CharMove, TCP)
|
||||
typedef struct PktMVEx* LPPktMVEx;
|
||||
struct PktMVEx : public PktBase
|
||||
{
|
||||
// CID<49><44> PktBase<73><65> dwServerInfo<66><6F> <20><><EFBFBD>´<EFBFBD>.
|
||||
CNetworkPos m_NetworkPos;
|
||||
unsigned char m_cUAct;
|
||||
unsigned char m_cLAct;
|
||||
};
|
||||
|
||||
/*
|
||||
Deplicated
|
||||
|
||||
// ij<><C4B3><EFBFBD><EFBFBD> <20>̵<EFBFBD> <20><>Ŷ (CharMove, UDP)
|
||||
typedef struct PktMV* LPPktMV;
|
||||
struct PktMV : public PktBase
|
||||
{
|
||||
POS m_Position; // ij<><C4B3><EFBFBD><EFBFBD> <20><>ġ
|
||||
float m_fDir; // ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
unsigned long m_dwCharID; // ij<><C4B3><EFBFBD><EFBFBD> ID
|
||||
unsigned long m_dwChantEf; // Chant Effect
|
||||
unsigned long m_dwEnchantEf; // Enchant Effect
|
||||
unsigned short m_wUAct; // <20><EFBFBD> <20><>ȣ
|
||||
unsigned short m_wLAct; // <20><EFBFBD> <20><>ȣ
|
||||
unsigned char m_wLevel; // ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
};
|
||||
|
||||
// ij<><C4B3><EFBFBD><EFBFBD> <20>̵<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <20><>Ŷ ( Char Move Update )
|
||||
typedef struct PktMU* LPPktMU;
|
||||
struct PktMU : public PktBase
|
||||
{
|
||||
POS m_Position; // <20><>ġ
|
||||
float m_fDir; // <20><><EFBFBD><EFBFBD>
|
||||
unsigned long m_dwTick; // Ŭ<><C5AC><EFBFBD>̾<EFBFBD>Ʈ ƽ
|
||||
bool m_bSitMode; // <20>ɱ<EFBFBD> (true = <20>ɾ<EFBFBD> <20><><EFBFBD><EFBFBD>.)
|
||||
};
|
||||
|
||||
// ij<><C4B3><EFBFBD><EFBFBD> <20>̵<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <20><>Ŷ Ack ( Char Move Update )
|
||||
typedef struct PktMUAck* LPPktMUAck;
|
||||
struct PktMUAck : public PktBase
|
||||
{
|
||||
unsigned long m_dwTick; // Ŭ<><C5AC><EFBFBD>̾<EFBFBD>Ʈ ƽ (ó<><C3B3> <20>ð<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>)
|
||||
unsigned char m_cFlag; // - <20>÷<EFBFBD><C3B7><EFBFBD> (0 = <20>̵<EFBFBD>, 1 = <20><><EFBFBD>̵<EFBFBD>)
|
||||
};
|
||||
*/
|
||||
|
||||
|
||||
// <20><>ȯ
|
||||
typedef struct PktSummon* LPPktSummon;
|
||||
struct PktSummon : public PktBase
|
||||
{
|
||||
unsigned long m_dwCharID; // ij<><C4B3><EFBFBD><EFBFBD> ID
|
||||
unsigned long m_dwTargetID; // <20><><EFBFBD><EFBFBD> ID
|
||||
CNetworkPos m_NetworkPos; // <20><>Ʈ<EFBFBD><C6AE>ũ <20><>ġ
|
||||
};
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ( Monster Move )
|
||||
typedef struct PktMM* LPPktMM;
|
||||
struct PktMM : public PktBase
|
||||
{
|
||||
unsigned long m_dwMonID; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>̵<EFBFBD>
|
||||
CNetworkPos m_NetworkPos; // <20><>Ʈ<EFBFBD><C6AE>ũ <20><>ġ
|
||||
unsigned char m_cAct; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ൿ
|
||||
unsigned char m_cAniNum; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>̵<EFBFBD> Ƚ<><C8BD>
|
||||
};
|
||||
|
||||
|
||||
namespace CellCommand
|
||||
{
|
||||
enum Type
|
||||
{
|
||||
CELL_MOVE = 0,
|
||||
CELL_LOGIN = 1,
|
||||
RESPAWN = 2
|
||||
};
|
||||
};
|
||||
|
||||
// ij<><C4B3><EFBFBD><EFBFBD> <20><> <20>α<EFBFBD><CEB1><EFBFBD> <20><>Ŷ (Char Cell Login)
|
||||
typedef struct PktCCLi* LPPktCCLi;
|
||||
struct PktCCLi : public PktBase
|
||||
{
|
||||
unsigned char m_cCmd; // see namespace CellCommand
|
||||
// <20><>Ŷ <20>ڿ<EFBFBD> BroadcastInfo::CharInfo::SLoginPhase<73><65> <20>پ<EFBFBD> <20>´<EFBFBD>.
|
||||
};
|
||||
|
||||
// ij<><C4B3><EFBFBD><EFBFBD> <20><> <20>αƿ<D7BE> <20><>Ŷ ( Char Cell Logout )
|
||||
typedef struct PktCCLo* LPPktCCLo;
|
||||
struct PktCCLo : public PktBase
|
||||
{
|
||||
unsigned long m_dwCharID;
|
||||
unsigned char m_cCmd; // see namespace CellCommand
|
||||
};
|
||||
|
||||
// <20><> <20><><EFBFBD>ε<EFBFBD> ij<><C4B3><EFBFBD><EFBFBD> + Address<73><73><EFBFBD><EFBFBD>ü
|
||||
typedef struct PktCB PktCB, *LPPktCB;
|
||||
struct PktCB : public PktBase
|
||||
{
|
||||
unsigned char m_cCharacterPhase; // <20><> <20><><EFBFBD>ε<EFBFBD>ij<EFBFBD><C4B3><EFBFBD><EFBFBD> Phase(ij<><C4B3><EFBFBD><EFBFBD>).
|
||||
unsigned short m_usBufferSize; // <20><> <20><><EFBFBD><EFBFBD> ũ<><C5A9>
|
||||
};
|
||||
|
||||
#pragma pack()
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user