Skip to content

Class endstone::PlayerBanList

ClassList > endstone > PlayerBanList

Represents a ban list, containing banned players.

  • #include <endstone/ban/player_ban_list.h>

Inherits the following classes: endstone::BanList

Public Functions

Type Name
virtual PlayerBanEntry & addBan (std::string name, std::optional< std::string > reason, std::optional< BanEntry::Date > expires, std::optional< std::string > source) = 0
Adds a ban to this list. If a previous ban exists, this will update the previous entry.
virtual PlayerBanEntry & addBan (std::string name, std::optional< UUID > uuid, std::optional< std::string > xuid, std::optional< std::string > reason, std::optional< BanEntry::Date > expires, std::optional< std::string > source) = 0
Adds a ban to this list. If a previous ban exists, this will update the previous entry.
virtual PlayerBanEntry & addBan (std::string name, std::optional< std::string > reason, std::chrono::seconds duration, std::optional< std::string > source) = 0
Adds a ban to this list. If a previous ban exists, this will update the previous entry.
virtual PlayerBanEntry & addBan (std::string name, std::optional< UUID > uuid, std::optional< std::string > xuid, std::optional< std::string > reason, std::chrono::seconds duration, std::optional< std::string > source) = 0
Adds a ban to this list. If a previous ban exists, this will update the previous entry.
virtual const PlayerBanEntry * getBanEntry (std::string name) const = 0
Gets a BanEntry by player name.
virtual PlayerBanEntry * getBanEntry (std::string name) = 0
Gets a BanEntry by player name.
virtual const PlayerBanEntry * getBanEntry (std::string name, std::optional< UUID > uuid, std::optional< std::string > xuid) const = 0
Gets a BanEntry by player name,UUID , or XUID.
virtual PlayerBanEntry * getBanEntry (std::string name, std::optional< UUID > uuid, std::optional< std::string > xuid) = 0
Gets a BanEntry by player name,UUID , or XUID.
virtual std::vector< const PlayerBanEntry * > getEntries () const = 0
Gets a vector containing pointers to every BanEntry in this list.
virtual std::vector< PlayerBanEntry * > getEntries () = 0
Gets a vector containing pointers to every BanEntry in this list.
virtual bool isBanned (std::string name) const = 0
Checks if a BanEntry exists for the target, indicating an active ban status.
virtual bool isBanned (std::string name, std::optional< UUID > uuid, std::optional< std::string > xuid) const = 0
Checks if a BanEntry exists for the target, indicating an active ban status.
virtual void removeBan (std::string name) = 0
Removes the specified player from this list, therefore indicating a "not banned" status.
virtual void removeBan (std::string name, std::optional< UUID > uuid, std::optional< std::string > xuid) = 0
Removes the specified player from this list, therefore indicating a "not banned" status.
virtual ~PlayerBanList () = default

Public Functions inherited from endstone::BanList

See endstone::BanList

Type Name
virtual T & addBan (std::string target, std::optional< std::string > reason, std::optional< BanEntry::Date > expires, std::optional< std::string > source) = 0
Adds a ban to this list. If a previous ban exists, this will update the previous entry.
virtual T & addBan (std::string target, std::optional< std::string > reason, std::chrono::seconds duration, std::optional< std::string > source) = 0
Adds a ban to this list. If a previous ban exists, this will update the previous entry.
virtual const T * getBanEntry (std::string target) const = 0
Gets a BanEntry by target.
virtual T * getBanEntry (std::string target) = 0
Gets a BanEntry by target.
virtual std::vector< const T * > getEntries () const = 0
Gets a vector containing pointers to every BanEntry in this list.
virtual std::vector< T * > getEntries () = 0
Gets a vector containing pointers to every BanEntry in this list.
virtual bool isBanned (std::string target) const = 0
Checks if a BanEntry exists for the target, indicating an active ban status.
virtual void removeBan (std::string target) = 0
Removes the specified target from this list, therefore indicating a "not banned" status.
virtual ~BanList () = default

Public Functions Documentation

function addBan [¼]

Adds a ban to this list. If a previous ban exists, this will update the previous entry.

virtual PlayerBanEntry & endstone::PlayerBanList::addBan (
    std::string name,
    std::optional< std::string > reason,
    std::optional< BanEntry::Date > expires,
    std::optional< std::string > source
) = 0

Parameters:

  • name The name of the target.
  • reason The reason for the ban, std::nullopt indicates implementation default.
  • expires The date for the ban's expiration (unban), or std::nullopt to imply forever.
  • source The source of the ban, std::nullopt indicates implementation default.

Returns:

PlayerBanEntry& The entry for the newly created ban, or the entry for the (updated) previous ban.

Implements endstone::BanList::addBan


function addBan [2/4]

Adds a ban to this list. If a previous ban exists, this will update the previous entry.

virtual PlayerBanEntry & endstone::PlayerBanList::addBan (
    std::string name,
    std::optional< UUID > uuid,
    std::optional< std::string > xuid,
    std::optional< std::string > reason,
    std::optional< BanEntry::Date > expires,
    std::optional< std::string > source
) = 0

Parameters:

  • name The name of the target.
  • uuid The UUID of the target, std::nullopt if not used.
  • xuid The XUID of the target, std::nullopt if not used.
  • reason The reason for the ban, std::nullopt indicates implementation default.
  • expires The date for the ban's expiration (unban), or std::nullopt to imply forever.
  • source The source of the ban, std::nullopt indicates implementation default.

Returns:

PlayerBanEntry& The entry for the newly created ban, or the entry for the (updated) previous ban.


