2016-07-26 19:31:47 +03:00
|
|
|
#pragma once
|
2016-07-26 03:22:47 +03:00
|
|
|
|
|
|
|
// Info on an individual player
|
2016-07-26 15:18:32 +03:00
|
|
|
class MPlayer
|
2016-07-26 03:22:47 +03:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
MPlayer();
|
2016-07-26 15:18:32 +03:00
|
|
|
|
2017-05-09 19:31:09 +03:00
|
|
|
void set_cvar_query(const char* cvar); // mark this player as querying a client cvar
|
|
|
|
void clear_cvar_query(const char* cvar = nullptr); // unmark this player as querying a client cvar
|
|
|
|
const char* is_querying_cvar() const; // check if a player is querying a cvar. returns
|
2016-07-26 19:31:47 +03:00
|
|
|
|
2016-07-26 15:18:32 +03:00
|
|
|
private:
|
2017-05-09 19:31:09 +03:00
|
|
|
bool m_isQueried; // is this player currently queried for a cvar value
|
|
|
|
char g_cvarName[64]; // name of the cvar if getting queried
|
2016-07-26 03:22:47 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
// A list of players. The number of max players is fixed and small enough
|
|
|
|
// to use an array.
|
|
|
|
class MPlayerList
|
2016-07-26 19:31:47 +03:00
|
|
|
{
|
2016-07-26 03:22:47 +03:00
|
|
|
public:
|
2017-05-09 19:31:09 +03:00
|
|
|
void set_player_cvar_query(const edict_t* pEntity, const char* cvar);
|
|
|
|
void clear_player_cvar_query(const edict_t* pEntity, const char* cvar = nullptr);
|
2016-07-26 19:31:47 +03:00
|
|
|
void clear_all_cvar_queries();
|
2017-05-09 19:31:09 +03:00
|
|
|
const char* is_querying_cvar(const edict_t* pEntity) const;
|
2016-07-26 15:18:32 +03:00
|
|
|
|
|
|
|
private:
|
2017-01-13 03:00:23 +03:00
|
|
|
int m_maxplayers = 32;
|
2017-05-09 19:31:09 +03:00
|
|
|
MPlayer m_players[MAX_CLIENTS + 1]; // array of players
|
2016-07-26 03:22:47 +03:00
|
|
|
};
|