Public Member Functions

SourceMod::IGamePlayer Class Reference

Abstracts some Half-Life 2 and SourceMod properties about clients. More...

#include <public/IPlayerHelpers.h>

List of all members.

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.

Detailed Description

Abstracts some Half-Life 2 and SourceMod properties about clients.

Definition at line 57 of file IPlayerHelpers.h.


Member Function Documentation

virtual const char* SourceMod::IGamePlayer::GetName (  )  [pure virtual]

Returns the player's name.

Returns:
String containing the player's name, or NULL if unavailable.
virtual const char* SourceMod::IGamePlayer::GetIPAddress (  )  [pure virtual]

Returns the player's IP address.

Returns:
String containing the player's IP address, or NULL if unavailable.
virtual const char* SourceMod::IGamePlayer::GetAuthString (  )  [pure virtual]

Returns the player's authentication string.

Returns:
String containing the player's auth string. May be NULL if unavailable.
virtual edict_t* SourceMod::IGamePlayer::GetEdict (  )  [pure virtual]

Returns the player's edict_t structure.

Returns:
edict_t pointer, or NULL if unavailable.
virtual bool SourceMod::IGamePlayer::IsInGame (  )  [pure virtual]

Returns whether the player is in game (putinserver).

Returns:
True if in game, false otherwise.
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.

Returns:
True if connected, false otherwise.
virtual bool SourceMod::IGamePlayer::IsFakeClient (  )  [pure virtual]

Returns whether the player is a fake client.

Returns:
True if a fake client, false otherwise.
virtual AdminId SourceMod::IGamePlayer::GetAdminId (  )  [pure virtual]

Returns the client's AdminId, if any.

Returns:
AdminId, or INVALID_ADMIN_ID if none.
virtual void SourceMod::IGamePlayer::SetAdminId ( AdminId  id,
bool  temp 
) [pure virtual]

Sets the client's AdminId.

Parameters:
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.

Returns:
Userid.
virtual unsigned int SourceMod::IGamePlayer::GetLanguageId (  )  [pure virtual]

Returns the client's language id.

Returns:
Language id.
virtual IPlayerInfo* SourceMod::IGamePlayer::GetPlayerInfo (  )  [pure virtual]

Returns a player's IPlayerInfo object, if any.

Returns:
IPlayerInfo pointer, or NULL if none.
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.

Returns:
True if access changed, false otherwise.
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.

Returns:
Serial number.
virtual bool SourceMod::IGamePlayer::IsAuthorized (  )  [pure virtual]

Return whether the client is authorized.

Returns:
True if authorized, false otherwise.
virtual void SourceMod::IGamePlayer::Kick ( const char *  message  )  [pure virtual]

Kicks the client with a message.

Parameters:
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.

Returns:
True if in the kick queue, false otherwise.
virtual bool SourceMod::IGamePlayer::IsSourceTV (  )  const [pure virtual]

Returns whether the player is the SourceTV bot.

Returns:
True if the SourceTV bot, false otherwise.
virtual bool SourceMod::IGamePlayer::IsReplay (  )  const [pure virtual]

Returns whether the player is the Replay bot.

Returns:
True if the Replay bot, false otherwise.

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