function addBan [¾]

Adds a ban to this list. If a previous ban exists, this will update the previous entry.

virtual PlayerBanEntry & endstone::PlayerBanList::addBan (
    std::string name,
    std::optional< std::string > reason,
    std::chrono::seconds duration,
    std::optional< std::string > source
) = 0

Parameters:

  • name The name of the target.
  • reason The reason for the ban, std::nullopt indicates implementation default.
  • duration The duration of the ban
  • source The source of the ban, std::nullopt indicates implementation default.

Returns:

PlayerBanEntry& The entry for the newly created ban, or the entry for the (updated) previous ban.

Implements endstone::BanList::addBan


function addBan [4/4]

Adds a ban to this list. If a previous ban exists, this will update the previous entry.

virtual PlayerBanEntry & endstone::PlayerBanList::addBan (
    std::string name,
    std::optional< UUID > uuid,
    std::optional< std::string > xuid,
    std::optional< std::string > reason,
    std::chrono::seconds duration,
    std::optional< std::string > source
) = 0

Parameters:

  • name The name of the target.
  • uuid The UUID of the target, std::nullopt if not used.
  • xuid The XUID of the target, std::nullopt if not used.
  • reason The reason for the ban, std::nullopt indicates implementation default.
  • duration The duration of the ban
  • source The source of the ban, std::nullopt indicates implementation default.

Returns:

PlayerBanEntry& The entry for the newly created ban, or the entry for the (updated) previous ban.


function getBanEntry [¼]

Gets a BanEntry by player name.

virtual const PlayerBanEntry * endstone::PlayerBanList::getBanEntry (
    std::string name
) const = 0

Parameters:

  • name The player name to search for.

Returns:

PlayerBanEntry* The corresponding entry, or nullptr if none found.

Implements endstone::BanList::getBanEntry


function getBanEntry [2/4]

Gets a BanEntry by player name.

virtual PlayerBanEntry * endstone::PlayerBanList::getBanEntry (
    std::string name
) = 0

Parameters:

  • name The player name to search for.

Returns:

PlayerBanEntry* The corresponding entry, or nullptr if none found.

Implements endstone::BanList::getBanEntry


function getBanEntry [¾]

Gets a BanEntry by player name,UUID , or XUID.

virtual const PlayerBanEntry * endstone::PlayerBanList::getBanEntry (
    std::string name,
    std::optional< UUID > uuid,
    std::optional< std::string > xuid
) const = 0

Parameters:

  • name The player name to search for.
  • uuid The UUID of the player to search for, std::nullopt if not used.
  • xuid The XUID of the player to search for, std::nullopt if not used.

Returns:

PlayerBanEntry* The corresponding entry, or nullptr if none found.


function getBanEntry [4/4]

Gets a BanEntry by player name,UUID , or XUID.

virtual PlayerBanEntry * endstone::PlayerBanList::getBanEntry (
    std::string name,
    std::optional< UUID > uuid,
    std::optional< std::string > xuid
) = 0

Parameters:

  • name The player name to search for.
  • uuid The UUID of the player to search for, std::nullopt if not used.
  • xuid The XUID of the player to search for, std::nullopt if not used.

Returns:

PlayerBanEntry* The corresponding entry, or nullptr if none found.


function getEntries [½]

Gets a vector containing pointers to every BanEntry in this list.

virtual std::vector< const PlayerBanEntry * > endstone::PlayerBanList::getEntries () const = 0

Returns:

A vector containing pointers to every entry tracked by this list.

Implements endstone::BanList::getEntries


function getEntries [2/2]

Gets a vector containing pointers to every BanEntry in this list.

virtual std::vector< PlayerBanEntry * > endstone::PlayerBanList::getEntries () = 0

Returns:

A vector containing pointers to every entry tracked by this list.

Implements endstone::BanList::getEntries


function isBanned [½]

Checks if a BanEntry exists for the target, indicating an active ban status.

virtual bool endstone::PlayerBanList::isBanned (
    std::string name
) const = 0

Parameters:

  • name The player name to find.

Returns:

true If a BanEntry exists for the target, indicating an active ban status.

Returns:

false Otherwise.

Implements endstone::BanList::isBanned


function isBanned [2/2]

Checks if a BanEntry exists for the target, indicating an active ban status.

virtual bool endstone::PlayerBanList::isBanned (
    std::string name,
    std::optional< UUID > uuid,
    std::optional< std::string > xuid
) const = 0

Parameters:

  • name The player name to find.
  • uuid The UUID of the target, std::nullopt if not used.
  • xuid The XUID of the target, std::nullopt if not used.

Returns:

true If a BanEntry exists for the target, indicating an active ban status.

Returns:

false Otherwise.


function removeBan [½]

Removes the specified player from this list, therefore indicating a "not banned" status.

virtual void endstone::PlayerBanList::removeBan (
    std::string name
) = 0

Parameters:

  • name The player name to remove from this list.

Implements endstone::BanList::removeBan


function removeBan [2/2]

Removes the specified player from this list, therefore indicating a "not banned" status.

virtual void endstone::PlayerBanList::removeBan (
    std::string name,
    std::optional< UUID > uuid,
    std::optional< std::string > xuid
) = 0

Parameters:

  • name The player name to remove from this list.
  • uuid The unique id of the player, std::nullopt if not used.
  • xuid The xbox user id (xuid) of the player, std::nullopt if not used.

function ~PlayerBanList

virtual endstone::PlayerBanList::~PlayerBanList () = default


The documentation for this class was generated from the following file include/endstone/ban/player_ban_list.h