diff --git a/agar-mini-map.user.js b/agar-mini-map.user.js index 772a0a6..7658f23 100644 --- a/agar-mini-map.user.js +++ b/agar-mini-map.user.js @@ -1,862 +1,962 @@ -// ==UserScript== -// @name agar-mini-map -// @namespace http://github.com/dimotsai/ -// @version 0.46 -// @description This script will show a mini map and your location on agar.io -// @author dimotsai -// @license MIT -// @match http://agar.io/* -// @require http://cdn.jsdelivr.net/msgpack/1.05/msgpack.js -// @grant none -// @run-at document-body -// ==/UserScript== - -window.msgpack = this.msgpack; - -(function() { - var _WebSocket = window._WebSocket = window.WebSocket; - var $ = window.jQuery; - var msgpack = window.msgpack; - var options = { - enableMultiCells: true, - enablePosition: true, - enableAxes: false, - enableCross: true - }; - - // game states - var agar_server = null; - var map_server = null; - var player_name = []; - var players = []; - var id_players = []; - var cells = []; - var current_cell_ids = []; - var start_x = -7000, - start_y = -7000, - end_x = 7000, - end_y = 7000, - length_x = 14000, - length_y = 14000; - var render_timer = null; - - function miniMapSendRawData(data) { - if (map_server !== null && map_server.readyState === window._WebSocket.OPEN) { - var array = new Uint8Array(data); - map_server.send(array.buffer); - } - } - - function miniMapConnectToServer(address, onOpen, onClose) { - try { - var ws = new window._WebSocket(address); - } catch (ex) { - onClose(); - console.error(ex); - return false; - } - ws.binaryType = "arraybuffer"; +var engine = window.atob('i18n_lang = "en"; + i18n_dict = { + "en": { + "connecting": "Connecting", + "connect_help": "If you cannot connect to the servers, check if you have some anti virus or firewall blocking the connection.", + "play": "Play", + "spectate": "Spectate", + "login_and_play": "Login and play", + "play_as_guest": "Play as guest", + "share": "Share", + "advertisement": "Advertisement", + "privacy_policy": "Privacy Policy", + "terms_of_service": "Terms of Service", + "changelog": "Changelog", + "instructions_mouse": "Move your mouse to control your cell", + "instructions_space": "Press Space to split", + "instructions_w": "Press W to eject some mass", + "gamemode_ffa": "FFA", + "gamemode_teams": "Teams", + "gamemode_experimental": "Experimental", + "region_select": " -- Select a Region -- ", + "region_us_east": "US East", + "region_us_west": "US West", + "region_north_america": "North America", + "region_south_america": "South America", + "region_europe": "Europe", + "region_turkey": "Turkey", + "region_poland": "Poland", + "region_east_asia": "East Asia", + "region_russia": "Russia", + "region_china": "China", + "region_oceania": "Oceania", + "region_australia": "Australia", + "region_players": "players", + "option_no_skins": "No skins", + "option_no_names": "No names", + "option_dark_theme": "Dark theme", + "option_no_colors": "No colors", + "option_show_mass": "Show mass", + "leaderboard": "Leaderboard", + "unnamed_cell": "An unnamed cell", + "last_match_results": "Last match results", + "score": "Score", + "leaderboard_time": "Leaderboard Time", + "mass_eaten": "Mass Eaten", + "top_position": "Top Position", + "position_1": "First", + "position_2": "Second", + "position_3": "Third", + "position_4": "Fourth", + "position_5": "Fifth", + "position_6": "Sixth", + "position_7": "Seventh", + "position_8": "Eighth", + "position_9": "Ninth", + "position_10": "Tenth", + "player_cells_eaten": "Player Cells Eaten", + "survival_time": "Survival Time", + + + "games_played": "Games played", + "highest_mass": "Highest mass", + "total_cells_eaten": "Total cells eaten", + "total_mass_eaten": "Total mass eaten", + "longest_survival": "Longest survival", + "logout": "Logout", + "stats": "Stats", + "shop": "Shop", + "party": "Party", + "party_description": "Play with your friends in the same map", + "create_party": "Create", + "creating_party": "Creating party...", + "join_party": "Join", + "back_button": "Back", + + "joining_party": "Joining party...", + "joined_party_instructions": "You are now playing with this party:", + "party_join_error": "There was a problem joining that party, please make sure the code is correct, or try creating another party", + "login_tooltip": "Login with Facebook and get:


