This game is offline/ inaccessible on this website
70 | `;
71 |
72 | // Add our styles.
73 | const head = document.head || document.getElementsByTagName('head')[0];
74 | const style = document.createElement('style');
75 | style.type = 'text/css';
76 | style.appendChild(document.createTextNode(css));
77 | head.appendChild(style);
78 |
79 | // Add our fonts.
80 | const font = document.createElement('link');
81 | font.type = 'text/css';
82 | font.rel = 'stylesheet';
83 | font.href = 'https://fonts.googleapis.com/css?family=Squada+One';
84 | head.appendChild(font);
85 |
86 | // Add our markup.
87 | this.container = document.createElement('div');
88 | this.container.innerHTML = html;
89 | this.container.id = this.options.prefix;
90 | this.container.className = this.options.prefix;
91 | this.container.addEventListener('click', () => {
92 | window.open(this.options.url, '_blank');
93 | });
94 | const body = document.body || document.getElementsByTagName('body')[0];
95 | body.insertBefore(this.container, body.firstChild);
96 | }
97 | }
98 |
99 | new Deleted();
100 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://nodejs.org/)
2 | [](https://github.com/GameDistribution/GD-HTML5/)
3 | [](https://github.com/GameDistribution/GD-HTML5/blob/master/LICENSE)
4 |
5 |
6 | # Gamedistribution.com HTML5 SDK
7 | This is the documentation of the "GameDistribution.com HTML5 SDK" project.
8 |
9 | Gamedistribution.com is the biggest broker of high quality, cross-platform games. We connect the best game developers to the biggest publishers.
10 |
11 | Running into any issues? Check out the F.A.Q. within the Wiki of the github repository before mailing to support@gamedistribution.com
12 |
13 | ## Implementation within games
14 | The SDK should be integrated within HTML5 games by loading it through our CDN. Specific information of the SDK features and usages can be found at the wiki.
15 |
16 | ### Implementation self-hosted games.
17 | In the case where a developer wants to self-host their game; the SDK should be implemented within the game as aforementioned. The only difference is that they will have to upload a zipped `index.html`-file containing an iframe with the following query variable: `GD_SDK_REFERRER_URL`. The value of this variable should be the parentUrl. A perfect example can be found at `./index_iframe.html`.
18 |
19 | ## Debugging
20 | Games, which include the SDK, can be easily debugged by calling the following from a browser developer console:
21 | ```
22 | gdsdk.openConsole();
23 | ```
24 | The gdsdk namespace is set when creating the SDK instance. We can't change the name of this namespace as it is still used within games using the old SDK implementation.
25 |
26 | ## Repository
27 | The SDK is maintained on a public github repository.
28 | https://github.com/gamedistribution/GD-HTML5
29 |
30 | ## Deployment
31 | Deployment of the SDK to production environments is done through TeamCity.
32 |
33 | ## Installation for development
34 | Install the following programs:
35 | * [NodeJS LTS](https://nodejs.org/).
36 | * [Grunt](http://gruntjs.com/).
37 |
38 | Pull in the rest of the requirements using npm:
39 | ```
40 | npm install
41 | ```
42 |
43 | Setup a local node server, watch changes and update your browser view automatically:
44 | ```
45 | grunt
46 | ```
47 |
48 | Make a production build:
49 | ```
50 | grunt build
51 | ```
52 |
53 | Make a production build of the promotion script. This script is loaded through advertisement slots to support for cross promotions:
54 | ```
55 | grunt promo
56 | ```
57 |
58 | ## Events
59 | ### SDK EVENTS
60 | The SDK events should be used by developers to start or pause their game or handling critical errors. Unless the errors are ad related, then they could hook into the AD_ERROR event, however; the SDK should gracefully fail, so this should not be needed.
61 |
62 | | Event | Description |
63 | | --- | --- |
64 | | SDK_READY | When the SDK is ready. |
65 | | SDK_ERROR | When the SDK has hit a critical error. |
66 | | SDK_GAME_START | When the game should start. |
67 | | SDK_GAME_PAUSE | When the game should pause. |
68 | | SDK_GDPR_TRACKING | When the publishers' client has requested to not track his/ her data. Hook into this event to find out if you can record client tracking data. |
69 | | SDK_GDPR_TARGETING | When the publishers' client has requested to not get personalised advertisements. Hook into this event to find out if you can display personalised advertisements in case you use another ad solution. |
70 | | SDK_GDPR_THIRD_PARTY | When the publishers' client has requested to not load third party services. Hook into this event to find out if you can third party services like Facebook, AddThis, and such alike. |
71 |
72 | ### IMA SDK EVENTS
73 | The SDK events are custom ads for handling any thing related to the IMA SDK itself.
74 |
75 | | Event | Description |
76 | | --- | --- |
77 | | AD_SDK_MANAGER_READY | When the adsManager instance is ready with ads. |
78 | | AD_SDK_CANCELED | When the ad is cancelled or stopped because its done running an ad. |
79 |
80 | ### AD EVENTS
81 | The Gamedistribution.com SDK uses the IMA SDK for loading ads. All events of this SDK are also available to the developer.
82 | https://developers.google.com/interactive-media-ads/docs/sdks/html5/
83 |
84 | | Event | Description |
85 | | --- | --- |
86 | | AD_ERROR | When the ad it self has an error. |
87 | | AD_BREAK_READY | Fired when an ad rule or a VMAP ad break would have played if autoPlayAdBreaks is false. |
88 | | AD_METADATA | Fired when an ads list is loaded. |
89 | | ALL_ADS_COMPLETED | Fired when the ads manager is done playing all the ads. |
90 | | CLICK | Fired when the ad is clicked. |
91 | | COMPLETE | Fired when the ad completes playing. |
92 | | CONTENT_PAUSE_REQUESTED | Fired when content should be paused. This usually happens right before an ad is about to cover the content. |
93 | | CONTENT_RESUME_REQUESTED | Fired when content should be resumed. This usually happens when an ad finishes or collapses. |
94 | | DURATION_CHANGE | Fired when the ad's duration changes. |
95 | | FIRST_QUARTILE | Fired when the ad playhead crosses first quartile. |
96 | | IMPRESSION | Fired when the impression URL has been pinged. |
97 | | INTERACTION | Fired when an ad triggers the interaction callback. Ad interactions contain an interaction ID string in the ad data. |
98 | | LINEAR_CHANGED | Fired when the displayed ad changes from linear to nonlinear, or vice versa. |
99 | | LOADED | Fired when ad data is available. |
100 | | LOG | Fired when a non-fatal error is encountered. The user need not take any action since the SDK will continue with the same or next ad playback depending on the error situation. |
101 | | MIDPOINT | Fired when the ad playhead crosses midpoint. |
102 | | PAUSED | Fired when the ad is paused. |
103 | | RESUMED | Fired when the ad is resumed. |
104 | | SKIPPABLE_STATE_CHANGED | Fired when the displayed ads skippable state is changed. |
105 | | SKIPPED | Fired when the ad is skipped by the user. |
106 | | STARTED | Fired when the ad starts playing. |
107 | | THIRD_QUARTILE | Fired when the ad playhead crosses third quartile. |
108 | | USER_CLOSE | Fired when the ad is closed by the user. |
109 | | VOLUME_CHANGED | Fired when the ad volume has changed. |
110 | | VOLUME_MUTED | Fired when the ad volume has been muted. |
111 |
--------------------------------------------------------------------------------
/blocked/blocked.js:
--------------------------------------------------------------------------------
1 | function getQueryParams() {
2 | const params = new URLSearchParams(window.location.search);
3 | return {
4 | domain: params.get('domain'),
5 | id: params.get('id'),
6 | img: params.get('img'),
7 | title: params.get('title'),
8 | unregistered: params.get('unregistered'),
9 | utm_source: params.get('utm_source'),
10 | utm_medium: params.get('utm_medium'),
11 | utm_campaign: params.get('utm_campaign')
12 | };
13 | }
14 |
15 | let instance = null;
16 |
17 | class Blocked {
18 | /**
19 | * Constructor of SDK Blocked.
20 | * @return {*}
21 | */
22 | constructor() {
23 | // Make this a singleton.
24 | if (instance) {
25 | return instance;
26 | } else {
27 | instance = this;
28 | }
29 |
30 | const params = getQueryParams();
31 |
32 | const domain = params.domain || 'gamedistribution.com';
33 | const gameId = params.id || '49258a0e497c42b5b5d87887f24d27a6';
34 | const gameImg = params.img || 'https://img.gamedistribution.com/49258a0e497c42b5b5d87887f24d27a6-512x512.jpeg';
35 | const title = params.title || 'Jewel Burst';
36 | const unregistered = params.unregistered === 'true' || false;
37 | const utm_source = params.utm_source || domain;
38 | const utm_medium = params.utm_medium || title;
39 | const utm_campaign = params.utm_campaign || "block-and-redirect";
40 |
41 | // Burada mesajı unregistered'a göre seçiyoruz
42 | let message;
43 | if (unregistered) {
44 | message = '%c %c %c GameDistribution.com BLOCKED! %c %c %c It seems this website has not finished the onboarding process or has not registered to GameDistribution.com. Check on your onboarding process or contact customer support. ';
45 | } else {
46 | message = '%c %c %c GameDistribution.com BLOCKED! %c %c %c This game is not available for this website. ';
47 | }
48 |
49 | // Set a version banner within the developer console.
50 | const banner = console.log(
51 | message,
52 | 'background: #9854d8',
53 | 'background: #6c2ca7', 'color: #fff; background: #450f78;',
54 | 'background: #6c2ca7', 'background: #9854d8',
55 | 'background: #c4161e; color: #fff;'
56 | );
57 | /* eslint-disable */
58 | console.log.apply(console, banner);
59 | /* eslint-enable */
60 |
61 | this.options = {
62 | url: `https://html5.gamedistribution.com/${gameId}/?utm_source=${utm_source}&utm_medium=${utm_medium}&utm_campaign=${utm_campaign}`,
63 | prefix: 'gdsdk-blocked__',
64 | img: gameImg,
65 | title: title,
66 | unregistered: unregistered
67 | };
68 |
69 | this.container = null;
70 |
71 | this.start();
72 | }
73 |
74 | /**
75 | * start()
76 | * Starts the promo, which is usually called from an ad slot.
77 | */
78 | start() {
79 | /* eslint-disable */
80 | const css = `
81 | .${this.options.prefix} {
82 | box-sizing: border-box;
83 | position: fixed;
84 | z-index: 666;
85 | top: 0;
86 | left: 0;
87 | width: 100%;
88 | height: 100%;
89 | padding: 40px;
90 | overflow: hidden;
91 | background: linear-gradient(0deg, #333, #000);
92 | display: flex;
93 | flex-direction: column;
94 | justify-content: center;
95 | align-items: center;
96 | }
97 | .${this.options.prefix} h1,
98 | .${this.options.prefix} h2 {
99 | color: #fff;
100 | text-align: center;
101 | text-transform: uppercase;
102 | font-family: Helvetica, Arial, sans-serif;
103 | font-weight: bold;
104 | }
105 | .${this.options.prefix} h1 {
106 | font-size: 18px;
107 | }
108 | .${this.options.prefix} h2 {
109 | font-size: 14px;
110 | font-weight: normal;
111 | }
112 | .${this.options.prefix} a {
113 | color: #fff;
114 | }
115 | .${this.options.prefix} .thumbnail {
116 | width: 150px;
117 | height: 150px;
118 | border-radius: 4px;
119 | background-position: center;
120 | background-size: cover!;
121 | box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
122 | background: url("${this.options.img}") 0% 0% / cover;
123 | }
124 | .${this.options.prefix} > .play {
125 | box-sizing: border-box;
126 | z-index: 1;
127 | border: 0;
128 | width: 150px;
129 | padding: 10px 22px;
130 | border-radius: 5px;
131 | border: 3px solid white;
132 | margin: 16px;
133 | background: linear-gradient(0deg, #dddddd, #ffffff);
134 | color: #222;
135 | text-transform: uppercase;
136 | text-shadow: 0 0 1px #fff;
137 | font-family: Helvetica, Arial, sans-serif;
138 | font-size: 18px;
139 | cursor: pointer;
140 | box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
141 | -webkit-appearance: button;
142 | -moz-appearance: button;
143 | appearance: button;
144 |
145 | text-decoration: none;
146 | color: initial;
147 | text-align: center;
148 | }
149 |
150 | .${this.options.prefix} > .play:hover {
151 | background: linear-gradient(0deg, #ffffff, #dddddd);
152 | }
153 | .${this.options.prefix} > .play:active {
154 | box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
155 | background: linear-gradient(0deg, #ffffff, #f5f5f5);
156 | }
157 |
158 | .${this.options.prefix} a[target="_blank"]::after {
159 | content: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAQElEQVR42qXKwQkAIAxDUUdxtO6/RBQkQZvSi8I/pL4BoGw/XPkh4XigPmsUgh0626AjRsgxHTkUThsG2T/sIlzdTsp52kSS1wAAAABJRU5ErkJggg==);
160 | margin: 0 3px 0 5px;
161 | }
162 | `;
163 |
164 | // const html = `
It seems this website has not finished the onboarding process or has not registered to
182 | //
183 | // Gamedistribution.com.
184 | //
185 | //
186 | // Please sign up hereor check on your onboarding process.
187 | //