Advertisement
Guest User

Untitled

a guest
Apr 30th, 2017
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 43.91 KB | None | 0 0
  1. (function (a, c) {
  2. function u(a, e) {
  3. if (e) {
  4. var b = new Date;
  5. b.setTime(b.getTime() + 864E5 * e);
  6. b = "; expires=" + b.toGMTString()
  7. } else b = "";
  8. document.cookie = "agario_redirect=" + a + b + "; path=/"
  9. }
  10.  
  11. function v() {
  12. return a.location.hash && 6 <= a.location.hash.length
  13. }
  14.  
  15. function S() {
  16. c.get(T + "//gc.agar.io", function (a) {
  17. a = a.split(" ");
  18. p = a[0];
  19. a = a[1] || "";
  20. t.hasOwnProperty(p) && ("string" == typeof t[p] ? MC.getRegion() || (MC.setRegion(t[p], !v()), c("#region")
  21. .val(MC.getRegion())) : t[p].hasOwnProperty(a) && !MC.getRegion() && (MC.setRegion(t[p][a], !v()), c("#region")
  22. .val(MC.getRegion())));
  23. "" != p && (cc.initialise({
  24. cookies: {
  25. social: {}
  26. , analytics: {}
  27. , advertising: {}
  28. , necessary: {}
  29. }
  30. , settings: {
  31. consenttype: "explicit"
  32. }
  33. }), cc.setLocation(p));
  34. v() || MC.reconnect()
  35. }, "text")
  36. }
  37.  
  38. function E(b) {
  39. b.preventDefault();
  40. a.core && a.core.playerZoom && a.core.playerZoom(b.wheelDelta / -120 || b.detail || 0)
  41. }
  42.  
  43. function F(a) {
  44. d.context = "google" == a ? "google" : "facebook";
  45. w()
  46. }
  47.  
  48. function w() {
  49. a.localStorage[q] = JSON.stringify(d);
  50. d = JSON.parse(a.localStorage[q]);
  51. a.storageInfo = d;
  52. "google" == d.context ? (c("#gPlusShare")
  53. .show(), c("#fbShare")
  54. .hide()) : (c("#gPlusShare")
  55. .hide(), c("#fbShare")
  56. .show())
  57. }
  58.  
  59. function G(b) {
  60. c("#helloContainer")
  61. .attr("data-has-account-data");
  62. "" != b.displayName && (b.name = b.displayName);
  63. if (null == b.name || void 0 == b.name) b.name = "";
  64. var e = b.name.lastIndexOf("_"); - 1 != e && (b.name = b.name.substring(0, e));
  65. c("#helloContainer")
  66. .attr("data-has-account-data", "1");
  67. c("#helloContainer")
  68. .attr("data-logged-in", "1");
  69. c(".agario-profile-panel .progress-bar-star")
  70. .text(b.level);
  71. c(".agario-exp-bar .progress-bar-text")
  72. .text(b.xp + "/" +
  73. b.xpNeeded + " XP");
  74. c(".agario-exp-bar .progress-bar")
  75. .css("width", (88 * b.xp / b.xpNeeded)
  76. .toFixed(2) + "%");
  77. c(".agario-profile-name")
  78. .text(b.name);
  79. "" != b.picture && c(".agario-profile-picture")
  80. .attr("src", b.picture);
  81. d.userInfo.level = b.level;
  82. d.userInfo.xp = b.xp;
  83. d.userInfo.xpNeeded = b.xpNeeded;
  84. d.userInfo.displayName = b.name;
  85. d.userInfo.loggedIn = "1";
  86. a.updateStorage()
  87. }
  88.  
  89. function r(b, e) {
  90. var k = b;
  91. if (d.userInfo.loggedIn) {
  92. var h = c("#helloContainer")
  93. .is(":visible") && "1" == c("#helloContainer")
  94. .attr("data-has-account-data");
  95. k && k || (k = d.userInfo);
  96. if (h) {
  97. var g = +c(".agario-exp-bar .progress-bar-text")
  98. .first()
  99. .text()
  100. .split("/")[0]
  101. , h = +c(".agario-exp-bar .progress-bar-text")
  102. .first()
  103. .text()
  104. .split("/")[1].split(" ")[0]
  105. , l = c(".agario-profile-panel .progress-bar-star")
  106. .first()
  107. .text();
  108. if (l != k.level) r({
  109. xp: h
  110. , xpNeeded: h
  111. , level: l
  112. }, function () {
  113. c(".agario-profile-panel .progress-bar-star")
  114. .text(k.level);
  115. c(".agario-exp-bar .progress-bar")
  116. .css("width", "100%");
  117. c(".progress-bar-star")
  118. .addClass("animated tada")
  119. .one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend", function () {
  120. c(".progress-bar-star")
  121. .removeClass("animated tada")
  122. });
  123. setTimeout(function () {
  124. c(".agario-exp-bar .progress-bar-text")
  125. .text(k.xpNeeded + "/" + k.xpNeeded + " XP");
  126. r({
  127. xp: 0
  128. , xpNeeded: k.xpNeeded
  129. , level: k.level
  130. }, function () {
  131. r(k)
  132. })
  133. }, 1E3)
  134. });
  135. else {
  136. var f = Date.now()
  137. , n = function () {
  138. var b;
  139. b = (Date.now() - f) / 1E3;
  140. b = 0 > b ? 0 : 1 < b ? 1 : b;
  141. b = b * b * (3 - 2 * b);
  142. c(".agario-exp-bar .progress-bar-text")
  143. .text(~~(g + (k.xp - g) * b) + "/" + k.xpNeeded + " XP");
  144. c(".agario-exp-bar .progress-bar")
  145. .css("width", (88 * (g + (k.xp - g) * b) / k.xpNeeded)
  146. .toFixed(2) + "%");
  147. e && e();
  148. 1 > b && a.requestAnimationFrame(n)
  149. };
  150. a.requestAnimationFrame(n)
  151. }
  152. }
  153. }
  154. }
  155.  
  156. function H() {
  157. 1 != I && 0 != A && 0 != J && (I = !0, ("1" == a.storageInfo.loginIntent && "facebook" == a.storageInfo.context || K) && a.FB.getLoginStatus(function (b) {
  158. "connected" === b.status ? L(b) : a.logout()
  159. }), a.facebookRelogin = M, a.facebookLogin = M)
  160. }
  161.  
  162. function M(b) {
  163. if (null == a.FB) alert("You seem to have something blocking Facebook on your browser, please check for any extensions"), b(null);
  164. else return d.loginIntent = "1", a.updateStorage(), a.FB.login(function (a) {
  165. L(a);
  166. b(a)
  167. }, {
  168. scope: B
  169. , auth_type: "rerequest"
  170. }), !0
  171. }
  172.  
  173. function L(b) {
  174. if ("connected" == b.status) {
  175. var e = b.authResponse.accessToken;
  176. null == e || "undefined" == e || "" == e ? (3 > N && (N++, a.facebookRelogin()), a.logout()) : (a.fetchFacebookPermissions(), a.MC.doLoginWithFB(e), f.cache.login_info = [e, "facebook"], a.FB.api("/me/picture?width=180&height=180", function (e) {
  177. d.userInfo.picture = e.data.url;
  178. a.updateStorage();
  179. c(".agario-profile-picture")
  180. .attr("src", e.data.url);
  181. d.userInfo.socialId = b.authResponse.userID;
  182. x()
  183. }), c("#helloContainer")
  184. .attr("data-logged-in", "1"), d.context = "facebook", d.loginIntent = "1", a.updateStorage(), a.MC.showInstructionsPanel(!0))
  185. }
  186. }
  187. var m = document.createElement("canvas");
  188. if ("undefined" != typeof console && "undefined" != typeof DataView && "undefined" != typeof WebSocket && m && null != m.getContext && a.localStorage) {
  189. var A = !1
  190. , y = {};
  191. (function () {
  192. var b = a.location.search;
  193. "?" == b.charAt(0) && (b = b.slice(1));
  194. for (var b = b.split("&"), e = 0; e < b.length; e++) {
  195. var c = b[e].split("=");
  196. y[c[0]] = c[1]
  197. }
  198. })();
  199. a.queryString = y;
  200. var K = "fb" in y
  201. , m = "miniclip" in y
  202. , V = function () {
  203. u("", -1)
  204. }
  205. , O = "http:" != a.location.protocol
  206. , W = "1" == function (a) {
  207. a += "=";
  208. for (var b = document.cookie.split(";"), c = 0; c < b.length; c++) {
  209. for (var d = b[c];
  210. " " == d.charAt(0);) d = d.substring(1, d.length);
  211. if (!d.indexOf(a)) return d.substring(a.length, d.length)
  212. }
  213. return null
  214. }("agario_redirect")
  215. , P = !1;
  216. K || m || (O && !W ? (u("1", 1), a.location.href = "http:" + a.location.href.substring(a.location.protocol.length), P = !0) : u("", -1));
  217. O || u("", -1);
  218. P || setTimeout(V, 3E3);
  219. if (!a.agarioNoInit) {
  220. var T = a.location.protocol
  221. , m = a.navigator.userAgent;
  222. if (-1 != m.indexOf("Android")) a.ga && a.ga("send", "event", "MobileRedirect", "PlayStore"), setTimeout(function () {
  223. a.location.href = "https://play.google.com/store/apps/details?id=com.miniclip.agar.io"
  224. }, 1E3);
  225. else if (-1 != m.indexOf("iPhone") || -1 != m.indexOf("iPad") || -1 != m.indexOf("iPod")) a.ga && a.ga("send", "event", "MobileRedirect", "AppStore"), setTimeout(function () {
  226. a.location.href = "https://itunes.apple.com/app/agar.io/id995999703?mt=8&at=1l3vajp"
  227. }, 1E3);
  228. else {
  229. var f = {};
  230. a.agarApp = f;
  231. (new Image)
  232. .src = "/img/split.png";
  233. var Q;
  234. a.agarioInit = function () {
  235. Q = setInterval(a.agarioAfterInit, 2E3)
  236. };
  237. a.agarioAfterInit = function () {
  238. clearInterval(Q);
  239. A = !0;
  240. MC.wasInitialized();
  241. null != a.localStorage[q] && (d = JSON.parse(a.localStorage[q]));
  242. "1" == d.loginIntent && F(d.context);
  243. "" == d.userInfo.name && "" == d.userInfo.displayName || G(d.userInfo);
  244. H();
  245. f.a.b();
  246. MC.getLatestConfigurationID();
  247. f.core.init();
  248. MC.refreshRegionInfo();
  249. setInterval(MC.refreshRegionInfo, 18E4);
  250. /firefox/i.test(navigator.userAgent) ? document.addEventListener("DOMMouseScroll", E, !1) : document.body.onmousewheel = E;
  251. presetGameMode && MC.setGameMode(presetGameMode, !1);
  252. S();
  253. v() ? MC.joinParty(a.location.hash) : MC.checkRegion();
  254. a.MC.setInGameState(!1)
  255. };
  256. var p = "";
  257. a.setAcid = function () {};
  258. a.f = function () {
  259. try {
  260. console.log("agar.io :)")
  261. } catch (b) {}
  262. };
  263. var C = {};
  264. a.addKeyListeners = function () {
  265. a.onkeydown = function (b) {
  266. if (!C[b.keyCode]) switch (C[b.keyCode] = !0, b.keyCode) {
  267. case 32:
  268. a.core && a.core.split && a.core.split();
  269. b.preventDefault();
  270. break;
  271. case 87:
  272. a.core && a.core.eject && a.core.eject();
  273. break;
  274. case 81:
  275. a.core && a.core.specialOn && a.core.specialOn();
  276. break;
  277. case 27:
  278. b.preventDefault();
  279. MC.showNickDialog(300);
  280. c("#oferwallContainer")
  281. .is(":visible") && a.closeOfferwall();
  282. c("#videoContainer")
  283. .is(":visible") && a.closeVideoContainer();
  284. break;
  285. case 220:
  286. b.preventDefault(), MC.showStatsDialog()
  287. }
  288. };
  289. a.onkeyup = function (b) {
  290. C[b.keyCode] = !1;
  291. 81 == b.keyCode && a.specialOff && a.core.specialOff()
  292. }
  293. };
  294. m = function (b) {
  295. var e = {}
  296. , d = !1
  297. , h = {
  298. skipDraw: !0
  299. , predictionModifier: 1.1
  300. };
  301. b.init = function () {
  302. f.account.init();
  303. f.google.h();
  304. f.a.init();
  305. (d = "debug" in a.queryString) && f.debug.showDebug()
  306. };
  307. b.bind = function (a, b) {
  308. c(e)
  309. .bind(a, b)
  310. };
  311. b.unbind = function (a, b) {
  312. c(e)
  313. .unbind(a, b)
  314. };
  315. b.trigger = function (a, b) {
  316. c(e)
  317. .trigger(a, b)
  318. };
  319. b.__defineGetter__("debug", function () {
  320. return d
  321. });
  322. b.__defineSetter__("debug", function (a) {
  323. return d = a
  324. });
  325. b.__defineGetter__("proxy", function () {
  326. return a.MC
  327. });
  328. b.__defineGetter__("config", function () {
  329. return h
  330. });
  331. return b
  332. }({});
  333. f.core = m;
  334. f.cache = {};
  335. m = function (a) {
  336. function b(a, b, e, d) {
  337. a += "Canvas";
  338. var g = c("<canvas>", {
  339. id: a
  340. });
  341. l.append(g);
  342. e = new SmoothieChart(e);
  343. for (g = 0; g < b.length; g++) {
  344. var k = b[g]
  345. , n = _.extend(U, d[g]);
  346. e.addTimeSeries(k, n)
  347. }
  348. e.streamTo(document.getElementById(a), 0)
  349. }
  350.  
  351. function d(a, e) {
  352. n[a] = h();
  353. b(a, [n[a]], e, [{
  354. strokeStyle: "rgba(0, 255, 0, 1)"
  355. , fillStyle: "rgba(0, 255, 0, 0.2)"
  356. , lineWidth: 2
  357. }])
  358. }
  359.  
  360. function h() {
  361. return new TimeSeries({
  362. C: !1
  363. })
  364. }
  365. var g = !1
  366. , l, m = !1
  367. , n = {}
  368. , U = {
  369. strokeStyle: "rgba(0, 255, 0, 1)"
  370. , fillStyle: "rgba(0, 255, 0, 0.2)"
  371. , lineWidth: 2
  372. };
  373. a.showDebug = function () {
  374. g || (l = c("#debug-overlay"), d("networkUpdate", {
  375. name: "network updates"
  376. , minValue: 0
  377. , maxValue: 240
  378. }), n.rttSDev = h(), n.rttMean = h(), b("rttMean", [n.rttSDev, n.rttMean], {
  379. name: "rtt"
  380. , minValue: 0
  381. , maxValue: 120
  382. }, [{
  383. strokeStyle: "rgba(255, 0, 0, 1)"
  384. , fillStyle: "rgba(0, 255, 0, 0.2)"
  385. , lineWidth: 2
  386. }, {
  387. strokeStyle: "rgba(0, 255, 0, 1)"
  388. , fillStyle: "rgba(0, 255, 0, 0)"
  389. , lineWidth: 2
  390. }]), d("fps", {
  391. name: "fps"
  392. , minValue: 0
  393. , maxValue: 70
  394. }), g = !0);
  395. f.core.debug = !0;
  396. l.show()
  397. };
  398. a.hideDebug = function () {
  399. l.hide();
  400. f.core.debug = !1
  401. };
  402. a.updateChart = function (a, b, e) {
  403. g && a in n && n[a].append(b, e)
  404. };
  405. a.__defineGetter__("showPrediction", function () {
  406. return m
  407. });
  408. a.__defineSetter__("showPrediction", function (a) {
  409. return m = a
  410. });
  411. return a
  412. }({});
  413. f.debug = m;
  414. var t = {
  415. AF: "JP-Tokyo"
  416. , AX: "EU-London"
  417. , AL: "EU-London"
  418. , DZ: "EU-London"
  419. , AS: "SG-Singapore"
  420. , AD: "EU-London"
  421. , AO: "EU-London"
  422. , AI: "US-Atlanta"
  423. , AG: "US-Atlanta"
  424. , AR: "BR-Brazil"
  425. , AM: "JP-Tokyo"
  426. , AW: "US-Atlanta"
  427. , AU: "SG-Singapore"
  428. , AT: "EU-London"
  429. , AZ: "JP-Tokyo"
  430. , BS: "US-Atlanta"
  431. , BH: "JP-Tokyo"
  432. , BD: "JP-Tokyo"
  433. , BB: "US-Atlanta"
  434. , BY: "EU-London"
  435. , BE: "EU-London"
  436. , BZ: "US-Atlanta"
  437. , BJ: "EU-London"
  438. , BM: "US-Atlanta"
  439. , BT: "JP-Tokyo"
  440. , BO: "BR-Brazil"
  441. , BQ: "US-Atlanta"
  442. , BA: "EU-London"
  443. , BW: "EU-London"
  444. , BR: "BR-Brazil"
  445. , IO: "JP-Tokyo"
  446. , VG: "US-Atlanta"
  447. , BN: "JP-Tokyo"
  448. , BG: "EU-London"
  449. , BF: "EU-London"
  450. , BI: "EU-London"
  451. , KH: "JP-Tokyo"
  452. , CM: "EU-London"
  453. , CA: "US-Atlanta"
  454. , CV: "EU-London"
  455. , KY: "US-Atlanta"
  456. , CF: "EU-London"
  457. , TD: "EU-London"
  458. , CL: "BR-Brazil"
  459. , CN: "CN-China"
  460. , CX: "JP-Tokyo"
  461. , CC: "JP-Tokyo"
  462. , CO: "BR-Brazil"
  463. , KM: "EU-London"
  464. , CD: "EU-London"
  465. , CG: "EU-London"
  466. , CK: "SG-Singapore"
  467. , CR: "US-Atlanta"
  468. , CI: "EU-London"
  469. , HR: "EU-London"
  470. , CU: "US-Atlanta"
  471. , CW: "US-Atlanta"
  472. , CY: "JP-Tokyo"
  473. , CZ: "EU-London"
  474. , DK: "EU-London"
  475. , DJ: "EU-London"
  476. , DM: "US-Atlanta"
  477. , DO: "US-Atlanta"
  478. , EC: "BR-Brazil"
  479. , EG: "EU-London"
  480. , SV: "US-Atlanta"
  481. , GQ: "EU-London"
  482. , ER: "EU-London"
  483. , EE: "EU-London"
  484. , ET: "EU-London"
  485. , FO: "EU-London"
  486. , FK: "BR-Brazil"
  487. , FJ: "SG-Singapore"
  488. , FI: "EU-London"
  489. , FR: "EU-London"
  490. , GF: "BR-Brazil"
  491. , PF: "SG-Singapore"
  492. , GA: "EU-London"
  493. , GM: "EU-London"
  494. , GE: "JP-Tokyo"
  495. , DE: "EU-London"
  496. , GH: "EU-London"
  497. , GI: "EU-London"
  498. , GR: "EU-London"
  499. , GL: "US-Atlanta"
  500. , GD: "US-Atlanta"
  501. , GP: "US-Atlanta"
  502. , GU: "SG-Singapore"
  503. , GT: "US-Atlanta"
  504. , GG: "EU-London"
  505. , GN: "EU-London"
  506. , GW: "EU-London"
  507. , GY: "BR-Brazil"
  508. , HT: "US-Atlanta"
  509. , VA: "EU-London"
  510. , HN: "US-Atlanta"
  511. , HK: "JP-Tokyo"
  512. , HU: "EU-London"
  513. , IS: "EU-London"
  514. , IN: "JP-Tokyo"
  515. , ID: "JP-Tokyo"
  516. , IR: "JP-Tokyo"
  517. , IQ: "JP-Tokyo"
  518. , IE: "EU-London"
  519. , IM: "EU-London"
  520. , IL: "JP-Tokyo"
  521. , IT: "EU-London"
  522. , JM: "US-Atlanta"
  523. , JP: "JP-Tokyo"
  524. , JE: "EU-London"
  525. , JO: "JP-Tokyo"
  526. , KZ: "JP-Tokyo"
  527. , KE: "EU-London"
  528. , KI: "SG-Singapore"
  529. , KP: "JP-Tokyo"
  530. , KR: "JP-Tokyo"
  531. , KW: "JP-Tokyo"
  532. , KG: "JP-Tokyo"
  533. , LA: "JP-Tokyo"
  534. , LV: "EU-London"
  535. , LB: "JP-Tokyo"
  536. , LS: "EU-London"
  537. , LR: "EU-London"
  538. , LY: "EU-London"
  539. , LI: "EU-London"
  540. , LT: "EU-London"
  541. , LU: "EU-London"
  542. , MO: "JP-Tokyo"
  543. , MK: "EU-London"
  544. , MG: "EU-London"
  545. , MW: "EU-London"
  546. , MY: "JP-Tokyo"
  547. , MV: "JP-Tokyo"
  548. , ML: "EU-London"
  549. , MT: "EU-London"
  550. , MH: "SG-Singapore"
  551. , MQ: "US-Atlanta"
  552. , MR: "EU-London"
  553. , MU: "EU-London"
  554. , YT: "EU-London"
  555. , MX: "US-Atlanta"
  556. , FM: "SG-Singapore"
  557. , MD: "EU-London"
  558. , MC: "EU-London"
  559. , MN: "JP-Tokyo"
  560. , ME: "EU-London"
  561. , MS: "US-Atlanta"
  562. , MA: "EU-London"
  563. , MZ: "EU-London"
  564. , MM: "JP-Tokyo"
  565. , NA: "EU-London"
  566. , NR: "SG-Singapore"
  567. , NP: "JP-Tokyo"
  568. , NL: "EU-London"
  569. , NC: "SG-Singapore"
  570. , NZ: "SG-Singapore"
  571. , NI: "US-Atlanta"
  572. , NE: "EU-London"
  573. , NG: "EU-London"
  574. , NU: "SG-Singapore"
  575. , NF: "SG-Singapore"
  576. , MP: "SG-Singapore"
  577. , NO: "EU-London"
  578. , OM: "JP-Tokyo"
  579. , PK: "JP-Tokyo"
  580. , PW: "SG-Singapore"
  581. , PS: "JP-Tokyo"
  582. , PA: "US-Atlanta"
  583. , PG: "SG-Singapore"
  584. , PY: "BR-Brazil"
  585. , PE: "BR-Brazil"
  586. , PH: "JP-Tokyo"
  587. , PN: "SG-Singapore"
  588. , PL: "EU-London"
  589. , PT: "EU-London"
  590. , PR: "US-Atlanta"
  591. , QA: "JP-Tokyo"
  592. , RE: "EU-London"
  593. , RO: "EU-London"
  594. , RU: "RU-Russia"
  595. , RW: "EU-London"
  596. , BL: "US-Atlanta"
  597. , SH: "EU-London"
  598. , KN: "US-Atlanta"
  599. , LC: "US-Atlanta"
  600. , MF: "US-Atlanta"
  601. , PM: "US-Atlanta"
  602. , VC: "US-Atlanta"
  603. , WS: "SG-Singapore"
  604. , SM: "EU-London"
  605. , ST: "EU-London"
  606. , SA: "EU-London"
  607. , SN: "EU-London"
  608. , RS: "EU-London"
  609. , SC: "EU-London"
  610. , SL: "EU-London"
  611. , SG: "JP-Tokyo"
  612. , SX: "US-Atlanta"
  613. , SK: "EU-London"
  614. , SI: "EU-London"
  615. , SB: "SG-Singapore"
  616. , SO: "EU-London"
  617. , ZA: "EU-London"
  618. , SS: "EU-London"
  619. , ES: "EU-London"
  620. , LK: "JP-Tokyo"
  621. , SD: "EU-London"
  622. , SR: "BR-Brazil"
  623. , SJ: "EU-London"
  624. , SZ: "EU-London"
  625. , SE: "EU-London"
  626. , CH: "EU-London"
  627. , SY: "EU-London"
  628. , TW: "JP-Tokyo"
  629. , TJ: "JP-Tokyo"
  630. , TZ: "EU-London"
  631. , TH: "JP-Tokyo"
  632. , TL: "JP-Tokyo"
  633. , TG: "EU-London"
  634. , TK: "SG-Singapore"
  635. , TO: "SG-Singapore"
  636. , TT: "US-Atlanta"
  637. , TN: "EU-London"
  638. , TR: "TK-Turkey"
  639. , TM: "JP-Tokyo"
  640. , TC: "US-Atlanta"
  641. , TV: "SG-Singapore"
  642. , UG: "EU-London"
  643. , UA: "EU-London"
  644. , AE: "EU-London"
  645. , GB: "EU-London"
  646. , US: "US-Atlanta"
  647. , UM: "SG-Singapore"
  648. , VI: "US-Atlanta"
  649. , UY: "BR-Brazil"
  650. , UZ: "JP-Tokyo"
  651. , VU: "SG-Singapore"
  652. , VE: "BR-Brazil"
  653. , VN: "JP-Tokyo"
  654. , WF: "SG-Singapore"
  655. , EH: "EU-London"
  656. , YE: "JP-Tokyo"
  657. , ZM: "EU-London"
  658. , ZW: "EU-London"
  659. };
  660. a.Maths = function (a) {
  661. function b(a, b, e) {
  662. return a < b ? b : a > e ? e : a
  663. }
  664. a.w = function (a, e, c) {
  665. c = b(c, 0, 1);
  666. return a + c * (e - a)
  667. };
  668. a.v = b;
  669. a.fixed = function (a, b) {
  670. var e = Math.pow(10, b);
  671. return ~~(a * e) / e
  672. };
  673. return a
  674. }({});
  675. a.Utils = function (a) {
  676. a.B = function () {
  677. for (var a = new Date, b = [a.getMonth() + 1, a.getDate(), a.getFullYear()], a = [a.getHours(), a.getMinutes(), a.getSeconds()], c = 1; 3 > c; c++) 10 > a[c] && (a[c] = "0" + a[c]);
  678. return "[" + b.join("/") + " " + a.join(":") + "]"
  679. };
  680. return a
  681. }({});
  682. Date.now || (Date.now = function () {
  683. return (new Date)
  684. .getTime()
  685. });
  686. var q = "storeObjectInfo"
  687. , z = {
  688. context: null
  689. , defaultProvider: "facebook"
  690. , loginIntent: "0"
  691. , userInfo: {
  692. socialToken: null
  693. , tokenExpires: ""
  694. , level: ""
  695. , xp: ""
  696. , xpNeeded: ""
  697. , name: ""
  698. , picture: ""
  699. , displayName: ""
  700. , loggedIn: "0"
  701. , socialId: ""
  702. }
  703. }
  704. , d = a.defaultSt = z;
  705. a.storageInfo = d;
  706. a.createDefaultStorage = function () {
  707. d = z
  708. };
  709. a.updateStorage = w;
  710. a.hasLoginIntent = function () {
  711. return "1" == d.loginIntent
  712. };
  713. a.checkLoginStatus = function () {
  714. "1" == d.loginIntent && (x(), F(d.context))
  715. };
  716. var x = function () {
  717. a.MC.setProfilePicture(d.userInfo.picture);
  718. a.MC.setSocialId(d.userInfo.socialId)
  719. };
  720. a.logout = function () {
  721. d = z;
  722. delete a.localStorage[q];
  723. a.localStorage[q] = JSON.stringify(z);
  724. w();
  725. "google" == d.context && R();
  726. f.cache.sentGameServerLogin = !1;
  727. delete f.cache.login_info;
  728. c("#helloContainer")
  729. .attr("data-logged-in", "0");
  730. c("#helloContainer")
  731. .attr("data-has-account-data", "0");
  732. c(".timer")
  733. .text("");
  734. c("#gPlusShare")
  735. .hide();
  736. c("#fbShare")
  737. .show();
  738. c("#user-id-tag")
  739. .text("");
  740. c(".shop-blocker")
  741. .fadeOut(100);
  742. MC.doLogout();
  743. MC.reconnect()
  744. };
  745. a.animateAccountData = r;
  746. a.toggleSocialLogin = function () {
  747. c("#socialLoginContainer")
  748. .toggle();
  749. c("#settings")
  750. .hide();
  751. c("#instructions")
  752. .hide();
  753. MC.showInstructionsPanel()
  754. };
  755. a.toggleSettings = function () {
  756. c("#settings")
  757. .toggle();
  758. c("#socialLoginContainer")
  759. .hide();
  760. c("#instructions")
  761. .hide();
  762. MC.showInstructionsPanel()
  763. };
  764. f.account = function (b) {
  765. function e() {}
  766.  
  767. function k(b, c) {
  768. a.TRModule.init(c.id);
  769. if (null == h || h.id != c.id) h = c, null != a.ssa_json && (a.ssa_json.applicationUserId = "" + c.id, a.ssa_json.custom_user_id = "" + c.id), "undefined" != typeof SSA_CORE && SSA_CORE.start()
  770. }
  771. var h = null;
  772. b.init = function () {
  773. f.core.bind("user_login", k);
  774. f.core.bind("user_logout", e)
  775. };
  776. b.setUserData = function (a) {
  777. G(a)
  778. };
  779. b.setAccountData = function (a, b) {
  780. var e = c("#helloContainer")
  781. .attr("data-has-account-data", "1");
  782. d.userInfo.xp = a.xp;
  783. d.userInfo.xpNeeded = a.xpNeeded;
  784. d.userInfo.level = a.level;
  785. w();
  786. e && b ? r(a) : (c(".agario-profile-panel .progress-bar-star")
  787. .text(a.level), c(".agario-exp-bar .progress-bar-text")
  788. .text(a.xp + "/" + a.xpNeeded + " XP"), c(".agario-exp-bar .progress-bar")
  789. .css("width", (88 * a.xp / a.xpNeeded)
  790. .toFixed(2) + "%"))
  791. };
  792. b.u = function (a) {
  793. r(a)
  794. };
  795. return b
  796. }({});
  797. var N = 0
  798. , J = !1
  799. , I = !1
  800. , B = "public_profile,email,user_friends";
  801. a.facebookLogin = function () {
  802. alert("Facebook Login is unavailable, please try again later or check if you are using private mode.")
  803. };
  804. a.getFacebookPermissions = function () {
  805. return d.permissions
  806. };
  807. a.fetchFacebookPermissions = function () {
  808. a.FB.api("/me/permissions", function (a) {
  809. a && a.data && (d.permissions = a.data)
  810. })
  811. };
  812. a.requestExtraPermissions = function (b) {
  813. var c = a.checkFacebookPermissions(b);
  814. c || (-1 == B.indexOf(b) && (B += "," + b), a.facebookRelogin());
  815. return !c
  816. };
  817. a.checkFacebookPermissions = function (b) {
  818. var c = a.getFacebookPermissions;
  819. if (c) {
  820. c = c();
  821. b = b.split(",");
  822. if (null == c) return !1;
  823. for (var d = 0; d < b.length; d++) {
  824. for (var f = !1, g = 0; g < c.length; g++) b[d] == c[g].permission && "granted" == c[g].status && (f = !0);
  825. if (!f) return !1
  826. }
  827. return !0
  828. }
  829. return !1
  830. };
  831. a.fbAsyncInit = function () {
  832. a.FB.init({
  833. appId: EnvConfig.fb_app_id
  834. , cookie: !0
  835. , xfbml: !0
  836. , status: !0
  837. , version: "v2.8"
  838. });
  839. J = !0;
  840. H();
  841. if (EnvConfig.env_staging || EnvConfig.env_production) {
  842. var b = document.createElement("script")
  843. , c = document.getElementsByTagName("script")[0];
  844. b.src = "https://renotifier.miniclippt.com/rntracking.js?app_id=" +
  845. EnvConfig.fb_app_id;
  846. c.parentNode.insertBefore(b, c)
  847. }
  848. };
  849. var D = !1;
  850. (function (b) {
  851. function d() {
  852. var a = document.createElement("script");
  853. a.type = "text/javascript";
  854. a.async = !0;
  855. a.src = "//apis.google.com/js/client:platform.js?onload=gapiAsyncInit";
  856. var b = document.getElementsByTagName("script")[0];
  857. b.parentNode.insertBefore(a, b);
  858. h = !0
  859. }
  860. var f = {}
  861. , h = !1;
  862. a.gapiAsyncInit = function () {
  863. c(f)
  864. .trigger("initialized")
  865. };
  866. b.google = {
  867. h: function () {
  868. d()
  869. }
  870. , g: function (b, c) {
  871. a.gapi.client.load("plus", "v1", function () {
  872. gapi.client.plus.people.get({
  873. userId: "me"
  874. })
  875. .execute(function (a) {
  876. c(a)
  877. })
  878. })
  879. }
  880. };
  881. b.o = function (a) {
  882. h || d();
  883. "undefined" !== typeof gapi ? a() : c(f)
  884. .bind("initialized", a)
  885. };
  886. return b
  887. })(f);
  888. m = function (b) {
  889. function e(b) {
  890. a.MC.doLoginWithGPlus(b);
  891. f.cache.login_info = [b, "google"];
  892. a.MC.showInstructionsPanel(!0)
  893. }
  894.  
  895. function k(a) {
  896. d.userInfo.picture = a;
  897. c(".agario-profile-picture")
  898. .attr("src", a)
  899. }
  900. var h = !1
  901. , g = !1
  902. , l = null
  903. , m = {
  904. client_id: EnvConfig.gplus_client_id
  905. , cookie_policy: "single_host_origin"
  906. , scope: "https://www.googleapis.com/auth/plus.login email"
  907. , app_package_name: "com.miniclip.agar.io"
  908. };
  909. b.a = {
  910. D: function () {
  911. return l
  912. }
  913. , s: function () {
  914. return d && "1" == d.loginIntent && "google" == d.context
  915. }
  916. , init: function () {
  917. var b = this;
  918. f.o(function () {
  919. a.gapi.ytsubscribe.go("agarYoutube");
  920. h = !0;
  921. b.b()
  922. })
  923. }
  924. , b: function () {
  925. if (1 != g && 0 != A && 0 != h) {
  926. g = !0;
  927. var b = this;
  928. a.gapi.load("auth2", function () {
  929. l = a.gapi.auth2.init(m);
  930. var c = document.getElementById("gplusLogin");
  931. c.addEventListener("click", function () {
  932. a.MC.googleLogin();
  933. b.l(a.open, l)
  934. });
  935. l.attachClickHandler(c, {}, function () {}, b.c);
  936. l.currentUser.listen(_.bind(b.m, b));
  937. l.then(_.bind(b.j, b), _.bind(b.c, b))
  938. })
  939. }
  940. }
  941. , l: function (b) {
  942. a.open = function () {
  943. a.open = b;
  944. var c = b.apply(this, arguments)
  945. , d = setInterval(function () {
  946. c.closed && (clearInterval(d), a.MC.onGoogleLoginComplete())
  947. }, 100);
  948. return c
  949. }
  950. }
  951. , j: function () {
  952. l.currentUser.get();
  953. this.s() && !l.isSignedIn.get() && a.logout()
  954. }
  955. , c: function () {}
  956. , m: function (b) {
  957. if (null != l && null != b) {
  958. if (l.isSignedIn.get() && !D) {
  959. D = !0;
  960. d.loginIntent = "1";
  961. var c = b.getAuthResponse()
  962. , g = c.access_token
  963. , h = b.getBasicProfile();
  964. b = h.getImageUrl();
  965. void 0 == b ? f.google.g(c, function (b) {
  966. b.result.isPlusUser ? (b && k(b.image.url), e(g), b && (d.userInfo.picture = b.image.url), d.userInfo.socialId = h.getId(), x()) : (alert("Please add Google+ to your Google account and try again.\nOr you can login with another account."), a.logout())
  967. }) : (k(b), d.userInfo.picture = b, d.userInfo.socialId = h.getId(), x(), e(g));
  968. d.context = "google";
  969. a.updateStorage()
  970. }
  971. a.MC.onGoogleLoginComplete()
  972. }
  973. }
  974. , i: function () {
  975. l && (l.signOut(), D = !1)
  976. }
  977. };
  978. return b
  979. }(f);
  980. a.gplusModule = m;
  981. var R = function () {
  982. f.a.i()
  983. };
  984. a.logoutGooglePlus = R;
  985. a.getStatsString = function (b) {
  986. var d = c(".stats-time-alive")
  987. .text();
  988. return a.parseString(b, "%@", [d.split(":")[0], d.split(":")[1], c(".stats-highest-mass")
  989. .text()])
  990. };
  991. a.twitterShareStats = function () {
  992. a.open("https://twitter.com/intent/tweet?text=" + a.getStatsString("page_tt_share_stats"), "Agar.io", "width=660,height=310,menubar=no,toolbar=no,resizable=yes,scrollbars=no,left=" + (a.screenX + a.innerWidth / 2 - 330) + ",top=" + (a.innerHeight - 310) / 2)
  993. };
  994. a.fbShareStats = function () {
  995. var b = a.i18n("page_fb_matchresults_title")
  996. , c = a.i18n("page_fb_matchresults_description")
  997. , d = a.getStatsString("page_fb_matchresults_subtitle");
  998. a.FB.ui({
  999. method: "feed"
  1000. , display: "iframe"
  1001. , name: b
  1002. , caption: c
  1003. , description: d
  1004. , link: "http://agar.io"
  1005. , A: "http://static2.miniclipcdn.com/mobile/agar/Agar.io_matchresults_fb_1200x630.png"
  1006. , actions: {
  1007. name: "play now!"
  1008. , link: "http://agar.io"
  1009. }
  1010. })
  1011. };
  1012. a.fillSocialValues = function (b, c) {
  1013. "google" == a.storageInfo.context && a.gapi.interactivepost.render(c, {
  1014. contenturl: EnvConfig.game_url
  1015. , clientid: EnvConfig.gplus_client_id
  1016. , cookiepolicy: "http://agar.io"
  1017. , prefilltext: b
  1018. , calltoactionlabel: "BEAT"
  1019. , calltoactionurl: EnvConfig.game_url
  1020. })
  1021. };
  1022. c(function () {
  1023. a.f();
  1024. "MAsyncInit" in a && a.MAsyncInit();
  1025. c("[data-itr]")
  1026. .each(function () {
  1027. var b = c(this)
  1028. , d = b.attr("data-itr");
  1029. b.html(a.i18n(d))
  1030. })
  1031. })
  1032. }
  1033. }
  1034. } else alert("You browser does not support this game, we recommend you to use Firefox to play this")
  1035. })(window, window.jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement