forked from ven0m2610/shell-shockers-io
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
9414 lines (8270 loc) · 327 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<script>
var gameServerRoot = null;
var dynamicContentRoot = null;
var dynamicContentPrefix = '';
</script>
<script>
class Loader {
static show () {
let container = document.createElement('div');
container.id = 'progress-container';
container.style = `
position: fixed;
top: 0;
left: 0;
height: 100vh;
width: 100vw;
z-index: 2000;
background-image: var(--ss-lightoverlay);
`;
const progressWrapper = document.createElement('div');
progressWrapper.id = 'progress-wrapper';
progressWrapper.className = 'load_screen';
progressWrapper.style = `
position: absolute;
left: 50%;
top: -6em;
transform: translateX(-50%);
background-image: none;
`;
const blueWizLogo = document.createElement('img');
blueWizLogo.src = 'img/BlueWizard-Logo-min.png';
blueWizLogo.style=`
width: 16em;
display: block;
margin: 5em auto 0;
z-index: 2000;
position: absolute;
left: 50%;
bottom: 8em;
transform: translateX(-50%);
`;
let logo = document.createElement('img');
logo.src = 'img/logo.svg';
logo.style = 'height: 16em';
logo.id = 'logo-svg';
// container.appendChild(logo);
const progressOuter = document.createElement('div');
progressOuter.id = 'progress-outer';
progressOuter.style = `
position: relative;
background: #643219;
border-radius: 2em;
height: 3.3em;
width: 24em;
margin-top: 2em;
`;
let progress = document.createElement('div');
progress.style = `
margin-top: 1em;
width: 23em;
height: 2.2em;
background: white;
padding: 0.5em;
border-radius: 2em;
margin: .3em .5em 0;
`;
container.appendChild(progress);
let progressBar = document.createElement('span');
progressBar.id = 'progressBar';
progressBar.style = `
display: block;
width: 20%;
height: 100%;
background: orange;
border-radius: 2em;
margin-left: 80%;
margin: 0 .3em .5em 0;
opacity: 0;
transition: margin-left linear 500ms;
transition-timing-function: ease-in-out;
`;
const progressBarOutside = document.createElement('div');
progress.appendChild(progressBar);
progressWrapper.appendChild(logo);
progressOuter.appendChild(progress);
progressWrapper.appendChild(progressOuter);
container.appendChild(progressWrapper);
container.appendChild(blueWizLogo);
// Minor for the progress bar intial load
setTimeout(() => progressBar.style.opacity = 1, 600);
Loader.barInterval = setInterval(() => {
if (Loader.progressBar.style.marginLeft == '0%') {
Loader.progressBar.style.marginLeft = '80%';
}
else {
Loader.progressBar.style.marginLeft = '0%';
}
}, 500);
Loader.progressBar = progressBar;
Loader.container = container;
let app = document.body;
app.appendChild(container);
}
static hide () {
Loader.container.style = "opacity : 0; transition: opacity 1s;";
setTimeout(() => { Loader.container.remove(); }, 1000);
}
static addTask () {
let id = Loader.loaded.length;
//console.log('Loading tasks: ', ++Loader.actualTasks);
Loader.loaded.push(0);
return id;
}
static finish (id) {
clearInterval(Loader.barInterval);
if (Loader.progressBar) {
Loader.progressBar.style.marginLeft = '0%';
Loader.progressBar.style.transition = '';
Loader.loaded[id] = 1;
Loader.updateBar();
}
}
static progress (id, value, total) {
clearInterval(Loader.barInterval);
if (Loader.progressBar) {
Loader.progressBar.style.marginLeft = '0%';
Loader.progressBar.style.transition = '';
Loader.loaded[id] = value / total;
Loader.updateBar();
}
return id;
}
static updateBar () {
let loadedTotal = 0;
for (let l of Loader.loaded) {
loadedTotal += l;
}
Loader.progressBar.style.width = loadedTotal / Loader.tasks * 95 + 5 + '%';
}
static loadJS (path, callback) {
let p = path;
(function (p, cb) {
let xhr = new XMLHttpRequest();
xhr.open('GET', p, true);
let id = Loader.addTask();
xhr.onprogress = event => {
if (Loader.progressBar) {
id = Loader.progress(id, event.loaded, event.total);
}
};
xhr.onload = () => {
if (xhr.status != 200) {
console.log(`Error ${xhr.status}: ${xhr.statusText}`);
}
else {
Loader.finish(id);
let script = document.createElement('script');
script.innerHTML = xhr.response;
document.body.appendChild(script);
if (cb) cb();
}
};
xhr.send();
})(path, callback);
}
}
Loader.actualTasks = 0;
Loader.tasks = 16;
Loader.loaded = [];
window.Loader = Loader;
window.indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
function openFirebaseDb () {
return new Promise((resolve, reject) => {
let req = window.indexedDB.open('firebaseLocalStorageDb');
req.onsuccess = () => {
let db = req.result;
let transaction = db.transaction(['firebaseLocalStorage'], 'readwrite');
let store = transaction.objectStore('firebaseLocalStorage');
resolve({ db, store });
}
req.onerror = err => reject(err);
req.onupgradeneeded = () => {
let db = req.result;
let store = db.createObjectStore('firebaseLocalStorage', { keyPath: 'fbase_key' });
resolve({ db, store });
}
});
}
var redirectIframe
function postStorageAndRedirect (iframe, storage, firebaseDb) {
iframe.contentWindow.postMessage({ storage, firebaseDb }, '*');
window.location = 'https://shellshock.io' + window.location.search + window.location.hash;
}
window.addEventListener('DOMContentLoaded', () => {
Loader.show();
});
</script><!-- title, seo meta and favicons -->
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="facebook-domain-verification" content="6lfua33vx0abiv1asnt9p13aac29xy" />
<!-- <link rel="manifest" href="manifest.json"> -->
<title>Shell Shockers | Alt URL: geometry.best.</title>
<meta name="Description" content="Alt URL: geometry.best. Shell Shockers, the world's most advanced egg-based multiplayer shooter! It's like your favorite battlefield game but... with eggs.">
<meta name="Keywords" content="Play, Free, Online, Multiplayer, Games, IO, ShellShockers, Shooter, Bullets, Top Down">
<meta name="author" content="Blue Wizard Digital">
<meta name="theme-color" content="#0B93BD" />
<meta name="background-color" content="#0B93BD" />
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="apple-touch-icon" href="favicon192.png" sizes="192x192" />
<link rel="icon" href="https://shellshock.io/favicon256.png" sizes="512x512" />
<meta property="og:url" content="https://www.shellshock.io" />
<meta property="og:type" content="website" />
<meta property="og:image:width" content="1000" />
<meta property="og:image:height" content="500" />
<meta property="og:image" content="https://www.shellshock.io/img/previewImage_shellShockers.jpg" />
<meta name="image" property="og:image" content="https://www.shellshock.io/img/previewImage_shellShockers.jpg" />
<meta property="og:title" content="Shell Shockers | by Blue Wizard Digital" />
<meta property="og:description" content="Alt URL: geometry.best. Shell Shockers, the world's most advanced egg-based multiplayer shooter! It's like your favorite battlefield game but... with eggs." />
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@eggcombat">
<meta name="twitter:creator" content="@eggcombat">
<meta name="twitter:title" content="Shell Shockers | by Blue Wizard Digital">
<meta name="twitter:description" content="Alt URL: geometry.best. Shell Shockers, the world's most advanced egg-based multiplayer shooter! It's like your favorite battlefield game but... with eggs.">
<meta name="twitter:image" content="https://www.shellshock.io/img/previewImage_shellShockers.jpg">
<!-- Styles & Fonts -->
<link href="https://fonts.googleapis.com/css?family=Sigmar+One|Nunito:100,200,600,700,900" rel="stylesheet">
<!-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous"> -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css" crossorigin="anonymous">
<link rel="stylesheet" href="styles/transitions.css%3F1651709060.css">
<link rel="stylesheet" href="styles/forms.css%3F1651709060.css">
<link rel="stylesheet" href="styles/style.css%3F1654110505.css">
<link rel="stylesheet" href="styles/game.css%3F1653069567.css"><script>
function storageFactory(getStorage) {
const inMemoryStorage = {};
function isSupported() {
try {
var testKey = "__some_random_key_you_are_not_going_to_use__";
getStorage().setItem(testKey, testKey);
getStorage().removeItem(testKey);
return true;
} catch (e) {
return false;
}
}
function clear() {
if (isSupported()) {
getStorage().clear();
} else {
inMemoryStorage = {};
}
}
function getItem(name) {
if (isSupported()) {
return getStorage().getItem(name);
}
if (inMemoryStorage.hasOwnProperty(name)) {
return inMemoryStorage[name];
}
return null;
}
function key(index) {
if (isSupported()) {
return getStorage().key(index);
} else {
return Object.keys(inMemoryStorage)[index] || null;
}
}
function removeItem(name) {
if (isSupported()) {
getStorage().removeItem(name);
} else {
delete inMemoryStorage[name];
}
}
function setItem(name, value) {
if (isSupported()) {
getStorage().setItem(name, value);
} else {
inMemoryStorage[name] = String(value);
}
}
function length() {
if (isSupported()) {
return getStorage().length;
} else {
return Object.keys(inMemoryStorage).length;
}
}
return {
getItem: getItem,
setItem: setItem,
removeItem: removeItem,
clear: clear,
key: key,
get length() {
return length();
}
};
}
const localStore = storageFactory(() => localStorage);
const sessionStore = storageFactory(() => sessionStorage);
</script><style>
.eggIcon {
display: inline-block;
color: #444444;
width: 1em;
height: 1em;
fill: currentColor;
}
</style>
<svg style="position: absolute; width: 0; height: 0; overflow: hidden" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<symbol id="icon-egg" viewBox="0 0 14.59 18.12">
<path class="eggFill" d="M14.49,10.79c0-3.96-3.02-10.66-6.98-10.66s-7.36,6.7-7.36,10.66s3.21,7.17,7.17,7.17S14.49,14.75,14.49,10.79z"></path>
</symbol>
</defs>
</svg>
<style>
.eggIconLocked {
display: inline-block;
color: #444444;
width: 1em;
height: 1em;
fill: currentColor;
}
</style>
<svg style="position: absolute; width: 0; height: 0; overflow: hidden" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<symbol id="icon-egg-locked" viewBox="0 0 14.59 18.12">
<g>
<path class="st0" d="M7.3,5.4c-0.6,0-1.1,0.5-1.1,1.1v1.3h2.2V6.5C8.4,5.9,7.9,5.4,7.3,5.4z"/>
<path class="st0" d="M7.5,0.1c-4,0-7.4,6.7-7.4,10.7S3.4,18,7.3,18c3.9,0,7.2-3.2,7.2-7.2S11.5,0.1,7.5,0.1z M11.3,12.5
c0,0.9-0.7,1.6-1.6,1.6H4.8c-0.9,0-1.6-0.7-1.6-1.6V7.8h1.5V6.5C4.8,5.1,5.9,4,7.3,4c1.4,0,2.5,1.1,2.5,2.5v1.3h1.5V12.5z"/>
</g>
</symbol>
</defs>
</svg><!-- ParsedURL -->
<script>
var parsedUrl = (function parseUrl () {
var url = {};
var loc = window.location;
url.root = loc.origin + loc.pathname;
var query = loc.search.substring(1).split('&');
url.query = {};
for (let i = 0; i < query.length; i++) {
var arr = query[i].split('=');
if (arr[0]) {
if (arr[1] === undefined) {
arr[1] = true;
} else if (!isNaN(arr[1])) {
arr[1] = parseFloat(arr[1]);
}
url.query[arr[0]] = arr[1];
}
}
url.hash = loc.hash.substring(1);
var host = loc.host.split('.');
url.dom = host[0];
url.top = host[1];
if (url.hash.length == 0) url.hash = undefined;
return url;
})();
</script>
<!-- third party globals -->
<script>
// Third party globals
var crazysdk = {inviteLink: function () {}},
pokiActive = false,
crazyGamesActive = false,
thirdPartyAdblocker = false,
testCrazy = false;
</script><!-- Crazy Games -->
<script src="https://sdk.crazygames.com/crazygames-sdk-v1.js"></script>
<script type="text/javascript">
const crazyAdDetect = (e) => {
if (e.hasAdblock) {
thirdPartyAdblocker = true;
}
};
// const crazyInitialized = (e) => {
// console.log('INITIALIZED: ', e);
// };
if (window.CrazyGames && CrazyGames.CrazySDK) {
const { CrazySDK } = window.CrazyGames;
crazysdk = CrazySDK.getInstance(); //Getting the SDK
crazysdk.addEventListener('bannerRendered', (e) => {
console.log(`Banner for container ${e.containerId} has been rendered!`);
});
crazysdk.addEventListener('bannerError', (e) => {
console.log(`Banner render error: ${e.error}`);
if (e.containerId === 'shellshockers_respawn_banner_2_ad' || e.containerId === 'shellshockers_respawn_banner-new_ad') {
// We only reset the timeout if both banners fail during the same request
if (++vueData.cGrespawnBannerErrors >= 2) {
vueData.cGrespawnBannerErrors = 0;
if (vueData.cGrespawnBannerTimeout) {
clearTimeout(vueData.cGrespawnBannerTimeout);
vueData.cGrespawnBannerTimeout = null;
}
}
}
});
// crazysdk.addEventListener('initialized', crazyInitialized);
crazysdk.addEventListener('adblockDetectionExecuted', crazyAdDetect);
crazysdk.init(); //Initializing the SDK, call as early as possible
}
if (parsedUrl.query.testCrazy) {
testCrazy = true;
}
</script><!-- European Union detection -->
<script>isFromEU = 0 ? true : false</script>
<!-- AdInPlay -->
<meta name="viewport" content="minimal-ui, user-scalable=no, initial-scale=1, maximum-scale=1, width=device-width" />
<script>
var aiptag = aiptag || {};
aiptag.cmd = aiptag.cmd || [];
aiptag.cmd.display = aiptag.cmd.display || [];
aiptag.cmd.player = aiptag.cmd.player || [];
</script>
<script async src="https://api.adinplay.com/libs/aiptag/pub/SSK/shellshock.io/tag.min.js"></script>
<!-- GTM -->
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-K5MSJHJ');</script>
<!-- End Google Tag Manager --><!-- In house ads -->
<script>
window.googletag = window.googletag || {cmd: []};
let inHouseSlot;
const slots = [];
const dpfNetwork = /21743024831/,
inHouseAdSlot = 'ShellShockers_LoadingScreen_HouseAds'
inHouseAdSize = [[468, 60], [970, 90], [970, 250], [728, 90]],
inHouseAdDiv = 'ShellShockers_LoadingScreen_HouseAds',
adSlots = [];
// Helper to setup slots and add to slot array
const adDefineSlot = (slot, sizes, id) => {
return adSlots.push([{slot, sizes, id}]);
};
// Defining the slots for the the array
const loadingScreeningAd = adDefineSlot(inHouseAdSlot, inHouseAdSize, inHouseAdDiv);
// Helper to add slots to google service
function addServiceToSlot() {
slots.forEach(slot => {
slot.addService(googletag.pubads());
});
}
// Get all the slots, add to google ad defineSlot method
function getAllDefinedSlots(allSlots) {
let definedSlots = [];
allSlots.forEach(adSlot => {
for (var i = 0, len = adSlot.length; i < len; i++) {
slots.push(googletag.defineSlot(dpfNetwork + adSlot[i].slot, adSlot[i].sizes, adSlot[i].id));
}
})
return addServiceToSlot(slots);
}
const gtagInHouseLoadingBannerIntialLoad = () => {
if (typeof hasPoki !== 'undefined') {
console.log('haspoki', typeof(hasPoki));
return;
}
googletag.cmd.push(function() {
getAllDefinedSlots(adSlots);
googletag.pubads().disableInitialLoad();
googletag.enableServices();
});
};
gtagInHouseLoadingBannerIntialLoad();
const adRenderedEvent = () => {
return googletag.pubads().addEventListener('slotRenderEnded', (event) => {
vueApp.disaplyAdEventObject(event);
});
};
const gtagInHouseLoadingBanner = () => {
googletag.cmd.push(function() {
googletag.pubads().refresh([slots[0]]);
adRenderedEvent();
});
};
const destroyInhouseAdForPaid = () => {
googletag.destroySlots([slots[0]]);
};
</script><!-- Firebase -->
<script src="https://www.gstatic.com/firebasejs/7.21.1/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/7.21.1/firebase-auth.js"></script>
<script src="https://www.gstatic.com/firebasejs/ui/4.6.1/firebase-ui-auth.js"></script>
<link type="text/css" rel="stylesheet" href="https://www.gstatic.com/firebasejs/ui/4.6.1/firebase-ui-auth.css" />
<!-- Facebook -->
<!-- Facebook Pixel Code -->
<script>
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
document,'script','https://connect.facebook.net/en_US/fbevents.js');
fbq('init', '771186996377132');
fbq('track', 'PageView');
</script>
<noscript>
<img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=771186996377132&ev=PageView&noscript=1"/>
</noscript>
<!-- DO NOT MODIFY -->
<!-- End Facebook Pixel Code -->
<!-- OneSignal -->
<script src="https://cdn.onesignal.com/sdks/OneSignalSDK.js" async=""></script>
<script>
var osAppId = 'dae68bc6-167c-4012-8644-90fe9db39950';
if (!location.hostname.startsWith('shellshock')) {
if (location.hostname.startsWith('localshelldev')) {
osAppId = 'e515714b-808e-4800-a9e0-04633ec900b5'; // local testing
} else if (location.hostname.startsWith('dev')) {
osAppId = '20bd47ca-cce1-428e-b34f-1a240f643112'; // dev testing
} else if (location.hostname.startsWith('localhost')) {
osAppId = '884bfbf7-5bcb-4170-9bf4-bba6b6e0046e';// localhost testing
} else {
osAppId = '166e17cb-5c02-4c7d-8bff-8ec69729f725'; // internal testing
}
}
var OneSignal = window.OneSignal || [];
OneSignal.push(function() {
OneSignal.init({
appId: osAppId,
// autoResubscribe:true,
// allowLocalhostAsSecureOrigin: true
});
});
</script><!-- progressive web app -->
<!-- <button id="addToHomescreen" style="z-index:333;display: none; position:absolute; top:0px; right: 75%; cursor:pointer;" class="ss_button btn_yolk bevel_yolk">Add to your desktop!</button> -->
<script>
let pwaBlockAds = false;
// if ('serviceWorker' in navigator) {
// console.log("Will the service worker register?");
// navigator.serviceWorker.register('service-worker.js')
// .then(function(reg){
// console.log("Yes, it did.");
// }).catch(function(err) {
// console.log("No it didn't. This happened:", err)
// });
// }
if (window.matchMedia('(display-mode: standalone)').matches) {
pwaBlockAds = 'utm_source' in parsedUrl.query && parsedUrl.query.utm_source === 'homescreen';
ga('send', 'event', 'pwa', 'desktop opened');
}
</script>
<!-- Music audio tag -->
<audio id="theAudio" preload="metadata"></audio><!-- VueJS -->
<script src="js/vue/vue.min.2.6.10.js"></script><!-- tools and varibles -->
<script>
let changeLogData;
var version;
fetch('./changelog/changelog.json?1653515333', {cache: "no-cache"})
.then(response => response.json())
.then(data => {
changeLogData = data;
version = changeLogData[0].version;
});
localStore.removeItem('brbTime');
String.prototype.format = String.prototype.f = function() {
var s = this,
i = arguments.length;
while (i--) {
s = s.replace(new RegExp('\\{' + i + '\\}', 'gm'), arguments[i]);
}
return s;
};
function getKeyByValue (obj, value) {
for (var prop in obj) {
if (obj.hasOwnProperty(prop)) {
if (obj[prop] === value) {
return prop;
}
}
}
}
function objToStr (obj) {
var str = JSON.stringify(obj, null, 4).replace(/\\|"/g, '');
//str = str.replace(/\\|"/g, '');
return str;
}
function detectChromebook() {
return /\bCrOS\b/.test(navigator.userAgent);
}
function removeChildNodes (name) {
var myNode = document.getElementById(name);
while (myNode.firstChild) {
myNode.removeChild(myNode.firstChild);
}
}
function logCallStack() {
var stack = new Error().stack;
console.log(stack);
}
function getRequest (url, callback) {
if (url.startsWith('./')) url = url.slice(2);
url = dynamicContentPrefix + url;
var req = new XMLHttpRequest();
if (!req) {
return false;
}
if (typeof callback != 'function') callback = function () {};
req.onreadystatechange = function(){
if(req.readyState == 4) {
return req.status === 200 ?
callback(null, req.responseText) : callback(req.status, null);
}
}
req.open("GET", url, true);
req.send(null);
return req;
}
function hasValue (a) {
return (a !== undefined && a !== null && a !== 0);
}
Array.prototype.shallowClone = function() {
return this.slice(0);
}
function deepClone (o) {
return JSON.parse(JSON.stringify(o));
}
function isString (value) {
return typeof value === 'string' || value instanceof String;
}
const theTimeTracker = (startTime, gaVar, gaLabel) => {
const endTime = new Date();
const timerResult = endTime - startTime;
if (!Number.isInteger(timerResult) && !timerResult ) {
return;
}
return ga('send', 'timing', vueData.googleAnalytics.cat.playerStats, gaVar, timerResult, gaLabel);
};
const isShellIframe = () => window.self === window.top;
const iframeParent = () => {
const parent = (window.location != window.parent.location)
? document.referrer
: document.location.href,
domain = new URL(parent).hostname.replace(/(www.)/, '').split('.');
if (!Array.isArray(domain) && !domain.length) {
return false;
}
const index = domain.length - 2;
return {
domain: domain,
index: index,
};
};
const iframeWhitelist = (domains) => {
if (isShellIframe()) {
return;
}
const parent = iframeParent(),
domain = parent.domain,
index = parent.index;
// if in iframe and url hostname is in approved whitelist return true or false if not in list
return domains.includes(domain[index]) || domains.includes(domain[index - 1]);
};
const playShellshockers = () => {
//if not in a iframe return true
if (isShellIframe()) {
console.log('Not playing in iframe');
return true;
}
console.log('Playing in iframe');
const gamePortals = [
'poki',
'poki-gdn',
'poki.compoki',
'games.poki',
'crazygames',
'1001juegos',
'ioground',
'gogy',
'playgamesio',
'iogames',
'iogames',
'wingsiofree',
'vseigru',
'miniclip',
'red-ball4',
'speelspelletjes',
'onlinegame',
'addictinggames'
];
const parent = iframeParent(),
domain = parent.domain,
index = parent.index;
// if in iframe and url hostname is in approved whitelist return true or false if not in list
//return gamePortals.includes(domain[index]) || gamePortals.includes(domain[index - 1]);
return true; // Disabling this for now because server outages caused everyone to be blacklisted for some insane, currently unknown reason.
};
const capitalize = (s) => {
if (typeof s !== 'string') return ''
return s.charAt(0).toUpperCase() + s.slice(1)
};
var servers = [
{ name: 'US East', subdom: 'useast2.', locKey: 'server_useast', id: 'us-e1' },
{ name: 'US West', subdom: 'uswest2.', locKey: 'server_uswest', id: 'us-w1' },
{ name: 'US Central', subdom: 'uscentral2.', locKey: 'server_uscentral', id: 'us-c1' },
{ name: 'Brazil', subdom: 'brazil2.', locKey: 'server_brazil', id: 'br-1' },
{ name: 'Germany', subdom: 'frankfurt.', locKey: 'server_germany', id: 'de-1' },
{ name: 'Singapore', subdom: 'singapore2.', locKey: 'server_singapore', id: 'si-1' },
{ name: 'Sydney', subdom: 'sydney.', locKey: 'server_sydney', id: 'au-1' },
];
var debug = false;
var servicesServer = 'wss://' + window.location.hostname + '/services/';
const isLocalShellDev = location.hostname.startsWith('localshelldev'),
isLocalHost = location.hostname.startsWith('localhost');
if (dynamicContentRoot) {
servicesServer = 'wss://' + dynamicContentRoot + '/services/';
}
else if (isLocalHost || isLocalShellDev) {
servicesServer = isLocalHost ? 'ws://localhost:4242' : 'ws://localshelldev.bluewizard.com:4242/';
debug = true;
if (isLocalShellDev)
servers.push({ name: 'Local VM', subdom: 'localshelldev.', root: 'bluewizard.com', locKey: 'server_localshelldev', id: 'lucyskydiamonds' });
servers.push({ name: 'local', subdom: '', locKey: '_server_local', id: 'local' });
servers.push({ name: 'Dev (US West)', subdom: 'gamedev.', locKey: 'server_gamedev', id: 'gamedev' });
}
else if (location.hostname.startsWith('staging.shellshock.io')) {
debug = true;
servers = [{ name: 'Staging', subdom: 'staging.', locKey: 'server_staging', id: 'staging' }];
var servicesServer = 'wss://staging.shellshock.io:8443/services/';
}
if (location.search.includes('portalTest')) {
gameServerRoot = 'shellshock.io';
dynamicContentRoot = 'dev.shellshock.io';
dynamicContentPrefix = 'https://dev.shellshock.io/';
servers = [{ name: 'Dev (US West)', subdom: 'gamedev.', locKey: 'server_dev', id: 'dev' }];
}
if (!dynamicContentRoot && location.hostname.startsWith('dev.shellshock.io') || dynamicContentRoot == 'dev.shellshock.io') {
servers = [{ name: 'Dev (US West)', subdom: 'gamedev.', locKey: 'server_dev', id: 'dev' }];
servicesServer = 'wss://dev.shellshock.io/services/';
}
function getGameServerUrl (server) {
// Dump the www from the hostname if it exists
var hostname = window.location.hostname;
var fields = hostname.split('.');
if (fields.length > 2) {
hostname = fields[1] + '.' + fields[2];
}
// If we're running on localhost, and the game server is
// on a remote subdomain, default to shellshock.io domain
var rootName = server.root || hostname;
if (server.subdom && rootName == 'localhost') {
rootName = 'shellshock.io';
}
var subdom = server.subdom || '';
if (gameServerRoot) rootName = gameServerRoot;
if (server.subdom == '' && rootName === 'localhost' || rootName === 'bluewizard.com') {
return 'ws://' + subdom + rootName + ':4430';
} else {
return 'wss://' + subdom + rootName;
}
}
function getServerIndex (server) {
return servers.map(s => s.id).indexOf(server.id);
}
function getStoredNumber (name, def) {
var num = localStore.getItem(name);
if (!num) {
return def;
}
return Number(num);
}
function getStoredBool (name, def) {
var str = localStore.getItem(name);
if (!str) {
return def;
}
return str == 'true' ? true : false;
}
function getStoredString (name, def) {
var str = localStore.getItem(name);
if (!str) {
return def;
}
return str;
}
function getStoredObject (name, def) {
var str = localStore.getItem(name);
if (!str) {
return def;
}
return JSON.parse(str);
}
var shellColors = [
'#ffffff',
'#c4e3e8',
'#e2bc8b',
'#d48e52',
'#cb6d4b',
'#8d3213',
'#5e260f',
'#e70a0a',
'#aa24ce',
'#f17ff9',
'#FFD700',
'#33a4ea',
'#3e7753',
'#59db27',
//'#99953a'
];
var freeColors = shellColors.slice(0, 7);
var paidColors = shellColors.slice(7, shellColors.length);
var Slot = {
Primary: 0,
Secondary: 1
};
var EGGCOLOR = {
white: 0,
skyblue: 1,
beige: 2,
tan: 3,
brown: 4,
caramel: 5,
chocolate: 6,
red: 7,
purple: 8,
violet: 9,
yellow: 10,
babyblue: 11,
darkgreen: 12,
green: 13
}
// Type matches contents of the item_type table (could be generated from a db query but ... meh)
var ItemType = {
Hat: 1,
Stamp: 2,
Primary: 3,
Secondary: 4,
Grenade: 6
}
var CharClass = {
Soldier: 0,
Scrambler: 1,
Ranger: 2,
Eggsploder: 3,
Whipper: 4,
Crackshot: 5,
TriHard: 6
};