]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/chat.qh
Merge branch 'master' into LegendaryGuard/cyber
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / chat.qh
1 #pragma once
2
3 float autocvar_g_chat_flood_burst;
4 float autocvar_g_chat_flood_burst_team;
5 float autocvar_g_chat_flood_burst_tell;
6 float autocvar_g_chat_flood_lmax;
7 float autocvar_g_chat_flood_lmax_team;
8 float autocvar_g_chat_flood_lmax_tell;
9 bool autocvar_g_chat_flood_notify_flooder;
10 float autocvar_g_chat_flood_spl;
11 float autocvar_g_chat_flood_spl_team;
12 float autocvar_g_chat_flood_spl_tell;
13 int autocvar_g_chat_nospectators;
14 bool autocvar_g_chat_teamcolors;
15 bool autocvar_g_chat_tellprivacy;
16
17 bool autocvar_sv_chat_sounds;
18 float autocvar_sv_chat_sounds_flood;
19 string autocvar_sv_chat_sounds_list;
20
21 const float NUM_NEAREST_ENTITIES = 4;
22 entity nearest_entity[NUM_NEAREST_ENTITIES];
23 float nearest_length[NUM_NEAREST_ENTITIES];
24
25 .float floodcontrol_chat;
26 .float floodcontrol_chatteam;
27 .float floodcontrol_chattell;
28 .float floodcontrol_voice;
29 .float floodcontrol_voiceteam;
30 .float floodcontrol_chatsound;
31
32 #define CHAT_NOSPECTATORS() ((autocvar_g_chat_nospectators == 1) || (autocvar_g_chat_nospectators == 2 && !warmup_stage))
33
34 int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodcontrol);
35 bool play_chatsound(entity source, string msgin);
36
37 string NearestLocation(vector p);
38
39 string formatmessage(entity this, string msg);
40
41 /// \brief Print the string to the client's chat.
42 /// \param[in] client Client to print to.
43 /// \param[in] text Text to print.
44 void PrintToChat(entity client, string text);
45
46 /// \brief Print the string to the client's chat if the server cvar "developer"
47 /// is not 0.
48 /// \param[in] client Client to print to.
49 /// \param[in] text Text to print.
50 void DebugPrintToChat(entity client, string text);
51
52 /// \brief Prints the string to all clients' chat.
53 /// \param[in] text Text to print.
54 void PrintToChatAll(string text);
55
56 /// \brief Prints the string to all clients' chat if the server cvar "developer"
57 /// is not 0.
58 /// \param[in] text Text to print.
59 void DebugPrintToChatAll(string text);
60
61 /// \brief Print the string to chat of all clients of the specified team.
62 /// \param[in] team_num Team to print to. See NUM_TEAM constants.
63 /// \param[in] text Text to print.
64 void PrintToChatTeam(int team_num, string text);
65
66 /// \brief Print the string to chat of all clients of the specified team if the
67 /// server cvar "developer" is not 0.
68 /// \param[in] team_num Team to print to. See NUM_TEAM constants.
69 /// \param[in] text Text to print.
70 void DebugPrintToChatTeam(int team_num, string text);