Go to the source code of this file.
|
void | MX_Forget (string room) |
|
void | MX_JLF_ (entity fh, entity pass, int status) |
|
void | MX_Join (string room) |
|
void | MX_Leave (string room) |
|
void | MX_Messages (string from) |
|
void | MX_Messages_ (entity fh, entity pass, int status) |
|
void | MX_Nick (string name) |
|
void | MX_Nick_ (entity fh, entity pass, int status) |
|
void | MX_Say (string body) |
|
void | MX_Say_ (entity fh, entity pass, int status) |
|
void | MX_Sync (string since) |
|
void | MX_Sync_ (entity fh, entity pass, int status) |
|
void | MX_Typing (bool state) |
|
void | MX_Typing_ (entity fh, entity pass, int status) |
|
◆ MX_Forget()
Definition at line 135 of file matrix.qc.
References autocvar_matrix_server, FILE_WRITE, matrix_access_token, matrix_room, MX_JLF_(), NULL, and url_single_fopen().
Referenced by GENERIC_COMMAND().
string matrix_access_token
ERASEABLE void url_single_fopen(string url, int mode, url_ready_func rdy, entity pass)
void MX_JLF_(entity fh, entity pass, int status)
string autocvar_matrix_server
◆ MX_JLF_()
Definition at line 145 of file matrix.qc.
References entity(), MX_Typing_(), pass, url_fclose(), url_fputs(), and URL_READY_CANWRITE.
Referenced by MX_Forget(), MX_Join(), MX_Leave(), and MX_Sync_().
149 fh.url_content_type =
"application/json";
const float URL_READY_CANWRITE
ERASEABLE void url_fputs(entity e, string s)
ERASEABLE void url_fclose(entity e)
#define pass(name, colormin, colormax)
◆ MX_Join()
Definition at line 115 of file matrix.qc.
References autocvar_matrix_server, FILE_WRITE, matrix_access_token, matrix_room, MX_JLF_(), NULL, and url_single_fopen().
Referenced by GENERIC_COMMAND().
string matrix_access_token
ERASEABLE void url_single_fopen(string url, int mode, url_ready_func rdy, entity pass)
void MX_JLF_(entity fh, entity pass, int status)
string autocvar_matrix_server
◆ MX_Leave()
Definition at line 125 of file matrix.qc.
References autocvar_matrix_server, FILE_WRITE, matrix_access_token, matrix_room, MX_JLF_(), NULL, and url_single_fopen().
Referenced by GENERIC_COMMAND().
string matrix_access_token
ERASEABLE void url_single_fopen(string url, int mode, url_ready_func rdy, entity pass)
void MX_JLF_(entity fh, entity pass, int status)
string autocvar_matrix_server
◆ MX_Messages()
Definition at line 34 of file matrix.qc.
References autocvar_matrix_server, FILE_READ, matrix_access_token, matrix_room, MX_Messages_(), NULL, and url_single_fopen().
Referenced by GENERIC_COMMAND(), and MX_Messages_().
string matrix_access_token
ERASEABLE void url_single_fopen(string url, int mode, url_ready_func rdy, entity pass)
void MX_Messages_(entity fh, entity pass, int status)
string autocvar_matrix_server
◆ MX_Messages_()
Definition at line 45 of file matrix.qc.
References _json_parse_object(), entity(), EXPECT_NE, json_get(), json_parse(), LOG_WARNF, MX_Handle(), MX_Messages(), MX_Sync_(), pass, stof(), strcat(), url_fclose(), url_fgets(), URL_READY_CANREAD, and URL_READY_CLOSED.
Referenced by MX_Messages(), and MX_Nick_().
59 for (
int i = 0, n =
stof(
json_get(buf,
"chunk.length")); i < n; ++i) {
const float URL_READY_CANREAD
const float URL_READY_CLOSED
ERASEABLE int json_parse(string in, bool() func)
#define EXPECT_NE(val1, val2)
ERASEABLE string json_get(int buf, string key)
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"))
ERASEABLE void url_fclose(entity e)
void MX_Messages(string from)
bool _json_parse_object()
parse a json object
ERASEABLE string url_fgets(entity e)
◆ MX_Nick()
Definition at line 6 of file matrix.qc.
References autocvar_matrix_server, entity(), FILE_WRITE, matrix_access_token, matrix_user, MX_Nick_(), name, new_pure, pass, and url_single_fopen().
Referenced by GENERIC_COMMAND().
string matrix_access_token
ERASEABLE void url_single_fopen(string url, int mode, url_ready_func rdy, entity pass)
#define new_pure(class)
purely logical entities (.origin doesn't work)
void MX_Nick_(entity fh, entity pass, int status)
#define pass(name, colormin, colormax)
string autocvar_matrix_server
◆ MX_Nick_()
Definition at line 18 of file matrix.qc.
References entity(), MX_Messages_(), pass, url_fclose(), url_fputs(), and URL_READY_CANWRITE.
Referenced by MX_Nick().
23 fh.url_content_type =
"application/json";
24 url_fputs(fh, sprintf(
"{\"displayname\": \"%s\"}",
pass.message));
const float URL_READY_CANWRITE
ERASEABLE void url_fputs(entity e, string s)
ERASEABLE void url_fclose(entity e)
#define pass(name, colormin, colormax)
◆ MX_Say()
Definition at line 187 of file matrix.qc.
References autocvar_matrix_server, entity(), FILE_WRITE, matrix_access_token, matrix_room, MX_Say_(), new_pure, pass, strzone(), and url_single_fopen().
Referenced by GENERIC_COMMAND(), and Say().
string matrix_access_token
ERASEABLE void url_single_fopen(string url, int mode, url_ready_func rdy, entity pass)
#define new_pure(class)
purely logical entities (.origin doesn't work)
#define pass(name, colormin, colormax)
void MX_Say_(entity fh, entity pass, int status)
string autocvar_matrix_server
◆ MX_Say_()
Definition at line 200 of file matrix.qc.
References pass, strfree, url_fclose(), url_fputs(), and URL_READY_CANWRITE.
Referenced by MX_Say(), and MX_Typing_().
205 fh.url_content_type =
"application/json";
206 url_fputs(fh, sprintf(
"{\"msgtype\": \"m.text\", \"body\": \"%s\"}",
pass.message));
const float URL_READY_CANWRITE
ERASEABLE void url_fputs(entity e, string s)
ERASEABLE void url_fclose(entity e)
#define pass(name, colormin, colormax)
◆ MX_Sync()
Definition at line 70 of file matrix.qc.
References autocvar_matrix_server, FILE_READ, matrix_access_token, matrix_room, MX_Sync_(), NULL, strcat(), and url_single_fopen().
Referenced by GENERIC_COMMAND(), and MX_Sync_().
78 sprintf(
"filter={\"account_data\":{\"types\":[]},\"presence\":{\"types\":[]},\"room\":{\"rooms\":[\"%s\"]}}&",
matrix_room)
83 "filter={\"account_data\":{\"types\":[]},\"presence\":{\"types\":[]},\"room\":{\"rooms\":[]}}&" void MX_Sync_(entity fh, entity pass, int status)
string matrix_access_token
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"))
ERASEABLE void url_single_fopen(string url, int mode, url_ready_func rdy, entity pass)
string autocvar_matrix_server
◆ MX_Sync_()
Definition at line 89 of file matrix.qc.
References _json_parse_object(), entity(), EXPECT_NE, json_get(), json_parse(), LOG_WARNF, matrix_room, MX_Handle(), MX_JLF_(), MX_Sync(), pass, stof(), strcat(), url_fclose(), url_fgets(), URL_READY_CANREAD, and URL_READY_CLOSED.
Referenced by MX_Messages_(), and MX_Sync().
103 string arr = sprintf(
"rooms.join.%s.timeline.events",
matrix_room);
104 for (
int i = 0, n =
stof(
json_get(buf, sprintf(
"%s.length", arr))); i < n; ++i) {
105 MX_Handle(buf, sprintf(
"%s.%d", arr, i));
const float URL_READY_CANREAD
const float URL_READY_CLOSED
ERASEABLE int json_parse(string in, bool() func)
#define EXPECT_NE(val1, val2)
ERASEABLE string json_get(int buf, string key)
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"))
ERASEABLE void url_fclose(entity e)
bool _json_parse_object()
parse a json object
void MX_Sync(string since)
ERASEABLE string url_fgets(entity e)
◆ MX_Typing()
Definition at line 159 of file matrix.qc.
References autocvar_matrix_server, entity(), FILE_WRITE, matrix_access_token, matrix_room, matrix_user, MX_Typing_(), new_pure, pass, and url_single_fopen().
Referenced by GENERIC_COMMAND().
163 pass.message =
state ?
"true" :
"false";
string matrix_access_token
void MX_Typing_(entity fh, entity pass, int status)
ERASEABLE void url_single_fopen(string url, int mode, url_ready_func rdy, entity pass)
#define new_pure(class)
purely logical entities (.origin doesn't work)
#define pass(name, colormin, colormax)
string autocvar_matrix_server
◆ MX_Typing_()
Definition at line 171 of file matrix.qc.
References entity(), MX_Say_(), pass, url_fclose(), url_fputs(), and URL_READY_CANWRITE.
Referenced by MX_JLF_(), and MX_Typing().
176 fh.url_content_type =
"application/json";
177 url_fputs(fh, sprintf(
"{\"typing\": %s, \"timeout\": 30000}",
pass.message));
const float URL_READY_CANWRITE
ERASEABLE void url_fputs(entity e, string s)
ERASEABLE void url_fclose(entity e)
#define pass(name, colormin, colormax)
◆ message