· 6 years ago · Mar 26, 2020, 08:10 PM
1<?php
2$sqlhostname = "localhost";
3$sqlusername = "root";
4$sqlpassword = "locale";
5$sqldb = "locale";
6
7
8
9$db = new MySQLi($sqlhostname, $sqlusername, $sqlpassword, $sqldb);
10
11if ($db->connect_error) {
12 die("<font color= '#ff000'> Connessione fallita: </font>" . $db->connect_error);
13}
14
15$ticket = $_GET['sso'];
16
17if(!$ticket){
18 die("<center>Inserisci l'sso</center>");
19}
20
21?>
22<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
23 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
24<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml">
25<head>
26 <meta http-equiv="X-UA-Compatible" content="IE=7" />
27
28 <title><?php echo $shortname; ?> ~ Client</title>
29
30<script type="text/javascript">
31var andSoItBegins = (new Date()).getTime();
32</script>
33
34<link rel="shortcut icon" href="images/index/icona.ico" type="image/vnd.microsoft.icon" />
35<script src="flashclient/libs2.js" type="text/javascript"></script>
36<script src="flashclient/visual.js" type="text/javascript"></script>
37<script src="flashclient/libs.js" type="text/javascript"></script>
38<script src="flashclient/common.js" type="text/javascript"></script>
39<link rel="stylesheet" href="flashclient/style.css" type="text/css" />
40<link rel="stylesheet" href="flashclient/bottons.css" type="text/css" />
41<link rel="stylesheet" href="flashclient/boxes.css" type="text/css" />
42<link rel="stylesheet" href="flashclient/tooltips.css" type="text/css" />
43<link rel="stylesheet" href="flashclient/changepassword.css" type="text/css" />
44
45<script type="text/javascript">
46var habboReqPath = "http://localhost/";
47var habboStaticFilePath = "http://localhost/r63/c_images/";
48var habboImagerUrl = "https://www.habbo.it/habbo-imaging/";
49var habboDefaultClientPopupUrl = "/client.php";
50</script>
51
52<link rel="stylesheet" href="flashclient/habboclient.css" type="text/css" />
53<link rel="stylesheet" href="flashclient/habboflashclient.css" type="text/css" />
54<script src="flashclient/habboflashclient.js" type="text/javascript"></script>
55
56<script type="text/javascript">
57
58 if (top == self) {
59 FlashHabboClient.cacheCheck();
60 }
61 var flashvars = {
62 "client.allow.cross.domain" : "1",
63 "client.notify.cross.domain" : "0",
64 "connection.info.host" : "127.0.0.1",
65 "connection.info.port" : "30000",
66 "site.url" : "http://localhost/",
67 "url.prefix" : "http://localhost/",
68 "client.reload.url" : "http://localhost/client",
69 "client.fatal.error.url" : "http://localhost/client",
70 "client.connection.failed.url" : "http://localhost/client",
71 "external.variables.txt" : "http://localhost/r63/gamedata/external_variables.php",
72 "external.texts.txt" : "http://localhost/r63/gamedata/external_flash_texts.txt",
73 "productdata.load.url" : "http://localhost/r63/gamedata/productdata.txt",
74 "furnidata.load.url" : "http://localhost/r63/gamedata/furnidata.txt",
75 "use.sso.ticket" : "1",
76 "sso.ticket" : "<?php echo $ticket ; ?>",
77 <?php
78 if($forward)
79 {
80 echo '"forward.type" : "'.$forward_type.'",';
81 echo '"forward.id" : "'.$roomid.'",';
82
83 }
84
85 if(isset($_GET['friendId']))
86 {
87 echo '"friend.id" : "'.mysql_real_escape_string($_GET['friendId']).'",';
88 }
89 ?>
90 "processlog.enabled" : "0",
91 "account_id" : "0",
92 "client.starting" : "Attendi perfavore! <?php echo $shortname; ?> sta caricando.",
93 "flash.client.url" : "http://localhost/r63/dcr/hof_furni/",
94 "user.hash" : "",
95 "has.identity" : "1",
96 "flash.client.origin" : "popup"
97 };
98 var params = {
99 "base" : "http://localhost/r63/gordon/r63/",
100 "allowScriptAccess" : "always",
101 "menu" : "false"
102
103 };
104
105 if (!(HabbletLoader.needsFlashKbWorkaround())) {
106 params["wmode"] = "opaque";
107 }
108
109 FlashExternalInterface.signoutUrl = "http://localhost/logout";
110
111 var clientUrl = "http://localhost/r63/gordon/r63/Habbo.swf";
112 swfobject.embedSWF(clientUrl, "flash-container", "100%", "100%", "10.0.0", "flashclient/expressInstall.swf", flashvars, params);
113
114 window.onbeforeunload = unloading;
115 function unloading() {
116 var clientObject;
117 if (navigator.appName.indexOf("Microsoft") != -1) {
118 clientObject = window["flash-container"];
119 } else {
120 clientObject = document["flash-container"];
121 }
122 try {
123 clientObject.unloading();
124 } catch (e) {}
125 }
126function toggleFullScreen()
127 {
128 if ((document.fullScreenElement && document.fullScreenElement !== null) ||
129 (!document.mozFullScreen && !document.webkitIsFullScreen))
130 {
131 if (document.documentElement.requestFullScreen)
132 {
133 document.documentElement.requestFullScreen();
134 }
135 else if (document.documentElement.mozRequestFullScreen)
136 {
137 document.documentElement.mozRequestFullScreen();
138 }
139 else if (document.documentElement.webkitRequestFullScreen)
140 {
141 document.documentElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
142 }
143 }
144 else
145 {
146 if (document.cancelFullScreen)
147 {
148 document.cancelFullScreen();
149 }
150 else if (document.mozCancelFullScreen)
151 {
152 document.mozCancelFullScreen();
153 }
154 else if (document.webkitCancelFullScreen)
155 {
156 document.webkitCancelFullScreen();
157 }
158 }
159 }
160function closeCredits(){ document.getElementById("credits").style.display='none'; }
161function closeSocial(){ document.getElementById("fbLike").style.display='none'; }
162function closeNews(){ document.getElementById("news").style.display='none'; }
163function readNews(numero){ document.getElementById("news-"+numero).style.display='block'; }
164function unreadNews(numero){ document.getElementById("news-"+numero).style.display='none'; }
165
166 var userId = 217206;
167 var bypassIdCheck = false;
168 var videoLimit = 20;
169 var SMALL_EVENTALERT_ENABLED = false;
170 var containers = [];
171 var mainPlaylists = '';
172 var currentVideo = 0;
173 var roomOwnerId = 0;
174 var currentPlaylist;
175 var secondsGone = 0;
176 var adsSeconds = 600;
177 var externalTexts = {};
178 var showBoardGameTooltip = false;
179
180 window.CameraPhotoPriceCredits = 1500;
181
182 var lastCheck = 0;
183 var pingIteration = 0;
184
185 setInterval(function() {
186 if (++pingIteration >= 3) {
187 pingIteration = 0;
188 }
189 return function(iteration) {
190 $.get('https://localhost/client/ping', iteration !== 2 ? {} : {
191 'with_playlists': '1',
192 'PLAYLIST_ID': typeof currentPlaylist == 'undefined' ? 0 : currentPlaylist.playlistId,
193 'SEARCH_VAL': $('.searchBox').val(),
194 }, function(data) {
195 refreshOnline(parseInt(data.usersonline));
196 $('.amount').html(parseInt(data.bonuspoints));
197
198 if (!done) {
199 return;
200 }
201
202 if (parseInt(data.show_ad) == 1 && (Date.now() - lastCheck) > 10000) {
203 lastCheck = Date.now();
204 secondsGone = adsSeconds - 1;
205 }
206
207 updateLockRequests(data.friendlock);
208
209 if (iteration == 2) {
210 updatePlaylists(data.playlists);
211 }
212 });
213 }(pingIteration);
214 }, 10000);
215
216 function refreshOnline(online) {
217 if (online !== 1) {
218 $('#seeonline').html(online + ' Lives online');
219 } else {
220 $('#seeonline').html(online + ' Live online');
221 }
222 if($('#seeonline').width() < 141) {
223 $('#seeonline').css('width', '141px');
224 } else {
225 $('#seeonline').css('width', $('#seeonline').width() + 'px');
226 }
227 }
228
229 function requestBoardGameDialog() {
230 if (!HabboSWF) {
231 return;
232 }
233 $('#board-game-tooltip').fadeOut();
234 showBoardGameTooltip = false;
235 HabboSWF.sendRawData("!" + encodeRawMessage(JSON.stringify({
236 EventType: 'RequestBoardGameDialog',
237 })));
238 }
239
240 function updateLockRequests(d) {
241 var alreadyDisplayed = $('#requestReceivedContainer').css('display') == 'block';
242 if (d.friendLockRequest) {
243 if (!alreadyDisplayed) {
244 friendLockItemId = d.itemId;
245 console.log('GOT WHAT!');
246 $('#friendlockContainer').css({
247 'display' : 'block',
248 'left' : '25%',
249 'top' : '25%'
250 });
251 $('#requestContainer').css('display', 'none');
252 $('#friendlock').css('display', 'none');
253 $('#requestReceivedContainer').css('display', 'block');
254 }
255 } else if(alreadyDisplayed) {
256 $('#friendlockContainer').css('display', 'none');
257 $('#requestReceivedContainer').css('display', 'none');
258 }
259 }
260
261 function callAds() {
262 if (secondsGone++ >= adsSeconds) {
263 secondsGone = 0;
264 var top = $('#pre-container').css('top');
265 if (top != '0px' && top != 'auto') {
266 $('#pre-container').css('display', 'block');
267 $('#pre-container').animate({'top':'0px'}, 1000);
268 }
269 }
270 setTimeout(callAds, 1000);
271 }
272
273 /*function desktop_notification(notification) {
274 if (!Notification) {
275 alert('Desktop Benachrichtigungen werden von deinem Browser nicht unterstützt. Nutze Chronium.');
276 }
277
278 if (Notification.permission !== "granted"){
279 Notification.requestPermission();
280 } else {
281 var notification = new Notification('Live-Hotel', {
282 icon: '/web-gallery/images/favicon.ico',
283 body: notification,
284 });
285
286 window.setTimeout(function(){
287 notification.close();
288 }, 5000);
289
290 notification.onclick = function () {
291 window.focus();
292 notification.close();
293 };
294 }
295 }*/
296
297 function sendFriendLockRequest() {
298 var name = $('#friendLockRequestName').val();
299 if (name.length < 1) {
300 return;
301 }
302 $('#friendLockRequestName').val("Bitte warten..");
303 $.post('ajax/client.ui3.ajax.php', {
304 'name' : name,
305 'ACTION' : 'REQUEST_FRIENDLOCK'
306 }, function(d) {
307 $('#friendLockRequestName').val("");
308 if (d.failed) {
309 alert('Der Nutzer befindet sich nicht in deinem Raum.');
310 return;
311 }
312 $('#friendlockContainer').css('display', 'none');
313 alert('Der Nutzer hat deine Anfrage erhalten. Sobald er sie angenommen hat, ist der Vorgang abgeschlossen.');
314 }, 'json');
315 }
316 var friendLockItemId = -1;
317 $(document).ready(function() {
318 $('#welcomeContainer').drag(function( ev, dd ){
319 $( this ).css({
320 top: dd.offsetY,
321 left: dd.offsetX
322 });
323 }, { handle:".top", not:".close" });
324
325 $('#easterEggContainer').drag(function( ev, dd ){
326 $( this ).css({
327 top: dd.offsetY,
328 left: dd.offsetX
329 });
330 }, { handle:".top", not:".close" });
331
332 $('#badgeContainer').drag(function( ev, dd ){
333 $( this ).css({
334 top: dd.offsetY,
335 left: dd.offsetX
336 });
337 }, { handle:null, not:".close" });
338
339 $('#eventAlertContainer').drag(function( ev, dd ){
340 $( this ).css({
341 top: dd.offsetY,
342 left: dd.offsetX
343 });
344 }, { handle:".top", not:".close" });
345
346 $('#friendlockContainer').drag(function( ev, dd ){
347 $( this ).css({
348 top: dd.offsetY,
349 left: dd.offsetX
350 });
351 }, { handle:".top", not:".close" });
352
353 $.post('ajax/client.ui3.ajax.php', {
354 'ACTION' : 'LOAD_WINDOW'
355 }, function(d) {
356 $('#containers').append(d.html);
357 currentPlaylist = d.currentPlaylist;
358 $('#tvDialog').drag(function( ev, dd ){
359 $( this ).css({
360 top: dd.offsetY,
361 left: dd.offsetX
362 });
363 }, { handle:".top", not:".close" });
364 if ($('#PlaylistItem' + currentPlaylist.playlistId).length) {
365 $('#PlaylistItem' + currentPlaylist.playlistId + ' .playlistName').css('text-decoration', 'underline');
366 }
367 if (((currentPlaylist.playlistId == userId && roomOwnerId == userId) || bypassIdCheck) && (typeof currentPlaylist !== 'undefined' && currentPlaylist.playlistId > 0)) {
368 $('.changePlaylist').css('display', 'block');
369 }
370 mainPlaylists = $('#tvDialog #youtubeContainer .playlistContainer').html();
371 }, "json");
372
373
374 $.get(flashvars["external.texts.txt"], function(d) {
375 var data = d.split("\n");
376
377 for (var index in data) {
378 if (!(typeof data[index].indexOf == "function")) {
379 continue;
380 }
381
382 var key = data[index].substring(0, data[index].indexOf("="));
383 var value = data[index].substring(key.length + 1);
384
385 externalTexts[key] = value;
386 }
387 });
388 });
389
390 function updatePlaylists(d) {
391 var videos = d.videos;
392 $('#youtubeContainer .topItems').html(d.html);
393 if (currentPlaylist.playlistId == userId) {
394 if ($('#youtubeContainer #MyPlaylistItem').length) {
395 $('#youtubeContainer #MyPlaylistItem .playlistName').css('text-decoration', 'underline');
396 }
397 } else {
398 if ($('#youtubeContainer #PlaylistItem' + currentPlaylist.playlistId).length) {
399 $('#youtubeContainer #PlaylistItem' + currentPlaylist.playlistId + ' .playlistName').css('text-decoration', 'underline');
400 }
401 }
402 for (var i = 0; i < videos.length; ++i) {
403 $('#youtubeContainer #PlaylistItem' + videos[i].PLAYLIST_ID + ' .videoCount').html(videos[i].VIDEO_COUNT + ' Video' + (videos[i].VIDEO_COUNT != 1 ? 's' : ''));
404 }
405 if ($('.searchBox').val().length < 1 ) {
406 mainPlaylists = $('#tvDialog #youtubeContainer .playlistContainer').html();
407 }
408 if (typeof currentPlaylist !== 'undefined' && currentPlaylist.playlistId == d.currentPlaylistID && $('.changePlaylistButtonText').html() == 'Playlist verwalten') {
409 var oldVideos = currentPlaylist.videos;
410 currentPlaylist.videos = d.currentVideos;
411 if (currentVideo == 0 && d.currentVideos.length < 1 && oldVideos.length < 1) {
412 return;
413 }
414 if ((currentPlaylist.videos.length > 0 && oldVideos.length < 1) || ((currentVideo + 1) > d.currentVideos.length)) {
415 playVideo(3);
416 return;
417 }
418 if (currentPlaylist.videos.length > 0) {
419 playVideo(2, d.currentVideos[currentVideo].url != oldVideos[currentVideo].url);
420 }
421 }
422 }
423
424 var setFriendLockRequestStatus = function (s) {
425 $('#friendlockContainer').css('display', 'none');
426 $.post('ajax/client.ui3.ajax.php', {
427 'ACTION' : 'SET_LOCKREQUEST_STATE',
428 'ITEM_ID' : friendLockItemId,
429 'STATE' : s ? 1 : 0
430 }, function(d) {
431 console.log(d);
432 }, "json"
433 );
434 };
435 var onYouTubePlayerReady = function(playerId) {
436 document.getElementById("videoStream").addEventListener("onStateChange", "onYouTubePlayerStateChanged");
437 };
438 var onYouTubePlayerStateChanged = function(newState) {
439 if (newState == 1 && typeof MRP !== 'undefined') {
440 //MRP.stop();
441 } else if (newState == 0 && typeof currentPlaylist !== 'undefined') {
442 setTimeout(function() {
443 if ((currentVideo + 1) < currentPlaylist.videos.length) {
444 playVideo(1, true, true);
445 } else {
446 playVideo(4);
447 }
448 }, 0);
449 }
450 };
451 var reqCount = 0;
452 var lastReq = '';
453 var playVideo = function(d,m,auto) {
454 m = (typeof m === 'undefined') || m;
455 auto = !(typeof auto === 'undefined');
456 if (d == 1 && (currentVideo + 1) >= currentPlaylist.videos.length) {
457 return;
458 } else if (d == 0 && (currentVideo - 1) < 0) {
459 return;
460 }
461 currentVideo += (d == 1 ? 1 : (d == 0 ? -1 : 0));
462 if (d == 3) {
463 currentVideo = currentPlaylist.videos.length - 1;
464 } else if(d == 4) {
465 currentVideo = 0;
466 }
467 if (m) {
468 swfobject.embedSWF("https://www.youtube.com/v/" + (typeof currentPlaylist.videos[currentVideo] === 'undefined' ? '' : currentPlaylist.videos[currentVideo].url) + "?enablejsapi=1&controls=2&modestbranding=1&rel=0&showinfo=0&playerapiid=videoStream&version=3&iv_load_policy=3&autoplay=" + (auto ? 1 : 0),
469 "videoStream", "380", "220", "8", null, null, { allowScriptAccess: "always" }, { id: "videoStream" });
470 }
471 $('.videoTitle').html(typeof currentPlaylist.videos[currentVideo] === 'undefined' ? 'Kein Video' : currentPlaylist.videos[currentVideo].title);
472 $('.videoCreator').html(typeof currentPlaylist.videos[currentVideo] === 'undefined' ? 'Interpret' : currentPlaylist.videos[currentVideo].creator);
473 $('.videoThumb').attr('src', 'https://img.youtube.com/vi/' + (typeof currentPlaylist.videos[currentVideo] === 'undefined' ? '' : currentPlaylist.videos[currentVideo].url) + '/mqdefault.jpg');
474 $('.nextButton').css('display', ((currentVideo + 1) == (typeof currentPlaylist.videos[currentVideo] === 'undefined' ? 0 : currentPlaylist.videos.length) ? 'none' : 'inline'));
475 $('.backButton').css('display', (currentVideo > 0 ? 'inline' : 'none'));
476 };
477 var currentLiveChannelId = 0;
478 var startLiveChannel = function(i,t,k) {
479 if (typeof MRP !== 'undefined') {
480 //MRP.stop();
481 }
482 $('.head').html(t + (i == 0 ? '' : ' lädt..'));
483 $('#tvDialog').css('width', '633px');
484 if ($('#liveTVContainer #PlaylistItem' + currentLiveChannelId).length) {
485 $('#liveTVContainer #PlaylistItem' + currentLiveChannelId + ' .playlistName').css('text-decoration', 'none');
486 }
487 if ($('#liveTVContainer #' + k).length) {
488 $('#liveTVContainer #' + k + ' .playlistName').css('text-decoration', 'underline');
489 }
490 currentLiveChannelId = i;
491 $('#liveTVContainer .secondColumn').css('display', i != 0 ? 'block' : 'none');
492 $.post('ajax/client.ui3.ajax.php', {
493 'ACTION' : 'OPEN_LIVE_CHANNEL',
494 'CHANNEL_ID' : i
495 }, function(d) {
496 $('.head').html(t);
497 $('#liveTVContainer .secondColumn').html($('<div>').html(d.html).find('.secondColumn').html());
498 if (i != 0) {
499 $('#liveTVContainer .secondColumn').css('display', i != 0 ? 'block' : 'none');
500 }
501 }, "json");
502 };
503 var startPlaylist = function(i,t,k) {
504 lastReq = '';
505 ++reqCount;
506 $('.head').html(t);
507 $('#youtubeContainer .playlistContainer').html(mainPlaylists);
508 $('.searchBox').val('');
509 $('.cancelSearchImg').css('display', 'none');
510 if ($('#youtubeContainer #PlaylistItem' + currentPlaylist.playlistId).length) {
511 $('#youtubeContainer #PlaylistItem' + currentPlaylist.playlistId + ' .playlistName').css('text-decoration', 'none');
512 }
513 $('#MyPlaylistItem .playlistName').css('text-decoration', 'none');
514 currentPlaylist.playlistId = i;
515 $('.changePlaylist').css('display', ((((currentPlaylist.playlistId == userId && roomOwnerId == userId) || bypassIdCheck) && (typeof currentPlaylist !== 'undefined' && currentPlaylist.playlistId > 0)) ? 'block' : 'none'));
516 changePlaylist(1);
517 if (typeof k === 'undefined') {
518 if (currentPlaylist.playlistId == userId) {
519 $('#MyPlaylistItem .playlistName').css('text-decoration', 'underline');
520 } else if ($('#youtubeContainer #PlaylistItem' + currentPlaylist.playlistId).length) {
521 $('#youtubeContainer #PlaylistItem' + currentPlaylist.playlistId + ' .playlistName').css('text-decoration', 'underline');
522 }
523 } else if ($('#' + k).length) {
524 $('#' + k + ' .playlistName').css('text-decoration', 'underline');
525 }
526 mainPlaylists = $('#tvDialog #youtubeContainer .playlistContainer').html();
527 $.post('ajax/client.ui3.ajax.php', {
528 'ACTION' : 'OPEN_PLAYLIST',
529 'PLAYLIST_ID' : i
530 }, function(d) {
531 currentVideo = 0;
532 currentPlaylist = d.currentPlaylist;
533 $('#youtubeContainer .secondColumn').html($('<div>').html(d.html).find('.secondColumn').html());
534 }, "json");
535 };
536 var changePlaylist = function(a) {
537 $('.addVideoButtonBox').css('display', 'none');
538 $('.addVideoURLBox').css('display', 'none');
539 $('.addVideoURL').val('');
540 $('.addVideoURL').attr('class', 'addVideoURL');
541 $('.controlButtons').css('display', 'block');
542 $('.changePlaylistButtonText').html('Playlist verwalten');
543 if (a == 1 || $('.settingButtons').css('display')=='block' || $('.addVideoButtonBox').css('display')=='block') {
544 if (a != 1) {
545 $.post('ajax/client.ui3.ajax.php', {
546 'ACTION' : 'SAVE_PLAYLIST',
547 'PLAYLIST_ID' : currentPlaylist.playlistId,
548 'VIDEOS' : currentPlaylist.videos
549 });
550 if ($('#youtubeContainer #PlaylistItem' + currentPlaylist.playlistId).length) {
551 $('#youtubeContainer #PlaylistItem' + currentPlaylist.playlistId + ' .videoCount').html(currentPlaylist.videos.length + ' Video' + (currentPlaylist.videos.length != 1 ? 's' : ''));
552 }
553 if (currentPlaylist.playlistId == userId) {
554 $('#MyPlaylistItem .videoCount').html(currentPlaylist.videos.length + ' Video' + (currentPlaylist.videos.length != 1 ? 's' : ''));
555 }
556 }
557 $('.videoInformation').css('display', 'block');
558 $('.videoThumbContainer').css('display', 'block');
559 $('.settingButtons').css('display', 'none');
560 } else {
561 $('.videoInformation').css('display', 'none');
562 $('.videoThumbContainer').css('display', 'none');
563 $('.settingButtons').css('display', 'block');
564 $('.changePlaylistButtonText').html('Playlist speichern');
565 }
566 mainPlaylists = $('#tvDialog #youtubeContainer .playlistContainer').html();
567 };
568 var deleteVideo = function() {
569 if (currentPlaylist.videos.length < 1) {
570 return;
571 }
572 currentPlaylist.videos.splice(currentVideo, 1);
573 if (currentPlaylist.videos.length < (currentVideo + 1)) {
574 --currentVideo;
575 }
576 playVideo(2);
577 };
578
579 var validateYoutubeURL = function(url) {
580 var p = /^(?:https?:\/\/)?(?:www\.)?youtube\.com\/watch\?(?=.*v=((\w|-){11}))(?:\S+)?$/;
581 return (url.match(p)) ? RegExp.$1 : false;
582 };
583
584 var YOUTUBE_BROWSER_KEY = 'AIzaSyB38kFW4n09FiY644q-X-_bXs5B8UmerVE';
585
586 var addVideo = function(url) {
587 $('.addVideoURL').val('');
588 var validation = validateYoutubeURL(url);
589 if (!validation) {
590 $('.addVideoURL').attr('class', 'addVideoURL txtError');
591 $('.addVideoURL').attr('placeholder', 'Deine Eingabe war ungültig, wiederholen..');
592 return;
593 }
594 if (currentPlaylist.videos.length >= videoLimit) {
595 $('.addVideoURL').attr('class', 'addVideoURL txtError');
596 $('.addVideoURL').attr('placeholder', 'Du darfst maximal ' + videoLimit + ' Videos haben!');
597 return;
598 }
599 for (var i = 0; i < currentPlaylist.videos.length; ++i) {
600 if (currentPlaylist.videos[i].url == validation) {
601 $('.addVideoURL').attr('class', 'addVideoURL txtError');
602 $('.addVideoURL').attr('placeholder', 'Das Video existiert bereits!');
603 return;
604 }
605 }
606 $('.addVideoURL').attr('class', 'addVideoURL');
607 $('.addVideoURL').attr('placeholder', 'Bitte warten..');
608
609 var videoFailed = false;
610
611 var invalidInput = function() {
612 $('.addVideoURL').attr('class', 'addVideoURL txtError');
613 $('.addVideoURL').attr('placeholder', 'Deine Eingabe war ungültig, wiederholen..');
614 };
615
616 $.getJSON('https://www.googleapis.com/youtube/v3/videos', {
617 'part' : 'id,snippet',
618 'id' : validation,
619 'key' : YOUTUBE_BROWSER_KEY
620 }, function (videoData) {
621 console.log(videoData);
622
623 if (videoData.items.length < 1) {
624 invalidInput();
625 return;
626 }
627
628 $.getJSON('https://www.googleapis.com/youtube/v3/channels', {
629 'part' : 'id,snippet',
630 'id' : videoData.items[0].snippet.channelId,
631 'key' : YOUTUBE_BROWSER_KEY
632 }, function(channelData) {
633 $('.addVideoURL').attr('placeholder', 'Youtube-Link eingeben..');
634 $('.addVideoButtonBox').css('display', 'none');
635 $('.addVideoURLBox').css('display', 'none');
636 $('.controlButtons').css('display', 'block');
637 $('.settingButtons').css('display', 'block');
638 $('.changePlaylistButtonText').html('Playlist speichern');
639
640 if (videoData.items[0].snippet.title.length > 43) {
641 videoData.items[0].snippet.title = videoData.items[0].snippet.title.substring(0, 43) + '..';
642 }
643 currentPlaylist.videos.push({
644 'url' : validation,
645 'title' : videoData.items[0].snippet.title,
646 'creator' : channelData.items[0].snippet.title
647 });
648
649 playVideo(3);
650 });
651
652
653 }).fail(function() {
654 invalidInput();
655 });
656 };
657 var updatePlaylistContainer = function(val) {
658 if (val != '' && lastReq != val) {
659 var req = reqCount;
660 lastReq = val;
661 $('#youtubeContainer .playlistContainer').html('');
662 $.post('ajax/client.ui3.ajax.php', {
663 'ACTION' : 'SEARCH_PLAYLISTS',
664 'SEARCH_VALUE' : val
665 }, function(d) {
666 if (req != reqCount) {
667 return;
668 }
669 $('#youtubeContainer .playlistContainer').html($('<div>').html(d.html).find('.playlistContainer').html());
670 }, "json");
671 } else if (val == '') {
672 ++reqCount;
673 lastReq = '';
674 $('#youtubeContainer .playlistContainer').html(mainPlaylists);
675 }
676 };
677 var currentAltitude = 1;
678 var maxAltitude = 30;
679 var magicVarId = 0;
680 var incrementAltitude = function() {
681 if (currentAltitude >= maxAltitude) {
682 return false;
683 }
684 currentAltitude += 0.1;
685 currentAltitude = Math.round((currentAltitude)*100)/100;
686 $('#magicVarAltitude').val(String(currentAltitude).replace(".", ","));
687 $('#magicVarAltitudeRange').val(String(currentAltitude));
688 submitAltitude(currentAltitude);
689 };
690 var decrementAltitude = function() {
691 if ((currentAltitude - 0.1) < 0) {
692 currentAltitude = 0;
693 } else {
694 currentAltitude -= 0.1;
695 }
696 currentAltitude = Math.round((currentAltitude)*100)/100;
697 $('#magicVarAltitude').val(String(currentAltitude).replace(".", ","));
698 $('#magicVarAltitudeRange').val(String(currentAltitude));
699 submitAltitude(currentAltitude);
700 };
701 var setAltitude = function(alt) {
702 currentAltitude = alt;
703 currentAltitude = Math.round((currentAltitude)*100)/100;
704 $('#magicVarAltitude').val(String(currentAltitude).replace(".", ","));
705 };
706
707 /**
708 ** @author Shynoshy
709 ** @see http://forum.ragezone.com/f353/b64-vl64-javascript-implementation-940244/
710 **/
711 function encodeB64(number) {
712 var buff = ['@', '@', '@'];
713 for (var i = 0; number > 0; ++i, number = Math.floor(number / 64))
714 buff[i] = String.fromCharCode((number % 64) + 64);
715 return buff.reverse().join('');
716 }
717
718 function encodeRawMessage(msg) {
719 return encodeB64(msg.length) + msg;
720 }
721
722 window.encodeRawMessage = encodeRawMessage;
723
724 var submitAltitude = function(alt) {
725 HabboSWF.sendRawData("!" + encodeRawMessage(JSON.stringify({
726 EventType: 'UpdateStackmagicAltitude',
727 ItemID: magicVarId,
728 NewAltitude: alt
729 })));
730 $('#magicVarAltitudeRange').val(String(currentAltitude));
731 };
732 var joinRoom = function(type) {
733 HabboSWF.sendRawData("!" + encodeRawMessage(JSON.stringify({
734 EventType: 'JoinRoom',
735 RoomID: type == 2 ? fightArenaRoom : eventAlertRoomId
736 })));
737 };
738 var updateAltitude = function(alt) {
739 currentAltitude = Math.round((alt)*100)/100;
740 $('#magicVarAltitude').val(String(currentAltitude).replace(".", ","));
741 $('#magicVarAltitudeRange').val(String(currentAltitude));
742 };
743 var triggerCooldown = false;
744 FlashExternalInterface.triggerFloorItem = function(k) {
745 if (triggerCooldown)
746 {
747 return;
748 }
749 triggerCooldown = true;
750 $.post('ajax/client.ui3.ajax.php', {
751 'ACTION' : 'OPEN_WINDOW',
752 'FURNI_ID' : k
753 }, function(d) {
754 triggerCooldown = false;
755 if (d.isTV) {
756 if (d.isYoutube) {
757 $('.head').html('YouTube TV');
758 $('#tvDialog').css('width', '633px');
759 $('#youtubeContainer').css('display', 'block');
760 $('#liveTVContainer').css('display', 'none');
761 } else {
762 startLiveChannel(0, 'Live TV', 'PlaylistItem0');
763 $('#tvDialog').css('width', '246px');
764 $('#youtubeContainer').css('display', 'none');
765 $('#liveTVContainer').css('display', 'block');
766 }
767 if (d.ownerID > 0) {
768 roomOwnerId = d.ownerID;
769 if (d.isYoutube) {
770 startPlaylist(d.ownerID, d.ownerName + '\'s Playlist');
771 }
772 }
773 $('#friendlockContainer').css('display', 'none');
774 $('#magicVarContainer').css('display', 'none');
775 $('#liveJumpContainer').css('display', 'none');
776 $('#requestFriendLock').css('display', 'none');
777 $("#badgeSelectionContainer").css('display', 'none');
778 $('#friendLockRequestReceived').css('display', 'none');
779 $('#tvDialog').css({
780 'left' : '25%',
781 'top' : '25%',
782 'display' : 'block'
783 });
784 $('.tvContainer .content').css('height', '300px');
785 } else if (d.gameType > 0) {
786 if (d.gameType == 3) {
787 $('#tvDialog').css('display', 'none');
788 $('#friendlockContainer').css({
789 'display' : 'block',
790 'left' : '25%',
791 'top' : '25%'
792 });
793 $('#requestContainer').css('display', 'block');
794 $('#requestReceivedContainer').css('display', 'none');
795 $('#friendlock').css('display', 'none');
796 } else if(d.gameType == 4) {
797 $('#tvDialog').css('display', 'none');
798 $('#friendlockContainer').css({
799 'display' : 'block',
800 'left' : '25%',
801 'top' : '25%'
802 });
803 $('#requestContainer').css('display', 'none');
804 $('#requestReceivedContainer').css('display', 'none');
805 $('#friendlock').css('display', 'block');
806
807 if (d.specialInfo == 1) {
808 $('#friendlock').css('background', 'url(images/love_lock.png)');
809 $('#friendlockDescription').html('Bis uns die Pixel scheiden');
810 } else if(d.specialInfo == 2) {
811 $('#friendlock').css('background', 'url(images/hween_lock.png)');
812 $('#friendlockDescription').html('Freunde bis zum letzten Flackern');
813 } else {
814 $('#friendlock').css('background', 'url(images/wildwest_lock.png)');
815 $('#friendlockDescription').html('Komplizen');
816 }
817
818 $('#friendlockAvatar1').css('background', 'url(https://avatar.localhost/avatarimage?figure=' + d.figure1Data + '&direction=2&head_direction=2)');
819 $('#friendlockAvatar2').css('background', 'url(https://avatar.localhost/avatarimage?figure=' + d.figure2Data + '&direction=4&head_direction=4)');
820 $('#friendlockDate').html(d.dateData);
821 $('#friendlockNames').html(d.nameData);
822 } else {
823 $('#friendlockContainer').css('display', 'none');
824 $('.head').html('Live-Jump mit ' + (d.gameType == 1 ? 'Imagician' : 'Optimus'));
825 $('#tvDialog').css('width', '422px');
826 $('#magicVarAltitude').css('display', 'none');
827 $('#liveTVContainer').css('display', 'none');
828 $('#youtubeContainer').css('display', 'none');
829 $('#liveJumpContainer').css('display', 'block');
830 $('#magicVarContainer').css('display', 'none');
831 $('#requestFriendLock').css('display', 'none');
832 $("#badgeSelectionContainer").css('display', 'none');
833 $('#friendLockRequestReceived').css('display', 'none');
834 $('#liveJumpContainer iframe').attr('src', '/liveJump/imagician.php?type=' + d.gameType);
835 $('#tvDialog').css({
836 'left' : '25%',
837 'top' : '25%',
838 'display' : 'block'
839 });
840 $('.tvContainer .content').css('height', '552px');
841 }
842 } else if (d.handleFurni) {
843 displayMagicVar(k, d.specialInfo);
844 }
845 }, "json").fail(function() {
846 console.log("Cooldown started!");
847 triggerCooldown = true;
848 setTimeout(function() {
849 console.log("Cooldown ended!");
850 triggerCooldown = false;
851 }, 5000);
852 })
853
854 };
855
856 var displayMagicVar = function(furniId, altitude) {
857 currentAltitude = Math.round((parseFloat(altitude))*100)/100;
858 $('#magicVarAltitude').val(String(currentAltitude).replace(".", ","));
859 $('#magicVarAltitudeRange').val(String(currentAltitude));
860 magicVarId = furniId;
861 $('.head').html('Stapelhilfe');
862 $('#friendlockContainer').css('display', 'none');
863 $('#tvDialog').css('width', '376px');
864 $('#youtubeContainer').css('display', 'block');
865 $('#liveJumpContainer').css('display', 'none');
866 $('#liveTVContainer').css('display', 'none');
867 $('#youtubeContainer').css('display', 'none');
868 $('#requestFriendLock').css('display', 'none');
869 $('#magicVarContainer').css('display', 'block');
870 $("#badgeSelectionContainer").css('display', 'none');
871 $('#friendLockRequestReceived').css('display', 'none');
872 $('#magicVarContainer input').css('display', 'inline');
873 $('#tvDialog').css({
874 'left' : '25%',
875 'top' : '25%',
876 'display' : 'block'
877 });
878 $('.tvContainer .content').css('height', '210px');
879 };
880
881 var roomId = 0;
882 FlashExternalInterface.legacyTrack = function (n, k, m) {
883 if (n == 'navigator' && k == 'private' && !isNaN(m) && roomId != m) {
884 $('#tvDialog').css('display', 'none');
885 startPlaylist(-1);
886 $('.changePlaylist').css('display', 'none');
887 roomId = parseInt(m);
888 }
889 };
890
891 var wiredSounds = {};
892 var gameSounds = {};
893 var currentVolume = 100;
894
895 (function (d) {
896 for (var i = 0; i < d.length; ++i) {
897 wiredSounds[d[i]] = (new Audio('https://static.localhost/RELEASE63-34888-34886-201107192308_9e5b377e2ee4333b61eb9d20d356936d/hof_furni/mp3/sound_machine_sample_' + d[i] + '.mp3'));
898 wiredSounds[d[i]].volume = currentVolume / 100;
899 }
900 })([
901 701, 478, 702, 719, 720, 722, 721, 723, 57, 703, 386, 724, 237, 707, 708, 706, 24, 726, 728, 729, 727, 609, 716, 715, 717, 714, 725, 718, 5, 34
902 ]);
903
904 (function (d) {
905 for (var i = 0; i < d.length; ++i) {
906 gameSounds[d[i]] = (new Audio('https://static.localhost/RELEASE63-34888-34886-201107192308_9e5b377e2ee4333b61eb9d20d356936d/hof_furni/mp3/games/' + d[i] + '.wav'));
907 gameSounds[d[i]].volume = currentVolume / 100;
908 }
909 })([
910 'gunshot2', 'zombie_hit', 'zombie_dead', 'zombie_eat', 'gun_reload', 'dryfire', 'points', 'doorbell'
911 ]);
912
913 var eventAlertSound = new Audio('https://static.localhost/RELEASE63-34888-34886-201107192308_9e5b377e2ee4333b61eb9d20d356936d/hof_furni/mp3/event_sound.mp3?d=1479602283');
914 eventAlertSound.volume = currentVolume / 100;
915
916 var selectBadgeCode = "";
917 var selectBadgeDisplayId = -1;
918 var selectBadgeRoomId = -1;
919
920 function selectBadge(badgeCode) {
921 selectBadgeCode = badgeCode;
922
923 if (badgeCode.substring(0, 6) == "USRBDG") {
924 $("#sellBadgeCheckbox").removeAttr("disabled");
925 } else {
926 $("#sellBadgeCheckbox").attr("disabled", true);
927 }
928 }
929
930 function submitBadgeSelection() {
931 if ($("#selectBadgeButtonText").html() != "Badge auswählen") {
932 return;
933 }
934
935 var sellBadge = $('#sellBadgeCheckbox:not([disabled])').length > 0 && $('#sellBadgeCheckbox:checked').length > 0;
936
937 if (selectBadgeCode.length < 1) {
938 alert ("Du hast noch kein Badge ausgewählt.");
939 return;
940 }
941
942 $("#selectBadgeButtonText").html("Bitte warten..");
943
944 $.post('ajax/badge-display.php', {
945 'ACTION' : 'SELECT_BADGE',
946 'ITEM_ID' : selectBadgeDisplayId,
947 'ROOM_ID' : selectBadgeRoomId,
948 'BDG_CODE' : selectBadgeCode,
949 'SELL' : sellBadge ? 1 : 0
950 }, function(d) {
951 $("#selectBadgeButtonText").html("Badge auswählen");
952
953 if (d.status < 1) {
954 alert("Du kannst kein Badge-o-matic Badge auswählen, wenn dieses nicht von dir gemacht ist.");
955 return;
956 }
957
958 $("#tvDialog").css("display", "none");
959 }, "json");
960 }
961
962 var currentContainerBadgeCode = "";
963 var currentBadgeContainerId = -1;
964 var currentBadgeContainerRoomId = -1;
965
966 function buyCurrentBadge() {
967 if (currentContainerBadgeCode.length < 1 || currentBadgeContainerId < 1 || $("#badgeBuyButtonText").html() != "Kaufen") {
968 return;
969 }
970
971 $("#badgeBuyButtonText").html("Bitte warten..");
972
973 $.post('ajax/badge-display.php', {
974 'ACTION' : 'BUY_BADGE',
975 'ITEM_ID' : currentBadgeContainerId,
976 'ROOM_ID' : currentBadgeContainerRoomId
977 }, function(d) {
978 $("#badgeBuyButtonText").html("Kaufen");
979
980 if (d.error.length > 0) {
981 alert(d.error);
982 } else {
983 $("#badgeContainer").css("display", "none");
984 }
985 }, "json");
986 }
987
988 var lastYoutubeWiredID = 0;
989
990 FlashExternalInterface.isButtonEnabled = (id) => {
991 return rpgEnabled || fightingEnabled;
992 };
993
994 document.onkeydown = function(evt) {
995 evt = evt || window.event;
996 if (evt.keyCode == 18) {
997 HabboSWF.sendRawData("!" + encodeRawMessage(JSON.stringify({
998 EventType: 'PVEShoot',
999 })));
1000 }
1001 };
1002
1003
1004 FlashExternalInterface.isUserTempActionEnabled = () => {
1005 return rpgEnabled || fightingEnabled;
1006 };
1007
1008 FlashExternalInterface.onUserTempAction = (virtualId) => {
1009 if (fightingEnabled) {
1010 HabboSWF.sendRawData("!" + encodeRawMessage(JSON.stringify({
1011 EventType: 'FightArenaAttackUserShortcut',
1012 virtualId: virtualId,
1013 })));
1014 return true;
1015 }
1016
1017 HabboSWF.sendRawData("!" + encodeRawMessage(JSON.stringify({
1018 EventType: 'RemoteEvent',
1019 name: 'attack_user_shortcut',
1020 body: virtualId,
1021 })));
1022 return true;
1023 };
1024
1025
1026 FlashExternalInterface.onButtonClick = (id, userId) => {
1027 if (id == 1) {
1028 if (fightingEnabled) {
1029 HabboSWF.sendRawData("!" + encodeRawMessage(JSON.stringify({
1030 EventType: 'FightArenaAttackUser',
1031 userId: userId,
1032 })));
1033 return true;
1034 }
1035 HabboSWF.sendRawData("!" + encodeRawMessage(JSON.stringify({
1036 EventType: 'RemoteEvent',
1037 name: 'attack_user',
1038 body: userId,
1039 })));
1040
1041 return false;
1042 } else if(id == 2) {
1043 HabboSWF.sendRawData("!" + encodeRawMessage(JSON.stringify({
1044 EventType: 'RemoteEvent',
1045 name: 'rob_user',
1046 body: userId,
1047 })));
1048
1049 return true;
1050 }
1051 };
1052
1053 FlashExternalInterface.logPlaneParserXML = function(data) {
1054 console.log(data);
1055 };
1056
1057 FlashExternalInterface.logMessage = function(id, data) {
1058 /**
1059 * Let's listen to a sound.
1060 **/
1061 if (id == 1337) {
1062 var audio = wiredSounds[parseInt(data.substring(2))];
1063 if (audio.paused) {
1064 audio.play();
1065 } else {
1066 audio.currentTime = 0;
1067 }
1068 /**
1069 * Update the volume
1070 **/
1071 } else if(id == 1338) {
1072 currentVolume = parseInt(data.substring(2));
1073 eventAlertSound.volume = currentVolume / 100;
1074 youtubeBackgroundPlayer.setVolume(currentVolume);
1075 for (prop in wiredSounds) {
1076 if (!wiredSounds.hasOwnProperty(prop)) {
1077 //The current property is not a direct property of wiredSounds
1078 continue;
1079 }
1080 wiredSounds[prop].volume = currentVolume / 100;
1081 }
1082 for (prop in gameSounds) {
1083 if (!gameSounds.hasOwnProperty(prop)) {
1084 continue;
1085 }
1086 gameSounds[prop].volume = currentVolume / 100;
1087 }
1088 /**
1089 * Stop all sounds and close some windows when leaving the room.
1090 **/
1091 } else if(id == 1339) {
1092 // If sound wired id is set then only stop wiredSounds[soundId]
1093 if (data.length > 2) {
1094 var prop = parseInt(data.substring(2));
1095 wiredSounds[prop].currentTime = 0;
1096 wiredSounds[prop].pause();
1097 // If there isn't any id set stop it all
1098 } else {
1099 $('#tvDialog').css('display', 'none');
1100 window.CameraEventBus.$emit('disable-camera');
1101 window.CameraEventBus.$emit('disable-farming');
1102 window.CameraEventBus.$emit('stop-youtube-video');
1103 window.CameraEventBus.$emit('disable-rpg');
1104 window.CameraEventBus.$emit('disable-fightarena');
1105 window.CameraEventBus.$emit('disable-pve');
1106 rpgEnabled = false;
1107 fightingEnabled = false;
1108 youtubeBackgroundPlayer.stopVideo();
1109 for (prop in wiredSounds) {
1110 if (!wiredSounds.hasOwnProperty(prop)) {
1111 //The current property is not a direct property of wiredSounds
1112 continue;
1113 }
1114 wiredSounds[prop].currentTime = 0;
1115 wiredSounds[prop].pause();
1116 }
1117 }
1118 /**
1119 * Open easter egg container
1120 **/
1121 } else if(id == 1340) {
1122 if (data.length > 2) {
1123 data = data.split(";");
1124 if (data[1].indexOf("*") > -1) {
1125 data[1] = data[1].substring(0, data[1].indexOf("*"));
1126 }
1127 if (data[2].indexOf("*") > -1) {
1128 data[2] = data[2].substring(0, data[2].indexOf("*"));
1129 }
1130 $("#furniImage").hide();
1131 $("#eggImage").css("background", "url(https://localhost/habbo-imaging/furniture?file=" + data[2] + "&animation=14) no-repeat center center");
1132 $("#furniImage").css("background", "url(https://localhost/habbo-imaging/furniture?file=" + data[1] + ") no-repeat center center");
1133 $("#easterEggContainer").fadeIn(function() {
1134 $("#furniImage").fadeIn("slow");
1135 });
1136 }
1137
1138 /**
1139 * Select badge for badge_display
1140 **/
1141 } else if (id == 1341) {
1142 var dataIds = data.substring(2).split(" ");
1143
1144 selectBadgeDisplayId = parseInt(dataIds[0]);
1145 selectBadgeRoomId = parseInt(dataIds[2]);
1146
1147 $('.head').html('Badge auswählen');
1148 $("#selectBadgeButtonText").html("Badge auswählen");
1149
1150 $('#tvDialog').css('width', '329px');
1151
1152 $('#friendlockContainer').css('display', 'none');
1153 $('#liveJumpContainer').css('display', 'none');
1154 $('#liveTVContainer').css('display', 'none');
1155 $('#youtubeContainer').css('display', 'none');
1156 $('#requestFriendLock').css('display', 'none');
1157 $('#magicVarContainer').css('display', 'none');
1158 $("#badgeSelectionContainer").css('display', 'block');
1159 $('#friendLockRequestReceived').css('display', 'none');
1160
1161 $('#tvDialog').css({
1162 'left' : '25%',
1163 'top' : '25%',
1164 'display' : 'block'
1165 });
1166
1167 $('.tvContainer .content').css('height', '291px');
1168
1169 /**
1170 * Show badge container
1171 **/
1172 } else if (id == 1342) {
1173 var dataFields = data.substring(2).split(" ");
1174 var itemId = parseInt(dataFields[0]);
1175 var badgeCode = dataFields[1];
1176 var displayBuyButton = parseInt(dataFields[2]) > 0;
1177 var roomId = parseInt(dataFields[3]);
1178
1179 currentBadgeContainerRoomId = roomId;
1180 currentBadgeContainerId = itemId;
1181 currentContainerBadgeCode = badgeCode;
1182
1183 $("#buyBadgeContainer").css("display", displayBuyButton ? "block" : "none");
1184 $("#badgeImage").css("background", "url(https://static.localhost/habbo-imaging/badge-imaging.php?" + badgeCode + ") no-repeat center center");
1185 $("#badgeTitle").html(externalTexts["badge_name_" + badgeCode]);
1186 $("#badgeDescription").html(externalTexts["badge_desc_" + badgeCode]);
1187 $("#badgeContainer").css("display", "block");
1188
1189
1190 /**
1191 * Play Youtube video
1192 **/
1193 } else if (id == 1343) {
1194 // Close visual video
1195 window.CameraEventBus.$emit('stop-youtube-video');
1196
1197 var dataFields = data.substring(2).split(" ");
1198 var wiredID = dataFields[0];
1199 var videoID = dataFields[1];
1200 var timeShift = dataFields[2];
1201
1202 lastYoutubeWiredID = wiredID;
1203
1204 youtubeBackgroundPlayer.setVolume(currentVolume);
1205 youtubeBackgroundPlayer.loadVideoById(videoID, timeShift, "small");
1206
1207 /**
1208 * Take a youtube wired action
1209 **/
1210 } else if (id == 1344) {
1211 if (lastYoutubeWiredID == data.substring(2)) {
1212 lastYoutubeWiredID = 0;
1213 youtubeBackgroundPlayer.stopVideo();
1214 window.CameraEventBus.$emit('stop-youtube-video');
1215 }
1216 /**
1217 * Stop YouTube sound
1218 **/
1219 } else if (id == 1345) {
1220 console.log('Stopping..');
1221 youtubeBackgroundPlayer.stopVideo();
1222 window.CameraEventBus.$emit('stop-youtube-video');
1223
1224 /**
1225 * Display stackmagic tool
1226 **/
1227 } else if (id == 1346) {
1228 var dataFields = data.substring(2).split(" ");
1229 displayMagicVar(parseInt(dataFields[0]), dataFields[1]);
1230
1231
1232 /**
1233 * Update stackmagic tool
1234 **/
1235 } else if(id == 1347) {
1236 var dataFields = data.substring(2).split(" ");
1237 var itemId = parseInt(dataFields[0]);
1238
1239 if (magicVarId == itemId) {
1240 updateAltitude(dataFields[1]);
1241 }
1242
1243
1244 /**
1245 * Open event container
1246 **/
1247 } else if(id == 1348) {
1248 if (eventAlertHideTimeout !== undefined) {
1249 clearInterval(eventAlertHideTimeout);
1250 }
1251
1252 var subData = data.substring(2);
1253 var roomId = subData.split(" ")[0];
1254 var message = escapeHtml(subData.substring(roomId.length + 1)).replace(/{(.+?)}/g, '<b>$1</b>');
1255 eventAlertRoomId = parseInt(roomId);
1256
1257 /*$("#eventAlertMessage").html(message);
1258 $("#eventAlertContainer").css({
1259 "display" : "block",
1260 "top": "32%",
1261 "left": "38%"
1262 });*/
1263
1264 eventAlertContainerIdentifier = "#eventAlertContainerv2";
1265 eventAlertHtmlContentIdentifier = "#eventAlertMessagev2";
1266
1267 if(SMALL_EVENTALERT_ENABLED) {
1268 eventAlertContainerIdentifier = "#simple-eventha";
1269 eventAlertHtmlContentIdentifier = "#eventha-html";
1270 }
1271
1272 $(eventAlertHtmlContentIdentifier).html(message);
1273 $(eventAlertContainerIdentifier).css({
1274 "display" : "block"
1275 });
1276
1277 if (SMALL_EVENTALERT_ENABLED) {
1278 $(eventAlertContainerIdentifier).css({ "top": ($("#fight-info").css("display") == "block" ? "287px" : "184px") });
1279 }
1280
1281 //desktop_notification("Es findet nun ein Event statt!");
1282
1283 eventAlertSound.currentTime = 0;
1284 eventAlertSound.play();
1285
1286 eventAlertHideTimeout = setTimeout(function() {
1287 $(eventAlertContainerIdentifier).css("display", "none");
1288 }, 300000);
1289 } else if(id == 1349) {
1290 var subData = data.substring(2);
1291 var specId = subData.split(" ")[0];
1292 var specIp = subData.substring(specId.length + 1);
1293 console.log("[1349] " + data);
1294 if(specIp == "RMV") {
1295 var o = $("#ic-" + specId);
1296 $(o).fadeOut("fast", function() {
1297 $(o).remove();
1298 });
1299 } else {
1300 createIpCheckBox("ic-" + specId, specIp);
1301 }
1302 } else if(id == 1350) {
1303 var subData = data.substring(2);
1304 var iconType = subData.split(" ")[0];
1305 var specMessage = subData.substring(iconType.length + 1);
1306
1307 createCurrencyBox(iconType, specMessage);
1308 } else if(id == 4001) {
1309 var photos = JSON.parse(data.substring(2));
1310 window.CameraEventBus.$emit('update-room-photos', photos);
1311 } else if(id == 4002) {
1312 window.CameraEventBus.$emit('photo-purchase-result');
1313 } else if(id == 4003) {
1314 window.CameraEventBus.$emit('view-photo', parseInt(data.substring(2), 10));
1315 } else if(id == 4004) {
1316 if (showBoardGameTooltip) {
1317 setInterval(function() {
1318 if (!showBoardGameTooltip) {
1319 return;
1320 }
1321 showBoardGameTooltip = false;
1322 $('#board-game-tooltip').fadeIn();
1323 }, 15000);
1324 }
1325 let roomId = parseInt(data.substring(2), 10);
1326 if (roomId == 726012 || roomId == 726066) {
1327 window.CameraEventBus.$emit('enable-farming');
1328 }
1329 window.CameraEventBus.$emit('enable-camera');
1330 } else if(id == 4005) {
1331 window.CameraEventBus.$emit('update-basket', data.substring(2));
1332 } else if(id == 4006) {
1333 var fruits = JSON.parse(data.substring(2));
1334 window.CameraEventBus.$emit('update-fruits', fruits);
1335 } else if(id == 4007) {
1336 window.CameraEventBus.$emit('open-shop');
1337 } else if(id == 4008) {
1338 window.CameraEventBus.$emit('start-blackjack');
1339 } else if(id == 4009) {
1340 window.CameraEventBus.$emit('update-blackjack-state', JSON.parse(data.substring(2)));
1341 } else if(id == 4010) {
1342 window.CameraEventBus.$emit('on-blackjack-request', JSON.parse(data.substring(2)));
1343 } else if(id == 4011) {
1344 window.CameraEventBus.$emit('open-blackjack-request-settings', JSON.parse(data.substring(2)));
1345 } else if(id == 4012) {
1346 setTimeout(() => HabboSWF.closeExtraWidget(), 1000);
1347 } else if(id == 4013) {
1348 var data = JSON.parse(data.substring(2));
1349 window.CameraEventBus.$emit('open-wired-settings', data);
1350 } else if(id == 4014) {
1351 var dataFields = data.substring(2).split(" ");
1352 var wiredID = dataFields[0];
1353 var videoUrl = dataFields[1];
1354
1355 lastYoutubeWiredID = wiredID;
1356
1357 // Stop background YouTube
1358 if (youtubeBackgroundPlayer !== null)
1359 youtubeBackgroundPlayer.stopVideo();
1360
1361 console.log('Playing', videoUrl);
1362 window.CameraEventBus.$emit('play-youtube-video', videoUrl);
1363 } else if(id == 4015) {
1364 var data = JSON.parse(data.substring(2));
1365 window.CameraEventBus.$emit('update-rpg-profile', data);
1366 } else if(id == 4016) {
1367 var data = JSON.parse(data.substring(2));
1368 window.CameraEventBus.$emit('enable-rpg', data);
1369 rpgEnabled = true;
1370 } else if(id == 4017) {
1371 window.CameraEventBus.$emit('disable-rpg');
1372 rpgEnabled = false;
1373 } else if(id == 4018) {
1374 var data = JSON.parse(data.substring(2));
1375 window.CameraEventBus.$emit('update-gang-info', data);
1376 } else if(id == 4019) {
1377 var data = JSON.parse(data.substring(2));
1378 window.CameraEventBus.$emit('enable-fightarena', data);
1379 fightingEnabled = data.canFight;
1380 } else if(id == 4020) {
1381 var data = JSON.parse(data.substring(2));
1382 window.CameraEventBus.$emit('update-fightarena', data);
1383 fightingEnabled = data.canFight;
1384 } else if(id == 4021) {
1385 window.CameraEventBus.$emit('on-arenafight-request', JSON.parse(data.substring(2)));
1386 } else if(id == 4022) {
1387 if (fightArenaUpdatable) {
1388 fightArenaUpdatable = false;
1389 var subData = data.substring(2);
1390 var roomId = subData.split(" ")[0];
1391 var message = escapeHtml(subData.substring(roomId.length + 1)).replace(/{(.+?)}/g, '<b>$1</b>');
1392 fightArenaRoom = parseInt(roomId);
1393 $("#fightinfo-html").html(message);
1394 $("#fight-info").css({
1395 "display" : "block",
1396 "top": ($("#simple-eventha").css("display") == "block" ? "293px" : "184px"),
1397 });
1398 setTimeout(function() {
1399 $("#fight-info").css({ "display" : "none" });
1400 fightArenaUpdatable = true;
1401 }, 15000);
1402 }
1403 } else if(id == 4023) {
1404 var audio = gameSounds[data.substring(2)];
1405 if (audio.paused) {
1406 audio.play();
1407 } else {
1408 audio.currentTime = 0;
1409 }
1410 } else if(id == 4024) {
1411 var audioData = data.substring(2).split(';');
1412 var volumeFactor = parseFloat(audioData[1]);
1413 const audio = (new Audio('https://static.localhost/RELEASE63-34888-34886-201107192308_9e5b377e2ee4333b61eb9d20d356936d/hof_furni/mp3/games/' + audioData[0] + '.wav'));
1414 audio.volume = currentVolume / 100 * volumeFactor;
1415 audio.play();
1416 } else if(id == 4025) {
1417 var data = JSON.parse(data.substring(2));
1418 window.CameraEventBus.$emit('update-pve-profile-stats', data);
1419
1420 } else if(id == 4026) {
1421 var data = JSON.parse(data.substring(2));
1422 window.CameraEventBus.$emit('update-pve-wave-info', data);
1423 } else if(id == 4027) {
1424 var data = JSON.parse(data.substring(2));
1425 window.CameraEventBus.$emit('open-pve-ranking', data);
1426 } else if(id == 4028) {
1427 var data = JSON.parse(data.substring(2));
1428 window.CameraEventBus.$emit('open-gameboard-create-dialog', data);
1429 } else if(id == 4029) {
1430 var data = JSON.parse(data.substring(2));
1431 createBoardGameInvitationBox(data);
1432 //window.CameraEventBus.$emit('open-gameboard-join-dialog', data);
1433 } else if(id == 4030) {
1434 window.CameraEventBus.$emit('close-gameboard-dialogues');
1435 }
1436 }
1437
1438 var rpgEnabled = false;
1439 var fightingEnabled = false;
1440 var fightArenaRoom = 0;
1441 var fightArenaUpdatable = true;
1442
1443 var entityMap = {
1444 "&": "&",
1445 "<": "<",
1446 ">": ">",
1447 '"': '"',
1448 "'": ''',
1449 "/": '/'
1450 };
1451
1452 function escapeHtml(string) {
1453 return String(string).replace(/[&<>"'\/]/g, function (s) {
1454 return entityMap[s];
1455 });
1456 }
1457
1458 var HabboSWF = null;
1459 var HabboSWFUnderlying = null;
1460 var eventAlertRoomId = 0;
1461 var eventAlertHideTimeout = undefined;
1462
1463 var onSWFEmbed = function(e) {
1464 $("body").mousemove(function(e) {
1465 window.mouseX = e.clientX;
1466 window.mouseY = e.clientY;
1467 });
1468 window.onbeforeunload = function(e) {
1469 if (!adblock && $('#pre-container').css('top') != '-974px') {
1470 var x = window.mouseX, y = window.mouseY;
1471 console.log(x, y);
1472
1473 if (x >= (window.innerWidth * 0.1) && x <= (window.innerWidth * 0.26 + 828) && y >= 0 && y <= 200) {
1474 console.log('X');
1475 var img = new Image();
1476 img.src = '/ajax/trigger_rew';
1477 }
1478 }
1479 };
1480 FlashExternalInterface.embedSwfCallback(e);
1481 HabboSWF = e.ref;
1482 window.HabboClient = e.ref;
1483 };
1484
1485 var clientUrl = "https://static.localhost/RELEASE63-34888-34886-201107192308_9e5b377e2ee4333b61eb9d20d356936d/Habbo_300120_build.swf";
1486 swfobject.embedSWF(clientUrl, "flash-container", "100%", "100%", "11.1.0", "https://localhost/web-gallery/flash/expressInstall.swf", flashvars, params, null, onSWFEmbed);
1487
1488 window.onbeforeunload = unloading;
1489
1490 function unloading() {
1491 var clientObject;
1492 if (navigator.appName.indexOf("Microsoft") != -1) {
1493 clientObject = window["flash-container"];
1494 } else {
1495 clientObject = document["flash-container"];
1496 }
1497 try {
1498 clientObject.unloading();
1499 } catch (e) {}
1500 }
1501
1502 //window.onresize = function() {
1503 // HabboClient.storeWindowSize();
1504 //}.debounce(0.5);
1505
1506 /**
1507 * Youtube iFrame API embedded by youtube-wired,
1508 * calling onVueYouTubeIframeAPIReady
1509 **/
1510 var youtubeBackgroundPlayer;
1511
1512 window.onVueYouTubeIframeAPIReady = () => {
1513 youtubeBackgroundPlayer = new YT.Player('background-youtube-sound');
1514 };
1515</script>
1516<!--[if IE 8]>
1517<link rel="stylesheet" href="flashclient/ie8.css" type="text/css" />
1518<![endif]-->
1519<!--[if lt IE 8]>
1520<link rel="stylesheet" href="flashclient/ie.css" type="text/css" />
1521<![endif]-->
1522<!--[if lt IE 7]>
1523<link rel="stylesheet" href="flashclient/ie6.css" type="text/css" />
1524<script src="flashclient/pngfix.js" type="text/javascript"></script>
1525<script type="text/javascript">
1526try { document.execCommand('BackgroundImageCache', false, true); } catch(e) {}
1527</script>
1528
1529<![endif]-->
1530</head>
1531
1532<body id="client" class="flashclient">
1533<div id="overlay"></div>
1534<img src="flashclient/page_loader.gif" style="position:absolute; margin: -1500px;" />
1535
1536<div id="overlay"></div>
1537<div id="client-ui" >
1538 <div id="flash-wrapper" style="width:100%">
1539
1540 <div id="flash-container">
1541 <div id="content" style="width: 400px; margin: 20px auto 0 auto; display: none">
1542<div class="cbb clearfix">
1543 <h2 class="title">Aggiorna Flash Player all'ultima versione disponibile</h2>
1544 <div class="box-content">
1545 <p>Puoi scaricare e istallare Adobe Flash Player <a href="http://get.adobe.com/flashplayer/">da questa URL</a>. Puoi trovare le istruzioni di istallazione <a href="http://www.adobe.com/products/flashplayer/productinfo/instructions/">cliccando qui</a>.</p>
1546
1547 <p><a href="http://www.adobe.com/go/getflashplayer"><img src="flashclient/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
1548 </div>
1549</div>
1550 </div>
1551 <script type="text/javascript">
1552 $('content').show();
1553 </script>
1554 </div>
1555 </div>
1556
1557 <div id="content" class="client-content"></div>
1558</div>
1559
1560 <script type="text/javascript">
1561 RightClick.init("flash-wrapper", "flash-container");
1562 if (window.opener && window.opener != window && window.opener.location.href == "/") {
1563 window.opener.location.replace("/home");
1564 }
1565 $(document.body).addClassName("js");
1566 HabboClient.startPingListener();
1567 </script>
1568
1569<div style="left: 25px;position: absolute;top: 12px;z-index: 1060;
1570">
1571<a target="_blank" href="/home"><button class="web-button">
1572<div class="arrow"></div><div class="arrow2"></div>
1573<span>WEB</span></button></a>
1574
1575<button onclick="toggleFullScreen()" class="fullscreen-button"><i></i></button></div>
1576
1577<script src="http://www.google-analytics.com/ga.js" type="text/javascript"></script>
1578<script type="text/javascript">
1579var pageTracker = _gat._getTracker("UA-448325-20");
1580pageTracker._trackPageview();
1581</script>
1582
1583<script type="text/javascript">
1584 HabboView.run();
1585</script>
1586</body>
1587</html><!--[if IE 8]>
1588<link rel="stylesheet" href="flashclient/ie8.css" type="text/css" />
1589<![endif]-->
1590<!--[if lt IE 8]>
1591<link rel="stylesheet" href="flashclient/ie.css" type="text/css" />
1592<![endif]-->
1593<!--[if lt IE 7]>
1594<link rel="stylesheet" href="flashclient/ie6.css" type="text/css" />
1595<script src="flashclient/pngfix.js" type="text/javascript"></script>
1596<script type="text/javascript">
1597try { document.execCommand('BackgroundImageCache', false, true); } catch(e) {}
1598</script>
1599
1600<![endif]-->
1601</head>
1602
1603<body id="client" class="flashclient">
1604<div id="overlay"></div>
1605<img src="flashclient/page_loader.gif" style="position:absolute; margin: -1500px;" />
1606
1607<div id="overlay"></div>
1608<div id="client-ui" >
1609 <div id="flash-wrapper" style="width:100%">
1610
1611 <div id="flash-container">
1612 <div id="content" style="width: 400px; margin: 20px auto 0 auto; display: none">
1613<div class="cbb clearfix">
1614 <h2 class="title">Aggiorna Flash Player all'ultima versione disponibile</h2>
1615 <div class="box-content">
1616 <p>Puoi scaricare e istallare Adobe Flash Player <a href="http://get.adobe.com/flashplayer/">da questa URL</a>. Puoi trovare le istruzioni di istallazione <a href="http://www.adobe.com/products/flashplayer/productinfo/instructions/">cliccando qui</a>.</p>
1617
1618 <p><a href="http://www.adobe.com/go/getflashplayer"><img src="flashclient/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
1619 </div>
1620</div>
1621 </div>
1622 <script type="text/javascript">
1623 $('content').show();
1624 </script>
1625 </div>
1626 </div>
1627
1628 <div id="content" class="client-content"></div>
1629</div>
1630
1631 <script type="text/javascript">
1632 RightClick.init("flash-wrapper", "flash-container");
1633 if (window.opener && window.opener != window && window.opener.location.href == "/") {
1634 window.opener.location.replace("/home");
1635 }
1636 $(document.body).addClassName("js");
1637 HabboClient.startPingListener();
1638 </script>
1639
1640<div style="left: 25px;position: absolute;top: 12px;z-index: 1060;
1641">
1642<a target="_blank" href="/home"><button class="web-button">
1643<div class="arrow"></div><div class="arrow2"></div>
1644<span>WEB</span></button></a>
1645
1646<button onclick="toggleFullScreen()" class="fullscreen-button"><i></i></button></div>
1647
1648<script src="http://www.google-analytics.com/ga.js" type="text/javascript"></script>
1649<script type="text/javascript">
1650var pageTracker = _gat._getTracker("UA-448325-20");
1651pageTracker._trackPageview();
1652</script>
1653
1654<script type="text/javascript">
1655 HabboView.run();
1656</script>
1657</body>
1658</html>
1659</body>
1660</html>