2023-06-17 15:49:48 +02:00
|
|
|
#include "backend/player_command.hpp"
|
|
|
|
#include "natives.hpp"
|
|
|
|
|
|
|
|
namespace big
|
|
|
|
{
|
|
|
|
class host_kick : player_command
|
|
|
|
{
|
|
|
|
using player_command::player_command;
|
|
|
|
|
|
|
|
virtual CommandAccessLevel get_access_level()
|
|
|
|
{
|
|
|
|
return CommandAccessLevel::TOXIC;
|
|
|
|
}
|
|
|
|
|
2023-07-20 22:46:32 +02:00
|
|
|
virtual void execute(player_ptr player, const std::vector<uint64_t>& _args, const std::shared_ptr<command_context> ctx)
|
2023-06-17 15:49:48 +02:00
|
|
|
{
|
|
|
|
if (!g_player_service->get_self()->is_host())
|
|
|
|
{
|
|
|
|
g_notification_service->push_error("Host kick", "Host kick failed");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
NETWORK::NETWORK_SESSION_KICK_PLAYER(player->id());
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
host_kick g_host_kick("hostkick", "Host Kick", "Host kick that only works when host", 0, false);
|
|
|
|
}
|