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,132 @@
|
||||
#ifndef _CHECK_SPEEDHACK_H_
|
||||
#define _CHECK_SPEEDHACK_H_
|
||||
|
||||
#include <vector>
|
||||
#include <deque>
|
||||
#include <Network/Packet/PacketStruct/CharAttackPacket.h>
|
||||
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
struct PktMU;
|
||||
struct PktAt;
|
||||
class CCharacter;
|
||||
|
||||
namespace Skill
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
struct ProtoType;
|
||||
};
|
||||
|
||||
// <20><><EFBFBD>ǵ<EFBFBD><C7B5><EFBFBD>
|
||||
class CSpeedHackCheck
|
||||
{
|
||||
public:
|
||||
|
||||
CSpeedHackCheck();
|
||||
|
||||
bool CheckTimeUpdate(DWORD dwClientTime);
|
||||
bool CheckAttackReplay(PktAt* lpPktAt);
|
||||
|
||||
inline void SetCharacter(CCharacter* lpCharacter) { m_lpCharacter = lpCharacter; }
|
||||
|
||||
private:
|
||||
|
||||
struct CoolDownInfo
|
||||
{
|
||||
const Skill::ProtoType* m_lpSkillProtoType;
|
||||
AtType m_attackType;
|
||||
unsigned long m_dwServerLastCastingTime;
|
||||
unsigned long m_dwClientLastCastingTime;
|
||||
unsigned long m_dwSkillUsedCount;
|
||||
|
||||
CoolDownInfo(const Skill::ProtoType* lpSkillProtoType, AtType attackType,
|
||||
unsigned long dwServerLastCastingTime, unsigned long dwClientLastCastingTime)
|
||||
: m_lpSkillProtoType(lpSkillProtoType), m_attackType(attackType),
|
||||
m_dwServerLastCastingTime(dwServerLastCastingTime),
|
||||
m_dwClientLastCastingTime(dwClientLastCastingTime),
|
||||
m_dwSkillUsedCount(1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
friend inline bool operator < (const CoolDownInfo& lhs, unsigned short usSkill_ID) { return lhs.m_attackType.m_wType < usSkill_ID; }
|
||||
friend inline bool operator < (unsigned short usSkill_ID, const CoolDownInfo& rhs) { return usSkill_ID < rhs.m_attackType.m_wType; }
|
||||
friend inline bool operator < (const CoolDownInfo& lhs, const CoolDownInfo& rhs) { return lhs.m_attackType.m_wType < rhs.m_attackType.m_wType; }
|
||||
};
|
||||
|
||||
struct SkillHistory
|
||||
{
|
||||
AtType m_attackType;
|
||||
long m_nServerInterval;
|
||||
long m_nClientInterval;
|
||||
long m_nMinCoolDownTime;
|
||||
|
||||
SkillHistory(AtType attackType, long nMinCoolDownTime,
|
||||
long nServerInterval, long nClientInterval)
|
||||
: m_attackType(attackType), m_nMinCoolDownTime(nMinCoolDownTime),
|
||||
m_nServerInterval(nServerInterval), m_nClientInterval(nClientInterval)
|
||||
{
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
struct AttackTime
|
||||
{
|
||||
long m_nDiffServerInterval;
|
||||
long m_nDiffClientInterval;
|
||||
|
||||
AttackTime() : m_nDiffServerInterval(0), m_nDiffClientInterval(0) { }
|
||||
|
||||
AttackTime(long nDiffServerInterval, long nDiffClientInterval)
|
||||
: m_nDiffServerInterval(nDiffServerInterval), m_nDiffClientInterval(nDiffClientInterval)
|
||||
{
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
struct SumAttackTime
|
||||
{
|
||||
long m_nSumServerAttackTime;
|
||||
long m_nSumClientAttackTime;
|
||||
|
||||
SumAttackTime() : m_nSumServerAttackTime(0), m_nSumClientAttackTime(0) { }
|
||||
void clear() { m_nSumServerAttackTime = m_nSumClientAttackTime = 0; }
|
||||
|
||||
void add(long nSumServerAttackTime, long nSumClientAttackTime) { m_nSumServerAttackTime += nSumServerAttackTime; m_nSumClientAttackTime += nSumClientAttackTime; }
|
||||
void add(AttackTime& atTime) { m_nSumServerAttackTime += atTime.m_nDiffServerInterval; m_nSumClientAttackTime += atTime.m_nDiffClientInterval; }
|
||||
|
||||
void minus(long nSumServerAttackTime, long nSumClientAttackTime) { m_nSumServerAttackTime -= nSumServerAttackTime; m_nSumClientAttackTime -= nSumClientAttackTime; }
|
||||
void minus(AttackTime& atTime) { m_nSumServerAttackTime -= atTime.m_nDiffServerInterval; m_nSumClientAttackTime -= atTime.m_nDiffClientInterval; }
|
||||
};
|
||||
|
||||
struct ClearAttackHackCheck;
|
||||
|
||||
bool CheckSpeedHack(unsigned long CurrentServer, unsigned long CurrentClient);
|
||||
bool CheckAttackHack(PktAt* lpPktAt, unsigned long dwCurrentServerTime);
|
||||
|
||||
void LogAttackHack(const char* szDetailText);
|
||||
|
||||
void LogSkillCoolDownTime(const CoolDownInfo& coolDownInfo, long nMinCoolDownTime,
|
||||
long nServerCoolDownTimeInterval, long nClientCoolDownTimeInterval);
|
||||
|
||||
unsigned long m_dwServerTotal;
|
||||
unsigned long m_dwServerLast;
|
||||
unsigned long m_dwClientTotal;
|
||||
unsigned long m_dwClinetLast;
|
||||
|
||||
unsigned long m_dwLastServerAttackTime; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ <20>ð<EFBFBD>
|
||||
unsigned long m_dwLastClientAttackTime; // Ŭ<><C5AC><EFBFBD>̾<EFBFBD>Ʈ<EFBFBD><C6AE> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ <20>ð<EFBFBD>
|
||||
|
||||
unsigned long m_dwHackFoundCount; // <20><> <20>߰<EFBFBD> ȸ<><C8B8>
|
||||
|
||||
typedef std::vector<CoolDownInfo> CoolDownInfoList;
|
||||
typedef std::deque<SkillHistory> SkillHistoryList;
|
||||
typedef std::deque<AttackTime> AttackTimeList;
|
||||
|
||||
SumAttackTime m_SumAttackTime; // <20><><EFBFBD><EFBFBD> <20>ð<EFBFBD> <20><>.
|
||||
AttackTimeList m_AttackTimeList; // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
CoolDownInfoList m_CoolDownInfo; // <20><><EFBFBD>ٿ<EFBFBD> <20><><EFBFBD><EFBFBD>.
|
||||
SkillHistoryList m_SkillHistoryList; // <20><>ų <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>丮 <20><><EFBFBD><EFBFBD>Ʈ
|
||||
CCharacter* m_lpCharacter;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user