Ark Server API (ASE) - Wiki
|
#include <Commands.h>
Classes | |
struct | Command |
Public Member Functions | |
Commands ()=default | |
Commands (const Commands &)=delete | |
Commands (Commands &&)=delete | |
Commands & | operator= (const Commands &)=delete |
Commands & | operator= (Commands &&)=delete |
~Commands () override=default | |
void | AddChatCommand (const FString &command, const std::function< void(AShooterPlayerController *, FString *, EChatSendMode::Type)> &callback) override |
Adds a chat command. | |
void | AddConsoleCommand (const FString &command, const std::function< void(APlayerController *, FString *, bool)> &callback) override |
Adds a console command. | |
void | AddRconCommand (const FString &command, const std::function< void(RCONClientConnection *, RCONPacket *, UWorld *)> &callback) override |
Adds a rcon command. | |
void | AddOnTickCallback (const FString &id, const std::function< void(float)> &callback) override |
Added function will be called every frame. | |
void | AddOnTimerCallback (const FString &id, const std::function< void()> &callback) override |
Added function will be called every second. | |
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 | RemoveChatCommand (const FString &command) override |
Removes a chat command. | |
bool | RemoveConsoleCommand (const FString &command) override |
Removes a console command. | |
bool | RemoveRconCommand (const FString &command) override |
Removes a rcon command. | |
bool | RemoveOnTickCallback (const FString &id) override |
Removes a on-tick callback. | |
bool | RemoveOnTimerCallback (const FString &id) override |
Removes an on-timer callback. | |
bool | RemoveOnChatMessageCallback (const FString &id) override |
Removes an on-chat-message callback. | |
bool | CheckChatCommands (AShooterPlayerController *shooter_player_controller, FString *message, EChatSendMode::Type mode) |
bool | CheckConsoleCommands (APlayerController *a_player_controller, FString *cmd, bool write_to_log) |
bool | CheckRconCommands (RCONClientConnection *rcon_client_connection, RCONPacket *rcon_packet, UWorld *u_world) |
void | CheckOnTickCallbacks (float delta_seconds) |
void | CheckOnTimerCallbacks () |
bool | CheckOnChatMessageCallbacks (AShooterPlayerController *player_controller, FString *message, EChatSendMode::Type mode, bool spam_check, bool command_executed) |
Public Member Functions inherited from ArkApi::ICommands | |
virtual | ~ICommands ()=default |
Private Types | |
using | ChatCommand = Command<void(AShooterPlayerController*, FString*, EChatSendMode::Type)> |
using | ConsoleCommand = Command<void(APlayerController*, FString*, bool)> |
using | RconCommand = Command<void(RCONClientConnection*, RCONPacket*, UWorld*)> |
using | OnTickCallback = Command<void(float)> |
using | OnTimerCallback = Command<void()> |
using | OnChatMessageCallback |
Private Member Functions | |
template<typename T > | |
bool | RemoveCommand (const FString &command, std::vector< std::shared_ptr< T > > &commands) |
template<typename T , typename... Args> | |
bool | CheckCommands (const FString &message, const std::vector< std::shared_ptr< T > > &commands, Args &&... args) |
Private Attributes | |
std::vector< std::shared_ptr< ChatCommand > > | chat_commands_ |
std::vector< std::shared_ptr< ConsoleCommand > > | console_commands_ |
std::vector< std::shared_ptr< RconCommand > > | rcon_commands_ |
std::vector< std::shared_ptr< OnTickCallback > > | on_tick_callbacks_ |
std::vector< std::shared_ptr< OnTimerCallback > > | on_timer_callbacks_ |
std::vector< std::shared_ptr< OnChatMessageCallback > > | on_chat_message_callbacks_ |
Definition at line 12 of file Commands.h.
|
private |
Definition at line 70 of file Commands.h.
|
private |
Definition at line 71 of file Commands.h.
|
private |
Definition at line 76 of file Commands.h.
|
private |
Definition at line 74 of file Commands.h.
|
private |
Definition at line 75 of file Commands.h.
|
private |
Definition at line 72 of file Commands.h.
|
default |
|
delete |
|
delete |
|
overridedefault |
|
overridevirtual |
Adds a chat command.
command | Command name |
callback | Callback function |
Implements ArkApi::ICommands.
Definition at line 7 of file Commands.cpp.
|
overridevirtual |
Adds a console command.
command | Command name |
callback | Callback function |
Implements ArkApi::ICommands.
Definition at line 14 of file Commands.cpp.
|
overridevirtual |
Added function will be called for AShooterPlayerController->ServerSendChatMessage events.
id | Unique ID |
callback | Callback function |
Implements ArkApi::ICommands.
Definition at line 36 of file Commands.cpp.
|
overridevirtual |
Added function will be called every frame.
id | Unique ID |
callback | Callback function |
Implements ArkApi::ICommands.
Definition at line 26 of file Commands.cpp.
|
overridevirtual |
Added function will be called every second.
id | Unique ID |
callback | Callback function |
Implements ArkApi::ICommands.
Definition at line 31 of file Commands.cpp.
|
overridevirtual |
Adds a rcon command.
command | Command name |
callback | Callback function |
Implements ArkApi::ICommands.
Definition at line 20 of file Commands.cpp.
bool ArkApi::Commands::CheckChatCommands | ( | AShooterPlayerController * | shooter_player_controller, |
FString * | message, | ||
EChatSendMode::Type | mode ) |
Definition at line 73 of file Commands.cpp.
|
inlineprivate |
Definition at line 99 of file Commands.h.
bool ArkApi::Commands::CheckConsoleCommands | ( | APlayerController * | a_player_controller, |
FString * | cmd, | ||
bool | write_to_log ) |
Definition at line 79 of file Commands.cpp.
bool ArkApi::Commands::CheckOnChatMessageCallbacks | ( | AShooterPlayerController * | player_controller, |
FString * | message, | ||
EChatSendMode::Type | mode, | ||
bool | spam_check, | ||
bool | command_executed ) |
Definition at line 115 of file Commands.cpp.
void ArkApi::Commands::CheckOnTickCallbacks | ( | float | delta_seconds | ) |
void ArkApi::Commands::CheckOnTimerCallbacks | ( | ) |
bool ArkApi::Commands::CheckRconCommands | ( | RCONClientConnection * | rcon_client_connection, |
RCONPacket * | rcon_packet, | ||
UWorld * | u_world ) |
Definition at line 84 of file Commands.cpp.
|
overridevirtual |
Removes a chat command.
command | Command name |
Implements ArkApi::ICommands.
Definition at line 43 of file Commands.cpp.
|
inlineprivate |
Definition at line 80 of file Commands.h.
|
overridevirtual |
Removes a console command.
command | Command name |
Implements ArkApi::ICommands.
Definition at line 48 of file Commands.cpp.
|
overridevirtual |
Removes an on-chat-message callback.
id | Callback ID |
Implements ArkApi::ICommands.
Definition at line 68 of file Commands.cpp.
|
overridevirtual |
Removes a on-tick callback.
id | Callback ID |
Implements ArkApi::ICommands.
Definition at line 58 of file Commands.cpp.
|
overridevirtual |
Removes an on-timer callback.
id | Callback ID |
Implements ArkApi::ICommands.
Definition at line 63 of file Commands.cpp.
|
overridevirtual |
Removes a rcon command.
command | Command name |
Implements ArkApi::ICommands.
Definition at line 53 of file Commands.cpp.
|
private |
Definition at line 124 of file Commands.h.
|
private |
Definition at line 125 of file Commands.h.
|
private |
Definition at line 130 of file Commands.h.
|
private |
Definition at line 128 of file Commands.h.
|
private |
Definition at line 129 of file Commands.h.
|
private |
Definition at line 126 of file Commands.h.