F4MP/tiltedcode/Code/server/Services/CommandService.h
Jous99 37b16f1547 code upload
codigo original de f4mp y tilted para referencias
2026-01-06 18:45:00 +01:00

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;
};