]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/chat.qh
Fix string length checks in world.qc and add VM_TEMPSTRING_MAXSIZE
[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 bool autocvar_g_chat_allowed;
14 bool autocvar_g_chat_private_allowed;
15 bool autocvar_g_chat_spectator_allowed;
16 bool autocvar_g_chat_team_allowed;
17 int autocvar_g_chat_nospectators;
18 bool autocvar_g_chat_teamcolors;
19 bool autocvar_g_chat_tellprivacy;
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
31 #define CHAT_NOSPECTATORS() ((autocvar_g_chat_nospectators == 1) || (autocvar_g_chat_nospectators == 2 && !warmup_stage))
32
33 int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodcontrol);
34
35 string NearestLocation(vector p);
36
37 string formatmessage(entity this, string msg);
38
39 /// \brief Print the string to the client's chat.
40 /// \param[in] client Client to print to.
41 /// \param[in] text Text to print.
42 void PrintToChat(entity client, string text);
43
44 /// \brief Print the string to the client's chat if the server cvar "developer"
45 /// is not 0.
46 /// \param[in] client Client to print to.
47 /// \param[in] text Text to print.
48 void DebugPrintToChat(entity client, string text);
49
50 /// \brief Prints the string to all clients' chat.
51 /// \param[in] text Text to print.
52 void PrintToChatAll(string text);
53
54 /// \brief Prints the string to all clients' chat if the server cvar "developer"
55 /// is not 0.
56 /// \param[in] text Text to print.
57 void DebugPrintToChatAll(string text);
58
59 /// \brief Print the string to chat of all clients of the specified team.
60 /// \param[in] team_num Team to print to. See NUM_TEAM constants.
61 /// \param[in] text Text to print.
62 void PrintToChatTeam(int team_num, string text);
63
64 /// \brief Print the string to chat of all clients of the specified team if the
65 /// server cvar "developer" is not 0.
66 /// \param[in] team_num Team to print to. See NUM_TEAM constants.
67 /// \param[in] text Text to print.
68 void DebugPrintToChatTeam(int team_num, string text);