Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
matrix.qc
Go to the documentation of this file.
1
#include "
matrix.qh
"
2
3
#include <
server/chat.qh
>
4
5
var
void
MX_Handle
(
int
buf,
string
ancestor)
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
}
json_get
ERASEABLE string json_get(int buf, string key)
Definition
json.qc:276
matrix_user
string matrix_user
Definition
matrix.qh:4
MX_Handle
var void MX_Handle(int buf, string ancestor)
Definition
matrix.qc:3
strcat
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
NULL
#define NULL
Definition
post.qh:14
Say
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
chat.qh
matrix.qh
server
matrix.qc
Generated on
for Xonotic QuakeC by
1.14.0