--- title: "AdServer" # description: "description" # layout: "definition" page_status: see_also: - "[Ad Server @ Smash Hit Lab](https://antifandom.com/smashhitlab/wiki/Ad_Server) (Used as an source for most of the content)" --- The Ad Server provides data used by the game to serve advertisements, in form of an UI xml file (`ads.xml`), an icon (`ads-icon.png`) and the full banner (`ads-front.png`). ## Details ### Retrieving To check for ads, the game sends an HTTP GET request for: ```plain http://grannysmithgame.com/ads/ads.php?product={product}&platform={platform}&version={version}&rev={rev} ``` - `product`: most likely used to indicate if the game is a `full` version or the `free` one - `platform`: platform that the game is on, for example android - `version`: game version - `rev`: most likely an advertisement revision The server responds with an zero length document if no advertisements are available. If there are any ads to show, then the server will respond with an xml document: ```xml ``` - `revision`: current advert revision. If zero, then none are available and no other field needs to be filled - `showfront`: unknown - `onlyfree`: most likely used to show ads only to the users of Granny Smith Free - `sale`: unknown - `folder`: a subfolder where advertisement files are stored. ### Display The advertisements use UI xml files and are shown when clicking the icon in the top-left corner of the screen. ## Examples Example response for an ad listing might look like this: ```xml ``` For the following files: ```plain http://grannysmithgame.com/ads/data/ads.xml http://grannysmithgame.com/ads/data/ads-front.png http://grannysmithgame.com/ads/data/ads-icon.png ``` Example `ads.xml` file: ```xml ```