mirror of
https://github.com/Jous99/F4MP.git
synced 2026-01-12 17:10:54 +01:00
31 lines
788 B
C++
31 lines
788 B
C++
#pragma once
|
|
|
|
#include <Events/PacketEvent.h>
|
|
|
|
struct World;
|
|
struct TeleportCommandRequest;
|
|
struct SetTimeCommandRequest;
|
|
|
|
/**
|
|
* @brief Processes incoming commands.
|
|
*/
|
|
struct CommandService
|
|
{
|
|
CommandService(World& aWorld, entt::dispatcher& aDispatcher) noexcept;
|
|
~CommandService() noexcept = default;
|
|
|
|
TP_NOCOPYMOVE(CommandService);
|
|
|
|
protected:
|
|
void OnSetTimeCommand(const PacketEvent<SetTimeCommandRequest>& acMessage) const noexcept;
|
|
/**
|
|
* @brief Returns the location of the target player of the teleport command.
|
|
*/
|
|
void OnTeleportCommandRequest(const PacketEvent<TeleportCommandRequest>& acMessage) const noexcept;
|
|
|
|
private:
|
|
World& m_world;
|
|
|
|
entt::scoped_connection m_setTimeConnection;
|
|
entt::scoped_connection m_teleportConnection;
|
|
};
|