Abstracts some Half-Life 2 and SourceMod properties about clients. More...
#include <public/IPlayerHelpers.h>
Public Member Functions | |
| virtual const char * | GetName ()=0 |
| Returns the player's name. | |
| virtual const char * | GetIPAddress ()=0 |
| Returns the player's IP address. | |
| virtual const char * | GetAuthString ()=0 |
| Returns the player's authentication string. | |
| virtual edict_t * | GetEdict ()=0 |
| Returns the player's edict_t structure. | |
| virtual bool | IsInGame ()=0 |
| Returns whether the player is in game (putinserver). | |
| virtual bool | IsConnected ()=0 |
| Returns whether the player is connected. | |
| virtual bool | IsFakeClient ()=0 |
| Returns whether the player is a fake client. | |
| virtual AdminId | GetAdminId ()=0 |
| Returns the client's AdminId, if any. | |
| virtual void | SetAdminId (AdminId id, bool temp)=0 |
| Sets the client's AdminId. | |
| virtual int | GetUserId ()=0 |
| Returns the client's userid. | |
| virtual unsigned int | GetLanguageId ()=0 |
| Returns the client's language id. | |
| virtual IPlayerInfo * | GetPlayerInfo ()=0 |
| Returns a player's IPlayerInfo object, if any. | |
| virtual bool | RunAdminCacheChecks ()=0 |
| Runs through Core's admin authorization checks. If the client is already an admin, no checks are performed. | |
| virtual void | NotifyPostAdminChecks ()=0 |
| Notifies all listeners that the client has completed all of your post-connection (in-game, auth, admin) checks. | |
| virtual unsigned int | GetSerial ()=0 |
| Returns the clients unique serial identifier. | |
| virtual bool | IsAuthorized ()=0 |
| Return whether the client is authorized. | |
| virtual void | Kick (const char *message)=0 |
| Kicks the client with a message. | |
| virtual bool | IsInKickQueue ()=0 |
| 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. | |
| virtual void | MarkAsBeingKicked ()=0 |
| 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 bool | IsSourceTV () const =0 |
| Returns whether the player is the SourceTV bot. | |
| virtual bool | IsReplay () const =0 |
| Returns whether the player is the Replay bot. | |
Abstracts some Half-Life 2 and SourceMod properties about clients.
Definition at line 57 of file IPlayerHelpers.h.
| virtual const char* SourceMod::IGamePlayer::GetName | ( | ) | [pure virtual] |
Returns the player's name.
| virtual const char* SourceMod::IGamePlayer::GetIPAddress | ( | ) | [pure virtual] |
Returns the player's IP address.
| virtual const char* SourceMod::IGamePlayer::GetAuthString | ( | ) | [pure virtual] |
Returns the player's authentication string.
| virtual edict_t* SourceMod::IGamePlayer::GetEdict | ( | ) | [pure virtual] |
Returns the player's edict_t structure.
| virtual bool SourceMod::IGamePlayer::IsInGame | ( | ) | [pure virtual] |
Returns whether the player is in game (putinserver).
| virtual bool SourceMod::IGamePlayer::IsConnected | ( | ) | [pure virtual] |
Returns whether the player is connected.
Note: If this returns true, all above functions except for GetAuthString() should return non-NULL results.
| virtual bool SourceMod::IGamePlayer::IsFakeClient | ( | ) | [pure virtual] |
Returns whether the player is a fake client.
| virtual AdminId SourceMod::IGamePlayer::GetAdminId | ( | ) | [pure virtual] |
Returns the client's AdminId, if any.
| virtual void SourceMod::IGamePlayer::SetAdminId | ( | AdminId | id, | |
| bool | temp | |||
| ) | [pure virtual] |
Sets the client's AdminId.
| id | AdminId to set. | |
| temp | If true, the id will be invalidated on disconnect. |
| virtual int SourceMod::IGamePlayer::GetUserId | ( | ) | [pure virtual] |
Returns the client's userid.
| virtual unsigned int SourceMod::IGamePlayer::GetLanguageId | ( | ) | [pure virtual] |
Returns the client's language id.
| virtual IPlayerInfo* SourceMod::IGamePlayer::GetPlayerInfo | ( | ) | [pure virtual] |
Returns a player's IPlayerInfo object, if any.
| virtual bool SourceMod::IGamePlayer::RunAdminCacheChecks | ( | ) | [pure virtual] |
Runs through Core's admin authorization checks. If the client is already an admin, no checks are performed.
Note that this function operates solely against the in-memory admin cache. It will check steamids, IPs, names, and verify a password if one exists. To implement other authentication schemes, simply don't call this function and use IGamePlayer::SetAdminId() instead.
| virtual void SourceMod::IGamePlayer::NotifyPostAdminChecks | ( | ) | [pure virtual] |
Notifies all listeners that the client has completed all of your post-connection (in-game, auth, admin) checks.
If you returned "false" from OnClientPreAdminCheck(), you must ALWAYS manually invoke this function, even if RunAdminCacheChecks() failed or you did not assign an AdminId. Failure to call this function could result in plugins (such as reservedslots) not working properly.
If you are implementing asynchronous fetches, and the client disconnects during your fetching process, you should make sure to recognize that case and not call this function. That is, do not call this function on mismatched PreCheck calls, or on disconnected clients. A good way to check this is to pass userids around, which are unique per client connection.
Calling this has no effect if it has already been called on the given client (thus it is safe for multiple asynchronous plugins to call it at various times).
| virtual unsigned int SourceMod::IGamePlayer::GetSerial | ( | ) | [pure virtual] |
Returns the clients unique serial identifier.
| virtual bool SourceMod::IGamePlayer::IsAuthorized | ( | ) | [pure virtual] |
Return whether the client is authorized.
| virtual void SourceMod::IGamePlayer::Kick | ( | const char * | message | ) | [pure virtual] |
Kicks the client with a message.
| message | The message shown to the client when kicked |
| virtual bool SourceMod::IGamePlayer::IsInKickQueue | ( | ) | [pure virtual] |
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.
| virtual bool SourceMod::IGamePlayer::IsSourceTV | ( | ) | const [pure virtual] |
Returns whether the player is the SourceTV bot.
| virtual bool SourceMod::IGamePlayer::IsReplay | ( | ) | const [pure virtual] |
Returns whether the player is the Replay bot.
1.7.1