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;
|
|
|
|
|
2023-08-01 11:10:14 +02:00
|
|
|
virtual CommandAccessLevel get_access_level() override
|
2023-06-17 15:49:48 +02:00
|
|
|
{
|
|
|
|
return CommandAccessLevel::TOXIC;
|
|
|
|
}
|
|
|
|
|
2023-08-01 11:10:14 +02:00
|
|
|
virtual void execute(player_ptr player, const command_arguments& _args, const std::shared_ptr<command_context> ctx) override
|
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());
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2023-07-27 00:26:09 +08:00
|
|
|
host_kick g_host_kick("hostkick", "HOST_KICK", "HOST_KICK_DESC", 0, false);
|
2023-06-17 15:49:48 +02:00
|
|
|
}
|