R-Type
Distributed multiplayer game engine in C++
Loading...
Searching...
No Matches
server::KickCommand Class Reference

Kicks a player from the current room. More...

#include <KickCommand.hpp>

Inheritance diagram for server::KickCommand:
Inheritance graph
Collaboration diagram for server::KickCommand:
Collaboration graph

Public Member Functions

 KickCommand ()=default
 
 ~KickCommand () override=default
 
std::string execute (const std::vector< std::string > &args, const CommandContext &context) override
 Execute the command.
 
std::string getName () const override
 Get command name.
 
std::string getDescription () const override
 Get command description.
 
std::string getUsage () const override
 Get command usage.
 
- Public Member Functions inherited from server::ICommand
virtual ~ICommand ()=default
 

Detailed Description

Kicks a player from the current room.

Usage: /kick <player_id> Only the room host can kick players. Spectators cannot be kicked. Works both in waiting room and during game.

Definition at line 25 of file KickCommand.hpp.

Constructor & Destructor Documentation

◆ KickCommand()

server::KickCommand::KickCommand ( )
default

◆ ~KickCommand()

server::KickCommand::~KickCommand ( )
overridedefault

Member Function Documentation

◆ execute()

std::string server::KickCommand::execute ( const std::vector< std::string > &  args,
const CommandContext context 
)
overridevirtual

Execute the command.

Parameters
argsCommand arguments (without the command name)
contextExecution context with player and room information
Returns
Response message to send to the player

Implements server::ICommand.

Definition at line 15 of file KickCommand.cpp.

References Server::kickPlayer(), LOG_INFO, server::CommandContext::playerId, server::CommandContext::playerName, server::CommandContext::room, and server::CommandContext::server.

Here is the call graph for this function:

◆ getDescription()

std::string server::KickCommand::getDescription ( ) const
inlineoverridevirtual

Get command description.

Returns
Description of what the command does

Implements server::ICommand.

Definition at line 32 of file KickCommand.hpp.

◆ getName()

std::string server::KickCommand::getName ( ) const
inlineoverridevirtual

Get command name.

Returns
The command name (without /)

Implements server::ICommand.

Definition at line 31 of file KickCommand.hpp.

◆ getUsage()

std::string server::KickCommand::getUsage ( ) const
inlineoverridevirtual

Get command usage.

Returns
Usage example/syntax for the command

Implements server::ICommand.

Definition at line 33 of file KickCommand.hpp.


The documentation for this class was generated from the following files: