Guest User

pseudo_tensai_4_ff.user

a guest
Dec 8th, 2015
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name        pseudo tensai 4 ff
  3. // @version     0.1
  4. // @include     http://agar.io/*
  5. // @run-at      document-start
  6. // @grant       none
  7. // ==/UserScript==
  8.  
  9. function makeProperty(name, varname) {
  10.     return "'" + name + "' in window.agar || " +
  11.         "Object.defineProperty( window.agar, '"+name+"', " +
  12.         "{get:function(){return "+varname+"},set:function(){"+varname+"=arguments[0]},enumerable:true})"
  13. }
  14.  
  15. var scriptTextRe =   /console\.log\("socket open"\);/
  16.  
  17. if (window.top != window.self)
  18.     return
  19.  
  20. if (document.readyState !== 'loading')
  21.     return console.error("Expose: this script should run at document-start")
  22.  
  23. var isFirefox = /Firefox/.test(navigator.userAgent)
  24.  
  25. // Stage 2: Search for `main_out.js`
  26. if (isFirefox) {
  27.     function bse_listener(e) { tryReplace(e.target, e) }
  28.     window.addEventListener('beforescriptexecute', bse_listener, true)
  29. } else {
  30.     // Iterate over document.head child elements and look for `main_out.js`
  31.     for (var i = 0; i < document.head.childNodes.length; i++)
  32.         if (tryReplace(document.head.childNodes[i]))
  33.             return
  34.     // If there are no desired element in document.head, then wait until it appears
  35.     function observerFunc(mutations) {
  36.         for (var i = 0; i < mutations.length; i++) {
  37.             var addedNodes = mutations[i].addedNodes
  38.             for (var j = 0; j < addedNodes.length; j++)
  39.                 if (tryReplace(addedNodes[j]))
  40.                     return observer.disconnect()
  41.         }
  42.     }
  43.     var observer = new MutationObserver(observerFunc)
  44.     observer.observe(document.head, {childList: true})
  45. }
  46.  
  47. // Stage 3: Replace found element using rules
  48. function tryReplace(node, event) {
  49.     var scriptEmbedded = scriptTextRe && scriptTextRe.test(node.textContent)
  50.     if (node.tagName != "SCRIPT" || !scriptEmbedded)
  51.         return false // this is not desired element; get back to stage 2
  52.  
  53.     if (isFirefox) {
  54.         event.preventDefault()
  55.         window.removeEventListener('beforescriptexecute', bse_listener, true)
  56.     }
  57.  
  58.     var mod = {
  59.         reset: "",
  60.         text: null,
  61.         replace: function(what, from, to, defaultValue) {
  62.             var newText = this.text.replace(from, to)
  63.             if(newText === this.text) {
  64.                 console.error("Expose: " + what + " replacement failed!")
  65.                 return false
  66.             } else {
  67.                 this.text = newText
  68.                 if(defaultValue !== undefined)
  69.                     this.reset += "window.agar." + what + "=" + defaultValue + ";"
  70.                 return true
  71.             }
  72.         },
  73.         get: function() {
  74.             return "window.agar={};" + this.reset + this.text
  75.         }
  76.     }
  77.  
  78.     if (scriptEmbedded) {
  79.         mod.text = node.textContent
  80.         //rules.replace(mod)
  81.         if (isFirefox) {
  82.             document.head.removeChild(node)
  83.             var script = document.createElement("script")
  84.             script.appendChild(document.createTextNode('('+ ccode +')();'));
  85.             document.head.appendChild(script)
  86.         } else {
  87.             node.textContent = mod.get()
  88.         }
  89.         console.log("Expose: replacement done_")
  90.     } else {
  91.         document.head.removeChild(node)
  92.         var request = new XMLHttpRequest()
  93.         request.onload = function() {
  94.             var script = document.createElement("script")
  95.             mod.text = this.responseText
  96.             rules.replace(mod)
  97.             script.textContent = mod.get()
  98.             // `main_out.js` should not executed before jQuery was loaded, so we need to wait jQuery
  99.             function insertScript(script) {
  100.                 if (typeof jQuery === "undefined")
  101.                     return setTimeout(insertScript, 0, script)
  102.                 document.head.appendChild(script)
  103.                 console.log("Expose: replacement done")
  104.             }
  105.             insertScript(script)
  106.         }
  107.         request.onerror = function() { console.error("Expose: response was null") }
  108.         request.open("get", node.src, true)
  109.         request.send()
  110.     }
  111.  
  112.     return true
  113. }
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123. var ccode = function () {
  124. function drawb (c, dark) {
  125.     c.lineWidth = 10;
  126.     c.strokeStyle = "#ff0000";
  127.     c.beginPath();
  128.     c.moveTo(-7060, -7060), c.lineTo(7060, -7060), c.lineTo(7060, 7060), c.lineTo(-7060, 7060), c.lineTo(-7060, -7060);
  129.     c.stroke();
  130. }
  131.  
  132. console.log("TENSAI:client started");
  133. window.agar = {
  134. };
  135. window.agar.allCells = {
  136. };
  137. window.agar.myCells = [
  138. ];
  139. window.agar.top = [
  140. ];
  141. window.agar.ws = '';
  142. window.agar.topTeams = [
  143. ];
  144. window.agar.dimensions = [
  145.   - 7071.067811865476,
  146.   - 7071.067811865476,
  147.   7071.067811865476,
  148.   7071.067811865476
  149. ];
  150. window.agar.rawViewport = {
  151.   x: 0,
  152.   y: 0,
  153.   scale: 1
  154. };
  155. agar.disableRendering = false;
  156. window.agar.minScale = 1;
  157. window.agar.region = '';
  158. window.agar.drawPellets = true;
  159. window.agar.colorOffensive=true;
  160. i18n_lang = 'en';
  161. i18n_dict = {
  162.   'en': {
  163.     'connecting': 'Connecting',
  164.     'connect_help': 'If you cannot connect to the servers, check if you have some anti virus or firewall blocking the connection.',
  165.     'play': 'Play',
  166.     'spectate': 'Spectate',
  167.     'login_and_play': 'Login and play',
  168.     'play_as_guest': 'Play as guest',
  169.     'share': 'Share',
  170.     'advertisement': 'Advertisement',
  171.     'privacy_policy': 'Privacy Policy',
  172.     'terms_of_service': 'Terms of Service',
  173.     'changelog': 'Changelog',
  174.     'instructions_mouse': 'Move your mouse to control your cell',
  175.     'instructions_space': 'Press <b>Space</b> to split',
  176.     'instructions_w': 'Press <b>W</b> to eject some mass',
  177.     'gamemode_ffa': 'FFA',
  178.     'gamemode_teams': 'Teams',
  179.     'gamemode_experimental': 'Experimental',
  180.     'region_select': ' -- Select a Region -- ',
  181.     'region_us_east': 'US East',
  182.     'region_us_west': 'US West',
  183.     'region_north_america': 'North America',
  184.     'region_south_america': 'South America',
  185.     'region_europe': 'Europe',
  186.     'region_turkey': 'Turkey',
  187.     'region_poland': 'Poland',
  188.     'region_east_asia': 'East Asia',
  189.     'region_russia': 'Russia',
  190.     'region_china': 'China',
  191.     'region_oceania': 'Oceania',
  192.     'region_australia': 'Australia',
  193.     'region_players': 'players',
  194.     'option_no_skins': 'No skins',
  195.     'option_no_names': 'No names',
  196.     'option_dark_theme': 'Dark theme',
  197.     'option_no_colors': 'No colors',
  198.     'option_show_mass': 'Show mass',
  199.     'leaderboard': 'Leaderboard',
  200.     'unnamed_cell': 'An unnamed cell',
  201.     'last_match_results': 'Last match results',
  202.     'score': 'Score',
  203.     'leaderboard_time': 'Leaderboard Time',
  204.     'mass_eaten': 'Mass Eaten',
  205.     'top_position': 'Top Position',
  206.     'position_1': 'First',
  207.     'position_2': 'Second',
  208.     'position_3': 'Third',
  209.     'position_4': 'Fourth',
  210.     'position_5': 'Fifth',
  211.     'position_6': 'Sixth',
  212.     'position_7': 'Seventh',
  213.     'position_8': 'Eighth',
  214.     'position_9': 'Ninth',
  215.     'position_10': 'Tenth',
  216.     'player_cells_eaten': 'Player Cells Eaten',
  217.     'survival_time': 'Survival Time',
  218.     'games_played': 'Games played',
  219.     'highest_mass': 'Highest mass',
  220.     'total_cells_eaten': 'Total cells eaten',
  221.     'total_mass_eaten': 'Total mass eaten',
  222.     'longest_survival': 'Longest survival',
  223.     'logout': 'Logout',
  224.     'stats': 'Stats',
  225.     'shop': 'Shop',
  226.     'party': 'Party',
  227.     'party_description': 'Play with your friends in the same map',
  228.     'create_party': 'Create',
  229.     'creating_party': 'Creating party...',
  230.     'join_party': 'Join',
  231.     'back_button': 'Back',
  232.     'joining_party': 'Joining party...',
  233.     'joined_party_instructions': 'You are now playing with this party:',
  234.     'party_join_error': 'There was a problem joining that party, please make sure the code is correct, or try creating another party',
  235.     'login_tooltip': 'Login with Facebook and get:<br&nbsp;/><br /><br />Start the game with more mass!<br />Level up to get even more starting mass!', //<br />Track your progress with player stats!
  236.     'create_party_instructions': 'Give this link to your friends:',
  237.     'join_party_instructions': 'Your friend should have given you a code, type it here:',
  238.     'continue': 'Continue',
  239.     'option_skip_stats': 'Skip stats',
  240.     'stats_food_eaten': 'food eaten',
  241.     'stats_highest_mass': 'highest mass',
  242.     'stats_time_alive': 'time alive',
  243.     'stats_leaderboard_time': 'leaderboard time',
  244.     'stats_cells_eaten': 'cells eaten',
  245.     'stats_top_position': 'top position',
  246.     '': ''
  247.   },
  248.   '?': {
  249.   }
  250. };
  251. i18n_lang = (window.navigator.userLanguage || window.navigator.language || 'en').split('-') [0];
  252. //i18n_lang = 'de';
  253. if (!i18n_dict.hasOwnProperty(i18n_lang)) i18n_lang = 'en';
  254. i18n = i18n_dict[i18n_lang];
  255. (function (d, e) {
  256.   function Nb() {
  257.     Ga = !0;
  258.     eb();
  259.     setInterval(eb, 180000);
  260.     L = Ha = document.getElementById('canvas');
  261.     f = L.getContext('2d');
  262.     L.onmousedown = function (a) {
  263.       if (fb) {
  264.         var b = a.clientX - (5 + h / 5 / 2),
  265.         c = a.clientY - (5 + h / 5 / 2);
  266.         if (Math.sqrt(b * b + c * c) <= h / 5 / 2) {
  267.           ba();
  268.           H(17);
  269.           return
  270.         }
  271.       }
  272.       na = 1 * a.clientX;
  273.       oa = 1 * a.clientY;
  274.       Ia();
  275.       ba()
  276.     };
  277.     L.onmousemove = function (a) {
  278.       na = 1 * a.clientX;
  279.       oa = 1 * a.clientY;
  280.       Ia()
  281.     };
  282.     L.onmouseup = function () {
  283.     };
  284.     /firefox/i.test(navigator.userAgent) ? document.addEventListener('DOMMouseScroll', (window.agar.dommousescroll = gb), !1)  : document.body.onmousewheel = gb;
  285.     var a =
  286.     !1,
  287.     b = !1,
  288.     c = !1;
  289.     d.onkeydown = function (p) {
  290.       32 != p.keyCode || a || (ba(), H(17), a = !0);
  291.       81 != p.keyCode || b || (H(18), b = !0);
  292.       87 != p.keyCode || c || (ba(), H(21), c = !0);
  293.       27 == p.keyCode && pa(300)
  294.     };
  295.     d.onkeyup = function (p) {
  296.       32 == p.keyCode && (a = !1);
  297.       87 == p.keyCode && (c = !1);
  298.       81 == p.keyCode && b && (H(19), b = !1)
  299.     };
  300.     d.onblur = function () {
  301.       H(19);
  302.       c = b = a = !1
  303.     };
  304.     d.onresize = hb;
  305.     d.requestAnimationFrame(ib);
  306.     setInterval(ba, 40);
  307.     z && e('#region').val(z);
  308.     jb();
  309.     qa(e('#region').val());
  310.     0 == Ja && z && M();
  311.     pa(0);
  312.     hb();
  313.     d.location.hash && 6 <= d.location.hash.length && kb(d.location.hash)
  314.   };
  315.   'scale' in window.agar || Object.defineProperty(window.agar, 'scale', {
  316.     get: function () {
  317.       return N
  318.     },
  319.     set: function () {
  320.       N = arguments[0]
  321.     },
  322.     enumerable: true
  323.   });
  324.   function gb(a) {
  325.     N *=
  326.     Math.pow(0.9, a.wheelDelta / - 120 || a.detail || 0);
  327.     window.agar.minScale > N && (N = window.agar.minScale);
  328.     N > 4 / g && (N = 4 / g)
  329.   }
  330.   function Ob() {
  331.     if (0.4 > g) ca = null;
  332.      else {
  333.       for (var a = Number.POSITIVE_INFINITY, b = Number.POSITIVE_INFINITY, c = Number.NEGATIVE_INFINITY, p = Number.NEGATIVE_INFINITY, d = 0; d < v.length; d++) {
  334.         var e = v[d];
  335.         !e.H() || e.M || 20 >= e.size * g || (a = Math.min(e.x - e.size, a), b = Math.min(e.y - e.size, b), c = Math.max(e.x + e.size, c), p = Math.max(e.y + e.size, p))
  336.       }
  337.       ca = Pb.X({
  338.         ba: a - 10,
  339.         ca: b - 10,
  340.         Z: c + 10,
  341.         $: p + 10,
  342.         fa: 2,
  343.         ha: 4
  344.       });
  345.       for (d = 0; d < v.length; d++) if (e = v[d], e.H() && !(20 >= e.size * g)) for (a = 0; a < e.a.length; ++a) b =
  346.       e.a[a].x,
  347.       c = e.a[a].y,
  348.       b < t - h / 2 / g || c < u - q / 2 / g || b > t + h / 2 / g || c > u + q / 2 / g || ca.Y(e.a[a])
  349.     }
  350.   }
  351.   function Ia() {
  352.     ra = (na - h / 2) / g + t;
  353.     sa = (oa - q / 2) / g + u
  354.   }
  355.   function eb() {
  356.     null == ta && (ta = {
  357.     }, e('#region').children().each(function () {
  358.       var a = e(this),
  359.       b = a.val();
  360.       b && (ta[b] = a.text())
  361.     }));
  362.     e.get(da + 'info', function (a) {
  363.       var b = {
  364.       },
  365.       c;
  366.       for (c in a.regions) {
  367.         var d = c.split(':') [0];
  368.         b[d] = b[d] || 0;
  369.         b[d] += a.regions[c].numPlayers
  370.       }
  371.       for (c in b) e('#region option[value="' + c + '"]').text(ta[c] + ' (' + b[c] + ' players)')
  372.     }, 'json')
  373.   }
  374.   function lb() {
  375.     e('#adsBottom').hide();
  376.     e('#overlays').hide();
  377.     e('#stats').hide();
  378.     e('#mainPanel').hide();
  379.     V = ea = !1;
  380.     jb();
  381.     mb(d.aa.concat(d.ac))
  382.   }
  383.   function qa(a) {
  384.     a && a != z && (e('#region').val() != a && e('#region').val(a), z = d.localStorage.location = a, e('.region-message').hide(), e('.region-message.' + a).show(), e('.btn-needs-server').prop('disabled', !1), Ga && M())
  385.   }
  386.   function pa(a) {
  387.     ea || V || (I = null, Ka || (e('#adsBottom').show(), e('#g300x250').hide(), e('#a300x250').show()), nb(Ka ? d.ac : d.aa), Ka = !1, 1000 > a && (s = 1), ea = !0, e('#mainPanel').show(), 0 < a ? e('#overlays').fadeIn(a)  : e('#overlays').show())
  388.   }
  389.   function fa(a) {
  390.     e('#helloContainer').attr('data-gamemode', a);
  391.     W = a;
  392.     e('#gamemode').val(a)
  393.   }
  394.   function jb() {
  395.     e('#region').val() ? d.localStorage.location = e('#region').val()  : d.localStorage.location && e('#region').val(d.localStorage.location);
  396.     e('#region').val() ? e('#locationKnown').append(e('#region'))  : e('#locationUnknown').append(e('#region'))
  397.   }
  398.   function nb(a) {
  399.     d.googletag && d.googletag.cmd.push(function () {
  400.       La && (La = !1, setTimeout(function () {
  401.         La = !0
  402.       }, 60000 * Qb), d.googletag && d.googletag.pubads && d.googletag.pubads().refresh &&
  403.       d.googletag.pubads().refresh(a))
  404.     })
  405.   }
  406.   function mb(a) {
  407.     d.googletag && d.googletag.pubads && d.googletag.pubads().clear && d.googletag.pubads().clear(a)
  408.   }
  409.   function ga(a) {
  410.     return d.i18n[a] || d.i18n_dict.en[a] || a
  411.   }
  412.   function ob() {
  413.     var a = ++Ja;
  414.     console.log('Find ' + z + W);
  415.     window.agar.region = z + W;
  416.     e.ajax(da + 'findServer', {
  417.       error: function () {
  418.         setTimeout(ob, 1000)
  419.       },
  420.       success: function (b) {
  421.         a == Ja && (b.alert && alert(b.alert), Ma('ws://' + b.ip, b.token))
  422.       },
  423.       dataType: 'json',
  424.       method: 'POST',
  425.       cache: !1,
  426.       crossDomain: !0,
  427.       data: (z + W || '?') + '\n2200049715'
  428.     })
  429.   }
  430.   function M() {
  431.     Ga && z && (e('#connecting').show(), ob())
  432.   }
  433.   function Ma(a, b) {
  434.     if (r) {
  435.       r.onopen = null;
  436.       r.onmessage = null;
  437.       r.onclose = null;
  438.       try {
  439.         r.close()
  440.       } catch (c) {
  441.       }
  442.       r = null
  443.     }
  444.     Na.ip && (a = 'ws://' + Na.ip);
  445.     if (null != O) {
  446.       var d = O;
  447.       O = function () {
  448.         d(b)
  449.       }
  450.     }
  451.     if (Rb) {
  452.       var e = a.split(':');
  453.       a = e[0] + 's://ip-' + e[1].replace(/\./g, '-').replace(/\//g, '') + '.tech.agar.io:' + + e[2]
  454.     }
  455.     A = [
  456.     ];
  457.     k = [
  458.     ];
  459.     J = {
  460.     };
  461.     v = [
  462.     ];
  463.     X = [
  464.     ];
  465.     x = [
  466.     ];
  467.     B = C = null;
  468.     P = 0;
  469.     ha = !1;
  470.     console.log('Connecting to ' + a);
  471.     r = new WebSocket(a);
  472.     window.agar.allCells = {
  473.     };
  474.     window.agar.myCells = [
  475.     ];
  476.     window.agar.top = [
  477.     ];
  478.     window.agar.ws = '';
  479.     window.agar.topTeams = [
  480.     ];
  481.     window.agar.dimensions = [
  482.       - 7071.067811865476,
  483.       - 7071.067811865476,
  484.       7071.067811865476,
  485.       7071.067811865476
  486.     ];
  487.     window.agar.rawViewport = {
  488.       x: 0,
  489.       y: 0,
  490.       scale: 1
  491.     };
  492.     agar.disableRendering = false;
  493.     window.agar.ws = a;
  494.     r.binaryType = 'arraybuffer';
  495.     r.onopen = function () {
  496.       var a;
  497.       console.log('socket open');
  498.       a = Q(5);
  499.       a.setUint8(0, 254);
  500.       a.setUint32(1, 5, !0);
  501.       R(a);
  502.       a = Q(5);
  503.       a.setUint8(0, 255);
  504.       a.setUint32(1, 2200049715, !0);
  505.       R(a);
  506.       a = Q(1 + b.length);
  507.       a.setUint8(0, 80);
  508.       for (var c = 0; c < b.length; ++c) a.setUint8(c + 1, b.charCodeAt(c));
  509.       R(a);
  510.       pb()
  511.     };
  512.     r.onmessage = Sb;
  513.     r.onclose = Tb;
  514.     r.onerror = function () {
  515.       console.log('socket error')
  516.     }
  517.   }
  518.   function Q(a) {
  519.     return new DataView(new ArrayBuffer(a))
  520.   }
  521.   function R(a) {
  522.     r.send(a.buffer)
  523.   }
  524.   function Tb() {
  525.     ha && (ua = 500);
  526.     console.log('socket close');
  527.     setTimeout(M, ua);
  528.     ua *= 2
  529.   }
  530.   function Sb(a) {
  531.     Ub(new DataView(a.data))
  532.   }
  533.   function Ub(a) {
  534.     function b() {
  535.       for (var b = ''; ; ) {
  536.         var d = a.getUint16(c, !0);
  537.         c += 2;
  538.         if (0 == d) break;
  539.         b += String.fromCharCode(d)
  540.       }
  541.       return b
  542.     }
  543.     var c = 0;
  544.     240 == a.getUint8(c) && (c += 5);
  545.     switch (a.getUint8(c++)) {
  546.       case 16:
  547.         Vb(a, c);
  548.         break;
  549.       case 17:
  550.         ia = a.getFloat32(c, !0);
  551.         c += 4;
  552.         ja = a.getFloat32(c, !0);
  553.         c += 4;
  554.         ka = a.getFloat32(c, !0);
  555.         c += 4;
  556.         window.agar.rawViewport.x = ia;
  557.         window.agar.rawViewport.y = ja;
  558.         window.agar.rawViewport.scale = ka;
  559.         break;
  560.       case 20:
  561.         k = [
  562.         ];
  563.         A = [
  564.         ];
  565.         break;
  566.       case 21:
  567.         Oa = a.getInt16(c, !0);
  568.         c += 2;
  569.         Pa = a.getInt16(c, !0);
  570.         c += 2;
  571.         Qa || (Qa = !0, va = Oa, wa = Pa);
  572.         break;
  573.       case 32:
  574.         window.agar.myCells = A;
  575.         A.push(a.getUint32(c, !0));
  576.         c += 4;
  577.         break;
  578.       case 49:
  579.         if (null != C) break;
  580.         var d = a.getUint32(c, !0),
  581.         c = c + 4;
  582.         x = [
  583.         ];
  584.         window.agar.top = x;
  585.         for (var e = 0; e < d; ++e) {
  586.           var f = a.getUint32(c, !0),
  587.           c = c + 4;
  588.           x.push({
  589.             id: f,
  590.             name: b()
  591.           })
  592.         }
  593.         qb();
  594.         break;
  595.       case 50:
  596.         C = [
  597.         ];
  598.         window.agar.topTeams = C;
  599.         d = a.getUint32(c, !0);
  600.         c += 4;
  601.         for (e = 0; e < d; ++e) C.push(a.getFloat32(c, !0)),
  602.         c += 4;
  603.         qb();
  604.         break;
  605.       case 64:
  606.         xa = a.getFloat64(c, !0);
  607.         c += 8;
  608.         ya = a.getFloat64(c, !0);
  609.         c += 8;
  610.         za = a.getFloat64(c, !0);
  611.         c += 8;
  612.         Aa = a.getFloat64(c, !0);
  613.         c += 8;
  614.         window.agar.dimensions = [
  615.           xa,
  616.           ya,
  617.           za,
  618.           Aa
  619.         ],
  620.         ia = (za + xa) / 2;
  621.         ja = (Aa + ya) / 2;
  622.         ka = 1;
  623.         0 == k.length && (t = ia, u = ja, g = ka);
  624.         a.byteLength > c && (a.getUint32(c, !0), c += 4, rb = b(), console.log('Server version ' + rb));
  625.         break;
  626.       case 81:
  627.         var w = a.getUint32(c, !0),
  628.         c = c + 4,
  629.         l = a.getUint32(c, !0),
  630.         c = c + 4,
  631.         h = a.getUint32(c, !0),
  632.         c = c + 4;
  633.         setTimeout(function () {
  634.           Y({
  635.             d: w,
  636.             e: l,
  637.             c: h
  638.           })
  639.         }, 1200)
  640.     }
  641.   }
  642.   function Vb(a, b) {
  643.     function c() {
  644.       for (var c = ''; ; ) {
  645.         var d = a.getUint16(b, !0);
  646.         b += 2;
  647.         if (0 == d) break;
  648.         c += String.fromCharCode(d)
  649.       }
  650.       return c
  651.     }
  652.     function p() {
  653.       for (var c = ''; ; ) {
  654.         var d = a.getUint8(b++);
  655.         if (0 == d) break;
  656.         c += String.fromCharCode(d)
  657.       }
  658.       return c
  659.     }
  660.     sb = F = Date.now();
  661.     ha || (ha = !0, Wb());
  662.     Ra = !1;
  663.     var n = a.getUint16(b, !0);
  664.     b += 2;
  665.     for (var f = 0; f < n; ++f) {
  666.       var w = J[a.getUint32(b, !0)],
  667.       l = J[a.getUint32(b + 4, !0)];
  668.       b += 8;
  669.       w && l && (l.S(), l.o = l.x, l.p = l.y, l.n = l.size, l.C = w.x, l.D = w.y, l.m = l.size, l.L = F, Xb(w, l))
  670.     }
  671.     for (f = 0; ; ) {
  672.       n = a.getUint32(b, !0);
  673.       b += 4;
  674.       if (0 == n) break;
  675.       ++f;
  676.       var g,
  677.       w = a.getInt32(b, !0);
  678.       b += 4;
  679.       l = a.getInt32(b, !0);
  680.       b += 4;
  681.       g = a.getInt16(b, !0);
  682.       b += 2;
  683.       var m = a.getUint8(b++),
  684.       K = a.getUint8(b++),
  685.       S = a.getUint8(b++),
  686.       K = Yb(m << 16 | K << 8 | S),
  687.       S = a.getUint8(b++),
  688.       h = !!(S & 1),
  689.       q = !!(S & 16),
  690.       r = null;
  691.       S & 2 && (b += 4 + a.getUint32(b, !0));
  692.       S & 4 && (r = p());
  693.       var s = c(),
  694.       m = null;
  695.       window.agar.allCells = J;
  696.       J.hasOwnProperty(n) ? (m = J[n], m.K(), m.o = m.x, m.p = m.y, m.n = m.size, m.color = K)  : (m = new Z(n, w, l, g, K, s), v.push(m), J[n] = m, m.ia = w, m.ja = l);
  697.       m.isVirus = m.f = h;
  698.       m.j = q;
  699.       m.C = w;
  700.       m.D = l;
  701.       m.m = g;
  702.       m.L = F;
  703.       m.U = S;
  704.       r && (m.J = r);
  705.       s && m.t(s);
  706.       - 1 != A.indexOf(n) && - 1 == k.indexOf(m) && (k.push(m), 1 == k.length && (t = m.x, u = m.y, tb(), document.getElementById('overlays').style.display = 'none', y = [
  707.       ], Sa = 0, Ta = k[0].color, Ua = !0, ub = Date.now(), T = Va = Wa = 0))
  708.     }
  709.     w = a.getUint32(b, !0);
  710.     b += 4;
  711.     for (f = 0; f < w; f++) n = a.getUint32(b, !0),
  712.     b += 4,
  713.     m = J[n],
  714.     null != m && m.S();
  715.     Ra && 0 == k.length && (vb = Date.now(), Ua = !1, ea || V || (wb ? (nb(d.ab), Zb(), V = !0, e('#overlays').fadeIn(3000), e('#stats').show())  : pa(3000)))
  716.   }
  717.   function Wb() {
  718.     e('#connecting').hide();
  719.     xb();
  720.     O && (O(), O = null);
  721.     null != Xa && clearTimeout(Xa);
  722.     Xa = setTimeout(function () {
  723.       d.ga && (++yb, d.ga('set', 'dimension2', yb))
  724.     }, 10000)
  725.   }
  726.   function ba() {
  727.     if ($()) {
  728.       var a = na - h / 2,
  729.       b = oa - q / 2;
  730.       64 > a * a + b * b || 0.01 > Math.abs(zb - ra) && 0.01 > Math.abs(Ab - sa) || (zb = ra, Ab = sa, a = Q(13), a.setUint8(0, 16), a.setInt32(1, ra, !0), a.setInt32(5, sa, !0), a.setUint32(9, 0, !0), R(a))
  731.     }
  732.   }
  733.   function xb() {
  734.     if ($() && ha && null != I) {
  735.       var a = Q(1 + 2 * I.length);
  736.       a.setUint8(0, 0);
  737.       for (var b = 0; b < I.length; ++b) a.setUint16(1 + 2 * b, I.charCodeAt(b), !0);
  738.       R(a);
  739.       I = null
  740.     }
  741.   }
  742.   function $() {
  743.     return null != r && r.readyState == r.OPEN
  744.   }
  745.   function H(a) {
  746.     if ($()) {
  747.       var b = Q(1);
  748.       b.setUint8(0, a);
  749.       R(b)
  750.     }
  751.   }
  752.   function pb() {
  753.     if ($() &&
  754.     null != D) {
  755.       var a = Q(1 + D.length);
  756.       a.setUint8(0, 81);
  757.       for (var b = 0; b < D.length; ++b) a.setUint8(b + 1, D.charCodeAt(b));
  758.       R(a)
  759.     }
  760.   }
  761.   function hb() {
  762.     h = 1 * d.innerWidth;
  763.     q = 1 * d.innerHeight;
  764.     Ha.width = L.width = h;
  765.     Ha.height = L.height = q;
  766.     var a = e('#helloContainer');
  767.     a.css('transform', 'none');
  768.     var b = a.height(),
  769.     c = d.innerHeight;
  770.     b > c / 1.1 ? a.css('transform', 'translate(-50%, -50%) scale(' + c / b / 1.1 + ')')  : a.css('transform', 'translate(-50%, -50%)');
  771.     Bb()
  772.   }
  773.   function Cb() {
  774.     var a;
  775.     a = 1 * Math.max(q / 1080, h / 1920);
  776.     return a *= N
  777.   }
  778.   function $b() {
  779.     if (0 != k.length) {
  780.       for (var a =
  781.       0, b = 0; b < k.length; b++) a += k[b].size;
  782.       window.agar.rawViewport.scale = Math.pow(Math.min(64 / a, 1), 0.4);
  783.       a = Math.pow(Math.min(64 / a, 1), 0.4) * Cb();
  784.       g = (9 * g + a) / 10
  785.     }
  786.   }
  787.   function Bb() {
  788.     var a,
  789.     b = Date.now();
  790.     ++ac;
  791.     F = b;
  792.     if (0 < k.length) {
  793.       $b();
  794.       for (var c = a = 0, d = 0; d < k.length; d++) k[d].K(),
  795.       a += k[d].x / k.length,
  796.       c += k[d].y / k.length;
  797.       ia = a;
  798.       ja = c;
  799.       ka = g;
  800.       t = (t + a) / 2;
  801.       u = (u + c) / 2
  802.     } else t = (29 * t + ia) / 30,
  803.     u = (29 * u + ja) / 30,
  804.     g = (9 * g + ka * Cb()) / 10;
  805.     window.agar.rawViewport.x = ia;
  806.     window.agar.rawViewport.y = ja;
  807.     if (window.agar.disableRendering) return;
  808.     Ob();
  809.     Ia();
  810.     Ya || f.clearRect(0, 0, h, q);
  811.     Ya ? (f.fillStyle = Ba ? '#111111' : '#F2FBFF', f.globalAlpha = 0.05, f.fillRect(0, 0, h, q), f.globalAlpha = 1)  : bc();
  812.     v.sort(function (a, b) {
  813.       return a.size == b.size ? a.id - b.id :
  814.       a.size - b.size
  815.     });
  816.     f.save();
  817.     f.translate(h / 2, q / 2);
  818.     f.scale(g, g);
  819.     f.translate( - t, - u);
  820.     drawb(f)
  821.     for (d = 0; d < X.length; d++) X[d].s(f);
  822.     for (d = 0; d < v.length; d++) v[d].s(f);
  823.     if (Qa) {
  824.       va = (3 * va + Oa) / 4;
  825.       wa = (3 * wa + Pa) / 4;
  826.       f.save();
  827.       f.strokeStyle = '#FFAAAA';
  828.       f.lineWidth = 10;
  829.       f.lineCap = 'round';
  830.       f.lineJoin = 'round';
  831.       f.globalAlpha = 0.5;
  832.       f.beginPath();
  833.       for (d = 0; d < k.length; d++) f.moveTo(k[d].x, k[d].y),
  834.       f.lineTo(va, wa);
  835.       f.stroke();
  836.       f.restore()
  837.     }
  838.     f.restore();
  839.     B && B.width && f.drawImage(B, h - B.width - 10, 10);
  840.     P = Math.max(P, Db());
  841.     0 != P && (null == Ca && (Ca = new Da(24, '#FFFFFF')), Ca.u(ga('score') +
  842.     ': ' + ~~(P / 100)), c = Ca.F(), a = c.width, f.globalAlpha = 0.2, f.fillStyle = '#000000', f.fillRect(window.bakaconf.scoreX, window.bakaconf.scoreY, a + 10, 34), f.globalAlpha = 1, f.drawImage(c, window.bakaconf.scoreX + 3, window.bakaconf.scoreY + 3));
  843.     cc();
  844.     b = Date.now() - b;
  845.     b > 1000 / 60 ? G -= 0.01 : b < 1000 / 65 && (G += 0.01);
  846.     0.4 > G && (G = 0.4);
  847.     1 < G && (G = 1);
  848.     b = F - Eb;
  849.     !$() || ea || V ? (s += b / 2000, 1 < s && (s = 1))  : (s -= b / 300, 0 > s && (s = 0));
  850.     0 < s ? (f.fillStyle = '#000000', Fb ? (f.globalAlpha = s, f.fillRect(0, 0, h, q), E.complete && E.width && (E.width / E.height < h / q ? (b = h, a = E.height * h / E.width)  : (b = E.width * q / E.height, a = q), f.drawImage(E, (h - b) / 2, (q - a) / 2, b, a), f.globalAlpha =
  851.     0.5 * s, f.fillRect(0, 0, h, q)))  : (f.globalAlpha = 0.5 * s, f.fillRect(0, 0, h, q)), f.globalAlpha = 1)  : Fb = !1;
  852.     Eb = F
  853.   }
  854.   function bc() {
  855.     f.fillStyle = Ba ? '#111111' : '#F2FBFF';
  856.     f.fillRect(0, 0, h, q);
  857.     f.save();
  858.     f.strokeStyle = Ba ? '#AAAAAA' : '#000000';
  859.     f.globalAlpha = 0.2 * g;
  860.     for (var a = h / g, b = q / g, c = ( - t + a / 2) % 50; c < a; c += 50) f.beginPath(),
  861.     f.moveTo(c * g - 0.5, 0),
  862.     f.lineTo(c * g - 0.5, b * g),
  863.     f.stroke();
  864.     for (c = ( - u + b / 2) % 50; c < b; c += 50) f.beginPath(),
  865.     f.moveTo(0, c * g - 0.5),
  866.     f.lineTo(a * g, c * g - 0.5),
  867.     f.stroke();
  868.     f.restore()
  869.   }
  870.   function cc() {
  871.     if (fb && Za.width) {
  872.       var a = h / 5;
  873.       f.drawImage(Za, 5, 5, a, a)
  874.     }
  875.   }
  876.   function Db() {
  877.     for (var a = 0, b = 0; b < k.length; b++) a += k[b].m * k[b].m;
  878.     return a
  879.   }
  880.   function qb() {
  881.     B = null;
  882.     if (null != C || 0 != x.length) if (null != C || Ea) {
  883.       B = document.createElement('canvas');
  884.       var a = B.getContext('2d'),
  885.       b = 60,
  886.       b = null == C ? b + 24 * x.length : b + 180,
  887.       c = Math.min(200, 0.3 * h) / 200;
  888.       B.width = 200 * c;
  889.       B.height = b * c;
  890.       a.scale(c, c);
  891.       a.globalAlpha = 0.4;
  892.       a.fillStyle = '#000000';
  893.       a.fillRect(0, 0, 200, b);
  894.       a.globalAlpha = 1;
  895.       a.fillStyle = '#FFFFFF';
  896.       c = null;
  897.       c = ga('leaderboard');
  898.       a.font = '30px tahoma';
  899.       a.fillText(c, 100 - a.measureText(c).width / 2, 40);
  900.       if (null ==
  901.       C) for (a.font = '20px tahoma', b = 0; b < x.length; ++b) c = x[b].name || ga('unnamed_cell'),
  902.       Ea || (c = ga('unnamed_cell')),
  903.       - 1 != A.indexOf(x[b].id) ? (k[0].name && (c = k[0].name), a.fillStyle = '#FFAAAA')  : a.fillStyle = '#FFFFFF',
  904.       c = b + 1 + '. ' + c,
  905.       a.fillText(c, 100 - a.measureText(c).width / 2, 70 + 24 * b);
  906.        else for (b = c = 0; b < C.length; ++b) {
  907.         var d = c + C[b] * Math.PI * 2;
  908.         a.fillStyle = '#333333'//dc[b + 1];
  909.         a.beginPath();
  910.         a.moveTo(100, 140);
  911.         a.arc(100, 140, 80, c, d, !1);
  912.         a.fill();
  913.         c = d
  914.       }
  915.     }
  916.   }
  917.   function ec(a) {
  918.     if (null == a || 0 == a.length) return null;
  919.     if ('%' == a[0]) {
  920.       if (!d.MC || !d.MC.getSkinInfo) return null;
  921.       a = d.MC.getSkinInfo('skin_' + a.slice(1));
  922.       if (null == a) return null;
  923.       for (a = ( + a.color).toString(16); 6 > a.length; ) a = '0' + a;
  924.       return '#' + a
  925.     }
  926.     return null
  927.   }
  928.   function fc(a) {
  929.     if (null == a || 0 == a.length) return null;
  930.     if (!la.hasOwnProperty(a)) {
  931.       var b = new Image;
  932.       if (':' == a[0]) b.src = a.slice(1);
  933.        else if ('%' == a[0]) {
  934.         if (!d.MC || !d.MC.getSkinInfo) return null;
  935.         var c = d.MC.getSkinInfo('skin_' + a.slice(1));
  936.         if (null == c) return null;
  937.         b.src = 'skins/premium/' + c.url
  938.       }
  939.       la[a] = b
  940.     }
  941.     return 0 != la[a].width && la[a].complete ? la[a] : null
  942.   }
  943.   function $a(a, b, c, d, e) {
  944.     this.Q = a;
  945.     this.x = b;
  946.     this.y = c;
  947.     this.g = d;
  948.     this.b = e
  949.   }
  950.   function Z(a, b, c, d, e, f) {
  951.     this.id = a;
  952.     this.o = this.x = b;
  953.     this.p = this.y = c;
  954.     this.n = this.size = d;
  955.     this.color = e;
  956.     this.a = [
  957.     ];
  958.     this.R();
  959.     this.t(f)
  960.   }
  961.   function Yb(a) {
  962.     for (a = a.toString(16); 6 > a.length; ) a = '0' + a;
  963.     return '#' + a
  964.   }
  965.   function Da(a, b, c, d) {
  966.     a && (this.q = a);
  967.     b && (this.N = b);
  968.     this.P = !!c;
  969.     d && (this.r = d)
  970.   }
  971.   function gc(a) {
  972.     for (var b = a.length, c, d; 0 < b; ) d = Math.floor(Math.random() * b),
  973.     b--,
  974.     c = a[b],
  975.     a[b] = a[d],
  976.     a[d] = c
  977.   }
  978.   function Y(a, b) {
  979.     var c = '1' == e('#helloContainer').attr('data-has-account-data');
  980.     e('#helloContainer').attr('data-has-account-data', '1');
  981.     if (null == b && d.localStorage[U]) {
  982.       var p = JSON.parse(d.localStorage[U]);
  983.       p.xp = a.e;
  984.       p.xpNeeded = a.c;
  985.       p.level = a.d;
  986.       d.localStorage[U] = JSON.stringify(p)
  987.     }
  988.     if (c) {
  989.       var n = + e('.agario-exp-bar .progress-bar-text').first().text().split('/') [0],
  990.       c = + e('.agario-exp-bar .progress-bar-text').first().text().split('/') [1].split(' ') [0],
  991.       p = e('.agario-profile-panel .progress-bar-star').first().text();
  992.       if (p != a.d) Y({
  993.         e: c,
  994.         c: c,
  995.         d: p
  996.       }, function () {
  997.         e('.agario-profile-panel .progress-bar-star').text(a.d);
  998.         e('.agario-exp-bar .progress-bar').css('width', '100%');
  999.         e('.progress-bar-star').addClass('animated tada').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () {
  1000.           e('.progress-bar-star').removeClass('animated tada')
  1001.         });
  1002.         setTimeout(function () {
  1003.           e('.agario-exp-bar .progress-bar-text').text(a.c + '/' + a.c + ' XP');
  1004.           Y({
  1005.             e: 0,
  1006.             c: a.c,
  1007.             d: a.d
  1008.           }, function () {
  1009.             Y(a, b)
  1010.           })
  1011.         }, 1000)
  1012.       });
  1013.        else {
  1014.         var f = Date.now(),
  1015.         g = function () {
  1016.           var c;
  1017.           c = (Date.now() - f) / 1000;
  1018.           c = 0 > c ? 0 : 1 < c ? 1 : c;
  1019.           c = c * c * (3 - 2 * c);
  1020.           e('.agario-exp-bar .progress-bar-text').text(~~(n + (a.e - n) * c) + '/' + a.c +
  1021.           ' XP');
  1022.           e('.agario-exp-bar .progress-bar').css('width', (88 * (n + (a.e - n) * c) / a.c).toFixed(2) + '%');
  1023.           1 > c ? d.requestAnimationFrame(g)  : b && b()
  1024.         };
  1025.         d.requestAnimationFrame(g)
  1026.       }
  1027.     } else e('.agario-profile-panel .progress-bar-star').text(a.d),
  1028.     e('.agario-exp-bar .progress-bar-text').text(a.e + '/' + a.c + ' XP'),
  1029.     e('.agario-exp-bar .progress-bar').css('width', (88 * a.e / a.c).toFixed(2) + '%'),
  1030.     b && b()
  1031.   }
  1032.   function Gb(a) {
  1033.     'string' == typeof a && (a = JSON.parse(a));
  1034.     Date.now() + 1800000 > a.expires ? e('#helloContainer').attr('data-logged-in', '0')  : (d.localStorage[U] =
  1035.     JSON.stringify(a), D = a.authToken, e('.agario-profile-name').text(a.name), pb(), Y({
  1036.       e: a.xp,
  1037.       c: a.xpNeeded,
  1038.       d: a.level
  1039.     }), e('#helloContainer').attr('data-logged-in', '1'))
  1040.   }
  1041.   function hc(a) {
  1042.     a = a.split('\n');
  1043.     Gb({
  1044.       name: a[0],
  1045.       fbid: a[1],
  1046.       authToken: a[2],
  1047.       expires: 1000 * + a[3],
  1048.       level: + a[4],
  1049.       xp: + a[5],
  1050.       xpNeeded: + a[6]
  1051.     })
  1052.   }
  1053.   function ab(a) {
  1054.     if ('connected' == a.status) {
  1055.       var b = a.authResponse.accessToken;
  1056.       console.log(b);
  1057.       d.FB.api('/me/picture?width=180&height=180', function (a) {
  1058.         d.localStorage.fbPictureCache = a.data.url;
  1059.         e('.agario-profile-picture').attr('src', a.data.url)
  1060.       });
  1061.       e('#helloContainer').attr('data-logged-in', '1');
  1062.       null != D ? e.ajax(da + 'checkToken', {
  1063.         error: function () {
  1064.           D = null;
  1065.           ab(a)
  1066.         },
  1067.         success: function (a) {
  1068.           a = a.split('\n');
  1069.           Y({
  1070.             d: + a[0],
  1071.             e: + a[1],
  1072.             c: + a[2]
  1073.           })
  1074.         },
  1075.         dataType: 'text',
  1076.         method: 'POST',
  1077.         cache: !1,
  1078.         crossDomain: !0,
  1079.         data: D
  1080.       })  : e.ajax(da + 'facebookLogin', {
  1081.         error: function () {
  1082.           D = null;
  1083.           e('#helloContainer').attr('data-logged-in', '0')
  1084.         },
  1085.         success: hc,
  1086.         dataType: 'text',
  1087.         method: 'POST',
  1088.         cache: !1,
  1089.         crossDomain: !0,
  1090.         data: b
  1091.       })
  1092.     }
  1093.   }
  1094.   function kb(a) {
  1095.     fa(':party');
  1096.     e('#helloContainer').attr('data-party-state', '4');
  1097.     a = decodeURIComponent(a).replace(/.*#/gim, '');
  1098.     bb('#' + d.encodeURIComponent(a));
  1099.     e.ajax(da + 'getToken', {
  1100.       error: function () {
  1101.         e('#helloContainer').attr('data-party-state', '6')
  1102.       },
  1103.       success: function (b) {
  1104.         b = b.split('\n');
  1105.         e('.partyToken').val('agar.io/#' + d.encodeURIComponent(a));
  1106.         e('#helloContainer').attr('data-party-state', '5');
  1107.         fa(':party');
  1108.         Ma('ws://' + b[0], a)
  1109.       },
  1110.       dataType: 'text',
  1111.       method: 'POST',
  1112.       cache: !1,
  1113.       crossDomain: !0,
  1114.       data: a
  1115.     })
  1116.   }
  1117.   function bb(a) {
  1118.     d.history && d.history.replaceState && d.history.replaceState({
  1119.     }, d.document.title, a)
  1120.   }
  1121.   function Xb(a, b) {
  1122.     var c = - 1 != A.indexOf(a.id),
  1123.     d = - 1 != A.indexOf(b.id),
  1124.     e = 30 > b.size;
  1125.     c && e && ++Sa;
  1126.     e || !c || d || ++Va
  1127.   }
  1128.   function Hb(a) {
  1129.     a = ~~a;
  1130.     var b = (a % 60).toString();
  1131.     a = (~~(a / 60)).toString();
  1132.     2 > b.length && (b = '0' + b);
  1133.     return a + ':' + b
  1134.   }
  1135.   function ic() {
  1136.     if (null == x) return 0;
  1137.     for (var a = 0; a < x.length; ++a) if ( - 1 != A.indexOf(x[a].id)) return a + 1;
  1138.     return 0
  1139.   }
  1140.   function Zb() {
  1141.     e('.stats-food-eaten').text(Sa);
  1142.     e('.stats-time-alive').text(Hb((vb - ub) / 1000));
  1143.     e('.stats-leaderboard-time').text(Hb(Wa));
  1144.     e('.stats-highest-mass').text(~~(P / 100));
  1145.     e('.stats-cells-eaten').text(Va);
  1146.     e('.stats-top-position').text(0 == T ? ':(' : T);
  1147.     var a = document.getElementById('statsGraph');
  1148.     if (a) {
  1149.       var b = a.getContext('2d'),
  1150.       c = a.width,
  1151.       a = a.height;
  1152.       b.clearRect(0, 0, c, a);
  1153.       if (2 < y.length) {
  1154.         for (var d = 200, n = 0; n < y.length; n++) d = Math.max(y[n], d);
  1155.         b.lineWidth = 3;
  1156.         b.lineCap = 'round';
  1157.         b.lineJoin = 'round';
  1158.         b.strokeStyle = Ta;
  1159.         b.fillStyle = Ta;
  1160.         b.beginPath();
  1161.         b.moveTo(0, a - y[0] / d * (a - 10) + 10);
  1162.         for (n = 1; n < y.length; n += Math.max(~~(y.length / c), 1)) {
  1163.           for (var f = n / (y.length - 1) * c, g = [
  1164.           ], l = - 20; 20 >= l; ++l) 0 > n + l || n + l >= y.length || g.push(y[n + l]);
  1165.           g = g.reduce(function (a, b) {
  1166.             return a + b
  1167.           }) / g.length / d;
  1168.           b.lineTo(f, a - g * (a - 10) + 10)
  1169.         }
  1170.         b.stroke();
  1171.         b.globalAlpha = 0.5;
  1172.         b.lineTo(c, a);
  1173.         b.lineTo(0, a);
  1174.         b.fill();
  1175.         b.globalAlpha = 1
  1176.       }
  1177.     }
  1178.   }
  1179.   if (!d.agarioNoInit) {
  1180.     var cb = d.location.protocol,
  1181.     Rb = 'https:' == cb,
  1182.     da = cb + '//m.agar.io/',
  1183.     Fa = d.navigator.userAgent;
  1184.     if ( - 1 != Fa.indexOf('Android')) d.ga && d.ga('send', 'event', 'MobileRedirect', 'PlayStore'),
  1185.     setTimeout(function () {
  1186.       d.location.href = 'https://play.google.com/store/apps/details?id=com.miniclip.agar.io'
  1187.     }, 1000);
  1188.      else if ( - 1 != Fa.indexOf('iPhone') || - 1 != Fa.indexOf('iPad') ||
  1189.     - 1 != Fa.indexOf('iPod')) d.ga && d.ga('send', 'event', 'MobileRedirect', 'AppStore'),
  1190.     setTimeout(function () {
  1191.       d.location.href = 'https://itunes.apple.com/app/agar.io/id995999703?mt=8&at=1l3vajp'
  1192.     }, 1000);
  1193.      else {
  1194.       var Ha,
  1195.       f,
  1196.       L,
  1197.       h,
  1198.       q,
  1199.       ca = null,
  1200.       r = null,
  1201.       t = 0,
  1202.       u = 0,
  1203.       A = [
  1204.       ],
  1205.       k = [
  1206.       ],
  1207.       J = {
  1208.       },
  1209.       v = [
  1210.       ],
  1211.       X = [
  1212.       ],
  1213.       x = [
  1214.       ],
  1215.       na = 0,
  1216.       oa = 0,
  1217.       ra = - 1,
  1218.       sa = - 1,
  1219.       ac = 0,
  1220.       F = 0,
  1221.       Eb = 0,
  1222.       I = null,
  1223.       xa = 0,
  1224.       ya = 0,
  1225.       za = 10000,
  1226.       Aa = 10000,
  1227.       g = 1,
  1228.       z = null,
  1229.       Ib = !0,
  1230.       Ea = !0,
  1231.       db = !1,
  1232.       Ra = !1,
  1233.       P = 0,
  1234.       Ba = !1,
  1235.       Jb = !1,
  1236.       ia = t = ~~((xa + za) / 2),
  1237.       ja = u = ~~((ya + Aa) / 2),
  1238.       ka = 1,
  1239.       W = '',
  1240.       C = null,
  1241.       Ga = !1,
  1242.       Qa = !1,
  1243.       Oa = 0,
  1244.       Pa = 0,
  1245.       va = 0,
  1246.       wa = 0,
  1247.       Kb = 0,
  1248.       dc = [
  1249.         '#333333',
  1250.         '#FF3333',
  1251.         '#33FF33',
  1252.         '#3333FF'
  1253.       ],
  1254.       Ya = !1,
  1255.       ha = !1,
  1256.       sb = 0,
  1257.       D = null,
  1258.       N = 1,
  1259.       s = 1,
  1260.       ea = !1,
  1261.       Ja = 0,
  1262.       Fb = !0,
  1263.       Na = {
  1264.       },
  1265.       rb = null;
  1266.       (function () {
  1267.         var a = d.location.search;
  1268.         '?' == a.charAt(0) && (a = a.slice(1));
  1269.         for (var a = a.split('&'), b = 0; b < a.length; b++) {
  1270.           var c = a[b].split('=');
  1271.           Na[c[0]] = c[1]
  1272.         }
  1273.       }) ();
  1274.       var E = new Image;
  1275.       E.src = 'img/background.png';
  1276.       var fb = 'ontouchstart' in d && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(d.navigator.userAgent),
  1277.       Za = new Image;
  1278.       Za.src = 'img/split.png';
  1279.       var Lb = document.createElement('canvas');
  1280.       if ('undefined' == typeof console || 'undefined' ==
  1281.       typeof DataView || 'undefined' == typeof WebSocket || null == Lb || null == Lb.getContext || null == d.localStorage) alert('You browser does not support this game, we recommend you to use Firefox to play this');
  1282.        else {
  1283.         var ta = null;
  1284.         d.setNick = function (a) {
  1285.           d.ga && d.ga('send', 'event', 'Nick', a.toLowerCase());
  1286.           lb();
  1287.           I = a;
  1288.           xb();
  1289.           P = 0
  1290.         };
  1291.         d.setRegion = qa;
  1292.         var Ka = !0;
  1293.         d.setSkins = function (a) {
  1294.           Ib = a
  1295.         };
  1296.         d.setNames = function (a) {
  1297.           Ea = a
  1298.         };
  1299.         d.setDarkTheme = function (a) {
  1300.           Ba = a
  1301.         };
  1302.         d.setColors = function (a) {
  1303.           db = a
  1304.         };
  1305.         d.setShowMass = function (a) {
  1306.           Jb = a
  1307.         };
  1308.         d.spectate = function () {
  1309.           I =
  1310.           null;
  1311.           H(1);
  1312.           lb()
  1313.         };
  1314.         d.setGameMode = function (a) {
  1315.           a != W && (':party' == W && e('#helloContainer').attr('data-party-state', '0'), fa(a), ':party' != a && M())
  1316.         };
  1317.         d.setAcid = function (a) {
  1318.           Ya = a
  1319.         };
  1320.         null != d.localStorage && (null == d.localStorage.AB9 && (d.localStorage.AB9 = 0 + ~~(100 * Math.random())), Kb = + d.localStorage.AB9, d.ABGroup = Kb);
  1321.         e.get(cb + '//gc.agar.io', function (a) {
  1322.           var b = a.split(' ');
  1323.           a = b[0];
  1324.           b = b[1] || '';
  1325.           - 1 == ['UA'].indexOf(a) && Mb.push('ussr');
  1326.           ma.hasOwnProperty(a) && ('string' == typeof ma[a] ? z || qa(ma[a])  : ma[a].hasOwnProperty(b) && (z || qa(ma[a][b])))
  1327.         }, 'text');
  1328.         var La = !0,
  1329.         Qb = 0,
  1330.         ma = {
  1331.           AF: 'JP-Tokyo',
  1332.           AX: 'EU-London',
  1333.           AL: 'EU-London',
  1334.           DZ: 'EU-London',
  1335.           AS: 'SG-Singapore',
  1336.           AD: 'EU-London',
  1337.           AO: 'EU-London',
  1338.           AI: 'US-Atlanta',
  1339.           AG: 'US-Atlanta',
  1340.           AR: 'BR-Brazil',
  1341.           AM: 'JP-Tokyo',
  1342.           AW: 'US-Atlanta',
  1343.           AU: 'SG-Singapore',
  1344.           AT: 'EU-London',
  1345.           AZ: 'JP-Tokyo',
  1346.           BS: 'US-Atlanta',
  1347.           BH: 'JP-Tokyo',
  1348.           BD: 'JP-Tokyo',
  1349.           BB: 'US-Atlanta',
  1350.           BY: 'EU-London',
  1351.           BE: 'EU-London',
  1352.           BZ: 'US-Atlanta',
  1353.           BJ: 'EU-London',
  1354.           BM: 'US-Atlanta',
  1355.           BT: 'JP-Tokyo',
  1356.           BO: 'BR-Brazil',
  1357.           BQ: 'US-Atlanta',
  1358.           BA: 'EU-London',
  1359.           BW: 'EU-London',
  1360.           BR: 'BR-Brazil',
  1361.           IO: 'JP-Tokyo',
  1362.           VG: 'US-Atlanta',
  1363.           BN: 'JP-Tokyo',
  1364.           BG: 'EU-London',
  1365.           BF: 'EU-London',
  1366.           BI: 'EU-London',
  1367.           KH: 'JP-Tokyo',
  1368.           CM: 'EU-London',
  1369.           CA: 'US-Atlanta',
  1370.           CV: 'EU-London',
  1371.           KY: 'US-Atlanta',
  1372.           CF: 'EU-London',
  1373.           TD: 'EU-London',
  1374.           CL: 'BR-Brazil',
  1375.           CN: 'CN-China',
  1376.           CX: 'JP-Tokyo',
  1377.           CC: 'JP-Tokyo',
  1378.           CO: 'BR-Brazil',
  1379.           KM: 'EU-London',
  1380.           CD: 'EU-London',
  1381.           CG: 'EU-London',
  1382.           CK: 'SG-Singapore',
  1383.           CR: 'US-Atlanta',
  1384.           CI: 'EU-London',
  1385.           HR: 'EU-London',
  1386.           CU: 'US-Atlanta',
  1387.           CW: 'US-Atlanta',
  1388.           CY: 'JP-Tokyo',
  1389.           CZ: 'EU-London',
  1390.           DK: 'EU-London',
  1391.           DJ: 'EU-London',
  1392.           DM: 'US-Atlanta',
  1393.           DO: 'US-Atlanta',
  1394.           EC: 'BR-Brazil',
  1395.           EG: 'EU-London',
  1396.           SV: 'US-Atlanta',
  1397.           GQ: 'EU-London',
  1398.           ER: 'EU-London',
  1399.           EE: 'EU-London',
  1400.           ET: 'EU-London',
  1401.           FO: 'EU-London',
  1402.           FK: 'BR-Brazil',
  1403.           FJ: 'SG-Singapore',
  1404.           FI: 'EU-London',
  1405.           FR: 'EU-London',
  1406.           GF: 'BR-Brazil',
  1407.           PF: 'SG-Singapore',
  1408.           GA: 'EU-London',
  1409.           GM: 'EU-London',
  1410.           GE: 'JP-Tokyo',
  1411.           DE: 'EU-London',
  1412.           GH: 'EU-London',
  1413.           GI: 'EU-London',
  1414.           GR: 'EU-London',
  1415.           GL: 'US-Atlanta',
  1416.           GD: 'US-Atlanta',
  1417.           GP: 'US-Atlanta',
  1418.           GU: 'SG-Singapore',
  1419.           GT: 'US-Atlanta',
  1420.           GG: 'EU-London',
  1421.           GN: 'EU-London',
  1422.           GW: 'EU-London',
  1423.           GY: 'BR-Brazil',
  1424.           HT: 'US-Atlanta',
  1425.           VA: 'EU-London',
  1426.           HN: 'US-Atlanta',
  1427.           HK: 'JP-Tokyo',
  1428.           HU: 'EU-London',
  1429.           IS: 'EU-London',
  1430.           IN: 'JP-Tokyo',
  1431.           ID: 'JP-Tokyo',
  1432.           IR: 'JP-Tokyo',
  1433.           IQ: 'JP-Tokyo',
  1434.           IE: 'EU-London',
  1435.           IM: 'EU-London',
  1436.           IL: 'JP-Tokyo',
  1437.           IT: 'EU-London',
  1438.           JM: 'US-Atlanta',
  1439.           JP: 'JP-Tokyo',
  1440.           JE: 'EU-London',
  1441.           JO: 'JP-Tokyo',
  1442.           KZ: 'JP-Tokyo',
  1443.           KE: 'EU-London',
  1444.           KI: 'SG-Singapore',
  1445.           KP: 'JP-Tokyo',
  1446.           KR: 'JP-Tokyo',
  1447.           KW: 'JP-Tokyo',
  1448.           KG: 'JP-Tokyo',
  1449.           LA: 'JP-Tokyo',
  1450.           LV: 'EU-London',
  1451.           LB: 'JP-Tokyo',
  1452.           LS: 'EU-London',
  1453.           LR: 'EU-London',
  1454.           LY: 'EU-London',
  1455.           LI: 'EU-London',
  1456.           LT: 'EU-London',
  1457.           LU: 'EU-London',
  1458.           MO: 'JP-Tokyo',
  1459.           MK: 'EU-London',
  1460.           MG: 'EU-London',
  1461.           MW: 'EU-London',
  1462.           MY: 'JP-Tokyo',
  1463.           MV: 'JP-Tokyo',
  1464.           ML: 'EU-London',
  1465.           MT: 'EU-London',
  1466.           MH: 'SG-Singapore',
  1467.           MQ: 'US-Atlanta',
  1468.           MR: 'EU-London',
  1469.           MU: 'EU-London',
  1470.           YT: 'EU-London',
  1471.           MX: 'US-Atlanta',
  1472.           FM: 'SG-Singapore',
  1473.           MD: 'EU-London',
  1474.           MC: 'EU-London',
  1475.           MN: 'JP-Tokyo',
  1476.           ME: 'EU-London',
  1477.           MS: 'US-Atlanta',
  1478.           MA: 'EU-London',
  1479.           MZ: 'EU-London',
  1480.           MM: 'JP-Tokyo',
  1481.           NA: 'EU-London',
  1482.           NR: 'SG-Singapore',
  1483.           NP: 'JP-Tokyo',
  1484.           NL: 'EU-London',
  1485.           NC: 'SG-Singapore',
  1486.           NZ: 'SG-Singapore',
  1487.           NI: 'US-Atlanta',
  1488.           NE: 'EU-London',
  1489.           NG: 'EU-London',
  1490.           NU: 'SG-Singapore',
  1491.           NF: 'SG-Singapore',
  1492.           MP: 'SG-Singapore',
  1493.           NO: 'EU-London',
  1494.           OM: 'JP-Tokyo',
  1495.           PK: 'JP-Tokyo',
  1496.           PW: 'SG-Singapore',
  1497.           PS: 'JP-Tokyo',
  1498.           PA: 'US-Atlanta',
  1499.           PG: 'SG-Singapore',
  1500.           PY: 'BR-Brazil',
  1501.           PE: 'BR-Brazil',
  1502.           PH: 'JP-Tokyo',
  1503.           PN: 'SG-Singapore',
  1504.           PL: 'EU-London',
  1505.           PT: 'EU-London',
  1506.           PR: 'US-Atlanta',
  1507.           QA: 'JP-Tokyo',
  1508.           RE: 'EU-London',
  1509.           RO: 'EU-London',
  1510.           RU: 'RU-Russia',
  1511.           RW: 'EU-London',
  1512.           BL: 'US-Atlanta',
  1513.           SH: 'EU-London',
  1514.           KN: 'US-Atlanta',
  1515.           LC: 'US-Atlanta',
  1516.           MF: 'US-Atlanta',
  1517.           PM: 'US-Atlanta',
  1518.           VC: 'US-Atlanta',
  1519.           WS: 'SG-Singapore',
  1520.           SM: 'EU-London',
  1521.           ST: 'EU-London',
  1522.           SA: 'EU-London',
  1523.           SN: 'EU-London',
  1524.           RS: 'EU-London',
  1525.           SC: 'EU-London',
  1526.           SL: 'EU-London',
  1527.           SG: 'JP-Tokyo',
  1528.           SX: 'US-Atlanta',
  1529.           SK: 'EU-London',
  1530.           SI: 'EU-London',
  1531.           SB: 'SG-Singapore',
  1532.           SO: 'EU-London',
  1533.           ZA: 'EU-London',
  1534.           SS: 'EU-London',
  1535.           ES: 'EU-London',
  1536.           LK: 'JP-Tokyo',
  1537.           SD: 'EU-London',
  1538.           SR: 'BR-Brazil',
  1539.           SJ: 'EU-London',
  1540.           SZ: 'EU-London',
  1541.           SE: 'EU-London',
  1542.           CH: 'EU-London',
  1543.           SY: 'EU-London',
  1544.           TW: 'JP-Tokyo',
  1545.           TJ: 'JP-Tokyo',
  1546.           TZ: 'EU-London',
  1547.           TH: 'JP-Tokyo',
  1548.           TL: 'JP-Tokyo',
  1549.           TG: 'EU-London',
  1550.           TK: 'SG-Singapore',
  1551.           TO: 'SG-Singapore',
  1552.           TT: 'US-Atlanta',
  1553.           TN: 'EU-London',
  1554.           TR: 'TK-Turkey',
  1555.           TM: 'JP-Tokyo',
  1556.           TC: 'US-Atlanta',
  1557.           TV: 'SG-Singapore',
  1558.           UG: 'EU-London',
  1559.           UA: 'EU-London',
  1560.           AE: 'EU-London',
  1561.           GB: 'EU-London',
  1562.           US: 'US-Atlanta',
  1563.           UM: 'SG-Singapore',
  1564.           VI: 'US-Atlanta',
  1565.           UY: 'BR-Brazil',
  1566.           UZ: 'JP-Tokyo',
  1567.           VU: 'SG-Singapore',
  1568.           VE: 'BR-Brazil',
  1569.           VN: 'JP-Tokyo',
  1570.           WF: 'SG-Singapore',
  1571.           EH: 'EU-London',
  1572.           YE: 'JP-Tokyo',
  1573.           ZM: 'EU-London',
  1574.           ZW: 'EU-London'
  1575.         },
  1576.         O = null;
  1577.         d.connect = Ma;
  1578.         var ua = 500,
  1579.         Xa = null,
  1580.         yb = 0,
  1581.         zb = - 1,
  1582.         Ab = - 1;
  1583.         d.refreshPlayerInfo = function () {
  1584.           H(253)
  1585.         };
  1586.         var B = null,
  1587.         G = 1,
  1588.         Ca = null,
  1589.         ib = function () {
  1590.           var a = Date.now(),
  1591.           b = 1000 / 60;
  1592.           return function () {
  1593.             d.requestAnimationFrame(ib);
  1594.             var c = Date.now(),
  1595.             e = c - a;
  1596.             e > b && (a = c - e % b, !$() || 240 > Date.now() - sb ? Bb()  : console.warn('Skipping draw'), jc())
  1597.           }
  1598.         }(),
  1599.         aa =
  1600.         {
  1601.         },
  1602.         Mb = 'poland;usa;china;russia;canada;australia;spain;brazil;germany;ukraine;france;sweden;chaplin;north korea;south korea;japan;united kingdom;earth;greece;latvia;lithuania;estonia;finland;norway;cia;maldivas;austria;nigeria;reddit;yaranaika;confederate;9gag;indiana;4chan;italy;bulgaria;tumblr;2ch.hk;hong kong;portugal;jamaica;german empire;mexico;sanik;switzerland;croatia;chile;indonesia;bangladesh;thailand;iran;iraq;peru;moon;botswana;bosnia;netherlands;european union;taiwan;pakistan;hungary;satanist;qing dynasty;matriarchy;patriarchy;feminism;ireland;texas;facepunch;prodota;cambodia;steam;piccolo;ea;india;kc;denmark;quebec;ayy lmao;sealand;bait;tsarist russia;origin;vinesauce;stalin;belgium;luxembourg;stussy;prussia;8ch;argentina;scotland;sir;romania;belarus;wojak;doge;nasa;byzantium;imperial japan;french kingdom;somalia;turkey;mars;pokerface;8;irs;receita federal;facebook;putin;merkel;tsipras;obama;kim jong-un;dilma;hollande;berlusconi;cameron;clinton;hillary;venezuela;blatter;chavez;cuba;fidel;merkel;palin;queen;boris;bush;trump'.split(';'),
  1603.         kc = '8;nasa;putin;merkel;tsipras;obama;kim jong-un;dilma;hollande;berlusconi;cameron;clinton;hillary;blatter;chavez;fidel;merkel;palin;queen;boris;bush;trump'.split(';'),
  1604.         la = {
  1605.         };
  1606.         $a.prototype = {
  1607.           Q: null,
  1608.           x: 0,
  1609.           y: 0,
  1610.           g: 0,
  1611.           b: 0
  1612.         };
  1613.         Z.prototype = {
  1614.           id: 0,
  1615.           a: null,
  1616.           name: null,
  1617.           k: null,
  1618.           I: null,
  1619.           x: 0,
  1620.           y: 0,
  1621.           size: 0,
  1622.           o: 0,
  1623.           p: 0,
  1624.           n: 0,
  1625.           C: 0,
  1626.           D: 0,
  1627.           m: 0,
  1628.           U: 0,
  1629.           L: 0,
  1630.           W: 0,
  1631.           A: !1,
  1632.           f: !1,
  1633.           j: !1,
  1634.           M: !0,
  1635.           T: 0,
  1636.           J: null,
  1637.           S: function () {
  1638.             var a;
  1639.             for (a = 0; a < v.length; a++) if (v[a] == this) {
  1640.               v.splice(a, 1);
  1641.               break
  1642.             }
  1643.             delete J[this.id];
  1644.             a = k.indexOf(this);
  1645.             - 1 != a && (Ra = !0, k.splice(a, 1));
  1646.             a = A.indexOf(this.id);
  1647.             - 1 != a && A.splice(a, 1);
  1648.             this.A = !0;
  1649.             0 < this.T && X.push(this)
  1650.           },
  1651.           i: function () {
  1652.             return Math.max(~~(0.3 * this.size), 24)
  1653.           },
  1654.           t: function (a) {
  1655.             if (this.name = a) null == this.k ? this.k = new Da(this.i(), '#FFFFFF', !0, '#000000')  : this.k.G(this.i()),
  1656.             this.k.u(this.name)
  1657.           },
  1658.           R: function () {
  1659.             for (var a = this.B(); this.a.length > a; ) {
  1660.               var b = ~~(Math.random() * this.a.length);
  1661.               this.a.splice(b, 1)
  1662.             }
  1663.             for (0 == this.a.length && 0 < a && this.a.push(new $a(this, this.x, this.y, this.size, Math.random() - 0.5)); this.a.length < a; ) b = ~~(Math.random() * this.a.length),
  1664.             b = this.a[b],
  1665.             this.a.push(new $a(this, b.x, b.y, b.g, b.b))
  1666.           },
  1667.           B: function () {
  1668.             var a = 10;
  1669.             20 > this.size && (a = 0);
  1670.             this.f && (a = 30);
  1671.             var b = this.size;
  1672.             this.f || (b *= g);
  1673.             b *= G;
  1674.             this.U & 32 && (b *= 0.25);
  1675.             return ~~Math.max(b, a)
  1676.           },
  1677.           da: function () {
  1678.             this.R();
  1679.             for (var a = this.a, b = a.length, c = 0; c < b; ++c) {
  1680.               var d = a[(c - 1 + b) % b].b,
  1681.               e = a[(c + 1) % b].b;
  1682.               a[c].b += (Math.random() - 0.5) * (this.j ? 3 : 1);
  1683.               a[c].b *= 0.7;
  1684.               10 < a[c].b && (a[c].b = 10);
  1685.               - 10 > a[c].b && (a[c].b = - 10);
  1686.               a[c].b = (d + e + 8 * a[c].b) / 10
  1687.             }
  1688.             for (var f = this, k = this.f ? 0 : (this.id / 1000 + F / 10000) % (2 * Math.PI), c = 0; c < b; ++c) {
  1689.               var l = a[c].g,
  1690.               d = a[(c - 1 + b) % b].g,
  1691.               e = a[(c + 1) % b].g;
  1692.               if (15 <
  1693.               this.size && null != ca && 20 < this.size * g && 0 < this.id) {
  1694.                 var h = !1,
  1695.                 m = a[c].x,
  1696.                 K = a[c].y;
  1697.                 ca.ea(m - 5, K - 5, 10, 10, function (a) {
  1698.                   a.Q != f && 25 > (m - a.x) * (m - a.x) + (K - a.y) * (K - a.y) && (h = !0)
  1699.                 });
  1700.                 !h && (a[c].x < xa || a[c].y < ya || a[c].x > za || a[c].y > Aa) && (h = !0);
  1701.                 h && (0 < a[c].b && (a[c].b = 0), a[c].b -= 1)
  1702.               }
  1703.               l += a[c].b;
  1704.               0 > l && (l = 0);
  1705.               l = this.j ? (19 * l + this.size) / 20 : (12 * l + this.size) / 13;
  1706.               a[c].g = (d + e + 8 * l) / 10;
  1707.               d = 2 * Math.PI / b;
  1708.               e = this.a[c].g;
  1709.               this.f && 0 == c % 2 && (e += 5);
  1710.               a[c].x = this.x + Math.cos(d * c + k) * e;
  1711.               a[c].y = this.y + Math.sin(d * c + k) * e
  1712.             }
  1713.           },
  1714.           K: function () {
  1715.             if (0 >= this.id) return 1;
  1716.             var a;
  1717.             a = (F - this.L) / 120;
  1718.             a = 0 > a ? 0 : 1 < a ? 1 : a;
  1719.             var b = 0 > a ? 0 : 1 < a ? 1 : a;
  1720.             this.i();
  1721.             if (this.A && 1 <= b) {
  1722.               var c = X.indexOf(this);
  1723.               - 1 != c && X.splice(c, 1)
  1724.             }
  1725.             this.x = a * (this.C - this.o) + this.o;
  1726.             this.y = a * (this.D - this.p) + this.p;
  1727.             this.size = b * (this.m - this.n) + this.n;
  1728.             return b
  1729.           },
  1730.           H: function () {
  1731.             return 0 >= this.id ? !0 : this.x + this.size + 40 < t - h / 2 / g || this.y + this.size + 40 < u - q / 2 / g || this.x - this.size - 40 > t + h / 2 / g || this.y - this.size - 40 > u + q / 2 / g ? !1 : !0
  1732.           },
  1733.           s: function (a) {
  1734.             if (window.agar.disableRendering) return;
  1735.             if (this.H()) {
  1736.               ++this.T;
  1737.               var b = 0 < this.id && !this.f && !this.j && 0.4 > g;
  1738.               5 > this.B() && 0 < this.id && (b = !0);
  1739.               if (this.M &&
  1740.               !b) for (var c = 0; c < this.a.length; c++) this.a[c].g = this.size;
  1741.               this.M = b;
  1742.               a.save();
  1743.               this.W = F;
  1744.               c = this.K();
  1745.               this.A && (a.globalAlpha *= 1 - c);
  1746.               a.lineWidth = 10;
  1747.               a.lineCap = 'round';
  1748.               a.lineJoin = this.f ? 'miter' : 'round';
  1749.               db ? (a.fillStyle = '#FFFFFF', a.strokeStyle = '#AAAAAA')  : (this.size * this.size < 1000 && window.bakaconf !== undefined && window.bakaconf.pelletColor !== undefined) ? (a.fillStyle = window.bakaconf.pelletColor, a.strokeStyle = window.bakaconf.pelletColor) : this.isVirus ? (a.fillStyle = '#555', a.strokeStyle = '#ccc', a.globalAlpha = 0.8) : (a.fillStyle = this.color, a.strokeStyle = this.color);
  1750.               if (b || this.isVirus) {
  1751.                 a.beginPath();
  1752.                 a.arc(this.x, this.y, this.size + 5, 0, 2 * Math.PI * ((this.size * this.size / 100 < 10) && !window.agar.drawPellets ? 0 : 1), !1);
  1753.               } else {
  1754.                 this.da();
  1755.                 a.beginPath();
  1756.                 var d = this.B();
  1757.                 a.moveTo(this.a[0].x, this.a[0].y);
  1758.                 for (c = 1; c <= d; ++c) {
  1759.                   var e = c % d;
  1760.                   a.lineTo(this.a[e].x, this.a[e].y)
  1761.                 }
  1762.               }
  1763.               a.closePath();
  1764.               d = this.name.toLowerCase();
  1765.               !this.j && Ib && ':teams' != W ? (c = fc(this.J)) || ( - 1 != Mb.indexOf(d) ? (aa.hasOwnProperty(d) || (aa[d] = new Image, aa[d].src = 'skins/' + d + '.png'), c = 0 != aa[d].width && aa[d].complete ? aa[d] : null)  : c = null)  : c = null;
  1766.               e = c;
  1767.               b || a.stroke();
  1768.               a.fill();
  1769.               if (typeof window.agar.skinF === 'function') e = window.agar.skinF(this, e);
  1770.               var expose_ssx2 = e && e.big ? 2 : 1;
  1771.               if (null != e) {
  1772.                 a.save();
  1773.                 if (!e.big) a.clip();
  1774.                 a.drawImage(e, this.x - this.size * expose_ssx2, this.y - this.size * expose_ssx2, 2 * this.size * expose_ssx2, 2 * this.size * expose_ssx2);
  1775.                 a.restore();
  1776.               };
  1777.               (db || 15 < this.size) && !b && (a.strokeStyle = '#000000', a.globalAlpha *= 0.1, a.stroke());
  1778.               var size_margin = (window.agar.colorOffensive ? window.agar.myCellsMax : window.agar.myCellsMin);
  1779.               if (window.agar.enableColorCoding && window.agar.myCells.length != 0) {
  1780.                 if (!this.isVirus && this.size*this.size/100 > 13) {
  1781.                   a.beginPath();
  1782.                   a.globalAlpha = 0.9;
  1783.                   a.lineWidth = 15;
  1784.                   if (window.agar.myCells.indexOf(this.id) != - 1) {
  1785.                     a.strokeStyle = '#FFFFFF';
  1786.                   } else if (this.size > Math.sqrt(2) * size_margin / 0.85) {
  1787.                     a.strokeStyle = '#FF0000';
  1788.                   } else if (this.size > size_margin / 0.85) {
  1789.                     a.strokeStyle = '#FF7F00';
  1790.                   } else if (this.size > size_margin * 0.85) {
  1791.                     a.strokeStyle = '#FFFF00';
  1792.                   } else if (this.size > size_margin / Math.sqrt(2) * 0.85) {
  1793.                     a.strokeStyle = '#008000';
  1794.                   } else {
  1795.                     a.strokeStyle = '#ADD8E6';
  1796.                   }
  1797.                   a.arc(this.x, this.y, this.size + 25, 0, Math.PI * 2, false);
  1798.                   a.closePath();
  1799.                   a.stroke();
  1800.                   a.lineWidth = 10;
  1801.                 }
  1802.               }
  1803.               if (window.agar.enableSplitGuides) {
  1804.                 if ((this.size >= Math.sqrt(2) * window.agar.myCellsMin / 0.85) || (this.size >= 60 && window.agar.myCells.indexOf(this.id) != - 1) || this.isVirus) {
  1805.                   a.globalAlpha = 0.8;
  1806.                   if (window.bakaconf !== undefined) {
  1807.                     a.lineWidth = window.bakaconf.splitGuideWidth;
  1808.                   }
  1809.                   a.strokeStyle = (window.agar.myCells.indexOf(this.id) == - 1 ? '#FF0000' : '#FFFFFF');
  1810.                   if (this.isVirus) {
  1811.                     a.strokeStyle = '#7CFC00'
  1812.                   }
  1813.                   a.beginPath();
  1814.                   a.arc(this.x, this.y, this.size + Math.max(760, this.size) + this.size, 0, 2 * Math.PI, !1);
  1815.                   a.closePath();
  1816.                   a.stroke();
  1817.                   if (window.agar.myCells.indexOf(this.id) != - 1) {
  1818.                     a.globalAlpha = 0.4;
  1819.                     a.beginPath();
  1820.                     a.arc(this.x, this.y, this.size + Math.max(760, this.size), 0, 2 * Math.PI, !1);
  1821.                     a.closePath();
  1822.                     a.stroke();
  1823.                   }
  1824.                   a.lineWidth = 10;
  1825.                   a.globalAlpha = 1;
  1826.                 }
  1827.               }
  1828.               a.globalAlpha = 1;
  1829.               c = - 1 != k.indexOf(this);
  1830.               b = ~~this.y;
  1831.               if (0 != this.id && (Ea ||
  1832.               c) && this.name && this.k && (null == e || - 1 == kc.indexOf(d))) {
  1833.                 e = this.k;
  1834.                 e.u(this.name);
  1835.                 e.G(this.i());
  1836.                 d = 0 >= this.id ? 1 : Math.ceil(10 * g) / 10;
  1837.                 e.V(d);
  1838.                 var e = e.F(),
  1839.                 f = ~~(e.width / d),
  1840.                 h = ~~(e.height / d);
  1841.                 a.drawImage(e, ~~this.x - ~~(f / 2), b - ~~(h / 2 * window.bakaconf.cellNameOffsetY), f, h);
  1842.                 b += e.height / 2 / d + 4
  1843.               }
  1844.               0 < this.id && Jb && 20 < this.size && (null == this.I && (this.I = new Da(this.i() / 2, '#FFFFFF', !0, '#000000')), c = this.I, c.G(this.i() / 2 * (this.f?6:window.bakaconf.cellMassScale)), c.u(~~(this.f?(200-this.size * this.size / 100)/14:this.size * this.size / 100)), d = Math.ceil(10 * g) / 10, c.V(d), e = c.F(), f = ~~(e.width / d), h = ~~(e.height / d), a.drawImage(e, ~~this.x - ~~(f / 2), b - ~~(h / 2*(this.f?1:window.bakaconf.cellMassOffsetY)), f, h));
  1845.               a.restore()
  1846.             }
  1847.           }
  1848.         };
  1849.         Da.prototype = {
  1850.           w: '',
  1851.           N: '#000000',
  1852.           P: !1,
  1853.           r: '#000000',
  1854.           q: 16,
  1855.           l: null,
  1856.           O: null,
  1857.           h: !1,
  1858.           v: 1,
  1859.           G: function (a) {
  1860.             this.q != a && (this.q = a, this.h = !0)
  1861.           },
  1862.           V: function (a) {
  1863.             this.v != a && (this.v = a, this.h = !0)
  1864.           },
  1865.           setStrokeColor: function (a) {
  1866.             this.r != a && (this.r = a, this.h = !0)
  1867.           },
  1868.           u: function (a) {
  1869.             a != this.w && (this.w = a, this.h = !0)
  1870.           },
  1871.           F: function () {
  1872.             null == this.l && (this.l = document.createElement('canvas'), this.O = this.l.getContext('2d'));
  1873.             if (this.h) {
  1874.               this.h = !1;
  1875.               var a = this.l,
  1876.               b = this.O,
  1877.               c = this.w,
  1878.               d = this.v,
  1879.               e = this.q,
  1880.               f = e + 'px tahoma';
  1881.               b.font = f;
  1882.               var g = ~~(0.2 * e);
  1883.               a.width = (b.measureText(c).width + 6) * d;
  1884.               a.height = (e + g) * d;
  1885.               b.font = f;
  1886.               b.scale(d, d);
  1887.               b.globalAlpha = 1;
  1888.               b.lineWidth = 3;
  1889.               b.strokeStyle = this.r;
  1890.               b.fillStyle = this.N;
  1891.               this.P && b.strokeText(c, 3, e - g / 2);
  1892.               b.fillText(c, 3, e - g / 2)
  1893.             }
  1894.             return this.l
  1895.           }
  1896.         };
  1897.         Date.now || (Date.now = function () {
  1898.           return (new Date).getTime()
  1899.         });
  1900.         (function () {
  1901.           for (var a = [
  1902.             'ms',
  1903.             'moz',
  1904.             'webkit',
  1905.             'o'
  1906.           ], b = 0; b < a.length && !d.requestAnimationFrame; ++b) d.requestAnimationFrame = d[a[b] + 'RequestAnimationFrame'],
  1907.           d.cancelAnimationFrame = d[a[b] + 'CancelAnimationFrame'] ||
  1908.           d[a[b] + 'CancelRequestAnimationFrame'];
  1909.           d.requestAnimationFrame || (d.requestAnimationFrame = function (a) {
  1910.             return setTimeout(a, 1000 / 60)
  1911.           }, d.cancelAnimationFrame = function (a) {
  1912.             clearTimeout(a)
  1913.           })
  1914.         }) ();
  1915.         var Pb = {
  1916.           X: function (a) {
  1917.             function b(a) {
  1918.               a < d && (a = d);
  1919.               a > f && (a = f);
  1920.               return ~~((a - d) / 32)
  1921.             }
  1922.             function c(a) {
  1923.               a < e && (a = e);
  1924.               a > g && (a = g);
  1925.               return ~~((a - e) / 32)
  1926.             }
  1927.             var d = a.ba,
  1928.             e = a.ca,
  1929.             f = a.Z,
  1930.             g = a.$,
  1931.             l = ~~((f - d) / 32) + 1,
  1932.             h = ~~((g - e) / 32) + 1,
  1933.             m = Array(l * h);
  1934.             return {
  1935.               Y: function (a) {
  1936.                 var d = b(a.x) + c(a.y) * l;
  1937.                 null == m[d] ? m[d] = a : Array.isArray(m[d]) ? m[d].push(a)  : m[d] = [
  1938.                   m[d],
  1939.                   a
  1940.                 ]
  1941.               },
  1942.               ea: function (a, d, e, f, g) {
  1943.                 var n = b(a),
  1944.                 k = c(d);
  1945.                 a = b(a + e);
  1946.                 d = c(d + f);
  1947.                 if (0 > n || n >= l || 0 > k || k >= h) debugger;
  1948.                 for (; k <= d; ++k) for (f = n; f <= a; ++f) if (e = m[f + k * l], null != e) if (Array.isArray(e)) for (var p = 0; p < e.length; p++) g(e[p]);
  1949.                  else g(e)
  1950.               }
  1951.             }
  1952.           }
  1953.         },
  1954.         tb = function () {
  1955.           var a = new Z(0, 0, 0, 32, '#ED1C24', ''),
  1956.           b = document.createElement('canvas');
  1957.           b.width = 32;
  1958.           b.height = 32;
  1959.           var c = b.getContext('2d');
  1960.           return function () {
  1961.             0 < k.length && (a.color = k[0].color, a.t(k[0].name));
  1962.             c.clearRect(0, 0, 32, 32);
  1963.             c.save();
  1964.             c.translate(16, 16);
  1965.             c.scale(0.4, 0.4);
  1966.             a.s(c);
  1967.             c.restore();
  1968.             var d =
  1969.             document.getElementById('favicon'),
  1970.             e = d.cloneNode(!0);
  1971.             e.setAttribute('href', b.toDataURL('image/png'));
  1972.             d.parentNode.replaceChild(e, d)
  1973.           }
  1974.         }();
  1975.         e(function () {
  1976.           tb()
  1977.         });
  1978.         var U = 'loginCache3';
  1979.         e(function () {
  1980.           + d.localStorage.wannaLogin && (d.localStorage[U] && Gb(d.localStorage[U]), d.localStorage.fbPictureCache && e('.agario-profile-picture').attr('src', d.localStorage.fbPictureCache))
  1981.         });
  1982.         d.facebookLogin = function () {
  1983.           d.localStorage.wannaLogin = 1
  1984.         };
  1985.         d.fbAsyncInit = function () {
  1986.           function a() {
  1987.             d.localStorage.wannaLogin = 1;
  1988.             null == d.FB ? alert('You seem to have something blocking Facebook on your browser, please check for any extensions')  :
  1989.             d.FB.login(function (a) {
  1990.               ab(a)
  1991.             }, {
  1992.               scope: 'public_profile, email'
  1993.             })
  1994.           }
  1995.           d.FB.init({
  1996.             appId: '677505792353827',
  1997.             cookie: !0,
  1998.             xfbml: !0,
  1999.             status: !0,
  2000.             version: 'v2.2'
  2001.           });
  2002.           d.FB.Event.subscribe('auth.statusChange', function (b) {
  2003.             + d.localStorage.wannaLogin && ('connected' == b.status ? ab(b)  : a())
  2004.           });
  2005.           d.facebookLogin = a
  2006.         };
  2007.         d.logout = function () {
  2008.           D = null;
  2009.           e('#helloContainer').attr('data-logged-in', '0');
  2010.           e('#helloContainer').attr('data-has-account-data', '0');
  2011.           delete d.localStorage.wannaLogin;
  2012.           delete d.localStorage[U];
  2013.           delete d.localStorage.fbPictureCache;
  2014.           M()
  2015.         };
  2016.         var jc = function () {
  2017.           function a(a, b, c, d, e) {
  2018.             var f = b.getContext('2d'),
  2019.             g = b.width;
  2020.             b = b.height;
  2021.             a.color = e;
  2022.             a.t(c);
  2023.             a.size = d;
  2024.             f.save();
  2025.             f.translate(g / 2, b / 2);
  2026.             a.s(f);
  2027.             f.restore()
  2028.           }
  2029.           for (var b = new Z( - 1, 0, 0, 32, '#5bc0de', ''), c = new Z( - 1, 0, 0, 32, '#5bc0de', ''), d = '#0791ff #5a07ff #ff07fe #ffa507 #ff0774 #077fff #3aff07 #ff07ed #07a8ff #ff076e #3fff07 #ff0734 #07ff20 #ff07a2 #ff8207 #07ff0e'.split(' '), f = [
  2030.           ], g = 0; g < d.length; ++g) {
  2031.             var h = g / d.length * 12,
  2032.             l = 30 * Math.sqrt(g / d.length);
  2033.             f.push(new Z( - 1, Math.cos(h) * l, Math.sin(h) * l, 10, d[g], ''))
  2034.           }
  2035.           gc(f);
  2036.           var k = document.createElement('canvas');
  2037.           k.getContext('2d');
  2038.           k.width = k.height = 70;
  2039.           a(c, k, '', 26, '#ebc0de');
  2040.           return function () {
  2041.             e('.cell-spinner').filter(':visible').each(function () {
  2042.               var c = e(this),
  2043.               d = Date.now(),
  2044.               f = this.width,
  2045.               g = this.height,
  2046.               h = this.getContext('2d');
  2047.               h.clearRect(0, 0, f, g);
  2048.               h.save();
  2049.               h.translate(f / 2, g / 2);
  2050.               for (var l = 0; 10 > l; ++l) h.drawImage(k, (0.1 * d + 80 * l) % (f + 140) - f / 2 - 70 - 35, g / 2 * Math.sin((0.001 * d + l) % Math.PI * 2) - 35, 70, 70);
  2051.               h.restore();
  2052.               (c = c.attr('data-itr')) && (c = ga(c));
  2053.               a(b, this, c || '', + e(this).attr('data-size'), '#5bc0de')
  2054.             });
  2055.             e('#statsPellets').filter(':visible').each(function () {
  2056.               e(this);
  2057.               var b = this.width,
  2058.               c = this.height;
  2059.               this.getContext('2d').clearRect(0, 0, b, c);
  2060.               for (b = 0; b < f.length; b++) a(f[b], this, '', f[b].size, f[b].color)
  2061.             })
  2062.           }
  2063.         }();
  2064.         d.createParty = function () {
  2065.           fa(':party');
  2066.           O = function (a) {
  2067.             bb('/#' + d.encodeURIComponent(a));
  2068.             e('.partyToken').val('agar.io/#' + d.encodeURIComponent(a));
  2069.             e('#helloContainer').attr('data-party-state', '1')
  2070.           };
  2071.           M()
  2072.         };
  2073.         d.joinParty = kb;
  2074.         d.cancelParty = function () {
  2075.           bb('/');
  2076.           e('#helloContainer').attr('data-party-state', '0');
  2077.           fa('');
  2078.           M()
  2079.         };
  2080.         var y = [
  2081.         ],
  2082.         Sa = 0,
  2083.         Ta = '#000000',
  2084.         V = !1,
  2085.         Ua = !1,
  2086.         ub = 0,
  2087.         vb = 0,
  2088.         Wa = 0,
  2089.         Va = 0,
  2090.         T = 0,
  2091.         wb = !0;
  2092.         setInterval(function () {
  2093.           Ua && y.push(Db() / 100)
  2094.         }, 1000 / 60);
  2095.         setInterval(function () {
  2096.           var a = ic();
  2097.           0 != a && (++Wa, 0 == T && (T = a), T = Math.min(T, a))
  2098.         }, 1000);
  2099.         d.closeStats = function () {
  2100.           V = !1;
  2101.           e('#stats').hide();
  2102.           mb(d.ab);
  2103.           pa(0)
  2104.         };
  2105.         d.setSkipStats = function (a) {
  2106.           wb = !a
  2107.         };
  2108.         e(function () {
  2109.           e(Nb)
  2110.         })
  2111.       }
  2112.     }
  2113.   }
  2114. }) (window, window.jQuery);
  2115. }
Advertisement
Add Comment
Please, Sign In to add comment