diff --git a/core/PlayerManager.h b/core/PlayerManager.h index 3b7a9662..52931cd8 100644 --- a/core/PlayerManager.h +++ b/core/PlayerManager.h @@ -79,6 +79,7 @@ public: void SetAdminId(AdminId id, bool temporary); AdminId GetAdminId(); void Kick(const char *str); + bool IsInKickQueue(); IPlayerInfo *GetPlayerInfo(); unsigned int GetLanguageId(); int GetUserId(); @@ -87,7 +88,6 @@ public: unsigned int GetSerial(); public: void DoBasicAdminChecks(); - bool IsInKickQueue(); void MarkAsBeingKicked(); int GetLifeState(); private: diff --git a/public/IGameHelpers.h b/public/IGameHelpers.h index 19d59871..87cced0e 100644 --- a/public/IGameHelpers.h +++ b/public/IGameHelpers.h @@ -40,7 +40,7 @@ */ #define SMINTERFACE_GAMEHELPERS_NAME "IGameHelpers" -#define SMINTERFACE_GAMEHELPERS_VERSION 4 +#define SMINTERFACE_GAMEHELPERS_VERSION 5 class CBaseEntity; class CBaseHandle; @@ -249,7 +249,19 @@ namespace SourceMod * * @return g_EntList pointer. */ - virtual void *GetGlobalEntityList() =0; + virtual void *GetGlobalEntityList() =0; + + /** + * @brief Adds a client to the kick queue, where they will be kicked + * next game frame. + * + * The user ID is used to ensure the correct player is kicked. + * + * @param client The index of the client to kick. + * @param userid The user ID of the client to kick. + * @param msg The kick message to show to the player. + */ + virtual void AddDelayedKick(int client, int userid, const char *msg) =0; }; } diff --git a/public/IPlayerHelpers.h b/public/IPlayerHelpers.h index 27b80e7a..fd14ef00 100644 --- a/public/IPlayerHelpers.h +++ b/public/IPlayerHelpers.h @@ -41,7 +41,7 @@ #include #define SMINTERFACE_PLAYERMANAGER_NAME "IPlayerManager" -#define SMINTERFACE_PLAYERMANAGER_VERSION 10 +#define SMINTERFACE_PLAYERMANAGER_VERSION 11 struct edict_t; class IPlayerInfo; @@ -196,7 +196,30 @@ namespace SourceMod * * @return True if authorized, false otherwise. */ - virtual bool IsAuthorized() =0; + virtual bool IsAuthorized() =0; + + /** + * @brief Kicks the client with a message + * + * @param message The message shown to the client when kicked + */ + virtual void Kick(const char *message) =0; + + /** + * @brief Returns whether the client is marked as being in the kick + * queue. The client doesn't necessarily have to be in the actual kick + * queue for this function to return true. + * + * @return True if in the kick queue, false otherwise. + */ + virtual bool IsInKickQueue() =0; + + /** + * @brief Marks the client as being in the kick queue. They are not + * actually added to the kick queue. Use IGameHelpers::AddDelayedKick() + * to actually add them to the queue. + */ + virtual void MarkAsBeingKicked() =0; }; /**