Start the game with more mass!
Level up to get even more starting mass!", //
Track your progress with player stats! + "create_party_instructions": "Give this link to your friends:", + "join_party_instructions": "Your friend should have given you a code, type it here:", + "continue": "Continue", + "option_skip_stats": "Skip stats", + "stats_food_eaten": "food eaten", + "stats_highest_mass": "highest mass", + "stats_time_alive": "time alive", + "stats_leaderboard_time": "leaderboard time", + "stats_cells_eaten": "cells eaten", + "stats_top_position": "top position", + + "": "" + }, + /* + "fr": { + "connecting": "Connexion", + "connect_help": "Si vous ne pouvez pas vous connecter aux serveurs, vérifiez que votre anti-virus ou votre pare-feu ne bloque pas la connexion.", + "play": "Jouer", + "spectate": "REGARDER", + "login_and_play": "Se connecter et jouer", + "login_tooltip": "Connectez-vous avec Facebook et obtenez:


double masse de départ à chaque partie!
Montez en niveau pour obtenir encore plus de masse de départ!", //
Consultez vos progrès dans les statistiques de joueur! + "play_as_guest": "Jouer en tant qu'invité", + "advertisement": "Publicité", + "privacy_policy": "Confidentialité", + "terms_of_service": "Conditions de service", + "changelog": "Changements", + "instructions_mouse": "Bougez votre souris pour contrôler votre cellule.", + "instructions_space": "Appuyez pour le séparer.", + "instructions_w": "Appuyez pour éjecter de la masse.", + "gamemode_ffa": "Chacun pour soi", + "gamemode_teams": "Par équipe", + "gamemode_experimental": "Expérimental", + "region_select": " -- Sélectionner une région -- ", + "region_us_east": "E.-U. Est", + "region_us_west": "E.-U. Ouest", + "region_north_america": "Amérique du Nord", + "region_south_america": "Amérique du Sud", + "region_europe": "Europe", + "region_turkey": "Turquie", + "region_poland": "Pologne", + "region_east_asia": "Asie de l'Est", + "region_russia": "Russie", + "region_china": "Chine", + "region_oceania": "Océanie", + "region_australia": "Australie", + "region_players": "Joueurs", + "option_no_skins": " Aucun motif", + "option_no_names": " Aucun nom", + "option_dark_theme": " Thème sombre", + "option_no_colors": " Aucune couleur", + "option_show_mass": " Montrer la masse", + "leaderboard": "Classement", + "unnamed_cell": "Une cellule sans nom", + "last_match_results": "Derniers résultats", + "score": "Score", + "leaderboard_time": "Temps au classement", + "mass_eaten": "Masse ingérée", + "top_position": "Au top", + "position_1": "Premier", + "position_2": "Deuxième", + "position_3": "Troisième", + "position_4": "Quatrième", + "position_5": "Cinquième", + "position_6": "Sixième", + "position_7": "Septième", + "position_8": "Huitième", + "position_9": "Neuvième", + "position_10": "Dixième", + "player_cells_eaten": "Cellules de joueur ingérées", + "survival_time": "Temps de survie", + "share": "Partager", + "screenshot_1": "Diviser & Conquérir ! Grossir et dominer !", + "screenshot_2": "Un hit en multijoueur ! Mangez ou soyez mangé !", + "screenshot_3": "Lancez et partagez votre masse pour prendre l'avantage !", + "screenshot_4": "Jouez avec de nombreuses apparences différentes !" + }, + "it": { + "connecting": "Connessione", + "connect_help": "Non puoi connetterti ai server, controlla che non ci sia un antivirus o un firewall che blocchino la connessione", + "play": "Gioca", + "spectate": "GUARDA", + "login_and_play": "Accedi e gioca", + "login_tooltip": "Accedi a Facebook per ottenere:


il doppio della massa iniziale a ogni partita!
Sali di livello per aumentare ulteriormente la massa iniziale!", //
Tieni traccia dei tuoi progressi con le statistiche del giocatore! + "play_as_guest": "Gioca come ospite", + "advertisement": "Pubblicità ", + "privacy_policy": "Privacy", + "terms_of_service": "Termini del servizio", + "changelog": "Log dei cambiamenti", + "instructions_mouse": "Sposta il mouse per controllare la tua cellula", + "instructions_space": "Premi per dividere", + "instructions_w": "Premi per espellere della massa", + "gamemode_ffa": "FFA", + "gamemode_teams": "Squadre", + "gamemode_experimental": "Sperimentale", + "region_select": " -- Scegli una regione -- ", + "region_us_east": "USA orientali", + "region_us_west": "USA occidentali", + "region_north_america": "Nord America", + "region_south_america": "Sud America", + "region_europe": "Europa", + "region_turkey": "Turchia", + "region_poland": "Polonia", + "region_east_asia": "Asia orientale", + "region_russia": "Russia", + "region_china": "Cina", + "region_oceania": "Oceania", + "region_australia": "Australia", + "region_players": "Giocatori", + "option_no_skins": " Nessuna skin", + "option_no_names": " Nessun nome", + "option_dark_theme": " Tema scuro", + "option_no_colors": " Nessun colore", + "option_show_mass": " Mostra massa", + "leaderboard": "Classifica", + "unnamed_cell": "Una cellula senza nome", + "last_match_results": "Risultati ultimo incontro", + "score": "Punteggio", + "leaderboard_time": "Tempo classifica", + "mass_eaten": "Massa ingerita", + "top_position": "Posizione più alta", + "position_1": "Primo", + "position_2": "Secondo", + "position_3": "Terzo", + "position_4": "Quarto", + "position_5": "Quindi", + "position_6": "Sesto", + "position_7": "Settimo", + "position_8": "Ottavo", + "position_9": "Nono", + "position_10": "Decimo", + "player_cells_eaten": "Cellule giocatore ingerite", + "survival_time": "Tempo di sopravvivenza", + "share": "Condividi", + "screenshot_1": "Dividiti e conquista! Cresci e domina!", + "screenshot_2": "Un successo multigiocatore! Mangia o sarai mangiato!", + "screenshot_3": "Lancia e dividi la massa per ottenere un vantaggio!", + "screenshot_4": "Gioca con molte skin diverse!" + }, + "de": { + "connecting": "Verbinde", + "connect_help": "Überprüfe bitte dein Antivirusprogramm oder deine Firewall, wenn du keine Verbindung zum Server herstellen kannst.", + "play": "Spielen", + "spectate": "ZUSCHAUEN", + "login_and_play": "Anmelden und spielen", + "login_tooltip": "Melde dich mit Facebook an und erhalte:


Doppelte Startmasse in jedem Spiel!
Erreiche eine höhere Stufe, um noch mehr Startmasse zu erhalten!", //
Verfolge deine Fortschritte mit Hilfe der Spielerstatistik! + "play_as_guest": "Als Gast spielen", + "advertisement": "Werbung", + "privacy_policy": "Datenschutz", + "terms_of_service": "Nutzungsbedingungen", + "changelog": "Changelog", + "instructions_mouse": "Bewege deine Maus, um deine Zelle zu kontrollieren", + "instructions_space": "Zum Teilen drücken", + "instructions_w": "Zur Abgabe von etwas Masse drücken", + "gamemode_ffa": "Für alle", + "gamemode_teams": "Teams", + "gamemode_experimental": "Experimentell", + "region_select": " -- Wähle eine Region -- ", + "region_us_east": "USA-Ost", + "region_us_west": "USA-West", + "region_north_america": "Nordamerika", + "region_south_america": "Südamerika", + "region_europe": "Europa", + "region_turkey": "Türkei", + "region_poland": "Polen", + "region_east_asia": "Ostasien", + "region_russia": "Russland", + "region_china": "China", + "region_oceania": "Ozeanien", + "region_australia": "Australien", + "region_players": "Spieler", + "option_no_skins": " Keine Skins", + "option_no_names": " Keine Namen", + "option_dark_theme": " Dunkelthema", + "option_no_colors": " Keine Farben", + "option_show_mass": " Masse anzeigen", + "leaderboard": "Bestenliste", + "unnamed_cell": "Eine unbenannte Zelle", + "last_match_results": "Letzte Spielergebnisse", + "score": "Punkte", + "leaderboard_time": "Bestenlistenzeit", + "mass_eaten": "Verzehrte Masse", + "top_position": "Spitzenposition", + "position_1": "Erster", + "position_2": "Zweiter", + "position_3": "Dritter", + "position_4": "Vierter", + "position_5": "Fünfter", + "position_6": "Sechster", + "position_7": "Siebenter", + "position_8": "Achter", + "position_9": "Neunter", + "position_10": "Zehnter", + "player_cells_eaten": "Verzehrte Spielerzellen", + "survival_time": "Überlebenszeit", + "share": "Teilen", + "screenshot_1": "Teile und erobere! Wachse und herrsche!", + "screenshot_2": "Ein Mehrspielerhit! Friss oder werde gefressen!", + "screenshot_3": "Spalte dich auf und wirf Masse ab, um einen Vorteil zu erringen!", + "screenshot_4": "Spiele mit vielen unterschiedlichen Skins!" + }, + "es": { + "connecting": "Conectando", + "connect_help": "Si no puedes conectar con los servidores, comprueba si tu antivirus o tu cortafuegos están bloqueando la conexión.", + "play": "Jugar", + "spectate": "Observar", + "login_and_play": "Iniciar sesión y jugar", + "login_tooltip": "Inicia sesión con Facebook y consigue:


¡El doble de masa inicial en cada partida!
¡Sube de nivel y consigue aún más masa inicial!", //
¡Controla tus progresos con las estadísticas! + "play_as_guest": "Jugar como invitado", + "advertisement": "Anuncio", + "privacy_policy": "Privacidad", + "terms_of_service": "Condiciones del servicio", + "changelog": "Registro de cambios", + "instructions_mouse": "Mueve el ratón para controlar tu punto", + "instructions_space": "Pulsa para dividir", + "instructions_w": "Pulsa W para liberar parte de tu masa", + "gamemode_ffa": "TcT", + "gamemode_teams": "Equipos", + "gamemode_experimental": "Experimental", + "region_select": " -- Elige una región -- ", + "region_us_east": "Este de EE.UU.", + "region_us_west": "Oeste de de EE.UU.", + "region_north_america": "Norteamérica", + "region_south_america": "Sudamérica", + "region_europe": "Europa", + "region_turkey": "Turquía", + "region_poland": "Polonia", + "region_east_asia": "Este de Asia", + "region_russia": "Rusia", + "region_china": "China", + "region_oceania": "Oceanía", + "region_australia": "Australia", + "region_players": "jugadores", + "option_no_skins": " Sin texturas", + "option_no_names": " Sin nombres", + "option_dark_theme": " Tema oscuro", + "option_no_colors": " Sin colores", + "option_show_mass": " Mostrar masa", + "leaderboard": "Marcador", + "unnamed_cell": "Un punto sin nombre", + "last_match_results": "Resultados de la última partida", + "score": "Puntuación", + "leaderboard_time": "Tiempo del marcador", + "mass_eaten": "Masa comida", + "top_position": "Campeón", + "position_1": "Primero", + "position_2": "Segundo", + "position_3": "Tercero", + "position_4": "Cuarto", + "position_5": "Quinto", + "position_6": "Sexto", + "position_7": "Séptimo", + "position_8": "Octavo", + "position_9": "Noveno", + "position_10": "Décimo", + "player_cells_eaten": "Puntos comidos del jugador", + "survival_time": "Tiempo de supervivencia", + "share": "Compartir", + "screenshot_1": "¡Divide y vencerás! ¡Crece y dominarás!", + "screenshot_2": "¡Un exitoso juego multijgador! ¡Come o te comerán!", + "screenshot_3": "¡Lanza y divide tu masa para conseguir ventaja!", + "screenshot_4": "¡Juega con un montón de apariencias distintas!" + }, + */ - ws.onopen = function() { - onOpen(); - console.log(address + ' connected'); - } + "?": {} + }; - ws.onmessage = function(event) { - var buffer = new Uint8Array(event.data); - var packet = msgpack.unpack(buffer); - switch(packet.type) { - case 128: - for (var i=0; i < packet.data.addition.length; ++i) { - var cell = packet.data.addition[i]; - if (! miniMapIsRegisteredToken(cell.id)) - { - miniMapRegisterToken( - cell.id, - miniMapCreateToken(cell.id, cell.color) - ); - } + i18n_lang = (window.navigator.userLanguage || window.navigator.language || 'en').split('-')[0]; + //i18n_lang = 'de'; + if (!i18n_dict.hasOwnProperty(i18n_lang)) i18n_lang = "en"; - var size_n = cell.size/length_x; - miniMapUpdateToken(cell.id, (cell.x - start_x)/length_x, (cell.y - start_y)/length_y, size_n); - } + i18n = i18n_dict[i18n_lang]; - for (var i=0; i < packet.data.deletion.length; ++i) { - var id = packet.data.deletion[i]; - miniMapUnregisterToken(id); - } - break; - case 129: - players = packet.data; - for (var p in players) { - var player = players[p]; - var ids = player.ids; - for (var i in ids) { - id_players[ids[i]] = player.no; - } + ! function(t, n) { + function e() { + Wn = !0, r(), setInterval(r, 18e4), rn = on = document.getElementById("canvas"), an = rn.getContext("2d"), rn.onmousedown = function(t) { + if (ue) { + var n = t.clientX - (5 + ln / 5 / 2), + e = t.clientY - (5 + ln / 5 / 2); + if (Math.sqrt(n * n + e * e) <= ln / 5 / 2) return L(), void w(17) } - mini_map_party.trigger('update-list'); - break; - case 130: - if (agar_server != packet.data.url) { - var region_name = $('#region > option[value="' + packet.data.region + '"]').text(); - var gamemode_name = $('#gamemode > option[value="' + packet.data.gamemode + '"]').text(); - var title = 'Agar Server Mismatched'; - var content = ('You are now at: ' + agar_server - + '
Your team members are all at: ' + packet.data.url + ', ' + region_name + ':' + gamemode_name + packet.data.party - + '.
The minimap server has disconnected automatically.'); - - $('#mini-map-connect-btn').popover('destroy').popover({ - animation: false, - placement: 'top', - title: title, - content: content, - container: document.body, - html: true - }).popover('show'); - } else { - $('#mini-map-content-btn').popover('hide'); - } - break; + bn = 1 * t.clientX, En = 1 * t.clientY, i(), L() + }, rn.onmousemove = function(t) { + bn = 1 * t.clientX, En = 1 * t.clientY, i() + }, rn.onmouseup = function() {}, /firefox/i.test(navigator.userAgent) ? document.addEventListener("DOMMouseScroll", o, !1) : document.body.onmousewheel = o; + var e = !1, + a = !1, + l = !1; + t.onkeydown = function(t) { + 32 != t.keyCode || e || (L(), w(17), e = !0), 81 != t.keyCode || a || (w(18), a = !0), 87 != t.keyCode || l || (L(), w(21), l = !0), 27 == t.keyCode && h(300) + }, t.onkeyup = function(t) { + 32 == t.keyCode && (e = !1), 87 == t.keyCode && (l = !1), 81 == t.keyCode && a && (w(19), a = !1) + }, t.onblur = function() { + w(19), l = a = e = !1 + }, t.onresize = F, t.requestAnimationFrame(Pe), setInterval(L, 40), Bn && n("#region").val(Bn), d(), s(n("#region").val()), 0 == se && Bn && m(), h(0), F(), t.location.hash && 6 <= t.location.hash.length && W(t.location.hash) } - } - ws.onerror = function() { - onClose(); - console.error('failed to connect to map server'); - } - - ws.onclose = function() { - onClose(); - map_server = null; - console.log('map server disconnected'); - } - - map_server = ws; - } + function o(t) { + ie *= Math.pow(.9, t.wheelDelta / -120 || t.detail || 0), 1 > ie && (ie = 1), ie > 4 / In && (ie = 4 / In) + } - function miniMapRender() { - var canvas = window.mini_map; - var ctx = canvas.getContext('2d'); - ctx.clearRect(0, 0, canvas.width, canvas.height); - for (var id in window.mini_map_tokens) { - var token = window.mini_map_tokens[id]; - var x = token.x * canvas.width; - var y = token.y * canvas.height; - var size = token.size * canvas.width; - - ctx.beginPath(); - ctx.arc( - x, - y, - size, - 0, - 2 * Math.PI, - false - ); - ctx.closePath(); - ctx.fillStyle = token.color; - ctx.fill(); - - if (options.enableCross && -1 != current_cell_ids.indexOf(token.id)) - miniMapDrawCross(token.x, token.y, token.color); - - if (options.enableAxes && -1 != current_cell_ids.indexOf(token.id)) - miniMapDrawMiddleCross() - - if (id_players[id] !== undefined) { - // Draw you party member's crosshair - if (options.enableCross) { - miniMapDrawCross(token.x, token.y, token.color); + function a() { + if (.4 > In) hn = null; + else { + for (var t = Number.POSITIVE_INFINITY, n = Number.POSITIVE_INFINITY, e = Number.NEGATIVE_INFINITY, o = Number.NEGATIVE_INFINITY, a = 0; a < Sn.length; a++) { + var i = Sn[a]; + !i.H() || i.L || 20 >= i.size * In || (t = Math.min(i.x - i.size, t), n = Math.min(i.y - i.size, n), e = Math.max(i.x + i.size, e), o = Math.max(i.y + i.size, o)) + } + for (hn = Be.X({ + ba: t - 10, + ca: n - 10, + Z: e + 10, + $: o + 10, + fa: 2, + ha: 4 + }), a = 0; a < Sn.length; a++) + if (i = Sn[a], i.H() && !(20 >= i.size * In)) + for (t = 0; t < i.a.length; ++t) n = i.a[t].x, e = i.a[t].y, gn - ln / 2 / In > n || fn - sn / 2 / In > e || n > gn + ln / 2 / In || e > fn + sn / 2 / In || hn.Y(i.a[t]) } - - ctx.font = size * 2 + 'px Arial'; - ctx.textAlign = 'center'; - ctx.textBaseline = 'middle'; - ctx.fillStyle = 'white'; - ctx.fillText(id_players[id] + 1, x, y); } - }; - } - - function miniMapDrawCross(x, y, color) { - var canvas = window.mini_map; - var ctx = canvas.getContext('2d'); - ctx.lineWidth = 0.5; - ctx.beginPath(); - ctx.moveTo(0, y * canvas.height); - ctx.lineTo(canvas.width, y * canvas.height); - ctx.moveTo(x * canvas.width, 0); - ctx.lineTo(x * canvas.width, canvas.height); - ctx.closePath(); - ctx.strokeStyle = color || '#FFFFFF'; - ctx.stroke(); - } - - function miniMapDrawMiddleCross() { - var canvas = window.mini_map; - var ctx = canvas.getContext('2d'); - ctx.lineWidth = 0.5; - ctx.beginPath(); - ctx.moveTo(0, canvas.height/2); - ctx.lineTo(canvas.width, canvas.height/2); - ctx.moveTo(canvas.width/2, 0); - ctx.lineTo(canvas.width/2, canvas.height); - ctx.closePath(); - ctx.strokeStyle = '#000000'; - ctx.stroke(); - } - - function miniMapCreateToken(id, color) { - var mini_map_token = { - id: id, - color: color, - x: 0, - y: 0, - size: 0 - }; - return mini_map_token; - } - - function miniMapRegisterToken(id, token) { - if (window.mini_map_tokens[id] === undefined) { - // window.mini_map.append(token); - window.mini_map_tokens[id] = token; - } - } - - function miniMapUnregisterToken(id) { - if (window.mini_map_tokens[id] !== undefined) { - // window.mini_map_tokens[id].detach(); - delete window.mini_map_tokens[id]; - } - } - - function miniMapIsRegisteredToken(id) { - return window.mini_map_tokens[id] !== undefined; - } - function miniMapUpdateToken(id, x, y, size) { - if (window.mini_map_tokens[id] !== undefined) { + function i() { + An = (bn - ln / 2) / In + gn, kn = (En - sn / 2) / In + fn + } - window.mini_map_tokens[id].x = x; - window.mini_map_tokens[id].y = y; - window.mini_map_tokens[id].size = size; + function r() { + null == pe && (pe = {}, n("#region").children().each(function() { + var t = n(this), + e = t.val(); + e && (pe[e] = t.text()) + })), n.get(nn + "info", function(t) { + var e, o = {}; + for (e in t.regions) { + var a = e.split(":")[0]; + o[a] = o[a] || 0, o[a] += t.regions[e].numPlayers + } + for (e in o) n('#region option[value="' + e + '"]').text(pe[e] + " (" + o[e] + " players)") + }, "json") + } - return true; - } else { - return false; - } - } + function l() { + n("#adsBottom").hide(), n("#overlays").hide(), n("#stats").hide(), n("#mainPanel").hide(), De = le = !1, d(), g(t.aa.concat(t.ac)) + } - function miniMapUpdatePos(x, y) { - window.mini_map_pos.text('x: ' + x.toFixed(0) + ', y: ' + y.toFixed(0)); - } + function s(e) { + e && e != Bn && (n("#region").val() != e && n("#region").val(e), Bn = t.localStorage.location = e, n(".region-message").hide(), n(".region-message." + e).show(), n(".btn-needs-server").prop("disabled", !1), Wn && m()) + } - function miniMapReset() { - cells = []; - window.mini_map_tokens = []; - } + function h(e) { + le || De || (wn = null, me || (n("#adsBottom").show(), n("#g300x250").hide(), n("#a300x250").show()), u(me ? t.ac : t.aa), me = !1, 1e3 > e && (re = 1), le = !0, n("#mainPanel").show(), e > 0 ? n("#overlays").fadeIn(e) : n("#overlays").show()) + } - function miniMapInit() { - window.mini_map_tokens = []; - - cells = []; - current_cell_ids = []; - start_x = -7000; - start_y = -7000; - end_x = 7000; - end_y = 7000; - length_x = 14000; - length_y = 14000; - - // minimap dom - if ($('#mini-map-wrapper').length === 0) { - var wrapper = $('
').attr('id', 'mini-map-wrapper').css({ - position: 'fixed', - bottom: 10, - right: 10, - width: 300, - height: 300, - background: 'rgba(128, 128, 128, 0.58)' - }); + function c(t) { + n("#helloContainer").attr("data-gamemode", t), qn = t, n("#gamemode").val(t) + } - var mini_map = $('').attr({ - id: 'mini-map', - width: 300, - height: 300 - }).css({ - width: '100%', - height: '100%', - position: 'relative' - }); + function d() { + n("#region").val() ? t.localStorage.location = n("#region").val() : t.localStorage.location && n("#region").val(t.localStorage.location), n("#region").val() ? n("#locationKnown").append(n("#region")) : n("#locationUnknown").append(n("#region")) + } - wrapper.append(mini_map).appendTo(document.body); + function u(n) { + t.googletag && t.googletag.cmd.push(function() { + Ue && (Ue = !1, setTimeout(function() { + Ue = !0 + }, 6e4 * Se), t.googletag && t.googletag.pubads && t.googletag.pubads().refresh && t.googletag.pubads().refresh(n)) + }) + } - window.mini_map = mini_map[0]; - } + function g(n) { + t.googletag && t.googletag.pubads && t.googletag.pubads().clear && t.googletag.pubads().clear(n) + } - // minimap renderer - if (render_timer === null) - render_timer = setInterval(miniMapRender, 1000 / 30); - - // minimap location - if ($('#mini-map-pos').length === 0) { - window.mini_map_pos = $('
').attr('id', 'mini-map-pos').css({ - bottom: 10, - right: 10, - color: 'white', - fontSize: 15, - fontWeight: 800, - position: 'fixed' - }).appendTo(document.body); - } + function f(n) { + return t.i18n[n] || t.i18n_dict.en[n] || n + } - // minimap options - if ($('#mini-map-options').length === 0) { - window.mini_map_options = $('
').attr('id', 'mini-map-options').css({ - bottom: 315, - right: 10, - color: '#666', - fontSize: 14, - position: 'fixed', - fontWeight: 400, - zIndex: 1000 - }).appendTo(document.body); - - var container = $('
') - .css({ - background: 'rgba(200, 200, 200, 0.58)', - padding: 5, - borderRadius: 5 + function p() { + var t = ++se; + console.log("Find " + Bn + qn), n.ajax(nn + "findServer", { + error: function() { + setTimeout(p, 1e3) + }, + success: function(n) { + t == se && (n.alert && alert(n.alert), U("ws://" + n.ip, n.token)) + }, + dataType: "json", + method: "POST", + cache: !1, + crossDomain: !0, + data: (Bn + qn || "?") + "\n154669603" }) - .hide(); - - for (var name in options) { + } - var label = $('