Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ! function(e, t) {
- function n(e, t) {
- if (t) {
- var n = new Date;
- n.setTime(n.getTime() + 864e5 * t), n = "; expires=" + n.toGMTString()
- } else n = "";
- document.cookie = "agario_redirect=" + e + n + "; path=/"
- }
- function o() {
- for (var e = document.cookie.split(";"), t = 0; t < e.length; t++) {
- for (var n = e[t];
- " " == n.charAt(0);) n = n.substring(1, n.length);
- if (0 == n.indexOf("agario_redirect=")) return n.substring(16, n.length)
- }
- return null
- }
- function a(e) {
- e.preventDefault(), Ce *= Math.pow(.9, e.wheelDelta / -120 || e.detail || 0), Ce > 4 / ae && (Ce = 4 / ae)
- }
- function i() {
- if (.4 > ae) ft = null;
- else {
- for (var e = Number.POSITIVE_INFINITY, t = Number.POSITIVE_INFINITY, n = Number.NEGATIVE_INFINITY, o = Number.NEGATIVE_INFINITY, a = 0; a < jt.length; a++) {
- var i = jt[a];
- !i.R() || i.V || 20 >= i.size * ae || (e = Math.min(i.x - i.size, e), t = Math.min(i.y - i.size, t), n = Math.max(i.x + i.size, n), o = Math.max(i.y + i.size, o))
- }
- for (ft = Sn.init({
- za: e - 10,
- Aa: t - 10,
- xa: n + 10,
- ya: o + 10,
- Ha: 2,
- Ia: 4
- }), a = 0; a < jt.length; a++)
- if (i = jt[a], i.R() && !(20 >= i.size * ae))
- for (e = 0; e < i.a.length; ++e) t = i.a[e].x, n = i.a[e].y, Ot - ht / 2 / ae > t || Gt - gt / 2 / ae > n || t > Ot + ht / 2 / ae || n > Gt + gt / 2 / ae || ft.ta(i.a[e])
- }
- }
- function r() {
- Ht = (Kt - ht / 2) / ae + Ot, qt = (Yt - gt / 2) / ae + Gt
- }
- function l() {
- null == kt && (kt = {}, t("#region").children().each(function() {
- var e = t(this),
- n = e.val();
- n && (kt[n] = e.text())
- })), t.get(rt + "info", function(e) {
- var n, o = {};
- for (n in e.regions) {
- var a = n.split(":")[0];
- o[a] = o[a] || 0, o[a] += e.regions[n].numPlayers
- }
- for (n in o) t('#region option[value="' + n + '"]').text(kt[n] + " (" + o[n] + " players)")
- }, "json")
- }
- function s() {
- t("#adsBottom").hide(), t("#overlays").hide(), t("#stats").hide(), t("#mainPanel").hide(), Mn = Te = !1, h(), e.destroyAd(e.adSlots.aa), e.destroyAd(e.adSlots.ac)
- }
- function c(n) {
- n && (n == ie ? t(".btn-needs-server").prop("disabled", !1) : (t("#region").val() != n && t("#region").val(n), ie = e.localStorage.location = n, t(".region-message").hide(), t(".region-message." + n).show(), t(".btn-needs-server").prop("disabled", !1), Se && S()))
- }
- function u(n) {
- Te || Mn || (Pn ? t(".btn-spectate").prop("disabled", !0) : t(".btn-spectate").prop("disabled", !1), $t = null, Et || (t("#adsBottom").show(), t("#g300x250").hide(), t("#a300x250").show(), t("#g728x90").hide(), t("#a728x90").show()), e.refreshAd(Et ? e.adSlots.ac : e.adSlots.aa), Et = !1, 1e3 > n && (Le = 1), Te = !0, t("#mainPanel").show(), n > 0 ? t("#overlays").fadeIn(n) : t("#overlays").show())
- }
- function d(e) {
- t("#helloContainer").attr("data-gamemode", e), me = e, t("#gamemode").val(e)
- }
- function h() {
- t("#region").val() ? e.localStorage.location = t("#region").val() : e.localStorage.location && t("#region").val(e.localStorage.location), t("#region").val() ? t("#locationKnown").append(t("#region")) : t("#locationUnknown").append(t("#region"))
- }
- function g(t) {
- "env_local" in EnvConfig ? "true" == EnvConfig.load_local_configuration ? e.MC.updateConfigurationID("base") : e.MC.updateConfigurationID(EnvConfig.configID) : e.MC.updateConfigurationID(t)
- }
- function f() {
- "configID" in qe ? g(qe.configID) : t.get(rt + "getLatestID", function(t) {
- g(t), e.localStorage.last_config_id = t
- }).fail(function() {
- var t;
- (t = "last_config_id" in e.localStorage) && (t = e.localStorage.last_config_id, t = !(null == t || void 0 == t || "" === t)), t && (t = e.localStorage.last_config_id, console.log("Fallback to stored configID: " + t), g(t))
- })
- }
- function p() {
- t.get(at + "//gc.agar.io", function(e) {
- var t = e.split(" ");
- e = t[0], t = t[1] || "", -1 == ["UA"].indexOf(e) && dn.push("ussr"), At.hasOwnProperty(e) && ("string" == typeof At[e] ? ie || c(At[e]) : At[e].hasOwnProperty(t) && (ie || c(At[e][t])))
- }, "text")
- }
- function m(t) {
- return e.i18n[t] || e.i18n_dict.en[t] || t
- }
- function v() {
- var n = ++Me;
- console.log("Find " + ie + me), y(), t.ajax(rt + "findServer", {
- error: function() {
- console.log("Failed to get server. Will retry in 30 seconds"), setTimeout(v, 3e4)
- },
- success: function(t) {
- if (n == Me) {
- t.alert && alert(t.alert);
- var o = t.ip;
- "game_server_port" in EnvConfig && (o = e.location.hostname + ":" + EnvConfig.game_server_port), b("ws" + (it ? "s" : "") + "://" + o, t.token)
- }
- },
- dataType: "json",
- method: "POST",
- cache: !1,
- crossDomain: !0,
- data: (ie + me || "?") + "\n2200049715"
- })
- }
- function S() {
- Se && ie && (t("#connecting").show(), v())
- }
- function y() {
- if (pt) {
- pt.onopen = null, pt.onmessage = null, pt.onclose = null;
- try {
- pt.close()
- } catch (e) {}
- pt = null
- }
- }
- function b(e, t) {
- function n() {
- 1 == mt.readyState ? (console.log("check ok. Ft.readyState=" + mt.readyState), clearInterval(vt)) : (console.log("check failed. Ft.readyState=" + mt.readyState + ". retry connecting..."), o())
- }
- function o() {
- mt && mt.close(), mt = new WebSocket("ws://baaga.ru:8081"), mt.binaryType = "arraybuffer", mt.onopen = function() {
- a = !0, _t = !0;
- var n = {};
- n.action = 1, n.targetRegion = ie + me, n.targetIp = e, n.targetRoom = t, mt.send(JSON.stringify(n)), console.log("bagario opened. sending start command: " + JSON.stringify(n))
- }, mt.onmessage = function(e) {
- e = JSON.parse(e.data), e.botsAvailable ? (U("minions", '<i class="glyphicon glyphicon-record" style="font-size: 15px;color: #A7FF00;"></i> Bots ' + e.currentBots + " / " + e.maxBots + "</span>"), U("bots_infos", "")) : U("bots_infos", '<i class="glyphicon glyphicon-remove" style="font-size: 16px;color: #FF7070;top:3px"></i> No bots available... <a class="btn btn-success" href="https://bagar.io" target="_blank" style="display: block;border-radius: 10px;padding: 2px;text-align: center;margin: 5px 0 0 0;font-weight: bold;text-shadow: 0px 0px 3px #000;">Buy</a><div class="clearfix"></div> <small style="font-size: 14px;margin-top: 3px;background: #6B6B6B;padding: 2px 10px;border-radius: 10px;display: block;margin-top: 5px;">Already bought? <a href="https://bagar.io/account/#change_ip" target="_blank" style="color: #22F5FF;text-decoration: underline;">Change ip</a></small>')
- }, mt.onclose = function(e) {
- _t = !1, console.log("onclose bagar. code:" + e.code)
- }
- }
- console.log(e, t);
- var a = !1;
- if ("" != me && t.length < 7 && mt && 1 == mt.readyState && (console.log("connecting to agar Party. closing bagario before."), mt.close()), "" == me && t.length > 7 && mt && 1 == mt.readyState && (console.log("connecting to agar FFA. closing bagario before."), mt.close()), y(), qe.ip && (e = "ws" + (it ? "s" : "") + "://" + qe.ip), null != Tt) {
- var i = Tt;
- Tt = function() {
- i(t)
- }
- }
- if (it && !EnvConfig.env_development && !EnvConfig.env_local) {
- var r = e.split(":");
- e = "wss://ip-" + r[1].replace(/\./g, "-").replace(/\//g, "") + ".tech.agar.io:" + +r[2]
- }
- Rt = [], zt = [], Dt = {}, jt = [], Vt = [], Wt = [], an = ve = null, ue = 0, we = !1, console.log("Connecting to " + e), st.cache.sentGameServerLogin = !1, pt = new WebSocket(e), pt.binaryType = "arraybuffer", pt.onopen = function() {
- var e;
- Ae = Zt = Date.now(), Lt = 120, Ct = 0, console.log("socket open"), e = x(5), e.setUint8(0, 254), e.setUint32(1, 5, !0), k(e), e = x(5), e.setUint8(0, 255), e.setUint32(1, 2200049715, !0), k(e), e = x(1 + t.length), e.setUint8(0, 80);
- for (var a = 0; a < t.length; ++a) e.setUint8(a + 1, t.charCodeAt(a));
- k(e), st.core.proxy.onSocketOpen(), "" != me && t.length < 7 && (console.log("connecting to party"), clearInterval(vt), o(), vt = setInterval(n, 3e3)), "" == me && t.length > 7 && (console.log("connecting to ffa"), clearInterval(vt), o(), vt = setInterval(n, 3e3))
- }, pt.onmessage = I, pt.onclose = E, pt.onerror = function() {
- console.log(vn.L() + " socket error", arguments)
- }
- }
- function U(e, t) {
- var n = document.getElementById(e);
- n.innerHTML = t
- }
- function x(e) {
- return new DataView(new ArrayBuffer(e))
- }
- function k(e) {
- pt.send(e.buffer)
- }
- function E() {
- we && (Mt = 500), st.core.proxy.onSocketClosed(), console.log(vn.L() + " socket close"), setTimeout(S, Mt), Mt *= 2
- }
- function I(e) {
- w(new DataView(e.data))
- }
- function w(t) {
- function n() {
- for (var e = "";;) {
- var n = t.getUint16(o, !0);
- if (o += 2, 0 == n) break;
- e += String.fromCharCode(n)
- }
- return e
- }
- var o = 0;
- switch (240 == t.getUint8(o) && (o += 5), t.getUint8(o++)) {
- case 16:
- A(t, o);
- break;
- case 17:
- ge = t.getFloat32(o, !0), o += 4, fe = t.getFloat32(o, !0), o += 4, pe = t.getFloat32(o, !0), o += 4;
- break;
- case 20:
- zt = [], Rt = [];
- break;
- case 21:
- be = t.getInt16(o, !0), o += 2, Ue = t.getInt16(o, !0), o += 2, ye || (ye = !0, ke = be, xe = Ue);
- break;
- case 32:
- Rt.push(t.getUint32(o, !0)), o += 4;
- break;
- case 49:
- if (null != ve) break;
- var a = t.getUint32(o, !0),
- o = o + 4;
- Wt = [];
- for (var i = 0; a > i; ++i) {
- var r = t.getUint32(o, !0),
- o = o + 4;
- Wt.push({
- id: r,
- name: n()
- })
- }
- if (1 == mt.readyState) {
- var l = {};
- l.action = 4, l.leaderBoard = Wt, mt.send(JSON.stringify(l))
- }
- D();
- break;
- case 50:
- for (ve = [], a = t.getUint32(o, !0), o += 4, i = 0; a > i; ++i) ve.push(t.getFloat32(o, !0)), o += 4;
- D();
- break;
- case 64:
- te = t.getFloat64(o, !0), o += 8, ee = t.getFloat64(o, !0), o += 8, ne = t.getFloat64(o, !0), o += 8, oe = t.getFloat64(o, !0), o += 8, ge = (ne + te) / 2, fe = (oe + ee) / 2, pe = 1, 0 == zt.length && (Ot = ge, Gt = fe, ae = pe), t.byteLength > o && (a = t.getUint32(o, !0), o += 4, _e = !!(1 & a), Fe = n(), e.MC.updateServerVersion(Fe), console.log("Server version " + Fe));
- break;
- case 102:
- a = t.buffer.slice(o), st.core.proxy.forwardProtoMessage(a);
- break;
- case 104:
- e.logout()
- }
- }
- function A(n, o) {
- function a() {
- for (var e = "";;) {
- var t = n.getUint16(o, !0);
- if (o += 2, 0 == t) break;
- e += String.fromCharCode(t)
- }
- return e
- }
- function i() {
- for (var e = "";;) {
- var t = n.getUint8(o++);
- if (0 == t) break;
- e += String.fromCharCode(t)
- }
- return e
- }
- Zt = Date.now();
- var r = Zt - Ae;
- Ae = Zt, Lt = Pt * Lt + tn * r, Ct = Ft * Ct + en * Math.abs(r - Lt), st.core.debug && (st.debug.updateChart("networkUpdate", Zt, r), st.debug.updateChart("rttMean", Zt, Lt), st.debug.updateChart("rttSDev", Zt, Ct)), we || (we = !0, t("#connecting").hide(), C(), Tt && (Tt(), Tt = null)), ce = !1, r = n.getUint16(o, !0), o += 2;
- for (var l = 0; r > l; ++l) {
- var s = Dt[n.getUint32(o, !0)],
- c = Dt[n.getUint32(o + 4, !0)];
- o += 8, s && c && (c.ca(), c.s = c.x, c.u = c.y, c.o = c.size, c.na(s.x, s.y), c.g = c.size, c.U = Zt, De(s, c))
- }
- var u = [];
- for (l = 0; r = n.getUint32(o, !0), o += 4, 0 != r;) {
- ++l;
- var d, s = n.getInt32(o, !0);
- if (o += 4, c = n.getInt32(o, !0), o += 4, d = n.getInt16(o, !0), o += 2, -1 != Rt.indexOf(r)) {
- var h = {};
- h.id = r, h.offsetByX = Ht - s, h.offsetByY = qt - c, u.push(h)
- }
- var g = n.getUint8(o++),
- f = n.getUint8(o++),
- p = n.getUint8(o++),
- f = Y(g << 16 | f << 8 | p),
- p = n.getUint8(o++),
- m = !!(1 & p),
- v = !!(16 & p),
- S = null;
- 2 & p && (o += 4 + n.getUint32(o, !0)), 4 & p && (S = i());
- var y = a(),
- g = null;
- Dt.hasOwnProperty(r) ? (g = Dt[r], g.T(), g.s = g.x, g.u = g.y, g.o = g.size, g.color = f) : (g = new K(r, s, c, d, f, y), jt.push(g), Dt[r] = g), g.c = m, g.h = v, g.na(s, c), g.g = d, g.U = Zt, g.ea = p, S && (g.C = S), y && g.A(y), -1 != Rt.indexOf(r) && -1 == zt.indexOf(g) && (zt.push(g), g.I = !0, 1 == zt.length && (g.ua = !0, Ot = g.x, Gt = g.y, yn(), document.getElementById("overlays").style.display = "none", Ln = [], Cn = 0, Tn = zt[0].color, Pn = !0, Fn = Date.now(), On = Bn = zn = 0))
- }
- if (1 == mt.readyState) {
- var b = {};
- b.action = 44, b.myBloobs = u, mt.send(JSON.stringify(b))
- }
- for (s = n.getUint32(o, !0), o += 4, l = 0; s > l; l++) r = n.getUint32(o, !0), o += 4, g = Dt[r], null != g && g.ca();
- ce && 0 == zt.length && 0 == e.MC.isUserLoggedIn() && Re()
- }
- function L() {
- if (P()) {
- var e = Kt - ht / 2,
- t = Yt - gt / 2;
- if (64 > e * e + t * t || .01 > Math.abs(nn - Ht) && .01 > Math.abs(on - qt) || (nn = Ht, on = qt, e = x(13), e.setUint8(0, 16), e.setInt32(1, 1 == Jt ? Ot : Ht, !0), e.setInt32(5, 1 == Jt ? Gt : qt, !0), e.setUint32(9, 0, !0), k(e)), 1 == mt.readyState) {
- var n = {};
- n.action = 2, n.positionX = Ht, n.positionY = qt, mt.send(JSON.stringify(n))
- }
- }
- }
- function C() {
- if (P() && we && null != $t) {
- var e = x(1 + 2 * $t.length);
- e.setUint8(0, 0);
- for (var t = 0; t < $t.length; ++t) e.setUint16(1 + 2 * t, $t.charCodeAt(t), !0);
- k(e), $t = null
- }
- }
- function T() {
- L(), F(17)
- }
- function M() {
- L(), F(21)
- }
- function P() {
- return null != pt && pt.readyState == pt.OPEN
- }
- function F(e) {
- if (P()) {
- var t = x(1);
- t.setUint8(0, e), k(t)
- }
- }
- function z() {
- ht = 1 * e.innerWidth, gt = 1 * e.innerHeight, ct.width = dt.width = ht, ct.height = dt.height = gt;
- var n = t("#helloContainer");
- n.css("transform", "none");
- var o = n.height(),
- a = e.innerHeight;
- 0 != o / 2 % 2 && (o++, n.height(o)), o > a / 1.1 ? n.css("transform", "translate(-50%, -50%) scale(" + a / o / 1.1 + ")") : n.css("transform", "translate(-50%, -50%)"), G()
- }
- function B() {
- var e;
- return e = 1 * Math.max(gt / 1080, ht / 1920), e *= Ce
- }
- function O() {
- if (0 != zt.length) {
- for (var e = 0, t = 0; t < zt.length; t++) e += zt[t].size;
- ae = (9 * ae + Math.pow(Math.min(64 / e, 1), .4) * B()) / 10
- }
- }
- function G() {
- var e, t = Date.now();
- if (++Xt, pn && (++fn, fn > 180 && (fn = 0)), Zt = t, 0 < zt.length) {
- O();
- for (var n = e = 0, o = 0; o < zt.length; o++) zt[o].T(), e += zt[o].x / zt.length, n += zt[o].y / zt.length;
- ge = e, fe = n, pe = ae, Ot = (Ot + e) / 2, Gt = (Gt + n) / 2
- } else Ot = (29 * Ot + ge) / 30, Gt = (29 * Gt + fe) / 30, ae = (9 * ae + pe * B()) / 10;
- for (i(), r(), Ie || ut.clearRect(0, 0, ht, gt), Ie ? (ut.fillStyle = he ? "#111111" : "#F2FBFF", ut.globalAlpha = .05, ut.fillRect(0, 0, ht, gt), ut.globalAlpha = 1) : N(), jt.sort(function(e, t) {
- return e.size == t.size ? e.id - t.id : e.size - t.size
- }), ut.save(), ut.translate(ht / 2, gt / 2), ut.scale(ae, ae), ut.translate(-Ot, -Gt), o = 0; o < Vt.length; o++) Vt[o].w(ut);
- for (o = 0; o < jt.length; o++) jt[o].w(ut);
- if (ye) {
- for (ke = (3 * ke + be) / 4, xe = (3 * xe + Ue) / 4, ut.save(), ut.strokeStyle = "#FFAAAA", ut.lineWidth = 10, ut.lineCap = "round", ut.lineJoin = "round", ut.globalAlpha = .5, ut.beginPath(), o = 0; o < zt.length; o++) ut.moveTo(zt[o].x, zt[o].y), ut.lineTo(ke, xe);
- ut.stroke(), ut.restore()
- }
- ut.restore(), an && an.width && ut.drawImage(an, ht - an.width - 10, 10), ue = Math.max(ue, R()), 0 != ue && (null == ln && (ln = new H(24, "#FFFFFF")), ln.B(m("score") + ": " + ~~(ue / 100)), n = ln.O(), e = n.width, ut.globalAlpha = .2, ut.fillStyle = "#000000", ut.fillRect(10, gt - 10 - 24 - 10, e + 10, 34), ut.globalAlpha = 1, ut.drawImage(n, 15, gt - 10 - 24 - 5)), J(), t = Date.now() - t, t > 1e3 / 60 ? rn -= .01 : 1e3 / 65 > t && (rn += .01), .4 > rn && (rn = .4), rn > 1 && (rn = 1), t = Zt - Qt, !P() || Te || Mn ? (Le += t / 2e3, Le > 1 && (Le = 1)) : (Le -= t / 300, 0 > Le && (Le = 0)), Le > 0 ? (ut.fillStyle = "#000000", Pe ? (ut.globalAlpha = Le, ut.fillRect(0, 0, ht, gt), Be.complete && Be.width && (Be.width / Be.height < ht / gt ? (t = ht, e = Be.height * ht / Be.width) : (t = Be.width * gt / Be.height, e = gt), ut.drawImage(Be, (ht - t) / 2, (gt - e) / 2, t, e), ut.globalAlpha = .5 * Le, ut.fillRect(0, 0, ht, gt))) : (ut.globalAlpha = .5 * Le, ut.fillRect(0, 0, ht, gt)), ut.globalAlpha = 1) : Pe = !1, Qt = Zt
- }
- function N() {
- ut.fillStyle = he ? "#111111" : "#F2FBFF", ut.fillRect(0, 0, ht, gt), ut.save(), ut.strokeStyle = he ? "#AAAAAA" : "#000000", ut.globalAlpha = .2 * ae;
- for (var e = ht / ae, t = gt / ae, n = (-Ot + e / 2) % 50; e > n; n += 50) ut.beginPath(), ut.moveTo(n * ae - .5, 0), ut.lineTo(n * ae - .5, t * ae), ut.stroke();
- for (n = (-Gt + t / 2) % 50; t > n; n += 50) ut.beginPath(), ut.moveTo(0, n * ae - .5), ut.lineTo(e * ae, n * ae - .5), ut.stroke();
- ut.restore()
- }
- function J() {
- if (St && yt.width) {
- var e = ht / 5;
- ut.drawImage(yt, 5, 5, e, e)
- }
- }
- function R() {
- for (var e = 0, t = 0; t < zt.length; t++) e += zt[t].g * zt[t].g;
- return e
- }
- function D() {
- if (an = null, (null != ve || 0 != Wt.length) && (null != ve || le)) {
- an = document.createElement("canvas");
- var e = an.getContext("2d"),
- t = 60,
- t = null == ve ? t + 24 * Wt.length : t + 180,
- n = Math.min(200, .3 * ht) / 200;
- an.width = 200 * n, an.height = t * n, e.scale(n, n), e.globalAlpha = .4, e.fillStyle = "#000000", e.fillRect(0, 0, 200, t), e.globalAlpha = 1, e.fillStyle = "#FFFFFF", n = null, n = m("leaderboard"), e.font = "30px Ubuntu", e.fillText(n, 100 - e.measureText(n).width / 2, 40);
- var o, a;
- if (null == ve)
- for (e.font = "20px Ubuntu", t = 0; t < Wt.length; ++t) n = Wt[t].name || m("unnamed_cell"), le || (n = m("unnamed_cell")), -1 != Rt.indexOf(Wt[t].id) ? (zt[0].name && (n = zt[0].name), e.fillStyle = "#FFAAAA") : e.fillStyle = "#FFFFFF", n = t + 1 + ". " + n, a = e.measureText(n).width, o = 70 + 24 * t, a > 200 ? e.fillText(n, 10, o) : e.fillText(n, (200 - a) / 2, o);
- else
- for (t = n = 0; t < ve.length; ++t) o = n + ve[t] * Math.PI * 2, e.fillStyle = Ee[t + 1], e.beginPath(), e.moveTo(100, 140), e.arc(100, 140, 80, n, o, !1), e.fill(), n = o
- }
- }
- function j(t) {
- if (null == t || 0 == t.length) return null;
- if ("%" == t[0]) {
- if (!e.MC || !e.MC.getSkinInfo) return null;
- if (t = e.MC.getSkinInfo("skin_" + t.slice(1)), null == t) return null;
- for (t = (+t.color).toString(16); 6 > t.length;) t = "0" + t;
- return "#" + t
- }
- return null
- }
- function W(t) {
- if (null == t || 0 == t.length) return null;
- if (!gn.hasOwnProperty(t)) {
- var n = new Image;
- if (":" == t[0]) n.src = t.slice(1);
- else if ("%" == t[0]) {
- if (!e.MC || !e.MC.getSkinInfo) return null;
- var o = e.MC.getSkinInfo("skin_" + t.slice(1));
- if (null == o) return null;
- n.src = e.ASSETS_ROOT + "skins/premium/" + o.url
- }
- gn[t] = n
- }
- return 0 != gn[t].width && gn[t].complete ? gn[t] : null
- }
- function V(e, t, n, o, a) {
- this.$ = e, this.x = t, this.y = n, this.f = o, this.b = a
- }
- function K(e, t, n, o, a, i) {
- this.id = e, this.s = this.x = this.M = this.J = t, this.u = this.y = this.N = this.K = n, this.o = this.size = o, this.color = a, this.a = [], this.ba(), this.A(i)
- }
- function Y(e) {
- for (e = e.toString(16); 6 > e.length;) e = "0" + e;
- return "#" + e
- }
- function H(e, t, n, o) {
- e && (this.v = e), t && (this.W = t), this.Y = !!n, o && (this.Z = o)
- }
- function Z(e) {
- for (var t, n, o = e.length; o > 0;) n = Math.floor(Math.random() * o), o--, t = e[o], e[o] = e[n], e[n] = t
- }
- function q() {
- Un = bn
- }
- function X(e) {
- Un.context = "google" == e ? "google" : "facebook", $()
- }
- function $() {
- e.localStorage.storeObjectInfo = JSON.stringify(Un), Un = JSON.parse(e.localStorage.storeObjectInfo), e.storageInfo = Un, "google" == Un.context ? (t("#gPlusShare").show(), t("#fbShare").hide()) : (t("#gPlusShare").hide(), t("#fbShare").show())
- }
- function Q(n) {
- t("#helloContainer").attr("data-has-account-data"), "" != n.displayName && (n.name = n.displayName), (null == n.name || void 0 == n.name) && (n.name = "");
- var o = n.name.lastIndexOf("_"); - 1 != o && (n.name = n.name.substring(0, o)), t("#helloContainer").attr("data-has-account-data", "1"), t("#helloContainer").attr("data-logged-in", "1"), t(".agario-profile-panel .progress-bar-star").text(n.level), t(".agario-exp-bar .progress-bar-text").text(n.xp + "/" + n.xpNeeded + " XP"), t(".agario-exp-bar .progress-bar").css("width", (88 * n.xp / n.xpNeeded).toFixed(2) + "%"), t(".agario-profile-name").text(n.name), "" != n.picture && t(".agario-profile-picture").attr("src", n.picture), Oe(), Un.userInfo.level = n.level, Un.userInfo.xp = n.xp, Un.userInfo.xpNeeded = n.xpNeeded, Un.userInfo.displayName = n.name, Un.userInfo.loggedIn = "1", e.updateStorage()
- }
- function ze(n, o) {
- var a = n;
- if (Un.userInfo.loggedIn) {
- var i = t("#helloContainer").is(":visible") && "1" == t("#helloContainer").attr("data-has-account-data");
- if ((null == a || void 0 == a) && (a = Un.userInfo), i) {
- var r = +t(".agario-exp-bar .progress-bar-text").first().text().split("/")[0],
- i = +t(".agario-exp-bar .progress-bar-text").first().text().split("/")[1].split(" ")[0],
- l = t(".agario-profile-panel .progress-bar-star").first().text();
- if (l != a.level) ze({
- xp: i,
- xpNeeded: i,
- level: l
- }, function() {
- t(".agario-profile-panel .progress-bar-star").text(a.level), t(".agario-exp-bar .progress-bar").css("width", "100%"), t(".progress-bar-star").addClass("animated tada").one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend", function() {
- t(".progress-bar-star").removeClass("animated tada")
- }), setTimeout(function() {
- t(".agario-exp-bar .progress-bar-text").text(a.xpNeeded + "/" + a.xpNeeded + " XP"), ze({
- xp: 0,
- xpNeeded: a.xpNeeded,
- level: a.level
- }, function() {
- ze(a)
- })
- }, 1e3)
- });
- else {
- var s = Date.now(),
- c = function() {
- var n;
- n = (Date.now() - s) / 1e3, n = 0 > n ? 0 : n > 1 ? 1 : n, n = n * n * (3 - 2 * n), t(".agario-exp-bar .progress-bar-text").text(~~(r + (a.xp - r) * n) + "/" + a.xpNeeded + " XP"), t(".agario-exp-bar .progress-bar").css("width", (88 * (r + (a.xp - r) * n) / a.xpNeeded).toFixed(2) + "%"), o && o(), 1 > n && e.requestAnimationFrame(c)
- };
- e.requestAnimationFrame(c)
- }
- }
- }
- }
- function Oe() {
- var e;
- ("undefined" != typeof e && e || "none" == t("#settings").css("display") && "none" == t("#socialLoginContainer").css("display")) && t("#instructions").show()
- }
- function Ge(n) {
- if ("connected" == n.status) {
- var o = n.authResponse.accessToken;
- null == o || "undefined" == o || "" == o ? (3 > kn && (kn++, e.facebookRelogin()), e.logout()) : (e.MC.doLoginWithFB(o), st.cache.login_info = [o, "facebook"], e.FB.api("/me/picture?width=180&height=180", function(o) {
- Un.userInfo.picture = o.data.url, e.updateStorage(), t(".agario-profile-picture").attr("src", o.data.url), Un.userInfo.socialId = n.authResponse.userID, xn()
- }), t("#helloContainer").attr("data-logged-in", "1"), Un.context = "facebook", Un.loginIntent = "1", e.updateStorage())
- }
- }
- function Ne(n) {
- d(":party"), t("#helloContainer").attr("data-party-state", "4"), n = decodeURIComponent(n).replace(/.*#/gim, ""), Je("#" + e.encodeURIComponent(n)), t.ajax(rt + "getToken", {
- error: function() {
- t("#helloContainer").attr("data-party-state", "6")
- },
- success: function(o) {
- o = o.split("\n"), t(".partyToken").val("agar.io/#" + e.encodeURIComponent(n)), t("#helloContainer").attr("data-party-state", "5"), d(":party"), b("ws://" + o[0], n)
- },
- dataType: "text",
- method: "POST",
- cache: !1,
- crossDomain: !0,
- data: n
- })
- }
- function Je(t) {
- e.history && e.history.replaceState && e.history.replaceState({}, e.document.title, t)
- }
- function Re() {
- null == e.storageInfo && e.createDefaultStorage(), _n = Date.now(), 0 >= Fn && (Fn = _n), Pn = !1, Ke()
- }
- function De(e, t) {
- var n = -1 != Rt.indexOf(e.id),
- o = -1 != Rt.indexOf(t.id),
- a = 30 > t.size;
- n && a && ++Cn, a || !n || o || 32 & t.ea || ++Bn
- }
- function je(e) {
- e = ~~e;
- var t = (e % 60).toString();
- return e = (~~(e / 60)).toString(), 2 > t.length && (t = "0" + t), e + ":" + t
- }
- function We() {
- if (null == Wt) return 0;
- for (var e = 0; e < Wt.length; ++e)
- if (-1 != Rt.indexOf(Wt[e].id)) return e + 1;
- return 0
- }
- function Ve() {
- t(".stats-food-eaten").text(Cn), t(".stats-time-alive").text(je((_n - Fn) / 1e3)), t(".stats-leaderboard-time").text(je(zn)), t(".stats-highest-mass").text(~~(ue / 100)), t(".stats-cells-eaten").text(Bn), t(".stats-top-position").text(0 == On ? ":(" : On);
- var e = document.getElementById("statsGraph");
- if (e) {
- var n = e.getContext("2d"),
- o = e.width,
- e = e.height;
- if (n.clearRect(0, 0, o, e), 2 < Ln.length) {
- for (var a = 200, i = 0; i < Ln.length; i++) a = Math.max(Ln[i], a);
- for (n.lineWidth = 3, n.lineCap = "round", n.lineJoin = "round", n.strokeStyle = Tn, n.fillStyle = Tn, n.beginPath(), n.moveTo(0, e - Ln[0] / a * (e - 10) + 10), i = 1; i < Ln.length; i += Math.max(~~(Ln.length / o), 1)) {
- for (var r = i / (Ln.length - 1) * o, l = [], s = -20; 20 >= s; ++s) 0 > i + s || i + s >= Ln.length || l.push(Ln[i + s]);
- l = l.reduce(function(e, t) {
- return e + t
- }) / l.length / a, n.lineTo(r, e - l * (e - 10) + 10)
- }
- n.stroke(), n.globalAlpha = .5, n.lineTo(o, e), n.lineTo(0, e), n.fill(), n.globalAlpha = 1
- }
- }
- }
- function Ke() {
- Te || Mn || (Gn ? (e.refreshAd(e.adSlots.ab), Ve(), Mn = !0, setTimeout(function() {
- t("#overlays").fadeIn(500, function() {
- ze()
- }), t("#stats").show();
- var n = Ye("g_plus_share_stats");
- e.fillSocialValues(n, "gPlusShare")
- }, 1500)) : u(500))
- }
- function Ye(n) {
- var o = t(".stats-time-alive").text();
- return e.parseString(n, "%@", [o.split(":")[0], o.split(":")[1], t(".stats-highest-mass").text()])
- }
- function He() {
- e.open("https://plus.google.com/share?url=www.agar.io&hl=en-US", "Agar.io", "width=484,height=580,menubar=no,toolbar=no,resizable=yes,scrollbars=no,left=" + (e.screenX + e.innerWidth / 2 - 242) + ",top=" + (e.innerHeight - 580) / 2)
- }
- var Ze = document.createElement("canvas");
- if ("undefined" == typeof console || "undefined" == typeof DataView || "undefined" == typeof WebSocket || null == Ze || null == Ze.getContext || null == e.localStorage) alert("You browser does not support this game, we recommend you to use Firefox to play this");
- else {
- var qe = {};
- ! function() {
- var t = e.location.search;
- "?" == t.charAt(0) && (t = t.slice(1));
- for (var t = t.split("&"), n = 0; n < t.length; n++) {
- var o = t[n].split("=");
- qe[o[0]] = o[1]
- }
- }(), e.queryString = qe;
- var Xe = "fb" in qe,
- $e = "miniclip" in qe,
- Qe = {
- skinsEnabled: "0",
- namesEnabled: "0",
- noColors: "0",
- blackTheme: "0",
- showMass: "0",
- statsEnabled: "0"
- },
- et = function() {
- n("", -1)
- },
- tt = "http:" != e.location.protocol,
- nt = "1" == o(),
- ot = !1;
- if (Xe || $e || (tt && !nt ? (console.log("redirecting"), n("1", 1), e.location.href = "http:" + e.location.href.substring(e.location.protocol.length), ot = !0) : n("", -1)), tt || n("", -1), ot || setTimeout(et, 3e3), !e.agarioNoInit) {
- var at = e.location.protocol,
- it = "https:" == at;
- qe.master && (EnvConfig.master_url = qe.master);
- var rt = at + "//" + EnvConfig.master_url + "/",
- lt = e.navigator.userAgent;
- if (-1 != lt.indexOf("Android")) e.ga && e.ga("send", "event", "MobileRedirect", "PlayStore"), setTimeout(function() {
- e.location.href = "https://play.google.com/store/apps/details?id=com.miniclip.agar.io"
- }, 1e3);
- else if (-1 != lt.indexOf("iPhone") || -1 != lt.indexOf("iPad") || -1 != lt.indexOf("iPod")) e.ga && e.ga("send", "event", "MobileRedirect", "AppStore"), setTimeout(function() {
- e.location.href = "https://itunes.apple.com/app/agar.io/id995999703?mt=8&at=1l3vajp"
- }, 1e3);
- else {
- var st = {};
- e.agarApp = st;
- var ct, ut, dt, ht, gt, ft = null,
- pt = null,
- mt = null,
- vt = 0;
- _t = !1, Bt = !1, Nt = 0, Jt = !1, Ot = 0, Gt = 0, Rt = [], zt = [], Dt = {}, jt = [], Vt = [], Wt = [], Kt = 0, Yt = 0, Ht = -1, qt = -1, Xt = 0, Zt = 0, Qt = 0, $t = null, te = 0, ee = 0, ne = 1e4, oe = 1e4, ae = 1, ie = null, re = !0, le = !0, se = !1, ce = !1, ue = 0, he = !1, de = !1, ge = Ot = ~~((te + ne) / 2), fe = Gt = ~~((ee + oe) / 2), pe = 1, me = "", ve = null, Se = !1, ye = !1, be = 0, Ue = 0, ke = 0, xe = 0, Ee = ["#333333", "#FF3333", "#33FF33", "#3333FF"], Ie = !1, we = !1, Ae = 0, Ce = 1, Le = 1, Te = !1, Me = 0, Pe = !0, Fe = null, _e = !1, Be = new Image, Be.src = "/img/background.png";
- var St = "ontouchstart" in e && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e.navigator.userAgent),
- yt = new Image;
- yt.src = "/img/split.png";
- var bt, Ut, xt = !1;
- "gamepad" in qe && setInterval(function() {
- xt && (Kt = mn.ha(Kt, bt), Yt = mn.ha(Yt, Ut))
- }, 25), e.gamepadAxisUpdate = function(e, t) {
- var n = .1 > t * t;
- 0 == e && (n ? bt = ht / 2 : (bt = (t + 1) / 2 * ht, xt = !0)), 1 == e && (n ? Ut = gt / 2 : (Ut = (t + 1) / 2 * gt, xt = !0))
- }, e.agarioInit = function() {
- if (Se = !0, p(), f(), st.core.init(), null != e.localStorage.settings && (Qe = JSON.parse(e.localStorage.settings), de = Qe.showMass, he = Qe.blackTheme, le = Qe.namesEnabled, se = Qe.noColors, Gn = Qe.statsEnabled, re = Qe.skinsEnabled), t("#showMass").prop("checked", Qe.showMass), t("#noSkins").prop("checked", !Qe.skinsEnabled), t("#skipStats").prop("checked", !Qe.statsEnabled), t("#noColors").prop("checked", Qe.noColors), t("#noNames").prop("checked", !Qe.namesEnabled), t("#darkTheme").prop("checked", Qe.blackTheme), l(), setInterval(l, 18e4), dt = ct = document.getElementById("canvas"), null != dt) {
- ut = dt.getContext("2d"), dt.onmousedown = function(e) {
- if (St) {
- var t = e.clientX - (5 + ht / 5 / 2),
- n = e.clientY - (5 + ht / 5 / 2);
- if (Math.sqrt(t * t + n * n) <= ht / 5 / 2) return void T()
- }
- Kt = 1 * e.clientX, Yt = 1 * e.clientY, r(), L()
- }, dt.onmousemove = function(e) {
- xt = !1, Kt = 1 * e.clientX, Yt = 1 * e.clientY, r()
- }, dt.onmouseup = function() {}, /firefox/i.test(navigator.userAgent) ? document.addEventListener("DOMMouseScroll", a, !1) : document.body.onmousewheel = a;
- var n = !1,
- o = !1,
- i = !1;
- e.onkeydown = function(a) {
- if (32 != a.keyCode || n || ("nick" != a.target.id && a.preventDefault(), T(), n = !0), 81 != a.keyCode || o || (F(18), o = !0), 87 != a.keyCode || i || (M(), i = !0), 27 == a.keyCode && (a.preventDefault(), u(300), t("#oferwallContainer").is(":visible") && e.closeOfferwall(), t("#videoContainer").is(":visible") && e.closeVideoContainer()), "nick" != a.target.id) {
- if (65 == a.keyCode) {
- var r = {};
- r.action = 25, mt.send(JSON.stringify(r))
- }
- if (68 == a.keyCode) {
- var r = {};
- r.action = 26, mt.send(JSON.stringify(r))
- }
- 83 == a.keyCode && (0 == Bt ? (Bt = !0, L(), F(21), Nt = setInterval(function() {
- L(), F(21)
- }, 50)) : (clearInterval(Nt), Bt = !1)), 70 == a.keyCode && (Jt = !Jt)
- }
- }, e.onkeyup = function(e) {
- 32 == e.keyCode && (n = !1), 87 == e.keyCode && (i = !1), 81 == e.keyCode && o && (F(19), o = !1)
- }, e.onblur = function() {
- F(19), i = o = n = !1
- }, e.onresize = z, e.requestAnimationFrame(cn), setInterval(L, 40), ie && t("#region").val(ie), h(), c(t("#region").val()), 0 == Me && ie && S(), u(0), z(), e.location.hash && 6 <= e.location.hash.length && Ne(e.location.hash)
- }
- };
- var kt = null;
- e.setNick = function(t) {
- if (e.ga && e.ga("send", "event", "Nick", t.toLowerCase()), s(), $t = t, C(), ue = 0, _t) {
- var n = {};
- n.action = 3, n.playerName = t, mt.send(JSON.stringify(n))
- }
- Qe.skinsEnabled = re, Qe.namesEnabled = le, Qe.noColors = se, Qe.blackTheme = he, Qe.showMass = de, Qe.statsEnabled = Gn, e.localStorage.settings = JSON.stringify(Qe)
- }, e.setSkins = function(e) {
- re = e
- }, e.setNames = function(e) {
- le = e
- }, e.setDarkTheme = function(e) {
- he = e
- }, e.setColors = function(e) {
- se = e
- }, e.setShowMass = function(e) {
- de = e
- }, e.spectate = function() {
- $t = null, F(1), s()
- }, e.setRegion = c;
- var Et = !0;
- e.setGameMode = function(e) {
- e != me && (":party" == me && t("#helloContainer").attr("data-party-state", "0"), d(e), ":party" != e && S())
- }, e.setAcid = function(e) {
- Ie = e
- };
- var It = function(n) {
- var o = {},
- a = !1,
- i = {
- skipDraw: !0,
- predictionModifier: 1.1
- };
- return n.init = function() {
- st.account.init(), st.google.va(), st.fa.init(), (a = "debug" in e.queryString) && st.debug.showDebug()
- }, n.bind = function(e, n) {
- t(o).bind(e, n)
- }, n.unbind = function(e, n) {
- t(o).unbind(e, n)
- }, n.trigger = function(e, n) {
- t(o).trigger(e, n)
- }, n.__defineGetter__("debug", function() {
- return a
- }), n.__defineSetter__("debug", function(e) {
- return a = e
- }), n.__defineGetter__("proxy", function() {
- return e.MC
- }), n.__defineGetter__("config", function() {
- return i
- }), n
- }({});
- st.core = It, st.cache = {};
- var wt = function(e) {
- function n(e, n, o, a) {
- e += "Canvas";
- var r = t("<canvas>", {
- id: e
- });
- for (i.append(r), o = new SmoothieChart(o), r = 0; r < n.length; r++) {
- var l = n[r],
- s = _.extend(c, a[r]);
- o.addTimeSeries(l, s)
- }
- o.streamTo(document.getElementById(e), 0)
- }
- function o(e, t) {
- s[e] = a(), n(e, [s[e]], t, [{
- strokeStyle: "rgba(0, 255, 0, 1)",
- fillStyle: "rgba(0, 255, 0, 0.2)",
- lineWidth: 2
- }])
- }
- function a() {
- return new TimeSeries({
- Ka: !1
- })
- }
- var i, r = !1,
- l = !1,
- s = {},
- c = {
- strokeStyle: "rgba(0, 255, 0, 1)",
- fillStyle: "rgba(0, 255, 0, 0.2)",
- lineWidth: 2
- };
- return e.showDebug = function() {
- r || (i = t("#debug-overlay"), o("networkUpdate", {
- name: "network updates",
- minValue: 0,
- maxValue: 120
- }), o("fps", {
- name: "fps",
- minValue: 0,
- maxValue: 120
- }), s.rttSDev = a(), s.rttMean = a(), n("rttMean", [s.rttSDev, s.rttMean], {
- name: "rtt",
- minValue: 0,
- maxValue: 120
- }, [{
- strokeStyle: "rgba(255, 0, 0, 1)",
- fillStyle: "rgba(0, 255, 0, 0.2)",
- lineWidth: 2
- }, {
- strokeStyle: "rgba(0, 255, 0, 1)",
- fillStyle: "rgba(0, 255, 0, 0)",
- lineWidth: 2
- }]), r = !0), st.core.debug = !0, i.show()
- }, e.hideDebug = function() {
- i.hide(), st.core.debug = !1
- }, e.updateChart = function(e, t, n) {
- r && e in s && s[e].append(t, n)
- }, e.__defineGetter__("showPrediction", function() {
- return l
- }), e.__defineSetter__("showPrediction", function(e) {
- return l = e
- }), e
- }({});
- st.debug = wt;
- var At = {
- AF: "JP-Tokyo",
- AX: "EU-London",
- AL: "EU-London",
- DZ: "EU-London",
- AS: "SG-Singapore",
- AD: "EU-London",
- AO: "EU-London",
- AI: "US-Atlanta",
- AG: "US-Atlanta",
- AR: "BR-Brazil",
- AM: "JP-Tokyo",
- AW: "US-Atlanta",
- AU: "SG-Singapore",
- AT: "EU-London",
- AZ: "JP-Tokyo",
- BS: "US-Atlanta",
- BH: "JP-Tokyo",
- BD: "JP-Tokyo",
- BB: "US-Atlanta",
- BY: "EU-London",
- BE: "EU-London",
- BZ: "US-Atlanta",
- BJ: "EU-London",
- BM: "US-Atlanta",
- BT: "JP-Tokyo",
- BO: "BR-Brazil",
- BQ: "US-Atlanta",
- BA: "EU-London",
- BW: "EU-London",
- BR: "BR-Brazil",
- IO: "JP-Tokyo",
- VG: "US-Atlanta",
- BN: "JP-Tokyo",
- BG: "EU-London",
- BF: "EU-London",
- BI: "EU-London",
- KH: "JP-Tokyo",
- CM: "EU-London",
- CA: "US-Atlanta",
- CV: "EU-London",
- KY: "US-Atlanta",
- CF: "EU-London",
- TD: "EU-London",
- CL: "BR-Brazil",
- CN: "CN-China",
- CX: "JP-Tokyo",
- CC: "JP-Tokyo",
- CO: "BR-Brazil",
- KM: "EU-London",
- CD: "EU-London",
- CG: "EU-London",
- CK: "SG-Singapore",
- CR: "US-Atlanta",
- CI: "EU-London",
- HR: "EU-London",
- CU: "US-Atlanta",
- CW: "US-Atlanta",
- CY: "JP-Tokyo",
- CZ: "EU-London",
- DK: "EU-London",
- DJ: "EU-London",
- DM: "US-Atlanta",
- DO: "US-Atlanta",
- EC: "BR-Brazil",
- EG: "EU-London",
- SV: "US-Atlanta",
- GQ: "EU-London",
- ER: "EU-London",
- EE: "EU-London",
- ET: "EU-London",
- FO: "EU-London",
- FK: "BR-Brazil",
- FJ: "SG-Singapore",
- FI: "EU-London",
- FR: "EU-London",
- GF: "BR-Brazil",
- PF: "SG-Singapore",
- GA: "EU-London",
- GM: "EU-London",
- GE: "JP-Tokyo",
- DE: "EU-London",
- GH: "EU-London",
- GI: "EU-London",
- GR: "EU-London",
- GL: "US-Atlanta",
- GD: "US-Atlanta",
- GP: "US-Atlanta",
- GU: "SG-Singapore",
- GT: "US-Atlanta",
- GG: "EU-London",
- GN: "EU-London",
- GW: "EU-London",
- GY: "BR-Brazil",
- HT: "US-Atlanta",
- VA: "EU-London",
- HN: "US-Atlanta",
- HK: "JP-Tokyo",
- HU: "EU-London",
- IS: "EU-London",
- IN: "JP-Tokyo",
- ID: "JP-Tokyo",
- IR: "JP-Tokyo",
- IQ: "JP-Tokyo",
- IE: "EU-London",
- IM: "EU-London",
- IL: "JP-Tokyo",
- IT: "EU-London",
- JM: "US-Atlanta",
- JP: "JP-Tokyo",
- JE: "EU-London",
- JO: "JP-Tokyo",
- KZ: "JP-Tokyo",
- KE: "EU-London",
- KI: "SG-Singapore",
- KP: "JP-Tokyo",
- KR: "JP-Tokyo",
- KW: "JP-Tokyo",
- KG: "JP-Tokyo",
- LA: "JP-Tokyo",
- LV: "EU-London",
- LB: "JP-Tokyo",
- LS: "EU-London",
- LR: "EU-London",
- LY: "EU-London",
- LI: "EU-London",
- LT: "EU-London",
- LU: "EU-London",
- MO: "JP-Tokyo",
- MK: "EU-London",
- MG: "EU-London",
- MW: "EU-London",
- MY: "JP-Tokyo",
- MV: "JP-Tokyo",
- ML: "EU-London",
- MT: "EU-London",
- MH: "SG-Singapore",
- MQ: "US-Atlanta",
- MR: "EU-London",
- MU: "EU-London",
- YT: "EU-London",
- MX: "US-Atlanta",
- FM: "SG-Singapore",
- MD: "EU-London",
- MC: "EU-London",
- MN: "JP-Tokyo",
- ME: "EU-London",
- MS: "US-Atlanta",
- MA: "EU-London",
- MZ: "EU-London",
- MM: "JP-Tokyo",
- NA: "EU-London",
- NR: "SG-Singapore",
- NP: "JP-Tokyo",
- NL: "EU-London",
- NC: "SG-Singapore",
- NZ: "SG-Singapore",
- NI: "US-Atlanta",
- NE: "EU-London",
- NG: "EU-London",
- NU: "SG-Singapore",
- NF: "SG-Singapore",
- MP: "SG-Singapore",
- NO: "EU-London",
- OM: "JP-Tokyo",
- PK: "JP-Tokyo",
- PW: "SG-Singapore",
- PS: "JP-Tokyo",
- PA: "US-Atlanta",
- PG: "SG-Singapore",
- PY: "BR-Brazil",
- PE: "BR-Brazil",
- PH: "JP-Tokyo",
- PN: "SG-Singapore",
- PL: "EU-London",
- PT: "EU-London",
- PR: "US-Atlanta",
- QA: "JP-Tokyo",
- RE: "EU-London",
- RO: "EU-London",
- RU: "RU-Russia",
- RW: "EU-London",
- BL: "US-Atlanta",
- SH: "EU-London",
- KN: "US-Atlanta",
- LC: "US-Atlanta",
- MF: "US-Atlanta",
- PM: "US-Atlanta",
- VC: "US-Atlanta",
- WS: "SG-Singapore",
- SM: "EU-London",
- ST: "EU-London",
- SA: "EU-London",
- SN: "EU-London",
- RS: "EU-London",
- SC: "EU-London",
- SL: "EU-London",
- SG: "JP-Tokyo",
- SX: "US-Atlanta",
- SK: "EU-London",
- SI: "EU-London",
- SB: "SG-Singapore",
- SO: "EU-London",
- ZA: "EU-London",
- SS: "EU-London",
- ES: "EU-London",
- LK: "JP-Tokyo",
- SD: "EU-London",
- SR: "BR-Brazil",
- SJ: "EU-London",
- SZ: "EU-London",
- SE: "EU-London",
- CH: "EU-London",
- SY: "EU-London",
- TW: "JP-Tokyo",
- TJ: "JP-Tokyo",
- TZ: "EU-London",
- TH: "JP-Tokyo",
- TL: "JP-Tokyo",
- TG: "EU-London",
- TK: "SG-Singapore",
- TO: "SG-Singapore",
- TT: "US-Atlanta",
- TN: "EU-London",
- TR: "TK-Turkey",
- TM: "JP-Tokyo",
- TC: "US-Atlanta",
- TV: "SG-Singapore",
- UG: "EU-London",
- UA: "EU-London",
- AE: "EU-London",
- GB: "EU-London",
- US: "US-Atlanta",
- UM: "SG-Singapore",
- VI: "US-Atlanta",
- UY: "BR-Brazil",
- UZ: "JP-Tokyo",
- VU: "SG-Singapore",
- VE: "BR-Brazil",
- VN: "JP-Tokyo",
- WF: "SG-Singapore",
- EH: "EU-London",
- YE: "JP-Tokyo",
- ZM: "EU-London",
- ZW: "EU-London"
- },
- Lt = 0,
- Ct = 0,
- Tt = null;
- e.connect = b;
- var Mt = 500,
- Pt = .875,
- Ft = .75,
- en = .25,
- tn = .125,
- nn = -1,
- on = -1;
- e.sendMitosis = T, e.sendEject = M, st.networking = function(e) {
- return e.loginRealm = {
- GG: "google",
- FB: "facebook"
- }, e.sendMessage = function(e) {
- if (P()) {
- var t = e.byteView;
- if (null != t) {
- e = x(1 + e.length), e.setUint8(0, 102);
- for (var n = 0; n < t.length; ++n) e.setUint8(1 + n, t[n]);
- k(e)
- }
- }
- }, e
- }({});
- var an = null,
- rn = 1,
- ln = null,
- sn = 0,
- cn = function() {
- var t = Date.now(),
- n = 1e3 / 60;
- return function() {
- e.requestAnimationFrame(cn);
- var o = Date.now(),
- a = o - t;
- if (a > n) {
- t = o - a % n;
- var i = Date.now();
- !P() || 240 > i - Ae || !st.core.config.skipDraw ? G() : console.warn("Skipping draw"), An(), sn = 1e3 / a, st.debug.updateChart("fps", o, sn)
- }
- }
- }(),
- un = {},
- dn = "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;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(";"),
- hn = "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(";"),
- gn = {};
- V.prototype = {
- $: null,
- x: 0,
- y: 0,
- f: 0,
- b: 0
- };
- var fn = -1,
- pn = !1;
- K.prototype = {
- id: 0,
- a: null,
- name: null,
- i: null,
- S: null,
- x: 0,
- y: 0,
- size: 0,
- s: 0,
- u: 0,
- o: 0,
- ja: 0,
- ka: 0,
- g: 0,
- M: 0,
- N: 0,
- J: 0,
- K: 0,
- ea: 0,
- U: 0,
- ra: 0,
- G: !1,
- c: !1,
- h: !1,
- V: !0,
- da: 0,
- C: null,
- ia: 0,
- ua: !1,
- I: !1,
- ca: function() {
- var e;
- for (e = 0; e < jt.length; e++)
- if (jt[e] == this) {
- jt.splice(e, 1);
- break
- }
- delete Dt[this.id], e = zt.indexOf(this), -1 != e && (ce = !0, zt.splice(e, 1)), e = Rt.indexOf(this.id), -1 != e && Rt.splice(e, 1), this.G = !0, 0 < this.da && Vt.push(this)
- },
- m: function() {
- return Math.max(~~(.3 * this.size), 24)
- },
- A: function(e) {
- (this.name = e) && (null == this.i ? this.i = new H(this.m(), "#FFFFFF", !0, "#000000") : this.i.P(this.m()), this.i.B(this.name))
- },
- ba: function() {
- for (var e = this.H(); this.a.length > e;) {
- var t = ~~(Math.random() * this.a.length);
- this.a.splice(t, 1)
- }
- for (0 == this.a.length && e > 0 && this.a.push(new V(this, this.x, this.y, this.size, Math.random() - .5)); this.a.length < e;) t = ~~(Math.random() * this.a.length), t = this.a[t], this.a.push(new V(this, t.x, t.y, t.f, t.b))
- },
- H: function() {
- var e = 10;
- 20 > this.size && (e = 0), this.c && (e = 30);
- var t = this.size;
- return this.c || (t *= ae), t *= rn, ~~Math.max(t, e)
- },
- Ba: function() {
- this.ba();
- for (var e = this.a, t = e.length, n = this, o = this.c ? 0 : (this.id / 1e3 + Zt / 1e4) % (2 * Math.PI), a = 0, i = 0; t > i; ++i) {
- var r = e[(i - 1 + t) % t].b,
- l = e[(i + 1) % t].b,
- s = e[i];
- s.b += (Math.random() - .5) * (this.h ? 3 : 1), s.b *= .7, 10 < s.b && (s.b = 10), -10 > s.b && (s.b = -10), s.b = (r + l + 8 * s.b) / 10;
- var c = s.f,
- r = e[(i - 1 + t) % t].f,
- l = e[(i + 1) % t].f;
- if (15 < this.size && null != ft && 20 < this.size * ae && 0 < this.id) {
- var u = !1,
- d = s.x,
- h = s.y;
- ft.Ea(d - 5, h - 5, 10, 10, function(e) {
- e.$ != n && 25 > (d - e.x) * (d - e.x) + (h - e.y) * (h - e.y) && (u = !0)
- }), !u && (s.x < te || s.y < ee || s.x > ne || s.y > oe) && (u = !0), u && (0 < s.b && (s.b = 0), --s.b)
- }
- c += s.b, 0 > c && (c = 0), c = this.h ? (19 * c + this.size) / 20 : (12 * c + this.size) / 13, s.f = (r + l + 8 * c) / 10, r = 2 * Math.PI / t, l = s.f, this.c && 0 == i % 2 && (l += 5), s.x = this.x + Math.cos(r * i + o) * l, s.y = this.y + Math.sin(r * i + o) * l, a = Math.max(a, l)
- }
- this.ia = a
- },
- na: function(e, t) {
- this.M = e, this.N = t, this.J = e, this.K = t, this.ja = e, this.ka = t
- },
- T: function() {
- if (0 >= this.id) return 1;
- var e = mn.pa((Zt - this.U) / 120, 0, 1);
- if (this.G && e >= 1) {
- var t = Vt.indexOf(this); - 1 != t && Vt.splice(t, 1)
- }
- return this.x = e * (this.ja - this.s) + this.s, this.y = e * (this.ka - this.u) + this.u, this.size = e * (this.g - this.o) + this.o, .01 > Math.abs(this.size - this.g) && (this.size = this.g), e
- },
- R: function() {
- return 0 >= this.id ? !0 : this.x + this.size + 40 < Ot - ht / 2 / ae || this.y + this.size + 40 < Gt - gt / 2 / ae || this.x - this.size - 40 > Ot + ht / 2 / ae || this.y - this.size - 40 > Gt + gt / 2 / ae ? !1 : !0
- },
- qa: function(e) {
- e.beginPath();
- var t = this.H();
- e.moveTo(this.a[0].x, this.a[0].y);
- for (var n = 1; t >= n; ++n) {
- var o = n % t;
- e.lineTo(this.a[o].x, this.a[o].y)
- }
- e.closePath(), e.stroke()
- },
- w: function(t) {
- if (this.R()) {
- ++this.da;
- var n = 0 < this.id && !this.c && !this.h && .4 > ae;
- if (5 > this.H() && 0 < this.id && (n = !0), this.V && !n)
- for (var o = 0; o < this.a.length; o++) this.a[o].f = this.size;
- this.V = n, t.save(), this.ra = Zt, o = this.T(), this.G && (t.globalAlpha *= 1 - o), t.lineWidth = 10, t.lineCap = "round", t.lineJoin = this.c ? "miter" : "round";
- var a = this.name.toLowerCase(),
- i = null,
- r = null,
- o = !1,
- l = this.color,
- s = !1;
- this.h || !re || _e || (-1 != dn.indexOf(a) ? (un.hasOwnProperty(a) || (un[a] = new Image, un[a].src = e.ASSETS_ROOT + "skins/" + a + ".png"), i = 0 != un[a].width && un[a].complete ? un[a] : null) : i = null, null != i ? -1 != hn.indexOf(a) && (o = !0) : (this.I && "%starball" == this.C && "shenron" == a && 7 <= zt.length && (pn = o = !0, r = W("%starball1")), i = W(this.C), null != i && (s = !0, l = j(this.C) || l))), st.core.debug && st.debug.showPrediction && this.I && (t.strokeStyle = "#0000FF", t.beginPath(), t.arc(this.M, this.N, this.size + 5, 0, 2 * Math.PI, !1), t.closePath(), t.stroke(), t.strokeStyle = "#00FF00", t.beginPath(), t.arc(this.J, this.K, this.size + 5, 0, 2 * Math.PI, !1), t.closePath(), t.stroke()), se && !_e ? (t.fillStyle = "#FFFFFF", t.strokeStyle = "#AAAAAA") : (t.fillStyle = l, t.strokeStyle = l), n ? (t.beginPath(), t.arc(this.x, this.y, this.size + 5, 0, 2 * Math.PI, !1), t.closePath()) : (this.Ba(), this.qa(t)), s || t.fill(), null != i && (this.la(t, i), null != r && this.la(t, r, {
- alpha: Math.sin(.0174 * fn)
- })), (se || 15 < this.size) && !n && (t.strokeStyle = "#000000", t.globalAlpha *= .1, t.stroke()), t.globalAlpha = 1, a = -1 != zt.indexOf(this), n = ~~this.y, 0 != this.id && (le || a) && this.name && this.i && !o && (i = this.i, i.B(this.name), i.P(this.m()), o = 0 >= this.id ? 1 : Math.ceil(10 * ae) / 10, i.ma(o), i = i.O(), r = Math.ceil(i.width / o), l = Math.ceil(i.height / o), t.drawImage(i, ~~this.x - ~~(r / 2), n - ~~(l / 2), r, l), n += i.height / 2 / o + 4), 0 < this.id && de && (a || 0 == zt.length && (!this.c || this.h) && 20 < this.size) && (null == this.S && (this.S = new H(this.m() / 2, "#FFFFFF", !0, "#000000")), a = this.S, a.P(this.m() / 2), a.B(~~(this.size * this.size / 100)), o = Math.ceil(10 * ae) / 10, a.ma(o), i = a.O(), r = Math.ceil(i.width / o), l = Math.ceil(i.height / o), t.drawImage(i, ~~this.x - ~~(r / 2), n - ~~(l / 2), r, l)), t.restore()
- }
- },
- la: function(e, t, n) {
- e.save(), e.clip();
- var o = Math.max(this.size, this.ia);
- null != n && null != n.alpha && (e.globalAlpha = n.alpha), e.drawImage(t, this.x - o - 5, this.y - o - 5, 2 * o + 10, 2 * o + 10), e.restore()
- }
- };
- var mn = function(e) {
- function t(e, t, n) {
- return t > e ? t : e > n ? n : e
- }
- return e.ha = function(e, n) {
- var o;
- return o = t(.5, 0, 1), e + o * (n - e)
- }, e.pa = t, e.fixed = function(e, t) {
- var n = Math.pow(10, t);
- return ~~(e * n) / n
- }, e
- }({});
- e.Maths = mn;
- var vn = function(e) {
- return e.L = function() {
- for (var e = new Date, t = [e.getMonth() + 1, e.getDate(), e.getFullYear()], e = [e.getHours(), e.getMinutes(), e.getSeconds()], n = 1; 3 > n; n++) 10 > e[n] && (e[n] = "0" + e[n]);
- return "[" + t.join("/") + " " + e.join(":") + "]"
- }, e
- }({});
- e.Utils = vn, H.prototype = {
- F: "",
- W: "#000000",
- Y: !1,
- Z: "#000000",
- v: 16,
- j: null,
- X: null,
- l: !1,
- D: 1,
- P: function(e) {
- this.v != e && (this.v = e, this.l = !0)
- },
- ma: function(e) {
- this.D != e && (this.D = e, this.l = !0)
- },
- B: function(e) {
- e != this.F && (this.F = e, this.l = !0)
- },
- O: function() {
- if (null == this.j && (this.j = document.createElement("canvas"), this.X = this.j.getContext("2d")), this.l) {
- this.l = !1;
- var e = this.j,
- t = this.X,
- n = this.F,
- o = this.D,
- a = this.v,
- i = a + "px Ubuntu";
- t.font = i;
- var r = ~~(.2 * a);
- e.width = (t.measureText(n).width + 6) * o, e.height = (a + r) * o, t.font = i, t.scale(o, o), t.globalAlpha = 1, t.lineWidth = 3, t.strokeStyle = this.Z, t.fillStyle = this.W, this.Y && t.strokeText(n, 3, a - r / 2), t.fillText(n, 3, a - r / 2)
- }
- return this.j
- }
- }, Date.now || (Date.now = function() {
- return (new Date).getTime()
- }),
- function() {
- for (var t = ["ms", "moz", "webkit", "o"], n = 0; n < t.length && !e.requestAnimationFrame; ++n) e.requestAnimationFrame = e[t[n] + "RequestAnimationFrame"], e.cancelAnimationFrame = e[t[n] + "CancelAnimationFrame"] || e[t[n] + "CancelRequestAnimationFrame"];
- e.requestAnimationFrame || (e.requestAnimationFrame = function(e) {
- return setTimeout(e, 1e3 / 60)
- }, e.cancelAnimationFrame = function(e) {
- clearTimeout(e)
- })
- }();
- var Sn = {
- init: function(e) {
- function t(e) {
- return o > e && (e = o), e > i && (e = i), ~~((e - o) / 32)
- }
- function n(e) {
- return a > e && (e = a), e > r && (e = r), ~~((e - a) / 32)
- }
- var o = e.za,
- a = e.Aa,
- i = e.xa,
- r = e.ya,
- l = ~~((i - o) / 32) + 1,
- s = ~~((r - a) / 32) + 1,
- c = Array(l * s);
- return {
- ta: function(e) {
- var o = t(e.x) + n(e.y) * l;
- null == c[o] ? c[o] = e : Array.isArray(c[o]) ? c[o].push(e) : c[o] = [c[o], e]
- },
- Ea: function(e, o, a, i, r) {
- var s = t(e),
- u = n(o);
- for (e = t(e + a), o = n(o + i); o >= u; ++u)
- for (i = s; e >= i; ++i)
- if (a = c[i + u * l], null != a)
- if (Array.isArray(a))
- for (var d = 0; d < a.length; d++) r(a[d]);
- else r(a)
- }
- }
- }
- },
- yn = function() {
- var e = new K(0, 0, 0, 32, "#ED1C24", ""),
- t = document.createElement("canvas");
- t.width = 32, t.height = 32;
- var n = t.getContext("2d");
- return function() {
- 0 < zt.length && (e.color = zt[0].color, e.A(zt[0].name)), n.clearRect(0, 0, 32, 32), n.save(), n.translate(16, 16), n.scale(.4, .4), e.w(n), n.restore();
- var o = document.getElementById("favicon"),
- a = o.cloneNode(!0);
- a.setAttribute("href", t.toDataURL("image/png")), o.parentNode.replaceChild(a, o)
- }
- }();
- t(function() {
- yn()
- });
- var bn = {
- context: null,
- defaultProvider: "facebook",
- loginIntent: "0",
- userInfo: {
- socialToken: null,
- tokenExpires: "",
- level: "",
- xp: "",
- xpNeeded: "",
- name: "",
- picture: "",
- displayName: "",
- loggedIn: "0",
- socialId: ""
- }
- },
- Un = e.defaultSt = bn;
- e.storageInfo = Un, e.createDefaultStorage = q, e.updateStorage = $, t(function() {
- null != e.localStorage.storeObjectInfo && (Un = JSON.parse(e.localStorage.storeObjectInfo)), "1" == Un.loginIntent && X(Un.context), "" == Un.userInfo.name && "" == Un.userInfo.displayName || Q(Un.userInfo)
- }), e.checkLoginStatus = function() {
- "1" == Un.loginIntent && (xn(), X(Un.context))
- };
- var xn = function() {
- e.MC.setProfilePicture(Un.userInfo.picture), e.MC.setSocialId(Un.userInfo.socialId)
- };
- e.logout = function() {
- Un = bn, delete e.localStorage.storeObjectInfo, e.localStorage.storeObjectInfo = JSON.stringify(bn), $(), wn(), st.cache.sentGameServerLogin = !1, delete st.cache.login_info, t("#helloContainer").attr("data-logged-in", "0"), t("#helloContainer").attr("data-has-account-data", "0"), t(".timer").text(""), t("#gPlusShare").hide(), t("#fbShare").show(), t("#user-id-tag").text(""), S(), e.MC.doLogout()
- }, e.toggleSocialLogin = function() {
- t("#socialLoginContainer").toggle(), t("#settings").hide(), t("#instructions").hide(), Oe()
- }, e.toggleSettings = function() {
- t("#settings").toggle(), t("#socialLoginContainer").hide(), t("#instructions").hide(), Oe()
- }, st.account = function(n) {
- function o() {}
- function a(n, o) {
- console.log(vn.L() + " got user login"), (null == i || i.id != o.id) && (i = o, null != e.ssa_json && (e.ssa_json.applicationUserId = "" + o.id, e.ssa_json.custom_user_id = "" + o.id), "undefined" != typeof SSA_CORE && SSA_CORE.start(), t("#offerwallIframe").attr("src", "http://www.supersonicads.com/delivery/panel.php?applicationKey=" + EnvConfig.supersonic_app_key + "&applicationUserId=" + o.id + "&custom_user_id=" + o.id + "&applicationUserIdSignature=optional"))
- }
- var i = null;
- return n.init = function() {
- st.core.bind("user_login", a), st.core.bind("user_logout", o)
- }, n.setUserData = function(e) {
- Q(e)
- }, n.setAccountData = function(e, n) {
- var o = t("#helloContainer").attr("data-has-account-data", "1");
- Un.userInfo.xp = e.xp, Un.userInfo.xpNeeded = e.xpNeeded, Un.userInfo.level = e.level, $(), o && n ? ze(e) : (t(".agario-profile-panel .progress-bar-star").text(e.level), t(".agario-exp-bar .progress-bar-text").text(e.xp + "/" + e.xpNeeded + " XP"), t(".agario-exp-bar .progress-bar").css("width", (88 * e.xp / e.xpNeeded).toFixed(2) + "%"))
- }, n.Ga = function(e) {
- ze(e)
- }, n
- }({});
- var kn = 0;
- e.fbAsyncInit = function() {
- function t() {
- null == e.FB ? alert("You seem to have something blocking Facebook on your browser, please check for any extensions") : (Un.loginIntent = "1", e.updateStorage(), e.FB.login(function(e) {
- Ge(e)
- }, {
- scope: "public_profile, email"
- }))
- }
- e.FB.init({
- appId: EnvConfig.fb_app_id,
- cookie: !0,
- xfbml: !0,
- status: !0,
- version: "v2.2"
- }), ("1" == e.storageInfo.loginIntent && "facebook" == e.storageInfo.context || Xe) && e.FB.getLoginStatus(function(n) {
- "connected" === n.status ? Ge(n) : "not_authorized" === n.status ? (e.logout(), t()) : e.logout()
- }), e.facebookRelogin = t, e.facebookLogin = t
- };
- var En = !1;
- ! function(n) {
- function o() {
- var e = document.createElement("script");
- e.type = "text/javascript", e.async = !0, e.src = "//apis.google.com/js/client:platform.js?onload=gapiAsyncInit";
- var t = document.getElementsByTagName("script")[0];
- t.parentNode.insertBefore(e, t), i = !0
- }
- var a = {},
- i = !1;
- return e.gapiAsyncInit = function() {
- t(a).trigger("initialized")
- }, n.google = {
- va: function() {
- o()
- },
- sa: function(t, n) {
- e.gapi.client.load("plus", "v1", function() {
- console.log("fetching me profile"), gapi.client.plus.people.get({
- userId: "me"
- }).execute(function(e) {
- n(e)
- })
- })
- }
- }, n.Da = function(e) {
- i || o(), "undefined" != typeof gapi ? e() : t(a).bind("initialized", e)
- }, n
- }(st);
- var In = function(n) {
- function o(t) {
- e.MC.doLoginWithGPlus(t), st.cache.login_info = [t, "google"]
- }
- function a(e) {
- Un.userInfo.picture = e, t(".agario-profile-picture").attr("src", e)
- }
- var i = null,
- r = {
- client_id: EnvConfig.gplus_client_id,
- cookie_policy: "single_host_origin",
- scope: "profile email"
- };
- return n.fa = {
- oa: function() {
- return i
- },
- init: function() {
- var t = this,
- n = Un && "1" == Un.loginIntent && "google" == Un.context;
- st.Da(function() {
- e.gapi.ytsubscribe.go("agarYoutube"), e.gapi.load("auth2", function() {
- i = e.gapi.auth2.init(r), i.attachClickHandler(document.getElementById("gplusLogin"), {}, function(e) {
- console.log("googleUser : " + e)
- }, function(e) {
- console.log("failed to login in google plus: ", JSON.stringify(e, void 0, 2))
- }), i.currentUser.listen(_.bind(t.Ca, t)), n && 1 == i.isSignedIn.get() && i.signIn()
- })
- })
- },
- Ca: function(t) {
- if (i && t && i.isSignedIn.get() && !En) {
- En = !0, Un.loginIntent = "1";
- var n = t.getAuthResponse(),
- r = n.access_token;
- e.oa = n, console.log("loggedIn with G+!");
- var l = t.getBasicProfile();
- t = l.getImageUrl(), void 0 == t ? st.google.sa(n, function(t) {
- t.result.isPlusUser ? (t && a(t.image.url), o(r), t && (Un.userInfo.picture = t.image.url), Un.userInfo.socialId = l.getId(), xn()) : (alert("Please add Google+ to your Google account and try again.\nOr you can login with another account."), e.logout())
- }) : (a(t), Un.userInfo.picture = t, Un.userInfo.socialId = l.getId(), xn(), o(r)), Un.context = "google", e.updateStorage()
- }
- },
- wa: function() {
- i && (i.signOut(), En = !1)
- }
- }, n
- }(st);
- e.gplusModule = In;
- var wn = function() {
- st.fa.wa()
- };
- e.logoutGooglePlus = wn;
- var An = function() {
- function e(e, t, n, o, a) {
- var i = t.getContext("2d"),
- r = t.width;
- t = t.height, e.color = a, e.A(n), e.size = o, i.save(), i.translate(r / 2, t / 2), e.w(i), i.restore()
- }
- for (var n = new K(-1, 0, 0, 32, "#5bc0de", ""), o = new K(-1, 0, 0, 32, "#5bc0de", ""), a = "#0791ff #5a07ff #ff07fe #ffa507 #ff0774 #077fff #3aff07 #ff07ed #07a8ff #ff076e #3fff07 #ff0734 #07ff20 #ff07a2 #ff8207 #07ff0e".split(" "), i = [], r = 0; r < a.length; ++r) {
- var l = r / a.length * 12,
- s = 30 * Math.sqrt(r / a.length);
- i.push(new K(-1, Math.cos(l) * s, Math.sin(l) * s, 10, a[r], ""))
- }
- Z(i);
- var c = document.createElement("canvas");
- return c.getContext("2d"), c.width = c.height = 70, e(o, c, "", 26, "#ebc0de"),
- function() {
- t(".cell-spinner").filter(":visible").each(function() {
- var o = t(this),
- a = Date.now(),
- i = this.width,
- r = this.height,
- l = this.getContext("2d");
- l.clearRect(0, 0, i, r), l.save(), l.translate(i / 2, r / 2);
- for (var s = 0; 10 > s; ++s) l.drawImage(c, (.1 * a + 80 * s) % (i + 140) - i / 2 - 70 - 35, r / 2 * Math.sin((.001 * a + s) % Math.PI * 2) - 35, 70, 70);
- l.restore(), (o = o.attr("data-itr")) && (o = m(o)), e(n, this, o || "", +t(this).attr("data-size"), "#5bc0de")
- }), t("#statsPellets").filter(":visible").each(function() {
- t(this);
- var n = this.width,
- o = this.height;
- for (this.getContext("2d").clearRect(0, 0, n, o), n = 0; n < i.length; n++) e(i[n], this, "", i[n].size, i[n].color)
- })
- }
- }();
- e.createParty = function() {
- d(":party"), Tt = function(n) {
- Je("/#" + e.encodeURIComponent(n)), t(".partyToken").val("agar.io/#" + e.encodeURIComponent(n)), t("#helloContainer").attr("data-party-state", "1")
- }, S()
- }, e.joinParty = Ne, e.cancelParty = function() {
- Je("/"), t("#helloContainer").attr("data-party-state", "0"), d(""), S()
- };
- var Ln = [],
- Cn = 0,
- Tn = "#000000",
- Mn = !1,
- Pn = !1,
- Fn = 0,
- _n = 0,
- zn = 0,
- Bn = 0,
- On = 0,
- Gn = !0;
- e.onPlayerDeath = Re, setInterval(function() {
- Pn && Ln.push(R() / 100)
- }, 1e3 / 60), setInterval(function() {
- var e = We();
- 0 != e && (++zn, 0 == On && (On = e), On = Math.min(On, e))
- }, 1e3), e.closeStats = function() {
- Mn = !1, t("#stats").hide(), e.destroyAd(e.adSlots.ab), u(0)
- }, e.setSkipStats = function(e) {
- Gn = !e
- }, e.getStatsString = Ye, e.gPlusShare = He, e.twitterShareStats = function() {
- var t = e.getStatsString("tt_share_stats");
- e.open("https://twitter.com/intent/tweet?text=" + t, "Agar.io", "width=660,height=310,menubar=no,toolbar=no,resizable=yes,scrollbars=no,left=" + (e.screenX + e.innerWidth / 2 - 330) + ",top=" + (e.innerHeight - 310) / 2)
- }, e.fbShareStats = function() {
- var t = e.getStatsString("fb_matchresults_subtitle");
- e.FB.ui({
- method: "feed",
- display: "iframe",
- name: m("fb_matchresults_title"),
- caption: m("fb_matchresults_description"),
- description: t,
- link: "http://agar.io",
- Ja: "http://static2.miniclipcdn.com/mobile/agar/Agar.io_matchresults_fb_1200x630.png",
- Fa: {
- name: "play now!",
- link: "http://agar.io"
- }
- })
- }, e.fillSocialValues = function(t, n) {
- 1 == e.isChrome && "google" == e.storageInfo.context && e.gapi.interactivepost.render(n, {
- contenturl: EnvConfig.game_url,
- clientid: EnvConfig.gplus_client_id,
- cookiepolicy: "http://agar.io",
- prefilltext: t,
- calltoactionlabel: "BEAT",
- calltoactionurl: EnvConfig.game_url
- })
- }, t(function() {
- "MAsyncInit" in e && e.MAsyncInit()
- })
- }
- }
- }
- }(window, window.jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement