Add a mutator hook for handling URIs
authorMario <mario@smbclan.net>
Mon, 8 Feb 2016 00:29:51 +0000 (10:29 +1000)
committerMario <mario@smbclan.net>
Mon, 8 Feb 2016 00:30:08 +0000 (10:30 +1000)
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/events.qh

index 9bd6024..2a3ef87 100644 (file)
@@ -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");
index 00d2716..d81b2b1 100644 (file)
@@ -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