24001

hkg deob

Dec 2nd, 2015
559
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 264.53 KB | None | 0 0
  1. /** @type {string} */
  2. var URL_MESSAGE =
  3. "https://googledrive.com/host/0Bx5EmU2kLXq9alVNVTQxX0FFd1k/_message.txt";
  4. /** @type {number} */
  5. var testingVal = 29;
  6. /** @type {number} */
  7. var testingCount = 0;
  8. /** @type {boolean} */
  9. var testingInd = false;
  10. /** @type {string} */
  11. var PRIVATE_SERVER_IP = "__";
  12. /** @type {string} */
  13. i18n_lang = "en";
  14. i18n_dict = {
  15. "en": {
  16. "connecting": "Connecting",
  17. "connect_help": "If you cannot connect to the servers, check if you have some anti virus or firewall blocking the connection.",
  18. "play": "Play",
  19. "spectate": "Spectate",
  20. "login_and_play": "Login and play",
  21. "play_as_guest": "Play as guest",
  22. "share": "Share",
  23. "advertisement": "Advertisement",
  24. "privacy_policy": "Privacy Policy",
  25. "terms_of_service": "Terms of Service",
  26. "changelog": "Changelog",
  27. "instructions_mouse": "Move your mouse to control your cell",
  28. "instructions_space": "Press <b>Space</b> to split",
  29. "instructions_w": "Press <b>W</b> to eject some mass",
  30. "gamemode_ffa": "FFA",
  31. "gamemode_teams": "Teams",
  32. "gamemode_experimental": "Experimental",
  33. "region_select": " -- Select a Region -- ",
  34. "region_us_east": "US East",
  35. "region_us_west": "US West",
  36. "region_north_america": "North America",
  37. "region_south_america": "South America",
  38. "region_europe": "Europe",
  39. "region_turkey": "Turkey",
  40. "region_poland": "Poland",
  41. "region_east_asia": "East Asia",
  42. "region_russia": "Russia",
  43. "region_china": "China",
  44. "region_oceania": "Oceania",
  45. "region_australia": "Australia",
  46. "region_players": "players",
  47. "option_no_skins": "No skins",
  48. "option_no_names": "No names",
  49. "option_dark_theme": "Dark theme",
  50. "option_no_colors": "No colors",
  51. "option_show_mass": "Show mass",
  52. "leaderboard": "Leaderboard",
  53. "unnamed_cell": "An unnamed cell",
  54. "last_match_results": "Last match results",
  55. "score": "Score",
  56. "leaderboard_time": "Leaderboard Time",
  57. "mass_eaten": "Mass Eaten",
  58. "top_position": "Top Position",
  59. "position_1": "First",
  60. "position_2": "Second",
  61. "position_3": "Third",
  62. "position_4": "Fourth",
  63. "position_5": "Fifth",
  64. "position_6": "Sixth",
  65. "position_7": "Seventh",
  66. "position_8": "Eighth",
  67. "position_9": "Ninth",
  68. "position_10": "Tenth",
  69. "player_cells_eaten": "Player Cells Eaten",
  70. "survival_time": "Survival Time",
  71. "games_played": "Games played",
  72. "highest_mass": "Highest mass",
  73. "total_cells_eaten": "Total cells eaten",
  74. "total_mass_eaten": "Total mass eaten",
  75. "longest_survival": "Longest survival",
  76. "logout": "Logout",
  77. "stats": "Stats",
  78. "shop": "Shop",
  79. "party": "Party",
  80. "party_description": "Play with your friends in the same map",
  81. "create_party": "Create",
  82. "creating_party": "Creating party...",
  83. "join_party": "Join",
  84. "back_button": "Back",
  85. "joining_party": "Joining party...",
  86. "joined_party_instructions": "You are now playing with this party:",
  87. "party_join_error": "There was a problem joining that party, please make sure the code is correct, or try creating another party",
  88. "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!",
  89. "create_party_instructions": "Give this link to your friends:",
  90. "join_party_instructions": "Your friend should have given you a code, type it here:",
  91. "continue": "Continue",
  92. "option_skip_stats": "Skip stats",
  93. "stats_food_eaten": "food eaten",
  94. "stats_highest_mass": "highest mass",
  95. "stats_time_alive": "time alive",
  96. "stats_leaderboard_time": "leaderboard time",
  97. "stats_cells_eaten": "cells eaten",
  98. "stats_top_position": "top position",
  99. "": ""
  100. }
  101. };
  102. i18n = i18n_dict[i18n_lang];
  103. var myApp;
  104. /** @type {Array} */
  105. var nodeList = [];
  106. /** @type {null} */
  107. var chatRoom = null;
  108. /** @type {null} */
  109. var minimap = null;
  110. /** @type {null} */
  111. var socket = null;
  112. /** @type {string} */
  113. var currentIP = "";
  114. /** @type {string} */
  115. var teamname = "HKG";
  116. /** @type {string} */
  117. var defaultTeamname = "HKG";
  118. var socketRetryInterval;
  119. /** @type {boolean} */
  120. var isSocketReady = false;
  121. /** @type {boolean} */
  122. var isChangeName = false;
  123. /** @type {null} */
  124. var conn = null;
  125. /** @type {number} */
  126. var reconnectCount = 0;
  127. /** @type {number} */
  128. var updateLBCount = 0;
  129. /** @type {string} */
  130. var tmpTeamname = "";
  131. /** @type {Image} */
  132. var defaultImage = new Image;
  133. /** @type {string} */
  134. defaultImage["src"] =
  135. "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNi4yLjEsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB3aWR0aD0iNTEycHgiIGhlaWdodD0iNTEycHgiIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MTIgNTEyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8Zz4NCgk8Zz4NCgkJPHBhdGggZD0iTTI1Niw0OEMxNDEuMSw0OCw0OCwxNDEuMSw0OCwyNTZzOTMuMSwyMDgsMjA4LDIwOGMxMTQuOSwwLDIwOC05My4xLDIwOC0yMDhTMzcwLjksNDgsMjU2LDQ4eiBNMjU2LDQ0Ni43DQoJCQljLTEwNS4xLDAtMTkwLjctODUuNS0xOTAuNy0xOTAuN2MwLTEwNS4xLDg1LjUtMTkwLjcsMTkwLjctMTkwLjdjMTA1LjEsMCwxOTAuNyw4NS41LDE5MC43LDE5MC43DQoJCQlDNDQ2LjcsMzYxLjEsMzYxLjEsNDQ2LjcsMjU2LDQ0Ni43eiIvPg0KCTwvZz4NCjwvZz4NCjxnPg0KCTxnPg0KCQk8cGF0aCBkPSJNMjU2LDk2Yy04OC40LDAtMTYwLDcxLjYtMTYwLDE2MGMwLDg4LjQsNzEuNiwxNjAsMTYwLDE2MGM4OC40LDAsMTYwLTcxLjYsMTYwLTE2MEM0MTYsMTY3LjYsMzQ0LjQsOTYsMjU2LDk2eiIvPg0KCTwvZz4NCjwvZz4NCjwvc3ZnPg0K";
  136. var customSkin = {
  137. "DEFAULT": defaultImage
  138. };
  139. /** @type {string} */
  140. var announcementTxt = "";
  141. var Action = {
  142. COPY: "HKGAGARTOOLCOPY",
  143. IMAGE: "HKGAGARTOOLIMAGE",
  144. FINISH: "HKGAGARTOOLFINISH"
  145. };
  146. /** @type {boolean} */
  147. var isJoinedGame = false;
  148. var hotkeyConfig = {};
  149. var hotkeyMapping = {};
  150. var teammateIdt = {};
  151. var defaultHotkeyMapping = {};
  152. var selectedHotkeyRow;
  153. var hotkeyMessageSend = {};
  154. /** @type {boolean} */
  155. var isWindowFocus = true;
  156. /** @type {Array} */
  157. var skinDownloadQueue = [];
  158. var skinDownloadFail = {};
  159. /** @type {Array} */
  160. var toastQueue = [];
  161. /** @type {string} */
  162. var defaultSkin = "DEFAULT";
  163. var gm;
  164. var defaultHotkeyMessageSend = {
  165. "input_hk_send_msg1": "街裡愛人一對對~♫",
  166. "input_hk_send_msg2": "16space 晒比ME",
  167. "input_hk_send_msg3": "唔好W!!!",
  168. "input_hk_send_msg4": "走呀好大隻!!!",
  169. "input_hk_send_msg5": "高速移動PLZ",
  170. "input_hk_send_msg6": "合咗先!?",
  171. "input_hk_send_msg7": "唔好咁~",
  172. "input_hk_send_msg8": "分開FARM",
  173. "input_hk_send_msg9": "花生友不如入場玩~? = =",
  174. "input_hk_send_msg10": "完場未?"
  175. };
  176. var hkgIcon = {
  177. "[sosading]": "https://na.cx/i/H82r31.gif",
  178. ":Plm2": "http://i.imgur.com/K1MuLWc.gif",
  179. ":Plm3": "https://na.cx/i/r71DPC.gif",
  180. "xx(lm": "http://forum14.hkgolden.com/faces/lomore/dead.gif",
  181. ":o)lm": "http://forum14.hkgolden.com/faces/lomore/clown.gif",
  182. "#ass#lm": "http://forum14.hkgolden.com/faces/lomore/ass.gif",
  183. ":)lm": "http://forum14.hkgolden.com/faces/lomore/smile.gif",
  184. ":o)2lm": "http://forum14.hkgolden.com/faces/lomore/clown2.gif",
  185. ":o)3lm": "http://forum14.hkgolden.com/faces/lomore/clown3.gif",
  186. ":o)4lm": "http://forum14.hkgolden.com/faces/lomore/clown4.gif",
  187. ":-(lm": "http://forum14.hkgolden.com/faces/lomore/frown.gif",
  188. ":~(lm": "http://forum14.hkgolden.com/faces/lomore/cry.gif",
  189. ";-)lm": "http://forum14.hkgolden.com/faces/lomore/wink.gif",
  190. ":-[lm": "http://forum14.hkgolden.com/faces/lomore/angry.gif",
  191. ":-]lm": "http://forum14.hkgolden.com/faces/lomore/devil.gif",
  192. ":Dlm": "http://forum14.hkgolden.com/faces/lomore/biggrin.gif",
  193. ":Olm": "http://forum14.hkgolden.com/faces/lomore/oh.gif",
  194. ":Plm": "http://forum14.hkgolden.com/faces/lomore/tongue.gif",
  195. "^3^lm": "http://forum14.hkgolden.com/faces/lomore/kiss.gif",
  196. "?_?lm": "http://forum14.hkgolden.com/faces/lomore/wonder.gif",
  197. "#yup#lm": "http://forum14.hkgolden.com/faces/lomore/agree.gif",
  198. "#hehe#lm": "http://forum14.hkgolden.com/faces/lomore/hehe.gif",
  199. "#love#lm": "http://forum14.hkgolden.com/faces/lomore/love.gif",
  200. "#oh#lm": "http://forum14.hkgolden.com/faces/lomore/surprise.gif",
  201. "[sosad]lm": "http://forum14.hkgolden.com/faces/lomore/sosad.gif",
  202. "#good#lm": "http://forum14.hkgolden.com/faces/lomore/good.gif",
  203. "#hoho#lm": "http://forum14.hkgolden.com/faces/lomore/hoho.gif",
  204. "#kill#lm": "http://forum14.hkgolden.com/faces/lomore/kill.gif",
  205. "@_@lm": "http://forum14.hkgolden.com/faces/lomore/@.gif",
  206. "#adore#lm": "http://forum14.hkgolden.com/faces/lomore/adore.gif",
  207. "???lm": "http://forum14.hkgolden.com/faces/lomore/wonder2.gif",
  208. "[banghead]lm": "http://forum14.hkgolden.com/faces/lomore/banghead.gif",
  209. "[bouncer]lm": "http://forum14.hkgolden.com/faces/lomore/bouncer.gif",
  210. "[flowerface]lm": "http://forum14.hkgolden.com/faces/lomore/flowerface.gif",
  211. "[shocking]lm": "http://forum14.hkgolden.com/faces/lomore/shocking.gif",
  212. "[photo]lm": "http://forum14.hkgolden.com/faces/lomore/photo.gif",
  213. "[yipes]lm": "http://forum14.hkgolden.com/faces/lomore/yipes.gif",
  214. "[369]lm": "http://forum14.hkgolden.com/faces/lomore/369.gif",
  215. "[slick]lm": "http://forum14.hkgolden.com/faces/lomore/slick.gif",
  216. "fucklm": "http://forum14.hkgolden.com/faces/lomore/diu.gif",
  217. "fuck2lm": "http://forum14.hkgolden.com/faces/lomore/diu2.gif",
  218. "#kill2#lm": "http://forum14.hkgolden.com/faces/lomore/Kill2lm.gif",
  219. "[offtopic]lm": "http://forum14.hkgolden.com/faces/lomore/offtopic.gif",
  220. "O:-)": "http://forum14.hkgolden.com/faces/angel.gif",
  221. "xx(": "http://forum14.hkgolden.com/faces/dead.gif",
  222. ":)": "http://forum14.hkgolden.com/faces/smile.gif",
  223. ":o)": "http://forum14.hkgolden.com/faces/clown.gif",
  224. ":-(": "http://forum14.hkgolden.com/faces/frown.gif",
  225. ":~(": "http://forum14.hkgolden.com/faces/cry.gif",
  226. ";-)": "http://forum14.hkgolden.com/faces/wink.gif",
  227. ":-[": "http://forum14.hkgolden.com/faces/angry.gif",
  228. ":-]": "http://forum14.hkgolden.com/faces/devil.gif",
  229. ":D": "http://forum14.hkgolden.com/faces/biggrin.gif",
  230. ":O": "http://forum14.hkgolden.com/faces/oh.gif",
  231. ":P": "http://forum14.hkgolden.com/faces/tongue.gif",
  232. "^3^": "http://forum14.hkgolden.com/faces/kiss.gif",
  233. "?_?": "http://forum14.hkgolden.com/faces/wonder.gif",
  234. "#yup#": "http://forum14.hkgolden.com/faces/agree.gif",
  235. "#ng#": "http://forum14.hkgolden.com/faces/donno.gif",
  236. "#hehe#": "http://forum14.hkgolden.com/faces/hehe.gif",
  237. "#love#": "http://forum14.hkgolden.com/faces/love.gif",
  238. "#oh#": "http://forum14.hkgolden.com/faces/surprise.gif",
  239. "#cn#": "http://forum14.hkgolden.com/faces/chicken.gif",
  240. "#ass#": "http://forum14.hkgolden.com/faces/ass.gif",
  241. "[sosad]": "http://forum14.hkgolden.com/faces/sosad.gif",
  242. "#good#": "http://forum14.hkgolden.com/faces/good.gif",
  243. "#hoho#": "http://forum14.hkgolden.com/faces/hoho.gif",
  244. "#kill#": "http://forum14.hkgolden.com/faces/kill.gif",
  245. "#bye#": "http://forum14.hkgolden.com/faces/bye.gif",
  246. "Z_Z": "http://forum14.hkgolden.com/faces/z.gif",
  247. "@_@": "http://forum14.hkgolden.com/faces/@.gif",
  248. "#adore#": "http://forum14.hkgolden.com/faces/adore.gif",
  249. "???": "http://forum14.hkgolden.com/faces/wonder2.gif",
  250. "[banghead]": "http://forum14.hkgolden.com/faces/banghead.gif",
  251. "[bouncer]": "http://forum14.hkgolden.com/faces/bouncer.gif",
  252. "[bouncy]": "http://forum14.hkgolden.com/faces/bouncy.gif",
  253. "[censored]": "http://forum14.hkgolden.com/faces/censored.gif",
  254. "[flowerface]": "http://forum14.hkgolden.com/faces/flowerface.gif",
  255. "[shocking]": "http://forum14.hkgolden.com/faces/shocking.gif",
  256. "[photo]": "http://forum14.hkgolden.com/faces/photo.gif",
  257. "#fire#": "http://forum14.hkgolden.com/faces/fire.gif",
  258. "[yipes]": "http://forum14.hkgolden.com/faces/yipes.gif",
  259. "[369]": "http://forum14.hkgolden.com/faces/369.gif",
  260. "[bomb]": "http://forum14.hkgolden.com/faces/bomb.gif",
  261. "[slick]": "http://forum14.hkgolden.com/faces/slick.gif",
  262. "fuck": "http://forum14.hkgolden.com/faces/fuck.gif",
  263. "#no#": "http://forum14.hkgolden.com/faces/no.gif",
  264. "#kill2#": "http://forum14.hkgolden.com/faces/kill2.gif",
  265. "[offtopic]": "http://forum14.hkgolden.com/faces/offtopic.gif"
  266. };
  267. /** @type {number} */
  268. var selected_profile = 0;
  269. /** @type {Array} */
  270. var player_profile = [{
  271. name: "不留名 [slick]",
  272. team: "HKG",
  273. skinurl: defaultSkin
  274. }, {
  275. name: "Profile 2",
  276. team: "team2",
  277. skinurl: "https://181cfbce4e26cf7f3642ac9e82d9e05ca7869931-www.googledrive.com/host/0B6Qc5Ss9h9-sfmhZMXBsRHYySVZFTzl5cVFkX3VPYjlDU3JJVmhwbzV2LVc5MGk4c3RHVDg/circles.png"
  278. }, {
  279. name: "Profile 3",
  280. team: "team3",
  281. skinurl: "https://181cfbce4e26cf7f3642ac9e82d9e05ca7869931-www.googledrive.com/host/0B6Qc5Ss9h9-sfmhZMXBsRHYySVZFTzl5cVFkX3VPYjlDU3JJVmhwbzV2LVc5MGk4c3RHVDg/1.png"
  282. }];
  283. myApp = new MyApp;
  284. myApp["init"]();
  285. (function (win, log) {
  286. /**
  287. * @return {undefined}
  288. */
  289. function init() {
  290. /** @type {boolean} */
  291. _0x3495xa5 = true;
  292. draw();
  293. setInterval(draw, 18E4);
  294. style = a = document["getElementById"]("canvas");
  295. var iframedoc = document["getElementById"]("overlays2");
  296. /**
  297. * @param {Object} xs
  298. * @return {undefined}
  299. */
  300. iframedoc["onmousemove"] = function (xs) {
  301. y = xs["clientX"];
  302. x = xs["clientY"];
  303. prep();
  304. };
  305. options = style["getContext"]("2d");
  306. if(/firefox/i ["test"](navigator["userAgent"])) {
  307. document["addEventListener"]("DOMMouseScroll", f3, false);
  308. } else {
  309. /** @type {function (Object): undefined} */
  310. document["body"]["onmousewheel"] = f3;
  311. }
  312. /** @type {boolean} */
  313. var memory = false;
  314. /** @type {boolean} */
  315. var stack = false;
  316. /** @type {boolean} */
  317. var list = false;
  318. /**
  319. * @param {Object} event
  320. * @return {undefined}
  321. */
  322. win["onkeydown"] = function (event) {
  323. if(!(32 != event["keyCode"])) {
  324. if(!chatRoom["isFocus"]()) {
  325. if(!memory) {
  326. f();
  327. toggleClass(17);
  328. /** @type {boolean} */
  329. memory = true;
  330. }
  331. }
  332. }
  333. if(!(81 != event["keyCode"])) {
  334. if(!stack) {
  335. toggleClass(18);
  336. /** @type {boolean} */
  337. stack = true;
  338. }
  339. }
  340. if(!(87 != event["keyCode"])) {
  341. if(!chatRoom["isFocus"]()) {
  342. if(!list) {
  343. f();
  344. toggleClass(21);
  345. /** @type {boolean} */
  346. list = true;
  347. }
  348. }
  349. }
  350. if(27 == event["keyCode"]) {
  351. event["preventDefault"]();
  352. show(300);
  353. }
  354. };
  355. /**
  356. * @param {Object} shortcuts
  357. * @return {undefined}
  358. */
  359. win["onkeyup"] = function (shortcuts) {
  360. if(32 == shortcuts["keyCode"]) {
  361. /** @type {boolean} */
  362. memory = false;
  363. }
  364. if(87 == shortcuts["keyCode"]) {
  365. /** @type {boolean} */
  366. list = false;
  367. }
  368. if(81 == shortcuts["keyCode"]) {
  369. if(stack) {
  370. toggleClass(19);
  371. /** @type {boolean} */
  372. stack = false;
  373. }
  374. }
  375. };
  376. /**
  377. * @return {undefined}
  378. */
  379. win["onblur"] = function () {
  380. toggleClass(19);
  381. /** @type {boolean} */
  382. list = stack = memory = false;
  383. };
  384. /** @type {function (): undefined} */
  385. win["onresize"] = resize;
  386. win["requestAnimationFrame"](LOAD);
  387. setInterval(f, 42);
  388. if(banner) {
  389. log("#region")["val"](banner);
  390. }
  391. replace();
  392. reset(log("#region")["val"]());
  393. if(0 == resizeUID) {
  394. if(banner) {
  395. animate();
  396. }
  397. }
  398. show(0);
  399. resize();
  400. if(win["location"]["hash"]) {
  401. if(6 <= win["location"]["hash"]["length"]) {
  402. success(win["location"]["hash"]);
  403. }
  404. }
  405. }
  406. /**
  407. * @param {Object} event
  408. * @return {undefined}
  409. */
  410. function f3(event) {
  411. if(!myApp["isEnableZoom"]) {
  412. return;
  413. }
  414. $timeout *= Math["pow"](myApp["getZoomSpeed"](), event["wheelDelta"] /
  415. -120 || (event["detail"] || 0));
  416. if(myApp["getZoomLimit"]() > $timeout) {
  417. $timeout = myApp["getZoomLimit"]();
  418. }
  419. if($timeout > 1 / w) {
  420. /** @type {number} */
  421. $timeout = 1 / w;
  422. }
  423. }
  424. /**
  425. * @return {undefined}
  426. */
  427. function throttledUpdate() {
  428. /** @type {null} */
  429. ea = null;
  430. }
  431. /**
  432. * @return {undefined}
  433. */
  434. function prep() {
  435. if(myApp["isStopMovement"]) {
  436. setPosition(key || value, b0 || old);
  437. } else {
  438. step = (y - width / 2) / w + value;
  439. h2 = (x - height / 2) / w + old;
  440. }
  441. }
  442. /**
  443. * @return {undefined}
  444. */
  445. function draw() {
  446. if(null == map) {
  447. map = {};
  448. log("#region")["children"]()["each"](function () {
  449. var obj = log(this);
  450. var objUid = obj["val"]();
  451. if(objUid) {
  452. map[objUid] = obj["text"]();
  453. }
  454. });
  455. }
  456. log["get"]("http://m.agar.io/info", function (data) {
  457. var old = {};
  458. var attr;
  459. for(attr in data["regions"]) {
  460. var name = attr["split"](":")[0];
  461. old[name] = old[name] || 0;
  462. old[name] += data["regions"][attr]["numPlayers"];
  463. }
  464. for(attr in old) {
  465. log('#region option[value="' + attr + '"]')["text"]
  466. (map[attr] + " (" + old[attr] + " players)");
  467. }
  468. }, "json");
  469. }
  470. /**
  471. * @return {undefined}
  472. */
  473. function createFile() {
  474. log("#overlays")["hide"]();
  475. log("#stats")["hide"]();
  476. log("#mainPanel")["hide"]();
  477. /** @type {boolean} */
  478. from = to = false;
  479. replace();
  480. }
  481. /**
  482. * @param {string} x
  483. * @return {undefined}
  484. */
  485. function reset(x) {
  486. if(log("#region")["val"]() == "gathering") {
  487. connect(PRIVATE_SERVER_IP, "");
  488. return;
  489. }
  490. if(x) {
  491. if(x != banner) {
  492. if(log("#region")["val"]() != x) {
  493. log("#region")["val"](x);
  494. }
  495. banner = win["localStorage"]["location"] = x;
  496. log(".region-message")["hide"]();
  497. log(".region-message." + x)["show"]();
  498. log(".btn-needs-server")["prop"]("disabled", false);
  499. if(_0x3495xa5) {
  500. animate();
  501. }
  502. }
  503. }
  504. }
  505. /**
  506. * @param {number} expectedHashCode
  507. * @return {undefined}
  508. */
  509. function show(expectedHashCode) {
  510. if(!to) {
  511. if(!from) {
  512. /** @type {null} */
  513. id = null;
  514. if(1E3 > expectedHashCode) {
  515. /** @type {number} */
  516. newEnd = 1;
  517. }
  518. /** @type {boolean} */
  519. to = true;
  520. log("#mainPanel")["show"]();
  521. if(0 < expectedHashCode) {
  522. log("#overlays")["fadeIn"](expectedHashCode);
  523. } else {
  524. log("#overlays")["show"]();
  525. }
  526. }
  527. }
  528. }
  529. /**
  530. * @param {string} expected
  531. * @return {undefined}
  532. */
  533. function fail(expected) {
  534. log("#helloContainer")["attr"]("data-gamemode", expected);
  535. /** @type {string} */
  536. message = expected;
  537. log("#gamemode")["val"](expected);
  538. }
  539. /**
  540. * @return {undefined}
  541. */
  542. function replace() {
  543. if(log("#region")["val"]()) {
  544. win["localStorage"]["location"] = log("#region")["val"]();
  545. } else {
  546. if(win["localStorage"]["location"]) {
  547. log("#region")["val"](win["localStorage"]["location"]);
  548. }
  549. }
  550. if(log("#region")["val"]()) {
  551. log("#locationKnown")["append"](log("#region"));
  552. } else {
  553. log("#locationUnknown")["append"](log("#region"));
  554. }
  555. }
  556. /**
  557. * @param {string} id
  558. * @return {?}
  559. */
  560. function require(id) {
  561. return win["i18n"][id] || (win["i18n_dict"]["en"][id] || id);
  562. }
  563. /**
  564. * @return {undefined}
  565. */
  566. function poll() {
  567. /** @type {number} */
  568. var uid = ++resizeUID;
  569. console["log"]("Find " + banner + message);
  570. log["ajax"]("http://m.agar.io/findServer", {
  571. /**
  572. * @return {undefined}
  573. */
  574. error: function () {
  575. setTimeout(poll, 1E3);
  576. },
  577. /**
  578. * @param {Object} value
  579. * @return {undefined}
  580. */
  581. success: function (value) {
  582. if(e != "" && value["ip"] != e) {
  583. poll();
  584. } else {
  585. if(uid == resizeUID) {
  586. if(value["alert"]) {
  587. alert(value["alert"]);
  588. }
  589. next("ws://" + value["ip"], value[
  590. "token"]);
  591. }
  592. }
  593. },
  594. dataType: "json",
  595. method: "POST",
  596. cache: false,
  597. crossDomain: true,
  598. data: (banner + message || "?") + "\n2200049715"
  599. });
  600. }
  601. /**
  602. * @return {undefined}
  603. */
  604. function animate() {
  605. if(_0x3495xa5) {
  606. if(banner) {
  607. log("#connecting")["show"]();
  608. poll();
  609. }
  610. }
  611. }
  612. /**
  613. * @param {string} request
  614. * @param {Object} res
  615. * @return {undefined}
  616. */
  617. function next(request, res) {
  618. /** @type {string} */
  619. currentIP = request;
  620. if(self) {
  621. /** @type {null} */
  622. self["onopen"] = null;
  623. /** @type {null} */
  624. self["onmessage"] = null;
  625. /** @type {null} */
  626. self["onclose"] = null;
  627. try {
  628. self["close"]();
  629. } catch(c) {}
  630. /** @type {null} */
  631. self = null;
  632. }
  633. if(dst["ip"]) {
  634. request = "ws://" + dst["ip"];
  635. }
  636. if(null != handler) {
  637. var fn = handler;
  638. /**
  639. * @return {undefined}
  640. */
  641. handler = function () {
  642. fn(res);
  643. };
  644. }
  645. if(isArr) {
  646. var replace = request["split"](":");
  647. /** @type {string} */
  648. request = replace[0] + "s://ip-" + replace[1]["replace"](/\./g,
  649. "-")["replace"](/\//g, "") + ".tech.agar.io:" + (+
  650. replace[2] + 2E3);
  651. }
  652. /** @type {Array} */
  653. p = [];
  654. /** @type {Array} */
  655. params = [];
  656. result = {};
  657. /** @type {Array} */
  658. h = [];
  659. /** @type {Array} */
  660. listeners = [];
  661. /** @type {Array} */
  662. stack = [];
  663. /** @type {null} */
  664. el = obj = null;
  665. /** @type {number} */
  666. currentValue = 0;
  667. /** @type {boolean} */
  668. item = false;
  669. console["log"]("Connecting to " + request);
  670. /** @type {WebSocket} */
  671. self = new WebSocket(request);
  672. /** @type {string} */
  673. self["binaryType"] = "arraybuffer";
  674. /**
  675. * @return {undefined}
  676. */
  677. self["onopen"] = function () {
  678. var udataCur;
  679. console["log"]("socket open");
  680. udataCur = forEach(5);
  681. udataCur["setUint8"](0, 254);
  682. udataCur["setUint32"](1, 5, true);
  683. addClass(udataCur);
  684. udataCur = forEach(5);
  685. udataCur["setUint8"](0, 255);
  686. udataCur["setUint32"](1, 2200049715, true);
  687. addClass(udataCur);
  688. udataCur = forEach(1 + res["length"]);
  689. udataCur["setUint8"](0, 80);
  690. /** @type {number} */
  691. var i = 0;
  692. for(; i < res["length"]; ++i) {
  693. udataCur["setUint8"](i + 1, res["charCodeAt"](i));
  694. }
  695. addClass(udataCur);
  696. observer();
  697. if(res["length"] > 4 && res["length"] <= 6) {
  698. callback("/#" + res);
  699. } else {
  700. callback("/");
  701. }
  702. };
  703. /** @type {function ((Object|string)): undefined} */
  704. self["onmessage"] = finish;
  705. /** @type {function (): undefined} */
  706. self["onclose"] = push;
  707. /**
  708. * @return {undefined}
  709. */
  710. self["onerror"] = function () {
  711. console["log"]("socket error");
  712. };
  713. }
  714. /**
  715. * @param {number} expectedNumberOfNonCommentArgs
  716. * @return {?}
  717. */
  718. function forEach(expectedNumberOfNonCommentArgs) {
  719. return new DataView(new ArrayBuffer(expectedNumberOfNonCommentArgs));
  720. }
  721. /**
  722. * @param {Object} value
  723. * @return {undefined}
  724. */
  725. function addClass(value) {
  726. err++;
  727. self["send"](value["buffer"]);
  728. }
  729. /**
  730. * @return {undefined}
  731. */
  732. function push() {
  733. if(item) {
  734. /** @type {number} */
  735. backoff = 500;
  736. }
  737. console["log"]("socket close");
  738. setTimeout(animate, backoff);
  739. backoff *= 2;
  740. }
  741. /**
  742. * @param {(Object|string)} result
  743. * @return {undefined}
  744. */
  745. function finish(result) {
  746. onComplete(new DataView(result["data"]));
  747. }
  748. /**
  749. * @param {Object} walkers
  750. * @return {undefined}
  751. */
  752. function onComplete(walkers) {
  753. /**
  754. * @return {?}
  755. */
  756. function wrapper() {
  757. /** @type {string} */
  758. var result = "";
  759. for(;;) {
  760. var fragment = walkers["getUint16"](node, true);
  761. node += 2;
  762. if(0 == fragment) {
  763. break;
  764. }
  765. result += String["fromCharCode"](fragment);
  766. }
  767. return result;
  768. }
  769. fx++;
  770. /** @type {number} */
  771. var node = 0;
  772. if(240 == walkers["getUint8"](node)) {
  773. node += 5;
  774. }
  775. switch(walkers["getUint8"](node++)) {
  776. case 16:
  777. render(walkers, node);
  778. break;
  779. case 17:
  780. current = walkers["getFloat32"](node, true);
  781. node += 4;
  782. expr = walkers["getFloat32"](node, true);
  783. node += 4;
  784. var type = walkers["getFloat32"](node, true);
  785. msg = type;
  786. if(!myApp["isEnableLockZoom"]) {
  787. cb = type;
  788. }
  789. node += 4;
  790. break;
  791. case 20:
  792. /** @type {Array} */
  793. params = [];
  794. /** @type {Array} */
  795. p = [];
  796. break;
  797. case 21:
  798. ref = walkers["getInt16"](node, true);
  799. node += 2;
  800. element = walkers["getInt16"](node, true);
  801. node += 2;
  802. if(!_0x3495xa6) {
  803. /** @type {boolean} */
  804. _0x3495xa6 = true;
  805. vvar = ref;
  806. openElement = element;
  807. }
  808. break;
  809. case 32:
  810. p["push"](walkers["getUint32"](node, true));
  811. node += 4;
  812. break;
  813. case 49:
  814. if(null != obj) {
  815. break;
  816. }
  817. var f = walkers["getUint32"](node, true);
  818. node = node + 4;
  819. /** @type {Array} */
  820. stack = [];
  821. /** @type {number} */
  822. var indexf = 0;
  823. for(; indexf < f; ++indexf) {
  824. var it = walkers["getUint32"](node, true);
  825. node = node + 4;
  826. stack["push"]({
  827. id: it,
  828. name: wrapper()
  829. });
  830. }
  831. break;
  832. case 50:
  833. /** @type {Array} */
  834. obj = [];
  835. f = walkers["getUint32"](node, true);
  836. node += 4;
  837. /** @type {number} */
  838. indexf = 0;
  839. for(; indexf < f; ++indexf) {
  840. obj["push"](walkers["getFloat32"](node, true));
  841. node += 4;
  842. }
  843. create();
  844. break;
  845. case 64:
  846. count = walkers["getFloat64"](node, true);
  847. node += 8;
  848. minY = walkers["getFloat64"](node, true);
  849. node += 8;
  850. idx = walkers["getFloat64"](node, true);
  851. node += 8;
  852. maxY = walkers["getFloat64"](node, true);
  853. node += 8;
  854. /** @type {number} */
  855. current = (idx + count) / 2;
  856. /** @type {number} */
  857. expr = (maxY + minY) / 2;
  858. /** @type {number} */
  859. cb = 1;
  860. if(0 == params["length"]) {
  861. /** @type {number} */
  862. value = current;
  863. /** @type {number} */
  864. old = expr;
  865. /** @type {number} */
  866. w = cb;
  867. }
  868. /** @type {number} */
  869. ln = idx - count;
  870. /** @type {number} */
  871. span = maxY - minY;
  872. myApp["afterGameLoaded"]();
  873. break;
  874. case 81:
  875. var i = walkers["getUint32"](node, true);
  876. node = node + 4;
  877. var email = walkers["getUint32"](node, true);
  878. node = node + 4;
  879. var position = walkers["getUint32"](node, true);
  880. node = node + 4;
  881. setTimeout(function () {
  882. load({
  883. d: i,
  884. e: email,
  885. c: position
  886. });
  887. }, 1200);
  888. }
  889. }
  890. /**
  891. * @param {Object} obj
  892. * @param {number} name
  893. * @return {undefined}
  894. */
  895. function render(obj, name) {
  896. /**
  897. * @return {?}
  898. */
  899. function readFile() {
  900. /** @type {string} */
  901. var str = "";
  902. for(;;) {
  903. var b = obj["getUint16"](name, true);
  904. name += 2;
  905. if(0 == b) {
  906. break;
  907. }
  908. str += String["fromCharCode"](b);
  909. }
  910. return str;
  911. }
  912. /**
  913. * @return {?}
  914. */
  915. function trim() {
  916. /** @type {string} */
  917. var str = "";
  918. for(;;) {
  919. var b = obj["getUint8"](name++);
  920. if(0 == b) {
  921. break;
  922. }
  923. str += String["fromCharCode"](b);
  924. }
  925. return str;
  926. }
  927. check = max = Date["now"]();
  928. if(!item) {
  929. /** @type {boolean} */
  930. item = true;
  931. ready();
  932. }
  933. /** @type {boolean} */
  934. _0x3495x9c = false;
  935. var m = obj["getUint16"](name, true);
  936. name += 2;
  937. /** @type {number} */
  938. var i = 0;
  939. for(; i < m; ++i) {
  940. var row = result[obj["getUint32"](name, true)];
  941. var data = result[obj["getUint32"](name + 4, true)];
  942. name += 8;
  943. if(row) {
  944. if(data) {
  945. data.R();
  946. data["o"] = data["x"];
  947. data["p"] = data["y"];
  948. data["n"] = data["size"];
  949. data["C"] = row["x"];
  950. data["D"] = row["y"];
  951. data["m"] = data["size"];
  952. data["K"] = max;
  953. fn(row, data);
  954. }
  955. }
  956. }
  957. /** @type {number} */
  958. i = 0;
  959. for(;;) {
  960. m = obj["getUint32"](name, true);
  961. name += 4;
  962. if(0 == m) {
  963. break;
  964. }
  965. ++i;
  966. var file;
  967. row = obj["getInt32"](name, true);
  968. name += 4;
  969. data = obj["getInt32"](name, true);
  970. name += 4;
  971. file = obj["getInt16"](name, true);
  972. name += 2;
  973. var self = obj["getUint8"](name++);
  974. var path = obj["getUint8"](name++);
  975. var e = obj["getUint8"](name++);
  976. path = join(self << 16 | path << 8 | e);
  977. e = obj["getUint8"](name++);
  978. /** @type {boolean} */
  979. var defaultValue = !!(e & 1);
  980. /** @type {boolean} */
  981. var temp = !!(e & 16);
  982. /** @type {null} */
  983. var val = null;
  984. if(e & 2) {
  985. name += 4 + obj["getUint32"](name, true);
  986. }
  987. if(e & 4) {
  988. val = trim();
  989. }
  990. var input = readFile();
  991. /** @type {null} */
  992. self = null;
  993. if(result["hasOwnProperty"](m)) {
  994. self = result[m];
  995. self.J();
  996. self["o"] = self["x"];
  997. self["p"] = self["y"];
  998. self["n"] = self["size"];
  999. self["color"] = path;
  1000. } else {
  1001. self = new $(m, row, data, file, path, input);
  1002. h["push"](self);
  1003. result[m] = self;
  1004. self["ia"] = row;
  1005. self["ja"] = data;
  1006. }
  1007. /** @type {boolean} */
  1008. self["f"] = defaultValue;
  1009. /** @type {boolean} */
  1010. self["j"] = temp;
  1011. self["C"] = row;
  1012. self["D"] = data;
  1013. self["m"] = file;
  1014. self["K"] = max;
  1015. self["T"] = e;
  1016. if(val) {
  1017. self["V"] = val;
  1018. }
  1019. if(input) {
  1020. self["t"](input);
  1021. }
  1022. if(-1 != p["indexOf"](m)) {
  1023. if(-1 == params["indexOf"](self)) {
  1024. params["push"](self);
  1025. if(1 == params["length"]) {
  1026. value = self["x"];
  1027. old = self["y"];
  1028. templateFunc();
  1029. /** @type {string} */
  1030. document["getElementById"]("overlays")["style"][
  1031. "display"
  1032. ] = "none";
  1033. /** @type {Array} */
  1034. b = [];
  1035. /** @type {number} */
  1036. rreturn = 0;
  1037. trans = params[0]["color"];
  1038. /** @type {boolean} */
  1039. _0x3495xf1 = true;
  1040. left = Date["now"]();
  1041. /** @type {number} */
  1042. v = r20 = funcs = 0;
  1043. }
  1044. }
  1045. }
  1046. }
  1047. row = obj["getUint32"](name, true);
  1048. name += 4;
  1049. /** @type {number} */
  1050. i = 0;
  1051. for(; i < row; i++) {
  1052. m = obj["getUint32"](name, true);
  1053. name += 4;
  1054. self = result[m];
  1055. if(null != self) {
  1056. self.R();
  1057. }
  1058. }
  1059. if(_0x3495x9c) {
  1060. if(0 == params["length"]) {
  1061. if(myApp["onDead"]() || true) {
  1062. right = Date["now"]();
  1063. /** @type {boolean} */
  1064. _0x3495xf1 = false;
  1065. if(!to) {
  1066. if(!from) {
  1067. if(connected) {
  1068. update();
  1069. /** @type {boolean} */
  1070. from = true;
  1071. log("#overlays")["fadeIn"](3E3);
  1072. log("#stats")["show"]();
  1073. } else {
  1074. show(1500);
  1075. }
  1076. }
  1077. }
  1078. }
  1079. }
  1080. }
  1081. }
  1082. /**
  1083. * @return {undefined}
  1084. */
  1085. function ready() {
  1086. /** @type {string} */
  1087. e = "";
  1088. log("#connecting")["hide"]();
  1089. func();
  1090. if(handler) {
  1091. handler();
  1092. /** @type {null} */
  1093. handler = null;
  1094. }
  1095. if(null != tref) {
  1096. clearTimeout(tref);
  1097. }
  1098. /** @type {number} */
  1099. tref = setTimeout(function () {
  1100. if(win["ga"]) {
  1101. ++restoreScript;
  1102. win["ga"]("set", "dimension2", restoreScript);
  1103. }
  1104. }, 1E4);
  1105. }
  1106. /**
  1107. * @return {undefined}
  1108. */
  1109. function f() {
  1110. if(myApp["isStopMovement"]) {
  1111. return;
  1112. }
  1113. if(removeClass()) {
  1114. /** @type {number} */
  1115. var z0 = y - width / 2;
  1116. /** @type {number} */
  1117. var z1 = x - height / 2;
  1118. if(!(64 > z0 * z0 + z1 * z1)) {
  1119. if(!(0.01 > Math["abs"](n - step) && 0.01 > Math["abs"](h1 -
  1120. h2))) {
  1121. n = step;
  1122. h1 = h2;
  1123. z0 = forEach(13);
  1124. z0["setUint8"](0, 16);
  1125. z0["setInt32"](1, step, true);
  1126. z0["setInt32"](5, h2, true);
  1127. z0["setUint32"](9, 0, true);
  1128. addClass(z0);
  1129. }
  1130. }
  1131. }
  1132. }
  1133. /**
  1134. * @return {undefined}
  1135. */
  1136. function func() {
  1137. if(removeClass() && (item && null != id)) {
  1138. var udataCur = forEach(1 + 2 * id["length"]);
  1139. udataCur["setUint8"](0, 0);
  1140. /** @type {number} */
  1141. var i = 0;
  1142. for(; i < id["length"]; ++i) {
  1143. udataCur["setUint16"](1 + 2 * i, id["charCodeAt"](i), true);
  1144. }
  1145. addClass(udataCur);
  1146. /** @type {null} */
  1147. id = null;
  1148. }
  1149. }
  1150. /**
  1151. * @return {?}
  1152. */
  1153. function removeClass() {
  1154. return null != self && self["readyState"] == self["OPEN"];
  1155. }
  1156. /**
  1157. * @param {number} expectedNumberOfNonCommentArgs
  1158. * @return {undefined}
  1159. */
  1160. function toggleClass(expectedNumberOfNonCommentArgs) {
  1161. if(removeClass()) {
  1162. var udataCur = forEach(1);
  1163. udataCur["setUint8"](0, expectedNumberOfNonCommentArgs);
  1164. addClass(udataCur);
  1165. }
  1166. }
  1167. /**
  1168. * @return {undefined}
  1169. */
  1170. function observer() {
  1171. var current = node;
  1172. if(removeClass() && null != current) {
  1173. var udataCur = forEach(1 + current["length"]);
  1174. udataCur["setUint8"](0, 81);
  1175. /** @type {number} */
  1176. var i = 0;
  1177. for(; i < current["length"]; ++i) {
  1178. udataCur["setUint8"](i + 1, current["charCodeAt"](i));
  1179. }
  1180. addClass(udataCur);
  1181. }
  1182. }
  1183. /**
  1184. * @return {undefined}
  1185. */
  1186. function resize() {
  1187. /** @type {number} */
  1188. width = 1 * win["innerWidth"];
  1189. /** @type {number} */
  1190. height = 1 * win["innerHeight"];
  1191. /** @type {number} */
  1192. a["width"] = style["width"] = width;
  1193. /** @type {number} */
  1194. a["height"] = style["height"] = height;
  1195. var obj = log("#helloContainer");
  1196. obj["css"]("transform", "none");
  1197. var HalfDiagonal = obj["height"]();
  1198. var b = win["innerHeight"];
  1199. if(HalfDiagonal > b / 1.1) {
  1200. obj["css"]("transform", "translate(-50%, -50%) scale(" + b /
  1201. HalfDiagonal / 1.1 + ")");
  1202. } else {
  1203. obj["css"]("transform", "translate(-50%, -50%)");
  1204. }
  1205. setupPrototype();
  1206. }
  1207. /**
  1208. * @return {?}
  1209. */
  1210. function promote() {
  1211. var _0x3495x2e;
  1212. /** @type {number} */
  1213. _0x3495x2e = 1 * Math["max"](height / 1080, width / 1920);
  1214. return _0x3495x2e *= $timeout;
  1215. }
  1216. /**
  1217. * @return {undefined}
  1218. */
  1219. function getOwnPropertyNames() {
  1220. if(0 != params["length"]) {
  1221. if(myApp["isEnableLockZoom"]) {
  1222. obj = promote();
  1223. } else {
  1224. /** @type {number} */
  1225. var obj = 0;
  1226. /** @type {number} */
  1227. var i = 0;
  1228. for(; i < params["length"]; i++) {
  1229. obj += params[i]["size"];
  1230. }
  1231. /** @type {number} */
  1232. obj = Math["pow"](Math["min"](64 / obj, 1), 0.4) * promote();
  1233. }
  1234. /** @type {number} */
  1235. w = (9 * w + obj) / 10;
  1236. }
  1237. }
  1238. /**
  1239. * @return {undefined}
  1240. */
  1241. function setupPrototype() {
  1242. var c;
  1243. var diff = Date["now"]();
  1244. ++clockseq;
  1245. max = diff;
  1246. if(0 < params["length"]) {
  1247. getOwnPropertyNames();
  1248. /** @type {number} */
  1249. var pop = c = 0;
  1250. /** @type {number} */
  1251. var k = 0;
  1252. for(; k < params["length"]; k++) {
  1253. params[k].J();
  1254. c += params[k]["x"] / params["length"];
  1255. pop += params[k]["y"] / params["length"];
  1256. }
  1257. /** @type {number} */
  1258. current = c;
  1259. /** @type {number} */
  1260. expr = pop;
  1261. cb = w;
  1262. if(myApp["testing"]) {
  1263. /** @type {number} */
  1264. value = (testingVal * value + current) / (testingVal + 1);
  1265. /** @type {number} */
  1266. old = (testingVal * old + expr) / (testingVal + 1);
  1267. console["log"](testingVal + 1);
  1268. } else {
  1269. /** @type {number} */
  1270. value = (value + c) / 2;
  1271. /** @type {number} */
  1272. old = (old + pop) / 2;
  1273. }
  1274. } else {
  1275. /** @type {number} */
  1276. value = (29 * value + current) / 30;
  1277. /** @type {number} */
  1278. old = (29 * old + expr) / 30;
  1279. /** @type {number} */
  1280. w = (9 * w + cb * promote()) / 10;
  1281. }
  1282. throttledUpdate();
  1283. prep();
  1284. if(!text) {
  1285. options["clearRect"](0, 0, width, height);
  1286. }
  1287. if(text) {
  1288. /** @type {string} */
  1289. options["fillStyle"] = color ? "#111111" : "#F2FBFF";
  1290. /** @type {number} */
  1291. options["globalAlpha"] = 0.05;
  1292. options["fillRect"](0, 0, width, height);
  1293. /** @type {number} */
  1294. options["globalAlpha"] = 1;
  1295. } else {
  1296. _buildItem();
  1297. }
  1298. h["sort"](function (a, b) {
  1299. return a["size"] == b["size"] ? a["id"] - b["id"] : a[
  1300. "size"] - b["size"];
  1301. });
  1302. options["save"]();
  1303. options["translate"](width / 2, height / 2);
  1304. options["scale"](w, w);
  1305. options["translate"](-value, -old);
  1306. if(myApp["isEnableBorder"]) {
  1307. /** @type {number} */
  1308. var position = 15 / w;
  1309. /** @type {number} */
  1310. position = position > 60 ? 60 : position;
  1311. /** @type {string} */
  1312. options["strokeStyle"] = color ? "white" : "#FF6666";
  1313. /** @type {number} */
  1314. options["lineWidth"] = position;
  1315. options["strokeRect"](~~(count - position), ~~(minY - position), ~
  1316. ~(ln + position * 2), ~~(span + position * 2));
  1317. }
  1318. /** @type {number} */
  1319. k = 0;
  1320. for(; k < listeners["length"]; k++) {
  1321. listeners[k]["s"](options);
  1322. }
  1323. /** @type {number} */
  1324. k = 0;
  1325. for(; k < h["length"]; k++) {
  1326. h[k]["s"](options);
  1327. }
  1328. if(resultItems["length"] > 0) {
  1329. /** @type {string} */
  1330. options["fillStyle"] = "#651FFF";
  1331. options["beginPath"]();
  1332. /** @type {number} */
  1333. var i = 0;
  1334. for(; i < resultItems["length"]; i++) {
  1335. var result = resultItems[i];
  1336. options["moveTo"](result["x"], result["y"]);
  1337. options["arc"](result["x"], result["y"], result["size"] + 5,
  1338. 0, udataCur, false);
  1339. }
  1340. options["fill"]();
  1341. /** @type {Array} */
  1342. resultItems = [];
  1343. }
  1344. if(params["length"] && myApp["isEnableSplitInd"]) {
  1345. /** @type {number} */
  1346. options["globalAlpha"] = 0.7;
  1347. /** @type {number} */
  1348. var oTemplate = ~~Math["min"](5 / w, 50);
  1349. /** @type {number} */
  1350. options["lineWidth"] = oTemplate;
  1351. /** @type {Array} */
  1352. var map = [];
  1353. /** @type {number} */
  1354. i = 0;
  1355. for(; i < params["length"]; i++) {
  1356. map["push"]({
  1357. x: params[i]["x"],
  1358. y: params[i]["y"],
  1359. size: params[i]["size"]
  1360. });
  1361. }
  1362. map["sort"](function (a, b) {
  1363. return a["size"] - b["size"];
  1364. });
  1365. /** @type {number} */
  1366. i = 0;
  1367. for(; i < data["length"]; i++) {
  1368. /** @type {number} */
  1369. var yMovement = data[i]["size"] * data[i]["size"];
  1370. /** @type {number} */
  1371. var x = 0;
  1372. for(; x < map["length"]; x++) {
  1373. /** @type {number} */
  1374. var xMovement = map[x]["size"] * map[x]["size"];
  1375. var p = Math["sqrt"](Math["pow"](map[x]["x"] - data[i][
  1376. "x"
  1377. ], 2) + Math["pow"](map[x]["y"] - data[i]["y"],
  1378. 2));
  1379. var a = map[x]["size"] + 655;
  1380. var li = data[i]["size"] + 655;
  1381. if(map["length"] <= 4 && (xMovement * 0.375 * 0.37 >
  1382. yMovement && a * 2 - 10 > p)) {
  1383. /** @type {number} */
  1384. data[i]["type"] = 4;
  1385. break;
  1386. }
  1387. if(map["length"] <= 8 && (xMovement * 0.37 > yMovement &&
  1388. a > p)) {
  1389. /** @type {number} */
  1390. data[i]["type"] = 2;
  1391. break;
  1392. }
  1393. if(xMovement * 0.73 > yMovement && a > p) {
  1394. /** @type {number} */
  1395. data[i]["type"] = 1;
  1396. break;
  1397. }
  1398. if(yMovement * 0.37 > xMovement && li > p) {
  1399. /** @type {number} */
  1400. data[i]["type"] = -2;
  1401. break;
  1402. }
  1403. if(yMovement * 0.73 > xMovement && li > p) {
  1404. /** @type {number} */
  1405. data[i]["type"] = -1;
  1406. break;
  1407. }
  1408. }
  1409. }
  1410. /** @type {number} */
  1411. var it = 0;
  1412. for(; it < list["length"]; it++) {
  1413. options["strokeStyle"] = list[it]["color"];
  1414. options["beginPath"]();
  1415. /** @type {number} */
  1416. i = 0;
  1417. for(; i < data["length"]; i++) {
  1418. if(!data[i]["type"] || data[i]["type"] != list[it][
  1419. "type"
  1420. ]) {
  1421. continue;
  1422. }
  1423. var originalEvent = data[i]["size"] + oTemplate + 8 + 2 /
  1424. w;
  1425. options["moveTo"](data[i]["x"] + originalEvent, data[i]
  1426. ["y"]);
  1427. options["arc"](data[i]["x"], data[i]["y"],
  1428. originalEvent, 0, udataCur, false);
  1429. }
  1430. options["stroke"]();
  1431. }
  1432. }
  1433. /** @type {Array} */
  1434. data = [];
  1435. if(_0x3495xa6) {
  1436. /** @type {number} */
  1437. vvar = (3 * vvar + ref) / 4;
  1438. /** @type {number} */
  1439. openElement = (3 * openElement + element) / 4;
  1440. options["save"]();
  1441. /** @type {string} */
  1442. options["strokeStyle"] = "#FFAAAA";
  1443. /** @type {number} */
  1444. options["lineWidth"] = 10;
  1445. /** @type {string} */
  1446. options["lineCap"] = "round";
  1447. /** @type {string} */
  1448. options["lineJoin"] = "round";
  1449. /** @type {number} */
  1450. options["globalAlpha"] = 0.5;
  1451. options["beginPath"]();
  1452. /** @type {number} */
  1453. k = 0;
  1454. for(; k < params["length"]; k++) {
  1455. options["moveTo"](params[k]["x"], params[k]["y"]);
  1456. options["lineTo"](vvar, openElement);
  1457. }
  1458. options["stroke"]();
  1459. options["restore"]();
  1460. }
  1461. options["restore"]();
  1462. if(":teams" == message) {
  1463. if(el) {
  1464. if(el["width"]) {
  1465. options["drawImage"](el, width - el["width"] - 10, 10);
  1466. }
  1467. }
  1468. }
  1469. currentValue = Math["max"](currentValue, format());
  1470. /** @type {number} */
  1471. diff = Date["now"]() - diff;
  1472. if(diff > 1E3 / 60) {
  1473. scale -= 0.01;
  1474. } else {
  1475. if(diff < 1E3 / 65) {
  1476. scale += 0.01;
  1477. }
  1478. }
  1479. if(0.4 > scale) {
  1480. /** @type {number} */
  1481. scale = 0.4;
  1482. }
  1483. if(1 < scale) {
  1484. /** @type {number} */
  1485. scale = 1;
  1486. }
  1487. /** @type {number} */
  1488. diff = max - aux;
  1489. if(!removeClass() || (to || from)) {
  1490. newEnd += diff / 2E3;
  1491. if(1 < newEnd) {
  1492. /** @type {number} */
  1493. newEnd = 1;
  1494. }
  1495. } else {
  1496. newEnd -= diff / 300;
  1497. if(0 > newEnd) {
  1498. /** @type {number} */
  1499. newEnd = 0;
  1500. }
  1501. }
  1502. aux = max;
  1503. if(myApp["autoW"]) {
  1504. toggleClass(21);
  1505. }
  1506. }
  1507. /**
  1508. * @return {undefined}
  1509. */
  1510. function _buildItem() {
  1511. if(!myApp["isEnableGridline"]) {
  1512. return;
  1513. }
  1514. options["save"]();
  1515. /** @type {string} */
  1516. options["strokeStyle"] = color ? "#AAAAAA" : "#000000";
  1517. /** @type {number} */
  1518. options["globalAlpha"] = 0.2 * w;
  1519. options["beginPath"]();
  1520. /** @type {number} */
  1521. var x = width / w;
  1522. /** @type {number} */
  1523. var p = height / w;
  1524. /** @type {number} */
  1525. var r = (-value + x / 2) % 50;
  1526. for(; r < x; r += 50) {
  1527. options["moveTo"](r * w - 0.5, 0);
  1528. options["lineTo"](r * w - 0.5, p * w);
  1529. }
  1530. /** @type {number} */
  1531. r = (-old + p / 2) % 50;
  1532. for(; r < p; r += 50) {
  1533. options["moveTo"](0, r * w - 0.5);
  1534. options["lineTo"](x * w, r * w - 0.5);
  1535. }
  1536. options["stroke"]();
  1537. options["restore"]();
  1538. }
  1539. /**
  1540. * @return {undefined}
  1541. */
  1542. function _0x3495x6d() {}
  1543. /**
  1544. * @return {?}
  1545. */
  1546. function format() {
  1547. /** @type {number} */
  1548. var MSG_CONCATENATED_DURATION_TEXT = 0;
  1549. /** @type {number} */
  1550. var i = 0;
  1551. for(; i < params["length"]; i++) {
  1552. MSG_CONCATENATED_DURATION_TEXT += params[i]["m"] * params[i][
  1553. "m"
  1554. ];
  1555. }
  1556. return MSG_CONCATENATED_DURATION_TEXT;
  1557. }
  1558. /**
  1559. * @return {undefined}
  1560. */
  1561. function create() {
  1562. /** @type {null} */
  1563. el = null;
  1564. if(null != obj || 0 != stack["length"]) {
  1565. if(null != obj || $rootScope) {
  1566. el = document["createElement"]("canvas");
  1567. var self = el["getContext"]("2d");
  1568. /** @type {number} */
  1569. var i = 60;
  1570. /** @type {number} */
  1571. i = null == obj ? i + 24 * stack["length"] : i + 180;
  1572. /** @type {number} */
  1573. var fn = Math["min"](200, 0.3 * width) / 200;
  1574. /** @type {number} */
  1575. el["width"] = 200 * fn;
  1576. /** @type {number} */
  1577. el["height"] = i * fn;
  1578. self["scale"](fn, fn);
  1579. /** @type {number} */
  1580. self["globalAlpha"] = 0.4;
  1581. /** @type {string} */
  1582. self["fillStyle"] = "#000000";
  1583. self["fillRect"](0, 0, 200, i);
  1584. /** @type {number} */
  1585. self["globalAlpha"] = 1;
  1586. /** @type {string} */
  1587. self["fillStyle"] = "#FFFFFF";
  1588. /** @type {null} */
  1589. fn = null;
  1590. fn = require("leaderboard");
  1591. /** @type {string} */
  1592. self["font"] = "30px Ubuntu";
  1593. self["fillText"](fn, 100 - self["measureText"](fn)["width"] /
  1594. 2, 40);
  1595. if(null == obj) {
  1596. /** @type {string} */
  1597. self["font"] = "20px Ubuntu";
  1598. /** @type {number} */
  1599. i = 0;
  1600. for(; i < stack["length"]; ++i) {
  1601. fn = stack[i]["name"] || require("unnamed_cell");
  1602. if(!$rootScope) {
  1603. fn = require("unnamed_cell");
  1604. }
  1605. if(-1 != p["indexOf"](stack[i]["id"])) {
  1606. if(params[0]["name"]) {
  1607. fn = params[0]["name"];
  1608. }
  1609. /** @type {string} */
  1610. self["fillStyle"] = "#FFAAAA";
  1611. } else {
  1612. /** @type {string} */
  1613. self["fillStyle"] = "#FFFFFF";
  1614. }
  1615. /** @type {string} */
  1616. fn = i + 1 + ". " + fn;
  1617. self["fillText"](fn, 100 - self["measureText"](fn)[
  1618. "width"] / 2, 70 + 24 * i);
  1619. }
  1620. } else {
  1621. /** @type {number} */
  1622. i = fn = 0;
  1623. for(; i < obj["length"]; ++i) {
  1624. /** @type {number} */
  1625. var returnFalse = fn + obj[i] * Math["PI"] * 2;
  1626. self["fillStyle"] = m[i + 1];
  1627. self["beginPath"]();
  1628. self["moveTo"](100, 140);
  1629. self["arc"](100, 140, 80, fn, returnFalse, false);
  1630. self["fill"]();
  1631. /** @type {number} */
  1632. fn = returnFalse;
  1633. }
  1634. }
  1635. }
  1636. }
  1637. }
  1638. /**
  1639. * @param {?} value
  1640. * @param {?} v
  1641. * @param {?} replacement
  1642. * @param {?} s
  1643. * @param {?} d
  1644. * @return {undefined}
  1645. */
  1646. function val(value, v, replacement, s, d) {
  1647. this["P"] = value;
  1648. this["x"] = v;
  1649. this["y"] = replacement;
  1650. this["g"] = s;
  1651. this["b"] = d;
  1652. }
  1653. /**
  1654. * @param {?} stream
  1655. * @param {?} x
  1656. * @param {?} state
  1657. * @param {?} n
  1658. * @param {?} name
  1659. * @param {?} value
  1660. * @return {undefined}
  1661. */
  1662. function $(stream, x, state, n, name, value) {
  1663. this["id"] = stream;
  1664. this["o"] = this["x"] = x;
  1665. this["p"] = this["y"] = state;
  1666. this["n"] = this["size"] = n;
  1667. this["color"] = name;
  1668. /** @type {Array} */
  1669. this["a"] = [];
  1670. this.Q();
  1671. this["t"](value);
  1672. }
  1673. /**
  1674. * @param {?} x
  1675. * @return {?}
  1676. */
  1677. function join(x) {
  1678. x = x.toString(16);
  1679. for(; 6 > x["length"];) {
  1680. /** @type {string} */
  1681. x = "0" + x;
  1682. }
  1683. return "#" + x;
  1684. }
  1685. /**
  1686. * @param {?} value
  1687. * @param {?} theArray
  1688. * @param {?} itemsPerChunk
  1689. * @param {?} newBox
  1690. * @return {undefined}
  1691. */
  1692. function chunk(value, theArray, itemsPerChunk, newBox) {
  1693. if(value) {
  1694. this["q"] = value;
  1695. }
  1696. if(theArray) {
  1697. this["M"] = theArray;
  1698. }
  1699. /** @type {boolean} */
  1700. this["O"] = !!itemsPerChunk;
  1701. if(newBox) {
  1702. this["r"] = newBox;
  1703. }
  1704. }
  1705. /**
  1706. * @param {Object} obj
  1707. * @return {undefined}
  1708. */
  1709. function isArraylike(obj) {
  1710. var i = obj["length"];
  1711. var val;
  1712. var prop;
  1713. for(; 0 < i;) {
  1714. prop = Math["floor"](Math["random"]() * i);
  1715. i--;
  1716. val = obj[i];
  1717. obj[i] = obj[prop];
  1718. obj[prop] = val;
  1719. }
  1720. }
  1721. /**
  1722. * @param {Object} data
  1723. * @param {Object} loaded
  1724. * @return {undefined}
  1725. */
  1726. function load(data, loaded) {
  1727. /** @type {boolean} */
  1728. var fn1 = "1" == log("#helloContainer")["attr"](
  1729. "data-has-account-data");
  1730. log("#helloContainer")["attr"]("data-has-account-data", "1");
  1731. if(null == loaded && win["localStorage"][i]) {
  1732. var c = JSON["parse"](win["localStorage"][i]);
  1733. c["xp"] = data["e"];
  1734. c["xpNeeded"] = data["c"];
  1735. c["level"] = data["d"];
  1736. win["localStorage"][i] = JSON["stringify"](c);
  1737. }
  1738. if(fn1) {
  1739. /** @type {number} */
  1740. var source = +log(".agario-exp-bar .progress-bar-text")["first"]
  1741. ()["text"]()["split"]("/")[0];
  1742. /** @type {number} */
  1743. fn1 = +log(".agario-exp-bar .progress-bar-text")["first"]()[
  1744. "text"]()["split"]("/")[1]["split"](" ")[0];
  1745. c = log(".agario-profile-panel .progress-bar-star")["first"]()[
  1746. "text"]();
  1747. if(c != data["d"]) {
  1748. load({
  1749. e: fn1,
  1750. c: fn1,
  1751. d: c
  1752. }, function () {
  1753. log(".agario-profile-panel .progress-bar-star")[
  1754. "text"](data["d"]);
  1755. log(".agario-exp-bar .progress-bar")["css"](
  1756. "width", "100%");
  1757. log(".progress-bar-star")["addClass"](
  1758. "animated tada")["one"](
  1759. "webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",
  1760. function () {
  1761. log(".progress-bar-star")[
  1762. "removeClass"](
  1763. "animated tada");
  1764. });
  1765. setTimeout(function () {
  1766. log(
  1767. ".agario-exp-bar .progress-bar-text"
  1768. )["text"](data["c"] + "/" +
  1769. data["c"] + " XP");
  1770. load({
  1771. e: 0,
  1772. c: data["c"],
  1773. d: data["d"]
  1774. }, function () {
  1775. load(data, loaded);
  1776. });
  1777. }, 1E3);
  1778. });
  1779. } else {
  1780. var _0x3495x45 = Date["now"]();
  1781. /**
  1782. * @return {undefined}
  1783. */
  1784. var init = function () {
  1785. var pos;
  1786. /** @type {number} */
  1787. pos = (Date["now"]() - _0x3495x45) / 1E3;
  1788. /** @type {number} */
  1789. pos = 0 > pos ? 0 : 1 < pos ? 1 : pos;
  1790. /** @type {number} */
  1791. pos = pos * pos * (3 - 2 * pos);
  1792. log(".agario-exp-bar .progress-bar-text")["text"](~
  1793. ~(source + (data["e"] - source) * pos) +
  1794. "/" + data["c"] + " XP");
  1795. log(".agario-exp-bar .progress-bar")["css"]("width",
  1796. (88 * (source + (data["e"] - source) * pos) /
  1797. data["c"])["toFixed"](2) + "%");
  1798. if(1 > pos) {
  1799. win["requestAnimationFrame"](init);
  1800. } else {
  1801. if(loaded) {
  1802. loaded();
  1803. }
  1804. }
  1805. };
  1806. win["requestAnimationFrame"](init);
  1807. }
  1808. } else {
  1809. log(".agario-profile-panel .progress-bar-star")["text"](data[
  1810. "d"]);
  1811. log(".agario-exp-bar .progress-bar-text")["text"](data["e"] +
  1812. "/" + data["c"] + " XP");
  1813. log(".agario-exp-bar .progress-bar")["css"]("width", (88 * data[
  1814. "e"] / data["c"])["toFixed"](2) + "%");
  1815. if(loaded) {
  1816. loaded();
  1817. }
  1818. }
  1819. }
  1820. /**
  1821. * @param {Object} args
  1822. * @return {undefined}
  1823. */
  1824. function parse(args) {
  1825. if("string" == typeof args) {
  1826. args = JSON["parse"](args);
  1827. }
  1828. if(Date["now"]() + 18E5 > args["expires"]) {
  1829. log("#helloContainer")["attr"]("data-logged-in", "0");
  1830. } else {
  1831. win["localStorage"][i] = JSON["stringify"](args);
  1832. node = args["authToken"];
  1833. log(".agario-profile-name")["text"](args["name"]);
  1834. observer();
  1835. load({
  1836. e: args["xp"],
  1837. c: args["xpNeeded"],
  1838. d: args["level"]
  1839. });
  1840. log("#helloContainer")["attr"]("data-logged-in", "1");
  1841. }
  1842. }
  1843. /**
  1844. * @param {Array} token
  1845. * @return {undefined}
  1846. */
  1847. function onSuccess(token) {
  1848. console["log"]("???");
  1849. token = token["split"]("\n");
  1850. parse({
  1851. name: token[0],
  1852. fbid: token[1],
  1853. authToken: token[2],
  1854. expires: 1E3 * +token[3],
  1855. level: +token[4],
  1856. xp: +token[5],
  1857. xpNeeded: +token[6]
  1858. });
  1859. }
  1860. /**
  1861. * @param {?} batches
  1862. * @return {undefined}
  1863. */
  1864. function run(batches) {
  1865. if("connected" == batches["status"]) {
  1866. var task = batches["authResponse"]["accessToken"];
  1867. win["FB"]["api"]("/me/picture?width=180&height=180", function (
  1868. cache) {
  1869. win["localStorage"]["fbPictureCache"] = cache[
  1870. "data"]["url"];
  1871. log(".agario-profile-picture")["attr"]("src", cache[
  1872. "data"]["url"]);
  1873. });
  1874. log("#helloContainer")["attr"]("data-logged-in", "1");
  1875. if(null != node) {
  1876. log["ajax"]("http://m.agar.io/checkToken", {
  1877. /**
  1878. * @return {undefined}
  1879. */
  1880. error: function () {
  1881. /** @type {null} */
  1882. node = null;
  1883. run(batches);
  1884. },
  1885. /**
  1886. * @param {Array} location
  1887. * @return {undefined}
  1888. */
  1889. success: function (location) {
  1890. location = location["split"]("\n");
  1891. load({
  1892. d: +location[0],
  1893. e: +location[1],
  1894. c: +location[2]
  1895. });
  1896. },
  1897. dataType: "text",
  1898. method: "POST",
  1899. cache: false,
  1900. crossDomain: true,
  1901. data: node
  1902. });
  1903. } else {
  1904. log["ajax"]("http://m.agar.io/facebookLogin", {
  1905. /**
  1906. * @return {undefined}
  1907. */
  1908. error: function () {
  1909. /** @type {null} */
  1910. node = null;
  1911. log("#helloContainer")["attr"](
  1912. "data-logged-in", "0");
  1913. },
  1914. /** @type {function (Array): undefined} */
  1915. success: onSuccess,
  1916. dataType: "text",
  1917. method: "POST",
  1918. cache: false,
  1919. crossDomain: true,
  1920. data: task
  1921. });
  1922. }
  1923. }
  1924. }
  1925. /**
  1926. * @param {Object} r
  1927. * @return {undefined}
  1928. */
  1929. function success(r) {
  1930. fail(":party");
  1931. log("#helloContainer")["attr"]("data-party-state", "4");
  1932. r = decodeURIComponent(r)["replace"](/.*#/gim, "");
  1933. callback("#" + win["encodeURIComponent"](r));
  1934. log["ajax"]("http://m.agar.io/getToken", {
  1935. /**
  1936. * @return {undefined}
  1937. */
  1938. error: function () {
  1939. log("#helloContainer")["attr"](
  1940. "data-party-state", "6");
  1941. log("#connect_error_div")["show"]();
  1942. },
  1943. /**
  1944. * @param {Element} location
  1945. * @return {undefined}
  1946. */
  1947. success: function (location) {
  1948. location = location["split"]("\n");
  1949. log(".partyToken")["val"]("agar.io/#" + win[
  1950. "encodeURIComponent"](r));
  1951. log("#helloContainer")["attr"](
  1952. "data-party-state", "5");
  1953. fail(":party");
  1954. next("ws://" + location[0], r);
  1955. },
  1956. dataType: "text",
  1957. method: "POST",
  1958. cache: false,
  1959. crossDomain: true,
  1960. data: r
  1961. });
  1962. }
  1963. /**
  1964. * @param {string} url
  1965. * @return {undefined}
  1966. */
  1967. function callback(url) {
  1968. if(win["history"]) {
  1969. if(win["history"]["replaceState"]) {
  1970. win["history"]["replaceState"]({}, win["document"]["title"],
  1971. url);
  1972. }
  1973. }
  1974. }
  1975. /**
  1976. * @param {Object} doc
  1977. * @param {Object} event
  1978. * @return {undefined}
  1979. */
  1980. function fn(doc, event) {
  1981. /** @type {boolean} */
  1982. var _0x3495x30 = -1 != p["indexOf"](doc["id"]);
  1983. /** @type {boolean} */
  1984. var _0x3495x2a = -1 != p["indexOf"](event["id"]);
  1985. /** @type {boolean} */
  1986. var _0x3495x2b = 30 > event["size"];
  1987. if(_0x3495x30) {
  1988. if(_0x3495x2b) {
  1989. ++rreturn;
  1990. }
  1991. }
  1992. if(!_0x3495x2b) {
  1993. if(!!_0x3495x30) {
  1994. if(!_0x3495x2a) {
  1995. ++r20;
  1996. }
  1997. }
  1998. }
  1999. }
  2000. /**
  2001. * @param {number} obj
  2002. * @return {?}
  2003. */
  2004. function isArray(obj) {
  2005. /** @type {number} */
  2006. obj = ~~obj;
  2007. /** @type {string} */
  2008. var result = (obj % 60).toString();
  2009. /** @type {string} */
  2010. obj = (~~(obj / 60)).toString();
  2011. if(2 > result["length"]) {
  2012. /** @type {string} */
  2013. result = "0" + result;
  2014. }
  2015. return obj + ":" + result;
  2016. }
  2017. /**
  2018. * @return {?}
  2019. */
  2020. function tryIt() {
  2021. if(null == stack) {
  2022. return 0;
  2023. }
  2024. /** @type {number} */
  2025. var i = 0;
  2026. for(; i < stack["length"]; ++i) {
  2027. if(-1 != p["indexOf"](stack[i]["id"])) {
  2028. return i + 1;
  2029. }
  2030. }
  2031. return 0;
  2032. }
  2033. /**
  2034. * @return {undefined}
  2035. */
  2036. function update() {
  2037. log(".stats-food-eaten")["text"](rreturn);
  2038. log(".stats-time-alive")["text"](isArray((right - left) / 1E3));
  2039. log(".stats-leaderboard-time")["text"](isArray(funcs));
  2040. log(".stats-highest-mass")["text"](~~(currentValue / 100));
  2041. log(".stats-cells-eaten")["text"](r20);
  2042. log(".stats-top-position")["text"](0 == v ? ":(" : v);
  2043. var size = document["getElementById"]("statsGraph");
  2044. if(size) {
  2045. var style = size["getContext"]("2d");
  2046. var width = size["width"];
  2047. size = size["height"];
  2048. style["clearRect"](0, 0, width, size);
  2049. if(2 < b["length"]) {
  2050. /** @type {number} */
  2051. var serverAttrs = 200;
  2052. /** @type {number} */
  2053. var i = 0;
  2054. for(; i < b["length"]; i++) {
  2055. serverAttrs = Math["max"](b[i], serverAttrs);
  2056. }
  2057. /** @type {number} */
  2058. style["lineWidth"] = 3;
  2059. /** @type {string} */
  2060. style["lineCap"] = "round";
  2061. /** @type {string} */
  2062. style["lineJoin"] = "round";
  2063. style["strokeStyle"] = trans;
  2064. style["fillStyle"] = trans;
  2065. style["beginPath"]();
  2066. style["moveTo"](0, size - b[0] / serverAttrs * (size - 10) +
  2067. 10);
  2068. /** @type {number} */
  2069. i = 1;
  2070. for(; i < b["length"]; i += Math["max"](~~(b["length"] /
  2071. width), 1)) {
  2072. /** @type {number} */
  2073. var offw = i / (b["length"] - 1) * width;
  2074. /** @type {Array} */
  2075. var dots = [];
  2076. /** @type {number} */
  2077. var off = -20;
  2078. for(; 20 >= off; ++off) {
  2079. if(!(0 > i + off)) {
  2080. if(!(i + off >= b["length"])) {
  2081. dots["push"](b[i + off]);
  2082. }
  2083. }
  2084. }
  2085. /** @type {number} */
  2086. dots = dots["reduce"](function (far, near) {
  2087. return far + near;
  2088. }) / dots["length"] / serverAttrs;
  2089. style["lineTo"](offw, size - dots * (size - 10) + 10);
  2090. }
  2091. style["stroke"]();
  2092. /** @type {number} */
  2093. style["globalAlpha"] = 0.5;
  2094. style["lineTo"](width, size);
  2095. style["lineTo"](0, size);
  2096. style["fill"]();
  2097. /** @type {number} */
  2098. style["globalAlpha"] = 1;
  2099. }
  2100. }
  2101. }
  2102. /**
  2103. * @param {number} a
  2104. * @param {number} b
  2105. * @return {undefined}
  2106. */
  2107. win["moveTo"] = function (a, b) {
  2108. if(a && b) {
  2109. /** @type {boolean} */
  2110. myApp["isStopMovement"] = true;
  2111. /** @type {number} */
  2112. key = a;
  2113. /** @type {number} */
  2114. b0 = b;
  2115. } else {
  2116. /** @type {null} */
  2117. key = null;
  2118. /** @type {null} */
  2119. b0 = null;
  2120. }
  2121. };
  2122. /**
  2123. * @param {?} deepDataAndEvents
  2124. * @param {?} opt_obj2
  2125. * @return {undefined}
  2126. */
  2127. win["setPosition"] = function (deepDataAndEvents, opt_obj2) {
  2128. if(removeClass()) {
  2129. var udataCur = forEach(13);
  2130. udataCur["setUint8"](0, 16);
  2131. udataCur["setInt32"](1, deepDataAndEvents, true);
  2132. udataCur["setInt32"](5, opt_obj2, true);
  2133. udataCur["setUint32"](9, 0, true);
  2134. addClass(udataCur);
  2135. }
  2136. };
  2137. if(!win["agarioNoInit"]) {
  2138. var arrayClass = win["location"]["protocol"];
  2139. /** @type {boolean} */
  2140. var isArr = "https:" == arrayClass;
  2141. if(isArr && -1 == win["location"]["search"]["indexOf"]("fb")) {
  2142. /** @type {string} */
  2143. win["location"]["href"] = "http://agar.io/";
  2144. } else {
  2145. var userAgent = win["navigator"]["userAgent"];
  2146. if(false) {} else {
  2147. var a;
  2148. var options;
  2149. var style;
  2150. var width;
  2151. var height;
  2152. /** @type {null} */
  2153. var ea = null;
  2154. /** @type {null} */
  2155. var self = null;
  2156. /** @type {number} */
  2157. var value = 0;
  2158. /** @type {number} */
  2159. var old = 0;
  2160. /** @type {Array} */
  2161. var p = [];
  2162. /** @type {Array} */
  2163. var params = [];
  2164. var result = {};
  2165. /** @type {Array} */
  2166. var h = [];
  2167. /** @type {Array} */
  2168. var listeners = [];
  2169. /** @type {Array} */
  2170. var stack = [];
  2171. /** @type {number} */
  2172. var y = 0;
  2173. /** @type {number} */
  2174. var x = 0;
  2175. /** @type {number} */
  2176. var step = -1;
  2177. /** @type {number} */
  2178. var h2 = -1;
  2179. /** @type {number} */
  2180. var clockseq = 0;
  2181. /** @type {number} */
  2182. var max = 0;
  2183. /** @type {number} */
  2184. var aux = 0;
  2185. /** @type {null} */
  2186. var id = null;
  2187. /** @type {number} */
  2188. var count = 0;
  2189. /** @type {number} */
  2190. var minY = 0;
  2191. /** @type {number} */
  2192. var idx = 1E4;
  2193. /** @type {number} */
  2194. var maxY = 1E4;
  2195. /** @type {number} */
  2196. var w = 1;
  2197. /** @type {null} */
  2198. var banner = null;
  2199. /** @type {boolean} */
  2200. var img = true;
  2201. /** @type {boolean} */
  2202. var $rootScope = true;
  2203. /** @type {boolean} */
  2204. var dest = false;
  2205. /** @type {boolean} */
  2206. var _0x3495x9c = false;
  2207. /** @type {number} */
  2208. var currentValue = 0;
  2209. /** @type {number} */
  2210. var color = 1;
  2211. /** @type {boolean} */
  2212. var oldStatus = false;
  2213. /** @type {number} */
  2214. var current = value = ~~((count + idx) / 2);
  2215. /** @type {number} */
  2216. var expr = old = ~~((minY + maxY) / 2);
  2217. /** @type {number} */
  2218. var cb = 1;
  2219. /** @type {string} */
  2220. var message = "";
  2221. /** @type {null} */
  2222. var obj = null;
  2223. /** @type {boolean} */
  2224. var _0x3495xa5 = false;
  2225. /** @type {boolean} */
  2226. var _0x3495xa6 = false;
  2227. /** @type {number} */
  2228. var ref = 0;
  2229. /** @type {number} */
  2230. var element = 0;
  2231. /** @type {number} */
  2232. var vvar = 0;
  2233. /** @type {number} */
  2234. var openElement = 0;
  2235. /** @type {number} */
  2236. var generalCallback = 0;
  2237. /** @type {Array} */
  2238. var m = ["#333333", "#FF3333", "#33FF33", "#3333FF"];
  2239. /** @type {boolean} */
  2240. var text = false;
  2241. /** @type {boolean} */
  2242. var item = false;
  2243. /** @type {number} */
  2244. var check = 0;
  2245. /** @type {null} */
  2246. var node = null;
  2247. /** @type {number} */
  2248. var $timeout = 1;
  2249. /** @type {number} */
  2250. var newEnd = 1;
  2251. /** @type {boolean} */
  2252. var to = false;
  2253. /** @type {number} */
  2254. var resizeUID = 0;
  2255. var dst = {};
  2256. /** @type {string} */
  2257. var e = "";
  2258. /** @type {number} */
  2259. var ln = 0;
  2260. /** @type {number} */
  2261. var span = 0;
  2262. /** @type {number} */
  2263. var _clockseq = 0;
  2264. /** @type {Array} */
  2265. var _0x3495xb9 = [];
  2266. /** @type {Array} */
  2267. var _0x3495xba = [];
  2268. /** @type {Array} */
  2269. var _0x3495xbb = [];
  2270. /** @type {Array} */
  2271. var data = [];
  2272. /** @type {number} */
  2273. var udataCur = 2 * Math["PI"];
  2274. /** @type {null} */
  2275. var key = null;
  2276. /** @type {null} */
  2277. var b0 = null;
  2278. /** @type {number} */
  2279. var msg = 0;
  2280. /** @type {number} */
  2281. var fx = 0;
  2282. /** @type {number} */
  2283. var err = 0;
  2284. /** @type {number} */
  2285. var type = 0;
  2286. /** @type {number} */
  2287. var error = 0;
  2288. /** @type {Array} */
  2289. var resultItems = [];
  2290. var _0x3495xc6 = {};
  2291. /** @type {Array} */
  2292. var list = [{
  2293. type: 1,
  2294. color: "#d3d3d3"
  2295. }, {
  2296. type: 2,
  2297. color: "#76FF03"
  2298. }, {
  2299. type: 4,
  2300. color: "#2196F3"
  2301. }, {
  2302. type: -1,
  2303. color: "#FF9800"
  2304. }, {
  2305. type: -2,
  2306. color: "#FD0000"
  2307. }, {
  2308. type: -4,
  2309. color: "white"
  2310. }];
  2311. setInterval(function () {
  2312. type = fx;
  2313. /** @type {number} */
  2314. fx = 0;
  2315. error = err;
  2316. /** @type {number} */
  2317. err = 0;
  2318. }, 1E3);
  2319. (function () {
  2320. var data = win["location"]["search"];
  2321. if("?" == data["charAt"](0)) {
  2322. data = data["slice"](1);
  2323. }
  2324. data = data["split"]("&");
  2325. /** @type {number} */
  2326. var i = 0;
  2327. for(; i < data["length"]; i++) {
  2328. var src = data[i]["split"]("=");
  2329. dst[src[0]] = src[1];
  2330. }
  2331. })();
  2332. var test_canvas = document["createElement"]("canvas");
  2333. if("undefined" == typeof console || ("undefined" == typeof DataView ||
  2334. ("undefined" == typeof WebSocket || (null ==
  2335. test_canvas || (null == test_canvas[
  2336. "getContext"] || null == win[
  2337. "localStorage"]))))) {
  2338. alert(
  2339. "You browser does not support this game, we recommend you to use Firefox to play this"
  2340. );
  2341. } else {
  2342. /** @type {null} */
  2343. var map = null;
  2344. /**
  2345. * @param {Object} override
  2346. * @return {undefined}
  2347. */
  2348. win["setNick"] = function (override) {
  2349. if(win["ga"]) {
  2350. win["ga"]("send", "event", "Nick", override[
  2351. "toLowerCase"]());
  2352. }
  2353. createFile();
  2354. /** @type {Object} */
  2355. id = override;
  2356. func();
  2357. /** @type {number} */
  2358. currentValue = 0;
  2359. setLocalStorage("nick", override);
  2360. myApp["newGame"]();
  2361. };
  2362. /** @type {function (string): undefined} */
  2363. win["setRegion"] = reset;
  2364. /**
  2365. * @param {boolean} el
  2366. * @return {undefined}
  2367. */
  2368. win["setSkins"] = function (el) {
  2369. /** @type {boolean} */
  2370. img = el;
  2371. };
  2372. /**
  2373. * @param {boolean} _$rootScope_
  2374. * @return {undefined}
  2375. */
  2376. win["setNames"] = function (_$rootScope_) {
  2377. /** @type {boolean} */
  2378. $rootScope = _$rootScope_;
  2379. };
  2380. /**
  2381. * @param {string} newColor
  2382. * @return {undefined}
  2383. */
  2384. win["setDarkTheme"] = function (newColor) {
  2385. /** @type {string} */
  2386. color = newColor;
  2387. };
  2388. /**
  2389. * @param {boolean} vec
  2390. * @return {undefined}
  2391. */
  2392. win["setColors"] = function (vec) {
  2393. /** @type {boolean} */
  2394. dest = vec;
  2395. };
  2396. /**
  2397. * @param {boolean} newStatus
  2398. * @return {undefined}
  2399. */
  2400. win["setShowMass"] = function (newStatus) {
  2401. /** @type {boolean} */
  2402. oldStatus = newStatus;
  2403. };
  2404. /**
  2405. * @param {string} d
  2406. * @return {undefined}
  2407. */
  2408. win["connectIP"] = function (d) {
  2409. var scripts = d["trim"]();
  2410. log("#opt_connect_ip")["val"](scripts);
  2411. if(!scripts) {
  2412. if(log("#gamemode option:selected")["val"]() ==
  2413. ":party") {
  2414. createParty();
  2415. return;
  2416. }
  2417. }
  2418. if(scripts["length"] != 0 && scripts["length"] <=
  2419. 6) {
  2420. success(d);
  2421. } else {
  2422. console["log"]("connecting IP = " + d);
  2423. /** @type {string} */
  2424. e = d;
  2425. animate();
  2426. }
  2427. };
  2428. /**
  2429. * @return {?}
  2430. */
  2431. win["getCurrentX"] = function () {
  2432. if(params["length"]) {
  2433. return value;
  2434. }
  2435. return "";
  2436. };
  2437. /**
  2438. * @return {?}
  2439. */
  2440. win["getCurrentY"] = function () {
  2441. if(params["length"]) {
  2442. return old;
  2443. }
  2444. return "";
  2445. };
  2446. /**
  2447. * @return {?}
  2448. */
  2449. win["getTop1X"] = function () {
  2450. return current;
  2451. };
  2452. /**
  2453. * @return {?}
  2454. */
  2455. win["getTop1Y"] = function () {
  2456. return expr;
  2457. };
  2458. /**
  2459. * @return {?}
  2460. */
  2461. win["getLengthX"] = function () {
  2462. return ln;
  2463. };
  2464. /**
  2465. * @return {?}
  2466. */
  2467. win["getLengthY"] = function () {
  2468. return span;
  2469. };
  2470. /**
  2471. * @return {?}
  2472. */
  2473. win["getLB"] = function () {
  2474. return stack;
  2475. };
  2476. /**
  2477. * @return {?}
  2478. */
  2479. win["getSelfIDs"] = function () {
  2480. return p;
  2481. };
  2482. /**
  2483. * @return {?}
  2484. */
  2485. win["getCell"] = function () {
  2486. return params;
  2487. };
  2488. /**
  2489. * @return {?}
  2490. */
  2491. win["getHighestScore"] = function () {
  2492. return currentValue;
  2493. };
  2494. /**
  2495. * @return {undefined}
  2496. */
  2497. win["quickSpace"] = function () {
  2498. if(params["length"] == 0) {
  2499. return;
  2500. }
  2501. toggleClass(17);
  2502. setTimeout(function () {
  2503. toggleClass(17);
  2504. }, 40);
  2505. setTimeout(function () {
  2506. toggleClass(17);
  2507. }, 80);
  2508. setTimeout(function () {
  2509. toggleClass(17);
  2510. }, 120);
  2511. };
  2512. /**
  2513. * @return {undefined}
  2514. */
  2515. win["doubleSpace"] = function () {
  2516. /** @type {number} */
  2517. var bufferTime = 38;
  2518. setTimeout(function () {
  2519. toggleClass(17);
  2520. }, bufferTime);
  2521. setTimeout(function () {
  2522. toggleClass(17);
  2523. }, bufferTime * 2);
  2524. };
  2525. /**
  2526. * @return {?}
  2527. */
  2528. win["getFPS"] = function () {
  2529. return _clockseq;
  2530. };
  2531. /**
  2532. * @return {?}
  2533. */
  2534. win["getPacketIO"] = function () {
  2535. return [type, error];
  2536. };
  2537. /**
  2538. * @return {undefined}
  2539. */
  2540. win["spectate"] = function () {
  2541. /** @type {null} */
  2542. id = null;
  2543. toggleClass(1);
  2544. createFile();
  2545. myApp["spectate"](params);
  2546. };
  2547. /**
  2548. * @param {undefined} error
  2549. * @return {undefined}
  2550. */
  2551. win["setGameMode"] = function (error) {
  2552. if(error != message) {
  2553. if(":party" == message) {
  2554. log("#helloContainer")["attr"](
  2555. "data-party-state", "0");
  2556. }
  2557. fail(error);
  2558. if(":party" != error) {
  2559. animate();
  2560. }
  2561. }
  2562. };
  2563. /**
  2564. * @param {Array} _$timeout_
  2565. * @return {undefined}
  2566. */
  2567. win["setZoomLevel"] = function (_$timeout_) {
  2568. /** @type {Array} */
  2569. $timeout = _$timeout_;
  2570. };
  2571. /**
  2572. * @return {?}
  2573. */
  2574. win["isFreeSpec"] = function () {
  2575. return myApp["isSpectating"] && msg === 0.25;
  2576. };
  2577. /**
  2578. * @param {boolean} textAlt
  2579. * @return {undefined}
  2580. */
  2581. win["setAcid"] = function (textAlt) {
  2582. /** @type {boolean} */
  2583. text = textAlt;
  2584. };
  2585. if(null != win["localStorage"]) {
  2586. if(null == win["localStorage"]["AB9"]) {
  2587. /** @type {number} */
  2588. win["localStorage"]["AB9"] = 0 + ~~(100 * Math[
  2589. "random"]());
  2590. }
  2591. /** @type {number} */
  2592. generalCallback = +win["localStorage"]["AB9"];
  2593. /** @type {number} */
  2594. win["ABGroup"] = generalCallback;
  2595. }
  2596. /** @type {boolean} */
  2597. var _0x3495xcd = true;
  2598. /** @type {number} */
  2599. var _0x3495xce = 0;
  2600. /** @type {null} */
  2601. var handler = null;
  2602. /** @type {function (string, Object): undefined} */
  2603. win["connect"] = next;
  2604. /** @type {number} */
  2605. var backoff = 500;
  2606. /** @type {null} */
  2607. var tref = null;
  2608. /** @type {number} */
  2609. var restoreScript = 0;
  2610. /** @type {number} */
  2611. var n = -1;
  2612. /** @type {number} */
  2613. var h1 = -1;
  2614. /** @type {null} */
  2615. var el = null;
  2616. /** @type {number} */
  2617. var scale = 1;
  2618. /** @type {null} */
  2619. var _0x3495xd7 = null;
  2620. var LOAD = function () {
  2621. var min = Date["now"]();
  2622. /** @type {number} */
  2623. var b = 1E3 / 60;
  2624. /** @type {number} */
  2625. var diff = 0;
  2626. var aux = Date["now"]();
  2627. return function () {
  2628. win["requestAnimationFrame"](LOAD);
  2629. var max = Date["now"]();
  2630. /** @type {number} */
  2631. var a = max - min;
  2632. if(myApp["isShowFPS"]) {
  2633. if(diff > 1E3) {
  2634. aux = max;
  2635. /** @type {number} */
  2636. diff = 0;
  2637. _clockseq = clockseq;
  2638. /** @type {number} */
  2639. clockseq = 0;
  2640. } else {
  2641. /** @type {number} */
  2642. diff = max - aux;
  2643. }
  2644. }
  2645. if(a > b) {
  2646. /** @type {number} */
  2647. min = max - a % b;
  2648. if(!removeClass() || 240 > Date[
  2649. "now"]() - check) {
  2650. setupPrototype();
  2651. } else {
  2652. console["warn"]("Skipping draw");
  2653. }
  2654. traverseNode();
  2655. }
  2656. };
  2657. }();
  2658. var images = {};
  2659. var classNames =
  2660. "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" [
  2661. "split"
  2662. ](";");
  2663. var secs =
  2664. "8;nasa;putin;merkel;tsipras;obama;kim jong-un;dilma;hollande;berlusconi;cameron;clinton;hillary;blatter;chavez;fidel;merkel;palin;queen;boris;bush;trump" [
  2665. "split"
  2666. ](";");
  2667. var imgs = {};
  2668. val["prototype"] = {
  2669. P: null,
  2670. x: 0,
  2671. y: 0,
  2672. g: 0,
  2673. b: 0
  2674. };
  2675. $["prototype"] = {
  2676. id: 0,
  2677. a: null,
  2678. name: null,
  2679. k: null,
  2680. I: null,
  2681. x: 0,
  2682. y: 0,
  2683. size: 0,
  2684. o: 0,
  2685. p: 0,
  2686. n: 0,
  2687. C: 0,
  2688. D: 0,
  2689. m: 0,
  2690. T: 0,
  2691. K: 0,
  2692. W: 0,
  2693. A: false,
  2694. f: false,
  2695. j: false,
  2696. L: true,
  2697. S: 0,
  2698. V: null,
  2699. /**
  2700. * @return {undefined}
  2701. */
  2702. R: function () {
  2703. var i;
  2704. /** @type {number} */
  2705. i = 0;
  2706. for(; i < h["length"]; i++) {
  2707. if(h[i] == this) {
  2708. h["splice"](i, 1);
  2709. break;
  2710. }
  2711. }
  2712. delete result[this["id"]];
  2713. i = params["indexOf"](this);
  2714. if(-1 != i) {
  2715. /** @type {boolean} */
  2716. _0x3495x9c = true;
  2717. params["splice"](i, 1);
  2718. }
  2719. i = p["indexOf"](this["id"]);
  2720. if(-1 != i) {
  2721. p["splice"](i, 1);
  2722. }
  2723. /** @type {boolean} */
  2724. this["A"] = true;
  2725. },
  2726. /**
  2727. * @return {?}
  2728. */
  2729. i: function () {
  2730. return Math["max"](~~(0.3 * this["size"]),
  2731. 24);
  2732. },
  2733. /**
  2734. * @param {Object} path
  2735. * @return {undefined}
  2736. */
  2737. t: function (path) {
  2738. var params = path["match"](
  2739. /\u0001([\u0002-\uffff]|[\u0002-\uffff]\uffff)$/g
  2740. );
  2741. /** @type {number} */
  2742. var result = 0;
  2743. if(params) {
  2744. result = params[0]["split"](
  2745. "\u0001")[1];
  2746. if(result["length"] > 1) {
  2747. this["img"] = result[
  2748. "charCodeAt"](0) +
  2749. 65534;
  2750. }
  2751. if(result["length"] == 1) {
  2752. this["img"] = result[
  2753. "charCodeAt"](0);
  2754. }
  2755. }
  2756. if(this["name"] = path) {
  2757. if(null == this["k"]) {
  2758. this["k"] = new chunk(this["i"]
  2759. (), "#FFFFFF", true,
  2760. "#000000");
  2761. /** @type {number} */
  2762. this["k"]["v"] = Math["ceil"](
  2763. 10 * w) / 10;
  2764. } else {
  2765. this["k"].G(this["i"]());
  2766. }
  2767. this["k"]["u"](this["name"]);
  2768. }
  2769. },
  2770. /**
  2771. * @return {undefined}
  2772. */
  2773. Q: function () {
  2774. var length = this.B();
  2775. for(; this["a"]["length"] > length;) {
  2776. /** @type {number} */
  2777. var a = ~~(Math["random"]() * this[
  2778. "a"]["length"]);
  2779. this["a"]["splice"](a, 1);
  2780. }
  2781. if(0 == this["a"]["length"]) {
  2782. if(0 < length) {
  2783. this["a"]["push"](new val(this,
  2784. this["x"], this["y"],
  2785. this["size"], Math[
  2786. "random"]() -
  2787. 0.5));
  2788. }
  2789. }
  2790. for(; this["a"]["length"] < length;) {
  2791. /** @type {number} */
  2792. a = ~~(Math["random"]() * this["a"]
  2793. ["length"]);
  2794. a = this["a"][a];
  2795. this["a"]["push"](new val(this, a[
  2796. "x"], a["y"], a["g"],
  2797. a["b"]));
  2798. }
  2799. },
  2800. /**
  2801. * @return {?}
  2802. */
  2803. B: function () {
  2804. /** @type {number} */
  2805. var suggestedValue = 10;
  2806. if(20 > this["size"]) {
  2807. /** @type {number} */
  2808. suggestedValue = 0;
  2809. }
  2810. if(this["f"]) {
  2811. /** @type {number} */
  2812. suggestedValue = 30;
  2813. }
  2814. var value = this["size"];
  2815. if(!this["f"]) {
  2816. value *= w;
  2817. }
  2818. value *= scale;
  2819. if(this["T"] & 32) {
  2820. value *= 0.25;
  2821. }
  2822. return ~~Math["max"](value,
  2823. suggestedValue);
  2824. },
  2825. /**
  2826. * @return {undefined}
  2827. */
  2828. da: function () {
  2829. this.Q();
  2830. var f = this["a"];
  2831. var n = f["length"];
  2832. /** @type {number} */
  2833. var i = 0;
  2834. for(; i < n; ++i) {
  2835. var p = f[(i - 1 + n) % n]["b"];
  2836. var c = f[(i + 1) % n]["b"];
  2837. f[i]["b"] += (Math["random"]() -
  2838. 0.5) * (this["j"] ? 3 : 1);
  2839. f[i]["b"] *= 0.7;
  2840. if(10 < f[i]["b"]) {
  2841. /** @type {number} */
  2842. f[i]["b"] = 10;
  2843. }
  2844. if(-10 > f[i]["b"]) {
  2845. /** @type {number} */
  2846. f[i]["b"] = -10;
  2847. }
  2848. /** @type {number} */
  2849. f[i]["b"] = (p + c + 8 * f[i]["b"]) /
  2850. 10;
  2851. }
  2852. var options = this;
  2853. /** @type {number} */
  2854. var difference = this["f"] ? 0 : (this[
  2855. "id"] / 1E3 + max / 1E4) % (2 *
  2856. Math["PI"]);
  2857. /** @type {number} */
  2858. i = 0;
  2859. for(; i < n; ++i) {
  2860. var grp = f[i]["g"];
  2861. p = f[(i - 1 + n) % n]["g"];
  2862. c = f[(i + 1) % n]["g"];
  2863. if(15 < this["size"] && (null != ea &&
  2864. (20 < this["size"] * w && 0 <
  2865. this["id"]))) {
  2866. /** @type {boolean} */
  2867. var _0x3495x47 = false;
  2868. var x = f[i]["x"];
  2869. var y = f[i]["y"];
  2870. ea["ea"](x - 5, y - 5, 10, 10,
  2871. function (o) {
  2872. if(o["P"] !=
  2873. options) {
  2874. if(25 > (x - o[
  2875. "x"
  2876. ]) * (x - o[
  2877. "x"
  2878. ]) + (y - o[
  2879. "y"
  2880. ]) * (y - o[
  2881. "y"
  2882. ])) {
  2883. /** @type {boolean} */
  2884. _0x3495x47 =
  2885. true;
  2886. }
  2887. }
  2888. });
  2889. if(!_0x3495x47) {
  2890. if(f[i]["x"] < count || (f[
  2891. i]["y"] < minY ||
  2892. (f[i]["x"] > idx ||
  2893. f[i]["y"] >
  2894. maxY))) {
  2895. /** @type {boolean} */
  2896. _0x3495x47 = true;
  2897. }
  2898. }
  2899. if(_0x3495x47) {
  2900. if(0 < f[i]["b"]) {
  2901. /** @type {number} */
  2902. f[i]["b"] = 0;
  2903. }
  2904. f[i]["b"] -= 1;
  2905. }
  2906. }
  2907. grp += f[i]["b"];
  2908. if(0 > grp) {
  2909. /** @type {number} */
  2910. grp = 0;
  2911. }
  2912. /** @type {number} */
  2913. grp = this["j"] ? (19 * grp + this[
  2914. "size"]) / 20 : (12 * grp +
  2915. this["size"]) / 13;
  2916. /** @type {number} */
  2917. f[i]["g"] = (p + c + 8 * grp) / 10;
  2918. /** @type {number} */
  2919. p = 2 * Math["PI"] / n;
  2920. c = this["a"][i]["g"];
  2921. if(this["f"]) {
  2922. if(0 == i % 2) {
  2923. c += 5;
  2924. }
  2925. }
  2926. f[i]["x"] = this["x"] + Math["cos"]
  2927. (p * i + difference) * c;
  2928. f[i]["y"] = this["y"] + Math["sin"]
  2929. (p * i + difference) * c;
  2930. }
  2931. },
  2932. /**
  2933. * @return {?}
  2934. */
  2935. J: function () {
  2936. if(0 >= this["id"]) {
  2937. return 1;
  2938. }
  2939. var a;
  2940. /** @type {number} */
  2941. a = (max - this["K"]) / 120;
  2942. /** @type {number} */
  2943. a = 0 > a ? 0 : 1 < a ? 1 : a;
  2944. /** @type {number} */
  2945. var d = 0 > a ? 0 : 1 < a ? 1 : a;
  2946. this["i"]();
  2947. if(this["A"] && 1 <= d) {
  2948. var e = listeners["indexOf"](this);
  2949. if(-1 != e) {
  2950. listeners["splice"](e, 1);
  2951. }
  2952. }
  2953. this["x"] = a * (this["C"] - this["o"]) +
  2954. this["o"];
  2955. this["y"] = a * (this["D"] - this["p"]) +
  2956. this["p"];
  2957. this["size"] = d * (this["m"] - this[
  2958. "n"]) + this["n"];
  2959. return d;
  2960. },
  2961. /**
  2962. * @return {?}
  2963. */
  2964. H: function () {
  2965. return 0 >= this["id"] ? true : this[
  2966. "x"] + this["size"] + 40 <
  2967. value - width / 2 / w || (this["y"] +
  2968. this["size"] + 40 < old -
  2969. height / 2 / w || (this["x"] -
  2970. this["size"] - 40 > value +
  2971. width / 2 / w || this["y"] -
  2972. this["size"] - 40 > old +
  2973. height / 2 / w)) ? false :
  2974. true;
  2975. },
  2976. /**
  2977. * @param {Object} suggest_values
  2978. * @return {undefined}
  2979. */
  2980. s: function (suggest_values) {
  2981. if(this.H()) {
  2982. var program = myApp[
  2983. "isEnableSimpleDrawing"];
  2984. if(this["size"] < 15) {
  2985. if(!myApp["isEnableHideFood"]) {
  2986. if(myApp["isSameColorFood"]) {
  2987. resultItems["push"]({
  2988. x: this["x"],
  2989. y: this["y"],
  2990. size: this[
  2991. "size"
  2992. ]
  2993. });
  2994. return;
  2995. }
  2996. suggest_values["beginPath"]
  2997. ();
  2998. suggest_values["fillStyle"] =
  2999. this["color"];
  3000. suggest_values["arc"](this[
  3001. "x"], this["y"],
  3002. this["size"] + 5, 0,
  3003. 2 * Math["PI"],
  3004. false);
  3005. suggest_values["fill"]();
  3006. }
  3007. return;
  3008. }
  3009. ++this["S"];
  3010. /** @type {boolean} */
  3011. var inverse = 0 < this["id"] && (!
  3012. this["f"] && (!this["j"] &&
  3013. 0.4 > w));
  3014. if(5 > this.B()) {
  3015. if(0 < this["id"]) {
  3016. /** @type {boolean} */
  3017. inverse = true;
  3018. }
  3019. }
  3020. if(this["L"] && !inverse) {
  3021. /** @type {number} */
  3022. var i = 0;
  3023. for(; i < this["a"]["length"]; i++) {
  3024. this["a"][i]["g"] = this[
  3025. "size"];
  3026. }
  3027. }
  3028. /** @type {boolean} */
  3029. this["L"] = inverse;
  3030. suggest_values["save"]();
  3031. this["W"] = max;
  3032. i = this.J();
  3033. if(this["A"]) {
  3034. suggest_values["globalAlpha"] *=
  3035. 1 - i;
  3036. }
  3037. /** @type {number} */
  3038. suggest_values["lineWidth"] = 10;
  3039. /** @type {string} */
  3040. suggest_values["lineCap"] = "round";
  3041. /** @type {string} */
  3042. suggest_values["lineJoin"] = this[
  3043. "f"] ? "miter" : "round";
  3044. /** @type {boolean} */
  3045. var _0x3495xe2 = !this["f"] && (
  3046. this["id"] > 0 && (this[
  3047. "size"] >= 15 && !
  3048. this["j"])) ? true :
  3049. false;
  3050. /** @type {boolean} */
  3051. var isHideSelfName = false;
  3052. /** @type {boolean} */
  3053. var _0x3495xe4 = false;
  3054. /** @type {number} */
  3055. var b = 0;
  3056. /** @type {null} */
  3057. var settings = null;
  3058. if(_0x3495xe2) {
  3059. if(myApp["isTransparentCell"]) {
  3060. /** @type {number} */
  3061. suggest_values[
  3062. "globalAlpha"] =
  3063. 0.8;
  3064. }
  3065. /** @type {number} */
  3066. var sp = 0;
  3067. for(; sp < p["length"]; sp++) {
  3068. if(this["id"] === p[sp]) {
  3069. /** @type {boolean} */
  3070. isHideSelfName = true;
  3071. }
  3072. }
  3073. if(isHideSelfName) {
  3074. if(myApp["cellColor"] != "") {
  3075. this["color"] = myApp[
  3076. "cellColor"];
  3077. }
  3078. if(myApp[
  3079. "isEnableAttackRange"
  3080. ]) {
  3081. suggest_values[
  3082. "beginPath"]();
  3083. /** @type {string} */
  3084. suggest_values[
  3085. "strokeStyle"] =
  3086. color ? "white" :
  3087. "black";
  3088. suggest_values["arc"](
  3089. this["x"], this[
  3090. "y"], this[
  3091. "size"] +
  3092. myApp[
  3093. "attackRangeRadius"
  3094. ], 0, 2 * Math[
  3095. "PI"],
  3096. false);
  3097. suggest_values["stroke"]
  3098. ();
  3099. suggest_values[
  3100. "closePath"]();
  3101. }
  3102. if(myApp[
  3103. "isEnableCustomSkin"
  3104. ]) {
  3105. settings = myApp[
  3106. "getSkinImage"]
  3107. (nodeList[0][5]);
  3108. }
  3109. } else {
  3110. if(_0x3495xe4) {
  3111. if(myApp[
  3112. "isEnableTeammateIndicator"
  3113. ] && this["size"] <
  3114. myApp[
  3115. "teammateIndicatorShowSize"
  3116. ]) {
  3117. suggest_values[
  3118. "drawImage"
  3119. ](myApp[
  3120. "teammateIndicator"
  3121. ], ~~(this[
  3122. "x"
  3123. ] - 50), ~~
  3124. (this["y"] -
  3125. this[
  3126. "size"
  3127. ] - 100
  3128. ));
  3129. }
  3130. if(myApp[
  3131. "isEnableCustomSkin"
  3132. ]) {
  3133. if(nodeList[b]) {
  3134. settings =
  3135. myApp[
  3136. "getSkinImage"
  3137. ](nodeList[
  3138. b][
  3139. 5
  3140. ]);
  3141. }
  3142. }
  3143. } else {}
  3144. }
  3145. }
  3146. if(dest) {
  3147. /** @type {string} */
  3148. suggest_values["fillStyle"] =
  3149. "#FFFFFF";
  3150. /** @type {string} */
  3151. suggest_values["strokeStyle"] =
  3152. "#AAAAAA";
  3153. } else {
  3154. suggest_values["fillStyle"] =
  3155. this["color"];
  3156. suggest_values["strokeStyle"] =
  3157. this["color"];
  3158. }
  3159. if(program && this["f"]) {
  3160. /** @type {string} */
  3161. suggest_values["fillStyle"] =
  3162. "#6e6e6e";
  3163. /** @type {number} */
  3164. suggest_values["globalAlpha"] =
  3165. 0.8;
  3166. /** @type {number} */
  3167. suggest_values["lineWidth"] =
  3168. 10;
  3169. /** @type {string} */
  3170. suggest_values["strokeStyle"] =
  3171. "#FFFFFF";
  3172. }
  3173. if(program || inverse) {
  3174. suggest_values["beginPath"]();
  3175. suggest_values["arc"](this["x"],
  3176. this["y"], this["size"] +
  3177. 5, 0, 2 * Math["PI"],
  3178. false);
  3179. if(myApp["isEnableSplitInd"] &&
  3180. (_0x3495xe2 && (!
  3181. isHideSelfName && (!
  3182. _0x3495xe4 && (
  3183. this["name"] ||
  3184. this["size"] >
  3185. 38))))) {
  3186. data["push"]({
  3187. x: this["x"],
  3188. y: this["y"],
  3189. size: this[
  3190. "size"]
  3191. });
  3192. }
  3193. } else {
  3194. this["da"]();
  3195. suggest_values["beginPath"]();
  3196. var index = this.B();
  3197. suggest_values["moveTo"](this[
  3198. "a"][0]["x"], this[
  3199. "a"][0]["y"]);
  3200. /** @type {number} */
  3201. i = 1;
  3202. for(; i <= index; ++i) {
  3203. /** @type {number} */
  3204. var j = i % index;
  3205. suggest_values["lineTo"](
  3206. this["a"][j]["x"],
  3207. this["a"][j]["y"]);
  3208. }
  3209. }
  3210. suggest_values["closePath"]();
  3211. i = this["name"]["toLowerCase"]();
  3212. var dst = this["img"] ?
  3213. "http://upload.happyfor.me/getimg.php?id=" +
  3214. this["img"] + "&_t=" + Math[
  3215. "random"]() : "skins/" + i +
  3216. ".png";
  3217. if(!settings && (!this["j"] && ((
  3218. img || myApp[
  3219. "isEnableOtherSkinSupport"
  3220. ]) && ":teams" !=
  3221. message))) {
  3222. index = this["V"];
  3223. if(null == index) {
  3224. /** @type {null} */
  3225. index = null;
  3226. } else {
  3227. if(":" == index[0]) {
  3228. if(!imgs[
  3229. "hasOwnProperty"
  3230. ](index)) {
  3231. /** @type {Image} */
  3232. imgs[index] = new Image;
  3233. imgs[index]["src"] =
  3234. index["slice"](
  3235. 1);
  3236. }
  3237. index = 0 != imgs[index]
  3238. ["width"] && imgs[
  3239. index][
  3240. "complete"
  3241. ] ? imgs[index] :
  3242. null;
  3243. } else {
  3244. /** @type {null} */
  3245. index = null;
  3246. }
  3247. }
  3248. if(!index) {
  3249. if(-1 != classNames[
  3250. "indexOf"](i) &&
  3251. img || this["img"]) {
  3252. if(!images[
  3253. "hasOwnProperty"
  3254. ](i)) {
  3255. /** @type {Image} */
  3256. images[i] = new Image;
  3257. images[i]["src"] =
  3258. dst;
  3259. }
  3260. index = 0 != images[i][
  3261. "width"
  3262. ] && images[i][
  3263. "complete"
  3264. ] ? images[i] :
  3265. null;
  3266. } else {
  3267. /** @type {null} */
  3268. index = null;
  3269. }
  3270. }
  3271. } else {
  3272. /** @type {null} */
  3273. index = null;
  3274. }
  3275. j = index;
  3276. if(!inverse) {
  3277. if(!!(program && this["f"])) {
  3278. suggest_values["stroke"]();
  3279. }
  3280. }
  3281. suggest_values["fill"]();
  3282. if(myApp["isEnableCustomSkin"]) {
  3283. if(settings && (settings[
  3284. "width"] &&
  3285. settings["complete"])) {
  3286. j = settings;
  3287. }
  3288. }
  3289. if(null != j) {
  3290. suggest_values["save"]();
  3291. suggest_values["clip"]();
  3292. suggest_values["drawImage"](j, ~
  3293. ~(this["x"] - this[
  3294. "size"]), ~~(this[
  3295. "y"] - this[
  3296. "size"]), ~~(2 *
  3297. this["size"]), ~~(2 *
  3298. this["size"]));
  3299. suggest_values["restore"]();
  3300. }
  3301. if(!program) {
  3302. if(dest || 15 < this["size"]) {
  3303. if(!inverse) {
  3304. /** @type {string} */
  3305. suggest_values[
  3306. "strokeStyle"] =
  3307. "#000000";
  3308. suggest_values[
  3309. "globalAlpha"] *=
  3310. 0.1;
  3311. suggest_values["stroke"]
  3312. ();
  3313. }
  3314. }
  3315. /** @type {number} */
  3316. suggest_values["globalAlpha"] =
  3317. 1;
  3318. }
  3319. /** @type {boolean} */
  3320. index = -1 != params["indexOf"](
  3321. this);
  3322. /** @type {number} */
  3323. inverse = ~~this["y"];
  3324. var _0x3495xe8 = this["f"] || (this[
  3325. "size"] > 315 || this[
  3326. "size"] * w > 18);
  3327. if(!(isHideSelfName && myApp[
  3328. "isHideSelfName"]) && ((!
  3329. myApp["isAutoHideName"] ||
  3330. _0x3495xe8) && (0 !=
  3331. this["id"] && ((
  3332. $rootScope ||
  3333. index) && (this[
  3334. "name"] &&
  3335. (this["k"] && (
  3336. null ==
  3337. j || -1 ==
  3338. secs[
  3339. "indexOf"
  3340. ](i)))))))) {
  3341. j = this["k"];
  3342. j["u"](this["name"]);
  3343. j.G(this["i"]() / 0.9);
  3344. /** @type {number} */
  3345. i = 0 >= this["id"] ? 1 : Math[
  3346. "ceil"](10 * w) / 10;
  3347. j.U(i);
  3348. j = j.F();
  3349. /** @type {number} */
  3350. var r20 = ~~(j["width"] / i);
  3351. /** @type {number} */
  3352. var restoreScript = ~~(j[
  3353. "height"] / i);
  3354. suggest_values["drawImage"](j, ~
  3355. ~this["x"] - ~~(r20 / 2),
  3356. inverse - ~~(
  3357. restoreScript / 2),
  3358. r20, restoreScript);
  3359. inverse += j["height"] / 2 / i +
  3360. 4;
  3361. }
  3362. if((!myApp["isAutoHideMass"] ||
  3363. _0x3495xe8) && myApp[
  3364. "isEnableShowAllMass"]) {
  3365. if(0 < this["id"]) {
  3366. if(oldStatus) {
  3367. if(38 < this["size"]) {
  3368. if(null == this["I"]) {
  3369. this["I"] = new chunk(
  3370. this[
  3371. "i"
  3372. ]() / 2,
  3373. "#FFFFFF",
  3374. true,
  3375. "#000000"
  3376. );
  3377. }
  3378. index = this["I"];
  3379. index.G(this["i"]() /
  3380. 0.8);
  3381. index["u"](~~(this[
  3382. "size"
  3383. ] *
  3384. this[
  3385. "size"
  3386. ] / 100
  3387. ));
  3388. /** @type {number} */
  3389. i = Math["ceil"](10 *
  3390. w) / 10;
  3391. index.U(i);
  3392. j = index.F();
  3393. /** @type {number} */
  3394. r20 = ~~(j["width"] /
  3395. i);
  3396. /** @type {number} */
  3397. restoreScript = ~~(
  3398. j["height"] /
  3399. i);
  3400. suggest_values[
  3401. "drawImage"
  3402. ](j, ~~this["x"] -
  3403. ~~(r20 / 2),
  3404. inverse - ~
  3405. ~(
  3406. restoreScript /
  3407. 2), r20,
  3408. restoreScript
  3409. );
  3410. }
  3411. }
  3412. }
  3413. }
  3414. suggest_values["restore"]();
  3415. }
  3416. }
  3417. };
  3418. chunk["prototype"] = {
  3419. w: "",
  3420. M: "#000000",
  3421. O: false,
  3422. r: "#000000",
  3423. q: 16,
  3424. l: null,
  3425. N: null,
  3426. h: false,
  3427. v: 1,
  3428. /**
  3429. * @param {number} q
  3430. * @return {undefined}
  3431. */
  3432. G: function (q) {
  3433. if(Math["abs"](q - this["q"]) > 5) {
  3434. if(this["q"] != q) {
  3435. /** @type {number} */
  3436. this["q"] = q;
  3437. /** @type {boolean} */
  3438. this["h"] = true;
  3439. }
  3440. }
  3441. },
  3442. /**
  3443. * @param {number} d
  3444. * @return {undefined}
  3445. */
  3446. U: function (d) {
  3447. if(this["v"] != d) {
  3448. /** @type {number} */
  3449. this["v"] = d;
  3450. /** @type {boolean} */
  3451. this["h"] = true;
  3452. }
  3453. },
  3454. /**
  3455. * @param {?} r
  3456. * @return {undefined}
  3457. */
  3458. setStrokeColor: function (r) {
  3459. if(this["r"] != r) {
  3460. this["r"] = r;
  3461. /** @type {boolean} */
  3462. this["h"] = true;
  3463. }
  3464. },
  3465. /**
  3466. * @param {number} w
  3467. * @return {undefined}
  3468. */
  3469. u: function (w) {
  3470. var color;
  3471. if(!isNaN(w) && (!isNaN(this["w"]) && (
  3472. this["w"] != 0 && (w != 0 &&
  3473. this["w"] != w)))) {
  3474. if(Math["abs"]((w - this["w"]) /
  3475. this["w"]) < 0.008) {
  3476. color = this["w"];
  3477. /** @type {number} */
  3478. this["w"] = w;
  3479. }
  3480. }
  3481. if(w != this["w"]) {
  3482. /** @type {number} */
  3483. this["w"] = w;
  3484. /** @type {boolean} */
  3485. this["h"] = true;
  3486. }
  3487. if(color) {
  3488. this["w"] = color;
  3489. }
  3490. },
  3491. /**
  3492. * @return {?}
  3493. */
  3494. F: function () {
  3495. if(null == this["l"]) {
  3496. this["l"] = document[
  3497. "createElement"]("canvas");
  3498. this["N"] = this["l"]["getContext"]
  3499. ("2d");
  3500. }
  3501. if(this["h"]) {
  3502. /** @type {boolean} */
  3503. this["h"] = false;
  3504. var param = this["l"];
  3505. var HEIGHT_CACHE = this["N"];
  3506. var slotIndex = this["w"];
  3507. var k = this["v"];
  3508. var x = this["q"];
  3509. /** @type {string} */
  3510. var result = "bold " + x +
  3511. "px Ubuntu";
  3512. /** @type {string} */
  3513. HEIGHT_CACHE["font"] = result;
  3514. /** @type {number} */
  3515. var w = ~~(0.2 * x);
  3516. /** @type {number} */
  3517. param["width"] = (HEIGHT_CACHE[
  3518. "measureText"](
  3519. slotIndex)["width"] + 6) *
  3520. k;
  3521. /** @type {number} */
  3522. param["height"] = (x + w) * k;
  3523. /** @type {string} */
  3524. HEIGHT_CACHE["font"] = result;
  3525. HEIGHT_CACHE["scale"](k, k);
  3526. /** @type {number} */
  3527. HEIGHT_CACHE["globalAlpha"] = 1;
  3528. HEIGHT_CACHE["fillStyle"] = this[
  3529. "M"];
  3530. if(myApp["isShowTextStrokeLine"]) {
  3531. /** @type {number} */
  3532. HEIGHT_CACHE["lineWidth"] = 5;
  3533. HEIGHT_CACHE["strokeStyle"] =
  3534. this["r"];
  3535. if(this["O"]) {
  3536. HEIGHT_CACHE["strokeText"](
  3537. slotIndex, 3, x - w /
  3538. 2);
  3539. }
  3540. }
  3541. HEIGHT_CACHE["fillText"](slotIndex,
  3542. 3, x - w / 2);
  3543. }
  3544. return this["l"];
  3545. }
  3546. };
  3547. if(!Date["now"]) {
  3548. /**
  3549. * @return {?}
  3550. */
  3551. Date["now"] = function () {
  3552. return(new Date)["getTime"]();
  3553. };
  3554. }
  3555. (function () {
  3556. /** @type {Array} */
  3557. var a = ["ms", "moz", "webkit", "o"];
  3558. /** @type {number} */
  3559. var x = 0;
  3560. for(; x < a["length"] && !win[
  3561. "requestAnimationFrame"]; ++x) {
  3562. win["requestAnimationFrame"] = win[a[x] +
  3563. "RequestAnimationFrame"];
  3564. win["cancelAnimationFrame"] = win[a[x] +
  3565. "CancelAnimationFrame"] || win[a[x] +
  3566. "CancelRequestAnimationFrame"];
  3567. }
  3568. if(!win["requestAnimationFrame"]) {
  3569. /**
  3570. * @param {?} fnc
  3571. * @return {?}
  3572. */
  3573. win["requestAnimationFrame"] = function (
  3574. fnc) {
  3575. return setTimeout(fnc, 1E3 / 60);
  3576. };
  3577. /**
  3578. * @param {?} to
  3579. * @return {undefined}
  3580. */
  3581. win["cancelAnimationFrame"] = function (to) {
  3582. clearTimeout(to);
  3583. };
  3584. }
  3585. })();
  3586. var AXIS_INDEX = {
  3587. /**
  3588. * @param {Object} sorted
  3589. * @return {?}
  3590. */
  3591. X: function (sorted) {
  3592. /**
  3593. * @param {?} value
  3594. * @return {?}
  3595. */
  3596. function parseFloat(value) {
  3597. if(value < min) {
  3598. value = min;
  3599. }
  3600. if(value > max) {
  3601. value = max;
  3602. }
  3603. return ~~((value - min) / 32);
  3604. }
  3605. /**
  3606. * @param {?} g
  3607. * @return {?}
  3608. */
  3609. function callback(g) {
  3610. if(g < b) {
  3611. g = b;
  3612. }
  3613. if(g > a) {
  3614. g = a;
  3615. }
  3616. return ~~((g - b) / 32);
  3617. }
  3618. var min = sorted["ba"];
  3619. var b = sorted["ca"];
  3620. var max = sorted["Z"];
  3621. var a = sorted["$"];
  3622. /** @type {number} */
  3623. var length = ~~((max - min) / 32) + 1;
  3624. /** @type {number} */
  3625. var klength = ~~((a - b) / 32) + 1;
  3626. /** @type {Array} */
  3627. var result = Array(length * klength);
  3628. return {
  3629. /**
  3630. * @param {Object} val
  3631. * @return {undefined}
  3632. */
  3633. Y: function (val) {
  3634. var key = parseFloat(val[
  3635. "x"]) + callback(
  3636. val["y"]) * length;
  3637. if(null == result[key]) {
  3638. /** @type {Object} */
  3639. result[key] = val;
  3640. } else {
  3641. if(Array["isArray"](
  3642. result[key])) {
  3643. result[key]["push"]
  3644. (val);
  3645. } else {
  3646. /** @type {Array} */
  3647. result[key] = [
  3648. result[key],
  3649. val
  3650. ];
  3651. }
  3652. }
  3653. },
  3654. /**
  3655. * @param {number} value
  3656. * @param {number} d
  3657. * @param {Object} data
  3658. * @param {number} i
  3659. * @param {?} ok
  3660. * @return {undefined}
  3661. */
  3662. ea: function (value, d, data, i, ok) {
  3663. var offset = parseFloat(
  3664. value);
  3665. var position = callback(d);
  3666. value = parseFloat(value +
  3667. data);
  3668. d = callback(d + i);
  3669. if(0 > offset || (offset >=
  3670. length || (0 >
  3671. position ||
  3672. position >=
  3673. klength))) {
  3674. debugger;
  3675. }
  3676. for(; position <= d; ++
  3677. position) {
  3678. i = offset;
  3679. for(; i <= value; ++i) {
  3680. if(data = result[i +
  3681. position *
  3682. length],
  3683. null != data) {
  3684. if(Array[
  3685. "isArray"
  3686. ](data)) {
  3687. /** @type {number} */
  3688. var color =
  3689. 0;
  3690. for(; color <
  3691. data[
  3692. "length"
  3693. ]; color++
  3694. ) {
  3695. ok(data[
  3696. color
  3697. ]);
  3698. }
  3699. } else {
  3700. ok(data);
  3701. }
  3702. }
  3703. }
  3704. }
  3705. }
  3706. };
  3707. }
  3708. };
  3709. var templateFunc = function () {
  3710. var styles = new $(0, 0, 0, 32, "#ED1C24", "");
  3711. var json = document["createElement"]("canvas");
  3712. /** @type {number} */
  3713. json["width"] = 32;
  3714. /** @type {number} */
  3715. json["height"] = 32;
  3716. var options = json["getContext"]("2d");
  3717. return function () {
  3718. if(0 < params["length"]) {
  3719. styles["color"] = params[0]["color"];
  3720. styles["t"](params[0]["name"]);
  3721. }
  3722. options["clearRect"](0, 0, 32, 32);
  3723. options["save"]();
  3724. options["translate"](16, 16);
  3725. options["scale"](0.4, 0.4);
  3726. styles["s"](options);
  3727. options["restore"]();
  3728. var favicon = document["getElementById"]
  3729. ("favicon");
  3730. var r20 = favicon["cloneNode"](true);
  3731. favicon["parentNode"]["replaceChild"](
  3732. r20, favicon);
  3733. };
  3734. }();
  3735. log(function () {
  3736. templateFunc();
  3737. });
  3738. /** @type {string} */
  3739. var i = "loginCache3";
  3740. log(function () {
  3741. if(+win["localStorage"]["wannaLogin"]) {
  3742. if(win["localStorage"][i]) {
  3743. parse(win["localStorage"][i]);
  3744. }
  3745. if(win["localStorage"]["fbPictureCache"]) {
  3746. log(".agario-profile-picture")[
  3747. "attr"]("src", win[
  3748. "localStorage"][
  3749. "fbPictureCache"
  3750. ]);
  3751. }
  3752. }
  3753. });
  3754. /**
  3755. * @return {undefined}
  3756. */
  3757. win["facebookLogin"] = function () {
  3758. /** @type {number} */
  3759. win["localStorage"]["wannaLogin"] = 1;
  3760. };
  3761. /**
  3762. * @return {undefined}
  3763. */
  3764. win["fbAsyncInit"] = function () {
  3765. /**
  3766. * @return {undefined}
  3767. */
  3768. function init() {
  3769. /** @type {number} */
  3770. win["localStorage"]["wannaLogin"] = 1;
  3771. if(null == win["FB"]) {
  3772. alert(
  3773. "You seem to have something blocking Facebook on your browser, please check for any extensions"
  3774. );
  3775. } else {
  3776. win["FB"]["login"](function (batches) {
  3777. run(batches);
  3778. }, {
  3779. scope: "public_profile, email"
  3780. });
  3781. }
  3782. }
  3783. win["FB"]["init"]({
  3784. appId: "677505792353827",
  3785. cookie: true,
  3786. xfbml: true,
  3787. status: true,
  3788. version: "v2.2"
  3789. });
  3790. win["FB"]["Event"]["subscribe"](
  3791. "auth.statusChange",
  3792. function (batches) {
  3793. if(+win["localStorage"][
  3794. "wannaLogin"
  3795. ]) {
  3796. if("connected" == batches[
  3797. "status"]) {
  3798. run(batches);
  3799. } else {
  3800. init();
  3801. }
  3802. }
  3803. });
  3804. /** @type {function (): undefined} */
  3805. win["facebookLogin"] = init;
  3806. };
  3807. /**
  3808. * @return {undefined}
  3809. */
  3810. win["logout"] = function () {
  3811. /** @type {null} */
  3812. node = null;
  3813. log("#helloContainer")["attr"]("data-logged-in",
  3814. "0");
  3815. log("#helloContainer")["attr"](
  3816. "data-has-account-data", "0");
  3817. delete win["localStorage"]["wannaLogin"];
  3818. delete win["localStorage"][i];
  3819. delete win["localStorage"]["fbPictureCache"];
  3820. animate();
  3821. };
  3822. var traverseNode = function () {
  3823. /**
  3824. * @param {Object} options
  3825. * @param {Object} args
  3826. * @param {string} path
  3827. * @param {number} position
  3828. * @param {string} name
  3829. * @return {undefined}
  3830. */
  3831. function init(options, args, path, position,
  3832. name) {
  3833. var value = args["getContext"]("2d");
  3834. var pageY = args["width"];
  3835. args = args["height"];
  3836. /** @type {string} */
  3837. options["color"] = name;
  3838. options["t"](path);
  3839. /** @type {number} */
  3840. options["size"] = position;
  3841. value["save"]();
  3842. value["translate"](pageY / 2, args / 2);
  3843. options["s"](value);
  3844. value["restore"]();
  3845. }
  3846. var EventEmitter = new $(-1, 0, 0, 32,
  3847. "#5bc0de", "");
  3848. var memory = new $(-1, 0, 0, 32, "#5bc0de", "");
  3849. var stack =
  3850. "#0791ff #5a07ff #ff07fe #ffa507 #ff0774 #077fff #3aff07 #ff07ed #07a8ff #ff076e #3fff07 #ff0734 #07ff20 #ff07a2 #ff8207 #07ff0e" [
  3851. "split"
  3852. ](" ");
  3853. /** @type {Array} */
  3854. var obj = [];
  3855. /** @type {number} */
  3856. var i = 0;
  3857. for(; i < stack["length"]; ++i) {
  3858. /** @type {number} */
  3859. var y = i / stack["length"] * 12;
  3860. /** @type {number} */
  3861. var _width = 30 * Math["sqrt"](i / stack[
  3862. "length"]);
  3863. obj["push"](new $(-1, Math["cos"](y) *
  3864. _width, Math["sin"](y) * _width,
  3865. 10, stack[i], ""));
  3866. }
  3867. isArraylike(obj);
  3868. var json = document["createElement"]("canvas");
  3869. json["getContext"]("2d");
  3870. /** @type {number} */
  3871. json["width"] = json["height"] = 70;
  3872. init(memory, json, "", 26, "#ebc0de");
  3873. return function () {
  3874. log(".cell-spinner")["filter"](
  3875. ":visible")["each"](function () {
  3876. var base = log(this);
  3877. var x = Date["now"]();
  3878. var dw = this["width"];
  3879. var dh = this["height"];
  3880. var source = this[
  3881. "getContext"]("2d");
  3882. source["clearRect"](0, 0,
  3883. dw, dh);
  3884. source["save"]();
  3885. source["translate"](dw / 2,
  3886. dh / 2);
  3887. /** @type {number} */
  3888. var y = 0;
  3889. for(; 10 > y; ++y) {
  3890. source["drawImage"](
  3891. json, (0.1 * x +
  3892. 80 * y) % (
  3893. dw + 140) -
  3894. dw / 2 - 70 -
  3895. 35, dh / 2 *
  3896. Math["sin"]((
  3897. 0.001 *
  3898. x + y) %
  3899. Math["PI"] *
  3900. 2) - 35, 70,
  3901. 70);
  3902. }
  3903. source["restore"]();
  3904. if(base = base["attr"](
  3905. "data-itr")) {
  3906. base = require(base);
  3907. }
  3908. init(EventEmitter, this,
  3909. base || "", +log(
  3910. this)["attr"](
  3911. "data-size"),
  3912. "#5bc0de");
  3913. });
  3914. log("#statsPellets")["filter"](
  3915. ":visible")["each"](function () {
  3916. log(this);
  3917. var i = this["width"];
  3918. var dh = this["height"];
  3919. this["getContext"]("2d")[
  3920. "clearRect"](0, 0,
  3921. i, dh);
  3922. /** @type {number} */
  3923. i = 0;
  3924. for(; i < obj["length"]; i++) {
  3925. init(obj[i], this, "",
  3926. obj[i]["size"],
  3927. obj[i]["color"]
  3928. );
  3929. }
  3930. });
  3931. };
  3932. }();
  3933. /**
  3934. * @return {undefined}
  3935. */
  3936. win["createParty"] = function () {
  3937. fail(":party");
  3938. /**
  3939. * @param {Object} v
  3940. * @return {undefined}
  3941. */
  3942. handler = function (v) {
  3943. callback("/#" + win[
  3944. "encodeURIComponent"](v));
  3945. log(".partyToken")["val"]("agar.io/#" +
  3946. win["encodeURIComponent"](v));
  3947. log("#helloContainer")["attr"](
  3948. "data-party-state", "1");
  3949. };
  3950. animate();
  3951. };
  3952. /** @type {function (Object): undefined} */
  3953. win["joinParty"] = success;
  3954. /**
  3955. * @return {undefined}
  3956. */
  3957. win["cancelParty"] = function () {
  3958. callback("/");
  3959. log("#helloContainer")["attr"](
  3960. "data-party-state", "0");
  3961. fail("");
  3962. animate();
  3963. };
  3964. /** @type {Array} */
  3965. var b = [];
  3966. /** @type {number} */
  3967. var rreturn = 0;
  3968. /** @type {string} */
  3969. var trans = "#000000";
  3970. /** @type {boolean} */
  3971. var from = false;
  3972. /** @type {boolean} */
  3973. var _0x3495xf1 = false;
  3974. /** @type {number} */
  3975. var left = 0;
  3976. /** @type {number} */
  3977. var right = 0;
  3978. /** @type {number} */
  3979. var funcs = 0;
  3980. /** @type {number} */
  3981. var r20 = 0;
  3982. /** @type {number} */
  3983. var v = 0;
  3984. /** @type {boolean} */
  3985. var connected = true;
  3986. setInterval(function () {
  3987. if(_0x3495xf1) {
  3988. b["push"](format() / 100);
  3989. }
  3990. }, 1E3 / 60);
  3991. setInterval(function () {
  3992. var k = tryIt();
  3993. if(0 != k) {
  3994. ++funcs;
  3995. if(0 == v) {
  3996. v = k;
  3997. }
  3998. v = Math["min"](v, k);
  3999. }
  4000. }, 1E3);
  4001. /**
  4002. * @return {undefined}
  4003. */
  4004. win["closeStats"] = function () {
  4005. /** @type {boolean} */
  4006. from = false;
  4007. log("#stats")["hide"]();
  4008. show(0);
  4009. };
  4010. /**
  4011. * @param {?} err
  4012. * @return {undefined}
  4013. */
  4014. win["setSkipStats"] = function (err) {
  4015. /** @type {boolean} */
  4016. connected = !err;
  4017. };
  4018. log(function () {
  4019. log(init);
  4020. });
  4021. }
  4022. }
  4023. }
  4024. }
  4025. })(window, window["jQuery"]);
  4026. myApp["afterGameLogicLoaded"]();
  4027. /**
  4028. * @return {undefined}
  4029. */
  4030. function MyApp() {
  4031. /**
  4032. * @return {?}
  4033. */
  4034. function handlePresence() {
  4035. $("#nick")["val"](myApp["getName"]());
  4036. if(nodeList[0][1] == myApp["getName"]()) {
  4037. return false;
  4038. }
  4039. nodeList[0][1] = myApp["getName"]();
  4040. setLocalStorage("nick", $("#nick")["val"]());
  4041. player_profile[selected_profile]["name"] = myApp["getName"]();
  4042. attr();
  4043. return true;
  4044. }
  4045. /**
  4046. * @return {?}
  4047. */
  4048. function setAttribute() {
  4049. var r20 = myApp["getTeamName"]();
  4050. $("#team_name")["val"](r20);
  4051. if(tmpTeamname == r20) {
  4052. return false;
  4053. }
  4054. setLocalStorage("opt_teamname", r20);
  4055. player_profile[selected_profile]["team"] = r20;
  4056. attr();
  4057. /** @type {boolean} */
  4058. isJoinedGame = false;
  4059. return true;
  4060. }
  4061. /**
  4062. * @return {undefined}
  4063. */
  4064. function createInput() {
  4065. setLocalStorage("selected_profile", selected_profile);
  4066. tmpTeamname = myApp["getTeamName"]();
  4067. $("#nick")["val"](player_profile[selected_profile]["name"]);
  4068. $("#team_name")["val"](player_profile[selected_profile]["team"]);
  4069. $("#skin_url")["val"](player_profile[selected_profile]["skinurl"])[
  4070. "trigger"]("change");
  4071. if(!setAttribute()) {
  4072. handlePresence();
  4073. } else {
  4074. nodeList[0][1] = myApp["getName"]();
  4075. setLocalStorage("nick", myApp["getName"]());
  4076. }
  4077. }
  4078. /**
  4079. * @return {undefined}
  4080. */
  4081. function attr() {
  4082. setLocalStorage("player_profile", player_profile);
  4083. }
  4084. /** @type {string} */
  4085. this["version"] = "v3.1.2p";
  4086. /** @type {number} */
  4087. var r20 = 0.97;
  4088. /** @type {number} */
  4089. var _0x3495xfa = 0.05;
  4090. /**
  4091. * @return {?}
  4092. */
  4093. this["getZoomSpeed"] = function () {
  4094. return r20;
  4095. };
  4096. /**
  4097. * @return {?}
  4098. */
  4099. this["getZoomLimit"] = function () {
  4100. return _0x3495xfa;
  4101. };
  4102. /** @type {boolean} */
  4103. this["isShowScroll"] = false;
  4104. /** @type {boolean} */
  4105. this["isShowSTE"] = false;
  4106. /** @type {boolean} */
  4107. this["isShowBallTotal"] = false;
  4108. /** @type {boolean} */
  4109. var error = false;
  4110. /** @type {boolean} */
  4111. this["isStopMovement"] = false;
  4112. /** @type {boolean} */
  4113. this["isEnableZoom"] = false;
  4114. /** @type {boolean} */
  4115. this["isEnableBorder"] = false;
  4116. /** @type {boolean} */
  4117. this["isEnableGridline"] = false;
  4118. /** @type {boolean} */
  4119. this["isEnableHideFood"] = false;
  4120. /** @type {boolean} */
  4121. this["isEnableShowAllMass"] = true;
  4122. /** @type {boolean} */
  4123. this["isEnableSimpleDrawing"] = false;
  4124. /** @type {boolean} */
  4125. this["isEnableAutoStart"] = true;
  4126. /** @type {boolean} */
  4127. this["isEnableMouseW"] = false;
  4128. /** @type {boolean} */
  4129. this["isEnableCustomSkin"] = false;
  4130. /** @type {boolean} */
  4131. this["isEnableLockZoom"] = true;
  4132. /** @type {boolean} */
  4133. this["isEnableAttackRange"] = false;
  4134. /** @type {boolean} */
  4135. this["isEnableTeammateIndicator"] = true;
  4136. /** @type {boolean} */
  4137. this["isEnableChatpopup"] = false;
  4138. /** @type {number} */
  4139. this["attackRangeRadius"] = 655;
  4140. /** @type {string} */
  4141. this["cellColor"] = "";
  4142. /** @type {Array} */
  4143. this["cellColorAry"] = ["red", "#76FF03", "blue", "yellow", "#8207ff",
  4144. "#2196F3", ""
  4145. ];
  4146. /** @type {boolean} */
  4147. this["autoW"] = false;
  4148. /** @type {boolean} */
  4149. this["quickSpace"] = false;
  4150. /** @type {boolean} */
  4151. this["doubleSpace"] = false;
  4152. /** @type {number} */
  4153. this["quickSpaceCount"] = 0;
  4154. /** @type {number} */
  4155. this["doubleSpaceCount"] = 0;
  4156. this["lockZoomG"];
  4157. /** @type {number} */
  4158. this["teammateIndicatorPosition"] = 40;
  4159. /** @type {number} */
  4160. this["teammateIndicatorSize"] = 50;
  4161. /** @type {number} */
  4162. this["teammateIndicatorShowSize"] = 200;
  4163. this["teammateIndicator"];
  4164. this["specTeammate"];
  4165. /** @type {boolean} */
  4166. this["isSpecTeammate"] = false;
  4167. /** @type {number} */
  4168. this["massTextSize"] = 0.8;
  4169. /** @type {boolean} */
  4170. this["isSpectating"] = false;
  4171. /** @type {boolean} */
  4172. this["isSameColorFood"] = true;
  4173. /** @type {boolean} */
  4174. this["isTransparentCell"] = false;
  4175. /** @type {boolean} */
  4176. this["isShowFPS"] = false;
  4177. /** @type {boolean} */
  4178. this["isAutoHideMass"] = false;
  4179. /** @type {boolean} */
  4180. this["isAutoHideName"] = false;
  4181. /** @type {boolean} */
  4182. this["isShowTextStrokeLine"] = false;
  4183. /** @type {boolean} */
  4184. this["isEnableSplitInd"] = false;
  4185. /** @type {boolean} */
  4186. this["isEnableOtherSkinSupport"] = false;
  4187. /** @type {boolean} */
  4188. this["testing"] = false;
  4189. /** @type {boolean} */
  4190. this["isHideSelfName"] = false;
  4191. var _0x3495xfc = {};
  4192. /** @type {boolean} */
  4193. this["isEnableSound"] = false;
  4194. /** @type {boolean} */
  4195. this["isEnableShareFb"] = false;
  4196. /** @type {boolean} */
  4197. this["isShowPacketIO"] = false;
  4198. /**
  4199. * @return {undefined}
  4200. */
  4201. this["init"] = function () {
  4202. $("body")["html"]("");
  4203. $("body")["append"](
  4204. '<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>'
  4205. );
  4206. $("body")["append"]("<canvas id='canvas'>");
  4207. $("body")["append"](
  4208. '<link id="favicon" rel="icon" type="image/png">');
  4209. /** @type {string} */
  4210. document["title"] = "HKG Agar Tool Lite";
  4211. $("body")["append"]("<div id = 'overlays2'></div>");
  4212. $("#overlays2")["append"](
  4213. "<div id = 'div_lb'><div class='header'>Leaderboard</div></div>"
  4214. );
  4215. $("#div_lb")["append"]("<div id='lb_detail'></div>");
  4216. $("#overlays2")["append"]("<div id = 'div_score'></div>");
  4217. var test_canvas = document["getElementById"]("canvas");
  4218. var _0x3495xfe = test_canvas["getContext"]("2d");
  4219. /** @type {boolean} */
  4220. test_canvas["mozOpaque"] = true;
  4221. /**
  4222. * @param {?} deepDataAndEvents
  4223. * @param {?} msg
  4224. * @return {undefined}
  4225. */
  4226. window["setLocalStorage"] = function (deepDataAndEvents, msg) {
  4227. if("string" == typeof msg) {
  4228. localStorage["setItem"](deepDataAndEvents, msg);
  4229. } else {
  4230. localStorage["setItem"](deepDataAndEvents, JSON[
  4231. "stringify"](msg));
  4232. }
  4233. };
  4234. /**
  4235. * @param {?} deepDataAndEvents
  4236. * @return {?}
  4237. */
  4238. window["getLocalStorage"] = function (deepDataAndEvents) {
  4239. return localStorage["getItem"](deepDataAndEvents);
  4240. };
  4241. if(getLocalStorage("selected_profile")) {
  4242. selected_profile = getLocalStorage("selected_profile");
  4243. }
  4244. if(getLocalStorage("player_profile")) {
  4245. player_profile = JSON["parse"](getLocalStorage("player_profile"));
  4246. } else {
  4247. if(getLocalStorage("nick")) {
  4248. player_profile[selected_profile]["name"] = getLocalStorage(
  4249. "nick");
  4250. }
  4251. if(getLocalStorage("opt_teamname")) {
  4252. player_profile[selected_profile]["team"] = getLocalStorage(
  4253. "opt_teamname");
  4254. }
  4255. if(getLocalStorage("skin_url")) {
  4256. player_profile[selected_profile]["skinurl"] =
  4257. getLocalStorage("skin_url");
  4258. }
  4259. }
  4260. /** @type {number} */
  4261. var i = 0;
  4262. for(; i < player_profile["length"]; i++) {
  4263. window["postMessage"]({
  4264. action: Action["IMAGE"],
  4265. data: player_profile[i]["skinurl"]
  4266. }, "*");
  4267. }
  4268. $("body")["attr"]("oncontextmenu", "return false;");
  4269. $("#overlays2")["append"]("<div id='teammate_menu'></div>");
  4270. $("#teammate_menu")["hide"]();
  4271. $("#teammate_menu")["click"](function (synEvent) {
  4272. synEvent["stopPropagation"]();
  4273. });
  4274. $("#overlays2")["click"](function () {
  4275. $("#teammate_menu")["hide"]();
  4276. });
  4277. /** @type {Array} */
  4278. nodeList[0] = ["me", getLocalStorage("nick"), null, null, "yellow"];
  4279. /** @type {Array} */
  4280. nodeList[1] = ["top1", "", null, null, "white"];
  4281. nodeList[0][8] = Date["now"]();
  4282. nodeList[1][8] = Date["now"]();
  4283. chatRoom = new ChatRoom;
  4284. chatRoom["setContainer"]("#overlays2");
  4285. chatRoom["createChatBox"]();
  4286. var data = $("#gamemode")["parent"]();
  4287. data["append"](
  4288. '<input id="opt_connect_ip" class="form-control" placeholder="IP address/ Party Code" maxlength="20" style="width:65%;float:left;">'
  4289. );
  4290. data["append"](
  4291. '<button id="btn_connect" onclick="connectIP($(\'#opt_connect_ip\').val().trim());" type="button" class="btn btn-needs-server">Connect</button>'
  4292. );
  4293. data["append"](
  4294. '<div id="connect_error_div" class="msg_error">Party code expired or invalid.</div>'
  4295. );
  4296. $("#btn_connect")["click"](function () {
  4297. $("#btn_connect")["text"]("Connecting");
  4298. $("#connect_error_div")["hide"]();
  4299. });
  4300. data["append"](
  4301. '<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="' +
  4302. defaultTeamname + '">');
  4303. data["append"](
  4304. '<div id="lbl_skin_url" style="height:20px;">Skin URL : </div><input type="text" id="skin_url" class="form-control" placeholder="Skin URL">'
  4305. );
  4306. minimap = new Minimap;
  4307. minimap["createMap"](250);
  4308. var testCanvas = document["createElement"]("canvas");
  4309. var style = testCanvas["getContext"]("2d");
  4310. style["beginPath"]();
  4311. /** @type {number} */
  4312. style["lineWidth"] = 10;
  4313. style["moveTo"](0, 0);
  4314. style["lineTo"](100, 0);
  4315. style["lineTo"](50, 50);
  4316. style["closePath"]();
  4317. /** @type {string} */
  4318. style["strokeStyle"] = "white";
  4319. /** @type {string} */
  4320. style["fillStyle"] = "white";
  4321. style["stroke"]();
  4322. style["fill"]();
  4323. this["teammateIndicator"] = testCanvas;
  4324. };
  4325. /**
  4326. * @return {undefined}
  4327. */
  4328. this["newGame"] = function () {
  4329. $("#nick")["prop"]("disabled", true);
  4330. /** @type {boolean} */
  4331. myApp["isStopMovement"] = false;
  4332. /** @type {boolean} */
  4333. myApp["isSpectating"] = false;
  4334. /** @type {string} */
  4335. myApp["cellColor"] = "";
  4336. myApp["newGameImpl"]();
  4337. /** @type {null} */
  4338. nodeList[1][2] = null;
  4339. /** @type {null} */
  4340. nodeList[1][3] = null;
  4341. };
  4342. /**
  4343. * @return {undefined}
  4344. */
  4345. this["afterGameLogicLoaded"] = function () {
  4346. myApp["setupOption"]();
  4347. myApp["setupHotKey"]();
  4348. myApp["restoreSetting"]();
  4349. myApp["setUpHotKeyConfigPage"]();
  4350. myApp["replaceTos"]();
  4351. myApp["createGameInfoBox"]();
  4352. myApp["setupHints"]();
  4353. myApp["checkVersion"]();
  4354. myApp["downloadSkin"]();
  4355. $('button[data-target="#hotkeys_setting"]')["after"]($(
  4356. "<button id='btn_info' type='button' class='btn btn-warning btn-show-info'>Notice</button>"
  4357. ));
  4358. $("#btn_info")["click"](function () {
  4359. myApp["showAnnouncement"]();
  4360. });
  4361. $("#game_info")["click"](function () {
  4362. myApp["copyGameInfo"]();
  4363. });
  4364. $("#nick")["change"](function () {
  4365. handlePresence();
  4366. });
  4367. $("#team_name")["change"](function () {
  4368. setAttribute();
  4369. })["focus"](function () {
  4370. tmpTeamname = myApp["getTeamName"]();
  4371. });
  4372. $("#skin_url")["change"](function () {
  4373. var nv = getLocalStorage("skin_url");
  4374. var v = myApp["getCustomSkinUrl"]();
  4375. $("#skin_url")["val"](v);
  4376. if(nv == v) {
  4377. return;
  4378. }
  4379. /** @type {RegExp} */
  4380. var rchecked =
  4381. /^(?:(?: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;
  4382. if(v != "DEFAULT" && !rchecked["test"](v)) {
  4383. console["log"]("Not valid URL");
  4384. $("#skin_url")["val"](nv);
  4385. return;
  4386. }
  4387. setLocalStorage("skin_url", v);
  4388. nodeList[0][5] = v;
  4389. player_profile[selected_profile]["skinurl"] = myApp[
  4390. "getCustomSkinUrl"]();
  4391. attr();
  4392. if(customSkin[v]) {
  4393. myApp["changePreviewImage"](customSkin[v]["src"]);
  4394. } else {
  4395. skinDownloadQueue["push"](v);
  4396. }
  4397. });
  4398. $(".nav.arrow-left")["click"](function () {
  4399. /** @type {number} */
  4400. selected_profile = (player_profile["length"] +
  4401. selected_profile - 1) % player_profile["length"];
  4402. createInput();
  4403. });
  4404. $(".nav.arrow-right")["click"](function () {
  4405. /** @type {number} */
  4406. selected_profile = (selected_profile + 1) %
  4407. player_profile["length"];
  4408. createInput();
  4409. });
  4410. attr();
  4411. };
  4412. /**
  4413. * @param {Object} result
  4414. * @return {undefined}
  4415. */
  4416. this["spectate"] = function (result) {
  4417. if(!result || result["length"] == 0) {
  4418. /** @type {boolean} */
  4419. myApp["isSpectating"] = true;
  4420. }
  4421. };
  4422. /**
  4423. * @return {undefined}
  4424. */
  4425. this["newGameImpl"] = function () {
  4426. /** @type {boolean} */
  4427. var _0x3495x10a = true;
  4428. var result = getCell();
  4429. if(!result || result["length"] == 0) {
  4430. /** @type {boolean} */
  4431. _0x3495x10a = false;
  4432. }
  4433. if(!_0x3495x10a) {
  4434. setTimeout(myApp["newGameImpl"], 100);
  4435. return;
  4436. } else {
  4437. var color = result[0]["color"];
  4438. nodeList[0][6] = color;
  4439. }
  4440. $(".nav")["hide"]();
  4441. };
  4442. /**
  4443. * @return {undefined}
  4444. */
  4445. this["onDead"] = function () {
  4446. $("#nick")["prop"]("disabled", false);
  4447. $(".nav")["show"]();
  4448. };
  4449. /**
  4450. * @return {undefined}
  4451. */
  4452. this["afterGameLoaded"] = function () {
  4453. /** @type {boolean} */
  4454. myApp["isSpectating"] = false;
  4455. /** @type {number} */
  4456. updateLBCount = -1;
  4457. /** @type {boolean} */
  4458. isJoinedGame = false;
  4459. $("#nick")["prop"]("disabled", false);
  4460. $("#current_ip")["text"]("Current IP = " + myApp["getCurrentIP"]());
  4461. $("#ip_info")["text"]("Current IP : " + myApp["getCurrentIP"]());
  4462. $("#region_info")["text"]("Region : " + $("#region option:selected")[
  4463. "text"]()["split"](" ")[0]);
  4464. $("#gamemode_info")["text"]("Game mode : " + $(
  4465. "#gamemode option:selected")["text"]());
  4466. $("#party_code_info")["text"]("Party Code : " + myApp[
  4467. "getCurrentPartyCode"]());
  4468. $("#btn_connect")["text"]("Connect");
  4469. moveTo(null, null);
  4470. /** @type {null} */
  4471. myApp["specTeammate"] = null;
  4472. /** @type {boolean} */
  4473. myApp["isStopMovement"] = false;
  4474. minimap["setDeadPosition"](null);
  4475. };
  4476. /**
  4477. * @return {undefined}
  4478. */
  4479. this["restoreSetting"] = function () {
  4480. if(getLocalStorage("opt_teamname")) {
  4481. $("#team_name")["val"](getLocalStorage("opt_teamname"));
  4482. }
  4483. if(!getLocalStorage("nick") || getLocalStorage("nick")["trim"]() ==
  4484. "") {
  4485. $("#nick")["val"](myApp["getName"]());
  4486. setLocalStorage("nick", myApp["getName"]());
  4487. nodeList[0][1] = myApp["getName"]();
  4488. } else {
  4489. $("#nick")["val"](getLocalStorage("nick", myApp["getName"]()));
  4490. nodeList[0][1] = myApp["getName"]();
  4491. }
  4492. if(getLocalStorage("opt_zoom_speed")) {
  4493. r20 = getLocalStorage("opt_zoom_speed");
  4494. $("#opt_zoom_speed")["val"](r20);
  4495. $("#txt_zoom_speed")["text"](r20);
  4496. }
  4497. var src = getLocalStorage("skin_url");
  4498. if(!src || src == "") {
  4499. setLocalStorage("skin_url", defaultSkin);
  4500. src = defaultSkin;
  4501. }
  4502. if(src && src != "") {
  4503. $("#skin_url")["val"](getLocalStorage("skin_url"));
  4504. nodeList[0][5] = src;
  4505. if(customSkin[src]) {
  4506. myApp["changePreviewImage"](customSkin[src]["src"]);
  4507. } else {
  4508. skinDownloadQueue["push"](getLocalStorage("skin_url"));
  4509. }
  4510. }
  4511. if(!getLocalStorage("hotkeyMapping")) {
  4512. var unlock;
  4513. for(unlock in hotkeyConfig) {
  4514. if(hotkeyConfig[unlock]["defaultHotkey"] && hotkeyConfig[
  4515. unlock]["defaultHotkey"] != "") {
  4516. /** @type {string} */
  4517. hotkeyMapping[hotkeyConfig[unlock]["defaultHotkey"]] =
  4518. unlock;
  4519. }
  4520. }
  4521. setLocalStorage("hotkeyMapping", hotkeyMapping);
  4522. } else {
  4523. hotkeyMapping = JSON["parse"](getLocalStorage("hotkeyMapping"));
  4524. }
  4525. if(!getLocalStorage("hotkeyMessageSend")) {
  4526. hotkeyMessageSend = defaultHotkeyMessageSend;
  4527. setLocalStorage("hotkeyMessageSend", hotkeyMessageSend);
  4528. } else {
  4529. hotkeyMessageSend = JSON["parse"](getLocalStorage(
  4530. "hotkeyMessageSend"));
  4531. }
  4532. };
  4533. /**
  4534. * @return {undefined}
  4535. */
  4536. this["replaceTos"] = function () {
  4537. $(".tosBox")["html"](
  4538. "<a target='_blank' class='text-muted' href='https://drive.google.com/open?id=1B6PDhwnwBjZhVXpXlkbZksnsZtkyRa4eaU5QW0SSGfI'>HKG Agar Tool Lite</a>" +
  4539. "<span class='text-muted'> | " + this["version"] +
  4540. "</span>");
  4541. };
  4542. /**
  4543. * @return {undefined}
  4544. */
  4545. this["setupOption"] = function () {
  4546. var handlers = {
  4547. "opt_self_name": {
  4548. text: "No my name",
  4549. default: true,
  4550. /**
  4551. * @param {?} token
  4552. * @return {undefined}
  4553. */
  4554. handler: function (token) {
  4555. myApp["isHideSelfName"] = token;
  4556. }
  4557. },
  4558. "opt_name": {
  4559. text: "No names",
  4560. /**
  4561. * @param {?} token
  4562. * @return {undefined}
  4563. */
  4564. handler: function (token) {
  4565. setNames(!token);
  4566. }
  4567. },
  4568. "opt_skin": {
  4569. text: "No skins",
  4570. default: true,
  4571. /**
  4572. * @param {?} token
  4573. * @return {undefined}
  4574. */
  4575. handler: function (token) {
  4576. setSkins(!token);
  4577. }
  4578. },
  4579. "opt_color": {
  4580. text: "No colors",
  4581. /**
  4582. * @param {?} token
  4583. * @return {undefined}
  4584. */
  4585. handler: function (token) {
  4586. setColors(token);
  4587. }
  4588. },
  4589. "opt_mass": {
  4590. text: "Show mass",
  4591. default: true,
  4592. /**
  4593. * @param {?} token
  4594. * @return {undefined}
  4595. */
  4596. handler: function (token) {
  4597. setShowMass(token);
  4598. }
  4599. },
  4600. "opt_stats": {
  4601. text: "Skip stats",
  4602. default: true,
  4603. /**
  4604. * @param {?} token
  4605. * @return {undefined}
  4606. */
  4607. handler: function (token) {
  4608. setSkipStats(token);
  4609. }
  4610. },
  4611. "opt_zoom": {
  4612. text: "Zoom",
  4613. default: true,
  4614. /**
  4615. * @param {?} token
  4616. * @return {undefined}
  4617. */
  4618. handler: function (token) {
  4619. myApp["isEnableZoom"] = token;
  4620. }
  4621. },
  4622. "opt_food": {
  4623. text: "Hide Food",
  4624. /**
  4625. * @param {?} token
  4626. * @return {undefined}
  4627. */
  4628. handler: function (token) {
  4629. myApp["isEnableHideFood"] = token;
  4630. }
  4631. },
  4632. "opt_gridline": {
  4633. text: "Gridline",
  4634. /**
  4635. * @param {?} token
  4636. * @return {undefined}
  4637. */
  4638. handler: function (token) {
  4639. myApp["isEnableGridline"] = token;
  4640. }
  4641. },
  4642. "opt_border": {
  4643. text: "Border",
  4644. default: true,
  4645. /**
  4646. * @param {?} token
  4647. * @return {undefined}
  4648. */
  4649. handler: function (token) {
  4650. myApp["isEnableBorder"] = token;
  4651. }
  4652. },
  4653. "opt_simple_drawing": {
  4654. text: "Simple draw",
  4655. default: true,
  4656. /**
  4657. * @param {?} token
  4658. * @return {undefined}
  4659. */
  4660. handler: function (token) {
  4661. myApp["isEnableSimpleDrawing"] = token;
  4662. }
  4663. },
  4664. "opt_score": {
  4665. text: "Score",
  4666. default: true,
  4667. /**
  4668. * @param {?} token
  4669. * @return {undefined}
  4670. */
  4671. handler: function (token) {
  4672. myApp["isShowScroll"] = token;
  4673. }
  4674. },
  4675. "opt_ste": {
  4676. text: "STE",
  4677. default: true,
  4678. /**
  4679. * @param {?} token
  4680. * @return {undefined}
  4681. */
  4682. handler: function (token) {
  4683. myApp["isShowSTE"] = token;
  4684. }
  4685. },
  4686. "opt_ball_total": {
  4687. text: "[n/16]",
  4688. default: true,
  4689. /**
  4690. * @param {?} token
  4691. * @return {undefined}
  4692. */
  4693. handler: function (token) {
  4694. myApp["isShowBallTotal"] = token;
  4695. }
  4696. },
  4697. "opt_minimap": {
  4698. text: "Minimap",
  4699. default: true,
  4700. /**
  4701. * @param {?} token
  4702. * @return {undefined}
  4703. */
  4704. handler: function (token) {
  4705. if(token) {
  4706. minimap["show"]();
  4707. } else {
  4708. minimap["hide"]();
  4709. }
  4710. }
  4711. },
  4712. "opt_mousew": {
  4713. text: "Mouse W",
  4714. /**
  4715. * @param {?} token
  4716. * @return {undefined}
  4717. */
  4718. handler: function (token) {
  4719. myApp["isEnableMouseW"] = token;
  4720. }
  4721. },
  4722. "opt_same_food_color": {
  4723. text: "Rainbow color",
  4724. /**
  4725. * @param {?} token
  4726. * @return {undefined}
  4727. */
  4728. handler: function (token) {
  4729. /** @type {boolean} */
  4730. myApp["isSameColorFood"] = !token;
  4731. }
  4732. },
  4733. "opt_transparent_cell": {
  4734. text: "Transparent Cell",
  4735. /**
  4736. * @param {?} token
  4737. * @return {undefined}
  4738. */
  4739. handler: function (token) {
  4740. myApp["isTransparentCell"] = token;
  4741. }
  4742. },
  4743. "opt_fps": {
  4744. text: "FPS",
  4745. default: true,
  4746. /**
  4747. * @param {?} token
  4748. * @return {undefined}
  4749. */
  4750. handler: function (token) {
  4751. myApp["isShowFPS"] = token;
  4752. }
  4753. },
  4754. "opt_packetIO": {
  4755. text: "Pactets I/O",
  4756. default: true,
  4757. /**
  4758. * @param {?} token
  4759. * @return {undefined}
  4760. */
  4761. handler: function (token) {
  4762. myApp["isShowPacketIO"] = token;
  4763. }
  4764. },
  4765. "opt_auto_hide_mass": {
  4766. text: "Auto hide mass",
  4767. default: true,
  4768. /**
  4769. * @param {?} token
  4770. * @return {undefined}
  4771. */
  4772. handler: function (token) {
  4773. myApp["isAutoHideMass"] = token;
  4774. }
  4775. },
  4776. "opt_auto_hide_name": {
  4777. text: "Auto hide name",
  4778. default: true,
  4779. /**
  4780. * @param {?} token
  4781. * @return {undefined}
  4782. */
  4783. handler: function (token) {
  4784. myApp["isAutoHideName"] = token;
  4785. }
  4786. },
  4787. "opt_show_text_stroke_line": {
  4788. text: "Text shadow",
  4789. /**
  4790. * @param {?} token
  4791. * @return {undefined}
  4792. */
  4793. handler: function (token) {
  4794. myApp["isShowTextStrokeLine"] = token;
  4795. }
  4796. },
  4797. "opt_lock_zoom": {
  4798. text: "Auto zoom",
  4799. /**
  4800. * @param {?} token
  4801. * @return {undefined}
  4802. */
  4803. handler: function (token) {
  4804. /** @type {boolean} */
  4805. myApp["isEnableLockZoom"] = !token;
  4806. }
  4807. },
  4808. "opt_split_ind": {
  4809. text: "Split indicator",
  4810. /**
  4811. * @param {?} token
  4812. * @return {undefined}
  4813. */
  4814. handler: function (token) {
  4815. myApp["isEnableSplitInd"] = token;
  4816. }
  4817. },
  4818. "opt_custom_skin": {
  4819. text: "Custom Skin",
  4820. default: true,
  4821. /**
  4822. * @param {?} token
  4823. * @return {undefined}
  4824. */
  4825. handler: function (token) {
  4826. myApp["isEnableCustomSkin"] = token;
  4827. }
  4828. },
  4829. "opt_other_skin": {
  4830. text: "YIN SKIN",
  4831. disabled: true,
  4832. /**
  4833. * @param {?} token
  4834. * @return {undefined}
  4835. */
  4836. handler: function (token) {
  4837. myApp["isEnableOtherSkinSupport"] = token;
  4838. }
  4839. },
  4840. "opt_system_message": {
  4841. text: "System Msg",
  4842. disabled: true,
  4843. default: false,
  4844. /**
  4845. * @param {boolean} err
  4846. * @return {undefined}
  4847. */
  4848. handler: function (err) {
  4849. /** @type {boolean} */
  4850. error = err;
  4851. }
  4852. },
  4853. "opt_chatbox": {
  4854. text: "Chatbox",
  4855. disabled: true,
  4856. /**
  4857. * @param {?} token
  4858. * @return {undefined}
  4859. */
  4860. handler: function (token) {
  4861. if(token) {
  4862. chatRoom["show"]();
  4863. } else {
  4864. chatRoom["hide"]();
  4865. }
  4866. }
  4867. },
  4868. "opt_chatpopup": {
  4869. text: "Chat Popup",
  4870. disabled: true,
  4871. default: false,
  4872. /**
  4873. * @param {?} token
  4874. * @return {undefined}
  4875. */
  4876. handler: function (token) {
  4877. myApp["isEnableChatpopup"] = token;
  4878. }
  4879. },
  4880. "opt_sound": {
  4881. text: "Sound",
  4882. disabled: true,
  4883. default: false,
  4884. /**
  4885. * @param {?} token
  4886. * @return {undefined}
  4887. */
  4888. handler: function (token) {
  4889. myApp["isEnableSound"] = token;
  4890. }
  4891. },
  4892. "opt_share_fb": {
  4893. text: "132 MASS",
  4894. disabled: true,
  4895. default: false,
  4896. /**
  4897. * @param {?} token
  4898. * @return {undefined}
  4899. */
  4900. handler: function (token) {
  4901. myApp["isEnableShareFb"] = token;
  4902. }
  4903. }
  4904. };
  4905. /**
  4906. * @param {?} v
  4907. * @return {undefined}
  4908. */
  4909. window["setYinSkinSupport"] = function (v) {
  4910. handlers["opt_other_skin"]["handler"](v);
  4911. setLocalStorage("opt_other_skin", v);
  4912. };
  4913. var relatedTarget = $(document["createDocumentFragment"]());
  4914. var i;
  4915. for(i in handlers) {
  4916. if(!handlers[i]["disabled"]) {
  4917. relatedTarget["append"]('<label><input id="' + i +
  4918. '" type="checkbox"></input><span>' + handlers[i][
  4919. "text"
  4920. ] + "</span></label>");
  4921. }
  4922. }
  4923. $("#options")["append"](relatedTarget);
  4924. $("input:checkbox")["change"](function () {
  4925. var isChecked = $(this)["prop"]("checked");
  4926. var type = $(this)["prop"]("id");
  4927. setLocalStorage(type, isChecked);
  4928. if(handlers[type]) {
  4929. handlers[type]["handler"](isChecked);
  4930. }
  4931. });
  4932. for(i in handlers) {
  4933. if(getLocalStorage(i)) {
  4934. if(getLocalStorage(i) == "true") {
  4935. if(i == "opt_other_skin") {
  4936. setYinSkinSupport(true);
  4937. } else {
  4938. $("#" + i)["click"]();
  4939. }
  4940. }
  4941. continue;
  4942. }
  4943. if(handlers[i]["default"]) {
  4944. $("#" + i)["click"]();
  4945. }
  4946. }
  4947. $("#settings")["append"](
  4948. '<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>'
  4949. );
  4950. $("#opt_zoom_speed")["change"](function () {
  4951. r20 = $("#opt_zoom_speed")["val"]();
  4952. setLocalStorage("opt_zoom_speed", r20);
  4953. });
  4954. };
  4955. /**
  4956. * @param {Object} bStack
  4957. * @return {?}
  4958. */
  4959. this["scoreInfo"] = function (bStack) {
  4960. if(!bStack || !bStack["length"]) {
  4961. return "";
  4962. }
  4963. /** @type {string} */
  4964. var optsData = "";
  4965. if(myApp["isShowSTE"]) {
  4966. optsData += " STE: " + this["getSTE"](bStack);
  4967. }
  4968. if(myApp["isShowBallTotal"]) {
  4969. optsData += " [" + bStack["length"] + "/16]";
  4970. }
  4971. return optsData;
  4972. };
  4973. /**
  4974. * @param {string} dataAndEvents
  4975. * @return {?}
  4976. */
  4977. this["scoreTxt"] = function (dataAndEvents) {
  4978. return myApp["isShowScroll"] ? dataAndEvents : "";
  4979. };
  4980. /**
  4981. * @return {?}
  4982. */
  4983. this["isShowScoreInfo"] = function () {
  4984. return myApp["isShowScroll"] || (myApp["isShowSTE"] || myApp[
  4985. "isShowBallTotal"]);
  4986. };
  4987. /**
  4988. * @return {?}
  4989. */
  4990. this["showSystemMessage"] = function () {
  4991. return error;
  4992. };
  4993. /**
  4994. * @param {Object} stack
  4995. * @return {?}
  4996. */
  4997. this["getSTE"] = function (stack) {
  4998. /** @type {number} */
  4999. var w = 0;
  5000. /** @type {number} */
  5001. var i = 0;
  5002. for(; i < stack["length"]; i++) {
  5003. if(stack[i] && (stack[i]["I"] && (stack[i]["I"]["w"] && stack[i]
  5004. ["I"]["w"] > w))) {
  5005. w = stack[i]["I"]["w"];
  5006. }
  5007. }
  5008. return ~~(0.375 * w);
  5009. };
  5010. /**
  5011. * @return {undefined}
  5012. */
  5013. this["createGameInfoBox"] = function () {
  5014. $(".gameinfo")["prepend"](
  5015. "<div id='game_info' class='agario-panel'>" +
  5016. "<p id='ip_info'></p>" + "<p id='region_info'></p>" +
  5017. "<p id='gamemode_info'></p>" +
  5018. "<p id='party_code_info'></p>" + "<p id='lb_info'></p>" +
  5019. "</div>");
  5020. $("#game_info")["append"](
  5021. '<button id ="btn_copy_gameinfo" class="btn btn-warning btn-hotkeys" type="button">Copy</button>'
  5022. );
  5023. };
  5024. /**
  5025. * @return {undefined}
  5026. */
  5027. this["updateLBInfo"] = function () {
  5028. /** @type {string} */
  5029. var later = "";
  5030. var stack = myApp["getLeaderBoard"]();
  5031. if(stack) {
  5032. /** @type {number} */
  5033. var i = 0;
  5034. for(; i < stack["length"]; i++) {
  5035. later += "<div>" + (i + 1) + ". " + stack[i] + "</div>";
  5036. }
  5037. }
  5038. $("#lb_info")["html"](later);
  5039. };
  5040. /**
  5041. * @return {?}
  5042. */
  5043. this["isPrivateServer"] = function () {
  5044. return PRIVATE_SERVER_IP == currentIP;
  5045. };
  5046. /**
  5047. * @return {?}
  5048. */
  5049. this["getCurrentIP"] = function () {
  5050. console["log"](currentIP);
  5051. if(this["isPrivateServer"]()) {
  5052. return "----------";
  5053. }
  5054. return currentIP["substring"](5, currentIP["length"]);
  5055. };
  5056. /**
  5057. * @return {?}
  5058. */
  5059. this["getRegion"] = function () {
  5060. return $("#region option:selected")["text"]()["split"](" ")[0];
  5061. };
  5062. /**
  5063. * @return {?}
  5064. */
  5065. this["getGameMode"] = function () {
  5066. if(this["isPrivateServer"]()) {
  5067. return "----------";
  5068. }
  5069. return $("#gamemode option:selected")["text"]();
  5070. };
  5071. /**
  5072. * @return {?}
  5073. */
  5074. this["getTeamName"] = function () {
  5075. var trim = $("#team_name")["val"]() == "" ? defaultTeamname : $(
  5076. "#team_name")["val"]();
  5077. return trim["trim"]();
  5078. };
  5079. /**
  5080. * @return {?}
  5081. */
  5082. this["getCustomSkinUrl"] = function () {
  5083. var url = ($("#skin_url")["val"]() + "")["trim"]();
  5084. return url == "" ? "DEFAULT" : url;
  5085. };
  5086. /**
  5087. * @return {?}
  5088. */
  5089. this["getCurrentPartyCode"] = function () {
  5090. if(document["location"]["hash"] && 6 <= document["location"]["hash"]
  5091. ["length"]) {
  5092. return document["location"]["hash"];
  5093. } else {
  5094. return "N/A";
  5095. }
  5096. };
  5097. /**
  5098. * @param {?} deepDataAndEvents
  5099. * @param {?} string
  5100. * @return {undefined}
  5101. */
  5102. this["showMessage"] = function (deepDataAndEvents, string) {
  5103. if($("#message_dialog")["length"] == 0) {
  5104. myApp["createMessageDialog"]();
  5105. }
  5106. $("#message_dialog_title")["text"](deepDataAndEvents);
  5107. $("#message_dialog_content")["html"](string);
  5108. $("#message_dialog")["modal"]({
  5109. show: "true"
  5110. });
  5111. };
  5112. /**
  5113. * @return {?}
  5114. */
  5115. this["getName"] = function () {
  5116. var h = $("#nick")["val"]()["trim"]();
  5117. if(h["indexOf"]("​") != -1) {
  5118. /** @type {string} */
  5119. h = "";
  5120. }
  5121. return h == "" ? "不留名 [slick]" : h;
  5122. };
  5123. /**
  5124. * @return {?}
  5125. */
  5126. this["getLeaderBoard"] = function () {
  5127. /** @type {Array} */
  5128. var result = [];
  5129. var stack = getLB();
  5130. if(stack) {
  5131. /** @type {number} */
  5132. var i = 0;
  5133. for(; i < stack["length"]; i++) {
  5134. result[result["length"]] = stack[i]["name"] == "" ?
  5135. "An unnamed cell" : stack[i]["name"];
  5136. }
  5137. }
  5138. return result;
  5139. };
  5140. /**
  5141. * @return {undefined}
  5142. */
  5143. this["setupHotKey"] = function () {
  5144. hotkeyConfig = {
  5145. "hk_start_new_game": {
  5146. defaultHotkey: "N",
  5147. name: "Start new game",
  5148. /**
  5149. * @return {undefined}
  5150. */
  5151. keyDown: function () {
  5152. setNick(myApp["getName"]());
  5153. },
  5154. type: "NORMAL"
  5155. },
  5156. "hk_cheatw": {
  5157. defaultHotkey: "E",
  5158. name: "Marco W",
  5159. /**
  5160. * @return {undefined}
  5161. */
  5162. keyDown: function () {
  5163. /** @type {boolean} */
  5164. myApp["autoW"] = true;
  5165. },
  5166. /**
  5167. * @return {undefined}
  5168. */
  5169. keyUp: function () {
  5170. /** @type {boolean} */
  5171. myApp["autoW"] = false;
  5172. },
  5173. type: "NORMAL"
  5174. },
  5175. "hk_quick_space": {
  5176. defaultHotkey: "T",
  5177. name: "Quick space",
  5178. /**
  5179. * @return {undefined}
  5180. */
  5181. keyDown: function () {
  5182. if(myApp["quickSpace"]) {
  5183. return;
  5184. }
  5185. /** @type {boolean} */
  5186. myApp["quickSpace"] = true;
  5187. quickSpace();
  5188. },
  5189. /**
  5190. * @return {undefined}
  5191. */
  5192. keyUp: function () {
  5193. /** @type {boolean} */
  5194. myApp["quickSpace"] = false;
  5195. },
  5196. type: "NORMAL"
  5197. },
  5198. "hk_double_space": {
  5199. defaultHotkey: "G",
  5200. name: "Double space",
  5201. /**
  5202. * @return {undefined}
  5203. */
  5204. keyDown: function () {
  5205. if(myApp["doubleSpace"]) {
  5206. return;
  5207. }
  5208. /** @type {boolean} */
  5209. myApp["doubleSpace"] = true;
  5210. doubleSpace();
  5211. },
  5212. /**
  5213. * @return {undefined}
  5214. */
  5215. keyUp: function () {
  5216. /** @type {boolean} */
  5217. myApp["doubleSpace"] = false;
  5218. },
  5219. type: "NORMAL"
  5220. },
  5221. "hk_change_color": {
  5222. defaultHotkey: "TAB",
  5223. name: "Switch Color",
  5224. /**
  5225. * @return {undefined}
  5226. */
  5227. keyDown: function () {
  5228. myApp["cellColor"] = myApp["cellColorAry"][(
  5229. myApp["cellColorAry"]["indexOf"](
  5230. myApp["cellColor"]) + 1) %
  5231. myApp["cellColorAry"]["length"]
  5232. ];
  5233. },
  5234. type: "NORMAL"
  5235. },
  5236. "hk_stop_movement_toggle": {
  5237. defaultHotkey: "ALT_S",
  5238. name: "Stop movement (Toggle)",
  5239. /**
  5240. * @return {undefined}
  5241. */
  5242. keyDown: function () {
  5243. /** @type {boolean} */
  5244. myApp["isStopMovement"] = !myApp[
  5245. "isStopMovement"];
  5246. /** @type {null} */
  5247. myApp["specTeammate"] = null;
  5248. },
  5249. type: "NORMAL"
  5250. },
  5251. "hk_stop_movement": {
  5252. defaultHotkey: "S",
  5253. name: "Stop movement (Temporary)",
  5254. /**
  5255. * @return {undefined}
  5256. */
  5257. keyDown: function () {
  5258. /** @type {boolean} */
  5259. myApp["isStopMovement"] = true;
  5260. /** @type {null} */
  5261. myApp["specTeammate"] = null;
  5262. moveTo(null, null);
  5263. },
  5264. /**
  5265. * @return {undefined}
  5266. */
  5267. keyUp: function () {
  5268. /** @type {boolean} */
  5269. myApp["isStopMovement"] = false;
  5270. },
  5271. type: "NORMAL"
  5272. },
  5273. "hk_split_ind": {
  5274. defaultHotkey: "I",
  5275. name: "On/ off split indicator",
  5276. /**
  5277. * @return {undefined}
  5278. */
  5279. keyDown: function () {
  5280. $("#opt_split_ind")["click"]();
  5281. },
  5282. type: "NORMAL"
  5283. },
  5284. "hk_lock_zoom": {
  5285. defaultHotkey: "L",
  5286. name: "On/ off auto zoom",
  5287. /**
  5288. * @return {undefined}
  5289. */
  5290. keyDown: function () {
  5291. $("#opt_lock_zoom")["click"]();
  5292. },
  5293. type: "NORMAL"
  5294. },
  5295. "hk_attack_range": {
  5296. defaultHotkey: "A",
  5297. name: "Show attack range (Temporary)",
  5298. /**
  5299. * @return {undefined}
  5300. */
  5301. keyDown: function () {
  5302. /** @type {boolean} */
  5303. myApp["isEnableAttackRange"] = true;
  5304. },
  5305. /**
  5306. * @return {undefined}
  5307. */
  5308. keyUp: function () {
  5309. /** @type {boolean} */
  5310. myApp["isEnableAttackRange"] = false;
  5311. },
  5312. type: "NORMAL"
  5313. },
  5314. "hk_attack_range_toggle": {
  5315. defaultHotkey: "ALT_A",
  5316. name: "Show attack range (Toggle)",
  5317. /**
  5318. * @return {undefined}
  5319. */
  5320. keyDown: function () {
  5321. /** @type {boolean} */
  5322. myApp["isEnableAttackRange"] = !myApp[
  5323. "isEnableAttackRange"];
  5324. },
  5325. type: "NORMAL"
  5326. },
  5327. "hk_spec_teammate": {
  5328. defaultHotkey: "V",
  5329. name: "Spectating teammate",
  5330. /**
  5331. * @return {undefined}
  5332. */
  5333. keyDown: function () {},
  5334. type: "NORMAL"
  5335. },
  5336. "hk_custom_skin": {
  5337. defaultHotkey: "",
  5338. name: "On/ off Custom skin",
  5339. /**
  5340. * @return {undefined}
  5341. */
  5342. keyDown: function () {
  5343. $("#opt_custom_skin")["click"]();
  5344. },
  5345. type: "NORMAL"
  5346. },
  5347. "hk_skin": {
  5348. defaultHotkey: "",
  5349. name: "Show/ hide skins",
  5350. /**
  5351. * @return {undefined}
  5352. */
  5353. keyDown: function () {
  5354. $("#opt_skin")["click"]();
  5355. },
  5356. type: "NORMAL"
  5357. },
  5358. "hk_same_food_color": {
  5359. defaultHotkey: "",
  5360. name: "On/ off Rainbow color",
  5361. /**
  5362. * @return {undefined}
  5363. */
  5364. keyDown: function () {
  5365. $("#opt_same_food_color")["click"]();
  5366. },
  5367. type: "NORMAL"
  5368. },
  5369. "hk_transparent_cell": {
  5370. defaultHotkey: "",
  5371. name: "On/ off transparent cell",
  5372. /**
  5373. * @return {undefined}
  5374. */
  5375. keyDown: function () {
  5376. $("#opt_transparent_cell")["click"]();
  5377. },
  5378. type: "NORMAL"
  5379. },
  5380. "hk_fps": {
  5381. defaultHotkey: "",
  5382. name: "Show/ Hide FPS counter",
  5383. /**
  5384. * @return {undefined}
  5385. */
  5386. keyDown: function () {
  5387. $("#opt_fps")["click"]();
  5388. },
  5389. type: "NORMAL"
  5390. },
  5391. "hk_zoom_a": {
  5392. defaultHotkey: "1",
  5393. name: "Zoom level 1",
  5394. /**
  5395. * @return {undefined}
  5396. */
  5397. keyDown: function () {
  5398. if(!myApp["isEnableLockZoom"]) {
  5399. hotkeyConfig["hk_lock_zoom"]["keyDown"]();
  5400. }
  5401. setZoomLevel(0.75);
  5402. },
  5403. type: "NORMAL"
  5404. },
  5405. "hk_zoom_b": {
  5406. defaultHotkey: "2",
  5407. name: "Zoom level 2",
  5408. /**
  5409. * @return {undefined}
  5410. */
  5411. keyDown: function () {
  5412. if(!myApp["isEnableLockZoom"]) {
  5413. hotkeyConfig["hk_lock_zoom"]["keyDown"]();
  5414. }
  5415. setZoomLevel(0.3);
  5416. },
  5417. type: "NORMAL"
  5418. },
  5419. "hk_zoom_c": {
  5420. defaultHotkey: "3",
  5421. name: "Zoom level 3",
  5422. /**
  5423. * @return {undefined}
  5424. */
  5425. keyDown: function () {
  5426. if(!myApp["isEnableLockZoom"]) {
  5427. hotkeyConfig["hk_lock_zoom"]["keyDown"]();
  5428. }
  5429. setZoomLevel(0.15);
  5430. },
  5431. type: "NORMAL"
  5432. },
  5433. "hk_zoom_d": {
  5434. defaultHotkey: "4",
  5435. name: "Zoom level 4",
  5436. /**
  5437. * @return {undefined}
  5438. */
  5439. keyDown: function () {
  5440. if(!myApp["isEnableLockZoom"]) {
  5441. hotkeyConfig["hk_lock_zoom"]["keyDown"]();
  5442. }
  5443. setZoomLevel(0.08);
  5444. },
  5445. type: "NORMAL"
  5446. },
  5447. "hk_zoom_e": {
  5448. defaultHotkey: "5",
  5449. name: "Zoom level 5",
  5450. /**
  5451. * @return {undefined}
  5452. */
  5453. keyDown: function () {
  5454. if(!myApp["isEnableLockZoom"]) {
  5455. hotkeyConfig["hk_lock_zoom"]["keyDown"]();
  5456. }
  5457. setZoomLevel(0.05);
  5458. },
  5459. type: "NORMAL"
  5460. },
  5461. "hk_name": {
  5462. defaultHotkey: "ALT_N",
  5463. name: "Show/ hide names",
  5464. /**
  5465. * @return {undefined}
  5466. */
  5467. keyDown: function () {
  5468. $("#opt_name")["click"]();
  5469. },
  5470. type: "NORMAL"
  5471. },
  5472. "hk_self_name": {
  5473. defaultHotkey: "",
  5474. name: "Show/ hide self name",
  5475. /**
  5476. * @return {undefined}
  5477. */
  5478. keyDown: function () {
  5479. $("#opt_self_name")["click"]();
  5480. },
  5481. type: "NORMAL"
  5482. },
  5483. "hk_color": {
  5484. defaultHotkey: "",
  5485. name: "Show/ hide colors",
  5486. /**
  5487. * @return {undefined}
  5488. */
  5489. keyDown: function () {
  5490. $("#opt_color")["click"]();
  5491. },
  5492. type: "NORMAL"
  5493. },
  5494. "hk_mass": {
  5495. defaultHotkey: "",
  5496. name: "Show/ hide mass",
  5497. /**
  5498. * @return {undefined}
  5499. */
  5500. keyDown: function () {
  5501. $("#opt_mass")["click"]();
  5502. },
  5503. type: "NORMAL"
  5504. },
  5505. "hk_stat": {
  5506. defaultHotkey: "",
  5507. name: "On/ off Skip stats",
  5508. /**
  5509. * @return {undefined}
  5510. */
  5511. keyDown: function () {
  5512. $("#opt_stats")["click"]();
  5513. },
  5514. type: "NORMAL"
  5515. },
  5516. "hk_zoom": {
  5517. defaultHotkey: "ALT_Z",
  5518. name: "On/ off Zoom",
  5519. /**
  5520. * @return {undefined}
  5521. */
  5522. keyDown: function () {
  5523. $("#opt_zoom")["click"]();
  5524. },
  5525. type: "NORMAL"
  5526. },
  5527. "hk_food": {
  5528. defaultHotkey: "F",
  5529. name: "Show/ hide Food",
  5530. /**
  5531. * @return {undefined}
  5532. */
  5533. keyDown: function () {
  5534. $("#opt_food")["click"]();
  5535. },
  5536. type: "NORMAL"
  5537. },
  5538. "hk_gridline": {
  5539. defaultHotkey: "ALT_G",
  5540. name: "Show/ hide Gridline",
  5541. /**
  5542. * @return {undefined}
  5543. */
  5544. keyDown: function () {
  5545. $("#opt_gridline")["click"]();
  5546. },
  5547. type: "NORMAL"
  5548. },
  5549. "hk_border": {
  5550. defaultHotkey: "ALT_B",
  5551. name: "Show/ hide Border",
  5552. /**
  5553. * @return {undefined}
  5554. */
  5555. keyDown: function () {
  5556. $("#opt_border")["click"]();
  5557. },
  5558. type: "NORMAL"
  5559. },
  5560. "hk_simple_draw": {
  5561. defaultHotkey: "",
  5562. name: "On/ off Simple draw",
  5563. /**
  5564. * @return {undefined}
  5565. */
  5566. keyDown: function () {
  5567. $("#opt_simple_drawing")["click"]();
  5568. },
  5569. type: "NORMAL"
  5570. },
  5571. "hk_score": {
  5572. defaultHotkey: "",
  5573. name: "Show/ hide Score",
  5574. /**
  5575. * @return {undefined}
  5576. */
  5577. keyDown: function () {
  5578. $("#opt_score")["click"]();
  5579. },
  5580. type: "NORMAL"
  5581. },
  5582. "hk_ste": {
  5583. defaultHotkey: "",
  5584. name: "Show/ hide STE",
  5585. /**
  5586. * @return {undefined}
  5587. */
  5588. keyDown: function () {
  5589. $("#opt_ste")["click"]();
  5590. },
  5591. type: "NORMAL"
  5592. },
  5593. "hk_n16": {
  5594. defaultHotkey: "",
  5595. name: "Show/ hide [n/16]",
  5596. /**
  5597. * @return {undefined}
  5598. */
  5599. keyDown: function () {
  5600. $("#opt_ball_total")["click"]();
  5601. },
  5602. type: "NORMAL"
  5603. },
  5604. "hk_auto_hide_mass": {
  5605. defaultHotkey: "",
  5606. name: "On/ off Auto hide mass",
  5607. /**
  5608. * @return {undefined}
  5609. */
  5610. keyDown: function () {
  5611. $("#opt_auto_hide_mass")["click"]();
  5612. },
  5613. type: "NORMAL"
  5614. },
  5615. "hk_auto_hide_name": {
  5616. defaultHotkey: "",
  5617. name: "On/ off Auto hide name",
  5618. /**
  5619. * @return {undefined}
  5620. */
  5621. keyDown: function () {
  5622. $("#opt_auto_hide_name")["click"]();
  5623. },
  5624. type: "NORMAL"
  5625. },
  5626. "hk_show_text_stroke_line": {
  5627. defaultHotkey: "",
  5628. name: "Show/ hide Text shadow",
  5629. /**
  5630. * @return {undefined}
  5631. */
  5632. keyDown: function () {
  5633. $("#opt_show_text_stroke_line")["click"]();
  5634. },
  5635. type: "NORMAL"
  5636. },
  5637. "hk_minimap": {
  5638. defaultHotkey: "ALT_M",
  5639. name: "Show/ hide Minimap",
  5640. /**
  5641. * @return {undefined}
  5642. */
  5643. keyDown: function () {
  5644. $("#opt_minimap")["click"]();
  5645. },
  5646. type: "NORMAL"
  5647. },
  5648. "hk_mousew": {
  5649. defaultHotkey: "",
  5650. name: "On/ off Mouse W",
  5651. /**
  5652. * @return {undefined}
  5653. */
  5654. keyDown: function () {
  5655. $("#opt_mousew")["click"]();
  5656. },
  5657. type: "NORMAL"
  5658. },
  5659. "hk_pause": {
  5660. defaultHotkey: "P",
  5661. name: "Pause game for short moment",
  5662. /**
  5663. * @return {undefined}
  5664. */
  5665. keyDown: function () {
  5666. var _0x3495x11b = (new Date)["getTime"]();
  5667. for(; _0x3495x11b + 500 >= (new Date)["getTime"]
  5668. ();) {}
  5669. },
  5670. type: "NORMAL"
  5671. },
  5672. "hk_send_msg": {
  5673. defaultHotkey: "ENTER",
  5674. name: "Chatbox send message",
  5675. /**
  5676. * @return {undefined}
  5677. */
  5678. keyDown: function () {
  5679. chatRoom["enter"]();
  5680. },
  5681. type: "NORMAL"
  5682. }
  5683. };
  5684. };
  5685. /**
  5686. * @return {undefined}
  5687. */
  5688. this["createMessageDialog"] = function () {
  5689. var iid;
  5690. var f;
  5691. var e;
  5692. e = $("<div class='modal-footer'>");
  5693. e["append"](
  5694. "<button type='button' class='btn btn-default' data-dismiss='modal'>OK</button>"
  5695. );
  5696. f = $("<div class='modal-content'/>");
  5697. f["append"]($("<div class='modal-header'/>")["append"](
  5698. "<button type='button' class='close' data-dismiss='modal'>&times;</button><h4 id='message_dialog_title' class='modal-title'></h4>"
  5699. ));
  5700. f["append"]($(
  5701. "<div id='message_dialog_content' class='modal-body'>"));
  5702. f["append"](e);
  5703. iid = $(
  5704. "<div id='message_dialog' class='modal fade' role='dialog'/>"
  5705. )["append"]("<div class='modal-dialog'/>")["append"](f);
  5706. $("body")["append"](iid);
  5707. $("#message_dialog")["modal"]({
  5708. backdrop: "static",
  5709. keyboard: false
  5710. });
  5711. $(document)["on"]("shown.bs.modal", "#message_dialog", function () {
  5712. var height = $("#message_dialog>.modal-content")[
  5713. "outerHeight"]();
  5714. var windowHeight = $(document)["outerHeight"]();
  5715. if(height > windowHeight) {
  5716. $("#message_dialog")["css"]("overflow", "auto");
  5717. } else {
  5718. $("#message_dialog")["css"]("margin-top",
  5719. windowHeight / 2 - height / 2 - 40);
  5720. }
  5721. });
  5722. $(document)["on"]("hide.bs.modal", "#message_dialog", function () {});
  5723. };
  5724. /**
  5725. * @return {undefined}
  5726. */
  5727. this["setUpHotKeyConfigPage"] = function () {
  5728. $("button[data-itr=logout]")["before"]($(
  5729. "<button type='button' class='btn btn-warning btn-hotkeys' data-toggle='modal' data-target='#hotkeys_setting'>Hotkeys</button>"
  5730. ));
  5731. var pdataCur;
  5732. var dest;
  5733. var data;
  5734. data = $("<div class='modal-footer'>");
  5735. data["append"](
  5736. "<button onclick='resetDefaultHotkey();' type='button' class='btn btn-default'>Reset Default</button>"
  5737. );
  5738. data["append"](
  5739. "<button id='btn_save_hotkey' onclick='saveHotkeys();' type='button' class='btn btn-default' data-dismiss='modal'>Save</button>"
  5740. );
  5741. data["append"](
  5742. "<button type='button' class='btn btn-default' data-dismiss='modal'>Cancel</button>"
  5743. );
  5744. dest = $("<div class='modal-content'/>");
  5745. dest["append"]($("<div class='modal-header'/>")["append"](
  5746. "<button type='button' class='close' data-dismiss='modal'>&times;</button><h4 class='modal-title'>Hotkeys Setting</h4>"
  5747. ));
  5748. dest["append"]($("<div id='hotkey_modal_body' class='modal-body'>")[
  5749. "append"](myApp["getHotkeyDivHtml"]()));
  5750. dest["append"](data);
  5751. pdataCur = $(
  5752. "<div id='hotkeys_setting' class='modal fade' role='dialog'/>"
  5753. )["append"]("<div class='modal-dialog'/>")["append"](dest);
  5754. $("body")["append"](pdataCur);
  5755. $(document)["on"]("hide.bs.modal", "#hotkeys_setting", function () {
  5756. if(selectedHotkeyRow) {
  5757. selectedHotkeyRow["removeClass"](
  5758. "table-row-selected");
  5759. }
  5760. /** @type {null} */
  5761. selectedHotkeyRow = null;
  5762. myApp["refreshHotkeySettingPage"]();
  5763. });
  5764. $("#hotkey_table .row")["not"](".header")["click"](function () {
  5765. if(selectedHotkeyRow) {
  5766. selectedHotkeyRow["removeClass"](
  5767. "table-row-selected");
  5768. }
  5769. selectedHotkeyRow = $(this);
  5770. selectedHotkeyRow["addClass"]("table-row-selected");
  5771. });
  5772. };
  5773. /**
  5774. * @return {undefined}
  5775. */
  5776. window["saveHotkeys"] = function () {
  5777. var stack = $(".hotkey");
  5778. hotkeyMapping = {};
  5779. /** @type {number} */
  5780. var i = 0;
  5781. for(; i < stack["length"]; i++) {
  5782. hotkeyMapping[$(stack[i])["text"]()] = $(stack[i])["attr"](
  5783. "data-hotkeyid");
  5784. }
  5785. setLocalStorage("hotkeyMapping", hotkeyMapping);
  5786. var guid;
  5787. for(guid in hotkeyMessageSend) {
  5788. hotkeyMessageSend[guid] = $("#" + guid)["val"]();
  5789. }
  5790. setLocalStorage("hotkeyMessageSend", hotkeyMessageSend);
  5791. };
  5792. /**
  5793. * @return {undefined}
  5794. */
  5795. this["copyGameInfo"] = function () {
  5796. /** @type {string} */
  5797. var later = "";
  5798. later += "Current IP = " + myApp["getCurrentIP"]();
  5799. later += "\nRegion : " + $("#region option:selected")["text"]()[
  5800. "split"](" ")[0];
  5801. later += "\nGame mode : " + $("#gamemode option:selected")["text"]();
  5802. later += "\nParty Code : " + myApp["getCurrentPartyCode"]();
  5803. var stack = myApp["getLeaderBoard"]();
  5804. if(stack && stack["length"] != 0) {
  5805. /** @type {number} */
  5806. var i = 0;
  5807. for(; i < stack["length"]; i++) {
  5808. later += "\n" + (i + 1) + ". " + stack[i];
  5809. }
  5810. }
  5811. copyToClipboard(later);
  5812. };
  5813. /**
  5814. * @return {undefined}
  5815. */
  5816. window["resetDefaultHotkey"] = function () {
  5817. var _0x3495x124;
  5818. _0x3495x124 = hotkeyMapping;
  5819. defaultHotkeyMapping = {};
  5820. var unlock;
  5821. for(unlock in hotkeyConfig) {
  5822. if(hotkeyConfig[unlock]["defaultHotkey"] && hotkeyConfig[unlock]
  5823. ["defaultHotkey"] != "") {
  5824. /** @type {string} */
  5825. defaultHotkeyMapping[hotkeyConfig[unlock]["defaultHotkey"]] =
  5826. unlock;
  5827. }
  5828. }
  5829. hotkeyMapping = defaultHotkeyMapping;
  5830. myApp["refreshHotkeySettingPage"]();
  5831. hotkeyMapping = _0x3495x124;
  5832. /** @type {null} */
  5833. _0x3495x124 = null;
  5834. /** @type {null} */
  5835. defaultHotkeyMapping = null;
  5836. var guid;
  5837. for(guid in defaultHotkeyMessageSend) {
  5838. $("#" + guid)["val"](defaultHotkeyMessageSend[guid]);
  5839. }
  5840. };
  5841. /**
  5842. * @return {undefined}
  5843. */
  5844. this["refreshHotkeySettingPage"] = function () {
  5845. var stack = $(".hotkey");
  5846. /** @type {number} */
  5847. var i = 0;
  5848. for(; i < stack["length"]; i++) {
  5849. $(stack[i])["text"](" ");
  5850. }
  5851. var sel;
  5852. for(sel in hotkeyMapping) {
  5853. $("[data-hotkeyid=" + hotkeyMapping[sel] + "]")["text"](sel);
  5854. }
  5855. var guid;
  5856. for(guid in hotkeyMessageSend) {
  5857. $("#" + guid)["val"](hotkeyMessageSend[guid]);
  5858. }
  5859. };
  5860. /**
  5861. * @return {?}
  5862. */
  5863. this["getHotkeyDivHtml"] = function () {
  5864. /** @type {string} */
  5865. var later = "";
  5866. var p = $("<div id='hotkey_setting'></div>");
  5867. var nodes = $("<div id='hotkey_table' class='table'></div>");
  5868. var self = $("<div class='row header blue'></div>");
  5869. self["append"]($(
  5870. "<div class='cell' style='width:170px;'>Hotkey</div>"));
  5871. self["append"]($(
  5872. "<div class='cell' style='width:222px;'>Function</div>"
  5873. ));
  5874. self["append"]($("<div class='cell'>Message</div>"));
  5875. nodes["append"](self);
  5876. /** @type {null} */
  5877. var value = null;
  5878. var id;
  5879. for(id in hotkeyConfig) {
  5880. value = $("<div class='row'></div>");
  5881. value["append"]($("<div data-hotkeyId='" + id +
  5882. "' class='cell hotkey'>" + getHotkeyById(id) +
  5883. "</div>"));
  5884. value["append"]($("<div class='cell'>" + hotkeyConfig[id][
  5885. "name"
  5886. ] + "</div>"));
  5887. if(hotkeyConfig[id]["type"] == "TEXT") {
  5888. value["append"]($("<div class='cell'><input id='input_" +
  5889. id +
  5890. "' maxlength='200' style='width:100%;color:black;' type='text' value='" +
  5891. hotkeyMessageSend["input_" + id] +
  5892. "'></input></div>"));
  5893. } else {
  5894. value["append"]($("<div class='cell'> / </div>"));
  5895. }
  5896. nodes["append"](value);
  5897. }
  5898. p["append"](nodes);
  5899. later += $("<p>Step 1 : Click on the function item</p>")[0][
  5900. "outerHTML"
  5901. ];
  5902. later += $("<p>Step 2 : Press wanted hotkey to modify</p>")[0][
  5903. "outerHTML"
  5904. ];
  5905. later += $("<p>Press DEL button to del selected hotkey</p>")[0][
  5906. "outerHTML"
  5907. ];
  5908. later += $(
  5909. "<p>PS : Hotkey combination only support - (Ctrl) + (Alt) + 0-9,a-z,tab, enter</p>"
  5910. )[0]["outerHTML"];
  5911. later += $("<br></br>")[0]["outerHTML"];
  5912. later += p[0]["outerHTML"];
  5913. return $("<div/>")["append"](later)["html"]();
  5914. };
  5915. /**
  5916. * @return {undefined}
  5917. */
  5918. this["checkVersion"] = function () {
  5919. var version = getLocalStorage("lastestVersion");
  5920. if(!version || version != myApp["version"]) {
  5921. myApp["applyNewUpdate"]();
  5922. setLocalStorage("lastestVersion", myApp["version"]);
  5923. }
  5924. };
  5925. /**
  5926. * @return {undefined}
  5927. */
  5928. this["showAnnouncement"] = function () {
  5929. if(announcementTxt == "") {
  5930. var substitute = myApp["ajax"](URL_MESSAGE, "get", function (
  5931. dataAndEvents) {
  5932. announcementTxt = dataAndEvents["responseText"];
  5933. myApp["showMessage"]("Notice", announcementTxt);
  5934. })
  5935. } else {
  5936. myApp["showMessage"]("Update info", announcementTxt);
  5937. }
  5938. };
  5939. /**
  5940. * @return {undefined}
  5941. */
  5942. this["applyNewUpdate"] = function () {};
  5943. /**
  5944. * @return {undefined}
  5945. */
  5946. this["setupHints"] = function () {
  5947. this["setupHintsImpl"]($("button[data-target=#hotkeys_setting]"),
  5948. "Hotkey setup page.");
  5949. };
  5950. /**
  5951. * @param {Object} node
  5952. * @param {?} value
  5953. * @return {undefined}
  5954. */
  5955. this["setupHintsImpl"] = function (node, value) {
  5956. /** @type {string} */
  5957. var alpha = "hint--bottom hint--rounded";
  5958. node["addClass"](alpha);
  5959. node["attr"]("data-hint", value);
  5960. };
  5961. /**
  5962. * @param {?} url
  5963. * @param {?} method
  5964. * @param {?} next
  5965. * @param {(Function|number)} requestOptions
  5966. * @return {?}
  5967. */
  5968. this["ajax"] = function (url, method, next, requestOptions) {
  5969. /** @type {null} */
  5970. requestOptions = null;
  5971. var request;
  5972. try {
  5973. /** @type {XMLHttpRequest} */
  5974. request = new XMLHttpRequest;
  5975. } catch(e) {
  5976. try {
  5977. request = new ActiveXObject("Msxml2.XMLHTTP");
  5978. } catch(e) {
  5979. try {
  5980. request = new ActiveXObject("Microsoft.XMLHTTP");
  5981. } catch(e) {
  5982. alert("Your browser does not support Ajax.");
  5983. return false;
  5984. }
  5985. }
  5986. }
  5987. /**
  5988. * @return {undefined}
  5989. */
  5990. request["onreadystatechange"] = function () {
  5991. if(request["readyState"] == 4) {
  5992. next(request);
  5993. }
  5994. };
  5995. request["open"](method, url, true);
  5996. request["send"](requestOptions);
  5997. return request;
  5998. };
  5999. /**
  6000. * @param {string} base
  6001. * @return {?}
  6002. */
  6003. this["getSkinImage"] = function (base) {
  6004. if(!base || base == "") {
  6005. return null;
  6006. }
  6007. if(customSkin[base]) {
  6008. return customSkin[base];
  6009. } else {
  6010. if(skinDownloadQueue["indexOf"](base) == -1) {
  6011. skinDownloadQueue["push"](base);
  6012. }
  6013. return null;
  6014. }
  6015. };
  6016. /**
  6017. * @return {undefined}
  6018. */
  6019. this["downloadSkin"] = function () {
  6020. if(skinDownloadQueue["length"] != 0) {
  6021. var task = skinDownloadQueue["shift"]();
  6022. if(!customSkin[task]) {
  6023. if(skinDownloadFail[task] && skinDownloadFail[task] > 5) {
  6024. if(myApp["getCustomSkinUrl"]() === task) {
  6025. $("#skin_url")["val"]("DEFAULT")["trigger"](
  6026. "change");
  6027. }
  6028. } else {
  6029. window["postMessage"]({
  6030. action: Action["IMAGE"],
  6031. data: task
  6032. }, "*");
  6033. }
  6034. }
  6035. }
  6036. setTimeout(myApp["downloadSkin"], 2E3);
  6037. };
  6038. /**
  6039. * @param {?} value
  6040. * @return {undefined}
  6041. */
  6042. this["changePreviewImage"] = function (value) {
  6043. $("#preview-img")["fadeOut"](315, function () {
  6044. $(this)["attr"]("src", value)["bind"](
  6045. "onreadystatechange load",
  6046. function () {
  6047. if(this["complete"]) {
  6048. $(this)["fadeIn"](315);
  6049. }
  6050. });
  6051. });
  6052. };
  6053. }
  6054. /**
  6055. * @return {undefined}
  6056. */
  6057. function ChatRoom() {
  6058. /** @type {string} */
  6059. this["container"] = "";
  6060. /** @type {boolean} */
  6061. this["isShow"] = true;
  6062. /** @type {string} */
  6063. this["lastMsg"] = "";
  6064. /** @type {number} */
  6065. this["width"] = 340;
  6066. /** @type {number} */
  6067. this["height"] = 350;
  6068. var options = this;
  6069. /** @type {number} */
  6070. var _0x3495x132 = 0;
  6071. /**
  6072. * @return {undefined}
  6073. */
  6074. this["createChatBox"] = function () {
  6075. $(this["container"])["append"]("<div id='chatroom'></div>");
  6076. $("#overlays2")["append"](
  6077. "<div id='chatboxArea2'><input id='input_box2' type='text'></input></div>"
  6078. );
  6079. this["hide"]();
  6080. $("#chatboxArea2")["hide"]();
  6081. $("#chatroom")["mouseup"](function () {
  6082. options["resize"]();
  6083. });
  6084. };
  6085. /**
  6086. * @return {undefined}
  6087. */
  6088. options["resize"] = function () {
  6089. if($("#chatroom")["width"]() != this["width"] || $("#chatroom")[
  6090. "height"]() != this["height"]) {
  6091. if($("#chatroom")["perfectScrollbar"]) {
  6092. $("#chatroom")["perfectScrollbar"]("update");
  6093. }
  6094. } else {}
  6095. };
  6096. /**
  6097. * @param {?} container
  6098. * @return {undefined}
  6099. */
  6100. this["setContainer"] = function (container) {
  6101. this["container"] = container;
  6102. };
  6103. /**
  6104. * @return {undefined}
  6105. */
  6106. this["enter"] = function () {
  6107. if(this["isFocus"]()) {
  6108. $("#input_box2")["val"]("");
  6109. $("#input_box2")["blur"]();
  6110. $("#chatboxArea2")["hide"]();
  6111. } else {
  6112. this["focus"]();
  6113. }
  6114. };
  6115. /**
  6116. * @param {?} dep
  6117. * @return {undefined}
  6118. */
  6119. this["popup"] = function (dep) {
  6120. if(!myApp["isEnableChatpopup"] || this["isShow"]) {
  6121. return;
  6122. }
  6123. if($["toast"]) {
  6124. $["toast"](dep);
  6125. } else {
  6126. toastQueue["push"](dep);
  6127. }
  6128. };
  6129. /**
  6130. * @param {?} text
  6131. * @return {undefined}
  6132. */
  6133. this["popupInfo"] = function (text) {
  6134. this["popup"]({
  6135. text: escapeHtml(text),
  6136. showHideTransition: "slide",
  6137. icon: "info",
  6138. bgColor: "rgba(10, 10, 10, 0.8)",
  6139. allowToastClose: false,
  6140. hideAfter: 15E3,
  6141. stack: 10
  6142. });
  6143. };
  6144. /**
  6145. * @param {?} text
  6146. * @return {undefined}
  6147. */
  6148. this["popupWarning"] = function (text) {
  6149. this["popup"]({
  6150. text: escapeHtml(text),
  6151. showHideTransition: "slide",
  6152. icon: "warning",
  6153. bgColor: "rgba(10, 10, 10, 0.8)",
  6154. allowToastClose: false,
  6155. hideAfter: 15E3,
  6156. stack: 10
  6157. });
  6158. };
  6159. /**
  6160. * @param {(Object|string)} path
  6161. * @param {?} msg
  6162. * @return {undefined}
  6163. */
  6164. this["popupChat"] = function (path, msg) {
  6165. var resolved = escapeHtml(path);
  6166. var _0x3495x136 = this["replaceHKGIcon"](escapeHtml(msg));
  6167. if(path == "不留名 [slick]") {
  6168. resolved = this["replaceHKGIcon"](resolved);
  6169. }
  6170. this["popup"]({
  6171. heading: '<span class="toast_sender">' + resolved +
  6172. " : </span>",
  6173. text: '<span class="toast_chatmsg">' + _0x3495x136 +
  6174. "</span>",
  6175. showHideTransition: "fade",
  6176. bgColor: "rgba(10, 10, 10, 0.8)",
  6177. allowToastClose: false,
  6178. hideAfter: 15E3,
  6179. stack: 10
  6180. });
  6181. };
  6182. /**
  6183. * @param {?} deepDataAndEvents
  6184. * @return {undefined}
  6185. */
  6186. this["showSystemMessage"] = function (deepDataAndEvents) {
  6187. this["showSystemMessageImpl"](deepDataAndEvents);
  6188. this["popupInfo"](deepDataAndEvents);
  6189. };
  6190. /**
  6191. * @param {?} deepDataAndEvents
  6192. * @return {undefined}
  6193. */
  6194. this["showSystemWarning"] = function (deepDataAndEvents) {
  6195. this["showSystemMessageImpl"](deepDataAndEvents);
  6196. this["popupWarning"](deepDataAndEvents);
  6197. };
  6198. /**
  6199. * @param {?} dataAndEvents
  6200. * @return {undefined}
  6201. */
  6202. this["showSystemMessageImpl"] = function (dataAndEvents) {
  6203. if(!myApp["showSystemMessage"]()) {
  6204. return;
  6205. }
  6206. $("#chatroom")["append"]($("<div/>")["append"]($(
  6207. "<span class='system'/>")["text"](this["getTimeStr"]
  6208. () + dataAndEvents)));
  6209. this["scrollDown"]();
  6210. };
  6211. /**
  6212. * @return {?}
  6213. */
  6214. this["getTimeStr"] = function () {
  6215. /** @type {Date} */
  6216. var date = new Date;
  6217. var fromIndex = date["getMinutes"]();
  6218. fromIndex = fromIndex < 10 ? "0" + fromIndex : fromIndex;
  6219. return date["getHours"]() + ":" + fromIndex + " ";
  6220. };
  6221. /**
  6222. * @param {string} deepDataAndEvents
  6223. * @param {?} key
  6224. * @return {undefined}
  6225. */
  6226. this["receiveMessage"] = function (deepDataAndEvents, key) {
  6227. var relatedTarget = $("<div/>");
  6228. var r20 = $("<span class='time'>")["text"](this["getTimeStr"]());
  6229. var attachments = $("<span class='sender'>")["text"](
  6230. deepDataAndEvents + " : ");
  6231. if(deepDataAndEvents == "不留名 [slick]") {
  6232. attachments["html"](this["replaceHKGIcon"](attachments["html"]()));
  6233. }
  6234. relatedTarget["append"](r20);
  6235. relatedTarget["append"](attachments);
  6236. var camelKey = $("<span class='msg'>")["text"](key);
  6237. camelKey["html"](this["replaceHKGIcon"](camelKey["html"]()));
  6238. relatedTarget["append"](camelKey);
  6239. $("#chatroom")["append"](relatedTarget);
  6240. this["scrollDown"]();
  6241. this["popupChat"](deepDataAndEvents, key);
  6242. };
  6243. /**
  6244. * @param {Object} actualObject
  6245. * @return {?}
  6246. */
  6247. this["replaceHKGIcon"] = function (actualObject) {
  6248. /** @type {Object} */
  6249. var object = actualObject;
  6250. var root;
  6251. for(root in hkgIcon) {
  6252. object = object["replace"](new RegExp(escapeRegex(root), "g"),
  6253. '<img alt="$1" src="' + hkgIcon[root] + '">');
  6254. }
  6255. var stack = $('img[alt="$1"]');
  6256. /** @type {number} */
  6257. var i = 0;
  6258. for(; i < stack["length"]; i++) {
  6259. for(root in hkgIcon) {
  6260. if(stack[i]["src"] == hkgIcon[root]) {
  6261. $(stack[i])["attr"]("alt", root);
  6262. break;
  6263. }
  6264. }
  6265. }
  6266. return object;
  6267. };
  6268. /**
  6269. * @return {undefined}
  6270. */
  6271. this["scrollDown"] = function () {
  6272. if($("#chatroom")["perfectScrollbar"]) {
  6273. $("#chatroom")["scrollTop"]($("#chatroom")["prop"](
  6274. "scrollHeight"));
  6275. $("#chatroom")["perfectScrollbar"]("update");
  6276. }
  6277. };
  6278. /**
  6279. * @return {undefined}
  6280. */
  6281. this["show"] = function () {
  6282. $("#chatroom")["show"]();
  6283. /** @type {boolean} */
  6284. this["isShow"] = true;
  6285. this["scrollDown"]();
  6286. };
  6287. /**
  6288. * @return {undefined}
  6289. */
  6290. this["hide"] = function () {
  6291. $("#chatroom")["hide"]();
  6292. /** @type {boolean} */
  6293. this["isShow"] = false;
  6294. };
  6295. /**
  6296. * @return {?}
  6297. */
  6298. this["isFocus"] = function () {
  6299. return $("#input_box2")["is"](":focus");
  6300. };
  6301. /**
  6302. * @return {undefined}
  6303. */
  6304. this["focus"] = function () {
  6305. $("#chatboxArea2")["show"]();
  6306. $("#input_box2")["focus"]();
  6307. };
  6308. /**
  6309. * @return {undefined}
  6310. */
  6311. this["createScrollBar"] = function () {
  6312. $("#chatroom")["perfectScrollbar"]({
  6313. minScrollbarLength: 50,
  6314. suppressScrollX: false
  6315. });
  6316. };
  6317. }
  6318. /**
  6319. * @return {undefined}
  6320. */
  6321. function Minimap() {
  6322. var data;
  6323. var style;
  6324. var o;
  6325. var cache;
  6326. /** @type {number} */
  6327. var imgWidth = 250;
  6328. /** @type {number} */
  6329. var r = 250;
  6330. /** @type {number} */
  6331. var random = 5;
  6332. /** @type {string} */
  6333. var value = "#FFC0CB";
  6334. /** @type {boolean} */
  6335. var _0x3495x142 = false;
  6336. var interval;
  6337. /** @type {number} */
  6338. var time = 30;
  6339. /** @type {number} */
  6340. var speed = 1E3 / time;
  6341. var text = {};
  6342. /**
  6343. * @param {number} v
  6344. * @return {undefined}
  6345. */
  6346. this["createMap"] = function (v) {
  6347. if(v) {
  6348. imgWidth = r = v;
  6349. }
  6350. $("body")["append"]("<canvas id='minimapNode'>");
  6351. $("body")["append"]("<canvas id='minimap' >");
  6352. data = document["getElementById"]("minimap");
  6353. style = data["getContext"]("2d");
  6354. data["width"] = imgWidth;
  6355. data["height"] = r;
  6356. style["scale"](1, 1);
  6357. /** @type {number} */
  6358. style["globalAlpha"] = 0.2;
  6359. /** @type {string} */
  6360. style["fillStyle"] = "#535353";
  6361. style["fillRect"](0, 0, data["width"], data["height"]);
  6362. /** @type {string} */
  6363. style["strokeStyle"] = "#000000";
  6364. style["beginPath"]();
  6365. style["moveTo"](0, r / 5);
  6366. style["lineTo"](imgWidth, r / 5);
  6367. style["moveTo"](0, r / 5 * 2);
  6368. style["lineTo"](imgWidth, r / 5 * 2);
  6369. style["moveTo"](0, r / 5 * 3);
  6370. style["lineTo"](imgWidth, r / 5 * 3);
  6371. style["moveTo"](0, r / 5 * 4);
  6372. style["lineTo"](imgWidth, r / 5 * 4);
  6373. style["moveTo"](imgWidth / 5, 0);
  6374. style["lineTo"](imgWidth / 5, r);
  6375. style["moveTo"](imgWidth / 5 * 2, 0);
  6376. style["lineTo"](imgWidth / 5 * 2, r);
  6377. style["moveTo"](imgWidth / 5 * 3, 0);
  6378. style["lineTo"](imgWidth / 5 * 3, r);
  6379. style["moveTo"](imgWidth / 5 * 4, 0);
  6380. style["lineTo"](imgWidth / 5 * 4, r);
  6381. style["stroke"]();
  6382. /** @type {string} */
  6383. style["font"] = "bold 26px Ubuntu";
  6384. /** @type {string} */
  6385. style["textAlign"] = "center";
  6386. /** @type {string} */
  6387. style["textBaseline"] = "middle";
  6388. /** @type {string} */
  6389. style["fillStyle"] = "#pink";
  6390. style["fillText"]("A1", imgWidth / 5 / 2, r / 5 / 2);
  6391. style["fillText"]("A2", imgWidth / 5 / 2 * 3, r / 5 / 2);
  6392. style["fillText"]("A3", imgWidth / 5 / 2 * 5, r / 5 / 2);
  6393. style["fillText"]("A4", imgWidth / 5 / 2 * 7, r / 5 / 2);
  6394. style["fillText"]("A5", imgWidth / 5 / 2 * 9, r / 5 / 2);
  6395. style["fillText"]("B1", imgWidth / 5 / 2, r / 5 / 2 * 3);
  6396. style["fillText"]("B2", imgWidth / 5 / 2 * 3, r / 5 / 2 * 3);
  6397. style["fillText"]("B3", imgWidth / 5 / 2 * 5, r / 5 / 2 * 3);
  6398. style["fillText"]("B4", imgWidth / 5 / 2 * 7, r / 5 / 2 * 3);
  6399. style["fillText"]("B5", imgWidth / 5 / 2 * 9, r / 5 / 2 * 3);
  6400. style["fillText"]("C1", imgWidth / 5 / 2, r / 5 / 2 * 5);
  6401. style["fillText"]("C2", imgWidth / 5 / 2 * 3, r / 5 / 2 * 5);
  6402. style["fillText"]("C3", imgWidth / 5 / 2 * 5, r / 5 / 2 * 5);
  6403. style["fillText"]("C4", imgWidth / 5 / 2 * 7, r / 5 / 2 * 5);
  6404. style["fillText"]("C5", imgWidth / 5 / 2 * 9, r / 5 / 2 * 5);
  6405. style["fillText"]("D1", imgWidth / 5 / 2, r / 5 / 2 * 7);
  6406. style["fillText"]("D2", imgWidth / 5 / 2 * 3, r / 5 / 2 * 7);
  6407. style["fillText"]("D3", imgWidth / 5 / 2 * 5, r / 5 / 2 * 7);
  6408. style["fillText"]("D4", imgWidth / 5 / 2 * 7, r / 5 / 2 * 7);
  6409. style["fillText"]("D5", imgWidth / 5 / 2 * 9, r / 5 / 2 * 7);
  6410. style["fillText"]("E1", imgWidth / 5 / 2, r / 5 / 2 * 9);
  6411. style["fillText"]("E2", imgWidth / 5 / 2 * 3, r / 5 / 2 * 9);
  6412. style["fillText"]("E3", imgWidth / 5 / 2 * 5, r / 5 / 2 * 9);
  6413. style["fillText"]("E4", imgWidth / 5 / 2 * 7, r / 5 / 2 * 9);
  6414. style["fillText"]("E5", imgWidth / 5 / 2 * 9, r / 5 / 2 * 9);
  6415. o = document["getElementById"]("minimapNode");
  6416. cache = o["getContext"]("2d");
  6417. /** @type {number} */
  6418. o["width"] = v;
  6419. /** @type {number} */
  6420. o["height"] = v;
  6421. /** @type {number} */
  6422. cache["globalAlpha"] = 1;
  6423. cache["scale"](1, 1);
  6424. /** @type {string} */
  6425. cache["textAlign"] = "center";
  6426. /** @type {string} */
  6427. cache["textBaseline"] = "middle";
  6428. /** @type {string} */
  6429. cache["font"] = "bold 12px Ubuntu";
  6430. this["hide"]();
  6431. /** @type {number} */
  6432. interval = setInterval(function () {
  6433. minimap["drawNodes"]();
  6434. }, speed);
  6435. };
  6436. /**
  6437. * @param {?} dataAndEvents
  6438. * @return {?}
  6439. */
  6440. this["isExists"] = function (dataAndEvents) {
  6441. /** @type {number} */
  6442. var i = 0;
  6443. for(; i < nodeList["length"]; i++) {
  6444. if(dataAndEvents == nodeList[i][0]) {
  6445. return i;
  6446. }
  6447. }
  6448. return null;
  6449. };
  6450. /**
  6451. * @param {Object} done
  6452. * @return {undefined}
  6453. */
  6454. this["addNode"] = function (done) {
  6455. /** @type {Array} */
  6456. nodeList[nodeList["length"]] = [done["id"], done["name"], null,
  6457. null, "#448AFF", done["skinurl"], done["cellColor"]
  6458. ];
  6459. };
  6460. /**
  6461. * @param {?} dataAndEvents
  6462. * @return {undefined}
  6463. */
  6464. this["deleteNode"] = function (dataAndEvents) {};
  6465. /**
  6466. * @return {undefined}
  6467. */
  6468. this["drawNodes"] = function () {
  6469. var imgHeight = getLengthX();
  6470. var total = getLengthY();
  6471. cache["clearRect"](0, 0, o["width"], o["height"]);
  6472. var a = getCurrentX();
  6473. var b = getCurrentY();
  6474. if(a && b) {
  6475. text["x"] = nodeList[0][2];
  6476. text["y"] = nodeList[0][3];
  6477. }
  6478. nodeList[0][2] = a;
  6479. nodeList[0][3] = b;
  6480. nodeList[0][12] = a;
  6481. nodeList[0][13] = b;
  6482. if(myApp["isSpectating"]) {
  6483. nodeList[1][2] = getTop1X();
  6484. nodeList[1][3] = getTop1Y();
  6485. nodeList[1][12] = getTop1X();
  6486. nodeList[1][13] = getTop1Y();
  6487. }
  6488. /** @type {number} */
  6489. var i = 0;
  6490. for(; i < nodeList["length"]; i++) {
  6491. if(!nodeList[i][2] || (!nodeList[i][3] || (!nodeList[i][12] ||
  6492. (!nodeList[i][13] || nodeList[i][0] == "del")))) {
  6493. continue;
  6494. }
  6495. var newWidth;
  6496. var r2;
  6497. var r20;
  6498. /** @type {number} */
  6499. r20 = i == 1 ? 7 : random;
  6500. /** @type {number} */
  6501. nodeList[i][2] = ~~nodeList[i][2];
  6502. /** @type {number} */
  6503. nodeList[i][3] = ~~nodeList[i][3];
  6504. /** @type {number} */
  6505. nodeList[i][12] = ~~nodeList[i][12];
  6506. /** @type {number} */
  6507. nodeList[i][13] = ~~nodeList[i][13];
  6508. nodeList[i][12] += (imgHeight / 2 + nodeList[i][2] - (imgHeight /
  6509. 2 + nodeList[i][12])) / time;
  6510. nodeList[i][13] += (total / 2 + nodeList[i][3] - (total / 2 +
  6511. nodeList[i][13])) / time;
  6512. /** @type {number} */
  6513. newWidth = (imgHeight / 2 + nodeList[i][12]) / imgHeight *
  6514. imgWidth;
  6515. /** @type {number} */
  6516. r2 = (total / 2 + nodeList[i][13]) / total * r;
  6517. cache["beginPath"]();
  6518. cache["arc"](newWidth, r2, r20, 0, 2 * Math["PI"], false);
  6519. cache["fillStyle"] = nodeList[i][4];
  6520. /** @type {string} */
  6521. cache["strokeStyle"] = "black";
  6522. cache["fill"]();
  6523. cache["stroke"]();
  6524. if(i > 1) {
  6525. /** @type {string} */
  6526. cache["fillStyle"] = value;
  6527. cache["fillText"](nodeList[i][1], newWidth, r2 - 10);
  6528. }
  6529. }
  6530. if(text["x"] && (text["y"] && (!a || !b))) {
  6531. /** @type {number} */
  6532. newWidth = (imgHeight / 2 + text["x"]) / imgHeight * imgWidth;
  6533. /** @type {number} */
  6534. r2 = (total / 2 + text["y"]) / total * r;
  6535. cache["beginPath"]();
  6536. cache["moveTo"](newWidth - 3, r2 - 3);
  6537. cache["lineTo"](newWidth + 3, r2 + 3);
  6538. cache["moveTo"](newWidth + 3, r2 - 3);
  6539. cache["lineTo"](newWidth - 3, r2 + 3);
  6540. cache["stroke"]();
  6541. /** @type {string} */
  6542. cache["strokeStyle"] = "yellow";
  6543. cache["stroke"]();
  6544. }
  6545. };
  6546. /**
  6547. * @return {undefined}
  6548. */
  6549. this["hide"] = function () {
  6550. $("#minimap")["hide"]();
  6551. $("#minimapNode")["hide"]();
  6552. };
  6553. /**
  6554. * @return {undefined}
  6555. */
  6556. this["show"] = function () {
  6557. $("#minimap")["show"]();
  6558. $("#minimapNode")["show"]();
  6559. };
  6560. /**
  6561. * @param {Object} textAlt
  6562. * @return {undefined}
  6563. */
  6564. this["setDeadPosition"] = function (textAlt) {
  6565. if(textAlt) {
  6566. /** @type {Object} */
  6567. text = textAlt;
  6568. } else {
  6569. text = {};
  6570. }
  6571. };
  6572. }
  6573. $(document)["keydown"](function (event) {
  6574. if((event["target"]["tagName"]["toLowerCase"]() == "input" || event[
  6575. "target"]["tagName"]["toLowerCase"]() == "textarea") &&
  6576. event["keyCode"] != 13) {
  6577. return;
  6578. }
  6579. /** @type {string} */
  6580. var prefix = "";
  6581. if(isValidHotKey(event)) {
  6582. prefix = getPressedKey(event);
  6583. }
  6584. if(event["keyCode"] == 18) {
  6585. event["preventDefault"]();
  6586. }
  6587. if(selectedHotkeyRow) {
  6588. if(event["keyCode"] == 46) {
  6589. event["preventDefault"]();
  6590. selectedHotkeyRow["find"](".hotkey")["text"](prefix);
  6591. } else {
  6592. if(prefix != "") {
  6593. event["preventDefault"]();
  6594. var stack = $(".hotkey");
  6595. /** @type {number} */
  6596. var i = 0;
  6597. for(; i < stack["length"]; i++) {
  6598. if($(stack[i])["text"]() == prefix) {
  6599. return;
  6600. }
  6601. }
  6602. selectedHotkeyRow["find"](".hotkey")["text"](prefix);
  6603. selectedHotkeyRow["removeClass"]("table-row-selected");
  6604. /** @type {null} */
  6605. selectedHotkeyRow = null;
  6606. }
  6607. }
  6608. }
  6609. if(prefix == "") {
  6610. return;
  6611. }
  6612. if(hotkeyMapping[prefix]) {
  6613. event["preventDefault"]();
  6614. if(hotkeyConfig[hotkeyMapping[prefix]]) {
  6615. if(hotkeyConfig[hotkeyMapping[prefix]]["keyDown"]) {
  6616. hotkeyConfig[hotkeyMapping[prefix]]["keyDown"]();
  6617. }
  6618. }
  6619. }
  6620. });
  6621. $(document)["keyup"](function (event) {
  6622. if((event["target"]["tagName"]["toLowerCase"]() == "input" || event[
  6623. "target"]["tagName"]["toLowerCase"]() == "textarea") &&
  6624. event["keyCode"] != 13) {
  6625. return;
  6626. }
  6627. /** @type {string} */
  6628. var output = "";
  6629. if(isValidHotKey(event)) {
  6630. output = getPressedKey(event);
  6631. }
  6632. if(output == "") {
  6633. return;
  6634. }
  6635. if(hotkeyMapping[output]) {
  6636. event["preventDefault"]();
  6637. if(hotkeyConfig[hotkeyMapping[output]]) {
  6638. if(hotkeyConfig[hotkeyMapping[output]]["keyUp"]) {
  6639. hotkeyConfig[hotkeyMapping[output]]["keyUp"]();
  6640. } else {}
  6641. }
  6642. }
  6643. });
  6644. $("#overlays2")["mousedown"](function (event) {
  6645. if(event["button"] === 0) {
  6646. if(myApp["isEnableMouseW"] && (event["target"]["tagName"][
  6647. "toLowerCase"
  6648. ]() != "input" || event["target"]["tagName"][
  6649. "toLowerCase"
  6650. ]() != "textarea")) {
  6651. /** @type {boolean} */
  6652. myApp["autoW"] = true;
  6653. event["preventDefault"]();
  6654. }
  6655. } else {
  6656. if(event["button"] === 2) {
  6657. $("#opt_chatbox")["click"]();
  6658. }
  6659. }
  6660. });
  6661. $("#overlays2")["mouseup"](function (event) {
  6662. if(event["button"] === 0) {
  6663. if(!myApp["isEnableMouseW"] || (event["target"]["tagName"][
  6664. "toLowerCase"
  6665. ]() == "input" || event["target"]["tagName"][
  6666. "toLowerCase"
  6667. ]() == "textarea")) {
  6668. return;
  6669. }
  6670. /** @type {boolean} */
  6671. myApp["autoW"] = false;
  6672. event["preventDefault"]();
  6673. }
  6674. });
  6675. /**
  6676. * @param {Object} keys
  6677. * @return {?}
  6678. */
  6679. function isValidHotKey(keys) {
  6680. return keys["keyCode"] >= 48 && keys["keyCode"] <= 57 || (keys["keyCode"] >=
  6681. 65 && keys["keyCode"] <= 90 || (keys["keyCode"] == 9 || keys[
  6682. "keyCode"] == 13)) ? true : false;
  6683. }
  6684. /**
  6685. * @param {Object} event
  6686. * @return {?}
  6687. */
  6688. function getPressedKey(event) {
  6689. /** @type {string} */
  6690. var optsData = "";
  6691. if(event["ctrlKey"]) {
  6692. optsData += "CTRL_";
  6693. }
  6694. if(event["altKey"]) {
  6695. optsData += "ALT_";
  6696. }
  6697. if(event["keyCode"] == 9) {
  6698. optsData += "TAB";
  6699. } else {
  6700. if(event["keyCode"] == 13) {
  6701. optsData += "ENTER";
  6702. } else {
  6703. optsData += String["fromCharCode"](event["keyCode"]);
  6704. }
  6705. }
  6706. return optsData;
  6707. }
  6708. /**
  6709. * @param {string} elt
  6710. * @return {?}
  6711. */
  6712. function getHotkeyById(elt) {
  6713. var i;
  6714. for(i in hotkeyMapping) {
  6715. if(hotkeyMapping[i] == elt) {
  6716. return i;
  6717. }
  6718. }
  6719. return "";
  6720. }
  6721. var escapeHtml = function () {
  6722. var buf = {
  6723. '"': "&quot;",
  6724. "&": "&amp;",
  6725. "<": "&lt;",
  6726. ">": "&gt;"
  6727. };
  6728. return function (data) {
  6729. return data["replace"](/[\"&<>]/g, function (off) {
  6730. return buf[off];
  6731. });
  6732. };
  6733. }();
  6734. /**
  6735. * @param {Object} text
  6736. * @return {undefined}
  6737. */
  6738. function copyToClipboard(text) {
  6739. window["postMessage"]({
  6740. action: Action["COPY"],
  6741. data: text
  6742. }, "*");
  6743. }
  6744. /**
  6745. * @return {?}
  6746. */
  6747. window["onbeforeunload"] = function () {
  6748. return "Are you sure to QUIT game!?";
  6749. };
  6750. /**
  6751. * @param {Object} value
  6752. * @return {?}
  6753. */
  6754. function escapeRegex(value) {
  6755. return value["replace"](/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
  6756. }
  6757. var disconnectTimeout;
  6758. $(window)["focus"](function () {
  6759. /** @type {boolean} */
  6760. isWindowFocus = true;
  6761. if(disconnectTimeout) {
  6762. clearTimeout(disconnectTimeout);
  6763. }
  6764. })["blur"](function () {
  6765. /** @type {boolean} */
  6766. isWindowFocus = false;
  6767. });
  6768. /**
  6769. * @param {string} requestUrl
  6770. * @param {Object} templateId
  6771. * @return {?}
  6772. */
  6773. jQuery["cachedScript"] = function (requestUrl, templateId) {
  6774. templateId = $["extend"](templateId || {}, {
  6775. dataType: "script",
  6776. cache: true,
  6777. url: requestUrl
  6778. });
  6779. return jQuery["ajax"](templateId);
  6780. };
  6781. updateGameInfoDiv();
  6782. /**
  6783. * @return {undefined}
  6784. */
  6785. function updateGameInfoDiv() {
  6786. if($("#overlays")["is"](":visible")) {
  6787. myApp["updateLBInfo"]();
  6788. }
  6789. setTimeout(updateGameInfoDiv, 1E3);
  6790. }
  6791. clearOldNodesData();
  6792. /**
  6793. * @return {undefined}
  6794. */
  6795. function clearOldNodesData() {
  6796. /** @type {number} */
  6797. var i = 1;
  6798. for(; i < nodeList["length"]; i++) {
  6799. var start = nodeList[i][8];
  6800. if(start) {
  6801. var end = Date["now"]();
  6802. /** @type {number} */
  6803. var duration = end - start;
  6804. if(duration > 5E3) {
  6805. if(i < 2) {
  6806. /** @type {null} */
  6807. nodeList[i][2] = null;
  6808. /** @type {null} */
  6809. nodeList[i][3] = null;
  6810. } else {
  6811. /** @type {string} */
  6812. nodeList[i][0] = "del";
  6813. }
  6814. }
  6815. }
  6816. }
  6817. setTimeout(clearOldNodesData, 5E3);
  6818. }
  6819. updateLbDiv();
  6820. /**
  6821. * @return {undefined}
  6822. */
  6823. function updateLbDiv() {
  6824. if($("#div_lb")["is"](":visible")) {
  6825. var stack = getLB();
  6826. var result = getSelfIDs();
  6827. /** @type {string} */
  6828. var s = "";
  6829. if(stack) {
  6830. /** @type {number} */
  6831. var i = 0;
  6832. for(; i < stack["length"]; i++) {
  6833. /** @type {boolean} */
  6834. var _0x3495x15f = false;
  6835. /** @type {number} */
  6836. var length = 0;
  6837. for(; length < result["length"]; length++) {
  6838. if(result[length] == stack[i]["id"]) {
  6839. /** @type {boolean} */
  6840. _0x3495x15f = true;
  6841. break;
  6842. }
  6843. }
  6844. var _0x3495x161 = !stack[i]["name"] ? "An unnamed cell" : stack[
  6845. i]["name"];
  6846. if(_0x3495x15f) {
  6847. s += "<div class='self'>";
  6848. } else {
  6849. s += "<div>";
  6850. }
  6851. s += i + 1 + ". " + _0x3495x161 + "</div>";
  6852. }
  6853. }
  6854. /** @type {string} */
  6855. document["getElementById"]("lb_detail")["innerHTML"] = s;
  6856. }
  6857. setTimeout(updateLbDiv, 1E3);
  6858. }
  6859. updateScoreDiv();
  6860. /**
  6861. * @return {undefined}
  6862. */
  6863. function updateScoreDiv() {
  6864. var _0x3495x163 = getHighestScore();
  6865. var tag = getCell();
  6866. /** @type {Array} */
  6867. var clrs = [];
  6868. if(_0x3495x163 != 0) {
  6869. if(myApp["isShowScroll"]) {
  6870. clrs["push"]("Score: " + ~~(_0x3495x163 / 100));
  6871. }
  6872. if(tag && tag["length"] > 0) {
  6873. if(myApp["isShowSTE"]) {
  6874. var elements = myApp["getSTE"](tag);
  6875. clrs["push"]("STE: " + elements);
  6876. }
  6877. if(myApp["isShowBallTotal"]) {
  6878. clrs["push"]("[" + tag["length"] + "/16]");
  6879. }
  6880. }
  6881. }
  6882. if(myApp["isShowFPS"]) {
  6883. var push = getFPS();
  6884. clrs["push"]("FPS: " + push);
  6885. }
  6886. if(myApp["isShowPacketIO"]) {
  6887. var _0x3495x166 = getPacketIO();
  6888. clrs["push"]("PIO: " + _0x3495x166[0] + "|" + _0x3495x166[1]);
  6889. }
  6890. if(myApp["isEnableLockZoom"]) {
  6891. clrs["push"]("🔒");
  6892. }
  6893. if(isFreeSpec() && (myApp["specTeammate"] && (myApp["isStopMovement"] &&
  6894. nodeList[myApp["specTeammate"]]))) {
  6895. clrs["push"]("SPEC: " + nodeList[myApp["specTeammate"]][1]);
  6896. }
  6897. if(myApp["testing"]) {
  6898. clrs["push"]("*** TESTING ***");
  6899. }
  6900. if(clrs["length"] > 0) {
  6901. if(!$("#div_score")["is"](":visible")) {
  6902. $("#div_score")["show"]();
  6903. }
  6904. document["getElementById"]("div_score")["innerHTML"] = clrs["join"](
  6905. "&nbsp;&nbsp;&nbsp;")["trim"]();
  6906. } else {
  6907. $("#div_score")["hide"]();
  6908. }
  6909. setTimeout(updateScoreDiv, 500);
  6910. }
  6911. $("#gamemode")["parent"]()["append"](
  6912. '<div id="testing_div"> <div id="lbl_testing" style="height:20px;">Testing : </div>' +
  6913. '<input value="' + testingVal +
  6914. '" type="text" id="testing" class="form-control" placeholder="Testing data"></div>'
  6915. );
  6916. $("#testing")["change"](function () {
  6917. /** @type {number} */
  6918. testingVal = Number($("#testing")["val"]());
  6919. console["log"]("testingVal=" + testingVal);
  6920. });
  6921. $("#testing_div")["hide"]();
  6922. $(".agario-profile-picture")["hide"]();
  6923. $(".agario-profile-name-container")["hide"]();
  6924. $(".agario-profile-panel")["click"](function () {
  6925. if($(".agario-profile-picture")["is"](":visible")) {
  6926. $(".agario-profile-picture")["hide"]();
  6927. $(".agario-profile-name-container")["hide"]();
  6928. } else {
  6929. $(".agario-profile-picture")["show"]();
  6930. $(".agario-profile-name-container")["show"]();
  6931. }
  6932. });
  6933. /**
  6934. * @param {?} timeoutKey
  6935. * @param {?} error
  6936. * @return {undefined}
  6937. */
  6938. var handleResource = function (timeoutKey, error) {
  6939. if(!timeoutKey || !error) {
  6940. console["log"](" ** null in download object url, return;");
  6941. return;
  6942. }
  6943. if(customSkin[timeoutKey]) {
  6944. return;
  6945. }
  6946. /** @type {Image} */
  6947. var script = new Image;
  6948. /**
  6949. * @return {undefined}
  6950. */
  6951. script["onload"] = function () {
  6952. customSkin[timeoutKey] = this;
  6953. if(myApp["getCustomSkinUrl"]() == timeoutKey) {
  6954. myApp["changePreviewImage"](this["src"]);
  6955. }
  6956. };
  6957. /**
  6958. * @return {undefined}
  6959. */
  6960. script["onerror"] = function () {
  6961. window["URL"]["revokeObjectURL"](error);
  6962. if(skinDownloadFail[timeoutKey]) {
  6963. skinDownloadFail[timeoutKey] = skinDownloadFail[timeoutKey] +
  6964. 1;
  6965. } else {
  6966. /** @type {number} */
  6967. skinDownloadFail[timeoutKey] = 1;
  6968. }
  6969. console["log"]("Load image error");
  6970. };
  6971. script["src"] = error;
  6972. };
  6973. myApp["showAnnouncement"]();
Add Comment
Please, Sign In to add comment