Files
.github
cmake
dAuthServer
dChatFilter
dChatServer
dCommon
dDatabase
dGame
dBehaviors
dComponents
dEntity
dGameMessages
dInventory
dMission
dPropertyBehaviors
dUtilities
BrickDatabase.cpp
BrickDatabase.h
CMakeLists.txt
CheatDetection.cpp
CheatDetection.h
GUID.cpp
GUID.h
Loot.cpp
Loot.h
Mail.cpp
Mail.h
ObjectIDManager.cpp
ObjectIDManager.h
Preconditions.cpp
Preconditions.h
SlashCommandHandler.cpp
SlashCommandHandler.h
VanityUtilities.cpp
VanityUtilities.h
CMakeLists.txt
Character.cpp
Character.h
Entity.cpp
Entity.h
EntityManager.cpp
EntityManager.h
LeaderboardManager.cpp
LeaderboardManager.h
Player.cpp
Player.h
PlayerManager.cpp
PlayerManager.h
TeamManager.cpp
TeamManager.h
TradingManager.cpp
TradingManager.h
User.cpp
User.h
UserManager.cpp
UserManager.h
dMasterServer
dNavigation
dNet
dPhysics
dScripts
dServer
dWorldServer
dZoneManager
docs
migrations
resources
tests
thirdparty
vanity
.dockerignore
.editorconfig
.env.example
.git-blame-ignore-revs
.gitattributes
.gitignore
.gitmodules
CMakeLists.txt
CMakePresets.json
CMakeVariables.txt
CONTRIBUTING.md
Dockerfile
LICENSE
README.md
SECURITY.md
build.sh
docker-compose.yml
entrypoint.sh
logo.png
systemd.example
versions.txt
DarkflameServer/dGame/dUtilities/CheatDetection.h
David Markowitz b24775f472 feat: Security improvements for spoofed packets ()
* Add cheat detection for spoofed packets

* Add config option for ip loggin

* remove packet saving
2023-09-28 12:16:11 -05:00

31 lines
1015 B
C++

#ifndef __CHEATDETECTION__H__
#define __CHEATDETECTION__H__
#include "dCommonVars.h"
struct SystemAddress;
enum class CheckType : uint8_t {
User,
Entity,
};
namespace CheatDetection {
/**
* @brief Verify that the object ID provided in this function is in someway connected to the system address who sent it.
*
* @param id The object ID to check ownership of
* @param sysAddr The system address which sent the packet
* @param checkType The check type to perform
* @param messageIfNotSender The message to log if the sender is not the owner of the object ID
* @param ... format args
* @return true If the sender is the owner of the object ID
* @return false If the sender is not the owner of the object ID
*/
bool VerifyLwoobjidIsSender(const LWOOBJID& id, const SystemAddress& sysAddr, const CheckType checkType, const char* messageIfNotSender, ...);
void ReportCheat(User* user, const SystemAddress& sysAddr, const char* messageIfNotSender, ...);
};
#endif //!__CHEATDETECTION__H__