Xonotic
cmd.qh File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void ClientCommand_macro_write_aliases (float fh)
 
string MapVote_Suggest (entity this, string m)
 

Variables

int autocvar_sv_clientcommand_antispam_count
 
float autocvar_sv_clientcommand_antispam_time
 
float cmd_floodcount
 
float cmd_floodtime
 

Function Documentation

◆ ClientCommand_macro_write_aliases()

void ClientCommand_macro_write_aliases ( float  fh)

Definition at line 852 of file cmd.qc.

References CLIENT_COMMANDS, and NULL.

Referenced by GENERIC_COMMAND().

853 {
854  #define CLIENT_COMMAND(name, function, description) \
855  { CMD_Write_Alias("qc_cmd_cmd", name, description); }
856 
857  CLIENT_COMMANDS(NULL, 0, 0, "");
858 #undef CLIENT_COMMAND
859 }
#define CLIENT_COMMANDS(ent, request, arguments, command)
Definition: cmd.qc:800
#define NULL
Definition: post.qh:17
+ Here is the caller graph for this function:

◆ MapVote_Suggest()

string MapVote_Suggest ( entity  this,
string  m 
)

Definition at line 119 of file mapvoting.qc.

References autocvar_g_maplist_votable_suggestions, autocvar_g_maplist_votable_suggestions_override_mostrecent, autocvar_sv_eventlog, autocvar_sv_vote_gametype, floor(), ftos(), GameLogEcho(), gametypevote, GameTypeVote_MapInfo_FixName(), Map_IsRecent(), MapInfo_CheckMap(), mapvote_initialized, mapvote_suggestion_ptr, mapvote_suggestions, playerid, random(), strcat(), strunzone(), and strzone().

Referenced by ClientCommand_suggestmap().

120 {
121  int i;
122  if(m == "")
123  return "That's not how to use this command.";
125  return "Suggestions are not accepted on this server.";
127  if(!gametypevote)
128  return "Can't suggest - voting is already in progress!";
130  if (!m)
131  return "The map you suggested is not available on this server.";
133  if(Map_IsRecent(m))
134  return "This server does not allow for recent maps to be played again. Please be patient for some rounds.";
135 
137  if(!MapInfo_CheckMap(m))
138  return "The map you suggested does not support the current game mode.";
139  for(i = 0; i < mapvote_suggestion_ptr; ++i)
140  if(mapvote_suggestions[i] == m)
141  return "This map was already suggested.";
142  if(mapvote_suggestion_ptr >= MAPVOTE_COUNT)
143  {
144  i = floor(random() * mapvote_suggestion_ptr);
145  }
146  else
147  {
149  mapvote_suggestion_ptr += 1;
150  }
151  if(mapvote_suggestions[i] != "")
155  GameLogEcho(strcat(":vote:suggested:", m, ":", ftos(this.playerid)));
156  return strcat("Suggestion of ", m, " accepted.");
157 }
bool autocvar_g_maplist_votable_suggestions
Definition: mapvoting.qh:15
int mapvote_suggestion_ptr
Definition: mapvoting.qc:34
string mapvote_suggestions[MAPVOTE_COUNT]
Definition: mapvoting.qc:33
int playerid
Definition: client.qh:78
string GameTypeVote_MapInfo_FixName(string m)
Definition: mapvoting.qc:95
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
void GameLogEcho(string s)
Definition: gamelog.qc:12
float MapInfo_CheckMap(string s)
Definition: mapinfo.qc:1170
bool Map_IsRecent(string m)
float gametypevote
Definition: mapvoting.qc:40
bool autocvar_g_maplist_votable_suggestions_override_mostrecent
Definition: mapvoting.qh:16
float mapvote_initialized
Definition: mapvoting.qh:39
bool autocvar_sv_eventlog
Definition: gamelog.qh:3
bool autocvar_sv_vote_gametype
Definition: mapvoting.qh:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ autocvar_sv_clientcommand_antispam_count

int autocvar_sv_clientcommand_antispam_count

Definition at line 4 of file cmd.qh.

Referenced by SV_ParseClientCommand_floodcheck().

◆ autocvar_sv_clientcommand_antispam_time

float autocvar_sv_clientcommand_antispam_time

Definition at line 3 of file cmd.qh.

Referenced by SV_ParseClientCommand_floodcheck().

◆ cmd_floodcount

float cmd_floodcount

Definition at line 7 of file cmd.qh.

◆ cmd_floodtime

float cmd_floodtime

Definition at line 6 of file cmd.qh.