2016-07-26 19:31:47 +03:00
|
|
|
#pragma once
|
2016-07-26 03:22:47 +03:00
|
|
|
|
2016-07-26 19:31:47 +03:00
|
|
|
#include "types_meta.h"
|
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
|
|
|
|
2016-07-26 19:31:47 +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 15:18:32 +03:00
|
|
|
private:
|
2016-07-30 02:03:01 +03:00
|
|
|
bool isQueried; // is this player currently queried for a cvar value
|
2016-07-26 19:31:47 +03:00
|
|
|
char 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:
|
2016-07-26 19:31:47 +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);
|
|
|
|
void clear_all_cvar_queries();
|
2016-07-26 15:18:32 +03:00
|
|
|
const char *is_querying_cvar(const edict_t *pEntity) const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
int maxplayers = 32;
|
2016-07-26 19:31:47 +03:00
|
|
|
MPlayer players[MAX_CLIENTS + 1]; // array of players
|
2016-07-26 03:22:47 +03:00
|
|
|
};
|