Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cheat Detection] Anti-Cheat reimplementation #1434

Merged
merged 23 commits into from
Aug 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions common/emu_oplist.h
Original file line number Diff line number Diff line change
Expand Up @@ -567,4 +567,5 @@ N(OP_ZoneServerReady),
N(OP_ZoneSpawns),
N(OP_ZoneUnavail),
N(OP_ResetAA),
N(OP_UnderWorld),
// mail and chat opcodes located in ../mail_oplist.h
1 change: 1 addition & 0 deletions common/eq_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
#define AT_FindBits 46 // set FindBits, whatever those are!
#define AT_TextureType 48 // TextureType
#define AT_FacePick 49 // Turns off face pick window? maybe ...
#define AT_AntiCheat 51 // sent by the client randomly telling the server how long since last action has occured
#define AT_GuildShow 52 // this is what MQ2 call sit, not sure
#define AT_Offline 53 // Offline mode

Expand Down
17 changes: 17 additions & 0 deletions common/eq_packet_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -5530,6 +5530,23 @@ struct SayLinkBodyFrame_Struct {
/*056*/
};

struct UpdateMovementEntry {
/* 00 */ float Y;
/* 04 */ float X;
/* 08 */ float Z;
/* 12 */ uint8 type;
/* 13 */ unsigned int timestamp;
/* 17 */
};

struct UnderWorld {
/* 00 */ int spawn_id;
/* 04 */ float y;
/* 08 */ float x;
/* 12 */ float z;
/* 16 */
};

// Restore structure packing to default
#pragma pack()

Expand Down
1 change: 1 addition & 0 deletions common/eqemu_logsys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ EQEmuLogSys *EQEmuLogSys::LoadLogSettingsDefaults()
log_settings[Logs::HotReload].log_to_console = static_cast<uint8>(Logs::General);
log_settings[Logs::Loot].log_to_gmsay = static_cast<uint8>(Logs::General);
log_settings[Logs::Scheduler].log_to_console = static_cast<uint8>(Logs::General);
log_settings[Logs::Cheat].log_to_console = static_cast<uint8>(Logs::General);

/**
* RFC 5424
Expand Down
2 changes: 2 additions & 0 deletions common/eqemu_logsys.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ namespace Logs {
Expeditions,
DynamicZones,
Scheduler,
Cheat,
MaxCategoryID /* Don't Remove this */
};

Expand Down Expand Up @@ -202,6 +203,7 @@ namespace Logs {
"Expeditions",
"DynamicZones",
"Scheduler",
"Cheat"
};
}

Expand Down
10 changes: 10 additions & 0 deletions common/eqemu_logsys_log_aliases.h
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,16 @@
OutF(LogSys, Logs::Detail, Logs::Scheduler, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)

#define LogCheat(message, ...) do {\
if (LogSys.log_settings[Logs::Cheat].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Cheat, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)

#define LogCheatDetail(message, ...) do {\
if (LogSys.log_settings[Logs::Cheat].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::Cheat, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)

#define Log(debug_level, log_category, message, ...) do {\
if (LogSys.log_settings[log_category].is_category_enabled == 1)\
LogSys.Out(debug_level, log_category, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
Expand Down
15 changes: 15 additions & 0 deletions common/ruletypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,21 @@ RULE_BOOL(DynamicZone, EnableInDynamicZoneStatus, false, "Enables the 'In Dynami
RULE_INT(DynamicZone, WorldProcessRate, 6000, "Timer interval (milliseconds) that systems check their dynamic zone states")
RULE_CATEGORY_END()

RULE_CATEGORY(Cheat)
RULE_REAL(Cheat, MQWarpDetectionDistanceFactor, 9.0, "clients move at 4.4 about if in a straight line but with movement and to acct for lag we raise it a bit")
RULE_INT(Cheat, MQWarpExemptStatus, -1, "Required status level to exempt the MQWarpDetector. Set to -1 to disable this feature.")
RULE_INT(Cheat, MQZoneExemptStatus, -1, "Required status level to exempt the MQZoneDetector. Set to -1 to disable this feature.")
RULE_INT(Cheat, MQGateExemptStatus, -1, "Required status level to exempt the MQGateDetector. Set to -1 to disable this feature.")
RULE_INT(Cheat, MQGhostExemptStatus, -1, "Required status level to exempt the MQGhostDetector. Set to -1 to disable this feature.")
RULE_INT(Cheat, MQFastMemExemptStatus, -1, "Required status level to exempt the MQFastMemDetector. Set to -1 to disable this feature.")
RULE_BOOL(Cheat, EnableMQWarpDetector, true, "Enable the MQWarp Detector. Set to False to disable this feature.")
RULE_BOOL(Cheat, EnableMQZoneDetector, true, "Enable the MQZone Detector. Set to False to disable this feature.")
RULE_BOOL(Cheat, EnableMQGateDetector, true, "Enable the MQGate Detector. Set to False to disable this feature.")
RULE_BOOL(Cheat, EnableMQGhostDetector, true, "Enable the MQGhost Detector. Set to False to disable this feature.")
RULE_BOOL(Cheat, EnableMQFastMemDetector, true, "Enable the MQFastMem Detector. Set to False to disable this feature.")
RULE_BOOL(Cheat, MarkMQWarpLT, false, "Mark clients makeing smaller warps")
RULE_CATEGORY_END()

#undef RULE_CATEGORY
#undef RULE_INT
#undef RULE_REAL
Expand Down
8 changes: 6 additions & 2 deletions zone/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ SET(zone_sources
bot_command.cpp
bot_database.cpp
botspellsai.cpp
cheat_manager.cpp
client.cpp
client_mods.cpp
client_packet.cpp
Expand Down Expand Up @@ -157,7 +158,8 @@ SET(zone_sources
zone_event_scheduler.cpp
zone_reload.cpp
zone_store.cpp
zoning.cpp)
zoning.cpp
)

SET(zone_headers
aa.h
Expand All @@ -171,6 +173,7 @@ SET(zone_headers
bot_command.h
bot_database.h
bot_structs.h
cheat_manager.h
client.h
client_packet.h
command.h
Expand Down Expand Up @@ -274,7 +277,8 @@ SET(zone_headers
zonedb.h
zonedump.h
zone_reload.h
zone_store.h)
zone_store.h
)

ADD_EXECUTABLE(zone ${zone_sources} ${zone_headers})

Expand Down
Loading