4#include "../Commands.h"
6#include "../PluginManager/PluginManager.h"
7#include "../IBaseApi.h"
8#include <../Private/Ark/Globals.h>
39 &AShooterGameMode_InitGame_original);
40 hooks->SetHook(
"AShooterPlayerController.ServerSendChatMessage_Implementation",
42 &AShooterPlayerController_ServerSendChatMessage_Impl_original);
44 &APlayerController_ConsoleCommand_original);
46 &AShooterPlayerController_ConsoleCommand_original);
48 &RCONClientConnection_ProcessRCONPacket_original);
51 &AShooterGameMode_BeginPlay_original);
54 &APlayerController_ServerReceivedPlayerControllerAck_Implementation_original);
56 &AShooterPlayerController_Possess_original);
66 UEngine_Init_original(_this, InEngineLoop);
68 Log::GetLog()->info(
"UGameEngine::Init was called");
78 Log::GetLog()->info(
"UWorld::InitWorld was called");
82 UWorld_InitWorld_original(world, ivs);
93 UWorld_Tick_original(world, tick_type, delta_seconds);
101 AShooterGameMode_InitGame_original(a_shooter_game_mode, map_name, options, error_message);
110 const auto spam_check = now_time - last_chat_time < 1.0;
111 if (last_chat_time > 0 && spam_check)
119 CheckChatCommands(player_controller, message, mode);
122 CheckOnChatMessageCallbacks(player_controller, message, mode, spam_check, command_executed);
124 if (command_executed || prevent_default)
129 AShooterPlayerController_ServerSendChatMessage_Impl_original(player_controller, message, mode);
133 FString* cmd,
bool write_to_log)
136 a_player_controller, cmd, write_to_log);
138 return APlayerController_ConsoleCommand_original(a_player_controller, result, cmd, write_to_log);
146 return AShooterPlayerController_ConsoleCommand_original(_this, result, Command, bWriteToLog);
157 RCONClientConnection_ProcessRCONPacket_original(_this, packet, in_world);
170 AGameState_DefaultTimer_original(_this);
175 AShooterGameMode_BeginPlay_original(_AShooterGameMode);
184 return URCONServer_Init_original(_this, Password, InPort, SCheatManager);
189 APlayerController_ServerReceivedPlayerControllerAck_Implementation_original(_this);
202 AShooterPlayerController_Possess_original(_this, inPawn);
210 AShooterGameMode_Logout_original(_this, Exiting);
#define DECLARE_HOOK(name, returnType,...)
virtual void RegisterCommands()=0
void LoadAllPlugins()
Find and load all plugins.
static PluginManager & Get()
static void DetectPluginChangesTimerCallback()
Checks for auto plugin reloads.
void CheckOnTimerCallbacks()
void CheckOnTickCallbacks(float delta_seconds)
virtual UWorld * GetWorld() const =0
Returns a pointer to UWorld.
static std::shared_ptr< spdlog::logger > & GetLog()
std::unique_ptr< IBaseApi > game_api
void Hook_AShooterGameMode_BeginPlay(AShooterGameMode *_AShooterGameMode)
void Hook_APlayerController_ServerReceivedPlayerControllerAck_Implementation(APlayerController *_this)
void Hook_AShooterPlayerController_Possess(AShooterPlayerController *_this, APawn *inPawn)
IApiUtils & GetApiUtils()
FString * Hook_AShooterPlayerController_ConsoleCommand(AShooterPlayerController *_this, FString *result, FString *Command, bool bWriteToLog)
void Hook_AShooterPlayerController_ServerSendChatMessage_Impl(AShooterPlayerController *player_controller, FString *message, EChatSendMode::Type mode)
void Hook_AShooterGameMode_InitGame(AShooterGameMode *a_shooter_game_mode, FString *map_name, FString *options, FString *error_message)
void Hook_UEngine_Init(DWORD64 _this, DWORD64 InEngineLoop)
FString * Hook_APlayerController_ConsoleCommand(APlayerController *a_player_controller, FString *result, FString *cmd, bool write_to_log)
void Hook_UWorld_Tick(DWORD64 world, DWORD64 tick_type, float delta_seconds)
void Hook_RCONClientConnection_ProcessRCONPacket(RCONClientConnection *_this, RCONPacket *packet, UWorld *in_world)
void Hook_AGameState_DefaultTimer(AGameState *_this)
bool Hook_URCONServer_Init(URCONServer *_this, FString Password, int InPort, UShooterCheatManager *SCheatManager)
void Hook_AShooterGameMode_Logout(AShooterGameMode *_this, AController *Exiting)
void Hook_UWorld_InitWorld(UWorld *world, DWORD64 ivs)
long double & LastChatMessageTimeField()
bool & IsAuthenticatedField()
long double & TimeSecondsField()