Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
matrix.qc File Reference
#include "matrix.qh"
#include <server/chat.qh>
Include dependency graph for matrix.qc:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

var void MX_Handle (int buf, string ancestor)

Function Documentation

◆ MX_Handle()

var void MX_Handle ( int buf,
string ancestor )

Definition at line 5 of file matrix.qc.

6{
7 string type = json_get(buf, strcat(ancestor, ".type"));
8 switch (type) {
9 case "m.room.message": {
10 string msgtype = json_get(buf, strcat(ancestor, ".content.msgtype"));
11 switch (msgtype) {
12 case "m.text": {
13 string sender = json_get(buf, strcat(ancestor, ".sender"));
14 string body = json_get(buf, strcat(ancestor, ".content.body"));
15 if (sender != matrix_user && body) Say(NULL, false, NULL, body, false);
16 break;
17 }
18 }
19 break;
20 }
21 }
22}
ERASEABLE string json_get(int buf, string key)
Definition json.qc:276
string matrix_user
Definition matrix.qh:4
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
#define NULL
Definition post.qh:14
int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodcontrol)
message "": do not say, just test flood control return value: 1 = accept 0 = reject -1 = fake accept
Definition chat.qc:27

References json_get(), matrix_user, NULL, Say(), and strcat().