Advertisement
Guest User

Untitled

a guest
Jul 20th, 2018
501
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 175.47 KB | None | 0 0
  1. const build = 1807170;
  2. var version;
  3. var showSideMenu;
  4. var hideSideMenu;
  5. (function() {
  6. function func(n, r, event) {
  7. if (!n) {
  8. return;
  9. }
  10. var total = this["location"]["href"]["split"]("://")[1]["split"]("/")[0]["split"](":")[0];
  11. var nextIdLookup = n["split"](",");
  12. var indexLookupKey = 0;
  13. for (; indexLookupKey < nextIdLookup["length"]; indexLookupKey++) {
  14. var currentIndex = nextIdLookup[indexLookupKey];
  15. if (currentIndex == total) {
  16. return;
  17. }
  18. if (!r) {
  19. continue;
  20. }
  21. currentIndex = total["split"]("." + currentIndex);
  22. if (currentIndex["length"] == 2 && !currentIndex[1]) {
  23. return;
  24. }
  25. }
  26. throw event || "error";
  27. }
  28. function f(value) {
  29. var locationMap = $("#" + value);
  30. if (locationMap["css"]("display") == "none") {
  31. startUpload();
  32. locationMap["show"](500);
  33. }
  34. }
  35. function startUpload() {
  36. $("#main-right")["children"]()["each"](function() {
  37. if ($(this)["css"]("display") == "block") {
  38. $(this)["hide"](500);
  39. }
  40. });
  41. }
  42. function exports() {
  43. function refresh() {
  44. function clear(fn) {
  45. jQuery["ajax"]({
  46. type : "POST",
  47. dataType : "json",
  48. url : "https://gota.io/api/servers",
  49. success : function(d) {
  50. var n;
  51. for (n in d) {
  52. var year = d[n];
  53. var mainWord;
  54. for (mainWord in year) {
  55. var values = year[mainWord];
  56. var m02 = values["playersCurrent"] + "/" + values["maxPlayers"];
  57. graph[values["name"]] = new Matrix3(values["name"], values["address"], m02, values["gamemode"], n["toLowerCase"](), values["ssl"]);
  58. graph[values["name"]]["playersCurrent"] = values["playersCurrent"];
  59. }
  60. }
  61. removeaToolTip();
  62. if (fn != null) {
  63. fn();
  64. } else {
  65. if (children != null) {
  66. remove(children["name"]);
  67. }
  68. }
  69. },
  70. error : function(deleted_model) {
  71. removeaToolTip();
  72. }
  73. });
  74. }
  75. function getData() {
  76. jQuery["ajax"]({
  77. type : "POST",
  78. dataType : "json",
  79. url : "https://gota.io/api/region",
  80. success : function(result) {
  81. var gotExpectedDetails = result["continent"]["toLowerCase"]();
  82. ok(gotExpectedDetails);
  83. var node;
  84. for (node in graph) {
  85. if (graph[node]["region"] == gotExpectedDetails) {
  86. if (graph[node]["playersCurrent"] < 128) {
  87. remove(node);
  88. break;
  89. }
  90. }
  91. }
  92. },
  93. error : function(deleted_model) {
  94. ok("eu");
  95. remove("Vendetta");
  96. }
  97. });
  98. }
  99. function ajax() {
  100. jQuery["ajax"]({
  101. type : "GET",
  102. dataType : "jsonp",
  103. crossDomain : true,
  104. url : "https://gamedata.gota.io/skinData.php",
  105. data : {
  106. "action" : "get"
  107. },
  108. async : false,
  109. success : function(xhr) {
  110. var nextIdLookup = JSON["parse"](JSON["parse"](xhr["json"])["names"]);
  111. var indexLookupKey;
  112. for (indexLookupKey in nextIdLookup) {
  113. var currentIndex = nextIdLookup[indexLookupKey];
  114. array[currentIndex] = 1;
  115. }
  116. },
  117. error : function(header, text, msg) {
  118. console["log"](header);
  119. console["log"]("Text status: " + text);
  120. console["log"]("Error thrown: " + msg);
  121. }
  122. });
  123. }
  124. popcornVideo = document["getElementById"]("canvas");
  125. item = popcornVideo["getContext"]("2d");
  126. popcornMedia = document["getElementById"]("minimap-canvas");
  127. memo = popcornMedia["getContext"]("2d");
  128. items = $("#main");
  129. _attachmentCallbacks = $("#party-panel");
  130. hist = $(".hud-panel");
  131. payload = $("#score-panel");
  132. extendedRegExp = $("#main-scrimmage");
  133. elem = $("#context-menu");
  134. component = $("#chat-input");
  135. _messageListeners = $("#leaderboard-header");
  136. trans = $("#scrimmage-custom");
  137. refreshFilteredDataSource();
  138. $(window)["resize"](update_measurements);
  139. update_measurements();
  140. _0x5D95 = false;
  141. window["onmousemove"] = function(options) {
  142. self["mouseRawX"] = options["clientX"];
  143. self["mouseRawY"] = options["clientY"];
  144. };
  145. window["onkeydown"] = function(selector) {
  146. var count = selector["which"] || selector["keyCode"] || selector["charCode"];
  147. if (_0x5291) {
  148. render(count);
  149. selector["preventDefault"]();
  150. return;
  151. }
  152. if (component["is"](":focus")) {
  153. return;
  154. }
  155. if (count == 27) {
  156. wrap(items);
  157. if (startApp($("#popup-profile") || startApp($("#popup-account-username")))) {
  158. find($("#popup-profile"));
  159. find($("#popup-account-username"));
  160. }
  161. }
  162. if (items["css"]("display") != "none") {
  163. return;
  164. }
  165. if (count == params["kEjectMass"]) {
  166. _0x5D95 = true;
  167. } else {
  168. if (count == params["kSplit"]) {
  169. self["sendPacket"](new PaintTools["sendKey"](17));
  170. } else {
  171. if (count == params["kToggleSpec"]) {
  172. self["sendPacket"](new PaintTools["sendKey"](18));
  173. } else {
  174. if (count == params["kDoubleSplit"]) {
  175. self["sendPacket"](new PaintTools["sendKey"](17));
  176. self["sendPacket"](new PaintTools["sendKey"](17));
  177. } else {
  178. if (count == params["kTripleSplit"]) {
  179. var _0x4AB7 = 0;
  180. for (; _0x4AB7 < 3; _0x4AB7++) {
  181. self["sendPacket"](new PaintTools["sendKey"](17));
  182. }
  183. } else {
  184. if (count == params["kQuadSplit"]) {
  185. _0x4AB7 = 0;
  186. for (; _0x4AB7 < 4; _0x4AB7++) {
  187. self["sendPacket"](new PaintTools["sendKey"](17));
  188. }
  189. } else {
  190. if (count == 38) {
  191. self["mouseZoom"] *= 1.025;
  192. self["mouseZoom"] = self["mouseZoom"] > 3 ? 3 : self["mouseZoom"] < .25 ? .25 : self["mouseZoom"];
  193. } else {
  194. if (count == 40) {
  195. self["mouseZoom"] *= .975;
  196. self["mouseZoom"] = self["mouseZoom"] > 3 ? 3 : self["mouseZoom"] < .25 ? .25 : self["mouseZoom"];
  197. }
  198. }
  199. }
  200. }
  201. }
  202. }
  203. }
  204. }
  205. };
  206. window["onkeyup"] = function(selector) {
  207. var ourSignature = selector["which"] || selector["keyCode"] || selector["charCode"];
  208. if (ourSignature == params["kEjectMass"]) {
  209. _0x5D95 = false;
  210. }
  211. };
  212. $(document)["on"]("mousewheel", function(result) {
  213. if (items["css"]("display") == "none" && result["target"]["id"] == "canvas") {
  214. var _0x4A99 = result["originalEvent"]["wheelDelta"] || result["originalEvent"]["deltaY"] * -1;
  215. if (_0x4A99 > 0) {
  216. self["mouseZoom"] *= 1.1;
  217. } else {
  218. self["mouseZoom"] *= .9;
  219. }
  220. self["mouseZoom"] = self["mouseZoom"] > 3 ? 3 : self["mouseZoom"] < .25 ? .25 : self["mouseZoom"];
  221. }
  222. });
  223. document["addEventListener"]("contextmenu", function(params) {
  224. params["preventDefault"]();
  225. resolve(params);
  226. });
  227. rebuildAttributes();
  228. perform_graphics_ops();
  229. var workers = window["location"]["href"]["split"]("#")["slice"](1)["join"]("#")["split"]("&");
  230. var node = "";
  231. if (workers[0]) {
  232. node = workers[0]["toLowerCase"]();
  233. }
  234. if (workers[1]) {
  235. _self = workers[1];
  236. }
  237. var callback = null;
  238. if (node != null && node != "") {
  239. node = node[0]["toUpperCase"]() + node["slice"](1);
  240. callback = function() {
  241. if (graph[node] != null) {
  242. remove(node);
  243. ok(graph[node]["region"]);
  244. } else {
  245. getData();
  246. }
  247. };
  248. } else {
  249. callback = getData;
  250. }
  251. clear(callback);
  252. setInterval(function() {
  253. clear(null);
  254. }, 9E5);
  255. var cast_receivers = new StatusPage["page"]({
  256. page : "zln04k70r03y"
  257. });
  258. cast_receivers["summary"]({
  259. success : function(result) {
  260. $(".color-description")["text"](result["status"]["description"]);
  261. $(".color-dot")["addClass"](result["status"]["indicator"]);
  262. }
  263. });
  264. array = {};
  265. ajax();
  266. send();
  267. $(window)["unload"](scopeReadChanged);
  268. self = new Self;
  269. PaintTools = new Game;
  270. $("#cUiForegroundColor")["spectrum"]({
  271. color : values["interfaceForegroundColor"],
  272. showAlpha : true,
  273. change : function(newRangeElements) {
  274. updateSubmitButton();
  275. }
  276. });
  277. $("#cUiBackgroundColor")["spectrum"]({
  278. color : values["interfaceBackgroundColor"],
  279. showAlpha : true,
  280. change : function(newRangeElements) {
  281. updateSubmitButton();
  282. }
  283. });
  284. $("#cGameBackground")["spectrum"]({
  285. color : values["gameBackgroundColor"],
  286. change : function(newRangeElements) {
  287. updateSubmitButton();
  288. }
  289. });
  290. $("#cGridColor")["spectrum"]({
  291. color : values["gridColor"],
  292. showAlpha : true,
  293. change : function(newRangeElements) {
  294. updateSubmitButton();
  295. }
  296. });
  297. $("#cBorderColor")["spectrum"]({
  298. color : values["borderColor"],
  299. showAlpha : true,
  300. change : function(newRangeElements) {
  301. updateSubmitButton();
  302. }
  303. });
  304. bind();
  305. updateSubmitButton();
  306. init();
  307. minX = Date["now"]();
  308. fps = 0;
  309. self["selfMsg"]("Welcome to Gota.io!");
  310. if (meta["enabled"] && meta["motd"] !== "") {
  311. self["selfMsg"]("MOTD: " + meta["motd"]);
  312. }
  313. if (meta["enabled"] && meta["particles"] && !fields["cDisableEffects"] && !fields["cDisableEventSkins"]) {
  314. settings = new Store(meta["particlesMax"]);
  315. }
  316. parseFonts();
  317. window["requestAnimationFrame"](prepare);
  318. }
  319. function responseCacheControl(next, req) {
  320. var static_ip = "transparent";
  321. if (req) {
  322. static_ip = req["toHexString"]();
  323. $(next)["css"]("color", static_ip);
  324. }
  325. }
  326. function update_measurements() {
  327. popcornVideo["width"] = $(window)["width"]() * scale;
  328. popcornVideo["height"] = $(window)["height"]() * scale;
  329. }
  330. function updateSubmitButton() {
  331. if (fields["cUiEnabled"]) {
  332. getData();
  333. } else {
  334. $("#cUiForegroundColor")["spectrum"]("set", defaults["uiForeground"]);
  335. $("#cUiBackgroundColor")["spectrum"]("set", defaults["uiBackground"]);
  336. $("#cGameBackground")["spectrum"]("set", defaults["background"]);
  337. $("#cGridColor")["spectrum"]("set", defaults["gridColor"]);
  338. $("#cBorderColor")["spectrum"]("set", defaults["borderColor"]);
  339. getData();
  340. }
  341. }
  342. function getData() {
  343. values["interfaceForegroundColor"] = $("#cUiForegroundColor")["spectrum"]("get")["toRgbString"]();
  344. values["interfaceBackgroundColor"] = $("#cUiBackgroundColor")["spectrum"]("get")["toRgbString"]();
  345. values["gameBackgroundColor"] = $("#cGameBackground")["spectrum"]("get")["toRgbString"]();
  346. values["gridColor"] = $("#cGridColor")["spectrum"]("get")["toRgbString"]();
  347. values["borderColor"] = $("#cBorderColor")["spectrum"]("get")["toRgbString"]();
  348. $(".fg-interface-color")["css"]({
  349. "color" : values["interfaceForegroundColor"]
  350. });
  351. $(".interface-color")["css"]({
  352. "color" : values["interfaceForegroundColor"],
  353. "background-color" : values["interfaceBackgroundColor"]
  354. });
  355. $(".main-cover")["css"]({
  356. "color" : values["interfaceForegroundColor"],
  357. "background-color" : values["interfaceBackgroundColor"]
  358. });
  359. $(".gota-btn")["css"]({
  360. "color" : values["interfaceForegroundColor"],
  361. "background-color" : values["interfaceBackgroundColor"]
  362. });
  363. $(".popup-panel")["css"]({
  364. "color" : values["interfaceForegroundColor"],
  365. "background-color" : values["interfaceBackgroundColor"]
  366. });
  367. $(".main-version")["css"]({
  368. "color" : values["interfaceForegroundColor"]
  369. });
  370. }
  371. function prepare() {
  372. var deltaX = Date["now"]() - minX;
  373. minX = Date["now"]();
  374. var FALSE = Math["min"](deltaX / 90, 1);
  375. imageX = imageX + deltaX;
  376. item["save"]();
  377. item["clearRect"](0, 0, popcornVideo["width"], popcornVideo["height"]);
  378. item["fillStyle"] = values["gameBackgroundColor"];
  379. item["fillRect"](0, 0, popcornVideo["width"], popcornVideo["height"]);
  380. var randomHexColor = 0;
  381. var sumOfFontSizes = 0;
  382. var numberOfCountedTextNodes = 0;
  383. var tileLayerCode = 0;
  384. var options = null;
  385. var i;
  386. for (i in self["myCells"]) {
  387. options = self["myCells"][i];
  388. if (options["steps"] > 0) {
  389. options["animate"](FALSE);
  390. }
  391. if (options != null) {
  392. randomHexColor = randomHexColor + options["x"];
  393. sumOfFontSizes = sumOfFontSizes + options["y"];
  394. tileLayerCode = tileLayerCode + options["size"];
  395. numberOfCountedTextNodes++;
  396. }
  397. }
  398. if (numberOfCountedTextNodes != 0) {
  399. self["centerX"] = randomHexColor / numberOfCountedTextNodes;
  400. self["centerY"] = sumOfFontSizes / numberOfCountedTextNodes;
  401. self["centerSteps"] = 0;
  402. if (fields["cDisableAutoZoom"]) {
  403. self["scale_base"] = .25 * Math["max"](popcornVideo["height"] / 1080, popcornVideo["width"] / 1920);
  404. } else {
  405. self["scale_base"] = Math["pow"](Math["min"](64 / tileLayerCode, 1), .4) * Math["max"](popcornVideo["height"] / 1080, popcornVideo["width"] / 1920);
  406. }
  407. }
  408. if (self["centerSteps"] > 0) {
  409. self["centerX"] += (self["centerX_"] - self["centerX"]) * FALSE;
  410. self["centerY"] += (self["centerY_"] - self["centerY"]) * FALSE;
  411. }
  412. var _0x4B4D = self["scale_base"] * self["mouseZoom"];
  413. self["scale"] = (9 * self["scale"] + _0x4B4D) / 10;
  414. item["scale"](self["scale"], self["scale"]);
  415. self["offsetX"] = popcornVideo["width"] / 2 / self["scale"] - self["centerX"];
  416. self["offsetY"] = popcornVideo["height"] / 2 / self["scale"] - self["centerY"];
  417. if (fields["cShowGrid"]) {
  418. moveFile(item);
  419. }
  420. item["translate"](self["offsetX"], self["offsetY"]);
  421. if (fields["cShowBorder"]) {
  422. load_options();
  423. }
  424. if (!fields["cHideFood"]) {
  425. for (i in self["foodObjects"]) {
  426. options = self["foodObjects"][i];
  427. if (options["steps"] > 0) {
  428. options["animate"](FALSE);
  429. }
  430. options["drawFood"](item);
  431. }
  432. }
  433. i = self["sorted"]["length"] - 1;
  434. for (; i >= 0; i--) {
  435. options = self["sorted"][i];
  436. if (options["steps"] > 0 && options["playerId"] != self["playerId"]) {
  437. options["animate"](FALSE);
  438. }
  439. options["draw"](item);
  440. }
  441. item["restore"]();
  442. if (!fields["cHideMinimap"]) {
  443. _setEndPoint(FALSE);
  444. }
  445. if (fields["cShowCoordinates"]) {
  446. handleUploads();
  447. }
  448. if (self["isConnected"]() && items["css"]("display") == "none") {
  449. var _self = self["mouseRawX"] * scale / self["scale"] - self["offsetX"];
  450. var _0x4B2F = self["mouseRawY"] * scale / self["scale"] - self["offsetY"];
  451. self["sendPacket"](new PaintTools["sendMouse"](_self, _0x4B2F));
  452. if (_0x5D95) {
  453. self["sendPacket"](new PaintTools["sendKey"](21));
  454. }
  455. }
  456. if (meta["enabled"] && meta["particles"] && !fields["cDisableEffects"] && !fields["cDisableEventSkins"] && !startApp(items)) {
  457. settings["onTick"](item, deltaX);
  458. }
  459. self["buffHolder"]["render"](item);
  460. artistTrack++;
  461. if (imageX >= 1E3) {
  462. $("#playerFps")["html"](artistTrack);
  463. imageX = 0;
  464. artistTrack = 0;
  465. }
  466. window["requestAnimationFrame"](prepare);
  467. }
  468. function load_options() {
  469. if (self["border"]["enabled"]) {
  470. item["lineWidth"] = 32;
  471. item["strokeStyle"] = values["borderColor"];
  472. item["strokeRect"](self["border"]["left"], self["border"]["top"], self["border"]["width"], self["border"]["height"]);
  473. item["lineWidth"] = 1;
  474. }
  475. }
  476. function moveFile(item) {
  477. var i = popcornVideo["height"] / self["scale"];
  478. var minboxVal = popcornVideo["width"] / self["scale"];
  479. item["beginPath"]();
  480. var value = self["offsetX"] % 100;
  481. for (; value < minboxVal; value = value + 100) {
  482. item["moveTo"](value, 0);
  483. item["lineTo"](value, i);
  484. }
  485. value = self["offsetY"] % 100;
  486. for (; value < i; value = value + 100) {
  487. item["moveTo"](0, value);
  488. item["lineTo"](minboxVal, value);
  489. }
  490. item["closePath"]();
  491. item["strokeStyle"] = values["gridColor"];
  492. item["globalAlpha"] = .25;
  493. item["stroke"]();
  494. item["globalAlpha"] = 1;
  495. }
  496. function handleUploads() {
  497. $(".coordinates")["css"]({
  498. "color" : values["interfaceForegroundColor"]
  499. });
  500. $(".coordinates")["html"]("X: " + self["centerX"]["toFixed"](2) + " Y: " + self["centerY"]["toFixed"](2));
  501. }
  502. function _setEndPoint(st) {
  503. if (!self["border"]["enabled"]) {
  504. return;
  505. }
  506. memo["clearRect"](0, 0, popcornMedia["width"], popcornMedia["height"]);
  507. memo["font"] = "12px Calibri";
  508. var type = 0;
  509. for (; type < self["party"]["length"]; type++) {
  510. var t = self["party"][type];
  511. if (t["x_"] != command && t["y_"] != command && t["id"] != self["playerId"]) {
  512. _compareBoundaryPoints(memo, t["name"], t["x"], t["y"], 4, t["mmColor"], true);
  513. t["x"] += (t["x_"] - t["x"]) * st;
  514. t["y"] += (t["y_"] - t["y"]) * st;
  515. }
  516. }
  517. _compareBoundaryPoints(memo, self["name"], self["centerX"], self["centerY"], 6, "#fefefe", false);
  518. }
  519. function scopeReadChanged() {
  520. if (_0x54AD == false && p_extl["playCounter"] > 0) {
  521. result["enabled"] = false;
  522. result["lockedName"] = "";
  523. }
  524. updater();
  525. }
  526. function Self() {
  527. this["socket"] = null;
  528. this["currentServer"] = null;
  529. this["currentServerName"] = null;
  530. this["spectate"] = false;
  531. this["name"] = "";
  532. this["playerId"] = -1;
  533. this["bucket"] = {};
  534. this["sorted"] = [];
  535. this["foodObjects"] = {};
  536. this["myCells"] = {};
  537. this["playerRegistry"] = new NativePrimitive;
  538. this["buffHolder"] = new renderTilesTransform;
  539. this["centerX"] = 0;
  540. this["centerY"] = 0;
  541. this["centerX_"] = 0;
  542. this["centerY_"] = 0;
  543. this["centerSteps"] = 0;
  544. this["scale"] = 1;
  545. this["scale_"] = 1;
  546. this["scale_base"] = 1;
  547. this["mouseZoom"] = 1;
  548. this["offsetX"] = 0;
  549. this["offsetY"] = 0;
  550. this["mouseRawX"] = 0;
  551. this["mouseRawY"] = 0;
  552. this["mouseX"] = 0;
  553. this["mouseY"] = 0;
  554. this["rainbow"] = false;
  555. this["party"] = [];
  556. this["partyIds"] = {};
  557. this["border"] = {};
  558. this["serverMaxCells"] = 16;
  559. this["score"] = 0;
  560. this["clearStats"]();
  561. setInterval(this["sendPing"]["bind"](this), 3E4);
  562. }
  563. function users(index) {
  564. this["id"] = index;
  565. this["type"] = 0;
  566. this["nameCache"] = null;
  567. this["skin"] = null;
  568. this["playerId"] = 0;
  569. this["color"] = null;
  570. this["x"] = 0;
  571. this["y"] = 0;
  572. this["x_"] = 0;
  573. this["y_"] = 0;
  574. this["size"] = 0;
  575. this["size_"] = 0;
  576. this["steps"] = 0;
  577. this["massLastAmount"] = -1;
  578. this["cache"] = null;
  579. }
  580. function NativePrimitive() {
  581. this["bucket"] = {};
  582. this["defaultData"];
  583. this["init"] = function() {
  584. this["defaultData"] = new Type(0);
  585. this["defaultData"]["name"] = "";
  586. this["defaultData"]["cellColor"] = "#aaa";
  587. };
  588. this["add"] = function(options) {
  589. this["bucket"][options["id"]] = options;
  590. };
  591. this["remove"] = function(ballNumber) {
  592. delete this["bucket"][ballNumber];
  593. };
  594. this["clear"] = function() {
  595. this["bucket"] = {};
  596. };
  597. this["getPlayer"] = function(ballNumber) {
  598. return this["bucket"][ballNumber];
  599. };
  600. this["getPlayerById"] = function(ballNumber) {
  601. var ball = this["bucket"][ballNumber];
  602. return ball != null ? ball : this["defaultData"];
  603. };
  604. this["init"]();
  605. }
  606. function Type(type) {
  607. this["id"] = type;
  608. this["name"];
  609. this["skin"];
  610. this["skinCache"];
  611. this["cellColor"];
  612. this["nameColor"] = "#fff";
  613. this["flags"] = 0;
  614. this["effect"] = 0;
  615. this["lowerName"] = false;
  616. this["nameCache"] = null;
  617. this["cacheUpdate"] = false;
  618. this["parseEffect"] = function(canCreateDiscussions) {
  619. if (canCreateDiscussions >= 64) {
  620. canCreateDiscussions = canCreateDiscussions - 64;
  621. this["lowerName"] = true;
  622. } else {
  623. this["lowerName"] = false;
  624. }
  625. this["effect"] = canCreateDiscussions;
  626. };
  627. this["getNameCache"] = function() {
  628. if (this["nameCache"] == null || this["cacheUpdate"] == true) {
  629. this["createNameCache"]();
  630. }
  631. return this["nameCache"]["canvas"];
  632. };
  633. this["createNameCache"] = function() {
  634. var popcornVideo = this["nameCache"] == null || this["nameCache"]["canvas"] == null ? document["createElement"]("canvas") : this["nameCache"]["canvas"];
  635. this["nameCache"] = popcornVideo["getContext"]("2d");
  636. var val = 54;
  637. var size_human = "bold 54pt Verdana";
  638. this["nameCache"]["font"] = size_human;
  639. popcornVideo["width"] = this["nameCache"]["measureText"](this["name"])["width"] + 4;
  640. popcornVideo["height"] = Math["floor"](val * 1.35);
  641. this["nameCache"]["font"] = size_human;
  642. this["nameCache"]["fillStyle"] = this["nameColor"];
  643. this["nameCache"]["fillText"](this["name"], 2, val);
  644. if (fields["cTextOutlines"] == true) {
  645. this["nameCache"]["lineWidth"] = 2;
  646. this["nameCache"]["strokeStyle"] = "#000";
  647. this["nameCache"]["strokeText"](this["name"], 2, val);
  648. }
  649. this["cacheUpdate"] = false;
  650. };
  651. this["setSkin"] = function(params) {
  652. if (params["length"] == 0) {
  653. return null;
  654. }
  655. var options = params["indexOf"]("[");
  656. if (options != -1) {
  657. var req = params["indexOf"]("]", options);
  658. if (req != -1) {
  659. params = params["substring"](options + 1, req);
  660. }
  661. }
  662. var osFamilies = params["toLowerCase"]();
  663. if (osFamilies["length"] != 0 && osFamilies != this["skin"]) {
  664. this["skin"] = osFamilies;
  665. this["skinCache"] = null;
  666. }
  667. };
  668. this["getSkin"] = function() {
  669. if (this["skinCache"] != null) {
  670. return this["skinCache"];
  671. }
  672. if (this["skin"] != null) {
  673. if (array[this["skin"]] != null) {
  674. if (array[this["skin"]] == 1) {
  675. array[this["skin"]] = new Image;
  676. array[this["skin"]]["src"] = "https://gamedata.gota.io/skins/" + this["skin"] + ".png";
  677. array[this["skin"]]["addEventListener"]("error", function() {
  678. delete array[name];
  679. });
  680. this["skinCache"] = array[this["skin"]];
  681. } else {
  682. this["skinCache"] = array[this["skin"]];
  683. return this["skinCache"];
  684. }
  685. } else {
  686. this["skin"] = null;
  687. }
  688. }
  689. return null;
  690. };
  691. }
  692. function Game() {
  693. }
  694. function cb(b, a, n) {
  695. var evdata = 0;
  696. for (; evdata < n["length"]; evdata++) {
  697. a["setUint8"](b, n["charCodeAt"](evdata));
  698. b++;
  699. }
  700. a["setUint8"](b, 0);
  701. }
  702. function log(id, self, selector) {
  703. var verb = 0;
  704. for (; verb < selector["length"]; verb++) {
  705. self["setUint16"](id, selector["charCodeAt"](verb), true);
  706. id = id + 2;
  707. }
  708. self["setUint16"](id, 0, true);
  709. }
  710. function require(options) {
  711. var tmp = "";
  712. for (; true;) {
  713. var start = options["getUint8"](options["offset"]);
  714. options["offset"]++;
  715. if (start == 0) {
  716. break;
  717. }
  718. tmp = tmp + String["fromCharCode"](start);
  719. }
  720. return tmp;
  721. }
  722. function compare(options) {
  723. var result = "";
  724. for (; true;) {
  725. var chunkCursor = options["getUint16"](options["offset"], true);
  726. options["offset"] += 2;
  727. if (chunkCursor == 0) {
  728. break;
  729. }
  730. result = result + String["fromCharCode"](chunkCursor);
  731. }
  732. return result;
  733. }
  734. function clickWithWebdriver(selector) {
  735. for (; true;) {
  736. var _0x4A99 = selector["getUint16"](selector["offset"], true);
  737. selector["offset"] += 2;
  738. if (_0x4A99 == 0) {
  739. break;
  740. }
  741. }
  742. }
  743. function buildJS(trace, done) {
  744. console["error"](trace["message"], trace["code"]);
  745. if (done) {
  746. switch(trace["code"]) {
  747. case "auth/user-disabled":
  748. alert("This account has been permanently suspended by an administrator.");
  749. break;
  750. case "auth/popup-closed-by-user":
  751. break;
  752. default:
  753. alert(trace["message"] + " (" + trace["code"] + ")");
  754. break;
  755. }
  756. }
  757. }
  758. function n(n) {
  759. return n["charAt"](0)["toUpperCase"]() + n["slice"](1);
  760. }
  761. function trim(text) {
  762. switch(text) {
  763. case "classic":
  764. return "Classic";
  765. break;
  766. case "instant":
  767. return "Instant Merge";
  768. break;
  769. case "megasplit":
  770. return "Mega Split";
  771. break;
  772. default:
  773. return text;
  774. break;
  775. }
  776. }
  777. function mouseout(target) {
  778. var _results = false;
  779. Object["keys"](target)["map"]((i) => {
  780. if (target[i]["wins"] > 0 || target[i]["losses"] > 0) {
  781. _results = true;
  782. }
  783. });
  784. return _results;
  785. }
  786. function text(elem, options) {
  787. var session_key = "";
  788. var total_rows = "";
  789. var oldPriority = "white";
  790. if (options["flags"]["STAFF"]) {
  791. total_rows = "Gota.io Staff";
  792. session_key = "build";
  793. oldPriority = "royalblue";
  794. } else {
  795. if (options["flags"]["VERIFIED"]) {
  796. total_rows = "Verified Player";
  797. session_key = "check_circle";
  798. } else {
  799. return;
  800. }
  801. }
  802. var result = document["createElement"]("i");
  803. result["className"] = "material-icons";
  804. result["id"] = "user-badge";
  805. result["innerText"] = session_key;
  806. result["style"]["color"] = oldPriority;
  807. $(result)["attr"]("data-balloon", total_rows);
  808. $(result)["attr"]("data-balloon-pos", "up");
  809. $(elem)["append"](result);
  810. }
  811. function Popcorn(options, entity) {
  812. var params = document["createElement"]("i");
  813. params["className"] = "material-icons";
  814. params["innerText"] = options;
  815. params["setAttribute"]("data-balloon", entity);
  816. params["setAttribute"]("data-balloon-pos", "up");
  817. return params;
  818. }
  819. function fn(result, options, state, searching) {
  820. var node = document["createElement"]("li");
  821. node["className"] = "user-embed";
  822. var params = document["createElement"]("img");
  823. params["src"] = result["avatar"];
  824. params["alt"] = result["username"];
  825. node["appendChild"](params);
  826. var a = document["createElement"]("div");
  827. a["className"] = "info";
  828. var b = document["createElement"]("div");
  829. b["className"] = "username";
  830. b["innerText"] = result["username"];
  831. a["appendChild"](b);
  832. text(b, result);
  833. var item = document["createElement"]("div");
  834. var hasExtend = false;
  835. var title = null;
  836. if (state) {
  837. title = n(result["presence"]["server"]);
  838. if (result["presence"]["timestamp"] + 1E3 * 60 < (new Date)["getTime"]() || result["presence"]["id"] === undefined) {
  839. item["className"] = "status offline";
  840. item["innerText"] = "Not playing on any server";
  841. } else {
  842. hasExtend = true;
  843. item["className"] = "status " + (result["presence"]["status"] === "ONLINE" ? "online" : "spectate");
  844. item["innerText"] = (result["presence"]["status"] === "ONLINE" ? "Playing " : "Spectating ") + result["presence"]["gamemode"] + " on " + title + " (ID " + result["presence"]["id"] + ")";
  845. }
  846. } else {
  847. item["className"] = "status pending";
  848. item["innerText"] = "Pending Friend Request";
  849. }
  850. a["appendChild"](item);
  851. var event = document["createElement"]("div");
  852. event["className"] = "actions";
  853. var popcornVideo = Popcorn("face", "View Profile");
  854. popcornVideo["addEventListener"]("click", function(canCreateDiscussions) {
  855. create(result, $("#main-social"));
  856. });
  857. event["append"](popcornVideo);
  858. if (state && hasExtend) {
  859. var popcornVideo = Popcorn("input", "Join Server");
  860. popcornVideo["addEventListener"]("click", function(canCreateDiscussions) {
  861. remove(title);
  862. self["play"]();
  863. self["selfMsg"](result["username"] + "'s ID is " + result["presence"]["id"]);
  864. find($("#main-social"));
  865. });
  866. event["appendChild"](popcornVideo);
  867. }
  868. if (!state) {
  869. var popcornVideo = Popcorn("done", "Add as Friend");
  870. popcornVideo["isHandlingRequest"] = false;
  871. popcornVideo["addEventListener"]("click", function(canCreateDiscussions) {
  872. if (popcornVideo["isHandlingRequest"]) {
  873. return;
  874. }
  875. popcornVideo["isHandlingRequest"] = true;
  876. firebase["auth"]()["currentUser"]["getIdToken"]()["then"]((textClass) => {
  877. fetch(HOST + "/api/v1/social/friends", {
  878. method : "POST",
  879. headers : {
  880. "Content-Type" : "application/json"
  881. },
  882. body : JSON["stringify"]({
  883. token : textClass,
  884. target : result["uid"],
  885. action : 2
  886. })
  887. })["then"]((options) => {
  888. return options["json"]();
  889. })["then"]((result) => {
  890. if (result["code"] !== 200) {
  891. alert(result["message"]);
  892. }
  893. popcornVideo["isHandlingRequest"] = false;
  894. })["catch"]((bbls) => {
  895. alert(bbls);
  896. popcornVideo["isHandlingRequest"] = false;
  897. });
  898. })["catch"]((name) => {
  899. buildJS(name, true);
  900. popcornVideo["isHandlingRequest"] = false;
  901. });
  902. });
  903. event["appendChild"](popcornVideo);
  904. }
  905. var this_stream = Popcorn("block", "Remove Friend");
  906. this_stream["isHandlingRequest"] = false;
  907. this_stream["addEventListener"]("click", function(canCreateDiscussions) {
  908. if (this_stream["isHandlingRequest"] || !confirm("Are you sure you want to remove " + result["username"] + " as your friend?")) {
  909. return;
  910. }
  911. this_stream["isHandlingRequest"] = true;
  912. firebase["auth"]()["currentUser"]["getIdToken"]()["then"]((textClass) => {
  913. fetch(HOST + "/api/v1/social/friends", {
  914. method : "POST",
  915. headers : {
  916. "Content-Type" : "application/json"
  917. },
  918. body : JSON["stringify"]({
  919. token : textClass,
  920. target : result["uid"],
  921. action : 4
  922. })
  923. })["then"]((options) => {
  924. return options["json"]();
  925. })["then"]((result) => {
  926. alert(result["message"]);
  927. if (result["code"] === 200) {
  928. firebase["database"]()["ref"](options["callbacks"][result["uid"]])["off"]();
  929. options["elements"][result["uid"]]["remove"]();
  930. delete options["callbacks"][result["uid"]];
  931. delete options["elements"][result["uid"]];
  932. }
  933. this_stream["isHandlingRequest"] = false;
  934. })["catch"]((bbls) => {
  935. alert(bbls);
  936. this_stream["isHandlingRequest"] = false;
  937. });
  938. })["catch"]((name) => {
  939. buildJS(name, true);
  940. this_stream["isHandlingRequest"] = false;
  941. });
  942. });
  943. event["appendChild"](this_stream);
  944. a["appendChild"](event);
  945. node["appendChild"](a);
  946. if (searching) {
  947. return options["appendChild"](node);
  948. } else {
  949. return node;
  950. }
  951. }
  952. function create(result, value) {
  953. wrap(value);
  954. append($("#popup-profile"));
  955. $("#popup-profile-text")["empty"]();
  956. $("#profile-username")["text"](result["username"]);
  957. $("#profile-avatar")["attr"]("src", result["avatar"]);
  958. $("#profile-avatar")["attr"]("alt", result["username"]);
  959. $("#profile-level")["text"]("Level " + result["levelData"]["level"]);
  960. $("#profile-username")["off"]("click");
  961. if (result["uid"] == expected["uid"]) {
  962. $("#profile-username")["on"]("click", function() {
  963. $("#popup-profile")["hide"]();
  964. wrap($("#popup-account-username"));
  965. });
  966. $("#profile-username")["css"]("cursor", "pointer");
  967. } else {
  968. $("#profile-username")["css"]("cursor", "default");
  969. }
  970. if (result["flags"]["STAFF"]) {
  971. $("#profile-avatar")["addClass"]("spin");
  972. } else {
  973. $("#profile-avatar")["removeClass"]("spin");
  974. }
  975. text($("#profile-username"), result);
  976. var self = document["createElement"]("div");
  977. self["className"] = "profile-ranked-container";
  978. var item = document["createElement"]("span");
  979. item["innerText"] = "Ranked";
  980. item["className"] = "profle-inline-title";
  981. $("#popup-profile-text")["append"](item);
  982. Object["keys"](result["ranked"])["map"]((selector) => {
  983. gamemodeData = result["ranked"][selector];
  984. var item = document["createElement"]("div");
  985. var settings = document["createElement"]("span");
  986. settings["innerText"] = trim(selector);
  987. item["appendChild"](settings);
  988. var this_stream = document["createElement"]("span");
  989. this_stream["innerText"] = gamemodeData["wins"] + "W/" + gamemodeData["losses"] + "L";
  990. item["appendChild"](this_stream);
  991. var value = document["createElement"]("span");
  992. value["innerText"] = gamemodeData["mmr"] + "MMR";
  993. item["appendChild"](value);
  994. self["appendChild"](item);
  995. });
  996. if (!mouseout(result["ranked"])) {
  997. var item = document["createElement"]("span");
  998. item["className"] = "ranked-info-unavailable";
  999. item["innerText"] = "User has not played ranked before";
  1000. $("#popup-profile-text")["append"](item);
  1001. }
  1002. $("#popup-profile-text")["append"](self);
  1003. }
  1004. function uploadFiles(item) {
  1005. if (_0x5129) {
  1006. return;
  1007. }
  1008. var self = $("#social-friends .user-list")[0];
  1009. var params = $("#social-friends .user-list")[1];
  1010. $("#social-uid")["text"](item["uid"]);
  1011. firebase["database"]()["ref"]("/friendships/" + item["uid"])["on"]("value", function(options) {
  1012. if (options["val"]() === null) {
  1013. var obj = document["createElement"]("div");
  1014. var params = document["createElement"]("span");
  1015. obj["className"] = "title-text center";
  1016. params["innerText"] = "You have no friends 😥";
  1017. obj["appendChild"](params);
  1018. self["appendChild"](obj);
  1019. return;
  1020. }
  1021. var obj = options["val"]();
  1022. var callback = false;
  1023. Object["keys"](obj)["map"]((i) => {
  1024. var name = obj[i];
  1025. if (!name && !callback) {
  1026. callback = true;
  1027. firebase["auth"]()["currentUser"]["getIdToken"]()["then"]((textClass) => {
  1028. fetch(HOST + "/api/v1/social/friends/pending", {
  1029. method : "POST",
  1030. headers : {
  1031. "Content-Type" : "application/json"
  1032. },
  1033. body : JSON["stringify"]({
  1034. token : textClass
  1035. })
  1036. })["then"]((options) => {
  1037. return options["json"]();
  1038. })["then"]((result) => {
  1039. if (result["code"] === 200) {
  1040. result["profiles"]["forEach"]((a) => {
  1041. if (!options["pendingFriends"]["includes"](a)) {
  1042. options["pendingFriends"]["push"](a["uid"]);
  1043. }
  1044. if (options["elements"][a["uid"]]) {
  1045. var result = fn(a, options["elements"][a["uid"]], false, false);
  1046. params["replaceChild"](result, options["elements"][a["uid"]]);
  1047. options["elements"][i] = result;
  1048. return;
  1049. }
  1050. options["elements"][a["uid"]] = fn(a, params, false, true);
  1051. });
  1052. }
  1053. });
  1054. })["catch"]((name) => {
  1055. return buildJS(name, false);
  1056. });
  1057. return;
  1058. }
  1059. if (!options["callbacks"][i]) {
  1060. var newname = "/users/" + i;
  1061. options["callbacks"][i] = newname;
  1062. firebase["database"]()["ref"](newname)["on"]("value", function(MapData) {
  1063. if (MapData["val"]() === null) {
  1064. return;
  1065. }
  1066. var result = MapData["val"]();
  1067. options["timestamps"][result["uid"]] = result["presence"]["timestamp"];
  1068. if (options["pendingFriends"]["includes"](i)) {
  1069. options["pendingFriends"]["slice"](options["pendingFriends"]["indexOf"](i), 1);
  1070. options["elements"][i]["remove"]();
  1071. var next = fn(result, options["elements"][i], true, false);
  1072. self["appendChild"](next);
  1073. options["elements"][i] = next;
  1074. return;
  1075. }
  1076. if (options["elements"][i]) {
  1077. next = fn(result, options["elements"][i], true, false);
  1078. self["replaceChild"](next, options["elements"][i]);
  1079. options["elements"][i] = next;
  1080. return;
  1081. }
  1082. options["elements"][i] = fn(result, self, true, true);
  1083. });
  1084. }
  1085. });
  1086. });
  1087. setInterval(function() {
  1088. var j;
  1089. for (j in options["timestamps"]) {
  1090. if (!options["timestamps"]["hasOwnProperty"](j)) {
  1091. return;
  1092. }
  1093. var _shapeB = options["timestamps"][j];
  1094. if (_shapeB + 1E3 * 60 < (new Date)["getTime"]() || _shapeB === undefined) {
  1095. var colorRamps = options["elements"][j]["children"][1]["children"][1];
  1096. colorRamps["innerText"] = "Not playing on any server";
  1097. colorRamps["className"] = "status offline";
  1098. var result = options["elements"][j]["children"][1]["children"][2]["children"][1];
  1099. if (result["dataset"]["balloon"] === "Join Server") {
  1100. result["remove"]();
  1101. }
  1102. }
  1103. }
  1104. }, 1E3 * 60);
  1105. _0x5129 = true;
  1106. }
  1107. function send() {
  1108. function upld(isMouseandNotTouch, argImage) {
  1109. if (isMouseandNotTouch) {
  1110. $(argImage)["prop"]("disabled", false);
  1111. $(argImage)["text"]("Set");
  1112. return;
  1113. }
  1114. $(argImage)["prop"]("disabled", true);
  1115. $(argImage)["text"]("...");
  1116. }
  1117. if (meta["enabled"] && !fields["cDisableEventSkins"]) {
  1118. $("body")["toggleClass"]("event-" + meta["key"]);
  1119. }
  1120. $(".server-tab")["on"]("click", function() {
  1121. var gotExpectedDetails = $(this)["attr"]("region");
  1122. ok(gotExpectedDetails);
  1123. });
  1124. $("#btn-play")["on"]("click", function() {
  1125. if (Object["keys"](self["myCells"])["length"] != 0 && this["currentServerName"] == children["name"]) {
  1126. find(items);
  1127. return;
  1128. }
  1129. self["spectate"] = false;
  1130. if (p_extl["incrementPlay"]() && typeof adplayer != "undefined") {
  1131. adplayer["startPreRoll"]();
  1132. find(items);
  1133. refreshFilteredDataSource();
  1134. } else {
  1135. self["play"]();
  1136. }
  1137. });
  1138. $("#btn-servers")["on"]("click", function() {
  1139. f("main-servers");
  1140. });
  1141. $("#btn-options")["on"]("click", function() {
  1142. f("main-options");
  1143. });
  1144. $("#btn-themes")["on"]("click", function() {
  1145. f("main-themes");
  1146. });
  1147. $("#btn-cellpanel")["on"]("click", function() {
  1148. f("main-subpanel");
  1149. });
  1150. $("#btn-forums")["on"]("click", function() {
  1151. window["open"]("https://forums.gota.io", "_blank");
  1152. });
  1153. $("#btn-trello")["on"]("click", function() {
  1154. window["open"]("https://trello.com/b/G1yNkEDH/gotaio", "_blank");
  1155. });
  1156. $("#name-box")["keypress"](function(options) {
  1157. if (options["keyCode"] == 13 && $(this)["is"](":focus")) {
  1158. self["play"]();
  1159. }
  1160. });
  1161. $("#btn-spec")["on"]("click", function() {
  1162. if (self["spectate"] && this["currentServerName"] == children["name"]) {
  1163. find(items);
  1164. return;
  1165. }
  1166. self["spectate"] = true;
  1167. if (p_extl["incrementPlay"]() && typeof adplayer != "undefined") {
  1168. adplayer["startPreRoll"]();
  1169. find(items);
  1170. refreshFilteredDataSource();
  1171. } else {
  1172. self["spec"]();
  1173. }
  1174. });
  1175. $("#chat-input")["keyup"](function(options) {
  1176. var popcornVideo = $(this)["val"]();
  1177. var result = popcornVideo["split"](" ");
  1178. if (options["keyCode"] == 13 && $(this)["is"](":focus")) {
  1179. fetch($(this)["val"]());
  1180. }
  1181. if (popcornVideo["length"] == 0 || popcornVideo["endsWith"](" ") || options["keyCode"] == 13) {
  1182. $("#autocomplete-panel")["html"]("");
  1183. $("#autocomplete-panel")["hide"]();
  1184. } else {
  1185. if (popcornVideo["startsWith"]("/")) {
  1186. if (result["length"] > 1) {
  1187. return;
  1188. }
  1189. $("#autocomplete-panel")["html"]("<table><thead><tr><th>Command</th><th>Aliases</th><th>Description</th></tr></thead><tbody></tbody></table>");
  1190. var i = -1;
  1191. Object["values"](target)["map"]((result) => {
  1192. if ((i = result["triggers"]["findIndex"]((options) => {
  1193. return options["toLowerCase"]()["startsWith"](result[0]["substring"](1)["toLowerCase"]());
  1194. })) > -1) {
  1195. $("#autocomplete-panel tbody")["append"]("<tr><td>" + result["triggers"][i] + "</td><td>" + result["triggers"] + "</td><td>" + result["description"] + "</td></tr>");
  1196. }
  1197. });
  1198. if ($("#autocomplete-panel tbody")["children"]()["length"] == 0) {
  1199. $("#autocomplete-panel")["hide"]();
  1200. } else {
  1201. $("#autocomplete-panel")["show"]();
  1202. }
  1203. } else {
  1204. if (result[result["length"] - 1]["startsWith"](":")) {
  1205. $("#autocomplete-panel")["html"]("");
  1206. var osFamilies = Object["keys"](bottoms)["filter"]((options) => {
  1207. return options["toLowerCase"]()["includes"](result[result["length"] - 1]["substring"](1)["toLowerCase"]());
  1208. });
  1209. var location_feature_ids = Object["keys"](gifEmoteList)["filter"]((options) => {
  1210. return options["toLowerCase"]()["includes"](result[result["length"] - 1]["substring"](1)["toLowerCase"]());
  1211. });
  1212. if (osFamilies["length"] === 0 && location_feature_ids["length"] === 0) {
  1213. $("#autocomplete-panel")["html"]("");
  1214. $("#autocomplete-panel")["hide"]();
  1215. return;
  1216. } else {
  1217. $("#autocomplete-panel")["show"]();
  1218. }
  1219. if (osFamilies["length"] > 0) {
  1220. $("#autocomplete-panel")["append"]("<h3>Emotes</h3>");
  1221. osFamilies["forEach"]((rel) => {
  1222. $("#autocomplete-panel")["append"]("<img name='" + rel + "' title='" + rel + "' src='https://gamedata.gota.io/emotes/" + rel + ".png' />");
  1223. });
  1224. }
  1225. if (location_feature_ids["length"] > 0) {
  1226. $("#autocomplete-panel")["append"]("<h3>Gifs</h3>");
  1227. location_feature_ids["forEach"]((rel) => {
  1228. $("#autocomplete-panel")["append"]("<img name='" + rel + "' title='" + rel + "' src='https://gamedata.gota.io/emotes/gifs/" + rel + ".gif' />");
  1229. });
  1230. }
  1231. }
  1232. }
  1233. }
  1234. });
  1235. $("#autocomplete-panel")["on"]("click", function(result) {
  1236. var workers = forEach()["split"](" ");
  1237. if (result["target"]["nodeName"] === "TD") {
  1238. $get("/" + result["target"]["parentElement"]["children"][0]["innerHTML"] + " ");
  1239. $("#autocomplete-panel")["html"]("");
  1240. $("#autocomplete-panel")["hide"]();
  1241. $("#chat-input")["focus"]();
  1242. } else {
  1243. if (result["target"]["nodeName"] === "IMG") {
  1244. $get(forEach()["substring"](0, forEach()["length"] - workers[workers["length"] - 1]["length"]) + result["target"]["attributes"]["name"]["nodeValue"] + " ");
  1245. $("#autocomplete-panel")["html"]("");
  1246. $("#autocomplete-panel")["hide"]();
  1247. $("#chat-input")["focus"]();
  1248. }
  1249. }
  1250. });
  1251. $("#chat-emote-btn")["css"]("background-image", "url(https://gamedata.gota.io/emotes/" + _tabInfo[Math["floor"](Math["random"]() * _tabInfo["length"])] + ".png)");
  1252. $("#chat-emote-btn")["on"]("click", function() {
  1253. $("#emote-panel")["toggle"]();
  1254. });
  1255. $("#emote-panel ul li img")["on"]("click", function(result) {
  1256. sendResponses(result["target"]["name"] + " ");
  1257. $("#chat-input")["focus"]();
  1258. });
  1259. (function() {
  1260. function onload(node) {
  1261. pos = node["clientX"];
  1262. arg = node["clientY"];
  1263. start = parseInt(document["defaultView"]["getComputedStyle"](result)["width"], 10);
  1264. argN2 = parseInt(document["defaultView"]["getComputedStyle"](result)["height"], 10);
  1265. document["documentElement"]["addEventListener"]("mousemove", noop, false);
  1266. document["documentElement"]["addEventListener"]("mouseup", success, false);
  1267. }
  1268. function noop(options) {
  1269. result["style"]["width"] = start + options["clientX"] - pos + "px";
  1270. result["style"]["height"] = argN2 - (options["clientY"] - arg) + "px";
  1271. }
  1272. function success(retu_data) {
  1273. document["documentElement"]["removeEventListener"]("mousemove", noop, false);
  1274. document["documentElement"]["removeEventListener"]("mouseup", success, false);
  1275. }
  1276. var result = document["getElementById"]("chat-panel");
  1277. document["getElementById"]("chat-resize")["addEventListener"]("mousedown", onload, false);
  1278. var pos;
  1279. var arg;
  1280. var start;
  1281. var argN2;
  1282. })();
  1283. $(".checkbox-options")["on"]("change", function(canCreateDiscussions) {
  1284. startCircleAnim($(this));
  1285. });
  1286. $(".options-container select")["on"]("change", function(canCreateDiscussions) {
  1287. bindEvents($(this));
  1288. });
  1289. $("#btn-login")["on"]("click", function() {
  1290. self["login"]();
  1291. });
  1292. $("#id-box")["keypress"](function(options) {
  1293. if (options["keyCode"] == 13 && $(this)["is"](":focus")) {
  1294. if ($("#pw-box")["val"]()["length"] < 1) {
  1295. $("#pw-box")["focus"]();
  1296. } else {
  1297. self["login"]();
  1298. }
  1299. }
  1300. });
  1301. $("#pw-box")["keypress"](function(options) {
  1302. if (options["keyCode"] == 13 && $(this)["is"](":focus")) {
  1303. if ($("#id-box")["val"]() < 1) {
  1304. $("#id-box")["focus"]();
  1305. } else {
  1306. self["login"]();
  1307. }
  1308. }
  1309. });
  1310. $("#btn-cancel")["on"]("click", function() {
  1311. find($("#popup-login"));
  1312. append(items);
  1313. });
  1314. $("#btn-changelog")["on"]("click", function() {
  1315. find($("#popup-changelog"));
  1316. append(items);
  1317. window["open"](processEvaluatorsCallback, "_blank");
  1318. });
  1319. $("#btn-close-changelog")["on"]("click", function() {
  1320. find($("#popup-changelog"));
  1321. append(items);
  1322. });
  1323. $("#btn-accept")["on"]("click", function() {
  1324. self["sendPacket"](new PaintTools["sendInviteResponse"](true));
  1325. find($("#popup-party"));
  1326. });
  1327. $("#btn-decline")["on"]("click", function() {
  1328. self["sendPacket"](new PaintTools["sendInviteResponse"](false));
  1329. find($("#popup-party"));
  1330. });
  1331. $("#popup-party-code-content button")["on"]("click", function() {
  1332. $("#popup-party-code-content input")["select"]();
  1333. document["execCommand"]("Copy");
  1334. $("#popup-party-code")["hide"]();
  1335. });
  1336. $("#menu-invite")["on"]("click", function() {
  1337. var _0x4A99 = elem["data"]("selected");
  1338. self["sendPacket"](new PaintTools["sendPartyAction"](0, _0x4A99));
  1339. });
  1340. $("#menu-whisper")["on"]("click", function() {
  1341. var rel = elem["data"]("selected");
  1342. var _0x4AB7 = $("#chat-input")["val"]();
  1343. $("#chat-input")["val"]("/t " + rel + " " + _0x4AB7);
  1344. });
  1345. $("#menu-pu_pr")["on"]("click", function() {
  1346. if (self["partyCode"] == undefined) {
  1347. self["sendPacket"](new PaintTools["sendPartyAction"](4, 0));
  1348. $("#menu-pu_pr span")["text"]("Private");
  1349. } else {
  1350. self["sendPacket"](new PaintTools["sendPartyAction"](4, 1));
  1351. $("#menu-pu_pr span")["text"]("Public");
  1352. }
  1353. });
  1354. $("#menu-promote")["on"]("click", function() {
  1355. var _0x4A99 = elem["data"]("party") + 1;
  1356. if (_0x4A99 >= 0) {
  1357. self["sendPacket"](new PaintTools["sendPartyAction"](2, _0x4A99));
  1358. }
  1359. });
  1360. $("#menu-kick")["on"]("click", function() {
  1361. var _0x4A99 = elem["data"]("party") + 1;
  1362. if (_0x4A99 >= 0) {
  1363. self["sendPacket"](new PaintTools["sendPartyAction"](1, _0x4A99));
  1364. }
  1365. });
  1366. $("#menu-spectate")["on"]("click", function() {
  1367. var _self = elem["data"]("selected");
  1368. if (_self >= 0) {
  1369. self["sendPacket"](new PaintTools["sendSpectate"](_self));
  1370. }
  1371. });
  1372. $("#menu-block")["on"]("click", function() {
  1373. var level = parseInt(elem["data"]("selected"));
  1374. var item = getByProp(level);
  1375. self["selfMsg"](item);
  1376. });
  1377. $(document)["on"]("click", function(result) {
  1378. elem["hide"]();
  1379. if (result["target"]["id"] !== "chat-emote-btn") {
  1380. $("#emote-panel")["hide"]();
  1381. }
  1382. if ($("#popup-party-code")["css"]("display") !== "none" && result["target"]["id"] !== "popup-party-code") {
  1383. $("#popup-party-code")["hide"]();
  1384. }
  1385. });
  1386. firebase["auth"]()["onAuthStateChanged"](function(unit) {
  1387. if (unit) {
  1388. nunjucksInjector();
  1389. var popcornVideo = firebase["database"]()["ref"]("users/" + unit["uid"]);
  1390. var _0x4AF3 = false;
  1391. popcornVideo["on"]("value", function(MapData) {
  1392. var options = MapData["val"]();
  1393. if (!options) {
  1394. return;
  1395. }
  1396. if (!_0x4AF3) {
  1397. $("#account-loader")["hide"]();
  1398. $("#authed")["show"]();
  1399. $("#authed")["attr"]("style", "display: flex;");
  1400. _0x4AF3 = true;
  1401. }
  1402. expected = options;
  1403. $("#account-avatar")["attr"]("src", options["avatar"]);
  1404. $("#account-username")["text"](options["username"]);
  1405. text($("#account-username"), options);
  1406. $("#account-level")["text"]("Level " + options["levelData"]["level"] + " | " + options["levelData"]["xp_current"] + "/" + options["levelData"]["xp_needed"] + "XP" + " | " + options["currency"] + " bits");
  1407. $(".xp-meter > span")["each"](function() {
  1408. var length = options["levelData"]["xp_current"] / options["levelData"]["xp_needed"] * 100;
  1409. $(this)["animate"]({
  1410. width : length + "%"
  1411. }, 1200);
  1412. });
  1413. if (result["enabled"]) {
  1414. close();
  1415. firebase["firestore"]()["collection"]("accounts")["doc"](expected["uid"])["onSnapshot"]((options) => {
  1416. if (options["data"]()["locked"]) {
  1417. $("#spLockedName")["html"](options["data"]()["name"]);
  1418. if (options["data"]()["lastChange"] !== undefined) {
  1419. $("#btn-chg-ln")["attr"]("title", "Last Changed: " + (new Date(options["data"]()["lastChange"]))["toLocaleString"]());
  1420. }
  1421. if (options["data"]()["expiry"] !== null) {
  1422. $("#spExpiry")["html"]((new Date(options["data"]()["expiry"]["seconds"] * 1E3))["toLocaleString"]());
  1423. } else {
  1424. $("#spExpiry")["html"]("Never");
  1425. }
  1426. } else {
  1427. result["enabled"] = false;
  1428. updater();
  1429. close();
  1430. if ($("#main-subpanel")["css"]("display") !== "none") {
  1431. f("main-servers");
  1432. }
  1433. }
  1434. }, (canCreateDiscussions) => {
  1435. });
  1436. }
  1437. if (_0x5129) {
  1438. uploadFiles(expected);
  1439. }
  1440. });
  1441. } else {
  1442. upld();
  1443. close(false);
  1444. }
  1445. });
  1446. firebase["database"]()["ref"]("/game")["on"]("value", function(options) {
  1447. var params = options["val"]();
  1448. if (params["version"] !== version) {
  1449. self["selfMsg"]("Woah! Version " + params["version"] + " is now available. Press Ctrl+R to update!");
  1450. }
  1451. if (signature != params["motd"] && params["motd"] !== "") {
  1452. signature = params["motd"];
  1453. self["selfMsg"]("MOTD: " + params["motd"]);
  1454. }
  1455. });
  1456. $("#account-login")["on"]("click", function() {
  1457. firebase["auth"]()["signInWithPopup"](numKeysDeleted)["then"](function(canCreateDiscussions) {
  1458. })["catch"]((name) => {
  1459. return buildJS(name, true);
  1460. });
  1461. });
  1462. $("#account-logout")["on"]("click", function() {
  1463. firebase["auth"]()["signOut"]()["then"](function() {
  1464. $("#authed")["hide"](500);
  1465. $("#guest")["show"]();
  1466. })["catch"]((name) => {
  1467. return buildJS(name, true);
  1468. });
  1469. });
  1470. $("#account-shop")["on"]("click", function() {
  1471. window["open"]("https://trello.com/c/Hdnxuxuc/2-account-system", "_blank");
  1472. });
  1473. $("#account-social")["on"]("click", function() {
  1474. if (!expected) {
  1475. return;
  1476. }
  1477. uploadFiles(expected);
  1478. append($("#main-social"));
  1479. find($(items));
  1480. });
  1481. $("#social-back-button")["on"]("click", function() {
  1482. find($("#main-social"));
  1483. append($(items));
  1484. });
  1485. $("#account-profile")["on"]("click", function() {
  1486. create(expected, items);
  1487. });
  1488. $("#profile-close-btn")["on"]("click", function() {
  1489. wrap(items);
  1490. find($("#popup-profile"));
  1491. });
  1492. $("#account-set-username-btn")["on"]("click", function() {
  1493. if (!expected) {
  1494. return;
  1495. }
  1496. upld(false, this);
  1497. var selector = $("#account-username-input")["val"]();
  1498. if (!selector || selector == "" || selector["trim"]() == "") {
  1499. alert("Please provide a username!");
  1500. upld(true, this);
  1501. return;
  1502. }
  1503. firebase["auth"]()["currentUser"]["getIdToken"]()["then"]((textClass) => {
  1504. fetch(HOST + "/api/v1/social/username", {
  1505. method : "POST",
  1506. headers : {
  1507. "Content-Type" : "application/json"
  1508. },
  1509. body : JSON["stringify"]({
  1510. token : textClass,
  1511. username : selector
  1512. })
  1513. })["then"]((options) => {
  1514. return options["json"]();
  1515. })["then"]((result) => {
  1516. upld(true, this);
  1517. if (result["code"] == 200) {
  1518. wrap(items);
  1519. $("#popup-account-username")["hide"]();
  1520. return;
  1521. }
  1522. alert(result["message"]);
  1523. })["catch"]((a) => {
  1524. console["error"](a);
  1525. alert(a);
  1526. upld(true, this);
  1527. });
  1528. })["catch"]((name) => {
  1529. upld(true, this);
  1530. buildJS(name, true);
  1531. });
  1532. });
  1533. $("#username-back-button")["on"]("click", function() {
  1534. wrap($("#popup-account-username"));
  1535. wrap(items);
  1536. });
  1537. $("#btn-add-friend")["on"]("click", function(options) {
  1538. options["preventDefault"]();
  1539. if (!expected) {
  1540. return;
  1541. }
  1542. var selector = prompt("Enter friend's UID (found above add friend button)");
  1543. if (!selector) {
  1544. return;
  1545. }
  1546. var hash = selector["replace"](/s/g, "");
  1547. if (typeof selector !== "string" || hash["length"] === 0) {
  1548. return alert("Please enter a valid UID");
  1549. }
  1550. firebase["auth"]()["currentUser"]["getIdToken"]()["then"]((textClass) => {
  1551. fetch(HOST + "/api/v1/social/friends", {
  1552. method : "POST",
  1553. headers : {
  1554. "Content-Type" : "application/json"
  1555. },
  1556. body : JSON["stringify"]({
  1557. token : textClass,
  1558. target : hash,
  1559. action : 1
  1560. })
  1561. })["then"]((options) => {
  1562. return options["json"]();
  1563. })["then"]((result) => {
  1564. alert(result["message"]);
  1565. });
  1566. })["catch"]((name) => {
  1567. return buildJS(name, true);
  1568. });
  1569. });
  1570. document["getElementById"]("party-canvas")["oncontextmenu"] = loadStencil;
  1571. $(document)["keyup"](function(options) {
  1572. if (options["keyCode"] == 13) {
  1573. var locationMap = $("#chat-input");
  1574. if (document["activeElement"]["tagName"] != "INPUT") {
  1575. locationMap["focus"]();
  1576. } else {
  1577. if (locationMap["is"](":focus")) {
  1578. locationMap["blur"]();
  1579. }
  1580. }
  1581. }
  1582. });
  1583. $(window)["bind"]("beforeunload", function() {
  1584. return "Are you sure you want to leave Gota.io?";
  1585. });
  1586. makeTimeoutHandler();
  1587. $(".keybinds-btn")["on"]("click", function() {
  1588. $(".keybinds-btn")["removeClass"]("keybinds-btn-selected");
  1589. $(this)["addClass"]("keybinds-btn-selected");
  1590. _0x5291 = true;
  1591. });
  1592. $("#scrimmage-mode-select")["on"]("change", function() {
  1593. $("#scrimmage-mode-info")["children"]()["css"]("display", "none");
  1594. $("#scrimmage-info-" + $(this)["val"]())["css"]("display", "block");
  1595. });
  1596. $("#btn-queue")["on"]("click", function() {
  1597. var n = parseInt($("#scrimmage-mode-select")["val"]());
  1598. var _self = isNaN(n) ? 0 : Math["min"](Math["max"](n, 0), 100);
  1599. self["sendPacket"](new PaintTools["sendQueue"](_self));
  1600. $(this)["blur"]();
  1601. });
  1602. $("#btn-leave-match")["on"]("click", function() {
  1603. self["sendPacket"](new PaintTools["sendLeaveMatch"]);
  1604. });
  1605. $("#btn-custom-create")["on"]("click", function() {
  1606. self["sendPacket"](new PaintTools["sendCustomGame"](0));
  1607. $(this)["blur"]();
  1608. });
  1609. $("#btn-custom-return")["on"]("click", function() {
  1610. self["sendPacket"](new PaintTools["sendCustomGame"](1));
  1611. });
  1612. $("#btn-custom-start")["on"]("click", function() {
  1613. self["sendPacket"](new PaintTools["sendCustomGame"](2));
  1614. });
  1615. $("#scrimmage-map")["on"]("change", function(canCreateDiscussions) {
  1616. var cookie = $(this)["find"]("option:selected")["val"]();
  1617. var key = $(this)["attr"]("data");
  1618. if (cookie != key) {
  1619. $("#scrimmage-map option[value='" + key + "']")["prop"]("selected", true);
  1620. self["sendPacket"](new PaintTools["sendCustomGameUpdate"](style["MAP"], cookie));
  1621. }
  1622. });
  1623. $("#scrimmage-mapmode")["on"]("change", function(canCreateDiscussions) {
  1624. var cookie = $(this)["find"]("option:selected")["val"]();
  1625. var key = $(this)["attr"]("data");
  1626. if (cookie != key) {
  1627. $("#scrimmage-mapmode option[value='" + key + "']")["prop"]("selected", true);
  1628. self["sendPacket"](new PaintTools["sendCustomGameUpdate"](style["MODE"], cookie));
  1629. }
  1630. });
  1631. $("#scrimmage-mapsize")["on"]("change", function(canCreateDiscussions) {
  1632. var cookie = $(this)["find"]("option:selected")["val"]();
  1633. var key = $(this)["attr"]("data");
  1634. if (cookie != key) {
  1635. $("#scrimmage-mapsize option[value='" + key + "']")["prop"]("selected", true);
  1636. self["sendPacket"](new PaintTools["sendCustomGameUpdate"](style["SIZE"], cookie));
  1637. }
  1638. });
  1639. $("#scrimmage-startmass")["on"]("change", function(canCreateDiscussions) {
  1640. var n = $(this)["val"]();
  1641. var elem = $(this)["attr"]("data");
  1642. if (isNaN(n)) {
  1643. $(this)["val"](elem);
  1644. return;
  1645. }
  1646. n = Math["max"](1, Math["min"](parseInt(n), 32E3));
  1647. if (n != elem) {
  1648. $(this)["val"](elem);
  1649. self["sendPacket"](new PaintTools["sendCustomGameUpdate"](style["STARTMASS"], n));
  1650. }
  1651. });
  1652. $("#scrimmage-lockteams")["on"]("change", function(canCreateDiscussions) {
  1653. var _0x4AB7 = $(this)["prop"]("checked");
  1654. $(this)["prop"]("checked", !_0x4AB7);
  1655. self["sendPacket"](new PaintTools["sendCustomGameUpdate"](style["LOCK"], _0x4AB7 == true ? 1 : 0));
  1656. });
  1657. }
  1658. function render(component) {
  1659. var locationMap = $(".keybinds-btn-selected");
  1660. _0x5291 = false;
  1661. if (locationMap["size"]() == 0) {
  1662. return;
  1663. }
  1664. var validate = locationMap["first"]();
  1665. locationMap["removeClass"]("keybinds-btn-selected");
  1666. if (component != 27) {
  1667. params[validate["attr"]("id")] = component;
  1668. } else {
  1669. params[validate["attr"]("id")] = -1;
  1670. }
  1671. assert(validate);
  1672. }
  1673. function assert(options) {
  1674. var key = params[options["attr"]("id")];
  1675. options["html"](prefix(key));
  1676. }
  1677. function prefix(num) {
  1678. return num > 0 ? tablx[num]["toUpperCase"]() : "&nbsp;";
  1679. }
  1680. function rebuildAttributes() {
  1681. const result = document["getElementById"]("logo");
  1682. const artistTrack = "url('images/logo.png')";
  1683. const GET_AUTH_URL_TIMEOUT = "url('images/" + meta["key"] + "/logo.png')";
  1684. if (fields["cDisableEventSkins"] || !meta["enabled"]) {
  1685. result["style"]["setProperty"]("--logo", artistTrack, "");
  1686. } else {
  1687. if (meta["enabled"]) {
  1688. result["style"]["setProperty"]("--logo", GET_AUTH_URL_TIMEOUT, "");
  1689. }
  1690. }
  1691. }
  1692. function perform_graphics_ops() {
  1693. obj = new Image;
  1694. b = new Image;
  1695. spike_mother_happy = new Image;
  1696. a = new Image;
  1697. shift();
  1698. bottoms = {};
  1699. gifEmoteList = {};
  1700. var i;
  1701. for (i in _tabInfo) {
  1702. var tx = _tabInfo[i];
  1703. $(".emote-list")["append"]("<li><img name='" + tx + "' title='" + tx + "' src='https://gamedata.gota.io/emotes/" + tx + ".png' /></li>");
  1704. bottoms[tx] = true;
  1705. }
  1706. for (i in blocks) {
  1707. tx = blocks[i];
  1708. $(".gif-list")["append"]("<li><img name='" + tx + "' title='" + tx + "' src='https://gamedata.gota.io/emotes/gifs/" + tx + ".gif' /></li>");
  1709. gifEmoteList[tx] = true;
  1710. }
  1711. i = 0;
  1712. for (; i < lookup["length"]; i++) {
  1713. var key = lookup[i];
  1714. $("#spEffect")["append"]("<option value=" + (i + 1) + ">" + key["charAt"](0)["toUpperCase"]() + key["slice"](1) + "</option>");
  1715. var obj = new Image;
  1716. obj["src"] = "images/ejectedmass_skins/" + key + ".png";
  1717. lookup[i] = obj;
  1718. }
  1719. if (meta["enabled"]) {
  1720. model = new Image;
  1721. model["src"] = "images/" + meta["key"] + "/ejected_mass.png";
  1722. }
  1723. drawImage();
  1724. }
  1725. function shift() {
  1726. if (!fields["cDisableEventSkins"] && meta["enabled"]) {
  1727. var i = "images/" + meta["key"];
  1728. obj["src"] = i + "/spike.png";
  1729. b["src"] = i + "/spike_mother.png";
  1730. spike_mother_happy["src"] = i + "/spike_mother_happy.png";
  1731. if (meta["mother_addon"]["enabled"]) {
  1732. a["src"] = i + "/spike_mother_addon.png";
  1733. }
  1734. } else {
  1735. obj["src"] = "images/spike.png";
  1736. b["src"] = "images/spike_mother.png";
  1737. spike_mother_happy["src"] = "images/spike_mother.png";
  1738. }
  1739. }
  1740. function makeTimeoutHandler() {
  1741. if (!fields["cShowCoordinates"]) {
  1742. $("#minimap-canvas")["css"]({
  1743. "border-top" : "0"
  1744. });
  1745. $("#minimap-panel")["css"]({
  1746. "height" : "250px"
  1747. });
  1748. } else {
  1749. $("#minimap-canvas")["css"]({
  1750. "border-top" : "2px solid rgba(255, 255, 255, .2)"
  1751. });
  1752. $("#minimap-panel")["css"]({
  1753. "height" : "270px"
  1754. });
  1755. }
  1756. }
  1757. function init() {
  1758. die();
  1759. $("#btn-chg-ln")["on"]("click", function() {
  1760. if (!_0x54AD) {
  1761. return;
  1762. }
  1763. var title = prompt("Enter new locked name!");
  1764. if (!title) {
  1765. return;
  1766. }
  1767. var g = null;
  1768. if (typeof title !== "string") {
  1769. g = "Please enter a valid name!";
  1770. }
  1771. if (title["length"] < 2) {
  1772. g = "Locked names must be 2 or more characters long.";
  1773. }
  1774. if (title["length"] > 20) {
  1775. g = "Locked names must be 20 or less characters long.";
  1776. }
  1777. if (g !== null) {
  1778. alert(g);
  1779. return;
  1780. }
  1781. title = title["trim"]();
  1782. if (confirm("You are about to change your locked name to: '" + title + "'.\n Locked names can only be changed once per week. \n\nAre you sure you wish to continue?")) {
  1783. result["lockedName"] = title;
  1784. getTime();
  1785. self["sendPacket"](new PaintTools["sendSubPanel"]);
  1786. result["lockedName"] = "";
  1787. }
  1788. });
  1789. $("#btn-updateSP")["on"]("click", function() {
  1790. if (!_0x54AD) {
  1791. return;
  1792. }
  1793. getTime();
  1794. self["sendPacket"](new PaintTools["sendSubPanel"]);
  1795. result["lockedName"] = "";
  1796. });
  1797. }
  1798. function die() {
  1799. close();
  1800. $("#spNameColor")["spectrum"]({
  1801. color : result["nameColor"],
  1802. showAlpha : false,
  1803. showInput : true,
  1804. preferredFormat : "rgb"
  1805. });
  1806. $("#spChatColor")["spectrum"]({
  1807. showPaletteOnly : true,
  1808. showPalette : true,
  1809. color : palette[result["chatColor"]],
  1810. palette : palette
  1811. });
  1812. $("#spSkinName")["val"](result["skinName"]);
  1813. $("#spLowerName")["prop"]("checked", result["lowerName"]);
  1814. $("#spEffect select")["val"](result["effect"]);
  1815. }
  1816. function getTime() {
  1817. result["skinName"] = $("#spSkinName")["val"]()["toLowerCase"]();
  1818. result["lowerName"] = $("#spLowerName")["prop"]("checked");
  1819. result["nameColor"] = $("#spNameColor")["spectrum"]("get")["toRgb"]();
  1820. var curRecKey = $("#spChatColor")["spectrum"]("get")["toHexString"]()["toUpperCase"]();
  1821. var overflowValue = 0;
  1822. var modelKeyName = 0;
  1823. for (; modelKeyName < palette["length"]; modelKeyName++) {
  1824. if (palette[modelKeyName] == curRecKey) {
  1825. overflowValue = modelKeyName;
  1826. break;
  1827. }
  1828. }
  1829. result["chatColor"] = overflowValue;
  1830. result["effect"] = parseInt($("#spEffect")["val"]());
  1831. }
  1832. function close() {
  1833. if (result["enabled"] && firebase["auth"]()["currentUser"] !== null) {
  1834. $("#btn-forums")["css"]("display", "none");
  1835. $("#btn-cellpanel")["css"]("display", "block");
  1836. } else {
  1837. $("#btn-cellpanel")["css"]("display", "none");
  1838. $("#btn-forums")["css"]("display", "block");
  1839. }
  1840. }
  1841. function Matrix3(m33, isSlidingUp, $cont, $slides, callback, scopeIn) {
  1842. this["name"] = m33;
  1843. this["ip"] = isSlidingUp;
  1844. this["players"] = $cont;
  1845. this["mode"] = $slides;
  1846. this["region"] = callback;
  1847. this["playersCurrent"] = 0;
  1848. this["ssl"] = scopeIn;
  1849. }
  1850. function removeaToolTip() {
  1851. $("#servers-body-eu")["html"]("");
  1852. $("#servers-body-na")["html"]("");
  1853. $("#servers-body-ap")["html"]("");
  1854. var name;
  1855. for (name in graph) {
  1856. var props = graph[name];
  1857. $("#servers-body-" + props["region"])["append"]('<tr id="s_" + props["name"] + "" class="server-row" server="" + props["name"] + ""><td class="server-table-name">" + props["name"] + "</td><td class="server-table-players">" + props["players"] + "</td><td class="server-table-mode">" + props["mode"] + "</td></tr>');
  1858. }
  1859. $(".server-row")["on"]("click", function() {
  1860. remove($(this)["attr"]("server"));
  1861. });
  1862. }
  1863. function remove(node) {
  1864. if (children != null) {
  1865. $("#s_" + children["name"])["removeClass"]("server-selected");
  1866. }
  1867. children = graph[node];
  1868. if (children != null) {
  1869. $("#s_" + children["name"])["addClass"]("server-selected");
  1870. }
  1871. }
  1872. function ok(selector) {
  1873. selector = selector["toLowerCase"]();
  1874. var locationMap = $("#server-tab-" + selector);
  1875. $("#server-tab-container")["children"]()["removeClass"]("server-active");
  1876. locationMap["addClass"]("server-active");
  1877. $("#server-content")["children"]()["css"]("display", "none");
  1878. $("#servers-" + selector)["css"]("display", "block");
  1879. }
  1880. function index(obj) {
  1881. var reconnectTryTimes = $("#chat-body tr")["length"];
  1882. if (reconnectTryTimes >= maxReconnectTryTimes) {
  1883. $("#chat-body tr:first-child")["remove"]();
  1884. }
  1885. var callbacks = document["createElement"]("tr");
  1886. callbacks["appendChild"](obj);
  1887. document["getElementById"]("chat-body")["appendChild"](callbacks);
  1888. var result = $("#chat-container");
  1889. if (result[0]["scrollHeight"] - result[0]["scrollTop"] < result["outerHeight"]() + 150) {
  1890. result["scrollTop"](result[0]["scrollHeight"]);
  1891. }
  1892. }
  1893. function fetch(params) {
  1894. if (params["length"] == 0) {
  1895. return;
  1896. } else {
  1897. if (params["charAt"](0) == "/") {
  1898. config(params);
  1899. } else {
  1900. self["sendPacket"](new PaintTools["sendChat"](params, 0));
  1901. $get("");
  1902. }
  1903. }
  1904. }
  1905. function $get(mmCoreSplitViewBlock) {
  1906. $("#chat-input")["val"](mmCoreSplitViewBlock);
  1907. }
  1908. function sendResponses(res) {
  1909. $("#chat-input")["val"](forEach() + res);
  1910. }
  1911. function forEach() {
  1912. return $("#chat-input")["val"]();
  1913. }
  1914. function config(params) {
  1915. var values = params["split"](" ");
  1916. var users = values[0];
  1917. var cast_receivers = users["substring"](1);
  1918. $get("");
  1919. var _0x4AD5 = false;
  1920. Object["keys"](target)["findIndex"]((i) => {
  1921. if (target[i]["triggers"]["findIndex"]((options) => {
  1922. return options["toUpperCase"]() === cast_receivers["toUpperCase"]();
  1923. }) > -1 && _0x4AD5 == false) {
  1924. target[i]["action"](values["slice"](1));
  1925. _0x4AD5 = true;
  1926. return;
  1927. }
  1928. });
  1929. if (_0x4AD5 == false) {
  1930. self["selfMsg"]("Invalid command!");
  1931. }
  1932. }
  1933. function callback(payload, options, value, start) {
  1934. var c = document["getElementById"]("context-name");
  1935. for (; c["firstChild"] != null;) {
  1936. c["removeChild"](c["firstChild"]);
  1937. }
  1938. c["appendChild"](options);
  1939. elem["data"]("selected", value);
  1940. elem["data"]("party", start);
  1941. $(".context-action")["css"]("display", "none");
  1942. if (start == -1) {
  1943. $("#menu-invite")["css"]("display", "block");
  1944. $("#menu-whisper")["css"]("display", "block");
  1945. $("#menu-block")["css"]("display", "block");
  1946. } else {
  1947. $("#menu-whisper")["css"]("display", "block");
  1948. if (self["isPartyLeader"]()) {
  1949. $("#menu-pu_pr")["css"]("display", "block");
  1950. $("#menu-promote")["css"]("display", "block");
  1951. $("#menu-kick")["css"]("display", "block");
  1952. }
  1953. }
  1954. if (self["spectate"]) {
  1955. $("#menu-spectate")["css"]("display", "block");
  1956. }
  1957. elem["css"]("display", "block");
  1958. elem["css"]("left", payload["clientX"]);
  1959. elem["css"]("top", payload["clientY"]);
  1960. }
  1961. function $(str) {
  1962. return str["replace"](/</g, "&lt;")["replace"](/>/g, "&gt;");
  1963. }
  1964. function extend(value, def) {
  1965. var obj = document["createElement"]("canvas");
  1966. var payload = obj["getContext"]("2d");
  1967. var _ = 12;
  1968. var User = "bold " + _ + "pt Times New Roman";
  1969. payload["font"] = User;
  1970. obj["width"] = payload["measureText"](value)["width"] + 4;
  1971. obj["height"] = _ + 5;
  1972. payload["font"] = User;
  1973. payload["fillStyle"] = def;
  1974. payload["fillText"](value, 2, _ + 2);
  1975. return obj;
  1976. }
  1977. function _compareBoundaryPoints(memo, containerB, offsetB, formatters, initialValue, value, range) {
  1978. var futurePrice = (offsetB - self["border"]["left"]) / self["border"]["width"] * popcornMedia["width"];
  1979. var numTiles = (formatters - self["border"]["top"]) / self["border"]["height"] * popcornMedia["height"];
  1980. memo["beginPath"]();
  1981. memo["arc"](futurePrice, numTiles, initialValue, 0, par5, false);
  1982. memo["fillStyle"] = value;
  1983. memo["fill"]();
  1984. if (range) {
  1985. var currentPriceNextPeriod = memo["measureText"](containerB)["width"] / 2;
  1986. var priceDiff = futurePrice - currentPriceNextPeriod;
  1987. var missingRects = numTiles - 5;
  1988. memo["fillText"](containerB, priceDiff, missingRects);
  1989. }
  1990. }
  1991. function resolve(result) {
  1992. var costSum = result["clientX"] * scale / self["scale"] - self["offsetX"];
  1993. var formattedBestGrade = result["clientY"] * scale / self["scale"] - self["offsetY"];
  1994. var object = null;
  1995. var node;
  1996. var i = 0;
  1997. for (; i < self["sorted"]["length"]; i++) {
  1998. node = self["sorted"][i];
  1999. if (node["size"] < 25) {
  2000. continue;
  2001. }
  2002. var clientWidth = node["y"] - node["size"];
  2003. var formattedGradebookGrade = node["y"] + node["size"];
  2004. var clientHeight = node["x"] - node["size"];
  2005. var gasSum = node["x"] + node["size"];
  2006. if (formattedBestGrade > formattedGradebookGrade) {
  2007. continue;
  2008. }
  2009. if (formattedBestGrade < clientWidth) {
  2010. continue;
  2011. }
  2012. if (costSum > gasSum) {
  2013. continue;
  2014. }
  2015. if (costSum < clientHeight) {
  2016. continue;
  2017. }
  2018. object = node;
  2019. break;
  2020. }
  2021. if (object != null && object["playerId"] != 0 && result["target"]["id"] == "canvas") {
  2022. var hash = self["playerRegistry"]["getPlayer"](object["playerId"]);
  2023. if (hash != null) {
  2024. var value = extend(hash["name"], "#fff");
  2025. callback(result, value, object["playerId"], -1);
  2026. }
  2027. }
  2028. }
  2029. function append(item) {
  2030. if (item["css"]("display") == "none") {
  2031. item["css"]("display", "block");
  2032. item["animate"]({
  2033. opacity : 1
  2034. }, 500);
  2035. }
  2036. }
  2037. function find(item) {
  2038. if (item["css"]("display") == "block" && item["css"]("opacity") == 1) {
  2039. item["animate"]({
  2040. opacity : 0
  2041. }, 500, function() {
  2042. item["css"]("display", "none");
  2043. });
  2044. }
  2045. }
  2046. function wrap(x) {
  2047. if (x["css"]("display") == "block" && x["css"]("opacity") == 1) {
  2048. find(x);
  2049. } else {
  2050. if (x["css"]("display") == "none") {
  2051. append(x);
  2052. }
  2053. }
  2054. }
  2055. function startApp(params) {
  2056. return params["css"]("display") === "none";
  2057. }
  2058. function clicked() {
  2059. hist["show"]();
  2060. if (self["party"]["length"] == 0) {
  2061. _attachmentCallbacks["css"]("display", "none");
  2062. }
  2063. if (fields["cHideChat"]) {
  2064. $("#chat-panel")["css"]("display", "none");
  2065. }
  2066. if (fields["cHideMinimap"]) {
  2067. $("#minimap-panel")["css"]("display", "none");
  2068. }
  2069. }
  2070. function refreshFilteredDataSource() {
  2071. hist["hide"]();
  2072. }
  2073. function nunjucksInjector() {
  2074. $("#guest")["hide"]();
  2075. $("#account-loader")["show"]();
  2076. }
  2077. function upld() {
  2078. $("#authed")["hide"]();
  2079. $("#account-loader")["hide"]();
  2080. $("#guest")["show"]();
  2081. }
  2082. function startCircleAnim(options) {
  2083. var j = options["attr"]("id");
  2084. fields[j] = options["prop"]("checked");
  2085. var stop = x[j];
  2086. if (stop != null) {
  2087. stop();
  2088. }
  2089. }
  2090. function bindEvents(component) {
  2091. var id = component["attr"]("id");
  2092. fields[id] = component["val"]();
  2093. var d = x[id];
  2094. if (d != null) {
  2095. d(component["val"]());
  2096. }
  2097. }
  2098. function updater() {
  2099. fields[data[1E3]] = $("#chat-panel")["css"]("width");
  2100. fields["iChatHeight"] = $("#chat-panel")["css"]("height");
  2101. window["localStorage"]["setItem"]("options", JSON["stringify"](fields));
  2102. window["localStorage"]["setItem"]("keybinds", JSON["stringify"](params));
  2103. window["localStorage"]["setItem"]("name", $("#name-box")["val"]());
  2104. window["localStorage"]["setItem"]("interfaceOptions", JSON["stringify"](values));
  2105. window["localStorage"]["setItem"]("subpanel", JSON["stringify"](result));
  2106. }
  2107. function bind() {
  2108. var input = window["localStorage"]["getItem"]("interfaceOptions");
  2109. if (input) {
  2110. input = JSON["parse"](input);
  2111. var i;
  2112. for (i in input) {
  2113. if (input[i] != "") {
  2114. values[i] = input[i];
  2115. }
  2116. }
  2117. }
  2118. $("#cUiForegroundColor")["spectrum"]("set", values["interfaceForegroundColor"]);
  2119. $("#cUiBackgroundColor")["spectrum"]("set", values["interfaceBackgroundColor"]);
  2120. $("#cGameBackground")["spectrum"]("set", values["gameBackgroundColor"]);
  2121. $("#cGridColor")["spectrum"]("set", values["gridColor"]);
  2122. $("#cBorderColor")["spectrum"]("set", values["borderColor"]);
  2123. var userConfig = window["localStorage"]["getItem"]("keybinds");
  2124. if (userConfig) {
  2125. userConfig = JSON["parse"](userConfig);
  2126. for (i in userConfig) {
  2127. if (userConfig[i] != null && Number["isInteger"](userConfig[i])) {
  2128. params[i] = userConfig[i];
  2129. assert($("#" + i));
  2130. }
  2131. }
  2132. }
  2133. var options = window["localStorage"]["getItem"]("options");
  2134. if (options) {
  2135. options = JSON["parse"](options);
  2136. var key;
  2137. for (key in fields) {
  2138. if (!options[key]) {
  2139. options[key] = fields[key];
  2140. }
  2141. }
  2142. } else {
  2143. options = fields;
  2144. }
  2145. for (key in options) {
  2146. var version = key["charAt"](0);
  2147. if (version == "c") {
  2148. if (options[key] == true) {
  2149. var obj = $("#" + key);
  2150. obj["prop"]("checked", options[key]);
  2151. startCircleAnim(obj);
  2152. }
  2153. } else {
  2154. if (version == "s") {
  2155. var that = $("#" + key);
  2156. that["val"](options[key]);
  2157. bindEvents(that);
  2158. } else {
  2159. if (version == "i") {
  2160. fields[key] = options[key];
  2161. }
  2162. }
  2163. }
  2164. }
  2165. $("#chat-panel")["css"]("width", fields[data[1E3]]);
  2166. $("#chat-panel")["css"]("height", fields["iChatHeight"]);
  2167. var artistTrack = window["localStorage"]["getItem"]("name");
  2168. if (artistTrack != null) {
  2169. $("#name-box")["val"](artistTrack);
  2170. }
  2171. var store = window["localStorage"]["getItem"]("subpanel");
  2172. if (store) {
  2173. store = JSON["parse"](store);
  2174. for (key in store) {
  2175. if (store[key] != "") {
  2176. result[key] = store[key];
  2177. }
  2178. }
  2179. }
  2180. result["lockedName"] = "";
  2181. close();
  2182. }
  2183. function calcPrevData(series) {
  2184. var options = series["split"](" ");
  2185. var x = "";
  2186. var tx = null;
  2187. var i = 0;
  2188. for (; i < options["length"]; i++) {
  2189. if (i != 0) {
  2190. x = x + " ";
  2191. }
  2192. tx = options[i];
  2193. if (bottoms[tx] != null) {
  2194. if (tx["startsWith"](":") && tx["endsWith"](":")) {
  2195. tx = tx["substring"](1, tx["length"] - 1);
  2196. }
  2197. x = x + ("<img src='https://gamedata.gota.io/emotes/" + tx + ".png' height='17' width='17' alt='" + tx + ">");
  2198. } else {
  2199. if (gifEmoteList[tx] != null) {
  2200. if (tx["startsWith"](":") && tx["endsWith"](":")) {
  2201. tx = tx["substring"](1, tx["length"] - 1);
  2202. }
  2203. x = x + ("<img src='https://gamedata.gota.io/emotes/gifs/" + tx + ".gif' height='17' width='17' alt='" + tx + "'>");
  2204. } else {
  2205. x = x + tx;
  2206. }
  2207. }
  2208. }
  2209. return x;
  2210. }
  2211. function Store(args) {
  2212. this["particles"] = [];
  2213. this["MAX_PARTICLES"] = args;
  2214. this["init"] = function() {
  2215. var _0x4A99 = 0;
  2216. for (; _0x4A99 < this["MAX_PARTICLES"]; _0x4A99++) {
  2217. var origin = new EventEmitter("images/" + meta["key"] + "/particles.png", Math["floor"](Math["random"]() * 7));
  2218. this["particles"]["push"](origin);
  2219. }
  2220. };
  2221. this["onTick"] = function(elem, n, canCreateDiscussions, isSlidingUp) {
  2222. n = n / 1E3;
  2223. var sGroup;
  2224. for (sGroup in this["particles"]) {
  2225. var obj = this["particles"][sGroup];
  2226. obj["draw"](elem, n);
  2227. }
  2228. };
  2229. this["init"](args);
  2230. }
  2231. function EventEmitter(ctx, events) {
  2232. this["image"] = null;
  2233. this["frame"] = events;
  2234. this["x"] = 0;
  2235. this["y"] = 0;
  2236. this["speed"] = 0;
  2237. this["angle"] = 0;
  2238. this["init"] = function(canCreateDiscussions) {
  2239. this["image"] = new Image;
  2240. this["image"]["src"] = canCreateDiscussions;
  2241. this["x"] = Math["random"]();
  2242. this["y"] = Math["random"]() - 1.25;
  2243. this["speed"] = (Math["random"]() * 7.5E-4 + 5E-4) * 60;
  2244. this["angle"] = 0;
  2245. };
  2246. this["draw"] = function(corePostTags, zr) {
  2247. if (this["y"] > 1) {
  2248. this["y"] = Math["random"]() * -.25 + -.1;
  2249. } else {
  2250. if (this["y"] < -1.25) {
  2251. this["y"] = -1.25;
  2252. }
  2253. }
  2254. if (this["x"] > 1) {
  2255. this["x"] = 0;
  2256. } else {
  2257. if (this["x"] < 0) {
  2258. this["x"] = 1;
  2259. }
  2260. }
  2261. this["angle"] += Math["random"]() * .1 - .05;
  2262. this["angle"] = Math["min"](Math["max"](-.2, this["angle"]), .2);
  2263. var zr2 = zr * this["speed"];
  2264. this["x"] += zr2 * Math["sin"](this["angle"]);
  2265. this["y"] += zr2 * Math["cos"](this["angle"]);
  2266. var pkg = popcornVideo["width"] * this["x"];
  2267. var i = popcornVideo["height"] * this["y"];
  2268. corePostTags["drawImage"](this["image"], 25 * this["frame"], 0, 25, 60, pkg, i, 25, 60);
  2269. };
  2270. this["init"](ctx);
  2271. }
  2272. function Module(_xOff, _yOff, _x) {
  2273. this["name"] = _xOff;
  2274. this["img"] = _yOff;
  2275. this["type"] = _x;
  2276. }
  2277. function drawImage() {
  2278. var i;
  2279. for (i in workers) {
  2280. var rel = workers[i]["img"];
  2281. var n = new Image;
  2282. n["src"] = "images/powerups/" + rel + ".png";
  2283. workers[i]["img"] = n;
  2284. }
  2285. node = new Image;
  2286. node["src"] = "images/debuff.svg";
  2287. }
  2288. function renderTilesTransform() {
  2289. this["passiveBuffs"] = {};
  2290. this["passiveSortedBuffs"] = [];
  2291. this["consumableBuffs"] = [];
  2292. this["cache"] = null;
  2293. this["nextCacheUpdate"] = 0;
  2294. this["bonusMaxCells"] = 0;
  2295. this["onAddBuff"] = function(name, key, value) {
  2296. var result = null;
  2297. var $constraint = workers[name]["type"];
  2298. if ($constraint != $baseDefinition["CONSUMABLE"]) {
  2299. result = this["passiveBuffs"][name];
  2300. if (result) {
  2301. result["update"](key, value);
  2302. } else {
  2303. result = new Error(name, key, value);
  2304. this["passiveBuffs"][name] = result;
  2305. this["sortPassiveBuffs"]();
  2306. }
  2307. this["onPassiveBuffsUpdate"]();
  2308. this["markCacheForUpdate"]();
  2309. } else {
  2310. result = new Error(name, key, value);
  2311. this["consumableBuffs"]["push"](result);
  2312. this["markCacheForUpdate"]();
  2313. }
  2314. if (result) {
  2315. self["selfMsg"]("Recieved buff: " + result["powerup"]["name"]);
  2316. }
  2317. };
  2318. this["onRemoveBuff"] = function(i) {
  2319. var result = null;
  2320. var $constraint = workers[i]["type"];
  2321. if ($constraint != $baseDefinition["CONSUMABLE"]) {
  2322. result = this["passiveBuffs"][i];
  2323. if (result) {
  2324. delete this["passiveBuffs"][i];
  2325. this["sortPassiveBuffs"]();
  2326. this["markCacheForUpdate"]();
  2327. this["onPassiveBuffsUpdate"]();
  2328. }
  2329. } else {
  2330. var namePiece = 0;
  2331. for (; namePiece < this["consumableBuffs"]["length"]; namePiece++) {
  2332. result = this["consumableBuffs"][namePiece];
  2333. if (result["id"] == i) {
  2334. this["consumableBuffs"]["splice"](namePiece, 1);
  2335. this["markCacheForUpdate"]();
  2336. break;
  2337. }
  2338. }
  2339. }
  2340. if (result) {
  2341. self["selfMsg"]("Lost buff: " + result["powerup"]["name"]);
  2342. }
  2343. };
  2344. this["clearBuffs"] = function(easing) {
  2345. if (this["passiveSortedBuffs"]["length"] == 0 && this["consumableBuffs"]["length"] == 0) {
  2346. return;
  2347. }
  2348. var thisEasingType = easing ? easing : false;
  2349. var subjectCount;
  2350. for (subjectCount in this["passiveBuffs"]) {
  2351. var result = this["passiveBuffs"][subjectCount];
  2352. if (thisEasingType && result["powerup"]["type"] == $baseDefinition["MODIFIER"]) {
  2353. } else {
  2354. delete this["passiveBuffs"][subjectCount];
  2355. }
  2356. }
  2357. this["sortPassiveBuffs"]();
  2358. this["onPassiveBuffsUpdate"]();
  2359. this["consumableBuffs"] = [];
  2360. this["markCacheForUpdate"]();
  2361. };
  2362. this["sortPassiveBuffs"] = function() {
  2363. this["passiveSortedBuffs"] = [];
  2364. if (this["passiveBuffs"]["length"] == 0) {
  2365. return;
  2366. }
  2367. var bestIndex;
  2368. for (bestIndex in this["passiveBuffs"]) {
  2369. var result = this["passiveBuffs"][bestIndex];
  2370. if (result["powerup"]["type"] == $baseDefinition["MODIFIER"]) {
  2371. this["passiveSortedBuffs"]["splice"](0, 0, bestIndex);
  2372. } else {
  2373. this["passiveSortedBuffs"]["push"](bestIndex);
  2374. }
  2375. }
  2376. };
  2377. this["onPassiveBuffsUpdate"] = function() {
  2378. this["bonusMaxCells"] = 0;
  2379. if (this["passiveBuffs"][1] != null) {
  2380. var osFamilies = this["passiveBuffs"][1];
  2381. this["bonusMaxCells"] = osFamilies["stack"] * 16;
  2382. }
  2383. };
  2384. this["render"] = function(options) {
  2385. if (this["passiveSortedBuffs"]["length"] == 0 && this["consumableBuffs"]["length"] == 0) {
  2386. return;
  2387. }
  2388. if (Date["now"]() >= this["nextCacheUpdate"]) {
  2389. this["updateCache"]();
  2390. this["nextCacheUpdate"] = Date["now"]() + 1E3;
  2391. }
  2392. options["drawImage"](this["cache"]["canvas"], payload["width"]() + 20, 15);
  2393. };
  2394. this["updateCache"] = function() {
  2395. var popcornVideo = this["cache"] == null || this["cache"]["canvas"] == null ? document["createElement"]("canvas") : this["cache"]["canvas"];
  2396. var damping = Math["max"](this["passiveSortedBuffs"]["length"], this["consumableBuffs"]["length"]);
  2397. popcornVideo["width"] = 55 * damping;
  2398. popcornVideo["height"] = 105;
  2399. this["cache"] = popcornVideo["getContext"]("2d");
  2400. this["cache"]["fillStyle"] = "#222";
  2401. this["cache"]["font"] = "bold 16pt Calibri";
  2402. var val = 0;
  2403. var param = 0;
  2404. var PARENT_NODE = 0;
  2405. for (; PARENT_NODE < this["passiveSortedBuffs"]["length"]; PARENT_NODE++) {
  2406. var node = this["passiveBuffs"][this["passiveSortedBuffs"][PARENT_NODE]];
  2407. node["draw"](this["cache"], val, param);
  2408. val = val + 55;
  2409. }
  2410. val = 0;
  2411. param = 55;
  2412. PARENT_NODE = 0;
  2413. for (; PARENT_NODE < this["consumableBuffs"]["length"]; PARENT_NODE++) {
  2414. node = this["consumableBuffs"][PARENT_NODE];
  2415. node["draw"](this["cache"], val, param);
  2416. val = val + 55;
  2417. }
  2418. this["nextCacheUpdate"] = Date["now"]() + 1E3;
  2419. };
  2420. this["markCacheForUpdate"] = function() {
  2421. this["nextCacheUpdate"] = 0;
  2422. };
  2423. }
  2424. function Error(name, action, app) {
  2425. this["id"] = name;
  2426. this["powerup"] = workers[name];
  2427. this["startTime"] = Date["now"]();
  2428. this["expireTime"] = app;
  2429. this["stack"] = action;
  2430. this["update"] = function(canCreateDiscussions, isSlidingUp) {
  2431. this["startTime"] = Date["now"]();
  2432. this["expireTime"] = isSlidingUp;
  2433. this["stack"] = canCreateDiscussions;
  2434. };
  2435. this["getCooldown"] = function() {
  2436. if (Date["now"]() >= this["expireTime"]) {
  2437. return 2 * Math["PI"];
  2438. } else {
  2439. var delta = this["expireTime"] - Date["now"]();
  2440. var lowestDelta = this["expireTime"] - this["startTime"];
  2441. var _0x4A99 = Math["min"](delta / lowestDelta, 1) * 2;
  2442. return _0x4A99 * Math["PI"];
  2443. }
  2444. };
  2445. this["draw"] = function(scope, value, status) {
  2446. scope["drawImage"](this["powerup"]["img"], value, status, 50, 50);
  2447. if (this["stack"] > 1) {
  2448. scope["fillStyle"] = "#000";
  2449. scope["fillText"](this["stack"], value + 35, status + 17);
  2450. }
  2451. if (this["expireTime"] > 0) {
  2452. scope["beginPath"]();
  2453. scope["moveTo"](value + 25, status + 25);
  2454. scope["arc"](value + 25, status + 25, 25, headers, headers - this["getCooldown"](), false);
  2455. scope["closePath"]();
  2456. scope["globalAlpha"] = .75;
  2457. scope["fillStyle"] = "#222";
  2458. scope["fill"]();
  2459. scope["globalAlpha"] = 1;
  2460. }
  2461. };
  2462. }
  2463. function format(v) {
  2464. return f[v % f["length"]];
  2465. }
  2466. function createNode(v) {
  2467. return f[v % f["length"]];
  2468. }
  2469. function randomMoment(params) {
  2470. var name = params["length"] - 1;
  2471. for (; name > 0; name--) {
  2472. var i = Math["floor"](Math["random"]() * (name + 1));
  2473. var val = params[name];
  2474. params[name] = params[i];
  2475. params[i] = val;
  2476. }
  2477. return params;
  2478. }
  2479. function getByProp(value) {
  2480. if (value === 0 || value === self["playerId"]) {
  2481. return "You cannot block that player.";
  2482. }
  2483. if (object["includes"](value)) {
  2484. delete object[value];
  2485. return "Unblocked player with ID: " + value;
  2486. }
  2487. object["push"](value);
  2488. return "Blocked player with ID: " + value;
  2489. }
  2490. function modelDidAttach(z) {
  2491. return byteToHex[z >> 4 & 15] + byteToHex[z & 15];
  2492. }
  2493. function shouldPreventDefault(deltaX) {
  2494. if (deltaX <= 0) {
  2495. return "0:00";
  2496. }
  2497. var index = Math["floor"](deltaX / 3600);
  2498. var title = Math["floor"]((deltaX - index * 3600) / 60);
  2499. var blue = deltaX - index * 3600 - title * 60;
  2500. if (title < 10 && index > 0) {
  2501. title = "0" + title;
  2502. }
  2503. if (blue < 10) {
  2504. blue = "0" + blue;
  2505. }
  2506. return (index > 0 ? index + ":" : "") + title + ":" + blue;
  2507. }
  2508. function parseFonts() {
  2509. var popcornVideo = localStorage["getItem"]("version");
  2510. var curIncome = version["split"](".");
  2511. if (popcornVideo === null) {
  2512. localStorage["setItem"]("version", version);
  2513. return;
  2514. }
  2515. popcornVideo = popcornVideo["split"](".");
  2516. if (curIncome[0] != popcornVideo[0] || curIncome[1] != popcornVideo[1]) {
  2517. localStorage["setItem"]("version", version);
  2518. find(items);
  2519. append($("#popup-changelog"));
  2520. }
  2521. }
  2522. function Promise() {
  2523. this["playCounter"] = 0;
  2524. this["deathCounter"] = 0;
  2525. this["incrementPlay"] = function() {
  2526. this["playCounter"]++;
  2527. if (this["playCounter"] % 5 == 1) {
  2528. return true;
  2529. } else {
  2530. return false;
  2531. }
  2532. };
  2533. }
  2534. function parseUriConfig() {
  2535. if (typeof aipPlayer != "undefined") {
  2536. adplayer = new aipPlayer({
  2537. AD_WIDTH : 960,
  2538. AD_HEIGHT : 540,
  2539. PREROLL_ELEM : document["getElementById"]("preroll"),
  2540. AIP_COMPLETE : function() {
  2541. if (!self["spectate"]) {
  2542. self["play"]();
  2543. } else {
  2544. self["spec"]();
  2545. }
  2546. }
  2547. });
  2548. } else {
  2549. }
  2550. }
  2551. var popcornVideo;
  2552. var item;
  2553. var popcornMedia;
  2554. var memo;
  2555. var self;
  2556. var PaintTools;
  2557. var minX;
  2558. var array;
  2559. var duedate;
  2560. var obj;
  2561. var b;
  2562. var a;
  2563. var children;
  2564. var items;
  2565. var _attachmentCallbacks;
  2566. var hist;
  2567. var _messageListeners;
  2568. var extendedRegExp;
  2569. var elem;
  2570. var component;
  2571. var state;
  2572. var _0x5D95;
  2573. var bottoms;
  2574. var _self;
  2575. var settings;
  2576. var images;
  2577. var trans;
  2578. var payload;
  2579. var signature;
  2580. var _0x54AD = false;
  2581. var imageX = 0;
  2582. var artistTrack = 0;
  2583. var scale = .5;
  2584. var expected = null;
  2585. var _0x5129 = false;
  2586. var options = {
  2587. elements : [],
  2588. callbacks : [],
  2589. pendingFriends : [],
  2590. timestamps : []
  2591. };
  2592. var object = [];
  2593. const par5 = Math["PI"] * 2;
  2594. const maxReconnectTryTimes = 100;
  2595. const processEvaluatorsCallback = "https://gota.io/topic/updates/";
  2596. const numKeysDeleted = new firebase["auth"]["GoogleAuthProvider"];
  2597. const HOST = "https://accounts.gota.io";
  2598. var meta = {
  2599. key : "birthday_2018",
  2600. foodColors : ["#ca67c5", "#7badfd", "#da7272", "#e9b32a"],
  2601. particles : true,
  2602. particlesMax : 100,
  2603. motd : "",
  2604. endDate : 1529928E6,
  2605. enabled : false,
  2606. mother_addon : {
  2607. enabled : false,
  2608. x_offset : 605 / 531,
  2609. y_offset : 749 / 531
  2610. }
  2611. };
  2612. meta["enabled"] = new Date < meta["endDate"];
  2613. firebase["initializeApp"]({
  2614. apiKey : "AIzaSyCmYFIIazBPyg5goqvPb-7uA6W9-4TVqEM",
  2615. authDomain : "accounts.gota.io",
  2616. databaseURL : "https://gota-io.firebaseio.com",
  2617. projectId : "gota-io",
  2618. storageBucket : "gota-io.appspot.com",
  2619. messagingSenderId : "570450309042"
  2620. });
  2621. firebase["firestore"]()["settings"]({
  2622. timestampsInSnapshots : true
  2623. });
  2624. var graph = {};
  2625. var osFamilies = {
  2626. levelNames : 3,
  2627. levelSkins : 3
  2628. };
  2629. var fields = {
  2630. cAutoRespawn : false,
  2631. cHideId : false,
  2632. cHideServerDisplay : true,
  2633. sShowNames : "ALL",
  2634. sShowSkins : "ALL",
  2635. sQuality : "ULTRA",
  2636. cShowMass : false,
  2637. cShowGrid : false,
  2638. cShowBorder : false,
  2639. cTransCells : false,
  2640. cSilentLogin : false,
  2641. cHideChat : false,
  2642. cTextOutlines : false,
  2643. cHideMinimap : false,
  2644. cShowCoordinates : false,
  2645. cHideFood : false,
  2646. cColoredPing : false,
  2647. cUiEnabled : false,
  2648. cDisableAutoZoom : false,
  2649. cAutoDecline : false,
  2650. cDisableEventSkins : false,
  2651. cResizableChat : false,
  2652. iChatWidth : "360px",
  2653. iChatHeight : "250px"
  2654. };
  2655. var params = {
  2656. kEjectMass : 87,
  2657. kSplit : 32,
  2658. kToggleSpec : 81,
  2659. kDoubleSplit : -1,
  2660. kTripleSplit : -1,
  2661. kQuadSplit : -1
  2662. };
  2663. var _0x5291 = false;
  2664. var values = {
  2665. interfaceForegroundColor : "",
  2666. interfaceBackgroundColor : "",
  2667. gameBackgroundColor : "",
  2668. gridColor : "",
  2669. borderColor : ""
  2670. };
  2671. var defaults = {
  2672. background : "#121212",
  2673. gridColor : "rgb(170, 170, 170)",
  2674. borderColor : "rgb(255, 0, 0)",
  2675. uiBackground : "rgba(23, 22, 23, 0.9)",
  2676. uiForeground : "rgba(255, 255, 255, 1.0)",
  2677. alpha : 1
  2678. };
  2679. var result = {
  2680. enabled : false,
  2681. nameColor : {
  2682. r : 0,
  2683. g : 255,
  2684. b : 255
  2685. },
  2686. chatColor : 0,
  2687. lowerName : false,
  2688. lockedName : "",
  2689. skinName : "",
  2690. effect : 0
  2691. };
  2692. Self.prototype["clearStats"] = function() {
  2693. this["stats"] = {
  2694. name : "An unnamed cell",
  2695. alive : 0,
  2696. eatenFood : 0,
  2697. eatenEject : 0,
  2698. eatenVirus : 0,
  2699. eatenPlayer : 0,
  2700. gainFood : 0,
  2701. gainEject : 0,
  2702. gainVirus : 0,
  2703. gainPlayer : 0
  2704. };
  2705. };
  2706. Self.prototype["play"] = function() {
  2707. if (children == null) {
  2708. this["selfMsg"]("No server selected!");
  2709. return;
  2710. }
  2711. this["name"] = $("#name-box")["val"]();
  2712. this["spectate"] = false;
  2713. this["currentServerName"] = children["name"];
  2714. $("#playerServer")["html"](this["currentServerName"]);
  2715. if (this["isConnected"]() && this["currentServer"] == children["ip"]) {
  2716. this["sendPacket"](new PaintTools["setName"](this["name"]));
  2717. } else {
  2718. this["connect"](children["ip"]);
  2719. }
  2720. clicked();
  2721. find(items);
  2722. ga("send", "event", "Game", "webMenu", "Play");
  2723. };
  2724. Self.prototype["spec"] = function() {
  2725. if (children == null) {
  2726. this["selfMsg"]("No server selected!");
  2727. return;
  2728. }
  2729. this["spectate"] = true;
  2730. if (this["isConnected"]() && this["currentServer"] == children["ip"]) {
  2731. this["sendPacket"](new PaintTools["sendSpectate"]);
  2732. } else {
  2733. this["connect"](children["ip"]);
  2734. }
  2735. clicked();
  2736. find(items);
  2737. ga("send", "event", "Game", "webMenu", "Spectate");
  2738. };
  2739. Self.prototype["login"] = function() {
  2740. var value = $("#id-box")["val"]();
  2741. var privateKey = $("#pw-box")["val"]();
  2742. if (state) {
  2743. var se_model_table_row_ = sha512(value + ":" + sha512(privateKey));
  2744. se_model_table_row_ = sha512(se_model_table_row_ + state);
  2745. var oldCondition = sha512(value);
  2746. } else {
  2747. return;
  2748. }
  2749. var _self = fields["cSilentLogin"] ? 12 : 13;
  2750. this["sendPacket"](new PaintTools["sendLogin"](_self, oldCondition, se_model_table_row_));
  2751. find($("#popup-login"));
  2752. };
  2753. Self.prototype["connect"] = function(query) {
  2754. if (this["socket"] != null) {
  2755. this["socket"]["nextUrl"] = query;
  2756. this["disconnect"](query);
  2757. return;
  2758. }
  2759. this["currentServer"] = query;
  2760. this["currentServerName"] = children["name"];
  2761. this["selfMsg"]("Connecting to " + this["currentServerName"] + "...");
  2762. if (children["ssl"] == 1) {
  2763. this["socket"] = new WebSocket("wss://" + query);
  2764. } else {
  2765. this["socket"] = new WebSocket("ws://" + query);
  2766. }
  2767. this["socket"]["binaryType"] = "arraybuffer";
  2768. var popcornVideo = this;
  2769. this["socket"]["onopen"] = this["onConnect"]["bind"](this);
  2770. this["socket"]["onmessage"] = this["onMessage"]["bind"](this);
  2771. this["socket"]["onclose"] = function(canCreateDiscussions) {
  2772. popcornVideo["reset"]();
  2773. if (this["nextUrl"] != null) {
  2774. popcornVideo["connect"](this["nextUrl"]);
  2775. }
  2776. };
  2777. this["socket"]["onerror"] = function(canCreateDiscussions) {
  2778. popcornVideo["reset"]();
  2779. this["nextUrl"] = null;
  2780. popcornVideo["selfMsg"]("Error connecting to server... Retrying every second.");
  2781. setTimeout(function() {
  2782. if (popcornVideo["isConnected"]() == false && popcornVideo["socket"] == null) {
  2783. popcornVideo["connect"](query);
  2784. }
  2785. }, 1E3);
  2786. };
  2787. };
  2788. Self.prototype["disconnect"] = function(canCreateDiscussions) {
  2789. if (this["socket"] != null) {
  2790. this["socket"]["close"]();
  2791. }
  2792. };
  2793. Self.prototype["reset"] = function() {
  2794. this["bucket"] = {};
  2795. this["sorted"] = [];
  2796. this["foodObjects"] = {};
  2797. this["myCells"] = {};
  2798. this["playerRegistry"]["clear"]();
  2799. this["playerId"] = -1;
  2800. this["rainbow"] = 0;
  2801. this["score"] = 0;
  2802. this["currentServer"] = null;
  2803. this["clearStats"]();
  2804. this["clearParty"]();
  2805. this["buffHolder"]["clearBuffs"]();
  2806. if (this["socket"] != null) {
  2807. this["socket"] = null;
  2808. }
  2809. $("#playerId")["html"](this["playerId"]);
  2810. };
  2811. Self.prototype["isConnected"] = function() {
  2812. if (this["socket"] == null) {
  2813. return false;
  2814. } else {
  2815. return this["socket"]["readyState"] == 1;
  2816. }
  2817. };
  2818. Self.prototype["sendPacket"] = function(mmCoreSplitViewBlock) {
  2819. if (this["isConnected"]()) {
  2820. this["socket"]["send"](mmCoreSplitViewBlock);
  2821. }
  2822. };
  2823. Self.prototype["onConnect"] = function() {
  2824. $("#onesignal-bell-launcher")["css"]("display", "none");
  2825. object = [];
  2826. grecaptcha["execute"]();
  2827. this["sendPacket"](new PaintTools["connectionStart"]);
  2828. this["sendPing"]();
  2829. if (firebase["auth"]()["currentUser"] !== null) {
  2830. firebase["auth"]()["currentUser"]["getIdToken"](true)["then"]((_self) => {
  2831. self["sendPacket"](new PaintTools["sendAuthToken"](_self));
  2832. })["catch"]((name) => {
  2833. return buildJS(name, true);
  2834. });
  2835. return;
  2836. } else {
  2837. if (!this["spectate"]) {
  2838. this["sendPacket"](new PaintTools["setName"](this["name"]));
  2839. } else {
  2840. this["sendPacket"](new PaintTools["sendSpectate"]);
  2841. }
  2842. }
  2843. };
  2844. Self.prototype["sendPing"] = function() {
  2845. if (this["isConnected"]()) {
  2846. duedate = +new Date;
  2847. this["sendPacket"](new PaintTools["sendPing"]);
  2848. }
  2849. };
  2850. Self.prototype["selfMsg"] = function(series) {
  2851. var callbacks = document["createElement"]("td");
  2852. var result = document["createElement"]("span");
  2853. result["style"]["color"] = "#DDDD00";
  2854. result["innerHTML"] = "[System] " + $(series);
  2855. callbacks["appendChild"](result);
  2856. index(callbacks);
  2857. };
  2858. Self.prototype["selfMsgWithJoinCode"] = function(series, forcedSize) {
  2859. var callbacks = document["createElement"]("td");
  2860. var result = document["createElement"]("span");
  2861. result["style"]["color"] = "#DDDD00";
  2862. result["innerHTML"] = "[System] " + $(series);
  2863. callbacks["appendChild"](result);
  2864. var obj = document["createElement"]("span");
  2865. obj["style"]["color"] = "#DDDD00";
  2866. obj["innerHTML"] = forcedSize;
  2867. obj["style"]["pointerEvents"] = "all";
  2868. obj["style"]["userSelect"] = "all";
  2869. callbacks["appendChild"](obj);
  2870. index(callbacks);
  2871. };
  2872. Self.prototype["clearParty"] = function(canCreateDiscussions) {
  2873. this["party"] = [];
  2874. this["partyIds"] = {};
  2875. this["partyLeader"] = -1;
  2876. this["partyIndex"] = -1;
  2877. $("#party-panel")["css"]("display", "none");
  2878. if (trans["css"]("display") == "block") {
  2879. this["handleCustomGameLeave"]();
  2880. }
  2881. if (this["partyCode"] != null || _self != null) {
  2882. this["partyCode"] = _self = null;
  2883. window["history"]["pushState"]("page", "", " ");
  2884. }
  2885. };
  2886. Self.prototype["isPartyLeader"] = function() {
  2887. return this["partyLeader"] == this["playerId"];
  2888. };
  2889. Self.prototype["getServerMaxCells"] = function() {
  2890. return this["serverMaxCells"] + this["buffHolder"]["bonusMaxCells"];
  2891. };
  2892. Self.prototype["onMessage"] = function(options) {
  2893. var raw_basefont = new DataView(options["data"]);
  2894. var _0x4AD5 = raw_basefont["getUint8"](0);
  2895. raw_basefont["offset"] = 1;
  2896. switch(_0x4AD5) {
  2897. case 2:
  2898. this["handleUpdate"](raw_basefont);
  2899. break;
  2900. case 10:
  2901. this["handlePosition"](raw_basefont);
  2902. break;
  2903. case 13:
  2904. this["handleLogin"](raw_basefont);
  2905. break;
  2906. case 21:
  2907. this["handleStats"](raw_basefont);
  2908. break;
  2909. case 22:
  2910. this["showSubPanel"](raw_basefont);
  2911. break;
  2912. case 40:
  2913. this["handleInvite"](raw_basefont);
  2914. break;
  2915. case 41:
  2916. this["handlePartyInfo"](raw_basefont);
  2917. break;
  2918. case 42:
  2919. this["handlePartyData"](raw_basefont);
  2920. break;
  2921. case 43:
  2922. this["handlePartyJoinCode"](raw_basefont);
  2923. break;
  2924. case 49:
  2925. this["handleLeaderboard"](raw_basefont);
  2926. break;
  2927. case 50:
  2928. this["handleLeaderboardCustom"](raw_basefont);
  2929. break;
  2930. case 64:
  2931. this["handleMapData"](raw_basefont);
  2932. break;
  2933. case 65:
  2934. this["handleClearNodes"]();
  2935. break;
  2936. case 66:
  2937. this["handleUpdateBorder"](raw_basefont);
  2938. break;
  2939. case 70:
  2940. this["handleSystemMsg"](raw_basefont);
  2941. break;
  2942. case 71:
  2943. this["handlePing"]();
  2944. break;
  2945. case 72:
  2946. this["handleChat"](raw_basefont);
  2947. break;
  2948. case 73:
  2949. this["handleWhisper"](raw_basefont);
  2950. break;
  2951. case 80:
  2952. this["handleShowScrimmageMenu"]();
  2953. break;
  2954. case 81:
  2955. this["handleQueueData"](raw_basefont);
  2956. break;
  2957. case 82:
  2958. this["handleQueueLeave"](raw_basefont);
  2959. break;
  2960. case 83:
  2961. this["handleMatchState"](raw_basefont);
  2962. break;
  2963. case 90:
  2964. this["handleScrimmageData"](raw_basefont);
  2965. break;
  2966. case 91:
  2967. this["handleCustomGameShow"](raw_basefont);
  2968. break;
  2969. case 92:
  2970. this["handleCustomGameUpdate"](raw_basefont);
  2971. break;
  2972. case 93:
  2973. this["handleCustomGameLeave"]();
  2974. break;
  2975. case 100:
  2976. this["handleAddBuff"](raw_basefont);
  2977. break;
  2978. case 101:
  2979. this["handleRemoveBuff"](raw_basefont);
  2980. break;
  2981. case 102:
  2982. this["handleClearBuffs"](raw_basefont);
  2983. break;
  2984. case 103:
  2985. this["handleAuthenticated"](raw_basefont);
  2986. break;
  2987. }
  2988. };
  2989. Self.prototype["handleUpdate"] = function(item) {
  2990. for (; true;) {
  2991. var i = item["getUint16"](item["offset"], true);
  2992. item["offset"] += 2;
  2993. if (i == 0) {
  2994. break;
  2995. }
  2996. var object = this["playerRegistry"]["getPlayer"](i);
  2997. var _0x4AB7 = false;
  2998. if (object == null) {
  2999. object = new Type(i);
  3000. } else {
  3001. _0x4AB7 = true;
  3002. }
  3003. object["cellColor"] = "#" + modelDidAttach(item["getUint8"](item["offset"]++)) + modelDidAttach(item["getUint8"](item["offset"]++)) + modelDidAttach(item["getUint8"](item["offset"]++));
  3004. object["name"] = compare(item);
  3005. object["flags"] = item["getUint8"](item["offset"]++);
  3006. if ((object["flags"] & 2) == 2) {
  3007. object["nameColor"] = "#" + modelDidAttach(item["getUint8"](item["offset"]++)) + modelDidAttach(item["getUint8"](item["offset"]++)) + modelDidAttach(item["getUint8"](item["offset"]++));
  3008. object["parseEffect"](item["getUint8"](item["offset"]++));
  3009. object["setSkin"](require(item));
  3010. object["cacheUpdate"] = true;
  3011. }
  3012. if (object["skin"] == null) {
  3013. object["setSkin"](object["name"]);
  3014. }
  3015. if (!_0x4AB7) {
  3016. self["playerRegistry"]["add"](object);
  3017. }
  3018. }
  3019. for (; true;) {
  3020. i = item["getUint16"](item["offset"], true);
  3021. item["offset"] += 2;
  3022. if (i == 0) {
  3023. break;
  3024. }
  3025. var alwaysDownload = item["getUint8"](item["offset"]++);
  3026. var point;
  3027. if (alwaysDownload == 0) {
  3028. point = this["foodObjects"][i];
  3029. } else {
  3030. point = this["bucket"][i];
  3031. }
  3032. if (point == null) {
  3033. point = new users(i);
  3034. point["setType"](alwaysDownload);
  3035. point["setX"](item["getInt16"](item["offset"], true));
  3036. point["setY"](item["getInt16"](item["offset"] + 2, true));
  3037. item["offset"] += 4;
  3038. switch(alwaysDownload) {
  3039. case 0:
  3040. point["color"] = format(point["id"]);
  3041. break;
  3042. case 1:
  3043. point["setSize"](item["getUint16"](item["offset"], true));
  3044. item["offset"] += 2;
  3045. point["color"] = "#" + modelDidAttach(item["getUint8"](item["offset"]++)) + modelDidAttach(item["getUint8"](item["offset"]++)) + modelDidAttach(item["getUint8"](item["offset"]++));
  3046. point["skin"] = item["getUint8"](item["offset"]++) - 1;
  3047. break;
  3048. case 2:
  3049. point["setSize"](item["getUint16"](item["offset"], true));
  3050. item["offset"] += 2;
  3051. point["playerId"] = item["getUint16"](item["offset"], true);
  3052. item["offset"] += 2;
  3053. break;
  3054. case 3:
  3055. point["setSize"](item["getUint16"](item["offset"], true));
  3056. item["offset"] += 2;
  3057. break;
  3058. case 4:
  3059. point["setSize"](item["getUint16"](item["offset"], true));
  3060. item["offset"] += 2;
  3061. break;
  3062. case 5:
  3063. point["setSize"](80);
  3064. point["buff"] = item["getUint8"](item["offset"]++);
  3065. break;
  3066. }
  3067. if (alwaysDownload == 0) {
  3068. this["foodObjects"][i] = point;
  3069. } else {
  3070. this["bucket"][i] = point;
  3071. }
  3072. if (point["playerId"] == this["playerId"]) {
  3073. this["myCells"][i] = point;
  3074. }
  3075. } else {
  3076. point["updateX"](item["getInt16"](item["offset"], true));
  3077. point["updateY"](item["getInt16"](item["offset"] + 2, true));
  3078. item["offset"] += 4;
  3079. switch(alwaysDownload) {
  3080. case 0:
  3081. break;
  3082. case 1:
  3083. point["size_"] = item["getUint16"](item["offset"], true);
  3084. item["offset"] += 2;
  3085. item["offset"] += 4;
  3086. break;
  3087. case 2:
  3088. point["size_"] = item["getUint16"](item["offset"], true);
  3089. item["offset"] += 2;
  3090. item["offset"] += 2;
  3091. break;
  3092. case 3:
  3093. point["size_"] = item["getUint16"](item["offset"], true);
  3094. item["offset"] += 2;
  3095. break;
  3096. case 4:
  3097. point["size_"] = item["getUint16"](item["offset"], true);
  3098. item["offset"] += 2;
  3099. break;
  3100. case 5:
  3101. item["offset"]++;
  3102. break;
  3103. }
  3104. point["steps"] = 30;
  3105. }
  3106. }
  3107. var _0x4A99 = item["getUint16"](item["offset"], true);
  3108. item["offset"] += 2;
  3109. for (; _0x4A99 > 0;) {
  3110. i = item["getUint16"](item["offset"], true);
  3111. item["offset"] += 2;
  3112. self["playerRegistry"]["remove"](i);
  3113. _0x4A99--;
  3114. }
  3115. _0x4A99 = item["getUint16"](item["offset"], true);
  3116. item["offset"] += 2;
  3117. for (; _0x4A99 > 0;) {
  3118. i = item["getUint16"](item["offset"], true);
  3119. item["offset"] += 2;
  3120. point = this["bucket"][i] || this["foodObjects"][i];
  3121. if (point != null) {
  3122. if (point["type"] == 0) {
  3123. delete this["foodObjects"][i];
  3124. } else {
  3125. delete this["bucket"][i];
  3126. }
  3127. if (point["playerId"] == this["playerId"]) {
  3128. delete this["myCells"][i];
  3129. if (Object["keys"](this["myCells"])["length"] == 0) {
  3130. if (fields["cAutoRespawn"]) {
  3131. if ($("#main")["css"]("display") == "none") {
  3132. self["play"]();
  3133. }
  3134. } else {
  3135. if (extendedRegExp["css"]("display") != "block") {
  3136. append(items);
  3137. }
  3138. aiptag["cmd"]["display"]["push"](function() {
  3139. aipDisplayTag["refresh"]("GOT_gota-io_336x280");
  3140. });
  3141. }
  3142. }
  3143. }
  3144. }
  3145. _0x4A99--;
  3146. }
  3147. this["sortCells"]();
  3148. };
  3149. Self.prototype["handlePosition"] = function(options) {
  3150. this["centerX_"] = options["getFloat32"](options["offset"], true);
  3151. options["offset"] += 4;
  3152. this["centerY_"] = options["getFloat32"](options["offset"], true);
  3153. options["offset"] += 4;
  3154. this["centerSteps"] = 30;
  3155. if (!fields["cDisableAutoZoom"]) {
  3156. this["scale_base"] = options["getFloat32"](options["offset"], true);
  3157. }
  3158. };
  3159. Self.prototype["handleMapData"] = function(item) {
  3160. this["playerId"] = item["getUint16"](item["offset"], true);
  3161. item["offset"] += 2 + 1;
  3162. this["handleUpdateBorder"](item);
  3163. this["serverMaxCells"] = item["getUint8"](item["offset"]++);
  3164. $("#playerId")["html"](self["playerId"]);
  3165. $("#playerCells")["html"]("0/" + this["getServerMaxCells"]());
  3166. if (_self != null) {
  3167. self["sendPacket"](new PaintTools["sendPartyJoin"](_self));
  3168. }
  3169. extendedRegExp["css"]("display", "none");
  3170. $("#scrimmage-btn-leave")["css"]("display", "none");
  3171. };
  3172. Self.prototype["handleUpdateBorder"] = function(options) {
  3173. this["border"] = {};
  3174. this["border"]["left"] = options["getInt16"](options["offset"], true);
  3175. this["border"]["top"] = options["getInt16"](options["offset"] + 2, true);
  3176. this["border"]["right"] = options["getInt16"](options["offset"] + 4, true);
  3177. this["border"]["bottom"] = options["getInt16"](options["offset"] + 6, true);
  3178. options["offset"] += 8;
  3179. this["border"]["width"] = this["border"]["right"] - this["border"]["left"];
  3180. this["border"]["height"] = this["border"]["bottom"] - this["border"]["top"];
  3181. this["border"]["enabled"] = this["border"]["width"] != 0 && this["border"]["height"] != 0;
  3182. };
  3183. Self.prototype["handleClearNodes"] = function(canCreateDiscussions) {
  3184. if (Object["keys"](this["bucket"])["length"] > 0) {
  3185. this["bucket"] = {};
  3186. }
  3187. if (Object["keys"](this["foodObjects"])["length"] > 0) {
  3188. this["foodObjects"] = {};
  3189. }
  3190. if (Object["keys"](this["myCells"])["length"] > 0) {
  3191. this["bucket"] = {};
  3192. }
  3193. };
  3194. Self.prototype["handleLeaderboard"] = function(options) {
  3195. var popcornVideo = document["getElementById"]("leaderboard-canvas");
  3196. var item = popcornVideo["getContext"]("2d");
  3197. _messageListeners["html"]("Leaderboard");
  3198. var cell_amount = options["getUint32"](options["offset"], true);
  3199. options["offset"] += 4;
  3200. popcornVideo["width"] = 200;
  3201. popcornVideo["height"] = 20 * cell_amount + 5;
  3202. item["font"] = "16px Calibri";
  3203. var maxLen = 20;
  3204. var i = 0;
  3205. for (; i < cell_amount; i++) {
  3206. var indexLookupKey = options["getUint16"](options["offset"], true);
  3207. options["offset"] += 2;
  3208. var _0x4B2F = compare(options) || "An unnamed cell";
  3209. if (indexLookupKey == this["playerId"]) {
  3210. item["fillStyle"] = "#FFAAAA";
  3211. } else {
  3212. if (this["partyIds"][indexLookupKey] != null) {
  3213. item["fillStyle"] = "#FFFF00";
  3214. } else {
  3215. item["fillStyle"] = values["interfaceForegroundColor"];
  3216. }
  3217. }
  3218. item["fillText"](i + 1 + ". " + _0x4B2F, 5, maxLen);
  3219. maxLen = maxLen + 20;
  3220. }
  3221. };
  3222. Self.prototype["handleLeaderboardCustom"] = function(options) {
  3223. var popcornVideo = document["getElementById"]("leaderboard-canvas");
  3224. var item = popcornVideo["getContext"]("2d");
  3225. _messageListeners["html"]("Leaderboard");
  3226. var clientHeight = options["getUint16"](options["offset"], true);
  3227. var river = options["getUint8"](options["offset"] + 2, true);
  3228. var EOL = options["getUint8"](options["offset"] + 3, true);
  3229. options["offset"] += 4;
  3230. popcornVideo["width"] = 200;
  3231. popcornVideo["height"] = 20 * clientHeight + 5 + (EOL != 0 ? 40 : 0);
  3232. item["font"] = "16px Calibri";
  3233. var maxLen = 20;
  3234. var stripTerrain = 0;
  3235. for (; stripTerrain < clientHeight; stripTerrain++) {
  3236. var child = require(options);
  3237. if (stripTerrain == river) {
  3238. item["fillStyle"] = "#FFAAAA";
  3239. } else {
  3240. item["fillStyle"] = values["interfaceForegroundColor"];
  3241. }
  3242. item["fillText"](child, 5, maxLen);
  3243. maxLen = maxLen + 20;
  3244. }
  3245. if (EOL != 0) {
  3246. maxLen = maxLen + 20;
  3247. item["fillText"]("Respawn: " + EOL, 5, maxLen);
  3248. }
  3249. };
  3250. Self.prototype["handlePing"] = function() {
  3251. var timeSubmittedDiff = +new Date - duedate;
  3252. if (!fields["cColoredPing"]) {
  3253. if (timeSubmittedDiff < 100) {
  3254. $("#playerPing")["css"]({
  3255. "color" : "#00ff00"
  3256. });
  3257. } else {
  3258. if (timeSubmittedDiff < 150) {
  3259. $("#playerPing")["css"]({
  3260. "color" : "#ffff00"
  3261. });
  3262. } else {
  3263. if (timeSubmittedDiff < 200) {
  3264. $("#playerPing")["css"]({
  3265. "color" : "#ff6600"
  3266. });
  3267. } else {
  3268. if (timeSubmittedDiff > 200) {
  3269. $("#playerPing")["css"]({
  3270. "color" : "#ff0000"
  3271. });
  3272. }
  3273. }
  3274. }
  3275. }
  3276. } else {
  3277. $("#playerPing")["css"]({
  3278. "color" : defaults["uiForeground"]
  3279. });
  3280. }
  3281. $("#playerPing")["html"](timeSubmittedDiff + "ms");
  3282. };
  3283. Self.prototype["handleChat"] = function(options) {
  3284. var _0x4A99 = options["getUint8"](options["offset"]++);
  3285. var expanded = "rgb(" + options["getUint8"](options["offset"]++) + "," + options["getUint8"](options["offset"]++) + "," + options["getUint8"](options["offset"]++) + ")";
  3286. var j = options["getUint8"](options["offset"]++);
  3287. var value = options["getUint16"](options["offset"], true);
  3288. options["offset"] += 2;
  3289. if (object["includes"](value)) {
  3290. return;
  3291. }
  3292. var ms = require(options);
  3293. var attribute = compare(options) || "An unnamed cell";
  3294. var series = $(compare(options));
  3295. var title;
  3296. switch(_0x4A99) {
  3297. case 1:
  3298. title = "Party";
  3299. break;
  3300. case 2:
  3301. title = "Admin";
  3302. break;
  3303. default:
  3304. title = "All";
  3305. break;
  3306. }
  3307. if (ms["length"] > 0) {
  3308. $(title = title + (" - " + ms));
  3309. }
  3310. var callbacks = document["createElement"]("td");
  3311. var params = document["createElement"]("span");
  3312. params["innerHTML"] = "[" + title + "] ";
  3313. callbacks["appendChild"](params);
  3314. var result = extend(attribute, expanded);
  3315. result["dataset"]["playerId"] = value;
  3316. result["oncontextmenu"] = getListed;
  3317. result["style"]["userSelect"] = "none";
  3318. callbacks["appendChild"](result);
  3319. var node = document["createElement"]("span");
  3320. node["style"]["color"] = palette[j];
  3321. if (j == 0) {
  3322. node["innerHTML"] = ": " + calcPrevData(series);
  3323. } else {
  3324. var params = document["createElement"]("span");
  3325. params["innerHTML"] = ": ";
  3326. callbacks["appendChild"](params);
  3327. node["innerHTML"] = calcPrevData(series);
  3328. }
  3329. callbacks["appendChild"](node);
  3330. index(callbacks);
  3331. };
  3332. Self.prototype["handleWhisper"] = function(style) {
  3333. var attribute = compare(style) || "An unnamed cell";
  3334. style["offset"] += 2;
  3335. var expanded = "rgb(" + style["getUint8"](style["offset"]++) + "," + style["getUint8"](style["offset"]++) + "," + style["getUint8"](style["offset"]++) + ")";
  3336. var level = compare(style) || "An unnamed cell";
  3337. style["offset"] += 2;
  3338. var start = "rgb(" + style["getUint8"](style["offset"]++) + "," + style["getUint8"](style["offset"]++) + "," + style["getUint8"](style["offset"]++) + ")";
  3339. var series = $(compare(style));
  3340. var callbacks = document["createElement"]("td");
  3341. var result = extend(attribute, expanded);
  3342. result["style"]["userSelect"] = "none";
  3343. callbacks["appendChild"](result);
  3344. var params = document["createElement"]("span");
  3345. params["innerHTML"] = " > ";
  3346. callbacks["appendChild"](params);
  3347. var node = extend(level, start);
  3348. node["style"]["userSelect"] = "none";
  3349. callbacks["appendChild"](node);
  3350. var options = document["createElement"]("span");
  3351. options["innerHTML"] = ": " + calcPrevData(series);
  3352. callbacks["appendChild"](options);
  3353. index(callbacks);
  3354. };
  3355. Self.prototype["handleSystemMsg"] = function(password) {
  3356. var ret = compare(password);
  3357. this["selfMsg"](ret);
  3358. };
  3359. Self.prototype["handleLogin"] = function(options) {
  3360. var _0x4A99 = options["getUint8"](1);
  3361. switch(_0x4A99) {
  3362. case 0:
  3363. break;
  3364. case 1:
  3365. alert("Invalid id or password!");
  3366. $("#id-box")["val"]("");
  3367. $("#pw-box")["val"]("");
  3368. append(items);
  3369. break;
  3370. }
  3371. append($("#popup-login"));
  3372. $("#id-box")["focus"]();
  3373. state = options["getUint32"](2, true);
  3374. };
  3375. Self.prototype["handleAuthenticated"] = function(options) {
  3376. var _0x4A99 = options["getUint8"](1);
  3377. switch(_0x4A99) {
  3378. case generatedSeries["SUCCESS"]:
  3379. break;
  3380. case generatedSeries["FAILURE"]:
  3381. this["selfMsg"]("Invalid authentication token! Please logout and try again!");
  3382. break;
  3383. }
  3384. if (result["enabled"]) {
  3385. this["sendPacket"](new PaintTools["sendSubPanel"]);
  3386. }
  3387. if (!this["spectate"]) {
  3388. this["sendPacket"](new PaintTools["setName"](this["name"]));
  3389. } else {
  3390. this["sendPacket"](new PaintTools["sendSpectate"]);
  3391. }
  3392. };
  3393. Self.prototype["handleInvite"] = function(password) {
  3394. if (fields["cAutoDecline"]) {
  3395. self["sendPacket"](new PaintTools["sendInviteResponse"](false));
  3396. } else {
  3397. var ret = compare(password);
  3398. var domain = extend(ret + " has invited you to a party.", "#FFFFFF");
  3399. var self = document["getElementById"]("popup-party-text");
  3400. for (; self["firstChild"] != null;) {
  3401. self["removeChild"](self["firstChild"]);
  3402. }
  3403. self["appendChild"](domain);
  3404. append($("#popup-party"));
  3405. }
  3406. };
  3407. Self.prototype["handlePartyInfo"] = function(options) {
  3408. var specialChars = {};
  3409. var TYPES = [];
  3410. var codeGeneratorFunc = -1;
  3411. var clientHeight = options["getUint16"](options["offset"], true);
  3412. options["offset"] += 2;
  3413. var targetOffsetHeight = 0;
  3414. for (; targetOffsetHeight < clientHeight; targetOffsetHeight++) {
  3415. var node = {};
  3416. var _0x4AB7 = options["getUint8"](options["offset"]++);
  3417. node["id"] = options["getUint16"](options["offset"], true);
  3418. specialChars[node["id"]] = targetOffsetHeight;
  3419. options["offset"] += 2;
  3420. if (_0x4AB7 == 1) {
  3421. node["color"] = "#00FFFF";
  3422. codeGeneratorFunc = node["id"];
  3423. } else {
  3424. node["color"] = defaults["uiForeground"];
  3425. }
  3426. node["name"] = compare(options) || "An unnamed cell";
  3427. node["x"] = 0;
  3428. node["y"] = 0;
  3429. node["x_"] = 0;
  3430. node["y_"] = 0;
  3431. node["score"] = 0;
  3432. node["cache"] = -1;
  3433. node["team"] = 0;
  3434. if (this["partyIds"][node["id"]] != null) {
  3435. var hash = this["party"][this["partyIds"][node["id"]]];
  3436. node["x"] = hash["x"];
  3437. node["y"] = hash["y"];
  3438. node["x_"] = hash["x_"];
  3439. node["y_"] = hash["y_"];
  3440. node["mmColor"] = hash["mmColor"];
  3441. } else {
  3442. node["mmColor"] = createNode(node["id"]);
  3443. }
  3444. TYPES["push"](node);
  3445. }
  3446. this["party"] = TYPES;
  3447. this["partyIds"] = specialChars;
  3448. if (this["partyLeader"] != codeGeneratorFunc) {
  3449. this["partyLeader"] = codeGeneratorFunc;
  3450. if (trans["css"]("display") == "block") {
  3451. ScrimmageHelper["checkLeader"]();
  3452. }
  3453. }
  3454. if (clientHeight > 0) {
  3455. this["drawParty"]();
  3456. } else {
  3457. this["clearParty"]();
  3458. }
  3459. };
  3460. Self.prototype["handlePartyData"] = function(options) {
  3461. var addressCount = options["getUint16"](options["offset"], true);
  3462. options["offset"] += 2;
  3463. if (addressCount != this["party"]["length"]) {
  3464. return;
  3465. }
  3466. var signedTransactionsCounter = 0;
  3467. for (; signedTransactionsCounter < addressCount; signedTransactionsCounter++) {
  3468. var payload = this["party"][signedTransactionsCounter];
  3469. payload["x_"] = options["getInt16"](options["offset"], true);
  3470. payload["y_"] = options["getInt16"](options["offset"] + 2, true);
  3471. payload["score"] = options["getInt32"](options["offset"] + 4, true);
  3472. options["offset"] += 8;
  3473. }
  3474. this["drawParty"]();
  3475. };
  3476. Self.prototype["handlePartyJoinCode"] = function(level) {
  3477. var ent = require(level);
  3478. this["partyCode"] = require(level);
  3479. if (this["partyCode"]["length"] != 0) {
  3480. this["selfMsgWithJoinCode"](ent, this["partyCode"]);
  3481. $("#popup-party-code-content input")["val"](this["partyCode"]);
  3482. $("#popup-party-code")["show"]();
  3483. var GET_AUTH_URL_TIMEOUT = "#" + this["currentServerName"] + "&" + this["partyCode"];
  3484. window["history"]["pushState"]("page", "", GET_AUTH_URL_TIMEOUT);
  3485. } else {
  3486. this["selfMsg"](ent);
  3487. this["partyCode"] = null;
  3488. window["history"]["pushState"]("page", "", " ");
  3489. }
  3490. };
  3491. Self.prototype["handleStats"] = function(options) {
  3492. var key = options["getUint16"](options["offset"], true);
  3493. options["offset"] += 2;
  3494. this["stats"]["name"] = compare(options) || "An unnamed cell";
  3495. this["stats"]["alive"] += options["getUint32"](options["offset"], true);
  3496. options["offset"] += 4;
  3497. this["stats"]["eatenFood"] += options["getUint32"](options["offset"], true);
  3498. options["offset"] += 4;
  3499. this["stats"]["eatenEject"] += options["getUint32"](options["offset"], true);
  3500. options["offset"] += 4;
  3501. this["stats"]["eatenVirus"] += options["getUint32"](options["offset"], true);
  3502. options["offset"] += 4;
  3503. this["stats"]["eatenPlayer"] += options["getUint32"](options["offset"], true);
  3504. options["offset"] += 4;
  3505. this["stats"]["gainFood"] += options["getUint32"](options["offset"], true);
  3506. options["offset"] += 4;
  3507. this["stats"]["gainEject"] += options["getUint32"](options["offset"], true);
  3508. options["offset"] += 4;
  3509. this["stats"]["gainVirus"] += options["getUint32"](options["offset"], true);
  3510. options["offset"] += 4;
  3511. this["stats"]["gainPlayer"] += options["getUint32"](options["offset"], true);
  3512. options["offset"] += 4;
  3513. var locationMap = $("#main-stats");
  3514. locationMap["empty"]();
  3515. locationMap["append"]("<span>Name: " + this["stats"]["name"] + " (" + key + ")</span><br>");
  3516. locationMap["append"]("<span>Alive: " + this["stats"]["alive"] + "</span><br>");
  3517. locationMap["append"]("<span>Food eaten: " + this["stats"]["eatenFood"] + " (" + this["stats"]["gainFood"] + ")</span><br>");
  3518. locationMap["append"]("<span>Ejected mass eaten: " + this["stats"]["eatenEject"] + " (" + this["stats"]["gainEject"] + ")</span><br>");
  3519. locationMap["append"]("<span>Viruses eaten: " + this["stats"]["eatenVirus"] + " (" + this["stats"]["gainVirus"] + ")</span><br>");
  3520. locationMap["append"]("<span>Player cells eaten: " + this["stats"]["eatenPlayer"] + " (" + this["stats"]["gainPlayer"] + ")</span><br>");
  3521. };
  3522. Self.prototype["showSubPanel"] = function(canCreateDiscussions) {
  3523. result["enabled"] = true;
  3524. updater();
  3525. close();
  3526. _0x54AD = true;
  3527. $("#recaptcha")["css"]("display", "none");
  3528. grecaptcha["reset"]();
  3529. };
  3530. Self.prototype["handleAddBuff"] = function(options) {
  3531. var artistTrack = options["getUint8"](options["offset"]++);
  3532. var GET_AUTH_URL_TIMEOUT = options["getUint8"](options["offset"]++);
  3533. var numKeysDeleted = options["getFloat64"](options["offset"], true);
  3534. options["offset"] += 8;
  3535. this["buffHolder"]["onAddBuff"](artistTrack, GET_AUTH_URL_TIMEOUT, numKeysDeleted);
  3536. };
  3537. Self.prototype["handleRemoveBuff"] = function(options) {
  3538. var artistTrack = options["getUint8"](options["offset"]++);
  3539. this["buffHolder"]["onRemoveBuff"](artistTrack);
  3540. };
  3541. Self.prototype["handleClearBuffs"] = function(options) {
  3542. var artistTrack = options["getUint8"](options["offset"]++) == 1 ? true : false;
  3543. this["buffHolder"]["clearBuffs"](artistTrack);
  3544. };
  3545. Self.prototype["sortCells"] = function() {
  3546. this["sorted"] = [];
  3547. var this_stream;
  3548. var _0x4AF3;
  3549. var conditionName;
  3550. for (conditionName in this["bucket"]) {
  3551. this_stream = this["bucket"][conditionName];
  3552. if (this["sorted"]["length"] == 0) {
  3553. this["sorted"]["push"](this_stream);
  3554. } else {
  3555. _0x4AF3 = false;
  3556. conditionName = 0;
  3557. for (; conditionName < this["sorted"]["length"]; conditionName++) {
  3558. var conditionVariable = this["sorted"][conditionName];
  3559. if (this_stream["size"] > conditionVariable["size"]) {
  3560. this["sorted"]["splice"](conditionName, 0, this_stream);
  3561. _0x4AF3 = true;
  3562. break;
  3563. }
  3564. }
  3565. if (!_0x4AF3) {
  3566. this["sorted"]["push"](this_stream);
  3567. }
  3568. }
  3569. }
  3570. var _0x4AD5 = 0;
  3571. var origoy = 0;
  3572. for (conditionName in this["myCells"]) {
  3573. this_stream = this["myCells"][conditionName];
  3574. _0x4AD5 = _0x4AD5 + this_stream["getRealMass"]();
  3575. origoy++;
  3576. }
  3577. if (_0x4AD5 > this["score"]) {
  3578. this["score"] = _0x4AD5;
  3579. $("#playerScore")["html"](this["score"]);
  3580. }
  3581. $("#playerCells")["html"](origoy + "/" + this["getServerMaxCells"]());
  3582. };
  3583. Self.prototype["drawParty"] = function() {
  3584. if (_attachmentCallbacks["css"]("display") == "none" && hist["css"]("display") != "none") {
  3585. _attachmentCallbacks["css"]("display", "block");
  3586. }
  3587. var popcornVideo = document["getElementById"]("party-canvas");
  3588. var obj = popcornVideo["getContext"]("2d");
  3589. obj["font"] = "16px Calibri";
  3590. var v_max = 0;
  3591. var lastChecksumFailCount = 0;
  3592. var i = 0;
  3593. for (; i < this["party"]["length"]; i++) {
  3594. var item = this["party"][i];
  3595. if (item["cache"] == -1) {
  3596. item["cache"] = obj["measureText"](i + 1 + ". " + item["name"])["width"];
  3597. }
  3598. if (item["cache"] > v_max) {
  3599. v_max = item["cache"];
  3600. }
  3601. var currentChecksumFailCount = obj["measureText"](item["score"])["width"];
  3602. if (currentChecksumFailCount > lastChecksumFailCount) {
  3603. lastChecksumFailCount = currentChecksumFailCount;
  3604. }
  3605. }
  3606. popcornVideo["width"] = 15 + v_max + 50 + lastChecksumFailCount;
  3607. popcornVideo["height"] = 20 * this["party"]["length"] + 5;
  3608. obj["font"] = "16px Calibri";
  3609. var p3 = 20;
  3610. var deep = 5 + v_max + 50;
  3611. i = 0;
  3612. for (; i < this["party"]["length"]; i++) {
  3613. item = this["party"][i];
  3614. obj["fillStyle"] = item["color"];
  3615. obj["fillText"](i + 1 + ". " + item["name"], 5, p3);
  3616. obj["fillText"]("" + item["score"], deep, p3);
  3617. p3 = p3 + 20;
  3618. }
  3619. };
  3620. Self.prototype["handleShowScrimmageMenu"] = function() {
  3621. items["stop"](true, false);
  3622. items["css"]("display", "none");
  3623. extendedRegExp["css"]("display", "block");
  3624. $("#scrimmage-btn-leave")["css"]("display", "none");
  3625. self["border"]["enabled"] = false;
  3626. };
  3627. Self.prototype["handleQueueData"] = function(options) {
  3628. var value = require(options);
  3629. var differenceX = options["getUint32"](options["offset"], true);
  3630. options["offset"] += 4;
  3631. var EOL = options["offset"] < options["byteLength"] ? options["getUint8"](options["offset"]) : -1;
  3632. var popcornVideo = document["getElementById"]("leaderboard-canvas");
  3633. var item = popcornVideo["getContext"]("2d");
  3634. _messageListeners["html"]("Queue");
  3635. popcornVideo["width"] = 200;
  3636. popcornVideo["height"] = 20 * (2 + (EOL != -1 ? 1 : 0)) + 5;
  3637. item["font"] = "16px Calibri";
  3638. var maxLen = 20;
  3639. item["fillStyle"] = values["interfaceForegroundColor"];
  3640. item["fillText"]("Mode: " + value, 5, maxLen);
  3641. maxLen = maxLen + 20;
  3642. item["fillText"]("Time: " + shouldPreventDefault(differenceX), 5, maxLen);
  3643. if (EOL != -1) {
  3644. maxLen = maxLen + 20;
  3645. item["fillText"]("Queued players: " + EOL, 5, maxLen);
  3646. }
  3647. };
  3648. Self.prototype["handleQueueLeave"] = function(lodash) {
  3649. var _ = require(lodash);
  3650. var popcornVideo = document["getElementById"]("leaderboard-canvas");
  3651. var _0x4A99 = popcornVideo["getContext"]("2d");
  3652. popcornVideo["width"] = 0;
  3653. popcornVideo["height"] = 0;
  3654. this["selfMsg"]("You have left the queue for [" + _ + "]");
  3655. };
  3656. Self.prototype["handleMatchState"] = function(options) {
  3657. var _0x4A99 = options["byteLength"] == 1 ? 0 : options["getUint8"](options["offset"]++);
  3658. if (_0x4A99 == 0) {
  3659. this["selfMsg"]("A match has been found. Good luck and have fun!");
  3660. } else {
  3661. if (_0x4A99 == 1) {
  3662. $("#scrimmage-btn-leave")["css"]("display", "block");
  3663. }
  3664. }
  3665. };
  3666. Self.prototype["handleScrimmageData"] = function(f) {
  3667. var _0x4A99 = f["getUint8"](f["offset"]++);
  3668. var params = $("#scrimmage-mode-select");
  3669. var locationMap = $("#scrimmage-mode-info");
  3670. params["empty"]();
  3671. locationMap["empty"]();
  3672. for (; _0x4A99 > 0;) {
  3673. var i = f["getUint8"](f["offset"]++);
  3674. var s = require(f);
  3675. var version = require(f);
  3676. var result = document["createElement"]("option");
  3677. result["innerHTML"] = s;
  3678. result["value"] = i;
  3679. params["append"](result);
  3680. result = document["createElement"]("div");
  3681. result["innerHTML"] = version;
  3682. result["id"] = "scrimmage-info-" + i;
  3683. result["style"]["display"] = "none";
  3684. locationMap["append"](result);
  3685. _0x4A99--;
  3686. }
  3687. params["prop"]("selectedIndex", 0);
  3688. params["trigger"]("change");
  3689. images = {
  3690. "modes" : {},
  3691. "sizes" : {},
  3692. "maps" : []
  3693. };
  3694. if (f["byteLength"] - 1 > f["offset"]) {
  3695. _0x4A99 = f["getUint8"](f["offset"]++);
  3696. for (; _0x4A99 > 0;) {
  3697. i = f["getUint8"](f["offset"]++);
  3698. s = require(f);
  3699. images["modes"][i] = {
  3700. "id" : i,
  3701. "name" : s
  3702. };
  3703. _0x4A99--;
  3704. }
  3705. _0x4A99 = f["getUint8"](f["offset"]++);
  3706. for (; _0x4A99 > 0;) {
  3707. i = f["getUint8"](f["offset"]++);
  3708. s = require(f);
  3709. images["sizes"][i] = {
  3710. "id" : i,
  3711. "name" : s
  3712. };
  3713. _0x4A99--;
  3714. }
  3715. _0x4A99 = f["getUint8"](f["offset"]++);
  3716. for (; _0x4A99 > 0;) {
  3717. s = require(f);
  3718. var result = {
  3719. "name" : s,
  3720. "startmass" : 0,
  3721. "modes" : [],
  3722. "sizes" : []
  3723. };
  3724. var rel = f["getUint8"](f["offset"]++);
  3725. for (; rel > 0;) {
  3726. result["modes"]["push"](f["getUint8"](f["offset"]++));
  3727. rel--;
  3728. }
  3729. rel = f["getUint8"](f["offset"]++);
  3730. for (; rel > 0;) {
  3731. result["sizes"]["push"](f["getUint8"](f["offset"]++));
  3732. rel--;
  3733. }
  3734. result["startmass"] = f["getUint16"](f["offset"], true);
  3735. f["offset"] += 2;
  3736. images["maps"]["push"](result);
  3737. _0x4A99--;
  3738. }
  3739. }
  3740. $("#scrimmage-custom-btn-container")["css"]("display", images["maps"]["length"] == 0 ? "none" : "block");
  3741. $("#scrimmage-map")["empty"]();
  3742. rel = 0;
  3743. for (; rel < images["maps"]["length"]; rel++) {
  3744. $("#scrimmage-map")["append"]("<option value='" + rel + "'>" + images["maps"][rel]["name"] + "</option>");
  3745. }
  3746. };
  3747. Self.prototype["handleCustomGameUpdate"] = function(options) {
  3748. var _0x4AD5 = options["getUint8"](options["offset"]++);
  3749. switch(_0x4AD5) {
  3750. case style["MAP"]:
  3751. ScrimmageHelper["updateMap"](options["getUint8"](options["offset"]++));
  3752. break;
  3753. case style["MODE"]:
  3754. ScrimmageHelper["updateMode"](options["getUint8"](options["offset"]++));
  3755. break;
  3756. case style["SIZE"]:
  3757. ScrimmageHelper["updateSize"](options["getUint8"](options["offset"]++));
  3758. break;
  3759. case style["STARTMASS"]:
  3760. ScrimmageHelper["updateStartMass"](options["getUint16"](options["offset"], true));
  3761. options["offset"] += 2;
  3762. break;
  3763. case style["LOCK"]:
  3764. ScrimmageHelper["updateLock"](options["getUint8"](options["offset"]++) == 0 ? true : false);
  3765. break;
  3766. case style["PLAYER_UPGame"]:
  3767. var i = options["getUint8"](options["offset"]++);
  3768. var _0x4AF3 = options["getUint8"](options["offset"]++);
  3769. self["party"][i]["team"] = _0x4AF3;
  3770. ScrimmageHelper["updatePlayerById"](i);
  3771. break;
  3772. case style["PLAYER_LIST"]:
  3773. var _0x4A99 = options["getUint8"](options["offset"]++);
  3774. i = 0;
  3775. for (; _0x4A99 > 0;) {
  3776. self["party"][i]["team"] = options["getUint8"](options["offset"]++);
  3777. _0x4A99--;
  3778. i++;
  3779. }
  3780. ScrimmageHelper["updatePlayers"]();
  3781. break;
  3782. }
  3783. };
  3784. Self.prototype["handleCustomGameShow"] = function(options) {
  3785. $("#scrimmage-menu")["css"]("display", "none");
  3786. $("#scrimmage-custom")["css"]("display", "block");
  3787. var artistTrack = options["getUint8"](options["offset"]++);
  3788. var GET_AUTH_URL_TIMEOUT = options["getUint8"](options["offset"]++);
  3789. var numKeysDeleted = options["getUint8"](options["offset"]++);
  3790. var postDateGmt = options["getUint16"](options["offset"], true);
  3791. options["offset"] += 2;
  3792. var _maskLayer = options["getUint8"](options["offset"]++) == 0 ? true : false;
  3793. var _0x4A99 = options["getUint8"](options["offset"]++);
  3794. var i = 0;
  3795. for (; _0x4A99 > 0;) {
  3796. self["party"][i]["team"] = options["getUint8"](options["offset"]++);
  3797. _0x4A99--;
  3798. i++;
  3799. }
  3800. ScrimmageHelper["updateMap"](artistTrack);
  3801. ScrimmageHelper["updateMode"](GET_AUTH_URL_TIMEOUT);
  3802. ScrimmageHelper["updateSize"](numKeysDeleted);
  3803. ScrimmageHelper["updateStartMass"](postDateGmt);
  3804. ScrimmageHelper["updateLock"](_maskLayer);
  3805. ScrimmageHelper["updatePlayers"]();
  3806. ScrimmageHelper["checkLeader"]();
  3807. };
  3808. Self.prototype["handleCustomGameLeave"] = function() {
  3809. $("#scrimmage-custom")["css"]("display", "none");
  3810. $("#scrimmage-menu")["css"]("display", "block");
  3811. };
  3812. ScrimmageHelper = {
  3813. updateMap : function(target) {
  3814. $("#scrimmage-map option[value='" + target + "']")["prop"]("selected", true);
  3815. var result = images["maps"][target];
  3816. $("#scrimmage-mapmode")["empty"]();
  3817. var rel = 0;
  3818. for (; rel < result["modes"]["length"]; rel++) {
  3819. var osFamilies = images["modes"][result["modes"][rel]];
  3820. $("#scrimmage-mapmode")["append"]("<option value='" + rel + "'>" + osFamilies["name"] + "</option>");
  3821. }
  3822. $("#scrimmage-mapsize")["empty"]();
  3823. rel = 0;
  3824. for (; rel < result["sizes"]["length"]; rel++) {
  3825. var osFamilies = images["sizes"][result["sizes"][rel]];
  3826. $("#scrimmage-mapsize")["append"]("<option value='" + rel + "'>" + osFamilies["name"] + "</option>");
  3827. }
  3828. ScrimmageHelper["updateMode"](0);
  3829. ScrimmageHelper["updateSize"](0);
  3830. ScrimmageHelper["updateStartMass"](result["startmass"]);
  3831. $("#scrimmage-startmass")["attr"]("placeholder", result["startmass"]);
  3832. $("#scrimmage-map")["attr"]("data", target);
  3833. },
  3834. updateMode : function(rel) {
  3835. $("#scrimmage-mapmode option[value='" + rel + "']")["prop"]("selected", true);
  3836. $("#scrimmage-mapmode")["attr"]("data", rel);
  3837. },
  3838. updateSize : function(rel) {
  3839. $("#scrimmage-mapsize option[value='" + rel + "']")["prop"]("selected", true);
  3840. $("#scrimmage-mapsize")["attr"]("data", rel);
  3841. },
  3842. updateStartMass : function(mmCoreSplitViewBlock) {
  3843. $("#scrimmage-startmass")["val"](mmCoreSplitViewBlock);
  3844. $("#scrimmage-startmass")["attr"]("data", mmCoreSplitViewBlock);
  3845. },
  3846. updateLock : function(value) {
  3847. $("#scrimmage-lockteams")["prop"]("checked", value);
  3848. ScrimmageHelper["checkLock"]();
  3849. },
  3850. checkLock : function() {
  3851. if ($("#scrimmage-lockteams")["prop"]("checked") && !self["isPartyLeader"]()) {
  3852. $("#cgp-" + self["partyIndex"])["attr"]("disabled", "disabled");
  3853. } else {
  3854. $("#cgp-" + self["partyIndex"])["removeAttr"]("disabled");
  3855. }
  3856. },
  3857. checkLeader : function() {
  3858. if (self["isPartyLeader"]()) {
  3859. $(".custom-game")["removeAttr"]("disabled");
  3860. } else {
  3861. $(".custom-game")["attr"]("disabled", "disabled");
  3862. ScrimmageHelper["checkLock"]();
  3863. }
  3864. },
  3865. updatePlayerById : function(rel) {
  3866. var releases = self["party"][rel];
  3867. $("#cgp-" + rel + " option[value='" + releases["team"] + "']")["prop"]("selected", true);
  3868. $("#cgp-name-" + rel)["text"](releases["name"]);
  3869. $("#cgp-name-" + rel)["css"]("color", moodleReleases[releases["team"]]);
  3870. },
  3871. updatePlayers : function() {
  3872. $("#scrimmage-custom-players")["empty"]();
  3873. var type = 0;
  3874. for (; type < self["party"]["length"]; type++) {
  3875. var palette = self["party"][type];
  3876. if (palette["id"] == self["playerId"]) {
  3877. self["partyIndex"] = type;
  3878. }
  3879. $("#scrimmage-custom-players")["append"]("<tr><td><span id='cgp-name-" + type + "'>" + palette["name"] + "</span></td><td><select class='custom-game' id='cgp-" + type + "'><option value='0'>Spectator</option><option value='1' class='t1'>Blue</option><option value='2' class='t2'>Red</option></select></td></tr>");
  3880. $("#cgp-" + type + " option[value='" + palette["team"] + "']")["prop"]("selected", true);
  3881. $("#cgp-name-" + type)["css"]("color", moodleReleases[palette["team"]]);
  3882. $("#cgp-" + type)["on"]("change", function(canCreateDiscussions) {
  3883. var i = parseInt($(this)["attr"]("id")["match"]("\d+")[0]);
  3884. var _0x4AF3 = $(this)["find"]("option:selected")["val"]();
  3885. $("#cgp-" + type + " option[value='" + $(this)["attr"]("data") + "']")["prop"]("selected", true);
  3886. if (self["party"][i]["id"] == self["playerId"]) {
  3887. self["sendPacket"](new PaintTools["sendCustomGameUpdate"](style["PLAYER_UPGame_SELF"], 0, _0x4AF3));
  3888. } else {
  3889. self["sendPacket"](new PaintTools["sendCustomGameUpdate"](style["PLAYER_UPGame"], i, _0x4AF3));
  3890. }
  3891. });
  3892. }
  3893. ScrimmageHelper["checkLeader"]();
  3894. }
  3895. };
  3896. users.prototype["setType"] = function(canCreateDiscussions) {
  3897. this["type"] = canCreateDiscussions;
  3898. };
  3899. users.prototype["setX"] = function(canCreateDiscussions) {
  3900. this["x_"] = canCreateDiscussions;
  3901. this["x"] = canCreateDiscussions;
  3902. };
  3903. users.prototype["setY"] = function(canCreateDiscussions) {
  3904. this["y_"] = canCreateDiscussions;
  3905. this["y"] = canCreateDiscussions;
  3906. };
  3907. users.prototype["updateX"] = function(canCreateDiscussions) {
  3908. this["x_"] = canCreateDiscussions;
  3909. };
  3910. users.prototype["updateY"] = function(canCreateDiscussions) {
  3911. this["y_"] = canCreateDiscussions;
  3912. };
  3913. users.prototype["setSize"] = function(canCreateDiscussions) {
  3914. this["size_"] = canCreateDiscussions;
  3915. this["size"] = canCreateDiscussions;
  3916. };
  3917. users.prototype["getMass"] = function() {
  3918. return this["size"] * this["size"] / 100 >> 0;
  3919. };
  3920. users.prototype["getRealMass"] = function() {
  3921. return this["size_"] * this["size_"] / 100 >> 0;
  3922. };
  3923. users.prototype["animate"] = function(factor) {
  3924. this["x"] += Math["round"]((this["x_"] - this["x"]) * factor);
  3925. this["y"] += Math["round"]((this["y_"] - this["y"]) * factor);
  3926. this["size"] += Math["round"]((this["size_"] - this["size"]) * factor);
  3927. this["steps"]--;
  3928. };
  3929. users.prototype["getSizeCache"] = function() {
  3930. var popcornVideo;
  3931. if (this["cache"] == null || this["cache"]["canvas"] == null) {
  3932. popcornVideo = document["createElement"]("canvas");
  3933. this["cache"] = popcornVideo["getContext"]("2d");
  3934. } else {
  3935. popcornVideo = this["cache"]["canvas"];
  3936. }
  3937. var this_stream = this["getMass"]();
  3938. if (this_stream != this["massLastAmount"] || this["massLastAmount"] < 0) {
  3939. var artistTrack = this_stream["toString"]();
  3940. var val = 54;
  3941. var size_human = "bold 54pt Verdana";
  3942. this["cache"]["font"] = size_human;
  3943. popcornVideo["width"] = this["cache"]["measureText"](artistTrack)["width"] + 4;
  3944. popcornVideo["height"] = Math["floor"](val * 1.35);
  3945. this["cache"]["font"] = size_human;
  3946. this["cache"]["fillStyle"] = "#fff";
  3947. this["cache"]["fillText"](artistTrack, 2, val);
  3948. if (fields["cTextOutlines"] == true) {
  3949. this["cache"]["lineWidth"] = 2;
  3950. this["cache"]["strokeStyle"] = "#000";
  3951. this["cache"]["strokeText"](this_stream, 2, val);
  3952. }
  3953. this["massLastAmount"] = this_stream;
  3954. }
  3955. return popcornVideo;
  3956. };
  3957. users.prototype["getMaskCache"] = function(result) {
  3958. if (this["cache"] == null || this["cache"]["canvas"] == null) {
  3959. var popcornVideo = document["createElement"]("canvas");
  3960. this["cache"] = popcornVideo["getContext"]("2d");
  3961. popcornVideo["width"] = 64;
  3962. popcornVideo["height"] = 64;
  3963. this["cache"]["drawImage"](result ? model : lookup[this["skin"]], 0, 0, 64, 64);
  3964. this["cache"]["globalCompositeOperation"] = "source-in";
  3965. this["cache"]["fillStyle"] = this["color"];
  3966. this["cache"]["rect"](0, 0, 64, 64);
  3967. this["cache"]["fill"]();
  3968. }
  3969. return this["cache"]["canvas"];
  3970. };
  3971. users.prototype["draw"] = function(callbacks) {
  3972. switch(this["type"]) {
  3973. case 0:
  3974. break;
  3975. case 1:
  3976. if (this["skin"] >= 0 && this["skin"] < lookup["length"]) {
  3977. callbacks["drawImage"](this["getMaskCache"](), this["x"] - this["size"], this["y"] - this["size"], this["size"] * 2, this["size"] * 2);
  3978. } else {
  3979. if (meta["enabled"]) {
  3980. callbacks["drawImage"](this["getMaskCache"](true), this["x"] - this["size"], this["y"] - this["size"], this["size"] * 2, this["size"] * 2);
  3981. return;
  3982. }
  3983. callbacks["beginPath"]();
  3984. callbacks["arc"](this["x"], this["y"], this["size"], 0, par5);
  3985. callbacks["fillStyle"] = this["color"];
  3986. callbacks["fill"]();
  3987. }
  3988. break;
  3989. case 2:
  3990. var options = self["playerRegistry"]["getPlayerById"](this["playerId"]);
  3991. var minZ = extents["ALL"];
  3992. if (self["playerId"] == this["playerId"]) {
  3993. minZ = extents["SELF"];
  3994. } else {
  3995. if (self["partyIds"][this["playerId"]] != null) {
  3996. minZ = extents["PARTY"];
  3997. }
  3998. }
  3999. callbacks["beginPath"]();
  4000. callbacks["arc"](this["x"], this["y"], this["size"], 0, par5, false);
  4001. callbacks["globalAlpha"] = defaults["alpha"];
  4002. callbacks["fillStyle"] = options["cellColor"];
  4003. callbacks["closePath"]();
  4004. callbacks["fill"]();
  4005. if (options["skin"] != null && osFamilies["levelSkins"] >= minZ) {
  4006. var value = options["getSkin"]();
  4007. if (value != null && value["complete"] && value["width"] > 0) {
  4008. callbacks["save"]();
  4009. callbacks["clip"]();
  4010. try {
  4011. callbacks["drawImage"](value, this["x"] - this["size"], this["y"] - this["size"], this["size"] * 2, this["size"] * 2);
  4012. } catch (e) {
  4013. }
  4014. callbacks["restore"]();
  4015. }
  4016. }
  4017. if ((options["flags"] & 1) == 1) {
  4018. callbacks["beginPath"]();
  4019. callbacks["arc"](this["x"], this["y"], this["size"] + 16, 0, par5, false);
  4020. callbacks["strokeStyle"] = "#808080";
  4021. callbacks["lineWidth"] = 8;
  4022. callbacks["closePath"]();
  4023. callbacks["stroke"]();
  4024. }
  4025. callbacks["globalAlpha"] = 1;
  4026. var _0x4B2F = this["y"];
  4027. if (options["lowerName"] == true) {
  4028. _0x4B2F = _0x4B2F + Math["floor"](this["size"] / 2);
  4029. }
  4030. if (options["name"]["length"] > 0 && osFamilies["levelNames"] >= minZ) {
  4031. var result = options["getNameCache"]();
  4032. var factor = Math["max"](.00375 * this["size"], .3);
  4033. var width = result["width"] * factor;
  4034. var value = result["height"] * factor;
  4035. callbacks["drawImage"](result, this["x"] - Math["floor"](width / 2), _0x4B2F - Math["floor"](value / 2), width, value);
  4036. }
  4037. if (fields["cShowMass"] == true && minZ <= extents["PARTY"]) {
  4038. var result = this["getSizeCache"]();
  4039. factor = Math["max"](.00375 * this["size"], .3);
  4040. width = result["width"] * factor;
  4041. value = result["height"] * factor;
  4042. callbacks["drawImage"](result, this["x"] - Math["floor"](width / 2), _0x4B2F + Math["floor"](value / 2), width, value);
  4043. }
  4044. if ((options["flags"] & 4) == 4) {
  4045. var _0x4B89 = this["size"] + 16;
  4046. callbacks["drawImage"](node, this["x"] - _0x4B89, this["y"] - _0x4B89, _0x4B89 * 2, _0x4B89 * 2);
  4047. }
  4048. break;
  4049. case 3:
  4050. callbacks["globalAlpha"] = defaults["alpha"];
  4051. if (obj["complete"]) {
  4052. callbacks["drawImage"](obj, this["x"] - this["size"], this["y"] - this["size"], this["size"] * 2, this["size"] * 2);
  4053. } else {
  4054. callbacks["beginPath"]();
  4055. callbacks["arc"](this["x"], this["y"], this["size"], 0, 2 * Math["PI"], false);
  4056. callbacks["fillStyle"] = this["color"];
  4057. callbacks["fill"]();
  4058. }
  4059. callbacks["globalAlpha"] = 1;
  4060. break;
  4061. case 4:
  4062. callbacks["globalAlpha"] = defaults["alpha"];
  4063. if (b["complete"] && spike_mother_happy["complete"]) {
  4064. var artistTrack = this["size"] * 2;
  4065. if (this["size"] > 145) {
  4066. callbacks["drawImage"](spike_mother_happy, this["x"] - this["size"], this["y"] - this["size"], artistTrack, artistTrack);
  4067. } else {
  4068. callbacks["drawImage"](b, this["x"] - this["size"], this["y"] - this["size"], artistTrack, artistTrack);
  4069. }
  4070. if (!fields["cDisableEventSkins"] && meta["mother_addon"]["enabled"] && a["complete"]) {
  4071. callbacks["drawImage"](a, this["x"] - this["size"] * meta["mother_addon"]["x_offset"], this["y"] - this["size"] * meta["mother_addon"]["y_offset"], artistTrack * meta["mother_addon"]["x_offset"], artistTrack * meta["mother_addon"]["y_offset"]);
  4072. }
  4073. } else {
  4074. callbacks["beginPath"]();
  4075. callbacks["arc"](this["x"], this["y"], this["size"], 0, par5);
  4076. callbacks["fillStyle"] = this["color"];
  4077. callbacks["fill"]();
  4078. }
  4079. callbacks["globalAlpha"] = 1;
  4080. break;
  4081. case 5:
  4082. callbacks["globalAlpha"] = defaults["alpha"];
  4083. value = workers[this["buff"]]["img"];
  4084. if (value["complete"]) {
  4085. callbacks["drawImage"](value, this["x"] - this["size"], this["y"] - this["size"], 178, 178);
  4086. } else {
  4087. callbacks["beginPath"]();
  4088. callbacks["arc"](this["x"], this["y"], this["size"], 0, par5);
  4089. callbacks["fillStyle"] = "#fff";
  4090. callbacks["fill"]();
  4091. }
  4092. callbacks["globalAlpha"] = 1;
  4093. break;
  4094. }
  4095. };
  4096. users.prototype["drawFood"] = function(callbacks) {
  4097. callbacks["beginPath"]();
  4098. callbacks["arc"](this["x"], this["y"], 14, 0, par5);
  4099. callbacks["fillStyle"] = this["color"];
  4100. callbacks["fill"]();
  4101. };
  4102. Game.prototype["connectionStart"] = function () {
  4103. var n = "Gota Web " + version;
  4104. var buf = new ArrayBuffer(1 + n["length"] + 1 + 1);
  4105. var arr = new DataView(buf);
  4106. arr.setUint8(0, 255);
  4107. arr.setUint8(1, 6);
  4108. for(var i=0;i < n.length; i++) arr.setUint8(2 + i, n.charCodeAt(i));
  4109. arr.setUint8(n.length + 1, 0);
  4110. return buf;
  4111. };
  4112. Game.prototype["setName"] = function (selector) {
  4113. var ab = new ArrayBuffer(1 + 1 + (selector["length"] + 1) * 2);
  4114. var v = new DataView(ab);
  4115. v.setUint8(0, 0);
  4116. log(1, v, selector);
  4117. if (fields["cSilentLogin"]) {
  4118. v.setUint8(2 + selector["length"] * 2 + 1, 1);
  4119. }
  4120. return ab;
  4121. };
  4122. Game.prototype["sendKey"] = function (firstChild) {
  4123. var arrayBuffer = new ArrayBuffer(1);
  4124. var head = new DataView(arrayBuffer);
  4125. head.setUint8(0, firstChild);
  4126. return arrayBuffer;
  4127. };
  4128. Game.prototype["sendMouse"] = function (firstChild, rightFence) {
  4129. var arrayBuffer = new ArrayBuffer(5);
  4130. var head = new DataView(arrayBuffer);
  4131. head.setUint8(0, 16);
  4132. head.setInt16(1, firstChild, true);
  4133. head.setInt16(3, rightFence, true);
  4134. return arrayBuffer;
  4135. };
  4136. Game.prototype["sendPing"] = function () {
  4137. var pcmEncodedBuffer16k = new ArrayBuffer(1);
  4138. var dataView16k = new DataView(pcmEncodedBuffer16k);
  4139. dataView16k.setUint8(0, 71);
  4140. return pcmEncodedBuffer16k;
  4141. };
  4142. Game.prototype["sendSpectate"] = function (firstChild) {
  4143. var arrayBuffer = new ArrayBuffer(1 + 2);
  4144. var head = new DataView(arrayBuffer);
  4145. head.setUint8(0, 1);
  4146. if (firstChild) {
  4147. head["setUint16"](1, firstChild, true);
  4148. }
  4149. return arrayBuffer;
  4150. };
  4151. Game.prototype["sendChat"] = function (selector, value) {
  4152. var ab = new ArrayBuffer(1 + 1 + (selector["length"] + 1) * 2);
  4153. var view = new DataView(ab);
  4154. view.setUint8(0, 72);
  4155. view.setUint8(1, value);
  4156. log(2, view, selector);
  4157. return ab;
  4158. };
  4159. Game.prototype["sendLogin"] = function (i, n, hash) {
  4160. var buf = new ArrayBuffer(1 + 2 + n["length"] + hash["length"]);
  4161. var arr = new DataView(buf);
  4162. arr.setUint8(0, i);
  4163. for(var i=0;i < n.length; i++) arr.setUint8(1 + i, arr.charCodeAt(i));
  4164. arr.setUint8(n.length + 1, 0);
  4165. cb(2 + n["length"], arr, hash);
  4166. return buf;
  4167. };
  4168. Game.prototype["sendInviteResponse"] = function (old) {
  4169. var value = new ArrayBuffer(2);
  4170. var t = new DataView(value);
  4171. t.setUint8(0, 41);
  4172. t.setUint8(1, old ? 1 : 0);
  4173. return value;
  4174. };
  4175. Game.prototype["sendPartyAction"] = function (firstChild, rightFence) {
  4176. var arrayBuffer = new ArrayBuffer(6);
  4177. var head = new DataView(arrayBuffer);
  4178. head.setUint8(0, 40);
  4179. head.setUint8(1, firstChild);
  4180. head["setUint32"](2, rightFence, true);
  4181. return arrayBuffer;
  4182. };
  4183. Game.prototype["sendPartyJoin"] = function (n) {
  4184. var buf = new ArrayBuffer(1 + n["length"] + 1);
  4185. var arr = new DataView(buf);
  4186. arr.setUint8(0, 42);
  4187. for(var i=0;i < n.length; i++) arr.setUint8(1 + i, arr.charCodeAt(i));
  4188. arr.setUint8(n.length + 1, 0);
  4189. return buf;
  4190. };
  4191. Game.prototype["sendWhisper"] = function (value, selector) {
  4192. var ab = new ArrayBuffer(5 + (selector["length"] + 1) * 2);
  4193. var view = new DataView(ab);
  4194. view.setUint8(0, 73);
  4195. view["setUint32"](1, value, true);
  4196. log(5, view, selector);
  4197. return ab;
  4198. };
  4199. Game.prototype["sendSubPanel"] = function () {
  4200. var buf = new ArrayBuffer(1 + 6 + (result["skinName"]["length"] + 1) + (result["lockedName"]["length"] + 1));
  4201. var arr = new DataView(buf);
  4202. arr.setUint8(0, 10);
  4203. arr.setUint8(1, result["nameColor"]["r"]);
  4204. arr.setUint8(2, result["nameColor"]["g"]);
  4205. arr.setUint8(3, result["nameColor"]["b"]);
  4206. arr.setUint8(4, result["chatColor"]);
  4207. arr.setUint8(5, result["effect"]);
  4208. arr.setUint8(6, result["lowerName"] ? 1 : 0);
  4209. cb(7, arr, result["skinName"]);
  4210. cb(8 + result["skinName"]["length"], arr, result["lockedName"]);
  4211. return buf;
  4212. };
  4213. Game.prototype["sendQueue"] = function (firstChild) {
  4214. var arrayBuffer = new ArrayBuffer(1 + 4);
  4215. var head = new DataView(arrayBuffer);
  4216. head.setUint8(0, 80);
  4217. head.setUint8(1, firstChild);
  4218. head.setUint8(2, 0);
  4219. head["setUint16"](3, 0);
  4220. return arrayBuffer;
  4221. };
  4222. Game.prototype["sendCustomGame"] = function (firstChild) {
  4223. var arrayBuffer = new ArrayBuffer(1 + 1);
  4224. var head = new DataView(arrayBuffer);
  4225. head.setUint8(0, 90);
  4226. head.setUint8(1, firstChild);
  4227. return arrayBuffer;
  4228. };
  4229. Game.prototype["sendLeaveMatch"] = function () {
  4230. var pcmEncodedBuffer16k = new ArrayBuffer(1);
  4231. var dataView16k = new DataView(pcmEncodedBuffer16k);
  4232. dataView16k.setUint8(0, 81);
  4233. return pcmEncodedBuffer16k;
  4234. };
  4235. Game.prototype["sendCaptcha"] = function (n) {
  4236. var buf = new ArrayBuffer(1 + (n["length"] + 1));
  4237. var arr = new DataView(buf);
  4238. arr.setUint8(0, 100);
  4239. for(var i=0;i < n.length; i++) arr.setUint8(1 + i, arr.charCodeAt(i));
  4240. arr.setUint8(n.length + 1, 0);
  4241. return buf;
  4242. };
  4243. Game.prototype["sendAuthToken"] = function (n) {
  4244. var buf = new ArrayBuffer(1 + (n["length"] + 1));
  4245. var arr = new DataView(buf);
  4246. arr.setUint8(0, 101);
  4247. for(var i=0;i < n.length; i++) arr.setUint8(1 + i, arr.charCodeAt(i));
  4248. arr.setUint8(n.length + 1, 0);
  4249. return buf;
  4250. };
  4251. Game.prototype["sendCustomGameUpdate"] = function (newBg, firstChild, rightFence) {
  4252. var arrayBuffer = new ArrayBuffer(1 + 3);
  4253. var head = new DataView(arrayBuffer);
  4254. head.setUint8(0, 91);
  4255. head.setUint8(1, newBg);
  4256. if (newBg != style["STARTMASS"]) {
  4257. head.setUint8(2, firstChild);
  4258. head.setUint8(3, rightFence);
  4259. } else {
  4260. head["setUint16"](2, firstChild, false);
  4261. }
  4262. return arrayBuffer;
  4263. };
  4264. var x = {
  4265. "cHideId" : function() {
  4266. var artistTrack = fields["cHideId"] ? "none" : "block";
  4267. $(".pID")["css"]("display", artistTrack);
  4268. },
  4269. "cHideServerDisplay" : function() {
  4270. var artistTrack = fields["cHideServerDisplay"] ? "none" : "block";
  4271. $(".psvr")["css"]("display", artistTrack);
  4272. },
  4273. "cTransCells" : function() {
  4274. defaults["alpha"] = fields["cTransCells"] ? .5 : 1;
  4275. },
  4276. "cHideChat" : function() {
  4277. var artistTrack = fields["cHideChat"] ? "none" : "block";
  4278. $("#chat-panel")["css"]("display", artistTrack);
  4279. },
  4280. "cHideMinimap" : function() {
  4281. var artistTrack = fields["cHideMinimap"] ? "none" : "block";
  4282. $("#minimap-panel")["css"]("display", artistTrack);
  4283. },
  4284. "cShowCoordinates" : function() {
  4285. var artistTrack = fields["cShowCoordinates"] ? "block" : "none";
  4286. $(".coordinates")["css"]("display", artistTrack);
  4287. makeTimeoutHandler();
  4288. },
  4289. "cDisableAutoZoom" : function() {
  4290. if (fields["cDisableAutoZoom"]) {
  4291. self["scale_base"] = .25 * Math["max"](popcornVideo["height"] / 1080, popcornVideo["width"] / 1920);
  4292. }
  4293. },
  4294. "cUiEnabled" : updateSubmitButton,
  4295. "cDisableEventSkins" : function() {
  4296. if (meta["enabled"]) {
  4297. $("body")["toggleClass"]("event-" + meta["key"]);
  4298. }
  4299. shift();
  4300. rebuildAttributes();
  4301. },
  4302. "cResizableChat" : function() {
  4303. $("#chat-resize")["css"]("display", fields["cResizableChat"] ? "block" : "none");
  4304. },
  4305. "sShowNames" : function() {
  4306. osFamilies["levelNames"] = extents[fields["sShowNames"]];
  4307. },
  4308. "sShowSkins" : function() {
  4309. osFamilies["levelSkins"] = extents[fields["sShowSkins"]];
  4310. },
  4311. "sQuality" : function() {
  4312. scale = dest[fields["sQuality"]];
  4313. update_measurements();
  4314. }
  4315. };
  4316. var getListed = function(params) {
  4317. var validate = this["cloneNode"]();
  4318. validate["getContext"]("2d")["drawImage"](this, 0, 0);
  4319. callback(params, validate, this["dataset"]["playerId"], -1);
  4320. };
  4321. var loadStencil = function(result) {
  4322. var value = result["offsetY"];
  4323. var i = Math["floor"](value / 20);
  4324. if (value % 20 < 5) {
  4325. return;
  4326. }
  4327. var object = self["party"][i];
  4328. if (object == null) {
  4329. return;
  4330. }
  4331. var l = extend(object["name"], "#fff");
  4332. callback(result, l, object["id"], i);
  4333. };
  4334. const $baseDefinition = {
  4335. MODIFIER : 1,
  4336. PASSIVE : 2,
  4337. CONSUMABLE : 3,
  4338. DEBUFF : 4,
  4339. NONE : 0
  4340. };
  4341. var node;
  4342. var workers = {
  4343. 0 : new Module("Random", "random", $baseDefinition["NONE"]),
  4344. 1 : new Module("Maximum Cells Upgrade", "extracells", $baseDefinition["MODIFIER"]),
  4345. 2 : new Module("Extra Consumable Slot", "extraconsumable", $baseDefinition["MODIFIER"]),
  4346. 3 : new Module("Merge", "merge", $baseDefinition["PASSIVE"]),
  4347. 4 : new Module("Grow", "grow", $baseDefinition["PASSIVE"]),
  4348. 5 : new Module("Speed", "speed", $baseDefinition["PASSIVE"]),
  4349. 6 : new Module("Guard", "guard", $baseDefinition["PASSIVE"]),
  4350. 7 : new Module("Virus", "spike", $baseDefinition["CONSUMABLE"]),
  4351. 8 : new Module("Disrupt", "disrupt", $baseDefinition["CONSUMABLE"]),
  4352. 9 : new Module("Teleport", "teleport", $baseDefinition["CONSUMABLE"]),
  4353. 10 : new Module("Disrupt", "_disrupt", $baseDefinition["DEBUFF"])
  4354. };
  4355. const headers = Math["PI"] * 1.5;
  4356. var selector = [];
  4357. var offset = 0;
  4358. for (; offset < 180; offset++) {
  4359. var obj = tinycolor({
  4360. h : offset * 2,
  4361. s : 97.25,
  4362. v : 100
  4363. });
  4364. selector[offset] = obj["toHexString"]();
  4365. }
  4366. const f = randomMoment(selector["slice"](0));
  4367. if (meta["enabled"] && meta["foodColors"]) {
  4368. format = function(utc_offset) {
  4369. return meta["foodColors"][utc_offset % meta["foodColors"]["length"]];
  4370. };
  4371. }
  4372. const _0x584F = ["#FF0000", "#FF2000", "#FF4000", "#FF6000", "#FF8000", "#FFA000", "#FFC000", "#FFE000", "#FFFF00", "#C0FF00", "#80FF00", "#40FF00", "#00FF00", "#00CF40", "#008080", "#0020C0", "#0000FF", "#1200C0", "#250080", "#380040", "#4B0082", "#5C00A1", "#6D00C0", "#7E00DF", "#8F00E1", "#AB00C0", "#C70080", "#E30040"];
  4373. const palette = ["#FFFFFF", "#FF9BDC", "#FF00FF", "#FF0000", "#C80000", "#FF6900", "#FFFF00", "#00FF00", "#008000", "#008080", "#00FFFF", "#0096FF", "#0000FF", "#CA48FA", "#8A2BE2", "#D2C878", "#8C4614"];
  4374. const target = {
  4375. whisper : {
  4376. description : "Whisper a player by ID",
  4377. triggers : ["whisper", "t", "w"],
  4378. action : function(params) {
  4379. var rel = parseInt(params[0]);
  4380. if (isNaN(rel)) {
  4381. self["selfMsg"]("Invalid player id.");
  4382. return;
  4383. }
  4384. var location_feature_ids = params["slice"](1)["join"](" ");
  4385. if (location_feature_ids["length"] != 0) {
  4386. self["sendPacket"](new PaintTools["sendWhisper"](rel, location_feature_ids));
  4387. }
  4388. $get("/t " + rel + " ");
  4389. }
  4390. },
  4391. reply_whisper : {
  4392. description : "Reply to previous whisper",
  4393. triggers : ["reply", "r"],
  4394. action : function(options) {
  4395. var location_feature_ids = options["join"](" ");
  4396. if (location_feature_ids["length"] != 0) {
  4397. self["sendPacket"](new PaintTools["sendWhisper"](0, location_feature_ids));
  4398. }
  4399. $get("/r ");
  4400. }
  4401. },
  4402. party_chat : {
  4403. description : "Send a message to other party members",
  4404. triggers : ["party", "p"],
  4405. action : function(options) {
  4406. var _self = options["join"](" ");
  4407. if (_self["length"] != 0) {
  4408. self["sendPacket"](new PaintTools["sendChat"](_self, 1));
  4409. }
  4410. $get("/p ");
  4411. }
  4412. },
  4413. invite : {
  4414. description : "Invite a player to the party",
  4415. triggers : ["invite", "i"],
  4416. action : function(feature) {
  4417. var normalized_images = parseInt(feature[0]);
  4418. if (!isNaN(normalized_images)) {
  4419. self["sendPacket"](new PaintTools["sendPartyAction"](0, normalized_images));
  4420. } else {
  4421. self["selfMsg"]("Invalid ID.");
  4422. }
  4423. }
  4424. },
  4425. leave : {
  4426. description : "Leave your current party",
  4427. triggers : ["leave", "l"],
  4428. action : function($back) {
  4429. self["sendPacket"](new PaintTools["sendPartyAction"](3, 0));
  4430. }
  4431. },
  4432. promote : {
  4433. description : "Promote a party member to leader",
  4434. triggers : ["promote"],
  4435. action : function(feature) {
  4436. var normalized_images = parseInt(feature[0]);
  4437. if (!isNaN(normalized_images)) {
  4438. self["sendPacket"](new PaintTools["sendPartyAction"](2, normalized_images));
  4439. } else {
  4440. self["selfMsg"]("Invalid ID.");
  4441. }
  4442. }
  4443. },
  4444. kick : {
  4445. description : "Kick a player from the party",
  4446. triggers : ["kick"],
  4447. action : function(feature) {
  4448. var normalized_images = parseInt(feature[0]);
  4449. if (!isNaN(normalized_images)) {
  4450. self["sendPacket"](new PaintTools["sendPartyAction"](1, normalized_images));
  4451. } else {
  4452. self["selfMsg"]("Invalid ID.");
  4453. }
  4454. }
  4455. },
  4456. clear : {
  4457. description : "Clear the chat",
  4458. triggers : ["clear"],
  4459. action : function($back) {
  4460. var item = document["getElementById"]("chat-body");
  4461. for (; item["firstChild"] != null;) {
  4462. item["removeChild"](item["firstChild"]);
  4463. }
  4464. }
  4465. },
  4466. info : {
  4467. description : "Get your current ID",
  4468. triggers : ["info"],
  4469. action : function($back) {
  4470. if (self["playerId"] > 0) {
  4471. self["selfMsg"]("Your id is " + self["playerId"]);
  4472. } else {
  4473. self["selfMsg"]("You need to be connected to a server to use this command.");
  4474. }
  4475. }
  4476. },
  4477. scrimmenu : {
  4478. description : "Show the scrimmage menu",
  4479. triggers : ["scrimmenu"],
  4480. action : function($back) {
  4481. extendedRegExp["css"]("display", extendedRegExp["css"]("display") == "none" ? "block" : "none");
  4482. }
  4483. },
  4484. join : {
  4485. description : "Join a party with a code",
  4486. triggers : ["join", "j"],
  4487. action : function(values) {
  4488. var users = values[0];
  4489. if (users != null && users["length"] != 0) {
  4490. self["sendPacket"](new PaintTools["sendPartyJoin"](users));
  4491. }
  4492. }
  4493. },
  4494. private : {
  4495. description : "Set the party to private",
  4496. triggers : ["private"],
  4497. action : function($back) {
  4498. self["sendPacket"](new PaintTools["sendPartyAction"](4, 1));
  4499. }
  4500. },
  4501. public : {
  4502. description : "Allow players to join the party without an invite",
  4503. triggers : ["public"],
  4504. action : function($back) {
  4505. self["sendPacket"](new PaintTools["sendPartyAction"](4, 0));
  4506. }
  4507. },
  4508. dnsbl : {
  4509. description : "Check if you are on a public blacklist",
  4510. triggers : ["dnsbl"],
  4511. action : function($back) {
  4512. jQuery["ajax"]({
  4513. type : "GET",
  4514. dataType : "json",
  4515. url : "https://gota.io/api/dnsbl",
  4516. success : function(effects) {
  4517. self["selfMsg"]("DNSBL: " + effects["message"]);
  4518. },
  4519. error : function(deleted_model) {
  4520. self["selfMsg"]("Error while checking DNSBL");
  4521. }
  4522. });
  4523. }
  4524. },
  4525. reset_chat : {
  4526. description : "Reset chat size",
  4527. triggers : ["resetchat"],
  4528. action : function($back) {
  4529. $("#chat-panel")["css"]("width", "360px");
  4530. $("#chat-panel")["css"]("height", "250px");
  4531. }
  4532. },
  4533. spectate : {
  4534. description : "Spectate a player",
  4535. triggers : ["spectate", "s"],
  4536. action : function(feature) {
  4537. var normalized_images = parseInt(feature[0]);
  4538. if (!isNaN(normalized_images)) {
  4539. self["sendPacket"](new PaintTools["sendSpectate"](normalized_images));
  4540. } else {
  4541. self["selfMsg"]("Invalid ID.");
  4542. }
  4543. }
  4544. },
  4545. disconnect : {
  4546. description : "Disconnect from the server",
  4547. triggers : ["disconnect"],
  4548. action : function($back) {
  4549. self["disconnect"]();
  4550. }
  4551. },
  4552. account : {
  4553. description : "Get Account UID",
  4554. triggers : ["account"],
  4555. action : function($back) {
  4556. if (expected === null) {
  4557. self["selfMsg"]("You are not logged in.");
  4558. return;
  4559. }
  4560. self["selfMsg"]("UID: " + expected["uid"]);
  4561. }
  4562. },
  4563. block : {
  4564. description : "Block or unblock a player by ID",
  4565. triggers : ["block", "b"],
  4566. action : function(feature) {
  4567. var level = parseInt(feature[0]);
  4568. if (!isNaN(level)) {
  4569. var item = getByProp(level);
  4570. self["selfMsg"](item);
  4571. }
  4572. }
  4573. }
  4574. };
  4575. const _tabInfo = ["4Head", "BibleThump", "DansGame", "DatSheffy", "FailFish", "FeelsBadMan", "FeelsGoodMan", "FeelsMadMan", "GabeN", "HassanChop", "HeyGuys", "Kappa", "KappaPride", "Keepo", "Kreygasm", "NotLikeThis", "OMGScoots", "PJSalt", "PogChamp", "rekt", "rip", "SaltyCorn", "sodaC", "sodaHeyGuys", "sodaNOPE", "sodaW", "sodaWut", "SwiftRage", "WutFace", "ResidentSleeper", "LUL", "MikuFail", "PepoHype", "KKona", "MeguFace", "AngryBork", "AngeryBOYE", "TohruFlex", "Sadness", "nou",
  4576. "MarioFP"];
  4577. const blocks = ["Ditto", "MichaelPls", "RareParrot", "PepePls", "RooNoticeMe", "PepeEyes", "EverythingsFine", "WeSmart", "PandaAww", "SleepyCat", "Clap"];
  4578. const byteToHex = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"];
  4579. const tablx = ["", "", "", "CANCEL", "", "", "HELP", "", "BACK_SPACE", "TAB", "", "", "CLEAR", "ENTER", "ENTER_SPECIAL", "", "SHIFT", "CONTROL", "ALT", "PAUSE", "CAPS_LOCK", "KANA", "EISU", "JUNJA", "FINAL", "HANJA", "", "ESCAPE", "CONVERT", "NONCONVERT", "ACCEPT", "MODECHANGE", "SPACE", "PAGE_UP", "PAGE_DOWN", "END", "HOME", "LEFT", "UP", "RIGHT", "DOWN", "SELECT", "PRINT",
  4580. "EXECUTE", "PRINTSCREEN", "INSERT", "DELETE", "", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ":", ";", "<", "=", ">", "?", "AT", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U",
  4581. "V", "W", "X", "Y", "Z", "OS_KEY", "", "CONTEXT_MENU", "", "SLEEP", "NUMPAD0", "NUMPAD1", "NUMPAD2", "NUMPAD3", "NUMPAD4", "NUMPAD5", "NUMPAD6", "NUMPAD7", "NUMPAD8", "NUMPAD9", "MULTIPLY", "ADD", "SEPARATOR", "SUBTRACT", "DECIMAL", "DIVIDE", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12", "F13", "F14", "F15", "F16",
  4582. "F17", "F18", "F19", "F20", "F21", "F22", "F23", "F24", "", "", "", "", "", "", "", "", "NUM_LOCK", "SCROLL_LOCK", "WIN_OEM_FJ_JISHO", "WIN_OEM_FJ_MASSHOU", "WIN_OEM_FJ_TOUROKU", "WIN_OEM_FJ_LOYA", "WIN_OEM_FJ_ROYA", "", "", "", "", "", "", "", "", "", "CIRCUMFLEX", "EXCLAMATION", "DOUBLE_QUOTE", "HASH", "DOLLAR", "PERCENT", "AMPERSAND", "UNDERSCORE", "OPEN_PAREN", "CLOSE_PAREN", "ASTERISK", "PLUS", "PIPE", "HYPHEN_MINUS",
  4583. "OPEN_CURLY_BRACKET", "CLOSE_CURLY_BRACKET", "TILDE", "", "", "", "", "VOLUME_MUTE", "VOLUME_DOWN", "VOLUME_UP", "", "", "SEMICOLON", "EQUALS", "COMMA", "MINUS", "PERIOD", "SLASH", "BACK_QUOTE", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "OPEN_BRACKET", "BACK_SLASH", "CLOSE_BRACKET", "QUOTE", "",
  4584. "META", "ALTGR", "", "WIN_ICO_HELP", "WIN_ICO_00", "", "WIN_ICO_CLEAR", "", "", "WIN_OEM_RESET", "WIN_OEM_JUMP", "WIN_OEM_PA1", "WIN_OEM_PA2", "WIN_OEM_PA3", "WIN_OEM_WSCTRL", "WIN_OEM_CUSEL", "WIN_OEM_ATTN", "WIN_OEM_FINISH", "WIN_OEM_COPY", "WIN_OEM_AUTO", "WIN_OEM_ENLW", "WIN_OEM_BACKTAB", "ATTN", "CRSEL", "EXSEL", "EREOF", "PLAY", "ZOOM", "", "PA1", "WIN_OEM_CLEAR", ""];
  4585. var lookup = ["heart", "star", "home", "apple", "spiral", "dice", "chicken", "ghost", "burger", "bow", "cloud", "skull", "mug", "flower", "music"];
  4586. var model = null;
  4587. const command = -32768;
  4588. const extents = {
  4589. ALL : 3,
  4590. PARTY : 2,
  4591. SELF : 1,
  4592. NONE : 0
  4593. };
  4594. const dest = {
  4595. ULTRA : 1,
  4596. HIGH : .8,
  4597. MEDIUM : .7,
  4598. LOW : .6,
  4599. VERYLOW : .5
  4600. };
  4601. const style = {
  4602. MAP : 0,
  4603. MODE : 1,
  4604. SIZE : 2,
  4605. STARTMASS : 3,
  4606. LOCK : 4,
  4607. PLAYER_UPGame : 5,
  4608. PLAYER_UPGame_SELF : 6,
  4609. PLAYER_LIST : 7
  4610. };
  4611. const generatedSeries = {
  4612. FAILURE : 1,
  4613. SUCCESS : 0
  4614. };
  4615. var moodleReleases = ["white", "#25f", "#f31", "green", "yellow", "purple", "orange"];
  4616. var p_extl = new Promise;
  4617. window["onCaptchaSubmit"] = function testGulpPlugin(callback) {
  4618. self["sendPacket"](new PaintTools["sendCaptcha"](callback));
  4619. $("#recaptcha")["css"]("display", "none");
  4620. grecaptcha["reset"]();
  4621. if (!self["spectate"]) {
  4622. self["play"]();
  4623. } else {
  4624. self["spec"]();
  4625. }
  4626. };
  4627. parseUriConfig();
  4628. refresh();
  4629. };
  4630.  
  4631. showSideMenu = f;
  4632. hideSideMenu = startUpload;
  4633. func("gota.io", 1, "");
  4634. version = "2.1.9";
  4635. $(exports);
  4636. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement