From: Mario Date: Mon, 8 Feb 2016 00:29:51 +0000 (+1000) Subject: Add a mutator hook for handling URIs X-Git-Tag: xonotic-v0.8.2~1196 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=8437190c858ade8be86b814e5357f0afbdcb39bb Add a mutator hook for handling URIs --- diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 9bd6024266..2a3ef87341 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -1114,6 +1114,10 @@ void URI_Get_Callback(float id, float status, string data) // online ban list OnlineBanList_URI_Get_Callback(id, status, data); } + else if (MUTATOR_CALLHOOK(URI_GetCallback, id, status, data)) + { + // handled by a mutator + } else { LOG_INFO("Received HTTP request data for an invalid id ", ftos(id), ".\n"); diff --git a/qcsrc/server/mutators/events.qh b/qcsrc/server/mutators/events.qh index 00d2716e4b..d81b2b1a5b 100644 --- a/qcsrc/server/mutators/events.qh +++ b/qcsrc/server/mutators/events.qh @@ -846,4 +846,15 @@ MUTATOR_HOOKABLE(MonsterModel, EV_MonsterModel); float pct_curteam; float pct_newteam; MUTATOR_HOOKABLE(Player_ChangeTeam, EV_Player_ChangeTeam); + +/**/ +#define EV_URI_GetCallback(i, o) \ + /**/ i(float, uricb_id) \ + /**/ i(float, uricb_status) \ + /**/ i(string, uricb_data) \ + /**/ +float uricb_id; +float uricb_status; +string uricb_data; +MUTATOR_HOOKABLE(URI_GetCallback, EV_URI_GetCallback); #endif