-
Notifications
You must be signed in to change notification settings - Fork 10
Filtering
SMJSGaming edited this page Aug 5, 2024
·
2 revisions
GDIntercept allows you to filter requests and responses with a set of options to make your event listeners more specific. This is done by using the RequestFilter and ResponseFilter classes in the event listener constructors.
GDIntercept has a few origins it recognizes, these are:
-
OriginFilter::GD_FILTER: Every request sent to: -
OriginFilter::GD_CDN_FILTER: Every request sent to: -
OriginFilter::ROBTOP_GAMES_FILTER: Every request sent to: -
OriginFilter::NEWGROUNDS_FILTER: Every request sent to: -
OriginFilter::GEODE_FILTER: Every request sent to: -
OriginFilter:LOCALHOST_FILTER: Every request sent to: -
OriginFilter::OTHER_FILTER: Every request that doesn't match any of the above -
OriginFilter::ALL_FILTER: Every request
RequestFilter(OriginFilter::GD_FILTER)
ResponseFilter(OriginFilter::GD_CDN_FILTER)You can also filter requests based on a part of the URL (excluding the query string). This is done by giving a string vector to the filter constructor:
// Possible URLs:
// https://www.boomlings.com/database/getGJLevels21.php
// https://geometrydash.com/index.php
RequestFilter({"boomlings.com/database", "geometrydash.com"})
// Possible URLs:
// https://boomlings.com/database/accounts/loginGJAccount.php
ResponseFilter({"https://boomlings.com/database"})Node listeners require the filter to be provided in the template arg. As a result, the last parameters of the this->template addEventListener functions are the filters constructor parameters:
// The filter parameter is optional, otherwise it can be filled in with any of the standard parameters
this->template addEventListener<RequestFilter>([=](const RequestEvent* event) {
// ...
}, OriginFilter::ALL_FILTER);