mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-02 20:42:28 +00:00
- License was intended to be GPLv3 per earlier commit of GPLv3 LICENSE FILE - This is confirmed by the inclusion of libraries that are incompatible with GPLv2 - This is also confirmed by KLS and the agreement of KLS's predecessors - Added GPLv3 license headers to the compilable source files - Removed Folly licensing in strings.h since the string functions do not match the Folly functions and are standard functions - this must have been left over from previous implementations - Removed individual contributor license headers since the project has been under the "developer" mantle for many years - Removed comments on files that were previously automatically generated since they've been manually modified multiple times and there are no automatic scripts referencing them (removed in 2023)
106 lines
2.8 KiB
C++
106 lines
2.8 KiB
C++
/* EQEmu: EQEmulator
|
|
|
|
Copyright (C) 2001-2026 EQEmu Development Team
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
#pragma once
|
|
|
|
#include "common/eq_packet_structs.h"
|
|
#include "common/eq_packet.h"
|
|
#include "common/rulesys.h"
|
|
#include "common/timer.h"
|
|
|
|
#include "glm/vec3.hpp"
|
|
|
|
class CheatManager;
|
|
class Client;
|
|
|
|
typedef enum {
|
|
Collision = 1,
|
|
TeleportB,
|
|
TeleportA,
|
|
ZoneLine,
|
|
Unknown0x5,
|
|
Unknown0x6,
|
|
SpellA, // Titanium - UF
|
|
Unknown0x8,
|
|
SpellB // Used in RoF+
|
|
} UpdateMovementType;
|
|
|
|
typedef enum {
|
|
ShadowStep,
|
|
KnockBack,
|
|
Port,
|
|
Assist,
|
|
Sense,
|
|
MAX_EXEMPTIONS
|
|
} ExemptionType;
|
|
|
|
typedef enum {
|
|
MQWarp,
|
|
MQWarpShadowStep,
|
|
MQWarpKnockBack,
|
|
MQWarpLight,
|
|
MQZone,
|
|
MQZoneUnknownDest,
|
|
MQGate,
|
|
MQGhost,
|
|
MQFastMem,
|
|
MQWarpAbsolute
|
|
} CheatTypes;
|
|
|
|
class CheatManager {
|
|
public:
|
|
CheatManager()
|
|
{
|
|
SetExemptStatus(ShadowStep, false);
|
|
SetExemptStatus(KnockBack, false);
|
|
SetExemptStatus(Port, false);
|
|
SetExemptStatus(Assist, false);
|
|
SetExemptStatus(Sense, false);
|
|
m_distance_since_last_position_check = 0.0f;
|
|
m_cheat_detect_moved = false;
|
|
m_target = nullptr;
|
|
m_time_since_last_memorization = 0;
|
|
m_time_since_last_position_check = 0;
|
|
m_time_since_last_warp_detection.Start();
|
|
m_time_since_last_movement_history.Start(70000);
|
|
m_warp_counter = 0;
|
|
}
|
|
void SetClient(Client *cli);
|
|
void SetExemptStatus(ExemptionType type, bool v);
|
|
bool GetExemptStatus(ExemptionType type);
|
|
void CheatDetected(CheatTypes type, glm::vec3 position1, glm::vec3 position2 = glm::vec3(0, 0, 0));
|
|
void MovementCheck(glm::vec3 updated_position);
|
|
void MovementCheck(uint32 time_between_checks = 1000);
|
|
void CheckMemTimer();
|
|
void ProcessMovementHistory(const EQApplicationPacket *app);
|
|
void ProcessSpawnApperance(uint16 spawn_id, uint16 type, uint32 parameter);
|
|
void ProcessItemVerifyRequest(int32 slot_id, uint32 target_id);
|
|
void ClientProcess();
|
|
private:
|
|
bool m_exemption[ExemptionType::MAX_EXEMPTIONS]{};
|
|
float m_distance_since_last_position_check;
|
|
bool m_cheat_detect_moved;
|
|
|
|
Client *m_target;
|
|
uint32 m_time_since_last_position_check;
|
|
uint32 m_time_since_last_memorization;
|
|
uint32 m_time_since_last_action{};
|
|
Timer m_time_since_last_warp_detection;
|
|
Timer m_time_since_last_movement_history;
|
|
uint32 m_warp_counter;
|
|
};
|