76 return CheckCommands<ChatCommand>(*message,
chat_commands_, shooter_player_controller, message, mode);
81 return CheckCommands<ConsoleCommand>(*cmd,
console_commands_, a_player_controller, cmd, write_to_log);
87 return CheckCommands<RconCommand>(rcon_packet
->Body,
rcon_commands_, rcon_client_connection, rcon_packet,
94 for (
const auto& data : tmp_tick_callbacks)
98 data->callback(delta_seconds);
106 for (
const auto& data : tmp_timer_callbacks)
120 bool command_executed)
124 bool prevent_default =
false;
125 for (
const auto& data : tmp_chat_callbacks)
127 prevent_default |= data->callback(player_controller, message, mode, spam_check, command_executed);
130 return prevent_default;
virtual std::unique_ptr< ArkApi::ICommands > & GetCommands()=0
std::vector< std::shared_ptr< OnTickCallback > > on_tick_callbacks_
std::vector< std::shared_ptr< OnChatMessageCallback > > on_chat_message_callbacks_
std::vector< std::shared_ptr< RconCommand > > rcon_commands_
bool RemoveOnTickCallback(const FString &id) override
Removes a on-tick callback.
bool RemoveOnChatMessageCallback(const FString &id) override
Removes an on-chat-message callback.
void AddConsoleCommand(const FString &command, const std::function< void(APlayerController *, FString *, bool)> &callback) override
Adds a console command.
void CheckOnTimerCallbacks()
std::vector< std::shared_ptr< ConsoleCommand > > console_commands_
std::vector< std::shared_ptr< OnTimerCallback > > on_timer_callbacks_
void AddRconCommand(const FString &command, const std::function< void(RCONClientConnection *, RCONPacket *, UWorld *)> &callback) override
Adds a rcon command.
bool CheckConsoleCommands(APlayerController *a_player_controller, FString *cmd, bool write_to_log)
bool RemoveRconCommand(const FString &command) override
Removes a rcon command.
bool RemoveConsoleCommand(const FString &command) override
Removes a console command.
std::vector< std::shared_ptr< ChatCommand > > chat_commands_
bool CheckRconCommands(RCONClientConnection *rcon_client_connection, RCONPacket *rcon_packet, UWorld *u_world)
bool RemoveChatCommand(const FString &command) override
Removes a chat command.
void AddOnChatMessageCallback(const FString &id, const std::function< bool(AShooterPlayerController *, FString *, EChatSendMode::Type, bool, bool)> &callback) override
Added function will be called for AShooterPlayerController->ServerSendChatMessage events.
bool CheckOnChatMessageCallbacks(AShooterPlayerController *player_controller, FString *message, EChatSendMode::Type mode, bool spam_check, bool command_executed)
void AddOnTimerCallback(const FString &id, const std::function< void()> &callback) override
Added function will be called every second.
bool RemoveOnTimerCallback(const FString &id) override
Removes an on-timer callback.
void AddOnTickCallback(const FString &id, const std::function< void(float)> &callback) override
Added function will be called every frame.
bool CheckChatCommands(AShooterPlayerController *shooter_player_controller, FString *message, EChatSendMode::Type mode)
void CheckOnTickCallbacks(float delta_seconds)
void AddChatCommand(const FString &command, const std::function< void(AShooterPlayerController *, FString *, EChatSendMode::Type)> &callback) override
Adds a chat command.
std::unique_ptr< IBaseApi > game_api
ARK_API ICommands &APIENTRY GetCommands()