Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /** @type {string} */
- var URL_MESSAGE =
- "https://googledrive.com/host/0Bx5EmU2kLXq9alVNVTQxX0FFd1k/_message.txt";
- /** @type {number} */
- var testingVal = 29;
- /** @type {number} */
- var testingCount = 0;
- /** @type {boolean} */
- var testingInd = false;
- /** @type {string} */
- var PRIVATE_SERVER_IP = "__";
- /** @type {string} */
- i18n_lang = "en";
- i18n_dict = {
- "en": {
- "connecting": "Connecting",
- "connect_help": "If you cannot connect to the servers, check if you have some anti virus or firewall blocking the connection.",
- "play": "Play",
- "spectate": "Spectate",
- "login_and_play": "Login and play",
- "play_as_guest": "Play as guest",
- "share": "Share",
- "advertisement": "Advertisement",
- "privacy_policy": "Privacy Policy",
- "terms_of_service": "Terms of Service",
- "changelog": "Changelog",
- "instructions_mouse": "Move your mouse to control your cell",
- "instructions_space": "Press <b>Space</b> to split",
- "instructions_w": "Press <b>W</b> to eject some mass",
- "gamemode_ffa": "FFA",
- "gamemode_teams": "Teams",
- "gamemode_experimental": "Experimental",
- "region_select": " -- Select a Region -- ",
- "region_us_east": "US East",
- "region_us_west": "US West",
- "region_north_america": "North America",
- "region_south_america": "South America",
- "region_europe": "Europe",
- "region_turkey": "Turkey",
- "region_poland": "Poland",
- "region_east_asia": "East Asia",
- "region_russia": "Russia",
- "region_china": "China",
- "region_oceania": "Oceania",
- "region_australia": "Australia",
- "region_players": "players",
- "option_no_skins": "No skins",
- "option_no_names": "No names",
- "option_dark_theme": "Dark theme",
- "option_no_colors": "No colors",
- "option_show_mass": "Show mass",
- "leaderboard": "Leaderboard",
- "unnamed_cell": "An unnamed cell",
- "last_match_results": "Last match results",
- "score": "Score",
- "leaderboard_time": "Leaderboard Time",
- "mass_eaten": "Mass Eaten",
- "top_position": "Top Position",
- "position_1": "First",
- "position_2": "Second",
- "position_3": "Third",
- "position_4": "Fourth",
- "position_5": "Fifth",
- "position_6": "Sixth",
- "position_7": "Seventh",
- "position_8": "Eighth",
- "position_9": "Ninth",
- "position_10": "Tenth",
- "player_cells_eaten": "Player Cells Eaten",
- "survival_time": "Survival Time",
- "games_played": "Games played",
- "highest_mass": "Highest mass",
- "total_cells_eaten": "Total cells eaten",
- "total_mass_eaten": "Total mass eaten",
- "longest_survival": "Longest survival",
- "logout": "Logout",
- "stats": "Stats",
- "shop": "Shop",
- "party": "Party",
- "party_description": "Play with your friends in the same map",
- "create_party": "Create",
- "creating_party": "Creating party...",
- "join_party": "Join",
- "back_button": "Back",
- "joining_party": "Joining party...",
- "joined_party_instructions": "You are now playing with this party:",
- "party_join_error": "There was a problem joining that party, please make sure the code is correct, or try creating another party",
- "login_tooltip": "Login with Facebook and get:<br /><br /><br />Start the game with more mass!<br />Level up to get even more starting mass!",
- "create_party_instructions": "Give this link to your friends:",
- "join_party_instructions": "Your friend should have given you a code, type it here:",
- "continue": "Continue",
- "option_skip_stats": "Skip stats",
- "stats_food_eaten": "food eaten",
- "stats_highest_mass": "highest mass",
- "stats_time_alive": "time alive",
- "stats_leaderboard_time": "leaderboard time",
- "stats_cells_eaten": "cells eaten",
- "stats_top_position": "top position",
- "": ""
- }
- };
- i18n = i18n_dict[i18n_lang];
- var myApp;
- /** @type {Array} */
- var nodeList = [];
- /** @type {null} */
- var chatRoom = null;
- /** @type {null} */
- var minimap = null;
- /** @type {null} */
- var socket = null;
- /** @type {string} */
- var currentIP = "";
- /** @type {string} */
- var teamname = "HKG";
- /** @type {string} */
- var defaultTeamname = "HKG";
- var socketRetryInterval;
- /** @type {boolean} */
- var isSocketReady = false;
- /** @type {boolean} */
- var isChangeName = false;
- /** @type {null} */
- var conn = null;
- /** @type {number} */
- var reconnectCount = 0;
- /** @type {number} */
- var updateLBCount = 0;
- /** @type {string} */
- var tmpTeamname = "";
- /** @type {Image} */
- var defaultImage = new Image;
- /** @type {string} */
- defaultImage["src"] =
- "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNi4yLjEsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB3aWR0aD0iNTEycHgiIGhlaWdodD0iNTEycHgiIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MTIgNTEyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8Zz4NCgk8Zz4NCgkJPHBhdGggZD0iTTI1Niw0OEMxNDEuMSw0OCw0OCwxNDEuMSw0OCwyNTZzOTMuMSwyMDgsMjA4LDIwOGMxMTQuOSwwLDIwOC05My4xLDIwOC0yMDhTMzcwLjksNDgsMjU2LDQ4eiBNMjU2LDQ0Ni43DQoJCQljLTEwNS4xLDAtMTkwLjctODUuNS0xOTAuNy0xOTAuN2MwLTEwNS4xLDg1LjUtMTkwLjcsMTkwLjctMTkwLjdjMTA1LjEsMCwxOTAuNyw4NS41LDE5MC43LDE5MC43DQoJCQlDNDQ2LjcsMzYxLjEsMzYxLjEsNDQ2LjcsMjU2LDQ0Ni43eiIvPg0KCTwvZz4NCjwvZz4NCjxnPg0KCTxnPg0KCQk8cGF0aCBkPSJNMjU2LDk2Yy04OC40LDAtMTYwLDcxLjYtMTYwLDE2MGMwLDg4LjQsNzEuNiwxNjAsMTYwLDE2MGM4OC40LDAsMTYwLTcxLjYsMTYwLTE2MEM0MTYsMTY3LjYsMzQ0LjQsOTYsMjU2LDk2eiIvPg0KCTwvZz4NCjwvZz4NCjwvc3ZnPg0K";
- var customSkin = {
- "DEFAULT": defaultImage
- };
- /** @type {string} */
- var announcementTxt = "";
- var Action = {
- COPY: "HKGAGARTOOLCOPY",
- IMAGE: "HKGAGARTOOLIMAGE",
- FINISH: "HKGAGARTOOLFINISH"
- };
- /** @type {boolean} */
- var isJoinedGame = false;
- var hotkeyConfig = {};
- var hotkeyMapping = {};
- var teammateIdt = {};
- var defaultHotkeyMapping = {};
- var selectedHotkeyRow;
- var hotkeyMessageSend = {};
- /** @type {boolean} */
- var isWindowFocus = true;
- /** @type {Array} */
- var skinDownloadQueue = [];
- var skinDownloadFail = {};
- /** @type {Array} */
- var toastQueue = [];
- /** @type {string} */
- var defaultSkin = "DEFAULT";
- var gm;
- var defaultHotkeyMessageSend = {
- "input_hk_send_msg1": "街裡愛人一對對~♫",
- "input_hk_send_msg2": "16space 晒比ME",
- "input_hk_send_msg3": "唔好W!!!",
- "input_hk_send_msg4": "走呀好大隻!!!",
- "input_hk_send_msg5": "高速移動PLZ",
- "input_hk_send_msg6": "合咗先!?",
- "input_hk_send_msg7": "唔好咁~",
- "input_hk_send_msg8": "分開FARM",
- "input_hk_send_msg9": "花生友不如入場玩~? = =",
- "input_hk_send_msg10": "完場未?"
- };
- var hkgIcon = {
- "[sosading]": "https://na.cx/i/H82r31.gif",
- ":Plm2": "http://i.imgur.com/K1MuLWc.gif",
- ":Plm3": "https://na.cx/i/r71DPC.gif",
- "xx(lm": "http://forum14.hkgolden.com/faces/lomore/dead.gif",
- ":o)lm": "http://forum14.hkgolden.com/faces/lomore/clown.gif",
- "#ass#lm": "http://forum14.hkgolden.com/faces/lomore/ass.gif",
- ":)lm": "http://forum14.hkgolden.com/faces/lomore/smile.gif",
- ":o)2lm": "http://forum14.hkgolden.com/faces/lomore/clown2.gif",
- ":o)3lm": "http://forum14.hkgolden.com/faces/lomore/clown3.gif",
- ":o)4lm": "http://forum14.hkgolden.com/faces/lomore/clown4.gif",
- ":-(lm": "http://forum14.hkgolden.com/faces/lomore/frown.gif",
- ":~(lm": "http://forum14.hkgolden.com/faces/lomore/cry.gif",
- ";-)lm": "http://forum14.hkgolden.com/faces/lomore/wink.gif",
- ":-[lm": "http://forum14.hkgolden.com/faces/lomore/angry.gif",
- ":-]lm": "http://forum14.hkgolden.com/faces/lomore/devil.gif",
- ":Dlm": "http://forum14.hkgolden.com/faces/lomore/biggrin.gif",
- ":Olm": "http://forum14.hkgolden.com/faces/lomore/oh.gif",
- ":Plm": "http://forum14.hkgolden.com/faces/lomore/tongue.gif",
- "^3^lm": "http://forum14.hkgolden.com/faces/lomore/kiss.gif",
- "?_?lm": "http://forum14.hkgolden.com/faces/lomore/wonder.gif",
- "#yup#lm": "http://forum14.hkgolden.com/faces/lomore/agree.gif",
- "#hehe#lm": "http://forum14.hkgolden.com/faces/lomore/hehe.gif",
- "#love#lm": "http://forum14.hkgolden.com/faces/lomore/love.gif",
- "#oh#lm": "http://forum14.hkgolden.com/faces/lomore/surprise.gif",
- "[sosad]lm": "http://forum14.hkgolden.com/faces/lomore/sosad.gif",
- "#good#lm": "http://forum14.hkgolden.com/faces/lomore/good.gif",
- "#hoho#lm": "http://forum14.hkgolden.com/faces/lomore/hoho.gif",
- "#kill#lm": "http://forum14.hkgolden.com/faces/lomore/kill.gif",
- "@_@lm": "http://forum14.hkgolden.com/faces/lomore/@.gif",
- "#adore#lm": "http://forum14.hkgolden.com/faces/lomore/adore.gif",
- "???lm": "http://forum14.hkgolden.com/faces/lomore/wonder2.gif",
- "[banghead]lm": "http://forum14.hkgolden.com/faces/lomore/banghead.gif",
- "[bouncer]lm": "http://forum14.hkgolden.com/faces/lomore/bouncer.gif",
- "[flowerface]lm": "http://forum14.hkgolden.com/faces/lomore/flowerface.gif",
- "[shocking]lm": "http://forum14.hkgolden.com/faces/lomore/shocking.gif",
- "[photo]lm": "http://forum14.hkgolden.com/faces/lomore/photo.gif",
- "[yipes]lm": "http://forum14.hkgolden.com/faces/lomore/yipes.gif",
- "[369]lm": "http://forum14.hkgolden.com/faces/lomore/369.gif",
- "[slick]lm": "http://forum14.hkgolden.com/faces/lomore/slick.gif",
- "fucklm": "http://forum14.hkgolden.com/faces/lomore/diu.gif",
- "fuck2lm": "http://forum14.hkgolden.com/faces/lomore/diu2.gif",
- "#kill2#lm": "http://forum14.hkgolden.com/faces/lomore/Kill2lm.gif",
- "[offtopic]lm": "http://forum14.hkgolden.com/faces/lomore/offtopic.gif",
- "O:-)": "http://forum14.hkgolden.com/faces/angel.gif",
- "xx(": "http://forum14.hkgolden.com/faces/dead.gif",
- ":)": "http://forum14.hkgolden.com/faces/smile.gif",
- ":o)": "http://forum14.hkgolden.com/faces/clown.gif",
- ":-(": "http://forum14.hkgolden.com/faces/frown.gif",
- ":~(": "http://forum14.hkgolden.com/faces/cry.gif",
- ";-)": "http://forum14.hkgolden.com/faces/wink.gif",
- ":-[": "http://forum14.hkgolden.com/faces/angry.gif",
- ":-]": "http://forum14.hkgolden.com/faces/devil.gif",
- ":D": "http://forum14.hkgolden.com/faces/biggrin.gif",
- ":O": "http://forum14.hkgolden.com/faces/oh.gif",
- ":P": "http://forum14.hkgolden.com/faces/tongue.gif",
- "^3^": "http://forum14.hkgolden.com/faces/kiss.gif",
- "?_?": "http://forum14.hkgolden.com/faces/wonder.gif",
- "#yup#": "http://forum14.hkgolden.com/faces/agree.gif",
- "#ng#": "http://forum14.hkgolden.com/faces/donno.gif",
- "#hehe#": "http://forum14.hkgolden.com/faces/hehe.gif",
- "#love#": "http://forum14.hkgolden.com/faces/love.gif",
- "#oh#": "http://forum14.hkgolden.com/faces/surprise.gif",
- "#cn#": "http://forum14.hkgolden.com/faces/chicken.gif",
- "#ass#": "http://forum14.hkgolden.com/faces/ass.gif",
- "[sosad]": "http://forum14.hkgolden.com/faces/sosad.gif",
- "#good#": "http://forum14.hkgolden.com/faces/good.gif",
- "#hoho#": "http://forum14.hkgolden.com/faces/hoho.gif",
- "#kill#": "http://forum14.hkgolden.com/faces/kill.gif",
- "#bye#": "http://forum14.hkgolden.com/faces/bye.gif",
- "Z_Z": "http://forum14.hkgolden.com/faces/z.gif",
- "@_@": "http://forum14.hkgolden.com/faces/@.gif",
- "#adore#": "http://forum14.hkgolden.com/faces/adore.gif",
- "???": "http://forum14.hkgolden.com/faces/wonder2.gif",
- "[banghead]": "http://forum14.hkgolden.com/faces/banghead.gif",
- "[bouncer]": "http://forum14.hkgolden.com/faces/bouncer.gif",
- "[bouncy]": "http://forum14.hkgolden.com/faces/bouncy.gif",
- "[censored]": "http://forum14.hkgolden.com/faces/censored.gif",
- "[flowerface]": "http://forum14.hkgolden.com/faces/flowerface.gif",
- "[shocking]": "http://forum14.hkgolden.com/faces/shocking.gif",
- "[photo]": "http://forum14.hkgolden.com/faces/photo.gif",
- "#fire#": "http://forum14.hkgolden.com/faces/fire.gif",
- "[yipes]": "http://forum14.hkgolden.com/faces/yipes.gif",
- "[369]": "http://forum14.hkgolden.com/faces/369.gif",
- "[bomb]": "http://forum14.hkgolden.com/faces/bomb.gif",
- "[slick]": "http://forum14.hkgolden.com/faces/slick.gif",
- "fuck": "http://forum14.hkgolden.com/faces/fuck.gif",
- "#no#": "http://forum14.hkgolden.com/faces/no.gif",
- "#kill2#": "http://forum14.hkgolden.com/faces/kill2.gif",
- "[offtopic]": "http://forum14.hkgolden.com/faces/offtopic.gif"
- };
- /** @type {number} */
- var selected_profile = 0;
- /** @type {Array} */
- var player_profile = [{
- name: "不留名 [slick]",
- team: "HKG",
- skinurl: defaultSkin
- }, {
- name: "Profile 2",
- team: "team2",
- skinurl: "https://181cfbce4e26cf7f3642ac9e82d9e05ca7869931-www.googledrive.com/host/0B6Qc5Ss9h9-sfmhZMXBsRHYySVZFTzl5cVFkX3VPYjlDU3JJVmhwbzV2LVc5MGk4c3RHVDg/circles.png"
- }, {
- name: "Profile 3",
- team: "team3",
- skinurl: "https://181cfbce4e26cf7f3642ac9e82d9e05ca7869931-www.googledrive.com/host/0B6Qc5Ss9h9-sfmhZMXBsRHYySVZFTzl5cVFkX3VPYjlDU3JJVmhwbzV2LVc5MGk4c3RHVDg/1.png"
- }];
- myApp = new MyApp;
- myApp["init"]();
- (function (win, log) {
- /**
- * @return {undefined}
- */
- function init() {
- /** @type {boolean} */
- _0x3495xa5 = true;
- draw();
- setInterval(draw, 18E4);
- style = a = document["getElementById"]("canvas");
- var iframedoc = document["getElementById"]("overlays2");
- /**
- * @param {Object} xs
- * @return {undefined}
- */
- iframedoc["onmousemove"] = function (xs) {
- y = xs["clientX"];
- x = xs["clientY"];
- prep();
- };
- options = style["getContext"]("2d");
- if(/firefox/i ["test"](navigator["userAgent"])) {
- document["addEventListener"]("DOMMouseScroll", f3, false);
- } else {
- /** @type {function (Object): undefined} */
- document["body"]["onmousewheel"] = f3;
- }
- /** @type {boolean} */
- var memory = false;
- /** @type {boolean} */
- var stack = false;
- /** @type {boolean} */
- var list = false;
- /**
- * @param {Object} event
- * @return {undefined}
- */
- win["onkeydown"] = function (event) {
- if(!(32 != event["keyCode"])) {
- if(!chatRoom["isFocus"]()) {
- if(!memory) {
- f();
- toggleClass(17);
- /** @type {boolean} */
- memory = true;
- }
- }
- }
- if(!(81 != event["keyCode"])) {
- if(!stack) {
- toggleClass(18);
- /** @type {boolean} */
- stack = true;
- }
- }
- if(!(87 != event["keyCode"])) {
- if(!chatRoom["isFocus"]()) {
- if(!list) {
- f();
- toggleClass(21);
- /** @type {boolean} */
- list = true;
- }
- }
- }
- if(27 == event["keyCode"]) {
- event["preventDefault"]();
- show(300);
- }
- };
- /**
- * @param {Object} shortcuts
- * @return {undefined}
- */
- win["onkeyup"] = function (shortcuts) {
- if(32 == shortcuts["keyCode"]) {
- /** @type {boolean} */
- memory = false;
- }
- if(87 == shortcuts["keyCode"]) {
- /** @type {boolean} */
- list = false;
- }
- if(81 == shortcuts["keyCode"]) {
- if(stack) {
- toggleClass(19);
- /** @type {boolean} */
- stack = false;
- }
- }
- };
- /**
- * @return {undefined}
- */
- win["onblur"] = function () {
- toggleClass(19);
- /** @type {boolean} */
- list = stack = memory = false;
- };
- /** @type {function (): undefined} */
- win["onresize"] = resize;
- win["requestAnimationFrame"](LOAD);
- setInterval(f, 42);
- if(banner) {
- log("#region")["val"](banner);
- }
- replace();
- reset(log("#region")["val"]());
- if(0 == resizeUID) {
- if(banner) {
- animate();
- }
- }
- show(0);
- resize();
- if(win["location"]["hash"]) {
- if(6 <= win["location"]["hash"]["length"]) {
- success(win["location"]["hash"]);
- }
- }
- }
- /**
- * @param {Object} event
- * @return {undefined}
- */
- function f3(event) {
- if(!myApp["isEnableZoom"]) {
- return;
- }
- $timeout *= Math["pow"](myApp["getZoomSpeed"](), event["wheelDelta"] /
- -120 || (event["detail"] || 0));
- if(myApp["getZoomLimit"]() > $timeout) {
- $timeout = myApp["getZoomLimit"]();
- }
- if($timeout > 1 / w) {
- /** @type {number} */
- $timeout = 1 / w;
- }
- }
- /**
- * @return {undefined}
- */
- function throttledUpdate() {
- /** @type {null} */
- ea = null;
- }
- /**
- * @return {undefined}
- */
- function prep() {
- if(myApp["isStopMovement"]) {
- setPosition(key || value, b0 || old);
- } else {
- step = (y - width / 2) / w + value;
- h2 = (x - height / 2) / w + old;
- }
- }
- /**
- * @return {undefined}
- */
- function draw() {
- if(null == map) {
- map = {};
- log("#region")["children"]()["each"](function () {
- var obj = log(this);
- var objUid = obj["val"]();
- if(objUid) {
- map[objUid] = obj["text"]();
- }
- });
- }
- log["get"]("http://m.agar.io/info", function (data) {
- var old = {};
- var attr;
- for(attr in data["regions"]) {
- var name = attr["split"](":")[0];
- old[name] = old[name] || 0;
- old[name] += data["regions"][attr]["numPlayers"];
- }
- for(attr in old) {
- log('#region option[value="' + attr + '"]')["text"]
- (map[attr] + " (" + old[attr] + " players)");
- }
- }, "json");
- }
- /**
- * @return {undefined}
- */
- function createFile() {
- log("#overlays")["hide"]();
- log("#stats")["hide"]();
- log("#mainPanel")["hide"]();
- /** @type {boolean} */
- from = to = false;
- replace();
- }
- /**
- * @param {string} x
- * @return {undefined}
- */
- function reset(x) {
- if(log("#region")["val"]() == "gathering") {
- connect(PRIVATE_SERVER_IP, "");
- return;
- }
- if(x) {
- if(x != banner) {
- if(log("#region")["val"]() != x) {
- log("#region")["val"](x);
- }
- banner = win["localStorage"]["location"] = x;
- log(".region-message")["hide"]();
- log(".region-message." + x)["show"]();
- log(".btn-needs-server")["prop"]("disabled", false);
- if(_0x3495xa5) {
- animate();
- }
- }
- }
- }
- /**
- * @param {number} expectedHashCode
- * @return {undefined}
- */
- function show(expectedHashCode) {
- if(!to) {
- if(!from) {
- /** @type {null} */
- id = null;
- if(1E3 > expectedHashCode) {
- /** @type {number} */
- newEnd = 1;
- }
- /** @type {boolean} */
- to = true;
- log("#mainPanel")["show"]();
- if(0 < expectedHashCode) {
- log("#overlays")["fadeIn"](expectedHashCode);
- } else {
- log("#overlays")["show"]();
- }
- }
- }
- }
- /**
- * @param {string} expected
- * @return {undefined}
- */
- function fail(expected) {
- log("#helloContainer")["attr"]("data-gamemode", expected);
- /** @type {string} */
- message = expected;
- log("#gamemode")["val"](expected);
- }
- /**
- * @return {undefined}
- */
- function replace() {
- if(log("#region")["val"]()) {
- win["localStorage"]["location"] = log("#region")["val"]();
- } else {
- if(win["localStorage"]["location"]) {
- log("#region")["val"](win["localStorage"]["location"]);
- }
- }
- if(log("#region")["val"]()) {
- log("#locationKnown")["append"](log("#region"));
- } else {
- log("#locationUnknown")["append"](log("#region"));
- }
- }
- /**
- * @param {string} id
- * @return {?}
- */
- function require(id) {
- return win["i18n"][id] || (win["i18n_dict"]["en"][id] || id);
- }
- /**
- * @return {undefined}
- */
- function poll() {
- /** @type {number} */
- var uid = ++resizeUID;
- console["log"]("Find " + banner + message);
- log["ajax"]("http://m.agar.io/findServer", {
- /**
- * @return {undefined}
- */
- error: function () {
- setTimeout(poll, 1E3);
- },
- /**
- * @param {Object} value
- * @return {undefined}
- */
- success: function (value) {
- if(e != "" && value["ip"] != e) {
- poll();
- } else {
- if(uid == resizeUID) {
- if(value["alert"]) {
- alert(value["alert"]);
- }
- next("ws://" + value["ip"], value[
- "token"]);
- }
- }
- },
- dataType: "json",
- method: "POST",
- cache: false,
- crossDomain: true,
- data: (banner + message || "?") + "\n2200049715"
- });
- }
- /**
- * @return {undefined}
- */
- function animate() {
- if(_0x3495xa5) {
- if(banner) {
- log("#connecting")["show"]();
- poll();
- }
- }
- }
- /**
- * @param {string} request
- * @param {Object} res
- * @return {undefined}
- */
- function next(request, res) {
- /** @type {string} */
- currentIP = request;
- if(self) {
- /** @type {null} */
- self["onopen"] = null;
- /** @type {null} */
- self["onmessage"] = null;
- /** @type {null} */
- self["onclose"] = null;
- try {
- self["close"]();
- } catch(c) {}
- /** @type {null} */
- self = null;
- }
- if(dst["ip"]) {
- request = "ws://" + dst["ip"];
- }
- if(null != handler) {
- var fn = handler;
- /**
- * @return {undefined}
- */
- handler = function () {
- fn(res);
- };
- }
- if(isArr) {
- var replace = request["split"](":");
- /** @type {string} */
- request = replace[0] + "s://ip-" + replace[1]["replace"](/\./g,
- "-")["replace"](/\//g, "") + ".tech.agar.io:" + (+
- replace[2] + 2E3);
- }
- /** @type {Array} */
- p = [];
- /** @type {Array} */
- params = [];
- result = {};
- /** @type {Array} */
- h = [];
- /** @type {Array} */
- listeners = [];
- /** @type {Array} */
- stack = [];
- /** @type {null} */
- el = obj = null;
- /** @type {number} */
- currentValue = 0;
- /** @type {boolean} */
- item = false;
- console["log"]("Connecting to " + request);
- /** @type {WebSocket} */
- self = new WebSocket(request);
- /** @type {string} */
- self["binaryType"] = "arraybuffer";
- /**
- * @return {undefined}
- */
- self["onopen"] = function () {
- var udataCur;
- console["log"]("socket open");
- udataCur = forEach(5);
- udataCur["setUint8"](0, 254);
- udataCur["setUint32"](1, 5, true);
- addClass(udataCur);
- udataCur = forEach(5);
- udataCur["setUint8"](0, 255);
- udataCur["setUint32"](1, 2200049715, true);
- addClass(udataCur);
- udataCur = forEach(1 + res["length"]);
- udataCur["setUint8"](0, 80);
- /** @type {number} */
- var i = 0;
- for(; i < res["length"]; ++i) {
- udataCur["setUint8"](i + 1, res["charCodeAt"](i));
- }
- addClass(udataCur);
- observer();
- if(res["length"] > 4 && res["length"] <= 6) {
- callback("/#" + res);
- } else {
- callback("/");
- }
- };
- /** @type {function ((Object|string)): undefined} */
- self["onmessage"] = finish;
- /** @type {function (): undefined} */
- self["onclose"] = push;
- /**
- * @return {undefined}
- */
- self["onerror"] = function () {
- console["log"]("socket error");
- };
- }
- /**
- * @param {number} expectedNumberOfNonCommentArgs
- * @return {?}
- */
- function forEach(expectedNumberOfNonCommentArgs) {
- return new DataView(new ArrayBuffer(expectedNumberOfNonCommentArgs));
- }
- /**
- * @param {Object} value
- * @return {undefined}
- */
- function addClass(value) {
- err++;
- self["send"](value["buffer"]);
- }
- /**
- * @return {undefined}
- */
- function push() {
- if(item) {
- /** @type {number} */
- backoff = 500;
- }
- console["log"]("socket close");
- setTimeout(animate, backoff);
- backoff *= 2;
- }
- /**
- * @param {(Object|string)} result
- * @return {undefined}
- */
- function finish(result) {
- onComplete(new DataView(result["data"]));
- }
- /**
- * @param {Object} walkers
- * @return {undefined}
- */
- function onComplete(walkers) {
- /**
- * @return {?}
- */
- function wrapper() {
- /** @type {string} */
- var result = "";
- for(;;) {
- var fragment = walkers["getUint16"](node, true);
- node += 2;
- if(0 == fragment) {
- break;
- }
- result += String["fromCharCode"](fragment);
- }
- return result;
- }
- fx++;
- /** @type {number} */
- var node = 0;
- if(240 == walkers["getUint8"](node)) {
- node += 5;
- }
- switch(walkers["getUint8"](node++)) {
- case 16:
- render(walkers, node);
- break;
- case 17:
- current = walkers["getFloat32"](node, true);
- node += 4;
- expr = walkers["getFloat32"](node, true);
- node += 4;
- var type = walkers["getFloat32"](node, true);
- msg = type;
- if(!myApp["isEnableLockZoom"]) {
- cb = type;
- }
- node += 4;
- break;
- case 20:
- /** @type {Array} */
- params = [];
- /** @type {Array} */
- p = [];
- break;
- case 21:
- ref = walkers["getInt16"](node, true);
- node += 2;
- element = walkers["getInt16"](node, true);
- node += 2;
- if(!_0x3495xa6) {
- /** @type {boolean} */
- _0x3495xa6 = true;
- vvar = ref;
- openElement = element;
- }
- break;
- case 32:
- p["push"](walkers["getUint32"](node, true));
- node += 4;
- break;
- case 49:
- if(null != obj) {
- break;
- }
- var f = walkers["getUint32"](node, true);
- node = node + 4;
- /** @type {Array} */
- stack = [];
- /** @type {number} */
- var indexf = 0;
- for(; indexf < f; ++indexf) {
- var it = walkers["getUint32"](node, true);
- node = node + 4;
- stack["push"]({
- id: it,
- name: wrapper()
- });
- }
- break;
- case 50:
- /** @type {Array} */
- obj = [];
- f = walkers["getUint32"](node, true);
- node += 4;
- /** @type {number} */
- indexf = 0;
- for(; indexf < f; ++indexf) {
- obj["push"](walkers["getFloat32"](node, true));
- node += 4;
- }
- create();
- break;
- case 64:
- count = walkers["getFloat64"](node, true);
- node += 8;
- minY = walkers["getFloat64"](node, true);
- node += 8;
- idx = walkers["getFloat64"](node, true);
- node += 8;
- maxY = walkers["getFloat64"](node, true);
- node += 8;
- /** @type {number} */
- current = (idx + count) / 2;
- /** @type {number} */
- expr = (maxY + minY) / 2;
- /** @type {number} */
- cb = 1;
- if(0 == params["length"]) {
- /** @type {number} */
- value = current;
- /** @type {number} */
- old = expr;
- /** @type {number} */
- w = cb;
- }
- /** @type {number} */
- ln = idx - count;
- /** @type {number} */
- span = maxY - minY;
- myApp["afterGameLoaded"]();
- break;
- case 81:
- var i = walkers["getUint32"](node, true);
- node = node + 4;
- var email = walkers["getUint32"](node, true);
- node = node + 4;
- var position = walkers["getUint32"](node, true);
- node = node + 4;
- setTimeout(function () {
- load({
- d: i,
- e: email,
- c: position
- });
- }, 1200);
- }
- }
- /**
- * @param {Object} obj
- * @param {number} name
- * @return {undefined}
- */
- function render(obj, name) {
- /**
- * @return {?}
- */
- function readFile() {
- /** @type {string} */
- var str = "";
- for(;;) {
- var b = obj["getUint16"](name, true);
- name += 2;
- if(0 == b) {
- break;
- }
- str += String["fromCharCode"](b);
- }
- return str;
- }
- /**
- * @return {?}
- */
- function trim() {
- /** @type {string} */
- var str = "";
- for(;;) {
- var b = obj["getUint8"](name++);
- if(0 == b) {
- break;
- }
- str += String["fromCharCode"](b);
- }
- return str;
- }
- check = max = Date["now"]();
- if(!item) {
- /** @type {boolean} */
- item = true;
- ready();
- }
- /** @type {boolean} */
- _0x3495x9c = false;
- var m = obj["getUint16"](name, true);
- name += 2;
- /** @type {number} */
- var i = 0;
- for(; i < m; ++i) {
- var row = result[obj["getUint32"](name, true)];
- var data = result[obj["getUint32"](name + 4, true)];
- name += 8;
- if(row) {
- if(data) {
- data.R();
- data["o"] = data["x"];
- data["p"] = data["y"];
- data["n"] = data["size"];
- data["C"] = row["x"];
- data["D"] = row["y"];
- data["m"] = data["size"];
- data["K"] = max;
- fn(row, data);
- }
- }
- }
- /** @type {number} */
- i = 0;
- for(;;) {
- m = obj["getUint32"](name, true);
- name += 4;
- if(0 == m) {
- break;
- }
- ++i;
- var file;
- row = obj["getInt32"](name, true);
- name += 4;
- data = obj["getInt32"](name, true);
- name += 4;
- file = obj["getInt16"](name, true);
- name += 2;
- var self = obj["getUint8"](name++);
- var path = obj["getUint8"](name++);
- var e = obj["getUint8"](name++);
- path = join(self << 16 | path << 8 | e);
- e = obj["getUint8"](name++);
- /** @type {boolean} */
- var defaultValue = !!(e & 1);
- /** @type {boolean} */
- var temp = !!(e & 16);
- /** @type {null} */
- var val = null;
- if(e & 2) {
- name += 4 + obj["getUint32"](name, true);
- }
- if(e & 4) {
- val = trim();
- }
- var input = readFile();
- /** @type {null} */
- self = null;
- if(result["hasOwnProperty"](m)) {
- self = result[m];
- self.J();
- self["o"] = self["x"];
- self["p"] = self["y"];
- self["n"] = self["size"];
- self["color"] = path;
- } else {
- self = new $(m, row, data, file, path, input);
- h["push"](self);
- result[m] = self;
- self["ia"] = row;
- self["ja"] = data;
- }
- /** @type {boolean} */
- self["f"] = defaultValue;
- /** @type {boolean} */
- self["j"] = temp;
- self["C"] = row;
- self["D"] = data;
- self["m"] = file;
- self["K"] = max;
- self["T"] = e;
- if(val) {
- self["V"] = val;
- }
- if(input) {
- self["t"](input);
- }
- if(-1 != p["indexOf"](m)) {
- if(-1 == params["indexOf"](self)) {
- params["push"](self);
- if(1 == params["length"]) {
- value = self["x"];
- old = self["y"];
- templateFunc();
- /** @type {string} */
- document["getElementById"]("overlays")["style"][
- "display"
- ] = "none";
- /** @type {Array} */
- b = [];
- /** @type {number} */
- rreturn = 0;
- trans = params[0]["color"];
- /** @type {boolean} */
- _0x3495xf1 = true;
- left = Date["now"]();
- /** @type {number} */
- v = r20 = funcs = 0;
- }
- }
- }
- }
- row = obj["getUint32"](name, true);
- name += 4;
- /** @type {number} */
- i = 0;
- for(; i < row; i++) {
- m = obj["getUint32"](name, true);
- name += 4;
- self = result[m];
- if(null != self) {
- self.R();
- }
- }
- if(_0x3495x9c) {
- if(0 == params["length"]) {
- if(myApp["onDead"]() || true) {
- right = Date["now"]();
- /** @type {boolean} */
- _0x3495xf1 = false;
- if(!to) {
- if(!from) {
- if(connected) {
- update();
- /** @type {boolean} */
- from = true;
- log("#overlays")["fadeIn"](3E3);
- log("#stats")["show"]();
- } else {
- show(1500);
- }
- }
- }
- }
- }
- }
- }
- /**
- * @return {undefined}
- */
- function ready() {
- /** @type {string} */
- e = "";
- log("#connecting")["hide"]();
- func();
- if(handler) {
- handler();
- /** @type {null} */
- handler = null;
- }
- if(null != tref) {
- clearTimeout(tref);
- }
- /** @type {number} */
- tref = setTimeout(function () {
- if(win["ga"]) {
- ++restoreScript;
- win["ga"]("set", "dimension2", restoreScript);
- }
- }, 1E4);
- }
- /**
- * @return {undefined}
- */
- function f() {
- if(myApp["isStopMovement"]) {
- return;
- }
- if(removeClass()) {
- /** @type {number} */
- var z0 = y - width / 2;
- /** @type {number} */
- var z1 = x - height / 2;
- if(!(64 > z0 * z0 + z1 * z1)) {
- if(!(0.01 > Math["abs"](n - step) && 0.01 > Math["abs"](h1 -
- h2))) {
- n = step;
- h1 = h2;
- z0 = forEach(13);
- z0["setUint8"](0, 16);
- z0["setInt32"](1, step, true);
- z0["setInt32"](5, h2, true);
- z0["setUint32"](9, 0, true);
- addClass(z0);
- }
- }
- }
- }
- /**
- * @return {undefined}
- */
- function func() {
- if(removeClass() && (item && null != id)) {
- var udataCur = forEach(1 + 2 * id["length"]);
- udataCur["setUint8"](0, 0);
- /** @type {number} */
- var i = 0;
- for(; i < id["length"]; ++i) {
- udataCur["setUint16"](1 + 2 * i, id["charCodeAt"](i), true);
- }
- addClass(udataCur);
- /** @type {null} */
- id = null;
- }
- }
- /**
- * @return {?}
- */
- function removeClass() {
- return null != self && self["readyState"] == self["OPEN"];
- }
- /**
- * @param {number} expectedNumberOfNonCommentArgs
- * @return {undefined}
- */
- function toggleClass(expectedNumberOfNonCommentArgs) {
- if(removeClass()) {
- var udataCur = forEach(1);
- udataCur["setUint8"](0, expectedNumberOfNonCommentArgs);
- addClass(udataCur);
- }
- }
- /**
- * @return {undefined}
- */
- function observer() {
- var current = node;
- if(removeClass() && null != current) {
- var udataCur = forEach(1 + current["length"]);
- udataCur["setUint8"](0, 81);
- /** @type {number} */
- var i = 0;
- for(; i < current["length"]; ++i) {
- udataCur["setUint8"](i + 1, current["charCodeAt"](i));
- }
- addClass(udataCur);
- }
- }
- /**
- * @return {undefined}
- */
- function resize() {
- /** @type {number} */
- width = 1 * win["innerWidth"];
- /** @type {number} */
- height = 1 * win["innerHeight"];
- /** @type {number} */
- a["width"] = style["width"] = width;
- /** @type {number} */
- a["height"] = style["height"] = height;
- var obj = log("#helloContainer");
- obj["css"]("transform", "none");
- var HalfDiagonal = obj["height"]();
- var b = win["innerHeight"];
- if(HalfDiagonal > b / 1.1) {
- obj["css"]("transform", "translate(-50%, -50%) scale(" + b /
- HalfDiagonal / 1.1 + ")");
- } else {
- obj["css"]("transform", "translate(-50%, -50%)");
- }
- setupPrototype();
- }
- /**
- * @return {?}
- */
- function promote() {
- var _0x3495x2e;
- /** @type {number} */
- _0x3495x2e = 1 * Math["max"](height / 1080, width / 1920);
- return _0x3495x2e *= $timeout;
- }
- /**
- * @return {undefined}
- */
- function getOwnPropertyNames() {
- if(0 != params["length"]) {
- if(myApp["isEnableLockZoom"]) {
- obj = promote();
- } else {
- /** @type {number} */
- var obj = 0;
- /** @type {number} */
- var i = 0;
- for(; i < params["length"]; i++) {
- obj += params[i]["size"];
- }
- /** @type {number} */
- obj = Math["pow"](Math["min"](64 / obj, 1), 0.4) * promote();
- }
- /** @type {number} */
- w = (9 * w + obj) / 10;
- }
- }
- /**
- * @return {undefined}
- */
- function setupPrototype() {
- var c;
- var diff = Date["now"]();
- ++clockseq;
- max = diff;
- if(0 < params["length"]) {
- getOwnPropertyNames();
- /** @type {number} */
- var pop = c = 0;
- /** @type {number} */
- var k = 0;
- for(; k < params["length"]; k++) {
- params[k].J();
- c += params[k]["x"] / params["length"];
- pop += params[k]["y"] / params["length"];
- }
- /** @type {number} */
- current = c;
- /** @type {number} */
- expr = pop;
- cb = w;
- if(myApp["testing"]) {
- /** @type {number} */
- value = (testingVal * value + current) / (testingVal + 1);
- /** @type {number} */
- old = (testingVal * old + expr) / (testingVal + 1);
- console["log"](testingVal + 1);
- } else {
- /** @type {number} */
- value = (value + c) / 2;
- /** @type {number} */
- old = (old + pop) / 2;
- }
- } else {
- /** @type {number} */
- value = (29 * value + current) / 30;
- /** @type {number} */
- old = (29 * old + expr) / 30;
- /** @type {number} */
- w = (9 * w + cb * promote()) / 10;
- }
- throttledUpdate();
- prep();
- if(!text) {
- options["clearRect"](0, 0, width, height);
- }
- if(text) {
- /** @type {string} */
- options["fillStyle"] = color ? "#111111" : "#F2FBFF";
- /** @type {number} */
- options["globalAlpha"] = 0.05;
- options["fillRect"](0, 0, width, height);
- /** @type {number} */
- options["globalAlpha"] = 1;
- } else {
- _buildItem();
- }
- h["sort"](function (a, b) {
- return a["size"] == b["size"] ? a["id"] - b["id"] : a[
- "size"] - b["size"];
- });
- options["save"]();
- options["translate"](width / 2, height / 2);
- options["scale"](w, w);
- options["translate"](-value, -old);
- if(myApp["isEnableBorder"]) {
- /** @type {number} */
- var position = 15 / w;
- /** @type {number} */
- position = position > 60 ? 60 : position;
- /** @type {string} */
- options["strokeStyle"] = color ? "white" : "#FF6666";
- /** @type {number} */
- options["lineWidth"] = position;
- options["strokeRect"](~~(count - position), ~~(minY - position), ~
- ~(ln + position * 2), ~~(span + position * 2));
- }
- /** @type {number} */
- k = 0;
- for(; k < listeners["length"]; k++) {
- listeners[k]["s"](options);
- }
- /** @type {number} */
- k = 0;
- for(; k < h["length"]; k++) {
- h[k]["s"](options);
- }
- if(resultItems["length"] > 0) {
- /** @type {string} */
- options["fillStyle"] = "#651FFF";
- options["beginPath"]();
- /** @type {number} */
- var i = 0;
- for(; i < resultItems["length"]; i++) {
- var result = resultItems[i];
- options["moveTo"](result["x"], result["y"]);
- options["arc"](result["x"], result["y"], result["size"] + 5,
- 0, udataCur, false);
- }
- options["fill"]();
- /** @type {Array} */
- resultItems = [];
- }
- if(params["length"] && myApp["isEnableSplitInd"]) {
- /** @type {number} */
- options["globalAlpha"] = 0.7;
- /** @type {number} */
- var oTemplate = ~~Math["min"](5 / w, 50);
- /** @type {number} */
- options["lineWidth"] = oTemplate;
- /** @type {Array} */
- var map = [];
- /** @type {number} */
- i = 0;
- for(; i < params["length"]; i++) {
- map["push"]({
- x: params[i]["x"],
- y: params[i]["y"],
- size: params[i]["size"]
- });
- }
- map["sort"](function (a, b) {
- return a["size"] - b["size"];
- });
- /** @type {number} */
- i = 0;
- for(; i < data["length"]; i++) {
- /** @type {number} */
- var yMovement = data[i]["size"] * data[i]["size"];
- /** @type {number} */
- var x = 0;
- for(; x < map["length"]; x++) {
- /** @type {number} */
- var xMovement = map[x]["size"] * map[x]["size"];
- var p = Math["sqrt"](Math["pow"](map[x]["x"] - data[i][
- "x"
- ], 2) + Math["pow"](map[x]["y"] - data[i]["y"],
- 2));
- var a = map[x]["size"] + 655;
- var li = data[i]["size"] + 655;
- if(map["length"] <= 4 && (xMovement * 0.375 * 0.37 >
- yMovement && a * 2 - 10 > p)) {
- /** @type {number} */
- data[i]["type"] = 4;
- break;
- }
- if(map["length"] <= 8 && (xMovement * 0.37 > yMovement &&
- a > p)) {
- /** @type {number} */
- data[i]["type"] = 2;
- break;
- }
- if(xMovement * 0.73 > yMovement && a > p) {
- /** @type {number} */
- data[i]["type"] = 1;
- break;
- }
- if(yMovement * 0.37 > xMovement && li > p) {
- /** @type {number} */
- data[i]["type"] = -2;
- break;
- }
- if(yMovement * 0.73 > xMovement && li > p) {
- /** @type {number} */
- data[i]["type"] = -1;
- break;
- }
- }
- }
- /** @type {number} */
- var it = 0;
- for(; it < list["length"]; it++) {
- options["strokeStyle"] = list[it]["color"];
- options["beginPath"]();
- /** @type {number} */
- i = 0;
- for(; i < data["length"]; i++) {
- if(!data[i]["type"] || data[i]["type"] != list[it][
- "type"
- ]) {
- continue;
- }
- var originalEvent = data[i]["size"] + oTemplate + 8 + 2 /
- w;
- options["moveTo"](data[i]["x"] + originalEvent, data[i]
- ["y"]);
- options["arc"](data[i]["x"], data[i]["y"],
- originalEvent, 0, udataCur, false);
- }
- options["stroke"]();
- }
- }
- /** @type {Array} */
- data = [];
- if(_0x3495xa6) {
- /** @type {number} */
- vvar = (3 * vvar + ref) / 4;
- /** @type {number} */
- openElement = (3 * openElement + element) / 4;
- options["save"]();
- /** @type {string} */
- options["strokeStyle"] = "#FFAAAA";
- /** @type {number} */
- options["lineWidth"] = 10;
- /** @type {string} */
- options["lineCap"] = "round";
- /** @type {string} */
- options["lineJoin"] = "round";
- /** @type {number} */
- options["globalAlpha"] = 0.5;
- options["beginPath"]();
- /** @type {number} */
- k = 0;
- for(; k < params["length"]; k++) {
- options["moveTo"](params[k]["x"], params[k]["y"]);
- options["lineTo"](vvar, openElement);
- }
- options["stroke"]();
- options["restore"]();
- }
- options["restore"]();
- if(":teams" == message) {
- if(el) {
- if(el["width"]) {
- options["drawImage"](el, width - el["width"] - 10, 10);
- }
- }
- }
- currentValue = Math["max"](currentValue, format());
- /** @type {number} */
- diff = Date["now"]() - diff;
- if(diff > 1E3 / 60) {
- scale -= 0.01;
- } else {
- if(diff < 1E3 / 65) {
- scale += 0.01;
- }
- }
- if(0.4 > scale) {
- /** @type {number} */
- scale = 0.4;
- }
- if(1 < scale) {
- /** @type {number} */
- scale = 1;
- }
- /** @type {number} */
- diff = max - aux;
- if(!removeClass() || (to || from)) {
- newEnd += diff / 2E3;
- if(1 < newEnd) {
- /** @type {number} */
- newEnd = 1;
- }
- } else {
- newEnd -= diff / 300;
- if(0 > newEnd) {
- /** @type {number} */
- newEnd = 0;
- }
- }
- aux = max;
- if(myApp["autoW"]) {
- toggleClass(21);
- }
- }
- /**
- * @return {undefined}
- */
- function _buildItem() {
- if(!myApp["isEnableGridline"]) {
- return;
- }
- options["save"]();
- /** @type {string} */
- options["strokeStyle"] = color ? "#AAAAAA" : "#000000";
- /** @type {number} */
- options["globalAlpha"] = 0.2 * w;
- options["beginPath"]();
- /** @type {number} */
- var x = width / w;
- /** @type {number} */
- var p = height / w;
- /** @type {number} */
- var r = (-value + x / 2) % 50;
- for(; r < x; r += 50) {
- options["moveTo"](r * w - 0.5, 0);
- options["lineTo"](r * w - 0.5, p * w);
- }
- /** @type {number} */
- r = (-old + p / 2) % 50;
- for(; r < p; r += 50) {
- options["moveTo"](0, r * w - 0.5);
- options["lineTo"](x * w, r * w - 0.5);
- }
- options["stroke"]();
- options["restore"]();
- }
- /**
- * @return {undefined}
- */
- function _0x3495x6d() {}
- /**
- * @return {?}
- */
- function format() {
- /** @type {number} */
- var MSG_CONCATENATED_DURATION_TEXT = 0;
- /** @type {number} */
- var i = 0;
- for(; i < params["length"]; i++) {
- MSG_CONCATENATED_DURATION_TEXT += params[i]["m"] * params[i][
- "m"
- ];
- }
- return MSG_CONCATENATED_DURATION_TEXT;
- }
- /**
- * @return {undefined}
- */
- function create() {
- /** @type {null} */
- el = null;
- if(null != obj || 0 != stack["length"]) {
- if(null != obj || $rootScope) {
- el = document["createElement"]("canvas");
- var self = el["getContext"]("2d");
- /** @type {number} */
- var i = 60;
- /** @type {number} */
- i = null == obj ? i + 24 * stack["length"] : i + 180;
- /** @type {number} */
- var fn = Math["min"](200, 0.3 * width) / 200;
- /** @type {number} */
- el["width"] = 200 * fn;
- /** @type {number} */
- el["height"] = i * fn;
- self["scale"](fn, fn);
- /** @type {number} */
- self["globalAlpha"] = 0.4;
- /** @type {string} */
- self["fillStyle"] = "#000000";
- self["fillRect"](0, 0, 200, i);
- /** @type {number} */
- self["globalAlpha"] = 1;
- /** @type {string} */
- self["fillStyle"] = "#FFFFFF";
- /** @type {null} */
- fn = null;
- fn = require("leaderboard");
- /** @type {string} */
- self["font"] = "30px Ubuntu";
- self["fillText"](fn, 100 - self["measureText"](fn)["width"] /
- 2, 40);
- if(null == obj) {
- /** @type {string} */
- self["font"] = "20px Ubuntu";
- /** @type {number} */
- i = 0;
- for(; i < stack["length"]; ++i) {
- fn = stack[i]["name"] || require("unnamed_cell");
- if(!$rootScope) {
- fn = require("unnamed_cell");
- }
- if(-1 != p["indexOf"](stack[i]["id"])) {
- if(params[0]["name"]) {
- fn = params[0]["name"];
- }
- /** @type {string} */
- self["fillStyle"] = "#FFAAAA";
- } else {
- /** @type {string} */
- self["fillStyle"] = "#FFFFFF";
- }
- /** @type {string} */
- fn = i + 1 + ". " + fn;
- self["fillText"](fn, 100 - self["measureText"](fn)[
- "width"] / 2, 70 + 24 * i);
- }
- } else {
- /** @type {number} */
- i = fn = 0;
- for(; i < obj["length"]; ++i) {
- /** @type {number} */
- var returnFalse = fn + obj[i] * Math["PI"] * 2;
- self["fillStyle"] = m[i + 1];
- self["beginPath"]();
- self["moveTo"](100, 140);
- self["arc"](100, 140, 80, fn, returnFalse, false);
- self["fill"]();
- /** @type {number} */
- fn = returnFalse;
- }
- }
- }
- }
- }
- /**
- * @param {?} value
- * @param {?} v
- * @param {?} replacement
- * @param {?} s
- * @param {?} d
- * @return {undefined}
- */
- function val(value, v, replacement, s, d) {
- this["P"] = value;
- this["x"] = v;
- this["y"] = replacement;
- this["g"] = s;
- this["b"] = d;
- }
- /**
- * @param {?} stream
- * @param {?} x
- * @param {?} state
- * @param {?} n
- * @param {?} name
- * @param {?} value
- * @return {undefined}
- */
- function $(stream, x, state, n, name, value) {
- this["id"] = stream;
- this["o"] = this["x"] = x;
- this["p"] = this["y"] = state;
- this["n"] = this["size"] = n;
- this["color"] = name;
- /** @type {Array} */
- this["a"] = [];
- this.Q();
- this["t"](value);
- }
- /**
- * @param {?} x
- * @return {?}
- */
- function join(x) {
- x = x.toString(16);
- for(; 6 > x["length"];) {
- /** @type {string} */
- x = "0" + x;
- }
- return "#" + x;
- }
- /**
- * @param {?} value
- * @param {?} theArray
- * @param {?} itemsPerChunk
- * @param {?} newBox
- * @return {undefined}
- */
- function chunk(value, theArray, itemsPerChunk, newBox) {
- if(value) {
- this["q"] = value;
- }
- if(theArray) {
- this["M"] = theArray;
- }
- /** @type {boolean} */
- this["O"] = !!itemsPerChunk;
- if(newBox) {
- this["r"] = newBox;
- }
- }
- /**
- * @param {Object} obj
- * @return {undefined}
- */
- function isArraylike(obj) {
- var i = obj["length"];
- var val;
- var prop;
- for(; 0 < i;) {
- prop = Math["floor"](Math["random"]() * i);
- i--;
- val = obj[i];
- obj[i] = obj[prop];
- obj[prop] = val;
- }
- }
- /**
- * @param {Object} data
- * @param {Object} loaded
- * @return {undefined}
- */
- function load(data, loaded) {
- /** @type {boolean} */
- var fn1 = "1" == log("#helloContainer")["attr"](
- "data-has-account-data");
- log("#helloContainer")["attr"]("data-has-account-data", "1");
- if(null == loaded && win["localStorage"][i]) {
- var c = JSON["parse"](win["localStorage"][i]);
- c["xp"] = data["e"];
- c["xpNeeded"] = data["c"];
- c["level"] = data["d"];
- win["localStorage"][i] = JSON["stringify"](c);
- }
- if(fn1) {
- /** @type {number} */
- var source = +log(".agario-exp-bar .progress-bar-text")["first"]
- ()["text"]()["split"]("/")[0];
- /** @type {number} */
- fn1 = +log(".agario-exp-bar .progress-bar-text")["first"]()[
- "text"]()["split"]("/")[1]["split"](" ")[0];
- c = log(".agario-profile-panel .progress-bar-star")["first"]()[
- "text"]();
- if(c != data["d"]) {
- load({
- e: fn1,
- c: fn1,
- d: c
- }, function () {
- log(".agario-profile-panel .progress-bar-star")[
- "text"](data["d"]);
- log(".agario-exp-bar .progress-bar")["css"](
- "width", "100%");
- log(".progress-bar-star")["addClass"](
- "animated tada")["one"](
- "webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",
- function () {
- log(".progress-bar-star")[
- "removeClass"](
- "animated tada");
- });
- setTimeout(function () {
- log(
- ".agario-exp-bar .progress-bar-text"
- )["text"](data["c"] + "/" +
- data["c"] + " XP");
- load({
- e: 0,
- c: data["c"],
- d: data["d"]
- }, function () {
- load(data, loaded);
- });
- }, 1E3);
- });
- } else {
- var _0x3495x45 = Date["now"]();
- /**
- * @return {undefined}
- */
- var init = function () {
- var pos;
- /** @type {number} */
- pos = (Date["now"]() - _0x3495x45) / 1E3;
- /** @type {number} */
- pos = 0 > pos ? 0 : 1 < pos ? 1 : pos;
- /** @type {number} */
- pos = pos * pos * (3 - 2 * pos);
- log(".agario-exp-bar .progress-bar-text")["text"](~
- ~(source + (data["e"] - source) * pos) +
- "/" + data["c"] + " XP");
- log(".agario-exp-bar .progress-bar")["css"]("width",
- (88 * (source + (data["e"] - source) * pos) /
- data["c"])["toFixed"](2) + "%");
- if(1 > pos) {
- win["requestAnimationFrame"](init);
- } else {
- if(loaded) {
- loaded();
- }
- }
- };
- win["requestAnimationFrame"](init);
- }
- } else {
- log(".agario-profile-panel .progress-bar-star")["text"](data[
- "d"]);
- log(".agario-exp-bar .progress-bar-text")["text"](data["e"] +
- "/" + data["c"] + " XP");
- log(".agario-exp-bar .progress-bar")["css"]("width", (88 * data[
- "e"] / data["c"])["toFixed"](2) + "%");
- if(loaded) {
- loaded();
- }
- }
- }
- /**
- * @param {Object} args
- * @return {undefined}
- */
- function parse(args) {
- if("string" == typeof args) {
- args = JSON["parse"](args);
- }
- if(Date["now"]() + 18E5 > args["expires"]) {
- log("#helloContainer")["attr"]("data-logged-in", "0");
- } else {
- win["localStorage"][i] = JSON["stringify"](args);
- node = args["authToken"];
- log(".agario-profile-name")["text"](args["name"]);
- observer();
- load({
- e: args["xp"],
- c: args["xpNeeded"],
- d: args["level"]
- });
- log("#helloContainer")["attr"]("data-logged-in", "1");
- }
- }
- /**
- * @param {Array} token
- * @return {undefined}
- */
- function onSuccess(token) {
- console["log"]("???");
- token = token["split"]("\n");
- parse({
- name: token[0],
- fbid: token[1],
- authToken: token[2],
- expires: 1E3 * +token[3],
- level: +token[4],
- xp: +token[5],
- xpNeeded: +token[6]
- });
- }
- /**
- * @param {?} batches
- * @return {undefined}
- */
- function run(batches) {
- if("connected" == batches["status"]) {
- var task = batches["authResponse"]["accessToken"];
- win["FB"]["api"]("/me/picture?width=180&height=180", function (
- cache) {
- win["localStorage"]["fbPictureCache"] = cache[
- "data"]["url"];
- log(".agario-profile-picture")["attr"]("src", cache[
- "data"]["url"]);
- });
- log("#helloContainer")["attr"]("data-logged-in", "1");
- if(null != node) {
- log["ajax"]("http://m.agar.io/checkToken", {
- /**
- * @return {undefined}
- */
- error: function () {
- /** @type {null} */
- node = null;
- run(batches);
- },
- /**
- * @param {Array} location
- * @return {undefined}
- */
- success: function (location) {
- location = location["split"]("\n");
- load({
- d: +location[0],
- e: +location[1],
- c: +location[2]
- });
- },
- dataType: "text",
- method: "POST",
- cache: false,
- crossDomain: true,
- data: node
- });
- } else {
- log["ajax"]("http://m.agar.io/facebookLogin", {
- /**
- * @return {undefined}
- */
- error: function () {
- /** @type {null} */
- node = null;
- log("#helloContainer")["attr"](
- "data-logged-in", "0");
- },
- /** @type {function (Array): undefined} */
- success: onSuccess,
- dataType: "text",
- method: "POST",
- cache: false,
- crossDomain: true,
- data: task
- });
- }
- }
- }
- /**
- * @param {Object} r
- * @return {undefined}
- */
- function success(r) {
- fail(":party");
- log("#helloContainer")["attr"]("data-party-state", "4");
- r = decodeURIComponent(r)["replace"](/.*#/gim, "");
- callback("#" + win["encodeURIComponent"](r));
- log["ajax"]("http://m.agar.io/getToken", {
- /**
- * @return {undefined}
- */
- error: function () {
- log("#helloContainer")["attr"](
- "data-party-state", "6");
- log("#connect_error_div")["show"]();
- },
- /**
- * @param {Element} location
- * @return {undefined}
- */
- success: function (location) {
- location = location["split"]("\n");
- log(".partyToken")["val"]("agar.io/#" + win[
- "encodeURIComponent"](r));
- log("#helloContainer")["attr"](
- "data-party-state", "5");
- fail(":party");
- next("ws://" + location[0], r);
- },
- dataType: "text",
- method: "POST",
- cache: false,
- crossDomain: true,
- data: r
- });
- }
- /**
- * @param {string} url
- * @return {undefined}
- */
- function callback(url) {
- if(win["history"]) {
- if(win["history"]["replaceState"]) {
- win["history"]["replaceState"]({}, win["document"]["title"],
- url);
- }
- }
- }
- /**
- * @param {Object} doc
- * @param {Object} event
- * @return {undefined}
- */
- function fn(doc, event) {
- /** @type {boolean} */
- var _0x3495x30 = -1 != p["indexOf"](doc["id"]);
- /** @type {boolean} */
- var _0x3495x2a = -1 != p["indexOf"](event["id"]);
- /** @type {boolean} */
- var _0x3495x2b = 30 > event["size"];
- if(_0x3495x30) {
- if(_0x3495x2b) {
- ++rreturn;
- }
- }
- if(!_0x3495x2b) {
- if(!!_0x3495x30) {
- if(!_0x3495x2a) {
- ++r20;
- }
- }
- }
- }
- /**
- * @param {number} obj
- * @return {?}
- */
- function isArray(obj) {
- /** @type {number} */
- obj = ~~obj;
- /** @type {string} */
- var result = (obj % 60).toString();
- /** @type {string} */
- obj = (~~(obj / 60)).toString();
- if(2 > result["length"]) {
- /** @type {string} */
- result = "0" + result;
- }
- return obj + ":" + result;
- }
- /**
- * @return {?}
- */
- function tryIt() {
- if(null == stack) {
- return 0;
- }
- /** @type {number} */
- var i = 0;
- for(; i < stack["length"]; ++i) {
- if(-1 != p["indexOf"](stack[i]["id"])) {
- return i + 1;
- }
- }
- return 0;
- }
- /**
- * @return {undefined}
- */
- function update() {
- log(".stats-food-eaten")["text"](rreturn);
- log(".stats-time-alive")["text"](isArray((right - left) / 1E3));
- log(".stats-leaderboard-time")["text"](isArray(funcs));
- log(".stats-highest-mass")["text"](~~(currentValue / 100));
- log(".stats-cells-eaten")["text"](r20);
- log(".stats-top-position")["text"](0 == v ? ":(" : v);
- var size = document["getElementById"]("statsGraph");
- if(size) {
- var style = size["getContext"]("2d");
- var width = size["width"];
- size = size["height"];
- style["clearRect"](0, 0, width, size);
- if(2 < b["length"]) {
- /** @type {number} */
- var serverAttrs = 200;
- /** @type {number} */
- var i = 0;
- for(; i < b["length"]; i++) {
- serverAttrs = Math["max"](b[i], serverAttrs);
- }
- /** @type {number} */
- style["lineWidth"] = 3;
- /** @type {string} */
- style["lineCap"] = "round";
- /** @type {string} */
- style["lineJoin"] = "round";
- style["strokeStyle"] = trans;
- style["fillStyle"] = trans;
- style["beginPath"]();
- style["moveTo"](0, size - b[0] / serverAttrs * (size - 10) +
- 10);
- /** @type {number} */
- i = 1;
- for(; i < b["length"]; i += Math["max"](~~(b["length"] /
- width), 1)) {
- /** @type {number} */
- var offw = i / (b["length"] - 1) * width;
- /** @type {Array} */
- var dots = [];
- /** @type {number} */
- var off = -20;
- for(; 20 >= off; ++off) {
- if(!(0 > i + off)) {
- if(!(i + off >= b["length"])) {
- dots["push"](b[i + off]);
- }
- }
- }
- /** @type {number} */
- dots = dots["reduce"](function (far, near) {
- return far + near;
- }) / dots["length"] / serverAttrs;
- style["lineTo"](offw, size - dots * (size - 10) + 10);
- }
- style["stroke"]();
- /** @type {number} */
- style["globalAlpha"] = 0.5;
- style["lineTo"](width, size);
- style["lineTo"](0, size);
- style["fill"]();
- /** @type {number} */
- style["globalAlpha"] = 1;
- }
- }
- }
- /**
- * @param {number} a
- * @param {number} b
- * @return {undefined}
- */
- win["moveTo"] = function (a, b) {
- if(a && b) {
- /** @type {boolean} */
- myApp["isStopMovement"] = true;
- /** @type {number} */
- key = a;
- /** @type {number} */
- b0 = b;
- } else {
- /** @type {null} */
- key = null;
- /** @type {null} */
- b0 = null;
- }
- };
- /**
- * @param {?} deepDataAndEvents
- * @param {?} opt_obj2
- * @return {undefined}
- */
- win["setPosition"] = function (deepDataAndEvents, opt_obj2) {
- if(removeClass()) {
- var udataCur = forEach(13);
- udataCur["setUint8"](0, 16);
- udataCur["setInt32"](1, deepDataAndEvents, true);
- udataCur["setInt32"](5, opt_obj2, true);
- udataCur["setUint32"](9, 0, true);
- addClass(udataCur);
- }
- };
- if(!win["agarioNoInit"]) {
- var arrayClass = win["location"]["protocol"];
- /** @type {boolean} */
- var isArr = "https:" == arrayClass;
- if(isArr && -1 == win["location"]["search"]["indexOf"]("fb")) {
- /** @type {string} */
- win["location"]["href"] = "http://agar.io/";
- } else {
- var userAgent = win["navigator"]["userAgent"];
- if(false) {} else {
- var a;
- var options;
- var style;
- var width;
- var height;
- /** @type {null} */
- var ea = null;
- /** @type {null} */
- var self = null;
- /** @type {number} */
- var value = 0;
- /** @type {number} */
- var old = 0;
- /** @type {Array} */
- var p = [];
- /** @type {Array} */
- var params = [];
- var result = {};
- /** @type {Array} */
- var h = [];
- /** @type {Array} */
- var listeners = [];
- /** @type {Array} */
- var stack = [];
- /** @type {number} */
- var y = 0;
- /** @type {number} */
- var x = 0;
- /** @type {number} */
- var step = -1;
- /** @type {number} */
- var h2 = -1;
- /** @type {number} */
- var clockseq = 0;
- /** @type {number} */
- var max = 0;
- /** @type {number} */
- var aux = 0;
- /** @type {null} */
- var id = null;
- /** @type {number} */
- var count = 0;
- /** @type {number} */
- var minY = 0;
- /** @type {number} */
- var idx = 1E4;
- /** @type {number} */
- var maxY = 1E4;
- /** @type {number} */
- var w = 1;
- /** @type {null} */
- var banner = null;
- /** @type {boolean} */
- var img = true;
- /** @type {boolean} */
- var $rootScope = true;
- /** @type {boolean} */
- var dest = false;
- /** @type {boolean} */
- var _0x3495x9c = false;
- /** @type {number} */
- var currentValue = 0;
- /** @type {number} */
- var color = 1;
- /** @type {boolean} */
- var oldStatus = false;
- /** @type {number} */
- var current = value = ~~((count + idx) / 2);
- /** @type {number} */
- var expr = old = ~~((minY + maxY) / 2);
- /** @type {number} */
- var cb = 1;
- /** @type {string} */
- var message = "";
- /** @type {null} */
- var obj = null;
- /** @type {boolean} */
- var _0x3495xa5 = false;
- /** @type {boolean} */
- var _0x3495xa6 = false;
- /** @type {number} */
- var ref = 0;
- /** @type {number} */
- var element = 0;
- /** @type {number} */
- var vvar = 0;
- /** @type {number} */
- var openElement = 0;
- /** @type {number} */
- var generalCallback = 0;
- /** @type {Array} */
- var m = ["#333333", "#FF3333", "#33FF33", "#3333FF"];
- /** @type {boolean} */
- var text = false;
- /** @type {boolean} */
- var item = false;
- /** @type {number} */
- var check = 0;
- /** @type {null} */
- var node = null;
- /** @type {number} */
- var $timeout = 1;
- /** @type {number} */
- var newEnd = 1;
- /** @type {boolean} */
- var to = false;
- /** @type {number} */
- var resizeUID = 0;
- var dst = {};
- /** @type {string} */
- var e = "";
- /** @type {number} */
- var ln = 0;
- /** @type {number} */
- var span = 0;
- /** @type {number} */
- var _clockseq = 0;
- /** @type {Array} */
- var _0x3495xb9 = [];
- /** @type {Array} */
- var _0x3495xba = [];
- /** @type {Array} */
- var _0x3495xbb = [];
- /** @type {Array} */
- var data = [];
- /** @type {number} */
- var udataCur = 2 * Math["PI"];
- /** @type {null} */
- var key = null;
- /** @type {null} */
- var b0 = null;
- /** @type {number} */
- var msg = 0;
- /** @type {number} */
- var fx = 0;
- /** @type {number} */
- var err = 0;
- /** @type {number} */
- var type = 0;
- /** @type {number} */
- var error = 0;
- /** @type {Array} */
- var resultItems = [];
- var _0x3495xc6 = {};
- /** @type {Array} */
- var list = [{
- type: 1,
- color: "#d3d3d3"
- }, {
- type: 2,
- color: "#76FF03"
- }, {
- type: 4,
- color: "#2196F3"
- }, {
- type: -1,
- color: "#FF9800"
- }, {
- type: -2,
- color: "#FD0000"
- }, {
- type: -4,
- color: "white"
- }];
- setInterval(function () {
- type = fx;
- /** @type {number} */
- fx = 0;
- error = err;
- /** @type {number} */
- err = 0;
- }, 1E3);
- (function () {
- var data = win["location"]["search"];
- if("?" == data["charAt"](0)) {
- data = data["slice"](1);
- }
- data = data["split"]("&");
- /** @type {number} */
- var i = 0;
- for(; i < data["length"]; i++) {
- var src = data[i]["split"]("=");
- dst[src[0]] = src[1];
- }
- })();
- var test_canvas = document["createElement"]("canvas");
- if("undefined" == typeof console || ("undefined" == typeof DataView ||
- ("undefined" == typeof WebSocket || (null ==
- test_canvas || (null == test_canvas[
- "getContext"] || null == win[
- "localStorage"]))))) {
- alert(
- "You browser does not support this game, we recommend you to use Firefox to play this"
- );
- } else {
- /** @type {null} */
- var map = null;
- /**
- * @param {Object} override
- * @return {undefined}
- */
- win["setNick"] = function (override) {
- if(win["ga"]) {
- win["ga"]("send", "event", "Nick", override[
- "toLowerCase"]());
- }
- createFile();
- /** @type {Object} */
- id = override;
- func();
- /** @type {number} */
- currentValue = 0;
- setLocalStorage("nick", override);
- myApp["newGame"]();
- };
- /** @type {function (string): undefined} */
- win["setRegion"] = reset;
- /**
- * @param {boolean} el
- * @return {undefined}
- */
- win["setSkins"] = function (el) {
- /** @type {boolean} */
- img = el;
- };
- /**
- * @param {boolean} _$rootScope_
- * @return {undefined}
- */
- win["setNames"] = function (_$rootScope_) {
- /** @type {boolean} */
- $rootScope = _$rootScope_;
- };
- /**
- * @param {string} newColor
- * @return {undefined}
- */
- win["setDarkTheme"] = function (newColor) {
- /** @type {string} */
- color = newColor;
- };
- /**
- * @param {boolean} vec
- * @return {undefined}
- */
- win["setColors"] = function (vec) {
- /** @type {boolean} */
- dest = vec;
- };
- /**
- * @param {boolean} newStatus
- * @return {undefined}
- */
- win["setShowMass"] = function (newStatus) {
- /** @type {boolean} */
- oldStatus = newStatus;
- };
- /**
- * @param {string} d
- * @return {undefined}
- */
- win["connectIP"] = function (d) {
- var scripts = d["trim"]();
- log("#opt_connect_ip")["val"](scripts);
- if(!scripts) {
- if(log("#gamemode option:selected")["val"]() ==
- ":party") {
- createParty();
- return;
- }
- }
- if(scripts["length"] != 0 && scripts["length"] <=
- 6) {
- success(d);
- } else {
- console["log"]("connecting IP = " + d);
- /** @type {string} */
- e = d;
- animate();
- }
- };
- /**
- * @return {?}
- */
- win["getCurrentX"] = function () {
- if(params["length"]) {
- return value;
- }
- return "";
- };
- /**
- * @return {?}
- */
- win["getCurrentY"] = function () {
- if(params["length"]) {
- return old;
- }
- return "";
- };
- /**
- * @return {?}
- */
- win["getTop1X"] = function () {
- return current;
- };
- /**
- * @return {?}
- */
- win["getTop1Y"] = function () {
- return expr;
- };
- /**
- * @return {?}
- */
- win["getLengthX"] = function () {
- return ln;
- };
- /**
- * @return {?}
- */
- win["getLengthY"] = function () {
- return span;
- };
- /**
- * @return {?}
- */
- win["getLB"] = function () {
- return stack;
- };
- /**
- * @return {?}
- */
- win["getSelfIDs"] = function () {
- return p;
- };
- /**
- * @return {?}
- */
- win["getCell"] = function () {
- return params;
- };
- /**
- * @return {?}
- */
- win["getHighestScore"] = function () {
- return currentValue;
- };
- /**
- * @return {undefined}
- */
- win["quickSpace"] = function () {
- if(params["length"] == 0) {
- return;
- }
- toggleClass(17);
- setTimeout(function () {
- toggleClass(17);
- }, 40);
- setTimeout(function () {
- toggleClass(17);
- }, 80);
- setTimeout(function () {
- toggleClass(17);
- }, 120);
- };
- /**
- * @return {undefined}
- */
- win["doubleSpace"] = function () {
- /** @type {number} */
- var bufferTime = 38;
- setTimeout(function () {
- toggleClass(17);
- }, bufferTime);
- setTimeout(function () {
- toggleClass(17);
- }, bufferTime * 2);
- };
- /**
- * @return {?}
- */
- win["getFPS"] = function () {
- return _clockseq;
- };
- /**
- * @return {?}
- */
- win["getPacketIO"] = function () {
- return [type, error];
- };
- /**
- * @return {undefined}
- */
- win["spectate"] = function () {
- /** @type {null} */
- id = null;
- toggleClass(1);
- createFile();
- myApp["spectate"](params);
- };
- /**
- * @param {undefined} error
- * @return {undefined}
- */
- win["setGameMode"] = function (error) {
- if(error != message) {
- if(":party" == message) {
- log("#helloContainer")["attr"](
- "data-party-state", "0");
- }
- fail(error);
- if(":party" != error) {
- animate();
- }
- }
- };
- /**
- * @param {Array} _$timeout_
- * @return {undefined}
- */
- win["setZoomLevel"] = function (_$timeout_) {
- /** @type {Array} */
- $timeout = _$timeout_;
- };
- /**
- * @return {?}
- */
- win["isFreeSpec"] = function () {
- return myApp["isSpectating"] && msg === 0.25;
- };
- /**
- * @param {boolean} textAlt
- * @return {undefined}
- */
- win["setAcid"] = function (textAlt) {
- /** @type {boolean} */
- text = textAlt;
- };
- if(null != win["localStorage"]) {
- if(null == win["localStorage"]["AB9"]) {
- /** @type {number} */
- win["localStorage"]["AB9"] = 0 + ~~(100 * Math[
- "random"]());
- }
- /** @type {number} */
- generalCallback = +win["localStorage"]["AB9"];
- /** @type {number} */
- win["ABGroup"] = generalCallback;
- }
- /** @type {boolean} */
- var _0x3495xcd = true;
- /** @type {number} */
- var _0x3495xce = 0;
- /** @type {null} */
- var handler = null;
- /** @type {function (string, Object): undefined} */
- win["connect"] = next;
- /** @type {number} */
- var backoff = 500;
- /** @type {null} */
- var tref = null;
- /** @type {number} */
- var restoreScript = 0;
- /** @type {number} */
- var n = -1;
- /** @type {number} */
- var h1 = -1;
- /** @type {null} */
- var el = null;
- /** @type {number} */
- var scale = 1;
- /** @type {null} */
- var _0x3495xd7 = null;
- var LOAD = function () {
- var min = Date["now"]();
- /** @type {number} */
- var b = 1E3 / 60;
- /** @type {number} */
- var diff = 0;
- var aux = Date["now"]();
- return function () {
- win["requestAnimationFrame"](LOAD);
- var max = Date["now"]();
- /** @type {number} */
- var a = max - min;
- if(myApp["isShowFPS"]) {
- if(diff > 1E3) {
- aux = max;
- /** @type {number} */
- diff = 0;
- _clockseq = clockseq;
- /** @type {number} */
- clockseq = 0;
- } else {
- /** @type {number} */
- diff = max - aux;
- }
- }
- if(a > b) {
- /** @type {number} */
- min = max - a % b;
- if(!removeClass() || 240 > Date[
- "now"]() - check) {
- setupPrototype();
- } else {
- console["warn"]("Skipping draw");
- }
- traverseNode();
- }
- };
- }();
- var images = {};
- var classNames =
- "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"
- ](";");
- var secs =
- "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"
- ](";");
- var imgs = {};
- val["prototype"] = {
- P: null,
- x: 0,
- y: 0,
- g: 0,
- b: 0
- };
- $["prototype"] = {
- id: 0,
- a: null,
- name: null,
- k: null,
- I: null,
- x: 0,
- y: 0,
- size: 0,
- o: 0,
- p: 0,
- n: 0,
- C: 0,
- D: 0,
- m: 0,
- T: 0,
- K: 0,
- W: 0,
- A: false,
- f: false,
- j: false,
- L: true,
- S: 0,
- V: null,
- /**
- * @return {undefined}
- */
- R: function () {
- var i;
- /** @type {number} */
- i = 0;
- for(; i < h["length"]; i++) {
- if(h[i] == this) {
- h["splice"](i, 1);
- break;
- }
- }
- delete result[this["id"]];
- i = params["indexOf"](this);
- if(-1 != i) {
- /** @type {boolean} */
- _0x3495x9c = true;
- params["splice"](i, 1);
- }
- i = p["indexOf"](this["id"]);
- if(-1 != i) {
- p["splice"](i, 1);
- }
- /** @type {boolean} */
- this["A"] = true;
- },
- /**
- * @return {?}
- */
- i: function () {
- return Math["max"](~~(0.3 * this["size"]),
- 24);
- },
- /**
- * @param {Object} path
- * @return {undefined}
- */
- t: function (path) {
- var params = path["match"](
- /\u0001([\u0002-\uffff]|[\u0002-\uffff]\uffff)$/g
- );
- /** @type {number} */
- var result = 0;
- if(params) {
- result = params[0]["split"](
- "\u0001")[1];
- if(result["length"] > 1) {
- this["img"] = result[
- "charCodeAt"](0) +
- 65534;
- }
- if(result["length"] == 1) {
- this["img"] = result[
- "charCodeAt"](0);
- }
- }
- if(this["name"] = path) {
- if(null == this["k"]) {
- this["k"] = new chunk(this["i"]
- (), "#FFFFFF", true,
- "#000000");
- /** @type {number} */
- this["k"]["v"] = Math["ceil"](
- 10 * w) / 10;
- } else {
- this["k"].G(this["i"]());
- }
- this["k"]["u"](this["name"]);
- }
- },
- /**
- * @return {undefined}
- */
- Q: function () {
- var length = this.B();
- for(; this["a"]["length"] > length;) {
- /** @type {number} */
- var a = ~~(Math["random"]() * this[
- "a"]["length"]);
- this["a"]["splice"](a, 1);
- }
- if(0 == this["a"]["length"]) {
- if(0 < length) {
- this["a"]["push"](new val(this,
- this["x"], this["y"],
- this["size"], Math[
- "random"]() -
- 0.5));
- }
- }
- for(; this["a"]["length"] < length;) {
- /** @type {number} */
- a = ~~(Math["random"]() * this["a"]
- ["length"]);
- a = this["a"][a];
- this["a"]["push"](new val(this, a[
- "x"], a["y"], a["g"],
- a["b"]));
- }
- },
- /**
- * @return {?}
- */
- B: function () {
- /** @type {number} */
- var suggestedValue = 10;
- if(20 > this["size"]) {
- /** @type {number} */
- suggestedValue = 0;
- }
- if(this["f"]) {
- /** @type {number} */
- suggestedValue = 30;
- }
- var value = this["size"];
- if(!this["f"]) {
- value *= w;
- }
- value *= scale;
- if(this["T"] & 32) {
- value *= 0.25;
- }
- return ~~Math["max"](value,
- suggestedValue);
- },
- /**
- * @return {undefined}
- */
- da: function () {
- this.Q();
- var f = this["a"];
- var n = f["length"];
- /** @type {number} */
- var i = 0;
- for(; i < n; ++i) {
- var p = f[(i - 1 + n) % n]["b"];
- var c = f[(i + 1) % n]["b"];
- f[i]["b"] += (Math["random"]() -
- 0.5) * (this["j"] ? 3 : 1);
- f[i]["b"] *= 0.7;
- if(10 < f[i]["b"]) {
- /** @type {number} */
- f[i]["b"] = 10;
- }
- if(-10 > f[i]["b"]) {
- /** @type {number} */
- f[i]["b"] = -10;
- }
- /** @type {number} */
- f[i]["b"] = (p + c + 8 * f[i]["b"]) /
- 10;
- }
- var options = this;
- /** @type {number} */
- var difference = this["f"] ? 0 : (this[
- "id"] / 1E3 + max / 1E4) % (2 *
- Math["PI"]);
- /** @type {number} */
- i = 0;
- for(; i < n; ++i) {
- var grp = f[i]["g"];
- p = f[(i - 1 + n) % n]["g"];
- c = f[(i + 1) % n]["g"];
- if(15 < this["size"] && (null != ea &&
- (20 < this["size"] * w && 0 <
- this["id"]))) {
- /** @type {boolean} */
- var _0x3495x47 = false;
- var x = f[i]["x"];
- var y = f[i]["y"];
- ea["ea"](x - 5, y - 5, 10, 10,
- function (o) {
- if(o["P"] !=
- options) {
- if(25 > (x - o[
- "x"
- ]) * (x - o[
- "x"
- ]) + (y - o[
- "y"
- ]) * (y - o[
- "y"
- ])) {
- /** @type {boolean} */
- _0x3495x47 =
- true;
- }
- }
- });
- if(!_0x3495x47) {
- if(f[i]["x"] < count || (f[
- i]["y"] < minY ||
- (f[i]["x"] > idx ||
- f[i]["y"] >
- maxY))) {
- /** @type {boolean} */
- _0x3495x47 = true;
- }
- }
- if(_0x3495x47) {
- if(0 < f[i]["b"]) {
- /** @type {number} */
- f[i]["b"] = 0;
- }
- f[i]["b"] -= 1;
- }
- }
- grp += f[i]["b"];
- if(0 > grp) {
- /** @type {number} */
- grp = 0;
- }
- /** @type {number} */
- grp = this["j"] ? (19 * grp + this[
- "size"]) / 20 : (12 * grp +
- this["size"]) / 13;
- /** @type {number} */
- f[i]["g"] = (p + c + 8 * grp) / 10;
- /** @type {number} */
- p = 2 * Math["PI"] / n;
- c = this["a"][i]["g"];
- if(this["f"]) {
- if(0 == i % 2) {
- c += 5;
- }
- }
- f[i]["x"] = this["x"] + Math["cos"]
- (p * i + difference) * c;
- f[i]["y"] = this["y"] + Math["sin"]
- (p * i + difference) * c;
- }
- },
- /**
- * @return {?}
- */
- J: function () {
- if(0 >= this["id"]) {
- return 1;
- }
- var a;
- /** @type {number} */
- a = (max - this["K"]) / 120;
- /** @type {number} */
- a = 0 > a ? 0 : 1 < a ? 1 : a;
- /** @type {number} */
- var d = 0 > a ? 0 : 1 < a ? 1 : a;
- this["i"]();
- if(this["A"] && 1 <= d) {
- var e = listeners["indexOf"](this);
- if(-1 != e) {
- listeners["splice"](e, 1);
- }
- }
- this["x"] = a * (this["C"] - this["o"]) +
- this["o"];
- this["y"] = a * (this["D"] - this["p"]) +
- this["p"];
- this["size"] = d * (this["m"] - this[
- "n"]) + this["n"];
- return d;
- },
- /**
- * @return {?}
- */
- H: function () {
- return 0 >= this["id"] ? true : this[
- "x"] + this["size"] + 40 <
- value - width / 2 / w || (this["y"] +
- this["size"] + 40 < old -
- height / 2 / w || (this["x"] -
- this["size"] - 40 > value +
- width / 2 / w || this["y"] -
- this["size"] - 40 > old +
- height / 2 / w)) ? false :
- true;
- },
- /**
- * @param {Object} suggest_values
- * @return {undefined}
- */
- s: function (suggest_values) {
- if(this.H()) {
- var program = myApp[
- "isEnableSimpleDrawing"];
- if(this["size"] < 15) {
- if(!myApp["isEnableHideFood"]) {
- if(myApp["isSameColorFood"]) {
- resultItems["push"]({
- x: this["x"],
- y: this["y"],
- size: this[
- "size"
- ]
- });
- return;
- }
- suggest_values["beginPath"]
- ();
- suggest_values["fillStyle"] =
- this["color"];
- suggest_values["arc"](this[
- "x"], this["y"],
- this["size"] + 5, 0,
- 2 * Math["PI"],
- false);
- suggest_values["fill"]();
- }
- return;
- }
- ++this["S"];
- /** @type {boolean} */
- var inverse = 0 < this["id"] && (!
- this["f"] && (!this["j"] &&
- 0.4 > w));
- if(5 > this.B()) {
- if(0 < this["id"]) {
- /** @type {boolean} */
- inverse = true;
- }
- }
- if(this["L"] && !inverse) {
- /** @type {number} */
- var i = 0;
- for(; i < this["a"]["length"]; i++) {
- this["a"][i]["g"] = this[
- "size"];
- }
- }
- /** @type {boolean} */
- this["L"] = inverse;
- suggest_values["save"]();
- this["W"] = max;
- i = this.J();
- if(this["A"]) {
- suggest_values["globalAlpha"] *=
- 1 - i;
- }
- /** @type {number} */
- suggest_values["lineWidth"] = 10;
- /** @type {string} */
- suggest_values["lineCap"] = "round";
- /** @type {string} */
- suggest_values["lineJoin"] = this[
- "f"] ? "miter" : "round";
- /** @type {boolean} */
- var _0x3495xe2 = !this["f"] && (
- this["id"] > 0 && (this[
- "size"] >= 15 && !
- this["j"])) ? true :
- false;
- /** @type {boolean} */
- var isHideSelfName = false;
- /** @type {boolean} */
- var _0x3495xe4 = false;
- /** @type {number} */
- var b = 0;
- /** @type {null} */
- var settings = null;
- if(_0x3495xe2) {
- if(myApp["isTransparentCell"]) {
- /** @type {number} */
- suggest_values[
- "globalAlpha"] =
- 0.8;
- }
- /** @type {number} */
- var sp = 0;
- for(; sp < p["length"]; sp++) {
- if(this["id"] === p[sp]) {
- /** @type {boolean} */
- isHideSelfName = true;
- }
- }
- if(isHideSelfName) {
- if(myApp["cellColor"] != "") {
- this["color"] = myApp[
- "cellColor"];
- }
- if(myApp[
- "isEnableAttackRange"
- ]) {
- suggest_values[
- "beginPath"]();
- /** @type {string} */
- suggest_values[
- "strokeStyle"] =
- color ? "white" :
- "black";
- suggest_values["arc"](
- this["x"], this[
- "y"], this[
- "size"] +
- myApp[
- "attackRangeRadius"
- ], 0, 2 * Math[
- "PI"],
- false);
- suggest_values["stroke"]
- ();
- suggest_values[
- "closePath"]();
- }
- if(myApp[
- "isEnableCustomSkin"
- ]) {
- settings = myApp[
- "getSkinImage"]
- (nodeList[0][5]);
- }
- } else {
- if(_0x3495xe4) {
- if(myApp[
- "isEnableTeammateIndicator"
- ] && this["size"] <
- myApp[
- "teammateIndicatorShowSize"
- ]) {
- suggest_values[
- "drawImage"
- ](myApp[
- "teammateIndicator"
- ], ~~(this[
- "x"
- ] - 50), ~~
- (this["y"] -
- this[
- "size"
- ] - 100
- ));
- }
- if(myApp[
- "isEnableCustomSkin"
- ]) {
- if(nodeList[b]) {
- settings =
- myApp[
- "getSkinImage"
- ](nodeList[
- b][
- 5
- ]);
- }
- }
- } else {}
- }
- }
- if(dest) {
- /** @type {string} */
- suggest_values["fillStyle"] =
- "#FFFFFF";
- /** @type {string} */
- suggest_values["strokeStyle"] =
- "#AAAAAA";
- } else {
- suggest_values["fillStyle"] =
- this["color"];
- suggest_values["strokeStyle"] =
- this["color"];
- }
- if(program && this["f"]) {
- /** @type {string} */
- suggest_values["fillStyle"] =
- "#6e6e6e";
- /** @type {number} */
- suggest_values["globalAlpha"] =
- 0.8;
- /** @type {number} */
- suggest_values["lineWidth"] =
- 10;
- /** @type {string} */
- suggest_values["strokeStyle"] =
- "#FFFFFF";
- }
- if(program || inverse) {
- suggest_values["beginPath"]();
- suggest_values["arc"](this["x"],
- this["y"], this["size"] +
- 5, 0, 2 * Math["PI"],
- false);
- if(myApp["isEnableSplitInd"] &&
- (_0x3495xe2 && (!
- isHideSelfName && (!
- _0x3495xe4 && (
- this["name"] ||
- this["size"] >
- 38))))) {
- data["push"]({
- x: this["x"],
- y: this["y"],
- size: this[
- "size"]
- });
- }
- } else {
- this["da"]();
- suggest_values["beginPath"]();
- var index = this.B();
- suggest_values["moveTo"](this[
- "a"][0]["x"], this[
- "a"][0]["y"]);
- /** @type {number} */
- i = 1;
- for(; i <= index; ++i) {
- /** @type {number} */
- var j = i % index;
- suggest_values["lineTo"](
- this["a"][j]["x"],
- this["a"][j]["y"]);
- }
- }
- suggest_values["closePath"]();
- i = this["name"]["toLowerCase"]();
- var dst = this["img"] ?
- "http://upload.happyfor.me/getimg.php?id=" +
- this["img"] + "&_t=" + Math[
- "random"]() : "skins/" + i +
- ".png";
- if(!settings && (!this["j"] && ((
- img || myApp[
- "isEnableOtherSkinSupport"
- ]) && ":teams" !=
- message))) {
- index = this["V"];
- if(null == index) {
- /** @type {null} */
- index = null;
- } else {
- if(":" == index[0]) {
- if(!imgs[
- "hasOwnProperty"
- ](index)) {
- /** @type {Image} */
- imgs[index] = new Image;
- imgs[index]["src"] =
- index["slice"](
- 1);
- }
- index = 0 != imgs[index]
- ["width"] && imgs[
- index][
- "complete"
- ] ? imgs[index] :
- null;
- } else {
- /** @type {null} */
- index = null;
- }
- }
- if(!index) {
- if(-1 != classNames[
- "indexOf"](i) &&
- img || this["img"]) {
- if(!images[
- "hasOwnProperty"
- ](i)) {
- /** @type {Image} */
- images[i] = new Image;
- images[i]["src"] =
- dst;
- }
- index = 0 != images[i][
- "width"
- ] && images[i][
- "complete"
- ] ? images[i] :
- null;
- } else {
- /** @type {null} */
- index = null;
- }
- }
- } else {
- /** @type {null} */
- index = null;
- }
- j = index;
- if(!inverse) {
- if(!!(program && this["f"])) {
- suggest_values["stroke"]();
- }
- }
- suggest_values["fill"]();
- if(myApp["isEnableCustomSkin"]) {
- if(settings && (settings[
- "width"] &&
- settings["complete"])) {
- j = settings;
- }
- }
- if(null != j) {
- suggest_values["save"]();
- suggest_values["clip"]();
- suggest_values["drawImage"](j, ~
- ~(this["x"] - this[
- "size"]), ~~(this[
- "y"] - this[
- "size"]), ~~(2 *
- this["size"]), ~~(2 *
- this["size"]));
- suggest_values["restore"]();
- }
- if(!program) {
- if(dest || 15 < this["size"]) {
- if(!inverse) {
- /** @type {string} */
- suggest_values[
- "strokeStyle"] =
- "#000000";
- suggest_values[
- "globalAlpha"] *=
- 0.1;
- suggest_values["stroke"]
- ();
- }
- }
- /** @type {number} */
- suggest_values["globalAlpha"] =
- 1;
- }
- /** @type {boolean} */
- index = -1 != params["indexOf"](
- this);
- /** @type {number} */
- inverse = ~~this["y"];
- var _0x3495xe8 = this["f"] || (this[
- "size"] > 315 || this[
- "size"] * w > 18);
- if(!(isHideSelfName && myApp[
- "isHideSelfName"]) && ((!
- myApp["isAutoHideName"] ||
- _0x3495xe8) && (0 !=
- this["id"] && ((
- $rootScope ||
- index) && (this[
- "name"] &&
- (this["k"] && (
- null ==
- j || -1 ==
- secs[
- "indexOf"
- ](i)))))))) {
- j = this["k"];
- j["u"](this["name"]);
- j.G(this["i"]() / 0.9);
- /** @type {number} */
- i = 0 >= this["id"] ? 1 : Math[
- "ceil"](10 * w) / 10;
- j.U(i);
- j = j.F();
- /** @type {number} */
- var r20 = ~~(j["width"] / i);
- /** @type {number} */
- var restoreScript = ~~(j[
- "height"] / i);
- suggest_values["drawImage"](j, ~
- ~this["x"] - ~~(r20 / 2),
- inverse - ~~(
- restoreScript / 2),
- r20, restoreScript);
- inverse += j["height"] / 2 / i +
- 4;
- }
- if((!myApp["isAutoHideMass"] ||
- _0x3495xe8) && myApp[
- "isEnableShowAllMass"]) {
- if(0 < this["id"]) {
- if(oldStatus) {
- if(38 < this["size"]) {
- if(null == this["I"]) {
- this["I"] = new chunk(
- this[
- "i"
- ]() / 2,
- "#FFFFFF",
- true,
- "#000000"
- );
- }
- index = this["I"];
- index.G(this["i"]() /
- 0.8);
- index["u"](~~(this[
- "size"
- ] *
- this[
- "size"
- ] / 100
- ));
- /** @type {number} */
- i = Math["ceil"](10 *
- w) / 10;
- index.U(i);
- j = index.F();
- /** @type {number} */
- r20 = ~~(j["width"] /
- i);
- /** @type {number} */
- restoreScript = ~~(
- j["height"] /
- i);
- suggest_values[
- "drawImage"
- ](j, ~~this["x"] -
- ~~(r20 / 2),
- inverse - ~
- ~(
- restoreScript /
- 2), r20,
- restoreScript
- );
- }
- }
- }
- }
- suggest_values["restore"]();
- }
- }
- };
- chunk["prototype"] = {
- w: "",
- M: "#000000",
- O: false,
- r: "#000000",
- q: 16,
- l: null,
- N: null,
- h: false,
- v: 1,
- /**
- * @param {number} q
- * @return {undefined}
- */
- G: function (q) {
- if(Math["abs"](q - this["q"]) > 5) {
- if(this["q"] != q) {
- /** @type {number} */
- this["q"] = q;
- /** @type {boolean} */
- this["h"] = true;
- }
- }
- },
- /**
- * @param {number} d
- * @return {undefined}
- */
- U: function (d) {
- if(this["v"] != d) {
- /** @type {number} */
- this["v"] = d;
- /** @type {boolean} */
- this["h"] = true;
- }
- },
- /**
- * @param {?} r
- * @return {undefined}
- */
- setStrokeColor: function (r) {
- if(this["r"] != r) {
- this["r"] = r;
- /** @type {boolean} */
- this["h"] = true;
- }
- },
- /**
- * @param {number} w
- * @return {undefined}
- */
- u: function (w) {
- var color;
- if(!isNaN(w) && (!isNaN(this["w"]) && (
- this["w"] != 0 && (w != 0 &&
- this["w"] != w)))) {
- if(Math["abs"]((w - this["w"]) /
- this["w"]) < 0.008) {
- color = this["w"];
- /** @type {number} */
- this["w"] = w;
- }
- }
- if(w != this["w"]) {
- /** @type {number} */
- this["w"] = w;
- /** @type {boolean} */
- this["h"] = true;
- }
- if(color) {
- this["w"] = color;
- }
- },
- /**
- * @return {?}
- */
- F: function () {
- if(null == this["l"]) {
- this["l"] = document[
- "createElement"]("canvas");
- this["N"] = this["l"]["getContext"]
- ("2d");
- }
- if(this["h"]) {
- /** @type {boolean} */
- this["h"] = false;
- var param = this["l"];
- var HEIGHT_CACHE = this["N"];
- var slotIndex = this["w"];
- var k = this["v"];
- var x = this["q"];
- /** @type {string} */
- var result = "bold " + x +
- "px Ubuntu";
- /** @type {string} */
- HEIGHT_CACHE["font"] = result;
- /** @type {number} */
- var w = ~~(0.2 * x);
- /** @type {number} */
- param["width"] = (HEIGHT_CACHE[
- "measureText"](
- slotIndex)["width"] + 6) *
- k;
- /** @type {number} */
- param["height"] = (x + w) * k;
- /** @type {string} */
- HEIGHT_CACHE["font"] = result;
- HEIGHT_CACHE["scale"](k, k);
- /** @type {number} */
- HEIGHT_CACHE["globalAlpha"] = 1;
- HEIGHT_CACHE["fillStyle"] = this[
- "M"];
- if(myApp["isShowTextStrokeLine"]) {
- /** @type {number} */
- HEIGHT_CACHE["lineWidth"] = 5;
- HEIGHT_CACHE["strokeStyle"] =
- this["r"];
- if(this["O"]) {
- HEIGHT_CACHE["strokeText"](
- slotIndex, 3, x - w /
- 2);
- }
- }
- HEIGHT_CACHE["fillText"](slotIndex,
- 3, x - w / 2);
- }
- return this["l"];
- }
- };
- if(!Date["now"]) {
- /**
- * @return {?}
- */
- Date["now"] = function () {
- return(new Date)["getTime"]();
- };
- }
- (function () {
- /** @type {Array} */
- var a = ["ms", "moz", "webkit", "o"];
- /** @type {number} */
- var x = 0;
- for(; x < a["length"] && !win[
- "requestAnimationFrame"]; ++x) {
- win["requestAnimationFrame"] = win[a[x] +
- "RequestAnimationFrame"];
- win["cancelAnimationFrame"] = win[a[x] +
- "CancelAnimationFrame"] || win[a[x] +
- "CancelRequestAnimationFrame"];
- }
- if(!win["requestAnimationFrame"]) {
- /**
- * @param {?} fnc
- * @return {?}
- */
- win["requestAnimationFrame"] = function (
- fnc) {
- return setTimeout(fnc, 1E3 / 60);
- };
- /**
- * @param {?} to
- * @return {undefined}
- */
- win["cancelAnimationFrame"] = function (to) {
- clearTimeout(to);
- };
- }
- })();
- var AXIS_INDEX = {
- /**
- * @param {Object} sorted
- * @return {?}
- */
- X: function (sorted) {
- /**
- * @param {?} value
- * @return {?}
- */
- function parseFloat(value) {
- if(value < min) {
- value = min;
- }
- if(value > max) {
- value = max;
- }
- return ~~((value - min) / 32);
- }
- /**
- * @param {?} g
- * @return {?}
- */
- function callback(g) {
- if(g < b) {
- g = b;
- }
- if(g > a) {
- g = a;
- }
- return ~~((g - b) / 32);
- }
- var min = sorted["ba"];
- var b = sorted["ca"];
- var max = sorted["Z"];
- var a = sorted["$"];
- /** @type {number} */
- var length = ~~((max - min) / 32) + 1;
- /** @type {number} */
- var klength = ~~((a - b) / 32) + 1;
- /** @type {Array} */
- var result = Array(length * klength);
- return {
- /**
- * @param {Object} val
- * @return {undefined}
- */
- Y: function (val) {
- var key = parseFloat(val[
- "x"]) + callback(
- val["y"]) * length;
- if(null == result[key]) {
- /** @type {Object} */
- result[key] = val;
- } else {
- if(Array["isArray"](
- result[key])) {
- result[key]["push"]
- (val);
- } else {
- /** @type {Array} */
- result[key] = [
- result[key],
- val
- ];
- }
- }
- },
- /**
- * @param {number} value
- * @param {number} d
- * @param {Object} data
- * @param {number} i
- * @param {?} ok
- * @return {undefined}
- */
- ea: function (value, d, data, i, ok) {
- var offset = parseFloat(
- value);
- var position = callback(d);
- value = parseFloat(value +
- data);
- d = callback(d + i);
- if(0 > offset || (offset >=
- length || (0 >
- position ||
- position >=
- klength))) {
- debugger;
- }
- for(; position <= d; ++
- position) {
- i = offset;
- for(; i <= value; ++i) {
- if(data = result[i +
- position *
- length],
- null != data) {
- if(Array[
- "isArray"
- ](data)) {
- /** @type {number} */
- var color =
- 0;
- for(; color <
- data[
- "length"
- ]; color++
- ) {
- ok(data[
- color
- ]);
- }
- } else {
- ok(data);
- }
- }
- }
- }
- }
- };
- }
- };
- var templateFunc = function () {
- var styles = new $(0, 0, 0, 32, "#ED1C24", "");
- var json = document["createElement"]("canvas");
- /** @type {number} */
- json["width"] = 32;
- /** @type {number} */
- json["height"] = 32;
- var options = json["getContext"]("2d");
- return function () {
- if(0 < params["length"]) {
- styles["color"] = params[0]["color"];
- styles["t"](params[0]["name"]);
- }
- options["clearRect"](0, 0, 32, 32);
- options["save"]();
- options["translate"](16, 16);
- options["scale"](0.4, 0.4);
- styles["s"](options);
- options["restore"]();
- var favicon = document["getElementById"]
- ("favicon");
- var r20 = favicon["cloneNode"](true);
- favicon["parentNode"]["replaceChild"](
- r20, favicon);
- };
- }();
- log(function () {
- templateFunc();
- });
- /** @type {string} */
- var i = "loginCache3";
- log(function () {
- if(+win["localStorage"]["wannaLogin"]) {
- if(win["localStorage"][i]) {
- parse(win["localStorage"][i]);
- }
- if(win["localStorage"]["fbPictureCache"]) {
- log(".agario-profile-picture")[
- "attr"]("src", win[
- "localStorage"][
- "fbPictureCache"
- ]);
- }
- }
- });
- /**
- * @return {undefined}
- */
- win["facebookLogin"] = function () {
- /** @type {number} */
- win["localStorage"]["wannaLogin"] = 1;
- };
- /**
- * @return {undefined}
- */
- win["fbAsyncInit"] = function () {
- /**
- * @return {undefined}
- */
- function init() {
- /** @type {number} */
- win["localStorage"]["wannaLogin"] = 1;
- if(null == win["FB"]) {
- alert(
- "You seem to have something blocking Facebook on your browser, please check for any extensions"
- );
- } else {
- win["FB"]["login"](function (batches) {
- run(batches);
- }, {
- scope: "public_profile, email"
- });
- }
- }
- win["FB"]["init"]({
- appId: "677505792353827",
- cookie: true,
- xfbml: true,
- status: true,
- version: "v2.2"
- });
- win["FB"]["Event"]["subscribe"](
- "auth.statusChange",
- function (batches) {
- if(+win["localStorage"][
- "wannaLogin"
- ]) {
- if("connected" == batches[
- "status"]) {
- run(batches);
- } else {
- init();
- }
- }
- });
- /** @type {function (): undefined} */
- win["facebookLogin"] = init;
- };
- /**
- * @return {undefined}
- */
- win["logout"] = function () {
- /** @type {null} */
- node = null;
- log("#helloContainer")["attr"]("data-logged-in",
- "0");
- log("#helloContainer")["attr"](
- "data-has-account-data", "0");
- delete win["localStorage"]["wannaLogin"];
- delete win["localStorage"][i];
- delete win["localStorage"]["fbPictureCache"];
- animate();
- };
- var traverseNode = function () {
- /**
- * @param {Object} options
- * @param {Object} args
- * @param {string} path
- * @param {number} position
- * @param {string} name
- * @return {undefined}
- */
- function init(options, args, path, position,
- name) {
- var value = args["getContext"]("2d");
- var pageY = args["width"];
- args = args["height"];
- /** @type {string} */
- options["color"] = name;
- options["t"](path);
- /** @type {number} */
- options["size"] = position;
- value["save"]();
- value["translate"](pageY / 2, args / 2);
- options["s"](value);
- value["restore"]();
- }
- var EventEmitter = new $(-1, 0, 0, 32,
- "#5bc0de", "");
- var memory = new $(-1, 0, 0, 32, "#5bc0de", "");
- var stack =
- "#0791ff #5a07ff #ff07fe #ffa507 #ff0774 #077fff #3aff07 #ff07ed #07a8ff #ff076e #3fff07 #ff0734 #07ff20 #ff07a2 #ff8207 #07ff0e" [
- "split"
- ](" ");
- /** @type {Array} */
- var obj = [];
- /** @type {number} */
- var i = 0;
- for(; i < stack["length"]; ++i) {
- /** @type {number} */
- var y = i / stack["length"] * 12;
- /** @type {number} */
- var _width = 30 * Math["sqrt"](i / stack[
- "length"]);
- obj["push"](new $(-1, Math["cos"](y) *
- _width, Math["sin"](y) * _width,
- 10, stack[i], ""));
- }
- isArraylike(obj);
- var json = document["createElement"]("canvas");
- json["getContext"]("2d");
- /** @type {number} */
- json["width"] = json["height"] = 70;
- init(memory, json, "", 26, "#ebc0de");
- return function () {
- log(".cell-spinner")["filter"](
- ":visible")["each"](function () {
- var base = log(this);
- var x = Date["now"]();
- var dw = this["width"];
- var dh = this["height"];
- var source = this[
- "getContext"]("2d");
- source["clearRect"](0, 0,
- dw, dh);
- source["save"]();
- source["translate"](dw / 2,
- dh / 2);
- /** @type {number} */
- var y = 0;
- for(; 10 > y; ++y) {
- source["drawImage"](
- json, (0.1 * x +
- 80 * y) % (
- dw + 140) -
- dw / 2 - 70 -
- 35, dh / 2 *
- Math["sin"]((
- 0.001 *
- x + y) %
- Math["PI"] *
- 2) - 35, 70,
- 70);
- }
- source["restore"]();
- if(base = base["attr"](
- "data-itr")) {
- base = require(base);
- }
- init(EventEmitter, this,
- base || "", +log(
- this)["attr"](
- "data-size"),
- "#5bc0de");
- });
- log("#statsPellets")["filter"](
- ":visible")["each"](function () {
- log(this);
- var i = this["width"];
- var dh = this["height"];
- this["getContext"]("2d")[
- "clearRect"](0, 0,
- i, dh);
- /** @type {number} */
- i = 0;
- for(; i < obj["length"]; i++) {
- init(obj[i], this, "",
- obj[i]["size"],
- obj[i]["color"]
- );
- }
- });
- };
- }();
- /**
- * @return {undefined}
- */
- win["createParty"] = function () {
- fail(":party");
- /**
- * @param {Object} v
- * @return {undefined}
- */
- handler = function (v) {
- callback("/#" + win[
- "encodeURIComponent"](v));
- log(".partyToken")["val"]("agar.io/#" +
- win["encodeURIComponent"](v));
- log("#helloContainer")["attr"](
- "data-party-state", "1");
- };
- animate();
- };
- /** @type {function (Object): undefined} */
- win["joinParty"] = success;
- /**
- * @return {undefined}
- */
- win["cancelParty"] = function () {
- callback("/");
- log("#helloContainer")["attr"](
- "data-party-state", "0");
- fail("");
- animate();
- };
- /** @type {Array} */
- var b = [];
- /** @type {number} */
- var rreturn = 0;
- /** @type {string} */
- var trans = "#000000";
- /** @type {boolean} */
- var from = false;
- /** @type {boolean} */
- var _0x3495xf1 = false;
- /** @type {number} */
- var left = 0;
- /** @type {number} */
- var right = 0;
- /** @type {number} */
- var funcs = 0;
- /** @type {number} */
- var r20 = 0;
- /** @type {number} */
- var v = 0;
- /** @type {boolean} */
- var connected = true;
- setInterval(function () {
- if(_0x3495xf1) {
- b["push"](format() / 100);
- }
- }, 1E3 / 60);
- setInterval(function () {
- var k = tryIt();
- if(0 != k) {
- ++funcs;
- if(0 == v) {
- v = k;
- }
- v = Math["min"](v, k);
- }
- }, 1E3);
- /**
- * @return {undefined}
- */
- win["closeStats"] = function () {
- /** @type {boolean} */
- from = false;
- log("#stats")["hide"]();
- show(0);
- };
- /**
- * @param {?} err
- * @return {undefined}
- */
- win["setSkipStats"] = function (err) {
- /** @type {boolean} */
- connected = !err;
- };
- log(function () {
- log(init);
- });
- }
- }
- }
- }
- })(window, window["jQuery"]);
- myApp["afterGameLogicLoaded"]();
- /**
- * @return {undefined}
- */
- function MyApp() {
- /**
- * @return {?}
- */
- function handlePresence() {
- $("#nick")["val"](myApp["getName"]());
- if(nodeList[0][1] == myApp["getName"]()) {
- return false;
- }
- nodeList[0][1] = myApp["getName"]();
- setLocalStorage("nick", $("#nick")["val"]());
- player_profile[selected_profile]["name"] = myApp["getName"]();
- attr();
- return true;
- }
- /**
- * @return {?}
- */
- function setAttribute() {
- var r20 = myApp["getTeamName"]();
- $("#team_name")["val"](r20);
- if(tmpTeamname == r20) {
- return false;
- }
- setLocalStorage("opt_teamname", r20);
- player_profile[selected_profile]["team"] = r20;
- attr();
- /** @type {boolean} */
- isJoinedGame = false;
- return true;
- }
- /**
- * @return {undefined}
- */
- function createInput() {
- setLocalStorage("selected_profile", selected_profile);
- tmpTeamname = myApp["getTeamName"]();
- $("#nick")["val"](player_profile[selected_profile]["name"]);
- $("#team_name")["val"](player_profile[selected_profile]["team"]);
- $("#skin_url")["val"](player_profile[selected_profile]["skinurl"])[
- "trigger"]("change");
- if(!setAttribute()) {
- handlePresence();
- } else {
- nodeList[0][1] = myApp["getName"]();
- setLocalStorage("nick", myApp["getName"]());
- }
- }
- /**
- * @return {undefined}
- */
- function attr() {
- setLocalStorage("player_profile", player_profile);
- }
- /** @type {string} */
- this["version"] = "v3.1.2p";
- /** @type {number} */
- var r20 = 0.97;
- /** @type {number} */
- var _0x3495xfa = 0.05;
- /**
- * @return {?}
- */
- this["getZoomSpeed"] = function () {
- return r20;
- };
- /**
- * @return {?}
- */
- this["getZoomLimit"] = function () {
- return _0x3495xfa;
- };
- /** @type {boolean} */
- this["isShowScroll"] = false;
- /** @type {boolean} */
- this["isShowSTE"] = false;
- /** @type {boolean} */
- this["isShowBallTotal"] = false;
- /** @type {boolean} */
- var error = false;
- /** @type {boolean} */
- this["isStopMovement"] = false;
- /** @type {boolean} */
- this["isEnableZoom"] = false;
- /** @type {boolean} */
- this["isEnableBorder"] = false;
- /** @type {boolean} */
- this["isEnableGridline"] = false;
- /** @type {boolean} */
- this["isEnableHideFood"] = false;
- /** @type {boolean} */
- this["isEnableShowAllMass"] = true;
- /** @type {boolean} */
- this["isEnableSimpleDrawing"] = false;
- /** @type {boolean} */
- this["isEnableAutoStart"] = true;
- /** @type {boolean} */
- this["isEnableMouseW"] = false;
- /** @type {boolean} */
- this["isEnableCustomSkin"] = false;
- /** @type {boolean} */
- this["isEnableLockZoom"] = true;
- /** @type {boolean} */
- this["isEnableAttackRange"] = false;
- /** @type {boolean} */
- this["isEnableTeammateIndicator"] = true;
- /** @type {boolean} */
- this["isEnableChatpopup"] = false;
- /** @type {number} */
- this["attackRangeRadius"] = 655;
- /** @type {string} */
- this["cellColor"] = "";
- /** @type {Array} */
- this["cellColorAry"] = ["red", "#76FF03", "blue", "yellow", "#8207ff",
- "#2196F3", ""
- ];
- /** @type {boolean} */
- this["autoW"] = false;
- /** @type {boolean} */
- this["quickSpace"] = false;
- /** @type {boolean} */
- this["doubleSpace"] = false;
- /** @type {number} */
- this["quickSpaceCount"] = 0;
- /** @type {number} */
- this["doubleSpaceCount"] = 0;
- this["lockZoomG"];
- /** @type {number} */
- this["teammateIndicatorPosition"] = 40;
- /** @type {number} */
- this["teammateIndicatorSize"] = 50;
- /** @type {number} */
- this["teammateIndicatorShowSize"] = 200;
- this["teammateIndicator"];
- this["specTeammate"];
- /** @type {boolean} */
- this["isSpecTeammate"] = false;
- /** @type {number} */
- this["massTextSize"] = 0.8;
- /** @type {boolean} */
- this["isSpectating"] = false;
- /** @type {boolean} */
- this["isSameColorFood"] = true;
- /** @type {boolean} */
- this["isTransparentCell"] = false;
- /** @type {boolean} */
- this["isShowFPS"] = false;
- /** @type {boolean} */
- this["isAutoHideMass"] = false;
- /** @type {boolean} */
- this["isAutoHideName"] = false;
- /** @type {boolean} */
- this["isShowTextStrokeLine"] = false;
- /** @type {boolean} */
- this["isEnableSplitInd"] = false;
- /** @type {boolean} */
- this["isEnableOtherSkinSupport"] = false;
- /** @type {boolean} */
- this["testing"] = false;
- /** @type {boolean} */
- this["isHideSelfName"] = false;
- var _0x3495xfc = {};
- /** @type {boolean} */
- this["isEnableSound"] = false;
- /** @type {boolean} */
- this["isEnableShareFb"] = false;
- /** @type {boolean} */
- this["isShowPacketIO"] = false;
- /**
- * @return {undefined}
- */
- this["init"] = function () {
- $("body")["html"]("");
- $("body")["append"](
- '<div id="overlays"><div id="helloContainer" data-logged-in="0" data-has-account-data="0" data-party-state="0" data-results-state="0" data-gamemode="" style="transform: translate(-50%, -50%) scale(0.685195908125844);"><div class="side-container"><div class="agario-panel agario-side-panel agario-profile-panel"><div class="clearfix" style="margin-bottom: 16px;"><img class="agario-profile-picture"> <div class="agario-profile-name-container"> <span class="agario-profile-name"></span></div></div><div style="position: relative; margin-bottom: -15px;" class="clearfix"><div class="agario-exp-bar progress"><span class="progress-bar-text"></span> <div class="progress-bar progress-bar-striped" style="width: 0%;"></div></div><div class="progress-bar-border"></div><div class="progress-bar-star"></div></div></div></div><div id="mainPanel" class="agario-panel"><form role="form"><div id="profile-main"><div id="profile-pic" class="form-group clearfix"><div class="nav arrow-left"></div><div id="preview-img-area"><img id="preview-img"></img></div><div class="nav arrow-right"></div></div><div class="form-group clearfix"><input id="nick" class="form-control" placeholder="Nick" maxlength="15" autofocus=""> <select id="gamemode" class="form-control" onchange="setGameMode($(this).val());" required=""><option selected="" value="" data-itr="gamemode_ffa">FFA</option><option value=":teams" data-itr="gamemode_teams">Teams</option><option value=":experimental" data-itr="gamemode_experimental">Experimental</option><option value=":party" data-itr="party">Party</option></select></div><div class="form-group clearfix"><div id="locationKnown"><select id="region" class="form-control" onchange="setRegion($(\'#region\').val());" required=""><option selected="" disabled="" value="" data-itr="region_select"> -- Select a Region -- </option><option value="US-Atlanta" data-itr="region_north_america">North America</option><option value="BR-Brazil" data-itr="region_south_america">South America</option><option value="EU-London" data-itr="region_europe">Europe</option><option value="RU-Russia" data-itr="region_russia">Russia</option><option value="TK-Turkey" data-itr="region_turkey">Turkey</option><option value="JP-Tokyo" data-itr="region_east_asia">East Asia</option><option value="CN-China" data-itr="region_china">China</option><option value="SG-Singapore" data-itr="region_oceania">Oceania</option></select></div></div><div id="locationUnknown"> </div></div><div id="settings" class="checkbox" style="display:none;"><div style="float: left; width: 200px;"><div id="options" style="margin: 6px; font-size: 12px;"></div></div><div style="float: right; width: 120px;"><button onclick="logout(); return false;" class="btn btn-danger btn-logout" data-itr="logout">Logout</button> </div><br clear="both"> </div><div class="form-group" id="agario-main-buttons"> <button type="button" onclick="$(\'#settings, #profile-main\').toggle();return false;" class="btn btn-info btn-settings"><i class="glyphicon glyphicon-cog"></i> </button> <button type="submit" onclick="setNick(document.getElementById(\'nick\').value); return false;" class="btn btn-play btn-primary btn-needs-server" data-itr="play">Play</button> <button onclick="spectate(); return false;" class="btn btn-warning btn-spectate btn-needs-server" data-itr="spectate">Spectate</button><button type="submit" onclick="setNick(document.getElementById(\'nick\').value); return false;" class="btn btn-play-guest btn-success btn-needs-server" data-itr="play_as_guest">Play as guest</button> <br clear="both"> </div><div><button onclick="facebookLogin(); return false;" class="btn btn-login btn-primary" style="line-height: 24px;width:100%" data-original-title="" title=""> <span class="social social-facebook" style="font-size:24px;margin-top:-6px;margin-left:-8px;vertical-align:middle;margin-right:5px;"></span> <span data-itr="login_and_play">Login and play</span> </button> <br clear="both"> </div></form></div><div id="stats" style="display: none;" class="agario-panel"><h2><center>Match Results</center></h2><canvas id="statsGraph" width="350" height="230"></canvas><div id="statsPelletsContainer"> <span id="statsText" class="stats-food-eaten"></span> <span id="statsSubtext" data-itr="stats_food_eaten">food eaten</span> </div><div id="statsHighestMassContainer"> <span id="statsText" class="stats-highest-mass"></span> <span id="statsSubtext" data-itr="stats_highest_mass">highest mass</span> </div><div id="statsTimeAliveContainer"> <span id="statsText" class="stats-time-alive"></span> <span id="statsSubtext" data-itr="stats_time_alive">time alive</span> </div><div id="statsTimeLeaderboardContainer"> <span id="statsText" class="stats-leaderboard-time"></span> <span id="statsSubtext" data-itr="stats_leaderboard_time">leaderboard time</span> </div><div id="statsPlayerCellsEatenContainer"> <span id="statsText" class="stats-cells-eaten"></span> <span id="statsSubtext" data-itr="stats_cells_eaten">cells eaten</span> </div><div id="statsTopPositionContainer"> <span id="statsText" class="stats-top-position">?</span> <span id="statsSubtext" data-itr="stats_top_position">top position</span> </div><hr style="position:absolute;bottom:350px;width:100%;margin:0px;"><button id="statsContinue" class="btn btn-primary" data-itr="continue" onclick="closeStats();">Continue</button> <hr style="position:absolute;bottom:255px;width:100%;"></div><div class="side-container gameinfo"></div></div><div class="tosBox"></div></div><div id="connecting"><div class="connecting-panel"><h2 data-itr="connecting">Connecting...</h2></div></div>'
- );
- $("body")["append"]("<canvas id='canvas'>");
- $("body")["append"](
- '<link id="favicon" rel="icon" type="image/png">');
- /** @type {string} */
- document["title"] = "HKG Agar Tool Lite";
- $("body")["append"]("<div id = 'overlays2'></div>");
- $("#overlays2")["append"](
- "<div id = 'div_lb'><div class='header'>Leaderboard</div></div>"
- );
- $("#div_lb")["append"]("<div id='lb_detail'></div>");
- $("#overlays2")["append"]("<div id = 'div_score'></div>");
- var test_canvas = document["getElementById"]("canvas");
- var _0x3495xfe = test_canvas["getContext"]("2d");
- /** @type {boolean} */
- test_canvas["mozOpaque"] = true;
- /**
- * @param {?} deepDataAndEvents
- * @param {?} msg
- * @return {undefined}
- */
- window["setLocalStorage"] = function (deepDataAndEvents, msg) {
- if("string" == typeof msg) {
- localStorage["setItem"](deepDataAndEvents, msg);
- } else {
- localStorage["setItem"](deepDataAndEvents, JSON[
- "stringify"](msg));
- }
- };
- /**
- * @param {?} deepDataAndEvents
- * @return {?}
- */
- window["getLocalStorage"] = function (deepDataAndEvents) {
- return localStorage["getItem"](deepDataAndEvents);
- };
- if(getLocalStorage("selected_profile")) {
- selected_profile = getLocalStorage("selected_profile");
- }
- if(getLocalStorage("player_profile")) {
- player_profile = JSON["parse"](getLocalStorage("player_profile"));
- } else {
- if(getLocalStorage("nick")) {
- player_profile[selected_profile]["name"] = getLocalStorage(
- "nick");
- }
- if(getLocalStorage("opt_teamname")) {
- player_profile[selected_profile]["team"] = getLocalStorage(
- "opt_teamname");
- }
- if(getLocalStorage("skin_url")) {
- player_profile[selected_profile]["skinurl"] =
- getLocalStorage("skin_url");
- }
- }
- /** @type {number} */
- var i = 0;
- for(; i < player_profile["length"]; i++) {
- window["postMessage"]({
- action: Action["IMAGE"],
- data: player_profile[i]["skinurl"]
- }, "*");
- }
- $("body")["attr"]("oncontextmenu", "return false;");
- $("#overlays2")["append"]("<div id='teammate_menu'></div>");
- $("#teammate_menu")["hide"]();
- $("#teammate_menu")["click"](function (synEvent) {
- synEvent["stopPropagation"]();
- });
- $("#overlays2")["click"](function () {
- $("#teammate_menu")["hide"]();
- });
- /** @type {Array} */
- nodeList[0] = ["me", getLocalStorage("nick"), null, null, "yellow"];
- /** @type {Array} */
- nodeList[1] = ["top1", "", null, null, "white"];
- nodeList[0][8] = Date["now"]();
- nodeList[1][8] = Date["now"]();
- chatRoom = new ChatRoom;
- chatRoom["setContainer"]("#overlays2");
- chatRoom["createChatBox"]();
- var data = $("#gamemode")["parent"]();
- data["append"](
- '<input id="opt_connect_ip" class="form-control" placeholder="IP address/ Party Code" maxlength="20" style="width:65%;float:left;">'
- );
- data["append"](
- '<button id="btn_connect" onclick="connectIP($(\'#opt_connect_ip\').val().trim());" type="button" class="btn btn-needs-server">Connect</button>'
- );
- data["append"](
- '<div id="connect_error_div" class="msg_error">Party code expired or invalid.</div>'
- );
- $("#btn_connect")["click"](function () {
- $("#btn_connect")["text"]("Connecting");
- $("#connect_error_div")["hide"]();
- });
- data["append"](
- '<div id="lbl_teamname" style="height:20px;">Team : </div><input type="text" id="team_name" class="form-control" placeholder="Team name (Default = HKG)" maxlength="10" value="' +
- defaultTeamname + '">');
- data["append"](
- '<div id="lbl_skin_url" style="height:20px;">Skin URL : </div><input type="text" id="skin_url" class="form-control" placeholder="Skin URL">'
- );
- minimap = new Minimap;
- minimap["createMap"](250);
- var testCanvas = document["createElement"]("canvas");
- var style = testCanvas["getContext"]("2d");
- style["beginPath"]();
- /** @type {number} */
- style["lineWidth"] = 10;
- style["moveTo"](0, 0);
- style["lineTo"](100, 0);
- style["lineTo"](50, 50);
- style["closePath"]();
- /** @type {string} */
- style["strokeStyle"] = "white";
- /** @type {string} */
- style["fillStyle"] = "white";
- style["stroke"]();
- style["fill"]();
- this["teammateIndicator"] = testCanvas;
- };
- /**
- * @return {undefined}
- */
- this["newGame"] = function () {
- $("#nick")["prop"]("disabled", true);
- /** @type {boolean} */
- myApp["isStopMovement"] = false;
- /** @type {boolean} */
- myApp["isSpectating"] = false;
- /** @type {string} */
- myApp["cellColor"] = "";
- myApp["newGameImpl"]();
- /** @type {null} */
- nodeList[1][2] = null;
- /** @type {null} */
- nodeList[1][3] = null;
- };
- /**
- * @return {undefined}
- */
- this["afterGameLogicLoaded"] = function () {
- myApp["setupOption"]();
- myApp["setupHotKey"]();
- myApp["restoreSetting"]();
- myApp["setUpHotKeyConfigPage"]();
- myApp["replaceTos"]();
- myApp["createGameInfoBox"]();
- myApp["setupHints"]();
- myApp["checkVersion"]();
- myApp["downloadSkin"]();
- $('button[data-target="#hotkeys_setting"]')["after"]($(
- "<button id='btn_info' type='button' class='btn btn-warning btn-show-info'>Notice</button>"
- ));
- $("#btn_info")["click"](function () {
- myApp["showAnnouncement"]();
- });
- $("#game_info")["click"](function () {
- myApp["copyGameInfo"]();
- });
- $("#nick")["change"](function () {
- handlePresence();
- });
- $("#team_name")["change"](function () {
- setAttribute();
- })["focus"](function () {
- tmpTeamname = myApp["getTeamName"]();
- });
- $("#skin_url")["change"](function () {
- var nv = getLocalStorage("skin_url");
- var v = myApp["getCustomSkinUrl"]();
- $("#skin_url")["val"](v);
- if(nv == v) {
- return;
- }
- /** @type {RegExp} */
- var rchecked =
- /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/i;
- if(v != "DEFAULT" && !rchecked["test"](v)) {
- console["log"]("Not valid URL");
- $("#skin_url")["val"](nv);
- return;
- }
- setLocalStorage("skin_url", v);
- nodeList[0][5] = v;
- player_profile[selected_profile]["skinurl"] = myApp[
- "getCustomSkinUrl"]();
- attr();
- if(customSkin[v]) {
- myApp["changePreviewImage"](customSkin[v]["src"]);
- } else {
- skinDownloadQueue["push"](v);
- }
- });
- $(".nav.arrow-left")["click"](function () {
- /** @type {number} */
- selected_profile = (player_profile["length"] +
- selected_profile - 1) % player_profile["length"];
- createInput();
- });
- $(".nav.arrow-right")["click"](function () {
- /** @type {number} */
- selected_profile = (selected_profile + 1) %
- player_profile["length"];
- createInput();
- });
- attr();
- };
- /**
- * @param {Object} result
- * @return {undefined}
- */
- this["spectate"] = function (result) {
- if(!result || result["length"] == 0) {
- /** @type {boolean} */
- myApp["isSpectating"] = true;
- }
- };
- /**
- * @return {undefined}
- */
- this["newGameImpl"] = function () {
- /** @type {boolean} */
- var _0x3495x10a = true;
- var result = getCell();
- if(!result || result["length"] == 0) {
- /** @type {boolean} */
- _0x3495x10a = false;
- }
- if(!_0x3495x10a) {
- setTimeout(myApp["newGameImpl"], 100);
- return;
- } else {
- var color = result[0]["color"];
- nodeList[0][6] = color;
- }
- $(".nav")["hide"]();
- };
- /**
- * @return {undefined}
- */
- this["onDead"] = function () {
- $("#nick")["prop"]("disabled", false);
- $(".nav")["show"]();
- };
- /**
- * @return {undefined}
- */
- this["afterGameLoaded"] = function () {
- /** @type {boolean} */
- myApp["isSpectating"] = false;
- /** @type {number} */
- updateLBCount = -1;
- /** @type {boolean} */
- isJoinedGame = false;
- $("#nick")["prop"]("disabled", false);
- $("#current_ip")["text"]("Current IP = " + myApp["getCurrentIP"]());
- $("#ip_info")["text"]("Current IP : " + myApp["getCurrentIP"]());
- $("#region_info")["text"]("Region : " + $("#region option:selected")[
- "text"]()["split"](" ")[0]);
- $("#gamemode_info")["text"]("Game mode : " + $(
- "#gamemode option:selected")["text"]());
- $("#party_code_info")["text"]("Party Code : " + myApp[
- "getCurrentPartyCode"]());
- $("#btn_connect")["text"]("Connect");
- moveTo(null, null);
- /** @type {null} */
- myApp["specTeammate"] = null;
- /** @type {boolean} */
- myApp["isStopMovement"] = false;
- minimap["setDeadPosition"](null);
- };
- /**
- * @return {undefined}
- */
- this["restoreSetting"] = function () {
- if(getLocalStorage("opt_teamname")) {
- $("#team_name")["val"](getLocalStorage("opt_teamname"));
- }
- if(!getLocalStorage("nick") || getLocalStorage("nick")["trim"]() ==
- "") {
- $("#nick")["val"](myApp["getName"]());
- setLocalStorage("nick", myApp["getName"]());
- nodeList[0][1] = myApp["getName"]();
- } else {
- $("#nick")["val"](getLocalStorage("nick", myApp["getName"]()));
- nodeList[0][1] = myApp["getName"]();
- }
- if(getLocalStorage("opt_zoom_speed")) {
- r20 = getLocalStorage("opt_zoom_speed");
- $("#opt_zoom_speed")["val"](r20);
- $("#txt_zoom_speed")["text"](r20);
- }
- var src = getLocalStorage("skin_url");
- if(!src || src == "") {
- setLocalStorage("skin_url", defaultSkin);
- src = defaultSkin;
- }
- if(src && src != "") {
- $("#skin_url")["val"](getLocalStorage("skin_url"));
- nodeList[0][5] = src;
- if(customSkin[src]) {
- myApp["changePreviewImage"](customSkin[src]["src"]);
- } else {
- skinDownloadQueue["push"](getLocalStorage("skin_url"));
- }
- }
- if(!getLocalStorage("hotkeyMapping")) {
- var unlock;
- for(unlock in hotkeyConfig) {
- if(hotkeyConfig[unlock]["defaultHotkey"] && hotkeyConfig[
- unlock]["defaultHotkey"] != "") {
- /** @type {string} */
- hotkeyMapping[hotkeyConfig[unlock]["defaultHotkey"]] =
- unlock;
- }
- }
- setLocalStorage("hotkeyMapping", hotkeyMapping);
- } else {
- hotkeyMapping = JSON["parse"](getLocalStorage("hotkeyMapping"));
- }
- if(!getLocalStorage("hotkeyMessageSend")) {
- hotkeyMessageSend = defaultHotkeyMessageSend;
- setLocalStorage("hotkeyMessageSend", hotkeyMessageSend);
- } else {
- hotkeyMessageSend = JSON["parse"](getLocalStorage(
- "hotkeyMessageSend"));
- }
- };
- /**
- * @return {undefined}
- */
- this["replaceTos"] = function () {
- $(".tosBox")["html"](
- "<a target='_blank' class='text-muted' href='https://drive.google.com/open?id=1B6PDhwnwBjZhVXpXlkbZksnsZtkyRa4eaU5QW0SSGfI'>HKG Agar Tool Lite</a>" +
- "<span class='text-muted'> | " + this["version"] +
- "</span>");
- };
- /**
- * @return {undefined}
- */
- this["setupOption"] = function () {
- var handlers = {
- "opt_self_name": {
- text: "No my name",
- default: true,
- /**
- * @param {?} token
- * @return {undefined}
- */
- handler: function (token) {
- myApp["isHideSelfName"] = token;
- }
- },
- "opt_name": {
- text: "No names",
- /**
- * @param {?} token
- * @return {undefined}
- */
- handler: function (token) {
- setNames(!token);
- }
- },
- "opt_skin": {
- text: "No skins",
- default: true,
- /**
- * @param {?} token
- * @return {undefined}
- */
- handler: function (token) {
- setSkins(!token);
- }
- },
- "opt_color": {
- text: "No colors",
- /**
- * @param {?} token
- * @return {undefined}
- */
- handler: function (token) {
- setColors(token);
- }
- },
- "opt_mass": {
- text: "Show mass",
- default: true,
- /**
- * @param {?} token
- * @return {undefined}
- */
- handler: function (token) {
- setShowMass(token);
- }
- },
- "opt_stats": {
- text: "Skip stats",
- default: true,
- /**
- * @param {?} token
- * @return {undefined}
- */
- handler: function (token) {
- setSkipStats(token);
- }
- },
- "opt_zoom": {
- text: "Zoom",
- default: true,
- /**
- * @param {?} token
- * @return {undefined}
- */
- handler: function (token) {
- myApp["isEnableZoom"] = token;
- }
- },
- "opt_food": {
- text: "Hide Food",
- /**
- * @param {?} token
- * @return {undefined}
- */
- handler: function (token) {
- myApp["isEnableHideFood"] = token;
- }
- },
- "opt_gridline": {
- text: "Gridline",
- /**
- * @param {?} token
- * @return {undefined}
- */
- handler: function (token) {
- myApp["isEnableGridline"] = token;
- }
- },
- "opt_border": {
- text: "Border",
- default: true,
- /**
- * @param {?} token
- * @return {undefined}
- */
- handler: function (token) {
- myApp["isEnableBorder"] = token;
- }
- },
- "opt_simple_drawing": {
- text: "Simple draw",
- default: true,
- /**
- * @param {?} token
- * @return {undefined}
- */
- handler: function (token) {
- myApp["isEnableSimpleDrawing"] = token;
- }
- },
- "opt_score": {
- text: "Score",
- default: true,
- /**
- * @param {?} token
- * @return {undefined}
- */
- handler: function (token) {
- myApp["isShowScroll"] = token;
- }
- },
- "opt_ste": {
- text: "STE",
- default: true,
- /**
- * @param {?} token
- * @return {undefined}
- */
- handler: function (token) {
- myApp["isShowSTE"] = token;
- }
- },
- "opt_ball_total": {
- text: "[n/16]",
- default: true,
- /**
- * @param {?} token
- * @return {undefined}
- */
- handler: function (token) {
- myApp["isShowBallTotal"] = token;
- }
- },
- "opt_minimap": {
- text: "Minimap",
- default: true,
- /**
- * @param {?} token
- * @return {undefined}
- */
- handler: function (token) {
- if(token) {
- minimap["show"]();
- } else {
- minimap["hide"]();
- }
- }
- },
- "opt_mousew": {
- text: "Mouse W",
- /**
- * @param {?} token
- * @return {undefined}
- */
- handler: function (token) {
- myApp["isEnableMouseW"] = token;
- }
- },
- "opt_same_food_color": {
- text: "Rainbow color",
- /**
- * @param {?} token
- * @return {undefined}
- */
- handler: function (token) {
- /** @type {boolean} */
- myApp["isSameColorFood"] = !token;
- }
- },
- "opt_transparent_cell": {
- text: "Transparent Cell",
- /**
- * @param {?} token
- * @return {undefined}
- */
- handler: function (token) {
- myApp["isTransparentCell"] = token;
- }
- },
- "opt_fps": {
- text: "FPS",
- default: true,
- /**
- * @param {?} token
- * @return {undefined}
- */
- handler: function (token) {
- myApp["isShowFPS"] = token;
- }
- },
- "opt_packetIO": {
- text: "Pactets I/O",
- default: true,
- /**
- * @param {?} token
- * @return {undefined}
- */
- handler: function (token) {
- myApp["isShowPacketIO"] = token;
- }
- },
- "opt_auto_hide_mass": {
- text: "Auto hide mass",
- default: true,
- /**
- * @param {?} token
- * @return {undefined}
- */
- handler: function (token) {
- myApp["isAutoHideMass"] = token;
- }
- },
- "opt_auto_hide_name": {
- text: "Auto hide name",
- default: true,
- /**
- * @param {?} token
- * @return {undefined}
- */
- handler: function (token) {
- myApp["isAutoHideName"] = token;
- }
- },
- "opt_show_text_stroke_line": {
- text: "Text shadow",
- /**
- * @param {?} token
- * @return {undefined}
- */
- handler: function (token) {
- myApp["isShowTextStrokeLine"] = token;
- }
- },
- "opt_lock_zoom": {
- text: "Auto zoom",
- /**
- * @param {?} token
- * @return {undefined}
- */
- handler: function (token) {
- /** @type {boolean} */
- myApp["isEnableLockZoom"] = !token;
- }
- },
- "opt_split_ind": {
- text: "Split indicator",
- /**
- * @param {?} token
- * @return {undefined}
- */
- handler: function (token) {
- myApp["isEnableSplitInd"] = token;
- }
- },
- "opt_custom_skin": {
- text: "Custom Skin",
- default: true,
- /**
- * @param {?} token
- * @return {undefined}
- */
- handler: function (token) {
- myApp["isEnableCustomSkin"] = token;
- }
- },
- "opt_other_skin": {
- text: "YIN SKIN",
- disabled: true,
- /**
- * @param {?} token
- * @return {undefined}
- */
- handler: function (token) {
- myApp["isEnableOtherSkinSupport"] = token;
- }
- },
- "opt_system_message": {
- text: "System Msg",
- disabled: true,
- default: false,
- /**
- * @param {boolean} err
- * @return {undefined}
- */
- handler: function (err) {
- /** @type {boolean} */
- error = err;
- }
- },
- "opt_chatbox": {
- text: "Chatbox",
- disabled: true,
- /**
- * @param {?} token
- * @return {undefined}
- */
- handler: function (token) {
- if(token) {
- chatRoom["show"]();
- } else {
- chatRoom["hide"]();
- }
- }
- },
- "opt_chatpopup": {
- text: "Chat Popup",
- disabled: true,
- default: false,
- /**
- * @param {?} token
- * @return {undefined}
- */
- handler: function (token) {
- myApp["isEnableChatpopup"] = token;
- }
- },
- "opt_sound": {
- text: "Sound",
- disabled: true,
- default: false,
- /**
- * @param {?} token
- * @return {undefined}
- */
- handler: function (token) {
- myApp["isEnableSound"] = token;
- }
- },
- "opt_share_fb": {
- text: "132 MASS",
- disabled: true,
- default: false,
- /**
- * @param {?} token
- * @return {undefined}
- */
- handler: function (token) {
- myApp["isEnableShareFb"] = token;
- }
- }
- };
- /**
- * @param {?} v
- * @return {undefined}
- */
- window["setYinSkinSupport"] = function (v) {
- handlers["opt_other_skin"]["handler"](v);
- setLocalStorage("opt_other_skin", v);
- };
- var relatedTarget = $(document["createDocumentFragment"]());
- var i;
- for(i in handlers) {
- if(!handlers[i]["disabled"]) {
- relatedTarget["append"]('<label><input id="' + i +
- '" type="checkbox"></input><span>' + handlers[i][
- "text"
- ] + "</span></label>");
- }
- }
- $("#options")["append"](relatedTarget);
- $("input:checkbox")["change"](function () {
- var isChecked = $(this)["prop"]("checked");
- var type = $(this)["prop"]("id");
- setLocalStorage(type, isChecked);
- if(handlers[type]) {
- handlers[type]["handler"](isChecked);
- }
- });
- for(i in handlers) {
- if(getLocalStorage(i)) {
- if(getLocalStorage(i) == "true") {
- if(i == "opt_other_skin") {
- setYinSkinSupport(true);
- } else {
- $("#" + i)["click"]();
- }
- }
- continue;
- }
- if(handlers[i]["default"]) {
- $("#" + i)["click"]();
- }
- }
- $("#settings")["append"](
- '<div style="margin-top:10px;width:200px;"><div style="width:100%">Zoom Speed : <span id="txt_zoom_speed">0.97</span></div><input oninput="$(\'#txt_zoom_speed\').text(this.value);" style="width:100%;" type="range" id="opt_zoom_speed" name="opt_zoom_speed" min="0.9" max="0.99" step="0.01" value="0.97"></div>'
- );
- $("#opt_zoom_speed")["change"](function () {
- r20 = $("#opt_zoom_speed")["val"]();
- setLocalStorage("opt_zoom_speed", r20);
- });
- };
- /**
- * @param {Object} bStack
- * @return {?}
- */
- this["scoreInfo"] = function (bStack) {
- if(!bStack || !bStack["length"]) {
- return "";
- }
- /** @type {string} */
- var optsData = "";
- if(myApp["isShowSTE"]) {
- optsData += " STE: " + this["getSTE"](bStack);
- }
- if(myApp["isShowBallTotal"]) {
- optsData += " [" + bStack["length"] + "/16]";
- }
- return optsData;
- };
- /**
- * @param {string} dataAndEvents
- * @return {?}
- */
- this["scoreTxt"] = function (dataAndEvents) {
- return myApp["isShowScroll"] ? dataAndEvents : "";
- };
- /**
- * @return {?}
- */
- this["isShowScoreInfo"] = function () {
- return myApp["isShowScroll"] || (myApp["isShowSTE"] || myApp[
- "isShowBallTotal"]);
- };
- /**
- * @return {?}
- */
- this["showSystemMessage"] = function () {
- return error;
- };
- /**
- * @param {Object} stack
- * @return {?}
- */
- this["getSTE"] = function (stack) {
- /** @type {number} */
- var w = 0;
- /** @type {number} */
- var i = 0;
- for(; i < stack["length"]; i++) {
- if(stack[i] && (stack[i]["I"] && (stack[i]["I"]["w"] && stack[i]
- ["I"]["w"] > w))) {
- w = stack[i]["I"]["w"];
- }
- }
- return ~~(0.375 * w);
- };
- /**
- * @return {undefined}
- */
- this["createGameInfoBox"] = function () {
- $(".gameinfo")["prepend"](
- "<div id='game_info' class='agario-panel'>" +
- "<p id='ip_info'></p>" + "<p id='region_info'></p>" +
- "<p id='gamemode_info'></p>" +
- "<p id='party_code_info'></p>" + "<p id='lb_info'></p>" +
- "</div>");
- $("#game_info")["append"](
- '<button id ="btn_copy_gameinfo" class="btn btn-warning btn-hotkeys" type="button">Copy</button>'
- );
- };
- /**
- * @return {undefined}
- */
- this["updateLBInfo"] = function () {
- /** @type {string} */
- var later = "";
- var stack = myApp["getLeaderBoard"]();
- if(stack) {
- /** @type {number} */
- var i = 0;
- for(; i < stack["length"]; i++) {
- later += "<div>" + (i + 1) + ". " + stack[i] + "</div>";
- }
- }
- $("#lb_info")["html"](later);
- };
- /**
- * @return {?}
- */
- this["isPrivateServer"] = function () {
- return PRIVATE_SERVER_IP == currentIP;
- };
- /**
- * @return {?}
- */
- this["getCurrentIP"] = function () {
- console["log"](currentIP);
- if(this["isPrivateServer"]()) {
- return "----------";
- }
- return currentIP["substring"](5, currentIP["length"]);
- };
- /**
- * @return {?}
- */
- this["getRegion"] = function () {
- return $("#region option:selected")["text"]()["split"](" ")[0];
- };
- /**
- * @return {?}
- */
- this["getGameMode"] = function () {
- if(this["isPrivateServer"]()) {
- return "----------";
- }
- return $("#gamemode option:selected")["text"]();
- };
- /**
- * @return {?}
- */
- this["getTeamName"] = function () {
- var trim = $("#team_name")["val"]() == "" ? defaultTeamname : $(
- "#team_name")["val"]();
- return trim["trim"]();
- };
- /**
- * @return {?}
- */
- this["getCustomSkinUrl"] = function () {
- var url = ($("#skin_url")["val"]() + "")["trim"]();
- return url == "" ? "DEFAULT" : url;
- };
- /**
- * @return {?}
- */
- this["getCurrentPartyCode"] = function () {
- if(document["location"]["hash"] && 6 <= document["location"]["hash"]
- ["length"]) {
- return document["location"]["hash"];
- } else {
- return "N/A";
- }
- };
- /**
- * @param {?} deepDataAndEvents
- * @param {?} string
- * @return {undefined}
- */
- this["showMessage"] = function (deepDataAndEvents, string) {
- if($("#message_dialog")["length"] == 0) {
- myApp["createMessageDialog"]();
- }
- $("#message_dialog_title")["text"](deepDataAndEvents);
- $("#message_dialog_content")["html"](string);
- $("#message_dialog")["modal"]({
- show: "true"
- });
- };
- /**
- * @return {?}
- */
- this["getName"] = function () {
- var h = $("#nick")["val"]()["trim"]();
- if(h["indexOf"]("") != -1) {
- /** @type {string} */
- h = "";
- }
- return h == "" ? "不留名 [slick]" : h;
- };
- /**
- * @return {?}
- */
- this["getLeaderBoard"] = function () {
- /** @type {Array} */
- var result = [];
- var stack = getLB();
- if(stack) {
- /** @type {number} */
- var i = 0;
- for(; i < stack["length"]; i++) {
- result[result["length"]] = stack[i]["name"] == "" ?
- "An unnamed cell" : stack[i]["name"];
- }
- }
- return result;
- };
- /**
- * @return {undefined}
- */
- this["setupHotKey"] = function () {
- hotkeyConfig = {
- "hk_start_new_game": {
- defaultHotkey: "N",
- name: "Start new game",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- setNick(myApp["getName"]());
- },
- type: "NORMAL"
- },
- "hk_cheatw": {
- defaultHotkey: "E",
- name: "Marco W",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- /** @type {boolean} */
- myApp["autoW"] = true;
- },
- /**
- * @return {undefined}
- */
- keyUp: function () {
- /** @type {boolean} */
- myApp["autoW"] = false;
- },
- type: "NORMAL"
- },
- "hk_quick_space": {
- defaultHotkey: "T",
- name: "Quick space",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- if(myApp["quickSpace"]) {
- return;
- }
- /** @type {boolean} */
- myApp["quickSpace"] = true;
- quickSpace();
- },
- /**
- * @return {undefined}
- */
- keyUp: function () {
- /** @type {boolean} */
- myApp["quickSpace"] = false;
- },
- type: "NORMAL"
- },
- "hk_double_space": {
- defaultHotkey: "G",
- name: "Double space",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- if(myApp["doubleSpace"]) {
- return;
- }
- /** @type {boolean} */
- myApp["doubleSpace"] = true;
- doubleSpace();
- },
- /**
- * @return {undefined}
- */
- keyUp: function () {
- /** @type {boolean} */
- myApp["doubleSpace"] = false;
- },
- type: "NORMAL"
- },
- "hk_change_color": {
- defaultHotkey: "TAB",
- name: "Switch Color",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- myApp["cellColor"] = myApp["cellColorAry"][(
- myApp["cellColorAry"]["indexOf"](
- myApp["cellColor"]) + 1) %
- myApp["cellColorAry"]["length"]
- ];
- },
- type: "NORMAL"
- },
- "hk_stop_movement_toggle": {
- defaultHotkey: "ALT_S",
- name: "Stop movement (Toggle)",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- /** @type {boolean} */
- myApp["isStopMovement"] = !myApp[
- "isStopMovement"];
- /** @type {null} */
- myApp["specTeammate"] = null;
- },
- type: "NORMAL"
- },
- "hk_stop_movement": {
- defaultHotkey: "S",
- name: "Stop movement (Temporary)",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- /** @type {boolean} */
- myApp["isStopMovement"] = true;
- /** @type {null} */
- myApp["specTeammate"] = null;
- moveTo(null, null);
- },
- /**
- * @return {undefined}
- */
- keyUp: function () {
- /** @type {boolean} */
- myApp["isStopMovement"] = false;
- },
- type: "NORMAL"
- },
- "hk_split_ind": {
- defaultHotkey: "I",
- name: "On/ off split indicator",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- $("#opt_split_ind")["click"]();
- },
- type: "NORMAL"
- },
- "hk_lock_zoom": {
- defaultHotkey: "L",
- name: "On/ off auto zoom",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- $("#opt_lock_zoom")["click"]();
- },
- type: "NORMAL"
- },
- "hk_attack_range": {
- defaultHotkey: "A",
- name: "Show attack range (Temporary)",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- /** @type {boolean} */
- myApp["isEnableAttackRange"] = true;
- },
- /**
- * @return {undefined}
- */
- keyUp: function () {
- /** @type {boolean} */
- myApp["isEnableAttackRange"] = false;
- },
- type: "NORMAL"
- },
- "hk_attack_range_toggle": {
- defaultHotkey: "ALT_A",
- name: "Show attack range (Toggle)",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- /** @type {boolean} */
- myApp["isEnableAttackRange"] = !myApp[
- "isEnableAttackRange"];
- },
- type: "NORMAL"
- },
- "hk_spec_teammate": {
- defaultHotkey: "V",
- name: "Spectating teammate",
- /**
- * @return {undefined}
- */
- keyDown: function () {},
- type: "NORMAL"
- },
- "hk_custom_skin": {
- defaultHotkey: "",
- name: "On/ off Custom skin",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- $("#opt_custom_skin")["click"]();
- },
- type: "NORMAL"
- },
- "hk_skin": {
- defaultHotkey: "",
- name: "Show/ hide skins",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- $("#opt_skin")["click"]();
- },
- type: "NORMAL"
- },
- "hk_same_food_color": {
- defaultHotkey: "",
- name: "On/ off Rainbow color",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- $("#opt_same_food_color")["click"]();
- },
- type: "NORMAL"
- },
- "hk_transparent_cell": {
- defaultHotkey: "",
- name: "On/ off transparent cell",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- $("#opt_transparent_cell")["click"]();
- },
- type: "NORMAL"
- },
- "hk_fps": {
- defaultHotkey: "",
- name: "Show/ Hide FPS counter",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- $("#opt_fps")["click"]();
- },
- type: "NORMAL"
- },
- "hk_zoom_a": {
- defaultHotkey: "1",
- name: "Zoom level 1",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- if(!myApp["isEnableLockZoom"]) {
- hotkeyConfig["hk_lock_zoom"]["keyDown"]();
- }
- setZoomLevel(0.75);
- },
- type: "NORMAL"
- },
- "hk_zoom_b": {
- defaultHotkey: "2",
- name: "Zoom level 2",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- if(!myApp["isEnableLockZoom"]) {
- hotkeyConfig["hk_lock_zoom"]["keyDown"]();
- }
- setZoomLevel(0.3);
- },
- type: "NORMAL"
- },
- "hk_zoom_c": {
- defaultHotkey: "3",
- name: "Zoom level 3",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- if(!myApp["isEnableLockZoom"]) {
- hotkeyConfig["hk_lock_zoom"]["keyDown"]();
- }
- setZoomLevel(0.15);
- },
- type: "NORMAL"
- },
- "hk_zoom_d": {
- defaultHotkey: "4",
- name: "Zoom level 4",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- if(!myApp["isEnableLockZoom"]) {
- hotkeyConfig["hk_lock_zoom"]["keyDown"]();
- }
- setZoomLevel(0.08);
- },
- type: "NORMAL"
- },
- "hk_zoom_e": {
- defaultHotkey: "5",
- name: "Zoom level 5",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- if(!myApp["isEnableLockZoom"]) {
- hotkeyConfig["hk_lock_zoom"]["keyDown"]();
- }
- setZoomLevel(0.05);
- },
- type: "NORMAL"
- },
- "hk_name": {
- defaultHotkey: "ALT_N",
- name: "Show/ hide names",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- $("#opt_name")["click"]();
- },
- type: "NORMAL"
- },
- "hk_self_name": {
- defaultHotkey: "",
- name: "Show/ hide self name",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- $("#opt_self_name")["click"]();
- },
- type: "NORMAL"
- },
- "hk_color": {
- defaultHotkey: "",
- name: "Show/ hide colors",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- $("#opt_color")["click"]();
- },
- type: "NORMAL"
- },
- "hk_mass": {
- defaultHotkey: "",
- name: "Show/ hide mass",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- $("#opt_mass")["click"]();
- },
- type: "NORMAL"
- },
- "hk_stat": {
- defaultHotkey: "",
- name: "On/ off Skip stats",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- $("#opt_stats")["click"]();
- },
- type: "NORMAL"
- },
- "hk_zoom": {
- defaultHotkey: "ALT_Z",
- name: "On/ off Zoom",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- $("#opt_zoom")["click"]();
- },
- type: "NORMAL"
- },
- "hk_food": {
- defaultHotkey: "F",
- name: "Show/ hide Food",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- $("#opt_food")["click"]();
- },
- type: "NORMAL"
- },
- "hk_gridline": {
- defaultHotkey: "ALT_G",
- name: "Show/ hide Gridline",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- $("#opt_gridline")["click"]();
- },
- type: "NORMAL"
- },
- "hk_border": {
- defaultHotkey: "ALT_B",
- name: "Show/ hide Border",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- $("#opt_border")["click"]();
- },
- type: "NORMAL"
- },
- "hk_simple_draw": {
- defaultHotkey: "",
- name: "On/ off Simple draw",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- $("#opt_simple_drawing")["click"]();
- },
- type: "NORMAL"
- },
- "hk_score": {
- defaultHotkey: "",
- name: "Show/ hide Score",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- $("#opt_score")["click"]();
- },
- type: "NORMAL"
- },
- "hk_ste": {
- defaultHotkey: "",
- name: "Show/ hide STE",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- $("#opt_ste")["click"]();
- },
- type: "NORMAL"
- },
- "hk_n16": {
- defaultHotkey: "",
- name: "Show/ hide [n/16]",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- $("#opt_ball_total")["click"]();
- },
- type: "NORMAL"
- },
- "hk_auto_hide_mass": {
- defaultHotkey: "",
- name: "On/ off Auto hide mass",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- $("#opt_auto_hide_mass")["click"]();
- },
- type: "NORMAL"
- },
- "hk_auto_hide_name": {
- defaultHotkey: "",
- name: "On/ off Auto hide name",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- $("#opt_auto_hide_name")["click"]();
- },
- type: "NORMAL"
- },
- "hk_show_text_stroke_line": {
- defaultHotkey: "",
- name: "Show/ hide Text shadow",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- $("#opt_show_text_stroke_line")["click"]();
- },
- type: "NORMAL"
- },
- "hk_minimap": {
- defaultHotkey: "ALT_M",
- name: "Show/ hide Minimap",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- $("#opt_minimap")["click"]();
- },
- type: "NORMAL"
- },
- "hk_mousew": {
- defaultHotkey: "",
- name: "On/ off Mouse W",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- $("#opt_mousew")["click"]();
- },
- type: "NORMAL"
- },
- "hk_pause": {
- defaultHotkey: "P",
- name: "Pause game for short moment",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- var _0x3495x11b = (new Date)["getTime"]();
- for(; _0x3495x11b + 500 >= (new Date)["getTime"]
- ();) {}
- },
- type: "NORMAL"
- },
- "hk_send_msg": {
- defaultHotkey: "ENTER",
- name: "Chatbox send message",
- /**
- * @return {undefined}
- */
- keyDown: function () {
- chatRoom["enter"]();
- },
- type: "NORMAL"
- }
- };
- };
- /**
- * @return {undefined}
- */
- this["createMessageDialog"] = function () {
- var iid;
- var f;
- var e;
- e = $("<div class='modal-footer'>");
- e["append"](
- "<button type='button' class='btn btn-default' data-dismiss='modal'>OK</button>"
- );
- f = $("<div class='modal-content'/>");
- f["append"]($("<div class='modal-header'/>")["append"](
- "<button type='button' class='close' data-dismiss='modal'>×</button><h4 id='message_dialog_title' class='modal-title'></h4>"
- ));
- f["append"]($(
- "<div id='message_dialog_content' class='modal-body'>"));
- f["append"](e);
- iid = $(
- "<div id='message_dialog' class='modal fade' role='dialog'/>"
- )["append"]("<div class='modal-dialog'/>")["append"](f);
- $("body")["append"](iid);
- $("#message_dialog")["modal"]({
- backdrop: "static",
- keyboard: false
- });
- $(document)["on"]("shown.bs.modal", "#message_dialog", function () {
- var height = $("#message_dialog>.modal-content")[
- "outerHeight"]();
- var windowHeight = $(document)["outerHeight"]();
- if(height > windowHeight) {
- $("#message_dialog")["css"]("overflow", "auto");
- } else {
- $("#message_dialog")["css"]("margin-top",
- windowHeight / 2 - height / 2 - 40);
- }
- });
- $(document)["on"]("hide.bs.modal", "#message_dialog", function () {});
- };
- /**
- * @return {undefined}
- */
- this["setUpHotKeyConfigPage"] = function () {
- $("button[data-itr=logout]")["before"]($(
- "<button type='button' class='btn btn-warning btn-hotkeys' data-toggle='modal' data-target='#hotkeys_setting'>Hotkeys</button>"
- ));
- var pdataCur;
- var dest;
- var data;
- data = $("<div class='modal-footer'>");
- data["append"](
- "<button onclick='resetDefaultHotkey();' type='button' class='btn btn-default'>Reset Default</button>"
- );
- data["append"](
- "<button id='btn_save_hotkey' onclick='saveHotkeys();' type='button' class='btn btn-default' data-dismiss='modal'>Save</button>"
- );
- data["append"](
- "<button type='button' class='btn btn-default' data-dismiss='modal'>Cancel</button>"
- );
- dest = $("<div class='modal-content'/>");
- dest["append"]($("<div class='modal-header'/>")["append"](
- "<button type='button' class='close' data-dismiss='modal'>×</button><h4 class='modal-title'>Hotkeys Setting</h4>"
- ));
- dest["append"]($("<div id='hotkey_modal_body' class='modal-body'>")[
- "append"](myApp["getHotkeyDivHtml"]()));
- dest["append"](data);
- pdataCur = $(
- "<div id='hotkeys_setting' class='modal fade' role='dialog'/>"
- )["append"]("<div class='modal-dialog'/>")["append"](dest);
- $("body")["append"](pdataCur);
- $(document)["on"]("hide.bs.modal", "#hotkeys_setting", function () {
- if(selectedHotkeyRow) {
- selectedHotkeyRow["removeClass"](
- "table-row-selected");
- }
- /** @type {null} */
- selectedHotkeyRow = null;
- myApp["refreshHotkeySettingPage"]();
- });
- $("#hotkey_table .row")["not"](".header")["click"](function () {
- if(selectedHotkeyRow) {
- selectedHotkeyRow["removeClass"](
- "table-row-selected");
- }
- selectedHotkeyRow = $(this);
- selectedHotkeyRow["addClass"]("table-row-selected");
- });
- };
- /**
- * @return {undefined}
- */
- window["saveHotkeys"] = function () {
- var stack = $(".hotkey");
- hotkeyMapping = {};
- /** @type {number} */
- var i = 0;
- for(; i < stack["length"]; i++) {
- hotkeyMapping[$(stack[i])["text"]()] = $(stack[i])["attr"](
- "data-hotkeyid");
- }
- setLocalStorage("hotkeyMapping", hotkeyMapping);
- var guid;
- for(guid in hotkeyMessageSend) {
- hotkeyMessageSend[guid] = $("#" + guid)["val"]();
- }
- setLocalStorage("hotkeyMessageSend", hotkeyMessageSend);
- };
- /**
- * @return {undefined}
- */
- this["copyGameInfo"] = function () {
- /** @type {string} */
- var later = "";
- later += "Current IP = " + myApp["getCurrentIP"]();
- later += "\nRegion : " + $("#region option:selected")["text"]()[
- "split"](" ")[0];
- later += "\nGame mode : " + $("#gamemode option:selected")["text"]();
- later += "\nParty Code : " + myApp["getCurrentPartyCode"]();
- var stack = myApp["getLeaderBoard"]();
- if(stack && stack["length"] != 0) {
- /** @type {number} */
- var i = 0;
- for(; i < stack["length"]; i++) {
- later += "\n" + (i + 1) + ". " + stack[i];
- }
- }
- copyToClipboard(later);
- };
- /**
- * @return {undefined}
- */
- window["resetDefaultHotkey"] = function () {
- var _0x3495x124;
- _0x3495x124 = hotkeyMapping;
- defaultHotkeyMapping = {};
- var unlock;
- for(unlock in hotkeyConfig) {
- if(hotkeyConfig[unlock]["defaultHotkey"] && hotkeyConfig[unlock]
- ["defaultHotkey"] != "") {
- /** @type {string} */
- defaultHotkeyMapping[hotkeyConfig[unlock]["defaultHotkey"]] =
- unlock;
- }
- }
- hotkeyMapping = defaultHotkeyMapping;
- myApp["refreshHotkeySettingPage"]();
- hotkeyMapping = _0x3495x124;
- /** @type {null} */
- _0x3495x124 = null;
- /** @type {null} */
- defaultHotkeyMapping = null;
- var guid;
- for(guid in defaultHotkeyMessageSend) {
- $("#" + guid)["val"](defaultHotkeyMessageSend[guid]);
- }
- };
- /**
- * @return {undefined}
- */
- this["refreshHotkeySettingPage"] = function () {
- var stack = $(".hotkey");
- /** @type {number} */
- var i = 0;
- for(; i < stack["length"]; i++) {
- $(stack[i])["text"](" ");
- }
- var sel;
- for(sel in hotkeyMapping) {
- $("[data-hotkeyid=" + hotkeyMapping[sel] + "]")["text"](sel);
- }
- var guid;
- for(guid in hotkeyMessageSend) {
- $("#" + guid)["val"](hotkeyMessageSend[guid]);
- }
- };
- /**
- * @return {?}
- */
- this["getHotkeyDivHtml"] = function () {
- /** @type {string} */
- var later = "";
- var p = $("<div id='hotkey_setting'></div>");
- var nodes = $("<div id='hotkey_table' class='table'></div>");
- var self = $("<div class='row header blue'></div>");
- self["append"]($(
- "<div class='cell' style='width:170px;'>Hotkey</div>"));
- self["append"]($(
- "<div class='cell' style='width:222px;'>Function</div>"
- ));
- self["append"]($("<div class='cell'>Message</div>"));
- nodes["append"](self);
- /** @type {null} */
- var value = null;
- var id;
- for(id in hotkeyConfig) {
- value = $("<div class='row'></div>");
- value["append"]($("<div data-hotkeyId='" + id +
- "' class='cell hotkey'>" + getHotkeyById(id) +
- "</div>"));
- value["append"]($("<div class='cell'>" + hotkeyConfig[id][
- "name"
- ] + "</div>"));
- if(hotkeyConfig[id]["type"] == "TEXT") {
- value["append"]($("<div class='cell'><input id='input_" +
- id +
- "' maxlength='200' style='width:100%;color:black;' type='text' value='" +
- hotkeyMessageSend["input_" + id] +
- "'></input></div>"));
- } else {
- value["append"]($("<div class='cell'> / </div>"));
- }
- nodes["append"](value);
- }
- p["append"](nodes);
- later += $("<p>Step 1 : Click on the function item</p>")[0][
- "outerHTML"
- ];
- later += $("<p>Step 2 : Press wanted hotkey to modify</p>")[0][
- "outerHTML"
- ];
- later += $("<p>Press DEL button to del selected hotkey</p>")[0][
- "outerHTML"
- ];
- later += $(
- "<p>PS : Hotkey combination only support - (Ctrl) + (Alt) + 0-9,a-z,tab, enter</p>"
- )[0]["outerHTML"];
- later += $("<br></br>")[0]["outerHTML"];
- later += p[0]["outerHTML"];
- return $("<div/>")["append"](later)["html"]();
- };
- /**
- * @return {undefined}
- */
- this["checkVersion"] = function () {
- var version = getLocalStorage("lastestVersion");
- if(!version || version != myApp["version"]) {
- myApp["applyNewUpdate"]();
- setLocalStorage("lastestVersion", myApp["version"]);
- }
- };
- /**
- * @return {undefined}
- */
- this["showAnnouncement"] = function () {
- if(announcementTxt == "") {
- var substitute = myApp["ajax"](URL_MESSAGE, "get", function (
- dataAndEvents) {
- announcementTxt = dataAndEvents["responseText"];
- myApp["showMessage"]("Notice", announcementTxt);
- })
- } else {
- myApp["showMessage"]("Update info", announcementTxt);
- }
- };
- /**
- * @return {undefined}
- */
- this["applyNewUpdate"] = function () {};
- /**
- * @return {undefined}
- */
- this["setupHints"] = function () {
- this["setupHintsImpl"]($("button[data-target=#hotkeys_setting]"),
- "Hotkey setup page.");
- };
- /**
- * @param {Object} node
- * @param {?} value
- * @return {undefined}
- */
- this["setupHintsImpl"] = function (node, value) {
- /** @type {string} */
- var alpha = "hint--bottom hint--rounded";
- node["addClass"](alpha);
- node["attr"]("data-hint", value);
- };
- /**
- * @param {?} url
- * @param {?} method
- * @param {?} next
- * @param {(Function|number)} requestOptions
- * @return {?}
- */
- this["ajax"] = function (url, method, next, requestOptions) {
- /** @type {null} */
- requestOptions = null;
- var request;
- try {
- /** @type {XMLHttpRequest} */
- request = new XMLHttpRequest;
- } catch(e) {
- try {
- request = new ActiveXObject("Msxml2.XMLHTTP");
- } catch(e) {
- try {
- request = new ActiveXObject("Microsoft.XMLHTTP");
- } catch(e) {
- alert("Your browser does not support Ajax.");
- return false;
- }
- }
- }
- /**
- * @return {undefined}
- */
- request["onreadystatechange"] = function () {
- if(request["readyState"] == 4) {
- next(request);
- }
- };
- request["open"](method, url, true);
- request["send"](requestOptions);
- return request;
- };
- /**
- * @param {string} base
- * @return {?}
- */
- this["getSkinImage"] = function (base) {
- if(!base || base == "") {
- return null;
- }
- if(customSkin[base]) {
- return customSkin[base];
- } else {
- if(skinDownloadQueue["indexOf"](base) == -1) {
- skinDownloadQueue["push"](base);
- }
- return null;
- }
- };
- /**
- * @return {undefined}
- */
- this["downloadSkin"] = function () {
- if(skinDownloadQueue["length"] != 0) {
- var task = skinDownloadQueue["shift"]();
- if(!customSkin[task]) {
- if(skinDownloadFail[task] && skinDownloadFail[task] > 5) {
- if(myApp["getCustomSkinUrl"]() === task) {
- $("#skin_url")["val"]("DEFAULT")["trigger"](
- "change");
- }
- } else {
- window["postMessage"]({
- action: Action["IMAGE"],
- data: task
- }, "*");
- }
- }
- }
- setTimeout(myApp["downloadSkin"], 2E3);
- };
- /**
- * @param {?} value
- * @return {undefined}
- */
- this["changePreviewImage"] = function (value) {
- $("#preview-img")["fadeOut"](315, function () {
- $(this)["attr"]("src", value)["bind"](
- "onreadystatechange load",
- function () {
- if(this["complete"]) {
- $(this)["fadeIn"](315);
- }
- });
- });
- };
- }
- /**
- * @return {undefined}
- */
- function ChatRoom() {
- /** @type {string} */
- this["container"] = "";
- /** @type {boolean} */
- this["isShow"] = true;
- /** @type {string} */
- this["lastMsg"] = "";
- /** @type {number} */
- this["width"] = 340;
- /** @type {number} */
- this["height"] = 350;
- var options = this;
- /** @type {number} */
- var _0x3495x132 = 0;
- /**
- * @return {undefined}
- */
- this["createChatBox"] = function () {
- $(this["container"])["append"]("<div id='chatroom'></div>");
- $("#overlays2")["append"](
- "<div id='chatboxArea2'><input id='input_box2' type='text'></input></div>"
- );
- this["hide"]();
- $("#chatboxArea2")["hide"]();
- $("#chatroom")["mouseup"](function () {
- options["resize"]();
- });
- };
- /**
- * @return {undefined}
- */
- options["resize"] = function () {
- if($("#chatroom")["width"]() != this["width"] || $("#chatroom")[
- "height"]() != this["height"]) {
- if($("#chatroom")["perfectScrollbar"]) {
- $("#chatroom")["perfectScrollbar"]("update");
- }
- } else {}
- };
- /**
- * @param {?} container
- * @return {undefined}
- */
- this["setContainer"] = function (container) {
- this["container"] = container;
- };
- /**
- * @return {undefined}
- */
- this["enter"] = function () {
- if(this["isFocus"]()) {
- $("#input_box2")["val"]("");
- $("#input_box2")["blur"]();
- $("#chatboxArea2")["hide"]();
- } else {
- this["focus"]();
- }
- };
- /**
- * @param {?} dep
- * @return {undefined}
- */
- this["popup"] = function (dep) {
- if(!myApp["isEnableChatpopup"] || this["isShow"]) {
- return;
- }
- if($["toast"]) {
- $["toast"](dep);
- } else {
- toastQueue["push"](dep);
- }
- };
- /**
- * @param {?} text
- * @return {undefined}
- */
- this["popupInfo"] = function (text) {
- this["popup"]({
- text: escapeHtml(text),
- showHideTransition: "slide",
- icon: "info",
- bgColor: "rgba(10, 10, 10, 0.8)",
- allowToastClose: false,
- hideAfter: 15E3,
- stack: 10
- });
- };
- /**
- * @param {?} text
- * @return {undefined}
- */
- this["popupWarning"] = function (text) {
- this["popup"]({
- text: escapeHtml(text),
- showHideTransition: "slide",
- icon: "warning",
- bgColor: "rgba(10, 10, 10, 0.8)",
- allowToastClose: false,
- hideAfter: 15E3,
- stack: 10
- });
- };
- /**
- * @param {(Object|string)} path
- * @param {?} msg
- * @return {undefined}
- */
- this["popupChat"] = function (path, msg) {
- var resolved = escapeHtml(path);
- var _0x3495x136 = this["replaceHKGIcon"](escapeHtml(msg));
- if(path == "不留名 [slick]") {
- resolved = this["replaceHKGIcon"](resolved);
- }
- this["popup"]({
- heading: '<span class="toast_sender">' + resolved +
- " : </span>",
- text: '<span class="toast_chatmsg">' + _0x3495x136 +
- "</span>",
- showHideTransition: "fade",
- bgColor: "rgba(10, 10, 10, 0.8)",
- allowToastClose: false,
- hideAfter: 15E3,
- stack: 10
- });
- };
- /**
- * @param {?} deepDataAndEvents
- * @return {undefined}
- */
- this["showSystemMessage"] = function (deepDataAndEvents) {
- this["showSystemMessageImpl"](deepDataAndEvents);
- this["popupInfo"](deepDataAndEvents);
- };
- /**
- * @param {?} deepDataAndEvents
- * @return {undefined}
- */
- this["showSystemWarning"] = function (deepDataAndEvents) {
- this["showSystemMessageImpl"](deepDataAndEvents);
- this["popupWarning"](deepDataAndEvents);
- };
- /**
- * @param {?} dataAndEvents
- * @return {undefined}
- */
- this["showSystemMessageImpl"] = function (dataAndEvents) {
- if(!myApp["showSystemMessage"]()) {
- return;
- }
- $("#chatroom")["append"]($("<div/>")["append"]($(
- "<span class='system'/>")["text"](this["getTimeStr"]
- () + dataAndEvents)));
- this["scrollDown"]();
- };
- /**
- * @return {?}
- */
- this["getTimeStr"] = function () {
- /** @type {Date} */
- var date = new Date;
- var fromIndex = date["getMinutes"]();
- fromIndex = fromIndex < 10 ? "0" + fromIndex : fromIndex;
- return date["getHours"]() + ":" + fromIndex + " ";
- };
- /**
- * @param {string} deepDataAndEvents
- * @param {?} key
- * @return {undefined}
- */
- this["receiveMessage"] = function (deepDataAndEvents, key) {
- var relatedTarget = $("<div/>");
- var r20 = $("<span class='time'>")["text"](this["getTimeStr"]());
- var attachments = $("<span class='sender'>")["text"](
- deepDataAndEvents + " : ");
- if(deepDataAndEvents == "不留名 [slick]") {
- attachments["html"](this["replaceHKGIcon"](attachments["html"]()));
- }
- relatedTarget["append"](r20);
- relatedTarget["append"](attachments);
- var camelKey = $("<span class='msg'>")["text"](key);
- camelKey["html"](this["replaceHKGIcon"](camelKey["html"]()));
- relatedTarget["append"](camelKey);
- $("#chatroom")["append"](relatedTarget);
- this["scrollDown"]();
- this["popupChat"](deepDataAndEvents, key);
- };
- /**
- * @param {Object} actualObject
- * @return {?}
- */
- this["replaceHKGIcon"] = function (actualObject) {
- /** @type {Object} */
- var object = actualObject;
- var root;
- for(root in hkgIcon) {
- object = object["replace"](new RegExp(escapeRegex(root), "g"),
- '<img alt="$1" src="' + hkgIcon[root] + '">');
- }
- var stack = $('img[alt="$1"]');
- /** @type {number} */
- var i = 0;
- for(; i < stack["length"]; i++) {
- for(root in hkgIcon) {
- if(stack[i]["src"] == hkgIcon[root]) {
- $(stack[i])["attr"]("alt", root);
- break;
- }
- }
- }
- return object;
- };
- /**
- * @return {undefined}
- */
- this["scrollDown"] = function () {
- if($("#chatroom")["perfectScrollbar"]) {
- $("#chatroom")["scrollTop"]($("#chatroom")["prop"](
- "scrollHeight"));
- $("#chatroom")["perfectScrollbar"]("update");
- }
- };
- /**
- * @return {undefined}
- */
- this["show"] = function () {
- $("#chatroom")["show"]();
- /** @type {boolean} */
- this["isShow"] = true;
- this["scrollDown"]();
- };
- /**
- * @return {undefined}
- */
- this["hide"] = function () {
- $("#chatroom")["hide"]();
- /** @type {boolean} */
- this["isShow"] = false;
- };
- /**
- * @return {?}
- */
- this["isFocus"] = function () {
- return $("#input_box2")["is"](":focus");
- };
- /**
- * @return {undefined}
- */
- this["focus"] = function () {
- $("#chatboxArea2")["show"]();
- $("#input_box2")["focus"]();
- };
- /**
- * @return {undefined}
- */
- this["createScrollBar"] = function () {
- $("#chatroom")["perfectScrollbar"]({
- minScrollbarLength: 50,
- suppressScrollX: false
- });
- };
- }
- /**
- * @return {undefined}
- */
- function Minimap() {
- var data;
- var style;
- var o;
- var cache;
- /** @type {number} */
- var imgWidth = 250;
- /** @type {number} */
- var r = 250;
- /** @type {number} */
- var random = 5;
- /** @type {string} */
- var value = "#FFC0CB";
- /** @type {boolean} */
- var _0x3495x142 = false;
- var interval;
- /** @type {number} */
- var time = 30;
- /** @type {number} */
- var speed = 1E3 / time;
- var text = {};
- /**
- * @param {number} v
- * @return {undefined}
- */
- this["createMap"] = function (v) {
- if(v) {
- imgWidth = r = v;
- }
- $("body")["append"]("<canvas id='minimapNode'>");
- $("body")["append"]("<canvas id='minimap' >");
- data = document["getElementById"]("minimap");
- style = data["getContext"]("2d");
- data["width"] = imgWidth;
- data["height"] = r;
- style["scale"](1, 1);
- /** @type {number} */
- style["globalAlpha"] = 0.2;
- /** @type {string} */
- style["fillStyle"] = "#535353";
- style["fillRect"](0, 0, data["width"], data["height"]);
- /** @type {string} */
- style["strokeStyle"] = "#000000";
- style["beginPath"]();
- style["moveTo"](0, r / 5);
- style["lineTo"](imgWidth, r / 5);
- style["moveTo"](0, r / 5 * 2);
- style["lineTo"](imgWidth, r / 5 * 2);
- style["moveTo"](0, r / 5 * 3);
- style["lineTo"](imgWidth, r / 5 * 3);
- style["moveTo"](0, r / 5 * 4);
- style["lineTo"](imgWidth, r / 5 * 4);
- style["moveTo"](imgWidth / 5, 0);
- style["lineTo"](imgWidth / 5, r);
- style["moveTo"](imgWidth / 5 * 2, 0);
- style["lineTo"](imgWidth / 5 * 2, r);
- style["moveTo"](imgWidth / 5 * 3, 0);
- style["lineTo"](imgWidth / 5 * 3, r);
- style["moveTo"](imgWidth / 5 * 4, 0);
- style["lineTo"](imgWidth / 5 * 4, r);
- style["stroke"]();
- /** @type {string} */
- style["font"] = "bold 26px Ubuntu";
- /** @type {string} */
- style["textAlign"] = "center";
- /** @type {string} */
- style["textBaseline"] = "middle";
- /** @type {string} */
- style["fillStyle"] = "#pink";
- style["fillText"]("A1", imgWidth / 5 / 2, r / 5 / 2);
- style["fillText"]("A2", imgWidth / 5 / 2 * 3, r / 5 / 2);
- style["fillText"]("A3", imgWidth / 5 / 2 * 5, r / 5 / 2);
- style["fillText"]("A4", imgWidth / 5 / 2 * 7, r / 5 / 2);
- style["fillText"]("A5", imgWidth / 5 / 2 * 9, r / 5 / 2);
- style["fillText"]("B1", imgWidth / 5 / 2, r / 5 / 2 * 3);
- style["fillText"]("B2", imgWidth / 5 / 2 * 3, r / 5 / 2 * 3);
- style["fillText"]("B3", imgWidth / 5 / 2 * 5, r / 5 / 2 * 3);
- style["fillText"]("B4", imgWidth / 5 / 2 * 7, r / 5 / 2 * 3);
- style["fillText"]("B5", imgWidth / 5 / 2 * 9, r / 5 / 2 * 3);
- style["fillText"]("C1", imgWidth / 5 / 2, r / 5 / 2 * 5);
- style["fillText"]("C2", imgWidth / 5 / 2 * 3, r / 5 / 2 * 5);
- style["fillText"]("C3", imgWidth / 5 / 2 * 5, r / 5 / 2 * 5);
- style["fillText"]("C4", imgWidth / 5 / 2 * 7, r / 5 / 2 * 5);
- style["fillText"]("C5", imgWidth / 5 / 2 * 9, r / 5 / 2 * 5);
- style["fillText"]("D1", imgWidth / 5 / 2, r / 5 / 2 * 7);
- style["fillText"]("D2", imgWidth / 5 / 2 * 3, r / 5 / 2 * 7);
- style["fillText"]("D3", imgWidth / 5 / 2 * 5, r / 5 / 2 * 7);
- style["fillText"]("D4", imgWidth / 5 / 2 * 7, r / 5 / 2 * 7);
- style["fillText"]("D5", imgWidth / 5 / 2 * 9, r / 5 / 2 * 7);
- style["fillText"]("E1", imgWidth / 5 / 2, r / 5 / 2 * 9);
- style["fillText"]("E2", imgWidth / 5 / 2 * 3, r / 5 / 2 * 9);
- style["fillText"]("E3", imgWidth / 5 / 2 * 5, r / 5 / 2 * 9);
- style["fillText"]("E4", imgWidth / 5 / 2 * 7, r / 5 / 2 * 9);
- style["fillText"]("E5", imgWidth / 5 / 2 * 9, r / 5 / 2 * 9);
- o = document["getElementById"]("minimapNode");
- cache = o["getContext"]("2d");
- /** @type {number} */
- o["width"] = v;
- /** @type {number} */
- o["height"] = v;
- /** @type {number} */
- cache["globalAlpha"] = 1;
- cache["scale"](1, 1);
- /** @type {string} */
- cache["textAlign"] = "center";
- /** @type {string} */
- cache["textBaseline"] = "middle";
- /** @type {string} */
- cache["font"] = "bold 12px Ubuntu";
- this["hide"]();
- /** @type {number} */
- interval = setInterval(function () {
- minimap["drawNodes"]();
- }, speed);
- };
- /**
- * @param {?} dataAndEvents
- * @return {?}
- */
- this["isExists"] = function (dataAndEvents) {
- /** @type {number} */
- var i = 0;
- for(; i < nodeList["length"]; i++) {
- if(dataAndEvents == nodeList[i][0]) {
- return i;
- }
- }
- return null;
- };
- /**
- * @param {Object} done
- * @return {undefined}
- */
- this["addNode"] = function (done) {
- /** @type {Array} */
- nodeList[nodeList["length"]] = [done["id"], done["name"], null,
- null, "#448AFF", done["skinurl"], done["cellColor"]
- ];
- };
- /**
- * @param {?} dataAndEvents
- * @return {undefined}
- */
- this["deleteNode"] = function (dataAndEvents) {};
- /**
- * @return {undefined}
- */
- this["drawNodes"] = function () {
- var imgHeight = getLengthX();
- var total = getLengthY();
- cache["clearRect"](0, 0, o["width"], o["height"]);
- var a = getCurrentX();
- var b = getCurrentY();
- if(a && b) {
- text["x"] = nodeList[0][2];
- text["y"] = nodeList[0][3];
- }
- nodeList[0][2] = a;
- nodeList[0][3] = b;
- nodeList[0][12] = a;
- nodeList[0][13] = b;
- if(myApp["isSpectating"]) {
- nodeList[1][2] = getTop1X();
- nodeList[1][3] = getTop1Y();
- nodeList[1][12] = getTop1X();
- nodeList[1][13] = getTop1Y();
- }
- /** @type {number} */
- var i = 0;
- for(; i < nodeList["length"]; i++) {
- if(!nodeList[i][2] || (!nodeList[i][3] || (!nodeList[i][12] ||
- (!nodeList[i][13] || nodeList[i][0] == "del")))) {
- continue;
- }
- var newWidth;
- var r2;
- var r20;
- /** @type {number} */
- r20 = i == 1 ? 7 : random;
- /** @type {number} */
- nodeList[i][2] = ~~nodeList[i][2];
- /** @type {number} */
- nodeList[i][3] = ~~nodeList[i][3];
- /** @type {number} */
- nodeList[i][12] = ~~nodeList[i][12];
- /** @type {number} */
- nodeList[i][13] = ~~nodeList[i][13];
- nodeList[i][12] += (imgHeight / 2 + nodeList[i][2] - (imgHeight /
- 2 + nodeList[i][12])) / time;
- nodeList[i][13] += (total / 2 + nodeList[i][3] - (total / 2 +
- nodeList[i][13])) / time;
- /** @type {number} */
- newWidth = (imgHeight / 2 + nodeList[i][12]) / imgHeight *
- imgWidth;
- /** @type {number} */
- r2 = (total / 2 + nodeList[i][13]) / total * r;
- cache["beginPath"]();
- cache["arc"](newWidth, r2, r20, 0, 2 * Math["PI"], false);
- cache["fillStyle"] = nodeList[i][4];
- /** @type {string} */
- cache["strokeStyle"] = "black";
- cache["fill"]();
- cache["stroke"]();
- if(i > 1) {
- /** @type {string} */
- cache["fillStyle"] = value;
- cache["fillText"](nodeList[i][1], newWidth, r2 - 10);
- }
- }
- if(text["x"] && (text["y"] && (!a || !b))) {
- /** @type {number} */
- newWidth = (imgHeight / 2 + text["x"]) / imgHeight * imgWidth;
- /** @type {number} */
- r2 = (total / 2 + text["y"]) / total * r;
- cache["beginPath"]();
- cache["moveTo"](newWidth - 3, r2 - 3);
- cache["lineTo"](newWidth + 3, r2 + 3);
- cache["moveTo"](newWidth + 3, r2 - 3);
- cache["lineTo"](newWidth - 3, r2 + 3);
- cache["stroke"]();
- /** @type {string} */
- cache["strokeStyle"] = "yellow";
- cache["stroke"]();
- }
- };
- /**
- * @return {undefined}
- */
- this["hide"] = function () {
- $("#minimap")["hide"]();
- $("#minimapNode")["hide"]();
- };
- /**
- * @return {undefined}
- */
- this["show"] = function () {
- $("#minimap")["show"]();
- $("#minimapNode")["show"]();
- };
- /**
- * @param {Object} textAlt
- * @return {undefined}
- */
- this["setDeadPosition"] = function (textAlt) {
- if(textAlt) {
- /** @type {Object} */
- text = textAlt;
- } else {
- text = {};
- }
- };
- }
- $(document)["keydown"](function (event) {
- if((event["target"]["tagName"]["toLowerCase"]() == "input" || event[
- "target"]["tagName"]["toLowerCase"]() == "textarea") &&
- event["keyCode"] != 13) {
- return;
- }
- /** @type {string} */
- var prefix = "";
- if(isValidHotKey(event)) {
- prefix = getPressedKey(event);
- }
- if(event["keyCode"] == 18) {
- event["preventDefault"]();
- }
- if(selectedHotkeyRow) {
- if(event["keyCode"] == 46) {
- event["preventDefault"]();
- selectedHotkeyRow["find"](".hotkey")["text"](prefix);
- } else {
- if(prefix != "") {
- event["preventDefault"]();
- var stack = $(".hotkey");
- /** @type {number} */
- var i = 0;
- for(; i < stack["length"]; i++) {
- if($(stack[i])["text"]() == prefix) {
- return;
- }
- }
- selectedHotkeyRow["find"](".hotkey")["text"](prefix);
- selectedHotkeyRow["removeClass"]("table-row-selected");
- /** @type {null} */
- selectedHotkeyRow = null;
- }
- }
- }
- if(prefix == "") {
- return;
- }
- if(hotkeyMapping[prefix]) {
- event["preventDefault"]();
- if(hotkeyConfig[hotkeyMapping[prefix]]) {
- if(hotkeyConfig[hotkeyMapping[prefix]]["keyDown"]) {
- hotkeyConfig[hotkeyMapping[prefix]]["keyDown"]();
- }
- }
- }
- });
- $(document)["keyup"](function (event) {
- if((event["target"]["tagName"]["toLowerCase"]() == "input" || event[
- "target"]["tagName"]["toLowerCase"]() == "textarea") &&
- event["keyCode"] != 13) {
- return;
- }
- /** @type {string} */
- var output = "";
- if(isValidHotKey(event)) {
- output = getPressedKey(event);
- }
- if(output == "") {
- return;
- }
- if(hotkeyMapping[output]) {
- event["preventDefault"]();
- if(hotkeyConfig[hotkeyMapping[output]]) {
- if(hotkeyConfig[hotkeyMapping[output]]["keyUp"]) {
- hotkeyConfig[hotkeyMapping[output]]["keyUp"]();
- } else {}
- }
- }
- });
- $("#overlays2")["mousedown"](function (event) {
- if(event["button"] === 0) {
- if(myApp["isEnableMouseW"] && (event["target"]["tagName"][
- "toLowerCase"
- ]() != "input" || event["target"]["tagName"][
- "toLowerCase"
- ]() != "textarea")) {
- /** @type {boolean} */
- myApp["autoW"] = true;
- event["preventDefault"]();
- }
- } else {
- if(event["button"] === 2) {
- $("#opt_chatbox")["click"]();
- }
- }
- });
- $("#overlays2")["mouseup"](function (event) {
- if(event["button"] === 0) {
- if(!myApp["isEnableMouseW"] || (event["target"]["tagName"][
- "toLowerCase"
- ]() == "input" || event["target"]["tagName"][
- "toLowerCase"
- ]() == "textarea")) {
- return;
- }
- /** @type {boolean} */
- myApp["autoW"] = false;
- event["preventDefault"]();
- }
- });
- /**
- * @param {Object} keys
- * @return {?}
- */
- function isValidHotKey(keys) {
- return keys["keyCode"] >= 48 && keys["keyCode"] <= 57 || (keys["keyCode"] >=
- 65 && keys["keyCode"] <= 90 || (keys["keyCode"] == 9 || keys[
- "keyCode"] == 13)) ? true : false;
- }
- /**
- * @param {Object} event
- * @return {?}
- */
- function getPressedKey(event) {
- /** @type {string} */
- var optsData = "";
- if(event["ctrlKey"]) {
- optsData += "CTRL_";
- }
- if(event["altKey"]) {
- optsData += "ALT_";
- }
- if(event["keyCode"] == 9) {
- optsData += "TAB";
- } else {
- if(event["keyCode"] == 13) {
- optsData += "ENTER";
- } else {
- optsData += String["fromCharCode"](event["keyCode"]);
- }
- }
- return optsData;
- }
- /**
- * @param {string} elt
- * @return {?}
- */
- function getHotkeyById(elt) {
- var i;
- for(i in hotkeyMapping) {
- if(hotkeyMapping[i] == elt) {
- return i;
- }
- }
- return "";
- }
- var escapeHtml = function () {
- var buf = {
- '"': """,
- "&": "&",
- "<": "<",
- ">": ">"
- };
- return function (data) {
- return data["replace"](/[\"&<>]/g, function (off) {
- return buf[off];
- });
- };
- }();
- /**
- * @param {Object} text
- * @return {undefined}
- */
- function copyToClipboard(text) {
- window["postMessage"]({
- action: Action["COPY"],
- data: text
- }, "*");
- }
- /**
- * @return {?}
- */
- window["onbeforeunload"] = function () {
- return "Are you sure to QUIT game!?";
- };
- /**
- * @param {Object} value
- * @return {?}
- */
- function escapeRegex(value) {
- return value["replace"](/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
- }
- var disconnectTimeout;
- $(window)["focus"](function () {
- /** @type {boolean} */
- isWindowFocus = true;
- if(disconnectTimeout) {
- clearTimeout(disconnectTimeout);
- }
- })["blur"](function () {
- /** @type {boolean} */
- isWindowFocus = false;
- });
- /**
- * @param {string} requestUrl
- * @param {Object} templateId
- * @return {?}
- */
- jQuery["cachedScript"] = function (requestUrl, templateId) {
- templateId = $["extend"](templateId || {}, {
- dataType: "script",
- cache: true,
- url: requestUrl
- });
- return jQuery["ajax"](templateId);
- };
- updateGameInfoDiv();
- /**
- * @return {undefined}
- */
- function updateGameInfoDiv() {
- if($("#overlays")["is"](":visible")) {
- myApp["updateLBInfo"]();
- }
- setTimeout(updateGameInfoDiv, 1E3);
- }
- clearOldNodesData();
- /**
- * @return {undefined}
- */
- function clearOldNodesData() {
- /** @type {number} */
- var i = 1;
- for(; i < nodeList["length"]; i++) {
- var start = nodeList[i][8];
- if(start) {
- var end = Date["now"]();
- /** @type {number} */
- var duration = end - start;
- if(duration > 5E3) {
- if(i < 2) {
- /** @type {null} */
- nodeList[i][2] = null;
- /** @type {null} */
- nodeList[i][3] = null;
- } else {
- /** @type {string} */
- nodeList[i][0] = "del";
- }
- }
- }
- }
- setTimeout(clearOldNodesData, 5E3);
- }
- updateLbDiv();
- /**
- * @return {undefined}
- */
- function updateLbDiv() {
- if($("#div_lb")["is"](":visible")) {
- var stack = getLB();
- var result = getSelfIDs();
- /** @type {string} */
- var s = "";
- if(stack) {
- /** @type {number} */
- var i = 0;
- for(; i < stack["length"]; i++) {
- /** @type {boolean} */
- var _0x3495x15f = false;
- /** @type {number} */
- var length = 0;
- for(; length < result["length"]; length++) {
- if(result[length] == stack[i]["id"]) {
- /** @type {boolean} */
- _0x3495x15f = true;
- break;
- }
- }
- var _0x3495x161 = !stack[i]["name"] ? "An unnamed cell" : stack[
- i]["name"];
- if(_0x3495x15f) {
- s += "<div class='self'>";
- } else {
- s += "<div>";
- }
- s += i + 1 + ". " + _0x3495x161 + "</div>";
- }
- }
- /** @type {string} */
- document["getElementById"]("lb_detail")["innerHTML"] = s;
- }
- setTimeout(updateLbDiv, 1E3);
- }
- updateScoreDiv();
- /**
- * @return {undefined}
- */
- function updateScoreDiv() {
- var _0x3495x163 = getHighestScore();
- var tag = getCell();
- /** @type {Array} */
- var clrs = [];
- if(_0x3495x163 != 0) {
- if(myApp["isShowScroll"]) {
- clrs["push"]("Score: " + ~~(_0x3495x163 / 100));
- }
- if(tag && tag["length"] > 0) {
- if(myApp["isShowSTE"]) {
- var elements = myApp["getSTE"](tag);
- clrs["push"]("STE: " + elements);
- }
- if(myApp["isShowBallTotal"]) {
- clrs["push"]("[" + tag["length"] + "/16]");
- }
- }
- }
- if(myApp["isShowFPS"]) {
- var push = getFPS();
- clrs["push"]("FPS: " + push);
- }
- if(myApp["isShowPacketIO"]) {
- var _0x3495x166 = getPacketIO();
- clrs["push"]("PIO: " + _0x3495x166[0] + "|" + _0x3495x166[1]);
- }
- if(myApp["isEnableLockZoom"]) {
- clrs["push"]("🔒");
- }
- if(isFreeSpec() && (myApp["specTeammate"] && (myApp["isStopMovement"] &&
- nodeList[myApp["specTeammate"]]))) {
- clrs["push"]("SPEC: " + nodeList[myApp["specTeammate"]][1]);
- }
- if(myApp["testing"]) {
- clrs["push"]("*** TESTING ***");
- }
- if(clrs["length"] > 0) {
- if(!$("#div_score")["is"](":visible")) {
- $("#div_score")["show"]();
- }
- document["getElementById"]("div_score")["innerHTML"] = clrs["join"](
- " ")["trim"]();
- } else {
- $("#div_score")["hide"]();
- }
- setTimeout(updateScoreDiv, 500);
- }
- $("#gamemode")["parent"]()["append"](
- '<div id="testing_div"> <div id="lbl_testing" style="height:20px;">Testing : </div>' +
- '<input value="' + testingVal +
- '" type="text" id="testing" class="form-control" placeholder="Testing data"></div>'
- );
- $("#testing")["change"](function () {
- /** @type {number} */
- testingVal = Number($("#testing")["val"]());
- console["log"]("testingVal=" + testingVal);
- });
- $("#testing_div")["hide"]();
- $(".agario-profile-picture")["hide"]();
- $(".agario-profile-name-container")["hide"]();
- $(".agario-profile-panel")["click"](function () {
- if($(".agario-profile-picture")["is"](":visible")) {
- $(".agario-profile-picture")["hide"]();
- $(".agario-profile-name-container")["hide"]();
- } else {
- $(".agario-profile-picture")["show"]();
- $(".agario-profile-name-container")["show"]();
- }
- });
- /**
- * @param {?} timeoutKey
- * @param {?} error
- * @return {undefined}
- */
- var handleResource = function (timeoutKey, error) {
- if(!timeoutKey || !error) {
- console["log"](" ** null in download object url, return;");
- return;
- }
- if(customSkin[timeoutKey]) {
- return;
- }
- /** @type {Image} */
- var script = new Image;
- /**
- * @return {undefined}
- */
- script["onload"] = function () {
- customSkin[timeoutKey] = this;
- if(myApp["getCustomSkinUrl"]() == timeoutKey) {
- myApp["changePreviewImage"](this["src"]);
- }
- };
- /**
- * @return {undefined}
- */
- script["onerror"] = function () {
- window["URL"]["revokeObjectURL"](error);
- if(skinDownloadFail[timeoutKey]) {
- skinDownloadFail[timeoutKey] = skinDownloadFail[timeoutKey] +
- 1;
- } else {
- /** @type {number} */
- skinDownloadFail[timeoutKey] = 1;
- }
- console["log"]("Load image error");
- };
- script["src"] = error;
- };
- myApp["showAnnouncement"]();
Add Comment
Please, Sign In to add comment